{
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;
// 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)
}
};
-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();
void keep_in_bounds(Vector& vector);
void shake();
+private:
/**
* The camera basically provides lookahead on the left or right side
* or is undecided.
LOOKAHEAD_NONE, LOOKAHEAD_LEFT, LOOKAHEAD_RIGHT
};
+private:
Vector translation;
Sector* sector;
screen_fading(0),
border_fade(NO_FADE),
border_fadetime(0),
+ border_fading(),
border_size(0),
black(false),
borders(false)
#include "supertux/mainloop.hpp"
#include "supertux/sector.hpp"
-EndSequenceFireworks::EndSequenceFireworks()
- : EndSequence()
+EndSequenceFireworks::EndSequenceFireworks() :
+ EndSequence(),
+ endsequence_timer()
{
}
#include <math.h>
-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 ) ){
#include "supertux/sector.hpp"
#include "video/drawing_context.hpp"
-Fireworks::Fireworks()
+Fireworks::Fireworks() :
+ timer()
{
timer.start(.2f);
sound_manager->preload("sounds/fireworks.wav");
#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)
{
#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);
#include "sprite/sprite_manager.hpp"
Flower::Flower(BonusType _type) :
- type(_type)
+ type(_type),
+ sprite()
{
bbox.set_size(32, 32);
#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<float> vColor;
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));
static const float TIME_WARNING = 20;
LevelTime::LevelTime(const Reader& reader) :
+ time_surface(),
running(true),
time_left(0)
{
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
#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);
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))
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);
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);
MovingSprite::MovingSprite(const MovingSprite& other) :
MovingObject(other),
+ sprite_name(),
+ sprite(),
layer(other.layer)
{
sprite.reset(new Sprite(*other.sprite));
#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);
}
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;
virtual void draw(DrawingContext& context);
private:
+ struct Particle {
+ Vector pos, vel;
+
+ Particle() :
+ pos(),
+ vel()
+ {}
+ // float angle;
+ };
+
+private:
Vector accel;
Timer timer;
bool live_forever;
float size;
int drawing_layer;
- struct Particle {
- Vector pos, vel;
- // float angle;
- };
std::vector <Particle*> particles;
};
}
}
-CloudParticleSystem::CloudParticleSystem()
- : ParticleSystem(128)
+CloudParticleSystem::CloudParticleSystem() :
+ ParticleSystem(128)
{
cloudimage = new Surface("images/objects/particles/cloud.png");
class Particle
{
public:
+ Particle() :
+ pos(),
+ texture()
+ {}
+
virtual ~Particle()
- { }
+ {}
Vector pos;
Surface* texture;
};
Surface* snowimages[3];
+
+private:
+ SnowParticleSystem(const SnowParticleSystem&);
+ SnowParticleSystem& operator=(const SnowParticleSystem&);
};
class GhostParticleSystem : public ParticleSystem
{
public:
float speed;
+
+ GhostParticle() :
+ speed()
+ {}
};
Surface* ghosts[2];
+
+private:
+ GhostParticleSystem(const GhostParticleSystem&);
+ GhostParticleSystem& operator=(const GhostParticleSystem&);
};
class CloudParticleSystem : public ParticleSystem
};
Surface* cloudimage;
+
+private:
+ CloudParticleSystem(const CloudParticleSystem&);
+ CloudParticleSystem& operator=(const CloudParticleSystem&);
};
#endif
class Particle
{
public:
+ Particle() :
+ pos(),
+ texture()
+ {}
+
virtual ~Particle()
- { }
+ {}
Vector pos;
Surface* texture;
};
Surface* rainimages[2];
+
+private:
+ RainParticleSystem(const RainParticleSystem&);
+ RainParticleSystem& operator=(const RainParticleSystem&);
};
class CometParticleSystem : public ParticleSystem_Interactive
};
Surface* cometimages[2];
+
+private:
+ CometParticleSystem(const CometParticleSystem&);
+ CometParticleSystem& operator=(const CometParticleSystem&);
};
#endif
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<Node> nodes;
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;
#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);
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;
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 == "")
#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)
{
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);
#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);
namespace Scripting {
-FloatingImage::FloatingImage(const std::string& spritefile)
+FloatingImage::FloatingImage(const std::string& spritefile) :
+ floating_image()
{
using namespace WorldMapNS;
#ifndef SCRIPTING_API
_Platform* platform;
+
+private:
+ Platform(const Platform&);
+ Platform& operator=(const Platform&);
#endif
};
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 << " (";
namespace Scripting
{
-ThreadQueue::ThreadQueue()
+ThreadQueue::ThreadQueue() :
+ threads()
{
}
#ifndef SCRIPTING_API
_TileMap* tilemap;
+
+private:
+ TileMap(const TileMap&);
+ TileMap& operator=(const TileMap&);
#endif
};
TimeScheduler* TimeScheduler::instance = NULL;
-TimeScheduler::TimeScheduler()
+TimeScheduler::TimeScheduler() :
+ schedule()
{
}
#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)
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()
#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;
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()) {
};
typedef std::map <std::string, Action*> 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;
};
SpriteManager* sprite_manager = NULL;
-SpriteManager::SpriteManager()
+SpriteManager::SpriteManager() :
+ sprites()
{
}
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()
Level::Level() :
name("noname"),
author("Mr. X"),
+ contact(),
+ license(),
+ filename(),
+ on_menukey_script(),
+ sectors(),
+ stats(),
tileset(NULL),
free_tileset(false)
{
pos(other.pos)
{}
-SpawnPoint::SpawnPoint(const lisp::Lisp* slisp)
+SpawnPoint::SpawnPoint(const lisp::Lisp* slisp) :
+ name(),
+ pos()
{
pos.x = -1;
pos.y = -1;
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;
static Color heading_color;
static Color reference_color;
static Color normal_color;
+
private:
float defaultspeed;
float speed;
Tile::Tile(const TileSet *new_tileset) :
tileset(new_tileset),
+ imagespecs(),
+ images(),
attributes(0),
data(0),
anim_fps(1)
Tile::Tile(const TileSet *new_tileset, std::vector<std::string> images, Rect rect,
uint32_t attributes, uint32_t data, float animfps) :
tileset(new_tileset),
+ imagespecs(),
+ images(),
attributes(attributes),
data(data),
anim_fps(animfps)
TileManager* tile_manager = NULL;
TileSet* current_tileset = NULL;
-TileManager::TileManager()
+TileManager::TileManager() :
+ tilesets()
{
}
#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);
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<Surface>(new Surface("images/engine/menu/frame.png"));
+}
+
void
TitleScreen::update_load_game_menu()
{
}
}
-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<Surface>(new Surface("images/engine/menu/frame.png"));
-}
-
void
TitleScreen::generate_main_menu()
{
void check_addons_menu();
void free_addons_menu();
+private:
std::auto_ptr<Menu> main_menu;
std::auto_ptr<Menu> contrib_menu;
std::auto_ptr<Menu> contrib_world_menu;
std::auto_ptr<Surface> frame;
std::auto_ptr<CodeController> controller;
std::auto_ptr<GameSession> titlesession;
+
+private:
+ TitleScreen(const TitleScreen&);
+ TitleScreen& operator=(const TitleScreen&);
};
#endif
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;
class World
{
-private:
- std::vector<std::string> 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();
void run();
+private:
+ std::vector<std::string> 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;
};
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);
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;
}
#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);
}
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;
#include "trigger/scripttrigger.hpp"
#include "util/reader.hpp"
-ScriptTrigger::ScriptTrigger(const Reader& reader)
+ScriptTrigger::ScriptTrigger(const Reader& reader) :
+ triggerevent(),
+ script()
{
bool must_activate = false;
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);
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);
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;
#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);
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);
}
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");
TURN_OFF
};
+private:
std::string sprite_name;
std::auto_ptr<Sprite> sprite;
std::string script;
-
SwitchState state;
-
};
#endif
TriggerBase::TriggerBase() :
sprite(),
lasthit(false),
- hit(false)
+ hit(false),
+ losetouch_listeners()
{
set_group(COLGROUP_TOUCHABLE);
}
}
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);
}
class RequestPtrCompare
- : public std::binary_function<const DrawingRequest*,
- const DrawingRequest*,
- bool>
{
public:
bool operator()(const DrawingRequest* r1, const DrawingRequest* r2) const
void take_screenshot();
private:
+ typedef std::vector<DrawingRequest*> DrawingRequests;
+
+private:
+ void handle_drawing_requests(DrawingRequests& requests);
+
+private:
class Transform
{
public:
}
};
+private:
Renderer *renderer;
Lightmap *lightmap;
std::vector<Blend> blend_stack;
Blend blend_mode;
- typedef std::vector<DrawingRequest*> DrawingRequests;
-
- void handle_drawing_requests(DrawingRequests& requests);
-
DrawingRequests drawing_requests;
DrawingRequests lightmap_requests;
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;
struct InverseEllipseRequest
{
+ InverseEllipseRequest() :
+ color(),
+ size()
+ {}
+
Color color;
Vector size;
};
} // 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;
private:
SDL_Surface *screen;
- int numerator, denominator;
+ int numerator;
+ int denominator;
+
+private:
+ SDLRenderer(const SDLRenderer&);
+ SDLRenderer& operator=(const SDLRenderer&);
};
#endif
}
}
-SDLTexture::SDLTexture(SDL_Surface* image)
+SDLTexture::SDLTexture(SDL_Surface* image) :
+ texture()
{
texture = optimize(image);
//width = texture->w;
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)
TextureManager* texture_manager = NULL;
-TextureManager::TextureManager()
+TextureManager::TextureManager() :
+ image_textures()
+#ifdef HAVE_OPENGL
+ ,textures(),
+ saved_textures()
+#endif
{
}
Direction string_to_direction(const std::string& directory);
SpawnPoint::SpawnPoint(const lisp::Lisp* slisp) :
+ name(),
+ pos(),
auto_dir(D_NONE)
{
pos.x = -1;
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);
static Color level_title_color;
static Color message_color;
static Color teleporter_message_color;
+
private:
+ typedef std::vector<SpecialTile*> SpecialTiles;
+ typedef std::vector<SpriteChange*> SpriteChanges;
+ typedef std::vector<SpawnPoint*> SpawnPoints;
+ typedef std::vector<LevelTile*> LevelTiles;
+ typedef std::vector<GameObject*> GameObjects;
+ typedef std::vector<HSQOBJECT> ScriptList;
+
Tux* tux;
TileSet *tileset;
std::string music;
std::string init_script;
- typedef std::vector<GameObject*> GameObjects;
GameObjects game_objects;
std::list<TileMap*> solid_tilemaps;
std::string map_filename;
std::string levels_path;
- typedef std::vector<SpecialTile*> SpecialTiles;
SpecialTiles special_tiles;
- typedef std::vector<LevelTile*> LevelTiles;
LevelTiles levels;
- typedef std::vector<SpriteChange*> SpriteChanges;
SpriteChanges sprite_changes;
- typedef std::vector<SpawnPoint*> SpawnPoints;
SpawnPoints spawn_points;
std::vector<Teleporter*> teleporters;
Statistics total_stats;
HSQOBJECT worldmap_table;
- typedef std::vector<HSQOBJECT> ScriptList;
ScriptList scripts;
Color ambient_light;