2 Cantaveria - action adventure platform game
3 Copyright (C) 2009 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
65 #define JOY_MIN -32768
70 #define DELAY_AMOUNT 1
76 #define MAX_SPRITES 256
77 #define MAX_ANIMATIONS 256
79 #define COLOR_KEY 0x000000
82 #define SAMPLE_RATE 44100
83 #define BUFFER_SIZE 1024
87 double x0
, y0
, x1
, y1
;
90 typedef struct sprite sprite
;
98 int x
, y
, w
, h
, vx
, vy
;
99 void (*update
)(sprite
*, void* ud
);
105 int loop_mode
;/*0 stopped, 1 once, 2 repeat, 3 pingpong, 4 evaporate*/
109 struct frame
* frames
;
114 void backend_init(int argc
, char* argv
[]);
117 void input(); /* pump event system */
118 void draw(); /* draw all active graphics */
121 int since(); /* ms since last time since() was called */
122 void delay(int ms
); /* wait ms ms */
124 int keynum(int name
); /* get key number for key name */
125 int butnum(int joy
, int name
); /* get button number for button name */
126 void control(int type
, int par1
, int par2
); /* automatic control */
128 int load_gfx(char* filename
);
129 int load_sprite(char* filename
, int id
);
130 sprite
* enable_sprite(int sprnum
);
131 void disable_sprite(sprite
* spr
);
132 sprite
* copy_sprite(sprite
* spr
);
135 int load_sound(char* filename
);
136 void play_sound(int id
);
137 int load_music(char* filename
);
138 int play_music(int id
);
141 void load_map(char* filename
);
144 void point_camera(int x
, int y
);
146 void animate_sprites();