Clean, self-contained extraction of the BattleTech-specific work from the
reverse-engineering workspace -- engine + game + content + build, with nothing
from Red Planet or the raw archive dumps. Builds green (Win32) and runs the
single-player drive->animate->target->fire->damage->destroy loop out of the box.
Layout:
engine/ MUNGA + MUNGA_L4 shared 2007 engine, carrying our BT render/loader
work (bgfload/L4D3D/L4VIDEO: BSL bit-slice decode, LOD/ground/shadow
models) + image codec; the minimal rp/ headers the audio HAL needs
game/ reconstructed BT logic + surviving-original BT source + fwd shims
+ WinMain launcher
content/ full runtime tree (BTL4.RES, VIDEO/, GAUGE/, AUDIO/, eggs, BTDPL.INI)
docs/ format specs + reconstruction ledgers
reference/ raw Ghidra pseudocode (recon source-of-truth) + decomp exporter
tools/ MP console emulator + map/resource scanners
One top-level CMake builds munga_engine lib + bt410_l4 game lib + btl4.exe.
All paths relativized (186 fwd shims + ~437 CMake abs paths -> repo-relative);
DXSDK is the one external, overridable via -DDXSDK. Verified: builds to a
byte-identical 2.27MB exe and runs combat (TARGET DESTROYED, 0 crashes) against
the bundled content.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
124 lines
3.3 KiB
C++
124 lines
3.3 KiB
C++
#ifndef dpl_2d_h
|
|
#define dpl_2d_h
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
#include <dpl/dpltypes.h>
|
|
|
|
#define WORDS_PER_DISPLAY_CHUNK 30
|
|
|
|
typedef struct s_dpl2d_display {
|
|
void *remote;
|
|
struct s_dpl2d_display *next;
|
|
struct s_dpl2d_display *tail;
|
|
int32 size;
|
|
int32 open;
|
|
int32 data[WORDS_PER_DISPLAY_CHUNK];
|
|
} dpl2d_DISPLAY;
|
|
|
|
typedef enum dpl2d_OPEN_MODE
|
|
{
|
|
dpl2d_open_mode_error,
|
|
dpl2d_open_mode_clear,
|
|
dpl2d_open_mode_append
|
|
} dpl2d_OPEN_MODE;
|
|
|
|
typedef enum dpl2d_CLIP_MODE
|
|
{
|
|
dpl2d_clip_mode_error,
|
|
dpl2d_clip_mode_OR,
|
|
dpl2d_clip_mode_AND,
|
|
dpl2d_clip_mode_XOR,
|
|
dpl2d_clip_mode_SET,
|
|
dpl2d_clip_mode_CLEAR
|
|
} dpl2d_CLIP_MODE;
|
|
|
|
typedef int32 *dpl_2d_snapshot;
|
|
|
|
typedef float32 dpl2d_MATRIX [6];
|
|
|
|
/* displaylist creation, destruction */
|
|
|
|
extern dpl2d_DISPLAY *dpl2d_NewDisplayList ( void );
|
|
|
|
extern int32 dpl2d_DeleteDisplayList ( dpl2d_DISPLAY *display );
|
|
|
|
extern int32 dpl2d_OpenDisplayList ( dpl2d_DISPLAY *display, dpl2d_OPEN_MODE append );
|
|
|
|
extern int32 dpl2d_CloseDisplayList ( dpl2d_DISPLAY *display );
|
|
|
|
extern int32 dpl2d_FlushDisplayList ( dpl2d_DISPLAY *display );
|
|
|
|
extern int32 dpl2d_AddOpenPolyline ( dpl2d_DISPLAY *display );
|
|
|
|
extern int32 dpl2d_AddClosePolyline ( dpl2d_DISPLAY *display );
|
|
|
|
extern int32 dpl2d_AddOpenLines ( dpl2d_DISPLAY *display );
|
|
|
|
extern int32 dpl2d_AddCloseLines ( dpl2d_DISPLAY *display );
|
|
|
|
extern int32 dpl2d_AddOpenPolypoint ( dpl2d_DISPLAY *display );
|
|
|
|
extern int32 dpl2d_AddClosePolypoint ( dpl2d_DISPLAY *display );
|
|
|
|
extern int32 dpl2d_AddPoint ( dpl2d_DISPLAY *display, float32 x, float32 y );
|
|
|
|
extern int32 dpl2d_AddCircle( dpl2d_DISPLAY *display, float32 x, float32 y, float32 r, int32 filled );
|
|
|
|
extern int32 dpl2d_AddPushState ( dpl2d_DISPLAY *display );
|
|
|
|
extern int32 dpl2d_AddPopState ( dpl2d_DISPLAY *display );
|
|
|
|
extern int32 dpl2d_AddSetColor ( dpl2d_DISPLAY *display, float32 r, float32 g, float32 b );
|
|
|
|
extern int32 dpl2d_AddSetAlpha ( dpl2d_DISPLAY *display, float32 a );
|
|
|
|
extern int32 dpl2d_AddSetMatrix ( dpl2d_DISPLAY *display, dpl2d_MATRIX );
|
|
|
|
extern int32 dpl2d_AddConcatMatrix ( dpl2d_DISPLAY *display, dpl2d_MATRIX, int32 post );
|
|
|
|
extern int32 dpl2d_AddSetLineWidth ( dpl2d_DISPLAY *display,
|
|
float32 w );
|
|
|
|
/* clip region support */
|
|
extern int32 dpl2d_AddFullScreenClipRegion ( dpl2d_DISPLAY *display );
|
|
|
|
extern int32 dpl2d_AddClearClipRegion ( dpl2d_DISPLAY *display );
|
|
|
|
extern int32 dpl2d_AddOpenClipPolygon ( dpl2d_DISPLAY *display );
|
|
|
|
extern int32 dpl2d_AddCloseClipPolygon ( dpl2d_DISPLAY *display,
|
|
dpl2d_CLIP_MODE mode );
|
|
|
|
extern int32 dpl2d_AddClipCircle ( dpl2d_DISPLAY *display,
|
|
float32 x, float32 y, float32 rad,
|
|
dpl2d_CLIP_MODE mode );
|
|
|
|
|
|
extern int32 dpl2d_AddCallDisplayList ( dpl2d_DISPLAY *display,
|
|
dpl2d_DISPLAY *sub_display );
|
|
|
|
extern int32 dpl2d_SetViewDisplayList ( dpl_VIEW *v, dpl2d_DISPLAY *disp );
|
|
|
|
extern dpl2d_DISPLAY *dpl2d_GetViewDisplayList ( dpl_VIEW *v );
|
|
|
|
/* and now the 2-D matrix support */
|
|
|
|
extern void dpl2d_IdMatrix ( dpl2d_MATRIX m );
|
|
extern void dpl2d_TranslateMatrix ( dpl2d_MATRIX m,
|
|
float32 x, float32 y );
|
|
extern void dpl2d_RotateMatrix ( dpl2d_MATRIX m,
|
|
float32 angle );
|
|
extern void dpl2d_ScaleMatrix ( dpl2d_MATRIX m,
|
|
float32 sx, float32 sy );
|
|
extern void dpl2d_ConcatMatrix ( dpl2d_MATRIX m,
|
|
dpl2d_MATRIX a,
|
|
dpl2d_MATRIX b );
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
#endif
|
|
|