summaryrefslogtreecommitdiffstats
path: root/src/Generating
diff options
context:
space:
mode:
authorMattes D <github@xoft.cz>2015-06-18 23:30:41 +0200
committerMattes D <github@xoft.cz>2015-06-19 16:15:59 +0200
commit8df31067d4703beb3225b7d9787385d58f893c5d (patch)
treeab6863dece3d5741b8ea1989700f29188a4f8098 /src/Generating
parentPrefabPiecePool: Added loading from cubeset file. (diff)
downloadcuberite-8df31067d4703beb3225b7d9787385d58f893c5d.tar
cuberite-8df31067d4703beb3225b7d9787385d58f893c5d.tar.gz
cuberite-8df31067d4703beb3225b7d9787385d58f893c5d.tar.bz2
cuberite-8df31067d4703beb3225b7d9787385d58f893c5d.tar.lz
cuberite-8df31067d4703beb3225b7d9787385d58f893c5d.tar.xz
cuberite-8df31067d4703beb3225b7d9787385d58f893c5d.tar.zst
cuberite-8df31067d4703beb3225b7d9787385d58f893c5d.zip
Diffstat (limited to 'src/Generating')
-rw-r--r--src/Generating/CMakeLists.txt2
-rw-r--r--src/Generating/PrefabPiecePool.cpp29
2 files changed, 3 insertions, 28 deletions
diff --git a/src/Generating/CMakeLists.txt b/src/Generating/CMakeLists.txt
index ebba4cce8..f3fe5c55c 100644
--- a/src/Generating/CMakeLists.txt
+++ b/src/Generating/CMakeLists.txt
@@ -101,5 +101,5 @@ endif()
if(NOT MSVC)
add_library(Generating ${SRCS} ${HDRS})
- target_link_libraries(Generating OSSupport Blocks)
+ target_link_libraries(Generating OSSupport Blocks Bindings)
endif()
diff --git a/src/Generating/PrefabPiecePool.cpp b/src/Generating/PrefabPiecePool.cpp
index c98eaaa5e..3f0ec8549 100644
--- a/src/Generating/PrefabPiecePool.cpp
+++ b/src/Generating/PrefabPiecePool.cpp
@@ -24,33 +24,6 @@
-#if SELF_TEST
-static class cPrefabPiecePoolTest
-{
-public:
- cPrefabPiecePoolTest(void)
- {
- cSelfTests::Get().Register(cSelfTests::SelfTestFunction(cPrefabPiecePoolTest::TestLoading), "PrefabPiecePool loading test");
- }
-
- static void TestLoading(void)
- {
- cPrefabPiecePool test;
- auto res = test.LoadFromFile("test.cubeset", true);
- if (!res)
- {
- LOGWARNING("Loading from file \"test.cubeset\" failed.");
- return;
- }
- LOG("Loaded %u pieces and %u starting pieces", static_cast<unsigned>(test.GetAllPiecesCount()), static_cast<unsigned>(test.GetStartingPiecesCount()));
- }
-} g_Test;
-#endif
-
-
-
-
-
/** Returns the map of string => eMergeStrategy used when translating cubeset file merge strategies. */
static std::map<AString, cBlockArea::eMergeStrategy> & GetMergeStrategyMap(void)
{
@@ -173,6 +146,7 @@ bool cPrefabPiecePool::LoadFromFile(const AString & a_FileName, bool a_LogWarnin
cFile f;
if (!f.Open(a_FileName, cFile::fmRead))
{
+ CONDWARNING(a_LogWarnings, "Cannot open file %s for reading", a_FileName.c_str());
return false;
}
char buf[4096];
@@ -184,6 +158,7 @@ bool cPrefabPiecePool::LoadFromFile(const AString & a_FileName, bool a_LogWarnin
{
return LoadFromCubesetFile(a_FileName, a_LogWarnings);
}
+ CONDWARNING(a_LogWarnings, "Cannot load prefabs from file %s, unknown file format", a_FileName.c_str());
return false;
}