super-tux-commit Mailing List for Super Tux (Page 75)
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-06 15:10:10
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15384/src Modified Files: menu.h setup.cpp worldmap.cpp Log Message: Made worldmap to save game on exit. And removed Save menu item, it's useless, since the game automatically saves the game, and only confuses the player. Index: worldmap.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/worldmap.cpp,v retrieving revision 1.66 retrieving revision 1.67 diff -u -d -r1.66 -r1.67 --- worldmap.cpp 2 May 2004 16:08:22 -0000 1.66 +++ worldmap.cpp 6 May 2004 15:09:47 -0000 1.67 @@ -743,12 +743,9 @@ { case MNID_RETURNWORLDMAP: // Return to game break; - case MNID_SAVEGAME: + case MNID_QUITWORLDMAP: // Quit Worldmap if (!savegame_file.empty()) savegame(savegame_file); - break; - - case MNID_QUITWORLDMAP: // Quit Worldmap quit = true; break; } Index: menu.h =================================================================== RCS file: /cvsroot/super-tux/supertux/src/menu.h,v retrieving revision 1.58 retrieving revision 1.59 diff -u -d -r1.58 -r1.59 --- menu.h 4 May 2004 22:16:11 -0000 1.58 +++ menu.h 6 May 2004 15:09:47 -0000 1.59 @@ -53,7 +53,6 @@ enum WorldMapMenuIDs { MNID_RETURNWORLDMAP, - MNID_SAVEGAME, MNID_QUITWORLDMAP }; Index: setup.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/setup.cpp,v retrieving revision 1.71 retrieving revision 1.72 diff -u -d -r1.71 -r1.72 --- setup.cpp 6 May 2004 12:51:27 -0000 1.71 +++ setup.cpp 6 May 2004 15:09:47 -0000 1.72 @@ -467,7 +467,6 @@ worldmap_menu->additem(MN_LABEL,"Pause",0,0); worldmap_menu->additem(MN_HL,"",0,0); worldmap_menu->additem(MN_ACTION,"Continue",0,0,MNID_RETURNWORLDMAP); - worldmap_menu->additem(MN_ACTION,"Save",0,0,MNID_SAVEGAME); worldmap_menu->additem(MN_GOTO,"Options",0,options_menu); worldmap_menu->additem(MN_HL,"",0,0); worldmap_menu->additem(MN_ACTION,"Quit Game",0,0,MNID_QUITWORLDMAP); |
From: Ricardo C. <rm...@us...> - 2004-05-06 15:03:32
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14089/src Modified Files: world.cpp Log Message: This should work, i guess... Index: world.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/world.cpp,v retrieving revision 1.65 retrieving revision 1.66 diff -u -d -r1.65 -r1.66 --- world.cpp 6 May 2004 12:47:45 -0000 1.65 +++ world.cpp 6 May 2004 15:03:24 -0000 1.66 @@ -340,9 +340,13 @@ final_scroll_x = tux_pos_x - X_SPACE; } - scroll_x += (final_scroll_x - scroll_x) +/* scroll_x += (final_scroll_x - scroll_x) / (frame_ratio * (CHANGE_DIR_SCROLL_SPEED / 100)) + (tux.physic.get_velocity_x() * frame_ratio + tux.physic.get_acceleration_x() * frame_ratio * frame_ratio); +*/ + +scroll_x += ((final_scroll_x - scroll_x) / CHANGE_DIR_SCROLL_SPEED) * frame_ratio; + // std::cerr << tux_pos_x << " " << final_scroll_x << " " << scroll_x << std::endl; } |
From: Ricardo C. <rm...@us...> - 2004-05-06 12:51:36
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18361/src Modified Files: setup.cpp Log Message: Just added leveleditor argument to help info. Index: setup.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/setup.cpp,v retrieving revision 1.70 retrieving revision 1.71 diff -u -d -r1.70 -r1.71 --- setup.cpp 5 May 2004 16:07:19 -0000 1.70 +++ setup.cpp 6 May 2004 12:51:27 -0000 1.71 @@ -1048,8 +1048,8 @@ "Misc Options:\n" " -j, --joystick NUM Use joystick NUM (default: 0)\n" " --joymap XAXIS:YAXIS:A:B:START\n" + " --leveleditor Opens the leveleditor in a file. (Only works when a file is provided.)\n" " Define how joystick buttons and axis should be mapped\n" - " --worldmap Start in worldmap-mode (EXPERIMENTAL)\n" " -d, --datadir DIR Load Game data from DIR (default: automatic)\n" " --debug-mode Enables the debug-mode, which is useful for developers.\n" " --help Display a help message summarizing command-line\n" |
From: Ricardo C. <rm...@us...> - 2004-05-06 12:47:54
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17758/src Modified Files: world.cpp Log Message: Made the back scrolling to work in debug mode (and also only). If you want to test it, just run supertux as 'supertux --debug-mode'. Index: world.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/world.cpp,v retrieving revision 1.64 retrieving revision 1.65 diff -u -d -r1.64 -r1.65 --- world.cpp 5 May 2004 23:58:06 -0000 1.64 +++ world.cpp 6 May 2004 12:47:45 -0000 1.65 @@ -320,9 +320,9 @@ { int tux_pos_x = (int)(tux.base.x + (tux.base.width/2)); - if (level->back_scrolling || debug_mode) + if (/*level->back_scrolling || */debug_mode) { - if(tux.old_dir != tux.dir && level->back_scrolling) + if(tux.old_dir != tux.dir) scrolling_timer.start(CHANGE_DIR_SCROLL_SPEED); if(scrolling_timer.check()) @@ -350,13 +350,13 @@ { if (tux.physic.get_velocity_x() > 0 && scroll_x < tux_pos_x - (screen->w - X_SPACE)) scroll_x = tux_pos_x - (screen->w - X_SPACE); - else if (tux.physic.get_velocity_x() < 0 && scroll_x > tux_pos_x - X_SPACE && level->back_scrolling) + else if (tux.physic.get_velocity_x() < 0 && scroll_x > tux_pos_x - X_SPACE && debug_mode) scroll_x = tux_pos_x - X_SPACE; else { if (tux.dir == RIGHT && scroll_x < tux_pos_x - (screen->w - X_SPACE)) scroll_x = tux_pos_x - (screen->w - X_SPACE); - else if (tux.dir == LEFT && scroll_x > tux_pos_x - X_SPACE && level->back_scrolling) + else if (tux.dir == LEFT && scroll_x > tux_pos_x - X_SPACE && debug_mode) scroll_x = tux_pos_x - X_SPACE; } } @@ -364,20 +364,10 @@ else /*no debug*/ { - if (tux.physic.get_velocity_x() > 0 && scroll_x < tux_pos_x - (screen->w - X_SPACE)) + if (scroll_x < tux_pos_x - (screen->w - X_SPACE)) scroll_x = tux_pos_x - (screen->w - X_SPACE); - else if (tux.physic.get_velocity_x() < 0 && scroll_x > tux_pos_x - X_SPACE && level->back_scrolling) - scroll_x = tux_pos_x - X_SPACE; - else - { - if (tux.dir == RIGHT && scroll_x < tux_pos_x - (screen->w - X_SPACE)) - scroll_x = tux_pos_x - (screen->w - X_SPACE); - else if (tux.dir == LEFT && scroll_x > tux_pos_x - X_SPACE && level->back_scrolling) - scroll_x = tux_pos_x - X_SPACE; } - } - // this code prevent the screen to scroll before the start or after the level's end if(scroll_x < 0) scroll_x = 0; |
From: Ryan F. <sik...@us...> - 2004-05-06 02:12:48
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10186 Modified Files: badguy.cpp Log Message: - replaced some fabs() where fabsf() should be used - made jumpy's animation follow the laws of physics more closely (springs) Index: badguy.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/badguy.cpp,v retrieving revision 1.65 retrieving revision 1.66 diff -u -d -r1.65 -r1.66 --- badguy.cpp 2 May 2004 21:28:32 -0000 1.65 +++ badguy.cpp 6 May 2004 02:12:36 -0000 1.66 @@ -350,12 +350,12 @@ if (dir == LEFT) { dir = RIGHT; - physic.set_velocity_x(fabs(physic.get_velocity_x())); + physic.set_velocity_x(fabsf(physic.get_velocity_x())); } else { dir = LEFT; - physic.set_velocity_x(-fabs(physic.get_velocity_x())); + physic.set_velocity_x(-fabsf(physic.get_velocity_x())); } } } @@ -376,12 +376,15 @@ void BadGuy::action_jumpy(double frame_ratio) { - if (fabsf(physic.get_velocity_y()) < 2.5f) + const float vy = physic.get_velocity_y(); + + // XXX: These tests *should* use location from ground, not velocity + if (fabsf(vy) > 5.6f) + set_sprite(img_jumpy_left_down, img_jumpy_left_down); + else if (fabsf(vy) > 5.3f) set_sprite(img_jumpy_left_middle, img_jumpy_left_middle); - else if (physic.get_velocity_y() < 0) + else set_sprite(img_jumpy_left_up, img_jumpy_left_up); - else - set_sprite(img_jumpy_left_down, img_jumpy_left_down); Player& tux = *World::current()->get_tux(); @@ -1002,12 +1005,12 @@ if (pbad_c->dir == LEFT) { dir = RIGHT; - physic.set_velocity(fabs(physic.get_velocity_x()), 2); + physic.set_velocity(fabsf(physic.get_velocity_x()), 2); } else if (pbad_c->dir == RIGHT) { dir = LEFT; - physic.set_velocity(-fabs(physic.get_velocity_x()), 2); + physic.set_velocity(-fabsf(physic.get_velocity_x()), 2); } @@ -1022,12 +1025,12 @@ if (dir == LEFT) { dir = RIGHT; - physic.set_velocity_x(fabs(physic.get_velocity_x())); + physic.set_velocity_x(fabsf(physic.get_velocity_x())); } else if (dir == RIGHT) { dir = LEFT; - physic.set_velocity_x(-fabs(physic.get_velocity_x())); + physic.set_velocity_x(-fabsf(physic.get_velocity_x())); } } |
From: Ryan F. <sik...@us...> - 2004-05-05 23:58:15
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21289 Modified Files: world.cpp Log Message: - made some backscroll changes. It's now a little better, but still needs some work. Index: world.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/world.cpp,v retrieving revision 1.63 retrieving revision 1.64 diff -u -d -r1.63 -r1.64 --- world.cpp 5 May 2004 22:24:37 -0000 1.63 +++ world.cpp 5 May 2004 23:58:06 -0000 1.64 @@ -340,7 +340,9 @@ final_scroll_x = tux_pos_x - X_SPACE; } - scroll_x += (final_scroll_x - scroll_x) / (frame_ratio * (CHANGE_DIR_SCROLL_SPEED / 100)); + scroll_x += (final_scroll_x - scroll_x) + / (frame_ratio * (CHANGE_DIR_SCROLL_SPEED / 100)) + + (tux.physic.get_velocity_x() * frame_ratio + tux.physic.get_acceleration_x() * frame_ratio * frame_ratio); // std::cerr << tux_pos_x << " " << final_scroll_x << " " << scroll_x << std::endl; } |
From: Ryan F. <sik...@us...> - 2004-05-05 22:24:45
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2016 Modified Files: world.cpp Log Message: - fixed scrolling problem when starting from a reset point Index: world.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/world.cpp,v retrieving revision 1.62 retrieving revision 1.63 diff -u -d -r1.62 -r1.63 --- world.cpp 5 May 2004 12:03:50 -0000 1.62 +++ world.cpp 5 May 2004 22:24:37 -0000 1.63 @@ -361,13 +361,21 @@ } else /*no debug*/ - { + { if (tux.physic.get_velocity_x() > 0 && scroll_x < tux_pos_x - (screen->w - X_SPACE)) scroll_x = tux_pos_x - (screen->w - X_SPACE); else if (tux.physic.get_velocity_x() < 0 && scroll_x > tux_pos_x - X_SPACE && level->back_scrolling) scroll_x = tux_pos_x - X_SPACE; + else + { + if (tux.dir == RIGHT && scroll_x < tux_pos_x - (screen->w - X_SPACE)) + scroll_x = tux_pos_x - (screen->w - X_SPACE); + else if (tux.dir == LEFT && scroll_x > tux_pos_x - X_SPACE && level->back_scrolling) + scroll_x = tux_pos_x - X_SPACE; } + } + // this code prevent the screen to scroll before the start or after the level's end if(scroll_x < 0) scroll_x = 0; |
From: Tobias Gl??er <to...@us...> - 2004-05-05 22:04:58
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30873/src Modified Files: leveleditor.cpp texture.cpp texture.h tile.cpp tile.h Log Message: added draw_stretched capability to surface* and tile* classes and moreover built a minimap upon it for the leveleditor. Unfortunately it only works correctly in OpenGL mode, therefore it is disabled in software mode. Index: tile.h =================================================================== RCS file: /cvsroot/super-tux/supertux/src/tile.h,v retrieving revision 1.16 retrieving revision 1.17 diff -u -d -r1.16 -r1.17 --- tile.h 3 May 2004 20:35:59 -0000 1.16 +++ tile.h 5 May 2004 22:04:48 -0000 1.17 @@ -80,6 +80,7 @@ /** Draw a tile on the screen: */ static void draw(float x, float y, unsigned int c, Uint8 alpha = 255); + static void draw_stretched(float x, float y, int w, int h, unsigned int c, Uint8 alpha = 255); }; struct TileGroup Index: leveleditor.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/leveleditor.cpp,v retrieving revision 1.87 retrieving revision 1.88 diff -u -d -r1.87 -r1.88 --- leveleditor.cpp 5 May 2004 20:05:09 -0000 1.87 +++ leveleditor.cpp 5 May 2004 22:04:47 -0000 1.88 @@ -128,6 +128,7 @@ /* leveleditor internals */ static string_list_type level_subsets; static bool le_level_changed; /* if changes, ask for saving, when quiting*/ +static bool show_minimap; static int pos_x, cursor_x, cursor_y, fire; static int le_level; static LevelEditorWorld le_world; @@ -782,6 +783,41 @@ } } +void le_drawminimap() +{ +if(le_current_level == NULL) +return; + +int mini_tile_width; +if(screen->w - 64 > le_current_level->width * 4) +mini_tile_width = 4; +else if(screen->w - 64 > le_current_level->width * 2) +mini_tile_width = 2; +else +mini_tile_width = 1; +int left_offset = (screen->w - 64 - le_current_level->width*mini_tile_width) / 2; + + for (int y = 0; y < 15; ++y) + for (int x = 0; x < le_current_level->width; ++x) + { + + Tile::draw_stretched(left_offset + mini_tile_width*x, y * 4, mini_tile_width , 4, le_current_level->bg_tiles[y][x]); + + Tile::draw_stretched(left_offset + mini_tile_width*x, y * 4, mini_tile_width , 4, le_current_level->ia_tiles[y][x]); + + Tile::draw_stretched(left_offset + mini_tile_width*x, y * 4, mini_tile_width , 4, le_current_level->fg_tiles[y][x]); + + } + +fillrect(left_offset, 0, le_current_level->width*mini_tile_width, 15*4, 200, 200, 200, 128); + +fillrect(left_offset + (pos_x/32)*mini_tile_width, 0, 19*mini_tile_width, 2, 200, 200, 200, 200); +fillrect(left_offset + (pos_x/32)*mini_tile_width, 0, 2, 15*4, 200, 200, 200, 200); +fillrect(left_offset + (pos_x/32)*mini_tile_width + 19*mini_tile_width - 2, 0, 2, 15*4, 200, 200, 200, 200); +fillrect(left_offset + (pos_x/32)*mini_tile_width, 15*4-2, 19*mini_tile_width, 2, 200, 200, 200, 200); + +} + void le_drawinterface() { int x,y; @@ -798,6 +834,9 @@ fillrect(0, y*32, screen->w - 32, 1, 225, 225, 225,255); } } + + 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 + le_drawminimap(); if(le_selection_mode == CURSOR) if(le_current.IsTile()) @@ -1353,22 +1392,28 @@ } if(!Menu::current()) { + show_minimap = false; + if(le_move_left_bt->get_state() == BUTTON_PRESSED) { pos_x -= 192; + show_minimap = true; } else if(le_move_left_bt->get_state() == BUTTON_HOVER) { pos_x -= 32; + show_minimap = true; } if(le_move_right_bt->get_state() == BUTTON_PRESSED) { pos_x += 192; + show_minimap = true; } else if(le_move_right_bt->get_state() == BUTTON_HOVER) { pos_x += 32; + show_minimap = true; } } Index: tile.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/tile.cpp,v retrieving revision 1.18 retrieving revision 1.19 diff -u -d -r1.18 -r1.19 --- tile.cpp 3 May 2004 20:35:59 -0000 1.18 +++ tile.cpp 5 May 2004 22:04:48 -0000 1.19 @@ -207,5 +207,29 @@ } } +void +Tile::draw_stretched(float x, float y, int w, int h, unsigned int c, Uint8 alpha) +{ + if (c != 0) + { + Tile* ptile = TileManager::instance()->get(c); + if(ptile) + { + if(ptile->images.size() > 1) + { + ptile->images[( ((global_frame_counter*25) / ptile->anim_speed) % (ptile->images.size()))]->draw_stretched(x,y,w,h, alpha); + } + else if (ptile->images.size() == 1) + { + ptile->images[0]->draw_stretched(x,y, w, h, alpha); + } + else + { + //printf("Tile not dravable %u\n", c); + } + } + } +} + // EOF // Index: texture.h =================================================================== RCS file: /cvsroot/super-tux/supertux/src/texture.h,v retrieving revision 1.21 retrieving revision 1.22 diff -u -d -r1.21 -r1.22 --- texture.h 3 May 2004 20:35:58 -0000 1.21 +++ texture.h 5 May 2004 22:04:48 -0000 1.22 @@ -85,7 +85,8 @@ void draw(float x, float y, Uint8 alpha = 255, bool update = false); void draw_bg(Uint8 alpha = 255, bool update = false); void draw_part(float sx, float sy, float x, float y, float w, float h, Uint8 alpha = 255, bool update = false); - void Surface::resize(int w_, int h_); + void draw_stretched(float x, float y, int w, int h, Uint8 alpha, bool update = false); + void resize(int w_, int h_); }; /** Surface implementation, all implementation have to inherit from @@ -107,6 +108,7 @@ virtual int draw(float x, float y, Uint8 alpha, bool update) = 0; virtual int draw_bg(Uint8 alpha, bool update) = 0; virtual int draw_part(float sx, float sy, float x, float y, float w, float h, Uint8 alpha, bool update) = 0; + virtual int draw_stretched(float x, float y, int w, int h, Uint8 alpha, bool update) = 0; int resize(int w_, int h_); SDL_Surface* get_sdl_surface() const; // @evil@ try to avoid this function @@ -123,6 +125,7 @@ int draw(float x, float y, Uint8 alpha, bool update); int draw_bg(Uint8 alpha, bool update); int draw_part(float sx, float sy, float x, float y, float w, float h, Uint8 alpha, bool update); + int draw_stretched(float x, float y, int w, int h, Uint8 alpha, bool update); }; #ifndef NOOPENGL @@ -140,6 +143,7 @@ int draw(float x, float y, Uint8 alpha, bool update); int draw_bg(Uint8 alpha, bool update); int draw_part(float sx, float sy, float x, float y, float w, float h, Uint8 alpha, bool update); + int draw_stretched(float x, float y, int w, int h, Uint8 alpha, bool update); private: void create_gl(SDL_Surface * surf, GLuint * tex); Index: texture.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/texture.cpp,v retrieving revision 1.20 retrieving revision 1.21 diff -u -d -r1.20 -r1.21 --- texture.cpp 3 May 2004 20:35:58 -0000 1.20 +++ texture.cpp 5 May 2004 22:04:48 -0000 1.21 @@ -237,6 +237,16 @@ } void +Surface::draw_stretched(float x, float y, int w, int h, Uint8 alpha, bool update) +{ + if (impl) + { + if (impl->draw_stretched(x, y, w, h, alpha, update) == -2) + reload(); + } +} + +void Surface::resize(int w_, int h_) { if (impl) @@ -571,6 +581,41 @@ (void) update; // avoid warnings return 0; } + +int +SurfaceOpenGL::draw_stretched(float x, float y, int sw, int sh, Uint8 alpha, bool update) +{ + float pw = power_of_two(int(this->w)); + float ph = power_of_two(int(this->h)); + + glBindTexture(GL_TEXTURE_2D, gl_texture); + + glEnable(GL_BLEND); + glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + + glColor4ub(alpha, alpha, alpha, alpha); + + glEnable(GL_TEXTURE_2D); + + + glBegin(GL_QUADS); + glTexCoord2f(0, 0); + glVertex2f(x, y); + glTexCoord2f((float)w / pw, 0); + glVertex2f(sw+x, y); + glTexCoord2f((float)w / pw, (float)h / ph); glVertex2f((float)sw+x, (float)sh+y); + glVertex2f(sw +x, sh+y); + glTexCoord2f(0, (float)h / ph); + glVertex2f(x, sh+y); + glEnd(); + + glDisable(GL_TEXTURE_2D); + glDisable(GL_BLEND); + + (void) update; // avoid warnings + return 0; +} + #endif SurfaceSDL::SurfaceSDL(SDL_Surface* surf, int use_alpha) @@ -680,6 +725,27 @@ return ret; } +int +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; + dest.h = (int)sh; + + if(alpha != 255) + SDL_SetAlpha(sdl_surface ,SDL_SRCALPHA,alpha); + + int ret = SDL_SoftStretch(sdl_surface, NULL, screen, &dest); + + if (update == UPDATE) + update_rect(screen, dest.x, dest.y, dest.w, dest.h); + + return ret; +} + SurfaceSDL::~SurfaceSDL() {} |
From: Tobias Gl??er <to...@us...> - 2004-05-05 20:05:18
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4552/src Modified Files: button.cpp leveleditor.cpp Log Message: Fixed Objects drag+drop bug. LevelEditor cursor tuning. Index: button.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/button.cpp,v retrieving revision 1.25 retrieving revision 1.26 diff -u -d -r1.25 -r1.26 --- button.cpp 5 May 2004 16:59:41 -0000 1.25 +++ button.cpp 5 May 2004 20:05:09 -0000 1.26 @@ -86,7 +86,7 @@ if(game_object != NULL) { - game_object->draw_on_screen(); + game_object->draw_on_screen(rect.x,rect.y); } if(show_info) Index: leveleditor.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/leveleditor.cpp,v retrieving revision 1.86 retrieving revision 1.87 diff -u -d -r1.86 -r1.87 --- leveleditor.cpp 5 May 2004 16:59:41 -0000 1.86 +++ leveleditor.cpp 5 May 2004 20:05:09 -0000 1.87 @@ -560,6 +560,8 @@ int le_init() { + + level_subsets = dsubdirs("/levels", "info"); le_level_subset = new LevelSubset; @@ -798,7 +800,10 @@ } if(le_selection_mode == CURSOR) - le_selection->draw( cursor_x - scroll_x, cursor_y); + 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; @@ -825,11 +830,9 @@ if(le_current.IsObject()) { le_current.obj->draw_on_screen(19 * 32, 14 * 32); + le_current.obj->draw_on_screen(cursor_x,cursor_y); } - //if(le_current.IsObject()) - //printf(""); - if(le_current_level != NULL) { le_save_level_bt->draw(); @@ -892,9 +895,9 @@ if(le_current.IsTile()) { - Tile::draw(cursor_x, cursor_y,le_current.tile,128); + Tile::draw(cursor_x-pos_x, cursor_y,le_current.tile,128); if(!TileManager::instance()->get(le_current.tile)->images.empty()) - fillrect(cursor_x,cursor_y,TileManager::instance()->get(le_current.tile)->images[0]->w,TileManager::instance()->get(le_current.tile)->images[0]->h,50,50,50,50); + fillrect(cursor_x-pos_x,cursor_y,TileManager::instance()->get(le_current.tile)->images[0]->w,TileManager::instance()->get(le_current.tile)->images[0]->h,50,50,50,50); } if(le_current.IsObject()) { @@ -1282,8 +1285,6 @@ { if(pbutton->get_state() == BUTTON_CLICKED) { - if(le_current.IsObject()) - le_current.obj->move_to(pbutton->get_pos().x,pbutton->get_pos().y); le_current.Tile(pbutton->get_tag()); } } @@ -1294,8 +1295,6 @@ { if(pbutton->get_state() == BUTTON_CLICKED) { - if(le_current.IsObject()) - le_current.obj->move_to(pbutton->get_pos().x,pbutton->get_pos().y); le_current.Object(pbutton->get_game_object()); } } |
From: Tobias Gl??er <to...@us...> - 2004-05-05 16:59:53
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30625/src Modified Files: button.cpp button.h leveleditor.cpp Log Message: LevelEditor tilegroup/object select by wheelup/wheeldown on buttons. Support for WheelUp and WheelDown in Buttons. Index: button.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/button.cpp,v retrieving revision 1.24 retrieving revision 1.25 diff -u -d -r1.24 -r1.25 --- button.cpp 5 May 2004 14:38:12 -0000 1.24 +++ button.cpp 5 May 2004 16:59:41 -0000 1.25 @@ -126,11 +126,21 @@ event.button.y < rect.y || event.button.y >= rect.y + rect.h) return; - if(event.button.button != SDL_BUTTON_LEFT) + if(event.button.button == SDL_BUTTON_RIGHT) { show_info = true; return; } + else if(event.button.button == 4) /* Mouse wheel up. */ + { + state = BUTTON_WHEELUP; + return; + } + else if(event.button.button == 5) /* Mouse wheel down. */ + { + state = BUTTON_WHEELDOWN; + return; + } if(event.type == SDL_MOUSEBUTTONDOWN) state = BUTTON_PRESSED; Index: button.h =================================================================== RCS file: /cvsroot/super-tux/supertux/src/button.h,v retrieving revision 1.19 retrieving revision 1.20 diff -u -d -r1.19 -r1.20 --- button.h 5 May 2004 12:59:18 -0000 1.19 +++ button.h 5 May 2004 16:59:41 -0000 1.20 @@ -28,7 +28,9 @@ BUTTON_NONE = -1, BUTTON_CLICKED, BUTTON_PRESSED, - BUTTON_HOVER + BUTTON_HOVER, + BUTTON_WHEELUP, + BUTTON_WHEELDOWN }; class ButtonPanel; Index: leveleditor.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/leveleditor.cpp,v retrieving revision 1.85 retrieving revision 1.86 diff -u -d -r1.85 -r1.86 --- leveleditor.cpp 5 May 2004 16:07:19 -0000 1.85 +++ leveleditor.cpp 5 May 2004 16:59:41 -0000 1.86 @@ -1184,21 +1184,90 @@ if(le_select_mode_two_bt->get_state() == BUTTON_CLICKED) le_selection_mode = SQUARE; } - + ButtonPanelMap::iterator it; le_tilegroup_bt->event(event); - if(le_tilegroup_bt->get_state() == BUTTON_CLICKED) + switch (le_tilegroup_bt->get_state()) { + case BUTTON_CLICKED: Menu::set_current(select_tilegroup_menu); select_tilegroup_menu_effect.start(200); select_tilegroup_menu->set_pos(screen->w - 64,100,-0.5,0.5); + break; + case BUTTON_WHEELUP: + it = tilegroups_map.find(cur_tilegroup); + if(it == tilegroups_map.end()) + { + cur_tilegroup = tilegroups_map.begin()->first; + cur_objects.clear(); + break; + } + if(++it != tilegroups_map.end()) + cur_tilegroup = (*it).first; + else + cur_tilegroup = tilegroups_map.begin()->first; + + cur_objects.clear(); + break; + case BUTTON_WHEELDOWN: + it = tilegroups_map.find(cur_tilegroup); + if(it == tilegroups_map.begin()) + { + cur_tilegroup = tilegroups_map.rbegin()->first; + cur_objects.clear(); + break; + } + if(--it != --tilegroups_map.begin()) + cur_tilegroup = (*it).first; + else + cur_tilegroup = tilegroups_map.rbegin()->first; + + cur_objects.clear(); + break; + default: + break; } le_objects_bt->event(event); - if(le_objects_bt->get_state() == BUTTON_CLICKED) + switch (le_objects_bt->get_state()) { + case BUTTON_CLICKED: Menu::set_current(select_objects_menu); select_objects_menu_effect.start(200); select_objects_menu->set_pos(screen->w - 64,100,-0.5,0.5); + break; + case BUTTON_WHEELUP: + it = objects_map.find(cur_objects); + if(it == objects_map.end()) + { + cur_objects = objects_map.begin()->first; + cur_tilegroup.clear(); + break; + } + if(++it != objects_map.end()) + cur_objects = (*it).first; + else + cur_objects = objects_map.begin()->first; + + cur_tilegroup.clear(); + break; + case BUTTON_WHEELDOWN: + it = objects_map.find(cur_objects); + if(it == objects_map.begin()) + { + cur_objects = objects_map.rbegin()->first; + cur_tilegroup.clear(); + break; + } + if(--it != --objects_map.begin()) + cur_objects = (*it).first; + else + cur_objects = objects_map.rbegin()->first; + + cur_tilegroup.clear(); + break; + break; + default: + break; } le_settings_bt->event(event); @@ -1278,7 +1347,7 @@ le_current_level->badguy_data.push_back(&le_world.bad_guys.back()); } } - le_mouse_clicked[LEFT] = false; + le_mouse_clicked[LEFT] = false; } } } |
From: Ricardo C. <rm...@us...> - 2004-05-05 16:07:28
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18303/src Modified Files: globals.cpp globals.h leveleditor.cpp leveleditor.h setup.cpp supertux.cpp title.cpp Log Message: Made leveleditor to start in a specific file when ran as: supertux --leveleditor levelname.stl Unfortanely, it crashes when creating the Objects menu. I don't think it is related with my code, so here is the commit. Index: setup.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/setup.cpp,v retrieving revision 1.69 retrieving revision 1.70 diff -u -d -r1.69 -r1.70 --- setup.cpp 4 May 2004 11:27:47 -0000 1.69 +++ setup.cpp 5 May 2004 16:07:19 -0000 1.70 @@ -969,9 +969,9 @@ << " Start-Button: " << joystick_keymap.start_button << std::endl; } } - else if (strcmp(argv[i], "--worldmap") == 0) + else if (strcmp(argv[i], "--leveleditor") == 0) { - launch_worldmap_mode = true; + launch_leveleditor_mode = true; } else if (strcmp(argv[i], "--datadir") == 0 || strcmp(argv[i], "-d") == 0 ) Index: globals.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/globals.cpp,v retrieving revision 1.17 retrieving revision 1.18 diff -u -d -r1.17 -r1.18 --- globals.cpp 20 Apr 2004 17:31:11 -0000 1.17 +++ globals.cpp 5 May 2004 16:07:19 -0000 1.18 @@ -58,7 +58,7 @@ int joystick_num = 0; char* level_startup_file = 0; -bool launch_worldmap_mode = false; +bool launch_leveleditor_mode = false; /* SuperTux directory ($HOME/.supertux) and save directory($HOME/.supertux/save) */ char *st_dir, *st_save_dir; Index: globals.h =================================================================== RCS file: /cvsroot/super-tux/supertux/src/globals.h,v retrieving revision 1.27 retrieving revision 1.28 diff -u -d -r1.27 -r1.28 --- globals.h 20 Apr 2004 16:25:57 -0000 1.27 +++ globals.h 5 May 2004 16:07:19 -0000 1.28 @@ -67,7 +67,7 @@ /** The number of the joystick that will be use in the game */ extern int joystick_num; extern char* level_startup_file; -extern bool launch_worldmap_mode; +extern bool launch_leveleditor_mode; /* SuperTux directory ($HOME/.supertux) and save directory($HOME/.supertux/save) */ extern char* st_dir; Index: title.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/title.cpp,v retrieving revision 1.77 retrieving revision 1.78 diff -u -d -r1.77 -r1.78 --- title.cpp 4 May 2004 18:58:51 -0000 1.77 +++ title.cpp 5 May 2004 16:07:20 -0000 1.78 @@ -299,7 +299,7 @@ generate_contrib_menu(); break; case MNID_LEVELEDITOR: - leveleditor(1); + leveleditor(); Menu::set_current(main_menu); break; case MNID_CREDITS: Index: leveleditor.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/leveleditor.cpp,v retrieving revision 1.84 retrieving revision 1.85 diff -u -d -r1.84 -r1.85 --- leveleditor.cpp 5 May 2004 14:38:12 -0000 1.84 +++ leveleditor.cpp 5 May 2004 16:07:19 -0000 1.85 @@ -66,6 +66,7 @@ /* crutial ones (main loop) */ int le_init(); void le_quit(); +int le_load_level(char *filename); void le_drawlevel(); void le_drawinterface(); void le_checkevents(); @@ -183,11 +184,12 @@ } } -int leveleditor(int levelnb) +int leveleditor(char* filename) { int last_time, now_time, i; - le_level = levelnb; + le_level = 1; + if(le_init() != 0) return 1; @@ -201,6 +203,10 @@ while (SDL_PollEvent(&event)) {} + if(filename != NULL) + if(le_load_level(filename)) + return 1; + while(true) { last_time = SDL_GetTicks(); @@ -322,22 +328,8 @@ default: if(i >= 1) { - le_level_subset->load(level_subsets.item[i-1]); - leveleditor_menu->get_item_by_id(MNID_SUBSETSETTINGS).kind = MN_GOTO; - le_level = 1; - le_world.arrays_free(); - delete le_current_level; - le_current_level = new Level; - if(le_current_level->load(le_level_subset->name, le_level) != 0) - { - le_quit(); - return 1; - } - le_set_defaults(); - le_current_level->load_gfx(); - le_world.activate_bad_guys(); - - Menu::set_current(NULL); + if(le_load_level(level_subsets.item[i-1])) + return 1; } break; } @@ -413,6 +405,27 @@ return done; } +int le_load_level(char *filename) +{ +le_level_subset->load(filename); +leveleditor_menu->get_item_by_id(MNID_SUBSETSETTINGS).kind = MN_GOTO; +le_level = 1; +le_world.arrays_free(); +delete le_current_level; +le_current_level = new Level; +if(le_current_level->load(le_level_subset->name, le_level) != 0) + { + le_quit(); + return 1; + } +le_set_defaults(); +le_current_level->load_gfx(); +le_world.activate_bad_guys(); + +Menu::set_current(NULL); + +return 0; +} void le_init_menus() { @@ -599,6 +612,7 @@ SDL_EnableKeyRepeat(SDL_DEFAULT_REPEAT_DELAY, SDL_DEFAULT_REPEAT_INTERVAL); + return 0; } Index: supertux.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/supertux.cpp,v retrieving revision 1.15 retrieving revision 1.16 diff -u -d -r1.15 -r1.16 --- supertux.cpp 28 Apr 2004 13:18:54 -0000 1.15 +++ supertux.cpp 5 May 2004 16:07:20 -0000 1.16 @@ -46,10 +46,9 @@ st_menu(); loadshared(); - if (launch_worldmap_mode) + if (launch_leveleditor_mode && level_startup_file) { - WorldMapNS::WorldMap worldmap; - worldmap.display(); + leveleditor(level_startup_file); } else if (level_startup_file) { Index: leveleditor.h =================================================================== RCS file: /cvsroot/super-tux/supertux/src/leveleditor.h,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- leveleditor.h 20 Apr 2004 11:09:34 -0000 1.7 +++ leveleditor.h 5 May 2004 16:07:19 -0000 1.8 @@ -34,7 +34,7 @@ SQUARE }; -int leveleditor(int levelnb); +int leveleditor(char* filename = NULL); void newlevel(void); void selectlevel(void); void le_savelevel(); |
From: Ingo R. <gr...@us...> - 2004-05-05 15:33:42
|
Update of /cvsroot/super-tux/htdocs/milestone2 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10407/milestone2 Added Files: index.xml submenu.xml Log Message: - added some milestone2 goals --- NEW FILE: index.xml --- <?xml version="1.0"?> <page title="SuperTux - Milestone 2 - Version 0.2.0"> <section title="Milestone 2 Goals"> <p> Now that Milestone1 is out and up and running, its time to take some preperations for Milestone2. Goals should of course include: </p> <ul> <li>new enemies</li> <li>at least one new tileset</li> <li>15-30 new levels</li> </ul> <p> However that are of course just generic goals that pretty much apply to any Milestone, more detail goals follow below and will be extented and refined over the comming month: </p> <ul> <li>intelligent horizontal and vertical scrolling as seen in most later jump'n runs, which means tha camera should automatically change the viewpoint so that the player has a good view onto things that are comming onto him, it should also be possible for the player to manually turn the camera to move to the left/right, the camera should also be sensitive to the speed of the player, so if he runs fast the camera should give more to see infront of the player, then when walking at normal speed, Yoshi Island demonstrates this camera behaviour quite well </li> <li> together with vertical scrolling levels of course should have both variable heights and width </li> <li> parallax scrolling backgrounds should be build out of tiles instead of plain huge jpg/png graphics, multilpe configurable background layers would be good as well (ie. gradient, parallax tilemap 1, parallax tilemap 2, playfield bg, interactive playfield, playfield fg, parallax tilemap foreground) </li> <li> the game should support sublevels, so that one can walk through pipes or doors to enter other sections of a level </li> <li> butt-jump as described on the development page should be implemented, in addition to that there would be a need for a new tiletype that reacts on a butt-jump and gets smashed </li> <li> flaping as described on the described should be implemented, it should basically provide the player with an additional 'up boost' in the down-phase of a jump and giving him more ability to land precisly. </li> <li> one-tile problem should be fixed, meaning Tux should be able to fall through small 1 tile wide holes, instead of just walking over them, this could/should be fixed by the use collision/tile shapes that are not rects, but rects with round edges or elipses </li> <li> Tux should be able to jump again/bounce while jumping on an enemy (ie. by holding down the jump button), this is standard Mario behaviour </li> <li> non-square tiles, as the ones used for sliding would be good to have, sliding itself isn't strictly necessary for Milestone2, could be suspended for Milestone3 </li> <li> At least one final boss is a minimum for this release, a second mini-boss would be good as well. </li> <li> info-boxes that present a dialog-window on jump would be good to teach the player new moves and actions </li> <li> multilanguage support (via gettext or such) might be good with the number of text increasing </li> <li> ice and fireflower should get more specifc meaning and abilities </li> </ul> </section> </page> --- NEW FILE: submenu.xml --- <?xml version="1.0"?> <submenu> <item file="index.html">Introduction</item> </submenu> |
From: Ingo R. <gr...@us...> - 2004-05-05 15:33:42
|
Update of /cvsroot/super-tux/htdocs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10407 Modified Files: Makefile default.xsl menu.xml Log Message: - added some milestone2 goals Index: menu.xml =================================================================== RCS file: /cvsroot/super-tux/htdocs/menu.xml,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- menu.xml 2 May 2004 21:36:11 -0000 1.3 +++ menu.xml 5 May 2004 15:33:33 -0000 1.4 @@ -3,6 +3,7 @@ <menu> <item section="." file="welcome.html">SuperTux</item> <item section="milestone1" file="milestone1/index.html">Milestone1</item> + <item section="milestone2" file="milestone2/index.html">Milestone2</item> <item section="development" file="development/index.html">Development</item> <item section="sfnet" file="http://sourceforge.net/projects/super-tux/">SF.Net</item> </menu> Index: Makefile =================================================================== RCS file: /cvsroot/super-tux/htdocs/Makefile,v retrieving revision 1.15 retrieving revision 1.16 diff -u -d -r1.15 -r1.16 --- Makefile 3 May 2004 15:40:19 -0000 1.15 +++ Makefile 5 May 2004 15:33:33 -0000 1.16 @@ -12,6 +12,8 @@ development/actions.html \ development/enemies.html \ \ + milestone2/index.html \ + \ milestone1/index.html \ milestone1/levels.html \ milestone1/music.html \ @@ -52,8 +54,6 @@ mkdir -p output/milestone1/images/ cp -v output/welcome.html output/index.html cp -v default.css output/ - cp -v default.css output/development/ - cp -v default.css output/milestone1/ cp -v images/*.jpg output/images/ cp -v images/*.png output/images/ cp -v milestone1/images/*.jpg output/milestone1/images/ Index: default.xsl =================================================================== RCS file: /cvsroot/super-tux/htdocs/default.xsl,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- default.xsl 2 May 2004 21:36:11 -0000 1.9 +++ default.xsl 5 May 2004 15:33:33 -0000 1.10 @@ -26,7 +26,7 @@ <html> <head> <title>SuperTux</title> - <link rel="stylesheet" type="text/css" href="default.css" /> + <link rel="stylesheet" type="text/css" href="{$basedir}default.css" /> <link rel="icon" href="images/favicon.png" type="image/png" /> </head> |
From: Ingo R. <gr...@us...> - 2004-05-05 15:33:18
|
Update of /cvsroot/super-tux/htdocs/milestone2 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10260/milestone2 Log Message: Directory /cvsroot/super-tux/htdocs/milestone2 added to the repository |
From: Tobias Gl??er <to...@us...> - 2004-05-05 14:38:20
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30361/src Modified Files: button.cpp leveleditor.cpp Log Message: Adding Objects works through clicking instead pressing now. Index: button.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/button.cpp,v retrieving revision 1.23 retrieving revision 1.24 diff -u -d -r1.23 -r1.24 --- button.cpp 5 May 2004 12:59:18 -0000 1.23 +++ button.cpp 5 May 2004 14:38:12 -0000 1.24 @@ -188,7 +188,6 @@ rect.h = h; hidden = false; hlast = false; - //last_clicked(NULL); } Button* ButtonPanel::event(SDL_Event& event) Index: leveleditor.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/leveleditor.cpp,v retrieving revision 1.83 retrieving revision 1.84 diff -u -d -r1.83 -r1.84 --- leveleditor.cpp 5 May 2004 12:59:18 -0000 1.83 +++ leveleditor.cpp 5 May 2004 14:38:12 -0000 1.84 @@ -137,6 +137,7 @@ static int done; static TileOrObject le_current; static bool le_mouse_pressed[2]; +static bool le_mouse_clicked[2]; static Button* le_save_level_bt; static Button* le_exit_bt; static Button* le_test_level_bt; @@ -385,7 +386,6 @@ { case MNID_SUBSETSAVECHANGES: save_subset_settings_menu(); - //FIXME:show_menu = true; Menu::set_current(leveleditor_menu); break; } @@ -470,11 +470,11 @@ 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_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,"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); @@ -509,7 +509,7 @@ else if(!TileManager::instance()->get(*sit)->editor_filenames.empty()) { imagefile += TileManager::instance()->get(*sit)->editor_filenames[0]; - only_editor_image = true; + only_editor_image = true; } else { @@ -518,11 +518,11 @@ 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); - } + 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); } } @@ -563,6 +563,9 @@ le_mouse_pressed[LEFT] = false; le_mouse_pressed[RIGHT] = false; + le_mouse_clicked[LEFT] = false; + le_mouse_clicked[RIGHT] = false; + le_selection = new Surface(datadir + "/images/leveleditor/select.png", USE_ALPHA); select_tilegroup_menu_effect.init(false); @@ -589,9 +592,9 @@ 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_current.Init(); - + le_init_menus(); SDL_EnableKeyRepeat(SDL_DEFAULT_REPEAT_DELAY, SDL_DEFAULT_REPEAT_INTERVAL); @@ -662,7 +665,7 @@ le_current_level->bkgd_image = string_list_active(level_settings_menu->get_item_by_id(MNID_BGIMG).list); i = true; } - + if(le_current_level->particle_system.compare(string_list_active(level_settings_menu->get_item_by_id(MNID_PARTICLE).list)) != 0) { le_current_level->particle_system = string_list_active(level_settings_menu->get_item_by_id(MNID_PARTICLE).list); @@ -807,7 +810,7 @@ } if(le_current.IsObject()) { - le_current.obj->draw_on_screen(19 * 32, 14 * 32); + le_current.obj->draw_on_screen(19 * 32, 14 * 32); } //if(le_current.IsObject()) @@ -872,16 +875,16 @@ { drawgradient(le_current_level->bkgd_top, le_current_level->bkgd_bottom); } - + if(le_current.IsTile()) { - Tile::draw(cursor_x, cursor_y,le_current.tile,128); - if(!TileManager::instance()->get(le_current.tile)->images.empty()) - fillrect(cursor_x,cursor_y,TileManager::instance()->get(le_current.tile)->images[0]->w,TileManager::instance()->get(le_current.tile)->images[0]->h,50,50,50,50); + Tile::draw(cursor_x, cursor_y,le_current.tile,128); + if(!TileManager::instance()->get(le_current.tile)->images.empty()) + fillrect(cursor_x,cursor_y,TileManager::instance()->get(le_current.tile)->images[0]->w,TileManager::instance()->get(le_current.tile)->images[0]->h,50,50,50,50); } if(le_current.IsObject()) { - le_current.obj->move_to(cursor_x, cursor_y); + le_current.obj->move_to(cursor_x, cursor_y); } /* clearscreen(current_level.bkgd_red, current_level.bkgd_green, current_level.bkgd_blue); */ @@ -1053,9 +1056,15 @@ break; case SDL_MOUSEBUTTONUP: if(event.button.button == SDL_BUTTON_LEFT) + { le_mouse_pressed[LEFT] = false; + le_mouse_clicked[LEFT] = true; + } else if(event.button.button == SDL_BUTTON_RIGHT) + { le_mouse_pressed[RIGHT] = false; + le_mouse_clicked[RIGHT] = true; + } break; case SDL_MOUSEMOTION: @@ -1190,8 +1199,8 @@ { if(pbutton->get_state() == BUTTON_CLICKED) { - if(le_current.IsObject()) - le_current.obj->move_to(pbutton->get_pos().x,pbutton->get_pos().y); + if(le_current.IsObject()) + le_current.obj->move_to(pbutton->get_pos().x,pbutton->get_pos().y); le_current.Tile(pbutton->get_tag()); } } @@ -1202,8 +1211,8 @@ { if(pbutton->get_state() == BUTTON_CLICKED) { - if(le_current.IsObject()) - le_current.obj->move_to(pbutton->get_pos().x,pbutton->get_pos().y); + if(le_current.IsObject()) + le_current.obj->move_to(pbutton->get_pos().x,pbutton->get_pos().y); le_current.Object(pbutton->get_game_object()); } } @@ -1241,7 +1250,10 @@ { if(le_current.IsTile()) le_change(cursor_x, cursor_y, active_tm, le_current.tile); - else if(le_current.IsObject()) + } + else if(le_mouse_clicked[LEFT]) + { + if(le_current.IsObject()) { std::string type = le_current.obj->type(); if(type == "BadGuy") @@ -1252,6 +1264,7 @@ le_current_level->badguy_data.push_back(&le_world.bad_guys.back()); } } + le_mouse_clicked[LEFT] = false; } } } |
From: Tobias Gl??er <to...@us...> - 2004-05-05 13:15:44
|
Update of /cvsroot/super-tux/supertux/data/levels/world1 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11390/data/levels/world1 Modified Files: level4.stl Log Message: well, actually I created this ... not that wonderful level for 0.0.5 ;) Index: level4.stl =================================================================== RCS file: /cvsroot/super-tux/supertux/data/levels/world1/level4.stl,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- level4.stl 1 May 2004 12:06:54 -0000 1.11 +++ level4.stl 5 May 2004 13:15:35 -0000 1.12 @@ -1,8 +1,8 @@ ;; Generated by Flexlay Editor (supertux-level (version 1) - (author "Bill Kendrick") - (name "Kendrick Road") + (author "Tobias Glaesser") + (name "Tobgle Road") (width 270) (height 15) (start_pos_x 100) |
From: Tobias Gl??er <to...@us...> - 2004-05-05 12:59:28
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8332/src Modified Files: button.cpp button.h leveleditor.cpp Log Message: a ButtonPanel is able to highlight the last clicked/activated item now. A double/tripple shortcut was replaced in the leveleditor. Index: button.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/button.cpp,v retrieving revision 1.22 retrieving revision 1.23 diff -u -d -r1.22 -r1.23 --- button.cpp 4 May 2004 22:16:11 -0000 1.22 +++ button.cpp 5 May 2004 12:59:18 -0000 1.23 @@ -187,6 +187,8 @@ rect.w = w; rect.h = h; hidden = false; + hlast = false; + //last_clicked(NULL); } Button* ButtonPanel::event(SDL_Event& event) @@ -197,7 +199,11 @@ { (*it)->event(event); if((*it)->state != BUTTON_NONE) + { + if(hlast && (*it)->state == BUTTON_CLICKED) + last_clicked = it; return (*it); + } } return NULL; } @@ -225,6 +231,10 @@ for(std::vector<Button*>::iterator it = item.begin(); it != item.end(); ++it) { (*it)->draw(); + if(hlast && it == last_clicked) + { + fillrect((*it)->get_pos().x,(*it)->get_pos().y,(*it)->get_pos().w,(*it)->get_pos().h,100,100,100,128); + } } } } @@ -261,3 +271,10 @@ else return item[i]; } + +void ButtonPanel::highlight_last(bool b) +{ +hlast = b; +} + + Index: button.h =================================================================== RCS file: /cvsroot/super-tux/supertux/src/button.h,v retrieving revision 1.18 retrieving revision 1.19 diff -u -d -r1.18 -r1.19 --- button.h 4 May 2004 22:16:11 -0000 1.18 +++ button.h 5 May 2004 12:59:18 -0000 1.19 @@ -72,12 +72,15 @@ Button* button_panel_event(SDL_Event& event); void set_button_size(int w, int h); Button* manipulate_button(int i); + void highlight_last(bool b); private: int bw, bh; + bool hlast; bool hidden; SDL_Rect rect; std::vector<Button*> item; + std::vector<Button*>::iterator last_clicked; }; #endif /*SUPERTUX_BUTTON_H*/ Index: leveleditor.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/leveleditor.cpp,v retrieving revision 1.82 retrieving revision 1.83 diff -u -d -r1.82 -r1.83 --- leveleditor.cpp 5 May 2004 12:27:51 -0000 1.82 +++ leveleditor.cpp 5 May 2004 12:59:18 -0000 1.83 @@ -485,7 +485,7 @@ level_settings_menu->additem(MN_ACTION,"Apply Changes",0,0,MNID_APPLY); select_tilegroup_menu->arrange_left = true; - select_tilegroup_menu->additem(MN_LABEL,"Select Tilegroup",0,0); + select_tilegroup_menu->additem(MN_LABEL,"Tilegroup",0,0); select_tilegroup_menu->additem(MN_HL,"",0,0); std::vector<TileGroup>* tilegroups = TileManager::tilegroups(); int tileid = 1; @@ -529,7 +529,7 @@ select_tilegroup_menu->additem(MN_HL,"",0,0); select_objects_menu->arrange_left = true; - select_objects_menu->additem(MN_LABEL,"Select Objects",0,0); + select_objects_menu->additem(MN_LABEL,"Objects",0,0); select_objects_menu->additem(MN_HL,"",0,0); select_objects_menu->additem(MN_ACTION,"BadGuys",0,0,1); objects_map["BadGuys"] = new ButtonPanel(screen->w - 64,96, 64, 318); @@ -585,9 +585,10 @@ le_tilemap_panel = new ButtonPanel(screen->w-64,screen->h-32,32,32); le_tilemap_panel->set_button_size(32,10); - le_tilemap_panel->additem(new Button("/images/icons/bkgrd.png","Background",SDLK_F4,0,0),TM_BG); - le_tilemap_panel->additem(new Button("/images/icons/intact.png","Interactive",SDLK_F4,0,0),TM_IA); - le_tilemap_panel->additem(new Button("/images/icons/frgrd.png","Foreground",SDLK_F4,0,0),TM_FG); + le_tilemap_panel->additem(new Button("/images/icons/bkgrd.png","Background",SDLK_b,0,0),TM_BG); + 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_current.Init(); |
From: Tobias Gl??er <to...@us...> - 2004-05-05 12:27:59
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31961/src Modified Files: leveleditor.cpp Log Message: fixed a crash when creating a new levelsubset in the editor Index: leveleditor.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/leveleditor.cpp,v retrieving revision 1.81 retrieving revision 1.82 diff -u -d -r1.81 -r1.82 --- leveleditor.cpp 4 May 2004 22:16:11 -0000 1.81 +++ leveleditor.cpp 5 May 2004 12:27:51 -0000 1.82 @@ -449,7 +449,7 @@ subset_new_menu->additem(MN_LABEL,"New Level Subset",0,0); subset_new_menu->additem(MN_HL,"",0,0); - subset_new_menu->additem(MN_TEXTFIELD,"Enter Name",0,0); + subset_new_menu->additem(MN_TEXTFIELD,"Enter Name",0,0,MNID_SUBSETNAME); subset_new_menu->additem(MN_ACTION,"Create",0,0, MNID_CREATESUBSET); subset_new_menu->additem(MN_HL,"",0,0); subset_new_menu->additem(MN_BACK,"Back",0,0); |
From: Ricardo C. <rm...@us...> - 2004-05-05 12:04:00
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27218/src Modified Files: world.cpp Log Message: Just tuned the X_SPACE, so that Tux position in screen is exactly the same as before. Check and remove the TODO point, in case you agree. Index: world.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/world.cpp,v retrieving revision 1.61 retrieving revision 1.62 diff -u -d -r1.61 -r1.62 --- world.cpp 5 May 2004 04:04:05 -0000 1.61 +++ world.cpp 5 May 2004 12:03:50 -0000 1.62 @@ -311,7 +311,7 @@ // the space that it takes for the screen to start scrolling, regarding // screen bounds (in pixels) -#define X_SPACE 380 +#define X_SPACE (400-16) // the time it takes to move the camera (in ms) #define CHANGE_DIR_SCROLL_SPEED 2000 |
From: Duong-Khang N. <neo...@us...> - 2004-05-05 11:08:31
|
Update of /cvsroot/super-tux/supertux/data In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14964/data Modified Files: Makefile.am Log Message: images/icon.png in Makefile.am removed as requested by Ricardo Cruz Index: Makefile.am =================================================================== RCS file: /cvsroot/super-tux/supertux/data/Makefile.am,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- Makefile.am 29 Apr 2004 13:30:37 -0000 1.10 +++ Makefile.am 5 May 2004 11:08:16 -0000 1.11 @@ -4,7 +4,6 @@ extro.txt \ CREDITS \ $(wildcard sounds/*.wav) \ - images/icon.png \ images/icon.xpm \ $(wildcard images/*.png) \ $(wildcard images/*.xpm) \ |
From: Ryan F. <sik...@us...> - 2004-05-05 04:04:13
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6096 Modified Files: world.cpp Log Message: - fixed scrolling past level bug Index: world.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/world.cpp,v retrieving revision 1.60 retrieving revision 1.61 diff -u -d -r1.60 -r1.61 --- world.cpp 5 May 2004 02:59:27 -0000 1.60 +++ world.cpp 5 May 2004 04:04:05 -0000 1.61 @@ -371,8 +371,8 @@ // this code prevent the screen to scroll before the start or after the level's end if(scroll_x < 0) scroll_x = 0; - if(scroll_x > (level->width-1) * 32) - scroll_x = (level->width-1) * 32; + if(scroll_x > level->width * 32 - screen->w) + scroll_x = level->width * 32 - screen->w; } void |
From: Ryan F. <sik...@us...> - 2004-05-05 02:59:35
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27409 Modified Files: world.cpp Log Message: - fixed the part of backscrolling that a broke. Backscrolling still needs some work. Index: world.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/world.cpp,v retrieving revision 1.59 retrieving revision 1.60 diff -u -d -r1.59 -r1.60 --- world.cpp 4 May 2004 23:39:40 -0000 1.59 +++ world.cpp 5 May 2004 02:59:27 -0000 1.60 @@ -320,25 +320,51 @@ { int tux_pos_x = (int)(tux.base.x + (tux.base.width/2)); - if(tux.old_dir != tux.dir && (level->back_scrolling || debug_mode)) - scrolling_timer.start(CHANGE_DIR_SCROLL_SPEED); - - if(scrolling_timer.check()) + if (level->back_scrolling || debug_mode) + { + if(tux.old_dir != tux.dir && level->back_scrolling) + scrolling_timer.start(CHANGE_DIR_SCROLL_SPEED); + + if(scrolling_timer.check()) { - float final_scroll_x; - if (tux.physic.get_velocity_x() > 0) - final_scroll_x = tux_pos_x - (screen->w - X_SPACE); - else if (tux.physic.get_velocity_x() < 0) - final_scroll_x = tux_pos_x - X_SPACE; + float final_scroll_x; + if (tux.physic.get_velocity_x() > 0) + final_scroll_x = tux_pos_x - (screen->w - X_SPACE); + else if (tux.physic.get_velocity_x() < 0) + final_scroll_x = tux_pos_x - X_SPACE; + else + { + if (tux.dir == RIGHT) + final_scroll_x = tux_pos_x - (screen->w - X_SPACE); + else if (tux.dir == LEFT && level->back_scrolling) + final_scroll_x = tux_pos_x - X_SPACE; + } + + scroll_x += (final_scroll_x - scroll_x) / (frame_ratio * (CHANGE_DIR_SCROLL_SPEED / 100)); + // std::cerr << tux_pos_x << " " << final_scroll_x << " " << scroll_x << std::endl; - scroll_x += ((final_scroll_x - scroll_x) / (CHANGE_DIR_SCROLL_SPEED)) * frame_ratio; } + else + { + if (tux.physic.get_velocity_x() > 0 && scroll_x < tux_pos_x - (screen->w - X_SPACE)) + scroll_x = tux_pos_x - (screen->w - X_SPACE); + else if (tux.physic.get_velocity_x() < 0 && scroll_x > tux_pos_x - X_SPACE && level->back_scrolling) + scroll_x = tux_pos_x - X_SPACE; + else + { + if (tux.dir == RIGHT && scroll_x < tux_pos_x - (screen->w - X_SPACE)) + scroll_x = tux_pos_x - (screen->w - X_SPACE); + else if (tux.dir == LEFT && scroll_x > tux_pos_x - X_SPACE && level->back_scrolling) + scroll_x = tux_pos_x - X_SPACE; + } + } + } - else + else /*no debug*/ { if (tux.physic.get_velocity_x() > 0 && scroll_x < tux_pos_x - (screen->w - X_SPACE)) scroll_x = tux_pos_x - (screen->w - X_SPACE); - else if (tux.physic.get_velocity_x() < 0 && scroll_x > tux_pos_x - X_SPACE && (level->back_scrolling || debug_mode)) + else if (tux.physic.get_velocity_x() < 0 && scroll_x > tux_pos_x - X_SPACE && level->back_scrolling) scroll_x = tux_pos_x - X_SPACE; } |
From: Ryan F. <sik...@us...> - 2004-05-04 23:39:48
|
Update of /cvsroot/super-tux/supertux In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23974 Modified Files: TODO Log Message: - fixed small scrolling bug - added screwed up backscroll to TODO Index: TODO =================================================================== RCS file: /cvsroot/super-tux/supertux/TODO,v retrieving revision 1.35 retrieving revision 1.36 diff -u -d -r1.35 -r1.36 --- TODO 4 May 2004 21:54:42 -0000 1.35 +++ TODO 4 May 2004 23:39:40 -0000 1.36 @@ -11,14 +11,13 @@ H: high priority L: low priority -[H] Scrolling is broken, if you fastly reverse around the middle of the screen - the scrolling has sudden hickups. Also the scrollstart position still isn't - the same as before the changes. +[H] The scrollstart position still isn't the same as before the changes. [H] Frame ratio code has been changed and so the animation may need tuning. Somebody do some testing and change the definitions regarding this. [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] Backscroll is really messed up right now :) [L] change lispreader to throw exceptions instead of simply assert() on syntax error [L] tux sometimes makes short jumps in the endsequence, mostly when |
From: Ryan F. <sik...@us...> - 2004-05-04 23:39:48
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23974/src Modified Files: world.cpp Log Message: - fixed small scrolling bug - added screwed up backscroll to TODO Index: world.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/world.cpp,v retrieving revision 1.58 retrieving revision 1.59 diff -u -d -r1.58 -r1.59 --- world.cpp 4 May 2004 19:12:39 -0000 1.58 +++ world.cpp 4 May 2004 23:39:40 -0000 1.59 @@ -326,9 +326,9 @@ if(scrolling_timer.check()) { float final_scroll_x; - if (tux.dir == RIGHT) + if (tux.physic.get_velocity_x() > 0) final_scroll_x = tux_pos_x - (screen->w - X_SPACE); - else// if (tux.dir == LEFT)// && ) + else if (tux.physic.get_velocity_x() < 0) final_scroll_x = tux_pos_x - X_SPACE; scroll_x += ((final_scroll_x - scroll_x) / (CHANGE_DIR_SCROLL_SPEED)) * frame_ratio; @@ -336,9 +336,9 @@ else { - if (tux.dir == RIGHT && scroll_x < tux_pos_x - (screen->w - X_SPACE)) + if (tux.physic.get_velocity_x() > 0 && scroll_x < tux_pos_x - (screen->w - X_SPACE)) scroll_x = tux_pos_x - (screen->w - X_SPACE); - else if (tux.dir == LEFT && scroll_x > tux_pos_x - X_SPACE && (level->back_scrolling || debug_mode)) + else if (tux.physic.get_velocity_x() < 0 && scroll_x > tux_pos_x - X_SPACE && (level->back_scrolling || debug_mode)) scroll_x = tux_pos_x - X_SPACE; } |
From: Ricardo C. <rm...@us...> - 2004-05-04 22:49:46
|
Update of /cvsroot/super-tux/supertux/data/levels/misc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15712/data/levels/misc Modified Files: menu.stl Log Message: Made intro demo to use the ordinary background (arctis2.jpg). Anyway, shouldn't a PNG file be preferible... Index: menu.stl =================================================================== RCS file: /cvsroot/super-tux/supertux/data/levels/misc/menu.stl,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- menu.stl 4 May 2004 19:12:38 -0000 1.4 +++ menu.stl 4 May 2004 22:49:38 -0000 1.5 @@ -4,7 +4,7 @@ (name "Hello World") (width 300) (height 15) - (background "arctis.png") + (background "arctis2.jpg") (music "theme.mod") (bkgd_red 150) (bkgd_green 200) |