Fixed a bug in list pop, again.
[cantaveria.git] / graphics.h
blob749e210e82f45c9b9b64c39d860bcf152c0f69ff
1 /*
2 Cantaveria - action adventure platform game
3 Copyright (C) 2009 2010 Evan Rinehart
5 This program is free software; you can redistribute it and/or
6 modify it under the terms of the GNU General Public License
7 as published by the Free Software Foundation; either version 2
8 of the License, or (at your option) any later version.
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to
18 The Free Software Foundation, Inc.
19 51 Franklin Street, Fifth Floor
20 Boston, MA 02110-1301, USA
22 #define MAX_SPRITES 256
23 #define MAX_ANIMATIONS 256
25 struct frame{
26 int x, y;
27 double x0, y0, x1, y1;
30 typedef struct sprite sprite;
31 struct sprite {
32 int number;
33 int frame_counter;
34 int current_frame;
35 struct frame frame;
36 int gfxid;
37 int anim;
38 int x, y, w, h;
41 typedef struct {
42 int w, h;
43 int loop_mode;/*0 stopped, 1 once, 2 repeat, 3 pingpong, 4 evaporate*/
44 int gfxid;
45 int frame_count;
46 short* frame_lens;
47 struct frame* frames;
48 } animation;
50 void graphics_init();
52 void draw_final();
53 void draw_sprites();
54 void draw_stage();
57 int load_sprite(char* filename, int id);
58 int load_font(char* filename);
60 int load_bitmap(char* filename);
61 void draw_bitmap(int id, int x, int y);
63 sprite* enable_sprite(int sprnum);
64 void disable_sprite(sprite* spr);
65 sprite* copy_sprite(sprite* spr);
66 void point_camera(int x, int y);
68 void draw_small_text(char* str, int x, int y);
69 void printf_small(int x, int y, char* format, ...);
72 void set_message(char* str);
73 void advance_message();
74 void clear_message();
75 void complete_message();
77 void reposition_message(int x, int y);
78 void resize_message(int w, int h);
80 void animate_sprites();
83 void enable_stage(int yn);