void update_menu_item(Control id);
virtual void menu_action(MenuItem* item);
JoystickKeyboardController* controller;
+
private:
void recreateMenu();
+
+private:
+ JoystickMenu(const JoystickMenu&);
+ JoystickMenu& operator=(const JoystickMenu&);
};
class JoystickKeyboardController::KeyboardMenu : public Menu
std::string get_key_name(SDLKey key);
virtual void menu_action(MenuItem* item);
JoystickKeyboardController* controller;
+
+private:
+ KeyboardMenu(const KeyboardMenu&);
+ KeyboardMenu& operator=(const KeyboardMenu&);
};
JoystickKeyboardController::JoystickKeyboardController() :
+ keymap(),
+ joy_button_map(),
+ joy_axis_map(),
+ joy_hat_map(),
+ joysticks(),
+ name(),
+ dead_zone(),
+ min_joybuttons(),
+ max_joybuttons(),
+ max_joyaxis(),
+ max_joyhats(),
hat_state(0),
+ jump_with_up_joy(),
+ jump_with_up_kbd(),
wait_for_key(-1),
wait_for_joystick(-1),
key_options_menu(0),
void print_joystick_mappings();
+ SDLKey reversemap_key(Control c);
+ int reversemap_joybutton(Control c);
+ int reversemap_joyaxis(Control c);
+ int reversemap_joyhat(Control c);
+
+ void unbind_joystick_control(Control c);
+
+ void bind_joybutton(int button, Control c);
+ void bind_joyaxis(int axis, Control c);
+ void bind_joyhat(int dir, Control c);
+ void bind_key(SDLKey key, Control c);
+
+ void set_joy_controls(Control id, bool value);
+
+private:
+ class KeyboardMenu;
+ class JoystickMenu;
+
+ friend class KeyboardMenu;
+ friend class JoystickMenu;
+
typedef std::map<SDLKey, Control> KeyMap;
+ typedef std::map<int, Control> ButtonMap;
+ typedef std::map<int, Control> AxisMap;
+ typedef std::map<int, Control> HatMap;
+
+private:
KeyMap keymap;
- typedef std::map<int, Control> ButtonMap;
ButtonMap joy_button_map;
- typedef std::map<int, Control> AxisMap;
AxisMap joy_axis_map;
- typedef std::map<int, Control> HatMap;
HatMap joy_hat_map;
std::vector<SDL_Joystick*> joysticks;
bool jump_with_up_joy; // Joystick up jumps
bool jump_with_up_kbd; // Keyboard up jumps
- SDLKey reversemap_key(Control c);
- int reversemap_joybutton(Control c);
- int reversemap_joyaxis(Control c);
- int reversemap_joyhat(Control c);
-
- void unbind_joystick_control(Control c);
-
- void bind_joybutton(int button, Control c);
- void bind_joyaxis(int axis, Control c);
- void bind_joyhat(int dir, Control c);
- void bind_key(SDLKey key, Control c);
-
- void set_joy_controls(Control id, bool value);
-
int wait_for_key;
int wait_for_joystick;
- class KeyboardMenu;
- class JoystickMenu;
-
KeyboardMenu* key_options_menu;
JoystickMenu* joystick_options_menu;
- friend class KeyboardMenu;
- friend class JoystickMenu;
private:
JoystickKeyboardController(const JoystickKeyboardController&);
info = info_;
}
+Button::Button(const Button& rhs) :
+ pos(rhs.pos),
+ size(rhs.size),
+ image(rhs.image),
+ binding(rhs.binding),
+ id(rhs.id),
+ state(rhs.state),
+ info(rhs.info)
+{
+}
+
Button::~Button()
{
}
+Button&
+Button::operator=(const Button& rhs)
+{
+ if (this != &rhs)
+ {
+ pos = rhs.pos;
+ size = rhs.size;
+ image = rhs.image;
+ binding = rhs.binding;
+ id = rhs.id;
+ state = rhs.state;
+ info = rhs.info;
+ }
+ return *this;
+}
+
void Button::draw(DrawingContext &context, bool selected)
{
if(selected)
{
public:
Button(Surface* image_, std::string info_, SDLKey binding_);
+ Button(const Button& rhs);
~Button();
+ Button& operator=(const Button& rhs);
+
void draw(DrawingContext& context, bool selected);
int event(SDL_Event& event, int x_offset = 0, int y_offset = 0);
private:
friend class ButtonGroup;
+private:
Vector pos;
Vector size;
help(),
list(),
selected(),
- target_menu()
+ target_menu(),
+ input_flickering()
{
toggled = false;
selected = false;
RandomGenerator systemRandom; // global random number generator
-RandomGenerator::RandomGenerator() {
+RandomGenerator::RandomGenerator() :
+ initialized(),
+ fptr(),
+ rptr(),
+ state(),
+ rand_type(),
+ rand_deg(),
+ rand_sep(),
+ end_ptr(),
+ debug()
+{
assert(sizeof(int) >= 4);
initialized = 0;
debug = 0; // change this by hand for debug
float currentvolume; /// how loud we are
float * volume_ptr; /// this will be used by the volume adjustment effect.
+
+private:
+ AmbientSound(const AmbientSound&);
+ AmbientSound& operator=(const AmbientSound&);
};
#endif
MovingSprite(reader, LAYER_OBJECTS, COLGROUP_STATIC),
master(0),
slave(0),
+ center(),
radius(128),
angle(0),
angular_speed(0),
+ contacts(),
momentum(0)
{
center = get_pos();
radius(master->radius),
angle(master->angle + M_PI),
angular_speed(0),
+ contacts(),
momentum(0)
{
set_pos(get_pos() + Vector(master->get_bbox().get_width(), 0));
std::set<GameObject*> contacts; /**< objects that are currently pushing on the platform */
float momentum; /** angular momentum in rad per second per second*/
+private:
+ BicyclePlatform(const BicyclePlatform&);
+ BicyclePlatform& operator=(const BicyclePlatform&);
};
#endif
BonusBlock::BonusBlock(const Vector& pos, int data) :
Block(sprite_manager->create("images/objects/bonus_block/bonusblock.sprite")),
+ contents(),
object(0)
{
bbox.set_pos(pos);
}
BonusBlock::BonusBlock(const Reader& lisp) :
- Block(sprite_manager->create("images/objects/bonus_block/bonusblock.sprite"))
+ Block(sprite_manager->create("images/objects/bonus_block/bonusblock.sprite")),
+ contents(),
+ object(0)
{
Vector pos;
CONTENT_CUSTOM
};
- Contents contents;
protected:
virtual void hit(Player& player);
-private:
+public:
+ Contents contents;
MovingObject* object;
+
+private:
+ BonusBlock(const BonusBlock&);
+ BonusBlock& operator=(const BonusBlock&);
};
class Brick : public Block
static const float LIFE_TIME = .5f;
BouncyCoin::BouncyCoin(const Vector& pos, bool emerge) :
+ sprite(),
position(pos),
+ timer(),
emerge_distance(0)
{
timer.start(LIFE_TIME);
BrokenBrick::BrokenBrick(std::auto_ptr<Sprite> sprite,
const Vector& pos, const Vector& nmovement) :
+ timer(),
sprite(sprite),
position(pos),
movement(nmovement)
const float BULLET_STARTING_YM = 0;
}
-Bullet::Bullet(const Vector& pos, float xm, int dir, BonusType type)
- : life_count(3), type(type)
+Bullet::Bullet(const Vector& pos, float xm, int dir, BonusType type) :
+ physic(),
+ life_count(3),
+ sprite(),
+ type(type)
{
float speed = dir == RIGHT ? BULLET_XM : -BULLET_XM;
physic.set_velocity_x(speed + xm);
#include "object/player.hpp"
#include "supertux/sector.hpp"
-EndSequence::EndSequence()
- : isrunning(false), isdone(false), tux_may_walk(true)
-{
- end_sequence_controller = 0;
+EndSequence::EndSequence() :
+ isrunning(false),
+ isdone(false),
+ tux_may_walk(true),
+ end_sequence_controller(0)
+{
}
EndSequence::~EndSequence()
virtual void running(float elapsed_time); /**< called while the EndSequence is running */
virtual void stopping(); /**< called when EndSequence stops */
+protected:
bool isrunning; /**< true while EndSequence plays */
bool isdone; /**< true if EndSequence has finished playing */
bool tux_may_walk; /**< true while tux is allowed to walk */
#include "supertux/mainloop.hpp"
#include "supertux/sector.hpp"
-EndSequenceWalkLeft::EndSequenceWalkLeft()
- : EndSequence()
+EndSequenceWalkLeft::EndSequenceWalkLeft() :
+ EndSequence(),
+ last_x_pos(),
+ endsequence_timer()
{
}
virtual void running(float elapsed_time); /**< called while the EndSequence is running */
virtual void stopping(); /**< called when EndSequence stops */
+private:
float last_x_pos;
Timer endsequence_timer;
};
#include "supertux/mainloop.hpp"
#include "supertux/sector.hpp"
-EndSequenceWalkRight::EndSequenceWalkRight()
- : EndSequence()
+EndSequenceWalkRight::EndSequenceWalkRight() :
+ EndSequence(),
+ last_x_pos(),
+ endsequence_timer()
{
}
virtual void running(float elapsed_time); /**< called while the EndSequence is running */
virtual void stopping(); /**< called when EndSequence stops */
+private:
float last_x_pos;
Timer endsequence_timer;
};
#include "sprite/sprite_manager.hpp"
#include "supertux/main.hpp"
-FallingCoin::FallingCoin(const Vector& start_position, const int vel_x)
+FallingCoin::FallingCoin(const Vector& start_position, const int vel_x) :
+ physic(),
+ pos(),
+ sprite()
{
pos = start_position;
sprite = sprite_manager->create("images/objects/coin/coin.sprite");
#include "util/reader.hpp"
Gradient::Gradient() :
- layer(LAYER_BACKGROUND0)
+ layer(LAYER_BACKGROUND0),
+ gradient_top(),
+ gradient_bottom()
{
}
Gradient::Gradient(const Reader& reader) :
- layer(LAYER_BACKGROUND0)
+ layer(LAYER_BACKGROUND0),
+ gradient_top(),
+ gradient_bottom()
{
reader.get("layer", layer);
std::vector<float> bkgd_top_color, bkgd_bottom_color;
private:
int layer;
- Color gradient_top, gradient_bottom;
+ Color gradient_top;
+ Color gradient_bottom;
};
#endif /*SUPERTUX_BACKGROUND_H*/
#include "object/player.hpp"
GrowUp::GrowUp(Direction direction) :
- MovingSprite(Vector(0,0), "images/powerups/egg/egg.sprite", LAYER_OBJECTS, COLGROUP_MOVING)
+ MovingSprite(Vector(0,0), "images/powerups/egg/egg.sprite", LAYER_OBJECTS, COLGROUP_MOVING),
+ physic()
{
physic.enable_gravity(true);
physic.set_velocity_x((direction == LEFT)?-100:100);
const float RECOVER_SPEED = 200;
}
-IceCrusher::IceCrusher(const Reader& reader)
- : MovingSprite(reader, "images/creatures/icecrusher/icecrusher.sprite", LAYER_OBJECTS, COLGROUP_STATIC),
- state(IDLE), speed(Vector(0,0))
+IceCrusher::IceCrusher(const Reader& reader) :
+ MovingSprite(reader, "images/creatures/icecrusher/icecrusher.sprite", LAYER_OBJECTS, COLGROUP_STATIC),
+ state(IDLE),
+ start_position(),
+ speed(Vector(0,0))
{
start_position = get_bbox().p1;
set_state(state, true);
InfoBlock::InfoBlock(const Reader& lisp) :
Block(sprite_manager->create("images/objects/bonus_block/infoblock.sprite")),
+ message(),
shown_pct(0),
- dest_pct(0)
+ dest_pct(0),
+ lines(),
+ lines_height()
{
Vector pos;
lisp.get("x", pos.x);
protected:
virtual void hit(Player& player);
+ Player* get_nearest_player();
+
+protected:
std::string message;
//AmbientSound* ringing;
//bool stopped;
float shown_pct; /**< Value in the range of 0..1, depending on how much of the infobox is currently shown */
float dest_pct; /**< With each call to update(), shown_pct will slowly transition to this value */
-
- Player* get_nearest_player();
-
std::vector<InfoBoxLine*> lines; /**< lines of text (or images) to display */
float lines_height;
};
#include "supertux/object_factory.hpp"
#include "util/reader.hpp"
-InvisibleWall::InvisibleWall(const Reader& lisp)
- : MovingSprite(lisp, "images/objects/invisible/invisible.sprite", LAYER_TILES, COLGROUP_STATIC), width(32), height(32)
+InvisibleWall::InvisibleWall(const Reader& lisp) :
+ MovingSprite(lisp, "images/objects/invisible/invisible.sprite", LAYER_TILES, COLGROUP_STATIC),
+ physic(),
+ width(32),
+ height(32)
{
lisp.get("width", width);
lisp.get("height", height);
#include "supertux/sector.hpp"
#include "supertux/tile.hpp"
-Ispy::Ispy(const Reader& reader)
- : MovingSprite(reader, "images/objects/ispy/ispy.sprite", LAYER_TILES+5, COLGROUP_DISABLED), state(ISPYSTATE_IDLE), dir(AUTO)
+Ispy::Ispy(const Reader& reader) :
+ MovingSprite(reader, "images/objects/ispy/ispy.sprite", LAYER_TILES+5, COLGROUP_DISABLED),
+ state(ISPYSTATE_IDLE),
+ script(),
+ dir(AUTO)
{
// read script to execute
reader.get("script", script);
#include "sprite/sprite.hpp"
#include "sprite/sprite_manager.hpp"
-Light::Light(const Vector& center, const Color& color) : position(center), color(color)
+Light::Light(const Vector& center, const Color& color) :
+ position(center),
+ color(color),
+ sprite()
{
sprite = sprite_manager->create("images/objects/lightmap_light/lightmap_light.sprite");
}
const float SWITCH_DELAY = 0.1f; /**< seconds to wait for stable conditions until switching solidity */
}
-MagicBlock::MagicBlock(const Reader& lisp)
- : MovingSprite(lisp, "images/objects/magicblock/magicblock.sprite"),
- is_solid(false), solid_time(0), switch_delay(0), light(1.0f,1.0f,1.0f)
+MagicBlock::MagicBlock(const Reader& lisp) :
+ MovingSprite(lisp, "images/objects/magicblock/magicblock.sprite"),
+ is_solid(false),
+ solid_time(0),
+ switch_delay(0),
+ light(1.0f,1.0f,1.0f)
{
set_group(COLGROUP_STATIC);
//get color from lisp
float speed_y; /**< vertical speed */
std::set<GameObject*> contacts; /**< objects that are currently pushing on the platform */
+private:
+ PneumaticPlatform(const PneumaticPlatform&);
+ PneumaticPlatform& operator=(const PneumaticPlatform&);
};
#endif
#include "util/reader.hpp"
PowerUp::PowerUp(const Reader& lisp) :
- MovingSprite(lisp, LAYER_OBJECTS, COLGROUP_MOVING)
+ MovingSprite(lisp, LAYER_OBJECTS, COLGROUP_MOVING),
+ physic(),
+ script(),
+ no_physics()
{
lisp.get("script", script);
no_physics = false;
//14 -> 8
}
-PushButton::PushButton(const Reader& lisp)
- : MovingSprite(lisp, "images/objects/pushbutton/pushbutton.sprite", LAYER_BACKGROUNDTILES+1, COLGROUP_MOVING), state(OFF)
+PushButton::PushButton(const Reader& lisp) :
+ MovingSprite(lisp, "images/objects/pushbutton/pushbutton.sprite", LAYER_BACKGROUNDTILES+1, COLGROUP_MOVING),
+ script(),
+ state(OFF)
{
sound_manager->preload(BUTTON_SOUND);
set_action("off", -1);
#include "object/rainsplash.hpp"
-RainSplash::RainSplash(Vector pos, bool vertical)
+RainSplash::RainSplash(Vector pos, bool vertical) :
+ sprite(),
+ position(),
+ frame()
{
frame = 0;
position = pos;
virtual void hit(Player& );
virtual void update(float time);
virtual void draw(DrawingContext& context);
+
private:
std::auto_ptr<Sprite> sprite;
Vector position;
Rock::Rock(const Reader& reader) :
MovingSprite(reader, "images/objects/rock/rock.sprite"),
+ physic(),
on_ground(),
grabbed(),
last_movement()
#include "sprite/sprite.hpp"
#include "supertux/object_factory.hpp"
-ScriptedObject::ScriptedObject(const Reader& lisp)
- : MovingSprite(lisp, LAYER_OBJECTS, COLGROUP_MOVING_STATIC),
- solid(true), physic_enabled(true), visible(true), new_vel_set(false)
+ScriptedObject::ScriptedObject(const Reader& lisp) :
+ MovingSprite(lisp, LAYER_OBJECTS, COLGROUP_MOVING_STATIC),
+ solid(true),
+ physic_enabled(true),
+ visible(true),
+ new_vel_set(false)
{
lisp.get("name", name);
if(name == "")
#include "object/specialriser.hpp"
#include "supertux/sector.hpp"
-SpecialRiser::SpecialRiser(Vector pos, MovingObject* _child)
- : child(_child)
+SpecialRiser::SpecialRiser(Vector pos, MovingObject* _child) :
+ offset(),
+ child(_child)
{
_child->set_pos(pos - Vector(0, 32));
offset = 0;
private:
float offset;
MovingObject* child;
+
+private:
+ SpecialRiser(const SpecialRiser&);
+ SpecialRiser& operator=(const SpecialRiser&);
};
#endif
SpriteParticle::SpriteParticle(std::string sprite_name, std::string action,
Vector position, AnchorPoint anchor, Vector velocity, Vector acceleration,
int drawing_layer) :
+ sprite(),
position(position),
velocity(velocity),
acceleration(acceleration),
static const float SPEED = 150;
static const float JUMPSPEED = -300;
-Star::Star(const Vector& pos, Direction direction)
- : MovingSprite(pos, "images/powerups/star/star.sprite", LAYER_OBJECTS, COLGROUP_MOVING)
+Star::Star(const Vector& pos, Direction direction) :
+ MovingSprite(pos, "images/powerups/star/star.sprite", LAYER_OBJECTS, COLGROUP_MOVING),
+ physic()
{
physic.set_velocity((direction == LEFT) ? -SPEED : SPEED, INITIALJUMP);
}
bool centered;
AnchorPoint anchor;
Vector pos;
+
+private:
+ TextObject(const TextObject&);
+ TextObject& operator=(const TextObject&);
};
#endif
const float VY_INITIAL = -500;
}
-Trampoline::Trampoline(const Reader& lisp)
- : Rock(lisp, "images/objects/trampoline/trampoline.sprite")
+Trampoline::Trampoline(const Reader& lisp) :
+ Rock(lisp, "images/objects/trampoline/trampoline.sprite"),
+ portable(true)
{
sound_manager->preload(TRAMPOLINE_SOUND);
- portable = true;
//Check if this trampoline is not portable
if(lisp.get("portable", portable)) {
if(!portable) {
#include "supertux/constants.hpp"
#include "supertux/object_factory.hpp"
-UnstableTile::UnstableTile(const Reader& lisp)
- : MovingSprite(lisp, LAYER_TILES, COLGROUP_STATIC), state(STATE_NORMAL)
+UnstableTile::UnstableTile(const Reader& lisp) :
+ MovingSprite(lisp, LAYER_TILES, COLGROUP_STATIC),
+ physic(),
+ state(STATE_NORMAL)
{
sprite->set_action("normal");
}
#include <sstream>
#include <stdexcept>
-IFileStreambuf::IFileStreambuf(const std::string& filename)
+IFileStreambuf::IFileStreambuf(const std::string& filename) :
+ file()
{
// check this as PHYSFS seems to be buggy and still returns a
// valid pointer in this case
//---------------------------------------------------------------------------
-OFileStreambuf::OFileStreambuf(const std::string& filename)
+OFileStreambuf::OFileStreambuf(const std::string& filename) :
+ file()
{
file = PHYSFS_openWrite(filename.c_str());
if(file == 0) {
#ifndef SCRIPTING_API
_Camera* camera;
+
+private:
+ Camera(const Camera&);
+ Camera& operator=(const Camera&);
#endif
};
#ifndef SCRIPTING_API
_LevelTime* level_time;
+
+private:
+ LevelTime(const LevelTime&);
+ LevelTime& operator=(const LevelTime&);
#endif
};
#ifndef SCRIPTING_API
_Thunderstorm* thunderstorm;
+
+private:
+ Thunderstorm(const Thunderstorm&);
+ Thunderstorm& operator=(const Thunderstorm&);
#endif
};