Many changes. Stage collision algorithm.
[cantaveria.git] / graphics.h
blob5edb65fe1aed26c8c58a93ac1e3165324898550f
1 #define MAX_SPRITES 256
2 #define MAX_ANIMATIONS 256
4 struct frame{
5 int x, y;
6 double x0, y0, x1, y1;
7 };
9 typedef struct sprite sprite;
10 struct sprite {
11 int number;
12 int frame_counter;
13 int current_frame;
14 struct frame frame;
15 int gfxid;
16 int anim;
17 int x, y, w, h;
18 //void (*update)(sprite*, void* ud);
19 //void* userdata;
22 typedef struct {
23 int w, h;
24 int loop_mode;/*0 stopped, 1 once, 2 repeat, 3 pingpong, 4 evaporate*/
25 int gfxid;
26 int frame_count;
27 short* frame_lens;
28 struct frame* frames;
29 } animation;
31 void graphics_init();
33 void draw();
34 void draw_sprites();
35 void draw_stage();
38 int load_sprite(char* filename, int id);
39 int load_font(char* filename);
40 sprite* enable_sprite(int sprnum);
41 void disable_sprite(sprite* spr);
42 sprite* copy_sprite(sprite* spr);
43 void point_camera(int x, int y);
45 void draw_small_text(char* str, int x, int y);
46 void printf_small(int x, int y, char* format, ...);
49 void set_message(char* str);
50 void advance_message();
51 void clear_message();
52 void complete_message();
54 void reposition_message(int x, int y);
55 void resize_message(int w, int h);
57 void animate_sprites();
60 void enable_stage(int yn);