Files
arcattackandClaude Opus 4.8 7b7d465e5e Initial commit: bt411 -- standalone Windows BattleTech (Tesla 4.10 port)
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>
2026-07-05 21:03:40 -05:00

185 lines
4.3 KiB
C++

//===========================================================================//
// File: messmgr.hh //
// Project: BattleTech //
// Contents: Consolidates Messages from Subsystems and Graphics Generation //
//---------------------------------------------------------------------------//
// Date Who Modification //
// -------- --- ---------------------------------------------------------- //
// 09/30/95 JM Initial coding. //
//---------------------------------------------------------------------------//
// Copyright (C) 1995, Virtual World Entertainment, Inc. All Rights reserved //
// PROPRIETARY AND CONFIDENTIAL //
//===========================================================================//
#if !defined (MESSMGR_HPP)
# define MESSMGR_HPP
#if !defined (SUBSYSTM_HPP)
# include <subsystm.hpp>
#endif
#if !defined (RESOURCE_HPP)
# include <resource.hpp>
#endif
#if !defined (VCHAIN_HPP)
# include <vchain.hpp>
#endif
#if !defined (PLUG_HPP)
# include <plug.hpp>
#endif
#if !defined(ENTITYID_HPP)
# include <entityid.hpp>
#endif
class Entity;
class Mech;
class Entity__TakeDamageMessage;
//##########################################################################
//########## SubsystemMessageManager::SubsystemResource ###############
//##########################################################################
struct SubsystemMessageManager__SubsystemResource :
public Subsystem::SubsystemResource
{
ResourceDescription::ResourceID
terrainHitExplosionID;
Scalar
rendererCompensateTime;
};
//##########################################################################
//##################### SubsystemMessageManager ###################
//##########################################################################
class
SubsystemMessageManager :
public Subsystem
{
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Shared Data Support
//
public:
static Derivation ClassDerivations;
static SharedData DefaultData;
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Death and Damage Support
//
public:
void DeathReset(Logical) {}
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Model Support
//
protected:
struct CommonDamageInformation
{
Entity
*entityHit;
int
damageZoneIndex;
Point3D
impactPoint;
} commonDamageInformation;
public:
struct DamageInformation
: public Plug
{
Enumeration
damageType;
int
subsystemID;
};
typedef void
(SubsystemMessageManager::*Performance)(Scalar time_slice);
void
SetPerformance(Performance performance)
{
Check(this);
activePerformance = (Simulation::Performance)performance;
}
void
ConsolidateAndSendDamage(Scalar time_slice);
Mech*
GetEntity()
{Check(this); return Cast_Object(Mech*, Subsystem::GetEntity());}
protected:
Scalar
rendererCompensateTime;
typedef PlugOf<ResourceDescription::ResourceID>
ResourceIDPlug;
VChainOf<ResourceIDPlug*, ResourceDescription::ResourceID>
weaponExplosions;
VChainOf<DamageInformation*, Scalar> damageInformation;
ResourceDescription::ResourceID
terrainHitExplosionID;
void
CreateWeaponExplosions(
Logical terrain_hit,
EntityID entity_hit,
Point3D explode_position
);
public:
void
AddDamageMessage(
Entity *damaged_entity,
Entity__TakeDamageMessage *message
);
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Construction and Destruction Support
//
public:
typedef SubsystemMessageManager__SubsystemResource SubsystemResource;
SubsystemMessageManager(
Mech *owner,
int subsystem_ID,
SubsystemResource *sub_res,
SharedData &shared_data=DefaultData
);
~SubsystemMessageManager();
Logical
TestInstance() const;
static Logical
CreateStreamedSubsystem(
ResourceFile *resource_file,
NotationFile *model_file,
const char *model_name,
const char *subsystem_name,
SubsystemResource *subsystem_resource,
NotationFile *subsystem_file,
const ResourceDirectories *directories
);
};
#endif