From: Ricardo Cruz Date: Fri, 2 Jul 2004 15:14:48 +0000 (+0000) Subject: Allow creation of Tilemap and Door objects by feeding them with info. X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=b19aa4f5b8e4bb2382efb0144d70551c1adc4b60;p=supertux.git Allow creation of Tilemap and Door objects by feeding them with info. SVN-Revision: 1528 --- diff --git a/src/door.cpp b/src/door.cpp index 9a14c826d..95d9807bf 100644 --- a/src/door.cpp +++ b/src/door.cpp @@ -47,6 +47,19 @@ Door::Door(LispReader& reader) animation_timer.init(true); } +Door::Door(int x, int y) +{ +area.x = x; +area.y = y; +area.width = 32; +area.height = 64; + +animation_timer.init(true); +door_activated = false; + +animation_timer.init(true); +} + void Door::write(LispWriter& writer) { diff --git a/src/door.h b/src/door.h index bd4456deb..402799998 100644 --- a/src/door.h +++ b/src/door.h @@ -40,6 +40,7 @@ class Door : public InteractiveObject, public Serializable { public: Door(LispReader& reader); + Door(int x, int y); virtual ~Door(); virtual void write(LispWriter& writer); diff --git a/src/menu.cpp b/src/menu.cpp index 720793614..a4e7ceb8b 100644 --- a/src/menu.cpp +++ b/src/menu.cpp @@ -91,7 +91,7 @@ bool confirm_dialog(Surface *background, std::string text) } if(background == NULL) - context.draw_gradient(Color(200, 100, 200), Color(100, 200, 100), LAYER_BACKGROUND0); + context.draw_gradient(Color(200,240,220), Color(200,200,220), LAYER_BACKGROUND0); else context.draw_surface(background, Vector(0,0), LAYER_BACKGROUND0); @@ -238,9 +238,9 @@ std::string MenuItem::get_input_with_symbol(bool active_item) char str[1024]; if(input_flickering) - sprintf(str,"%s_",input); - else sprintf(str,"%s ",input); + else + sprintf(str,"%s_",input); std::string string = str; diff --git a/src/tilemap.cpp b/src/tilemap.cpp index a877dc911..b5f90b411 100644 --- a/src/tilemap.cpp +++ b/src/tilemap.cpp @@ -83,6 +83,11 @@ TileMap::TileMap(LispReader& reader) throw std::runtime_error("wrong number of tiles in tilemap."); } +TileMap::TileMap(int layer_, bool solid_, size_t width_, size_t height_) + : solid(solid_), speed(1), width(width_), height(height_), layer(layer_) +{ +} + TileMap::~TileMap() { } diff --git a/src/tilemap.h b/src/tilemap.h index fa39f2a47..c46435542 100644 --- a/src/tilemap.h +++ b/src/tilemap.h @@ -48,6 +48,7 @@ class TileMap : public GameObject, public Serializable public: TileMap(); TileMap(LispReader& reader); + TileMap(int layer_, bool solid_, size_t width_, size_t height_); virtual ~TileMap(); virtual void write(LispWriter& writer);