super-tux-commit Mailing List for Super Tux (Page 51)
Brought to you by:
wkendrick
You can subscribe to this list here.
2004 |
Jan
|
Feb
|
Mar
(94) |
Apr
(500) |
May
(531) |
Jun
(196) |
Jul
(224) |
Aug
(193) |
Sep
(117) |
Oct
(115) |
Nov
(319) |
Dec
(97) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2005 |
Jan
(19) |
Feb
|
Mar
(105) |
Apr
(41) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2006 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(6) |
2007 |
Jan
(1) |
Feb
(2) |
Mar
|
Apr
(1) |
May
|
Jun
|
Jul
(2) |
Aug
(2) |
Sep
|
Oct
|
Nov
|
Dec
|
2008 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
(4) |
Jul
|
Aug
|
Sep
(7) |
Oct
(12) |
Nov
(26) |
Dec
(39) |
2009 |
Jan
(6) |
Feb
(15) |
Mar
(10) |
Apr
(25) |
May
(29) |
Jun
(21) |
Jul
(26) |
Aug
(8) |
Sep
(3) |
Oct
|
Nov
|
Dec
(10) |
2010 |
Jan
(5) |
Feb
(5) |
Mar
(2) |
Apr
|
May
(5) |
Jun
|
Jul
(1) |
Aug
(2) |
Sep
(2) |
Oct
(2) |
Nov
|
Dec
|
From: Ricardo C. <rm...@us...> - 2004-07-07 19:19:28
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6618/src Modified Files: lispreader.cpp Log Message: Added support for data files internationalization by a simple 3 lines code in lispreader's read_string(). To translate a level's title to European Portuguese, I would look at: (title "Hello World!") and add: (title-pt_PT "Olá Mundo!") Also, made display_text_file() using lispreader (to make it i18n too). Unfortunately, there is a crash of lisp_reader in my system (not related), so I wasn't able to give it a try. data/*.txt files also need updating to work. Else, it should just skip it, without crashing. Index: lispreader.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/lispreader.cpp,v retrieving revision 1.26 retrieving revision 1.27 diff -u -d -r1.26 -r1.27 --- lispreader.cpp 29 Jun 2004 12:12:24 -0000 1.26 +++ lispreader.cpp 7 Jul 2004 19:19:19 -0000 1.27 @@ -1208,7 +1208,13 @@ bool LispReader::read_string (const char* name, std::string& str) { - lisp_object_t* obj = search_for (name); + char str_[1204]; + sprintf(str_, "%s-%s", name, getenv("LANG")); + lisp_object_t* obj = search_for (str_); + + if(!obj) + obj = search_for (name); + if (!obj) return false; |
From: Ricardo C. <rm...@us...> - 2004-07-07 17:56:56
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21331/src Modified Files: setup.cpp Log Message: Changed --debug-mode for --debug. Index: setup.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/setup.cpp,v retrieving revision 1.105 retrieving revision 1.106 diff -u -d -r1.105 -r1.106 --- setup.cpp 29 Jun 2004 17:47:36 -0000 1.105 +++ setup.cpp 7 Jul 2004 17:56:47 -0000 1.106 @@ -1038,7 +1038,7 @@ printf("Music disabled \n"); use_music = false; } - else if (strcmp(argv[i], "--debug-mode") == 0) + else if (strcmp(argv[i], "--debug") == 0) { /* Enable the debug-mode */ debug_mode = true; @@ -1067,7 +1067,7 @@ " Define how joystick buttons and axis should be mapped\n" " --leveleditor Opens the leveleditor in a file. (Only works when a file is provided.)\n" " -d, --datadir DIR Load Game data from DIR (default: automatic)\n" - " --debug-mode Enables the debug-mode, which is useful for developers.\n" + " --debug Enables the debug mode, which is useful for developers.\n" " --help Display a help message summarizing command-line\n" " options, license and game controls.\n" " --usage Display a brief message summarizing command-line options.\n" @@ -1106,7 +1106,7 @@ /* Display the usage message: */ - fprintf(fi, _("Usage: %s [--fullscreen] [--opengl] [--disable-sound] [--disable-music] [--debug-mode] | [--usage | --help | --version] [--leveleditor] FILENAME\n"), + fprintf(fi, _("Usage: %s [--fullscreen] [--opengl] [--disable-sound] [--disable-music] [--debug] | [--usage | --help | --version] [--leveleditor] FILENAME\n"), prog); |
From: Ricardo C. <rm...@us...> - 2004-07-07 17:56:11
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21175/src Modified Files: gameloop.cpp gameloop.h level.cpp level.h sector.cpp worldmap.cpp worldmap.h Log Message: Instead of setting the level to be flipped from the level file, it is now passed through the world. This way we can make a level designed to be played the two ways, and then the put them in the world map one after the other. I have played the castle level flipped, and I've to say it is soo damn cool! It is like you were playing a completely different level. It is also possible to set levels to be flipped by using --debug (this will be temporary). Index: sector.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/sector.cpp,v retrieving revision 1.15 retrieving revision 1.16 diff -u -d -r1.15 -r1.16 --- sector.cpp 7 Jul 2004 11:39:35 -0000 1.15 +++ sector.cpp 7 Jul 2004 17:56:01 -0000 1.16 @@ -303,19 +303,19 @@ 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; + 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; + 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); + 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; + spawn->pos.y = solids->get_height()*32 - spawn->pos.y - 32; } } Index: level.h =================================================================== RCS file: /cvsroot/super-tux/supertux/src/level.h,v retrieving revision 1.60 retrieving revision 1.61 diff -u -d -r1.60 -r1.61 --- level.h 7 Jul 2004 11:39:35 -0000 1.60 +++ level.h 7 Jul 2004 17:56:01 -0000 1.61 @@ -49,8 +49,8 @@ const std::string& get_author() const { return author; } - bool is_level_flipped() - { return vertical_flip; } + /** Flips the level vertically */ + void do_vertical_flip(); void add_sector(Sector* sector); @@ -58,10 +58,6 @@ private: void load_old_format(LispReader& reader); - - /** If true, it will flip the level vertically, during the - parsing process */ - bool vertical_flip; }; #endif /*SUPERTUX_LEVEL_H*/ Index: gameloop.h =================================================================== RCS file: /cvsroot/super-tux/supertux/src/gameloop.h,v retrieving revision 1.52 retrieving revision 1.53 diff -u -d -r1.52 -r1.53 --- gameloop.h 31 May 2004 13:43:30 -0000 1.52 +++ gameloop.h 7 Jul 2004 17:56:01 -0000 1.53 @@ -72,6 +72,7 @@ bool game_pause; std::string levelname; + bool flip_level; // the sector and spawnpoint we shoudl spawn after this frame std::string newsector; @@ -84,7 +85,7 @@ DrawingContext* context; Timer time_left; - GameSession(const std::string& level, int mode); + GameSession(const std::string& level, int mode, bool flip_level_ = false); ~GameSession(); /** Enter the busy loop */ Index: level.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/level.cpp,v retrieving revision 1.96 retrieving revision 1.97 diff -u -d -r1.96 -r1.97 --- level.cpp 7 Jul 2004 11:39:35 -0000 1.96 +++ level.cpp 7 Jul 2004 17:56:01 -0000 1.97 @@ -61,8 +61,6 @@ return; } - vertical_flip = false; - for(lisp_object_t* cur = level->get_lisp(); !lisp_nil_p(cur); cur = lisp_cdr(cur)) { std::string token = lisp_symbol(lisp_car(lisp_car(cur))); @@ -75,8 +73,6 @@ author = lisp_string(data); } else if(token == "time") { time_left = lisp_integer(data); - } else if(token == "flip") { - vertical_flip = lisp_boolean(data); } else if(token == "sector") { Sector* sector = new Sector; sector->parse(reader); @@ -88,12 +84,6 @@ } delete level; - - if(vertical_flip) - { - for(Sectors::iterator i = sectors.begin(); i != sectors.end(); ++i) - i->second->do_vertical_flip(); - } } void @@ -102,18 +92,10 @@ reader.read_string("name", name); reader.read_string("author", author); reader.read_int("time", time_left); - vertical_flip = false; - reader.read_bool("flip", vertical_flip); Sector* sector = new Sector; sector->parse_old_format(reader); add_sector(sector); - - if(vertical_flip) - { - for(Sectors::iterator i = sectors.begin(); i != sectors.end(); ++i) - i->second->do_vertical_flip(); - } } void @@ -135,9 +117,6 @@ for(Sectors::iterator i = sectors.begin(); i != sectors.end(); ++i) { - if(vertical_flip) - i->second->do_vertical_flip(); - writer->start_list("sector"); i->second->write(*writer); writer->end_list("sector"); @@ -156,6 +135,13 @@ } void +Level::do_vertical_flip() +{ + for(Sectors::iterator i = sectors.begin(); i != sectors.end(); ++i) + i->second->do_vertical_flip(); +} + +void Level::add_sector(Sector* sector) { sectors.insert(std::make_pair(sector->get_name(), sector)); Index: worldmap.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/worldmap.cpp,v retrieving revision 1.87 retrieving revision 1.88 diff -u -d -r1.87 -r1.88 --- worldmap.cpp 14 Jun 2004 22:45:23 -0000 1.87 +++ worldmap.cpp 7 Jul 2004 17:56:01 -0000 1.88 @@ -428,6 +428,8 @@ reader.read_string("name", level.name); reader.read_int("x", level.x); reader.read_int("y", level.y); + level.vertical_flip = false; + reader.read_bool("flip", level.vertical_flip); levels.push_back(level); } @@ -646,7 +648,7 @@ shrink_fade(Vector((level->x*32 + 16 + offset.x),(level->y*32 + 16 + offset.y)), 500); GameSession session(datadir + "/levels/" + level->name, - ST_GL_LOAD_LEVEL_FILE); + ST_GL_LOAD_LEVEL_FILE, level->vertical_flip); switch (session.run()) { Index: worldmap.h =================================================================== RCS file: /cvsroot/super-tux/supertux/src/worldmap.h,v retrieving revision 1.32 retrieving revision 1.33 diff -u -d -r1.32 -r1.33 --- worldmap.h 8 Jun 2004 14:59:50 -0000 1.32 +++ worldmap.h 7 Jul 2004 17:56:01 -0000 1.33 @@ -136,6 +136,9 @@ std::string title; bool solved; + /** Check if this level should be vertically flipped */ + bool vertical_flip; + /** Filename of the extro text to show once the level is successfully completed */ std::string extro_filename; Index: gameloop.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/gameloop.cpp,v retrieving revision 1.154 retrieving revision 1.155 diff -u -d -r1.154 -r1.155 --- gameloop.cpp 7 Jul 2004 11:39:35 -0000 1.154 +++ gameloop.cpp 7 Jul 2004 17:56:00 -0000 1.155 @@ -59,9 +59,9 @@ GameSession* GameSession::current_ = 0; -GameSession::GameSession(const std::string& levelname_, int mode) +GameSession::GameSession(const std::string& levelname_, int mode, bool flip_level_) : level(0), currentsector(0), st_gl_mode(mode), - end_sequence(NO_ENDSEQUENCE), levelname(levelname_) + end_sequence(NO_ENDSEQUENCE), levelname(levelname_), flip_level(flip_level_) { current_ = this; @@ -74,6 +74,9 @@ context = new DrawingContext(); + if(debug_mode) + flip_level = true; + restart_level(); } @@ -100,6 +103,8 @@ level = new Level; level->load(levelname); + if(flip_level) + level->do_vertical_flip(); currentsector = level->get_sector("main"); if(!currentsector) st_abort("Level has no main sector.", ""); @@ -165,7 +170,7 @@ Vector(0, 400), LAYER_FOREGROUND1); - if(level->is_level_flipped()) + if(flip_level) context.draw_text_center(white_text, _("Level Vertically Flipped!"), Vector(0, 310), LAYER_FOREGROUND1); |
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11947/src Modified Files: badguy.h gameloop.cpp interactive_object.h level.cpp level.h sector.cpp sector.h tilemap.cpp tilemap.h Log Message: Added vertical flipping to levels! To enable it, add to the level file (flip #t) . Index: sector.h =================================================================== RCS file: /cvsroot/super-tux/supertux/src/sector.h,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- sector.h 28 Jun 2004 11:30:27 -0000 1.6 +++ sector.h 7 Jul 2004 11:39:35 -0000 1.7 @@ -112,6 +112,10 @@ the tile which the badguy is walking on an killing him this way */ void trybumpbadguy(const Vector& pos); + /** 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@ */ static Sector* current() { return _current; } Index: sector.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/sector.cpp,v retrieving revision 1.14 retrieving revision 1.15 diff -u -d -r1.14 -r1.15 --- sector.cpp 2 Jul 2004 15:12:48 -0000 1.14 +++ sector.cpp 7 Jul 2004 11:39:35 -0000 1.15 @@ -288,6 +288,38 @@ } void +Sector::do_vertical_flip() +{ + 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; + FlyingPlatform* flying_platform = dynamic_cast<FlyingPlatform*> (*i); + if(flying_platform) + flying_platform->base.y = solids->get_height()*32 - flying_platform->base.y; + Door* door = dynamic_cast<Door*> (*i); + if(door) + door->set_area(door->get_area().x, solids->get_height()*32 - door->get_area().y); + } + + for(SpawnPoints::iterator i = spawnpoints.begin(); i != spawnpoints.end(); + ++i) { + SpawnPoint* spawn = *i; + spawn->pos.y = solids->get_height()*32 - spawn->pos.y; + } +} + +void Sector::add_object(GameObject* object) { gameobjects_new.push_back(object); Index: level.h =================================================================== RCS file: /cvsroot/super-tux/supertux/src/level.h,v retrieving revision 1.59 retrieving revision 1.60 diff -u -d -r1.59 -r1.60 --- level.h 16 Jun 2004 00:40:42 -0000 1.59 +++ level.h 7 Jul 2004 11:39:35 -0000 1.60 @@ -49,12 +49,19 @@ const std::string& get_author() const { return author; } + bool is_level_flipped() + { return vertical_flip; } + void add_sector(Sector* sector); Sector* get_sector(const std::string& name); private: void load_old_format(LispReader& reader); + + /** If true, it will flip the level vertically, during the + parsing process */ + bool vertical_flip; }; #endif /*SUPERTUX_LEVEL_H*/ Index: badguy.h =================================================================== RCS file: /cvsroot/super-tux/supertux/src/badguy.h,v retrieving revision 1.57 retrieving revision 1.58 diff -u -d -r1.57 -r1.58 --- badguy.h 1 Jul 2004 13:39:25 -0000 1.57 +++ badguy.h 7 Jul 2004 11:39:35 -0000 1.58 @@ -99,6 +99,7 @@ bool stay_on_platform; Direction dir; + Vector start_position; Timer frozen_timer; // gets frozen when a ice shot hits it @@ -108,7 +109,6 @@ int squishcount; /// number of times this enemy was squiched Vector target; // Target that badguy is aiming for (wingling uses this) Timer timer; - Vector start_position; Physic physic; float angle; Index: interactive_object.h =================================================================== RCS file: /cvsroot/super-tux/supertux/src/interactive_object.h,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- interactive_object.h 9 Jun 2004 05:23:20 -0000 1.2 +++ interactive_object.h 7 Jul 2004 11:39:35 -0000 1.3 @@ -43,6 +43,9 @@ const base_type& get_area() const { return area; } + void set_area(float x, float y) + { area.x = x; area.y = y; } + protected: base_type area; }; Index: level.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/level.cpp,v retrieving revision 1.95 retrieving revision 1.96 diff -u -d -r1.95 -r1.96 --- level.cpp 29 Jun 2004 13:00:41 -0000 1.95 +++ level.cpp 7 Jul 2004 11:39:35 -0000 1.96 @@ -44,6 +44,7 @@ Level::Level() : name("noname"), author("mr. x"), time_left(500) + { } @@ -60,6 +61,8 @@ return; } + vertical_flip = false; + for(lisp_object_t* cur = level->get_lisp(); !lisp_nil_p(cur); cur = lisp_cdr(cur)) { std::string token = lisp_symbol(lisp_car(lisp_car(cur))); @@ -72,6 +75,8 @@ author = lisp_string(data); } else if(token == "time") { time_left = lisp_integer(data); + } else if(token == "flip") { + vertical_flip = lisp_boolean(data); } else if(token == "sector") { Sector* sector = new Sector; sector->parse(reader); @@ -83,6 +88,12 @@ } delete level; + + if(vertical_flip) + { + for(Sectors::iterator i = sectors.begin(); i != sectors.end(); ++i) + i->second->do_vertical_flip(); + } } void @@ -91,10 +102,18 @@ reader.read_string("name", name); reader.read_string("author", author); reader.read_int("time", time_left); + vertical_flip = false; + reader.read_bool("flip", vertical_flip); Sector* sector = new Sector; sector->parse_old_format(reader); add_sector(sector); + + if(vertical_flip) + { + for(Sectors::iterator i = sectors.begin(); i != sectors.end(); ++i) + i->second->do_vertical_flip(); + } } void @@ -116,6 +135,9 @@ for(Sectors::iterator i = sectors.begin(); i != sectors.end(); ++i) { + if(vertical_flip) + i->second->do_vertical_flip(); + writer->start_list("sector"); i->second->write(*writer); writer->end_list("sector"); Index: tilemap.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/tilemap.cpp,v retrieving revision 1.15 retrieving revision 1.16 diff -u -d -r1.15 -r1.16 --- tilemap.cpp 2 Jul 2004 15:14:48 -0000 1.15 +++ tilemap.cpp 7 Jul 2004 11:39:35 -0000 1.16 @@ -33,13 +33,13 @@ #include "lispwriter.h" TileMap::TileMap() - : solid(false), speed(1), width(0), height(0), layer(LAYER_TILES) + : solid(false), speed(1), width(0), height(0), layer(LAYER_TILES), vertical_flip(false) { tilemanager = TileManager::instance(); } TileMap::TileMap(LispReader& reader) - : solid(false), speed(1), width(0), height(0), layer(LAYER_TILES) + : solid(false), speed(1), width(0), height(0), layer(LAYER_TILES), vertical_flip(false) { tilemanager = TileManager::instance(); @@ -84,7 +84,7 @@ } TileMap::TileMap(int layer_, bool solid_, size_t width_, size_t height_) - : solid(solid_), speed(1), width(width_), height(height_), layer(layer_) + : solid(solid_), speed(1), width(width_), height(height_), layer(layer_), vertical_flip(false) { } @@ -131,9 +131,15 @@ void TileMap::draw(DrawingContext& context) -{ +{ if (speed == 1.0) { + if(vertical_flip) // flip vertically the tiles, in case we are playing this + { // level upside down + context.push_transform(); + context.set_drawing_effect(VERTICAL_FLIP); + } + /** if we don't round here, we'll have a 1 pixel gap on screen sometimes. * I have no idea why */ float start_x = roundf(context.get_translation().x); @@ -153,6 +159,9 @@ tilemanager->draw_tile(context, tiles[ty*width + tx].id, pos, layer); } } + + if(vertical_flip) // disable flipping, if applied + context.pop_transform(); } else { @@ -161,6 +170,8 @@ context.push_transform(); context.set_translation(Vector(trans_x * speed, trans_y * speed)); + if(vertical_flip) + context.set_drawing_effect(VERTICAL_FLIP); float start_x = roundf(context.get_translation().x); float start_y = roundf(context.get_translation().y); @@ -235,6 +246,19 @@ width = new_width; } +void +TileMap::do_vertical_flip() +{ + // remap tiles vertically flipped + for(int y = 0; y < height / 2; ++y) { + for(int x = 0; x < width; ++x) { + std::swap(tiles[y*width + x], tiles[(((height-1)*width) - (y*width)) + x]); + } + } + + vertical_flip = true; +} + Tile* TileMap::get_tile(int x, int y) const { Index: tilemap.h =================================================================== RCS file: /cvsroot/super-tux/supertux/src/tilemap.h,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- tilemap.h 2 Jul 2004 15:14:48 -0000 1.10 +++ tilemap.h 7 Jul 2004 11:39:35 -0000 1.11 @@ -64,6 +64,10 @@ */ void resize(int newwidth, int newheight); + /** Flip the all tile map vertically. The purpose of this is to let + player to play the same level in a different way :) */ + void do_vertical_flip(); + size_t get_width() const { return width; } @@ -96,6 +100,8 @@ float speed; int width, height; int layer; + + bool vertical_flip; }; #endif /*SUPERTUX_TILEMAP_H*/ Index: gameloop.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/gameloop.cpp,v retrieving revision 1.153 retrieving revision 1.154 diff -u -d -r1.153 -r1.154 --- gameloop.cpp 22 Jun 2004 12:20:22 -0000 1.153 +++ gameloop.cpp 7 Jul 2004 11:39:35 -0000 1.154 @@ -164,6 +164,12 @@ std::string(_("by ")) + level->get_author(), Vector(0, 400), LAYER_FOREGROUND1); + + if(level->is_level_flipped()) + context.draw_text_center(white_text, + _("Level Vertically Flipped!"), + Vector(0, 310), LAYER_FOREGROUND1); + context.do_drawing(); SDL_Event event; @@ -763,7 +769,7 @@ { sprintf(str, "%2.1f", fps_fps); context.draw_text(white_text, "FPS", - Vector(screen->w - white_text->get_text_width("FPS "), 40), + Vector(screen->w - white_text->get_text_width("FPS "), 40), LAYER_FOREGROUND1); context.draw_text(gold_text, str, Vector(screen->w-4*16, 40), LAYER_FOREGROUND1); |
From: Marek M. <wa...@us...> - 2004-07-06 22:42:38
|
Update of /cvsroot/super-tux/supertux/data/levels/worldmap In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19237/data/levels/worldmap Added Files: bonusisland1.stwm Log Message: Added (experimental) world map for the bonus pack --- NEW FILE: bonusisland1.stwm --- ;; Generated with Flexlay Editor (supertux-worldmap (tilemap (width 70) (height 40) (data 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 11 16 16 16 16 16 16 16 12 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 15 24 25 26 58 24 26 19 17 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 11 16 16 12 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 15 30 29 28 59 31 27 19 17 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 11 22 19 19 23 12 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 15 19 24 26 47 30 28 19 17 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 15 19 20 21 20 13 9 9 9 9 9 9 11 16 16 16 16 16 16 16 16 16 16 16 16 22 19 30 28 47 19 19 19 23 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 12 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 15 19 17 14 13 9 9 9 9 9 9 9 15 48 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 45 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 39 17 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 14 18 13 9 9 9 9 9 9 9 9 9 15 47 20 18 18 21 19 19 19 19 19 19 19 19 19 19 60 47 60 19 19 19 20 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 21 47 17 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 11 16 16 16 16 16 22 47 17 9 9 15 19 48 40 40 40 40 40 40 40 40 40 45 40 40 40 39 17 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 15 47 17 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 15 48 40 40 40 40 40 42 17 9 9 15 19 47 20 18 21 19 20 18 21 19 19 47 20 18 21 47 17 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 15 47 17 9 9 9 9 9 9 9 9 9 9 9 9 9 9 11 16 16 16 16 16 16 22 47 20 18 18 18 18 18 13 9 9 15 48 42 17 9 14 18 13 9 14 21 19 47 17 9 15 47 17 9 9 11 16 16 16 16 16 16 16 16 12 9 9 9 9 9 15 47 17 9 9 9 9 9 9 9 9 9 9 9 9 9 9 15 48 40 40 40 40 40 40 42 17 9 9 9 9 9 9 9 9 15 47 20 13 9 9 9 9 11 16 22 19 47 17 9 15 47 17 11 16 22 48 40 40 6 40 39 19 19 17 9 9 9 9 9 15 47 17 9 9 9 9 9 9 9 9 9 9 9 9 9 9 15 47 20 18 18 18 18 18 18 13 9 9 9 9 11 16 12 9 15 47 17 9 9 11 12 9 14 21 19 19 47 23 16 22 47 23 22 60 19 47 19 19 19 19 47 19 19 17 9 9 9 9 11 22 47 23 12 9 9 9 9 9 9 9 9 9 9 9 9 9 15 47 17 9 9 9 9 9 9 9 9 9 9 9 14 18 13 9 15 47 17 9 9 15 23 12 9 14 21 19 37 40 40 39 37 40 40 6 40 42 19 48 40 40 42 19 20 13 9 9 9 9 15 60 47 60 17 9 9 9 9 9 9 9 9 9 9 9 9 9 15 47 17 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 15 47 17 9 9 15 19 17 9 9 14 18 18 18 21 47 20 18 21 60 19 19 19 47 19 19 20 18 13 9 9 9 9 9 14 21 47 20 13 9 9 9 9 9 9 9 9 9 9 9 9 11 22 47 23 12 11 16 16 16 16 12 9 9 9 9 9 9 9 9 15 47 17 9 9 14 18 13 9 9 9 9 9 9 15 47 17 9 14 18 21 19 19 47 19 19 23 12 9 9 9 9 9 11 16 22 47 23 16 12 9 9 9 9 9 9 9 9 9 9 9 15 19 47 19 23 22 48 6 40 39 17 9 9 9 9 9 11 16 16 22 47 23 16 16 16 16 12 9 9 9 9 9 9 15 47 17 9 9 9 14 21 19 7 19 19 19 23 12 9 9 9 9 15 19 19 7 19 19 17 9 9 9 9 9 9 9 9 9 9 9 15 19 47 19 19 19 47 19 19 47 17 9 9 9 9 9 15 19 19 19 47 19 19 48 40 39 17 9 9 9 9 9 9 15 47 17 9 9 9 9 15 19 37 40 40 39 19 17 9 9 9 9 14 21 19 37 40 39 23 16 12 9 9 9 9 9 9 9 9 9 14 21 47 19 19 48 42 19 19 47 23 12 9 9 9 9 14 18 21 19 7 19 19 47 19 47 17 9 9 9 9 11 16 22 47 23 16 12 9 9 15 19 19 19 19 47 19 17 9 9 9 9 9 15 19 19 19 47 19 20 13 9 9 9 9 9 9 9 9 9 9 15 37 6 40 42 24 25 26 47 19 17 9 11 12 9 9 9 14 21 37 40 40 42 19 47 17 9 9 9 9 15 19 19 7 19 19 23 12 9 14 18 18 18 21 47 20 13 9 11 16 16 16 22 19 19 19 47 19 23 12 9 9 9 9 9 9 9 9 9 9 15 19 19 19 19 31 32 27 47 19 17 9 14 13 9 9 11 16 22 19 60 19 19 19 7 17 9 9 9 9 14 21 19 37 40 40 39 17 9 9 9 9 9 15 47 17 9 9 15 48 40 40 40 40 39 19 37 40 39 23 12 9 9 9 9 9 9 9 9 9 15 19 60 19 19 30 29 28 47 20 13 9 9 9 9 11 22 19 19 19 19 19 19 19 47 17 9 9 9 9 9 14 21 19 19 19 47 17 9 9 9 9 11 22 47 17 9 9 15 47 19 19 19 19 47 19 19 19 47 19 17 9 9 9 9 9 9 9 9 9 14 21 48 40 6 40 40 40 42 17 9 9 9 9 9 15 48 40 40 40 6 40 40 40 42 17 9 9 9 9 9 9 15 19 19 19 47 17 9 9 9 9 15 19 47 17 9 9 15 47 19 19 19 19 37 6 40 40 42 19 17 9 9 9 9 9 9 9 9 11 16 22 47 19 19 19 19 19 19 17 9 9 9 9 9 15 47 19 19 19 19 20 21 19 20 13 9 9 9 9 9 9 15 19 48 6 42 23 12 9 9 9 15 19 47 17 9 9 15 37 40 39 19 19 19 19 19 19 19 19 17 9 9 9 9 9 9 9 9 15 19 19 37 40 40 40 40 6 39 17 9 9 9 9 9 15 37 40 39 19 20 13 14 18 13 9 9 9 9 9 9 9 14 21 47 19 19 19 17 9 9 11 22 19 47 17 9 9 15 19 19 37 6 40 40 40 40 39 19 20 13 9 9 9 9 9 9 9 9 14 21 19 19 19 19 19 19 19 47 23 12 9 9 9 9 14 18 21 47 20 13 9 9 9 9 9 9 9 9 9 9 9 9 15 47 20 18 18 13 9 9 14 21 19 47 17 9 9 14 21 19 19 19 20 18 18 21 47 20 13 9 9 9 9 9 9 9 9 9 9 14 18 18 18 18 18 18 21 47 20 13 9 9 9 9 9 9 15 47 17 9 9 9 9 9 9 9 9 9 9 9 9 9 15 47 17 9 9 9 9 9 9 14 21 47 17 9 9 9 14 18 18 18 13 9 9 15 47 17 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 15 47 17 9 9 9 9 9 9 9 15 47 17 9 9 9 9 9 9 9 9 9 9 9 9 9 15 47 17 9 9 9 9 9 9 9 15 47 17 9 9 9 9 9 9 9 9 9 9 15 47 17 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 15 47 23 16 16 16 16 16 16 16 22 47 23 16 16 16 16 16 16 16 16 16 16 16 16 16 22 47 23 16 16 16 16 16 16 16 22 47 23 16 16 16 16 16 16 16 16 16 16 22 47 17 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 15 37 40 40 40 40 40 40 40 40 40 44 40 40 40 40 40 40 40 40 40 40 40 43 40 40 40 44 40 40 40 40 40 40 40 40 40 44 40 40 40 40 40 40 40 40 40 40 40 40 42 17 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 14 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 21 47 20 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 13 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 15 47 17 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 15 47 17 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 11 16 16 22 47 23 16 16 12 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 15 19 19 19 37 40 39 19 17 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 15 19 19 49 50 51 47 19 17 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 15 60 19 52 53 54 47 60 17 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 15 19 19 55 56 57 42 19 17 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 15 19 19 19 19 19 19 19 17 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 14 18 18 18 18 18 18 18 13 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 )) ) |
From: Marek M. <wa...@us...> - 2004-07-06 20:01:18
|
Update of /cvsroot/super-tux/supertux/data/levels/unfinished In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19850/data/levels/unfinished Removed Files: matr1x-level1.stl matr1x-level2.stl matr1x-level3.stl wansti-level1.stl Log Message: Removed obsolete level directories Added the bonus pack directory, containing 12 levels for the bonus level pack --- matr1x-level2.stl DELETED --- --- matr1x-level3.stl DELETED --- --- wansti-level1.stl DELETED --- --- matr1x-level1.stl DELETED --- |
From: Marek M. <wa...@us...> - 2004-07-06 20:01:13
|
Update of /cvsroot/super-tux/supertux/data/levels/Cold_As_Ice In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19850/data/levels/Cold_As_Ice Removed Files: info level1.stl level2.stl level3.stl Log Message: Removed obsolete level directories Added the bonus pack directory, containing 12 levels for the bonus level pack --- level1.stl DELETED --- --- info DELETED --- --- level3.stl DELETED --- --- level2.stl DELETED --- |
From: Marek M. <wa...@us...> - 2004-07-06 19:57:54
|
Update of /cvsroot/super-tux/supertux/data/levels/bonus1 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19413/bonus1 Log Message: Directory /cvsroot/super-tux/supertux/data/levels/bonus1 added to the repository |
From: Ricardo C. <rm...@us...> - 2004-07-02 15:14:57
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23055/src Modified Files: door.cpp door.h menu.cpp tilemap.cpp tilemap.h Log Message: Allow creation of Tilemap and Door objects by feeding them with info. Index: menu.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/menu.cpp,v retrieving revision 1.82 retrieving revision 1.83 diff -u -d -r1.82 -r1.83 --- menu.cpp 1 Jul 2004 13:39:25 -0000 1.82 +++ menu.cpp 2 Jul 2004 15:14:48 -0000 1.83 @@ -91,7 +91,7 @@ } if(background == NULL) - context.draw_gradient(Color(200, 100, 200), Color(100, 200, 100), LAYER_BACKGROUND0); + context.draw_gradient(Color(200,240,220), Color(200,200,220), LAYER_BACKGROUND0); else context.draw_surface(background, Vector(0,0), LAYER_BACKGROUND0); @@ -238,9 +238,9 @@ char str[1024]; if(input_flickering) - sprintf(str,"%s_",input); - else sprintf(str,"%s ",input); + else + sprintf(str,"%s_",input); std::string string = str; Index: door.h =================================================================== RCS file: /cvsroot/super-tux/supertux/src/door.h,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- door.h 20 Jun 2004 14:50:21 -0000 1.4 +++ door.h 2 Jul 2004 15:14:48 -0000 1.5 @@ -40,6 +40,7 @@ { public: Door(LispReader& reader); + Door(int x, int y); virtual ~Door(); virtual void write(LispWriter& writer); Index: tilemap.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/tilemap.cpp,v retrieving revision 1.14 retrieving revision 1.15 diff -u -d -r1.14 -r1.15 --- tilemap.cpp 1 Jul 2004 15:25:02 -0000 1.14 +++ tilemap.cpp 2 Jul 2004 15:14:48 -0000 1.15 @@ -83,6 +83,11 @@ throw std::runtime_error("wrong number of tiles in tilemap."); } +TileMap::TileMap(int layer_, bool solid_, size_t width_, size_t height_) + : solid(solid_), speed(1), width(width_), height(height_), layer(layer_) +{ +} + TileMap::~TileMap() { } Index: tilemap.h =================================================================== RCS file: /cvsroot/super-tux/supertux/src/tilemap.h,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- tilemap.h 28 Jun 2004 11:30:27 -0000 1.9 +++ tilemap.h 2 Jul 2004 15:14:48 -0000 1.10 @@ -48,6 +48,7 @@ public: TileMap(); TileMap(LispReader& reader); + TileMap(int layer_, bool solid_, size_t width_, size_t height_); virtual ~TileMap(); virtual void write(LispWriter& writer); Index: door.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/door.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- door.cpp 20 Jun 2004 14:50:21 -0000 1.4 +++ door.cpp 2 Jul 2004 15:14:48 -0000 1.5 @@ -47,6 +47,19 @@ animation_timer.init(true); } +Door::Door(int x, int y) +{ +area.x = x; +area.y = y; +area.width = 32; +area.height = 64; + +animation_timer.init(true); +door_activated = false; + +animation_timer.init(true); +} + void Door::write(LispWriter& writer) { |
From: Matze B. <mat...@us...> - 2004-07-02 15:12:58
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22612 Modified Files: sector.cpp Log Message: save spawnpoints Index: sector.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/sector.cpp,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- sector.cpp 29 Jun 2004 13:00:42 -0000 1.13 +++ sector.cpp 2 Jul 2004 15:12:48 -0000 1.14 @@ -267,6 +267,18 @@ writer.write_float("gravity", gravity); writer.write_string("music", song_title); + // write spawnpoints + for(SpawnPoints::iterator i = spawnpoints.begin(); i != spawnpoints.end(); + ++i) { + SpawnPoint* spawn = *i; + writer.start_list("playerspawn"); + writer.write_string("name", spawn->name); + writer.write_float("x", spawn->pos.x); + writer.write_float("y", spawn->pos.y); + writer.end_list("playerspawn"); + } + + // write objects for(GameObjects::iterator i = gameobjects.begin(); i != gameobjects.end(); ++i) { Serializable* serializable = dynamic_cast<Serializable*> (*i); |
From: Ricardo C. <rm...@us...> - 2004-07-01 15:25:14
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13968/src Modified Files: tilemap.cpp Log Message: Found the evil bug that was causing the tilemap to not differ interactive, foreground or background tiles, in the new level format. It was really simple: there were two variables with the same name! A local string in parse() and an integer in the Tilemap class, both called layer. Dunno why g++ didn't report any warning... I think spawn points are not being saved. Matze, could you do that? :) Index: tilemap.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/tilemap.cpp,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- tilemap.cpp 29 Jun 2004 13:00:43 -0000 1.13 +++ tilemap.cpp 1 Jul 2004 15:25:02 -0000 1.14 @@ -43,16 +43,16 @@ { tilemanager = TileManager::instance(); - std::string layer; - if(reader.read_string("layer", layer)) { - if(layer == "background") + std::string layer_str; + if(reader.read_string("layer", layer_str)) { + if(layer_str == "background") layer = LAYER_BACKGROUNDTILES; - else if(layer == "interactive") + else if(layer_str == "interactive") layer = LAYER_TILES; - else if(layer == "foreground") + else if(layer_str == "foreground") layer = LAYER_FOREGROUNDTILES; else - std::cerr << "Unknown layer '" << layer << "' in tilemap.\n"; + std::cerr << "Unknown layer '" << layer_str << "' in tilemap.\n"; } reader.read_bool("solid", solid); |
From: Ricardo C. <rm...@us...> - 2004-07-01 13:39:36
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26502/src Modified Files: badguy.cpp badguy.h gameobjs.cpp gameobjs.h menu.cpp sprite.h Log Message: Changes: - testing for existing sector in badguy; - made flying object and trampoline's gfx accessible; - added sprite and badguys surface pointer return func. Index: menu.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/menu.cpp,v retrieving revision 1.81 retrieving revision 1.82 diff -u -d -r1.81 -r1.82 --- menu.cpp 28 Jun 2004 17:12:34 -0000 1.81 +++ menu.cpp 1 Jul 2004 13:39:25 -0000 1.82 @@ -553,7 +553,7 @@ { context.draw_text_center(gray_text, pitem.text, Vector(0, y_pos - int(blue_text->get_height()/2)), - LAYER_FOREGROUND1); + LAYER_GUI); break; } @@ -564,16 +564,16 @@ int y = y_pos - 12 - effect_offset; /* Draw a horizontal line with a little 3d effect */ context.draw_filled_rect(Vector(x, y + 6), - Vector(menu_width, 4), Color(150,200,255,225), LAYER_FOREGROUND1); + Vector(menu_width, 4), Color(150,200,255,225), LAYER_GUI); context.draw_filled_rect(Vector(x, y + 6), - Vector(menu_width, 2), Color(255,255,255,255), LAYER_FOREGROUND1); + Vector(menu_width, 2), Color(255,255,255,255), LAYER_GUI); break; } case MN_LABEL: { context.draw_text_center(white_big_text, pitem.text, Vector(0, y_pos - int(white_big_text->get_height()/2)), - LAYER_FOREGROUND1); + LAYER_GUI); break; } case MN_TEXTFIELD: @@ -588,11 +588,11 @@ context.draw_filled_rect( Vector(input_pos - 5, y_pos - 10), Vector(input_width + 10, 20), - Color(255,255,255,255), LAYER_FOREGROUND1-5); + Color(255,255,255,255), LAYER_GUI-5); context.draw_filled_rect( Vector(input_pos - 4, y_pos - 9), Vector(input_width + 8, 18), - Color(0,0,0,128), LAYER_FOREGROUND1-4); + Color(0,0,0,128), LAYER_GUI-4); if(pitem.kind == MN_CONTROLFIELD_KB) get_controlfield_key_into_input(&pitem); @@ -605,21 +605,21 @@ context.draw_text(gold_text, pitem.get_input_with_symbol(true), Vector(input_pos, y_pos - int(gold_text->get_height()/2)), - LAYER_FOREGROUND1); + LAYER_GUI); else context.draw_text(gold_text, pitem.get_input_with_symbol(false), Vector(input_pos, y_pos - int(gold_text->get_height()/2)), - LAYER_FOREGROUND1); + LAYER_GUI); } else context.draw_text(gold_text, pitem.input, Vector(input_pos, y_pos - int(gold_text->get_height()/2)), - LAYER_FOREGROUND1); + LAYER_GUI); context.draw_text(text_font, pitem.text, Vector(text_pos, y_pos - int(text_font->get_height()/2)), - LAYER_FOREGROUND1); + LAYER_GUI); break; } case MN_STRINGSELECT: @@ -631,37 +631,37 @@ /* Draw arrows */ context.draw_surface(arrow_left, Vector(x_pos - list_pos + text_pos - 17, y_pos - 8), - LAYER_FOREGROUND1); + LAYER_GUI); context.draw_surface(arrow_right, Vector(x_pos - list_pos + text_pos - 1 + list_pos_2, y_pos - 8), - LAYER_FOREGROUND1); + LAYER_GUI); /* Draw input background */ context.draw_filled_rect( Vector(x_pos - list_pos + text_pos - 1, y_pos - 10), Vector(list_pos_2 + 2, 20), - Color(255,255,255,255), LAYER_FOREGROUND1 - 4); + Color(255,255,255,255), LAYER_GUI - 4); context.draw_filled_rect( Vector(x_pos - list_pos + text_pos, y_pos - 9), Vector(list_pos_2, 18), - Color(0,0,0,128), LAYER_FOREGROUND1 - 5); + Color(0,0,0,128), LAYER_GUI - 5); context.draw_text_center(text_font, string_list_active(pitem.list), Vector(text_pos, y_pos - int(text_font->get_height()/2)), - LAYER_FOREGROUND1); + LAYER_GUI); context.draw_text_center(text_font, pitem.text, Vector(list_pos_2/2, y_pos - int(text_font->get_height()/2)), - LAYER_FOREGROUND1); + LAYER_GUI); break; } case MN_BACK: { context.draw_text_center(text_font, pitem.text, Vector(0, y_pos - int(text_font->get_height()/2)), - LAYER_FOREGROUND1); + LAYER_GUI); context.draw_surface(back, Vector(x_pos + text_width/2 + 16, y_pos - 8), - LAYER_FOREGROUND1); + LAYER_GUI); break; } @@ -669,28 +669,28 @@ { context.draw_text_center(text_font, pitem.text, Vector(0, y_pos - (text_font->get_height()/2)), - LAYER_FOREGROUND1); + LAYER_GUI); if(pitem.toggled) context.draw_surface(checkbox_checked, Vector(x_pos + (text_width+16)/2, y_pos - 8), - LAYER_FOREGROUND1 + 1); + LAYER_GUI + 1); else context.draw_surface(checkbox, Vector(x_pos + (text_width+16)/2, y_pos - 8), - LAYER_FOREGROUND1 + 1); + LAYER_GUI + 1); break; } case MN_ACTION: context.draw_text_center(text_font, pitem.text, Vector(0, y_pos - int(text_font->get_height()/2)), - LAYER_FOREGROUND1); + LAYER_GUI); break; case MN_GOTO: context.draw_text_center(text_font, pitem.text, Vector(0, y_pos - int(text_font->get_height()/2)), - LAYER_FOREGROUND1); + LAYER_GUI); break; } } @@ -730,7 +730,7 @@ context.draw_filled_rect( Vector(pos_x - menu_width/2, pos_y - 24*item.size()/2 - 10), Vector(menu_width,menu_height + 20), - Color(150,180,200,125), LAYER_FOREGROUND1-10); + Color(150,180,200,125), LAYER_GUI-10); for(unsigned int i = 0; i < item.size(); ++i) { Index: sprite.h =================================================================== RCS file: /cvsroot/super-tux/supertux/src/sprite.h,v retrieving revision 1.14 retrieving revision 1.15 diff -u -d -r1.14 -r1.15 --- sprite.h 14 Jun 2004 22:45:23 -0000 1.14 +++ sprite.h 1 Jul 2004 13:39:26 -0000 1.15 @@ -67,6 +67,10 @@ std::string get_name() const { return name; } int get_width() const; int get_height() const; + + Surface* get_frame(unsigned int frame) + { if(frame < surfaces.size()) return surfaces[frame]; + else return surfaces[0]; } }; #endif /*SUPERTUX_SPRITE_H*/ Index: badguy.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/badguy.cpp,v retrieving revision 1.108 retrieving revision 1.109 diff -u -d -r1.108 -r1.109 --- badguy.cpp 14 Jun 2004 21:39:57 -0000 1.108 +++ badguy.cpp 1 Jul 2004 13:39:24 -0000 1.109 @@ -206,6 +206,7 @@ timer.init(true); // if we're in a solid tile at start correct that now + if(Sector::current()) { if(kind != BAD_FLAME && kind != BAD_FISH && collision_object_map(base)) { std::cout << "Warning: badguy started in wall: kind: " << badguykind_to_string(kind) @@ -214,7 +215,7 @@ --base.y; } - if(Sector::current() && Sector::current()->camera) { + if(Sector::current()->camera) { Vector scroll = Sector::current()->camera->get_translation(); if(start_position.x > scroll.x - X_OFFSCREEN_DISTANCE && @@ -223,7 +224,7 @@ start_position.y < scroll.y + screen->h + Y_OFFSCREEN_DISTANCE) { activate(LEFT); } - } else { + } } else { if(start_position.x > 0 && start_position.x <= screen->w && start_position.y > 0 && start_position.y <= screen->h) activate(LEFT); Index: badguy.h =================================================================== RCS file: /cvsroot/super-tux/supertux/src/badguy.h,v retrieving revision 1.56 retrieving revision 1.57 diff -u -d -r1.56 -r1.57 --- badguy.h 29 Jun 2004 13:00:41 -0000 1.56 +++ badguy.h 1 Jul 2004 13:39:25 -0000 1.57 @@ -139,6 +139,9 @@ /** initializes the badguy (when he appears on screen) */ void activate(Direction direction); // should only be used by BadGuy's objects + Surface* get_image() + { return sprite_left->get_frame(0); } + private: void init(); Index: gameobjs.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/gameobjs.cpp,v retrieving revision 1.41 retrieving revision 1.42 diff -u -d -r1.41 -r1.42 --- gameobjs.cpp 14 Jun 2004 22:45:23 -0000 1.41 +++ gameobjs.cpp 1 Jul 2004 13:39:25 -0000 1.42 @@ -137,7 +137,6 @@ /* Trampoline */ -#define TRAMPOLINE_FRAMES 4 Sprite *img_trampoline[TRAMPOLINE_FRAMES]; Trampoline::Trampoline(LispReader& reader) @@ -154,6 +153,19 @@ physic.reset(); } +Trampoline::Trampoline(float x, float y) +{ + base.x = x; + base.y = y; + base.width = 32; + base.height = 32; + power = 7.5; + + frame = 0; + mode = M_NORMAL; + physic.reset(); +} + void Trampoline::write(LispWriter& writer) { @@ -301,6 +313,14 @@ frame = 0; } +FlyingPlatform::FlyingPlatform(int x, int y) +{ +base.x = x; +base.y = y; +point = 0; +move = false; +} + void FlyingPlatform::write(LispWriter& writer) { Index: gameobjs.h =================================================================== RCS file: /cvsroot/super-tux/supertux/src/gameobjs.h,v retrieving revision 1.28 retrieving revision 1.29 diff -u -d -r1.28 -r1.29 --- gameobjs.h 14 Jun 2004 22:45:23 -0000 1.28 +++ gameobjs.h 1 Jul 2004 13:39:25 -0000 1.29 @@ -37,6 +37,8 @@ #define NO_BOUNCE 0 #define BOUNCE 1 +class Sprite; + struct TileId; class BouncyDistro : public GameObject @@ -101,10 +103,14 @@ Timer timer; }; +#define TRAMPOLINE_FRAMES 4 +extern Sprite *img_trampoline[TRAMPOLINE_FRAMES]; + class Trampoline : public MovingObject, public Serializable { public: Trampoline(LispReader& reader); + Trampoline(float x, float y); virtual void write(LispWriter& writer); virtual void action(float frame_ratio); @@ -121,10 +127,13 @@ unsigned int frame; }; +extern Sprite *img_flying_platform; + class FlyingPlatform : public MovingObject, public Serializable { public: FlyingPlatform(LispReader& reader); + FlyingPlatform(int x, int y); virtual void write(LispWriter& writer); virtual void action(float frame_ratio); |
From: Ryan F. <sik...@us...> - 2004-06-29 19:08:20
|
Update of /cvsroot/super-tux/htdocs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24925 Modified Files: download.xml news.xml Log Message: - added SuSE RPMs Index: news.xml =================================================================== RCS file: /cvsroot/super-tux/htdocs/news.xml,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- news.xml 19 May 2004 22:46:08 -0000 1.4 +++ news.xml 29 Jun 2004 19:08:09 -0000 1.5 @@ -2,6 +2,10 @@ <page title="SuperTux"> <section title="News"> <news> + <item date="29. June 2004"> + SuperTux 0.1.1 now has SuSE RPMs available. You can get them from our + <a href="download.html">download section</a>. + </item> <item date="19. May 2004"> Supertux 0.1.1 now has binaries for Windows and Mac OS X 10.3.x as well as an <a href="http://www.autopackage.org">autopackage</a> installer Index: download.xml =================================================================== RCS file: /cvsroot/super-tux/htdocs/download.xml,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- download.xml 19 May 2004 22:43:40 -0000 1.11 +++ download.xml 29 Jun 2004 19:08:09 -0000 1.12 @@ -7,6 +7,8 @@ <li>Windows Binary: <a href="http://prdownloads.sourceforge.net/super-tux/supertux-0.1.1-setup.exe?download">supertux-0.1.1-setup.exe</a></li> <li>Mac OS X 10.3.x disk image: <a href="http://prdownloads.sourceforge.net/super-tux/supertux-0.1.1-macosx.dmg?download">supertux-0.1.1-macosx.dmg</a></li> <li>Autopackage: <a href="http://prdownloads.sourceforge.net/super-tux/supertux-0.1.1.package?download">supertux-0.1.1.package</a></li> + <li>SuSE RPM (with OpenGL): <a href="http://prdownloads.sourceforge.net/super-tux/supertux-0.1.1-1.GL.SuSE.i586.rpm?download">supertux-0.1.1-1.GL.SuSE.i586.rpm</a></li> + <li>SuSE RPM (without OpenGL): <a href="http://prdownloads.sourceforge.net/super-tux/supertux-0.1.1-11.nonGL.SuSE.i586.rpm?download">supertux-0.1.1-11.nonGL.SuSE.i586.rpm</a></li> </ul> </subsection> |
From: Ryan F. <sik...@us...> - 2004-06-29 17:55:42
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9741 Modified Files: Tag: supertux_0_1_1_branch lispreader.cpp Log Message: - backported MatzeB's improved lisp_free() patch Index: lispreader.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/lispreader.cpp,v retrieving revision 1.18.2.1 retrieving revision 1.18.2.2 diff -u -d -r1.18.2.1 -r1.18.2.2 --- lispreader.cpp 28 Jun 2004 23:04:57 -0000 1.18.2.1 +++ lispreader.cpp 29 Jun 2004 17:55:22 -0000 1.18.2.2 @@ -22,7 +22,7 @@ */ #include <iostream> -#include <queue> +#include <vector> #include <string> #include <assert.h> #include <ctype.h> @@ -507,13 +507,13 @@ /** We have to use this iterative code because the recursion function * produces a stack overflow and crashes on OSX 10.2 */ - std::queue<lisp_object_t*> objs; - objs.push(obj); + std::vector<lisp_object_t*> objs; + objs.push_back(obj); while(!objs.empty()) { - lisp_object_t* obj = objs.front(); - objs.pop(); + lisp_object_t* obj = objs.back(); + objs.pop_back(); switch (obj->type) { @@ -528,14 +528,14 @@ case LISP_TYPE_CONS : case LISP_TYPE_PATTERN_CONS : if(obj->v.cons.car) - objs.push(obj->v.cons.car); + objs.push_back(obj->v.cons.car); if(obj->v.cons.cdr) - objs.push(obj->v.cons.cdr); + objs.push_back(obj->v.cons.cdr); break; case LISP_TYPE_PATTERN_VAR : if(obj->v.pattern.sub) - objs.push(obj->v.pattern.sub); + objs.push_back(obj->v.pattern.sub); break; } } |
From: Ricardo C. <rm...@us...> - 2004-06-29 17:47:45
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8142/src Modified Files: mousecursor.cpp mousecursor.h setup.cpp Log Message: Added hidden state to mouse cursor. Also forgot to free gray text when added it. Shame on me! :) Index: mousecursor.h =================================================================== RCS file: /cvsroot/super-tux/supertux/src/mousecursor.h,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- mousecursor.h 14 Jun 2004 22:45:23 -0000 1.9 +++ mousecursor.h 29 Jun 2004 17:47:36 -0000 1.10 @@ -31,7 +31,8 @@ enum { MC_NORMAL, MC_CLICK, - MC_LINK + MC_LINK, + MC_HIDE }; class MouseCursor Index: mousecursor.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/mousecursor.cpp,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- mousecursor.cpp 28 Jun 2004 11:30:27 -0000 1.11 +++ mousecursor.cpp 29 Jun 2004 17:47:36 -0000 1.12 @@ -61,6 +61,9 @@ void MouseCursor::draw(DrawingContext& context) { + if(cur_state == MC_HIDE) + return; + int x,y,w,h; Uint8 ispressed = SDL_GetMouseState(&x,&y); w = cursor->w / tot_frames; Index: setup.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/setup.cpp,v retrieving revision 1.104 retrieving revision 1.105 diff -u -d -r1.104 -r1.105 --- setup.cpp 28 Jun 2004 17:12:34 -0000 1.104 +++ setup.cpp 29 Jun 2004 17:47:36 -0000 1.105 @@ -619,6 +619,7 @@ delete gold_text; delete white_text; delete blue_text; + delete gray_text; delete white_small_text; delete white_big_text; delete yellow_nums; |
From: Ryan F. <sik...@us...> - 2004-06-29 17:31:39
|
Update of /cvsroot/super-tux/supertux/contrib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5095 Added Files: supertux.spec Log Message: - added specfile from Peter Astakhov --- NEW FILE: supertux.spec --- Name: supertux Version: 0.1.1 Release: 2zebar Group: Amusements/Games Summary: A free arcade game like Super Mario. Vendor: The SuperTux Developer Team Packager: Astakhov Peter License: GPL URL: http://super-tux.sf.net/ Source0: %{name}-%{version}.tar.bz2 BuildRoot: %{_tmppath}/%{name}-%{version}-root Prefix: /usr Requires: SDL, SDL_image, SDL_mixer BuildRequires: SDL-devel, SDL_mixer-devel, SDL_image-devel %description SuperTux is a jump'n run like game, with strong inspiration from the Super Mario Bros games for Nintendo. Run and jump through multiple worlds, fighting off enemies by jumping on them or bumping them from below. Grabbing power-ups and other stuff on the way. %prep #Unpack package %setup %build CFLAGS="$RPM_OPT_FLAGS" CXXFLAGS="$RPM_OPT_FLAGS" \ ./configure --prefix=%{_prefix} --disable-opengl --disable-debug make %install #make DESTDIR=%{buildroot} install %makeinstall #Install application link for X-Windows install -d %{buildroot}/etc/X11/applnk/Games echo -e "[Desktop Entry] Name=SuperTux Comment=Arcade game Exec=supertux Icon=/usr/share/supertux/images/icon.xpm Terminal=0 Type=Application" > %{buildroot}/etc/X11/applnk/Games/SuperTux.desktop %clean rm -rf %{buildroot} %files %defattr(-,root,root) %doc COPYING README ChangeLog TODO #%doc doc/* /etc/X11/applnk/* %{_bindir}/* %{_prefix}/share/supertux/* %changelog * Wed Jun 23 2004 Astakhov Peter <ast...@ma...> - initial supertux specfile |
From: Ricardo C. <rm...@us...> - 2004-06-29 13:01:23
|
Update of /cvsroot/super-tux/supertux/src/screen In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11052/src/screen Modified Files: drawing_context.cpp drawing_context.h font.cpp font.h Log Message: Changes: - Font now supports drawing effect; - Level saving now works. Still has flaws: o Spawn points are not saved; o Tilemaps do not know differ foreground/background. Matze, Can you have a look at this? - Other minor stuff. Index: font.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/screen/font.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- font.cpp 9 Jun 2004 04:43:15 -0000 1.4 +++ font.cpp 29 Jun 2004 13:00:40 -0000 1.5 @@ -81,16 +81,18 @@ } void -Font::draw(const std::string& text, const Vector& pos) +Font::draw(const std::string& text, const Vector& pos, Uint32 drawing_effect) { if(shadowsize > 0) - draw_chars(shadow_chars, text, pos + Vector(shadowsize, shadowsize)); + draw_chars(shadow_chars, text, pos + Vector(shadowsize, shadowsize), + drawing_effect); - draw_chars(chars, text, pos); + draw_chars(chars, text, pos, drawing_effect); } void -Font::draw_chars(Surface* pchars, const std::string& text, const Vector& pos) +Font::draw_chars(Surface* pchars, const std::string& text, const Vector& pos, + Uint32 drawing_effect) { SurfaceImpl* impl = pchars->impl; @@ -115,7 +117,7 @@ int source_x = (index % 16) * w; int source_y = (index / 16) * h; - impl->draw_part(source_x, source_y, p.x, p.y, w, h, 255); + impl->draw_part(source_x, source_y, p.x, p.y, w, h, 255, drawing_effect); p.x += w; } } Index: drawing_context.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/screen/drawing_context.cpp,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- drawing_context.cpp 28 Jun 2004 11:30:25 -0000 1.12 +++ drawing_context.cpp 29 Jun 2004 13:00:39 -0000 1.13 @@ -76,13 +76,14 @@ void DrawingContext::draw_text(Font* font, const std::string& text, - const Vector& position, int layer) + const Vector& position, int layer, Uint32 drawing_effect) { DrawingRequest request; request.type = TEXT; request.layer = layer; request.pos = transform.apply(position); + request.drawing_effect = drawing_effect; TextRequest* textrequest = new TextRequest; textrequest->font = font; @@ -94,7 +95,7 @@ void DrawingContext::draw_text_center(Font* font, const std::string& text, - const Vector& position, int layer) + const Vector& position, int layer, Uint32 drawing_effect) { DrawingRequest request; @@ -102,6 +103,7 @@ request.layer = layer; request.pos = transform.apply(position) + Vector(screen->w/2 - font->get_text_width(text)/2, 0); + request.drawing_effect = drawing_effect; TextRequest* textrequest = new TextRequest; textrequest->font = font; @@ -212,7 +214,7 @@ { TextRequest* textrequest = (TextRequest*) request.request_data; - textrequest->font->draw(textrequest->text, request.pos); + textrequest->font->draw(textrequest->text, request.pos, request.drawing_effect); delete textrequest; } @@ -226,6 +228,7 @@ float y = request.pos.y; float w = fillrectrequest->size.x; float h = fillrectrequest->size.y; + #ifndef NOOPENGL if(use_gl) { Index: drawing_context.h =================================================================== RCS file: /cvsroot/super-tux/supertux/src/screen/drawing_context.h,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- drawing_context.h 28 Jun 2004 11:30:26 -0000 1.10 +++ drawing_context.h 29 Jun 2004 13:00:40 -0000 1.11 @@ -62,10 +62,10 @@ Uint32 drawing_effect = NONE_EFFECT); /** draws a text */ void draw_text(Font* font, const std::string& text, const Vector& position, - int layer); + int layer, Uint32 drawing_effect = NONE_EFFECT); /** draws aligned text */ void draw_text_center(Font* font, const std::string& text, - const Vector& position, int layer); + const Vector& position, int layer, Uint32 drawing_effect = NONE_EFFECT); /** draws a color gradient onto the whole screen */ void draw_gradient(Color from, Color to, int layer); /** fills a rectangle */ Index: font.h =================================================================== RCS file: /cvsroot/super-tux/supertux/src/screen/font.h,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- font.h 14 Jun 2004 22:45:24 -0000 1.4 +++ font.h 29 Jun 2004 13:00:40 -0000 1.5 @@ -53,9 +53,10 @@ private: friend class DrawingContext; - void draw(const std::string& text, const Vector& pos); + void draw(const std::string& text, const Vector& pos, + Uint32 drawing_effect = NONE_EFFECT); void draw_chars(Surface* pchars, const std::string& text, - const Vector& position); + const Vector& position, Uint32 drawing_effect); Surface* chars; Surface* shadow_chars; |
From: Ricardo C. <rm...@us...> - 2004-06-29 13:01:06
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11052/src Modified Files: badguy.h level.cpp sector.cpp tilemap.cpp Log Message: Changes: - Font now supports drawing effect; - Level saving now works. Still has flaws: o Spawn points are not saved; o Tilemaps do not know differ foreground/background. Matze, Can you have a look at this? - Other minor stuff. Index: badguy.h =================================================================== RCS file: /cvsroot/super-tux/supertux/src/badguy.h,v retrieving revision 1.55 retrieving revision 1.56 diff -u -d -r1.55 -r1.56 --- badguy.h 14 Jun 2004 22:45:23 -0000 1.55 +++ badguy.h 29 Jun 2004 13:00:41 -0000 1.56 @@ -136,6 +136,9 @@ */ void kill_me(int score); + /** initializes the badguy (when he appears on screen) */ + void activate(Direction direction); // should only be used by BadGuy's objects + private: void init(); @@ -153,9 +156,6 @@ void action_wingling(double frame_ratio); void action_walkingtree(double frame_ratio); - /** initializes the badguy (when he appears on screen) */ - void activate(Direction direction); - /** handles falling down. disables gravity calculation when we're back on * ground */ void fall(); Index: level.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/level.cpp,v retrieving revision 1.94 retrieving revision 1.95 diff -u -d -r1.94 -r1.95 --- level.cpp 28 Jun 2004 11:30:26 -0000 1.94 +++ level.cpp 29 Jun 2004 13:00:41 -0000 1.95 @@ -115,7 +115,11 @@ writer->write_int("time", time_left); 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"); Index: tilemap.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/tilemap.cpp,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- tilemap.cpp 15 Jun 2004 14:27:34 -0000 1.12 +++ tilemap.cpp 29 Jun 2004 13:00:43 -0000 1.13 @@ -52,7 +52,7 @@ else if(layer == "foreground") layer = LAYER_FOREGROUNDTILES; else - std::cout << "Unknown layer '" << layer << "' in tilemap.\n"; + std::cerr << "Unknown layer '" << layer << "' in tilemap.\n"; } reader.read_bool("solid", solid); @@ -99,7 +99,8 @@ else if(layer == LAYER_FOREGROUNDTILES) writer.write_string("layer", "foreground"); else { - std::cout << "Warning unknown layer in tilemap.\n"; + writer.write_string("layer", "unknown"); + std::cerr << "Warning unknown layer in tilemap.\n"; } writer.write_bool("solid", solid); Index: sector.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/sector.cpp,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- sector.cpp 28 Jun 2004 11:30:27 -0000 1.12 +++ sector.cpp 29 Jun 2004 13:00:42 -0000 1.13 @@ -265,6 +265,7 @@ { writer.write_string("name", name); writer.write_float("gravity", gravity); + writer.write_string("music", song_title); for(GameObjects::iterator i = gameobjects.begin(); i != gameobjects.end(); ++i) { |
From: Matze B. <mat...@us...> - 2004-06-29 12:12:33
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1694/src Modified Files: lispreader.cpp Log Message: use a more efficient datastructure in lisp_free Index: lispreader.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/lispreader.cpp,v retrieving revision 1.25 retrieving revision 1.26 diff -u -d -r1.25 -r1.26 --- lispreader.cpp 28 Jun 2004 22:01:29 -0000 1.25 +++ lispreader.cpp 29 Jun 2004 12:12:24 -0000 1.26 @@ -21,7 +21,7 @@ * Boston, MA 02111-1307, USA. */ #include <iostream> -#include <queue> +#include <vector> #include <string> #include <cctype> #include <cstdlib> @@ -509,12 +509,12 @@ /** We have to use this iterative code, because the recursive function * produces a stack overflow and crashs on OSX 10.2 */ - std::queue<lisp_object_t*> objs; - objs.push(obj); + std::vector<lisp_object_t*> objs; + objs.push_back(obj); while(!objs.empty()) { - lisp_object_t* obj = objs.front(); - objs.pop(); + lisp_object_t* obj = objs.back(); + objs.pop_back(); switch (obj->type) { case LISP_TYPE_INTERNAL : @@ -530,14 +530,14 @@ case LISP_TYPE_CONS : case LISP_TYPE_PATTERN_CONS : if(obj->v.cons.car) - objs.push(obj->v.cons.car); + objs.push_back(obj->v.cons.car); if(obj->v.cons.cdr) - objs.push(obj->v.cons.cdr); + objs.push_back(obj->v.cons.cdr); break; case LISP_TYPE_PATTERN_VAR : if(obj->v.pattern.sub) - objs.push(obj->v.pattern.sub); + objs.push_back(obj->v.pattern.sub); break; } |
From: Ryan F. <sik...@us...> - 2004-06-28 23:05:06
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31373 Modified Files: Tag: supertux_0_1_1_branch lispreader.cpp Log Message: - backported MatzeB's lisp_free() patch Index: lispreader.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/lispreader.cpp,v retrieving revision 1.18 retrieving revision 1.18.2.1 diff -u -d -r1.18 -r1.18.2.1 --- lispreader.cpp 3 May 2004 23:06:19 -0000 1.18 +++ lispreader.cpp 28 Jun 2004 23:04:57 -0000 1.18.2.1 @@ -22,6 +22,7 @@ */ #include <iostream> +#include <queue> #include <string> #include <assert.h> #include <ctype.h> @@ -503,28 +504,41 @@ if (obj == 0) return; - switch (obj->type) - { - case LISP_TYPE_INTERNAL : - case LISP_TYPE_PARSE_ERROR : - case LISP_TYPE_EOF : - return; + /** We have to use this iterative code because the recursion function + * produces a stack overflow and crashes on OSX 10.2 + */ + std::queue<lisp_object_t*> objs; + objs.push(obj); - case LISP_TYPE_SYMBOL : - case LISP_TYPE_STRING : - free(obj->v.string); - break; + while(!objs.empty()) + { + lisp_object_t* obj = objs.front(); + objs.pop(); - case LISP_TYPE_CONS : - case LISP_TYPE_PATTERN_CONS : - lisp_free(obj->v.cons.car); - lisp_free(obj->v.cons.cdr); - break; + switch (obj->type) + { + case LISP_TYPE_INTERNAL : + case LISP_TYPE_PARSE_ERROR : + case LISP_TYPE_EOF : + return; + case LISP_TYPE_SYMBOL : + case LISP_TYPE_STRING : + free(obj->v.string); + break; + case LISP_TYPE_CONS : + case LISP_TYPE_PATTERN_CONS : + if(obj->v.cons.car) + objs.push(obj->v.cons.car); + if(obj->v.cons.cdr) + objs.push(obj->v.cons.cdr); + break; - case LISP_TYPE_PATTERN_VAR : - lisp_free(obj->v.pattern.sub); - break; + case LISP_TYPE_PATTERN_VAR : + if(obj->v.pattern.sub) + objs.push(obj->v.pattern.sub); + break; } + } free(obj); } |
From: Matze B. <mat...@us...> - 2004-06-28 22:01:40
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17489/src Modified Files: lispreader.cpp Log Message: changed lisp_free to an iterative algorithm Index: lispreader.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/lispreader.cpp,v retrieving revision 1.24 retrieving revision 1.25 diff -u -d -r1.24 -r1.25 --- lispreader.cpp 15 Jun 2004 12:18:59 -0000 1.24 +++ lispreader.cpp 28 Jun 2004 22:01:29 -0000 1.25 @@ -20,8 +20,8 @@ * Free Software Foundation, Inc., 59 Temple Place - Suite 330, * Boston, MA 02111-1307, USA. */ - #include <iostream> +#include <queue> #include <string> #include <cctype> #include <cstdlib> @@ -506,30 +506,43 @@ if (obj == 0) return; - switch (obj->type) - { - case LISP_TYPE_INTERNAL : - case LISP_TYPE_PARSE_ERROR : - case LISP_TYPE_EOF : - return; + /** We have to use this iterative code, because the recursive function + * produces a stack overflow and crashs on OSX 10.2 + */ + std::queue<lisp_object_t*> objs; + objs.push(obj); - case LISP_TYPE_SYMBOL : - case LISP_TYPE_STRING : - free(obj->v.string); - break; + while(!objs.empty()) { + lisp_object_t* obj = objs.front(); + objs.pop(); + + switch (obj->type) { + case LISP_TYPE_INTERNAL : + case LISP_TYPE_PARSE_ERROR : + case LISP_TYPE_EOF : + return; - case LISP_TYPE_CONS : - case LISP_TYPE_PATTERN_CONS : - lisp_free(obj->v.cons.car); - lisp_free(obj->v.cons.cdr); - break; + case LISP_TYPE_SYMBOL : + case LISP_TYPE_STRING : + free(obj->v.string); + break; - case LISP_TYPE_PATTERN_VAR : - lisp_free(obj->v.pattern.sub); - break; + case LISP_TYPE_CONS : + case LISP_TYPE_PATTERN_CONS : + if(obj->v.cons.car) + objs.push(obj->v.cons.car); + if(obj->v.cons.cdr) + objs.push(obj->v.cons.cdr); + break; + + case LISP_TYPE_PATTERN_VAR : + if(obj->v.pattern.sub) + objs.push(obj->v.pattern.sub); + break; } - free(obj); + free(obj); + } } lisp_object_t* |
From: Ricardo C. <rm...@us...> - 2004-06-28 17:12:46
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21693/src Modified Files: globals.cpp globals.h menu.cpp setup.cpp Log Message: When a menu is disabled, it now uses Benjamin's gray fonts! Index: menu.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/menu.cpp,v retrieving revision 1.80 retrieving revision 1.81 diff -u -d -r1.80 -r1.81 --- menu.cpp 14 Jun 2004 18:10:37 -0000 1.80 +++ menu.cpp 28 Jun 2004 17:12:34 -0000 1.81 @@ -551,7 +551,7 @@ { case MN_DEACTIVE: { - context.draw_text_center(blue_text, pitem.text, + context.draw_text_center(gray_text, pitem.text, Vector(0, y_pos - int(blue_text->get_height()/2)), LAYER_FOREGROUND1); break; Index: setup.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/setup.cpp,v retrieving revision 1.103 retrieving revision 1.104 diff -u -d -r1.103 -r1.104 --- setup.cpp 22 Jun 2004 12:43:42 -0000 1.103 +++ setup.cpp 28 Jun 2004 17:12:34 -0000 1.104 @@ -590,6 +590,8 @@ blue_text = new Font(datadir + "/images/fonts/blue.png", Font::TEXT, 16,18,3); white_text = new Font(datadir + "/images/fonts/white.png", Font::TEXT, 16,18); + gray_text = new Font(datadir + "/images/fonts/gray.png", + Font::TEXT, 16,18); white_small_text = new Font(datadir + "/images/fonts/white-small.png", Font::TEXT, 8,9, 1); white_big_text = new Font(datadir + "/images/fonts/white-big.png", Index: globals.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/globals.cpp,v retrieving revision 1.21 retrieving revision 1.22 diff -u -d -r1.21 -r1.22 --- globals.cpp 30 May 2004 01:08:48 -0000 1.21 +++ globals.cpp 28 Jun 2004 17:12:34 -0000 1.22 @@ -38,12 +38,9 @@ JoystickKeymap joystick_keymap; SDL_Surface * screen; -Font* black_text; Font* gold_text; -Font* silver_text; Font* blue_text; -Font* red_text; -Font* green_text; +Font* gray_text; Font* yellow_nums; Font* white_text; Font* white_small_text; Index: globals.h =================================================================== RCS file: /cvsroot/super-tux/supertux/src/globals.h,v retrieving revision 1.33 retrieving revision 1.34 diff -u -d -r1.33 -r1.34 --- globals.h 9 Jun 2004 05:23:20 -0000 1.33 +++ globals.h 28 Jun 2004 17:12:34 -0000 1.34 @@ -51,9 +51,10 @@ extern SDL_Surface* screen; extern Font* gold_text; extern Font* white_text; +extern Font* blue_text; +extern Font* gray_text; extern Font* white_small_text; extern Font* white_big_text; -extern Font* blue_text; extern Font* yellow_nums; extern MouseCursor * mouse_cursor; |
From: Benjamin P. J. <lit...@us...> - 2004-06-28 12:43:11
|
Update of /cvsroot/super-tux/supertux/data/images/fonts In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32342/data/images/fonts Added Files: gray.png Log Message: Added a gray font (for disabled menu entries). --- NEW FILE: gray.png --- (This appears to be a binary file; contents omitted.) |
From: Ricardo C. <rm...@us...> - 2004-06-28 11:30:37
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18728/src Modified Files: level.cpp mousecursor.cpp sector.cpp sector.h supertux.cpp tile_manager.h tilemap.h Log Message: A few changes to make the code ready for the new level editor. Major changes: - Level's save() works. Still doesn't save the game properly. - added a set_drawing_effect() for DrawingContext. Will apply it to the following drawings. Works with pop/push_transform. Index: sector.h =================================================================== RCS file: /cvsroot/super-tux/supertux/src/sector.h,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- sector.h 9 Jun 2004 05:23:20 -0000 1.5 +++ sector.h 28 Jun 2004 11:30:27 -0000 1.6 @@ -69,6 +69,8 @@ void activate(const std::string& spawnpoint = "main"); void action(float elapsed_time); + void update_game_objects(); + void draw(DrawingContext& context); /// adds a gameobject Index: sector.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/sector.cpp,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- sector.cpp 14 Jun 2004 22:45:23 -0000 1.11 +++ sector.cpp 28 Jun 2004 11:30:27 -0000 1.12 @@ -332,6 +332,12 @@ /* Handle all possible collisions. */ collision_handler(); + update_game_objects(); +} + +void +Sector::update_game_objects() +{ /** cleanup marked objects */ for(std::vector<GameObject*>::iterator i = gameobjects.begin(); i != gameobjects.end(); /* nothing */) { @@ -407,7 +413,6 @@ gameobjects.push_back(*i); } gameobjects_new.clear(); - } void Index: mousecursor.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/mousecursor.cpp,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- mousecursor.cpp 9 Jun 2004 05:23:19 -0000 1.10 +++ mousecursor.cpp 28 Jun 2004 11:30:27 -0000 1.11 @@ -89,5 +89,5 @@ } context.draw_surface_part(cursor, Vector(w*cur_frame, h*cur_state), Vector(w, - h), Vector(x-mid_x, y-mid_y), LAYER_FOREGROUND1+100); + h), Vector(x-mid_x, y-mid_y), LAYER_GUI+100); } Index: level.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/level.cpp,v retrieving revision 1.93 retrieving revision 1.94 diff -u -d -r1.93 -r1.94 --- level.cpp 16 Jun 2004 00:40:41 -0000 1.93 +++ level.cpp 28 Jun 2004 11:30:26 -0000 1.94 @@ -100,40 +100,27 @@ void Level::save(const std::string& filename) { -#if 0 - LispReader* level = LispReader::load(filename, "supertux-level"); + ofstream file(filename.c_str(), ios::out); + LispWriter* writer = new LispWriter(file); - int version = 1; - level->read_int("version", version); - if(version == 1) { - load_old_format(*level); - return; - } + writer->write_comment("Level made using SuperTux's built-in Level Editor"); - for(lisp_object_t* cur = level->get_lisp(); !lisp_nil_p(cur); - cur = lisp_cdr(cur)) { - std::string token = lisp_symbol(lisp_car(lisp_car(cur))); - lisp_object_t* data = lisp_car(lisp_cdr(lisp_car(cur))); - LispReader reader(lisp_cdr(lisp_car(cur))); + writer->start_list("supertux-level"); - if(token == "name") { - name = lisp_string(data); - } else if(token == "author") { - author = lisp_string(data); - } else if(token == "time") { - time_left = lisp_integer(data); - } else if(token == "sector") { - Sector* sector = new Sector; - sector->parse(reader); - add_sector(sector); - } else { - std::cerr << "Unknown token '" << token << "' in level file.\n"; - continue; - } - } - - delete level; -#endif + int version = 2; + writer->write_int("version", version); + + writer->write_string("name", name); + writer->write_string("author", author); + writer->write_int("time", time_left); + + for(Sectors::iterator i = sectors.begin(); i != sectors.end(); ++i) + i->second->write(*writer); + + writer->end_list("supertux-level"); + + delete writer; + file.close(); } Level::~Level() Index: tile_manager.h =================================================================== RCS file: /cvsroot/super-tux/supertux/src/tile_manager.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- tile_manager.h 14 Jun 2004 22:45:23 -0000 1.1 +++ tile_manager.h 28 Jun 2004 11:30:27 -0000 1.2 @@ -61,6 +61,10 @@ const Vector& pos, int layer); static std::set<TileGroup>* tilegroups() { if(!instance_) { instance_ = new TileManager(); } return tilegroups_ ? tilegroups_ : tilegroups_ = new std::set<TileGroup>; } + + unsigned int total_ids() + { return tiles.size(); } + Tile& get(unsigned int id) { if(id < tiles.size()) Index: tilemap.h =================================================================== RCS file: /cvsroot/super-tux/supertux/src/tilemap.h,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- tilemap.h 14 Jun 2004 22:08:01 -0000 1.8 +++ tilemap.h 28 Jun 2004 11:30:27 -0000 1.9 @@ -68,6 +68,9 @@ size_t get_height() const { return height; } + + int get_layer() const + { return layer; } bool is_solid() const { return solid; } Index: supertux.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/supertux.cpp,v retrieving revision 1.23 retrieving revision 1.24 diff -u -d -r1.23 -r1.24 --- supertux.cpp 14 Jun 2004 22:45:23 -0000 1.23 +++ supertux.cpp 28 Jun 2004 11:30:27 -0000 1.24 @@ -58,10 +58,14 @@ st_menu(); loadshared(); - if (launch_leveleditor_mode && level_startup_file) + if (launch_leveleditor_mode) { - // TODO - // leveleditor(level_startup_file); + LevelEditor leveleditor; + + if(level_startup_file) + leveleditor.run(level_startup_file); + else + leveleditor.run(); } else if (level_startup_file) { |
From: Ricardo C. <rm...@us...> - 2004-06-28 11:30:34
|
Update of /cvsroot/super-tux/supertux/src/screen In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18728/src/screen Modified Files: drawing_context.cpp drawing_context.h Log Message: A few changes to make the code ready for the new level editor. Major changes: - Level's save() works. Still doesn't save the game properly. - added a set_drawing_effect() for DrawingContext. Will apply it to the following drawings. Works with pop/push_transform. Index: drawing_context.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/screen/drawing_context.cpp,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- drawing_context.cpp 25 Jun 2004 11:54:37 -0000 1.11 +++ drawing_context.cpp 28 Jun 2004 11:30:25 -0000 1.12 @@ -27,6 +27,7 @@ DrawingContext::DrawingContext() { +transform.draw_effect = NONE_EFFECT; } DrawingContext::~DrawingContext() @@ -46,6 +47,7 @@ request.request_data = const_cast<Surface*> (surface); request.pos = transform.apply(position); request.drawing_effect = drawing_effect; + request.drawing_effect = transform.draw_effect | drawing_effect; drawingrequests.push_back(request); } @@ -341,3 +343,8 @@ transformstack.pop_back(); } +void +DrawingContext::set_drawing_effect(int effect) +{ + transform.draw_effect = effect; +} Index: drawing_context.h =================================================================== RCS file: /cvsroot/super-tux/supertux/src/screen/drawing_context.h,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- drawing_context.h 25 Jun 2004 11:54:37 -0000 1.9 +++ drawing_context.h 28 Jun 2004 11:30:26 -0000 1.10 @@ -83,6 +83,9 @@ void push_transform(); void pop_transform(); + /** apply that effect in the next draws (effects are listed on surface.h) */ + void set_drawing_effect(int effect); + private: class Transform { @@ -93,6 +96,8 @@ { return v - translation; } + + int draw_effect; }; /// the transform stack |