super-tux-commit Mailing List for Super Tux (Page 15)
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: Matze B. <mat...@us...> - 2004-11-26 14:46:13
|
Update of /cvsroot/super-tux/supertux/lib/special In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31955/lib/special Modified Files: sprite.cpp Log Message: some cleanups memory leak fixes and moving of source files Index: sprite.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/lib/special/sprite.cpp,v retrieving revision 1.34 retrieving revision 1.35 diff -u -d -r1.34 -r1.35 --- sprite.cpp 26 Nov 2004 13:56:30 -0000 1.34 +++ sprite.cpp 26 Nov 2004 14:45:31 -0000 1.35 @@ -87,7 +87,7 @@ frame += frame_inc; - if(frame > get_frames()) { + if(frame >= get_frames()) { frame = fmodf(frame+get_frames(), get_frames()); animation_loops--; |
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31955/src Modified Files: gameloop.cpp level.cpp level.h leveleditor.cpp leveleditor.h misc.h resources.cpp sector.cpp sector.h supertux.cpp title.cpp Removed Files: background.cpp background.h camera.cpp camera.h gameobjs.cpp gameobjs.h particlesystem.cpp particlesystem.h player.cpp player.h tilemap.cpp tilemap.h Log Message: some cleanups memory leak fixes and moving of source files --- tilemap.cpp DELETED --- --- background.h DELETED --- Index: leveleditor.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/leveleditor.cpp,v retrieving revision 1.170 retrieving revision 1.171 diff -u -d -r1.170 -r1.171 --- leveleditor.cpp 23 Nov 2004 22:21:51 -0000 1.170 +++ leveleditor.cpp 26 Nov 2004 14:45:32 -0000 1.171 @@ -31,13 +31,13 @@ #include "leveleditor.h" #include "resources.h" #include "tile.h" -#include "tilemap.h" #include "tile_manager.h" #include "sector.h" -#include "background.h" #include "gameloop.h" -#include "gameobjs.h" -#include "camera.h" +#include "object/gameobjs.h" +#include "object/camera.h" +#include "object/tilemap.h" +#include "object/background.h" LevelEditor::LevelEditor() { @@ -288,7 +288,9 @@ level_subset->description = create_subset_menu->get_item_by_id(MN_ID_DESCRIPTION_SUBSET).input; //FIXME: generate better level filenames level_subset->add_level(subset_name+'/'+"new_level.stl"); - Level::create(level_subset->get_level_filename(0)); + Level* newlevel = new Level(); + newlevel->add_sector(create_sector("main", 25, 19)); + newlevel->save(level_subset->get_level_filename(0)); level_subset->save(); load_level(0); @@ -368,7 +370,9 @@ if(confirm_dialog(NULL, str)) { level_subset->add_level("new_level.stl"); - Level::create(level_subset->get_level_filename(level_nb + 1)); + Level* newlevel = new Level(); + newlevel->add_sector(create_sector("main", 25, 19)); + newlevel->save(level_subset->get_level_filename(level_nb + 1)); level_subset->save(); load_level(level_nb + 1); } @@ -780,7 +784,7 @@ { if(!confirm_dialog(NULL, _("No more sectors exist. Create another?"))) return; - sector_ = Sector::create("new_sector",25,19); + sector_ = create_sector("new_sector",25,19); level->add_sector(sector_); } @@ -1033,3 +1037,19 @@ show_grid = show_grid_t; mouse_cursor->set_state(MC_NORMAL); } + +Sector* +LevelEditor::create_sector(const std::string& name, size_t width, size_t height) +{ + Sector* sector = new Sector; + sector->set_name(name); + + sector->add_object(new TileMap(LAYER_BACKGROUNDTILES, false, width, height)); + sector->add_object(new TileMap(LAYER_TILES, true, width, height)); + sector->add_object(new TileMap(LAYER_FOREGROUNDTILES, false, width, height)); + sector->add_object(new Camera(sector)); + sector->update_game_objects(); + + return sector; +} + Index: misc.h =================================================================== RCS file: /cvsroot/super-tux/supertux/src/misc.h,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- misc.h 20 Nov 2004 22:14:38 -0000 1.3 +++ misc.h 26 Nov 2004 14:45:40 -0000 1.4 @@ -19,14 +19,14 @@ #define SUPERTUX_MISC_H #include "app/setup.h" -#include "resources.h" +#include "app/gettext.h" #include "gui/menu.h" #include "utils/configfile.h" -#include "player.h" #include "title.h" +#include "resources.h" #include "worldmap.h" #include "gameloop.h" -#include "app/gettext.h" +#include "object/player.h" class MyConfig : public Config { Index: gameloop.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/gameloop.cpp,v retrieving revision 1.203 retrieving revision 1.204 diff -u -d -r1.203 -r1.204 --- gameloop.cpp 26 Nov 2004 13:56:31 -0000 1.203 +++ gameloop.cpp 26 Nov 2004 14:45:32 -0000 1.204 @@ -47,19 +47,19 @@ #include "high_scores.h" #include "gui/menu.h" #include "sector.h" -#include "player.h" #include "level.h" #include "scene.h" #include "tile.h" -#include "particlesystem.h" +#include "object/particlesystem.h" +#include "object/background.h" +#include "object/tilemap.h" +#include "object/camera.h" +#include "object/player.h" #include "resources.h" -#include "background.h" -#include "tilemap.h" #include "app/gettext.h" #include "worldmap.h" #include "intro.h" #include "misc.h" -#include "camera.h" #include "statistics.h" #include "timer.h" #include "object/fireworks.h" Index: sector.h =================================================================== RCS file: /cvsroot/super-tux/supertux/src/sector.h,v retrieving revision 1.25 retrieving revision 1.26 diff -u -d -r1.25 -r1.26 --- sector.h 25 Nov 2004 00:49:34 -0000 1.25 +++ sector.h 26 Nov 2004 14:45:41 -0000 1.26 @@ -67,8 +67,6 @@ Sector(); ~Sector(); - /// create new sector - static Sector *create(const std::string& name, size_t width, size_t height); /// read sector from lisp file void parse(LispReader& reader); void parse_old_format(LispReader& reader); @@ -88,6 +86,8 @@ /// adds a gameobject void add_object(GameObject* object); + void set_name(const std::string& name) + { this->name = name; } const std::string& get_name() const { return name; } @@ -102,16 +102,10 @@ case (or not). */ void collision_handler(); - void add_score(const Vector& pos, int s); - bool add_bullet(const Vector& pos, float xm, Direction dir); bool add_smoke_cloud(const Vector& pos); void add_floating_text(const Vector& pos, const std::string& text); - /** Flip the all the sector vertically. The purpose of this is to let - player to play the same level in a different way :) */ - void do_vertical_flip(); - /** @evil@ but can#t always be avoided in current design... */ static Sector* current() { return _current; } --- gameobjs.cpp DELETED --- --- camera.cpp DELETED --- Index: title.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/title.cpp,v retrieving revision 1.133 retrieving revision 1.134 diff -u -d -r1.133 -r1.134 --- title.cpp 25 Nov 2004 19:48:36 -0000 1.133 +++ title.cpp 26 Nov 2004 14:45:41 -0000 1.134 @@ -52,14 +52,14 @@ #include "worldmap.h" #include "leveleditor.h" #include "scene.h" -#include "player.h" #include "tile.h" #include "sector.h" -#include "tilemap.h" +#include "object/tilemap.h" +#include "object/camera.h" +#include "object/player.h" #include "resources.h" #include "app/gettext.h" #include "misc.h" -#include "camera.h" static Surface* bkg_title; static Surface* logo; Index: resources.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/resources.cpp,v retrieving revision 1.58 retrieving revision 1.59 diff -u -d -r1.58 -r1.59 --- resources.cpp 25 Nov 2004 19:48:26 -0000 1.58 +++ resources.cpp 26 Nov 2004 14:45:41 -0000 1.59 @@ -25,9 +25,9 @@ #include "gui/menu.h" #include "gui/button.h" #include "scene.h" -#include "player.h" -#include "gameobjs.h" #include "resources.h" +#include "object/gameobjs.h" +#include "object/player.h" Surface* img_waves[3]; Surface* img_water; --- player.h DELETED --- Index: sector.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/sector.cpp,v retrieving revision 1.50 retrieving revision 1.51 diff -u -d -r1.50 -r1.51 --- sector.cpp 26 Nov 2004 13:56:31 -0000 1.50 +++ sector.cpp 26 Nov 2004 14:45:41 -0000 1.51 @@ -29,12 +29,12 @@ #include "app/globals.h" #include "sector.h" #include "utils/lispreader.h" -#include "gameobjs.h" -#include "camera.h" -#include "background.h" -#include "particlesystem.h" +#include "object/gameobjs.h" +#include "object/camera.h" +#include "object/background.h" +#include "object/particlesystem.h" +#include "object/tilemap.h" #include "tile.h" -#include "tilemap.h" #include "audio/sound_manager.h" #include "gameloop.h" #include "resources.h" @@ -69,13 +69,13 @@ song_title = "Mortimers_chipdisko.mod"; player = new Player(); add_object(player); - - printf("seccreated: %p.\n", this); } Sector::~Sector() { - printf("secdel: %p.\n", this); + update_game_objects(); + assert(gameobjects_new.size() == 0); + for(GameObjects::iterator i = gameobjects.begin(); i != gameobjects.end(); ++i) { delete *i; @@ -89,23 +89,6 @@ _current = 0; } -Sector *Sector::create(const std::string& name, size_t width, size_t height) -{ - Sector *sector = new Sector; - sector->name = name; - TileMap *background = new TileMap(LAYER_BACKGROUNDTILES, false, width, height); - TileMap *interactive = new TileMap(LAYER_TILES, true, width, height); - TileMap *foreground = new TileMap(LAYER_FOREGROUNDTILES, false, width, height); - sector->add_object(background); - sector->add_object(interactive); - sector->add_object(foreground); - sector->solids = interactive; - sector->camera = new Camera(sector); - sector->add_object(sector->camera); - sector->update_game_objects(); - return sector; -} - GameObject* Sector::parse_object(const std::string& name, LispReader& reader) { @@ -151,14 +134,6 @@ } else if(name == "nolok_01") { return new Nolok_01(reader); } -#if 0 - else if(badguykind_from_string(name) != BAD_INVALID) { - return new BadGuy(badguykind_from_string(name), reader); - } else if(name == "trampoline") { - return new Trampoline(reader); - } else if(name == "flying-platform") { - return new FlyingPlatform(reader); -#endif std::cerr << "Unknown object type '" << name << "'.\n"; return 0; @@ -197,6 +172,9 @@ } } + update_game_objects(); + fix_old_tiles(); + update_game_objects(); if(!camera) { std::cerr << "sector '" << name << "' does not contain a camera.\n"; camera = new Camera(this); @@ -237,11 +215,11 @@ bkgd_bottom.blue = b; if(backgroundimage != "") { - background = new Background; + Background* background = new Background; background->set_image(backgroundimage, bgspeed); add_object(background); } else { - background = new Background; + Background* background = new Background; background->set_gradient(bkgd_top, bkgd_bottom); add_object(background); } @@ -275,10 +253,7 @@ || reader.read_int_vector("tilemap", tiles)) { TileMap* tilemap = new TileMap(); tilemap->set(width, height, tiles, LAYER_TILES, true); - solids = tilemap; add_object(tilemap); - - fix_old_tiles(); } if(reader.read_int_vector("background-tm", tiles)) { @@ -338,8 +313,14 @@ } // add a camera - camera = new Camera(this); + Camera* camera = new Camera(this); add_object(camera); + + update_game_objects(); + fix_old_tiles(); + update_game_objects(); + if(solids == 0) + throw std::runtime_error("sector does not contain a solid tile layer."); } void @@ -411,41 +392,6 @@ } void -Sector::do_vertical_flip() -{ - // remove or fix later -#if 0 - for(GameObjects::iterator i = gameobjects_new.begin(); i != gameobjects_new.end(); ++i) - { - TileMap* tilemap = dynamic_cast<TileMap*> (*i); - if(tilemap) - { - tilemap->do_vertical_flip(); - } - - BadGuy* badguy = dynamic_cast<BadGuy*> (*i); - if(badguy) - badguy->start_position.y = solids->get_height()*32 - badguy->start_position.y - 32; - Trampoline* trampoline = dynamic_cast<Trampoline*> (*i); - if(trampoline) - trampoline->base.y = solids->get_height()*32 - trampoline->base.y - 32; - FlyingPlatform* flying_platform = dynamic_cast<FlyingPlatform*> (*i); - if(flying_platform) - flying_platform->base.y = solids->get_height()*32 - flying_platform->base.y - 32; - Door* door = dynamic_cast<Door*> (*i); - if(door) - door->set_area(door->get_area().x, solids->get_height()*32 - door->get_area().y - 32); - } - - for(SpawnPoints::iterator i = spawnpoints.begin(); i != spawnpoints.end(); - ++i) { - SpawnPoint* spawn = *i; - spawn->pos.y = solids->get_height()*32 - spawn->pos.y - 32; - } -#endif -} - -void Sector::add_object(GameObject* object) { // make sure the object isn't already in the list @@ -536,8 +482,7 @@ } /* Handle all possible collisions. */ - collision_handler(); - + collision_handler(); update_game_objects(); } @@ -573,7 +518,6 @@ if(tilemap && tilemap->is_solid()) { if(solids == 0) { solids = tilemap; - fix_old_tiles(); } else { std::cerr << "Another solid tilemaps added. Ignoring."; } @@ -774,14 +718,6 @@ } } -void -Sector::add_score(const Vector& pos, int s) -{ - global_stats.add_points(SCORE_STAT, s); - - add_object(new FloatingText(pos, s)); -} - bool Sector::add_bullet(const Vector& pos, float xm, Direction dir) { --- particlesystem.cpp DELETED --- --- gameobjs.h DELETED --- --- tilemap.h DELETED --- --- particlesystem.h DELETED --- --- camera.h DELETED --- Index: level.h =================================================================== RCS file: /cvsroot/super-tux/supertux/src/level.h,v retrieving revision 1.68 retrieving revision 1.69 diff -u -d -r1.68 -r1.69 --- level.h 25 Nov 2004 19:48:26 -0000 1.68 +++ level.h 26 Nov 2004 14:45:32 -0000 1.69 @@ -54,7 +54,6 @@ // loads a levelfile void load(const std::string& filename); void save(const std::string& filename); - static void create(const std::string& filename); EndSequenceType get_end_sequence_type() const { return end_sequence_type; } --- player.cpp DELETED --- Index: level.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/level.cpp,v retrieving revision 1.110 retrieving revision 1.111 diff -u -d -r1.110 -r1.111 --- level.cpp 26 Nov 2004 13:56:31 -0000 1.110 +++ level.cpp 26 Nov 2004 14:45:32 -0000 1.111 @@ -30,7 +30,6 @@ #include "app/globals.h" #include "app/setup.h" -#include "camera.h" #include "video/screen.h" #include "level.h" #include "math/physic.h" @@ -39,9 +38,10 @@ #include "tile.h" #include "utils/lispreader.h" #include "resources.h" -#include "gameobjs.h" #include "utils/lispwriter.h" -#include "tilemap.h" +#include "object/gameobjs.h" +#include "object/camera.h" +#include "object/tilemap.h" using namespace std; @@ -52,16 +52,6 @@ } void -Level::create(const std::string& filename) -{ - Level level; - const size_t width = 25; - const size_t height = 19; - level.add_sector(Sector::create("main", width, height)); - level.save(filename); -} - -void Level::load(const std::string& filepath) { LispReader* level = LispReader::load(filepath, "supertux-level"); @@ -167,8 +157,10 @@ void Level::do_vertical_flip() { +#if 0 for(Sectors::iterator i = sectors.begin(); i != sectors.end(); ++i) i->second->do_vertical_flip(); +#endif } void @@ -242,10 +234,7 @@ int total_coins = 0; for(Sectors::iterator i = sectors.begin(); i != sectors.end(); ++i) { TileMap* solids = i->second->solids; - if(!solids) { - std::cerr << "Sector '" << i->first << "' contains no solids!?!\n"; - continue; - } + assert(solids != 0); for(size_t x = 0; x < solids->get_width(); ++x) for(size_t y = 0; y < solids->get_height(); ++y) { const Tile* tile = solids->get_tile(x, y); --- background.cpp DELETED --- Index: supertux.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/supertux.cpp,v retrieving revision 1.33 retrieving revision 1.34 diff -u -d -r1.33 -r1.34 --- supertux.cpp 25 Nov 2004 01:12:13 -0000 1.33 +++ supertux.cpp 26 Nov 2004 14:45:41 -0000 1.34 @@ -39,7 +39,6 @@ #include "video/surface.h" #include "tile_manager.h" #include "app/gettext.h" -#include "player.h" #include "misc.h" #include "utils/configfile.h" Index: leveleditor.h =================================================================== RCS file: /cvsroot/super-tux/supertux/src/leveleditor.h,v retrieving revision 1.23 retrieving revision 1.24 diff -u -d -r1.23 -r1.24 --- leveleditor.h 23 Nov 2004 02:00:51 -0000 1.23 +++ leveleditor.h 26 Nov 2004 14:45:40 -0000 1.24 @@ -143,6 +143,9 @@ Vector selection_ini, selection_end; bool level_changed; + +private: + Sector* create_sector(const std::string& name, size_t width, size_t height); }; #endif |
From: Matze B. <mat...@us...> - 2004-11-26 14:46:03
|
Update of /cvsroot/super-tux/supertux/src/badguy In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31955/src/badguy Modified Files: badguy.cpp badguy.h Log Message: some cleanups memory leak fixes and moving of source files Index: badguy.h =================================================================== RCS file: /cvsroot/super-tux/supertux/src/badguy/badguy.h,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- badguy.h 24 Nov 2004 18:19:51 -0000 1.2 +++ badguy.h 26 Nov 2004 14:45:41 -0000 1.3 @@ -7,7 +7,7 @@ #include "special/moving_object.h" #include "special/sprite.h" #include "math/physic.h" -#include "player.h" +#include "object/player.h" #include "serializable.h" #include "resources.h" #include "sector.h" Index: badguy.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/badguy/badguy.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- badguy.cpp 25 Nov 2004 00:49:34 -0000 1.6 +++ badguy.cpp 26 Nov 2004 14:45:41 -0000 1.7 @@ -1,7 +1,7 @@ #include <config.h> #include "badguy.h" -#include "camera.h" +#include "object/camera.h" static const float SQUISH_TIME = 2; static const float X_OFFSCREEN_DISTANCE = 1600; |
From: Matze B. <mat...@us...> - 2004-11-26 14:45:58
|
Update of /cvsroot/super-tux/supertux/src/trigger In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31955/src/trigger Modified Files: trigger_base.cpp Log Message: some cleanups memory leak fixes and moving of source files Index: trigger_base.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/trigger/trigger_base.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- trigger_base.cpp 23 Nov 2004 16:47:26 -0000 1.2 +++ trigger_base.cpp 26 Nov 2004 14:45:42 -0000 1.3 @@ -19,8 +19,8 @@ #include <config.h> #include "trigger_base.h" -#include "player.h" #include "video/drawing_context.h" +#include "object/player.h" TriggerBase::TriggerBase() : sprite(0) |
From: Matze B. <mat...@us...> - 2004-11-26 13:56:53
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20618/src Modified Files: background.cpp camera.cpp camera.h defines.h gameloop.cpp gameobjs.h level.cpp player.cpp player.h sector.cpp tile_manager.cpp tile_manager.h worldmap.h Removed Files: collision.cpp collision.h Log Message: fixed broken 1-time animations in sprites, fixed collision code returning no-collision if both objects didn't move, some cleanups Index: tile_manager.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/tile_manager.cpp,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- tile_manager.cpp 20 Nov 2004 22:14:39 -0000 1.8 +++ tile_manager.cpp 26 Nov 2004 13:56:31 -0000 1.9 @@ -17,7 +17,6 @@ // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA // 02111-1307, USA. - #include <config.h> #include <assert.h> Index: background.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/background.cpp,v retrieving revision 1.16 retrieving revision 1.17 diff -u -d -r1.16 -r1.17 --- background.cpp 23 Nov 2004 14:36:39 -0000 1.16 +++ background.cpp 26 Nov 2004 13:56:30 -0000 1.17 @@ -47,6 +47,7 @@ Background::~Background() { + printf("bgfree.\n"); delete image; } @@ -89,6 +90,7 @@ this->imagefile = name; this->speed = speed; + printf("seti %p\n", this); delete image; image = new Surface(datadir + "/images/background/" + name, false); } @@ -108,17 +110,10 @@ Background::draw(DrawingContext& context) { if(type == GRADIENT) { - /* In case we are using OpenGL just draw the gradient, else (software mode) - use the cache. */ - if(use_gl) - context.draw_gradient(gradient_top, gradient_bottom, layer); - else - { - context.push_transform(); - context.set_translation(Vector(0, 0)); - context.draw_surface(image, Vector(0, 0), layer); - context.pop_transform(); - } + context.push_transform(); + context.set_translation(Vector(0, 0)); + context.draw_surface(image, Vector(0, 0), layer); + context.pop_transform(); } else if(type == IMAGE) { if(!image) return; Index: sector.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/sector.cpp,v retrieving revision 1.49 retrieving revision 1.50 diff -u -d -r1.49 -r1.50 --- sector.cpp 25 Nov 2004 16:38:31 -0000 1.49 +++ sector.cpp 26 Nov 2004 13:56:31 -0000 1.50 @@ -69,10 +69,13 @@ song_title = "Mortimers_chipdisko.mod"; player = new Player(); add_object(player); + + printf("seccreated: %p.\n", this); } Sector::~Sector() { + printf("secdel: %p.\n", this); for(GameObjects::iterator i = gameobjects.begin(); i != gameobjects.end(); ++i) { delete *i; @@ -110,25 +113,11 @@ background = new Background(reader); return background; } else if(name == "camera") { - if(camera) { - std::cerr << "Warning: More than 1 camera defined in sector.\n"; - return 0; - } - camera = new Camera(this); - camera->read(reader); + Camera* camera = new Camera(this); + camera->parse(reader); return camera; } else if(name == "tilemap") { - TileMap* tilemap = new TileMap(reader); - - if(tilemap->is_solid()) { - if(solids) { - std::cerr << "Warning multiple solid tilemaps in sector.\n"; - return 0; - } - solids = tilemap; - fix_old_tiles(); - } - return tilemap; + return new TileMap(reader); } else if(name == "particles-snow") { SnowParticleSystem* partsys = new SnowParticleSystem(); partsys->parse(reader); @@ -565,15 +554,6 @@ std::remove(bullets.begin(), bullets.end(), bullet), bullets.end()); } -#if 0 - InteractiveObject* interactive_object = - dynamic_cast<InteractiveObject*> (*i); - if(interactive_object) { - interactive_objects.erase( - std::remove(interactive_objects.begin(), interactive_objects.end(), - interactive_object), interactive_objects.end()); - } -#endif delete *i; i = gameobjects.erase(i); } else { @@ -585,17 +565,30 @@ for(std::vector<GameObject*>::iterator i = gameobjects_new.begin(); i != gameobjects_new.end(); ++i) { - Bullet* bullet = dynamic_cast<Bullet*> (*i); - if(bullet) - bullets.push_back(bullet); -#if 0 - InteractiveObject* interactive_object - = dynamic_cast<InteractiveObject*> (*i); - if(interactive_object) - interactive_objects.push_back(interactive_object); -#endif + Bullet* bullet = dynamic_cast<Bullet*> (*i); + if(bullet) + bullets.push_back(bullet); - gameobjects.push_back(*i); + TileMap* tilemap = dynamic_cast<TileMap*> (*i); + if(tilemap && tilemap->is_solid()) { + if(solids == 0) { + solids = tilemap; + fix_old_tiles(); + } else { + std::cerr << "Another solid tilemaps added. Ignoring."; + } + } + + Camera* camera = dynamic_cast<Camera*> (*i); + if(camera) { + if(this->camera != 0) { + std::cerr << "Warning: Multiple cameras added. Ignoring."; + continue; + } + this->camera = camera; + } + + gameobjects.push_back(*i); } gameobjects_new.clear(); } Index: player.h =================================================================== RCS file: /cvsroot/super-tux/supertux/src/player.h,v retrieving revision 1.95 retrieving revision 1.96 diff -u -d -r1.95 -r1.96 --- player.h 24 Nov 2004 23:10:03 -0000 1.95 +++ player.h 26 Nov 2004 13:56:31 -0000 1.96 @@ -23,7 +23,6 @@ #include "timer.h" #include "video/surface.h" -#include "collision.h" #include "special/moving_object.h" #include "special/sprite.h" #include "math/physic.h" Index: tile_manager.h =================================================================== RCS file: /cvsroot/super-tux/supertux/src/tile_manager.h,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- tile_manager.h 23 Nov 2004 16:49:13 -0000 1.6 +++ tile_manager.h 26 Nov 2004 13:56:31 -0000 1.7 @@ -89,5 +89,3 @@ }; #endif - -/* EOF */ Index: gameobjs.h =================================================================== RCS file: /cvsroot/super-tux/supertux/src/gameobjs.h,v retrieving revision 1.42 retrieving revision 1.43 diff -u -d -r1.42 -r1.43 --- gameobjs.h 22 Nov 2004 21:35:04 -0000 1.42 +++ gameobjs.h 26 Nov 2004 13:56:31 -0000 1.43 @@ -26,7 +26,6 @@ #include "timer.h" #include "scene.h" #include "math/physic.h" -#include "collision.h" #include "special/game_object.h" #include "special/moving_object.h" #include "serializable.h" Index: gameloop.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/gameloop.cpp,v retrieving revision 1.202 retrieving revision 1.203 diff -u -d -r1.202 -r1.203 --- gameloop.cpp 25 Nov 2004 19:48:25 -0000 1.202 +++ gameloop.cpp 26 Nov 2004 13:56:31 -0000 1.203 @@ -50,7 +50,6 @@ #include "player.h" #include "level.h" #include "scene.h" -#include "collision.h" #include "tile.h" #include "particlesystem.h" #include "resources.h" Index: worldmap.h =================================================================== RCS file: /cvsroot/super-tux/supertux/src/worldmap.h,v retrieving revision 1.50 retrieving revision 1.51 diff -u -d -r1.50 -r1.51 --- worldmap.h 23 Nov 2004 02:00:52 -0000 1.50 +++ worldmap.h 26 Nov 2004 13:56:31 -0000 1.51 @@ -16,7 +16,6 @@ // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - #ifndef SUPERTUX_WORLDMAP_H #define SUPERTUX_WORLDMAP_H --- collision.h DELETED --- Index: defines.h =================================================================== RCS file: /cvsroot/super-tux/supertux/src/defines.h,v retrieving revision 1.50 retrieving revision 1.51 diff -u -d -r1.50 -r1.51 --- defines.h 20 Nov 2004 22:14:38 -0000 1.50 +++ defines.h 26 Nov 2004 13:56:31 -0000 1.51 @@ -25,14 +25,11 @@ enum Direction { LEFT = 0, RIGHT = 1 }; -/* Direction (keyboard/joystick) states: */ - +/* keyboard/joystick states: */ #define UP 0 #define DOWN 1 /* Dying types: */ - -/* ---- NO 0 */ enum DyingType { DYING_NOT = 0, DYING_SQUISHED = 1, @@ -40,25 +37,14 @@ }; /* Speed constraints: */ -#define MAX_WALK_XM 230 -#define MAX_RUN_XM 320 #define MAX_LIVES 99 -#define WALK_SPEED 100 - /* gameplay related defines */ - #define START_LIVES 4 #define MAX_FIRE_BULLETS 2 #define MAX_ICE_BULLETS 1 #define FROZEN_TIME 3.0 -#define WALK_ACCELERATION_X 300 -#define RUN_ACCELERATION_X 400 - -#define SKID_XM 200 -#define SKID_TIME .3 - #endif /*SUPERTUX_DEFINES_H*/ --- collision.cpp DELETED --- Index: player.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/player.cpp,v retrieving revision 1.210 retrieving revision 1.211 diff -u -d -r1.210 -r1.211 --- player.cpp 25 Nov 2004 20:18:16 -0000 1.210 +++ player.cpp 26 Nov 2004 13:56:31 -0000 1.211 @@ -40,13 +40,18 @@ #include "gameloop.h" #include "trigger/trigger_base.h" -// behavior definitions: -#define TILES_FOR_BUTTJUMP 3 -// animation times (in ms): -#define SHOOTING_TIME .150 +static const int TILES_FOR_BUTTJUMP = 3; +static const float SHOOTING_TIME = .150; +/// time before idle animation starts +static const float IDLE_TIME = 2.5; -// time before idle animation starts -#define IDLE_TIME 2.500 +static const float WALK_ACCELERATION_X = 300; +static const float RUN_ACCELERATION_X = 400; +static const float SKID_XM = 200; +static const float SKID_TIME = .3; +static const float MAX_WALK_XM = 230; +static const float MAX_RUN_XM = 320; +static const float WALK_SPEED = 100; // growing animation Surface* growingtux_left[GROWING_FRAMES]; Index: level.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/level.cpp,v retrieving revision 1.109 retrieving revision 1.110 diff -u -d -r1.109 -r1.110 --- level.cpp 25 Nov 2004 19:48:25 -0000 1.109 +++ level.cpp 26 Nov 2004 13:56:31 -0000 1.110 @@ -126,36 +126,36 @@ void Level::save(const std::string& filename) { - std::string filepath = "levels/" + filename; - int last_slash = filepath.find_last_of('/'); - FileSystem::fcreatedir(filepath.substr(0,last_slash).c_str()); - filepath = st_dir + "/" + filepath; - ofstream file(filepath.c_str(), ios::out); - LispWriter* writer = new LispWriter(file); + std::string filepath = "levels/" + filename; + int last_slash = filepath.find_last_of('/'); + FileSystem::fcreatedir(filepath.substr(0,last_slash).c_str()); + filepath = st_dir + "/" + filepath; + ofstream file(filepath.c_str(), ios::out); + LispWriter* writer = new LispWriter(file); - writer->write_comment("Level made using SuperTux's built-in Level Editor"); + writer->write_comment("Level made using SuperTux's built-in Level Editor"); - writer->start_list("supertux-level"); + writer->start_list("supertux-level"); - int version = 2; - writer->write_int("version", version); + int version = 2; + writer->write_int("version", version); - writer->write_string("name", name); - writer->write_string("author", author); - writer->write_int("time", timelimit); - writer->write_string("end-sequence-animation", - end_sequence_type == FIREWORKS_ENDSEQ_ANIM ? "fireworks" : "none"); + writer->write_string("name", name); + writer->write_string("author", author); + writer->write_int("time", timelimit); + writer->write_string("end-sequence-animation", + end_sequence_type == FIREWORKS_ENDSEQ_ANIM ? "fireworks" : "none"); - for(Sectors::iterator i = sectors.begin(); i != sectors.end(); ++i) { - writer->start_list("sector"); - i->second->write(*writer); - writer->end_list("sector"); - } + for(Sectors::iterator i = sectors.begin(); i != sectors.end(); ++i) { + writer->start_list("sector"); + i->second->write(*writer); + writer->end_list("sector"); + } - writer->end_list("supertux-level"); + writer->end_list("supertux-level"); - delete writer; - file.close(); + delete writer; + file.close(); } Level::~Level() Index: camera.h =================================================================== RCS file: /cvsroot/super-tux/supertux/src/camera.h,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- camera.h 20 Nov 2004 22:14:38 -0000 1.13 +++ camera.h 26 Nov 2004 13:56:30 -0000 1.14 @@ -44,7 +44,7 @@ virtual ~Camera(); /// parse camera mode from lisp file - void read(LispReader& reader); + void parse(LispReader& reader); /// write camera mode to a lisp file virtual void write(LispWriter& writer); Index: camera.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/camera.cpp,v retrieving revision 1.16 retrieving revision 1.17 diff -u -d -r1.16 -r1.17 --- camera.cpp 20 Nov 2004 22:14:37 -0000 1.16 +++ camera.cpp 26 Nov 2004 13:56:30 -0000 1.17 @@ -52,7 +52,7 @@ } void -Camera::read(LispReader& reader) +Camera::parse(LispReader& reader) { std::string modename; |
From: Matze B. <mat...@us...> - 2004-11-26 13:56:49
|
Update of /cvsroot/super-tux/supertux/lib/special In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20618/lib/special Modified Files: collision.cpp sprite.cpp Log Message: fixed broken 1-time animations in sprites, fixed collision code returning no-collision if both objects didn't move, some cleanups Index: collision.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/lib/special/collision.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- collision.cpp 25 Nov 2004 16:38:30 -0000 1.5 +++ collision.cpp 26 Nov 2004 13:56:30 -0000 1.6 @@ -38,7 +38,11 @@ hit.normal.y = 0; } else { if(movement.y > -DELTA && movement.y < DELTA) { - return false; + hit.time = 0; + hit.depth = 0; + hit.normal.x = 1; + hit.normal.y = 0; + return true; } hit.time = FLT_MAX; } Index: sprite.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/lib/special/sprite.cpp,v retrieving revision 1.33 retrieving revision 1.34 diff -u -d -r1.33 -r1.34 --- sprite.cpp 24 Nov 2004 23:10:02 -0000 1.33 +++ sprite.cpp 26 Nov 2004 13:56:30 -0000 1.34 @@ -57,7 +57,7 @@ return; SpriteData::Action* newaction = data.get_action(name); - if(!action) { + if(!newaction) { #ifdef DEBUG std::cerr << "Action '" << name << "' not found.\n"; #endif @@ -72,7 +72,7 @@ bool Sprite::check_animation() { - return animation_loops; + return animation_loops == 0; } void @@ -87,14 +87,12 @@ frame += frame_inc; - float lastframe = frame; - frame = fmodf(frame+get_frames(), get_frames()); - if(frame != lastframe) { - if(animation_loops > 0) { - animation_loops--; - if(animation_loops == 0) - frame = 0; - } + if(frame > get_frames()) { + frame = fmodf(frame+get_frames(), get_frames()); + + animation_loops--; + if(animation_loops == 0) + frame = 0; } } @@ -146,4 +144,3 @@ } -/* EOF */ |
From: Matze B. <mat...@us...> - 2004-11-26 13:56:47
|
Update of /cvsroot/super-tux/supertux/lib/app In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20618/lib/app Modified Files: globals.cpp Log Message: fixed broken 1-time animations in sprites, fixed collision code returning no-collision if both objects didn't move, some cleanups Index: globals.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/lib/app/globals.cpp,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- globals.cpp 24 Nov 2004 18:22:21 -0000 1.12 +++ globals.cpp 26 Nov 2004 13:56:23 -0000 1.13 @@ -70,7 +70,8 @@ SDL_Joystick * js; /* Returns 1 for every button event, 2 for a quit event and 0 for no event. */ -int wait_for_event(SDL_Event& event,unsigned int min_delay, unsigned int max_delay, bool empty_events) +int wait_for_event(SDL_Event& event, unsigned int min_delay, + unsigned int max_delay, bool empty_events) { int i; Timer maxdelay; |
From: Matze B. <mat...@us...> - 2004-11-26 13:56:46
|
Update of /cvsroot/super-tux/supertux/src/trigger In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20618/src/trigger Modified Files: door.cpp Log Message: fixed broken 1-time animations in sprites, fixed collision code returning no-collision if both objects didn't move, some cleanups Index: door.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/trigger/door.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- door.cpp 25 Nov 2004 11:16:03 -0000 1.4 +++ door.cpp 26 Nov 2004 13:56:32 -0000 1.5 @@ -77,7 +77,7 @@ Door::action(float ) { //Check if door animation is complete - if (!sprite->check_animation()) { + if(sprite->check_animation()) { GameSession::current()->respawn(target_sector, target_spawnpoint); } } |
From: Matze B. <mat...@us...> - 2004-11-26 13:56:45
|
Update of /cvsroot/super-tux/supertux/lib/math In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20618/lib/math Modified Files: physic.cpp Log Message: fixed broken 1-time animations in sprites, fixed collision code returning no-collision if both objects didn't move, some cleanups Index: physic.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/lib/math/physic.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- physic.cpp 24 Nov 2004 14:10:22 -0000 1.6 +++ physic.cpp 26 Nov 2004 13:56:30 -0000 1.7 @@ -23,7 +23,6 @@ #include <cstdio> #include "math/physic.h" -#include "special/timer.h" using namespace SuperTux; |
From: Matze B. <mat...@us...> - 2004-11-25 20:20:17
|
Update of /cvsroot/super-tux/supertux/data/levels/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18853/data/levels/test Added Files: simple.stl Log Message: simple testlevel to test slopes , and different tile/hole sizes --- NEW FILE: simple.stl --- ;; Generated by Flexlay Editor (supertux-level (version 2) (name "Bonus Block Test") (author "SuperTux Team") (time 999) (sector (name "main") (width 30) (height 20) (music "supertux-1.ogg") (gravity 10.000000) (background (image "arctis.jpg") (speed 0.5)) (spawn-points (name "main") (x 50) (y 200)) (tilemap (layer "background") (solid #f) (speed 1.000000) (width 30) (height 20) (tiles 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 )) (tilemap (layer "main") (solid #t) (speed 1.000000) (width 30) (height 20) (tiles 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 61 61 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 61 61 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 61 61 0 0 0 1048 1052 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 61 61 0 0 0 1009 1048 1052 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 48 48 48 61 61 0 0 0 1009 1009 1048 1052 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 61 61 0 0 0 0 1009 1009 1048 1052 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 61 61 0 0 0 0 0 1009 1009 1048 0 0 48 0 48 0 48 0 48 0 0 0 0 0 0 0 0 0 0 0 61 61 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 48 48 48 48 48 61 61 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 61 61 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 61 61 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 61 61 0 0 0 0 0 1063 0 1064 0 1065 0 1066 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 61 61 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 48 48 0 0 0 0 0 0 0 61 61 48 0 0 0 0 0 0 0 0 0 0 48 48 0 0 0 0 0 0 48 48 0 0 0 0 0 0 0 61 61 48 48 48 0 0 0 0 0 0 0 0 48 48 0 0 0 0 0 0 48 48 0 0 0 0 0 0 0 61 61 0 0 0 0 0 0 0 0 0 0 0 48 48 0 0 0 0 0 0 48 48 0 0 0 0 0 0 48 61 61 0 0 0 0 0 0 0 0 0 0 0 48 48 0 0 0 0 0 0 48 48 0 0 0 0 0 0 0 61 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 )) (tilemap (layer "foreground") (solid #f) (speed 1.000000) (width 30) (height 20) (tiles 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 )) (camera (mode "normal") (path )) ) ) ;; EOF ;; |
From: Matze B. <mat...@us...> - 2004-11-25 20:18:29
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18484/src Modified Files: player.cpp Log Message: this time 1-hole problems are fixed for real Index: player.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/player.cpp,v retrieving revision 1.209 retrieving revision 1.210 diff -u -d -r1.209 -r1.210 --- player.cpp 25 Nov 2004 18:57:26 -0000 1.209 +++ player.cpp 25 Nov 2004 20:18:16 -0000 1.210 @@ -390,7 +390,7 @@ // extend/shrink tux collision rectangle so that we fall through/walk over 1 // tile holes - if(vx > MAX_WALK_XM) { + if(fabsf(vx) > MAX_WALK_XM) { bbox.set_width(33); } else { bbox.set_width(31.8); |
From: Matze B. <mat...@us...> - 2004-11-25 19:49:08
|
Update of /cvsroot/super-tux/supertux/lib/app In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12128/lib/app Modified Files: setup.cpp Log Message: make supertux accepts normal paths on the commandline Index: setup.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/lib/app/setup.cpp,v retrieving revision 1.20 retrieving revision 1.21 diff -u -d -r1.20 -r1.21 --- setup.cpp 24 Nov 2004 23:10:01 -0000 1.20 +++ setup.cpp 25 Nov 2004 19:48:24 -0000 1.21 @@ -280,10 +280,9 @@ st_dir = home + "/." + package_symbol_name; /* Remove .supertux config-file from old SuperTux versions */ - if(FileSystem::faccessible(st_dir)) - { - remove(st_dir.c_str()); - } + if(FileSystem::faccessible(st_dir)) { + remove(st_dir.c_str()); + } st_save_dir = st_dir + "/save"; @@ -296,7 +295,7 @@ // try current directory as datadir if(datadir.empty()) { if(FileSystem::faccessible("./data/intro.txt")) - datadir = "./data"; + datadir = "./data/"; } // User has not that a datadir, so we try some magic @@ -314,23 +313,25 @@ { std::string exedir = std::string(dirname(exe_file)) + "/"; - datadir = exedir + "../data"; // SuperTux run from source dir + datadir = exedir + "../data/"; // SuperTux run from source dir if (access(datadir.c_str(), F_OK) != 0) { - datadir = exedir + "../../data"; //SuperTux run from source dir (with libtool script) + datadir = exedir + "../../data/"; //SuperTux run from source dir (with libtool script) if (access(datadir.c_str(), F_OK) != 0) { - datadir = exedir + "../share/" + package_symbol_name; // SuperTux run from PATH + datadir = exedir + "../share/" + package_symbol_name + "/"; // SuperTux run from PATH if (access(datadir.c_str(), F_OK) != 0) { // If all fails, fall back to compiled path - datadir = DATA_PREFIX; + datadir = DATA_PREFIX; + datadir += "/"; } } } } #else - datadir = DATA_PREFIX; + datadir = DATA_PREFIX; + datadir += "/"; #endif } printf("Datadir: %s\n", datadir.c_str()); |
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12128/src Modified Files: gameloop.cpp gameloop.h level.cpp level.h level_subset.cpp resources.cpp resources.h title.cpp worldmap.cpp Log Message: make supertux accepts normal paths on the commandline Index: gameloop.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/gameloop.cpp,v retrieving revision 1.201 retrieving revision 1.202 diff -u -d -r1.201 -r1.202 --- gameloop.cpp 24 Nov 2004 18:29:26 -0000 1.201 +++ gameloop.cpp 25 Nov 2004 19:48:25 -0000 1.202 @@ -80,11 +80,11 @@ return false; } -GameSession::GameSession(const std::string& levelname_, int mode, +GameSession::GameSession(const std::string& levelfile_, int mode, bool flip_level_, Statistics* statistics) : level(0), currentsector(0), st_gl_mode(mode), - end_sequence(NO_ENDSEQUENCE), levelname(levelname_), flip_level(flip_level_), - best_level_statistics(statistics) + end_sequence(NO_ENDSEQUENCE), levelfile(levelfile_), + flip_level(flip_level_), best_level_statistics(statistics) { current_ = this; @@ -124,7 +124,7 @@ currentsector = 0; level = new Level; - level->load(levelname); + level->load(levelfile); if(flip_level) level->do_vertical_flip(); @@ -726,7 +726,8 @@ while (exit_status == ES_NONE) { Uint32 ticks = SDL_GetTicks(); float elapsed_time = float(ticks - lastticks) / 1000.; - global_time += elapsed_time; + if(!game_pause) + global_time += elapsed_time; lastticks = ticks; // 40fps is minimum Index: level.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/level.cpp,v retrieving revision 1.108 retrieving revision 1.109 diff -u -d -r1.108 -r1.109 --- level.cpp 23 Nov 2004 16:28:03 -0000 1.108 +++ level.cpp 25 Nov 2004 19:48:25 -0000 1.109 @@ -62,20 +62,8 @@ } void -Level::load(const std::string& filename) +Level::load(const std::string& filepath) { - std::string filepath; - filepath = st_dir + "/levels/" + filename; - if (access(filepath.c_str(), R_OK) != 0) - { - filepath = datadir + "/levels/" + filename; - if (access(filepath.c_str(), R_OK) != 0) - { - std::cerr << "Error: Level: couldn't find level: " << filename << std::endl; - return; - } - } - LispReader* level = LispReader::load(filepath, "supertux-level"); int version = 1; Index: level_subset.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/level_subset.cpp,v retrieving revision 1.17 retrieving revision 1.18 diff -u -d -r1.17 -r1.18 --- level_subset.cpp 20 Nov 2004 22:14:38 -0000 1.17 +++ level_subset.cpp 25 Nov 2004 19:48:26 -0000 1.18 @@ -20,10 +20,13 @@ #include <config.h> +#include <sstream> +#include <stdexcept> #include <assert.h> #include <unistd.h> #include "app/setup.h" #include "level.h" +#include "resources.h" #include "app/globals.h" #include "video/surface.h" #include "level_subset.h" @@ -89,14 +92,13 @@ // Check in which directory our subset is located (ie. ~/.supertux/ // or SUPERTUX_DATADIR) - std::string filename; - filename = st_dir + "/levels/" + subset + "/info"; - if (access(filename.c_str(), R_OK) != 0) - { - filename = datadir + "/levels/" + subset + "/info"; - if (access(filename.c_str(), R_OK) != 0) - std::cout << "Error: LevelSubset: couldn't find subset: " << subset << std::endl; - } + std::string filename = get_resource_filename( + std::string("levels/") + subset + "/info"); + if(filename == "") { + std::stringstream msg; + msg << "Couldn't find level subset '" << subset << "'."; + throw new std::runtime_error(msg.str()); + } read_info_file(filename); @@ -115,7 +117,8 @@ for(std::set<std::string>::iterator i = files.begin(); i != files.end(); ++i) { if (has_suffix(*i, ".stl")) - levels.push_back(subset+ "/" + *i); + levels.push_back(get_resource_filename( + std::string("levels/" + subset+ "/" + *i))); } } } @@ -177,5 +180,3 @@ { return levels.size(); } - -/* EOF */ Index: level.h =================================================================== RCS file: /cvsroot/super-tux/supertux/src/level.h,v retrieving revision 1.67 retrieving revision 1.68 diff -u -d -r1.67 -r1.68 --- level.h 20 Nov 2004 22:14:38 -0000 1.67 +++ level.h 25 Nov 2004 19:48:26 -0000 1.68 @@ -51,6 +51,7 @@ Level(); ~Level(); + // loads a levelfile void load(const std::string& filename); void save(const std::string& filename); static void create(const std::string& filename); Index: gameloop.h =================================================================== RCS file: /cvsroot/super-tux/supertux/src/gameloop.h,v retrieving revision 1.64 retrieving revision 1.65 diff -u -d -r1.64 -r1.65 --- gameloop.h 23 Nov 2004 02:00:33 -0000 1.64 +++ gameloop.h 25 Nov 2004 19:48:25 -0000 1.65 @@ -78,7 +78,7 @@ bool game_pause; - std::string levelname; + std::string levelfile; bool flip_level; // the sector and spawnpoint we shoudl spawn after this frame @@ -93,7 +93,8 @@ DrawingContext* context; Timer2 time_left; - GameSession(const std::string& level, int mode, bool flip_level_ = false, Statistics* statistics = NULL); + GameSession(const std::string& levelfile, int mode, bool flip_level_ = false, + Statistics* statistics = 0); ~GameSession(); /** Enter the busy loop */ Index: title.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/title.cpp,v retrieving revision 1.132 retrieving revision 1.133 diff -u -d -r1.132 -r1.133 --- title.cpp 23 Nov 2004 02:00:51 -0000 1.132 +++ title.cpp 25 Nov 2004 19:48:36 -0000 1.133 @@ -322,7 +322,8 @@ Ticks::pause_init(); - titlesession = new GameSession("misc/menu.stl", ST_GL_DEMO_GAME); + titlesession = new GameSession(get_resource_filename("levels/misc/menu.stl"), + ST_GL_DEMO_GAME); /* Load images: */ bkg_title = new Surface(datadir + "/images/background/arctis.jpg", false); @@ -483,6 +484,3 @@ delete img_choose_subset; } - -// EOF // - Index: worldmap.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/worldmap.cpp,v retrieving revision 1.133 retrieving revision 1.134 diff -u -d -r1.133 -r1.134 --- worldmap.cpp 23 Nov 2004 02:00:51 -0000 1.133 +++ worldmap.cpp 25 Nov 2004 19:48:36 -0000 1.134 @@ -863,7 +863,8 @@ // do a shriking fade to the level shrink_fade(Vector((level->pos.x*32 + 16 + offset.x),(level->pos.y*32 + 16 + offset.y)), 500); - GameSession session(level->name, + GameSession session( + get_resource_filename(std::string("levels/" + level->name)), ST_GL_LOAD_LEVEL_FILE, level->vertical_flip, &level->statistics); Index: resources.h =================================================================== RCS file: /cvsroot/super-tux/supertux/src/resources.h,v retrieving revision 1.17 retrieving revision 1.18 diff -u -d -r1.17 -r1.18 --- resources.h 20 Nov 2004 22:14:39 -0000 1.17 +++ resources.h 25 Nov 2004 19:48:36 -0000 1.18 @@ -93,6 +93,10 @@ extern Font* white_big_text; extern Font* yellow_nums; +// maps a virtual resource path to a real path (ie. levels/bla is mapped to +// $DATADIR/levels/bla or $HOME/.supertux/levels/bla) +std::string get_resource_filename(const std::string& resource); + void loadshared(); void unloadshared(); Index: resources.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/resources.cpp,v retrieving revision 1.57 retrieving revision 1.58 diff -u -d -r1.57 -r1.58 --- resources.cpp 21 Nov 2004 03:21:25 -0000 1.57 +++ resources.cpp 25 Nov 2004 19:48:26 -0000 1.58 @@ -304,3 +304,16 @@ sprite_manager = 0; } +std::string get_resource_filename(const std::string& resource) +{ + std::string filepath = st_dir + resource; + if(access(filepath.c_str(), R_OK) == 0) + return filepath; + + filepath = datadir + resource; + if(access(filepath.c_str(), R_OK) == 0) + return filepath; + + std::cerr << "Couldn't find resource: '" << resource << "'." << std::endl; + return ""; +} |
From: Matze B. <mat...@us...> - 2004-11-25 18:57:40
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1214 Modified Files: player.cpp Log Message: shrink tux bounding box to make him not fail on 1 or 2 tiles heigh places, also extend/shrink his bounding box when walking/running Index: player.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/player.cpp,v retrieving revision 1.208 retrieving revision 1.209 diff -u -d -r1.208 -r1.209 --- player.cpp 25 Nov 2004 16:38:30 -0000 1.208 +++ player.cpp 25 Nov 2004 18:57:26 -0000 1.209 @@ -131,7 +131,7 @@ { holding_something = false; - bbox.set_size(32, 32); + bbox.set_size(31.8, 31.8); size = SMALL; got_power = NONE_POWER; @@ -388,6 +388,14 @@ } #endif + // extend/shrink tux collision rectangle so that we fall through/walk over 1 + // tile holes + if(vx > MAX_WALK_XM) { + bbox.set_width(33); + } else { + bbox.set_width(31.8); + } + physic.set_velocity(vx, vy); physic.set_acceleration(ax, ay); } @@ -660,13 +668,13 @@ { duck = true; bbox.move(Vector(0, 32)); - bbox.set_height(32); + bbox.set_height(31.8); } else if(input.down == UP && size == BIG && duck) { // try if we can really unduck bbox.move(Vector(0, -32)); - bbox.set_height(64); + bbox.set_height(63.8); duck = false; // FIXME #if 0 @@ -676,7 +684,7 @@ } else { // undo the ducking changes bbox.move(Vector(0, 32)); - bbox.set_height(32); + bbox.set_height(31.8); } #endif } @@ -689,7 +697,7 @@ return; size = BIG; - bbox.set_height(64); + bbox.set_height(63.8); bbox.move(Vector(0, -32)); if(animate) @@ -916,7 +924,7 @@ growing_timer.start(GROWING_TIME); safe_timer.start(TUX_SAFE_TIME + GROWING_TIME); size = SMALL; - bbox.set_height(32); + bbox.set_height(31.8); duck = false; } } @@ -938,7 +946,7 @@ { got_power = NONE_POWER; size = SMALL; - bbox.set_height(32); + bbox.set_height(31.8); } void |
Update of /cvsroot/super-tux/supertux/data/levels/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22766 Removed Files: animtiles.stl bonusblock.stl forest1-grumbel.stl invisible_blocks.stl level1.stl level10.stl level11.stl level12.stl level13.stl level14.stl level16.stl level17.stl level2.stl level3.stl level4.stl level5.stl level6.stl level7.stl level8.stl level9.stl noloktest.stl paratest.stl Log Message: removing test levels... --- level1.stl DELETED --- --- invisible_blocks.stl DELETED --- --- level16.stl DELETED --- --- level17.stl DELETED --- --- level6.stl DELETED --- --- level8.stl DELETED --- --- level14.stl DELETED --- --- animtiles.stl DELETED --- --- level2.stl DELETED --- --- level10.stl DELETED --- --- forest1-grumbel.stl DELETED --- --- level12.stl DELETED --- --- level5.stl DELETED --- --- bonusblock.stl DELETED --- --- level4.stl DELETED --- --- noloktest.stl DELETED --- --- level7.stl DELETED --- --- level13.stl DELETED --- --- level11.stl DELETED --- --- paratest.stl DELETED --- --- level9.stl DELETED --- --- level3.stl DELETED --- |
From: Matze B. <mat...@us...> - 2004-11-25 16:43:49
|
Update of /cvsroot/super-tux/supertux In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4998 Modified Files: TODO Log Message: TODO update and cleanup Index: TODO =================================================================== RCS file: /cvsroot/super-tux/supertux/TODO,v retrieving revision 1.92 retrieving revision 1.93 diff -u -d -r1.92 -r1.93 --- TODO 25 Nov 2004 16:38:27 -0000 1.92 +++ TODO 25 Nov 2004 16:43:39 -0000 1.93 @@ -39,62 +39,29 @@ g++ -Wall .... -o build/linux/src/error.o src/error.cpp --Collision Detection Rewrite (all [H])-- - * make blocks bounce again - ok - * bonusblocks don't always bounce back to their original position (but stay a - few pixels higher) - hopefully ok - * it's impossible to go into passages that have exactly the size of tux, - either reduce collision rectangle by DELTA or round collision coordinates to - integers... - ok for tux and most badguys - ** implement 1up - ok - ** implement star - ok - * bring back the enemies - - add activation again - ok - - make api simpler - ok - - implement jumpy - ok - -* implement spiky - ok - - implement snowball - ok + * enemies: - implement fish - - implement bouncingsnowball - ok - -* implement mriceblock - ~ok - - implement flame - ok - -* implement mrbomb - ok - implement flyingsnowball - implement wingling - implement tree (really?) - bring back stay on platform flag - make enemies bounce of upon each other again - make enemies fall again - ok - -* activate/deactive enemies when on screen/away again - ok ** implement ability to cary mriceblock (and other objects) around - delayed for after big commit... * smoke clouds are too fast - * some shots disappear in the ground with a "max collision depth reached" - message - ok - * rework collision detection to take movement into account - this should fix - the egg suddenly turning directions and the somtimes strange behaviour - when hitting a block from the side when falling. - - done for rectangles, fixes the issues with blocks and enemies hitting - when they should get squished, still it's not optimal as when hitting 2 - blocks now only 1 gets cleared... - ok * rethink slopes collision feedback... tux becomes too slow when walking up and starts jumping when walking down * think about an attachement mechanism for moving platforms * implement paths for the moving platform, implement simple moving platforms - ** activate level end sequence again - ok - ** make bullets kill enemies - ok * fix bullet speed/behaviour - ** fix ducking - ok * check if unducking is actually possible or if something is in the way * fix flapping - ** having a star doesn't kill enemies - ok - * tux always jumps to full height at the moment - ok - * invisble blocks are visible and make the game crash when bumped - ok - * reimplement spikes as objects - ok * what to do when stuck under tiles (after using duck-sliding) * do we want multi hit scores again? * tux doesn't stop at igloo anymore - * background particle systems are too slow - ok * buttjump is deactivated + * implement quadtree or grid to speedup collision detection --Code Refactoring/Cleanup/Optimisation-- [H] make the title using GameSession instead of reimplementing all the stuff @@ -108,7 +75,6 @@ ingame mode and eventually leveleditor mode [H] introduce a special mode in DrawingContext for objects that want to draw themselfes. This could speed up rendering of tilemaps. -[H] implement quadtree to speed up collision detection [?] remove badguyspecs and bitmask files [M] Make the gamelogic run in a fixed logical framerate |
From: Matze B. <mat...@us...> - 2004-11-25 16:39:09
|
Update of /cvsroot/super-tux/supertux/data/images/tilesets In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3933/data/images/tilesets Modified Files: supertux.stgt Log Message: added some more non-45 degree triangle modes Index: supertux.stgt =================================================================== RCS file: /cvsroot/super-tux/supertux/data/images/tilesets/supertux.stgt,v retrieving revision 1.61 retrieving revision 1.62 diff -u -d -r1.61 -r1.62 --- supertux.stgt 24 Nov 2004 22:26:02 -0000 1.61 +++ supertux.stgt 25 Nov 2004 16:38:28 -0000 1.62 @@ -2,203 +2,35 @@ (supertux-tiles (tilegroup (name "Snow") - (tiles - 7 8 9 202 - 13 14 15 204 - 10 11 12 206 - 16 17 18 205 - 22 21 19 203 - 23 20 207 208 - 31 30 114 113 - 115 116 122 123 - 117 118 124 125 - 33 32 34 209 - 35 37 39 210 - 38 36 43 0 - 40 41 42 0 - 119 121 120 0 -) + (tiles 7 8 9 202 13 14 15 204 10 11 12 206 16 17 18 205 22 21 19 203 23 20 207 208 31 30 114 113 115 116 122 123 117 118 124 125 33 32 34 209 35 37 39 210 38 36 43 0 40 41 42 119 121 120) ) - (tilegroup (name "Forest (Foreground)") - (tiles - 1000 1001 1002 1003 - 1004 1005 1006 1007 - 1008 1009 1010 1011 - 1012 1013 1014 1015 - 1016 1017 1018 1019 - 0 1060 1061 0 - 1063 1064 1065 1066 - 1067 1068 1069 1070 - 1045 1046 1051 1052 - 1047 1048 1053 1054 - 1049 1050 1055 1056 - 1042 1043 1057 1058 - 1034 1035 1029 1030 - 1041 1040 1031 1032 - 1036 1037 0 1038 - 1020 1021 1022 1044 - 1023 1024 1025 1033 - 1026 1027 1028 1039 )) - + (tiles 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 0 1060 1061 1063 1064 1065 1066 1067 1068 1069 1070 1045 1046 1051 1052 1047 1048 1053 1054 1049 1050 1055 1056 1042 1043 1057 1058 1034 1035 1029 1030 1041 1040 1031 1032 1036 1037 1038 1020 1021 1022 1044 1023 1024 1025 1033 1026 1027 1028 1039) + ) (tilegroup (name "Forest (Background)") - (tiles - 0 0 1073 1074 - 0 0 1081 1082 - 0 1088 1089 1090 - 1095 1096 1097 1098 - 1103 1104 1105 1106 - 1111 1112 1113 1114 - 1119 1120 1121 1122 - 1127 1128 1129 1130 - 0 0 1137 1138 - 0 0 1145 1146 - 0 0 1153 1154 - 0 0 1161 1162 - 1075 0 0 0 - 1083 1084 0 0 - 1091 1092 0 0 - 1099 1100 1101 0 - 1107 1108 1109 1110 - 1115 1116 1117 1118 - 1123 1124 1125 1126 - 1131 1132 1133 1134 - 1139 1140 1141 0 - 1147 1148 0 0 - 1155 1156 0 0 - 1163 1164 0 0 - 0 1168 1169 1170 - 0 1174 1175 1176 - 1179 1180 1181 1182 - 1185 1186 1187 1188 - 1191 1192 1193 1194 - 1197 1198 1199 1200 - 1191 1192 1193 1194 - 1197 1198 1199 1200 - 1203 1204 1205 1206 - 1209 1210 1211 1212 - 1177 0 1219 1220 - 1183 0 1225 1226 - 1189 1190 1217 1218 - 1195 0 1223 1224 - 1201 1190 1229 1230 - 1195 0 1235 1236 - 1201 1202 0 0 - 1207 0 0 0 - 1213 1214 0 0 - 0 1240 1241 1242 - 1243 1244 1245 1246 - 1247 1248 1249 1250 - 1251 1252 1253 1254 - 1255 1256 1257 1258 - 1259 1260 1261 1262 - 1263 1264 1265 1266 - 1267 1268 1269 1270 - 1271 1272 1273 1274 - 1275 1276 1277 1278 - 1279 1280 1281 1282 - 1283 1284 1285 1286 - 1287 1288 1303 1304 - 1289 1290 1305 1306 - 1291 1292 1307 1308 - 1293 1294 1309 1310 - 1295 1296 0 0 - 1297 1298 0 0 - 1299 1300 0 0 - 1301 1302 0 0 -402 -403 -404 -405 -406 -407 -408 -409 -410 -411 -412 -413 -414 -415 -416 -417 -418 -419 -420 -421 -422 -423 -424 -425 -426 -427 -428 -429 -430 -431 -432 -433 -434 -435 -436 -437 -438 -439 -440 -441 -442 -443 -444 -445 -446 -447 -448 -449 -450 -451 -452 -453 -454 -455 -456 -457 - - -)) - + (tiles 0 1073 1074 1081 1082 1088 1089 1090 1095 1096 1097 1098 1103 1104 1105 1106 1111 1112 1113 1114 1119 1120 1121 1122 1127 1128 1129 1130 1137 1138 1145 1146 1153 1154 1161 1162 1075 1083 1084 1091 1092 1099 1100 1101 1107 1108 1109 1110 1115 1116 1117 1118 1123 1124 1125 1126 1131 1132 1133 1134 1139 1140 1141 1147 1148 1155 1156 1163 1164 1168 1169 1170 1174 1175 1176 1179 1180 1181 1182 1185 1186 1187 1188 1191 1192 1193 1194 1197 1198 1199 1200 1203 1204 1205 1206 1209 1210 1211 1212 1177 1219 1220 1183 1225 1226 1189 1190 1217 1218 1195 1223 1224 1201 1229 1230 1235 1236 1202 1207 1213 1214 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1303 1304 1289 1290 1305 1306 1291 1292 1307 1308 1293 1294 1309 1310 1295 1296 1297 1298 1299 1300 1301 1302 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457) + ) (tilegroup (name "Block") - (tiles - 27 28 29 47 - 48 50 49 211 - 77 51 52 212 - 78 62 61 213 - 44 83 84 102 140 103 104 105 112 128) - ) + (tiles 27 28 29 47 48 50 49 211 77 51 52 212 78 62 61 213 44 83 84 102 140 103 104 105 112 128) + ) (tilegroup (name "Background") - (tiles - 106 107 108 24 - 109 110 111 25 - 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101) - ) + (tiles 106 107 108 24 109 110 111 25 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101) + ) (tilegroup (name "Points") (tiles 132 133) - ) - + ) (tilegroup (name "Misc") (tiles 75 76 200 201 79 80 126 127 129 130 134 135 81 295 296 297 298 173 174) ) (tilegroup (name "Pipe") - (tiles 53 55 0 0 - 54 56 0 0 - 57 58 0 0 - 59 60 0 0 ) + (tiles 53 55 0 54 56 57 58 59 60) ) (tilegroup (name "Grey") @@ -206,8 +38,7 @@ ) (tilegroup (name "Signs") - (tiles 136 137 141 142 - 138 139 143 144 ) + (tiles 136 137 141 142 138 139 143 144) ) (tilegroup (name "Grasslands") @@ -215,10 +46,7 @@ ) (tilegroup (name "Jungle") - (tiles 301 302 303 312 - 304 305 306 0 - 307 308 309 0 - 310 311 0 0 ) + (tiles 301 302 303 312 304 305 306 0 307 308 309 310 311) ) (tilegroup (name "Slopes") @@ -235,7 +63,7 @@ (tilegroup (name "Waterfall-edgecloud") (tiles 195 196 197 198 199) - ) + ) (tile (id 0) (editor-images "bonus-fireflower.png") @@ -2266,233 +2094,342 @@ ) (slope-type 0) ) - -(tile + (tile (id 402) (images - (region "foresttiles-12.png" 0 0 32 32))) -(tile + (region "foresttiles-12.png" 0 0 32 32) + ) + ) + (tile (id 403) (images - (region "foresttiles-12.png" 32 0 32 32))) -(tile + (region "foresttiles-12.png" 32 0 32 32) + ) + ) + (tile (id 404) (images - (region "foresttiles-12.png" 64 0 32 32))) -(tile + (region "foresttiles-12.png" 64 0 32 32) + ) + ) + (tile (id 405) (images - (region "foresttiles-12.png" 96 0 32 32))) -(tile + (region "foresttiles-12.png" 96 0 32 32) + ) + ) + (tile (id 406) (images - (region "foresttiles-12.png" 0 32 32 32))) -(tile + (region "foresttiles-12.png" 0 32 32 32) + ) + ) + (tile (id 407) (images - (region "foresttiles-12.png" 32 32 32 32))) -(tile + (region "foresttiles-12.png" 32 32 32 32) + ) + ) + (tile (id 408) (images - (region "foresttiles-12.png" 64 32 32 32))) -(tile + (region "foresttiles-12.png" 64 32 32 32) + ) + ) + (tile (id 409) (images - (region "foresttiles-12.png" 96 32 32 32))) -(tile + (region "foresttiles-12.png" 96 32 32 32) + ) + ) + (tile (id 410) (images - (region "foresttiles-12.png" 0 64 32 32))) -(tile + (region "foresttiles-12.png" 0 64 32 32) + ) + ) + (tile (id 411) (images - (region "foresttiles-12.png" 32 64 32 32))) -(tile + (region "foresttiles-12.png" 32 64 32 32) + ) + ) + (tile (id 412) (images - (region "foresttiles-12.png" 64 64 32 32))) -(tile + (region "foresttiles-12.png" 64 64 32 32) + ) + ) + (tile (id 413) (images - (region "foresttiles-12.png" 96 64 32 32))) -(tile + (region "foresttiles-12.png" 96 64 32 32) + ) + ) + (tile (id 414) (images - (region "foresttiles-12.png" 0 96 32 32))) -(tile + (region "foresttiles-12.png" 0 96 32 32) + ) + ) + (tile (id 415) (images - (region "foresttiles-12.png" 32 96 32 32))) -(tile + (region "foresttiles-12.png" 32 96 32 32) + ) + ) + (tile (id 416) (images - (region "foresttiles-12.png" 64 96 32 32))) -(tile + (region "foresttiles-12.png" 64 96 32 32) + ) + ) + (tile (id 417) (images - (region "foresttiles-12.png" 96 96 32 32))) -(tile + (region "foresttiles-12.png" 96 96 32 32) + ) + ) + (tile (id 418) (images - (region "foresttiles-12.png" 0 128 32 32))) -(tile + (region "foresttiles-12.png" 0 128 32 32) + ) + ) + (tile (id 419) (images - (region "foresttiles-12.png" 32 128 32 32))) -(tile + (region "foresttiles-12.png" 32 128 32 32) + ) + ) + (tile (id 420) (images - (region "foresttiles-12.png" 64 128 32 32))) -(tile + (region "foresttiles-12.png" 64 128 32 32) + ) + ) + (tile (id 421) (images - (region "foresttiles-12.png" 96 128 32 32))) -(tile + (region "foresttiles-12.png" 96 128 32 32) + ) + ) + (tile (id 422) (images - (region "foresttiles-12.png" 0 160 32 32))) -(tile + (region "foresttiles-12.png" 0 160 32 32) + ) + ) + (tile (id 423) (images - (region "foresttiles-12.png" 32 160 32 32))) -(tile + (region "foresttiles-12.png" 32 160 32 32) + ) + ) + (tile (id 424) (images - (region "foresttiles-12.png" 64 160 32 32))) -(tile + (region "foresttiles-12.png" 64 160 32 32) + ) + ) + (tile (id 425) (images - (region "foresttiles-12.png" 96 160 32 32))) - -(tile + (region "foresttiles-12.png" 96 160 32 32) + ) + ) + (tile (id 426) (images - (region "foresttiles-12.png" 128 0 32 32))) -(tile + (region "foresttiles-12.png" 128 0 32 32) + ) + ) + (tile (id 427) (images - (region "foresttiles-12.png" 160 0 32 32))) -(tile + (region "foresttiles-12.png" 160 0 32 32) + ) + ) + (tile (id 428) (images - (region "foresttiles-12.png" 192 0 32 32))) -(tile + (region "foresttiles-12.png" 192 0 32 32) + ) + ) + (tile (id 429) (images - (region "foresttiles-12.png" 224 0 32 32))) -(tile + (region "foresttiles-12.png" 224 0 32 32) + ) + ) + (tile (id 430) (images - (region "foresttiles-12.png" 128 32 32 32))) -(tile + (region "foresttiles-12.png" 128 32 32 32) + ) + ) + (tile (id 431) (images - (region "foresttiles-12.png" 160 32 32 32))) -(tile + (region "foresttiles-12.png" 160 32 32 32) + ) + ) + (tile (id 432) (images - (region "foresttiles-12.png" 192 32 32 32))) -(tile + (region "foresttiles-12.png" 192 32 32 32) + ) + ) + (tile (id 433) (images - (region "foresttiles-12.png" 224 32 32 32))) -(tile + (region "foresttiles-12.png" 224 32 32 32) + ) + ) + (tile (id 434) (images - (region "foresttiles-12.png" 128 64 32 32))) -(tile + (region "foresttiles-12.png" 128 64 32 32) + ) + ) + (tile (id 435) (images - (region "foresttiles-12.png" 160 64 32 32))) -(tile + (region "foresttiles-12.png" 160 64 32 32) + ) + ) + (tile (id 436) (images - (region "foresttiles-12.png" 192 64 32 32))) -(tile + (region "foresttiles-12.png" 192 64 32 32) + ) + ) + (tile (id 437) (images - (region "foresttiles-12.png" 224 64 32 32))) -(tile + (region "foresttiles-12.png" 224 64 32 32) + ) + ) + (tile (id 438) (images - (region "foresttiles-12.png" 128 96 32 32))) -(tile + (region "foresttiles-12.png" 128 96 32 32) + ) + ) + (tile (id 439) (images - (region "foresttiles-12.png" 160 96 32 32))) -(tile + (region "foresttiles-12.png" 160 96 32 32) + ) + ) + (tile (id 440) (images - (region "foresttiles-12.png" 192 96 32 32))) -(tile + (region "foresttiles-12.png" 192 96 32 32) + ) + ) + (tile (id 441) (images - (region "foresttiles-12.png" 224 96 32 32))) -(tile + (region "foresttiles-12.png" 224 96 32 32) + ) + ) + (tile (id 442) (images - (region "foresttiles-12.png" 128 128 32 32))) -(tile + (region "foresttiles-12.png" 128 128 32 32) + ) + ) + (tile (id 443) (images - (region "foresttiles-12.png" 160 128 32 32))) -(tile + (region "foresttiles-12.png" 160 128 32 32) + ) + ) + (tile (id 444) (images - (region "foresttiles-12.png" 192 128 32 32))) -(tile + (region "foresttiles-12.png" 192 128 32 32) + ) + ) + (tile (id 445) (images - (region "foresttiles-12.png" 224 128 32 32))) -(tile + (region "foresttiles-12.png" 224 128 32 32) + ) + ) + (tile (id 446) (images - (region "foresttiles-12.png" 128 160 32 32))) -(tile + (region "foresttiles-12.png" 128 160 32 32) + ) + ) + (tile (id 447) (images - (region "foresttiles-12.png" 160 160 32 32))) -(tile + (region "foresttiles-12.png" 160 160 32 32) + ) + ) + (tile (id 448) (images - (region "foresttiles-12.png" 192 160 32 32))) -(tile + (region "foresttiles-12.png" 192 160 32 32) + ) + ) + (tile (id 449) (images - (region "foresttiles-12.png" 224 160 32 32))) -(tile + (region "foresttiles-12.png" 224 160 32 32) + ) + ) + (tile (id 450) (images - (region "foresttiles-12.png" 128 192 32 32))) -(tile + (region "foresttiles-12.png" 128 192 32 32) + ) + ) + (tile (id 451) (images - (region "foresttiles-12.png" 160 192 32 32))) -(tile + (region "foresttiles-12.png" 160 192 32 32) + ) + ) + (tile (id 452) (images - (region "foresttiles-12.png" 192 192 32 32))) -(tile + (region "foresttiles-12.png" 192 192 32 32) + ) + ) + (tile (id 453) (images - (region "foresttiles-12.png" 224 192 32 32))) -(tile + (region "foresttiles-12.png" 224 192 32 32) + ) + ) + (tile (id 454) (images - (region "foresttiles-12.png" 128 224 32 32))) -(tile + (region "foresttiles-12.png" 128 224 32 32) + ) + ) + (tile (id 455) (images - (region "foresttiles-12.png" 160 224 32 32))) -(tile + (region "foresttiles-12.png" 160 224 32 32) + ) + ) + (tile (id 456) (images - (region "foresttiles-12.png" 192 224 32 32))) -(tile + (region "foresttiles-12.png" 192 224 32 32) + ) + ) + (tile (id 457) (images - (region "foresttiles-12.png" 224 224 32 32))) - + (region "foresttiles-12.png" 224 224 32 32) + ) + ) (tile (id 1000) (images @@ -2863,14 +2800,16 @@ (images (region "foresttiles-6.png" 0 32 32 32) ) - (slope-type 0) + (slope-type 66) + (data 66) ) (tile (id 1054) (images (region "foresttiles-6.png" 32 32 32 32) ) - (slope-type 0) + (slope-type 48) + (data 48) ) (tile (id 1055) @@ -2878,7 +2817,8 @@ (region "foresttiles-6.png" 0 64 32 32) ) (solid #t) - (slope-type 0) + (slope-type 50) + (data 50) ) (tile (id 1056) @@ -2886,7 +2826,8 @@ (region "foresttiles-6.png" 32 64 32 32) ) (solid #t) - (slope-type 0) + (slope-type 64) + (data 64) ) (tile (id 1057) @@ -2907,14 +2848,12 @@ (images (region "foresttiles-7.png" 32 0 32 32) ) - (slope-type 0) ) (tile (id 1061) (images (region "foresttiles-7.png" 64 0 32 32) ) - (slope-type 0) ) (tile (id 1063) @@ -2922,7 +2861,8 @@ (region "foresttiles-7.png" 0 32 32 32) ) (solid #t) - (slope-type 0) + (slope-type 18) + (data 18) ) (tile (id 1064) @@ -2930,7 +2870,8 @@ (region "foresttiles-7.png" 32 32 32 32) ) (solid #t) - (slope-type 0) + (slope-type 34) + (data 34) ) (tile (id 1065) @@ -2938,7 +2879,8 @@ (region "foresttiles-7.png" 64 32 32 32) ) (solid #t) - (slope-type 0) + (slope-type 32) + (data 32) ) (tile (id 1066) @@ -2946,7 +2888,8 @@ (region "foresttiles-7.png" 96 32 32 32) ) (solid #t) - (slope-type 0) + (slope-type 16) + (data 16) ) (tile (id 1067) |
From: Matze B. <mat...@us...> - 2004-11-25 16:39:08
|
Update of /cvsroot/super-tux/supertux In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3933 Modified Files: TODO Log Message: added some more non-45 degree triangle modes Index: TODO =================================================================== RCS file: /cvsroot/super-tux/supertux/TODO,v retrieving revision 1.91 retrieving revision 1.92 diff -u -d -r1.91 -r1.92 --- TODO 25 Nov 2004 00:49:32 -0000 1.91 +++ TODO 25 Nov 2004 16:38:27 -0000 1.92 @@ -75,7 +75,7 @@ when hitting a block from the side when falling. - done for rectangles, fixes the issues with blocks and enemies hitting when they should get squished, still it's not optimal as when hitting 2 - blocks now only 1 gets cleared... + blocks now only 1 gets cleared... - ok * rethink slopes collision feedback... tux becomes too slow when walking up and starts jumping when walking down * think about an attachement mechanism for moving platforms |
From: Matze B. <mat...@us...> - 2004-11-25 16:39:07
|
Update of /cvsroot/super-tux/supertux/lib/special In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3933/lib/special Modified Files: collision.cpp Log Message: added some more non-45 degree triangle modes Index: collision.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/lib/special/collision.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- collision.cpp 25 Nov 2004 13:15:57 -0000 1.4 +++ collision.cpp 25 Nov 2004 16:38:30 -0000 1.5 @@ -83,29 +83,57 @@ { if(!rectangle_rectangle(hit, rect, movement, (const Rectangle&) triangle)) return false; - + Vector normal; float c; Vector p1; - switch(triangle.dir) { + Vector tp1, tp2; + switch(triangle.dir & AATriangle::DEFORM_MASK) { + case 0: + tp1 = triangle.p1; + tp2 = triangle.p2; + break; + case AATriangle::DEFORM1: + tp1 = Vector(triangle.p1.x, triangle.p1.y + triangle.get_height()/2); + tp2 = triangle.p2; + break; + case AATriangle::DEFORM2: + tp1 = triangle.p1; + tp2 = Vector(triangle.p2.x, triangle.p1.y + triangle.get_height()/2); + break; + case AATriangle::DEFORM3: + tp1 = triangle.p1; + tp2 = Vector(triangle.p1.x + triangle.get_width()/2, triangle.p2.y); + break; + case AATriangle::DEFORM4: + tp1 = Vector(triangle.p1.x + triangle.get_width()/2, triangle.p1.y); + tp2 = triangle.p2; + break; + default: + assert(false); + } + + switch(triangle.dir & AATriangle::DIRECTION_MASK) { case AATriangle::SOUTHWEST: p1 = Vector(rect.p1.x, rect.p2.y); - makePlane(triangle.p1, triangle.p2, normal, c); + makePlane(tp1, tp2, normal, c); break; case AATriangle::NORTHEAST: p1 = Vector(rect.p2.x, rect.p1.y); - makePlane(triangle.p2, triangle.p1, normal, c); + makePlane(tp2, tp1, normal, c); break; case AATriangle::SOUTHEAST: p1 = rect.p2; - makePlane(Vector(triangle.p1.x, triangle.p2.y), - Vector(triangle.p2.x, triangle.p1.y), normal, c); + makePlane(Vector(tp1.x, tp2.y), + Vector(tp2.x, tp1.y), normal, c); break; case AATriangle::NORTHWEST: p1 = rect.p1; - makePlane(Vector(triangle.p2.x, triangle.p1.y), - Vector(triangle.p1.x, triangle.p2.y), normal, c); + makePlane(Vector(tp2.x, tp1.y), + Vector(tp1.x, tp2.y), normal, c); break; + default: + assert(false); } float n_p1 = -(normal * p1); |
From: Matze B. <mat...@us...> - 2004-11-25 16:38:57
|
Update of /cvsroot/super-tux/supertux/src/badguy In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3933/src/badguy Modified Files: dispenser.cpp Log Message: added some more non-45 degree triangle modes Index: dispenser.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/badguy/dispenser.cpp,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- dispenser.cpp 25 Nov 2004 16:22:05 -0000 1.7 +++ dispenser.cpp 25 Nov 2004 16:38:31 -0000 1.8 @@ -51,9 +51,9 @@ void Dispenser::active_action(float ) { - if (dispense_timer.check()) { - launch_badguy(); - } + if (dispense_timer.check()) { + launch_badguy(); + } } HitResponse @@ -78,8 +78,8 @@ void Dispenser::launch_badguy() { - //FIXME: Does is_offscreen() work right here? - if (!is_offscreen()) { + //FIXME: Does is_offscreen() work right here? + if (!is_offscreen()) { if (badguy == "snowball") Sector::current()->add_object(new SnowBall(get_pos().x, get_pos().y, dir)); else if (badguy == "bouncingsnowball") @@ -89,6 +89,7 @@ else if (badguy == "mriceblock") Sector::current()->add_object(new MrIceBlock(get_pos().x, get_pos().y, dir)); else if (badguy == "random") - {} - } + {} + } } + |
From: Matze B. <mat...@us...> - 2004-11-25 16:38:56
|
Update of /cvsroot/super-tux/supertux/lib/math In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3933/lib/math Modified Files: aatriangle.h Log Message: added some more non-45 degree triangle modes Index: aatriangle.h =================================================================== RCS file: /cvsroot/super-tux/supertux/lib/math/aatriangle.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- aatriangle.h 20 Nov 2004 22:18:32 -0000 1.1 +++ aatriangle.h 25 Nov 2004 16:38:29 -0000 1.2 @@ -20,21 +20,32 @@ * | \ \ | / | | / * | \ \ | / | | / * *---* * *---* * + * + * Deform flags: (see docs/aatriangletypes.png for details) */ enum Direction { - SOUTHWEST, NORTHEAST, SOUTHEAST, NORTHWEST + SOUTHWEST = 0, + NORTHEAST, + SOUTHEAST, + NORTHWEST, + DIRECTION_MASK = 0x0003, + DEFORM1 = 0x0010, + DEFORM2 = 0x0020, + DEFORM3 = 0x0030, + DEFORM4 = 0x0040, + DEFORM_MASK = 0x0070 }; AATriangle() : dir(SOUTHWEST) { } - AATriangle(const Vector& v1, const Vector& v2, Direction newdir) + AATriangle(const Vector& v1, const Vector& v2, int newdir) : Rectangle(v1, v2), dir(newdir) { } - Direction dir; + int dir; }; } |
From: Matze B. <mat...@us...> - 2004-11-25 16:38:55
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3933/src Modified Files: player.cpp sector.cpp Log Message: added some more non-45 degree triangle modes Index: player.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/player.cpp,v retrieving revision 1.207 retrieving revision 1.208 diff -u -d -r1.207 -r1.208 --- player.cpp 25 Nov 2004 15:41:28 -0000 1.207 +++ player.cpp 25 Nov 2004 16:38:30 -0000 1.208 @@ -857,10 +857,6 @@ HitResponse Player::collision(GameObject& other, const CollisionHit& hit) { - if(dying) { - return FORCE_MOVE; - } - if(other.get_flags() & FLAG_SOLID) { if(hit.normal.y < 0) { // landed on floor? if (physic.get_velocity_y() < 0) Index: sector.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/sector.cpp,v retrieving revision 1.48 retrieving revision 1.49 diff -u -d -r1.48 -r1.49 --- sector.cpp 25 Nov 2004 11:16:02 -0000 1.48 +++ sector.cpp 25 Nov 2004 16:38:31 -0000 1.49 @@ -673,23 +673,7 @@ AATriangle triangle; Vector p1(x*32, y*32); Vector p2((x+1)*32, (y+1)*32); - switch(tile->data) { - case 0: - triangle = AATriangle(p1, p2, AATriangle::SOUTHWEST); - break; - case 1: - triangle = AATriangle(p1, p2, AATriangle::NORTHEAST); - break; - case 2: - triangle = AATriangle(p1, p2, AATriangle::SOUTHEAST); - break; - case 3: - triangle = AATriangle(p1, p2, AATriangle::NORTHWEST); - break; - default: - printf("Invalid slope angle in tile %d !\n", tile->id); - break; - } + triangle = AATriangle(p1, p2, tile->data); if(Collision::rectangle_aatriangle(temphit, dest, object->movement, triangle)) { |
From: Matze B. <mat...@us...> - 2004-11-25 16:38:38
|
Update of /cvsroot/super-tux/supertux/docs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3933/docs Added Files: aatriangletypes.dia aatriangletypes.png Log Message: added some more non-45 degree triangle modes --- NEW FILE: aatriangletypes.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: aatriangletypes.dia --- (This appears to be a binary file; contents omitted.) |
Update of /cvsroot/super-tux/supertux/src/badguy In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv553/src/badguy Modified Files: dispenser.cpp mrbomb.cpp mrbomb.h mriceblock.cpp mriceblock.h nolok_01.cpp nolok_01.h snowball.cpp snowball.h Log Message: updated dispenser -- can summon mriceblock, snowball, bouncing_snowball and mrbomb now fixed message display of the secret area trigger ended some more of Nolok's minor troubles :) Index: nolok_01.h =================================================================== RCS file: /cvsroot/super-tux/supertux/src/badguy/nolok_01.h,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- nolok_01.h 25 Nov 2004 14:59:04 -0000 1.3 +++ nolok_01.h 25 Nov 2004 16:22:05 -0000 1.4 @@ -18,8 +18,8 @@ protected: bool collision_squished(Player& player); Timer2 action_timer; - enum { WALKING, JUMPING, SHOOTING }; - int action; + enum Actions { WALKING, JUMPING, SHOOTING }; + Actions action; }; #endif Index: snowball.h =================================================================== RCS file: /cvsroot/super-tux/supertux/src/badguy/snowball.h,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- snowball.h 24 Nov 2004 18:19:51 -0000 1.2 +++ snowball.h 25 Nov 2004 16:22:05 -0000 1.3 @@ -7,7 +7,7 @@ { public: SnowBall(LispReader& reader); - SnowBall(float pos_x, float pos_y); + SnowBall(float pos_x, float pos_y, Direction d); void activate(); void write(LispWriter& writer); @@ -15,6 +15,8 @@ protected: bool collision_squished(Player& player); + bool set_direction; + Direction initial_direction; }; #endif Index: mriceblock.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/badguy/mriceblock.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- mriceblock.cpp 25 Nov 2004 00:49:34 -0000 1.3 +++ mriceblock.cpp 25 Nov 2004 16:22:05 -0000 1.4 @@ -13,6 +13,18 @@ reader.read_float("y", start_position.y); bbox.set_size(31.8, 31.8); sprite = sprite_manager->create("mriceblock"); + set_direction = false; +} + +MrIceBlock::MrIceBlock(float pos_x, float pos_y, Direction d) + : ice_state(ICESTATE_NORMAL), squishcount(0) +{ + start_position.x = pos_x; + start_position.y = pos_y; + bbox.set_size(31.8, 31.8); + sprite = sprite_manager->create("mriceblock"); + set_direction = true; + initial_direction = d; } void @@ -29,6 +41,7 @@ void MrIceBlock::activate() { + if (set_direction) {dir = initial_direction;} physic.set_velocity_x(dir == LEFT ? -WALKSPEED : WALKSPEED); sprite->set_action(dir == LEFT ? "left" : "right"); } Index: snowball.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/badguy/snowball.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- snowball.cpp 25 Nov 2004 00:49:34 -0000 1.4 +++ snowball.cpp 25 Nov 2004 16:22:05 -0000 1.5 @@ -10,14 +10,17 @@ reader.read_float("y", start_position.y); bbox.set_size(31.8, 31.8); sprite = sprite_manager->create("snowball"); + set_direction = false; } -SnowBall::SnowBall(float pos_x, float pos_y) +SnowBall::SnowBall(float pos_x, float pos_y, Direction d) { start_position.x = pos_x; start_position.y = pos_y; bbox.set_size(31.8, 31.8); sprite = sprite_manager->create("snowball"); + set_direction = true; + initial_direction = d; } void @@ -34,6 +37,7 @@ void SnowBall::activate() { + if (set_direction) {dir = initial_direction;} physic.set_velocity_x(dir == LEFT ? -WALKSPEED : WALKSPEED); sprite->set_action(dir == LEFT ? "left" : "right"); } Index: dispenser.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/badguy/dispenser.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- dispenser.cpp 25 Nov 2004 13:19:37 -0000 1.6 +++ dispenser.cpp 25 Nov 2004 16:22:05 -0000 1.7 @@ -3,6 +3,8 @@ #include "dispenser.h" #include "badguy/bouncing_snowball.h" #include "badguy/snowball.h" +#include "badguy/mrbomb.h" +#include "badguy/mriceblock.h" Dispenser::Dispenser(LispReader& reader) @@ -69,9 +71,9 @@ } //TODO: Add launching velocity to badguys -// Add more badguys and randomizer +// Add randomizer // Clean up stuff I copied without understanding what it does :) -// Stop dispensing when game is paused +// Stop dispensing when game is paused (timer related problem) // Lots-O-Stuff (tm) void Dispenser::launch_badguy() @@ -79,9 +81,13 @@ //FIXME: Does is_offscreen() work right here? if (!is_offscreen()) { if (badguy == "snowball") - Sector::current()->add_object(new SnowBall(get_pos().x-2, get_pos().y)); + Sector::current()->add_object(new SnowBall(get_pos().x, get_pos().y, dir)); else if (badguy == "bouncingsnowball") - Sector::current()->add_object(new BouncingSnowball(get_pos().x-2, get_pos().y, dir)); + Sector::current()->add_object(new BouncingSnowball(get_pos().x, get_pos().y, dir)); + else if (badguy == "mrbomb") + Sector::current()->add_object(new MrBomb(get_pos().x, get_pos().y, dir)); + else if (badguy == "mriceblock") + Sector::current()->add_object(new MrIceBlock(get_pos().x, get_pos().y, dir)); else if (badguy == "random") {} } Index: mrbomb.h =================================================================== RCS file: /cvsroot/super-tux/supertux/src/badguy/mrbomb.h,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- mrbomb.h 24 Nov 2004 18:19:51 -0000 1.2 +++ mrbomb.h 25 Nov 2004 16:22:05 -0000 1.3 @@ -7,7 +7,7 @@ { public: MrBomb(LispReader& reader); - MrBomb(float pos_x, float pos_y); + MrBomb(float pos_x, float pos_y, Direction d); void activate(); void write(LispWriter& writer); @@ -15,6 +15,8 @@ protected: bool collision_squished(Player& player); + bool set_direction; + Direction initial_direction; }; #endif Index: nolok_01.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/badguy/nolok_01.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- nolok_01.cpp 25 Nov 2004 14:59:04 -0000 1.4 +++ nolok_01.cpp 25 Nov 2004 16:22:05 -0000 1.5 @@ -11,7 +11,6 @@ static const float WALKSPEED = 90; //TODO: Create sprite, give multiple hitpoints, limit max number of snowballs -// Can only be killed when jumping, no idea why // Stop actions when pause button is hit (probably a general problem of timers) Nolok_01::Nolok_01(LispReader& reader) { @@ -52,27 +51,35 @@ void Nolok_01::active_action(float elapsed_time) { - movement = physic.get_movement(elapsed_time); if (action_timer.check()) { - if (action == WALKING) { - physic.set_velocity_y(700); - action = JUMPING; - action_timer.start(JUMP_TIME); - } - else if (action == JUMPING) { + switch (action) { + case WALKING: + { + physic.set_velocity_y(700); + action = JUMPING; + action_timer.start(JUMP_TIME); + break; + } + case JUMPING: + { sprite->set_action("throw"); action = SHOOTING; action_timer.start(SHOOT_TIME); - } - else if (action == SHOOTING) { + break; + } + case SHOOTING: + { Sector::current()->add_object(new BouncingSnowball(get_pos().x - 64, get_pos().y, LEFT)); Sector::current()->add_object(new BouncingSnowball(get_pos().x + 64, get_pos().y, RIGHT)); physic.set_velocity_x(dir == LEFT ? -WALKSPEED : WALKSPEED); sprite->set_action(dir == LEFT ? "left" : "right"); action = WALKING; action_timer.start(WALK_TIME); + break; + } } } + movement = physic.get_movement(elapsed_time); } bool Index: mrbomb.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/badguy/mrbomb.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- mrbomb.cpp 25 Nov 2004 00:49:34 -0000 1.5 +++ mrbomb.cpp 25 Nov 2004 16:22:05 -0000 1.6 @@ -11,14 +11,17 @@ reader.read_float("y", start_position.y); bbox.set_size(31.8, 31.8); sprite = sprite_manager->create("mrbomb"); + set_direction = false; } -MrBomb::MrBomb(float pos_x, float pos_y) +MrBomb::MrBomb(float pos_x, float pos_y, Direction d) { start_position.x = pos_x; start_position.y = pos_y; bbox.set_size(31.8, 31.8); sprite = sprite_manager->create("mrbomb"); + set_direction = true; + initial_direction = d; } void @@ -35,6 +38,7 @@ void MrBomb::activate() { + if (set_direction) {dir = initial_direction;} physic.set_velocity_x(dir == LEFT ? -WALKSPEED : WALKSPEED); sprite->set_action(dir == LEFT ? "left" : "right"); } Index: mriceblock.h =================================================================== RCS file: /cvsroot/super-tux/supertux/src/badguy/mriceblock.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- mriceblock.h 20 Nov 2004 22:14:39 -0000 1.1 +++ mriceblock.h 25 Nov 2004 16:22:05 -0000 1.2 @@ -7,6 +7,7 @@ { public: MrIceBlock(LispReader& reader); + MrIceBlock(float pos_x, float pos_y, Direction d); void activate(); void write(LispWriter& writer); @@ -26,6 +27,8 @@ IceState ice_state; Timer2 flat_timer; int squishcount; + bool set_direction; + Direction initial_direction; }; #endif |
From: Marek M. <wa...@us...> - 2004-11-25 16:22:15
|
Update of /cvsroot/super-tux/supertux/src/trigger In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv553/src/trigger Modified Files: secretarea_trigger.cpp secretarea_trigger.h Log Message: updated dispenser -- can summon mriceblock, snowball, bouncing_snowball and mrbomb now fixed message display of the secret area trigger ended some more of Nolok's minor troubles :) Index: secretarea_trigger.h =================================================================== RCS file: /cvsroot/super-tux/supertux/src/trigger/secretarea_trigger.h,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- secretarea_trigger.h 24 Nov 2004 17:33:50 -0000 1.4 +++ secretarea_trigger.h 25 Nov 2004 16:22:05 -0000 1.5 @@ -22,6 +22,7 @@ private: std::string message; Timer2 message_timer; + bool message_displayed; }; #endif Index: secretarea_trigger.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/trigger/secretarea_trigger.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- secretarea_trigger.cpp 24 Nov 2004 17:33:50 -0000 1.4 +++ secretarea_trigger.cpp 25 Nov 2004 16:22:05 -0000 1.5 @@ -4,8 +4,9 @@ #include "utils/lispwriter.h" #include "gameloop.h" -#define MESSAGE_TIME 3 +#define MESSAGE_TIME 3.5 +//TODO: Count numbers of triggered/total secret areas SecretAreaTrigger::SecretAreaTrigger(LispReader& reader) { reader.read_float("x", bbox.p1.x); @@ -13,6 +14,7 @@ bbox.set_size(32, 32); reader.read_string("message", message); + message_displayed = false; } SecretAreaTrigger::SecretAreaTrigger(const Vector& pos) @@ -20,6 +22,7 @@ bbox.set_pos(pos); bbox.set_size(32, 32); message = "You found a secret area!"; + message_displayed = false; } SecretAreaTrigger::~SecretAreaTrigger() @@ -44,9 +47,11 @@ SecretAreaTrigger::draw(DrawingContext& context) { if (message_timer.started()) { + context.push_transform(); + context.set_translation(Vector(0, 0)); Vector pos = Vector(0, screen->h/2 - gold_text->get_height()/2); context.draw_center_text(gold_text, message, pos, LAYER_GUI); - //TODO: Prevent text from scrolling with the rest of the level + context.pop_transform(); } if (message_timer.check()) { remove_me(); @@ -57,6 +62,9 @@ SecretAreaTrigger::event(Player& , EventType type) { if(type == EVENT_TOUCH) { - message_timer.start(MESSAGE_TIME); + if (!message_displayed) { + message_timer.start(MESSAGE_TIME); + message_displayed = true; + } } } |