From de52b3e7ce2a8faf766b4f93b5bbc6afdec12163 Mon Sep 17 00:00:00 2001 From: EvanR Date: Sun, 7 Mar 2010 10:20:16 -0600 Subject: [PATCH] Changed relevant printf to boot_msg and error_msg. --- audio.c | 2 +- graphics.c | 2 +- inner.c | 5 +++++ midi.c | 6 +++--- seq.c | 5 ----- soundtest.c | 2 +- synth.c | 2 +- text.c | 9 +++------ zip.c | 2 +- 9 files changed, 16 insertions(+), 19 deletions(-) diff --git a/audio.c b/audio.c index fa33c6c..07b82c9 100644 --- a/audio.c +++ b/audio.c @@ -128,7 +128,7 @@ void audio_init(){ memset(lout, 0, got.samples*sizeof(float)); memset(rout, 0, got.samples*sizeof(float)); - printf(" sound online\n"); + boot_msg(" sound online\n"); SDL_PauseAudio(0); } diff --git a/graphics.c b/graphics.c index 62acc6f..71a3091 100644 --- a/graphics.c +++ b/graphics.c @@ -196,7 +196,7 @@ void animate_sprites(){ int load_sprite(char* filename, int id){ int i; - printf("loading %s\n",filename); + //printf("loading %s\n",filename); char path[1024] = "sprites/"; strncat(path, filename, 1023 - strlen(filename)); diff --git a/inner.c b/inner.c index 997d5b0..83644ad 100644 --- a/inner.c +++ b/inner.c @@ -8,6 +8,7 @@ #include //#include #include +#include #include @@ -52,6 +53,10 @@ static void draw(){ } static void press(input in){ + if(in.button == ESCAPE_KEY){ + game_is_over(); + return; + } printf("press: %s\n", input_str(in)); /* check global keys diff --git a/midi.c b/midi.c index 445e36d..3741f1e 100644 --- a/midi.c +++ b/midi.c @@ -114,7 +114,7 @@ int conv_divisions(int divraw){ return divraw; } else{ - printf("midi_load: time division is given in frames per second, expect breakage without further support\n"); + error_msg("midi_load: time division is given in frames per second, expect breakage without further support\n"); return abs(divraw>>8); } } @@ -161,7 +161,7 @@ event* meta_tempochange(reader* r, int tick){ } event* meta_possibleloop(reader* r, int tick){ -printf("ERR meta_possibleloop not done\n"); +error_msg("ERR meta_possibleloop not done\n"); return NULL; } @@ -180,7 +180,7 @@ event* meta_dummy(reader* r, int tick){ } event* skip_sys(reader* r, int tick){ -printf("ERR skip_sys not done\n"); +error_msg("ERR skip_sys not done\n"); return NULL; } diff --git a/seq.c b/seq.c index 31a7362..65ac307 100644 --- a/seq.c +++ b/seq.c @@ -66,12 +66,10 @@ event* dequeue_event(){ advance_event(e); if(e->type == EVX_TEMPOCHANGE){ -//printf("tempo change to %d bpm\n", e->val1); bpm = e->val1; } if(e->type == EVX_TICKSPERBEAT){ -//printf("setting tpb to %d\n", e->val1); tpb = e->val1; } @@ -80,9 +78,6 @@ event* dequeue_event(){ event_after_loop = next_event; } - -//printf("event (%d, %03x, %d, %d, %d)\n", e->tick, e->type, e->chan, e->val1, e->val2); - return e; } else{ diff --git a/soundtest.c b/soundtest.c index e49d548..d5a63b3 100644 --- a/soundtest.c +++ b/soundtest.c @@ -59,7 +59,7 @@ void setup_inner(){ console_clear(); if(music_load("last_battle.mid", MUS_TEST1) < 0){ - printf("open music failed\n"); + error_msg("open music failed\n"); } else{ music_play(MUS_TEST1); diff --git a/synth.c b/synth.c index 978f611..fe94a84 100644 --- a/synth.c +++ b/synth.c @@ -158,7 +158,7 @@ void clip(float buf[], int count){ } if(clipped){ - printf("synth: clipping distortion due to output overload\n"); + error_msg("synth: clipping distortion due to output overload\n"); } avg /= count?count:1; diff --git a/text.c b/text.c index b0d1634..5daf8f0 100644 --- a/text.c +++ b/text.c @@ -58,7 +58,6 @@ void set_message(char* str){ if the current word is longer than a whole line then just break here (would happen with japanese). */ - //printf("%04lx[%lc] ",u, C->u); } else{ /* @@ -66,11 +65,9 @@ character not found, so use a rectangle or something use four tiny numbers to indicate the character do the same as above */ - //printf("%04lx[???] ", u); } N += unicode_getc(str+N, &u); }; - printf("\n"); } @@ -160,7 +157,7 @@ void randomly_insert(vwchar* C[], int count){ int load_font(char* filename){ - printf("load_font: loading %s\n",filename); + //printf("load_font: loading %s\n",filename); char buf[256] = "fonts/"; strmcat(buf, filename, 256); reader* rd = loader_open(buf); @@ -191,12 +188,12 @@ int load_font(char* filename){ } randomly_insert(C, ptr); - +/* printf(" loaded %d characters\n",N); printf(" character tree is the following\n"); print_tree(chartree); printf("\n"); - +*/ return 0; } diff --git a/zip.c b/zip.c index dff41ce..5820677 100644 --- a/zip.c +++ b/zip.c @@ -117,7 +117,7 @@ static void hash_insert(zip_archive* arc, struct record* rec){ struct record* ptr = arc->table[i]; if(get_record(arc, rec->filename)){ - printf("cant insert %s twice\n", rec->filename); + fprintf(stderr, "zip: can't insert %s twice\n", rec->filename); return; } -- 2.11.4.GIT