summaryrefslogtreecommitdiffstats
path: root/converter/cConvert.cpp
diff options
context:
space:
mode:
authoradmin@omencraft.com <admin@omencraft.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2011-10-30 03:16:01 +0100
committeradmin@omencraft.com <admin@omencraft.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2011-10-30 03:16:01 +0100
commit9f3b6fe838b29fd178a7981b559ba56f7e2c34cd (patch)
tree77316b98bf6f6940ef90069083b7f281c2d6b886 /converter/cConvert.cpp
parentAdded 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)
downloadcuberite-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/cConvert.cpp')
-rw-r--r--converter/cConvert.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/converter/cConvert.cpp b/converter/cConvert.cpp
index 788399dcf..8554687ca 100644
--- a/converter/cConvert.cpp
+++ b/converter/cConvert.cpp
@@ -109,6 +109,9 @@ int main () {
char temparr[compdlength]; //can't get fread to read more than one char at a time into a char array... so that's what I'll do. :( At least it works.
+ if( fread( temparr, compdlength, 1, f) != 1 ) { cout << "ERROR rf22 READING FROM FILE " << SourceFile; fclose(f); return false; }
+ frloc = frloc + compdlength;
+ /*
int re = 0;
char tempbyte = 0;
while (re < compdlength) { //loop through file and read contents into char array a byte at a time.
@@ -118,7 +121,7 @@ int main () {
frloc++;
}
-
+ */
//if( fread( comp_data, compdlength, sizeof(unsigned char), f) != 1 ) { cout << "ERROR 1234 READING FROM FILE " << SourceFile <<endl; fclose(f); return false; } //actual compressed chunk data
//frloc += compdlength;
@@ -169,6 +172,12 @@ int main () {
//cout << BlockDataString << endl;
+ //testing of nbtparser.
+ cNBTData* NBTData = new cNBTData::cNBTData(BlockData, testr);
+ //NBTData->m_bDecompressed = true;
+ NBTData->ParseData();
+ NBTData->PrintData();
+ return 1;
fwrite( BlockData, DestSize, 1, wf ); //write contents of uncompressed block data to file to check to see if it's valid... It is! :D
//fwrite( &temparr, compdlength, sizeof(unsigned char), wf );
//cin >> n; //just to see screen output