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>
76 lines
2.4 KiB
C++
76 lines
2.4 KiB
C++
#pragma once
|
|
|
|
#include "style.h"
|
|
#include "scalar.h"
|
|
|
|
class NotationFile;
|
|
|
|
extern char *WorkingDirectory;
|
|
|
|
extern const char *White_Space;
|
|
|
|
inline char* NextToken()
|
|
{
|
|
return strtok(NULL, White_Space);
|
|
}
|
|
|
|
void SetSourceDirectory(const char *input_file);
|
|
void SetOutputDirectory(const char *directory);
|
|
const char* GetSourceDirectory();
|
|
const char* GetConfigDirectory();
|
|
const char* GetMaterialDirectory();
|
|
const char* GetTextureDirectory();
|
|
const char* GetAnimationDirectory();
|
|
const char* GetProductionDirectory();
|
|
const char* GetOutputDirectory();
|
|
void ClearDirectories();
|
|
const char* SourceFile(const char *filename, const char *extension = NULL);
|
|
const char* ConfigFile(const char *filename, const char *extension = NULL);
|
|
const char* MaterialFile(const char *filename, const char *extension = NULL);
|
|
const char* TextureFile(const char *filename, const char *extension = NULL);
|
|
const char* AnimationFile(const char *filename, const char *extension = NULL);
|
|
const char* OutputFile(const char *filename, const char *extension = NULL);
|
|
const char* StripDirectory(const char *filename);
|
|
const char* StripExtension(const char *filename);
|
|
|
|
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
char* Ind(int level = 1);
|
|
|
|
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
Logical GetLine(std::istream &stream, char *buffer, int size_of_buffer);
|
|
|
|
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
#if 0
|
|
char* stripname(char filename[]);
|
|
#endif
|
|
|
|
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
Scalar D2R(float degrees);
|
|
|
|
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
char* MakeWorkingDirectory(const char *file);
|
|
|
|
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
Logical DirectoryIsSpecified(const char *file);
|
|
|
|
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
char* MakePathedFilename(const char *directory, const char *name);
|
|
|
|
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
void OpenOutput(std::ofstream &stream, const char *directory, const char *filename);
|
|
|
|
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
void OpenInput(std::ifstream &stream, char *directory, const char *filename);
|
|
|
|
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
Logical DoesNotationFileExist(NotationFile *notation_file); |