From c2ef5e6d22697ba7ac242274f863d0c391ff0116 Mon Sep 17 00:00:00 2001 From: Sebastian Krzyszkowiak Date: Sun, 19 Feb 2012 19:17:04 +0100 Subject: [PATCH] replace sounds with flac files --- .gitignore | 2 ++ main.c | 16 ++++++++-------- make | 2 +- menu.c | 4 ++-- 4 files changed, 13 insertions(+), 11 deletions(-) diff --git a/.gitignore b/.gitignore index 135c829..110b9cb 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,4 @@ *~ +allegro.log superderpy +others diff --git a/main.c b/main.c index b02dc63..72ad63d 100644 --- a/main.c +++ b/main.c @@ -9,10 +9,10 @@ float FPS = 60; int DISPLAY_WIDTH = 800; int DISPLAY_HEIGHT = 500; bool FULLSCREEN = true; -bool DEBUG = true; +bool DEBUG_MODE = true; void PrintConsole(struct Game *game, char* text) { - if (DEBUG) printf("%s\n", text); + if (DEBUG_MODE) printf("%s\n", text); ALLEGRO_BITMAP *con = al_create_bitmap(al_get_bitmap_width(game->console), al_get_bitmap_height(game->console)*1.0); al_set_target_bitmap(con); al_clear_to_color(al_map_rgba(0,0,0,80)); @@ -137,6 +137,11 @@ int main(int argc, char **argv){ return 0; } + if(!al_init_acodec_addon()){ + fprintf(stderr, "failed to initialize audio codecs!\n"); + return -1; + } + if(!al_install_audio()){ fprintf(stderr, "failed to initialize audio!\n"); return -1; @@ -146,11 +151,6 @@ int main(int argc, char **argv){ fprintf(stderr, "failed to initialize keyboard!\n"); return -1; } - - if(!al_init_acodec_addon()){ - fprintf(stderr, "failed to initialize audio codecs!\n"); - return -1; - } if (!al_reserve_samples(2)){ fprintf(stderr, "failed to reserve samples!\n"); @@ -186,7 +186,7 @@ int main(int argc, char **argv){ al_register_event_source(game.event_queue, al_get_timer_event_source(game.timer)); al_register_event_source(game.event_queue, al_get_keyboard_event_source()); - game.showconsole = DEBUG; + game.showconsole = DEBUG_MODE; game.console = al_create_bitmap(al_get_display_width(game.display), al_get_display_height(game.display)*0.12); al_set_target_bitmap(game.console); al_clear_to_color(al_map_rgba(0,0,0,80)); diff --git a/make b/make index 448fcbd..f8c36f0 100755 --- a/make +++ b/make @@ -1,2 +1,2 @@ #!/bin/sh -gcc loading.c main.c menu.c about.c intro.c map.c -o superderpy -lallegro -lallegro_audio -lallegro_acodec -lallegro_image -lallegro_font -lallegro_ttf -std=gnu99 -g && ./superderpy +gcc loading.c main.c menu.c about.c intro.c map.c -o superderpy -lallegro -lallegro_audio-debug -lallegro_acodec-debug -lallegro_image-debug -lallegro_font-debug -lallegro_ttf-debug -DDEBUG -std=gnu99 -g && ./superderpy diff --git a/menu.c b/menu.c index a269f57..38be457 100644 --- a/menu.c +++ b/menu.c @@ -63,8 +63,8 @@ void Menu_Preload(struct Game *game) { //al_destroy_bitmap(game->menu.image); // ugh... game->menu.image = al_load_bitmap( "data/menu.png" ); game->menu.mountain = al_load_bitmap( "data/mountain.png" ); - game->menu.sample = al_load_sample( "data/menu.wav" ); - game->menu.rain_sample = al_load_sample( "data/rain.wav" ); + game->menu.sample = al_load_sample( "data/menu.flac" ); + game->menu.rain_sample = al_load_sample( "data/rain.flac" ); game->menu.cloud = al_load_bitmap( "data/cloud.png" ); game->menu.cloud2 = al_load_bitmap( "data/cloud2.png" ); game->menu.pinkcloud = al_load_bitmap( "data/pinkcloud.png" );