Files
TeslaRel410/CODE/BT/BT/BTREG.CPP
T
CydandClaude Fable 5 fdd9ac9d97 Initial import: Tesla Release 4.10 (Tesla:BattleTech & Tesla:Red Planet)
Archival snapshot of the Virtual World Entertainment Tesla cockpit
software, 1994-1996: MUNGA engine and L4 pod layer source (Borland
C++ 5.0), BT/RP game code, and game content (models, audio, maps,
gauges, Division renderer data). Includes third-party libraries:
Division dVS/DPL graphics, HMI SOS audio, WATTCP networking.

Files are preserved byte-for-byte (.gitattributes disables all
line-ending conversion). README.md documents the layout, target
hardware, and toolchain.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-02 13:21:58 -05:00

163 lines
4.2 KiB
C++

//===========================================================================//
// File: btreg.cc //
// Project: MUNGA Brick: Registry Manager //
// Contents: Interface specification for Registry Manager //
//---------------------------------------------------------------------------//
// Date Who Modification //
// -------- --- ---------------------------------------------------------- //
// 11/22/94 ECH Initial coding. //
// 11/29/94 JMA Changed Identities to IDs //
//---------------------------------------------------------------------------//
// Copyright (C) 1994, Virtual World Entertainment, Inc. //
// All Rights reserved worldwide //
// This unpublished sourcecode is PROPRIETARY and CONFIDENTIAL //
//===========================================================================//
#include <bt.hpp>
#pragma hdrstop
#if !defined(BTREG_HPP)
# include <btreg.hpp>
#endif
#if !defined(BTPLAYER_HPP)
# include <btplayer.hpp>
#endif
#if !defined(BTDIRECT_HPP)
# include <btdirect.hpp>
#endif
//
// Registered classes...
//
#if !defined(MECH_HPP)
# include <mech.hpp>
#endif
#if !defined(PROJTILE_HPP)
# include <projtile.hpp>
#endif
#if !defined(MISSILE_HPP)
# include <missile.hpp>
#endif
#if !defined(BTTEAM_HPP)
# include <btteam.hpp>
#endif
//
//~~~~~~~~~~~~~~~~
// Munga Includes
//~~~~~~~~~~~~~~~~
//
#if !defined(BTMSSN_HPP)
# include <btmssn.hpp>
#endif
#if !defined(DIRECTOR_HPP)
# include <director.hpp>
#endif
#if !defined(HOSTMGR_HPP)
# include <hostmgr.hpp>
#endif
#if !defined(APP_HPP)
# include <app.hpp>
#endif
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Registry ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
//#############################################################################
// Registry
//#############################################################################
//
BTRegistry::BTRegistry(ResourceFile *)
{
}
//
//#############################################################################
// ~Registry
//#############################################################################
//
BTRegistry::~BTRegistry()
{
}
//
//#############################################################################
// GetStaticData
//#############################################################################
//
Entity::SharedData*
BTRegistry::GetStaticData(ClassID class_ID)
{
switch (class_ID)
{
case MechClassID:
return &Mech::DefaultData;
case ProjectileClassID:
return &Projectile::DefaultData;
case MissileClassID:
return &Missile::DefaultData;
case BTPlayerClassID:
return &BTPlayer::DefaultData;
case BTTeamClassID:
return &BTTeam::DefaultData;
default:
return Registry::GetStaticData(class_ID);
}
}
//
//#############################################################################
// GetStaticData
//#############################################################################
//
Player*
BTRegistry::MakePlayer(Mission *mission)
{
Check(this);
Check(mission);
BTMission *bt_mission = Cast_Object(BTMission *, mission);
if (strcmp(mission->GetGameModel(), "camera"))
{
BTPlayer::MakeMessage
make_player(
BTPlayer::MakeMessageID,
sizeof(BTPlayer::MakeMessage),
BTPlayerClassID,
EntityID::Null,
ResourceDescription::NullResourceID,
BTPlayer::DefaultFlags,
Origin::Identity,
mission->GetPlayerBitmapIndex(),
bt_mission->GetRoleName(),
bt_mission->GetTeamName()
);
return new BTPlayer(&make_player);
}
else
{
BTCameraDirector::MakeMessage create_director(
BTCameraDirector::MakeMessageID,
sizeof(BTCameraDirector::MakeMessage),
CameraDirectorClassID,
EntityID::Null,
ResourceDescription::NullResourceID,
BTCameraDirector::DefaultFlags,
Origin::Identity,
mission->GetPlayerBitmapIndex()
);
return new BTCameraDirector(&create_director);
}
}