summaryrefslogtreecommitdiffhomepage
path: root/StarsEx/Archive.h
diff options
context:
space:
mode:
authorAki <please@ignore.pl>2022-04-10 15:24:32 +0200
committerAki <please@ignore.pl>2022-04-10 15:25:02 +0200
commit034aa81895b201164004d79aa090e882e3e66945 (patch)
tree502ad20a5488c3258c866514e9a286e89321f8f4 /StarsEx/Archive.h
parente8c40a99cb00ea7f68dcb1b8414065785c89df9c (diff)
downloadstarshatter-034aa81895b201164004d79aa090e882e3e66945.zip
starshatter-034aa81895b201164004d79aa090e882e3e66945.tar.gz
starshatter-034aa81895b201164004d79aa090e882e3e66945.tar.bz2
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.
Diffstat (limited to 'StarsEx/Archive.h')
-rw-r--r--StarsEx/Archive.h18
1 files changed, 12 insertions, 6 deletions
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 <cstdint>
+
+#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;