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>
177 lines
4.1 KiB
C++
177 lines
4.1 KiB
C++
#pragma once
|
|
|
|
#include "network.h"
|
|
#include "lattice.h"
|
|
|
|
class Entity;
|
|
|
|
class InterestOrigin:
|
|
public Node
|
|
{
|
|
friend class InterestManager;
|
|
|
|
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
// Destructor, and Testing
|
|
//
|
|
public:
|
|
~InterestOrigin();
|
|
|
|
Logical
|
|
TestInstance() const;
|
|
|
|
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
// Update
|
|
//
|
|
public:
|
|
//
|
|
//-----------------------------------------------------------------------
|
|
// Update
|
|
//
|
|
// Updates the interest origins internal data structures for the
|
|
// interest zone ID. This method is most likely called by the
|
|
// renderer manager.
|
|
//-----------------------------------------------------------------------
|
|
//
|
|
virtual void
|
|
Update(InterestZoneID interest_zone_ID);
|
|
|
|
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
// Accessors
|
|
//
|
|
private:
|
|
InterestZoneID
|
|
GetInterestZoneID();
|
|
|
|
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
// Constructor
|
|
//
|
|
protected:
|
|
InterestOrigin(
|
|
InterestZoneID interest_zone_ID,
|
|
InterestType interest_type,
|
|
InterestDepth depth_calibration
|
|
);
|
|
|
|
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
// Interest Manager support
|
|
//
|
|
private:
|
|
virtual void
|
|
AddInterestingEntity(Entity *interesting_entity);
|
|
virtual void
|
|
RemoveUninterestingEntity(Entity *uninteresting_entity);
|
|
virtual void
|
|
RemoveUninterestingEntities();
|
|
|
|
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
// Private data
|
|
//
|
|
private:
|
|
InterestZoneID
|
|
interestZoneID;
|
|
InterestType
|
|
interestType;
|
|
InterestDepth
|
|
depthCalibration;
|
|
SlotOf<InterestArena*>
|
|
interestArenaSocket;
|
|
};
|
|
|
|
//~~~~~~~~~~~~~~~~~~~~~~~ InterestOrigin inlines ~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
inline InterestZoneID
|
|
InterestOrigin::GetInterestZoneID()
|
|
{
|
|
Check(this);
|
|
return interestZoneID;
|
|
}
|
|
|
|
#if 0
|
|
//##########################################################################
|
|
//####################### InterestOrigin #############################
|
|
//##########################################################################
|
|
|
|
class InterestOrigin:
|
|
public Node
|
|
{
|
|
friend class InterestManager;
|
|
friend class InterestOrigin__InterestingEntityIterator;
|
|
|
|
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
// Public types
|
|
//
|
|
public:
|
|
typedef InterestOrigin__InterestingEntityIterator
|
|
InterestingEntityIterator;
|
|
|
|
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
// Constructor, Destructor, and Testing
|
|
//
|
|
public:
|
|
InterestOrigin(
|
|
const EntityID &entity_ID,
|
|
InterestType interest_type,
|
|
InterestDepth depth_calibration
|
|
);
|
|
~InterestOrigin();
|
|
|
|
Logical
|
|
TestInstance() const;
|
|
|
|
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
// Renderer support
|
|
//
|
|
public:
|
|
//
|
|
//--------------------------------------------------------------------
|
|
// UpdateInterestOrigin
|
|
//
|
|
// Updates the interest managers internal data structures for the
|
|
// interest origin entity. This method is most likely called by the
|
|
// renderer manager. It prepares the data that will be accessed by
|
|
// InterestingEntityIterator.
|
|
//--------------------------------------------------------------------
|
|
//
|
|
virtual void
|
|
Update();
|
|
|
|
InterestArena*
|
|
GetInterestArena();
|
|
|
|
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
// Interest Manager support
|
|
//
|
|
protected:
|
|
virtual void
|
|
AddInterestingEntity(Entity *interesting_entity);
|
|
virtual void
|
|
RemoveUninterestingEntity(Entity *uninteresting_entity);
|
|
virtual void
|
|
RemoveUninterestingEntities();
|
|
|
|
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
// Private data
|
|
//
|
|
private:
|
|
EntityID
|
|
entityID;
|
|
InterestType
|
|
interestType;
|
|
InterestDepth
|
|
depthCalibration;
|
|
SlotOf<InterestArena*>
|
|
interestArenaSocket;
|
|
SChainOf<Entity*>
|
|
interestingEntitySocket;
|
|
};
|
|
|
|
//~~~~~~~~~~~~~~~~~~~~~~~~ InterestOrigin inlines ~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
inline InterestArena*
|
|
InterestOrigin::GetInterestArena()
|
|
{
|
|
Check(this);
|
|
return interestArenaSocket.GetCurrent();
|
|
}
|
|
#endif
|