From 034aa81895b201164004d79aa090e882e3e66945 Mon Sep 17 00:00:00 2001 From: Aki Date: Sun, 10 Apr 2022 15:24:32 +0200 Subject: Moved archives list from static part of impl to loader member Including Archive.h in DataLoader.h created name conflicts and created an error due to missing types from Types.h in the Archive.h itself. --- StarsEx/Archive.h | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) (limited to 'StarsEx/Archive.h') diff --git a/StarsEx/Archive.h b/StarsEx/Archive.h index ac22f28..1cf76e9 100644 --- a/StarsEx/Archive.h +++ b/StarsEx/Archive.h @@ -10,12 +10,18 @@ #ifndef Archive_h #define Archive_h +#include + +#include "Types.h" + // +------------------------------------------------------------------+ -#define VERSION 0x0010 -#define BLOCK_SIZE 1024 -#define FILE_BLOCK 1024 -#define NAMELEN 64 +namespace Archive +{ +static constexpr std::uint32_t VERSION {0x0010}; +static constexpr std::size_t BLOCK_SIZE {1024}; +static constexpr std::size_t NAMELEN {64}; +} // +------------------------------------------------------------------+ @@ -34,7 +40,7 @@ struct DataEntry { static const char* TYPENAME() { return "DataEntry"; } - char name[NAMELEN]; + char name[Archive::NAMELEN]; DWORD size_orig; DWORD size_comp; DWORD offset; @@ -80,7 +86,7 @@ private: BYTE* dirbuf; // transient members: - char datafile[NAMELEN]; + char datafile[Archive::NAMELEN]; DWORD* block_map; DWORD nblocks; -- cgit v1.1