Files
TeslaRel410/restoration/source410/BT_L4/BTL4VID.CPP
T
CydandClaude Fable 5 ed7843b89f BT410 5.3.49: first renderable answer -- BTPlayer, and the pod stops complaining
BTL4VideoRenderer now overrides MakeEntityRenderables.  Class 3035 resolves
to BTPlayerClassID (the BT enum block starts at 3000 in VDATA.HPP), and a
player carries no graphics -- exactly what the engine already does for its
own PlayerClassID with an empty case.  Everything else chains to DPLRenderer,
so the override can only add answers.

On the pod: the 'couldn't figure out how to MakeEntityRenderables' complaint
is gone and the run no longer exits, it keeps running.  It still renders
nothing -- the wire fifodump grows at ~24 bytes/sec, keep-alive rather than a
frame stream -- which is expected, since only the player has been answered
and the mech and arena still have no renderables.

Banked a practical problem worth fixing before the next session: a pod run
that does NOT crash produces no readable log, because the conf redirects the
game's stdout and DOS buffers it.  Every readable log this session came from
a run that crashed and had its buffer flushed by the fault handler.  The
RC.TXT marker (a separate command) survives that, and the com3/serial3=file
trick from the emulator notes would give live unbuffered output -- worth
wiring in, otherwise progress is invisible precisely when things are going
well.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-28 08:34:44 -05:00

119 lines
4.5 KiB
C++

//===========================================================================//
// File: btl4vid.cpp //
// Project: BattleTech //
// Contents: Implementation details for the BT video renderer //
//---------------------------------------------------------------------------//
// Copyright (C) 1995, Virtual World Entertainment, Inc. //
// All Rights reserved worldwide //
// This unpublished sourcecode is PROPRIETARY and CONFIDENTIAL //
//===========================================================================//
#include <btl4.hpp>
#pragma hdrstop
#if !defined(BTL4VID_HPP)
# include <btl4vid.hpp>
#endif
BTL4VideoRenderer::BTL4VideoRenderer(
RendererRate calibration_rate,
RendererComplexity calibration_complexity,
RendererPriority calibration_priority,
InterestType interest_type,
InterestDepth depth_calibration
):
DPLRenderer(
calibration_rate,
calibration_complexity,
calibration_priority,
interest_type,
depth_calibration
)
{
}
BTL4VideoRenderer::~BTL4VideoRenderer()
{
}
//
//#############################################################################
// LoadMissionImplementation -- called by Renderer::LoadMission (the authentic
// engine, CODE/RP/MUNGA/RENDERER.CPP:263) after it has set
// LoadingRendererStatus, stamped nextRenderTime and started the renderer with
// the RendererManager. This is where a GAME renderer builds the mission's
// scene content on the Division board.
//
// BRING-UP NO-OP (phase 1 of the btl4vid ladder). A no-op is a LEGAL body
// here, not a cheat: the engine's own VideoRenderer::LoadMissionImplementation
// (CODE/RP/MUNGA/VIDREND.CPP:259) is a bare Tell, and our GaugeRenderer
// (GAUGREND.CPP:3275) ships the same. The renderer therefore comes up and
// runs its frame loop with an EMPTY scene, which is exactly what we want to
// measure before writing any content.
//
// THE AUTHENTIC SHAPE, pinned by the surviving sibling header for Red
// Planet's renderer (CODE/RP/RP_L4/RPL4VID.HPP -- same engine, same board,
// same year; only the .CPP is missing there too):
//
// LoadMissionImplementation walks the mission's entities and calls
// MakeEntityRenderables(entity, model_resource, view_type) for each,
// which builds a dpl_DCS hierarchy through ReadSKLFile /
// RecurseSKLFile (the skeleton notation pages), with a material
// substitution list set up around it.
//
// The BT-specific renderables (BTReticleRenderable, BTTranslocationRenderable,
// the pending-wrecks map) come from the BT411 donor game/reconstructed/
// btl4vid.cpp -- 3188 lines -- but NOTE that port restructured this hook and
// has no method under this name, so the CONTRACT above comes from the 1995
// engine and only the CONTENT comes from the donor.
//#############################################################################
//
//
//#############################################################################
// MakeEntityRenderables -- the game level of the renderable factory.
//
// The engine's DPLRenderer::MakeEntityRenderables (L4VIDEO.CPP:4151) knows
// the ENGINE entity classes and calls DOWN to
// VideoRenderer::MakeEntityRenderables for anything else, which only prints
// Entity <id> class<n> couldn't figure out how to MakeEntityRenderables
// So every BT class has to be answered here.
//
// FIRST ANSWER: BTPlayer (class 3035) carries no graphics. The engine
// already does exactly this for its own PlayerClassID -- an empty case --
// and BT's player is simply a different id it cannot know about. This is
// the class the live pod run complained about.
//
// Everything else still chains to the engine, so this override can only
// ADD answers, never remove the ones DPLRenderer already gives.
//#############################################################################
//
void
BTL4VideoRenderer::MakeEntityRenderables(
Entity *entity,
ResourceDescription *model_resource,
ViewFrom view_type)
{
Check(this);
Check(entity);
switch (entity->GetClassID())
{
case RegisteredClass::BTPlayerClassID:
//
// No graphics -- the player is a control/scoring entity.
//
break;
default:
DPLRenderer::MakeEntityRenderables(entity, model_resource, view_type);
break;
}
}
void
BTL4VideoRenderer::LoadMissionImplementation(Mission *)
{
Check(this);
Tell("BTL4VideoRenderer::LoadMissionImplementation -- empty scene (bring-up)\n");
}