Discord-rock animation in intro, Qt Creator project files, better vsync

handling
This commit is contained in:
Sebastian Krzyszkowiak 2012-05-16 18:18:52 +02:00
parent 05a96a36b7
commit a74403bfbf
8 changed files with 35 additions and 5 deletions

View file

@ -17,6 +17,8 @@ $(ODIR)/%.o: $(SRCDIR)/%.c
$(OUTPUTDIR)/superderpy: $(OBJ)
$(CC) -o $@ $^ $(CFLAGS) $(LIBS)
all: $(OUTPUTDIR)/superderpy
.PHONY: clean
clean:

1
SuperDerpy.config Normal file
View file

@ -0,0 +1 @@
// ADD PREDEFINED MACROS HERE!

1
SuperDerpy.creator Normal file
View file

@ -0,0 +1 @@
[General]

24
SuperDerpy.files Normal file
View file

@ -0,0 +1,24 @@
src/about.c
src/about.h
src/allegro_utils.c
src/allegro_utils.h
src/config.c
src/config.h
src/intro.c
src/intro.h
src/level.c
src/level.h
src/loading.c
src/loading.h
src/main.c
src/main.h
src/map.c
src/map.h
src/menu.c
src/menu.h
src/moonwalk.c
src/moonwalk.h
src/pause.c
src/pause.h
src/timeline.c
src/timeline.h

1
SuperDerpy.includes Normal file
View file

@ -0,0 +1 @@
/home/dos/git/SuperDerpy/src

View file

@ -208,9 +208,9 @@ void Intro_Preload(struct Game *game) {
game->intro.in_animation = false;
game->intro.anim = 0;
game->intro.animsprites[0] = LoadScaledBitmap("intro/discord.png", al_get_display_width(game->display)*0.3125*3, al_get_display_height(game->display)*0.63*3);
game->intro.animsprites[0] = LoadScaledBitmap("intro/1.png", al_get_display_width(game->display)*0.3125*3, al_get_display_height(game->display)*0.63*3);
game->intro.animsprites[1] = LoadScaledBitmap("levels/derpy/walk.png", al_get_display_width(game->display)*0.3125*3, al_get_display_height(game->display)*0.63*3);
game->intro.animsprites[2] = LoadScaledBitmap("intro/zombie.png", al_get_display_width(game->display)*0.3125*3, al_get_display_height(game->display)*0.63*3);
game->intro.animsprites[2] = LoadScaledBitmap("intro/3.png", al_get_display_width(game->display)*0.3125*3, al_get_display_height(game->display)*0.63*3);
game->intro.animsprites[3] = LoadScaledBitmap("loading.png", al_get_display_width(game->display)*0.3125*3, al_get_display_height(game->display)*0.63*3);
game->intro.animsprites[4] = LoadScaledBitmap("about/letter.png", al_get_display_width(game->display)*0.3125*3, al_get_display_height(game->display)*0.63*3);

View file

@ -36,6 +36,7 @@ void Loading_Draw(struct Game *game) {
PreloadGameState(game);
al_wait_for_vsync();
al_start_timer(game->timer);
for(fadeloop=255; fadeloop>0; fadeloop-=tps(game, 600)){

View file

@ -1,5 +1,4 @@
/*! \file main.c
* \brief Main file of SuperDerpy engine.
/*! \file main.c * \brief Main file of SuperDerpy engine.
*
* Contains basic functions shared by all views.
*/
@ -343,7 +342,7 @@ int main(int argc, char **argv){
if (game.fullscreen) al_set_new_display_flags(ALLEGRO_FULLSCREEN_WINDOW);
else al_set_new_display_flags(ALLEGRO_WINDOWED);
al_set_new_display_option(ALLEGRO_VSYNC, atoi(GetConfigOptionDefault("SuperDerpy", "vsync", "1")), ALLEGRO_SUGGEST);
al_set_new_display_option(ALLEGRO_VSYNC, 2-atoi(GetConfigOptionDefault("SuperDerpy", "vsync", "1")), ALLEGRO_SUGGEST);
al_set_new_display_option(ALLEGRO_OPENGL, atoi(GetConfigOptionDefault("SuperDerpy", "opengl", "1")), ALLEGRO_SUGGEST);
al_set_new_display_option(ALLEGRO_SAMPLE_BUFFERS, 1, ALLEGRO_SUGGEST);
al_set_new_display_option(ALLEGRO_SAMPLES, 8, ALLEGRO_SUGGEST);
@ -408,6 +407,7 @@ int main(int argc, char **argv){
return -1;
}
al_register_event_source(game.event_queue, al_get_timer_event_source(game.timer));
al_wait_for_vsync();
al_start_timer(game.timer);
setlocale(LC_NUMERIC, "C"); /* FIXME? */