Tools/Map extractor: Warning fixes

This commit is contained in:
Shauren
2015-04-15 12:58:38 +02:00
parent 7b0c4792ce
commit ca1f42d409
3 changed files with 19 additions and 20 deletions

View File

@@ -45,28 +45,26 @@ enum LiquidType
//
// Adt file height map chunk
//
class adt_MCVT
struct adt_MCVT
{
union{
uint32 fcc;
char fcc_txt[4];
};
uint32 size;
public:
float height_map[(ADT_CELL_SIZE+1)*(ADT_CELL_SIZE+1)+ADT_CELL_SIZE*ADT_CELL_SIZE];
};
//
// Adt file liquid map chunk (old)
//
class adt_MCLQ
struct adt_MCLQ
{
union{
uint32 fcc;
char fcc_txt[4];
};
uint32 size;
public:
float height1;
float height2;
struct liquid_data{
@@ -87,14 +85,13 @@ public:
//
// Adt file cell chunk
//
class adt_MCNK
struct adt_MCNK
{
union{
uint32 fcc;
char fcc_txt[4];
};
uint32 size;
public:
uint32 flags;
uint32 ix;
uint32 iy;
@@ -139,7 +136,8 @@ public:
#define ADT_LIQUID_HEADER_FULL_LIGHT 0x01
#define ADT_LIQUID_HEADER_NO_HIGHT 0x02
struct adt_liquid_header{
struct adt_liquid_header
{
uint16 liquidType; // Index from LiquidType.dbc
uint16 formatFlags;
float heightLevel1;
@@ -155,9 +153,8 @@ struct adt_liquid_header{
//
// Adt file liquid data chunk (new)
//
class adt_MH2O
struct adt_MH2O
{
public:
union{
uint32 fcc;
char fcc_txt[4];

View File

@@ -21,7 +21,7 @@
#include "loadlib.h"
#include <cstdio>
u_map_fcc MverMagic = { {'R','E','V','M'} };
u_map_fcc MverMagic = { { 'R','E','V','M' } };
ChunkedFile::ChunkedFile()
{
@@ -89,14 +89,15 @@ void ChunkedFile::free()
data_size = 0;
}
u_map_fcc InterestingChunks[] = {
{ 'R', 'E', 'V', 'M' },
{ 'N', 'I', 'A', 'M' },
{ 'O', '2', 'H', 'M' },
{ 'K', 'N', 'C', 'M' },
{ 'T', 'V', 'C', 'M' },
{ 'O', 'M', 'W', 'M' },
{ 'Q', 'L', 'C', 'M' }
u_map_fcc InterestingChunks[] =
{
{ { 'R', 'E', 'V', 'M' } },
{ { 'N', 'I', 'A', 'M' } },
{ { 'O', '2', 'H', 'M' } },
{ { 'K', 'N', 'C', 'M' } },
{ { 'T', 'V', 'C', 'M' } },
{ { 'O', 'M', 'W', 'M' } },
{ { 'Q', 'L', 'C', 'M' } }
};
bool IsInterestingChunk(u_map_fcc const& fcc)
@@ -123,7 +124,7 @@ void ChunkedFile::parseChunks()
std::swap(header.fcc_txt[0], header.fcc_txt[3]);
std::swap(header.fcc_txt[1], header.fcc_txt[2]);
FileChunk* chunk = new FileChunk{ ptr, size };
FileChunk* chunk = new FileChunk(ptr, size);
chunk->parseSubChunks();
chunks.insert({ std::string(header.fcc_txt, 4), chunk });
}
@@ -167,7 +168,7 @@ void FileChunk::parseSubChunks()
std::swap(header.fcc_txt[0], header.fcc_txt[3]);
std::swap(header.fcc_txt[1], header.fcc_txt[2]);
FileChunk* chunk = new FileChunk{ ptr, subsize };
FileChunk* chunk = new FileChunk(ptr, subsize);
chunk->parseSubChunks();
subchunks.insert({ std::string(header.fcc_txt, 4), chunk });
}

View File

@@ -70,6 +70,7 @@ struct file_MWMO
class FileChunk
{
public:
FileChunk(uint8* data_, uint32 size_) : data(data_), size(size_) { }
~FileChunk();
uint8* data;