From: Ondřej Hošek Date: Tue, 11 Apr 2006 07:34:01 +0000 (+0000) Subject: * Some Mac fixes that don't break Linux (inclusion of stddef.h for size_t, explicit... X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=6de12dea8edcf2d684f8540bd603990f9a536d07;p=supertux.git * Some Mac fixes that don't break Linux (inclusion of stddef.h for size_t, explicit conversion from int* to GLint*) * Fixed crasher when player carries Mr Iceblock and jumps out of sector's bounds * Fixed crasher when player hits Enter without supplying a command (or only one or more spaces) in the console * Reflected changes in directory structure and file types in Jamfiles for 'jam install' SVN-Revision: 3290 --- diff --git a/data/Jamfile b/data/Jamfile index 32fab8c14..2abd5d75f 100644 --- a/data/Jamfile +++ b/data/Jamfile @@ -1,78 +1,122 @@ SubDir TOP data ; IMAGEPATHS = - images/tiles - images/tiles/goal - images/tiles/grey - images/tiles/lava - images/tiles/pipe - images/tiles/pole - images/tiles/snow - images/tiles/darksnow - images/tiles/signs - images/tiles/water - images/tiles/doodads - images/tiles/waterfall - images/tiles/auxiliary - images/tiles/background - images/tiles/blocks - images/tiles/forest - images/tiles/jungle - images/tiles/worldmap + images images/background - images/powerups - images/powerups/1up - images/powerups/egg - images/powerups/star - images/powerups/iceflower - images/powerups/fireflower - images/engine - images/engine/menu - images/engine/fonts - images/engine/icons - images/engine/editor - images/objects - images/objects/bell - images/objects/coin - images/objects/door - images/objects/particles - images/objects/hatch - images/objects/flying_platform - images/objects/bonus_block - images/objects/unstable_tile - images/objects/trampoline - images/objects/bullets images/creatures - images/creatures/fish - images/creatures/yeti - images/creatures/snowball - images/creatures/tux_small + images/creatures/angrystone + images/creatures/bouncing_snowball + images/creatures/colorlamp images/creatures/dispenser - images/creatures/mr_iceblock + images/creatures/dummyguy + images/creatures/evilpenguin + images/creatures/fish images/creatures/flame + images/creatures/flame_fish + images/creatures/fluffy + images/creatures/flying_snowball + images/creatures/ghost + images/creatures/granito images/creatures/jumpy + images/creatures/kirby + images/creatures/kugelblitz + images/creatures/mr_bomb + images/creatures/mr_fluffy + images/creatures/mr_iceblock + images/creatures/mr_rocket + images/creatures/mr_tree images/creatures/nolok + images/creatures/penny + images/creatures/plant + images/creatures/poison_ivy + images/creatures/skullhead + images/creatures/skullyhop + images/creatures/snowball + images/creatures/snowsnail + images/creatures/spidermite images/creatures/spike images/creatures/spiky + images/creatures/sspiky images/creatures/stalactite - images/creatures/mr_bomb - images/creatures/mr_tree - images/creatures/flying_snowball + images/creatures/stony + images/creatures/totem images/creatures/tux_big - images/creatures/flame_fish images/creatures/tux_grow - images/creatures/poison_ivy + images/creatures/tux_small + images/creatures/willowisp + images/creatures/yeti images/creatures/zeekling - images/creatures/mr_rocket - images/creatures/bouncing_snowball - images/creatures/dummyguy - images/creatures/plant - images/creatures/sspiky + images/credits + images/effects + images/engine + images/engine/editor + images/engine/fonts + images/engine/icons + images/engine/menu + images/objects + images/objects/bonus_block + images/objects/bullets + images/objects/castledoor + images/objects/coin + images/objects/door + images/objects/eat-me + images/objects/firefly + images/objects/flying_platform + images/objects/hatch + images/objects/icecube + images/objects/keys + images/objects/lamp + images/objects/lightmap_light + images/objects/logo + images/objects/particles + images/objects/platforms + images/objects/radio + images/objects/rock + images/objects/skull_tile + images/objects/skulls + images/objects/spotlight + images/objects/strawbox + images/objects/trampoline + images/objects/unstable_tile + images/objects/voicemail + images/powerups + images/powerups/1up + images/powerups/egg + images/powerups/fireflower + images/powerups/iceflower + images/powerups/potions + images/powerups/star + images/tiles + images/tiles/auxiliary + images/tiles/background + images/tiles/blocks + images/tiles/castle + images/tiles/color + images/tiles/darksnow + images/tiles/doodads + images/tiles/firefly + images/tiles/forest + images/tiles/ghostforest + images/tiles/goal + images/tiles/icewood + images/tiles/jungle + images/tiles/lava + images/tiles/pipe + images/tiles/pole + images/tiles/signs + images/tiles/snow + images/tiles/underground + images/tiles/water + images/tiles/waterfall + images/worldmap + images/worldmap/antarctica + images/worldmap/common + images/worldmap/forest ; for p in $(IMAGEPATHS) { InstallData - [ Wildcard $(p) : *.png *.jpg *.xpm *.strf *.ico *.stgt *.stwt ] + [ Wildcard $(p) : *.png *.jpg *.xpm *.strf *.sprite *.ico *.stgt *.stwt ] : $(p) ; } @@ -88,14 +132,16 @@ LEVELPATHS = ; for p in $(LEVELPATHS) { - InstallData [ Wildcard $(p) : info *.stl *.stwm *.txt *.po ] : $(p) ; + InstallData [ Wildcard $(p) : info *.nut *.stl *.stwm *.txt *.po ] : $(p) ; local translatable_lisp = [ Wildcard $(p) : info *.stl *.stwm *.txt ] ; SEARCH on $(translatable_lisp) = $(SEARCH_SOURCE) ; MakePot $(SUBDIR)/$(p)/messages.pot : $(translatable_lisp) ; XGETTEXT_FLAGS on $(SUBDIR)/$(p)/messages.pot += --language=Lisp ; } -InstallData [ Wildcard *.txt ] ; +InstallData [ Wildcard *.txt *.po ] ; InstallData [ Wildcard music : *.ogg ] : music ; +InstallData [ Wildcard script : *.nut ] : script ; +InstallData [ Wildcard speech : *.ogg ] : speech ; InstallData [ Wildcard sounds : *.wav ] : sounds ; InstallData [ Wildcard locale : *.po ] : locale ; diff --git a/src/badguy/badguy.cpp b/src/badguy/badguy.cpp index 42904049c..a9edc75a4 100644 --- a/src/badguy/badguy.cpp +++ b/src/badguy/badguy.cpp @@ -32,7 +32,7 @@ static const float X_OFFSCREEN_DISTANCE = 1600; static const float Y_OFFSCREEN_DISTANCE = 1200; BadGuy::BadGuy() - : countMe(true), sprite(0), dir(LEFT), state(STATE_INIT) + : countMe(true), sprite(0), remove_out_of_bounds(true), dir(LEFT), state(STATE_INIT) { set_group(COLGROUP_DISABLED); } @@ -62,7 +62,7 @@ BadGuy::draw(DrawingContext& context) void BadGuy::update(float elapsed_time) { - if(!Sector::current()->inside(bbox)) { + if(!Sector::current()->inside(bbox) && remove_out_of_bounds) { remove_me(); return; } diff --git a/src/badguy/badguy.hpp b/src/badguy/badguy.hpp index b3ae59f93..5f0910a18 100644 --- a/src/badguy/badguy.hpp +++ b/src/badguy/badguy.hpp @@ -141,6 +141,12 @@ protected: /// is the enemy activated bool activated; /** + * Should the badguy be removed when it leaves the bounds of the sector? + * Use this when the badguy is portable and picked up by the player, who + * may actually leave the sector's bounds sometimes. + */ + bool remove_out_of_bounds; + /** * initial position of the enemy. Also the position where enemy respawns when * after being deactivated. */ diff --git a/src/badguy/mriceblock.cpp b/src/badguy/mriceblock.cpp index 18efa2f53..d79641aa3 100644 --- a/src/badguy/mriceblock.cpp +++ b/src/badguy/mriceblock.cpp @@ -277,6 +277,7 @@ MrIceBlock::grab(MovingObject&, const Vector& pos, Direction dir) sprite->set_action(dir == LEFT ? "flat-left" : "flat-right"); set_state(ICESTATE_GRABBED); set_group(COLGROUP_DISABLED); + remove_out_of_bounds = false; } void @@ -285,6 +286,7 @@ MrIceBlock::ungrab(MovingObject& , Direction dir) this->dir = dir; set_state(ICESTATE_KICKED); set_group(COLGROUP_MOVING); + remove_out_of_bounds = true; } IMPLEMENT_FACTORY(MrIceBlock, "mriceblock") diff --git a/src/console.cpp b/src/console.cpp index da30b2225..091619ccc 100644 --- a/src/console.cpp +++ b/src/console.cpp @@ -177,6 +177,7 @@ Console::parse(std::string s) } // command is args[0] + if (args.size() == 0) return; std::string command = args.front(); args.erase(args.begin()); diff --git a/src/physfs/physfs_stream.hpp b/src/physfs/physfs_stream.hpp index 6b6b6271e..6a090e45f 100644 --- a/src/physfs/physfs_stream.hpp +++ b/src/physfs/physfs_stream.hpp @@ -18,6 +18,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #ifndef __PHYSFSSTREAM_HPP__ #define __PHYSFSSTREAM_HPP__ +#include #include #include #include diff --git a/src/video/texture_manager.cpp b/src/video/texture_manager.cpp index 174343bd5..42f59c159 100644 --- a/src/video/texture_manager.cpp +++ b/src/video/texture_manager.cpp @@ -148,19 +148,19 @@ TextureManager::save_texture(Texture* texture) saved_texture.texture = texture; glBindTexture(GL_TEXTURE_2D, texture->get_handle()); glGetTexLevelParameteriv(GL_TEXTURE_2D, 0, GL_TEXTURE_WIDTH, - &saved_texture.width); + (GLint*)&saved_texture.width); glGetTexLevelParameteriv(GL_TEXTURE_2D, 0, GL_TEXTURE_HEIGHT, - &saved_texture.height); + (GLint*)&saved_texture.height); glGetTexLevelParameteriv(GL_TEXTURE_2D, 0, GL_TEXTURE_BORDER, - &saved_texture.border); + (GLint*)&saved_texture.border); glGetTexParameteriv(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, - &saved_texture.min_filter); + (GLint*)&saved_texture.min_filter); glGetTexParameteriv(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, - &saved_texture.mag_filter); + (GLint*)&saved_texture.mag_filter); glGetTexParameteriv(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, - &saved_texture.wrap_s); + (GLint*)&saved_texture.wrap_s); glGetTexParameteriv(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, - &saved_texture.wrap_t); + (GLint*)&saved_texture.wrap_t); size_t pixelssize = saved_texture.width * saved_texture.height * 4; saved_texture.pixels = new char[pixelssize]; diff --git a/src/world.cpp b/src/world.cpp index 7999097b3..faf5c7b12 100644 --- a/src/world.cpp +++ b/src/world.cpp @@ -19,6 +19,7 @@ // 02111-1307, USA. #include +#include #include #include