projects
/
supertux.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
forgot more stuff
[supertux.git]
/
src
/
trigger
/
door.cpp
diff --git
a/src/trigger/door.cpp
b/src/trigger/door.cpp
index
4c338a5
..
efe8004
100644
(file)
--- a/
src/trigger/door.cpp
+++ b/
src/trigger/door.cpp
@@
-19,25
+19,26
@@
#include <config.h>
#include "door.h"
#include <config.h>
#include "door.h"
-#include "utils/lispreader.h"
-#include "utils/lispwriter.h"
-#include "gameloop.h"
+#include "game_session.h"
#include "resources.h"
#include "resources.h"
-#include "special/sprite.h"
-#include "special/sprite_manager.h"
+#include "object_factory.h"
+#include "sprite/sprite.h"
+#include "sprite/sprite_manager.h"
#include "video/drawing_context.h"
#include "app/globals.h"
#include "video/drawing_context.h"
#include "app/globals.h"
+#include "lisp/lisp.h"
+#include "lisp/writer.h"
using namespace SuperTux;
using namespace SuperTux;
-Door::Door(
LispReader
& reader)
+Door::Door(
const lisp::Lisp
& reader)
{
{
- reader.
read_floa
t("x", bbox.p1.x);
- reader.
read_floa
t("y", bbox.p1.y);
+ reader.
ge
t("x", bbox.p1.x);
+ reader.
ge
t("y", bbox.p1.y);
bbox.set_size(32, 64);
bbox.set_size(32, 64);
- reader.
read_string
("sector", target_sector);
- reader.
read_string
("spawnpoint", target_spawnpoint);
+ reader.
get
("sector", target_sector);
+ reader.
get
("spawnpoint", target_spawnpoint);
sprite = sprite_manager->create("door");
}
sprite = sprite_manager->create("door");
}
@@
-58,7
+59,7
@@
Door::~Door()
}
void
}
void
-Door::write(
Lisp
Writer& writer)
+Door::write(
lisp::
Writer& writer)
{
writer.start_list("door");
{
writer.start_list("door");
@@
-78,6
+79,7
@@
Door::action(float )
{
//Check if door animation is complete
if(sprite->check_animation()) {
{
//Check if door animation is complete
if(sprite->check_animation()) {
+ sprite->set_action("normal");
GameSession::current()->respawn(target_sector, target_spawnpoint);
}
}
GameSession::current()->respawn(target_sector, target_spawnpoint);
}
}
@@
-96,3
+98,4
@@
Door::event(Player& , EventType type)
}
}
}
}
+IMPLEMENT_FACTORY(Door, "door");