super-tux-commit Mailing List for Super Tux (Page 73)
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: Ricardo C. <rm...@us...> - 2004-05-09 21:44:18
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15185/src Modified Files: setup.cpp Log Message: Removed the screen free. It was already been freed before, this could be the cause of Win32 crashes related by Ryan... Index: setup.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/setup.cpp,v retrieving revision 1.76 retrieving revision 1.77 diff -u -d -r1.76 -r1.77 --- setup.cpp 9 May 2004 19:56:11 -0000 1.76 +++ setup.cpp 9 May 2004 21:44:07 -0000 1.77 @@ -668,8 +668,6 @@ void st_video_setup_sdl(void) { - SDL_FreeSurface(screen); - if (use_fullscreen) { screen = SDL_SetVideoMode(SCREEN_W, SCREEN_H, 0, SDL_FULLSCREEN ) ; /* | SDL_HWSURFACE); */ |
From: Ricardo C. <rm...@us...> - 2004-05-09 21:16:08
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9709/src Modified Files: defines.h world.cpp world.h Log Message: Instead of limitating the number of bullets, according to the ones in screen, do it in a time bases. This was asked in a comment on The Linux Game Tome and I already wanted to do this, since the day I made that hack, so here it goes. You can tune that time on the defines.h file, it is the BULLETS_TIMEOUT definition (in ms). There is a fire test level. Index: world.h =================================================================== RCS file: /cvsroot/super-tux/supertux/src/world.h,v retrieving revision 1.37 retrieving revision 1.38 diff -u -d -r1.37 -r1.38 --- world.h 7 May 2004 20:48:22 -0000 1.37 +++ world.h 9 May 2004 21:15:58 -0000 1.38 @@ -58,6 +58,7 @@ std::vector<FloatingScore*> floating_scores; std::vector<Upgrade> upgrades; + Timer bullets_timer; std::vector<Bullet> bullets; typedef std::vector<ParticleSystem*> ParticleSystems; ParticleSystems particle_systems; Index: defines.h =================================================================== RCS file: /cvsroot/super-tux/supertux/src/defines.h,v retrieving revision 1.32 retrieving revision 1.33 diff -u -d -r1.32 -r1.33 --- defines.h 6 May 2004 21:39:47 -0000 1.32 +++ defines.h 9 May 2004 21:15:58 -0000 1.33 @@ -69,7 +69,7 @@ #define START_LIVES 4 -#define MAX_BULLETS 2 +#define BULLETS_TIMEOUT 500 #define YM_FOR_JUMP 6.0 #define WALK_ACCELERATION_X 0.03 Index: world.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/world.cpp,v retrieving revision 1.69 retrieving revision 1.70 diff -u -d -r1.69 -r1.70 --- world.cpp 8 May 2004 10:41:42 -0000 1.69 +++ world.cpp 9 May 2004 21:15:58 -0000 1.70 @@ -56,6 +56,7 @@ apply_bonuses(); scrolling_timer.init(true); + bullets_timer.init(true); } World::World(const std::string& subset, int level_nr) @@ -77,6 +78,7 @@ apply_bonuses(); scrolling_timer.init(true); + bullets_timer.init(true); } void @@ -541,9 +543,11 @@ void World::add_bullet(float x, float y, float xm, Direction dir) { - if(bullets.size() > MAX_BULLETS-1) + if(bullets_timer.check()) return; + bullets_timer.start(BULLETS_TIMEOUT); + Bullet new_bullet; new_bullet.init(x,y,xm,dir); bullets.push_back(new_bullet); |
From: Tobias Gl??er <to...@us...> - 2004-05-09 20:10:33
|
Update of /cvsroot/super-tux/supertux/data/images/icons In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26287/data/images/icons Modified Files: select-mode2.png Log Message: changed to look a bit better in the editor Index: select-mode2.png =================================================================== RCS file: /cvsroot/super-tux/supertux/data/images/icons/select-mode2.png,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 Binary files /tmp/cvsG9KZG1 and /tmp/cvs8KTIGv differ |
From: Tobias Gl??er <to...@us...> - 2004-05-09 19:56:30
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22549/src Modified Files: setup.cpp Log Message: big white font correction Index: setup.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/setup.cpp,v retrieving revision 1.75 retrieving revision 1.76 diff -u -d -r1.75 -r1.76 --- setup.cpp 7 May 2004 13:46:50 -0000 1.75 +++ setup.cpp 9 May 2004 19:56:11 -0000 1.76 @@ -589,7 +589,7 @@ green_text = new Text(datadir + "/images/status/letters-green.png", TEXT_TEXT, 16,18); white_text = new Text(datadir + "/images/status/letters-white.png", TEXT_TEXT, 16,18); white_small_text = new Text(datadir + "/images/status/letters-white-small.png", TEXT_TEXT, 8,9); - white_big_text = new Text(datadir + "/images/status/letters-white-big.png", TEXT_TEXT, 20,23); + white_big_text = new Text(datadir + "/images/status/letters-white-big.png", TEXT_TEXT, 20,22); yellow_nums = new Text(datadir + "/images/status/numbers.png", TEXT_NUM, 32,32); /* Load GUI/menu images: */ |
From: Tobias Gl??er <to...@us...> - 2004-05-09 19:55:43
|
Update of /cvsroot/super-tux/supertux/data/images/status In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22408/data/images/status Modified Files: letters-white-big.png letters-white-small.png Log Message: update Index: letters-white-small.png =================================================================== RCS file: /cvsroot/super-tux/supertux/data/images/status/letters-white-small.png,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 Binary files /tmp/cvsGaioeo and /tmp/cvslLBLrV differ Index: letters-white-big.png =================================================================== RCS file: /cvsroot/super-tux/supertux/data/images/status/letters-white-big.png,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 Binary files /tmp/cvszeQl9x and /tmp/cvsMDott5 differ |
From: Ryan F. <sik...@us...> - 2004-05-09 19:34:55
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18323 Modified Files: player.h Log Message: - increased Tux's safe time to 1250ms Index: player.h =================================================================== RCS file: /cvsroot/super-tux/supertux/src/player.h,v retrieving revision 1.52 retrieving revision 1.53 diff -u -d -r1.52 -r1.53 --- player.h 8 May 2004 10:41:42 -0000 1.52 +++ player.h 9 May 2004 19:34:43 -0000 1.53 @@ -31,7 +31,7 @@ /* Times: */ -#define TUX_SAFE_TIME 750 +#define TUX_SAFE_TIME 1250 #define TUX_INVINCIBLE_TIME 10000 #define TUX_INVINCIBLE_TIME_WARNING 2000 #define TIME_WARNING 20000 /* When to alert player they're low on time! */ |
From: Tobias Gl??er <to...@us...> - 2004-05-09 18:08:12
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1289/src Modified Files: leveleditor.cpp menu.cpp menu.h texture.cpp texture.h Log Message: Added a static member function to the Surface class for screen capturing. Redesigned the confirm dialog using it. Minor leveleditor improvements. (Asks if you want to save a changed level etc.) Index: menu.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/menu.cpp,v retrieving revision 1.66 retrieving revision 1.67 diff -u -d -r1.66 -r1.67 --- menu.cpp 7 May 2004 00:22:28 -0000 1.66 +++ menu.cpp 9 May 2004 18:08:01 -0000 1.67 @@ -1,5 +1,5 @@ // $Id$ -// +// // SuperTux // Copyright (C) 2004 Tobias Glaesser <tob...@gm...> // @@ -12,7 +12,7 @@ // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. -// [...1008 lines suppressed...] + y = event.motion.y; + if(x > pos_x - get_width()/2 && + x < pos_x + get_width()/2 && + y > pos_y - get_height()/2 && + y < pos_y + get_height()/2) + { + active_item = (y - (pos_y - get_height()/2)) / 24; + mouse_cursor->set_state(MC_LINK); + } + else + { + mouse_cursor->set_state(MC_NORMAL); + } + break; + default: + break; + } } Index: leveleditor.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/leveleditor.cpp,v retrieving revision 1.100 retrieving revision 1.101 diff -u -d -r1.100 -r1.101 --- leveleditor.cpp 9 May 2004 13:55:54 -0000 1.100 +++ leveleditor.cpp 9 May 2004 18:08:01 -0000 1.101 @@ -66,7 +66,7 @@ /* crutial ones (main loop) */ int le_init(); void le_quit(); -int le_load_level(char *filename); +int le_load_level_subset(char *filename); void le_drawlevel(); void le_drawinterface(); void le_checkevents(); @@ -75,7 +75,7 @@ void le_showhelp(); void le_set_defaults(void); void le_activate_bad_guys(void); - +void le_goto_level(int levelnb); void le_highlight_selection(); void apply_level_settings_menu(); @@ -169,7 +169,7 @@ {} if(filename != NULL) - if(le_load_level(filename)) + if(le_load_level_subset(filename)) return 1; while(true) @@ -294,7 +294,7 @@ default: if(i >= 1) { - if(le_load_level(level_subsets.item[i-1])) + if(le_load_level_subset(level_subsets.item[i-1])) return 1; } break; @@ -314,8 +314,7 @@ LevelSubset::create(subset_new_menu->get_item_by_id(MNID_SUBSETNAME).input); le_level_subset->load(subset_new_menu->get_item_by_id(MNID_SUBSETNAME).input); leveleditor_menu->get_item_by_id(MNID_SUBSETSETTINGS).kind = MN_GOTO; - delete le_world; - le_world = new World(le_level_subset->name,1); + le_goto_level(1); subset_new_menu->get_item_by_id(MNID_SUBSETNAME).change_input(""); Menu::set_current(subset_settings_menu); @@ -361,13 +360,12 @@ return done; } -int le_load_level(char *filename) +int le_load_level_subset(char *filename) { le_level_subset->load(filename); leveleditor_menu->get_item_by_id(MNID_SUBSETSETTINGS).kind = MN_GOTO; le_level = 1; - delete le_world; - le_world = new World(filename,le_level); + le_goto_level(1); //GameSession* session = new GameSession(datadir + "/levels/" + le_level_subset->name + "/level1.stl", 0, ST_GL_DEMO_GAME); @@ -666,20 +664,35 @@ le_level_subset->save(); } -void le_goto_level(int levelnb) +void le_unload_level() { + if(le_level_changed) + { + le_drawlevel(); + le_drawinterface(); + char str[1024]; + sprintf(str,"Save changes to level %d of %s?",le_level,le_level_subset->name.c_str()); + if(confirm_dialog(str)) + { + le_world->get_level()->save(le_level_subset->name.c_str(),le_level); + } + } + delete le_world; + le_level_changed = false; +} + +void le_goto_level(int levelnb) +{ + le_unload_level(); le_world = new World(le_level_subset->name, levelnb); } void le_quit(void) { - /*if(level_changed == true) - if(askforsaving() == CANCEL) - return;*/ //FIXME - SDL_EnableKeyRepeat(0, 0); // disables key repeating + le_unload_level(); delete le_selection; delete leveleditor_menu; delete subset_load_menu; @@ -777,19 +790,19 @@ { if(le_current.IsTile()) le_selection->draw( cursor_x - pos_x, cursor_y); - } - else if(le_selection_mode == SQUARE) - { - int w, h; - le_highlight_selection(); - /* draw current selection */ - w = selection.x2 - selection.x1; - h = selection.y2 - selection.y1; - fillrect(selection.x1 - pos_x, selection.y1, w, SELECT_W, SELECT_CLR); - fillrect(selection.x1 - pos_x + w, selection.y1, SELECT_W, h, SELECT_CLR); - fillrect(selection.x1 - pos_x, selection.y1 + h, w, SELECT_W, SELECT_CLR); - fillrect(selection.x1 - pos_x, selection.y1, SELECT_W, h, SELECT_CLR); - } + } + else if(le_selection_mode == SQUARE) + { + int w, h; + le_highlight_selection(); + /* draw current selection */ + w = selection.x2 - selection.x1; + h = selection.y2 - selection.y1; + fillrect(selection.x1 - pos_x, selection.y1, w, SELECT_W, SELECT_CLR); + fillrect(selection.x1 - pos_x + w, selection.y1, SELECT_W, h, SELECT_CLR); + fillrect(selection.x1 - pos_x, selection.y1 + h, w, SELECT_W, SELECT_CLR); + fillrect(selection.x1 - pos_x, selection.y1, SELECT_W, h, SELECT_CLR); + } /* draw button bar */ @@ -961,7 +974,7 @@ { Menu::current()->event(event); if(!le_world && !Menu::current()) - Menu::set_current(leveleditor_menu); + Menu::set_current(leveleditor_menu); } else { @@ -982,7 +995,7 @@ { case SDLK_ESCAPE: Menu::set_current(leveleditor_menu); - break; + break; case SDLK_LEFT: if(fire == DOWN) cursor_x -= KEY_CURSOR_SPEED; @@ -1341,6 +1354,7 @@ { if(le_current.IsObject()) { + le_level_changed = true; std::string type = le_current.obj->type(); if(type == "BadGuy") { @@ -1440,8 +1454,8 @@ int x1, x2, y1, y2; unsigned int i = 0; - /* level_changed = true; */ - + le_level_changed = true; + switch(le_selection_mode) { case CURSOR: Index: menu.h =================================================================== RCS file: /cvsroot/super-tux/supertux/src/menu.h,v retrieving revision 1.59 retrieving revision 1.60 diff -u -d -r1.59 -r1.60 --- menu.h 6 May 2004 15:09:47 -0000 1.59 +++ menu.h 9 May 2004 18:08:02 -0000 1.60 @@ -92,7 +92,7 @@ MNID_APPLY }; -bool confirm_dialog(char *text); +bool confirm_dialog(std::string text); /* Kinds of menu items */ enum MenuItemKind { Index: texture.h =================================================================== RCS file: /cvsroot/super-tux/supertux/src/texture.h,v retrieving revision 1.22 retrieving revision 1.23 diff -u -d -r1.22 -r1.23 --- texture.h 5 May 2004 22:04:48 -0000 1.22 +++ texture.h 9 May 2004 18:08:02 -0000 1.23 @@ -30,6 +30,8 @@ #include <list> #include "screen.h" +SDL_Surface* sdl_surface_from_sdl_surface(SDL_Surface* sdl_surf, int use_alpha); + class SurfaceImpl; class SurfaceSDL; class SurfaceOpenGL; @@ -79,6 +81,9 @@ Surface(const std::string& file, int x, int y, int w, int h, int use_alpha); ~Surface(); + /** Captures the screen and returns it as Surface*, the user is expected to call the destructor. */ + static Surface* CaptureScreen(); + /** Reload the surface, which is necesarry in case of a mode swich */ void reload(); Index: texture.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/texture.cpp,v retrieving revision 1.24 retrieving revision 1.25 diff -u -d -r1.24 -r1.25 --- texture.cpp 9 May 2004 13:49:14 -0000 1.24 +++ texture.cpp 9 May 2004 18:08:02 -0000 1.25 @@ -251,13 +251,60 @@ { if (impl) { - w = w_; - h = h_; + w = w_; + h = h_; if (impl->resize(w_,h_) == -2) reload(); } } +Surface* Surface::CaptureScreen() +{ + Surface *cap_screen; + + if (!(screen->flags & SDL_OPENGL)) + { + cap_screen = new Surface(SDL_GetVideoSurface(),false); + } + +#ifndef NOOPENGL + if (use_gl) + { + SDL_Surface *temp; + unsigned char *pixels; + int i; + temp = SDL_CreateRGBSurface(SDL_SWSURFACE, screen->w, screen->h, 24, +#if SDL_BYTEORDER == SDL_LIL_ENDIAN + 0x000000FF, 0x0000FF00, 0x00FF0000, 0 +#else + 0x00FF0000, 0x0000FF00, 0x000000FF, 0 +#endif + ); + if (temp == NULL) + st_abort("Error while trying to capture the screen in OpenGL mode",""); + + pixels = (unsigned char*) malloc(3 * screen->w * screen->h); + if (pixels == NULL) + { + SDL_FreeSurface(temp); + st_abort("Error while trying to capture the screen in OpenGL mode",""); + } + + glReadPixels(0, 0, screen->w, screen->h, GL_RGB, GL_UNSIGNED_BYTE, pixels); + + for (i=0; i<screen->h; i++) + memcpy(((char *) temp->pixels) + temp->pitch * i, pixels + 3*screen->w * (screen->h-i-1), screen->w*3); + free(pixels); + + cap_screen = new Surface(temp,false); + SDL_FreeSurface(temp); + + } +#endif + +return cap_screen; +} + SDL_Surface* sdl_surface_part_from_file(const std::string& file, int x, int y, int w, int h, int use_alpha) { @@ -400,7 +447,7 @@ dest.w = w; dest.h = h; int ret = SDL_SoftStretch(sdl_surface, NULL, - sdl_surface, &dest); + sdl_surface, &dest); return ret; } @@ -789,7 +836,7 @@ SurfaceSDL::draw_stretched(float x, float y, int sw, int sh, Uint8 alpha, bool update) { SDL_Rect dest; - + dest.x = (int)x; dest.y = (int)y; dest.w = (int)sw; @@ -797,15 +844,15 @@ if(alpha != 255) SDL_SetAlpha(sdl_surface ,SDL_SRCALPHA,alpha); - - - SDL_Surface* sdl_surface_copy = SDL_CreateRGBSurface (sdl_surface->flags, - sw, sh, sdl_surface->format->BitsPerPixel, - sdl_surface->format->Rmask, sdl_surface->format->Gmask, - sdl_surface->format->Bmask, - 0); - SDL_BlitSurface(sdl_surface, NULL, sdl_surface_copy, NULL); + + SDL_Surface* sdl_surface_copy = SDL_CreateRGBSurface (sdl_surface->flags, + sw, sh, sdl_surface->format->BitsPerPixel, + sdl_surface->format->Rmask, sdl_surface->format->Gmask, + sdl_surface->format->Bmask, + 0); + + SDL_BlitSurface(sdl_surface, NULL, sdl_surface_copy, NULL); SDL_SoftStretch(sdl_surface_copy, NULL, sdl_surface_copy, &dest); int ret = SDL_BlitSurface(sdl_surface_copy,NULL,screen,&dest); |
From: Ricardo C. <rm...@us...> - 2004-05-09 13:56:05
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17391/src Modified Files: leveleditor.cpp leveleditor.h Log Message: Don't show selection cursor when help is being displayed. Index: leveleditor.h =================================================================== RCS file: /cvsroot/super-tux/supertux/src/leveleditor.h,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- leveleditor.h 5 May 2004 16:07:19 -0000 1.8 +++ leveleditor.h 9 May 2004 13:55:54 -0000 1.9 @@ -31,7 +31,8 @@ /* selection modes */ enum { CURSOR, - SQUARE + SQUARE, + NONE }; int leveleditor(char* filename = NULL); Index: leveleditor.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/leveleditor.cpp,v retrieving revision 1.99 retrieving revision 1.100 diff -u -d -r1.99 -r1.100 --- leveleditor.cpp 9 May 2004 11:14:12 -0000 1.99 +++ leveleditor.cpp 9 May 2004 13:55:54 -0000 1.100 @@ -1544,6 +1544,8 @@ void le_showhelp() { bool tmp_show_grid = le_show_grid; + int temp_le_selection_mode = le_selection_mode; + le_selection_mode = NONE; le_show_grid = false; le_help_shown = true; @@ -1648,4 +1650,5 @@ le_show_grid = tmp_show_grid; le_help_shown = false; + le_selection_mode = temp_le_selection_mode; } |
From: Ricardo C. <rm...@us...> - 2004-05-09 13:49:23
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16364/src Modified Files: texture.cpp Log Message: Cleanuped code and applied it to draw_bg() and draw_part() as well. Index: texture.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/texture.cpp,v retrieving revision 1.23 retrieving revision 1.24 diff -u -d -r1.23 -r1.24 --- texture.cpp 9 May 2004 11:14:18 -0000 1.23 +++ texture.cpp 9 May 2004 13:49:14 -0000 1.24 @@ -650,47 +650,33 @@ dest.h = h; if(alpha != 255) - { - /* Copy the SDL surface, then make it using alpha and use it to blit into the screen */ -/* - SDL_Surface* sdl_surface_copy = SDL_CreateRGBSurface (sdl_surface->flags, - sdl_surface->w, sdl_surface->h, sdl_surface->format->BitsPerPixel, - sdl_surface->format->Rmask, sdl_surface->format->Gmask, - sdl_surface->format->Bmask, - sdl_surface->format->Amask); - - SDL_BlitSurface(sdl_surface, NULL, sdl_surface_copy, NULL); - - SDL_SetAlpha(sdl_surface_copy ,SDL_SRCALPHA,alpha); - - int ret = SDL_BlitSurface(sdl_surface_copy, NULL, screen, &dest); */ - -/* *TEST* Create a Surface, make it using colorkey, blit surface into temp, apply alpha -to temp sur, blit the temp into the screen */ + { + /* Create a Surface, make it using colorkey, blit surface into temp, apply alpha + to temp sur, blit the temp into the screen */ + /* Note: this has to be done, since SDL doesn't allow to set alpha to surfaces that + already have an alpha mask yet... */ SDL_Surface* sdl_surface_copy = SDL_CreateRGBSurface (sdl_surface->flags, sdl_surface->w, sdl_surface->h, sdl_surface->format->BitsPerPixel, sdl_surface->format->Rmask, sdl_surface->format->Gmask, sdl_surface->format->Bmask, 0); -int colorkey = SDL_MapRGB(sdl_surface_copy->format, 255, 0, 255); -SDL_FillRect(sdl_surface_copy, NULL, colorkey); -SDL_SetColorKey(sdl_surface_copy, SDL_SRCCOLORKEY, colorkey); - - -SDL_BlitSurface(sdl_surface, NULL, sdl_surface_copy, NULL); -SDL_SetAlpha(sdl_surface_copy ,SDL_SRCALPHA,alpha); + int colorkey = SDL_MapRGB(sdl_surface_copy->format, 255, 0, 255); + SDL_FillRect(sdl_surface_copy, NULL, colorkey); + SDL_SetColorKey(sdl_surface_copy, SDL_SRCCOLORKEY, colorkey); -int ret = SDL_BlitSurface(sdl_surface_copy, NULL, screen, &dest); + SDL_BlitSurface(sdl_surface, NULL, sdl_surface_copy, NULL); + SDL_SetAlpha(sdl_surface_copy ,SDL_SRCALPHA,alpha); + int ret = SDL_BlitSurface(sdl_surface_copy, NULL, screen, &dest); if (update == UPDATE) SDL_UpdateRect(screen, dest.x, dest.y, dest.w, dest.h); - SDL_FreeSurface (sdl_surface_copy) ; + SDL_FreeSurface (sdl_surface_copy); return ret; - } + } int ret = SDL_BlitSurface(sdl_surface, NULL, screen, &dest); @@ -711,7 +697,33 @@ dest.h = screen->h; if(alpha != 255) - SDL_SetAlpha(sdl_surface ,SDL_SRCALPHA,alpha); + { + /* Create a Surface, make it using colorkey, blit surface into temp, apply alpha + to temp sur, blit the temp into the screen */ + /* Note: this has to be done, since SDL doesn't allow to set alpha to surfaces that + already have an alpha mask yet... */ + + SDL_Surface* sdl_surface_copy = SDL_CreateRGBSurface (sdl_surface->flags, + sdl_surface->w, sdl_surface->h, sdl_surface->format->BitsPerPixel, + sdl_surface->format->Rmask, sdl_surface->format->Gmask, + sdl_surface->format->Bmask, + 0); + int colorkey = SDL_MapRGB(sdl_surface_copy->format, 255, 0, 255); + SDL_FillRect(sdl_surface_copy, NULL, colorkey); + SDL_SetColorKey(sdl_surface_copy, SDL_SRCCOLORKEY, colorkey); + + + SDL_BlitSurface(sdl_surface, NULL, sdl_surface_copy, NULL); + SDL_SetAlpha(sdl_surface_copy ,SDL_SRCALPHA,alpha); + + int ret = SDL_BlitSurface(sdl_surface_copy, NULL, screen, &dest); + + if (update == UPDATE) + SDL_UpdateRect(screen, dest.x, dest.y, dest.w, dest.h); + + SDL_FreeSurface (sdl_surface_copy); + return ret; + } int ret = SDL_SoftStretch(sdl_surface, NULL, screen, &dest); @@ -737,7 +749,33 @@ dest.h = (int)h; if(alpha != 255) - SDL_SetAlpha(sdl_surface ,SDL_SRCALPHA,alpha); + { + /* Create a Surface, make it using colorkey, blit surface into temp, apply alpha + to temp sur, blit the temp into the screen */ + /* Note: this has to be done, since SDL doesn't allow to set alpha to surfaces that + already have an alpha mask yet... */ + + SDL_Surface* sdl_surface_copy = SDL_CreateRGBSurface (sdl_surface->flags, + sdl_surface->w, sdl_surface->h, sdl_surface->format->BitsPerPixel, + sdl_surface->format->Rmask, sdl_surface->format->Gmask, + sdl_surface->format->Bmask, + 0); + int colorkey = SDL_MapRGB(sdl_surface_copy->format, 255, 0, 255); + SDL_FillRect(sdl_surface_copy, NULL, colorkey); + SDL_SetColorKey(sdl_surface_copy, SDL_SRCCOLORKEY, colorkey); + + + SDL_BlitSurface(sdl_surface, NULL, sdl_surface_copy, NULL); + SDL_SetAlpha(sdl_surface_copy ,SDL_SRCALPHA,alpha); + + int ret = SDL_BlitSurface(sdl_surface_copy, NULL, screen, &dest); + + if (update == UPDATE) + SDL_UpdateRect(screen, dest.x, dest.y, dest.w, dest.h); + + SDL_FreeSurface (sdl_surface_copy); + return ret; + } int ret = SDL_BlitSurface(sdl_surface, &src, screen, &dest); |
From: Tobias Gl??er <to...@us...> - 2004-05-09 11:14:29
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14009/src Modified Files: button.h leveleditor.cpp texture.cpp Log Message: Minimap works in SDL now and one more crash is fixed. Changed the Help a bit, but it's still in the works. Index: leveleditor.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/leveleditor.cpp,v retrieving revision 1.98 retrieving revision 1.99 diff -u -d -r1.98 -r1.99 --- leveleditor.cpp 8 May 2004 12:39:28 -0000 1.98 +++ leveleditor.cpp 9 May 2004 11:14:12 -0000 1.99 @@ -103,6 +103,7 @@ static string_list_type level_subsets; static bool le_level_changed; /* if changes, ask for saving, when quiting*/ static bool show_minimap; +static bool le_help_shown; static int pos_x, cursor_x, cursor_y, fire; static int le_level; static World* le_world; @@ -226,10 +227,10 @@ switch (leveleditor_menu->check()) { case MNID_RETURNLEVELEDITOR: - if(le_world != NULL) - Menu::set_current(0); - else - Menu::set_current(leveleditor_menu); + if(le_world != NULL) + Menu::set_current(0); + else + Menu::set_current(leveleditor_menu); break; case MNID_SUBSETSETTINGS: update_subset_settings_menu(); @@ -313,7 +314,7 @@ LevelSubset::create(subset_new_menu->get_item_by_id(MNID_SUBSETNAME).input); le_level_subset->load(subset_new_menu->get_item_by_id(MNID_SUBSETNAME).input); leveleditor_menu->get_item_by_id(MNID_SUBSETSETTINGS).kind = MN_GOTO; - delete le_world; + delete le_world; le_world = new World(le_level_subset->name,1); subset_new_menu->get_item_by_id(MNID_SUBSETNAME).change_input(""); @@ -367,7 +368,7 @@ le_level = 1; delete le_world; le_world = new World(filename,le_level); - + //GameSession* session = new GameSession(datadir + "/levels/" + le_level_subset->name + "/level1.stl", 0, ST_GL_DEMO_GAME); Menu::set_current(NULL); @@ -378,7 +379,7 @@ void le_init_menus() { int i; - + leveleditor_menu = new Menu(); subset_load_menu = new Menu(); subset_new_menu = new Menu(); @@ -452,42 +453,42 @@ std::set<TileGroup>* tilegroups = TileManager::tilegroups(); int tileid = 1; for(std::set<TileGroup>::iterator it = tilegroups->begin(); - it != tilegroups->end(); ++it ) - { - select_tilegroup_menu->additem(MN_ACTION, it->name, 0, 0, tileid); - tileid++; - tilegroups_map[(*it).name] = new ButtonPanel(screen->w - 64,96, 64, 318); - i = 0; - - for(std::vector<int>::const_iterator sit = (*it).tiles.begin(); - sit != (*it).tiles.end(); ++sit, ++i) + it != tilegroups->end(); ++it ) { - std::string imagefile = "/images/tilesets/" ; - bool only_editor_image = false; - if(!TileManager::instance()->get(*sit)->filenames.empty()) - { - imagefile += TileManager::instance()->get(*sit)->filenames[0]; - } - else if(!TileManager::instance()->get(*sit)->editor_filenames.empty()) - { - imagefile += TileManager::instance()->get(*sit)->editor_filenames[0]; - only_editor_image = true; - } - else + select_tilegroup_menu->additem(MN_ACTION, it->name, 0, 0, tileid); + tileid++; + tilegroups_map[(*it).name] = new ButtonPanel(screen->w - 64,96, 64, 318); + i = 0; + + for(std::vector<int>::const_iterator sit = (*it).tiles.begin(); + sit != (*it).tiles.end(); ++sit, ++i) { - imagefile += "notile.png"; - } - Button* button = new Button(imagefile, it->name, SDLKey(SDLK_a + i), - 0, 0, 32, 32); - if(!only_editor_image) - if(!TileManager::instance()->get(*sit)->editor_filenames.empty()) + std::string imagefile = "/images/tilesets/" ; + bool only_editor_image = false; + if(!TileManager::instance()->get(*sit)->filenames.empty()) { - imagefile = "/images/tilesets/" + TileManager::instance()->get(*sit)->editor_filenames[0]; - button->add_icon(imagefile,32,32); + imagefile += TileManager::instance()->get(*sit)->filenames[0]; } - tilegroups_map[it->name]->additem(button, *sit); + else if(!TileManager::instance()->get(*sit)->editor_filenames.empty()) + { + imagefile += TileManager::instance()->get(*sit)->editor_filenames[0]; + only_editor_image = true; + } + else + { + imagefile += "notile.png"; + } + Button* button = new Button(imagefile, it->name, SDLKey(SDLK_a + i), + 0, 0, 32, 32); + if(!only_editor_image) + if(!TileManager::instance()->get(*sit)->editor_filenames.empty()) + { + imagefile = "/images/tilesets/" + TileManager::instance()->get(*sit)->editor_filenames[0]; + button->add_icon(imagefile,32,32); + } + tilegroups_map[it->name]->additem(button, *sit); + } } - } select_tilegroup_menu->additem(MN_HL,"",0,0); select_objects_menu->arrange_left = true; @@ -511,11 +512,11 @@ { - level_subsets = dsubdirs("/levels", "info"); + level_subsets = dsubdirs("/levels", "level1.stl"); le_level_subset = new LevelSubset; le_world = NULL; - + active_tm = TM_IA; le_show_grid = true; scroll_x = 0; @@ -524,6 +525,7 @@ done = 0; le_frame = 0; /* support for frames in some tiles, like waves and bad guys */ le_level_changed = false; + le_help_shown = false; le_mouse_pressed[LEFT] = false; le_mouse_pressed[RIGHT] = false; @@ -557,6 +559,7 @@ le_tilemap_panel->additem(new Button("/images/icons/intact.png","Interactive",SDLK_i,0,0),TM_IA); le_tilemap_panel->additem(new Button("/images/icons/frgrd.png","Foreground",SDLK_f,0,0),TM_FG); le_tilemap_panel->highlight_last(true); + le_tilemap_panel->set_last_clicked(TM_IA); le_current.Init(); @@ -767,26 +770,26 @@ } } - if(show_minimap && use_gl) // use_gl because the minimap isn't shown correctly in software mode. Any idea? FIXME Possible reasons: SDL_SoftStretch is a hack itsself || an alpha blitting issue SDL can't handle in software mode + if(show_minimap) // use_gl because the minimap isn't shown correctly in software mode. Any idea? FIXME Possible reasons: SDL_SoftStretch is a hack itsself || an alpha blitting issue SDL can't handle in software mode le_drawminimap(); if(le_selection_mode == CURSOR) + { if(le_current.IsTile()) le_selection->draw( cursor_x - pos_x, cursor_y); - else - le_selection->draw( cursor_x, cursor_y); - else if(le_selection_mode == SQUARE) - { - int w, h; - le_highlight_selection(); - /* draw current selection */ - w = selection.x2 - selection.x1; - h = selection.y2 - selection.y1; - fillrect(selection.x1 - pos_x, selection.y1, w, SELECT_W, SELECT_CLR); - fillrect(selection.x1 - pos_x + w, selection.y1, SELECT_W, h, SELECT_CLR); - fillrect(selection.x1 - pos_x, selection.y1 + h, w, SELECT_W, SELECT_CLR); - fillrect(selection.x1 - pos_x, selection.y1, SELECT_W, h, SELECT_CLR); - } + } + else if(le_selection_mode == SQUARE) + { + int w, h; + le_highlight_selection(); + /* draw current selection */ + w = selection.x2 - selection.x1; + h = selection.y2 - selection.y1; + fillrect(selection.x1 - pos_x, selection.y1, w, SELECT_W, SELECT_CLR); + fillrect(selection.x1 - pos_x + w, selection.y1, SELECT_W, h, SELECT_CLR); + fillrect(selection.x1 - pos_x, selection.y1 + h, w, SELECT_W, SELECT_CLR); + fillrect(selection.x1 - pos_x, selection.y1, SELECT_W, h, SELECT_CLR); + } /* draw button bar */ @@ -831,9 +834,10 @@ le_tilemap_panel->draw(); sprintf(str, "%d/%d", le_level,le_level_subset->levels); - white_text->drawf(str, -10, 16, A_RIGHT, A_TOP, 0); + white_text->drawf(str, (le_level_subset->levels < 10) ? -10 : 0, 16, A_RIGHT, A_TOP, 0); - white_small_text->draw("F1 for Help", 10, 430, 1); + if(!le_help_shown) + white_small_text->draw("F1 for Help", 10, 430, 1); } else { @@ -855,9 +859,9 @@ { s = (int)((float)pos_x * ((float)le_world->get_level()->bkgd_speed/60.)) % screen->w; le_world->get_level()->img_bkgd->draw_part(s,0,0,0, - le_world->get_level()->img_bkgd->w - s - 32, le_world->get_level()->img_bkgd->h); + le_world->get_level()->img_bkgd->w - s - 32, le_world->get_level()->img_bkgd->h); le_world->get_level()->img_bkgd->draw_part(0,0,screen->w - s - 32 ,0,s, - le_world->get_level()->img_bkgd->h); + le_world->get_level()->img_bkgd->h); } else { @@ -904,8 +908,9 @@ /* draw whats inside stuff when cursor is selecting those */ /* (draw them all the time - is this the right behaviour?) */ - if(!TileManager::instance()->get(le_world->get_level()->ia_tiles[y][x + (int)(pos_x / 32)])->editor_images.empty()) - TileManager::instance()->get(le_world->get_level()->ia_tiles[y][x + (int)(pos_x / 32)])->editor_images[0]->draw( x * 32 - ((int)pos_x % 32), y*32); + Tile* edit_image = TileManager::instance()->get(le_world->get_level()->ia_tiles[y][x + (int)(pos_x / 32)]); + if(edit_image && !edit_image->editor_images.empty()) + edit_image->editor_images[0]->draw( x * 32 - ((int)pos_x % 32), y*32); } @@ -926,7 +931,7 @@ void le_change_object_properties(GameObject *pobj) { -Menu* object_properties_menu = new Menu(); + Menu* object_properties_menu = new Menu(); object_properties_menu->additem(MN_LABEL,pobj->type() + " Properties",0,0); object_properties_menu->additem(MN_HL,"",0,0); @@ -937,7 +942,7 @@ object_properties_menu->additem(MN_HL,"",0,0); object_properties_menu->additem(MN_BACK,"Apply",0,0); -delete object_properties_menu; + delete object_properties_menu; } @@ -955,6 +960,8 @@ if (Menu::current()) { Menu::current()->event(event); + if(!le_world && !Menu::current()) + Menu::set_current(leveleditor_menu); } else { @@ -975,6 +982,7 @@ { case SDLK_ESCAPE: Menu::set_current(leveleditor_menu); + break; case SDLK_LEFT: if(fire == DOWN) cursor_x -= KEY_CURSOR_SPEED; @@ -1017,8 +1025,8 @@ fire =UP; break; case SDLK_F1: - if(le_world != NULL) - le_showhelp(); + if(le_world != NULL) + le_showhelp(); break; case SDLK_HOME: cursor_x = 0; @@ -1318,7 +1326,7 @@ if(le_objects_bt->get_state() == BUTTON_CLICKED) { Menu::set_current(0); - } + } } } @@ -1449,10 +1457,10 @@ for(std::list<BadGuy*>::iterator it = le_world->bad_guys.begin(); it != le_world->bad_guys.end(); ++it, ++i) if(rectcollision(cursor_base,(*it)->base)) { - delete (*it); + delete (*it); le_world->bad_guys.erase(it); le_world->get_level()->badguy_data.erase(le_world->get_level()->badguy_data.begin() + i); - break; + break; } break; @@ -1490,14 +1498,14 @@ if((*it)->base.x/32 >= x1 && (*it)->base.x/32 <= x2 && (*it)->base.y/32 >= y1 && (*it)->base.y/32 <= y2) { - delete (*it); + delete (*it); it = le_world->bad_guys.erase(it); - le_world->get_level()->badguy_data.erase(le_world->get_level()->badguy_data.begin() + i); + le_world->get_level()->badguy_data.erase(le_world->get_level()->badguy_data.begin() + i); continue; } else { - ++i; + ++i; ++it; } } @@ -1519,8 +1527,8 @@ { //Make sure a time value is set when testing the level if(le_world->get_level()->time_left == 0) - le_world->get_level()->time_left = 250; - + le_world->get_level()->time_left = 250; + le_world->get_level()->save("test", le_level); GameSession session("test",le_level, ST_GL_TEST); @@ -1535,63 +1543,69 @@ void le_showhelp() { + bool tmp_show_grid = le_show_grid; + le_show_grid = false; + le_help_shown = true; + + drawgradient(Color(0,0,0), Color(255,255,255)); + le_drawinterface(); + SDL_Event event; unsigned int i, done_; char *text[] = { " - Supertux level editor tutorial - ", - "", - "To make your map, click the tilegroup button and choose a tilegroup." - "Pick a tile and simply hold down the left mouse button over the map", - "to \"paint\" your selection over the screen.", - "There are three layers for painting tiles upon, Background layer,", - "the Interactive layer, and the Foreground layer, which can be toggled", - "by the BkGrd, IntAct and FrGrd buttons. The Foreground and Background", - "layers do not effect Tux in the gameplay, but lie in front of him or", - "lie behind him in his adventures. The tiles placed on the Interactive", - "layer are those which actually effect Tux in the game.", - "Click the objects menu to put bad guys and other objects in the game.", - "Unlike placing tiles, you cannot \"paint\" enemies. Click them onto", - "the screen one at a time.", - "To change the settings of your level, click the button with the", - "screwdriver and wrench. From here you can change the background,", - "music, length of the level, and more.", - "You may have more than one levelset. Pressing the up and down buttons", - "above the button bar lets you choose which one you are working on.", - "If you would like to speed up your level editing, a useful trick is", - "to learn the keyboard shortcuts. They are easy to learn, just right-", - "Have fun making levels! If you make some good ones, send them to us on", - "the SuperTux mailing list!", - "- SuperTux team" + "", + "To make your map, click the ", + "tilegroup button and choose a ", + "tilegroup.", + "Pick a tile and simply hold down ", + "the left mouse button over the map", + "to \"paint\" your selection over", + "the screen.", + "There are three layers for painting", + "tiles upon, Background layer,", + "the Interactive layer, and the", + "Foreground layer, which can be", + "toggled by the BkGrd, IntAct and", + "FrGrd buttons. The Foreground and", + "Background layers do not effect", + "Tux in the gameplay, but lie in", + "front of him or lie behind him in", + "his adventures.", }; char *text2[] = { - " - Supertux level editor tutorial - ", - "", - "To make your map, click the tilegroup button and choose a tilegroup." - "APick a tile and simply hold down the left mouse button over the map", - "Ato \"paint\" your selection over the screen.", - "AThere are three layers for painting tiles upon, Background layer,", - "the Interactive layer, and the Foreground layer, which can be toggled", - "by the BkGrd, IntAct and FrGrd buttons. The Foreground and Background", - "layers do not effect Tux in the gameplay, but lie in front of him or", - "lie behind him in his adventures. The tiles placed on the Interactive", - "layer are those which actually effect Tux in the game.", - "Click the objects menu to put bad guys and other objects in the game.", - "Unlike placing tiles, you cannot \"paint\" enemies. Click them onto", - "the screen one at a time.", - "To change the settings of your level, click the button with the", - "screwdriver and wrench. From here you can change the background,", - "music, length of the level, and more.", - "You may have more than one levelset. Pressing the up and down buttons", - "above the button bar lets you choose which one you are working on.", - "If you would like to speed up your level editing, a useful trick is", - "to learn the keyboard shortcuts. They are easy to learn, just right-", - "Have fun making levels! If you make some good ones, send them to us on", - "the SuperTux mailing list!", - "- SuperTux team" - }; + " - Supertux level editor tutorial - ", + "", + "The tiles placed on", + "the Interactive layer are those", + "which actually effect Tux in the", + "game.", + "Click the objects menu to put ", + "bad guys and other objects in the", + "game. Unlike placing tiles, you", + "cannot \"paint\" enemies. Click", + "them onto the screen one at a time.", + "To change the settings of your", + "level, click the button with the", + "screwdriver and wrench. From here", + "you can change the background,", + "music, length of the level, and more.", + "You may have more than one levelset.", + "Pressing the up and down buttons", + "above the button bar lets you choose", + "which one you are working on.", + "If you would like to speed up your", + "level editing, a useful trick is", + "to learn the keyboard shortcuts. They", + "are easy to learn, just right-", + "Have fun making levels! If you make", + "some good ones, send them to us on", + "the SuperTux mailing list!", + "- SuperTux team" + }; blue_text->drawf("- Help -", 0, 30, A_HMIDDLE, A_TOP, 2); @@ -1599,7 +1613,7 @@ for(i = 0; i < sizeof(text)/sizeof(char *); i++) white_text->draw(text[i], 5, 80+(i*white_text->h), 1); - gold_text->drawf("Press Any Key to Continue - Page 1/2", 0, 440, A_HMIDDLE, A_TOP, 1); + gold_text->drawf("Press Any Key to Continue - Page 1/2", 0, 0, A_LEFT, A_BOTTOM, 1); flipscreen(); @@ -1610,16 +1624,17 @@ done_ = wait_for_event(event); SDL_Delay(50); } - - le_drawlevel(); + + drawgradient(Color(0,0,0), Color(255,255,255)); le_drawinterface(); - + + blue_text->drawf("- Help -", 0, 30, A_HMIDDLE, A_TOP, 2); for(i = 0; i < sizeof(text2)/sizeof(char *); i++) white_text->draw(text2[i], 5, 80+(i*white_text->h), 1); - gold_text->drawf("Press Any Key to Continue - Page 2/2", 0, 440, A_HMIDDLE, A_TOP, 1); + gold_text->drawf("Press Any Key to Continue - Page 2/2", 0, 0, A_LEFT, A_BOTTOM, 1); flipscreen(); @@ -1630,4 +1645,7 @@ done_ = wait_for_event(event); SDL_Delay(50); } + + le_show_grid = tmp_show_grid; + le_help_shown = false; } Index: button.h =================================================================== RCS file: /cvsroot/super-tux/supertux/src/button.h,v retrieving revision 1.20 retrieving revision 1.21 diff -u -d -r1.20 -r1.21 --- button.h 5 May 2004 16:59:41 -0000 1.20 +++ button.h 9 May 2004 11:14:12 -0000 1.21 @@ -75,6 +75,8 @@ void set_button_size(int w, int h); Button* manipulate_button(int i); void highlight_last(bool b); + void set_last_clicked(unsigned int last) + { if(hlast) { if(item.size() >= last) { last_clicked = item.begin() + last; } } }; private: int bw, bh; Index: texture.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/texture.cpp,v retrieving revision 1.22 retrieving revision 1.23 diff -u -d -r1.22 -r1.23 --- texture.cpp 9 May 2004 01:13:20 -0000 1.22 +++ texture.cpp 9 May 2004 11:14:18 -0000 1.23 @@ -751,7 +751,7 @@ SurfaceSDL::draw_stretched(float x, float y, int sw, int sh, Uint8 alpha, bool update) { SDL_Rect dest; - + dest.x = (int)x; dest.y = (int)y; dest.w = (int)sw; @@ -759,8 +759,19 @@ if(alpha != 255) SDL_SetAlpha(sdl_surface ,SDL_SRCALPHA,alpha); + + + SDL_Surface* sdl_surface_copy = SDL_CreateRGBSurface (sdl_surface->flags, + sw, sh, sdl_surface->format->BitsPerPixel, + sdl_surface->format->Rmask, sdl_surface->format->Gmask, + sdl_surface->format->Bmask, + 0); - int ret = SDL_SoftStretch(sdl_surface, NULL, screen, &dest); + SDL_BlitSurface(sdl_surface, NULL, sdl_surface_copy, NULL); + SDL_SoftStretch(sdl_surface_copy, NULL, sdl_surface_copy, &dest); + + int ret = SDL_BlitSurface(sdl_surface_copy,NULL,screen,&dest); + SDL_FreeSurface(sdl_surface_copy); if (update == UPDATE) update_rect(screen, dest.x, dest.y, dest.w, dest.h); |
From: Ricardo C. <rm...@us...> - 2004-05-09 01:13:29
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24748/src Modified Files: texture.cpp Log Message: SDL draw() now supports alpha blitting. Index: texture.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/texture.cpp,v retrieving revision 1.21 retrieving revision 1.22 diff -u -d -r1.21 -r1.22 --- texture.cpp 5 May 2004 22:04:48 -0000 1.21 +++ texture.cpp 9 May 2004 01:13:20 -0000 1.22 @@ -652,16 +652,38 @@ if(alpha != 255) { /* Copy the SDL surface, then make it using alpha and use it to blit into the screen */ +/* SDL_Surface* sdl_surface_copy = SDL_CreateRGBSurface (sdl_surface->flags, sdl_surface->w, sdl_surface->h, sdl_surface->format->BitsPerPixel, - sdl_surface->format->Rmask, sdl_surface->format->Gmask, sdl_surface->format->Bmask, + sdl_surface->format->Rmask, sdl_surface->format->Gmask, + sdl_surface->format->Bmask, sdl_surface->format->Amask); SDL_BlitSurface(sdl_surface, NULL, sdl_surface_copy, NULL); SDL_SetAlpha(sdl_surface_copy ,SDL_SRCALPHA,alpha); - int ret = SDL_BlitSurface(sdl_surface_copy, NULL, screen, &dest); + int ret = SDL_BlitSurface(sdl_surface_copy, NULL, screen, &dest); */ + +/* *TEST* Create a Surface, make it using colorkey, blit surface into temp, apply alpha +to temp sur, blit the temp into the screen */ + + SDL_Surface* sdl_surface_copy = SDL_CreateRGBSurface (sdl_surface->flags, + sdl_surface->w, sdl_surface->h, sdl_surface->format->BitsPerPixel, + sdl_surface->format->Rmask, sdl_surface->format->Gmask, + sdl_surface->format->Bmask, + 0); +int colorkey = SDL_MapRGB(sdl_surface_copy->format, 255, 0, 255); +SDL_FillRect(sdl_surface_copy, NULL, colorkey); +SDL_SetColorKey(sdl_surface_copy, SDL_SRCCOLORKEY, colorkey); + + +SDL_BlitSurface(sdl_surface, NULL, sdl_surface_copy, NULL); +SDL_SetAlpha(sdl_surface_copy ,SDL_SRCALPHA,alpha); + +int ret = SDL_BlitSurface(sdl_surface_copy, NULL, screen, &dest); + + if (update == UPDATE) SDL_UpdateRect(screen, dest.x, dest.y, dest.w, dest.h); |
From: Ricardo C. <rm...@us...> - 2004-05-08 23:47:05
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11740/src Modified Files: badguy.cpp badguy.h Log Message: Added explode(). Avoid duplicated code, futhermore, allows any badguy to explode. Index: badguy.h =================================================================== RCS file: /cvsroot/super-tux/supertux/src/badguy.h,v retrieving revision 1.37 retrieving revision 1.38 diff -u -d -r1.37 -r1.38 --- badguy.h 2 May 2004 21:28:32 -0000 1.37 +++ badguy.h 8 May 2004 23:46:43 -0000 1.38 @@ -111,6 +111,8 @@ void draw(); std::string type() { return "BadGuy"; }; + void explode(BadGuy* badguy); + void collision(void* p_c_object, int c_object, CollisionType type = COLLISION_NORMAL); Index: badguy.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/badguy.cpp,v retrieving revision 1.67 retrieving revision 1.68 diff -u -d -r1.67 -r1.68 --- badguy.cpp 8 May 2004 23:21:21 -0000 1.67 +++ badguy.cpp 8 May 2004 23:46:43 -0000 1.68 @@ -929,6 +929,12 @@ play_sound(sounds[SND_FALL], SOUND_CENTER_SPEAKER); } +void BadGuy::explode(BadGuy *badguy) +{ +World::current()->add_bad_guy(badguy->base.x, badguy->base.y, BAD_BOMB); +badguy->remove_me(); +} + void BadGuy::collision(void *p_c_object, int c_object, CollisionType type) { @@ -974,9 +980,7 @@ if (pbad_c->kind == BAD_MRBOMB) { // mrbomb transforms into a bomb now - World::current()->add_bad_guy(pbad_c->base.x, pbad_c->base.y, - BAD_BOMB); - pbad_c->remove_me(); + explode(pbad_c); return; } else if (pbad_c->kind != BAD_MRBOMB) @@ -991,9 +995,7 @@ if (pbad_c->kind == BAD_MRBOMB) { // mrbomb transforms into a bomb now - World::current()->add_bad_guy(pbad_c->base.x, pbad_c->base.y, - BAD_BOMB); - pbad_c->remove_me(); + explode(pbad_c); return; } else @@ -1074,6 +1076,7 @@ } } + //--------------------------------------------------------------------------- void load_badguy_gfx() |
From: Ricardo C. <rm...@us...> - 2004-05-08 23:21:30
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7390/src Modified Files: badguy.cpp Log Message: if a stalactite hits a Mr. Bomb, explode, instead of falling. Do you agree with this behavior? Index: badguy.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/badguy.cpp,v retrieving revision 1.66 retrieving revision 1.67 diff -u -d -r1.66 -r1.67 --- badguy.cpp 6 May 2004 02:12:36 -0000 1.66 +++ badguy.cpp 8 May 2004 23:21:21 -0000 1.67 @@ -988,7 +988,16 @@ /* Kill any badguys that get hit by stalactite */ else if (kind == BAD_STALACTITE && dying == DYING_NOT) { - pbad_c->kill_me(50); + if (pbad_c->kind == BAD_MRBOMB) + { + // mrbomb transforms into a bomb now + World::current()->add_bad_guy(pbad_c->base.x, pbad_c->base.y, + BAD_BOMB); + pbad_c->remove_me(); + return; + } + else + pbad_c->kill_me(50); } /* When enemies run into eachother, make them change directions */ |
From: Ricardo C. <rm...@us...> - 2004-05-08 14:57:17
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13867/src Modified Files: player.cpp Log Message: Small clean-up. Index: player.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/player.cpp,v retrieving revision 1.86 retrieving revision 1.87 diff -u -d -r1.86 -r1.87 --- player.cpp 8 May 2004 10:41:42 -0000 1.86 +++ player.cpp 8 May 2004 14:57:07 -0000 1.87 @@ -756,13 +756,15 @@ if(base.x < scroll_x && (!back_scrolling || hor_autoscroll)) // can happen if back scrolling is disabled base.x = scroll_x; - if(base.x == scroll_x && hor_autoscroll) - if(issolid(base.x+32, base.y) || (size != SMALL && issolid(base.x+32, base.y+32))) - kill(KILL); - - if(base.x + base.width > scroll_x + screen->w && hor_autoscroll) - base.x = scroll_x + screen->w - base.width; + if(hor_autoscroll) + { + if(base.x == scroll_x) + if(issolid(base.x+32, base.y) || (size != SMALL && issolid(base.x+32, base.y+32))) + kill(KILL); + if(base.x + base.width > scroll_x + screen->w) + base.x = scroll_x + screen->w - base.width; + } } |
From: Tobias Gl??er <to...@us...> - 2004-05-08 12:39:38
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22067/src Modified Files: leveleditor.cpp Log Message: Prevent "Return to Level Editor" from working, if no levelsubset is loaded. This solves a few possible crashes. Index: leveleditor.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/leveleditor.cpp,v retrieving revision 1.97 retrieving revision 1.98 diff -u -d -r1.97 -r1.98 --- leveleditor.cpp 8 May 2004 12:16:06 -0000 1.97 +++ leveleditor.cpp 8 May 2004 12:39:28 -0000 1.98 @@ -226,7 +226,10 @@ switch (leveleditor_menu->check()) { case MNID_RETURNLEVELEDITOR: + if(le_world != NULL) Menu::set_current(0); + else + Menu::set_current(leveleditor_menu); break; case MNID_SUBSETSETTINGS: update_subset_settings_menu(); @@ -1014,6 +1017,7 @@ fire =UP; break; case SDLK_F1: + if(le_world != NULL) le_showhelp(); break; case SDLK_HOME: @@ -1534,43 +1538,88 @@ SDL_Event event; unsigned int i, done_; char *text[] = { - " - This is SuperTux's built-in level editor -", - "It has been designed to be light and easy to use from the start.", - "", - "When you first load the level editor you are given a menu where you", - "can load level subsets, create a new level subset, edit the current", - "subset's settings, or simply quit the editor. You can access this menu", - "from the level editor at any time by pressing the escape key.", - "", - "To your right is your button bar. The center of this contains many", - "tiles you can use to make your level. To select a tile, click on it", - "with your left mouse button; your selection will be shown in the", - "bottom right corner of the button box. Click anywhere on your level", - "with the left mouse button to place that tile down. If you right click", - "a tile in the button bar, you can find out what its keyboard shortcut", - "is. The three buttons FGD, BGD and EMY let you pick from foreground,", - "background, and enemy tiles. The eraser lets you remove tiles.", - "The left and right arrow keys scroll back and forth through your level.", - "The button with the wrench and screwdriver, lets you change the", - "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.", - "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.", - "", + + " - Supertux level editor tutorial - ", + "", + "To make your map, click the tilegroup button and choose a tilegroup." + "Pick a tile and simply hold down the left mouse button over the map", + "to \"paint\" your selection over the screen.", + "There are three layers for painting tiles upon, Background layer,", + "the Interactive layer, and the Foreground layer, which can be toggled", + "by the BkGrd, IntAct and FrGrd buttons. The Foreground and Background", + "layers do not effect Tux in the gameplay, but lie in front of him or", + "lie behind him in his adventures. The tiles placed on the Interactive", + "layer are those which actually effect Tux in the game.", + "Click the objects menu to put bad guys and other objects in the game.", + "Unlike placing tiles, you cannot \"paint\" enemies. Click them onto", + "the screen one at a time.", + "To change the settings of your level, click the button with the", + "screwdriver and wrench. From here you can change the background,", + "music, length of the level, and more.", + "You may have more than one levelset. Pressing the up and down buttons", + "above the button bar lets you choose which one you are working on.", + "If you would like to speed up your level editing, a useful trick is", + "to learn the keyboard shortcuts. They are easy to learn, just right-", "Have fun making levels! If you make some good ones, send them to us on", "the SuperTux mailing list!", "- SuperTux team" }; + char *text2[] = { + + " - Supertux level editor tutorial - ", + "", + "To make your map, click the tilegroup button and choose a tilegroup." + "APick a tile and simply hold down the left mouse button over the map", + "Ato \"paint\" your selection over the screen.", + "AThere are three layers for painting tiles upon, Background layer,", + "the Interactive layer, and the Foreground layer, which can be toggled", + "by the BkGrd, IntAct and FrGrd buttons. The Foreground and Background", + "layers do not effect Tux in the gameplay, but lie in front of him or", + "lie behind him in his adventures. The tiles placed on the Interactive", + "layer are those which actually effect Tux in the game.", + "Click the objects menu to put bad guys and other objects in the game.", + "Unlike placing tiles, you cannot \"paint\" enemies. Click them onto", + "the screen one at a time.", + "To change the settings of your level, click the button with the", + "screwdriver and wrench. From here you can change the background,", + "music, length of the level, and more.", + "You may have more than one levelset. Pressing the up and down buttons", + "above the button bar lets you choose which one you are working on.", + "If you would like to speed up your level editing, a useful trick is", + "to learn the keyboard shortcuts. They are easy to learn, just right-", + "Have fun making levels! If you make some good ones, send them to us on", + "the SuperTux mailing list!", + "- SuperTux team" + }; + blue_text->drawf("- Help -", 0, 30, A_HMIDDLE, A_TOP, 2); for(i = 0; i < sizeof(text)/sizeof(char *); i++) - white_small_text->draw(text[i], 5, 80+(i*white_small_text->h), 1); + white_text->draw(text[i], 5, 80+(i*white_text->h), 1); - gold_text->drawf("Press Any Key to Continue", 0, 440, A_HMIDDLE, A_TOP, 1); + gold_text->drawf("Press Any Key to Continue - Page 1/2", 0, 440, A_HMIDDLE, A_TOP, 1); + + flipscreen(); + + done_ = 0; + + while(done_ == 0) + { + done_ = wait_for_event(event); + SDL_Delay(50); + } + + le_drawlevel(); + le_drawinterface(); + + blue_text->drawf("- Help -", 0, 30, A_HMIDDLE, A_TOP, 2); + + for(i = 0; i < sizeof(text2)/sizeof(char *); i++) + white_text->draw(text2[i], 5, 80+(i*white_text->h), 1); + + gold_text->drawf("Press Any Key to Continue - Page 2/2", 0, 440, A_HMIDDLE, A_TOP, 1); flipscreen(); |
From: Tobias Gl??er <to...@us...> - 2004-05-08 12:16:15
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17857/src Modified Files: leveleditor.cpp Log Message: minor fix, that makes sure a time_left value is set, if you want to test a level. Index: leveleditor.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/leveleditor.cpp,v retrieving revision 1.96 retrieving revision 1.97 diff -u -d -r1.96 -r1.97 --- leveleditor.cpp 8 May 2004 12:01:56 -0000 1.96 +++ leveleditor.cpp 8 May 2004 12:16:06 -0000 1.97 @@ -1513,6 +1513,10 @@ void le_testlevel() { + //Make sure a time value is set when testing the level + if(le_world->get_level()->time_left == 0) + le_world->get_level()->time_left = 250; + le_world->get_level()->save("test", le_level); GameSession session("test",le_level, ST_GL_TEST); |
From: Tobias Gl??er <to...@us...> - 2004-05-08 12:02:07
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15698/src Modified Files: leveleditor.cpp Log Message: change back to to le_world as current world, when we are done testing our level. Index: leveleditor.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/leveleditor.cpp,v retrieving revision 1.95 retrieving revision 1.96 diff -u -d -r1.95 -r1.96 --- leveleditor.cpp 8 May 2004 11:35:03 -0000 1.95 +++ leveleditor.cpp 8 May 2004 12:01:56 -0000 1.96 @@ -1522,9 +1522,7 @@ music_manager->halt_music(); Menu::set_current(NULL); - /*delete le_world.arrays_free(); - le_current_level->load_gfx(); - le_world.activate_bad_guys();*/ + World::set_current(le_world); } void le_showhelp() |
From: Tobias Gl??er <to...@us...> - 2004-05-08 11:35:23
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11066/src Modified Files: leveleditor.cpp tile.h Log Message: Make sure that tiles are loaded before tilegroups are requested. This fixed a bug when loading leveleditor from command-line. Index: tile.h =================================================================== RCS file: /cvsroot/super-tux/supertux/src/tile.h,v retrieving revision 1.18 retrieving revision 1.19 diff -u -d -r1.18 -r1.19 --- tile.h 6 May 2004 19:55:39 -0000 1.18 +++ tile.h 8 May 2004 11:35:04 -0000 1.19 @@ -112,7 +112,7 @@ static TileManager* instance() { return instance_ ? instance_ : instance_ = new TileManager(); } static void destroy_instance() { delete instance_; instance_ = 0; } - static std::set<TileGroup>* tilegroups() { return tilegroups_ ? tilegroups_ : tilegroups_ = new std::set<TileGroup>; } + static std::set<TileGroup>* tilegroups() { if(!instance_) { instance_ = new TileManager(); } return tilegroups_ ? tilegroups_ : tilegroups_ = new std::set<TileGroup>; } Tile* get(unsigned int id) { if(id < tiles.size()) { Index: leveleditor.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/leveleditor.cpp,v retrieving revision 1.94 retrieving revision 1.95 diff -u -d -r1.94 -r1.95 --- leveleditor.cpp 8 May 2004 00:28:46 -0000 1.94 +++ leveleditor.cpp 8 May 2004 11:35:03 -0000 1.95 @@ -257,8 +257,7 @@ default: if(it >= 0) { - cur_tilegroup - = select_tilegroup_menu->get_item_by_id(it).text; + cur_tilegroup = select_tilegroup_menu->get_item_by_id(it).text; Menu::set_current(0); cur_objects = ""; @@ -446,6 +445,7 @@ select_tilegroup_menu->arrange_left = true; select_tilegroup_menu->additem(MN_LABEL,"Tilegroup",0,0); select_tilegroup_menu->additem(MN_HL,"",0,0); + select_tilegroup_menu->additem(MN_ACTION,"asd",0,0); std::set<TileGroup>* tilegroups = TileManager::tilegroups(); int tileid = 1; for(std::set<TileGroup>::iterator it = tilegroups->begin(); @@ -642,7 +642,7 @@ le_world->get_level()->song_title = string_list_active(level_settings_menu->get_item_by_id(MNID_SONG).list); le_world->get_level()->change_size(atoi(level_settings_menu->get_item_by_id(MNID_LENGTH).input)); - le_world->get_level()->time_left = atoi(level_settings_menu->get_item_by_id(MNID_BGIMG).input); + le_world->get_level()->time_left = atoi(level_settings_menu->get_item_by_id(MNID_TIME).input); le_world->get_level()->gravity = atof(level_settings_menu->get_item_by_id(MNID_GRAVITY).input); le_world->get_level()->bkgd_speed = atoi(level_settings_menu->get_item_by_id(MNID_BGSPEED).input); le_world->get_level()->bkgd_top.red = atoi(level_settings_menu->get_item_by_id(MNID_TopRed).input); @@ -901,7 +901,7 @@ /* draw whats inside stuff when cursor is selecting those */ /* (draw them all the time - is this the right behaviour?) */ - if(TileManager::instance()->get(le_world->get_level()->ia_tiles[y][x + (int)(pos_x / 32)])->editor_images.size() > 0) + if(!TileManager::instance()->get(le_world->get_level()->ia_tiles[y][x + (int)(pos_x / 32)])->editor_images.empty()) TileManager::instance()->get(le_world->get_level()->ia_tiles[y][x + (int)(pos_x / 32)])->editor_images[0]->draw( x * 32 - ((int)pos_x % 32), y*32); } |
From: Ricardo C. <rm...@us...> - 2004-05-08 10:46:02
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2339/src Modified Files: worldmap.cpp Log Message: There is no need in saving on exit, since it already saves in level exit. Index: worldmap.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/worldmap.cpp,v retrieving revision 1.67 retrieving revision 1.68 diff -u -d -r1.67 -r1.68 --- worldmap.cpp 6 May 2004 15:09:47 -0000 1.67 +++ worldmap.cpp 8 May 2004 10:45:52 -0000 1.68 @@ -744,8 +744,6 @@ case MNID_RETURNWORLDMAP: // Return to game break; case MNID_QUITWORLDMAP: // Quit Worldmap - if (!savegame_file.empty()) - savegame(savegame_file); quit = true; break; } |
From: Ricardo C. <rm...@us...> - 2004-05-08 10:41:51
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1584/src Modified Files: player.cpp player.h world.cpp Log Message: Fixes death in modes different than the autoscrolling. Index: player.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/player.cpp,v retrieving revision 1.85 retrieving revision 1.86 diff -u -d -r1.85 -r1.86 --- player.cpp 8 May 2004 00:04:00 -0000 1.85 +++ player.cpp 8 May 2004 10:41:42 -0000 1.86 @@ -194,7 +194,6 @@ base.x += frame_ratio * WALK_SPEED * (dir ? 1 : -1); previous_base = old_base = base; } - check_bounds(); // Land: if (!on_ground()) @@ -739,7 +738,7 @@ } void -Player::check_bounds() +Player::check_bounds(bool back_scrolling, bool hor_autoscroll) { /* Keep tux in bounds: */ if (base.x < 0) @@ -754,14 +753,14 @@ kill(KILL); } - if(base.x < scroll_x) // can happen if back scrolling is disabled + if(base.x < scroll_x && (!back_scrolling || hor_autoscroll)) // can happen if back scrolling is disabled base.x = scroll_x; - if(base.x == scroll_x) - if(issolid(base.x, base.y) || (size != SMALL && issolid(base.x, base.y+32))) + if(base.x == scroll_x && hor_autoscroll) + if(issolid(base.x+32, base.y) || (size != SMALL && issolid(base.x+32, base.y+32))) kill(KILL); - if(base.x + base.width > scroll_x + screen->w) + if(base.x + base.width > scroll_x + screen->w && hor_autoscroll) base.x = scroll_x + screen->w - base.width; Index: player.h =================================================================== RCS file: /cvsroot/super-tux/supertux/src/player.h,v retrieving revision 1.51 retrieving revision 1.52 diff -u -d -r1.51 -r1.52 --- player.h 4 May 2004 13:59:00 -0000 1.51 +++ player.h 8 May 2004 10:41:42 -0000 1.52 @@ -145,7 +145,7 @@ void is_dying(); bool is_dead(); void player_remove_powerups(); - void check_bounds(); + void check_bounds(bool back_scrolling, bool hor_autoscroll); bool on_ground(); bool under_solid(); void grow(); Index: world.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/world.cpp,v retrieving revision 1.68 retrieving revision 1.69 diff -u -d -r1.68 -r1.69 --- world.cpp 7 May 2004 23:09:53 -0000 1.68 +++ world.cpp 8 May 2004 10:41:42 -0000 1.69 @@ -261,6 +261,7 @@ World::action(double frame_ratio) { tux.action(frame_ratio); + tux.check_bounds(level->back_scrolling, (bool)level->hor_autoscroll_speed); scrolling(frame_ratio); /* Handle bouncy distros: */ |
From: Tobias Gl??er <to...@us...> - 2004-05-08 00:28:57
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6409/src Modified Files: leveleditor.cpp Log Message: Fixed some leveleditor-object/badguy issues. Index: leveleditor.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/leveleditor.cpp,v retrieving revision 1.93 retrieving revision 1.94 diff -u -d -r1.93 -r1.94 --- leveleditor.cpp 7 May 2004 23:45:24 -0000 1.93 +++ leveleditor.cpp 8 May 2004 00:28:46 -0000 1.94 @@ -246,7 +246,6 @@ break; default: - //show_menu = true; break; } } @@ -1311,6 +1310,11 @@ { Menu::set_current(0); } + le_objects_bt->event(event); + if(le_objects_bt->get_state() == BUTTON_CLICKED) + { + Menu::set_current(0); + } } } @@ -1422,7 +1426,7 @@ { int xx,yy; int x1, x2, y1, y2; - unsigned int i; + unsigned int i = 0; /* level_changed = true; */ @@ -1438,11 +1442,13 @@ cursor_base.height = 32; /* if there is a bad guy over there, remove it */ - for(std::list<BadGuy*>::iterator it = le_world->bad_guys.begin(); it != le_world->bad_guys.end(); ++it) + for(std::list<BadGuy*>::iterator it = le_world->bad_guys.begin(); it != le_world->bad_guys.end(); ++it, ++i) if(rectcollision(cursor_base,(*it)->base)) { - le_world->bad_guys.erase(le_world->bad_guys.begin(),it); + delete (*it); + le_world->bad_guys.erase(it); le_world->get_level()->badguy_data.erase(le_world->get_level()->badguy_data.begin() + i); + break; } break; @@ -1480,11 +1486,14 @@ if((*it)->base.x/32 >= x1 && (*it)->base.x/32 <= x2 && (*it)->base.y/32 >= y1 && (*it)->base.y/32 <= y2) { + delete (*it); it = le_world->bad_guys.erase(it); + le_world->get_level()->badguy_data.erase(le_world->get_level()->badguy_data.begin() + i); continue; } else { + ++i; ++it; } } |
From: Ricardo C. <rm...@us...> - 2004-05-08 00:04:14
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2465/src Modified Files: player.cpp Log Message: Fixed bug that was causing player's dead. Don't think it is totally solved Index: player.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/player.cpp,v retrieving revision 1.84 retrieving revision 1.85 diff -u -d -r1.84 -r1.85 --- player.cpp 7 May 2004 23:09:53 -0000 1.84 +++ player.cpp 8 May 2004 00:04:00 -0000 1.85 @@ -758,7 +758,7 @@ base.x = scroll_x; if(base.x == scroll_x) - if(issolid(base.x, base.y) || issolid(base.x, base.y+32)) + if(issolid(base.x, base.y) || (size != SMALL && issolid(base.x, base.y+32))) kill(KILL); if(base.x + base.width > scroll_x + screen->w) |
From: Tobias Gl??er <to...@us...> - 2004-05-07 23:45:38
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31838/src Modified Files: leveleditor.cpp Log Message: Fixed creating level-subset again. Index: leveleditor.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/leveleditor.cpp,v retrieving revision 1.92 retrieving revision 1.93 diff -u -d -r1.92 -r1.93 --- leveleditor.cpp 7 May 2004 20:48:21 -0000 1.92 +++ leveleditor.cpp 7 May 2004 23:45:24 -0000 1.93 @@ -82,32 +82,6 @@ void update_subset_settings_menu(); void save_subset_settings_menu(); -/*static Level* le_current_level;*/ - -/*struct LevelEditorWorld -{ - std::vector<BadGuy> bad_guys; - void arrays_free(void) - { - bad_guys.clear(); - } - - void add_bad_guy(float x, float y, BadGuyKind kind) - { - bad_guys.push_back(BadGuy(x,y,kind, false /* stay_on_platform * /)); - } - - void activate_bad_guys() - { - for (std::vector<BadGuyData>::iterator i = le_current_level->badguy_data.begin(); - i != le_current_level->badguy_data.end(); - ++i) - { - add_bad_guy(i->x, i->y, i->kind); - } - } -};*/ - struct TileOrObject { TileOrObject() : tile(0), obj(NULL) { is_tile = true; }; @@ -338,9 +312,8 @@ LevelSubset::create(subset_new_menu->get_item_by_id(MNID_SUBSETNAME).input); le_level_subset->load(subset_new_menu->get_item_by_id(MNID_SUBSETNAME).input); leveleditor_menu->get_item_by_id(MNID_SUBSETSETTINGS).kind = MN_GOTO; - le_level = 1; delete le_world; - le_world = new World; + le_world = new World(le_level_subset->name,1); subset_new_menu->get_item_by_id(MNID_SUBSETNAME).change_input(""); Menu::set_current(subset_settings_menu); @@ -453,21 +426,21 @@ level_settings_menu->arrange_left = true; level_settings_menu->additem(MN_LABEL,"Level Settings",0,0); level_settings_menu->additem(MN_HL,"",0,0); - level_settings_menu->additem(MN_TEXTFIELD,"Name ",0,0,MNID_NAME); - level_settings_menu->additem(MN_TEXTFIELD,"Author ",0,0,MNID_AUTHOR); + level_settings_menu->additem(MN_TEXTFIELD, "Name ",0,0,MNID_NAME); + level_settings_menu->additem(MN_TEXTFIELD, "Author ",0,0,MNID_AUTHOR); level_settings_menu->additem(MN_STRINGSELECT,"Song ",0,0,MNID_SONG); level_settings_menu->additem(MN_STRINGSELECT,"Bg-Image",0,0,MNID_BGIMG); level_settings_menu->additem(MN_STRINGSELECT,"Particle",0,0,MNID_PARTICLE); - level_settings_menu->additem(MN_NUMFIELD,"Length ",0,0,MNID_LENGTH); - level_settings_menu->additem(MN_NUMFIELD,"Time ",0,0,MNID_TIME); - level_settings_menu->additem(MN_NUMFIELD,"Gravity",0,0,MNID_GRAVITY); - level_settings_menu->additem(MN_NUMFIELD,"Bg-Img-Speed",0,0,MNID_BGSPEED); - level_settings_menu->additem(MN_NUMFIELD,"Top Red ",0,0,MNID_TopRed); - level_settings_menu->additem(MN_NUMFIELD,"Top Green ",0,0,MNID_TopGreen); - level_settings_menu->additem(MN_NUMFIELD,"Top Blue ",0,0,MNID_TopBlue); - level_settings_menu->additem(MN_NUMFIELD,"Bottom Red ",0,0,MNID_BottomRed); - level_settings_menu->additem(MN_NUMFIELD,"Bottom Green",0,0,MNID_BottomGreen); - level_settings_menu->additem(MN_NUMFIELD,"Bottom Blue",0,0,MNID_BottomBlue); + level_settings_menu->additem(MN_NUMFIELD, "Length ",0,0,MNID_LENGTH); + level_settings_menu->additem(MN_NUMFIELD, "Time ",0,0,MNID_TIME); + level_settings_menu->additem(MN_NUMFIELD, "Gravity ",0,0,MNID_GRAVITY); + level_settings_menu->additem(MN_NUMFIELD, "Bg-Img-Speed",0,0,MNID_BGSPEED); + level_settings_menu->additem(MN_NUMFIELD, "Top Red ",0,0,MNID_TopRed); + level_settings_menu->additem(MN_NUMFIELD, "Top Green ",0,0,MNID_TopGreen); + level_settings_menu->additem(MN_NUMFIELD, "Top Blue ",0,0,MNID_TopBlue); + level_settings_menu->additem(MN_NUMFIELD, "Bottom Red ",0,0,MNID_BottomRed); + level_settings_menu->additem(MN_NUMFIELD, "Bottom Green",0,0,MNID_BottomGreen); + level_settings_menu->additem(MN_NUMFIELD, "Bottom Blue",0,0,MNID_BottomBlue); level_settings_menu->additem(MN_HL,"",0,0); level_settings_menu->additem(MN_ACTION,"Apply Changes",0,0,MNID_APPLY); |
From: Ricardo C. <ri...@ae...> - 2004-05-07 23:35:26
|
Just to add that it couldn't be because of any of those, since the text displaying is done by display_text_file(), that is totally independent. Anyway, I think that bug is already there for awhile (i believe that 0.1 has this bug). Ricardo Cruz Em Sexta, 7 de Maio de 2004 22:14, o Ingo Ruhnke escreveu: > Update of /cvsroot/super-tux/supertux > In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3038 > > Modified Files: > TODO > Log Message: > added new issue > > > Index: TODO > =================================================================== > RCS file: /cvsroot/super-tux/supertux/TODO,v > retrieving revision 1.36 > retrieving revision 1.37 > diff -u -d -r1.36 -r1.37 > --- TODO 4 May 2004 23:39:40 -0000 1.36 > +++ TODO 7 May 2004 21:14:42 -0000 1.37 > @@ -17,6 +17,8 @@ > [M] When aborting a level, lives and score should remain the same as they > were before. Solution: make more dependency between the game engine > and worldmap or just backup those variables before starting a level. > +[L] intro doesn't seamlessly wrap around, might be due to the new > + scrolling code or due to the worldmap doing the drawing > [L] Backscroll is really messed up right now :) > [L] change lispreader to throw exceptions instead of simply assert() on > syntax error > > > -- As of next week, passwords will be entered in Morse code. |
From: Ingo R. <gr...@us...> - 2004-05-07 23:21:18
|
Update of /cvsroot/super-tux/supertux/data/images/title In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27114 Modified Files: logo.png Log Message: fixed logo, old one was missing a row of pixels on the top and on the right Index: logo.png =================================================================== RCS file: /cvsroot/super-tux/supertux/data/images/title/logo.png,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 Binary files /tmp/cvs6cTTen and /tmp/cvsWA9XE7 differ |