2020-10-18 17:08:41 +02:00
|
|
|
#pragma once
|
|
|
|
|
2021-09-21 12:14:39 +02:00
|
|
|
struct zmap_header_type;
|
|
|
|
struct gdrv_bitmap8;
|
|
|
|
|
2020-10-24 17:30:45 +02:00
|
|
|
|
2021-01-28 16:01:26 +01:00
|
|
|
enum class bmp8Flags : unsigned char
|
|
|
|
{
|
|
|
|
RawBmpUnaligned = 1 << 0,
|
2021-01-31 15:29:53 +01:00
|
|
|
DibBitmap = 1 << 1,
|
|
|
|
Spliced = 1 << 2,
|
2021-01-28 16:01:26 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2021-09-21 12:14:39 +02:00
|
|
|
#pragma pack(push, 1)
|
2020-10-24 17:30:45 +02:00
|
|
|
struct datFileHeader
|
2020-10-18 17:08:41 +02:00
|
|
|
{
|
|
|
|
char FileSignature[21];
|
|
|
|
char AppName[50];
|
|
|
|
char Description[100];
|
|
|
|
int FileSize;
|
|
|
|
unsigned short NumberOfGroups;
|
|
|
|
int SizeOfBody;
|
|
|
|
unsigned short Unknown;
|
|
|
|
};
|
|
|
|
|
2020-10-24 17:30:45 +02:00
|
|
|
struct dat8BitBmpHeader
|
2020-10-18 17:08:41 +02:00
|
|
|
{
|
2021-09-21 12:14:39 +02:00
|
|
|
uint8_t Resolution;
|
2021-02-16 17:03:45 +01:00
|
|
|
int16_t Width;
|
|
|
|
int16_t Height;
|
|
|
|
int16_t XPosition;
|
|
|
|
int16_t YPosition;
|
2020-10-24 17:30:45 +02:00
|
|
|
int Size;
|
2021-01-28 16:01:26 +01:00
|
|
|
bmp8Flags Flags;
|
|
|
|
|
2021-09-21 12:14:39 +02:00
|
|
|
bool IsFlagSet(bmp8Flags flag) const
|
2021-01-28 16:01:26 +01:00
|
|
|
{
|
|
|
|
return static_cast<char>(Flags) & static_cast<char>(flag);
|
|
|
|
}
|
2020-10-18 17:08:41 +02:00
|
|
|
};
|
|
|
|
|
2021-09-09 10:40:54 +02:00
|
|
|
struct dat16BitBmpHeader
|
2021-01-29 14:42:05 +01:00
|
|
|
{
|
2021-02-16 17:03:45 +01:00
|
|
|
int16_t Width;
|
|
|
|
int16_t Height;
|
|
|
|
int16_t Stride;
|
2021-01-29 14:42:05 +01:00
|
|
|
int Unknown0;
|
2021-02-16 17:03:45 +01:00
|
|
|
int16_t Unknown1_0;
|
|
|
|
int16_t Unknown1_1;
|
2021-01-29 14:42:05 +01:00
|
|
|
};
|
|
|
|
#pragma pack(pop)
|
|
|
|
|
2021-09-21 12:14:39 +02:00
|
|
|
static_assert(sizeof(dat8BitBmpHeader) == 14, "Wrong size of dat8BitBmpHeader");
|
|
|
|
static_assert(sizeof(datFileHeader) == 183, "Wrong size of datFileHeader");
|
2021-01-29 14:42:05 +01:00
|
|
|
static_assert(sizeof(dat16BitBmpHeader) == 14, "Wrong size of zmap_header_type");
|
|
|
|
|
2021-09-21 12:14:39 +02:00
|
|
|
|
2020-10-18 17:08:41 +02:00
|
|
|
class partman
|
|
|
|
{
|
|
|
|
public:
|
2021-10-01 17:55:44 +02:00
|
|
|
static class DatFile* load_records(LPCSTR lpFileName, bool fullTiltMode);
|
2020-10-18 17:08:41 +02:00
|
|
|
private:
|
|
|
|
static short _field_size[];
|
2021-10-01 17:55:44 +02:00
|
|
|
|
|
|
|
template <typename T>
|
|
|
|
static T LRead(FILE* file)
|
|
|
|
{
|
|
|
|
T Buffer{};
|
|
|
|
fread(&Buffer, 1, sizeof(T), file);
|
|
|
|
return Buffer;
|
|
|
|
}
|
2020-10-18 17:08:41 +02:00
|
|
|
};
|