Merge branch 'master' of github.com:laochailan/taisei

This commit is contained in:
laochailan 2012-08-10 22:17:59 +02:00
commit fa973116a3
64 changed files with 194 additions and 195 deletions

View file

@ -46,7 +46,7 @@ ConfigEntry* config_findentry(char *name) {
return NULL;
}
void config_preset() {
void config_preset(void) {
memset(tconfig.strval, 0, sizeof(tconfig.strval));
tconfig.intval[KEY_UP] = SDLK_UP;
@ -108,19 +108,19 @@ FILE* config_open(char *filename, char *mode) {
return out;
}
inline int config_intval_p(ConfigEntry *e) {
int config_intval_p(ConfigEntry *e) {
return tconfig.intval[e->key];
}
inline char* config_strval_p(ConfigEntry *e) {
char* config_strval_p(ConfigEntry *e) {
return tconfig.strval[e->key];
}
inline int config_intval(char *key) {
int config_intval(char *key) {
return config_intval_p(config_findentry(key));
}
inline char* config_strval(char *key) {
char* config_strval(char *key) {
return config_strval_p(config_findentry(key));
}

View file

@ -72,14 +72,14 @@ Config tconfig;
#define CONFIG_LOAD_BUFSIZE 256
int config_sym2key(int sym);
void config_preset();
void config_preset(void);
void config_load(char *filename);
void config_save(char *filename);
ConfigEntry* config_findentry(char *name);
inline int config_intval(char*);
inline int config_intval_p(ConfigEntry*);
inline char* config_strval(char*);
inline char* config_strval_p(ConfigEntry*);
int config_intval(char*);
int config_intval_p(ConfigEntry*);
char* config_strval(char*);
char* config_strval_p(ConfigEntry*);
#endif

View file

@ -18,7 +18,7 @@
Global global;
void init_global() {
void init_global(void) {
memset(&global, 0, sizeof(global));
tsrand_seed_p(&global.rand_game, time(0));
@ -36,7 +36,7 @@ void init_global() {
SDL_EnableKeyRepeat(TS_KR_DELAY, TS_KR_INTERVAL);
}
void print_state_checksum() {
void print_state_checksum(void) {
int plr, spos = 0, smisc = 0, sargs = 0, proj = 0;
Player *p = &global.plr;
Enemy *s;
@ -94,7 +94,7 @@ void calc_fps(FPSCounter *fps) {
fps->stagebg_fps = approach(fps->stagebg_fps, fps->show_fps, 0.1);
}
void set_ortho() {
void set_ortho(void) {
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glOrtho(0, SCREEN_W, SCREEN_H, 0, -100, 100);
@ -121,19 +121,19 @@ void fade_out(float f) {
colorfill(0, 0, 0, f);
}
inline double psin(double x) {
double psin(double x) {
return 0.5 + 0.5 * sin(x);
}
inline double max(double a, double b) {
double max(double a, double b) {
return (a > b)? a : b;
}
inline double min(double a, double b) {
double min(double a, double b) {
return (a < b)? a : b;
}
inline double clamp(double f, double lower, double upper) {
double clamp(double f, double lower, double upper) {
if(f < lower)
return lower;
if(f > upper)
@ -142,7 +142,7 @@ inline double clamp(double f, double lower, double upper) {
return f;
}
void take_screenshot()
void take_screenshot(void)
{
FILE *out;
char *data;

View file

@ -127,20 +127,18 @@ typedef struct {
extern Global global;
void print_state_checksum();
void print_state_checksum(void);
void init_global();
void init_global(void);
void frame_rate(int *lasttime);
void calc_fps(FPSCounter *fps);
void set_ortho();
void set_ortho(void);
void colorfill(float r, float g, float b, float a);
void fade_out(float f);
void global_processevent(SDL_Event*);
void take_screenshot();
double psin();
void take_screenshot(void);
// needed for mingw compatibility:
#undef min
@ -153,6 +151,7 @@ double min(double, double);
double max(double, double);
double clamp(double, double, double);
double approach(double v, double t, double d);
double psin(double);
int strendswith(char *s, char *e);
char* difficulty_name(Difficulty diff);
void stralloc(char **dest, char *src);

View file

@ -26,7 +26,7 @@ void delete_item(Item *item) {
delete_element((void **)&global.items, item);
}
void draw_items() {
void draw_items(void) {
Item *p;
Texture *tex = NULL;
for(p = global.items; p; p = p->next) {
@ -57,7 +57,7 @@ void draw_items() {
}
}
void delete_items() {
void delete_items(void) {
delete_all_elements((void **)&global.items, delete_element);
}
@ -71,7 +71,7 @@ void move_item(Item *i) {
i->pos = i->pos0 + log(t/5.0 + 1)*5*(i->v + lim) + lim*t;
}
void process_items() {
void process_items(void) {
Item *item = global.items, *del = NULL;
int v;
@ -126,7 +126,7 @@ int collision_item(Item *i) {
return 0;
}
inline void spawn_item(complex pos, Type type) {
void spawn_item(complex pos, Type type) {
tsrand_fill(2);
create_item(pos, 5*cexp(I*tsrand_a(0)/afrand(1)*M_PI*2), type);
}

View file

@ -37,11 +37,11 @@ struct Item{
Item *create_item(complex pos, complex v, Type type);
void delete_item(Item *item);
void draw_items();
void delete_items();
void draw_items(void);
void delete_items(void);
int collision_item(Item *p);
void process_items();
void process_items(void);
void spawn_item(complex pos, Type type);
void spawn_items(complex pos, int point, int power, int bomb, int life);

View file

@ -139,7 +139,7 @@ void draw_laser_curve(Laser *laser) {
glDisable(GL_TEXTURE_2D);
}
void draw_lasers() {
void draw_lasers(void) {
Laser *laser;
for(laser = global.lasers; laser; laser = laser->next) {
@ -162,11 +162,11 @@ void _delete_laser(void **lasers, void *laser) {
delete_element(lasers, laser);
}
void delete_lasers() {
void delete_lasers(void) {
delete_all_elements((void **)&global.lasers, _delete_laser);
}
void process_lasers() {
void process_lasers(void) {
Laser *laser = global.lasers, *del = NULL;
while(laser != NULL) {

View file

@ -54,9 +54,9 @@ struct Laser {
Laser *create_laserline_ab(complex a, complex b, float width, float charge, float dur, Color *clr);
Laser *create_laser(complex pos, float time, float deathtime, Color *color, LaserPosRule prule, LaserLogicRule lrule, complex a0, complex a1, complex a2, complex a3);
void draw_lasers();
void delete_lasers();
void process_lasers();
void draw_lasers(void);
void delete_lasers(void);
void process_lasers(void);
int collision_laser_line(Laser *l);
int collision_laser_curve(Laser *l);

View file

@ -16,7 +16,7 @@
#include "paths/native.h"
#include "taiseigl.h"
void init_gl() {
void init_gl(void) {
load_gl_functions();
check_gl_extensions();
@ -34,7 +34,7 @@ void init_gl() {
}
void taisei_shutdown() {
void taisei_shutdown(void) {
config_save(CONFIG_FILE);
printf("\nshutdown:\n");

View file

@ -30,7 +30,7 @@ void give_up(void *arg) {
global.game_over = (MAX_CONTINUES - global.plr.continues)? GAMEOVER_ABORT : GAMEOVER_DEFEAT;
}
MenuData *create_gameover_menu() {
MenuData *create_gameover_menu(void) {
MenuData *m = malloc(sizeof(MenuData));
create_menu(m);
m->abortable = -1;

View file

@ -11,6 +11,6 @@
#include "menu.h"
MenuData *create_gameover_menu();
MenuData *create_gameover_menu(void);
#endif

View file

@ -16,7 +16,7 @@ void return_to_title(void *arg) {
global.game_over = GAMEOVER_ABORT;
}
MenuData *create_ingame_menu() {
MenuData *create_ingame_menu(void) {
MenuData *m = malloc(sizeof(MenuData));
create_menu(m);
add_menu_entry(m, "Return to Game", return_to_game, NULL);

View file

@ -10,8 +10,8 @@
#include "menu.h"
MenuData *create_ingame_menu();
MenuData *create_ingame_menu(void);
void draw_ingame_menu(MenuData *menu);
void ingame_menu_logic(MenuData **menu);
#endif
#endif

View file

@ -55,7 +55,7 @@ typedef struct MenuData{
} MenuData;
void add_menu_entry(MenuData *menu, char *name, void (*action)(void *), void *arg);
void add_menu_separator();
void add_menu_separator(MenuData *menu);
void create_menu(MenuData *menu);
void destroy_menu(MenuData *menu);

View file

@ -299,7 +299,7 @@ int bind_noshader_set(void *b, int v)
return i;
}
int bind_stagebg_fpslimit_dependence() {
int bind_stagebg_fpslimit_dependence(void) {
return tconfig.intval[NO_STAGEBG] == 2;
}

View file

@ -18,7 +18,7 @@ int options_menu_loop(MenuData *m);
typedef int (*BindingGetter)(void*);
typedef int (*BindingSetter)(void*, int);
typedef int (*BindingDependence)();
typedef int (*BindingDependence)(void);
typedef enum BindingType {
BT_IntValue,

View file

@ -8,9 +8,9 @@
#ifndef NATIVE_H
#define NATIVE_H
const char *get_prefix();
const char *get_config_path();
const char *get_screenshots_path();
const char *get_replays_path();
const char *get_prefix(void);
const char *get_config_path(void);
const char *get_screenshots_path(void);
const char *get_replays_path(void);
#endif

View file

@ -49,7 +49,7 @@ typedef struct Projectile {
} Projectile;
Color *rgba(float r, float g, float b, float a);
inline Color *rgb(float r, float g, float b);
Color *rgb(float r, float g, float b);
#define create_particle3c(n,p,c,d,r,a1,a2,a3) create_particle4c(n,p,c,d,r,a1,a2,a3,0)
#define create_particle2c(n,p,c,d,r,a1,a2) create_particle4c(n,p,c,d,r,a1,a2,0,0)

View file

@ -33,19 +33,19 @@ int tsrand_p(RandomState *rnd) {
return (uint32_t)((rnd->z << 16u) + rnd->w) % TSRAND_MAX;
}
inline void tsrand_seed(uint32_t seed) {
void tsrand_seed(uint32_t seed) {
tsrand_seed_p(tsrand_current, seed);
}
inline int tsrand(void) {
int tsrand(void) {
return tsrand_p(tsrand_current);
}
inline double frand(void) {
double frand(void) {
return tsrand()/(double)TSRAND_MAX;
}
inline double nfrand(void) {
double nfrand(void) {
return frand() * 2 - 1;
}
@ -96,21 +96,21 @@ void tsrand_fill_p(RandomState *rnd, int amount) {
tsrand_array[i] = tsrand_p(rnd);
}
inline void tsrand_fill(int amount) {
void tsrand_fill(int amount) {
tsrand_fill_p(tsrand_current, amount);
}
inline int tsrand_a(int idx) {
int tsrand_a(int idx) {
if(idx >= tsrand_array_elems || idx < 0)
errx(-1, "tsrand_a: index out of range (%i / %i)", idx, tsrand_array_elems);
return tsrand_array[idx];
}
inline double afrand(int idx) {
double afrand(int idx) {
return tsrand_a(idx)/(double)TSRAND_MAX;
}
inline double anfrand(int idx) {
double anfrand(int idx) {
return afrand(idx) * 2 - 1;
}

View file

@ -21,17 +21,17 @@ void tsrand_switch(RandomState *rnd);
void tsrand_seed_p(RandomState *rnd, uint32_t seed);
int tsrand_p(RandomState *rnd);
inline void tsrand_seed(uint32_t seed);
inline int tsrand(void);
void tsrand_seed(uint32_t seed);
int tsrand(void);
inline double frand(void);
inline double nfrand(void);
double frand(void);
double nfrand(void);
void tsrand_fill_p(RandomState *rnd, int amount);
inline void tsrand_fill(int amount);
inline int tsrand_a(int idx);
inline double afrand(int idx);
inline double anfrand(int idx);
void tsrand_fill(int amount);
int tsrand_a(int idx);
double afrand(int idx);
double anfrand(int idx);
#define TSRAND_MAX INT32_MAX

View file

@ -72,7 +72,7 @@ void delete_animation(void **anis, void *ani) {
delete_element(anis, ani);
}
void delete_animations() {
void delete_animations(void) {
delete_all_elements((void **)&resources.animations, delete_animation);
}
@ -114,4 +114,4 @@ void draw_animation_p(float x, float y, int row, Animation *ani) {
glPopMatrix();
glDisable(GL_TEXTURE_2D);
}

View file

@ -29,8 +29,8 @@ typedef struct Animation {
Animation *init_animation(char *filename);
Animation *get_ani(char *name);
void delete_animations();
void delete_animations(void);
void draw_animation(float x, float y, int row, char *name);
void draw_animation_p(float x, float y, int row, Animation *ani);
#endif
#endif

View file

@ -82,6 +82,6 @@ void delete_sound(void **snds, void *snd) {
delete_element(snds, snd);
}
void delete_sounds() {
void delete_sounds(void) {
delete_all_elements((void **)&resources.sounds, delete_sound);
}
}

View file

@ -27,6 +27,6 @@ void play_sound(char *name);
void play_sound_p(Sound *snd);
Sound *get_snd(char *name);
void delete_sounds();
void delete_sounds(void);
#endif
#endif

View file

@ -28,7 +28,7 @@ TTF_Font *load_font(char *name, int size) {
return f;
}
void init_fonts() {
void init_fonts(void) {
TTF_Init();
_fonts.standard = load_font("gfx/LinBiolinum.ttf", 20);

View file

@ -20,7 +20,7 @@ typedef enum {
Texture *load_text(const char *text, TTF_Font *font);
void draw_text(Alignment align, float x, float y, const char *text, TTF_Font *font);
void init_fonts();
void init_fonts(void);
int stringwidth(char *s, TTF_Font *font);
int stringheight(char *s, TTF_Font *font);
int charwidth(char c, TTF_Font *font);

View file

@ -109,7 +109,7 @@ void parse_obj(char *filename, ObjFileData *data) {
fclose(fp);
}
static inline void bad_reference_error(char *filename, char *aux, int n) {
static void bad_reference_error(char *filename, char *aux, int n) {
errx(-1, "load_model():\n!- OBJ file '%s': Index %d: bad %s index reference\n", filename, n, aux);
}
@ -227,6 +227,6 @@ void delete_model(void **models, void *model) {
delete_element(models, model);
}
void delete_models() { // Does not delete elements from the VBO, so doing this at runtime is leaking VBO space
void delete_models(void) { // Does not delete elements from the VBO, so doing this at runtime is leaking VBO space
delete_all_elements((void **)&resources.models, delete_model);
}
}

View file

@ -48,6 +48,6 @@ Model *get_model(char *name);
void draw_model_p(Model *model);
void draw_model(char *name);
void delete_models(); // Does not delete elements from the VBO, so doing this at runtime is leaking VBO space
void delete_models(void); // Does not delete elements from the VBO, so doing this at runtime is leaking VBO space
#endif
#endif

View file

@ -51,7 +51,7 @@ void recurse_dir(char *path) {
closedir(dir);
}
void load_resources() {
void load_resources(void) {
printf("load_resources():\n");
char *path = malloc(strlen(get_prefix())+32);
@ -107,7 +107,7 @@ void load_resources() {
}
}
void free_resources() {
void free_resources(void) {
if(resources.state & RS_SfxLoaded) {
printf("-- freeing sounds\n");
delete_sounds();

View file

@ -47,6 +47,6 @@ struct Resources {
extern Resources resources;
void load_resources();
void free_resources();
void load_resources(void);
void free_resources(void);
#endif

View file

@ -300,6 +300,6 @@ void delete_shader(void **shas, void *sha) {
delete_element(shas, sha);
}
void delete_shaders() {
void delete_shaders(void) {
delete_all_elements((void **)&resources.shaders, delete_shader);
}
}

View file

@ -35,8 +35,8 @@ void load_shader_snippets(char *filename, char *prefix);
void load_shader_file(char *filename);
void load_shader(char *vtext, char *ftext, char *name, int nsize);
Shader *get_shader(const char *name);
void delete_shaders();
void delete_shaders(void);
void cache_uniforms(Shader *sha);
int uniloc(Shader *sha, char *name);
#endif
#endif

View file

@ -25,7 +25,7 @@ Color *rgba(float r, float g, float b, float a) {
return clr;
}
inline Color *rgb(float r, float g, float b) {
Color *rgb(float r, float g, float b) {
return rgba(r, g, b, 1.0);
}
@ -68,7 +68,7 @@ void delete_texture(void **texs, void *tex) {
delete_element((void **)texs, tex);
}
void delete_textures() {
void delete_textures(void) {
delete_all_elements((void **)&resources.textures, delete_texture);
}

View file

@ -38,7 +38,7 @@ Texture *prefix_get_tex(char *name, char *prefix);
SDL_Surface *load_png(const char *filename);
void delete_texture(void **texs, void *tex);
void delete_textures();
void delete_textures(void);
Texture *load_texture(const char *filename);
void load_sdl_surf(SDL_Surface *surface, Texture *texture);
@ -50,4 +50,4 @@ void draw_texture_p(float x, float y, Texture *tex);
void fill_screen(float xoff, float yoff, float ratio, char *name);
void fill_screen_p(float xoff, float yoff, float ratio, Texture *tex);
#endif
#endif

View file

@ -36,7 +36,7 @@ StageInfo* stage_get(int n) {
return NULL;
}
void stage_start() {
void stage_start(void) {
global.timer = 0;
global.frames = 0;
global.game_over = 0;
@ -51,14 +51,14 @@ void stage_start() {
global.plr.deathtime = -1;
}
void stage_ingamemenu() {
void stage_ingamemenu(void) {
if(!global.menu)
global.menu = create_ingame_menu();
else
global.menu->quit = 1;
}
void replay_input() {
void replay_input(void) {
if(global.menu) {
menu_input(global.menu);
return;
@ -108,7 +108,7 @@ void replay_input() {
player_applymovement(&global.plr);
}
void stage_input() {
void stage_input(void) {
if(global.menu) {
menu_input(global.menu);
return;
@ -161,7 +161,7 @@ void stage_input() {
player_applymovement(&global.plr);
}
void draw_hud() {
void draw_hud(void) {
draw_texture(SCREEN_W/2.0, SCREEN_H/2.0, "hud");
char buf[16], *diff;
@ -449,7 +449,7 @@ void stage_logic(int time) {
global.game_over = GAMEOVER_WIN;
}
void stage_end() {
void stage_end(void) {
delete_enemies(&global.enemies);
delete_items();
delete_lasers();

View file

@ -51,11 +51,11 @@ void apply_bg_shaders(ShaderRule *shaderrules);
void draw_stage_title(StageInfo *info);
void stage1_loop();
void stage2_loop();
void stage3_loop();
void stage4_loop();
void stage5_loop();
void stage6_loop();
void stage1_loop(void);
void stage2_loop(void);
void stage3_loop(void);
void stage4_loop(void);
void stage5_loop(void);
void stage6_loop(void);
#endif

View file

@ -13,7 +13,7 @@
static Stage3D bgcontext;
Dialog *stage1_dialog() {
Dialog *stage1_dialog(void) {
Dialog *d = create_dialog(global.plr.cha == Marisa ? "dialog/marisa" : "dialog/youmu", "masterspark");
dadd_msg(d, Right, "Hey! Who is there?");
@ -101,7 +101,7 @@ void stage1_fog(int fbonum) {
glUseProgram(0);
}
void stage1_draw() {
void stage1_draw(void) {
set_perspective(&bgcontext, 500, 5000);
draw_stage3d(&bgcontext, 7000);
@ -205,7 +205,7 @@ void cirno_pfreeze_bg(Boss *c, int time) {
glColor4f(1,1,1,1);
}
Boss *create_cirno_mid() {
Boss *create_cirno_mid(void) {
Boss* cirno = create_boss("Cirno", "cirno", VIEWPORT_W + 220 + 30I);
boss_add_attack(cirno, AT_Move, "Introduction", 2, 0, cirno_intro, NULL);
boss_add_attack(cirno, AT_Normal, "Icy Storm", 20, 20000, cirno_icy, NULL);
@ -345,7 +345,7 @@ void cirno_icicle_fall(Boss *c, int time) {
}
}
Boss *create_cirno() {
Boss *create_cirno(void) {
Boss* cirno = create_boss("Cirno", "cirno", -230 + 100I);
boss_add_attack(cirno, AT_Move, "Introduction", 2, 0, cirno_intro_boss, NULL);
boss_add_attack(cirno, AT_Normal, "Iceplosion 0", 20, 20000, cirno_iceplosion0, NULL);
@ -558,7 +558,7 @@ int stage1_tritoss(Enemy *e, int t) {
return 1;
}
void stage1_events() {
void stage1_events(void) {
TIMER(&global.timer);
// AT(0)
@ -644,7 +644,7 @@ void stage1_events() {
}
void stage1_start() {
void stage1_start(void) {
init_stage3d(&bgcontext);
add_model(&bgcontext, stage1_bg_draw, stage1_bg_pos);
add_model(&bgcontext, stage1_smoke_draw, stage1_smoke_pos);
@ -654,11 +654,11 @@ void stage1_start() {
bgcontext.cv[1] = 7;
}
void stage1_end() {
void stage1_end(void) {
free_stage3d(&bgcontext);
}
void stage1_loop() {
void stage1_loop(void) {
ShaderRule list[] = { stage1_fog, NULL };
stage_loop(stage_get(1), stage1_start, stage1_end, stage1_draw, stage1_events, list, 5200);
}

View file

@ -8,6 +8,6 @@
#ifndef STAGE1_H
#define STAGE1_H
void stage1_loop();
void stage1_loop(void);
#endif
#endif

View file

@ -126,7 +126,7 @@ void stage2_bloom(int fbonum) {
glUseProgram(0);
}
void stage2_start() {
void stage2_start(void) {
init_stage3d(&bgcontext);
bgcontext.cx[2] = 1000;
bgcontext.cx[0] = -850;
@ -139,11 +139,11 @@ void stage2_start() {
add_model(&bgcontext, stage2_bg_leaves_draw, stage2_bg_pos);
}
void stage2_end() {
void stage2_end(void) {
free_stage3d(&bgcontext);
}
void stage2_draw() {
void stage2_draw(void) {
TIMER(&global.frames);
set_perspective(&bgcontext, 500, 5000);
@ -158,7 +158,7 @@ void stage2_draw() {
}
void stage2_loop() {
void stage2_loop(void) {
ShaderRule shaderrules[] = { stage2_fog, stage2_bloom, NULL };
stage_loop(stage_get(2), stage2_start, stage2_end, stage2_draw, stage2_events, shaderrules, 5240);
}

View file

@ -8,6 +8,6 @@
#ifndef STAGE2_H
#define STAGE2_H
void stage2_loop();
void stage2_loop(void);
#endif
#endif

View file

@ -10,7 +10,7 @@
#include "stage.h"
#include "enemy.h"
Dialog *stage2_dialog() {
Dialog *stage2_dialog(void) {
Dialog *d = create_dialog(global.plr.cha == Marisa ? "dialog/marisa" : "dialog/youmu", "dialog/hina");
if(global.plr.cha == Marisa) {
@ -33,7 +33,7 @@ Dialog *stage2_dialog() {
return d;
}
Dialog *stage2_post_dialog() {
Dialog *stage2_post_dialog(void) {
Dialog *d = create_dialog(global.plr.cha == Marisa ? "dialog/marisa" : "dialog/youmu", NULL);
dadd_msg(d, Right, "Well, let's go then.");
@ -243,7 +243,7 @@ void wriggle_small_storm(Boss *w, int time) {
}
}
Boss *create_wriggle_mid() {
Boss *create_wriggle_mid(void) {
Boss* wriggle = create_boss("Wriggle", "wriggle", VIEWPORT_W + 150 - 30I);
boss_add_attack(wriggle, AT_Move, "Introduction", 4, 0, wriggle_intro, NULL);
boss_add_attack(wriggle, AT_Normal, "Small Bug Storm", 20, 20000, wriggle_small_storm, NULL);
@ -391,7 +391,7 @@ void hina_spell_bg(Boss *h, int time) {
}
Boss *create_hina() {
Boss *create_hina(void) {
Boss* hina = create_boss("Kagiyama Hina", "hina", VIEWPORT_W + 150 + 100I);
boss_add_attack(hina, AT_Move, "Introduction", 2, 0, hina_intro, NULL);
boss_add_attack(hina, AT_Normal, "Cards1", 20, 15000, hina_cards1, NULL);
@ -404,7 +404,7 @@ Boss *create_hina() {
return hina;
}
void stage2_events() {
void stage2_events(void) {
TIMER(&global.timer);
AT(300) {

View file

@ -8,6 +8,6 @@
#ifndef STAGE2_EVENTS_H
#define STAGE2_EVENTS_H
void stage2_events();
void stage2_events(void);
#endif
#endif

View file

@ -110,7 +110,7 @@ void stage3_fog(int fbonum) {
glUseProgram(0);
}
void stage3_start() {
void stage3_start(void) {
init_stage3d(&bgcontext);
bgcontext.cx[2] = -10;
@ -129,11 +129,11 @@ void stage3_start() {
// stgstate.fog_exp = 5.0;
}
void stage3_end() {
void stage3_end(void) {
free_stage3d(&bgcontext);
}
void stage3_draw() {
void stage3_draw(void) {
TIMER(&global.timer)
set_perspective(&bgcontext, 300, 5000);
@ -278,7 +278,7 @@ void stage3_draw() {
draw_stage3d(&bgcontext, 7000);
}
void stage3_loop() {
void stage3_loop(void) {
ShaderRule shaderrules[] = { stage3_fog, stage3_tunnel, NULL };
stage_loop(stage_get(3), stage3_start, stage3_end, stage3_draw, stage3_events, shaderrules, 5700);
}

View file

@ -8,6 +8,6 @@
#ifndef STAGE3_H
#define STAGE3_H
void stage3_loop();
void stage3_loop(void);
#endif
#endif

View file

@ -11,7 +11,7 @@
#include "stage.h"
#include "enemy.h"
Dialog *stage3_dialog() {
Dialog *stage3_dialog(void) {
Dialog *d = create_dialog(global.plr.cha == Marisa ? "dialog/marisa" : "dialog/youmu", "masterspark");
dadd_msg(d, Left, "Ugh, it's like bugs being attracted by the light...");
@ -420,7 +420,7 @@ void stage3_boss_spellbg(Boss *b, int time) {
glColor4f(1,1,1,1);
}
Boss* stage3_create_midboss() {
Boss* stage3_create_midboss(void) {
Boss *scuttle = create_boss("Scuttle", "scuttle", VIEWPORT_W/2 - 200I);
boss_add_attack(scuttle, AT_Move, "Introduction", 2, 0, stage3_mid_intro, NULL);
boss_add_attack(scuttle, AT_Normal, "Lethal Bite", 30, 25000, stage3_mid_a0, NULL);
@ -750,7 +750,7 @@ void stage3_boss_intro(Boss *boss, int time) {
GO_TO(boss, VIEWPORT_W/2.0 + 100I, 0.03);
}
Boss* stage3_create_boss() {
Boss* stage3_create_boss(void) {
Boss *wriggle = create_boss("EX Wriggle", "wriggle", VIEWPORT_W/2 - 200I);
boss_add_attack(wriggle, AT_Move, "Introduction", 2, 0, stage3_boss_intro, NULL);
@ -765,7 +765,7 @@ Boss* stage3_create_boss() {
return wriggle;
}
void stage3_events() {
void stage3_events(void) {
TIMER(&global.timer);
FROM_TO(160, 300, 10) {

View file

@ -9,6 +9,6 @@
#ifndef STAGE3_EVENTS_H
#define STAGE3_EVENTS_H
void stage3_events();
void stage3_events(void);
#endif

View file

@ -189,7 +189,7 @@ void stage4_corridor_draw(Vector pos) {
glColor3f(1,1,1);
}
void stage4_start() {
void stage4_start(void) {
init_stage3d(&bgcontext);
bgcontext.cx[2] = -10000;
@ -207,11 +207,11 @@ void stage4_start() {
add_model(&bgcontext, stage4_corridor_draw, stage4_corridor_pos);
}
void stage4_end() {
void stage4_end(void) {
free_stage3d(&bgcontext);
}
void stage4_draw() {
void stage4_draw(void) {
set_perspective(&bgcontext, 130, 3000);
draw_stage3d(&bgcontext, 4000);
@ -229,7 +229,7 @@ void stage4_draw() {
bgcontext.cv[1] += 0.02;
}
void stage4_loop() {
void stage4_loop(void) {
ShaderRule shaderrules[] = { stage4_fog, NULL };
stage_loop(stage_get(4), stage4_start, stage4_end, stage4_draw, stage4_events, shaderrules, 5550);
}

View file

@ -8,6 +8,6 @@
#ifndef STAGE4_H
#define STAGE4_H
void stage4_loop();
void stage4_loop(void);
#endif
#endif

View file

@ -11,7 +11,7 @@
#include "enemy.h"
#include "laser.h"
Dialog *stage4_dialog() {
Dialog *stage4_dialog(void) {
Dialog *d = create_dialog(global.plr.cha == Marisa ? "dialog/marisa" : "dialog/youmu", "masterspark");
dadd_msg(d, Right, "Ah! Intruder! Stop being so persistent!");
@ -34,7 +34,7 @@ Dialog *stage4_dialog() {
return d;
}
Dialog *stage4_dialog_end() {
Dialog *stage4_dialog_end(void) {
Dialog *d = create_dialog(global.plr.cha == Marisa ? "dialog/marisa" : "dialog/youmu", "masterspark");
dadd_msg(d, Left, "Now, where is your master?");
@ -359,7 +359,7 @@ void kurumi_outro(Boss *b, int time) {
b->pos += -5-I;
}
Boss *create_kurumi_mid() {
Boss *create_kurumi_mid(void) {
Boss* b = create_boss("Kurumi", "kurumi", VIEWPORT_W/2-400I);
boss_add_attack(b, AT_Move, "Introduction", 4, 0, kurumi_intro, NULL);
boss_add_attack(b, AT_Spellcard, "Bloodless ~ Gate of Walachia", 25, 20000, kurumi_slaveburst, kurumi_spell_bg);
@ -695,7 +695,7 @@ void kurumi_danmaku(Boss *b, int time) {
}
Boss *create_kurumi() {
Boss *create_kurumi(void) {
Boss* b = create_boss("Kurumi", "kurumi", -400I);
boss_add_attack(b, AT_Move, "Introduction", 4, 0, kurumi_boss_intro, NULL);
boss_add_attack(b, AT_Normal, "Sin Breaker", 20, 20000, kurumi_sbreaker, NULL);
@ -711,7 +711,7 @@ Boss *create_kurumi() {
void stage4_events() {
void stage4_events(void) {
TIMER(&global.timer);
AT(70) {

View file

@ -8,6 +8,6 @@
#ifndef STAGE4_EVENTS_H
#define STAGE4_EVENTS_H
void stage4_events();
void stage4_events(void);
#endif
#endif

View file

@ -55,7 +55,7 @@ void stage5_stairs_draw(Vector pos) {
glUseProgram(0);
}
void stage5_draw() {
void stage5_draw(void) {
set_perspective(&bgcontext, 100, 20000);
draw_stage3d(&bgcontext, 30000);
@ -113,7 +113,7 @@ void iku_spell_bg(Boss *b, int t) {
glColor4f(1,1,1,1);
}
void stage5_start() {
void stage5_start(void) {
memset(&stagedata, 0, sizeof(stagedata));
init_stage3d(&bgcontext);
@ -124,10 +124,10 @@ void stage5_start() {
stagedata.rad = 2800;
}
void stage5_end() {
void stage5_end(void) {
free_stage3d(&bgcontext);
}
void stage5_loop() {
void stage5_loop(void) {
stage_loop(stage_get(5), stage5_start, stage5_end, stage5_draw, stage5_events, NULL, 5700);
}

View file

@ -8,6 +8,6 @@
#ifndef STAGE5_H
#define STAGE5_H
void stage5_loop();
void stage5_loop(void);
#endif
#endif

View file

@ -9,7 +9,7 @@
#include "stage5.h"
#include <global.h>
Dialog *stage5_post_mid_dialog() {
Dialog *stage5_post_mid_dialog(void) {
Dialog *d = create_dialog(global.plr.cha == Marisa ? "dialog/marisa" : "dialog/youmu", NULL);
dadd_msg(d, Left, "Hey! Stop!");
@ -17,7 +17,7 @@ Dialog *stage5_post_mid_dialog() {
return d;
}
Dialog *stage5_boss_dialog() {
Dialog *stage5_boss_dialog(void) {
Dialog *d = create_dialog(global.plr.cha == Marisa ? "dialog/marisa" : "dialog/youmu", "masterspark");
dadd_msg(d, Left, "Finally!");
@ -30,7 +30,7 @@ Dialog *stage5_boss_dialog() {
return d;
}
Dialog *stage5_post_boss_dialog() {
Dialog *stage5_post_boss_dialog(void) {
Dialog *d = create_dialog(global.plr.cha == Marisa ? "dialog/marisa" : "dialog/youmu", NULL);
dadd_msg(d, Left, "I can see the top!");
@ -201,7 +201,7 @@ void iku_mid_intro(Boss *b, int t) {
killall(global.enemies);
}
Boss *create_iku_mid() {
Boss *create_iku_mid(void) {
Boss *b = create_boss("Bombs?", "iku", VIEWPORT_W+800I);
boss_add_attack(b, AT_SurvivalSpell, "Static Bombs", 16, 10, iku_mid_intro, NULL);
@ -479,7 +479,7 @@ void iku_induction(Boss *b, int t) {
void iku_spell_bg(Boss *b, int t);
Boss *create_iku() {
Boss *create_iku(void) {
Boss *b = create_boss("Nagae Iku", "iku", VIEWPORT_W/2-200I);
boss_add_attack(b, AT_Move, "Introduction", 3, 0, iku_intro, NULL);
@ -494,7 +494,7 @@ Boss *create_iku() {
return b;
}
void stage5_events() {
void stage5_events(void) {
TIMER(&global.timer);
FROM_TO(60, 120, 10)

View file

@ -8,6 +8,6 @@
#ifndef STAGE5_EVENTS_H
#define STAGE5_EVENTS_H
void stage5_events();
void stage5_events(void);
#endif
#endif

View file

@ -93,7 +93,7 @@ void stage6_skysphere_draw(Vector pos) {
glDisable(GL_TEXTURE_2D);
}
void stage6_draw() {
void stage6_draw(void) {
set_perspective(&bgcontext, 100, 9000);
draw_stage3d(&bgcontext, 10000);
@ -143,11 +143,11 @@ void stage6_draw() {
bgcontext.crot[2] += 180/M_PI*g*w;
}
void start_fall_over() { //troll
void start_fall_over(void) { //troll
fall_over = global.frames;
}
void stage6_start() {
void stage6_start(void) {
init_stage3d(&bgcontext);
fall_over = 0;
@ -169,11 +169,11 @@ void stage6_start() {
}
void stage6_end() {
void stage6_end(void) {
free_stage3d(&bgcontext);
}
void stage6_loop() {
void stage6_loop(void) {
// ShaderRule shaderrules[] = { stage6_bloom, NULL };
stage_loop(stage_get(6), stage6_start, stage6_end, stage6_draw, stage6_events, NULL, 3900);
}

View file

@ -8,7 +8,7 @@
#ifndef STAGE6_H
#define STAGE6_H
void stage6_loop();
void start_fall_over();
void stage6_loop(void);
void start_fall_over(void);
#endif
#endif

View file

@ -9,7 +9,7 @@
#include "stage6.h"
#include <global.h>
Dialog *stage6_dialog() {
Dialog *stage6_dialog(void) {
Dialog *d = create_dialog(global.plr.cha == Marisa ? "dialog/marisa" : "dialog/youmu", "masterspark");
dadd_msg(d, Left, "You are responsible?");
@ -878,7 +878,7 @@ void elly_spellbg_modern(Boss *b, int t) {
glColor4f(1,1,1,1);
}
Boss *create_elly() {
Boss *create_elly(void) {
Boss *b = create_boss("Elly", "elly", -200I);
boss_add_attack(b, AT_Move, "Catch the Scythe", 6, 0, elly_intro, NULL);
@ -899,7 +899,7 @@ Boss *create_elly() {
return b;
}
void stage6_events() {
void stage6_events(void) {
TIMER(&global.timer);
// AT(0)

View file

@ -8,6 +8,6 @@
#ifndef STAGE6_EVENTS_H
#define STAGE6_EVENTS_H
void stage6_events();
void stage6_events(void);
#endif
#endif

View file

@ -34,7 +34,7 @@ void set_perspective_viewport(Stage3D *s, float n, float f, int vx, int vy, int
glMatrixMode(GL_MODELVIEW);
}
inline void set_perspective(Stage3D *s, float n, float f) {
void set_perspective(Stage3D *s, float n, float f) {
set_perspective_viewport(s, n, f, VIEWPORT_X, VIEWPORT_Y, VIEWPORT_W, VIEWPORT_H);
}

View file

@ -39,7 +39,7 @@ void init_stage3d(Stage3D *s);
void add_model(Stage3D *s, SegmentDrawRule draw, SegmentPositionRule pos);
void set_perspective_viewport(Stage3D *s, float n, float f, int vx, int vy, int vw, int vh);
inline void set_perspective(Stage3D *s, float near, float far);
void set_perspective(Stage3D *s, float near, float far);
void draw_stage3d(Stage3D *s, float maxrange);
void free_stage3d(Stage3D *s);

View file

@ -28,7 +28,7 @@ GLFuncPtr get_proc_address(char *name) {
}
void check_gl_extensions() {
void check_gl_extensions(void) {
int l;
char *ext = (char*)glGetString(GL_EXTENSIONS);
char *last, *pos;
@ -47,7 +47,7 @@ void check_gl_extensions() {
}
}
void load_gl_functions() {
void load_gl_functions(void) {
#ifdef __WIN32__
glActiveTexture = (PFNGLACTIVETEXTUREPROC)get_proc_address("glActiveTexture");
glBlendEquation = (PFNGLBLENDEQUATIONPROC)get_proc_address("glBlendEquation");
@ -98,4 +98,4 @@ void load_gl_functions() {
glUniform2fv = (PFNGLUNIFORM2FVPROC)get_proc_address("glUniform2fv");
glUniform3fv = (PFNGLUNIFORM3FVPROC)get_proc_address("glUniform3fv");
glUniform4fv = (PFNGLUNIFORM4FVPROC)get_proc_address("glUniform4fv");
}
}

View file

@ -19,8 +19,8 @@ enum {
extern int tgl_ext[_TGLEXT_COUNT];
void load_gl_functions();
void check_gl_extensions();
void load_gl_functions(void);
void check_gl_extensions(void);
#ifdef __WIN32__
PFNGLACTIVETEXTUREPROC glActiveTexture;
@ -73,4 +73,4 @@ PFNGLUNIFORM2FVPROC glUniform2fv;
PFNGLUNIFORM3FVPROC glUniform3fv;
PFNGLUNIFORM4FVPROC glUniform4fv;
#endif
#endif

View file

@ -40,7 +40,7 @@ void vbo_add_verts(VBO *vbo, Vertex *verts, int count) {
vbo->offset += count;
}
void init_quadvbo() {
void init_quadvbo(void) {
Vertex verts[] = {
{{-0.5,-0.5,0},{0,0,1},0,0},
{{-0.5,0.5,0},{0,0,1},0,1},
@ -64,11 +64,11 @@ void delete_vbo(VBO *vbo) {
glDeleteBuffers(1, &vbo->vbo);
}
void draw_quad() {
void draw_quad(void) {
// glBindBuffer(GL_ARRAY_BUFFER, _vbo.vbo);
glDrawArrays(GL_QUADS, 0, 4);
// glBindBuffer(GL_ARRAY_BUFFER, 0);
}
}

View file

@ -37,8 +37,8 @@ struct Vertex {
void init_vbo(VBO *vbo, int size);
void vbo_add_verts(VBO *vbo, Vertex *verts, int count);
void init_quadvbo();
void draw_quad();
void init_quadvbo(void);
void draw_quad(void);
void delete_vbo(VBO *vbo);
#endif
#endif