#include <algorithm>
#include <iostream>
#include <stdexcept>
-#include <cmath>
+#include <math.h>
#include "tilemap.hpp"
#include "video/drawing_context.hpp"
set_x_offset(v.x);
set_y_offset(v.y);
}
-
+
std::string draw_target_s = "normal";
reader.get("draw-target", draw_target_s);
if (draw_target_s == "normal") draw_target = DrawingContext::NORMAL;
}
void
-TileMap::resize(int new_width, int new_height)
+TileMap::resize(int new_width, int new_height, int fill_id)
{
if(new_width < width) {
// remap tiles for new width
}
}
- tiles.resize(new_width * new_height);
+ tiles.resize(new_width * new_height, fill_id);
if(new_width > width) {
// remap tiles
for(int y = std::min(height, new_height)-1; y >= 0; --y) {
for(int x = new_width-1; x >= 0; --x) {
if(x >= width) {
- tiles[y * new_width + x] = 0;
+ tiles[y * new_width + x] = fill_id;
continue;
}
width = new_width;
}
-void
-TileMap::set_solid(bool solid)
+void
+TileMap::set_solid(bool solid)
{
this->solid = solid;
}
}
}
-void
+void
TileMap::fade(float alpha, float seconds)
{
this->alpha = alpha;