aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShauren <shauren.trinity@gmail.com>2015-04-15 12:58:38 +0200
committerShauren <shauren.trinity@gmail.com>2015-04-15 12:58:38 +0200
commitca1f42d4091a91d3bd50ccc52012c836c43958f6 (patch)
tree5cf5fd3c8ebed6b8d7a4911fb991c85d4c36d618
parent7b0c4792ce805dd16f930f7a5fef71a10186a0a3 (diff)
Tools/Map extractor: Warning fixes
-rw-r--r--src/tools/map_extractor/adt.h15
-rw-r--r--src/tools/map_extractor/loadlib.cpp23
-rw-r--r--src/tools/map_extractor/loadlib/loadlib.h1
3 files changed, 19 insertions, 20 deletions
diff --git a/src/tools/map_extractor/adt.h b/src/tools/map_extractor/adt.h
index 71af5a52f05..5845f46dc99 100644
--- a/src/tools/map_extractor/adt.h
+++ b/src/tools/map_extractor/adt.h
@@ -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];
diff --git a/src/tools/map_extractor/loadlib.cpp b/src/tools/map_extractor/loadlib.cpp
index b594b21a9c9..4a9b35397a1 100644
--- a/src/tools/map_extractor/loadlib.cpp
+++ b/src/tools/map_extractor/loadlib.cpp
@@ -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 });
}
diff --git a/src/tools/map_extractor/loadlib/loadlib.h b/src/tools/map_extractor/loadlib/loadlib.h
index abea14893df..038942009ab 100644
--- a/src/tools/map_extractor/loadlib/loadlib.h
+++ b/src/tools/map_extractor/loadlib/loadlib.h
@@ -70,6 +70,7 @@ struct file_MWMO
class FileChunk
{
public:
+ FileChunk(uint8* data_, uint32 size_) : data(data_), size(size_) { }
~FileChunk();
uint8* data;