Files
BT411/game/original/BT_L4/BTL4MODE.HPP
T
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

153 lines
4.3 KiB
C++

//===========================================================================//
// File: btl4mode.hpp //
// Project: Battletech //
// Contents: BTL4 controls //
//---------------------------------------------------------------------------//
// Date Who Modification //
// -------- --- ---------------------------------------------------------- //
// 02/13/96 CPB Initial coding. //
//---------------------------------------------------------------------------//
// Copyright (C) 1996, Virtual World Entertainment, Inc. //
// All Rights reserved worldwide //
// This unpublished sourcecode is PROPRIETARY and CONFIDENTIAL //
//===========================================================================//
#if !defined(BTL4MODE_HPP)
# define BTL4MODE_HPP
# if !defined(MODE_HPP)
# include <mode.hpp>
# endif
//#########################################################################
//########################## BTL4ControlsManager ##########################
//#########################################################################
class BTL4ModeManager:
public ModeManager
{
public:
enum
{
};
//-------------------------------------------------------------------
// Construction/destruction/verification
//-------------------------------------------------------------------
public:
BTL4ModeManager(ModeMask initial_mask):
ModeManager(initial_mask)
{}
//-------------------------------------------------------------------
// Mode control
//-------------------------------------------------------------------
enum
{
ModeMFD1QuadBit = ModeManager::nextModeBit,
ModeMFD1Eng1Bit,
ModeMFD1Eng2Bit,
ModeMFD1Eng3Bit,
ModeMFD1Eng4Bit,
ModeMFD2QuadBit,
ModeMFD2Eng1Bit,
ModeMFD2Eng2Bit,
ModeMFD2Eng3Bit,
ModeMFD2Eng4Bit,
ModeMFD3QuadBit,
ModeMFD3Eng1Bit,
ModeMFD3Eng2Bit,
ModeMFD3Eng3Bit,
ModeMFD3Eng4Bit,
ModeMappingBit,
ModeNonMappingBit,
ModeIntercomBit,
ModeSecondaryDamageBit,
ModeSecondaryCriticalBit,
ModeSecondaryHeatBit,
ModeEjectBit,
ModePlasmaDisplayBit,
};
enum
{
// These 5 mutually exclusive
ModeMFD1Quad = 1L<<ModeMFD1QuadBit,
ModeMFD1Eng1 = 1L<<ModeMFD1Eng1Bit,
ModeMFD1Eng2 = 1L<<ModeMFD1Eng2Bit,
ModeMFD1Eng3 = 1L<<ModeMFD1Eng3Bit,
ModeMFD1Eng4 = 1L<<ModeMFD1Eng4Bit,
// These 5 mutually exclusive
ModeMFD2Quad = 1L<<ModeMFD2QuadBit,
ModeMFD2Eng1 = 1L<<ModeMFD2Eng1Bit,
ModeMFD2Eng2 = 1L<<ModeMFD2Eng2Bit,
ModeMFD2Eng3 = 1L<<ModeMFD2Eng3Bit,
ModeMFD2Eng4 = 1L<<ModeMFD2Eng4Bit,
// These 5 mutually exclusive
ModeMFD3Quad = 1L<<ModeMFD3QuadBit,
ModeMFD3Eng1 = 1L<<ModeMFD3Eng1Bit,
ModeMFD3Eng2 = 1L<<ModeMFD3Eng2Bit,
ModeMFD3Eng3 = 1L<<ModeMFD3Eng3Bit,
ModeMFD3Eng4 = 1L<<ModeMFD3Eng4Bit,
// These two mutually exclusive
ModeMapping = 1L<<ModeMappingBit,
ModeNonMapping= 1L<<ModeNonMappingBit,
ModeIntercom = 1L<<ModeIntercomBit,
// These three mutually exclusive
ModeSecondaryDamage = 1L<<ModeSecondaryDamageBit,
ModeSecondaryCritical= 1L<<ModeSecondaryCriticalBit,
ModeSecondaryHeat = 1L<<ModeSecondaryHeatBit,
ModeEject = 1L<<ModeEjectBit,
ModePlasmaDisplay = 1L<<ModePlasmaDisplayBit
};
// Useful combinations
enum
{
ModeInitial =
ModeMFD1Quad|ModeMFD2Quad|ModeMFD3Quad|ModeNonMapping|
ModeSecondaryDamage,
ModeNonConfig =
ModeNonMapping,
ModeMFD1NonQuad =
ModeMFD1Eng1|ModeMFD1Eng2|ModeMFD1Eng3|ModeMFD1Eng4,
ModeMFD1All =
ModeMFD1Quad|ModeMFD1NonQuad,
ModeMFD2NonQuad =
ModeMFD2Eng1|ModeMFD2Eng2|ModeMFD2Eng3|ModeMFD2Eng4,
ModeMFD2All =
ModeMFD2Quad|ModeMFD2NonQuad,
ModeMFD3NonQuad =
ModeMFD3Eng1|ModeMFD3Eng2|ModeMFD3Eng3|ModeMFD3Eng4,
ModeMFD3All =
ModeMFD3Quad|ModeMFD3NonQuad,
ModeSecondaryAll =
ModeSecondaryDamage|ModeSecondaryCritical|ModeSecondaryHeat
};
Logical // defined as virtual in MODE.HPP
ModeStringLookup(const char *name, ModeMask *returned_value);
};
#endif