From: grumbel Date: Tue, 17 Nov 2009 20:50:37 +0000 (+0000) Subject: More -Weffc++ cleanup X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=834a8bee2bfa3dc628bee7e5598e94fcea804cb2;p=supertux.git More -Weffc++ cleanup git-svn-id: http://supertux.lethargik.org/svn/supertux/trunk/supertux@6013 837edb03-e0f3-0310-88ca-d4d4e8b29345 --- diff --git a/src/object/camera.cpp b/src/object/camera.cpp index 031714a05..aea8685bc 100644 --- a/src/object/camera.cpp +++ b/src/object/camera.cpp @@ -38,17 +38,17 @@ class CameraConfig { public: // 0 = No, 1 = Fix, 2 = Mario/Yoshi, 3 = Kirby, 4 = Super Metroid-like - int ymode; - // as above int xmode; + // as above + int ymode; float kirby_rectsize_x; float kirby_rectsize_y; // where to fix the player (used for Yoshi and Fix camera) - float target_y; float target_x; + float target_y; // maximum scrolling speed in Y direction - float max_speed_y; float max_speed_x; + float max_speed_y; // factor to dynamically increase max_speed_x based on player speed float dynamic_max_speed_x; @@ -61,27 +61,28 @@ public: // set to <= 0 to disable noscroll mode float sensitive_x; - float clamp_y; float clamp_x; + float clamp_y; float dynamic_speed_sm; - CameraConfig() { - xmode = 4; - ymode = 3; - target_x = .5f; - target_y = .5f; - max_speed_y = 100; - max_speed_x = 100; - clamp_x = 0.1666f; - clamp_y = 0.3f; - kirby_rectsize_x = 0.2f; - kirby_rectsize_y = 0.34f; - edge_x = 0.4f; - sensitive_x = -1; - dynamic_max_speed_x = 1.0; - dirchange_time = 0.2f; - dynamic_speed_sm = 0.8f; + CameraConfig() : + xmode(4), + ymode(3), + kirby_rectsize_x(0.2f), + kirby_rectsize_y(0.34f), + target_x(.5f), + target_y(.5f), + max_speed_x(100), + max_speed_y(100), + dynamic_max_speed_x(1.0), + dirchange_time(0.2f), + edge_x(0.4f), + sensitive_x(-1), + clamp_x(0.1666f), + clamp_y(0.3f), + dynamic_speed_sm(0.8f) + { } void load(const std::string& filename) @@ -110,8 +111,26 @@ public: } }; -Camera::Camera(Sector* newsector, std::string name) - : mode(NORMAL), sector(newsector), lookahead_mode(LOOKAHEAD_NONE) +Camera::Camera(Sector* newsector, std::string name) : + mode(NORMAL), + translation(), + sector(newsector), + lookahead_mode(LOOKAHEAD_NONE), + changetime(), + lookahead_pos(), + peek_pos(), + cached_translation(), + autoscroll_path(), + autoscroll_walker(), + shaketimer(), + shakespeed(), + shakedepth_x(), + shakedepth_y(), + scroll_from(), + scroll_goal(), + scroll_to_pos(), + scrollspeed(), + config() { this->name = name; config = new CameraConfig(); diff --git a/src/object/camera.hpp b/src/object/camera.hpp index f396c2666..7158528af 100644 --- a/src/object/camera.hpp +++ b/src/object/camera.hpp @@ -88,6 +88,7 @@ private: void keep_in_bounds(Vector& vector); void shake(); +private: /** * The camera basically provides lookahead on the left or right side * or is undecided. @@ -96,6 +97,7 @@ private: LOOKAHEAD_NONE, LOOKAHEAD_LEFT, LOOKAHEAD_RIGHT }; +private: Vector translation; Sector* sector; diff --git a/src/object/display_effect.cpp b/src/object/display_effect.cpp index 8f38cf577..924e7e736 100644 --- a/src/object/display_effect.cpp +++ b/src/object/display_effect.cpp @@ -28,6 +28,7 @@ DisplayEffect::DisplayEffect(std::string name) : screen_fading(0), border_fade(NO_FADE), border_fadetime(0), + border_fading(), border_size(0), black(false), borders(false) diff --git a/src/object/endsequence_fireworks.cpp b/src/object/endsequence_fireworks.cpp index 34e7a003b..4fab4e1e7 100644 --- a/src/object/endsequence_fireworks.cpp +++ b/src/object/endsequence_fireworks.cpp @@ -20,8 +20,9 @@ #include "supertux/mainloop.hpp" #include "supertux/sector.hpp" -EndSequenceFireworks::EndSequenceFireworks() - : EndSequence() +EndSequenceFireworks::EndSequenceFireworks() : + EndSequence(), + endsequence_timer() { } diff --git a/src/object/firefly.cpp b/src/object/firefly.cpp index 589441bd2..792c69d9c 100644 --- a/src/object/firefly.cpp +++ b/src/object/firefly.cpp @@ -25,8 +25,10 @@ #include -Firefly::Firefly(const Reader& lisp) - : MovingSprite(lisp, "images/objects/resetpoints/default-resetpoint.sprite", LAYER_TILES, COLGROUP_TOUCHABLE), activated(false) +Firefly::Firefly(const Reader& lisp) : + MovingSprite(lisp, "images/objects/resetpoints/default-resetpoint.sprite", LAYER_TILES, COLGROUP_TOUCHABLE), + activated(false), + initial_position() { initial_position = get_pos(); if( !lisp.get( "sprite", sprite_name ) ){ diff --git a/src/object/fireworks.cpp b/src/object/fireworks.cpp index e943c56f8..6532c89cc 100644 --- a/src/object/fireworks.cpp +++ b/src/object/fireworks.cpp @@ -23,7 +23,8 @@ #include "supertux/sector.hpp" #include "video/drawing_context.hpp" -Fireworks::Fireworks() +Fireworks::Fireworks() : + timer() { timer.start(.2f); sound_manager->preload("sounds/fireworks.wav"); diff --git a/src/object/floating_image.cpp b/src/object/floating_image.cpp index d25ad3db3..07aa120ad 100644 --- a/src/object/floating_image.cpp +++ b/src/object/floating_image.cpp @@ -20,9 +20,11 @@ #include "supertux/main.hpp" FloatingImage::FloatingImage(const std::string& spritefile) : + sprite(), layer(LAYER_FOREGROUND1 + 1), visible(false), anchor(ANCHOR_MIDDLE), + pos(), fading(0), fadetime(0) { diff --git a/src/object/floating_text.cpp b/src/object/floating_text.cpp index bf32552c3..217da5c71 100644 --- a/src/object/floating_text.cpp +++ b/src/object/floating_text.cpp @@ -21,15 +21,19 @@ #include "supertux/resources.hpp" #include "video/drawing_context.hpp" -FloatingText::FloatingText(const Vector& pos, const std::string& text_) - : position(pos), text(text_) +FloatingText::FloatingText(const Vector& pos, const std::string& text_) : + position(pos), + text(text_), + timer() { timer.start(.1f); position.x -= text.size() * 8; } -FloatingText::FloatingText(const Vector& pos, int score) - : position(pos) +FloatingText::FloatingText(const Vector& pos, int score) : + position(pos), + text(), + timer() { timer.start(.1f); diff --git a/src/object/flower.cpp b/src/object/flower.cpp index 4b73264af..aaccbb3eb 100644 --- a/src/object/flower.cpp +++ b/src/object/flower.cpp @@ -20,7 +20,8 @@ #include "sprite/sprite_manager.hpp" Flower::Flower(BonusType _type) : - type(_type) + type(_type), + sprite() { bbox.set_size(32, 32); diff --git a/src/object/lantern.cpp b/src/object/lantern.cpp index 5083038b3..800e17707 100644 --- a/src/object/lantern.cpp +++ b/src/object/lantern.cpp @@ -23,9 +23,10 @@ #include "sprite/sprite_manager.hpp" #include "supertux/object_factory.hpp" -Lantern::Lantern(const Reader& reader) - : Rock(reader, "images/objects/lantern/lantern.sprite"), - lightcolor(1.0f, 1.0f, 1.0f) +Lantern::Lantern(const Reader& reader) : + Rock(reader, "images/objects/lantern/lantern.sprite"), + lightcolor(1.0f, 1.0f, 1.0f), + lightsprite() { //get color from lisp std::vector vColor; @@ -37,9 +38,10 @@ Lantern::Lantern(const Reader& reader) sound_manager->preload("sounds/willocatch.wav"); } -Lantern::Lantern(const Vector& pos) - : Rock(pos, "images/objects/lantern/lantern.sprite"), - lightcolor(0.0f, 0.0f, 0.0f) +Lantern::Lantern(const Vector& pos) : + Rock(pos, "images/objects/lantern/lantern.sprite"), + lightcolor(0.0f, 0.0f, 0.0f), + lightsprite() { lightsprite = sprite_manager->create("images/objects/lightmap_light/lightmap_light.sprite"); lightsprite->set_blend(Blend(GL_SRC_ALPHA, GL_ONE)); diff --git a/src/object/level_time.cpp b/src/object/level_time.cpp index 20c708f85..1f92c11ec 100644 --- a/src/object/level_time.cpp +++ b/src/object/level_time.cpp @@ -32,6 +32,7 @@ static const float TIME_WARNING = 20; LevelTime::LevelTime(const Reader& reader) : + time_surface(), running(true), time_left(0) { diff --git a/src/object/magicblock.cpp b/src/object/magicblock.cpp index ab3d64759..973c7646f 100644 --- a/src/object/magicblock.cpp +++ b/src/object/magicblock.cpp @@ -38,9 +38,15 @@ const float SWITCH_DELAY = 0.1f; /**< seconds to wait for stable conditions unti MagicBlock::MagicBlock(const Reader& lisp) : MovingSprite(lisp, "images/objects/magicblock/magicblock.sprite"), is_solid(false), + trigger_red(), + trigger_green(), + trigger_blue(), solid_time(0), - switch_delay(0), - light(1.0f,1.0f,1.0f) + switch_delay(0), + color(), + light(1.0f,1.0f,1.0f), + center(), + black() { set_group(COLGROUP_STATIC); //get color from lisp diff --git a/src/object/moving_sprite.cpp b/src/object/moving_sprite.cpp index a737109d0..24f0877b4 100644 --- a/src/object/moving_sprite.cpp +++ b/src/object/moving_sprite.cpp @@ -18,8 +18,11 @@ #include "sprite/sprite.hpp" #include "sprite/sprite_manager.hpp" -MovingSprite::MovingSprite(const Vector& pos, const std::string& sprite_name, int layer, CollisionGroup collision_group) - : sprite_name(sprite_name), layer(layer) +MovingSprite::MovingSprite(const Vector& pos, const std::string& sprite_name, + int layer, CollisionGroup collision_group) : + sprite_name(sprite_name), + sprite(), + layer(layer) { bbox.set_pos(pos); sprite = sprite_manager->create(sprite_name); @@ -27,8 +30,10 @@ MovingSprite::MovingSprite(const Vector& pos, const std::string& sprite_name, in set_group(collision_group); } -MovingSprite::MovingSprite(const Reader& reader, const Vector& pos, int layer, CollisionGroup collision_group) - : layer(layer) +MovingSprite::MovingSprite(const Reader& reader, const Vector& pos, int layer, CollisionGroup collision_group) : + sprite_name(sprite_name), + sprite(), + layer(layer) { bbox.set_pos(pos); if (!reader.get("sprite", sprite_name)) @@ -39,8 +44,10 @@ MovingSprite::MovingSprite(const Reader& reader, const Vector& pos, int layer, C set_group(collision_group); } -MovingSprite::MovingSprite(const Reader& reader, const std::string& sprite_name, int layer, CollisionGroup collision_group) - : sprite_name(sprite_name), layer(layer) +MovingSprite::MovingSprite(const Reader& reader, const std::string& sprite_name, int layer, CollisionGroup collision_group) : + sprite_name(sprite_name), + sprite(), + layer(layer) { reader.get("x", bbox.p1.x); reader.get("y", bbox.p1.y); @@ -51,8 +58,10 @@ MovingSprite::MovingSprite(const Reader& reader, const std::string& sprite_name, set_group(collision_group); } -MovingSprite::MovingSprite(const Reader& reader, int layer, CollisionGroup collision_group) - : layer(layer) +MovingSprite::MovingSprite(const Reader& reader, int layer, CollisionGroup collision_group) : + sprite_name(), + sprite(), + layer(layer) { reader.get("x", bbox.p1.x); reader.get("y", bbox.p1.y); @@ -66,6 +75,8 @@ MovingSprite::MovingSprite(const Reader& reader, int layer, CollisionGroup colli MovingSprite::MovingSprite(const MovingSprite& other) : MovingObject(other), + sprite_name(), + sprite(), layer(other.layer) { sprite.reset(new Sprite(*other.sprite)); diff --git a/src/object/oneup.cpp b/src/object/oneup.cpp index d48b58d07..cea25b0ea 100644 --- a/src/object/oneup.cpp +++ b/src/object/oneup.cpp @@ -19,7 +19,8 @@ #include "supertux/sector.hpp" OneUp::OneUp(const Vector& pos, Direction direction) : - MovingSprite(pos, "images/powerups/1up/1up.sprite", LAYER_FLOATINGOBJECTS, COLGROUP_TOUCHABLE) + MovingSprite(pos, "images/powerups/1up/1up.sprite", LAYER_FLOATINGOBJECTS, COLGROUP_TOUCHABLE), + physic() { physic.set_velocity((direction == LEFT)?-100:100, -400); } diff --git a/src/object/particles.cpp b/src/object/particles.cpp index 3730b0d92..18432ea08 100644 --- a/src/object/particles.cpp +++ b/src/object/particles.cpp @@ -28,9 +28,12 @@ Particles::Particles(const Vector& epicenter, int min_angle, int max_angle, const Vector& initial_velocity, const Vector& acceleration, int number, Color color_, int size_, float life_time, int drawing_layer_) : accel(acceleration), + timer(), + live_forever(), color(color_), size(size_), - drawing_layer(drawing_layer_) + drawing_layer(drawing_layer_), + particles() { if(life_time == 0) { live_forever = true; diff --git a/src/object/particles.hpp b/src/object/particles.hpp index 55c2b1aaf..858266508 100644 --- a/src/object/particles.hpp +++ b/src/object/particles.hpp @@ -35,6 +35,17 @@ public: virtual void draw(DrawingContext& context); private: + struct Particle { + Vector pos, vel; + + Particle() : + pos(), + vel() + {} + // float angle; + }; + +private: Vector accel; Timer timer; bool live_forever; @@ -43,10 +54,6 @@ private: float size; int drawing_layer; - struct Particle { - Vector pos, vel; - // float angle; - }; std::vector particles; }; diff --git a/src/object/particlesystem.cpp b/src/object/particlesystem.cpp index dcbd90fc2..bb79f54de 100644 --- a/src/object/particlesystem.cpp +++ b/src/object/particlesystem.cpp @@ -175,8 +175,8 @@ void GhostParticleSystem::update(float elapsed_time) } } -CloudParticleSystem::CloudParticleSystem() - : ParticleSystem(128) +CloudParticleSystem::CloudParticleSystem() : + ParticleSystem(128) { cloudimage = new Surface("images/objects/particles/cloud.png"); diff --git a/src/object/particlesystem.hpp b/src/object/particlesystem.hpp index 6671ef03d..59c92b230 100644 --- a/src/object/particlesystem.hpp +++ b/src/object/particlesystem.hpp @@ -57,8 +57,13 @@ protected: class Particle { public: + Particle() : + pos(), + texture() + {} + virtual ~Particle() - { } + {} Vector pos; Surface* texture; @@ -92,6 +97,10 @@ private: }; Surface* snowimages[3]; + +private: + SnowParticleSystem(const SnowParticleSystem&); + SnowParticleSystem& operator=(const SnowParticleSystem&); }; class GhostParticleSystem : public ParticleSystem @@ -112,9 +121,17 @@ private: { public: float speed; + + GhostParticle() : + speed() + {} }; Surface* ghosts[2]; + +private: + GhostParticleSystem(const GhostParticleSystem&); + GhostParticleSystem& operator=(const GhostParticleSystem&); }; class CloudParticleSystem : public ParticleSystem @@ -138,6 +155,10 @@ private: }; Surface* cloudimage; + +private: + CloudParticleSystem(const CloudParticleSystem&); + CloudParticleSystem& operator=(const CloudParticleSystem&); }; #endif diff --git a/src/object/particlesystem_interactive.hpp b/src/object/particlesystem_interactive.hpp index 27e37cfa3..0b5ade0cd 100644 --- a/src/object/particlesystem_interactive.hpp +++ b/src/object/particlesystem_interactive.hpp @@ -49,8 +49,13 @@ protected: class Particle { public: + Particle() : + pos(), + texture() + {} + virtual ~Particle() - { } + {} Vector pos; Surface* texture; @@ -82,6 +87,10 @@ private: }; Surface* rainimages[2]; + +private: + RainParticleSystem(const RainParticleSystem&); + RainParticleSystem& operator=(const RainParticleSystem&); }; class CometParticleSystem : public ParticleSystem_Interactive @@ -106,6 +115,10 @@ private: }; Surface* cometimages[2]; + +private: + CometParticleSystem(const CometParticleSystem&); + CometParticleSystem& operator=(const CometParticleSystem&); }; #endif diff --git a/src/object/path.hpp b/src/object/path.hpp index 8230ab890..779ca1923 100644 --- a/src/object/path.hpp +++ b/src/object/path.hpp @@ -43,6 +43,11 @@ public: public: Vector position; /**< the position of this node */ float time; /**< time (in seconds) to get from this node to next node */ + + Node() : + position(), + time() + {} }; std::vector nodes; diff --git a/src/object/path_walker.cpp b/src/object/path_walker.cpp index 46c891353..cf668c95c 100644 --- a/src/object/path_walker.cpp +++ b/src/object/path_walker.cpp @@ -26,6 +26,7 @@ PathWalker::PathWalker(const Path* path, bool running) : next_node_nr(0), stop_at_node_nr(running?-1:0), node_time(0), + node_mult(), walking_speed(1.0) { node_mult = 1 / path->nodes[0].time; diff --git a/src/object/platform.cpp b/src/object/platform.cpp index 8ac06240b..794ff7612 100644 --- a/src/object/platform.cpp +++ b/src/object/platform.cpp @@ -23,10 +23,14 @@ #include "supertux/sector.hpp" #include "util/reader.hpp" -Platform::Platform(const Reader& reader) - : MovingSprite(reader, Vector(0,0), LAYER_OBJECTS, COLGROUP_STATIC), - speed(Vector(0,0)), - automatic(false), player_contact(false), last_player_contact(false) +Platform::Platform(const Reader& reader) : + MovingSprite(reader, Vector(0,0), LAYER_OBJECTS, COLGROUP_STATIC), + path(), + walker(), + speed(Vector(0,0)), + automatic(false), + player_contact(false), + last_player_contact(false) { bool running = true; reader.get("name", name); diff --git a/src/object/rock.cpp b/src/object/rock.cpp index ee9b2f461..3daf7126c 100644 --- a/src/object/rock.cpp +++ b/src/object/rock.cpp @@ -49,8 +49,12 @@ Rock::Rock(const Reader& reader) : set_group(COLGROUP_MOVING_STATIC); } -Rock::Rock(const Reader& reader, std::string spritename) - : MovingSprite(reader, spritename) +Rock::Rock(const Reader& reader, std::string spritename) : + MovingSprite(reader, spritename), + physic(), + on_ground(), + grabbed(), + last_movement() { sound_manager->preload(ROCK_SOUND); on_ground = false; diff --git a/src/object/scripted_object.cpp b/src/object/scripted_object.cpp index b1a572a2e..2da88188c 100644 --- a/src/object/scripted_object.cpp +++ b/src/object/scripted_object.cpp @@ -24,10 +24,13 @@ ScriptedObject::ScriptedObject(const Reader& lisp) : MovingSprite(lisp, LAYER_OBJECTS, COLGROUP_MOVING_STATIC), + physic(), + name(), solid(true), physic_enabled(true), visible(true), - new_vel_set(false) + new_vel_set(false), + new_vel() { lisp.get("name", name); if(name == "") diff --git a/src/object/text_object.cpp b/src/object/text_object.cpp index dea467cfa..efe870874 100644 --- a/src/object/text_object.cpp +++ b/src/object/text_object.cpp @@ -22,9 +22,12 @@ #include "video/drawing_context.hpp" TextObject::TextObject(std::string name) : + font(), + text(), fading(0), fadetime(0), visible(false), + centered(), anchor(ANCHOR_MIDDLE), pos(0, 0) { diff --git a/src/object/thunderstorm.cpp b/src/object/thunderstorm.cpp index 8cb171dfc..cd926050e 100644 --- a/src/object/thunderstorm.cpp +++ b/src/object/thunderstorm.cpp @@ -32,7 +32,10 @@ const float FLASH_DISPLAY_TIME = 0.1f; Thunderstorm::Thunderstorm(const Reader& reader) : running(true), interval(10.0f), - layer(LAYER_BACKGROUNDTILES-1) + layer(LAYER_BACKGROUNDTILES-1), + time_to_thunder(), + time_to_lightning(), + flash_display_timer() { reader.get("name", name); reader.get("running", running); diff --git a/src/object/wind.cpp b/src/object/wind.cpp index ab23c3525..7a9c6f1e3 100644 --- a/src/object/wind.cpp +++ b/src/object/wind.cpp @@ -26,8 +26,11 @@ #include "util/reader.hpp" #include "video/drawing_context.hpp" -Wind::Wind(const Reader& reader) - : blowing(true), acceleration(100), elapsed_time(0) +Wind::Wind(const Reader& reader) : + blowing(true), + speed(), + acceleration(100), + elapsed_time(0) { reader.get("name", name); reader.get("x", bbox.p1.x); diff --git a/src/scripting/floating_image.cpp b/src/scripting/floating_image.cpp index 270814d63..1410827e7 100644 --- a/src/scripting/floating_image.cpp +++ b/src/scripting/floating_image.cpp @@ -23,7 +23,8 @@ namespace Scripting { -FloatingImage::FloatingImage(const std::string& spritefile) +FloatingImage::FloatingImage(const std::string& spritefile) : + floating_image() { using namespace WorldMapNS; diff --git a/src/scripting/platform.hpp b/src/scripting/platform.hpp index aeb6257fd..a1184753e 100644 --- a/src/scripting/platform.hpp +++ b/src/scripting/platform.hpp @@ -43,6 +43,10 @@ public: #ifndef SCRIPTING_API _Platform* platform; + +private: + Platform(const Platform&); + Platform& operator=(const Platform&); #endif }; diff --git a/src/scripting/squirrel_error.cpp b/src/scripting/squirrel_error.cpp index 82f8dbcc7..672ca2577 100644 --- a/src/scripting/squirrel_error.cpp +++ b/src/scripting/squirrel_error.cpp @@ -19,7 +19,8 @@ namespace Scripting { -SquirrelError::SquirrelError(HSQUIRRELVM v, const std::string& message) throw() +SquirrelError::SquirrelError(HSQUIRRELVM v, const std::string& message) throw() : + message() { std::ostringstream msg; msg << "Squirrel error: " << message << " ("; diff --git a/src/scripting/thread_queue.cpp b/src/scripting/thread_queue.cpp index 4e3d06c54..c9ecff26a 100644 --- a/src/scripting/thread_queue.cpp +++ b/src/scripting/thread_queue.cpp @@ -22,7 +22,8 @@ namespace Scripting { -ThreadQueue::ThreadQueue() +ThreadQueue::ThreadQueue() : + threads() { } diff --git a/src/scripting/tilemap.hpp b/src/scripting/tilemap.hpp index 8ad817773..3c402b307 100644 --- a/src/scripting/tilemap.hpp +++ b/src/scripting/tilemap.hpp @@ -59,6 +59,10 @@ public: #ifndef SCRIPTING_API _TileMap* tilemap; + +private: + TileMap(const TileMap&); + TileMap& operator=(const TileMap&); #endif }; diff --git a/src/scripting/time_scheduler.cpp b/src/scripting/time_scheduler.cpp index 9773fca2f..3b484f606 100644 --- a/src/scripting/time_scheduler.cpp +++ b/src/scripting/time_scheduler.cpp @@ -24,7 +24,8 @@ namespace Scripting { TimeScheduler* TimeScheduler::instance = NULL; -TimeScheduler::TimeScheduler() +TimeScheduler::TimeScheduler() : + schedule() { } diff --git a/src/sprite/sprite.cpp b/src/sprite/sprite.cpp index 782fc5223..d3995048d 100644 --- a/src/sprite/sprite.cpp +++ b/src/sprite/sprite.cpp @@ -19,12 +19,15 @@ #include "sprite/sprite.hpp" #include "supertux/timer.hpp" -Sprite::Sprite(SpriteData& newdata) - : data(newdata), - frame(0), - animation_loops(-1), - angle(0.0f), - color(1.0f, 1.0f, 1.0f, 1.0f) +Sprite::Sprite(SpriteData& newdata) : + data(newdata), + frame(0), + animation_loops(-1), + last_ticks(), + angle(0.0f), + color(1.0f, 1.0f, 1.0f, 1.0f), + blend(), + action() { action = data.get_action("normal"); if(!action) @@ -32,14 +35,16 @@ Sprite::Sprite(SpriteData& newdata) last_ticks = game_time; } -Sprite::Sprite(const Sprite& other) - : data(other.data), frame(other.frame), - animation_loops(other.animation_loops), - angle(0.0f), - color(1.0f, 1.0f, 1.0f, 1.0f), - action(other.action) +Sprite::Sprite(const Sprite& other) : + data(other.data), + frame(other.frame), + animation_loops(other.animation_loops), + last_ticks(game_time), + angle(0.0f), // FIXME: this can't be right + color(1.0f, 1.0f, 1.0f, 1.0f), + blend(), + action(other.action) { - last_ticks = game_time; } Sprite::~Sprite() diff --git a/src/sprite/sprite_data.cpp b/src/sprite/sprite_data.cpp index 5f2fe752d..6d2d2a558 100644 --- a/src/sprite/sprite_data.cpp +++ b/src/sprite/sprite_data.cpp @@ -22,7 +22,15 @@ #include "lisp/list_iterator.hpp" #include "util/log.hpp" -SpriteData::Action::Action() +SpriteData::Action::Action() : + name(), + x_offset(), + y_offset(), + hitbox_w(), + hitbox_h(), + z_order(), + fps(), + surfaces() { x_offset = 0; y_offset = 0; @@ -39,7 +47,9 @@ SpriteData::Action::~Action() delete *i; } -SpriteData::SpriteData(const lisp::Lisp* lisp, const std::string& basedir) +SpriteData::SpriteData(const lisp::Lisp* lisp, const std::string& basedir) : + actions(), + name() { lisp::ListIterator iter(lisp); while(iter.next()) { diff --git a/src/sprite/sprite_data.hpp b/src/sprite/sprite_data.hpp index 82d50d57b..85940e218 100644 --- a/src/sprite/sprite_data.hpp +++ b/src/sprite/sprite_data.hpp @@ -64,12 +64,12 @@ private: }; typedef std::map Actions; - Actions actions; void parse_action(const lisp::Lisp* lispreader, const std::string& basedir); /** Get an action */ Action* get_action(std::string act); + Actions actions; std::string name; }; diff --git a/src/sprite/sprite_manager.cpp b/src/sprite/sprite_manager.cpp index cc64de18b..a12fff501 100644 --- a/src/sprite/sprite_manager.cpp +++ b/src/sprite/sprite_manager.cpp @@ -22,7 +22,8 @@ SpriteManager* sprite_manager = NULL; -SpriteManager::SpriteManager() +SpriteManager::SpriteManager() : + sprites() { } diff --git a/src/supertux/gameconfig.cpp b/src/supertux/gameconfig.cpp index 25679aeaa..dbef16551 100644 --- a/src/supertux/gameconfig.cpp +++ b/src/supertux/gameconfig.cpp @@ -27,32 +27,29 @@ Config* g_config = 0; -Config::Config() +Config::Config() : + profile(1), + fullscreen_width (800), + fullscreen_height(600), + window_width (800), + window_height(600), + aspect_width (0), // auto detect + aspect_height(0), + magnification(1.0f), + use_fullscreen(false), + video(AUTO_VIDEO), + try_vsync(true), + show_fps(false), + sound_enabled(true), + music_enabled(true), + console_enabled(false), + random_seed(0), // set by time(), by default (unless in config) + start_level(), + enable_script_debugger(false), + start_demo(), + record_demo(), + locale() { - profile = 1; - use_fullscreen = false; - video = AUTO_VIDEO; - try_vsync = true; - show_fps = false; - sound_enabled = true; - music_enabled = true; - console_enabled = false; - random_seed = 0; // set by time(), by default (unless in config) - - window_width = 800; - window_height = 600; - - fullscreen_width = 800; - fullscreen_height = 600; - - magnification = 1.0f; - - aspect_width = 0; // auto detect - aspect_height = 0; - - enable_script_debugger = false; - - locale = ""; // autodetect } Config::~Config() diff --git a/src/supertux/level.cpp b/src/supertux/level.cpp index 598ca898a..a398d7fbf 100644 --- a/src/supertux/level.cpp +++ b/src/supertux/level.cpp @@ -30,6 +30,12 @@ using namespace std; Level::Level() : name("noname"), author("Mr. X"), + contact(), + license(), + filename(), + on_menukey_script(), + sectors(), + stats(), tileset(NULL), free_tileset(false) { diff --git a/src/supertux/spawn_point.cpp b/src/supertux/spawn_point.cpp index 5f36934df..3175da834 100644 --- a/src/supertux/spawn_point.cpp +++ b/src/supertux/spawn_point.cpp @@ -30,7 +30,9 @@ SpawnPoint::SpawnPoint(const SpawnPoint& other) : pos(other.pos) {} -SpawnPoint::SpawnPoint(const lisp::Lisp* slisp) +SpawnPoint::SpawnPoint(const lisp::Lisp* slisp) : + name(), + pos() { pos.x = -1; pos.y = -1; diff --git a/src/supertux/textscroller.cpp b/src/supertux/textscroller.cpp index 1f9e0203d..b9a62914d 100644 --- a/src/supertux/textscroller.cpp +++ b/src/supertux/textscroller.cpp @@ -31,7 +31,14 @@ static const float LEFT_BORDER = 50; static const float SCROLL = 60; static const float ITEMS_SPACE = 4; -TextScroller::TextScroller(const std::string& filename) +TextScroller::TextScroller(const std::string& filename) : + defaultspeed(), + speed(), + music(), + background(), + lines(), + scroll(), + fading() { defaultspeed = DEFAULT_SPEED; speed = defaultspeed; diff --git a/src/supertux/textscroller.hpp b/src/supertux/textscroller.hpp index c6d2d2703..fca80d764 100644 --- a/src/supertux/textscroller.hpp +++ b/src/supertux/textscroller.hpp @@ -98,6 +98,7 @@ public: static Color heading_color; static Color reference_color; static Color normal_color; + private: float defaultspeed; float speed; diff --git a/src/supertux/tile.cpp b/src/supertux/tile.cpp index d0489d875..5a5528d53 100644 --- a/src/supertux/tile.cpp +++ b/src/supertux/tile.cpp @@ -24,6 +24,8 @@ Tile::Tile(const TileSet *new_tileset) : tileset(new_tileset), + imagespecs(), + images(), attributes(0), data(0), anim_fps(1) @@ -33,6 +35,8 @@ Tile::Tile(const TileSet *new_tileset) : Tile::Tile(const TileSet *new_tileset, std::vector images, Rect rect, uint32_t attributes, uint32_t data, float animfps) : tileset(new_tileset), + imagespecs(), + images(), attributes(attributes), data(data), anim_fps(animfps) diff --git a/src/supertux/tile_manager.cpp b/src/supertux/tile_manager.cpp index a6873de36..926693204 100644 --- a/src/supertux/tile_manager.cpp +++ b/src/supertux/tile_manager.cpp @@ -26,7 +26,8 @@ TileManager* tile_manager = NULL; TileSet* current_tileset = NULL; -TileManager::TileManager() +TileManager::TileManager() : + tilesets() { } diff --git a/src/supertux/tile_set.cpp b/src/supertux/tile_set.cpp index 4a798f699..a96436dca 100644 --- a/src/supertux/tile_set.cpp +++ b/src/supertux/tile_set.cpp @@ -23,8 +23,10 @@ #include "lisp/parser.hpp" #include "util/file_system.hpp" -TileSet::TileSet() - : tiles_path(""), tiles_loaded(false) +TileSet::TileSet() : + tiles(), + tiles_path(""), + tiles_loaded(false) { tiles.resize(1, 0); tiles[0] = new Tile(this); diff --git a/src/supertux/title.cpp b/src/supertux/title.cpp index 72c6b9eb7..b4b3e70f2 100644 --- a/src/supertux/title.cpp +++ b/src/supertux/title.cpp @@ -52,6 +52,31 @@ enum MainMenuIDs { MNID_QUITMAINMENU }; +TitleScreen::TitleScreen() : + main_menu(), + contrib_menu(), + contrib_world_menu(), + main_world(), + contrib_worlds(), + addons_menu(), + addons(), + current_world(), + frame(), + controller(), + titlesession() +{ + controller.reset(new CodeController()); + titlesession.reset(new GameSession("levels/misc/menu.stl")); + + Player* player = titlesession->get_current_sector()->player; + player->set_controller(controller.get()); + player->set_speedlimit(230); //MAX_WALK_XM + + generate_main_menu(); + + frame = std::auto_ptr(new Surface("images/engine/menu/frame.png")); +} + void TitleScreen::update_load_game_menu() { @@ -305,20 +330,6 @@ TitleScreen::make_tux_jump() } } -TitleScreen::TitleScreen() -{ - controller.reset(new CodeController()); - titlesession.reset(new GameSession("levels/misc/menu.stl")); - - Player* player = titlesession->get_current_sector()->player; - player->set_controller(controller.get()); - player->set_speedlimit(230); //MAX_WALK_XM - - generate_main_menu(); - - frame = std::auto_ptr(new Surface("images/engine/menu/frame.png")); -} - void TitleScreen::generate_main_menu() { diff --git a/src/supertux/title.hpp b/src/supertux/title.hpp index 7336be9cf..b61fb01ed 100644 --- a/src/supertux/title.hpp +++ b/src/supertux/title.hpp @@ -55,6 +55,7 @@ private: void check_addons_menu(); void free_addons_menu(); +private: std::auto_ptr main_menu; std::auto_ptr contrib_menu; std::auto_ptr contrib_world_menu; @@ -67,6 +68,10 @@ private: std::auto_ptr frame; std::auto_ptr controller; std::auto_ptr titlesession; + +private: + TitleScreen(const TitleScreen&); + TitleScreen& operator=(const TitleScreen&); }; #endif diff --git a/src/supertux/world.cpp b/src/supertux/world.cpp index d6519beba..2909226c3 100644 --- a/src/supertux/world.cpp +++ b/src/supertux/world.cpp @@ -35,7 +35,16 @@ static bool has_suffix(const std::string& data, const std::string& suffix) World* World::current_ = NULL; -World::World() +World::World() : + levels(), + basedir(), + savegame_filename(), + state_table(), + world_thread(), + title(), + description(), + hide_from_contribs(), + is_levelset() { is_levelset = true; hide_from_contribs = false; diff --git a/src/supertux/world.hpp b/src/supertux/world.hpp index cffc0a485..9ea04c47c 100644 --- a/src/supertux/world.hpp +++ b/src/supertux/world.hpp @@ -23,15 +23,6 @@ class World { -private: - std::vector levels; - std::string basedir; - std::string savegame_filename; - /// squirrel table that saves persistent state (about the world) - HSQOBJECT state_table; - HSQOBJECT world_thread; - static World* current_; - public: World(); ~World(); @@ -54,8 +45,20 @@ public: void run(); +private: + std::vector levels; + std::string basedir; + std::string savegame_filename; + /// squirrel table that saves persistent state (about the world) + HSQOBJECT state_table; + HSQOBJECT world_thread; + static World* current_; + +public: std::string title; std::string description; + +public: bool hide_from_contribs; bool is_levelset; }; diff --git a/src/trigger/climbable.cpp b/src/trigger/climbable.cpp index 2045d7629..416fb005c 100644 --- a/src/trigger/climbable.cpp +++ b/src/trigger/climbable.cpp @@ -30,8 +30,9 @@ const float POSITION_FIX_AX = 50; // x-wise acceleration applied to player when const float POSITION_FIX_AY = 50; // y-wise acceleration applied to player when trying to align player and Climbable } -Climbable::Climbable(const Reader& reader) - : climbed_by(0) +Climbable::Climbable(const Reader& reader) : + climbed_by(0), + activate_try_timer() { reader.get("x", bbox.p1.x); reader.get("y", bbox.p1.y); @@ -41,8 +42,9 @@ Climbable::Climbable(const Reader& reader) bbox.set_size(w, h); } -Climbable::Climbable(const Rect& area) - : climbed_by(0) +Climbable::Climbable(const Rect& area) : + climbed_by(0), + activate_try_timer() { bbox = area; } diff --git a/src/trigger/door.cpp b/src/trigger/door.cpp index b86fa0fba..2f44ac280 100644 --- a/src/trigger/door.cpp +++ b/src/trigger/door.cpp @@ -22,7 +22,11 @@ #include "trigger/door.hpp" Door::Door(const Reader& reader) : - state(CLOSED) + state(CLOSED), + target_sector(), + target_spawnpoint(), + sprite(), + stay_open_timer() { reader.get("x", bbox.p1.x); reader.get("y", bbox.p1.y); @@ -37,7 +41,11 @@ Door::Door(const Reader& reader) : } Door::Door(int x, int y, std::string sector, std::string spawnpoint) : - state(CLOSED) + state(CLOSED), + target_sector(), + target_spawnpoint(), + sprite(), + stay_open_timer() { bbox.set_pos(Vector(x, y)); target_sector = sector; diff --git a/src/trigger/scripttrigger.cpp b/src/trigger/scripttrigger.cpp index 29700e2e4..50aa75f37 100644 --- a/src/trigger/scripttrigger.cpp +++ b/src/trigger/scripttrigger.cpp @@ -23,7 +23,9 @@ #include "trigger/scripttrigger.hpp" #include "util/reader.hpp" -ScriptTrigger::ScriptTrigger(const Reader& reader) +ScriptTrigger::ScriptTrigger(const Reader& reader) : + triggerevent(), + script() { bool must_activate = false; @@ -45,7 +47,9 @@ ScriptTrigger::ScriptTrigger(const Reader& reader) triggerevent = EVENT_TOUCH; } -ScriptTrigger::ScriptTrigger(const Vector& pos, const std::string& script) +ScriptTrigger::ScriptTrigger(const Vector& pos, const std::string& script) : + triggerevent(), + script() { bbox.set_pos(pos); bbox.set_size(32, 32); diff --git a/src/trigger/secretarea_trigger.cpp b/src/trigger/secretarea_trigger.cpp index 68c0a85c9..8f3366bb3 100644 --- a/src/trigger/secretarea_trigger.cpp +++ b/src/trigger/secretarea_trigger.cpp @@ -29,7 +29,9 @@ static const float MESSAGE_TIME=3.5; SecretAreaTrigger::SecretAreaTrigger(const Reader& reader) : - fade_tilemap("") + message_timer(), + message_displayed(), + fade_tilemap() { reader.get("x", bbox.p1.x); reader.get("y", bbox.p1.y); @@ -42,8 +44,10 @@ SecretAreaTrigger::SecretAreaTrigger(const Reader& reader) : message_displayed = false; } -SecretAreaTrigger::SecretAreaTrigger(const Rect& area, std::string fade_tilemap) - : fade_tilemap(fade_tilemap) +SecretAreaTrigger::SecretAreaTrigger(const Rect& area, std::string fade_tilemap) : + message_timer(), + message_displayed(), + fade_tilemap(fade_tilemap) { bbox = area; message_displayed = false; diff --git a/src/trigger/sequence_trigger.cpp b/src/trigger/sequence_trigger.cpp index 3ea537229..7491a08b0 100644 --- a/src/trigger/sequence_trigger.cpp +++ b/src/trigger/sequence_trigger.cpp @@ -19,7 +19,9 @@ #include "trigger/sequence_trigger.hpp" #include "util/reader.hpp" -SequenceTrigger::SequenceTrigger(const Reader& reader) +SequenceTrigger::SequenceTrigger(const Reader& reader) : + triggerevent(), + sequence_name() { reader.get("x", bbox.p1.x); reader.get("y", bbox.p1.y); @@ -31,7 +33,9 @@ SequenceTrigger::SequenceTrigger(const Reader& reader) triggerevent = EVENT_TOUCH; } -SequenceTrigger::SequenceTrigger(const Vector& pos, const std::string& sequence) +SequenceTrigger::SequenceTrigger(const Vector& pos, const std::string& sequence) : + triggerevent(), + sequence_name() { bbox.set_pos(pos); bbox.set_size(32, 32); diff --git a/src/trigger/switch.cpp b/src/trigger/switch.cpp index e01e887ee..329a50f33 100644 --- a/src/trigger/switch.cpp +++ b/src/trigger/switch.cpp @@ -29,6 +29,9 @@ const std::string SWITCH_SOUND = "sounds/switch.ogg"; } Switch::Switch(const Reader& reader) : + sprite_name(), + sprite(), + script(), state(OFF) { if (!reader.get("x", bbox.p1.x)) throw std::runtime_error("no x position set"); diff --git a/src/trigger/switch.hpp b/src/trigger/switch.hpp index a1a601dd9..3bfd59a51 100644 --- a/src/trigger/switch.hpp +++ b/src/trigger/switch.hpp @@ -42,12 +42,11 @@ private: TURN_OFF }; +private: std::string sprite_name; std::auto_ptr sprite; std::string script; - SwitchState state; - }; #endif diff --git a/src/trigger/trigger_base.cpp b/src/trigger/trigger_base.cpp index 85a9a0e7e..247ee2bf1 100644 --- a/src/trigger/trigger_base.cpp +++ b/src/trigger/trigger_base.cpp @@ -22,7 +22,8 @@ TriggerBase::TriggerBase() : sprite(), lasthit(false), - hit(false) + hit(false), + losetouch_listeners() { set_group(COLGROUP_TOUCHABLE); } diff --git a/src/video/drawing_context.cpp b/src/video/drawing_context.cpp index 89b925c12..82890be72 100644 --- a/src/video/drawing_context.cpp +++ b/src/video/drawing_context.cpp @@ -40,7 +40,20 @@ static inline int next_po2(int val) } DrawingContext::DrawingContext() : - renderer(0), lightmap(0), ambient_color(1.0f, 1.0f, 1.0f, 1.0f), target(NORMAL), screenshot_requested(false) + renderer(0), + lightmap(0), + transformstack(), + transform(), + blend_stack(), + blend_mode(), + drawing_requests(), + lightmap_requests(), + requests(), + ambient_color(1.0f, 1.0f, 1.0f, 1.0f), + target(NORMAL), + target_stack(), + obst(), + screenshot_requested(false) { requests = &drawing_requests; obstack_init(&obst); @@ -341,9 +354,6 @@ DrawingContext::do_drawing() } class RequestPtrCompare - : public std::binary_function { public: bool operator()(const DrawingRequest* r1, const DrawingRequest* r2) const diff --git a/src/video/drawing_context.hpp b/src/video/drawing_context.hpp index a8b7fc400..302b90e23 100644 --- a/src/video/drawing_context.hpp +++ b/src/video/drawing_context.hpp @@ -116,6 +116,12 @@ public: void take_screenshot(); private: + typedef std::vector DrawingRequests; + +private: + void handle_drawing_requests(DrawingRequests& requests); + +private: class Transform { public: @@ -135,6 +141,7 @@ private: } }; +private: Renderer *renderer; Lightmap *lightmap; @@ -146,10 +153,6 @@ private: std::vector blend_stack; Blend blend_mode; - typedef std::vector DrawingRequests; - - void handle_drawing_requests(DrawingRequests& requests); - DrawingRequests drawing_requests; DrawingRequests lightmap_requests; diff --git a/src/video/drawing_request.hpp b/src/video/drawing_request.hpp index 1007ab976..859d952d5 100644 --- a/src/video/drawing_request.hpp +++ b/src/video/drawing_request.hpp @@ -71,25 +71,55 @@ enum RequestType struct SurfacePartRequest { + SurfacePartRequest() : + surface(), + source(), + size() + {} + const Surface* surface; - Vector source, size; + Vector source; + Vector size; }; struct TextRequest { + TextRequest() : + font(), + text(), + alignment() + {} + const Font* font; std::string text; FontAlignment alignment; + +private: + TextRequest(const TextRequest&); + TextRequest& operator=(const TextRequest&); }; struct GradientRequest { - Color top, bottom; + GradientRequest() : + top(), + bottom(), + size() + {} + + Color top; + Color bottom; Vector size; }; struct FillRectRequest { + FillRectRequest() : + color(), + size(), + radius() + {} + Color color; Vector size; float radius; @@ -97,6 +127,11 @@ struct FillRectRequest struct InverseEllipseRequest { + InverseEllipseRequest() : + color(), + size() + {} + Color color; Vector size; }; diff --git a/src/video/sdl/sdl_renderer.cpp b/src/video/sdl/sdl_renderer.cpp index 9693bdd89..dc4b73829 100644 --- a/src/video/sdl/sdl_renderer.cpp +++ b/src/video/sdl/sdl_renderer.cpp @@ -108,9 +108,12 @@ SDL_Surface *apply_alpha(SDL_Surface *src, float alpha_factor) } // namespace -SDLRenderer::SDLRenderer() +SDLRenderer::SDLRenderer() : + screen(), + numerator(), + denominator() { - ::Renderer::instance_ = this; + Renderer::instance_ = this; const SDL_VideoInfo *info = SDL_GetVideoInfo(); log_info << "Hardware surfaces are " << (info->hw_available ? "" : "not ") << "available." << std::endl; diff --git a/src/video/sdl/sdl_renderer.hpp b/src/video/sdl/sdl_renderer.hpp index 453aa0800..7f7818006 100644 --- a/src/video/sdl/sdl_renderer.hpp +++ b/src/video/sdl/sdl_renderer.hpp @@ -40,7 +40,12 @@ public: private: SDL_Surface *screen; - int numerator, denominator; + int numerator; + int denominator; + +private: + SDLRenderer(const SDLRenderer&); + SDLRenderer& operator=(const SDLRenderer&); }; #endif diff --git a/src/video/sdl/sdl_texture.cpp b/src/video/sdl/sdl_texture.cpp index 0651c12a3..412c77644 100644 --- a/src/video/sdl/sdl_texture.cpp +++ b/src/video/sdl/sdl_texture.cpp @@ -600,7 +600,8 @@ SDL_Surface *optimize(SDL_Surface *src) } } -SDLTexture::SDLTexture(SDL_Surface* image) +SDLTexture::SDLTexture(SDL_Surface* image) : + texture() { texture = optimize(image); //width = texture->w; diff --git a/src/video/sdl/sdl_texture.hpp b/src/video/sdl/sdl_texture.hpp index 9f3a66737..97c38cb95 100644 --- a/src/video/sdl/sdl_texture.hpp +++ b/src/video/sdl/sdl_texture.hpp @@ -60,16 +60,22 @@ protected: memset(data, 0, CACHE_SIZE * sizeof(SDL_Surface *)); } + ColorCache(const ColorCache&); + ~ColorCache() { std::for_each(data, data + CACHE_SIZE, SDL_FreeSurface); } - void operator = (const ColorCache &other) + ColorCache& operator=(const ColorCache &other) { - std::for_each(other.data, other.data + CACHE_SIZE, ref); - std::for_each(data, data + CACHE_SIZE, SDL_FreeSurface); - memcpy(data, other.data, CACHE_SIZE * sizeof(SDL_Surface *)); + if (this != &other) + { + std::for_each(other.data, other.data + CACHE_SIZE, ref); + std::for_each(data, data + CACHE_SIZE, SDL_FreeSurface); + memcpy(data, other.data, CACHE_SIZE * sizeof(SDL_Surface *)); + } + return *this; } SDL_Surface *&operator [] (const Color &color) diff --git a/src/video/texture_manager.cpp b/src/video/texture_manager.cpp index 218de7dbb..c15d4cf82 100644 --- a/src/video/texture_manager.cpp +++ b/src/video/texture_manager.cpp @@ -27,7 +27,12 @@ TextureManager* texture_manager = NULL; -TextureManager::TextureManager() +TextureManager::TextureManager() : + image_textures() +#ifdef HAVE_OPENGL + ,textures(), + saved_textures() +#endif { } diff --git a/src/worldmap/spawn_point.cpp b/src/worldmap/spawn_point.cpp index a57d71263..15905010e 100644 --- a/src/worldmap/spawn_point.cpp +++ b/src/worldmap/spawn_point.cpp @@ -26,6 +26,8 @@ namespace WorldMapNS { Direction string_to_direction(const std::string& directory); SpawnPoint::SpawnPoint(const lisp::Lisp* slisp) : + name(), + pos(), auto_dir(D_NONE) { pos.x = -1; diff --git a/src/worldmap/worldmap.cpp b/src/worldmap/worldmap.cpp index 62b63d6e7..72217a4b1 100644 --- a/src/worldmap/worldmap.cpp +++ b/src/worldmap/worldmap.cpp @@ -139,9 +139,29 @@ WorldMap::WorldMap(const std::string& filename, const std::string& force_spawnpo tux(0), tileset(NULL), free_tileset(false), + worldmap_menu(), + camera_offset(), + name(), + music(), + init_script(), + game_objects(), + solid_tilemaps(), + passive_message_timer(), + passive_message(), + map_filename(), + levels_path(), + special_tiles(), + levels(), + sprite_changes(), + spawn_points(), + teleporters(), + total_stats(), + worldmap_table(), + scripts(), ambient_light( 1.0f, 1.0f, 1.0f, 1.0f ), force_spawnpoint(force_spawnpoint), in_level(false), + pan_pos(), panning(false) { tux = new Tux(this); diff --git a/src/worldmap/worldmap.hpp b/src/worldmap/worldmap.hpp index 3f0dc32c0..8ca3bb359 100644 --- a/src/worldmap/worldmap.hpp +++ b/src/worldmap/worldmap.hpp @@ -70,7 +70,15 @@ class WorldMap : public Screen static Color level_title_color; static Color message_color; static Color teleporter_message_color; + private: + typedef std::vector SpecialTiles; + typedef std::vector SpriteChanges; + typedef std::vector SpawnPoints; + typedef std::vector LevelTiles; + typedef std::vector GameObjects; + typedef std::vector ScriptList; + Tux* tux; TileSet *tileset; @@ -86,7 +94,6 @@ private: std::string music; std::string init_script; - typedef std::vector GameObjects; GameObjects game_objects; std::list solid_tilemaps; @@ -99,20 +106,15 @@ private: std::string map_filename; std::string levels_path; - typedef std::vector SpecialTiles; SpecialTiles special_tiles; - typedef std::vector LevelTiles; LevelTiles levels; - typedef std::vector SpriteChanges; SpriteChanges sprite_changes; - typedef std::vector SpawnPoints; SpawnPoints spawn_points; std::vector teleporters; Statistics total_stats; HSQOBJECT worldmap_table; - typedef std::vector ScriptList; ScriptList scripts; Color ambient_light;