BadGuy::BadGuy(const Vector& pos, const std::string& sprite_name, int layer) :
MovingSprite(pos, sprite_name, layer, COLGROUP_DISABLED),
+ physic(),
countMe(true),
is_initialized(false),
start_position(),
BadGuy::BadGuy(const Vector& pos, Direction direction, const std::string& sprite_name, int layer) :
MovingSprite(pos, sprite_name, layer, COLGROUP_DISABLED),
+ physic(),
countMe(true),
is_initialized(false),
start_position(),
BadGuy::BadGuy(const Reader& reader, const std::string& sprite_name, int layer) :
MovingSprite(reader, sprite_name, layer, COLGROUP_DISABLED),
+ physic(),
countMe(true),
is_initialized(false),
start_position(),
{
return start_position;
}
+
void set_start_position(const Vector& vec)
{
start_position = vec;
}
- /** Count this badguy to the statistics? This value should not be
- changed during runtime. */
- bool countMe;
-
/** Called when hit by a fire bullet, and is_flammable() returns true */
virtual void ignite();
/** called each frame when the badguy is not activated. */
virtual void inactive_update(float elapsed_time);
- /** true if initialize() has already been called */
- bool is_initialized;
-
/** called immediately before the first call to initialize */
virtual void initialize();
pixels. Minimum value for height is 1 pixel */
bool might_fall(int height = 1);
- Vector start_position;
-
- /** The direction we currently face in */
- Direction dir;
-
- /** The direction we initially faced in */
- Direction start_dir;
-
/** Get Direction from String. */
Direction str2dir( std::string dir_str );
from above. */
Vector get_floor_normal();
- bool frozen;
- bool ignited; /**< true if this badguy is currently on fire */
-
- std::string dead_script; /**< script to execute when badguy is killed */
-
/** Returns true if we were in STATE_ACTIVE at the beginning of the
last call to update() */
bool is_active();
protected:
Physic physic;
+public:
+ /** Count this badguy to the statistics? This value should not be
+ changed during runtime. */
+ bool countMe;
+
+protected:
+ /** true if initialize() has already been called */
+ bool is_initialized;
+
+ Vector start_position;
+
+ /** The direction we currently face in */
+ Direction dir;
+
+ /** The direction we initially faced in */
+ Direction start_dir;
+
+ bool frozen;
+ bool ignited; /**< true if this badguy is currently on fire */
+
+ std::string dead_script; /**< script to execute when badguy is killed */
+
private:
State state;
JoystickKeyboardController* controller;
};
-JoystickKeyboardController::JoystickKeyboardController()
- : hat_state(0),
- wait_for_key(-1), wait_for_joystick(-1),
- key_options_menu(0), joystick_options_menu(0)
+JoystickKeyboardController::JoystickKeyboardController() :
+ hat_state(0),
+ wait_for_key(-1),
+ wait_for_joystick(-1),
+ key_options_menu(0),
+ joystick_options_menu(0)
{
// initialize default keyboard map
keymap[SDLK_LEFT] = LEFT;
ButtonGroup::ButtonGroup(Vector pos_, Vector buttons_size_, Vector buttons_box_) :
pos(pos_),
buttons_size(buttons_size_),
- buttons_box(buttons_box_)
+ buttons_box(buttons_box_),
+ buttons(),
+ button_selected(),
+ row(),
+ mouse_hover(),
+ mouse_left_button(),
+ buttons_pair_nb()
{
buttons.clear();
row = 0;
bool is_hover();
private:
- Vector pos, buttons_size, buttons_box;
typedef std::vector <Button> Buttons;
+
+ Vector pos;
+ Vector buttons_size;
+ Vector buttons_box;
Buttons buttons;
- int button_selected, row;
- bool mouse_hover, mouse_left_button;
+ int button_selected;
+ int row;
+ bool mouse_hover;
+ bool mouse_left_button;
int buttons_pair_nb;
}
}
-MenuItem::MenuItem(MenuItemKind _kind, int _id)
- : kind(_kind) , id(_id)
+MenuItem::MenuItem(MenuItemKind _kind, int _id) :
+ kind(_kind),
+ id(_id),
+ toggled(),
+ text(),
+ input(),
+ help(),
+ list(),
+ selected(),
+ target_menu()
{
toggled = false;
selected = false;
previous = NULL;
}
-Menu::Menu()
- : close(false)
+Menu::Menu() :
+ hit_item(),
+ pos_x(),
+ pos_y(),
+ menuaction(),
+ delete_character(),
+ mn_input_char(),
+ menu_repeat_time(),
+ close(false),
+ items(),
+ effect_progress(),
+ effect_start_time(),
+ arrange_left(),
+ active_item(),
+ checkbox(),
+ checkbox_checked(),
+ back(),
+ arrow_left(),
+ arrow_right()
{
all_menus.push_back(this);
{
public:
MenuItem(MenuItemKind kind, int id = -1);
+
+ void set_help(const std::string& help_text);
+
+ void change_text (const std::string& text);
+ void change_input(const std::string& text);
+
+ static MenuItem* create(MenuItemKind kind, const std::string& text,
+ int init_toggle, Menu* target_menu, int id, int key);
+
+ std::string get_input_with_symbol(bool active_item); // returns the text with an input symbol
+
+public:
MenuItemKind kind;
int id; // item id
bool toggled;
Menu* target_menu;
- void set_help(const std::string& help_text);
-
- void change_text (const std::string& text);
- void change_input(const std::string& text);
-
- static MenuItem* create(MenuItemKind kind, const std::string& text,
- int init_toggle, Menu* target_menu, int id, int key);
-
- std::string get_input_with_symbol(bool active_item); // returns the text with an input symbol
-
private:
/// keyboard key or joystick button
bool input_flickering;
MENU_ACTION_BACK
};
- /** Number of the item that got 'hit' (ie. pressed) in the last
- event()/update() call, -1 if none */
- int hit_item;
-
- // position of the menu (ie. center of the menu, not top/left)
- float pos_x;
- float pos_y;
-
- /** input event for the menu (up, down, left, right, etc.) */
- MenuAction menuaction;
-
- /* input implementation variables */
- int delete_character;
- char mn_input_char;
- float menu_repeat_time;
-
- bool close;
-
public:
- std::vector<MenuItem*> items;
-
Menu();
virtual ~Menu();
{
return *(items[index]);
}
+
MenuItem& get_item_by_id(int id);
const MenuItem& get_item_by_id(int id) const;
private:
void check_controlfield_change_event(const SDL_Event& event);
void draw_item(DrawingContext& context, int index);
+
+private:
+ /** Number of the item that got 'hit' (ie. pressed) in the last
+ event()/update() call, -1 if none */
+ int hit_item;
+
+ // position of the menu (ie. center of the menu, not top/left)
+ float pos_x;
+ float pos_y;
+
+ /** input event for the menu (up, down, left, right, etc.) */
+ MenuAction menuaction;
+
+ /* input implementation variables */
+ int delete_character;
+ char mn_input_char;
+ float menu_repeat_time;
+
+ bool close;
+
+public:
+ std::vector<MenuItem*> items;
+
+private:
float effect_progress;
float effect_start_time;
int arrange_left;
MouseCursor* MouseCursor::current_ = 0;
extern SDL_Surface* g_screen;
-MouseCursor::MouseCursor(std::string cursor_file) : mid_x(0), mid_y(0)
+MouseCursor::MouseCursor(std::string cursor_file) :
+ mid_x(0),
+ mid_y(0),
+ state_before_click(),
+ cur_state(),
+ cursor()
{
cursor = new Surface(cursor_file);
{ current_ = pcursor; };
private:
- int mid_x, mid_y;
- static MouseCursor* current_;
+ int mid_x;
+ int mid_y;
int state_before_click;
int cur_state;
Surface* cursor;
private:
+ static MouseCursor* current_;
+
+private:
MouseCursor(const MouseCursor&);
MouseCursor& operator=(const MouseCursor&);
};
namespace lisp {
-Lexer::Lexer(std::istream& newstream)
- : stream(newstream), eof(false), linenumber(0)
+Lexer::Lexer(std::istream& newstream) :
+ stream(newstream),
+ eof(false),
+ linenumber(0),
+ bufend(),
+ bufpos(),
+ c(),
+ token_length()
{
// trigger a refill of the buffer
bufpos = NULL;
inline void nextChar();
inline void addChar();
+private:
std::istream& stream;
bool eof;
int linenumber;
namespace lisp {
-Lisp::Lisp(LispType newtype)
- : type(newtype)
+Lisp::Lisp(LispType newtype) :
+ type(newtype),
+ v()
{
}
namespace lisp {
-ListIterator::ListIterator(const lisp::Lisp* newlisp)
- : current_lisp(0), cur(newlisp)
+ListIterator::ListIterator(const lisp::Lisp* newlisp) :
+ current_item(),
+ current_lisp(0),
+ cur(newlisp)
{
}
namespace lisp {
-Parser::Parser(bool translate)
- : lexer(0), dictionary_manager(0), dictionary(0)
+Parser::Parser(bool translate) :
+ lexer(0),
+ filename(),
+ dictionary_manager(0),
+ dictionary(0),
+ token(),
+ obst()
{
if(translate) {
dictionary_manager = new TinyGetText::DictionaryManager();
void parse_error(const char* msg) const __attribute__((__noreturn__));
const Lisp* read();
+
+private:
Lexer* lexer;
std::string filename;
TinyGetText::DictionaryManager* dictionary_manager;
namespace lisp {
-Writer::Writer(const std::string& filename)
+Writer::Writer(const std::string& filename) :
+ out(),
+ out_owned(),
+ indent_depth(),
+ lists()
{
out = new OFileStream(filename);
out_owned = true;
out->precision(10);
}
-Writer::Writer(std::ostream* newout)
+Writer::Writer(std::ostream* newout) :
+ out(),
+ out_owned(),
+ indent_depth(),
+ lists()
{
out = newout;
out_owned = false;
void write_escaped_string(const std::string& str);
void indent();
+private:
std::ostream* out;
bool out_owned;
int indent_depth;
#include "supertux/sector.hpp"
#include "util/reader.hpp"
-AmbientSound::AmbientSound(const Reader& lisp)
+AmbientSound::AmbientSound(const Reader& lisp) :
+ name(),
+ position(),
+ dimension(),
+ sample(),
+ sound_source(),
+ latency(),
+ distance_factor(),
+ distance_bias(),
+ silence_distance(),
+ maximumvolume(),
+ targetvolume(),
+ currentvolume(),
+ volume_ptr()
{
name="";
position.x = 0;
latency=0;
}
-AmbientSound::AmbientSound(Vector pos, float factor, float bias, float vol, std::string file)
+AmbientSound::AmbientSound(Vector pos, float factor, float bias, float vol, std::string file) :
+ name(),
+ position(),
+ dimension(),
+ sample(),
+ sound_source(),
+ latency(),
+ distance_factor(),
+ distance_bias(),
+ silence_distance(),
+ maximumvolume(),
+ targetvolume(),
+ currentvolume(),
+ volume_ptr()
{
position.x=pos.x;
position.y=pos.y;
latency=0;
}
-AmbientSound::~AmbientSound() {
+AmbientSound::~AmbientSound()
+{
stop_playing();
}
}
void
-AmbientSound::stop_playing() {
+AmbientSound::stop_playing()
+{
delete sound_source;
sound_source = 0;
}
virtual void stop_playing();
virtual void expose(HSQUIRRELVM vm, SQInteger table_idx);
virtual void unexpose(HSQUIRRELVM vm, SQInteger table_idx);
+
private:
std::string name; /**< user-defined name for use in scripts or empty string if not scriptable */
Vector position;
#include "supertux/object_factory.hpp"
#include "util/reader.hpp"
-Background::Background()
- : layer(LAYER_BACKGROUND0)
+Background::Background() :
+ layer(LAYER_BACKGROUND0),
+ imagefile_top(),
+ imagefile(),
+ imagefile_bottom(),
+ pos(),
+ speed(),
+ speed_y(),
+ image_top(),
+ image(),
+ image_bottom()
{
}
-Background::Background(const Reader& reader)
- : layer(LAYER_BACKGROUND0)
+Background::Background(const Reader& reader) :
+ layer(LAYER_BACKGROUND0),
+ imagefile_top(),
+ imagefile(),
+ imagefile_bottom(),
+ pos(),
+ speed(),
+ speed_y(),
+ image_top(),
+ image(),
+ image_bottom()
{
// read position, defaults to (0,0)
float px = 0;
#include "object/electrifier.hpp"
#include "supertux/sector.hpp"
-Electrifier::Electrifier(uint32_t oldtile, uint32_t newtile, float seconds)
+Electrifier::Electrifier(uint32_t oldtile, uint32_t newtile, float seconds) :
+ change_from(),
+ change_to(),
+ duration()
{
duration.start(seconds);
change_from = oldtile;
public:
Electrifier(uint32_t oldtile, uint32_t newtile, float seconds);
~Electrifier();
+
protected:
virtual void update(float time);
virtual void draw(DrawingContext& context);
+
private:
uint32_t change_from;
uint32_t change_to;
Rock::Rock(const Vector& pos, std::string spritename) :
MovingSprite(pos, spritename),
+ physic(),
on_ground(),
grabbed(),
last_movement()
static const float CRACKTIME = 0.3f;
static const float FALLTIME = 0.8f;
-SkullTile::SkullTile(const Reader& lisp)
- : MovingSprite(lisp, "images/objects/skull_tile/skull_tile.sprite", LAYER_TILES, COLGROUP_STATIC), hit(false), falling(false)
+SkullTile::SkullTile(const Reader& lisp) :
+ MovingSprite(lisp, "images/objects/skull_tile/skull_tile.sprite", LAYER_TILES, COLGROUP_STATIC),
+ physic(),
+ timer(),
+ hit(false),
+ falling(false)
{
}
#include "sprite/sprite_manager.hpp"
SmokeCloud::SmokeCloud(const Vector& pos) :
+ sprite(),
+ timer(),
position(pos)
{
timer.start(.3f);
private:
PHYSFS_file* file;
char buf[1024];
+
+private:
+ IFileStreambuf(const IFileStreambuf&);
+ IFileStreambuf& operator=(const IFileStreambuf&);
};
class OFileStreambuf : public std::streambuf
private:
PHYSFS_file* file;
char buf[1024];
+
+private:
+ OFileStreambuf(const OFileStreambuf&);
+ OFileStreambuf& operator=(const OFileStreambuf&);
};
class IFileStream : public std::istream
#ifndef SCRIPTING_API
_Wind* wind;
+
+private:
+ Wind(const Wind&);
+ Wind& operator=(const Wind&);
#endif
};
-}
+} // namespace Scripting
#endif
int get_frame() const
{ return (int)frame; }
/** Set current frame */
- void set_frame(int frame)
+ void set_frame(int frame_)
{
- this->frame = (float) (frame % get_frames());
+ this->frame = (float) (frame_ % get_frames());
}
- Surface* get_frame(unsigned int frame)
+ Surface* get_frame(unsigned int frame_)
{
- assert(frame < action->surfaces.size());
- return action->surfaces[frame];
+ assert(frame_ < action->surfaces.size());
+ return action->surfaces[frame_];
}
private:
class Constraints
{
public:
- Constraints() {
+ Constraints() :
+ left(),
+ right(),
+ top(),
+ bottom(),
+ ground_movement(),
+ hit()
+ {
float infinity = (std::numeric_limits<float>::has_infinity ?
std::numeric_limits<float>::infinity() :
std::numeric_limits<float>::max());
bottom = infinity;
}
- bool has_constraints() const {
+ bool has_constraints() const
+ {
float infinity = (std::numeric_limits<float>::has_infinity ?
std::numeric_limits<float>::infinity() :
std::numeric_limits<float>::max());
- return left > -infinity || right < infinity
- || top > -infinity || bottom < infinity;
+ return
+ left > -infinity ||
+ right < infinity ||
+ top > -infinity ||
+ bottom < infinity;
}
+public:
float left;
float right;
float top;
float player_sprite_py; /**< Position (y axis) for the player sprite */
float player_sprite_vy; /**< Velocity (y axis) for the player sprite */
Timer player_sprite_jump_timer; /**< When timer fires, the player sprite will "jump" */
+
+private:
+ LevelIntro(const LevelIntro&);
+ LevelIntro& operator=(const LevelIntro&);
};
#endif
#include "supertux/shrinkfade.hpp"
#include "video/drawing_context.hpp"
-ShrinkFade::ShrinkFade(const Vector& dest, float fade_time)
- : dest(dest), fade_time(fade_time), accum_time(0)
+ShrinkFade::ShrinkFade(const Vector& dest, float fade_time) :
+ dest(dest),
+ fade_time(fade_time),
+ accum_time(0),
+ speedleft(),
+ speedright(),
+ speedtop(),
+ speedbottom()
{
speedleft = dest.x / fade_time;
speedright = (SCREEN_WIDTH - dest.x) / fade_time;
Vector dest;
float fade_time;
float accum_time;
- float speedleft, speedright, speedtop, speedbottom;
+ float speedleft;
+ float speedright;
+ float speedtop;
+ float speedbottom;
};
#endif
#include "supertux/spawn_point.hpp"
#include "util/log.hpp"
-SpawnPoint::SpawnPoint()
+SpawnPoint::SpawnPoint() :
+ name(),
+ pos()
{}
-SpawnPoint::SpawnPoint(const SpawnPoint& other)
- : name(other.name), pos(other.pos)
+SpawnPoint::SpawnPoint(const SpawnPoint& other) :
+ name(other.name),
+ pos(other.pos)
{}
SpawnPoint::SpawnPoint(const lisp::Lisp* slisp)
Color color;
std::string text;
Surface* image;
+
+private:
+ InfoBoxLine(const InfoBoxLine&);
+ InfoBoxLine& operator=(const InfoBoxLine&);
};
/** This class is displaying a box with information text inside the game
std::map<std::string, Surface*> images;
Surface* arrow_scrollup;
Surface* arrow_scrolldown;
+
+private:
+ InfoBox(const InfoBox&);
+ InfoBox& operator=(const InfoBox&);
};
/**
alpha(1.0f)
{}
- Color(float red, float green, float blue, float alpha = 1.0) :
- red(red),
- green(green),
- blue(blue),
- alpha(alpha)
+ Color(float red_, float green_, float blue_, float alpha_ = 1.0) :
+ red(red_),
+ green(green_),
+ blue(blue_),
+ alpha(alpha_)
{
#ifdef DEBUG
check_color_ranges();
Font::Font(GlyphWidth glyph_width_,
const std::string& filename,
- int shadowsize_)
- : glyph_width(glyph_width_),
- shadowsize(shadowsize_),
- glyphs(65536)
+ int shadowsize_) :
+ glyph_width(glyph_width_),
+ glyph_surfaces(),
+ shadow_surfaces(),
+ char_height(),
+ shadowsize(shadowsize_),
+ glyphs(65536)
{
for(unsigned int i=0; i<65536;i++) glyphs[i].surface_idx = -1;
VARIABLE
};
+public:
/** Construct a fixed-width font
*
* @param glyph_width VARIABLE for proportional fonts, VARIABLE for monospace ones
const Vector& position, DrawingEffect drawing_effect, Color color,
float alpha) const;
- GlyphWidth glyph_width;
-
- std::vector<Surface> glyph_surfaces;
- std::vector<Surface> shadow_surfaces;
- int char_height;
- int shadowsize;
-
+ void loadFontFile(const std::string &filename);
+ void loadFontSurface(const std::string &glyphimage,
+ const std::string &shadowimage,
+ const std::vector<std::string> &chars,
+ GlyphWidth glyph_width,
+ int char_width);
+private:
struct Glyph {
/** How many pixels should the cursor advance after printing the
glyph */
/** Position of the glyph inside the surface */
Rect rect;
+
+ Glyph() :
+ advance(),
+ offset(),
+ surface_idx(),
+ rect()
+ {}
};
+private:
+ GlyphWidth glyph_width;
+
+ std::vector<Surface> glyph_surfaces;
+ std::vector<Surface> shadow_surfaces;
+ int char_height;
+ int shadowsize;
+
/** 65536 of glyphs */
std::vector<Glyph> glyphs;
-
- void loadFontFile(const std::string &filename);
- void loadFontSurface(const std::string &glyphimage,
- const std::string &shadowimage,
- const std::vector<std::string> &chars,
- GlyphWidth glyph_width,
- int char_width);
};
#endif
} // namespace
-GLTexture::GLTexture(unsigned int width, unsigned int height)
+GLTexture::GLTexture(unsigned int width, unsigned int height) :
+ handle(),
+ texture_width(),
+ texture_height(),
+ image_width(),
+ image_height()
{
assert(is_power_of_2(width));
assert(is_power_of_2(height));
- texture_width = width;
+ texture_width = width;
texture_height = height;
- image_width = width;
+ image_width = width;
image_height = height;
assert_gl("before creating texture");
}
}
-GLTexture::GLTexture(SDL_Surface* image)
+GLTexture::GLTexture(SDL_Surface* image) :
+ handle(),
+ texture_width(),
+ texture_height(),
+ image_width(),
+ image_height()
{
texture_width = next_power_of_two(image->w);
texture_height = next_power_of_two(image->h);
#include "video/sdl/sdl_surface_data.hpp"
#include "video/sdl/sdl_texture.hpp"
-SDLLightmap::SDLLightmap()
+SDLLightmap::SDLLightmap() :
+ screen(),
+ red_channel(),
+ blue_channel(),
+ green_channel(),
+ width(),
+ height(),
+ numerator(),
+ denominator(),
+ LIGHTMAP_DIV()
{
screen = SDL_GetVideoSurface();
Uint8 *red_channel;
Uint8 *blue_channel;
Uint8 *green_channel;
- int width, height;
- int numerator, denominator;
+ int width;
+ int height;
+ int numerator;
+ int denominator;
int LIGHTMAP_DIV;
void light_blit(SDL_Surface *src, SDL_Rect *src_rect, int dstx, int dsty);
+
+private:
+ SDLLightmap(const SDLLightmap&);
+ SDLLightmap& operator=(const SDLLightmap&);
};
#endif
{
return height;
}*/
+
+private:
+ SDLTexture(const SDLTexture&);
+ SDLTexture& operator=(const SDLTexture&);
};
#endif
namespace WorldMapNS {
LevelTile::LevelTile(const std::string& basedir, const lisp::Lisp* lisp) :
+ pos(),
+ title(),
solved(false),
auto_play(false),
+ sprite(),
+ statistics(),
+ extro_script(),
basedir(basedir),
picture_cached(false),
picture(0)
virtual void draw(DrawingContext& context);
virtual void update(float elapsed_time);
+ /** return Surface of level picture or 0 if no picture is available */
+ const Surface* get_picture();
+
+public:
Vector pos;
std::string title;
bool solved;
/** Script that is run when the level is successfully finished */
std::string extro_script;
- /** return Surface of level picture or 0 if no picture is available */
- const Surface* get_picture();
-
private:
std::string basedir;
bool picture_cached;
namespace WorldMapNS {
-SpecialTile::SpecialTile(const lisp::Lisp* lisp)
- : passive_message(false), invisible(false),
- apply_action_north(true), apply_action_east(true),
- apply_action_south(true), apply_action_west(true)
+SpecialTile::SpecialTile(const lisp::Lisp* lisp) :
+ pos(),
+ sprite(),
+ map_message(),
+ passive_message(false),
+ script(),
+ invisible(false),
+ apply_action_north(true),
+ apply_action_east(true),
+ apply_action_south(true),
+ apply_action_west(true)
{
lisp->get("x", pos.x);
lisp->get("y", pos.y);
virtual void draw(DrawingContext& context);
virtual void update(float elapsed_time);
+public:
Vector pos;
/** Sprite to render instead of guessing what image to draw */
bool apply_action_west;
};
-}
+} // namespace WorldMapNS
#endif
namespace WorldMapNS {
-SpriteChange::SpriteChange(const lisp::Lisp* lisp)
- : change_on_touch(false), in_stay_action(false)
+SpriteChange::SpriteChange(const lisp::Lisp* lisp) :
+ pos(),
+ change_on_touch(false),
+ sprite(),
+ stay_action(),
+ stay_group(),
+ in_stay_action(false)
{
lisp->get("x", pos.x);
lisp->get("y", pos.y);
SpriteChange(const lisp::Lisp* lisp);
virtual ~SpriteChange();
- Vector pos;
- /**
- * should tuxs sprite change when the tile has been completely entered,
- * or already when the tile was just touched
- */
- bool change_on_touch;
- /// sprite to change tux image to
- std::auto_ptr<Sprite> sprite;
- /**
- * stay action can be used for objects like boats or cars, if it is
- * != "" then this sprite will be displayed when tux left the tile towards
- * another SpriteChange object.
- */
- std::string stay_action;
-
- /**
- * name of a group in which only one SpriteChange will ever have its stay_action displayed.
- * Leave empty if you don't care.
- */
- std::string stay_group;
-
virtual void draw(DrawingContext& context);
virtual void update(float elapsed_time);
*/
void clear_stay_action();
+public:
+ Vector pos;
+
+ /** should tuxs sprite change when the tile has been completely entered,
+ or already when the tile was just touched */
+ bool change_on_touch;
+
+ /** sprite to change tux image to */
+ std::auto_ptr<Sprite> sprite;
+
+ /** stay action can be used for objects like boats or cars, if it is
+ != "" then this sprite will be displayed when tux left the tile
+ towards another SpriteChange object. */
+ std::string stay_action;
+
+ /** name of a group in which only one SpriteChange will ever have
+ its stay_action displayed. Leave empty if you don't care. */
+ std::string stay_group;
+
private:
- /**
- * should the stayaction be displayed
- */
+ /** should the stayaction be displayed */
bool in_stay_action;
+private:
static std::list<SpriteChange*> all_sprite_changes;
-
};
-}
+} // namespace WorldMapNS
#endif
namespace WorldMapNS {
-Teleporter::Teleporter(const lisp::Lisp* lisp)
- : automatic(false)
+Teleporter::Teleporter(const lisp::Lisp* lisp) :
+ pos(),
+ sprite(),
+ worldmap(),
+ spawnpoint(),
+ automatic(false),
+ message()
{
lisp->get("x", pos.x);
lisp->get("y", pos.y);
{
}
-}
+} // namespace WorldMapNS
/* EOF */
virtual void draw(DrawingContext& context);
virtual void update(float elapsed_time);
+public:
/** Position (in tiles, not pixels) */
Vector pos;
/** optional map message to display */
std::string message;
-
};
-}
+} // namespace WorldMapNS
#endif