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>
108 lines
3.5 KiB
C++
108 lines
3.5 KiB
C++
#pragma once
|
|
|
|
#include "slot.h"
|
|
#include "chain.h"
|
|
#include "renderer.h"
|
|
#include <vector>
|
|
|
|
#if defined(TRACE_VIDEO_RENDERER) || defined(USE_ONE_VIDEO_TRACE)
|
|
extern BitTrace Video_Renderer;
|
|
#endif
|
|
|
|
#if defined(TRACE_VIDEO_RENDERER)
|
|
#define SET_VIDEO_RENDERER() Video_Renderer.Set()
|
|
#define CLEAR_VIDEO_RENDERER() Video_Renderer.Clear()
|
|
#else
|
|
#define SET_VIDEO_RENDERER()
|
|
#define CLEAR_VIDEO_RENDERER()
|
|
#endif
|
|
|
|
#if defined(TRACE_VIDEO_BECOME_INTERESTING)
|
|
#if defined(USE_ONE_VIDEO_TRACE)
|
|
#define SET_VIDEO_BECOME_INTERESTING() Video_Renderer.Set()
|
|
#define CLEAR_VIDEO_BECOME_INTERESTING() Video_Renderer.Clear()
|
|
#else
|
|
extern BitTrace Video_Become_Interesting;
|
|
#define SET_VIDEO_BECOME_INTERESTING() Video_Become_Interesting.Set()
|
|
#define CLEAR_VIDEO_BECOME_INTERESTING()\
|
|
Video_Become_Interesting.Clear()
|
|
#endif
|
|
#else
|
|
#define SET_VIDEO_BECOME_INTERESTING()
|
|
#define CLEAR_VIDEO_BECOME_INTERESTING()
|
|
#endif
|
|
|
|
#if defined(TRACE_VIDEO_BECOME_UNINTERESTING)
|
|
#if defined(USE_ONE_VIDEO_TRACE)
|
|
#define SET_VIDEO_BECOME_UNINTERESTING() Video_Renderer.Set()
|
|
#define CLEAR_VIDEO_BECOME_UNINTERESTING() Video_Renderer.Clear()
|
|
#else
|
|
extern BitTrace Video_Become_Uninteresting;
|
|
#define SET_VIDEO_BECOME_UNINTERESTING()\
|
|
Video_Become_Uninteresting.Set()
|
|
#define CLEAR_VIDEO_BECOME_UNINTERESTING()\
|
|
Video_Become_Uninteresting.Clear()
|
|
#endif
|
|
#else
|
|
#define SET_VIDEO_BECOME_UNINTERESTING()
|
|
#define CLEAR_VIDEO_BECOME_UNINTERESTING()
|
|
#endif
|
|
|
|
class VideoRenderer : public Renderer
|
|
{
|
|
public:
|
|
VideoRenderer(RendererRate calibration_rate, RendererComplexity calibration_complexity, RendererPriority calibration_priority, InterestType interest_type, InterestDepth depth_calibration);
|
|
~VideoRenderer();
|
|
|
|
Logical TestInstance() const;
|
|
|
|
virtual void ConsolidateStaticObjects() = 0;
|
|
virtual std::vector<MONITORINFO> MonitorsCreateAll(int &count) = 0;
|
|
|
|
//
|
|
//--------------------------------------------------------------------
|
|
// NotifyOfNewInterestingEntity
|
|
//
|
|
// This method tells the renderer that a new entity will be in it's
|
|
// interest list the next time the Execute method is called.
|
|
//--------------------------------------------------------------------
|
|
//
|
|
void NotifyOfNewInterestingEntity(Entity *interesting_entity);
|
|
|
|
void NotifyOfBecomingUninterestingEntity(Entity *uninteresting_entity);
|
|
|
|
virtual int *GetSecondaryIndex() = 0;
|
|
virtual int *GetAux1Index() = 0;
|
|
virtual int *GetAux2Index() = 0;
|
|
|
|
private:
|
|
void LoadMissionImplementation(Mission *mission);
|
|
void ShutdownImplementation();
|
|
void SuspendImplementation();
|
|
void ResumeImplementation();
|
|
void ExecuteImplementation(RendererComplexity complexity_update, RendererOrigin::InterestingEntityIterator *iterator);
|
|
|
|
protected:
|
|
|
|
enum ViewFrom
|
|
{
|
|
outsideEntity, // The external view of an entity will be displayed
|
|
insideEntity, // The internal view of the entity will be displayed
|
|
collisionEntity // The collision solids of the entity will be displayed
|
|
};
|
|
|
|
//
|
|
//--------------------------------------------------------------------
|
|
// MakeEntityRenderables
|
|
//
|
|
// This method is called to create the renderables for a given entity
|
|
// it must be provided by the hardware specific renderer.
|
|
//--------------------------------------------------------------------
|
|
//
|
|
virtual void MakeEntityRenderables(Entity*, ResourceDescription*, ViewFrom);
|
|
|
|
Logical Disconnected_Eye; // If this is true, we will construct an outside
|
|
// version of the viewpoint entity. This is so
|
|
// higher level renderers can fix the eye in one
|
|
// spot and watch the viewpoint entity drive around.
|
|
}; |