summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHowaner <franzi.moos@googlemail.com>2014-09-24 15:00:49 +0200
committerHowaner <franzi.moos@googlemail.com>2014-09-24 15:00:49 +0200
commit65077c314aa8dea94b37e0d22ced4a09850c8132 (patch)
treefa4c47cd2b299fd760f073dd9a9a66ea3b3a9f7a
parentMerge branch 'master' into WorldLoader (diff)
parentQtBiomeVisualiser: Fixed MSVC path-crossing. (diff)
downloadcuberite-65077c314aa8dea94b37e0d22ced4a09850c8132.tar
cuberite-65077c314aa8dea94b37e0d22ced4a09850c8132.tar.gz
cuberite-65077c314aa8dea94b37e0d22ced4a09850c8132.tar.bz2
cuberite-65077c314aa8dea94b37e0d22ced4a09850c8132.tar.lz
cuberite-65077c314aa8dea94b37e0d22ced4a09850c8132.tar.xz
cuberite-65077c314aa8dea94b37e0d22ced4a09850c8132.tar.zst
cuberite-65077c314aa8dea94b37e0d22ced4a09850c8132.zip
-rw-r--r--Tools/QtBiomeVisualiser/BiomeView.cpp2
-rw-r--r--Tools/QtBiomeVisualiser/ChunkSource.cpp2
-rw-r--r--Tools/QtBiomeVisualiser/ChunkSource.h2
-rw-r--r--Tools/QtBiomeVisualiser/QtBiomeVisualiser.cpp (renamed from Tools/QtBiomeVisualiser/main.cpp)0
-rw-r--r--Tools/QtBiomeVisualiser/QtBiomeVisualiser.pro16
-rw-r--r--Tools/QtBiomeVisualiser/QtChunk.cpp (renamed from Tools/QtBiomeVisualiser/Chunk.cpp)3
-rw-r--r--Tools/QtBiomeVisualiser/QtChunk.h (renamed from Tools/QtBiomeVisualiser/Chunk.h)0
-rw-r--r--src/WorldStorage/NBTChunkSerializer.cpp2
-rw-r--r--src/WorldStorage/WSSAnvil.cpp20
9 files changed, 33 insertions, 14 deletions
diff --git a/Tools/QtBiomeVisualiser/BiomeView.cpp b/Tools/QtBiomeVisualiser/BiomeView.cpp
index bbaccb369..ce5a870cd 100644
--- a/Tools/QtBiomeVisualiser/BiomeView.cpp
+++ b/Tools/QtBiomeVisualiser/BiomeView.cpp
@@ -1,6 +1,6 @@
#include "Globals.h"
#include "BiomeView.h"
-#include "Chunk.h"
+#include "QtChunk.h"
#include <QPainter>
#include <QResizeEvent>
diff --git a/Tools/QtBiomeVisualiser/ChunkSource.cpp b/Tools/QtBiomeVisualiser/ChunkSource.cpp
index 28d184615..bebf89a0a 100644
--- a/Tools/QtBiomeVisualiser/ChunkSource.cpp
+++ b/Tools/QtBiomeVisualiser/ChunkSource.cpp
@@ -2,9 +2,9 @@
#include "ChunkSource.h"
#include <QThread>
#include "src/Generating/BioGen.h"
-#include "inifile/iniFile.h"
#include "src/StringCompression.h"
#include "src/WorldStorage/FastNBT.h"
+#include "inifile/iniFile.h"
diff --git a/Tools/QtBiomeVisualiser/ChunkSource.h b/Tools/QtBiomeVisualiser/ChunkSource.h
index 05e8ac5de..7bd1865ff 100644
--- a/Tools/QtBiomeVisualiser/ChunkSource.h
+++ b/Tools/QtBiomeVisualiser/ChunkSource.h
@@ -2,7 +2,7 @@
#include "Globals.h"
#include <QString>
#include <QMutex>
-#include "Chunk.h"
+#include "QtChunk.h"
diff --git a/Tools/QtBiomeVisualiser/main.cpp b/Tools/QtBiomeVisualiser/QtBiomeVisualiser.cpp
index f41cdcfb2..f41cdcfb2 100644
--- a/Tools/QtBiomeVisualiser/main.cpp
+++ b/Tools/QtBiomeVisualiser/QtBiomeVisualiser.cpp
diff --git a/Tools/QtBiomeVisualiser/QtBiomeVisualiser.pro b/Tools/QtBiomeVisualiser/QtBiomeVisualiser.pro
index d6630bd34..9e5d1303c 100644
--- a/Tools/QtBiomeVisualiser/QtBiomeVisualiser.pro
+++ b/Tools/QtBiomeVisualiser/QtBiomeVisualiser.pro
@@ -12,7 +12,7 @@ TARGET = QtBiomeVisualiser
TEMPLATE = app
-SOURCES += main.cpp\
+SOURCES +=\
MainWindow.cpp \
BiomeView.cpp \
../../src/Generating/BioGen.cpp \
@@ -27,7 +27,6 @@ SOURCES += main.cpp\
../../src/OSSupport/IsThread.cpp \
../../src/BiomeDef.cpp \
ChunkCache.cpp \
- Chunk.cpp \
ChunkSource.cpp \
ChunkLoader.cpp \
../../src/StringCompression.cpp \
@@ -47,7 +46,9 @@ SOURCES += main.cpp\
../../lib/zlib/trees.c \
../../lib/zlib/uncompr.c \
../../lib/zlib/zutil.c \
- GeneratorSetup.cpp
+ GeneratorSetup.cpp \
+ QtBiomeVisualiser.cpp \
+ QtChunk.cpp
HEADERS += MainWindow.h \
Globals.h \
@@ -64,7 +65,6 @@ HEADERS += MainWindow.h \
../../src/OSSupport/IsThread.h \
../../src/BiomeDef.h \
ChunkCache.h \
- Chunk.h \
ChunkSource.h \
ChunkLoader.h \
../../src/StringCompression.h \
@@ -80,13 +80,19 @@ HEADERS += MainWindow.h \
../../lib/zlib/zconf.h \
../../lib/zlib/zlib.h \
../../lib/zlib/zutil.h \
- GeneratorSetup.h
+ GeneratorSetup.h \
+ QtChunk.h
INCLUDEPATH += $$_PRO_FILE_PWD_ \
$$_PRO_FILE_PWD_/../../lib \
+ $$_PRO_FILE_PWD_/../../lib/jsoncpp/include \
+ $$_PRO_FILE_PWD_/../../lib/polarssl/include \
+ $$_PRO_FILE_PWD_/../../lib/sqlite \
+ $$_PRO_FILE_PWD_/../../lib/SQLiteCpp/include \
$$_PRO_FILE_PWD_/../../
+
CONFIG += C++11
OTHER_FILES +=
diff --git a/Tools/QtBiomeVisualiser/Chunk.cpp b/Tools/QtBiomeVisualiser/QtChunk.cpp
index d3419af9c..80109b2f8 100644
--- a/Tools/QtBiomeVisualiser/Chunk.cpp
+++ b/Tools/QtBiomeVisualiser/QtChunk.cpp
@@ -1,6 +1,5 @@
#include "Globals.h"
-#include "Globals.h"
-#include "Chunk.h"
+#include "QtChunk.h"
diff --git a/Tools/QtBiomeVisualiser/Chunk.h b/Tools/QtBiomeVisualiser/QtChunk.h
index 03e7bd1b3..03e7bd1b3 100644
--- a/Tools/QtBiomeVisualiser/Chunk.h
+++ b/Tools/QtBiomeVisualiser/QtChunk.h
diff --git a/src/WorldStorage/NBTChunkSerializer.cpp b/src/WorldStorage/NBTChunkSerializer.cpp
index 09225dd90..0e364d8b0 100644
--- a/src/WorldStorage/NBTChunkSerializer.cpp
+++ b/src/WorldStorage/NBTChunkSerializer.cpp
@@ -582,7 +582,7 @@ void cNBTChunkSerializer::AddMonsterEntity(cMonster * a_Monster)
}
m_Writer.AddByte("Sitting", Wolf.IsSitting() ? 1 : 0);
m_Writer.AddByte("Angry", Wolf.IsAngry() ? 1 : 0);
- m_Writer.AddInt("CollarColor", Wolf.GetCollarColor());
+ m_Writer.AddByte("CollarColor", (unsigned char)Wolf.GetCollarColor());
break;
}
case cMonster::mtZombie:
diff --git a/src/WorldStorage/WSSAnvil.cpp b/src/WorldStorage/WSSAnvil.cpp
index 62f5ef9c0..3821ad976 100644
--- a/src/WorldStorage/WSSAnvil.cpp
+++ b/src/WorldStorage/WSSAnvil.cpp
@@ -2505,10 +2505,24 @@ void cWSSAnvil::LoadWolfFromNBT(cEntityList & a_Entities, const cParsedNBT & a_N
Monster->SetIsAngry(Angry);
}
int CollarColorIdx = a_NBT.FindChildByName(a_TagIdx, "CollarColor");
- if ((CollarColorIdx > 0) && (a_NBT.GetType(CollarColorIdx) == TAG_Int))
+ if (CollarColorIdx > 0)
{
- int CollarColor = a_NBT.GetInt(CollarColorIdx);
- Monster->SetCollarColor(CollarColor);
+ switch (a_NBT.GetType(CollarColorIdx))
+ {
+ case TAG_Byte:
+ {
+ // Vanilla uses this
+ unsigned char CollarColor = a_NBT.GetByte(CollarColorIdx);
+ Monster->SetCollarColor(CollarColor);
+ break;
+ }
+ case TAG_Int:
+ {
+ // Old MCS code used this, keep reading it for compatibility reasons:
+ Monster->SetCollarColor(a_NBT.GetInt(CollarColorIdx));
+ break;
+ }
+ }
}
a_Entities.push_back(Monster.release());
}