Reverse-engineered reimplementation of 3D Pinball for Windows - Space Cadet from k4zmu2a/SpaceCadetPinball (MIT), upstream cb9b7b8, vendored rather than submoduled so local patches are just edits. - CMakeLists: stop hard-setting CMAKE_OSX_ARCHITECTURES so the documented -D override works; brew's SDL2 is arm64-only and universal linking failed. - gitignore original .DAT/.MID assets, which are not ours to redistribute. - CLAUDE.md: build line, upstream deviation, and where game data goes. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
74 lines
1.3 KiB
C++
74 lines
1.3 KiB
C++
#pragma once
|
|
|
|
struct zmap_header_type;
|
|
struct gdrv_bitmap8;
|
|
|
|
|
|
enum class bmp8Flags : unsigned char
|
|
{
|
|
RawBmpUnaligned = 1 << 0,
|
|
DibBitmap = 1 << 1,
|
|
Spliced = 1 << 2,
|
|
};
|
|
|
|
|
|
#pragma pack(push, 1)
|
|
struct datFileHeader
|
|
{
|
|
char FileSignature[21];
|
|
char AppName[50];
|
|
char Description[100];
|
|
int FileSize;
|
|
unsigned short NumberOfGroups;
|
|
int SizeOfBody;
|
|
unsigned short Unknown;
|
|
};
|
|
|
|
struct dat8BitBmpHeader
|
|
{
|
|
uint8_t Resolution;
|
|
int16_t Width;
|
|
int16_t Height;
|
|
int16_t XPosition;
|
|
int16_t YPosition;
|
|
int Size;
|
|
bmp8Flags Flags;
|
|
|
|
bool IsFlagSet(bmp8Flags flag) const
|
|
{
|
|
return static_cast<char>(Flags) & static_cast<char>(flag);
|
|
}
|
|
};
|
|
|
|
struct dat16BitBmpHeader
|
|
{
|
|
int16_t Width;
|
|
int16_t Height;
|
|
int16_t Stride;
|
|
int Unknown0;
|
|
int16_t Unknown1_0;
|
|
int16_t Unknown1_1;
|
|
};
|
|
#pragma pack(pop)
|
|
|
|
static_assert(sizeof(dat8BitBmpHeader) == 14, "Wrong size of dat8BitBmpHeader");
|
|
static_assert(sizeof(datFileHeader) == 183, "Wrong size of datFileHeader");
|
|
static_assert(sizeof(dat16BitBmpHeader) == 14, "Wrong size of zmap_header_type");
|
|
|
|
|
|
class partman
|
|
{
|
|
public:
|
|
static class DatFile* load_records(LPCSTR lpFileName, bool fullTiltMode);
|
|
private:
|
|
static short _field_size[];
|
|
|
|
template <typename T>
|
|
static T LRead(FILE* file)
|
|
{
|
|
T Buffer{};
|
|
fread(&Buffer, 1, sizeof(T), file);
|
|
return Buffer;
|
|
}
|
|
};
|