super-tux-commit Mailing List for Super Tux (Page 101)
Brought to you by:
wkendrick
You can subscribe to this list here.
2004 |
Jan
|
Feb
|
Mar
(94) |
Apr
(500) |
May
(531) |
Jun
(196) |
Jul
(224) |
Aug
(193) |
Sep
(117) |
Oct
(115) |
Nov
(319) |
Dec
(97) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2005 |
Jan
(19) |
Feb
|
Mar
(105) |
Apr
(41) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2006 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(6) |
2007 |
Jan
(1) |
Feb
(2) |
Mar
|
Apr
(1) |
May
|
Jun
|
Jul
(2) |
Aug
(2) |
Sep
|
Oct
|
Nov
|
Dec
|
2008 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
(4) |
Jul
|
Aug
|
Sep
(7) |
Oct
(12) |
Nov
(26) |
Dec
(39) |
2009 |
Jan
(6) |
Feb
(15) |
Mar
(10) |
Apr
(25) |
May
(29) |
Jun
(21) |
Jul
(26) |
Aug
(8) |
Sep
(3) |
Oct
|
Nov
|
Dec
(10) |
2010 |
Jan
(5) |
Feb
(5) |
Mar
(2) |
Apr
|
May
(5) |
Jun
|
Jul
(1) |
Aug
(2) |
Sep
(2) |
Oct
(2) |
Nov
|
Dec
|
From: Tobias Gl??er <to...@us...> - 2004-03-29 13:36:12
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21235/src Modified Files: badguy.cpp badguy.h gameloop.cpp globals.cpp globals.h intro.cpp leveleditor.cpp menu.cpp scene.cpp scene.h special.cpp Log Message: - introduced new function wait_for_event - removed arrays_init() - applied fixes from Matze Braun for badguy bugs Index: scene.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/scene.cpp,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- scene.cpp 24 Mar 2004 22:15:44 -0000 1.9 +++ scene.cpp 29 Mar 2004 13:24:42 -0000 1.10 @@ -45,10 +45,6 @@ timer_type time_left; double frame_ratio; -void arrays_init(void) -{ -} - void arrays_free(void) { bad_guys.clear(); Index: intro.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/intro.cpp,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- intro.cpp 22 Mar 2004 15:52:35 -0000 1.8 +++ intro.cpp 29 Mar 2004 13:24:41 -0000 1.9 @@ -2,7 +2,7 @@ intro.c Super Tux - Intro Screen - + by Bill Kendrick bi...@ne... http://www.newbreedsoftware.com/supertux/ @@ -29,11 +29,11 @@ #include "timer.h" char * intro_text[] = { - "Tux and Gown were having a nice picnic..", - "when suddenly...", - "Gown is beamed away!!!", - "This looks like a job for ---" -}; + "Tux and Gown were having a nice picnic..", + "when suddenly...", + "Gown is beamed away!!!", + "This looks like a job for ---" + }; /* --- INTRO --- */ @@ -42,16 +42,16 @@ { SDL_Event event; texture_type bkgd, copter_squish, copter_stretch, beam, - gown_sit, gown_lookup, gown_upset, - tux_sit, tux_upset, tux_mad; + gown_sit, gown_lookup, gown_upset, + tux_sit, tux_upset, tux_mad; texture_type copter[2]; SDL_Rect src, dest; int done, i, quit, j, scene; int * height, * height_speed; timer_type timer; - + /* Load sprite images: */ - texture_load(&bkgd, datadir + "/images/intro/intro.png", IGNORE_ALPHA); + texture_load(&bkgd, datadir + "/images/intro/intro.png", IGNORE_ALPHA); texture_load(&gown_sit, datadir + "/images/intro/gown-sit.png", USE_ALPHA); texture_load(&gown_lookup, datadir + "/images/intro/gown-lookup.png", USE_ALPHA); texture_load(&gown_upset, datadir + "/images/intro/gown-upset.png", USE_ALPHA); @@ -59,244 +59,228 @@ texture_load(&tux_upset, datadir + "/images/intro/tux-upset.png", USE_ALPHA); texture_load(&tux_mad, datadir + "/images/intro/tux-mad.png", USE_ALPHA); texture_load(&copter[0], datadir + "/images/intro/copter1.png", USE_ALPHA); - texture_load(&copter[1], datadir + "/images/intro/copter2.png", USE_ALPHA); - texture_load(&copter_squish, datadir + "/images/intro/copter-squish.png", USE_ALPHA); - texture_load(&copter_stretch, datadir + "/images/intro/copter-stretch.png", USE_ALPHA); - texture_load(&beam, datadir + "/images/intro/beam.png", USE_ALPHA); - + texture_load(&copter[1], datadir + "/images/intro/copter2.png", USE_ALPHA); + texture_load(&copter_squish, datadir + "/images/intro/copter-squish.png", USE_ALPHA); + texture_load(&copter_stretch, datadir + "/images/intro/copter-stretch.png", USE_ALPHA); + texture_load(&beam, datadir + "/images/intro/beam.png", USE_ALPHA); + /* Allocate buffer for height array: */ - + height = (int*) malloc(sizeof(int) * (gown_upset.w)); height_speed = (int*) malloc(sizeof(int) * (gown_upset.w)); - - + + /* Initialize height arrays: */ - + for (j = 0; j < (gown_upset.w); j++) { height[j] = 400; height_speed[j] = (rand() % 10) + 1; } - - /* Display background: */ - + + /* Display background: */ + texture_draw_bg(&bkgd, UPDATE); - + /* Animation: */ - + done = 0; quit = 0; scene = 0; i = 0; - + timer_init(&timer, false); timer_start(&timer,10000); - + while (timer_check(&timer) && !done && !quit) { - - /* Handle events: */ - - while (SDL_PollEvent(&event)) + + + done = wait_for_event(event,0); + if(done == 2) { - if (event.type == SDL_QUIT) - { - /* Quit event - quit: */ - - quit = 1; - } - else if (event.type == SDL_KEYDOWN) - { - /* Keypress - skip intro: */ - - done = 1; - } - else if (event.type == SDL_JOYBUTTONDOWN) - { - /* Fire button - skip intro: */ - - done = 1; - } - } - - - /* Display background: */ - + quit = 1; + done = 0; + } + + + /* Display background: */ + /* Draw things: */ - + if (timer_get_gone(&timer) < 2000 && scene == 0) - { - ++scene; - /* Gown and tux sitting: */ - - texture_draw(&tux_sit, 270, 400, UPDATE); - texture_draw(&gown_sit, 320, 400, UPDATE); - - text_drawf(&white_text, intro_text[0], 0, -8, A_HMIDDLE, A_BOTTOM, 0); - } - - + { + ++scene; + /* Gown and tux sitting: */ + + texture_draw(&tux_sit, 270, 400, UPDATE); + texture_draw(&gown_sit, 320, 400, UPDATE); + + text_drawf(&white_text, intro_text[0], 0, -8, A_HMIDDLE, A_BOTTOM, 0); + } + + if (timer_get_gone(&timer) >= 2000 && scene == 1) - { - ++scene; - /* Helicopter begins to fly in: */ - - erasecenteredtext(&white_text, intro_text[0], 454, &bkgd, NO_UPDATE, 1); - text_drawf(&white_text, intro_text[1], 0,-8, A_HMIDDLE, A_BOTTOM, 0); - } + { + ++scene; + /* Helicopter begins to fly in: */ + + erasecenteredtext(&white_text, intro_text[0], 454, &bkgd, NO_UPDATE, 1); + text_drawf(&white_text, intro_text[1], 0,-8, A_HMIDDLE, A_BOTTOM, 0); + } + - if (timer_get_gone(&timer) >= 2000 && timer_get_gone(&timer) < 4000) - { - /* Helicopter flying in: */ - texture_draw_part(&bkgd,0,32, 0, 32, screen->w, (copter[0].h)); - - texture_draw(&copter[i % 2], - (float)(timer_get_gone(&timer) - 2000) / 5 - (copter[0].w), 32, - NO_UPDATE); + { + /* Helicopter flying in: */ + texture_draw_part(&bkgd,0,32, 0, 32, screen->w, (copter[0].h)); + + texture_draw(&copter[i % 2], + (float)(timer_get_gone(&timer) - 2000) / 5 - (copter[0].w), 32, + NO_UPDATE); + + update_rect(screen, 0, 32, screen->w, (copter[0].h)); + } - update_rect(screen, 0, 32, screen->w, (copter[0].h)); - } - if (timer_get_gone(&timer) >= 2500 && scene == 2) - { - ++scene; - /* Gown notices something... */ - - texture_draw(&gown_lookup, 320, 400, UPDATE); - } + { + ++scene; + /* Gown notices something... */ + + texture_draw(&gown_lookup, 320, 400, UPDATE); + } + - if (timer_get_gone(&timer) >= 3500 && scene == 3) - { - ++scene; - /* Gown realizes it's bad! */ - - texture_draw(&gown_upset, 320, 400, UPDATE); - } + { + ++scene; + /* Gown realizes it's bad! */ + + texture_draw(&gown_upset, 320, 400, UPDATE); + } + - if (timer_get_gone(&timer) >= 4000 && timer_get_gone(&timer) < 8000) - { - /* Helicopter sits: */ - texture_draw_part(&bkgd,0,32, 0, 32, screen->w, (copter[0].h)); - - texture_draw(&copter[i % 2], 400 - (copter[0].w), 32); - update_rect(screen, 0, 32, screen->w, (copter[0].h)); - } + { + /* Helicopter sits: */ + texture_draw_part(&bkgd,0,32, 0, 32, screen->w, (copter[0].h)); + + texture_draw(&copter[i % 2], 400 - (copter[0].w), 32); + update_rect(screen, 0, 32, screen->w, (copter[0].h)); + } + - if (timer_get_gone(&timer) >= 5000 && scene == 4) - { - ++scene; - /* Tux realizes something's happening: */ - - texture_draw(&tux_upset, 270, 400, UPDATE); - - - erasecenteredtext(&white_text, intro_text[1], 454, &bkgd, UPDATE, 1); - text_drawf(&white_text, intro_text[2], 0,-8, A_HMIDDLE, A_BOTTOM, 0); - } - - + { + ++scene; + /* Tux realizes something's happening: */ + + texture_draw(&tux_upset, 270, 400, UPDATE); + + + erasecenteredtext(&white_text, intro_text[1], 454, &bkgd, UPDATE, 1); + text_drawf(&white_text, intro_text[2], 0,-8, A_HMIDDLE, A_BOTTOM, 0); + } + + if (timer_get_gone(&timer) >= 5000 && timer_get_gone(&timer) <= 8000) - { - /* Beam gown up! */ - - texture_draw_part(&bkgd, - 310, 32 + (copter[0].h), 310, - 32 + (copter[0].h), - (gown_upset.w) + 20, - 376 + (gown_upset.h) - (copter[0].h)); - - - for (j = 0; j < (gown_upset.sdl_surface -> w); j++) - { - texture_draw(&beam, 320 + j - ((beam.w) / 2), height[j], - NO_UPDATE); - - src.x = j; - src.y = 0; - src.w = 1; - src.h = (gown_upset.h); - - dest.x = 320 + j; - dest.y = height[j]; - dest.w = src.w; - dest.h = src.h; - - texture_draw_part(&gown_upset,src.x,src.y,dest.x,dest.y,dest.w,dest.h); - - height[j] = 400 + rand() % 10 - (int)(300. * ((float)(timer_get_gone(&timer) - 5000)/(float)3000.)); - if(height[j] < 105) - height[j] = 105; - } + { + /* Beam gown up! */ + + texture_draw_part(&bkgd, + 310, 32 + (copter[0].h), 310, + 32 + (copter[0].h), + (gown_upset.w) + 20, + 376 + (gown_upset.h) - (copter[0].h)); + + + for (j = 0; j < (gown_upset.sdl_surface -> w); j++) + { + texture_draw(&beam, 320 + j - ((beam.w) / 2), height[j], + NO_UPDATE); + + src.x = j; + src.y = 0; + src.w = 1; + src.h = (gown_upset.h); + + dest.x = 320 + j; + dest.y = height[j]; + dest.w = src.w; + dest.h = src.h; + + texture_draw_part(&gown_upset,src.x,src.y,dest.x,dest.y,dest.w,dest.h); + + height[j] = 400 + rand() % 10 - (int)(300. * ((float)(timer_get_gone(&timer) - 5000)/(float)3000.)); + if(height[j] < 105) + height[j] = 105; + } + + update_rect(screen, + 310, + 32 + (copter[0].h), + (gown_upset.w) + 20, + 400 + (gown_upset.h) - (copter[0].h)); + } + - update_rect(screen, - 310, - 32 + (copter[0].h), - (gown_upset.w) + 20, - 400 + (gown_upset.h) - (copter[0].h)); - } - - if (timer_get_gone(&timer) >= 8000 && scene == 5) - { - texture_draw_part(&bkgd, - 310, 32 + (copter[0].h), 310, - 32 + (copter[0].h), - (gown_upset.w) + 20, - 368 + (gown_upset.h) - (copter[0].h)); - - ++scene; - /* Tux gets mad! */ - - texture_draw(&tux_mad, 270, 400, UPDATE); - - erasecenteredtext(&white_text, intro_text[2], 454, &bkgd, UPDATE, 1); - text_drawf(&white_text, intro_text[3], 0,-8, A_HMIDDLE, A_BOTTOM, 0); - } - - + { + texture_draw_part(&bkgd, + 310, 32 + (copter[0].h), 310, + 32 + (copter[0].h), + (gown_upset.w) + 20, + 368 + (gown_upset.h) - (copter[0].h)); + + ++scene; + /* Tux gets mad! */ + + texture_draw(&tux_mad, 270, 400, UPDATE); + + erasecenteredtext(&white_text, intro_text[2], 454, &bkgd, UPDATE, 1); + text_drawf(&white_text, intro_text[3], 0,-8, A_HMIDDLE, A_BOTTOM, 0); + } + + if (timer_get_gone(&timer) >= 8000 && timer_get_gone(&timer) <= 8250) - { - /* Helicopter starting to speed off: */ - - texture_draw_part(&bkgd, 0, 32, 0, 32, screen->w, (copter_squish.h)); - - texture_draw(&copter_squish, - 400 - (copter[0].w), 32, - NO_UPDATE); + { + /* Helicopter starting to speed off: */ - update_rect(screen, 0, 32, screen->w, (copter_squish.h)); - } + texture_draw_part(&bkgd, 0, 32, 0, 32, screen->w, (copter_squish.h)); + + texture_draw(&copter_squish, + 400 - (copter[0].w), 32, + NO_UPDATE); + + update_rect(screen, 0, 32, screen->w, (copter_squish.h)); + } if (timer_get_gone(&timer) >= 8250) - { - /* Helicopter speeding off: */ - - texture_draw_part(&bkgd, 0, 32, 0, 32, screen->w, (copter_stretch.h)); - - texture_draw(&copter_stretch, - (timer_get_gone(&timer) - 8250) /*(i - (8250 / FPS)) * 30*/ + 400 - (copter[0].w), - 32, - NO_UPDATE); - - update_rect(screen, 0, 32, screen->w, (copter_stretch.h)); - } - - flipscreen(); + { + /* Helicopter speeding off: */ + + texture_draw_part(&bkgd, 0, 32, 0, 32, screen->w, (copter_stretch.h)); + + texture_draw(&copter_stretch, + (timer_get_gone(&timer) - 8250) /*(i - (8250 / FPS)) * 30*/ + 400 - (copter[0].w), + 32, + NO_UPDATE); + + update_rect(screen, 0, 32, screen->w, (copter_stretch.h)); + } + + flipscreen(); ++i; /* Pause: */ SDL_Delay(20); } - + /* Free surfaces: */ - + texture_free(&bkgd); texture_free(&gown_sit); texture_free(&gown_lookup); @@ -309,15 +293,15 @@ texture_free(&copter_squish); texture_free(&copter_stretch); texture_free(&beam); - - + + /* Free array buffers: */ - + free(height); free(height_speed); - - + + /* Return to main! */ - + return(quit); } Index: special.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/special.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- special.cpp 24 Mar 2004 17:41:04 -0000 1.4 +++ special.cpp 29 Mar 2004 13:24:42 -0000 1.5 @@ -89,10 +89,15 @@ void bullet_collision(bullet_type* pbullet, int c_object) { - - if(c_object == CO_BADGUY) - bullets.erase(static_cast<std::vector<bullet_type>::iterator>(pbullet)); - + if(c_object == CO_BADGUY) { + std::vector<bullet_type>::iterator i; + for(i = bullets.begin(); i != bullets.end(); ++i) { + if(& (*i) == pbullet) { + bullets.erase(i); + return; + } + } + } } void upgrade_init(upgrade_type *pupgrade, float x, float y, int dir, int kind) Index: globals.h =================================================================== RCS file: /cvsroot/super-tux/supertux/src/globals.h,v retrieving revision 1.20 retrieving revision 1.21 diff -u -d -r1.20 -r1.21 --- globals.h 28 Mar 2004 01:00:16 -0000 1.20 +++ globals.h 29 Mar 2004 13:24:41 -0000 1.21 @@ -44,6 +44,8 @@ extern SDL_Joystick * js; +int wait_for_event(SDL_Event& event,unsigned int min_delay = 0, unsigned int max_delay = 0, bool empty_events = false); + #define JOYSTICK_DEAD_ZONE 4096 #endif /* SUPERTUX_GLOBALS_H */ Index: scene.h =================================================================== RCS file: /cvsroot/super-tux/supertux/src/scene.h,v retrieving revision 1.14 retrieving revision 1.15 diff -u -d -r1.14 -r1.15 --- scene.h 24 Mar 2004 22:23:48 -0000 1.14 +++ scene.h 29 Mar 2004 13:24:42 -0000 1.15 @@ -53,7 +53,6 @@ void add_score(float x, float y, int s); void set_defaults(void); -void arrays_init(void); void arrays_free(void); void add_bouncy_distro(float x, float y); Index: gameloop.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/gameloop.cpp,v retrieving revision 1.38 retrieving revision 1.39 diff -u -d -r1.38 -r1.39 --- gameloop.cpp 28 Mar 2004 14:11:53 -0000 1.38 +++ gameloop.cpp 29 Mar 2004 13:24:41 -0000 1.39 @@ -87,7 +87,8 @@ flipscreen(); - SDL_Delay(1000); + SDL_Event event; + wait_for_event(event,1000,3000,true); } /* Reset Timers */ @@ -370,7 +371,6 @@ } arrays_free(); - arrays_init(); activate_bad_guys(); activate_particle_systems(); level_free_gfx(); @@ -594,7 +594,7 @@ level = levelnb; /* Init the game: */ - arrays_init(); + arrays_free(); set_defaults(); strcpy(level_subset,subset); @@ -761,8 +761,10 @@ /* Pause till next frame, if the machine running the game is too fast: */ /* FIXME: Works great for in OpenGl mode, where the CPU doesn't have to do that much. But the results in SDL mode aren't perfect (thought the 100 FPS are reached), even on an AMD2500+. */ - if(last_update_time >= update_time - 12 && !jump) + if(last_update_time >= update_time - 12 && !jump) { SDL_Delay(10); + update_time = st_get_ticks(); + } /*if((update_time - last_update_time) < 10) SDL_Delay((11 - (update_time - last_update_time))/2);*/ @@ -1548,7 +1550,9 @@ text_drawf(&gold_text, str, 0, 256, A_HMIDDLE, A_TOP, 1); flipscreen(); - SDL_Delay(2000); + + SDL_Event event; + wait_for_event(event,2000,5000,true); } void drawresultscreen(void) @@ -1566,7 +1570,9 @@ text_drawf(&gold_text, str, 0, 256, A_HMIDDLE, A_TOP, 1); flipscreen(); - SDL_Delay(2000); + + SDL_Event event; + wait_for_event(event,2000,5000,true); } void savegame(int slot) @@ -1632,7 +1638,6 @@ if(level_load(¤t_level,level_subset,level) != 0) exit(1); arrays_free(); - arrays_init(); activate_bad_guys(); activate_particle_systems(); level_free_gfx(); Index: menu.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/menu.cpp,v retrieving revision 1.21 retrieving revision 1.22 diff -u -d -r1.21 -r1.22 --- menu.cpp 28 Mar 2004 21:42:04 -0000 1.21 +++ menu.cpp 29 Mar 2004 13:24:42 -0000 1.22 @@ -129,6 +129,7 @@ { pos_x = screen->w/2; pos_y = screen->h/2; + last_menu = 0; arrange_left = 0; num_items = 0; active_item = 0; Index: globals.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/globals.cpp,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- globals.cpp 28 Mar 2004 01:00:16 -0000 1.7 +++ globals.cpp 29 Mar 2004 13:24:41 -0000 1.8 @@ -21,12 +21,12 @@ MouseCursor * mouse_cursor; bool use_gl; -bool use_joystick; +bool use_joystick; bool use_fullscreen; bool debug_mode; bool show_fps; -int joystick_num = 0; +int joystick_num = 0; char* level_startup_file = 0; bool launch_worldmap_mode = false; @@ -35,4 +35,59 @@ SDL_Joystick * js; +/* Returns 1 for every button event, 2 for a quit event and 0 for no event. */ +int wait_for_event(SDL_Event& event,unsigned int min_delay, unsigned int max_delay, bool empty_events) +{ + int i; + timer_type maxdelay; + timer_type mindelay; + timer_init(&maxdelay,false); + timer_init(&mindelay,false); + + if(max_delay < min_delay) + max_delay = min_delay; + + timer_start(&maxdelay,max_delay); + timer_start(&mindelay,min_delay); + + if(empty_events) + while (SDL_PollEvent(&event)) + {} + /* Handle events: */ + + for(i = 0; timer_check(&maxdelay) || !i; ++i) + { + while (SDL_PollEvent(&event)) + { + if(!timer_check(&mindelay)) + { + if (event.type == SDL_QUIT) + { + /* Quit event - quit: */ + return 2; + } + else if (event.type == SDL_KEYDOWN) + { + /* Keypress - skip intro: */ + + return 1; + } + else if (event.type == SDL_JOYBUTTONDOWN) + { + /* Fire button - skip intro: */ + + return 1; + } + else if (event.type == SDL_MOUSEBUTTONDOWN) + { + /* Mouse button - skip intro: */ + return 1; + } + } + } + SDL_Delay(10); + } + + return 0; +} Index: leveleditor.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/leveleditor.cpp,v retrieving revision 1.25 retrieving revision 1.26 diff -u -d -r1.25 -r1.26 --- leveleditor.cpp 28 Mar 2004 21:42:04 -0000 1.25 +++ leveleditor.cpp 29 Mar 2004 13:24:41 -0000 1.26 @@ -240,7 +240,7 @@ le_level_subset.load(level_subsets.item[i-2]); leveleditor_menu->item[3].kind = MN_GOTO; le_level = 1; - arrays_init(); + arrays_free(); loadshared(); le_current_level = new st_level; if(level_load(le_current_level, le_level_subset.name.c_str(), le_level) != 0) @@ -271,7 +271,7 @@ le_level_subset.load(subset_new_menu->item[2].input); leveleditor_menu->item[3].kind = MN_GOTO; le_level = 1; - arrays_init(); + arrays_free(); loadshared(); le_current_level = new st_level; if(level_load(le_current_level, le_level_subset.name.c_str(), le_level) != 0) @@ -578,7 +578,6 @@ void le_goto_level(int levelnb) { arrays_free(); - arrays_init(); level_free(le_current_level); if(level_load(le_current_level, le_level_subset.name.c_str(), levelnb) != 0) @@ -1237,7 +1236,7 @@ level_save(le_current_level,"test",le_level); gameloop("test",le_level, ST_GL_TEST); Menu::set_current(leveleditor_menu); - arrays_init(); + arrays_free(); level_load_gfx(le_current_level); loadshared(); } Index: badguy.h =================================================================== RCS file: /cvsroot/super-tux/supertux/src/badguy.h,v retrieving revision 1.18 retrieving revision 1.19 diff -u -d -r1.18 -r1.19 --- badguy.h 28 Mar 2004 01:44:15 -0000 1.18 +++ badguy.h 29 Mar 2004 13:24:41 -0000 1.19 @@ -21,6 +21,11 @@ #include "physic.h" #include "collision.h" +extern texture_type img_bsod_left[4]; +extern texture_type img_bsod_right[4]; +extern texture_type img_laptop_left[3]; +extern texture_type img_money_left[2]; + /* Enemy modes: */ enum { NORMAL=0, @@ -28,6 +33,8 @@ KICK, HELD, + MONEY_JUMP, + BOMB_TICKING, BOMB_EXPLODE, @@ -35,26 +42,6 @@ STALACTITE_FALL }; -extern texture_type img_bsod_squished_left; -extern texture_type img_bsod_squished_right; -extern texture_type img_bsod_falling_left; -extern texture_type img_bsod_falling_right; -extern texture_type img_laptop_flat_left; -extern texture_type img_laptop_flat_right; -extern texture_type img_laptop_falling_left; -extern texture_type img_laptop_falling_right; -extern texture_type img_bsod_left[4]; -extern texture_type img_bsod_right[4]; -extern texture_type img_laptop_left[3]; -extern texture_type img_laptop_right[3]; -extern texture_type img_money_left[2]; -extern texture_type img_money_right[2]; -extern texture_type img_mrbomb_left[4]; -extern texture_type img_mrbomb_right[4]; -extern texture_type img_stalactite; -extern texture_type img_stalactite_broken; -extern texture_type img_flame[2]; - /* Bad guy kinds: */ enum BadGuyKind { BAD_BSOD, Index: badguy.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/badguy.cpp,v retrieving revision 1.17 retrieving revision 1.18 diff -u -d -r1.17 -r1.18 --- badguy.cpp 28 Mar 2004 21:42:04 -0000 1.17 +++ badguy.cpp 29 Mar 2004 13:24:41 -0000 1.18 @@ -33,6 +33,9 @@ texture_type img_money_right[2]; texture_type img_mrbomb_left[4]; texture_type img_mrbomb_right[4]; +texture_type img_mrbomb_ticking_left; +texture_type img_mrbomb_ticking_right; +texture_type img_mrbomb_explosion; texture_type img_stalactite; texture_type img_stalactite_broken; texture_type img_flame[2]; @@ -88,15 +91,15 @@ void BadGuy::init(float x, float y, BadGuyKind kind_) { + base.x = x; + base.y = y; base.width = 32; base.height = 32; mode = NORMAL; dying = DYING_NOT; kind = kind_; - base.x = x; - base.y = y; base.xm = -1.3; - base.ym = 4.8; + base.ym = 0; old_base = base; dir = LEFT; seen = false; @@ -110,6 +113,8 @@ dying = DYING_SQUISHED; } else if(kind == BAD_FLAME) { base.ym = 0; // we misuse base.ym as angle for the flame + } else if(kind == BAD_MONEY) { + base.ym = 4.8; } } @@ -118,14 +123,13 @@ /* --- BLUE SCREEN OF DEATH MONSTER: --- */ /* Move left/right: */ - if (dying == DYING_NOT || - dying == DYING_FALLING) + if (dying == DYING_NOT || dying == DYING_FALLING) { base.x += base.xm * frame_ratio; } /* Move vertically: */ - base.y = base.y + base.ym * frame_ratio; + base.y += base.ym * frame_ratio; if (dying != DYING_FALLING) collision_swept_object_map(&old_base,&base); @@ -136,13 +140,11 @@ fall(true); // Handle dying timer: - if (dying == DYING_SQUISHED) + if (dying == DYING_SQUISHED && !timer_check(&timer)) { /* Remove it if time's up: */ - if(!timer_check(&timer)) { - remove_me(); - return; - } + remove_me(); + return; } } @@ -219,18 +221,14 @@ fall(); /* Handle mode timer: */ - if (mode == FLAT && mode != HELD) + if (mode == FLAT) { if(!timer_check(&timer)) { mode = NORMAL; - base.xm = 4; + base.xm = (dir == LEFT) ? -1.3 : 1.3; } } - else if (mode == KICK) - { - timer_check(&timer); - } } void BadGuy::check_horizontal_bump(bool checkcliff) @@ -251,6 +249,8 @@ // don't check for cliffs when we're falling if(!checkcliff) return; + if(!issolid(base.x + base.width/2, base.y + base.height + 16)) + return; if(dir == LEFT && !issolid(base.x, (int) base.y + base.height + 16)) { @@ -274,7 +274,7 @@ /* Fall if we get off the ground: */ if (dying != DYING_FALLING) { - if (!issolid(base.x+16, base.y + 32)) + if (!issolid(base.x+base.width/2, base.y + base.height)) { if(!physic_is_set(&physic)) { @@ -282,18 +282,14 @@ physic_set_start_vy(&physic, dojump ? 2. : 0.); } - if(mode != HELD) - { - base.ym = physic_get_velocity(&physic); - } + base.ym = physic_get_velocity(&physic); } else { /* Land: */ - if (base.ym > 0) { - base.y = (int)(base.y / 32) * 32; + base.y = int((base.y + base.height)/32) * 32 - base.height; base.ym = 0; } physic_init(&physic); @@ -354,18 +350,12 @@ physic_set_state(&physic,PH_VT); physic_set_start_vy(&physic,6.); base.ym = physic_get_velocity(&physic); + mode = MONEY_JUMP; } - /* // matze: is this code needed? - else if(issolid(base.x, base.y)) - { // This works, but isn't the best solution imagineable - physic_set_state(&physic,PH_VT); - physic_set_start_vy(&physic,0.); - base.ym = physic_get_velocity(&physic); - ++base.y; - }*/ else { base.ym = physic_get_velocity(&physic); + mode = NORMAL; } } else @@ -407,6 +397,12 @@ mode = BOMB_EXPLODE; dying = DYING_NOT; // now the bomb hurts timer_start(&timer, 1000); + // explosion image has different size + base.x -= (img_mrbomb_explosion.w - base.width) / 2; + base.y -= img_mrbomb_explosion.h - base.height; + base.width = img_mrbomb_explosion.w; + base.height = img_mrbomb_explosion.h; + old_base = base; } else if(mode == BOMB_EXPLODE) { remove_me(); return; @@ -417,7 +413,11 @@ void BadGuy::action_stalactite() { if(mode == NORMAL) { - if(tux.base.x + 32 > base.x - 40 && tux.base.x < base.x + 32 + 40) { + static const int range = 40; + // start shaking when tux is below the stalactite and at least 40 pixels + // near + if(tux.base.x + 32 > base.x - range && tux.base.x < base.x + 32 + range + && tux.base.y + tux.base.height > base.y) { timer_start(&timer, 800); mode = STALACTITE_SHAKING; } @@ -427,7 +427,8 @@ mode = STALACTITE_FALL; } } else if(mode == STALACTITE_FALL) { - base.y += base.ym * frame_ratio; + base.y += base.ym * frame_ratio; + fall(); /* Destroy if collides land */ if(issolid(base.x+16, base.y+32)) { @@ -435,6 +436,10 @@ dying = DYING_SQUISHED; mode = FLAT; } + } else if(mode == FLAT) { + if(!timer_check(&timer)) { + remove_me(); + } } } @@ -451,52 +456,50 @@ void BadGuy::action() -{ - if (seen) - { - switch (kind) - { - case BAD_BSOD: - action_bsod(); - break; - - case BAD_LAPTOP: - action_laptop(); - break; - - case BAD_MONEY: - action_money(); - break; - - case BAD_MRBOMB: - action_mrbomb(); - break; - - case BAD_BOMB: - action_bomb(); - break; - - case BAD_STALACTITE: - action_stalactite(); - break; - - case BAD_FLAME: - action_flame(); - break; - } - } - +{ // Remove if it's far off the screen: if (base.x < scroll_x - OFFSCREEN_DISTANCE) { - remove_me(); + remove_me(); return; } - else /* !seen */ + + // Once it's on screen, it's activated! + if (base.x <= scroll_x + screen->w + OFFSCREEN_DISTANCE) + seen = true; + + if(!seen) + return; + + switch (kind) { - // Once it's on screen, it's activated! - if (base.x <= scroll_x + screen->w + OFFSCREEN_DISTANCE) - seen = true; + case BAD_BSOD: + action_bsod(); + break; + + case BAD_LAPTOP: + action_laptop(); + break; + + case BAD_MONEY: + action_money(); + break; + + case BAD_MRBOMB: + action_mrbomb(); + break; + + case BAD_BOMB: + action_bomb(); + break; + + case BAD_STALACTITE: + action_stalactite(); + break; + + case BAD_FLAME: + action_flame(); + break; } } @@ -504,7 +507,7 @@ BadGuy::draw_bsod() { texture_type* texture = 0; - float y = base.y; + if(dying == DYING_NOT) { size_t frame = (global_frame_counter / 5) % 4; texture = (dir == LEFT) ? &img_bsod_left[frame] : &img_bsod_right[frame]; @@ -513,10 +516,9 @@ } else if(dying == DYING_SQUISHED) { texture = (dir == LEFT) ? &img_bsod_squished_left : &img_bsod_squished_right; - y += 24; } - texture_draw(texture, base.x - scroll_x, y); + texture_draw(texture, base.x - scroll_x, base.y); } void @@ -546,7 +548,7 @@ BadGuy::draw_money() { texture_type* texture; - size_t frame = (base.ym != 300) ? 0 : 1; + size_t frame = (mode == NORMAL) ? 0 : 1; if(tux.base.x + tux.base.width < base.x) { texture = &img_money_left[frame]; @@ -575,12 +577,13 @@ BadGuy::draw_bomb() { texture_type* texture; - + // TODO add real bomb graphics if(mode == BOMB_TICKING) { - texture = &img_bsod_squished_right; + texture = (dir == LEFT) + ? &img_mrbomb_ticking_left : &img_mrbomb_ticking_right; } else { - texture = &img_bsod_squished_left; + texture = &img_mrbomb_explosion; } texture_draw(texture, base.x - scroll_x, base.y); @@ -611,40 +614,39 @@ BadGuy::draw() { // Don't try to draw stuff that is outside of the screen - if (base.x > scroll_x - 32 && - base.x < scroll_x + screen->w) + if (base.x <= scroll_x - base.width || base.x >= scroll_x + screen->w) + return; + + switch (kind) { - switch (kind) - { - case BAD_BSOD: - draw_bsod(); - break; - - case BAD_LAPTOP: - draw_laptop(); - break; - - case BAD_MONEY: - draw_money(); - break; + case BAD_BSOD: + draw_bsod(); + break; - case BAD_MRBOMB: - draw_mrbomb(); - break; + case BAD_LAPTOP: + draw_laptop(); + break; - case BAD_BOMB: - draw_bomb(); - break; + case BAD_MONEY: + draw_money(); + break; - case BAD_STALACTITE: - draw_stalactite(); - break; + case BAD_MRBOMB: + draw_mrbomb(); + break; - case BAD_FLAME: - draw_flame(); - break; + case BAD_BOMB: + draw_bomb(); + break; + + case BAD_STALACTITE: + draw_stalactite(); + break; + + case BAD_FLAME: + draw_flame(); + break; - } } } @@ -662,8 +664,8 @@ BadGuy::make_player_jump(Player* player) { physic_set_state(&player->vphysic,PH_VT); - physic_set_start_vy(&player->vphysic,2.); - player->base.y = base.y - player->base.height - 1; + physic_set_start_vy(&player->vphysic, 2.); + player->base.y = base.y - player->base.height - 2; } void @@ -682,14 +684,18 @@ return; } else if(kind == BAD_BSOD) { - dying = DYING_SQUISHED; - timer_start(&timer,4000); - make_player_jump(player); add_score(base.x - scroll_x, base.y, 50 * score_multiplier); play_sound(sounds[SND_SQUISH], SOUND_CENTER_SPEAKER); score_multiplier++; + + dying = DYING_SQUISHED; + timer_start(&timer, 2000); + base.y += base.height - img_bsod_squished_left.h; + base.height = img_bsod_squished_left.h; + base.xm = base.ym = 0; + old_base = base; return; } else if (kind == BAD_LAPTOP) { @@ -698,29 +704,27 @@ /* Flatten! */ play_sound(sounds[SND_STOMP], SOUND_CENTER_SPEAKER); mode = FLAT; - base.xm = 4; + base.xm = 0; timer_start(&timer, 4000); } else if (mode == FLAT) { /* Kick! */ play_sound(sounds[SND_KICK], SOUND_CENTER_SPEAKER); - if (player->base.x < base.x + (base.width/2)) + if (player->base.x < base.x + (base.width/2)) { + base.xm = 5; dir = RIGHT; - else + } else { + base.xm = -5; dir = LEFT; + } - base.xm = 5; mode = KICK; - - timer_start(&timer,5000); } make_player_jump(player); - add_score(base.x - scroll_x, - base.y, - 25 * score_multiplier); + add_score(base.x - scroll_x, base.y, 25 * score_multiplier); score_multiplier++; return; } @@ -767,11 +771,7 @@ case CO_BADGUY: pbad_c = (BadGuy*) p_c_object; - if (mode == NORMAL) - { - /* do nothing */ - } - else if(mode == KICK) + if(kind == BAD_LAPTOP && mode == KICK) { /* We're in kick mode, kill the other guy and yourself(wuahaha) : */ @@ -782,7 +782,6 @@ add_score(base.x - scroll_x, base.y, 100); - pbad_c->dying = DYING_FALLING; dying = DYING_FALLING; base.ym = -8; @@ -918,6 +917,12 @@ texture_load(&img_mrbomb_right[i], datadir + "/images/shared/mrbomb-right-" + num + ".png", USE_ALPHA); } + texture_load(&img_mrbomb_ticking_left, + datadir + "/images/shared/mrbombx-left-0.png", USE_ALPHA); + texture_load(&img_mrbomb_ticking_right, + datadir + "/images/shared/mrbombx-right-0.png", USE_ALPHA); + texture_load(&img_mrbomb_explosion, + datadir + "/images/shared/mrbomb-explosion.png", USE_ALPHA); /* stalactite */ texture_load(&img_stalactite, @@ -969,6 +974,10 @@ texture_free(&img_mrbomb_right[i]); } + texture_free(&img_mrbomb_ticking_left); + texture_free(&img_mrbomb_ticking_right); + texture_free(&img_mrbomb_explosion); + texture_free(&img_stalactite); texture_free(&img_stalactite_broken); |
From: Ingo R. <gr...@us...> - 2004-03-28 23:34:42
|
Update of /cvsroot/super-tux/supertux In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3863 Modified Files: configure.ac Log Message: - fixed datadir Index: configure.ac =================================================================== RCS file: /cvsroot/super-tux/supertux/configure.ac,v retrieving revision 1.16 retrieving revision 1.17 diff -u -d -r1.16 -r1.17 --- configure.ac 28 Mar 2004 21:48:55 -0000 1.16 +++ configure.ac 28 Mar 2004 23:23:20 -0000 1.17 @@ -89,7 +89,7 @@ AC_CHECK_LIB(z, gzopen,, AC_MSG_ERROR([*** zlib is missing])) -CXXFLAGS="$CXXFLAGS -DDATA_PREFIX='\"$datatdir/supertux\"'" +CXXFLAGS="$CXXFLAGS -DDATA_PREFIX='\"$datadir/supertux\"'" dnl Checks for library functions. AC_CHECK_FUNCS(mkdir strdup strstr) |
From: Tobias Gl??er <to...@us...> - 2004-03-28 22:00:19
|
Update of /cvsroot/super-tux/supertux In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15314 Modified Files: configure.ac Log Message: little improvement Index: configure.ac =================================================================== RCS file: /cvsroot/super-tux/supertux/configure.ac,v retrieving revision 1.15 retrieving revision 1.16 diff -u -d -r1.15 -r1.16 --- configure.ac 22 Mar 2004 10:33:15 -0000 1.15 +++ configure.ac 28 Mar 2004 21:48:55 -0000 1.16 @@ -7,6 +7,7 @@ dnl Process this file with autoconf to produce a configure script. +AC_PREREQ([2.54]) AC_INIT(SuperTux, 0.0.7-cvs) AC_CONFIG_SRCDIR([src/supertux.cpp]) AC_CANONICAL_TARGET |
From: Tobias Gl??er <to...@us...> - 2004-03-28 21:54:50
|
Update of /cvsroot/super-tux/supertux/data/images/tilesets In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14292/data/images/tilesets Modified Files: supertux.stgt Log Message: tilegroup definitions Index: supertux.stgt =================================================================== RCS file: /cvsroot/super-tux/supertux/data/images/tilesets/supertux.stgt,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- supertux.stgt 28 Mar 2004 11:47:21 -0000 1.8 +++ supertux.stgt 28 Mar 2004 21:43:29 -0000 1.9 @@ -4,6 +4,10 @@ (properties (id 0)) ;; Zero tile + (tilegroup (name "Snow") (tiles 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 30 31)) + (tilegroup (name "Darksnow") (tiles 32 33 34 35 36 37 38 39 40 41 42 43)) + (tilegroup (name "Block") (tiles 27 28 29 47 48 49 50 51 52 61 62)) + (tilegroup (name "Oldschool-Background") (tiles 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101)) (tile (id 0) (images "notile.png")) |
From: Tobias Gl??er <to...@us...> - 2004-03-28 21:53:27
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14011/src Modified Files: badguy.cpp collision.cpp leveleditor.cpp menu.cpp menu.h tile.cpp tile.h Log Message: - Leveleditor improvements and fixes. - collision bugfixes from Matze Braun Index: tile.h =================================================================== RCS file: /cvsroot/super-tux/supertux/src/tile.h,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- tile.h 28 Mar 2004 14:11:53 -0000 1.6 +++ tile.h 28 Mar 2004 21:42:04 -0000 1.7 @@ -53,6 +53,11 @@ int anim_speed; }; +struct TileGroup +{ + std::string name; + std::vector<int> tiles; +}; class TileManager { @@ -60,10 +65,12 @@ TileManager(); std::vector<Tile*> tiles; static TileManager* instance_ ; + static std::vector<TileGroup>* tilegroups_; void load_tileset(std::string filename); public: static TileManager* instance() { return instance_ ? instance_ : instance_ = new TileManager(); } + static std::vector<TileGroup>* tilegroups() { return tilegroups_ ? tilegroups_ : tilegroups_ = new std::vector<TileGroup>; } Tile* get(unsigned int id) { if(id < tiles.size()) { Index: menu.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/menu.cpp,v retrieving revision 1.20 retrieving revision 1.21 diff -u -d -r1.20 -r1.21 --- menu.cpp 28 Mar 2004 01:00:16 -0000 1.20 +++ menu.cpp 28 Mar 2004 21:42:04 -0000 1.21 @@ -132,10 +132,17 @@ arrange_left = 0; num_items = 0; active_item = 0; + last_menu = 0; item = NULL; timer_init(&effect,false); } +void Menu::set_pos(int x, int y, float rw, float rh) +{ + pos_x = x + (int)((float)width() * rw); + pos_y = y + (int)((float)height() * rh); +} + void Menu::additem(MenuItemKind kind, char *text, int toggle, Menu* menu) { Index: collision.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/collision.cpp,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- collision.cpp 26 Mar 2004 23:53:31 -0000 1.8 +++ collision.cpp 28 Mar 2004 21:42:04 -0000 1.9 @@ -208,15 +208,17 @@ { for(unsigned int j = 0; j < bad_guys.size(); ++j) { - if(bad_guys[j].dying == DYING_NOT) + if(bad_guys[j].dying != DYING_NOT) + continue; + if(rectcollision(&bullets[i].base, &bad_guys[j].base)) { - if(rectcollision(&bullets[i].base,&bad_guys[j].base)) - { - // We have detected a collision and now call the - // collision functions of the collided objects. - bullet_collision(&bullets[i], CO_BADGUY); - bad_guys[j].collision(&bullets[i], CO_BULLET); - } + // We have detected a collision and now call the + // collision functions of the collided objects. + // collide with bad_guy first, since bullet_collision will + // delete the bullet + bad_guys[j].collision(0, CO_BULLET); + bullet_collision(&bullets[i], CO_BADGUY); + break; // bullet is invalid now, so break } } } @@ -224,20 +226,20 @@ /* CO_BADGUY & CO_BADGUY check */ for(unsigned int i = 0; i < bad_guys.size(); ++i) { - if(bad_guys[i].dying == DYING_NOT) + if(bad_guys[i].dying != DYING_NOT) + continue; + + for(unsigned int j = i+1; j < bad_guys.size(); ++j) { - for(unsigned int j = i+1; j < bad_guys.size(); ++j) + if(j == i || bad_guys[j].dying != DYING_NOT) + continue; + + if(rectcollision(&bad_guys[i].base, &bad_guys[j].base)) { - if(j != i && !bad_guys[j].dying) - { - if(rectcollision(&bad_guys[i].base, &bad_guys[j].base)) - { - // We have detected a collision and now call the - // collision functions of the collided objects. - bad_guys[j].collision(&bad_guys[i], CO_BADGUY); - bad_guys[i].collision(&bad_guys[j], CO_BADGUY); - } - } + // We have detected a collision and now call the + // collision functions of the collided objects. + bad_guys[j].collision(&bad_guys[i], CO_BADGUY); + bad_guys[i].collision(&bad_guys[j], CO_BADGUY); } } } @@ -245,7 +247,10 @@ // CO_BADGUY & CO_PLAYER check for(unsigned int i = 0; i < bad_guys.size(); ++i) { - if(bad_guys[i].dying == DYING_NOT && rectcollision_offset(&bad_guys[i].base,&tux.base,0,0)) + if(bad_guys[i].dying != DYING_NOT) + continue; + + if(rectcollision_offset(&bad_guys[i].base,&tux.base,0,0)) { // We have detected a collision and now call the collision // functions of the collided objects. Index: menu.h =================================================================== RCS file: /cvsroot/super-tux/supertux/src/menu.h,v retrieving revision 1.23 retrieving revision 1.24 diff -u -d -r1.23 -r1.24 --- menu.h 28 Mar 2004 01:00:16 -0000 1.23 +++ menu.h 28 Mar 2004 21:42:04 -0000 1.24 @@ -81,6 +81,7 @@ int check (); void draw (); void draw_item(int index, int menu_width, int menu_height); + void set_pos(int x, int y, float rw = 0, float rh = 0); }; Index: leveleditor.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/leveleditor.cpp,v retrieving revision 1.24 retrieving revision 1.25 diff -u -d -r1.24 -r1.25 --- leveleditor.cpp 28 Mar 2004 01:30:48 -0000 1.24 +++ leveleditor.cpp 28 Mar 2004 21:42:04 -0000 1.25 @@ -13,9 +13,11 @@ Ricardo Cruz <ri...@ae...> Tobias Glaesser <tob...@gm...> */ +#include <map> #include <stdio.h> #include <stdlib.h> #include <string.h> +#include <math.h> #include <errno.h> #include <unistd.h> #include <SDL.h> @@ -31,6 +33,7 @@ #include "badguy.h" #include "scene.h" #include "button.h" +#include "tile.h" /* definitions to aid development */ #define DONE_LEVELEDITOR 1 @@ -102,17 +105,16 @@ static button_type le_select_mode_one_bt; static button_type le_select_mode_two_bt; static button_type le_settings_bt; -static button_type le_bad_bt; -static button_type le_bkgd_bt; -static button_type le_fgd_bt; -static button_panel_type le_bkgd_panel; -static button_panel_type le_fgd_panel; -static button_panel_type le_bad_panel; +static button_type le_tilegroup_bt; static Menu* leveleditor_menu; static Menu* subset_load_menu; static Menu* subset_new_menu; static Menu* subset_settings_menu; static Menu* level_settings_menu; +static Menu* select_tilegroup_menu; +static timer_type select_tilegroup_menu_effect; +static std::map<std::string, button_panel_type > tilegroups_map; +static std::string cur_tilegroup; static square selection; static int le_selection_mode; @@ -152,6 +154,16 @@ le_checkevents(); + if(current_menu == select_tilegroup_menu) + { + if(timer_check(&select_tilegroup_menu_effect)) + { + select_tilegroup_menu->set_pos(screen->w - 64 + timer_get_left(&select_tilegroup_menu_effect),82,-0.5,0.5); + } + else + select_tilegroup_menu->set_pos(screen->w - 64,82,-0.5,0.5); + } + if(le_current_level != NULL) { /* making events results to be in order */ @@ -200,6 +212,22 @@ break; } } + else if(current_menu == select_tilegroup_menu) + { + int it = -1; + switch (it = select_tilegroup_menu->check()) + { + default: + if(it != -1) + { + if(select_tilegroup_menu->item[it].kind == MN_ACTION) + cur_tilegroup = select_tilegroup_menu->item[it].text; + + show_menu = false; + } + break; + } + } else if(current_menu == subset_load_menu) { switch (i = subset_load_menu->check()) @@ -305,7 +333,7 @@ void le_update_buttons(const char *theme) { - int i; + /*int i; char filename[1024]; char pathname[1024]; SDLKey key; @@ -342,7 +370,7 @@ { sprintf(filename,"%s/%s",pathname,fgd_files.item[i]); button_change_icon(&le_fgd_panel.item[i+14],filename); - } + }*/ } int le_init() @@ -370,6 +398,8 @@ texture_load(&le_selection, datadir + "/images/leveleditor/select.png", USE_ALPHA); + timer_init(&select_tilegroup_menu_effect,false); + /* Load buttons */ button_load(&le_save_level_bt,"/images/icons/save.png","Save level", SDLK_F6,screen->w-64,32); button_load(&le_next_level_bt,"/images/icons/up.png","Next level", SDLK_PAGEUP,screen->w-64,0); @@ -381,103 +411,14 @@ button_load(&le_settings_bt,"/images/icons/settings.png","Level settings",SDLK_F5,screen->w-32,screen->h - 64); button_load(&le_move_left_bt,"/images/icons/left.png","Move left",SDLK_LEFT,0,0); button_load(&le_move_right_bt,"/images/icons/right.png","Move right",SDLK_RIGHT,screen->w-80,0); - button_load(&le_fgd_bt,"/images/icons/fgd.png","Foreground tiles", SDLK_F7,screen->w-64,82); - button_load(&le_bkgd_bt,"/images/icons/bgd.png","Background tiles", SDLK_F8,screen->w-43,82); - button_load(&le_bad_bt,"/images/icons/emy.png","Enemies", SDLK_F9,screen->w-22,82); - - bkgd_files = dfiles("images/themes/antarctica","bkgd-", NULL); - string_list_sort(&bkgd_files); - - button_panel_init(&le_bkgd_panel, screen->w - 64,98, 64, 318); - le_bkgd_panel.hidden = true; - key = SDLK_a; - for(i = 0; i < bkgd_files.num_items; ++i) - { - sprintf(filename,"images/themes/antarctica/%s",bkgd_files.item[i]); - button_panel_additem(&le_bkgd_panel,button_create(filename, "Background Tile",(SDLKey)((int)key+i),0,0),i); - } - - string_list_free(&bkgd_files); - bkgd_files = dfiles("images/shared","cloud-", NULL); - string_list_sort(&bkgd_files); - - for(i = 0; i < bkgd_files.num_items; ++i) - { - sprintf(filename,"images/shared/%s",bkgd_files.item[i]); - button_panel_additem(&le_bkgd_panel,button_create(filename, "Background Tile",(SDLKey)((int)key+i+8),0,0),i+8); - } - - fgd_files = dfiles("images/themes/antarctica","solid", NULL); - string_list_sort(&fgd_files); - key = SDLK_a; - button_panel_init(&le_fgd_panel, screen->w - 64,98, 64, 318); - for(i = 0; i < fgd_files.num_items; ++i) - { - sprintf(filename,"images/themes/antarctica/%s",fgd_files.item[i]); - button_panel_additem(&le_fgd_panel,button_create(filename, "Foreground Tile",(SDLKey)((int)key+i),0,0),i); - } - - string_list_free(&fgd_files); - string_list_add_item(&fgd_files,"waves-0.png"); - string_list_add_item(&fgd_files,"water.png"); - string_list_add_item(&fgd_files,"pole.png"); - string_list_add_item(&fgd_files,"poletop.png"); - string_list_add_item(&fgd_files,"flag-0.png"); - string_list_add_item(&fgd_files,"box-empty.png"); - string_list_add_item(&fgd_files,"mints.png"); - string_list_add_item(&fgd_files,"distro-0.png"); - string_list_add_item(&fgd_files,"golden-herring.png"); - string_list_add_item(&fgd_files,"distro-0.png"); - - for(i = 0; i < fgd_files.num_items; ++i) - { - sprintf(filename,"images/shared/%s",fgd_files.item[i]); - button_panel_additem(&le_fgd_panel,button_create(filename, "Foreground Tile",(SDLKey)((int)key+i+4),0,0),i+4); - } - - string_list_free(&fgd_files); - fgd_files = dfiles("images/themes/antarctica","brick", NULL); - string_list_sort(&fgd_files); - - for(i = 0; i < fgd_files.num_items; ++i) - { - sprintf(filename,"images/themes/antarctica/%s",fgd_files.item[i]); - button_panel_additem(&le_fgd_panel,button_create(filename, "Foreground Tile",(SDLKey)((int)key+i+14),0,0),i+14); - } - - string_list_free(&fgd_files); - string_list_add_item(&fgd_files,"distro-0.png"); - string_list_add_item(&fgd_files,"distro-0.png"); - for(i = 0; i < fgd_files.num_items; ++i) - { - sprintf(filename,"images/shared/%s",fgd_files.item[i]); - button_panel_additem(&le_fgd_panel,button_create(filename, "Foreground Tile",(SDLKey)((int)key+i+16),0,0),i+16); - } - - le_fgd_panel.item[10].bkgd = &le_fgd_panel.item[9].icon; - le_fgd_panel.item[11].bkgd = &le_fgd_panel.item[9].icon; - le_fgd_panel.item[12].bkgd = &le_fgd_panel.item[9].icon; - le_fgd_panel.item[16].bkgd = &le_fgd_panel.item[14].icon; - le_fgd_panel.item[17].bkgd = &le_fgd_panel.item[15].icon; - - string_list_init(&bad_files); - string_list_add_item(&bad_files,"bsod-left-0.png"); - string_list_add_item(&bad_files,"laptop-left-0.png"); - string_list_add_item(&bad_files,"bag-left-0.png"); - button_panel_init(&le_bad_panel, screen->w - 64,98, 64, 318); - le_bad_panel.hidden = true; - key = SDLK_a; - for(i = 0; i < bad_files.num_items; ++i) - { - sprintf(filename,"images/shared/%s",bad_files.item[i]); - button_panel_additem(&le_bad_panel,button_create(filename, "Bad Guy",(SDLKey)((int)key+i),0,0),i); - } + button_load(&le_tilegroup_bt,"/images/icons/tilegroup.png","Select Tilegroup", SDLK_F7,screen->w-64,82); leveleditor_menu = new Menu(); subset_load_menu = new Menu(); subset_new_menu = new Menu(); subset_settings_menu = new Menu(); level_settings_menu = new Menu(); + select_tilegroup_menu = new Menu(); leveleditor_menu->additem(MN_LABEL,"Level Editor Menu",0,0); leveleditor_menu->additem(MN_HL,"",0,0); @@ -534,6 +475,20 @@ level_settings_menu->additem(MN_HL,"",0,0); level_settings_menu->additem(MN_ACTION,"Apply Changes",0,0); + select_tilegroup_menu->arrange_left = true; + select_tilegroup_menu->additem(MN_LABEL,"Select Tilegroup",0,0); + select_tilegroup_menu->additem(MN_HL,"",0,0); + std::vector<TileGroup>* tilegroups = TileManager::tilegroups(); + for(std::vector<TileGroup>::iterator it = tilegroups->begin(); it != tilegroups->end(); ++it ) + { + + select_tilegroup_menu->additem(MN_ACTION,const_cast<char*>((*it).name.c_str()),0,0); + button_panel_init(&tilegroups_map[(*it).name], screen->w - 64,98, 64, 318); + for(std::vector<int>::iterator sit = (*it).tiles.begin(); sit != (*it).tiles.end(); ++sit) + button_panel_additem(&tilegroups_map[(*it).name],button_create(const_cast<char*>(("images/tilesets/" + TileManager::instance()->get(*sit)->filenames[0]).c_str()), const_cast<char*>((*it).name.c_str()),(SDLKey)((int)key),0,0),(*sit)); + } + select_tilegroup_menu->additem(MN_HL,"",0,0); + SDL_EnableKeyRepeat(SDL_DEFAULT_REPEAT_DELAY, SDL_DEFAULT_REPEAT_INTERVAL); return 0; @@ -657,9 +612,7 @@ delete subset_new_menu; delete subset_settings_menu; delete level_settings_menu; - button_panel_free(&le_bkgd_panel); - button_panel_free(&le_fgd_panel); - button_panel_free(&le_bad_panel); + delete select_tilegroup_menu; button_free(&le_save_level_bt); button_free(&le_test_level_bt); button_free(&le_next_level_bt); @@ -670,9 +623,7 @@ button_free(&le_select_mode_one_bt); button_free(&le_select_mode_two_bt); button_free(&le_settings_bt); - button_free(&le_bad_bt); - button_free(&le_bkgd_bt); - button_free(&le_fgd_bt); + button_free(&le_tilegroup_bt); if(le_current_level != NULL) { @@ -757,12 +708,8 @@ button_draw(&le_settings_bt); button_draw(&le_move_right_bt); button_draw(&le_move_left_bt); - button_draw(&le_bad_bt); - button_draw(&le_bkgd_bt); - button_draw(&le_fgd_bt); - button_panel_draw(&le_bkgd_panel); - button_panel_draw(&le_fgd_panel); - button_panel_draw(&le_bad_panel); + button_draw(&le_tilegroup_bt); + button_panel_draw(&tilegroups_map[cur_tilegroup]); sprintf(str, "%d/%d", le_level,le_level_subset.levels); text_drawf(&white_text, str, -8, 16, A_RIGHT, A_TOP, 1); @@ -800,7 +747,7 @@ for (y = 0; y < 15; ++y) for (x = 0; x < 20; ++x) { - drawshape(x * 32 - ((int)pos_x % 32), y * 32, le_current_level->ia_tiles[y][x + (int)(pos_x / 32)]); + drawshape(32*x - fmodf(pos_x, 32), y * 32, le_current_level->ia_tiles[y][x + (int)(pos_x / 32)]); /* draw whats inside stuff when cursor is selecting those */ /* (draw them all the time - is this the right behaviour?) */ @@ -852,9 +799,9 @@ while(SDL_PollEvent(&event)) { if(show_menu) - menu_event(event); + menu_event(event); else - mouse_cursor->set_state(MC_NORMAL); + mouse_cursor->set_state(MC_NORMAL); /* testing SDL_KEYDOWN, SDL_KEYUP and SDL_QUIT events*/ if(event.type == SDL_KEYDOWN || ((event.type == SDL_MOUSEBUTTONDOWN || SDL_MOUSEMOTION) && (event.motion.x > 0 && event.motion.x < screen->w - 64 && @@ -1077,44 +1024,30 @@ if(button_get_state(&le_select_mode_two_bt) == BUTTON_CLICKED) le_selection_mode = SQUARE; - button_event(&le_bad_bt,&event); - if(button_get_state(&le_bad_bt) == BUTTON_CLICKED) + button_event(&le_tilegroup_bt,&event); + if(button_get_state(&le_tilegroup_bt) == BUTTON_CLICKED) { - le_bad_panel.hidden = false; - le_fgd_panel.hidden = true; - le_bkgd_panel.hidden = true; + Menu::set_current(select_tilegroup_menu); + timer_start(&select_tilegroup_menu_effect,200); + select_tilegroup_menu->set_pos(screen->w - 64,100,-0.5,0.5); + show_menu = true; } - button_event(&le_fgd_bt,&event); - if(button_get_state(&le_fgd_bt) == BUTTON_CLICKED) - { - le_bad_panel.hidden = true; - le_fgd_panel.hidden = false; - le_bkgd_panel.hidden = true; - } - button_event(&le_bkgd_bt,&event); - if(button_get_state(&le_bkgd_bt) == BUTTON_CLICKED) - { - le_bad_panel.hidden = true; - le_fgd_panel.hidden = true; - le_bkgd_panel.hidden = false; - } button_event(&le_settings_bt,&event); if(button_get_state(&le_settings_bt) == BUTTON_CLICKED) { - if(show_menu == false) - { - update_level_settings_menu(); - Menu::set_current(level_settings_menu); - show_menu = true; - } - else - { - Menu::set_current(leveleditor_menu); - show_menu = false; - } + update_level_settings_menu(); + Menu::set_current(level_settings_menu); + show_menu = true; } - if((pbutton = button_panel_event(&le_bkgd_panel,&event)) != NULL) + if((pbutton = button_panel_event(&tilegroups_map[cur_tilegroup],&event)) != NULL) + { + if(button_get_state(pbutton) == BUTTON_CLICKED) + { + le_current_tile = pbutton->tag; + } + } + /*if((pbutton = button_panel_event(&le_bkgd_panel,&event)) != NULL) { if(button_get_state(pbutton) == BUTTON_CLICKED) { @@ -1130,80 +1063,21 @@ if(c != '\0') le_current_tile = c; } - } - if((pbutton = button_panel_event(&le_fgd_panel,&event)) != NULL) - { - if(button_get_state(pbutton) == BUTTON_CLICKED) - { - char c = '\0'; - if(pbutton->tag == 0) - c = '#' ; - else if(pbutton->tag == 1) - c = '['; - else if(pbutton->tag == 2) - c = '='; - else if(pbutton->tag == 3) - c = ']'; - else if(pbutton->tag == 4) - c = '^'; - else if(pbutton->tag == 5) - c = '&'; - else if(pbutton->tag == 6) - c = '|'; - else if(pbutton->tag == 7) - c = '*'; - else if(pbutton->tag == 8) - c = '\\'; - else if(pbutton->tag == 9) - c = 'a'; - else if(pbutton->tag == 10) - c = 'B'; - else if(pbutton->tag == 11) - c = 'A'; - else if(pbutton->tag == 12) - c = '!'; - else if(pbutton->tag == 13) - c = '$'; - else if(pbutton->tag == 14) - c = 'X'; - else if(pbutton->tag == 15) - c = 'Y'; - else if(pbutton->tag == 16) - c = 'x'; - else if(pbutton->tag == 17) - c = 'y'; - if(c != '\0') - le_current_tile = c; - } - } - if((pbutton = button_panel_event(&le_bad_panel,&event)) != NULL) - { - if(button_get_state(pbutton) == BUTTON_CLICKED) - { - char c = '\0'; - if(pbutton->tag >= 0 && pbutton->tag <= 2) - c = '0' + pbutton->tag; - if(c != '\0') - le_current_tile = c; - } - } + }*/ } else { button_event(&le_settings_bt,&event); if(button_get_state(&le_settings_bt) == BUTTON_CLICKED) { - if(show_menu == false) - { - update_level_settings_menu(); - Menu::set_current(level_settings_menu); - show_menu = true; - } - else - { - Menu::set_current(leveleditor_menu); - show_menu = false; - } + Menu::set_current(leveleditor_menu); + show_menu = false; + } + button_event(&le_tilegroup_bt,&event); + if(button_get_state(&le_tilegroup_bt) == BUTTON_CLICKED) + { + Menu::set_current(leveleditor_menu); + show_menu = false; } } } Index: badguy.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/badguy.cpp,v retrieving revision 1.16 retrieving revision 1.17 diff -u -d -r1.16 -r1.17 --- badguy.cpp 28 Mar 2004 01:44:15 -0000 1.16 +++ badguy.cpp 28 Mar 2004 21:42:04 -0000 1.17 @@ -207,9 +207,9 @@ if(mode == KICK && changed != dir) { /* handle stereo sound (number 10 should be tweaked...)*/ - if (base.x < scroll_x - 10) + if (base.x < scroll_x + screen->w/2 - 10) play_sound(sounds[SND_RICOCHET], SOUND_LEFT_SPEAKER); - else if (base.x > scroll_x + 10) + else if (base.x > scroll_x + screen->w/2 + 10) play_sound(sounds[SND_RICOCHET], SOUND_RIGHT_SPEAKER); else play_sound(sounds[SND_RICOCHET], SOUND_CENTER_SPEAKER); Index: tile.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/tile.cpp,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- tile.cpp 28 Mar 2004 14:11:53 -0000 1.7 +++ tile.cpp 28 Mar 2004 21:42:04 -0000 1.8 @@ -1,7 +1,7 @@ // // C++ Implementation: tile // -// Description: +// Description: // // // Author: Tobias Glaesser <tob...@gm...>, (C) 2004 @@ -13,17 +13,18 @@ #include "assert.h" TileManager* TileManager::instance_ = 0; +std::vector<TileGroup>* TileManager::tilegroups_ = 0; TileManager::TileManager() { - std::string filename = datadir + "images/tilesets/supertux.stgt"; + std::string filename = datadir + "images/tilesets/supertux.stgt"; load_tileset(filename); } void TileManager::load_tileset(std::string filename) { lisp_object_t* root_obj = lisp_read_from_file(filename); - + if (!root_obj) st_abort("Couldn't load file", filename); @@ -41,19 +42,19 @@ Tile* tile = new Tile; tile->id = -1; tile->solid = false; - tile->brick = false; - tile->ice = false; - tile->fullbox = false; + tile->brick = false; + tile->ice = false; + tile->fullbox = false; tile->distro = false; tile->data = 0; tile->next_tile = 0; tile->anim_speed = 25; - + LispReader reader(lisp_cdr(element)); assert(reader.read_int("id", &tile->id)); reader.read_bool("solid", &tile->solid); reader.read_bool("brick", &tile->brick); - reader.read_bool("ice", &tile->ice); + reader.read_bool("ice", &tile->ice); reader.read_bool("fullbox", &tile->fullbox); reader.read_bool("distro", &tile->distro); reader.read_int("data", &tile->data); @@ -61,36 +62,49 @@ reader.read_int("next-tile", &tile->next_tile); reader.read_string_vector("images", &tile->filenames); - for(std::vector<std::string>::iterator it = tile->filenames.begin(); + for(std::vector<std::string>::iterator it = tile-> + filenames.begin(); it != tile->filenames.end(); ++it) { texture_type cur_image; tile->images.push_back(cur_image); - texture_load(&tile->images[tile->images.size()-1], - datadir + "images/tilesets/" + (*it), + texture_load(&tile->images[tile->images.size()-1], + datadir + "images/tilesets/" + (*it), USE_ALPHA); } - if (tile->id + tileset_id >= int(tiles.size())) + if (tile->id + tileset_id >= int(tiles.size()) + ) tiles.resize(tile->id + tileset_id+1); tiles[tile->id + tileset_id] = tile; } - else if (strcmp(lisp_symbol(lisp_car(element)), "tileset") == 0) + else if (strcmp(lisp_symbol(lisp_car(element)), "tileset") == 0) { - LispReader reader(lisp_cdr(element)); - std::string filename; + LispReader reader(lisp_cdr(element)); + std::string filename; reader.read_string("file", &filename); - filename = datadir + "images/tilesets/" + filename; - load_tileset(filename); - } - else if (strcmp(lisp_symbol(lisp_car(element)), "properties") == 0) + filename = datadir + "images/tilesets/" + filename; + load_tileset(filename); + } + else if (strcmp(lisp_symbol(lisp_car(element)), "tilegroup") == 0) { - LispReader reader(lisp_cdr(element)); + TileGroup new_; + if(!tilegroups_) + tilegroups_ = new std::vector<TileGroup>; + tilegroups_->push_back(new_); + LispReader reader(lisp_cdr(element)); + tilegroups_->back().name; + reader.read_string("name", &tilegroups_->back().name); + reader.read_int_vector("tiles", &tilegroups_->back().tiles); + } + else if (strcmp(lisp_symbol(lisp_car(element)), "properties") == 0) + { + LispReader reader(lisp_cdr(element)); reader.read_int("id", &tileset_id); - tileset_id *= 1000; - } + tileset_id *= 1000; + } else { puts("Unhandled symbol"); |
From: Ingo R. <gr...@us...> - 2004-03-28 21:07:58
|
Update of /cvsroot/super-tux/supertux/data/levels/default In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4961 Modified Files: boss1-grumbel.stl Log Message: - added some flames Index: boss1-grumbel.stl =================================================================== RCS file: /cvsroot/super-tux/supertux/data/levels/default/boss1-grumbel.stl,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- boss1-grumbel.stl 27 Mar 2004 16:34:19 -0000 1.3 +++ boss1-grumbel.stl 28 Mar 2004 20:56:36 -0000 1.4 @@ -23,12 +23,12 @@ 64 64 69 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 62 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 62 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 69 0 0 0 0 0 0 0 0 0 0 0 65 65 64 64 64 64 64 64 64 69 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 68 64 64 64 64 64 65 0 0 0 0 67 64 64 64 64 64 64 64 69 0 65 64 64 64 64 64 64 64 64 64 69 0 0 68 64 64 64 64 64 64 64 66 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65 65 65 65 65 65 65 65 65 65 65 65 65 0 65 65 65 65 65 0 65 65 65 65 65 0 65 65 65 65 65 65 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 67 64 64 64 64 69 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 59 60 0 64 64 69 0 0 0 0 0 0 0 0 65 65 65 65 65 65 65 65 65 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 62 0 0 0 0 0 0 0 0 0 0 62 0 0 0 0 0 0 0 0 0 0 62 64 64 64 64 64 64 64 64 64 64 64 64 64 64 69 0 0 0 0 0 0 0 0 0 0 65 65 64 64 64 64 64 64 64 64 64 69 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65 65 65 65 65 0 0 0 68 64 64 64 64 64 64 65 0 0 0 0 67 64 64 64 64 64 64 69 0 0 68 64 64 64 64 64 64 64 64 69 0 0 0 66 64 64 64 64 64 66 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65 65 65 64 64 64 64 64 64 64 64 64 64 64 64 64 0 68 64 64 64 64 0 68 64 64 64 64 0 68 64 64 64 64 64 65 65 65 65 65 65 65 0 0 0 0 65 65 65 65 65 65 65 65 0 0 0 67 64 64 64 69 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 59 60 0 64 64 69 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 62 0 0 0 0 0 0 0 0 0 0 0 0 0 62 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 0 0 0 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 0 0 0 0 0 62 64 64 64 64 62 66 66 62 64 64 64 64 64 69 0 0 0 0 0 0 0 0 0 65 65 64 64 64 64 64 64 64 64 64 64 64 69 0 65 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 68 64 64 64 69 0 0 0 68 64 64 64 64 64 64 64 65 0 0 0 0 67 64 64 64 64 64 69 0 0 68 64 64 64 64 64 64 64 64 69 0 0 0 0 66 66 66 66 66 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65 65 65 65 65 65 65 65 65 0 0 0 0 0 0 0 0 0 0 0 0 0 26 26 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65 65 0 0 0 0 65 65 0 0 0 0 65 65 65 65 64 64 64 66 66 66 66 66 66 66 66 66 66 66 66 66 0 66 66 66 66 66 0 66 66 66 66 66 0 66 66 66 66 66 66 66 66 66 66 66 66 66 0 0 0 0 68 64 64 64 64 64 64 69 0 0 0 0 66 66 66 66 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 45 59 60 0 - 64 64 69 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65 65 65 65 65 65 0 0 0 0 0 0 0 0 0 0 0 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 67 66 66 66 66 66 66 66 66 66 66 66 66 66 66 66 66 66 66 66 66 66 0 0 0 67 66 66 66 66 66 66 66 66 66 66 66 66 66 66 66 66 66 66 66 66 66 0 0 0 0 0 62 64 64 64 64 62 0 0 62 64 64 64 64 69 0 0 0 0 0 0 0 0 65 65 64 64 64 64 64 64 64 64 64 64 64 64 64 69 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65 65 65 65 65 0 0 0 68 64 64 64 69 0 0 0 68 64 64 64 64 64 64 64 64 65 0 0 0 0 67 64 64 64 64 64 65 0 68 64 64 64 64 64 64 64 64 69 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65 0 0 0 68 64 64 64 64 64 64 64 69 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 67 66 0 0 0 0 67 66 0 0 0 0 67 66 66 66 66 66 66 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 68 64 64 64 64 64 64 69 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65 65 65 65 - 64 64 69 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65 65 65 65 65 65 0 0 65 65 65 65 65 65 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65 65 65 65 65 65 0 68 64 64 64 64 69 0 0 0 0 0 0 0 0 0 0 0 68 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 69 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 62 0 0 0 0 0 0 62 0 0 0 0 0 0 0 0 0 0 62 0 0 0 0 0 0 0 0 0 0 66 66 66 66 66 66 0 0 67 66 66 66 66 0 0 0 0 0 0 0 65 65 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 69 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 68 64 64 64 69 0 0 0 68 64 64 64 69 0 0 0 68 64 64 64 64 64 64 64 64 64 65 0 0 0 0 67 66 66 66 66 0 0 66 66 66 66 66 66 66 66 66 66 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65 0 0 0 0 0 0 0 68 64 64 64 64 64 64 64 69 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 66 66 66 66 66 66 66 66 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 68 64 64 64 - 64 64 64 65 65 65 65 65 65 65 65 65 65 65 65 65 0 65 65 65 65 65 65 0 68 64 64 64 64 69 0 0 68 64 64 64 64 69 0 0 0 0 0 0 0 65 65 65 65 65 65 0 68 64 64 64 64 69 0 68 64 64 64 64 69 0 0 0 65 65 65 65 65 65 0 0 68 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 69 0 0 65 65 65 65 65 65 65 65 65 65 65 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65 65 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 69 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65 65 65 65 65 0 0 0 65 65 65 65 65 0 0 0 68 64 64 64 69 0 0 0 68 64 64 64 69 0 0 0 68 64 64 64 64 64 64 64 64 64 64 65 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65 65 65 65 65 65 65 65 65 65 65 0 0 0 0 62 0 0 0 0 62 0 0 0 0 65 65 65 65 65 65 65 0 0 0 0 0 0 0 0 0 0 0 68 64 64 64 64 64 64 64 69 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 68 64 64 64 - 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 69 0 68 64 64 64 64 69 0 68 64 64 64 64 69 0 0 68 64 64 64 64 69 0 0 0 0 65 65 0 68 64 64 64 64 69 0 68 64 64 64 64 69 0 68 64 64 64 64 69 0 0 0 68 64 64 64 64 69 0 0 68 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 69 0 0 68 64 64 64 64 64 64 64 64 64 64 65 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65 65 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 69 0 0 0 0 0 0 0 0 0 65 65 65 65 0 0 0 68 64 64 64 69 0 0 0 68 64 64 64 69 0 0 0 68 64 64 64 69 0 0 0 68 64 64 64 69 0 0 0 68 64 64 64 64 64 64 64 64 64 64 64 65 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65 65 65 65 65 65 0 0 68 64 64 64 64 64 64 64 64 64 69 0 0 0 0 0 0 0 0 0 0 0 0 0 0 68 64 64 64 64 64 69 0 0 0 0 0 0 0 0 0 0 0 68 64 64 64 64 64 64 64 69 0 0 0 65 65 65 65 65 65 0 0 65 65 65 65 65 65 0 0 65 65 65 65 65 65 0 0 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 0 0 0 0 0 0 0 0 0 0 0 0 0 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 64 64 64 64 - 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 69 0 68 64 64 64 64 69 0 68 64 64 64 64 69 0 0 68 64 64 64 64 69 0 0 0 0 68 69 0 68 64 64 64 64 69 0 68 64 64 64 64 69 0 68 64 64 64 64 69 0 0 0 68 64 64 64 64 69 0 0 68 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 69 0 0 68 64 64 64 64 64 64 64 64 64 64 64 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 69 0 0 0 0 65 65 0 0 0 68 64 64 69 0 0 0 68 64 64 64 69 0 0 0 68 64 64 64 69 0 0 0 68 64 64 64 69 0 0 0 68 64 64 64 69 0 0 0 68 64 64 64 64 64 64 64 64 64 64 64 64 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 27 28 28 28 28 28 28 28 28 29 65 65 65 65 65 65 0 0 68 64 64 64 64 69 0 0 68 64 64 64 64 64 64 64 64 64 69 0 0 0 0 0 0 0 0 0 0 0 0 0 0 68 64 64 64 64 64 69 0 0 0 0 0 0 0 0 0 0 0 68 64 64 64 64 64 64 64 69 0 0 0 68 64 64 64 64 69 0 0 68 64 64 64 64 69 0 0 68 64 64 64 64 69 0 0 68 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 65 65 65 65 65 65 65 65 65 65 65 65 65 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 - 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 69 0 68 64 64 64 64 69 0 68 64 64 64 64 69 0 0 68 64 64 64 64 64 65 65 65 65 64 64 65 68 64 64 64 64 69 0 68 64 64 64 64 69 0 68 64 64 64 64 69 0 0 0 68 64 64 64 64 69 0 0 68 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 69 0 0 68 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 69 0 0 0 0 68 69 0 0 0 68 64 64 69 0 0 0 68 64 64 64 69 0 0 0 68 64 64 64 69 0 0 0 68 64 64 64 69 0 0 0 68 64 64 64 69 0 0 0 68 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 0 0 0 0 0 0 0 0 0 0 68 64 64 64 64 69 0 0 68 64 64 64 64 69 0 0 68 64 64 64 64 64 64 64 64 64 69 0 0 0 0 0 0 0 0 0 0 0 0 0 0 68 64 64 64 64 64 69 0 0 0 0 0 0 0 0 0 0 0 68 64 64 64 64 64 64 64 69 0 0 0 68 64 64 64 64 69 0 0 68 64 64 64 64 69 0 0 68 64 64 64 64 69 0 0 68 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 + 64 64 69 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 62 0 0 0 0 0 0 65 65 65 65 65 65 0 0 0 0 0 0 0 0 0 0 0 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 67 66 66 66 66 66 66 66 66 66 66 66 66 66 66 66 66 66 66 66 66 66 0 0 0 67 66 66 66 66 66 66 66 66 66 66 66 66 66 66 66 66 66 66 66 66 66 0 0 0 0 0 62 64 64 64 64 62 0 0 62 64 64 64 64 69 0 0 0 0 0 0 0 0 65 65 64 64 64 64 64 64 64 64 64 64 64 64 64 69 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65 65 65 65 65 0 0 0 68 64 64 64 69 0 0 0 68 64 64 64 64 64 64 64 64 65 0 0 0 0 67 64 64 64 64 64 65 0 68 64 64 64 64 64 64 64 64 69 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65 0 0 0 68 64 64 64 64 64 64 64 69 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 67 66 0 0 0 0 67 66 0 0 0 0 67 66 66 66 66 66 66 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 68 64 64 64 64 64 64 69 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65 65 65 65 + 64 64 69 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65 65 65 65 65 65 0 0 65 65 65 65 65 65 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65 65 65 65 65 65 0 68 64 64 64 64 69 0 0 0 0 0 62 0 0 0 0 0 68 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 69 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 62 0 0 0 0 0 0 62 0 0 0 0 0 0 0 0 0 0 62 0 0 0 0 0 0 0 0 0 0 66 66 66 66 66 66 0 0 67 66 66 66 66 0 0 0 0 0 0 0 65 65 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 69 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 68 64 64 64 69 0 0 0 68 64 64 64 69 0 0 0 68 64 64 64 64 64 64 64 64 64 65 0 0 0 0 67 66 66 66 66 0 0 66 66 66 66 66 66 66 66 66 66 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65 0 0 0 0 0 0 0 68 64 64 64 64 64 64 64 69 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 66 66 66 66 66 66 66 66 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 68 64 64 64 + 64 64 64 65 65 65 65 65 65 65 65 65 65 65 65 65 0 65 65 65 65 65 65 0 68 64 64 64 64 69 0 0 68 64 64 64 64 69 0 0 0 0 0 0 0 65 65 65 65 65 65 0 68 64 64 64 64 69 0 68 64 64 64 64 69 0 0 65 65 65 65 65 65 65 0 0 68 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 69 0 0 65 65 65 65 65 65 65 65 65 65 65 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65 65 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 69 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 62 65 65 65 62 0 0 0 65 65 65 65 65 0 0 0 68 64 64 64 69 0 0 0 68 64 64 64 69 0 0 0 68 64 64 64 64 64 64 64 64 64 64 65 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65 65 65 65 65 62 65 65 65 65 65 0 0 0 0 62 0 0 0 0 62 0 0 0 0 65 65 65 65 65 65 65 0 0 0 0 0 0 0 0 0 0 0 68 64 64 64 64 64 64 64 69 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 68 64 64 64 + 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 69 0 68 64 64 64 64 69 0 68 64 64 64 64 69 0 0 68 64 64 64 64 69 0 0 0 0 65 65 0 68 64 64 64 64 69 0 68 64 64 64 64 69 0 68 64 64 64 64 69 0 0 68 64 64 64 64 64 69 0 0 68 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 69 0 0 68 64 64 64 64 64 64 64 64 64 64 65 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65 65 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 69 0 0 0 0 0 0 0 0 0 65 65 65 65 0 0 0 68 64 64 64 69 0 0 0 68 64 64 64 69 0 0 0 68 64 64 64 69 0 0 0 68 64 64 64 69 0 0 0 68 64 64 64 64 64 64 64 64 64 64 64 65 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65 65 62 65 65 0 0 68 64 64 64 64 64 64 64 64 64 69 0 0 0 0 0 0 0 0 0 0 0 0 0 0 68 64 64 64 64 64 69 0 0 0 0 0 0 0 0 0 0 0 68 64 64 64 64 64 64 64 69 0 0 0 65 65 65 65 65 65 0 0 65 65 65 65 65 65 0 0 65 65 65 65 65 65 0 0 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 0 0 0 0 0 0 0 0 0 0 0 0 0 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 64 64 64 64 + 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 69 0 68 64 64 64 64 69 0 68 64 64 64 64 69 0 0 68 64 64 64 64 69 0 0 0 0 68 69 0 68 64 64 64 64 69 0 68 64 64 64 64 69 0 68 64 64 64 64 69 0 0 68 64 64 64 64 64 69 0 0 68 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 69 0 0 68 64 64 64 64 64 64 64 64 64 64 64 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 69 0 0 0 0 65 65 0 0 0 68 64 64 69 0 0 0 68 64 64 64 69 0 0 0 68 64 64 64 69 0 0 0 68 64 64 64 69 0 0 0 68 64 64 64 69 0 0 0 68 64 64 64 64 64 64 64 64 64 64 64 64 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 27 28 28 28 28 28 28 28 28 29 65 65 65 65 65 65 65 0 0 68 64 64 64 69 0 0 68 64 64 64 64 64 64 64 64 64 69 0 0 0 0 0 0 0 0 0 0 0 0 0 0 68 64 64 64 64 64 69 0 0 0 0 0 0 0 0 0 0 0 68 64 64 64 64 64 64 64 69 0 0 0 68 64 64 64 64 69 0 0 68 64 64 64 64 69 0 0 68 64 64 64 64 69 0 0 68 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 65 65 65 65 65 65 65 65 65 65 65 65 65 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 + 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 69 0 68 64 64 64 64 69 0 68 64 64 64 64 69 0 0 68 64 64 64 64 64 65 65 65 65 64 64 65 68 64 64 64 64 69 0 68 64 64 64 64 69 0 68 64 64 64 64 69 0 0 68 64 64 64 64 64 69 0 0 68 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 69 0 0 68 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 69 0 0 0 0 68 69 0 0 0 68 64 64 69 0 0 0 68 64 64 64 69 0 0 0 68 64 64 64 69 0 0 0 68 64 64 64 69 0 0 0 68 64 64 64 69 0 0 0 68 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 0 0 0 0 0 0 0 0 0 0 68 64 64 64 64 64 69 0 0 68 64 64 64 69 0 0 68 64 64 64 64 64 64 64 64 64 69 0 0 0 0 0 0 0 0 0 0 0 0 0 0 68 64 64 64 64 64 69 0 0 0 0 0 0 0 0 0 0 0 68 64 64 64 64 64 64 64 69 0 0 0 68 64 64 64 64 69 0 0 68 64 64 64 64 69 0 0 68 64 64 64 64 69 0 0 68 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 ) (background-tm @@ -112,6 +112,26 @@ (mriceblock (x 1148) (y 313)) (mriceblock (x 491) (y 213)) (mriceblock (x 545) (y 213)) + (stalactite (x 790) (y 96)) + (stalactite (x 868) (y 96)) + (flame (x 1665) (y 288)) + (flame (x 2240) (y 320)) + (flame (x 2625) (y 258)) + (flame (x 2849) (y 191)) + (flame (x 3071) (y 256)) + (flame (x 4737) (y 321)) + (flame (x 4737) (y 225)) + (flame (x 5088) (y 321)) + (flame (x 5088) (y 224)) + (flame (x 7170) (y 354)) + (flame (x 7297) (y 352)) + (flame (x 9887) (y 384)) + (flame (x 10209) (y 352)) + (flame (x 10528) (y 352)) + (flame (x 10688) (y 353)) + (flame (x 12145) (y 256)) + (flame (x 12817) (y 273)) + (flame (x 13010) (y 272)) ) ) |
From: Ingo R. <gr...@us...> - 2004-03-28 14:23:12
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21013 Modified Files: gameloop.cpp gameloop.h player.cpp tile.cpp tile.h Log Message: - removed alpha from tile since it isn't needed - fixed brick behaviour (I hope...) Index: tile.h =================================================================== RCS file: /cvsroot/super-tux/supertux/src/tile.h,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- tile.h 28 Mar 2004 12:41:11 -0000 1.5 +++ tile.h 28 Mar 2004 14:11:53 -0000 1.6 @@ -51,7 +51,6 @@ int next_tile; int anim_speed; - unsigned char alpha; }; Index: player.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/player.cpp,v retrieving revision 1.16 retrieving revision 1.17 diff -u -d -r1.16 -r1.17 --- player.cpp 26 Mar 2004 23:53:31 -0000 1.16 +++ player.cpp 28 Mar 2004 14:11:53 -0000 1.17 @@ -216,8 +216,7 @@ trygrabdistro(base.x, base.y - 32,BOUNCE); trybumpbadguy(base.x, base.y - 64); - if(size == BIG) - trybreakbrick(base.x, base.y); + trybreakbrick(base.x, base.y, size == SMALL); bumpbrick(base.x, base.y); tryemptybox(base.x, base.y, RIGHT); @@ -230,59 +229,11 @@ trybumpbadguy(base.x+ 31, base.y - 64); if(size == BIG) - trybreakbrick(base.x+ 31, base.y); + trybreakbrick(base.x+ 31, base.y, size == SMALL); bumpbrick(base.x+ 31, base.y); tryemptybox(base.x+ 31, base.y, LEFT); } - - - if(size == SMALL) - { - Tile* tile = gettile(base.x, base.y); - /* Get a distro from a brick? */ - if (tile->brick) - { - add_bouncy_distro((((int)base.x) - / 32) * 32, - ((int)base.y / 32) * 32); - - if (counting_distros == false) - { - counting_distros = true; - distro_counter = 100; - } - - if (distro_counter <= 0) - level_change(¤t_level,base.x,base.y - 1, TM_IA, tile->next_tile); - - play_sound(sounds[SND_DISTRO], SOUND_CENTER_SPEAKER); - score = score + SCORE_DISTRO; - distros++; - } - } - else - { - Tile* tile2 = gettile(base.x + 31, base.y); - if (tile2->brick) - { - add_bouncy_distro((((int)base.x + 31) - / 32) * 32, - ((int)base.y / 32) * 32); - if (counting_distros == false) - { - counting_distros = true; - distro_counter = 100; - } - - if (distro_counter <= 0) - level_change(¤t_level,base.x+ 31, base.y, TM_IA, tile2->next_tile); - - play_sound(sounds[SND_DISTRO], SOUND_CENTER_SPEAKER); - score = score + SCORE_DISTRO; - distros++; - } - } } grabdistros(); Index: gameloop.h =================================================================== RCS file: /cvsroot/super-tux/supertux/src/gameloop.h,v retrieving revision 1.20 retrieving revision 1.21 diff -u -d -r1.20 -r1.21 --- gameloop.h 25 Mar 2004 02:27:45 -0000 1.20 +++ gameloop.h 28 Mar 2004 14:11:53 -0000 1.21 @@ -43,9 +43,18 @@ void drawshape(float x, float y, unsigned int c); unsigned int shape(float x, float y); void bumpbrick(float x, float y); + +/** Try to grab the coin at the given coordinates */ void trygrabdistro(float x, float y, int bounciness); -void trybreakbrick(float x, float y); + +/** Try to break the brick at the given coordinates */ +void trybreakbrick(float x, float y, bool small); + +/** Try to get the content out of a bonus box, thus emptying it */ void tryemptybox(float x, float y, int col_side); + +/** Try to bumb a badguy that might we walking above Tux, thus shaking + the tile which the badguy is walking on an killing him this way */ void trybumpbadguy(float x, float y); #endif /*SUPERTUX_GAMELOOP_H*/ Index: tile.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/tile.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- tile.cpp 28 Mar 2004 12:41:11 -0000 1.6 +++ tile.cpp 28 Mar 2004 14:11:53 -0000 1.7 @@ -46,7 +46,6 @@ tile->fullbox = false; tile->distro = false; tile->data = 0; - tile->alpha = 0; tile->next_tile = 0; tile->anim_speed = 25; @@ -57,8 +56,7 @@ reader.read_bool("ice", &tile->ice); reader.read_bool("fullbox", &tile->fullbox); reader.read_bool("distro", &tile->distro); - reader.read_int("data", (int*)&tile->data); - reader.read_int("alpha", (int*)&tile->alpha); + reader.read_int("data", &tile->data); reader.read_int("anim-speed", &tile->anim_speed); reader.read_int("next-tile", &tile->next_tile); reader.read_string_vector("images", &tile->filenames); Index: gameloop.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/gameloop.cpp,v retrieving revision 1.37 retrieving revision 1.38 diff -u -d -r1.37 -r1.38 --- gameloop.cpp 28 Mar 2004 12:41:11 -0000 1.37 +++ gameloop.cpp 28 Mar 2004 14:11:53 -0000 1.38 @@ -1344,8 +1344,7 @@ } /* Break a brick: */ - -void trybreakbrick(float x, float y) +void trybreakbrick(float x, float y, bool small) { Tile* tile = gettile(x, y); if (tile->brick) @@ -1369,23 +1368,19 @@ score = score + SCORE_DISTRO; distros++; } - else + else if (!small) { /* Get rid of it: */ level_change(¤t_level,x, y, TM_IA, tile->next_tile); + + /* Replace it with broken bits: */ + add_broken_brick(((int)(x + 1) / 32) * 32, + (int)(y / 32) * 32); + + /* Get some score: */ + play_sound(sounds[SND_BRICK], SOUND_CENTER_SPEAKER); + score = score + SCORE_BRICK; } - - - /* Replace it with broken bits: */ - - add_broken_brick(((int)(x + 1) / 32) * 32, - (int)(y / 32) * 32); - - - /* Get some score: */ - - play_sound(sounds[SND_BRICK], SOUND_CENTER_SPEAKER); - score = score + SCORE_BRICK; } } |
From: Tobias Gl??er <to...@us...> - 2004-03-28 14:19:17
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20139/src Modified Files: particlesystem.cpp Log Message: Index: particlesystem.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/particlesystem.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- particlesystem.cpp 26 Mar 2004 23:53:31 -0000 1.2 +++ particlesystem.cpp 28 Mar 2004 14:07:59 -0000 1.3 @@ -104,7 +104,7 @@ SnowParticle* particle = (SnowParticle*) *i; particle->y += particle->speed * elapsed_time; if(particle->y > screen->h) { - particle->y = 0; + particle->y = fmodf(particle->y , virtual_height); particle->x = rand() % int(virtual_width); } } |
From: Ingo R. <gr...@us...> - 2004-03-28 12:52:30
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5281 Modified Files: gameloop.cpp tile.cpp tile.h setup.cpp Log Message: - removed next_tile2, which isn't needed - added --sdl option to turn of opengl in case it is on in the config file Index: tile.h =================================================================== RCS file: /cvsroot/super-tux/supertux/src/tile.h,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- tile.h 28 Mar 2004 01:00:16 -0000 1.4 +++ tile.h 28 Mar 2004 12:41:11 -0000 1.5 @@ -49,7 +49,6 @@ /** Id of the tile that is going to replace this tile once it has been collected or jumped at */ int next_tile; - int next_tile2; int anim_speed; unsigned char alpha; Index: setup.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/setup.cpp,v retrieving revision 1.21 retrieving revision 1.22 diff -u -d -r1.21 -r1.22 --- setup.cpp 28 Mar 2004 01:00:16 -0000 1.21 +++ setup.cpp 28 Mar 2004 12:41:11 -0000 1.22 @@ -929,8 +929,11 @@ use_gl = true; #endif - } + else if (strcmp(argv[i], "--sdl") == 0) + { + use_gl = false; + } else if (strcmp(argv[i], "--usage") == 0) { /* Show usage: */ @@ -971,6 +974,7 @@ " --fullscreen Run in fullscreen mode.\n" " --opengl If opengl support was compiled in, this will enable\n" " the EXPERIMENTAL OpenGL mode.\n" + " --sdl Use non-opengl renderer\n" "\n" "Sound Options:\n" " --disable-sound If sound support was compiled in, this will\n" Index: tile.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/tile.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- tile.cpp 25 Mar 2004 11:07:02 -0000 1.5 +++ tile.cpp 28 Mar 2004 12:41:11 -0000 1.6 @@ -48,7 +48,6 @@ tile->data = 0; tile->alpha = 0; tile->next_tile = 0; - tile->next_tile2 = 0; tile->anim_speed = 25; LispReader reader(lisp_cdr(element)); @@ -62,7 +61,6 @@ reader.read_int("alpha", (int*)&tile->alpha); reader.read_int("anim-speed", &tile->anim_speed); reader.read_int("next-tile", &tile->next_tile); - reader.read_int("next-tile2", &tile->next_tile2); reader.read_string_vector("images", &tile->filenames); for(std::vector<std::string>::iterator it = tile->filenames.begin(); Index: gameloop.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/gameloop.cpp,v retrieving revision 1.36 retrieving revision 1.37 diff -u -d -r1.36 -r1.37 --- gameloop.cpp 28 Mar 2004 01:44:15 -0000 1.36 +++ gameloop.cpp 28 Mar 2004 12:41:11 -0000 1.37 @@ -1171,7 +1171,7 @@ } else { - printf("Tile not dravable %u\n", c); + //printf("Tile not dravable %u\n", c); } } } @@ -1363,7 +1363,7 @@ } if (distro_counter <= 0) - level_change(¤t_level,x, y, TM_IA, tile->next_tile2); + level_change(¤t_level,x, y, TM_IA, tile->next_tile); play_sound(sounds[SND_DISTRO], SOUND_CENTER_SPEAKER); score = score + SCORE_DISTRO; |
From: Ingo R. <gr...@us...> - 2004-03-28 11:58:38
|
Update of /cvsroot/super-tux/supertux/data/images/tilesets In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20701 Modified Files: supertux.stgt Added Files: bonus-flower.png bonus-grow.png bonus-herring.png bonus-invisible.png notile.png Log Message: - use new boxes everywhere - added invisible-box (usefull for secrets) --- NEW FILE: bonus-grow.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: notile.png --- (This appears to be a binary file; contents omitted.) Index: supertux.stgt =================================================================== RCS file: /cvsroot/super-tux/supertux/data/images/tilesets/supertux.stgt,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- supertux.stgt 26 Mar 2004 23:54:11 -0000 1.7 +++ supertux.stgt 28 Mar 2004 11:47:21 -0000 1.8 @@ -4,26 +4,12 @@ (properties (id 0)) ;; Zero tile - (tile (id 0)) + (tile (id 0) + (images "notile.png")) (tile (id 1) - (images "background1.png") - (solid #f)) - (tile (id 2) - (images "background2.png") - (solid #f)) - (tile (id 3) - (images "background3.png") - (solid #f)) - (tile (id 4) - (images "background4.png") - (solid #f)) - (tile (id 5) - (images "background5.png") - (solid #f)) - (tile (id 6) - (images "background6.png") - (solid #f)) + (solid #t) + (images "notile.png")) (tile (id 7) (images "snow1.png") @@ -82,18 +68,8 @@ (solid #f)) (tile (id 26) - (images "bonus2-1.png" - "bonus2-2.png" - "bonus2-3.png" - "bonus2-4.png" - "bonus2-5.png" - "bonus2-4.png" - "bonus2-3.png" - "bonus2-2.png" - "bonus2-1.png" - "bonus2-1.png" - "bonus2-1.png" - ) + (images "bonus2-1.png" "bonus2-2.png" "bonus2-3.png" "bonus2-4.png" "bonus2-5.png" "bonus2-4.png" + "bonus2-3.png" "bonus2-2.png" "bonus2-1.png" "bonus2-1.png" "bonus2-1.png") (anim-speed 50) (solid #t) (fullbox #t) @@ -286,7 +262,8 @@ (distro #t)) (tile (id 83) - (images "box-full.png") + (images "bonus2-1.png" "bonus2-2.png" "bonus2-3.png" "bonus2-4.png" "bonus2-5.png" "bonus2-4.png" + "bonus2-3.png" "bonus2-2.png" "bonus2-1.png" "bonus2-1.png" "bonus2-1.png") (fullbox #t) (solid #t) (next-tile 84) @@ -317,13 +294,17 @@ (tile (id 101) (images "bkgd-00.png")) (tile (id 102) - (images "box-full.png") + (images "bonus2-1.png" "bonus2-2.png" "bonus2-3.png" "bonus2-4.png" "bonus2-5.png" "bonus2-4.png" + "bonus2-3.png" "bonus2-2.png" "bonus2-1.png" "bonus2-1.png" "bonus2-1.png") + (editor-images "bonus-flower.png") (solid #t) (fullbox #t) (data 2) (next-tile 84)) (tile (id 103) - (images "box-full.png") + (images "bonus2-1.png" "bonus2-2.png" "bonus2-3.png" "bonus2-4.png" "bonus2-5.png" "bonus2-4.png" + "bonus2-3.png" "bonus2-2.png" "bonus2-1.png" "bonus2-1.png" "bonus2-1.png") + (editor-images "bonus-herring.png") (solid #t) (fullbox #t) (data 3) @@ -345,4 +326,30 @@ (next-tile 84) (solid #t)) + (tile (id 106) + (images "background1.png") + (solid #f)) + (tile (id 107) + (images "background2.png") + (solid #f)) + (tile (id 108) + (images "background3.png") + (solid #f)) + (tile (id 109) + (images "background4.png") + (solid #f)) + (tile (id 110) + (images "background5.png") + (solid #f)) + (tile (id 111) + (images "background6.png") + (solid #f)) + + (tile (id 112) + (editor-images "bonus-invisible.png") + (anim-speed 50) + (solid #t) + (fullbox #t) + (next-tile 84) + (data 0)) ) \ No newline at end of file --- NEW FILE: bonus-flower.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: bonus-invisible.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: bonus-herring.png --- (This appears to be a binary file; contents omitted.) |
From: Tobias Gl??er <to...@us...> - 2004-03-28 11:10:00
|
Update of /cvsroot/super-tux/supertux/data/images/status In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12974/data/images/status Modified Files: mousecursor.png Log Message: new link image Index: mousecursor.png =================================================================== RCS file: /cvsroot/super-tux/supertux/data/images/status/mousecursor.png,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 Binary files /tmp/cvsyj3XtX and /tmp/cvsuLkXWr differ |
From: Tobias Gl??er <to...@us...> - 2004-03-28 10:37:29
|
Update of /cvsroot/super-tux/supertux/data/images/shared In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8426/data/images/shared Added Files: flame-0.png flame-1.png Log Message: initial --- NEW FILE: flame-0.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: flame-1.png --- (This appears to be a binary file; contents omitted.) |
From: Tobias Gl??er <to...@us...> - 2004-03-28 01:55:29
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31271/src Modified Files: badguy.cpp badguy.h gameloop.cpp Log Message: applied flame badguy patch from Matze Braun Index: badguy.h =================================================================== RCS file: /cvsroot/super-tux/supertux/src/badguy.h,v retrieving revision 1.17 retrieving revision 1.18 diff -u -d -r1.17 -r1.18 --- badguy.h 27 Mar 2004 00:14:46 -0000 1.17 +++ badguy.h 28 Mar 2004 01:44:15 -0000 1.18 @@ -53,6 +53,7 @@ extern texture_type img_mrbomb_right[4]; extern texture_type img_stalactite; extern texture_type img_stalactite_broken; +extern texture_type img_flame[2]; /* Bad guy kinds: */ enum BadGuyKind { @@ -61,11 +62,14 @@ BAD_MONEY, BAD_MRBOMB, BAD_BOMB, - BAD_STALACTITE + BAD_STALACTITE, + BAD_FLAME }; BadGuyKind badguykind_from_string(const std::string& str); std::string badguykind_to_string(BadGuyKind kind); +void load_badguy_gfx(); +void free_badguy_gfx(); struct BadGuyData { @@ -127,6 +131,9 @@ void action_stalactite(); void draw_stalactite(); + void action_flame(); + void draw_flame(); + void make_player_jump(Player* player); void check_horizontal_bump(bool checkcliff = false); void bump(); Index: badguy.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/badguy.cpp,v retrieving revision 1.15 retrieving revision 1.16 diff -u -d -r1.15 -r1.16 --- badguy.cpp 27 Mar 2004 00:14:46 -0000 1.15 +++ badguy.cpp 28 Mar 2004 01:44:15 -0000 1.16 @@ -9,6 +9,7 @@ // Copyright: See COPYING file that comes with this distribution // // +#include <math.h> #include "globals.h" #include "defines.h" @@ -34,6 +35,7 @@ texture_type img_mrbomb_right[4]; texture_type img_stalactite; texture_type img_stalactite_broken; +texture_type img_flame[2]; BadGuyKind badguykind_from_string(const std::string& str) { @@ -47,6 +49,8 @@ return BAD_MRBOMB; else if (str == "stalactite") return BAD_STALACTITE; + else if (str == "flame") + return BAD_FLAME; else { printf("Couldn't convert badguy: %s\n", str.c_str()); @@ -73,6 +77,9 @@ case BAD_STALACTITE: return "stalactite"; break; + case BAD_FLAME: + return "flame"; + break; default: return "bsod"; } @@ -101,6 +108,8 @@ mode = BOMB_TICKING; // hack so that the bomb doesn't hurt until it expldes... dying = DYING_SQUISHED; + } else if(kind == BAD_FLAME) { + base.ym = 0; // we misuse base.ym as angle for the flame } } @@ -430,6 +439,17 @@ } void +BadGuy::action_flame() +{ + static const float radius = 100; + static const float speed = 0.02; + base.x = old_base.x + cos(base.ym) * radius; + base.y = old_base.y + sin(base.ym) * radius; + + base.ym = fmodf(base.ym + frame_ratio * speed, 2*M_PI); +} + +void BadGuy::action() { if (seen) @@ -460,6 +480,9 @@ action_stalactite(); break; + case BAD_FLAME: + action_flame(); + break; } } @@ -576,6 +599,15 @@ } void +BadGuy::draw_flame() +{ + size_t frame = (global_frame_counter / 10) % 2; + texture_type* texture = &img_flame[frame]; + + texture_draw(texture, base.x - scroll_x, base.y); +} + +void BadGuy::draw() { // Don't try to draw stuff that is outside of the screen @@ -607,6 +639,11 @@ case BAD_STALACTITE: draw_stalactite(); break; + + case BAD_FLAME: + draw_flame(); + break; + } } } @@ -707,7 +744,7 @@ switch (c_object) { case CO_BULLET: - if(kind == BAD_BOMB || kind == BAD_STALACTITE) + if(kind == BAD_BOMB || kind == BAD_STALACTITE || kind == BAD_FLAME) return; dying = DYING_FALLING; @@ -757,4 +794,186 @@ } } +//--------------------------------------------------------------------------- + +void load_badguy_gfx() +{ + /* (BSOD) */ + texture_load(&img_bsod_left[0], datadir + + "/images/shared/bsod-left-0.png", + USE_ALPHA); + + texture_load(&img_bsod_left[1], datadir + + "/images/shared/bsod-left-1.png", + USE_ALPHA); + + texture_load(&img_bsod_left[2], datadir + + "/images/shared/bsod-left-2.png", + USE_ALPHA); + + texture_load(&img_bsod_left[3], datadir + + "/images/shared/bsod-left-3.png", + USE_ALPHA); + + texture_load(&img_bsod_right[0], datadir + + "/images/shared/bsod-right-0.png", + USE_ALPHA); + + texture_load(&img_bsod_right[1], datadir + + "/images/shared/bsod-right-1.png", + USE_ALPHA); + + texture_load(&img_bsod_right[2], datadir + + "/images/shared/bsod-right-2.png", + USE_ALPHA); + + texture_load(&img_bsod_right[3], datadir + + "/images/shared/bsod-right-3.png", + USE_ALPHA); + + texture_load(&img_bsod_squished_left, datadir + + "/images/shared/bsod-squished-left.png", + USE_ALPHA); + + texture_load(&img_bsod_squished_right, datadir + + "/images/shared/bsod-squished-right.png", + USE_ALPHA); + + texture_load(&img_bsod_falling_left, datadir + + "/images/shared/bsod-falling-left.png", + USE_ALPHA); + + texture_load(&img_bsod_falling_right, datadir + + "/images/shared/bsod-falling-right.png", + USE_ALPHA); + + + /* (Laptop) */ + + texture_load(&img_laptop_left[0], datadir + + "/images/shared/laptop-left-0.png", + USE_ALPHA); + + texture_load(&img_laptop_left[1], datadir + + "/images/shared/laptop-left-1.png", + USE_ALPHA); + + texture_load(&img_laptop_left[2], datadir + + "/images/shared/laptop-left-2.png", + USE_ALPHA); + + texture_load(&img_laptop_right[0], datadir + + "/images/shared/laptop-right-0.png", + USE_ALPHA); + + texture_load(&img_laptop_right[1], datadir + + "/images/shared/laptop-right-1.png", + USE_ALPHA); + + texture_load(&img_laptop_right[2], datadir + + "/images/shared/laptop-right-2.png", + USE_ALPHA); + + texture_load(&img_laptop_flat_left, datadir + + "/images/shared/laptop-flat-left.png", + USE_ALPHA); + + texture_load(&img_laptop_flat_right, datadir + + "/images/shared/laptop-flat-right.png", + USE_ALPHA); + + texture_load(&img_laptop_falling_left, datadir + + "/images/shared/laptop-falling-left.png", + USE_ALPHA); + + texture_load(&img_laptop_falling_right, datadir + + "/images/shared/laptop-falling-right.png", + USE_ALPHA); + + + /* (Money) */ + + texture_load(&img_money_left[0], datadir + + "/images/shared/bag-left-0.png", + USE_ALPHA); + + texture_load(&img_money_left[1], datadir + + "/images/shared/bag-left-1.png", + USE_ALPHA); + + texture_load(&img_money_right[0], datadir + + "/images/shared/bag-right-0.png", + USE_ALPHA); + + texture_load(&img_money_right[1], datadir + + "/images/shared/bag-right-1.png", + USE_ALPHA); + + /* Mr. Bomb */ + for(int i=0; i<4; ++i) { + char num[4]; + snprintf(num, 4, "%d", i); + texture_load(&img_mrbomb_left[i], + datadir + "/images/shared/mrbomb-left-" + num + ".png", USE_ALPHA); + texture_load(&img_mrbomb_right[i], + datadir + "/images/shared/mrbomb-right-" + num + ".png", USE_ALPHA); + } + + /* stalactite */ + texture_load(&img_stalactite, + datadir + "/images/shared/stalactite.png", USE_ALPHA); + texture_load(&img_stalactite_broken, + datadir + "/images/shared/stalactite-broken.png", USE_ALPHA); + + /* flame */ + texture_load(&img_flame[0], + datadir + "/images/shared/flame-0.png", USE_ALPHA); + texture_load(&img_flame[1], + datadir + "/images/shared/flame-1.png", USE_ALPHA); +} + +void free_badguy_gfx() +{ + for (int i = 0; i < 4; i++) + { + texture_free(&img_bsod_left[i]); + texture_free(&img_bsod_right[i]); + } + + texture_free(&img_bsod_squished_left); + texture_free(&img_bsod_squished_right); + + texture_free(&img_bsod_falling_left); + texture_free(&img_bsod_falling_right); + + for (int i = 0; i < 3; i++) + { + texture_free(&img_laptop_left[i]); + texture_free(&img_laptop_right[i]); + } + + texture_free(&img_laptop_flat_left); + texture_free(&img_laptop_flat_right); + + texture_free(&img_laptop_falling_left); + texture_free(&img_laptop_falling_right); + + for (int i = 0; i < 2; i++) + { + texture_free(&img_money_left[i]); + texture_free(&img_money_right[i]); + } + + for(int i = 0; i < 4; i++) { + texture_free(&img_mrbomb_left[i]); + texture_free(&img_mrbomb_right[i]); + } + + texture_free(&img_stalactite); + texture_free(&img_stalactite_broken); + + texture_free(&img_flame[0]); + texture_free(&img_flame[1]); +} + // EOF // Index: gameloop.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/gameloop.cpp,v retrieving revision 1.35 retrieving revision 1.36 diff -u -d -r1.35 -r1.36 --- gameloop.cpp 28 Mar 2004 01:00:16 -0000 1.35 +++ gameloop.cpp 28 Mar 2004 01:44:15 -0000 1.36 @@ -1020,134 +1020,7 @@ /* Bad guys: */ - - /* (BSOD) */ - - texture_load(&img_bsod_left[0], datadir + - "/images/shared/bsod-left-0.png", - USE_ALPHA); - - texture_load(&img_bsod_left[1], datadir + - "/images/shared/bsod-left-1.png", - USE_ALPHA); - - texture_load(&img_bsod_left[2], datadir + - "/images/shared/bsod-left-2.png", - USE_ALPHA); - - texture_load(&img_bsod_left[3], datadir + - "/images/shared/bsod-left-3.png", - USE_ALPHA); - - texture_load(&img_bsod_right[0], datadir + - "/images/shared/bsod-right-0.png", - USE_ALPHA); - - texture_load(&img_bsod_right[1], datadir + - "/images/shared/bsod-right-1.png", - USE_ALPHA); - - texture_load(&img_bsod_right[2], datadir + - "/images/shared/bsod-right-2.png", - USE_ALPHA); - - texture_load(&img_bsod_right[3], datadir + - "/images/shared/bsod-right-3.png", - USE_ALPHA); - - texture_load(&img_bsod_squished_left, datadir + - "/images/shared/bsod-squished-left.png", - USE_ALPHA); - - texture_load(&img_bsod_squished_right, datadir + - "/images/shared/bsod-squished-right.png", - USE_ALPHA); - - texture_load(&img_bsod_falling_left, datadir + - "/images/shared/bsod-falling-left.png", - USE_ALPHA); - - texture_load(&img_bsod_falling_right, datadir + - "/images/shared/bsod-falling-right.png", - USE_ALPHA); - - - /* (Laptop) */ - - texture_load(&img_laptop_left[0], datadir + - "/images/shared/laptop-left-0.png", - USE_ALPHA); - - texture_load(&img_laptop_left[1], datadir + - "/images/shared/laptop-left-1.png", - USE_ALPHA); - - texture_load(&img_laptop_left[2], datadir + - "/images/shared/laptop-left-2.png", - USE_ALPHA); - - texture_load(&img_laptop_right[0], datadir + - "/images/shared/laptop-right-0.png", - USE_ALPHA); - - texture_load(&img_laptop_right[1], datadir + - "/images/shared/laptop-right-1.png", - USE_ALPHA); - - texture_load(&img_laptop_right[2], datadir + - "/images/shared/laptop-right-2.png", - USE_ALPHA); - - texture_load(&img_laptop_flat_left, datadir + - "/images/shared/laptop-flat-left.png", - USE_ALPHA); - - texture_load(&img_laptop_flat_right, datadir + - "/images/shared/laptop-flat-right.png", - USE_ALPHA); - - texture_load(&img_laptop_falling_left, datadir + - "/images/shared/laptop-falling-left.png", - USE_ALPHA); - - texture_load(&img_laptop_falling_right, datadir + - "/images/shared/laptop-falling-right.png", - USE_ALPHA); - - - /* (Money) */ - - texture_load(&img_money_left[0], datadir + - "/images/shared/bag-left-0.png", - USE_ALPHA); - - texture_load(&img_money_left[1], datadir + - "/images/shared/bag-left-1.png", - USE_ALPHA); - - texture_load(&img_money_right[0], datadir + - "/images/shared/bag-right-0.png", - USE_ALPHA); - - texture_load(&img_money_right[1], datadir + - "/images/shared/bag-right-1.png", - USE_ALPHA); - - /* Mr. Bomb */ - for(int i=0; i<4; ++i) { - char num[4]; - snprintf(num, 4, "%d", i); - texture_load(&img_mrbomb_left[i], - datadir + "/images/shared/mrbomb-left-" + num + ".png", USE_ALPHA); - texture_load(&img_mrbomb_right[i], - datadir + "/images/shared/mrbomb-right-" + num + ".png", USE_ALPHA); - } - - /* stalactite */ - texture_load(&img_stalactite, - datadir + "/images/shared/stalactite.png", USE_ALPHA); - texture_load(&img_stalactite_broken, - datadir + "/images/shared/stalactite-broken.png", USE_ALPHA); + load_badguy_gfx(); /* Upgrades: */ @@ -1244,43 +1117,7 @@ texture_free(&skidtux_left); texture_free(&skidtux_right); - for (i = 0; i < 4; i++) - { - texture_free(&img_bsod_left[i]); - texture_free(&img_bsod_right[i]); - } - - texture_free(&img_bsod_squished_left); - texture_free(&img_bsod_squished_right); - - texture_free(&img_bsod_falling_left); - texture_free(&img_bsod_falling_right); - - for (i = 0; i < 3; i++) - { - texture_free(&img_laptop_left[i]); - texture_free(&img_laptop_right[i]); - } - - texture_free(&img_laptop_flat_left); - texture_free(&img_laptop_flat_right); - - texture_free(&img_laptop_falling_left); - texture_free(&img_laptop_falling_right); - - for (i = 0; i < 2; i++) - { - texture_free(&img_money_left[i]); - texture_free(&img_money_right[i]); - } - - for(i = 0; i < 4; i++) { - texture_free(&img_mrbomb_left[i]); - texture_free(&img_mrbomb_right[i]); - } - - texture_free(&img_stalactite); - texture_free(&img_stalactite_broken); + free_badguy_gfx(); texture_free(&img_box_full); texture_free(&img_box_empty); |
From: Tobias Gl??er <to...@us...> - 2004-03-28 01:42:04
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28916/src Modified Files: button.cpp leveleditor.cpp Log Message: improved the behaviour of the mouse-cursor in the leveleditor Index: button.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/button.cpp,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- button.cpp 22 Mar 2004 15:52:35 -0000 1.7 +++ button.cpp 28 Mar 2004 01:30:48 -0000 1.8 @@ -148,6 +148,7 @@ if(pbutton->state != BUTTON_PRESSED && pbutton->state != BUTTON_CLICKED) { pbutton->state = BUTTON_HOVER; + mouse_cursor->set_state(MC_LINK); } } else if(event->type != SDL_KEYDOWN && event->type != SDL_KEYUP) Index: leveleditor.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/leveleditor.cpp,v retrieving revision 1.23 retrieving revision 1.24 diff -u -d -r1.23 -r1.24 --- leveleditor.cpp 28 Mar 2004 01:00:16 -0000 1.23 +++ leveleditor.cpp 28 Mar 2004 01:30:48 -0000 1.24 @@ -220,7 +220,7 @@ le_quit(); return 1; } - le_update_buttons(le_current_level->theme.c_str()); + le_update_buttons(le_current_level->theme.c_str()); le_set_defaults(); level_load_gfx(le_current_level); show_menu = true; @@ -239,7 +239,7 @@ switch (i = subset_new_menu->check()) { case 3: - st_subset::create(subset_new_menu->item[2].input); + st_subset::create(subset_new_menu->item[2].input); le_level_subset.load(subset_new_menu->item[2].input); leveleditor_menu->item[3].kind = MN_GOTO; le_level = 1; @@ -251,7 +251,7 @@ le_quit(); return 1; } - le_update_buttons(le_current_level->theme.c_str()); + le_update_buttons(le_current_level->theme.c_str()); le_set_defaults(); level_load_gfx(le_current_level); menu_item_change_input(&subset_new_menu->item[2],""); @@ -275,9 +275,10 @@ break; } } - mouse_cursor->draw(); } + mouse_cursor->draw(); + if(done) { le_quit(); @@ -850,9 +851,11 @@ while(SDL_PollEvent(&event)) { - if(show_menu) - menu_event(event); - + if(show_menu) + menu_event(event); + else + mouse_cursor->set_state(MC_NORMAL); + /* testing SDL_KEYDOWN, SDL_KEYUP and SDL_QUIT events*/ if(event.type == SDL_KEYDOWN || ((event.type == SDL_MOUSEBUTTONDOWN || SDL_MOUSEMOTION) && (event.motion.x > 0 && event.motion.x < screen->w - 64 && event.motion.y > 0 && event.motion.y < screen->h))) @@ -1046,8 +1049,8 @@ break; case SDLK_n: d = 1; - break; - default: + break; + default: break; } break; @@ -1292,8 +1295,8 @@ /* if there is a bad guy over there, remove it */ for(i = 0; i < bad_guys.size(); ++i) - if(xx == bad_guys[i].base.x/32 && yy == bad_guys[i].base.y/32) - bad_guys.erase(static_cast<std::vector<BadGuy>::iterator>(&bad_guys[i])); + if(xx == bad_guys[i].base.x/32 && yy == bad_guys[i].base.y/32) + bad_guys.erase(static_cast<std::vector<BadGuy>::iterator>(&bad_guys[i])); if(c == '0') /* if it's a bad guy */ add_bad_guy(xx*32, yy*32, BAD_BSOD); @@ -1332,9 +1335,9 @@ /* if there is a bad guy over there, remove it */ for(i = 0; i < bad_guys.size(); ++i) - if(bad_guys[i].base.x/32 >= x1 && bad_guys[i].base.x/32 <= x2 - && bad_guys[i].base.y/32 >= y1 && bad_guys[i].base.y/32 <= y2) - bad_guys.erase(static_cast<std::vector<BadGuy>::iterator>(&bad_guys[i])); + if(bad_guys[i].base.x/32 >= x1 && bad_guys[i].base.x/32 <= x2 + && bad_guys[i].base.y/32 >= y1 && bad_guys[i].base.y/32 <= y2) + bad_guys.erase(static_cast<std::vector<BadGuy>::iterator>(&bad_guys[i])); for(xx = x1; xx <= x2; xx++) for(yy = y1; yy <= y2; yy++) @@ -1391,12 +1394,12 @@ "settings of your level, including how long it is or what music it will", "play. When you are ready to give your level a test, click on the little", "running Tux. If you like the changes you have made to your level,", - "press the red save key to keep them.", + "press the red save key to keep them.", "To change which level in your subset you are editing, press the white", "up and down arrow keys at the top of the button box.", - "", + "", "Have fun making levels! If you make some good ones, send them to us on", - "the SuperTux mailing list!", + "the SuperTux mailing list!", "- SuperTux team" }; |
From: Ingo R. <gr...@us...> - 2004-03-28 01:14:38
|
Update of /cvsroot/super-tux/supertux/data/images/shared In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24372 Modified Files: mrbomb-left-0.png mrbomb-left-1.png mrbomb-left-2.png mrbomb-left-3.png mrbomb-right-0.png mrbomb-right-1.png mrbomb-right-2.png mrbomb-right-3.png Added Files: mrbomb-explosion.png mrbombx-left-0.png mrbombx-right-0.png Log Message: - mrbomb stuff --- NEW FILE: mrbombx-left-0.png --- (This appears to be a binary file; contents omitted.) Index: mrbomb-left-0.png =================================================================== RCS file: /cvsroot/super-tux/supertux/data/images/shared/mrbomb-left-0.png,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 Binary files /tmp/cvsti8R96 and /tmp/cvsNarHmS differ Index: mrbomb-left-1.png =================================================================== RCS file: /cvsroot/super-tux/supertux/data/images/shared/mrbomb-left-1.png,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 Binary files /tmp/cvsYC38S9 and /tmp/cvsASXK7U differ Index: mrbomb-left-2.png =================================================================== RCS file: /cvsroot/super-tux/supertux/data/images/shared/mrbomb-left-2.png,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 Binary files /tmp/cvsrCBsYb and /tmp/cvsKiEqeX differ Index: mrbomb-left-3.png =================================================================== RCS file: /cvsroot/super-tux/supertux/data/images/shared/mrbomb-left-3.png,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 Binary files /tmp/cvsw0lD7f and /tmp/cvsNv9Mo1 differ --- NEW FILE: mrbombx-right-0.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: mrbomb-explosion.png --- (This appears to be a binary file; contents omitted.) Index: mrbomb-right-2.png =================================================================== RCS file: /cvsroot/super-tux/supertux/data/images/shared/mrbomb-right-2.png,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 Binary files /tmp/cvsa6XArh and /tmp/cvsX398K2 differ Index: mrbomb-right-3.png =================================================================== RCS file: /cvsroot/super-tux/supertux/data/images/shared/mrbomb-right-3.png,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 Binary files /tmp/cvsxe5ipj and /tmp/cvsD9K8J4 differ Index: mrbomb-right-0.png =================================================================== RCS file: /cvsroot/super-tux/supertux/data/images/shared/mrbomb-right-0.png,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 Binary files /tmp/cvsFvJ9il and /tmp/cvsLiUdF6 differ Index: mrbomb-right-1.png =================================================================== RCS file: /cvsroot/super-tux/supertux/data/images/shared/mrbomb-right-1.png,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 Binary files /tmp/cvst4W7Ip and /tmp/cvswLXx6a differ |
From: Tobias Gl??er <to...@us...> - 2004-03-28 01:11:29
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23846/src Modified Files: gameloop.cpp globals.cpp globals.h leveleditor.cpp menu.cpp menu.h mousecursor.cpp mousecursor.h setup.cpp tile.h title.cpp Log Message: We have our own mouse-cursor now! (graphics by Settra Gaia) Index: tile.h =================================================================== RCS file: /cvsroot/super-tux/supertux/src/tile.h,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- tile.h 25 Mar 2004 10:26:07 -0000 1.3 +++ tile.h 28 Mar 2004 01:00:16 -0000 1.4 @@ -55,6 +55,7 @@ unsigned char alpha; }; + class TileManager { private: @@ -80,4 +81,6 @@ } }; + + #endif Index: mousecursor.h =================================================================== RCS file: /cvsroot/super-tux/supertux/src/mousecursor.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- mousecursor.h 26 Mar 2004 23:54:47 -0000 1.1 +++ mousecursor.h 28 Mar 2004 01:00:16 -0000 1.2 @@ -33,9 +33,10 @@ ~MouseCursor(); int state(); void set_state(int nstate); - void draw(int x, int y); + void draw(); private: + int state_before_click; int cur_state; int cur_frame, tot_frames; texture_type cursor; Index: globals.h =================================================================== RCS file: /cvsroot/super-tux/supertux/src/globals.h,v retrieving revision 1.19 retrieving revision 1.20 diff -u -d -r1.19 -r1.20 --- globals.h 24 Mar 2004 14:35:11 -0000 1.19 +++ globals.h 28 Mar 2004 01:00:16 -0000 1.20 @@ -18,12 +18,15 @@ #include <SDL.h> #include "text.h" #include "menu.h" +#include "mousecursor.h" extern std::string datadir; extern SDL_Surface * screen; extern text_type black_text, gold_text, white_text, white_small_text, white_big_text, blue_text, red_text, yellow_nums; +extern MouseCursor * mouse_cursor; + extern bool use_gl; extern bool use_joystick; extern bool use_fullscreen; Index: gameloop.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/gameloop.cpp,v retrieving revision 1.34 retrieving revision 1.35 diff -u -d -r1.34 -r1.35 --- gameloop.cpp 27 Mar 2004 17:24:14 -0000 1.34 +++ gameloop.cpp 28 Mar 2004 01:00:16 -0000 1.35 @@ -570,7 +570,10 @@ } if(show_menu) + { menu_process_current(); + mouse_cursor->draw(); + } /* (Update it all!) */ updatescreen(); Index: menu.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/menu.cpp,v retrieving revision 1.19 retrieving revision 1.20 diff -u -d -r1.19 -r1.20 --- menu.cpp 27 Mar 2004 17:24:14 -0000 1.19 +++ menu.cpp 28 Mar 2004 01:00:16 -0000 1.20 @@ -456,16 +456,11 @@ } } -/* Draw the current menu. */ -void -Menu::draw() +int Menu::width() { - int menu_height; - int menu_width; - /* The width of the menu has to be more than the width of the text with the most characters */ - menu_width = 0; + int menu_width = 0; for(int i = 0; i < num_items; ++i) { int w = strlen(item[i].text) + (item[i].input ? strlen(item[i].input) + 1 : 0) + strlen(string_list_active(item[i].list)); @@ -477,8 +472,20 @@ } } - menu_width = menu_width * 16 + 48; - menu_height = (num_items) * 24; + return (menu_width * 16 + 48); +} + +int Menu::height() +{ + return ((num_items) * 24); +} + +/* Draw the current menu. */ +void +Menu::draw() +{ + int menu_height = height(); + int menu_width = width(); /* Draw a transparent background */ fillrect(pos_x - menu_width/2, @@ -524,11 +531,12 @@ SDLKey key; switch(event.type) { - case SDL_KEYDOWN: + case SDL_KEYDOWN: key = event.key.keysym.sym; SDLMod keymod; char ch[2]; keymod = SDL_GetModState(); + int x,y; /* If the current unicode character is an ASCII character, assign it to ch. */ @@ -604,18 +612,37 @@ case SDL_JOYBUTTONDOWN: menuaction = MENU_ACTION_HIT; break; + case SDL_MOUSEBUTTONDOWN: + x = event.motion.x; + y = event.motion.y; + if(x > current_menu->pos_x - current_menu->width()/2 && + x < current_menu->pos_x + current_menu->width()/2 && + y > current_menu->pos_y - current_menu->height()/2 && + y < current_menu->pos_y + current_menu->height()/2) + { + menuaction = MENU_ACTION_HIT; + } + break; + case SDL_MOUSEMOTION: + x = event.motion.x; + y = event.motion.y; + if(x > current_menu->pos_x - current_menu->width()/2 && + x < current_menu->pos_x + current_menu->width()/2 && + y > current_menu->pos_y - current_menu->height()/2 && + y < current_menu->pos_y + current_menu->height()/2) + { + current_menu->active_item = (y - (current_menu->pos_y - current_menu->height()/2)) / 24; + menu_change = true; + mouse_cursor->set_state(MC_LINK); + } + else + { + mouse_cursor->set_state(MC_NORMAL); + } + break; default: break; } - /* FIXME: NO JOYSTICK SUPPORT */ - /*#ifdef JOY_YES - else if (event.type == SDL_JOYBUTTONDOWN) - { - Joystick button: Continue: - - done = 1; - } - #endif*/ } Index: setup.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/setup.cpp,v retrieving revision 1.20 retrieving revision 1.21 diff -u -d -r1.20 -r1.21 --- setup.cpp 27 Mar 2004 17:24:14 -0000 1.20 +++ setup.cpp 28 Mar 2004 01:00:16 -0000 1.21 @@ -545,6 +545,9 @@ texture_load(&arrow_left, datadir + "/images/icons/left.png", USE_ALPHA); texture_load(&arrow_right, datadir + "/images/icons/right.png", USE_ALPHA); + /* Load the mouse-cursor */ + mouse_cursor = new MouseCursor( datadir + "/images/status/mousecursor.png",1); + } void st_general_free(void) @@ -567,6 +570,9 @@ texture_free(&arrow_left); texture_free(&arrow_right); + /* Free mouse-cursor */ + delete mouse_cursor; + /* Free menus */ delete main_menu; delete game_menu; Index: menu.h =================================================================== RCS file: /cvsroot/super-tux/supertux/src/menu.h,v retrieving revision 1.22 retrieving revision 1.23 diff -u -d -r1.22 -r1.23 --- menu.h 27 Mar 2004 17:24:14 -0000 1.22 +++ menu.h 28 Mar 2004 01:00:16 -0000 1.23 @@ -17,6 +17,7 @@ #include "texture.h" #include "timer.h" #include "type.h" +#include "mousecursor.h" /* Kinds of menu items */ enum MenuItemKind { @@ -51,6 +52,8 @@ class Menu { +friend void menu_event(SDL_Event& event); + private: // position of the menu (ie. center of the menu, not top/left) int pos_x; @@ -58,6 +61,8 @@ int num_items; Menu* last_menu; + int width(); + int height(); public: timer_type effect; Index: globals.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/globals.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- globals.cpp 22 Mar 2004 15:47:31 -0000 1.6 +++ globals.cpp 28 Mar 2004 01:00:16 -0000 1.7 @@ -18,6 +18,8 @@ SDL_Surface * screen; text_type black_text, gold_text, blue_text, red_text, yellow_nums, white_text, white_small_text, white_big_text; +MouseCursor * mouse_cursor; + bool use_gl; bool use_joystick; bool use_fullscreen; Index: leveleditor.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/leveleditor.cpp,v retrieving revision 1.22 retrieving revision 1.23 diff -u -d -r1.22 -r1.23 --- leveleditor.cpp 27 Mar 2004 17:24:14 -0000 1.22 +++ leveleditor.cpp 28 Mar 2004 01:00:16 -0000 1.23 @@ -275,6 +275,7 @@ break; } } + mouse_cursor->draw(); } if(done) @@ -849,18 +850,19 @@ while(SDL_PollEvent(&event)) { + if(show_menu) + menu_event(event); + /* testing SDL_KEYDOWN, SDL_KEYUP and SDL_QUIT events*/ if(event.type == SDL_KEYDOWN || ((event.type == SDL_MOUSEBUTTONDOWN || SDL_MOUSEMOTION) && (event.motion.x > 0 && event.motion.x < screen->w - 64 && event.motion.y > 0 && event.motion.y < screen->h))) { - switch(event.type) { case SDL_KEYDOWN: // key pressed key = event.key.keysym.sym; if(show_menu) { - menu_event(event); if(key == SDLK_ESCAPE) { show_menu = false; Index: mousecursor.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/mousecursor.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- mousecursor.cpp 26 Mar 2004 23:54:47 -0000 1.1 +++ mousecursor.cpp 28 Mar 2004 01:00:16 -0000 1.2 @@ -15,16 +15,16 @@ MouseCursor::MouseCursor(std::string cursor_file, int frames) { -texture_load(&cursor,cursor_file.c_str(),USE_ALPHA); + texture_load(&cursor,cursor_file.c_str(),USE_ALPHA); -cur_state = MC_NORMAL; -cur_frame = 0; -tot_frames = frames; + cur_state = MC_NORMAL; + cur_frame = 0; + tot_frames = frames; -timer_init(&timer, false); -timer_start(&timer,MC_FRAME_PERIOD); + timer_init(&timer, false); + timer_start(&timer,MC_FRAME_PERIOD); -SDL_ShowCursor(SDL_DISABLE); + SDL_ShowCursor(SDL_DISABLE); } MouseCursor::~MouseCursor() @@ -36,28 +36,42 @@ int MouseCursor::state() { -return cur_state; + return cur_state; } void MouseCursor::set_state(int nstate) { -cur_state = nstate; + cur_state = nstate; } -void MouseCursor::draw(int x, int y) +void MouseCursor::draw() { -int w,h; -w = cursor.w / tot_frames; -h = cursor.h / MC_STATES_NB; + int x,y,w,h; + Uint8 ispressed = SDL_GetMouseState(&x,&y); + w = cursor.w / tot_frames; + h = cursor.h / MC_STATES_NB; + if(ispressed &SDL_BUTTON(1) || ispressed &SDL_BUTTON(2)) + { + if(cur_state != MC_CLICK) + { + state_before_click = cur_state; + cur_state = MC_CLICK; + } + } + else + { + if(cur_state == MC_CLICK) + cur_state = state_before_click; + } -if(timer_get_left(&timer) < 0 && tot_frames > 1) - { - cur_frame++; - if(cur_frame++ >= tot_frames) - cur_frame = 0; + if(timer_get_left(&timer) < 0 && tot_frames > 1) + { + cur_frame++; + if(cur_frame++ >= tot_frames) + cur_frame = 0; - timer_start(&timer,MC_FRAME_PERIOD); - } + timer_start(&timer,MC_FRAME_PERIOD); + } -texture_draw_part(&cursor, w*cur_frame, h*cur_state , x, y, w, h); + texture_draw_part(&cursor, w*cur_frame, h*cur_state , x, y, w, h); } Index: title.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/title.cpp,v retrieving revision 1.14 retrieving revision 1.15 diff -u -d -r1.14 -r1.15 --- title.cpp 27 Mar 2004 17:24:14 -0000 1.14 +++ title.cpp 28 Mar 2004 01:00:16 -0000 1.15 @@ -326,6 +326,8 @@ process_save_load_game_menu(false); } + mouse_cursor->draw(); + flipscreen(); /* Set the time of the last update and the time of the current update */ @@ -461,7 +463,7 @@ texture_draw_part(&bkg_title, 0, 0, 0, 0, 640, 130); - + flipscreen(); if(60+screen->h+(n*18)+(d*18)-scroll < 0 && 20+60+screen->h+(n*18)+(d*18)-scroll < 0) |
From: Tobias Gl??er <to...@us...> - 2004-03-28 01:10:06
|
Update of /cvsroot/super-tux/supertux/data/images/status In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23608/data/images/status Added Files: mousecursor.png Log Message: initial --- NEW FILE: mousecursor.png --- (This appears to be a binary file; contents omitted.) |
From: Ingo R. <gr...@us...> - 2004-03-27 19:48:09
|
Update of /cvsroot/super-tux/supertux/contrib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28539 Modified Files: levelconverter-0.0.6_0.0.7.py Log Message: - added object support (untested) Index: levelconverter-0.0.6_0.0.7.py =================================================================== RCS file: /cvsroot/super-tux/supertux/contrib/levelconverter-0.0.6_0.0.7.py,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- levelconverter-0.0.6_0.0.7.py 27 Mar 2004 19:30:07 -0000 1.7 +++ levelconverter-0.0.6_0.0.7.py 27 Mar 2004 19:36:58 -0000 1.8 @@ -103,11 +103,11 @@ for x in range(0, int(width)): val = content[10 + y][x] if val == '0': - print " (bsod %d %d)" % (x*32, y*32) + print " (bsod (x %d) (y %d))" % (x*32, y*32) elif val == '1': - print " (laptop %d %d)" % (x*32, y*32) + print " (laptop (x %d) (y %d))" % (x*32, y*32) elif val == '2': - print " (money %d %d)" % (x*32, y*32) + print " (money (x %d) (y %d))" % (x*32, y*32) print " )" print ")" |
From: Ingo R. <gr...@us...> - 2004-03-27 19:41:18
|
Update of /cvsroot/super-tux/supertux/contrib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27562 Modified Files: levelconverter-0.0.6_0.0.7.py Log Message: - added object support (untested) Index: levelconverter-0.0.6_0.0.7.py =================================================================== RCS file: /cvsroot/super-tux/supertux/contrib/levelconverter-0.0.6_0.0.7.py,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- levelconverter-0.0.6_0.0.7.py 25 Mar 2004 02:35:07 -0000 1.6 +++ levelconverter-0.0.6_0.0.7.py 27 Mar 2004 19:30:07 -0000 1.7 @@ -97,6 +97,19 @@ sys.stdout.write(" ") print "" print " )" + +print " (objects" +for y in range(0, 15): + for x in range(0, int(width)): + val = content[10 + y][x] + if val == '0': + print " (bsod %d %d)" % (x*32, y*32) + elif val == '1': + print " (laptop %d %d)" % (x*32, y*32) + elif val == '2': + print " (money %d %d)" % (x*32, y*32) +print " )" + print ")" # EOF # |
From: Tobias Gl??er <to...@us...> - 2004-03-27 17:35:26
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv634/src Modified Files: gameloop.cpp high_scores.cpp leveleditor.cpp menu.cpp menu.h setup.cpp title.cpp Log Message: more kinds of menu_event are handled directly in the menu-code now. Index: menu.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/menu.cpp,v retrieving revision 1.18 retrieving revision 1.19 diff -u -d -r1.18 -r1.19 --- menu.cpp 27 Mar 2004 13:04:39 -0000 1.18 +++ menu.cpp 27 Mar 2004 17:24:14 -0000 1.19 @@ -214,6 +214,7 @@ case MN_ACTION: case MN_TEXTFIELD: case MN_NUMFIELD: + case MN_CONTROLFIELD: item[active_item].toggled = true; break; @@ -376,6 +377,7 @@ } case MN_TEXTFIELD: case MN_NUMFIELD: + case MN_CONTROLFIELD: { int input_pos = input_width/2; int text_pos = (text_width + font_width)/2; @@ -517,76 +519,94 @@ } /* Check for menu event */ -void menu_event(SDL_keysym* keysym) +void menu_event(SDL_Event& event) { - SDLKey key = keysym->sym; - SDLMod keymod; - char ch[2]; - keymod = SDL_GetModState(); - - /* If the current unicode character is an ASCII character, - assign it to ch. */ - if ( (keysym->unicode & 0xFF80) == 0 ) - { - ch[0] = keysym->unicode & 0x7F; - ch[1] = '\0'; - } - else + SDLKey key; + switch(event.type) { - /* An International Character. */ - } + case SDL_KEYDOWN: + key = event.key.keysym.sym; + SDLMod keymod; + char ch[2]; + keymod = SDL_GetModState(); - switch(key) - { - case SDLK_UP: /* Menu Up */ - menuaction = MENU_ACTION_UP; - menu_change = true; - break; - case SDLK_DOWN: /* Menu Down */ - menuaction = MENU_ACTION_DOWN; - menu_change = true; - break; - case SDLK_LEFT: /* Menu Up */ - menuaction = MENU_ACTION_LEFT; - menu_change = true; - break; - case SDLK_RIGHT: /* Menu Down */ - menuaction = MENU_ACTION_RIGHT; - menu_change = true; - break; - case SDLK_SPACE: - if(current_menu->item[current_menu->active_item].kind == MN_TEXTFIELD) + /* If the current unicode character is an ASCII character, + assign it to ch. */ + if ( (event.key.keysym.unicode & 0xFF80) == 0 ) { - menuaction = MENU_ACTION_INPUT; - menu_change = true; - mn_input_char = ' '; - break; + ch[0] = event.key.keysym.unicode & 0x7F; + ch[1] = '\0'; } - case SDLK_RETURN: /* Menu Hit */ - menuaction = MENU_ACTION_HIT; - menu_change = true; - break; - case SDLK_DELETE: - case SDLK_BACKSPACE: - menuaction = MENU_ACTION_REMOVE; - menu_change = true; - delete_character++; - break; - default: - if( (key >= SDLK_0 && key <= SDLK_9) || (key >= SDLK_a && key <= SDLK_z) || (key >= SDLK_SPACE && key <= SDLK_SLASH)) + else { - menuaction = MENU_ACTION_INPUT; + /* An International Character. */ + } + + switch(key) + { + case SDLK_UP: /* Menu Up */ + menuaction = MENU_ACTION_UP; menu_change = true; - mn_input_char = *ch; + break; + case SDLK_DOWN: /* Menu Down */ + menuaction = MENU_ACTION_DOWN; + menu_change = true; + break; + case SDLK_LEFT: /* Menu Up */ + menuaction = MENU_ACTION_LEFT; + menu_change = true; + break; + case SDLK_RIGHT: /* Menu Down */ + menuaction = MENU_ACTION_RIGHT; + menu_change = true; + break; + case SDLK_SPACE: + if(current_menu->item[current_menu->active_item].kind == MN_TEXTFIELD) + { + menuaction = MENU_ACTION_INPUT; + menu_change = true; + mn_input_char = ' '; + break; + } + case SDLK_RETURN: /* Menu Hit */ + menuaction = MENU_ACTION_HIT; + menu_change = true; + break; + case SDLK_DELETE: + case SDLK_BACKSPACE: + menuaction = MENU_ACTION_REMOVE; + menu_change = true; + delete_character++; + break; + default: + if( (key >= SDLK_0 && key <= SDLK_9) || (key >= SDLK_a && key <= SDLK_z) || (key >= SDLK_SPACE && key <= SDLK_SLASH)) + { + menuaction = MENU_ACTION_INPUT; + menu_change = true; + mn_input_char = *ch; + } + else + { + mn_input_char = '\0'; + } + break; } - else + break; + case SDL_JOYAXISMOTION: + if(event.jaxis.axis == JOY_Y) { - mn_input_char = '\0'; + if (event.jaxis.value > 1024) + menuaction = MENU_ACTION_DOWN; + else if (event.jaxis.value < -1024) + menuaction = MENU_ACTION_UP; } break; + case SDL_JOYBUTTONDOWN: + menuaction = MENU_ACTION_HIT; + break; + default: + break; } - - /* FIXME: NO JOYSTICK SUPPORT */ /*#ifdef JOY_YES else if (event.type == SDL_JOYBUTTONDOWN) Index: setup.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/setup.cpp,v retrieving revision 1.19 retrieving revision 1.20 diff -u -d -r1.19 -r1.20 --- setup.cpp 27 Mar 2004 11:27:45 -0000 1.19 +++ setup.cpp 27 Mar 2004 17:24:14 -0000 1.20 @@ -38,6 +38,7 @@ #include "menu.h" #include "gameloop.h" #include "configfile.h" +#include "scene.h" #ifdef WIN32 #define mkdir(dir, mode) mkdir(dir) @@ -352,6 +353,7 @@ { main_menu = new Menu(); options_menu = new Menu(); + options_controls_menu = new Menu(); load_game_menu = new Menu(); save_game_menu = new Menu(); game_menu = new Menu(); @@ -381,8 +383,15 @@ options_menu->additem(MN_DEACTIVE,"Music ",use_music,0); } options_menu->additem(MN_TOGGLE,"Show FPS ",show_fps,0); + options_menu->additem(MN_GOTO,"Controls ",0,options_controls_menu); options_menu->additem(MN_HL,"",0,0); options_menu->additem(MN_BACK,"Back",0,0); + + options_controls_menu->additem(MN_LABEL,"Controls",0,0); + options_controls_menu->additem(MN_HL,"",0,0); + options_controls_menu->additem(MN_CONTROLFIELD,"Move Right",tux.keymap.right,0); + options_controls_menu->additem(MN_HL,"",0,0); + options_controls_menu->additem(MN_BACK,"Back",0,0); load_game_menu->additem(MN_LABEL,"Load Game",0,0); load_game_menu->additem(MN_HL,"",0,0); Index: menu.h =================================================================== RCS file: /cvsroot/super-tux/supertux/src/menu.h,v retrieving revision 1.21 retrieving revision 1.22 diff -u -d -r1.21 -r1.22 --- menu.h 27 Mar 2004 13:04:39 -0000 1.21 +++ menu.h 27 Mar 2004 17:24:14 -0000 1.22 @@ -27,9 +27,10 @@ MN_DEACTIVE, MN_TEXTFIELD, MN_NUMFIELD, + MN_CONTROLFIELD, MN_STRINGSELECT, MN_LABEL, - MN_HL /* horizontal line */ + MN_HL, /* horizontal line */ }; class Menu; @@ -116,7 +117,7 @@ void menu_process_current(void); /* Check for a menu event */ -void menu_event(SDL_keysym* keysym); +void menu_event(SDL_Event& event); #endif /*SUPERTUX_MENU_H*/ Index: leveleditor.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/leveleditor.cpp,v retrieving revision 1.21 retrieving revision 1.22 diff -u -d -r1.21 -r1.22 --- leveleditor.cpp 27 Mar 2004 00:38:47 -0000 1.21 +++ leveleditor.cpp 27 Mar 2004 17:24:14 -0000 1.22 @@ -860,7 +860,7 @@ key = event.key.keysym.sym; if(show_menu) { - menu_event(&event.key.keysym); + menu_event(event); if(key == SDLK_ESCAPE) { show_menu = false; Index: title.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/title.cpp,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- title.cpp 26 Mar 2004 22:08:12 -0000 1.13 +++ title.cpp 27 Mar 2004 17:24:14 -0000 1.14 @@ -134,6 +134,7 @@ while (SDL_PollEvent(&event)) { + menu_event(event); if (event.type == SDL_QUIT) { /* Quit event - quit: */ @@ -146,7 +147,7 @@ key = event.key.keysym.sym; /* Check for menu events */ - menu_event(&event.key.keysym); + //menu_event(event); if (key == SDLK_ESCAPE) { @@ -155,18 +156,6 @@ quit = 1; } } - else if (event.type == SDL_JOYAXISMOTION && event.jaxis.axis == JOY_Y) - { - if (event.jaxis.value > 1024) - menuaction = MENU_ACTION_DOWN; - else if (event.jaxis.value < -1024) - menuaction = MENU_ACTION_UP; - } - else if (event.type == SDL_JOYBUTTONDOWN) - { - /* Joystick button: Continue: */ - menuaction = MENU_ACTION_HIT; - } } /* Draw the background: */ Index: high_scores.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/high_scores.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- high_scores.cpp 24 Mar 2004 14:35:11 -0000 1.6 +++ high_scores.cpp 27 Mar 2004 17:24:14 -0000 1.7 @@ -115,7 +115,7 @@ while(SDL_PollEvent(&event)) if(event.type == SDL_KEYDOWN) - menu_event(&event.key.keysym); + menu_event(event); switch (highscore_menu->check()) { Index: gameloop.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/gameloop.cpp,v retrieving revision 1.33 retrieving revision 1.34 diff -u -d -r1.33 -r1.34 --- gameloop.cpp 27 Mar 2004 00:38:47 -0000 1.33 +++ gameloop.cpp 27 Mar 2004 17:24:14 -0000 1.34 @@ -130,6 +130,9 @@ { while (SDL_PollEvent(&event)) { + /* Check for menu-events, if the menu is shown */ + if(show_menu) + menu_event(event); switch(event.type) { case SDL_QUIT: /* Quit event - quit: */ @@ -138,10 +141,6 @@ case SDL_KEYDOWN: /* A keypress! */ key = event.key.keysym.sym; - /* Check for menu-events, if the menu is shown */ - if(show_menu) - menu_event(&event.key.keysym); - if(tux.key_event(key,DOWN)) break; @@ -266,16 +265,8 @@ tux.input.down = UP; else tux.input.down = UP; - - /* Handle joystick for the menu */ - if(show_menu) - { - if(tux.input.down == DOWN) - menuaction = MENU_ACTION_DOWN; - else - menuaction = MENU_ACTION_UP; - } - break; + + break; default: break; } @@ -291,9 +282,7 @@ tux.input.up = UP; else if (event.jbutton.button == JOY_B) tux.input.fire = UP; - - if(show_menu) - menuaction = MENU_ACTION_HIT; + break; default: |
From: Tobias Gl??er <to...@us...> - 2004-03-27 16:28:58
|
Update of /cvsroot/super-tux/supertux In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17068 Modified Files: Makefile.cvs Log Message: old Makefile works again Index: Makefile.cvs =================================================================== RCS file: /cvsroot/super-tux/supertux/Makefile.cvs,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- Makefile.cvs 19 Mar 2004 23:56:17 -0000 1.5 +++ Makefile.cvs 27 Mar 2004 16:17:49 -0000 1.6 @@ -54,8 +54,8 @@ CC = g++ OBJECTS=obj/supertux.o obj/setup.o obj/intro.o obj/title.o obj/scene.o obj/collision.o obj/bitmask.o obj/type.o \ - obj/timer.o obj/text.o obj/texture.o obj/badguy.o obj/special.o obj/world.o obj/player.o obj/level.o obj/gameloop.o \ - obj/screen.o obj/sound.o obj/high_scores.o obj/menu.o obj/leveleditor.o obj/globals.o obj/button.o obj/physic.o obj/lispreader.o obj/worldmap.o + obj/timer.o obj/text.o obj/texture.o obj/badguy.o obj/special.o obj/player.o obj/level.o obj/gameloop.o \ + obj/screen.o obj/sound.o obj/high_scores.o obj/menu.o obj/leveleditor.o obj/globals.o obj/button.o obj/physic.o obj/lispreader.o obj/worldmap.o obj/particlesystem.o obj/tile.o obj/mousecursor.o obj/configfile.o obj/world.o # Make commands: @@ -182,4 +182,16 @@ $(CC) $(CFLAGS) src/physic.cpp -c -o obj/physic.o obj/worldmap.o: src/worldmap.cpp - $(CC) $(CFLAGS) src/worldmap.cpp -c -o obj/worldmap.o \ No newline at end of file + $(CC) $(CFLAGS) src/worldmap.cpp -c -o obj/worldmap.o + +obj/particlesystem.o: src/particlesystem.cpp + $(CC) $(CFLAGS) src/particlesystem.cpp -c -o obj/particlesystem.o + +obj/tile.o: src/tile.cpp + $(CC) $(CFLAGS) src/tile.cpp -c -o obj/tile.o + +obj/mousecursor.o: src/mousecursor.cpp + $(CC) $(CFLAGS) src/mousecursor.cpp -c -o obj/mousecursor.o + +obj/configfile.o: src/configfile.cpp + $(CC) $(CFLAGS) src/configfile.cpp -c -o obj/configfile.o \ No newline at end of file |
From: Tobias Gl??er <to...@us...> - 2004-03-27 13:15:48
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17970/src Modified Files: menu.cpp menu.h Log Message: MN_BACK works for multiple layers of menus now. Index: menu.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/menu.cpp,v retrieving revision 1.17 retrieving revision 1.18 diff -u -d -r1.17 -r1.18 --- menu.cpp 24 Mar 2004 21:43:56 -0000 1.17 +++ menu.cpp 27 Mar 2004 13:04:39 -0000 1.18 @@ -39,12 +39,12 @@ Menu* main_menu = 0; Menu* game_menu = 0; Menu* options_menu = 0; +Menu* options_controls_menu = 0; Menu* highscore_menu = 0; Menu* load_game_menu = 0; Menu* save_game_menu = 0; Menu* current_menu = 0; -Menu* last_menu = 0; /* input implementation variables */ int delete_character; @@ -57,8 +57,12 @@ if(pmenu != current_menu) { menu_change = true; - last_menu = current_menu; + Menu* tmp = current_menu; current_menu = pmenu; + if(tmp) + if(tmp->last_menu != pmenu) + current_menu->last_menu = tmp; + timer_start(&pmenu->effect, 500); } } @@ -139,7 +143,7 @@ } /* Add an item to a menu */ -void +void Menu::additem(menu_item_type* pmenu_item) { ++num_items; @@ -172,7 +176,7 @@ case MENU_ACTION_LEFT: if(item[active_item].kind == MN_STRINGSELECT - && item[active_item].list->num_items != 0) + && item[active_item].list->num_items != 0) { if(item[active_item].list->active_item > 0) --item[active_item].list->active_item; @@ -181,8 +185,8 @@ } break; case MENU_ACTION_RIGHT: - if(item[active_item].kind == MN_STRINGSELECT - && item[active_item].list->num_items != 0) + if(item[active_item].kind == MN_STRINGSELECT + && item[active_item].list->num_items != 0) { if(item[active_item].list->active_item < item[active_item].list->num_items-1) ++item[active_item].list->active_item; @@ -195,18 +199,18 @@ { switch (item[active_item].kind) { - case MN_GOTO: + case MN_GOTO: if (item[active_item].target_menu != NULL) Menu::set_current(item[active_item].target_menu); else puts("NULLL"); break; - + case MN_TOGGLE: item[active_item].toggled = !item[active_item].toggled; menu_change = true; break; - + case MN_ACTION: case MN_TEXTFIELD: case MN_NUMFIELD: @@ -225,7 +229,7 @@ case MENU_ACTION_REMOVE: if(item[active_item].kind == MN_TEXTFIELD - || item[active_item].kind == MN_NUMFIELD) + || item[active_item].kind == MN_NUMFIELD) { if(item[active_item].input != NULL) { @@ -242,7 +246,7 @@ case MENU_ACTION_INPUT: if(item[active_item].kind == MN_TEXTFIELD - || (item[active_item].kind == MN_NUMFIELD && mn_input_char >= '0' && mn_input_char <= '9')) + || (item[active_item].kind == MN_NUMFIELD && mn_input_char >= '0' && mn_input_char <= '9')) { if(item[active_item].input != NULL) { @@ -267,8 +271,8 @@ menu_item_type& new_item = item[active_item]; if(new_item.kind == MN_DEACTIVE - || new_item.kind == MN_LABEL - || new_item.kind == MN_HL) + || new_item.kind == MN_LABEL + || new_item.kind == MN_HL) { // Skip the horzontal line item if(menuaction != MENU_ACTION_UP && menuaction != MENU_ACTION_DOWN) @@ -285,10 +289,10 @@ { if(num_items != 0 && item != NULL) { - if((item[active_item].kind == MN_ACTION + if((item[active_item].kind == MN_ACTION || item[active_item].kind == MN_TEXTFIELD || item[active_item].kind == MN_NUMFIELD) - && item[active_item].toggled) + && item[active_item].toggled) { item[active_item].toggled = false; show_menu = 0; @@ -307,7 +311,7 @@ void Menu::draw_item(int index, // Position of the current item in the menu - int menu_width, + int menu_width, int menu_height) { int font_width = 16; @@ -333,7 +337,7 @@ if (arrange_left) x_pos += 24 - menu_width/2 + (text_width + input_width + list_width)/2; - + if(index == active_item) { shadow_size = 3; @@ -344,7 +348,7 @@ { case MN_DEACTIVE: { - text_draw_align(&black_text, pitem.text, + text_draw_align(&black_text, pitem.text, x_pos, y_pos, A_HMIDDLE, A_VMIDDLE, 2); break; @@ -352,20 +356,20 @@ case MN_HL: { - int x = pos_x - menu_width/2; + int x = pos_x - menu_width/2; int y = y_pos - 12 - effect_offset; /* Draw a horizontal line with a little 3d effect */ fillrect(x, y + 6, menu_width, 4, 210,50,50,225); - fillrect(x, y + 6, + fillrect(x, y + 6, menu_width, 2, 0,0,0,255); break; } case MN_LABEL: { - text_draw_align(&white_big_text, pitem.text, + text_draw_align(&white_big_text, pitem.text, x_pos, y_pos, A_HMIDDLE, A_VMIDDLE, 2); break; @@ -384,10 +388,10 @@ 0,0,0,128); text_draw_align(&gold_text, pitem.input, - x_pos + text_pos, y_pos, + x_pos + text_pos, y_pos, A_HMIDDLE, A_VMIDDLE, 2); - text_draw_align(text_font, pitem.text, + text_draw_align(text_font, pitem.text, x_pos - (input_width + font_width)/2, y_pos, A_HMIDDLE, A_VMIDDLE, shadow_size); break; @@ -410,7 +414,7 @@ list_pos_2, 18, 0,0,0,128); - text_draw_align(&gold_text, string_list_active(pitem.list), + text_draw_align(&gold_text, string_list_active(pitem.list), x_pos + text_pos, y_pos, A_HMIDDLE, A_VMIDDLE,2); @@ -429,13 +433,13 @@ case MN_TOGGLE: { text_draw_align(text_font, pitem.text, x_pos, y_pos, A_HMIDDLE, A_VMIDDLE, shadow_size); - + if(pitem.toggled) - texture_draw(&checkbox_checked, + texture_draw(&checkbox_checked, x_pos + (text_width+font_width)/2, y_pos - 8); else - texture_draw(&checkbox, + texture_draw(&checkbox, x_pos + (text_width+font_width)/2, y_pos - 8); break; @@ -456,7 +460,7 @@ { int menu_height; int menu_width; - + /* The width of the menu has to be more than the width of the text with the most characters */ menu_width = 0; @@ -492,7 +496,6 @@ show_menu = false; menuaction = MENU_ACTION_NONE; current_menu = NULL; - last_menu = NULL; delete_character = 0; mn_input_char = '\0'; Index: menu.h =================================================================== RCS file: /cvsroot/super-tux/supertux/src/menu.h,v retrieving revision 1.20 retrieving revision 1.21 diff -u -d -r1.20 -r1.21 --- menu.h 24 Mar 2004 13:52:34 -0000 1.20 +++ menu.h 27 Mar 2004 13:04:39 -0000 1.21 @@ -56,6 +56,7 @@ int pos_y; int num_items; + Menu* last_menu; public: timer_type effect; @@ -98,11 +99,11 @@ extern Menu* main_menu; extern Menu* game_menu; extern Menu* options_menu; +extern Menu* options_controls_menu; extern Menu* highscore_menu; extern Menu* load_game_menu; extern Menu* save_game_menu; extern Menu* current_menu; -extern Menu* last_menu; /* input implementation variables */ extern int delete_character; |
From: Tobias Gl??er <to...@us...> - 2004-03-27 11:38:52
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2580/src Modified Files: setup.cpp Log Message: little change to improve win32 portability Index: setup.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/setup.cpp,v retrieving revision 1.18 retrieving revision 1.19 diff -u -d -r1.18 -r1.19 --- setup.cpp 24 Mar 2004 22:23:48 -0000 1.18 +++ setup.cpp 27 Mar 2004 11:27:45 -0000 1.19 @@ -43,7 +43,7 @@ #define mkdir(dir, mode) mkdir(dir) // on win32 we typically don't want LFS paths #undef DATA_PREFIX -#define DATA_PREFIX "./data" +#define DATA_PREFIX "./data/" #endif /* Local function prototypes: */ |
From: Ingo R. <gr...@us...> - 2004-03-27 00:49:50
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3934 Modified Files: gameloop.cpp level.cpp level.h leveleditor.cpp Log Message: - removed dn_tilemap - fixed broken level_change() function to draw only on one map, not all at once Index: level.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/level.cpp,v retrieving revision 1.20 retrieving revision 1.21 diff -u -d -r1.20 -r1.21 --- level.cpp 25 Mar 2004 19:10:00 -0000 1.20 +++ level.cpp 27 Mar 2004 00:38:47 -0000 1.21 @@ -224,12 +224,6 @@ for(y = 0; y < plevel->width; ++y) plevel->fg_tiles[i][y] = (unsigned int) '.'; plevel->fg_tiles[i][plevel->width] = (unsigned int) '\0'; - - plevel->dn_tiles[i] = (unsigned int*) malloc((plevel->width+1)*sizeof(unsigned int)); - plevel->dn_tiles[i][plevel->width] = (unsigned int) '\0'; - for(y = 0; y < plevel->width; ++y) - plevel->dn_tiles[i][y] = (unsigned int) '.'; - plevel->dn_tiles[i][plevel->width] = (unsigned int) '\0'; } } @@ -389,7 +383,6 @@ for(int i = 0; i < 15; ++i) { - plevel->dn_tiles[i] = (unsigned int*) calloc((plevel->width +1) , sizeof(unsigned int) ); plevel->ia_tiles[i] = (unsigned int*) calloc((plevel->width +1) , sizeof(unsigned int) ); plevel->bg_tiles[i] = (unsigned int*) calloc((plevel->width +1) , sizeof(unsigned int) ); plevel->fg_tiles[i] = (unsigned int*) calloc((plevel->width +1) , sizeof(unsigned int) ); @@ -502,15 +495,6 @@ } fprintf( fi,")\n"); - fprintf(fi," (dynamic-tm "); - - for(y = 0; y < 15; ++y) - { - for(i = 0; i < plevel->width; ++i) - fprintf(fi," %d ", plevel->dn_tiles[y][i]); - } - - fprintf( fi,")\n"); fprintf(fi," (foreground-tm "); for(y = 0; y < 15; ++y) @@ -536,8 +520,6 @@ for(i=0; i < 15; ++i) free(plevel->ia_tiles[i]); for(i=0; i < 15; ++i) - free(plevel->dn_tiles[i]); - for(i=0; i < 15; ++i) free(plevel->fg_tiles[i]); plevel->name.clear(); @@ -637,7 +619,6 @@ if(new_width < 21) new_width = 21; tilemap_change_size((unsigned int***)&plevel->ia_tiles,new_width,plevel->width); - tilemap_change_size((unsigned int***)&plevel->dn_tiles,new_width,plevel->width); tilemap_change_size((unsigned int***)&plevel->bg_tiles,new_width,plevel->width); tilemap_change_size((unsigned int***)&plevel->fg_tiles,new_width,plevel->width); plevel->width = new_width; @@ -657,14 +638,15 @@ { switch(tm) { - case 0: + case TM_BG: plevel->bg_tiles[yy][xx] = c; - case 1: + break; + case TM_IA: plevel->ia_tiles[yy][xx] = c; - case 2: - plevel->dn_tiles[yy][xx] = c; - case 4: + break; + case TM_FG: plevel->fg_tiles[yy][xx] = c; + break; } } } Index: level.h =================================================================== RCS file: /cvsroot/super-tux/supertux/src/level.h,v retrieving revision 1.15 retrieving revision 1.16 diff -u -d -r1.15 -r1.16 --- level.h 25 Mar 2004 11:36:05 -0000 1.15 +++ level.h 27 Mar 2004 00:38:47 -0000 1.16 @@ -42,10 +42,9 @@ #define LEVEL_NAME_MAX 20 -enum { +enum TileMapType { TM_BG, TM_IA, - TM_DN, TM_FG }; @@ -64,7 +63,6 @@ std::string particle_system; unsigned int* bg_tiles[15]; /* Tiles in the background */ unsigned int* ia_tiles[15]; /* Tiles which can interact in the game (solids for example)*/ - unsigned int* dn_tiles[15]; /* Dynamic tiles (bad guys and moving platforms for example)*/ unsigned int* fg_tiles[15]; /* Tiles in the foreground */ int time_left; int bkgd_red; Index: gameloop.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/gameloop.cpp,v retrieving revision 1.32 retrieving revision 1.33 diff -u -d -r1.32 -r1.33 --- gameloop.cpp 26 Mar 2004 23:53:31 -0000 1.32 +++ gameloop.cpp 27 Mar 2004 00:38:47 -0000 1.33 @@ -477,7 +477,7 @@ void game_draw(void) { -int y,x; + int y,x; /* Draw screen: */ if (tux.dying && (global_frame_counter % 4) == 0) @@ -518,7 +518,6 @@ } /* Draw interactive tiles: */ - for (y = 0; y < 15; ++y) { for (x = 0; x < 21; ++x) @@ -529,7 +528,6 @@ } /* (Bouncy bricks): */ - for (unsigned int i = 0; i < bouncy_bricks.size(); ++i) bouncy_brick_draw(&bouncy_bricks[i]); @@ -548,13 +546,12 @@ upgrade_draw(&upgrades[i]); for (unsigned int i = 0; i < bouncy_distros.size(); ++i) - bouncy_distro_draw(&bouncy_distros[i]); + bouncy_distro_draw(&bouncy_distros[i]); for (unsigned int i = 0; i < broken_bricks.size(); ++i) broken_brick_draw(&broken_bricks[i]); /* Draw foreground: */ - for (y = 0; y < 15; ++y) { for (x = 0; x < 21; ++x) Index: leveleditor.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/leveleditor.cpp,v retrieving revision 1.20 retrieving revision 1.21 diff -u -d -r1.20 -r1.21 --- leveleditor.cpp 26 Mar 2004 23:53:31 -0000 1.20 +++ leveleditor.cpp 27 Mar 2004 00:38:47 -0000 1.21 @@ -118,24 +118,6 @@ static int le_selection_mode; static SDL_Event event; -void le_activate_bad_guys(void) -{ - int x,y; - - /* Activate bad guys: */ - - /* as oposed to the gameloop.c func, this one doesn't remove - the badguys from tiles */ - - for (y = 0; y < 15; ++y) - for (x = 0; x < le_current_level->width; ++x) - if (le_current_level->dn_tiles[y][x] >= '0' && le_current_level->dn_tiles[y][x] <= '9') - add_bad_guy(x * 32, y * 32, static_cast<BadGuyKind>(le_current_level->dn_tiles[y][x] - '0')); - - - -} - void le_set_defaults() { if(le_current_level != NULL) @@ -241,7 +223,6 @@ le_update_buttons(le_current_level->theme.c_str()); le_set_defaults(); level_load_gfx(le_current_level); - le_activate_bad_guys(); show_menu = true; } break; @@ -273,7 +254,6 @@ le_update_buttons(le_current_level->theme.c_str()); le_set_defaults(); level_load_gfx(le_current_level); - le_activate_bad_guys(); menu_item_change_input(&subset_new_menu->item[2],""); show_menu = true; break; @@ -659,8 +639,6 @@ level_free_gfx(); level_load_gfx(le_current_level); - - le_activate_bad_guys(); } void le_quit(void) @@ -1383,7 +1361,6 @@ arrays_init(); level_load_gfx(le_current_level); loadshared(); - le_activate_bad_guys(); } void le_showhelp() |
From: Tobias Gl??er <to...@us...> - 2004-03-27 00:25:48
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32627/src Modified Files: badguy.cpp badguy.h Log Message: fixed BSOD hopping Index: badguy.h =================================================================== RCS file: /cvsroot/super-tux/supertux/src/badguy.h,v retrieving revision 1.16 retrieving revision 1.17 diff -u -d -r1.16 -r1.17 --- badguy.h 26 Mar 2004 23:53:31 -0000 1.16 +++ badguy.h 27 Mar 2004 00:14:46 -0000 1.17 @@ -106,7 +106,7 @@ CollisionType type = COLLISION_NORMAL); private: - void fall(); + void fall(bool dojump=false); void remove_me(); void action_bsod(); Index: badguy.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/badguy.cpp,v retrieving revision 1.14 retrieving revision 1.15 diff -u -d -r1.14 -r1.15 --- badguy.cpp 26 Mar 2004 23:53:31 -0000 1.14 +++ badguy.cpp 27 Mar 2004 00:14:46 -0000 1.15 @@ -124,7 +124,7 @@ if (!dying) check_horizontal_bump(); - fall(); + fall(true); // Handle dying timer: if (dying == DYING_SQUISHED) @@ -260,7 +260,7 @@ } } -void BadGuy::fall() +void BadGuy::fall(bool dojump) { /* Fall if we get off the ground: */ if (dying != DYING_FALLING) @@ -270,7 +270,7 @@ if(!physic_is_set(&physic)) { physic_set_state(&physic,PH_VT); - physic_set_start_vy(&physic,0.); + physic_set_start_vy(&physic, dojump ? 2. : 0.); } if(mode != HELD) |