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>
159 lines
5.7 KiB
C++
159 lines
5.7 KiB
C++
//===========================================================================//
|
|
// File: vdata.cc //
|
|
// Project: MUNGA Brick: Connection Library //
|
|
// Contents: Implementation details for registered classes and virtual data //
|
|
//---------------------------------------------------------------------------//
|
|
// Date Who Modification //
|
|
// -------- --- -----------------------------------------------------------//
|
|
// 11/03/94 ECH Initial coding. //
|
|
// 11/03/94 ECH Made compatible with BC4.0 //
|
|
// 11/08/94 ECH Made compatible with BC4.0 //
|
|
// 11/29/94 JMA Changed ClassIdentity to ClassID //
|
|
// 11/30/94 JMA Adapted to style changes //
|
|
// 12/01/94 JMA Made compatible with SGI CC //
|
|
// 12/12/94 ECH Changed class id access //
|
|
//---------------------------------------------------------------------------//
|
|
// Copyright (C) 1994-1995, Virtual World Entertainment, Inc. //
|
|
// All Rights reserved worldwide //
|
|
// This unpublished sourcecode is PROPRIETARY and CONFIDENTIAL //
|
|
//===========================================================================//
|
|
|
|
#include <munga.hpp>
|
|
#pragma hdrstop
|
|
|
|
#if !defined(VDATA_HPP)
|
|
#include <vdata.hpp>
|
|
#endif
|
|
|
|
#if !defined(OBJSTRM_HPP)
|
|
#include <objstrm.hpp>
|
|
#endif
|
|
|
|
//#############################################################################
|
|
//####################### RegisteredClass ###############################
|
|
//#############################################################################
|
|
|
|
//
|
|
//#############################################################################
|
|
// RegisteredClass
|
|
//#############################################################################
|
|
//
|
|
RegisteredClass::RegisteredClass(ClassID class_id)
|
|
{
|
|
classID = class_id;
|
|
}
|
|
|
|
//
|
|
//#############################################################################
|
|
// ~RegisteredClass
|
|
//#############################################################################
|
|
//
|
|
RegisteredClass::~RegisteredClass()
|
|
{
|
|
}
|
|
|
|
//
|
|
//#############################################################################
|
|
// RegisteredClass
|
|
//#############################################################################
|
|
//
|
|
RegisteredClass::RegisteredClass(ObjectStream *stream)
|
|
{
|
|
ObjectID object_ID;
|
|
|
|
MemoryStream_Read(stream, &classID);
|
|
Verify(classID != NullClassID);
|
|
MemoryStream_Read(stream, &object_ID);
|
|
}
|
|
|
|
//
|
|
//#############################################################################
|
|
// BuildFromPage
|
|
//#############################################################################
|
|
//
|
|
void
|
|
RegisteredClass::BuildFromPage(
|
|
ObjectStream *stream,
|
|
NameList*,
|
|
ClassID class_ID,
|
|
ObjectID object_ID
|
|
)
|
|
{
|
|
*stream << class_ID << object_ID;
|
|
}
|
|
|
|
//
|
|
//#############################################################################
|
|
// TestInstance
|
|
//#############################################################################
|
|
//
|
|
Logical
|
|
RegisteredClass::TestInstance() const
|
|
{
|
|
return True;
|
|
}
|
|
|
|
//
|
|
//#############################################################################
|
|
// GetClassID
|
|
//#############################################################################
|
|
//
|
|
RegisteredClass::ClassID
|
|
RegisteredClass::GetClassID(const CString &class_name_string)
|
|
{
|
|
//
|
|
//--------------------------------------------------------------------------
|
|
// HACK - Class name lookup could be perfromed via registration, for now,
|
|
// use if statements
|
|
//--------------------------------------------------------------------------
|
|
//
|
|
#define COMPARE_AND_RETURN(class_name)\
|
|
if (!strcmp(class_name_string, #class_name))\
|
|
return class_name##ClassID;
|
|
|
|
COMPARE_AND_RETURN(AudioStateTrigger);
|
|
COMPARE_AND_RETURN(AudioMotionScale);
|
|
COMPARE_AND_RETURN(AudioRenderer);
|
|
COMPARE_AND_RETURN(AudioLocation);
|
|
COMPARE_AND_RETURN(AudioMotionTrigger);
|
|
COMPARE_AND_RETURN(AudioControlMixer);
|
|
COMPARE_AND_RETURN(AudioHingeScale);
|
|
COMPARE_AND_RETURN(AudioControlSmoother);
|
|
COMPARE_AND_RETURN(AudioResourceSelector);
|
|
COMPARE_AND_RETURN(L4AudioCollisionTrigger);
|
|
COMPARE_AND_RETURN(AudioResourceIndex);
|
|
COMPARE_AND_RETURN(AudioScalarScale);
|
|
COMPARE_AND_RETURN(AudioControlSend);
|
|
COMPARE_AND_RETURN(L4AudioLocation);
|
|
COMPARE_AND_RETURN(DirectPatchSource);
|
|
COMPARE_AND_RETURN(Dynamic3DPatchSource);
|
|
COMPARE_AND_RETURN(PatchResource);
|
|
COMPARE_AND_RETURN(Static3DPatchSource);
|
|
COMPARE_AND_RETURN(AudioControlMultiplier);
|
|
COMPARE_AND_RETURN(AudioSampleAndHold);
|
|
COMPARE_AND_RETURN(AudioScalarTrigger);
|
|
COMPARE_AND_RETURN(AudioEnumerationTrigger);
|
|
COMPARE_AND_RETURN(AudioIntegerTrigger);
|
|
COMPARE_AND_RETURN(AudioLogicalTrigger);
|
|
COMPARE_AND_RETURN(AudioControlsButtonTrigger);
|
|
COMPARE_AND_RETURN(ExplosionResourceTable);
|
|
COMPARE_AND_RETURN(AudioIdleWatcher);
|
|
COMPARE_AND_RETURN(AudioControlEvent);
|
|
COMPARE_AND_RETURN(AudioControlSequence);
|
|
COMPARE_AND_RETURN(AudioControlSplitter);
|
|
COMPARE_AND_RETURN(AudioLFO);
|
|
COMPARE_AND_RETURN(AudioEnumerationDeltaTrigger);
|
|
COMPARE_AND_RETURN(AudioScalarDeltaTrigger);
|
|
COMPARE_AND_RETURN(AudioLevelOfDetail);
|
|
COMPARE_AND_RETURN(PatchLevelOfDetail);
|
|
COMPARE_AND_RETURN(AudioMessageWatcher);
|
|
COMPARE_AND_RETURN(AudioControlsButtonMessageWatcher);
|
|
|
|
//
|
|
// Etc...
|
|
//
|
|
|
|
return NullClassID;
|
|
}
|
|
|