This commit is contained in:
Adrian Hedqvist 2018-01-10 10:10:43 +01:00
parent d5f2a52731
commit 68d85c5eae
3 changed files with 7 additions and 10 deletions

View file

@ -1,9 +1,5 @@
#include "Mapgen.h"
<<<<<<< HEAD
#include "vec2i.h"
=======
#include "vec2i.h"
>>>>>>> 9557a88ed46a9e1e9aa3994762f9ec1dd7e051f1
#include <vector>
#include <queue>
#include <random>
@ -255,7 +251,8 @@ Tilemap generate_dungeon(unsigned int seed, int width, int height, TileSet tiles
// Find the room furthest away from the entrance and make it the exit
Pathfinder::DijkstraMap dijk;
const float maxv = width+height;
Pathfinder::calc_dijkstra_map(map, std::vector<vec2i>{ startpos }, dijk, maxv);
std::vector<vec2i> goals = { startpos };
Pathfinder::calc_dijkstra_map(map, goals, dijk, maxv);
float exitroomval = 0;
Room* exitroom = &startroom;

View file

@ -16,7 +16,7 @@
#include "Shaman.h"
#include "Rng.h"
#include "TileSet.h"
#include <kaguya\kaguya.hpp>
#include <kaguya/kaguya.hpp>
InputAction player_action;
TileSet tileset;

View file

@ -1,6 +1,6 @@
#include "TileSet.h"
#include <kaguya\kaguya.hpp>
#include <SDL2\SDL_log.h>
#include <kaguya/kaguya.hpp>
#include <SDL2/SDL_log.h>
Tile null = Tile();
@ -67,7 +67,7 @@ void TileSet::load_from_table(kaguya::LuaStackRef table) {
SDL_LogWarn(SDL_LOG_CATEGORY_APPLICATION, "Tileset: Missing value wall for tile: %s", key.c_str());
}
SDL_LogDebug(SDL_LOG_CATEGORY_APPLICATION, "Tileset: Added tile: %s", key.c_str());
tiles.insert_or_assign(key, t);
tiles[key] = t;
if (tiles.count(key) == 0) {
SDL_LogDebug(SDL_LOG_CATEGORY_APPLICATION, "Tileset: Could not find the tile we just added?!: %s", key.c_str());
}
@ -75,7 +75,7 @@ void TileSet::load_from_table(kaguya::LuaStackRef table) {
}
void TileSet::add_tile(std::string name, Tile tile) {
tiles.insert_or_assign(name, tile);
tiles[name] = tile;
}
Tile const& TileSet::get_tile(std::string name) {