[Super-tux-commit] supertux/src leveleditor.cpp,1.51,1.52
Brought to you by:
wkendrick
From: Ricardo C. <rm...@us...> - 2004-04-19 14:24:39
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22306/src Modified Files: leveleditor.cpp Log Message: Fixed a help font bug (was using normal fonts, instead of the small ones). Tried to make leveleditor quit when SDL_QUIT signal is received without success. Why doesn't this work? :( Index: leveleditor.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/leveleditor.cpp,v retrieving revision 1.51 retrieving revision 1.52 diff -u -d -r1.51 -r1.52 --- leveleditor.cpp 18 Apr 2004 21:45:13 -0000 1.51 +++ leveleditor.cpp 19 Apr 2004 14:24:30 -0000 1.52 @@ -38,8 +38,7 @@ #include "resources.h" /* definitions to aid development */ -#define DONE_LEVELEDITOR 1 -#define DONE_QUIT 2 + /* definitions that affect gameplay */ #define KEY_CURSOR_SPEED 32 @@ -223,7 +222,7 @@ update_subset_settings_menu(); break; case 7: - done = DONE_LEVELEDITOR; + done = 1; break; } } @@ -333,8 +332,11 @@ mouse_cursor->draw(); +printf("done: %i\n", done); + if(done) { +printf("done\n"); le_quit(); return 0; } @@ -794,6 +796,10 @@ { switch(event.type) { + case SDL_QUIT: // window closed +printf("window closed\n"); + done = -1; + break; case SDL_KEYDOWN: // key pressed key = event.key.keysym.sym; switch(key) @@ -909,9 +915,6 @@ } } break; - case SDL_QUIT: // window closed - done = DONE_QUIT; - break; default: break; } @@ -1217,7 +1220,7 @@ void le_showhelp() { SDL_Event event; - unsigned int i, done; + unsigned int i, done_; char *text[] = { " - This is SuperTux's built-in level editor -", "It has been designed to be light and easy to use from the start.", @@ -1253,17 +1256,17 @@ blue_text->drawf("- Help -", 0, 30, A_HMIDDLE, A_TOP, 2); for(i = 0; i < sizeof(text)/sizeof(char *); i++) - white_text->draw(text[i], 5, 80+(i*18), 1); + white_small_text->draw(text[i], 5, 80+(i*white_small_text->h), 1); gold_text->drawf("Press Any Key to Continue", 0, 440, A_HMIDDLE, A_TOP, 1); flipscreen(); - done = 0; + done_ = 0; - while(done == 0) + while(done_ == 0) { - done = wait_for_event(event); + done_ = wait_for_event(event); SDL_Delay(50); } } |