refactor(maps): pyramid.yaml per piràmide amb merge a sala
This commit is contained in:
1 parent
5f206e03c8
commit
125cdd0c74
45 files changed
+331
-1085
No files matched your search
@@ -9,8 +9,8 @@
|
||||
#include "core/rendering/screen.hpp"
|
||||
#include "core/rendering/surface.hpp"
|
||||
#include "core/resources/resource_cache.hpp"
|
||||
#include "core/resources/resource_helper.hpp"
|
||||
#include "external/fkyaml_node.hpp"
|
||||
#include "game/map/room_yaml.hpp"
|
||||
#include "utils/log.hpp"
|
||||
|
||||
#ifdef _DEBUG
|
||||
@@ -41,13 +41,7 @@ namespace {
|
||||
} // namespace
|
||||
|
||||
Tilemap::Tilemap(const std::string& yaml_path) {
|
||||
auto bytes = Resource::Helper::loadFile(yaml_path);
|
||||
if (bytes.empty()) {
|
||||
throw std::runtime_error("Tilemap: no s'ha pogut obrir " + yaml_path);
|
||||
}
|
||||
const auto* begin = reinterpret_cast<const char*>(bytes.data());
|
||||
const auto* end = begin + bytes.size();
|
||||
auto yaml = fkyaml::node::deserialize(begin, end);
|
||||
auto yaml = RoomYaml::loadMerged(yaml_path);
|
||||
|
||||
tileset_path_ = yaml["tileset"].get_value<std::string>();
|
||||
tile_size_ = yaml["tile_size"].get_value<int>();
|
||||
|
||||
Reference in new issue
Block a user