commit e7e425a0
Now applies prefab with prefab exposed to the world
Changed files
| M | src/saland/GameRegion.cpp before |
| M | src/saland/Prefabs.cpp before |
| M | src/saland/Prefabs.hpp before |
diff --git a/src/saland/GameRegion.cpp b/src/saland/GameRegion.cpp
index 5eaa3b4..decbcf4 100644
--- a/src/saland/GameRegion.cpp
+++ b/src/saland/GameRegion.cpp
@@ -132,6 +132,8 @@ std::string GameRegion::GetRegionType(int region_x, int region_y) const {
return "default";
}
+
+
void GameRegion::Init(int x, int y, const std::string& worldName, bool forceResetWorld) {
region_x = x;
region_y = y;
@@ -211,7 +213,7 @@ void GameRegion::Init(int x, int y, const std::string& worldName, bool forceRese
}
}
- TestApplyPrefab(world.tm, 32, 32);
+ ApplyPrefab(world.tm, 32, 32, getPrefab("basic_house"));
MonsterDef batDef;
batDef.radius = 16.0f;
diff --git a/src/saland/Prefabs.cpp b/src/saland/Prefabs.cpp
index 12f160e..e978bb0 100644
--- a/src/saland/Prefabs.cpp
+++ b/src/saland/Prefabs.cpp
@@ -118,9 +118,7 @@ Prefab getPrefab(const char* name) {
return p;
}
-void TestApplyPrefab(sago::tiled::TileMap& dest, int destX, int destY) {
- ApplyPrefab(dest, destX, destY, getPrefab("basic_house"));
-}
+
void ScanPrefabs(const std::string& filename) {
std::string mapFileName = "maps/"+filename+".tmx";
diff --git a/src/saland/Prefabs.hpp b/src/saland/Prefabs.hpp
index 2400a07..591acf1 100644
--- a/src/saland/Prefabs.hpp
+++ b/src/saland/Prefabs.hpp
@@ -45,4 +45,3 @@ void ApplyPrefab(sago::tiled::TileMap& dest, int destX, int destY, const Prefab&
Prefab getPrefab(const char* name);
-void TestApplyPrefab(sago::tiled::TileMap& dest, int destX, int destY);