1
0

Merge branch 'master' into WorldLoader

This commit is contained in:
Howaner 2014-09-24 15:00:49 +02:00
commit 65077c314a
9 changed files with 33 additions and 14 deletions

View File

@ -1,6 +1,6 @@
#include "Globals.h" #include "Globals.h"
#include "BiomeView.h" #include "BiomeView.h"
#include "Chunk.h" #include "QtChunk.h"
#include <QPainter> #include <QPainter>
#include <QResizeEvent> #include <QResizeEvent>

View File

@ -2,9 +2,9 @@
#include "ChunkSource.h" #include "ChunkSource.h"
#include <QThread> #include <QThread>
#include "src/Generating/BioGen.h" #include "src/Generating/BioGen.h"
#include "inifile/iniFile.h"
#include "src/StringCompression.h" #include "src/StringCompression.h"
#include "src/WorldStorage/FastNBT.h" #include "src/WorldStorage/FastNBT.h"
#include "inifile/iniFile.h"

View File

@ -2,7 +2,7 @@
#include "Globals.h" #include "Globals.h"
#include <QString> #include <QString>
#include <QMutex> #include <QMutex>
#include "Chunk.h" #include "QtChunk.h"

View File

@ -12,7 +12,7 @@ TARGET = QtBiomeVisualiser
TEMPLATE = app TEMPLATE = app
SOURCES += main.cpp\ SOURCES +=\
MainWindow.cpp \ MainWindow.cpp \
BiomeView.cpp \ BiomeView.cpp \
../../src/Generating/BioGen.cpp \ ../../src/Generating/BioGen.cpp \
@ -27,7 +27,6 @@ SOURCES += main.cpp\
../../src/OSSupport/IsThread.cpp \ ../../src/OSSupport/IsThread.cpp \
../../src/BiomeDef.cpp \ ../../src/BiomeDef.cpp \
ChunkCache.cpp \ ChunkCache.cpp \
Chunk.cpp \
ChunkSource.cpp \ ChunkSource.cpp \
ChunkLoader.cpp \ ChunkLoader.cpp \
../../src/StringCompression.cpp \ ../../src/StringCompression.cpp \
@ -47,7 +46,9 @@ SOURCES += main.cpp\
../../lib/zlib/trees.c \ ../../lib/zlib/trees.c \
../../lib/zlib/uncompr.c \ ../../lib/zlib/uncompr.c \
../../lib/zlib/zutil.c \ ../../lib/zlib/zutil.c \
GeneratorSetup.cpp GeneratorSetup.cpp \
QtBiomeVisualiser.cpp \
QtChunk.cpp
HEADERS += MainWindow.h \ HEADERS += MainWindow.h \
Globals.h \ Globals.h \
@ -64,7 +65,6 @@ HEADERS += MainWindow.h \
../../src/OSSupport/IsThread.h \ ../../src/OSSupport/IsThread.h \
../../src/BiomeDef.h \ ../../src/BiomeDef.h \
ChunkCache.h \ ChunkCache.h \
Chunk.h \
ChunkSource.h \ ChunkSource.h \
ChunkLoader.h \ ChunkLoader.h \
../../src/StringCompression.h \ ../../src/StringCompression.h \
@ -80,13 +80,19 @@ HEADERS += MainWindow.h \
../../lib/zlib/zconf.h \ ../../lib/zlib/zconf.h \
../../lib/zlib/zlib.h \ ../../lib/zlib/zlib.h \
../../lib/zlib/zutil.h \ ../../lib/zlib/zutil.h \
GeneratorSetup.h GeneratorSetup.h \
QtChunk.h
INCLUDEPATH += $$_PRO_FILE_PWD_ \ INCLUDEPATH += $$_PRO_FILE_PWD_ \
$$_PRO_FILE_PWD_/../../lib \ $$_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_/../../ $$_PRO_FILE_PWD_/../../
CONFIG += C++11 CONFIG += C++11
OTHER_FILES += OTHER_FILES +=

View File

@ -1,6 +1,5 @@
#include "Globals.h" #include "Globals.h"
#include "Globals.h" #include "QtChunk.h"
#include "Chunk.h"

View File

@ -582,7 +582,7 @@ void cNBTChunkSerializer::AddMonsterEntity(cMonster * a_Monster)
} }
m_Writer.AddByte("Sitting", Wolf.IsSitting() ? 1 : 0); m_Writer.AddByte("Sitting", Wolf.IsSitting() ? 1 : 0);
m_Writer.AddByte("Angry", Wolf.IsAngry() ? 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; break;
} }
case cMonster::mtZombie: case cMonster::mtZombie:

View File

@ -2505,10 +2505,24 @@ void cWSSAnvil::LoadWolfFromNBT(cEntityList & a_Entities, const cParsedNBT & a_N
Monster->SetIsAngry(Angry); Monster->SetIsAngry(Angry);
} }
int CollarColorIdx = a_NBT.FindChildByName(a_TagIdx, "CollarColor"); 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); switch (a_NBT.GetType(CollarColorIdx))
Monster->SetCollarColor(CollarColor); {
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()); a_Entities.push_back(Monster.release());
} }