// 02111-1307, USA.
#include <config.h>
-#include "flip_level_transformer.h"
-#include "object/tilemap.h"
-#include "object/camera.h"
-#include "badguy/badguy.h"
-#include "sector.h"
-#include "tile_manager.h"
-#include "spawn_point.h"
+#include "flip_level_transformer.hpp"
+#include "object/tilemap.hpp"
+#include "object/camera.hpp"
+#include "badguy/badguy.hpp"
+#include "sector.hpp"
+#include "tile_manager.hpp"
+#include "spawn_point.hpp"
void
FlipLevelTransformer::transform_sector(Sector* sector)
Player* player = dynamic_cast<Player*> (object);
if(player) {
Vector pos = player->get_pos();
- pos.y = height - pos.y;
+ pos.y = height - pos.y - player->get_bbox().get_height();
player->move(pos);
continue;
}
BadGuy* badguy = dynamic_cast<BadGuy*> (object);
if(badguy) {
transform_badguy(height, badguy);
- continue;
}
-
MovingObject* mobject = dynamic_cast<MovingObject*> (object);
if(mobject) {
transform_moving_object(height, mobject);
}
}
if(tilemap->get_drawing_effect() != 0) {
- tilemap->set_drawing_effect(0);
+ tilemap->set_drawing_effect(NO_EFFECT);
} else {
tilemap->set_drawing_effect(VERTICAL_FLIP);
}
FlipLevelTransformer::transform_moving_object(float height, MovingObject*object)
{
Vector pos = object->get_pos();
- pos.y = height - pos.y;
+ pos.y = height - pos.y - object->get_bbox().get_height();
object->set_pos(pos);
}