* An axis-aligned triangle (ie. a triangle where 2 sides are parallel to the x-
* and y-axis.
*/
-class AATriangle : public Rect
+class AATriangle : public Rect // FIXME: yuck
{
public:
/** Directions:
#include "video/drawing_context.hpp"
ParticleSystem::ParticleSystem(float max_particle_size) :
- max_particle_size(max_particle_size)
+ max_particle_size(max_particle_size),
+ z_pos(),
+ particles(),
+ virtual_width(),
+ virtual_height()
{
virtual_width = SCREEN_WIDTH + max_particle_size * 2;
virtual_height = SCREEN_HEIGHT + max_particle_size *2;
}
CloudParticleSystem::CloudParticleSystem() :
- ParticleSystem(128)
+ ParticleSystem(128),
+ cloudimage()
{
cloudimage = new Surface("images/objects/particles/cloud.png");
virtual void draw(DrawingContext& context);
protected:
- float max_particle_size;
- int z_pos;
-
class Particle
{
public:
Surface* texture;
};
+ float max_particle_size;
+ int z_pos;
std::vector<Particle*> particles;
- float virtual_width, virtual_height;
+ float virtual_width;
+ float virtual_height;
};
class SnowParticleSystem : public ParticleSystem
float wobble;
float anchorx;
float drift_speed;
+
+ SnowParticle() :
+ speed(),
+ wobble(),
+ anchorx(),
+ drift_speed()
+ {}
};
Surface* snowimages[3];
{
public:
float speed;
+
+ CloudParticle() :
+ speed()
+ {}
};
Surface* cloudimage;
//TODO: Find a way to make rain collide with objects like bonus blocks
// Add an option to set rain strength
// Fix rain being "respawned" over solid tiles
-ParticleSystem_Interactive::ParticleSystem_Interactive()
+ParticleSystem_Interactive::ParticleSystem_Interactive() :
+ z_pos(),
+ particles(),
+ virtual_width(),
+ virtual_height()
{
virtual_width = SCREEN_WIDTH;
virtual_height = SCREEN_HEIGHT;
virtual void draw(DrawingContext& context);
protected:
- int z_pos;
-
class Particle
{
public:
Surface* texture;
};
- std::vector<Particle*> particles;
- float virtual_width, virtual_height;
int collision(Particle* particle, Vector movement);
+
+ int z_pos;
+ std::vector<Particle*> particles;
+ float virtual_width;
+ float virtual_height;
};
class RainParticleSystem : public ParticleSystem_Interactive
{
public:
float speed;
+
+ RainParticle() :
+ speed()
+ {}
};
Surface* rainimages[2];
{
public:
float speed;
+
+ CometParticle() :
+ speed()
+ {}
};
Surface* cometimages[2];
}
Player::Player(PlayerStatus* _player_status, const std::string& name) :
+ deactivated(),
+ controller(),
scripting_controller(0),
player_status(_player_status),
+ duck(),
+ dead(),
+ dying(),
+ backflipping(),
+ backflip_direction(),
+ peekingX(),
+ peekingY(),
+ swimming(),
+ speedlimit(),
scripting_controller_old(0),
+ jump_early_apex(),
+ on_ice(),
+ ice_this_frame(),
+ dir(),
+ old_dir(),
+ last_ground_y(),
+ fall_mode(),
+ on_ground_flag(),
+ jumping(),
+ can_jump(),
+ jump_button_timer(),
+ wants_buttjump(),
+ does_buttjump(),
+ invincible_timer(),
+ skidding_timer(),
+ safe_timer(),
+ kick_timer(),
+ shooting_timer(),
+ dying_timer(),
+ growing(),
+ backflip_timer(),
+ physic(),
+ visible(),
grabbed_object(NULL),
+ sprite(),
+ airarrow(),
+ floor_normal(),
ghost_mode(false),
edit_mode(false),
+ unduck_hurt_timer(),
+ idle_timer(),
idle_stage(0),
climbing(0)
{
{
public:
enum FallMode { ON_GROUND, JUMPING, TRAMPOLINE_JUMP, FALLING };
-
- Controller* controller;
- std::auto_ptr<CodeController> scripting_controller; /**< This controller is used when the Player is controlled via scripting */
- PlayerStatus* player_status;
- bool duck;
- bool dead;
//Tux can only go this fast. If set to 0 no special limit is used, only the default limits.
void set_speedlimit(float newlimit);
float get_speedlimit();
-private:
- bool dying;
- bool backflipping;
- int backflip_direction;
- Direction peekingX, peekingY;
- bool swimming;
- float speedlimit;
- Controller* scripting_controller_old; /**< Saves the old controller while the scripting_controller is used */
- bool jump_early_apex;
- bool on_ice;
- bool ice_this_frame;
-
-public:
- Direction dir;
- Direction old_dir;
-
- float last_ground_y;
- FallMode fall_mode;
-
- bool on_ground_flag;
- bool jumping;
- bool can_jump;
- Timer jump_button_timer; /**< started when player presses the jump button; runs until Tux jumps or JUMP_GRACE_TIME runs out */
- bool wants_buttjump;
- bool does_buttjump;
-
- Timer invincible_timer;
- Timer skidding_timer;
- Timer safe_timer;
- Timer kick_timer;
- Timer shooting_timer; // used to show the arm when Tux is shooting
- Timer dying_timer;
- bool growing;
- Timer backflip_timer;
-
public:
Player(PlayerStatus* player_status, const std::string& name);
virtual ~Player();
void handle_input();
void handle_input_ghost(); /**< input handling while in ghost mode */
void handle_input_climbing(); /**< input handling while climbing */
- bool deactivated;
void init();
void apply_friction();
private:
+ bool deactivated;
+
+ Controller* controller;
+ std::auto_ptr<CodeController> scripting_controller; /**< This controller is used when the Player is controlled via scripting */
+ PlayerStatus* player_status;
+ bool duck;
+ bool dead;
+
+private:
+ bool dying;
+ bool backflipping;
+ int backflip_direction;
+ Direction peekingX;
+ Direction peekingY;
+ bool swimming;
+ float speedlimit;
+ Controller* scripting_controller_old; /**< Saves the old controller while the scripting_controller is used */
+ bool jump_early_apex;
+ bool on_ice;
+ bool ice_this_frame;
+
+public:
+ Direction dir;
+ Direction old_dir;
+
+ float last_ground_y;
+ FallMode fall_mode;
+
+ bool on_ground_flag;
+ bool jumping;
+ bool can_jump;
+ Timer jump_button_timer; /**< started when player presses the jump button; runs until Tux jumps or JUMP_GRACE_TIME runs out */
+ bool wants_buttjump;
+ bool does_buttjump;
+
+ Timer invincible_timer;
+ Timer skidding_timer;
+ Timer safe_timer;
+ Timer kick_timer;
+ Timer shooting_timer; // used to show the arm when Tux is shooting
+ Timer dying_timer;
+ bool growing;
+ Timer backflip_timer;
+
Physic physic;
bool visible;
slave(0),
start_y(0),
offset_y(0),
- speed_y(0)
+ speed_y(0),
+ contacts()
{
start_y = get_pos().y;
}
slave(this),
start_y(master->start_y),
offset_y(-master->offset_y),
- speed_y(0)
+ speed_y(0),
+ contacts()
{
set_pos(get_pos() + Vector(master->get_bbox().get_width(), 0));
master->master = master;
TileMap::TileMap(const TileSet *new_tileset) :
tileset(new_tileset),
+ tiles(),
solid(false),
speed_x(1),
speed_y(1),
z_pos(0),
x_offset(0),
y_offset(0),
- movement(Vector(0,0)),
+ movement(0,0),
drawing_effect(NO_EFFECT),
alpha(1.0),
current_alpha(1.0),
remaining_fade_time(0),
+ path(),
+ walker(),
draw_target(DrawingContext::NORMAL)
{
}
TileMap::TileMap(const Reader& reader) :
+ tileset(),
+ tiles(),
solid(false),
speed_x(1),
speed_y(1),
alpha(1.0),
current_alpha(1.0),
remaining_fade_time(0),
+ path(),
+ walker(),
draw_target(DrawingContext::NORMAL)
{
tileset = current_tileset;
TileMap::TileMap(const TileSet *new_tileset, std::string name, int z_pos,
bool solid, size_t width, size_t height) :
tileset(new_tileset),
+ tiles(),
solid(solid),
speed_x(1),
speed_y(1),
alpha(1.0),
current_alpha(1.0),
remaining_fade_time(0),
+ path(),
+ walker(),
draw_target(DrawingContext::NORMAL)
{
this->name = name;
static const float FADE_SPEED = 1;
Console::Console() :
+ history(),
history_position(history.end()),
+ lines(),
+ background(),
+ background2(),
vm(NULL),
+ vm_object(),
backgroundOffset(0),
height(0),
alpha(1.0),
offset(0),
focused(false),
+ font(),
+ fontheight(),
stayOpen(0)
{
fontheight = 8;
GameObject::GameObject() :
wants_to_die(false),
- remove_listeners(NULL)
+ remove_listeners(NULL),
+ name()
{
}
GameObject::GameObject(const GameObject& rhs) :
wants_to_die(rhs.wants_to_die),
- remove_listeners(NULL)
+ remove_listeners(NULL),
+ name(rhs.name)
{
}
GameSession::GameSession(const std::string& levelfile_, Statistics* statistics) :
level(0),
+ statistics_backdrop(),
+ scripts(),
currentsector(0),
+ levelnb(),
+ pause_menu_frame(),
end_sequence(0),
+ game_pause(),
+ speed_before_pause(),
levelfile(levelfile_),
+ reset_sector(),
+ reset_pos(),
+ newsector(),
+ newspawnpoint(),
best_level_statistics(statistics),
capture_demo_stream(0),
+ capture_file(),
playback_demo_stream(0),
demo_controller(0),
+ game_menu(),
play_time(0),
edit_mode(false),
levelintro_shown(false)
LevelIntro::LevelIntro(const Level* level, const Statistics* best_level_statistics) :
level(level),
best_level_statistics(best_level_statistics),
+ player_sprite(),
player_sprite_py(0),
- player_sprite_vy(0)
+ player_sprite_vy(0),
+ player_sprite_jump_timer()
{
player_sprite = sprite_manager->create("images/creatures/tux/tux.sprite");
player_sprite->set_action("small-walk-right");
MainLoop* g_main_loop = NULL;
MainLoop::MainLoop() :
+ waiting_threads(),
+ running(),
speed(1.0),
nextpop(false),
nextpush(false),
fps(0),
+ next_screen(),
+ current_screen(),
+ console(),
+ screen_fade(),
+ screen_stack(),
screenshot_requested(false)
{
using namespace Scripting;
void process_events();
void handle_screen_switch();
+private:
bool running;
float speed;
bool nextpop;
#include "supertux/moving_object.hpp"
-MovingObject::MovingObject()
+MovingObject::MovingObject() :
+ bbox(),
+ movement(),
+ group(COLGROUP_MOVING),
+ dest()
{
- group = COLGROUP_MOVING;
}
MovingObject::~MovingObject()
};
-OptionsMenu::OptionsMenu()
+OptionsMenu::OptionsMenu() :
+ language_menu()
{
language_menu.reset(new LanguageMenu());
PlayerStatus* player_status = 0;
-PlayerStatus::PlayerStatus()
- : coins(START_COINS),
- bonus(NO_BONUS),
- max_fire_bullets(0),
- max_ice_bullets(0)
+PlayerStatus::PlayerStatus() :
+ coins(START_COINS),
+ bonus(NO_BONUS),
+ max_fire_bullets(0),
+ max_ice_bullets(0),
+ coin_surface()
{
reset();
context.pop_transform();
}
-void
-PlayerStatus::operator= (const PlayerStatus& other)
-{
- coins = other.coins;
- bonus = other.bonus;
-}
-
/* EOF */
void draw(DrawingContext& context);
+public:
int coins;
BonusType bonus;
int max_fire_bullets; /**< maximum number of fire bullets in play */
int max_ice_bullets; /**< maximum number of ice bullets in play */
- void operator= (const PlayerStatus& other);
-
private:
- // don't use this
- PlayerStatus(const PlayerStatus& other);
-
std::auto_ptr<Surface> coin_surface;
+
+private:
+ PlayerStatus(const PlayerStatus&);
+ PlayerStatus& operator=(const PlayerStatus&);
};
// global player state
Sector::Sector(Level* parent) :
level(parent),
+ name(),
+ bullets(),
+ init_script(),
+ gameobjects_new(),
currentmusic(LEVEL_MUSIC),
+ sector_table(),
+ scripts(),
ambient_light( 1.0f, 1.0f, 1.0f, 1.0f ),
+ gameobjects(),
+ moving_objects(),
+ spawnpoints(),
+ portables(),
+ music(),
gravity(10.0),
player(0),
+ solid_tilemaps(),
camera(0),
effect(0)
{
float get_gravity() const;
private:
- Level* level; /**< Parent level containing this sector */
uint32_t collision_tile_attributes(const Rect& dest) const;
void before_object_remove(GameObject* object);
void fix_old_tiles();
+private:
static Sector* _current;
+ Level* level; /**< Parent level containing this sector */
+
std::string name;
std::vector<Bullet*> bullets;
}
}
-InfoBox::InfoBox(const std::string& text)
- : firstline(0)
+InfoBox::InfoBox(const std::string& text) :
+ firstline(0),
+ lines(),
+ images(),
+ arrow_scrollup(),
+ arrow_scrolldown()
{
// Split text string lines into a vector
lines = InfoBoxLine::split(text, 400);
InfoBoxLine::InfoBoxLine(char format_char, const std::string& text) :
lineType(NORMAL),
font(normal_font),
+ color(),
text(text),
image(0)
{
TileSet::TileSet() :
tiles(),
- tiles_path(""),
+ tiles_path(),
tiles_loaded(false)
{
tiles.resize(1, 0);
tiles[0] = new Tile(this);
}
-TileSet::TileSet(const std::string& filename)
- : tiles_path(""), tiles_loaded(true)
+TileSet::TileSet(const std::string& filename) :
+ tiles(),
+ tiles_path(),
+ tiles_loaded(true)
{
tiles_path = FileSystem::dirname(filename);