#ifndef render_h #define render_h #include "config.h" #include "rect.h" #include "memory.h" typedef struct { unsigned char r, g, b, a; } Colour; Colour make_colour(unsigned rgb, unsigned char a); Colour make_black(); Colour make_white(); typedef struct Bitmap { Colour* pixels; int w, h; } Bitmap; void init_bitmap( Bitmap* bitmap, Colour* pixels, int w, int h ); #define max_glyphset 256 struct Font; typedef struct Font Font; int font_height(Font* f); void get_font_rect( const Font* font, Rectangle* dst, char c ); Font* new_font( Heap* h, const unsigned char* raw, int size ); Rectangle text_rect(Font* font, const char* text); void rfont_text( Font* font, int x, int y, const char* text ); void rfont_text_col( Font* font, int x, int y, const char* text, Colour colour ); void render_init(void); void render_begin(void); void render_clear(void); void render_clear_col(Colour col); void render_clip(const Rectangle* rect); void render_reset_clip(void); Colour blend(Colour dst, Colour src); Colour blend_mod(Colour dst, Colour src, Colour mod); Colour* get_render_pixels(void); extern int sprite_camera_x; extern int sprite_camera_y; void render_bitmap( const Bitmap* bitmap, int x, int y, const Rectangle* rect ); void render_bitmap_col( const Bitmap* bitmap, int x, int y, const Rectangle* rect, Colour colour ); void render_rect( const Rectangle* rect, Colour colour ); void render_mask( const unsigned char* pixels, int x, int y, int w, int h, const Rectangle* rect, Colour colour ); void rcopy( Bitmap* dst, const Bitmap* src, int x, int y, const Rectangle* rect ); void rcopy_col( Bitmap* dst, const Bitmap* src, int x, int y, const Rectangle* rect, Colour colour ); void rcopy_ac( Bitmap* dst, const Bitmap* src, int x, int y, const Rectangle* rect, unsigned char t ); void rcopy_rect( Bitmap* dst, const Rectangle* rect, Colour colour ); #endif