-#include <cmath>
-
-#include "tilemap.h"
-#include "video/drawing_context.h"
-#include "level.h"
-#include "tile.h"
-#include "tile_manager.h"
-#include "app/globals.h"
-#include "utils/lispreader.h"
-#include "utils/lispwriter.h"
-
-TileMap::TileMap()
- : solid(false), speed(1), width(0), height(0), layer(LAYER_TILES),
- vertical_flip(false)
+#include <math.h>
+#include <limits>
+
+#include "tilemap.hpp"
+#include "video/drawing_context.hpp"
+#include "level.hpp"
+#include "tile.hpp"
+#include "resources.hpp"
+#include "lisp/lisp.hpp"
+#include "lisp/list_iterator.hpp"
+#include "lisp/writer.hpp"
+#include "object_factory.hpp"
+#include "main.hpp"
+#include "log.hpp"
+#include "tile_set.hpp"
+#include "tile_manager.hpp"
+#include "scripting/tilemap.hpp"
+#include "scripting/squirrel_util.hpp"
+
+TileMap::TileMap(const TileSet *new_tileset)
+ : tileset(new_tileset), solid(false), speed_x(1), speed_y(1), width(0),
+ height(0), z_pos(0), x_offset(0), y_offset(0), movement(Vector(0,0)), drawing_effect(NO_EFFECT),
+ alpha(1.0), current_alpha(1.0), remaining_fade_time(0),
+ draw_target(DrawingContext::NORMAL)