diff options
author | admin@omencraft.com <admin@omencraft.com@0a769ca7-a7f5-676a-18bf-c427514a06d6> | 2011-10-30 03:16:01 +0100 |
---|---|---|
committer | admin@omencraft.com <admin@omencraft.com@0a769ca7-a7f5-676a-18bf-c427514a06d6> | 2011-10-30 03:16:01 +0100 |
commit | 9f3b6fe838b29fd178a7981b559ba56f7e2c34cd (patch) | |
tree | 77316b98bf6f6940ef90069083b7f281c2d6b886 /converter/cNBTData.cpp | |
parent | Added denotch map converter. Program currently reads the only mcr file in the region dir and writes the uncompressed chunk data in world/X0-Z0.pak. I compile in linux with "g++ cConvert.cpp -lz -o denotch" (diff) | |
download | cuberite-9f3b6fe838b29fd178a7981b559ba56f7e2c34cd.tar cuberite-9f3b6fe838b29fd178a7981b559ba56f7e2c34cd.tar.gz cuberite-9f3b6fe838b29fd178a7981b559ba56f7e2c34cd.tar.bz2 cuberite-9f3b6fe838b29fd178a7981b559ba56f7e2c34cd.tar.lz cuberite-9f3b6fe838b29fd178a7981b559ba56f7e2c34cd.tar.xz cuberite-9f3b6fe838b29fd178a7981b559ba56f7e2c34cd.tar.zst cuberite-9f3b6fe838b29fd178a7981b559ba56f7e2c34cd.zip |
Diffstat (limited to 'converter/cNBTData.cpp')
-rw-r--r-- | converter/cNBTData.cpp | 28 |
1 files changed, 20 insertions, 8 deletions
diff --git a/converter/cNBTData.cpp b/converter/cNBTData.cpp index 9bc25b789..03e88b3ce 100644 --- a/converter/cNBTData.cpp +++ b/converter/cNBTData.cpp @@ -27,12 +27,13 @@ cNBTData::cNBTData( char* a_Buffer, unsigned int a_BufferSize ) { m_ParseFunctions[i] = 0; } - m_ParseFunctions[TAG_Byte] = &cNBTData::ParseByte; - m_ParseFunctions[TAG_Short] = &cNBTData::ParseShort; - m_ParseFunctions[TAG_Int] = &cNBTData::ParseInt; + m_ParseFunctions[TAG_Byte] = &cNBTData::ParseByte; + m_ParseFunctions[TAG_Short] = &cNBTData::ParseShort; + m_ParseFunctions[TAG_Int] = &cNBTData::ParseInt; m_ParseFunctions[TAG_String] = &cNBTData::ParseString; - m_ParseFunctions[TAG_List] = &cNBTData::ParseList; - m_ParseFunctions[TAG_Compound] = &cNBTData::ParseCompound; + m_ParseFunctions[TAG_List] = &cNBTData::ParseList; + m_ParseFunctions[TAG_Compound] = &cNBTData::ParseCompound; + m_ParseFunctions[TAG_ByteArray] = &cNBTData::ParseByteArray; m_Buffer = a_Buffer; @@ -41,7 +42,7 @@ cNBTData::cNBTData( char* a_Buffer, unsigned int a_BufferSize ) m_CurrentCompound = this; - m_bDecompressed = false; + m_bDecompressed = true; } bool cNBTData::OpenCompound( std::string a_Name ) @@ -102,7 +103,7 @@ bool cNBTData::CloseList() void cNBTData::Compress() { //printf("Before Compress size: %i\n", m_BufferSize ); - const int MAXNBTSIZE = 1024 * 2; + const int MAXNBTSIZE = 1024 * 1024 * 120; int ret; unsigned have; @@ -180,7 +181,7 @@ bool cNBTData::Decompress() //printf("Before Decompress size: %i\n", m_BufferSize ); - const int MAXNBTSIZE = 1024 * 2; + const int MAXNBTSIZE = 1024 * 1024 * 120 ; int ret; z_stream strm; @@ -518,6 +519,17 @@ void cNBTData::ParseString( bool a_bNamed ) //printf("STRING: %s (%s)\n", Name.c_str(), String.c_str() ); } +void cNBTData::ParseByteArray( bool a_bNamed ) +{ + std::string Name; + if( a_bNamed ) Name = ReadName(); + std::string String = ReadName(); + + PutString( Name, String ); + + //printf("STRING: %s (%s)\n", Name.c_str(), String.c_str() ); +} + std::string cNBTData::ReadName() { short Length = ReadShort(); |