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>
98 lines
3.0 KiB
C++
98 lines
3.0 KiB
C++
#include "munga.h"
|
|
#pragma hdrstop
|
|
|
|
#include "vdata.h"
|
|
#include "objstrm.h"
|
|
|
|
//#############################################################################
|
|
//####################### RegisteredClass ###############################
|
|
//#############################################################################
|
|
|
|
RegisteredClass::RegisteredClass(ClassID class_id)
|
|
{
|
|
classID = class_id;
|
|
}
|
|
|
|
RegisteredClass::~RegisteredClass()
|
|
{
|
|
}
|
|
|
|
RegisteredClass::RegisteredClass(ObjectStream *stream)
|
|
{
|
|
ObjectID object_ID;
|
|
|
|
MemoryStream_Read(stream, &classID);
|
|
Verify(classID != NullClassID);
|
|
MemoryStream_Read(stream, &object_ID);
|
|
}
|
|
|
|
void RegisteredClass::BuildFromPage(ObjectStream *stream, NameList*, ClassID class_ID, ObjectID object_ID)
|
|
{
|
|
*stream << class_ID << object_ID;
|
|
}
|
|
|
|
Logical RegisteredClass::TestInstance() const
|
|
{
|
|
return true;
|
|
}
|
|
|
|
//
|
|
//#############################################################################
|
|
// GetClassID
|
|
//#############################################################################
|
|
//
|
|
RegisteredClass::ClassID RegisteredClass::GetClassID(const CString &class_name_string)
|
|
{
|
|
//
|
|
//--------------------------------------------------------------------------
|
|
// HACK - Class name lookup could be perfromed via registration, for now,
|
|
// use if statements
|
|
//--------------------------------------------------------------------------
|
|
//
|
|
#define COMPARE_AND_RETURN(class_name) if (!strcmp(class_name_string, #class_name)) return class_name##ClassID;
|
|
|
|
COMPARE_AND_RETURN(AudioStateTrigger);
|
|
COMPARE_AND_RETURN(AudioMotionScale);
|
|
COMPARE_AND_RETURN(AudioRenderer);
|
|
COMPARE_AND_RETURN(AudioLocation);
|
|
COMPARE_AND_RETURN(AudioMotionTrigger);
|
|
COMPARE_AND_RETURN(AudioControlMixer);
|
|
COMPARE_AND_RETURN(AudioHingeScale);
|
|
COMPARE_AND_RETURN(AudioControlSmoother);
|
|
COMPARE_AND_RETURN(AudioResourceSelector);
|
|
COMPARE_AND_RETURN(L4AudioCollisionTrigger);
|
|
COMPARE_AND_RETURN(AudioResourceIndex);
|
|
COMPARE_AND_RETURN(AudioScalarScale);
|
|
COMPARE_AND_RETURN(AudioControlSend);
|
|
COMPARE_AND_RETURN(L4AudioLocation);
|
|
COMPARE_AND_RETURN(DirectPatchSource);
|
|
COMPARE_AND_RETURN(Dynamic3DPatchSource);
|
|
COMPARE_AND_RETURN(PatchResource);
|
|
COMPARE_AND_RETURN(Static3DPatchSource);
|
|
COMPARE_AND_RETURN(AudioControlMultiplier);
|
|
COMPARE_AND_RETURN(AudioSampleAndHold);
|
|
COMPARE_AND_RETURN(AudioScalarTrigger);
|
|
COMPARE_AND_RETURN(AudioEnumerationTrigger);
|
|
COMPARE_AND_RETURN(AudioIntegerTrigger);
|
|
COMPARE_AND_RETURN(AudioLogicalTrigger);
|
|
COMPARE_AND_RETURN(AudioControlsButtonTrigger);
|
|
COMPARE_AND_RETURN(ExplosionResourceTable);
|
|
COMPARE_AND_RETURN(AudioIdleWatcher);
|
|
COMPARE_AND_RETURN(AudioControlEvent);
|
|
COMPARE_AND_RETURN(AudioControlSequence);
|
|
COMPARE_AND_RETURN(AudioControlSplitter);
|
|
COMPARE_AND_RETURN(AudioLFO);
|
|
COMPARE_AND_RETURN(AudioEnumerationDeltaTrigger);
|
|
COMPARE_AND_RETURN(AudioScalarDeltaTrigger);
|
|
COMPARE_AND_RETURN(AudioLevelOfDetail);
|
|
COMPARE_AND_RETURN(PatchLevelOfDetail);
|
|
COMPARE_AND_RETURN(AudioMessageWatcher);
|
|
COMPARE_AND_RETURN(AudioControlsButtonMessageWatcher);
|
|
|
|
//
|
|
// Etc...
|
|
//
|
|
|
|
return NullClassID;
|
|
}
|