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>
199 lines
5.1 KiB
Plaintext
199 lines
5.1 KiB
Plaintext
//===========================================================================//
|
|
// File: watcher.tst //
|
|
// Project: MUNGA Brick: //
|
|
// Contents: //
|
|
//---------------------------------------------------------------------------//
|
|
// Date Who Modification //
|
|
// -------- --- ---------------------------------------------------------- //
|
|
// 01/03/94 ECH Initial coding. //
|
|
//---------------------------------------------------------------------------//
|
|
// Copyright (C) 1994, Virtual World Entertainment, Inc. //
|
|
// All Rights reserved worldwide //
|
|
// This unpublished sourcecode is PROPRIETARY and CONFIDENTIAL //
|
|
//===========================================================================//
|
|
|
|
#include "entity.thp"
|
|
|
|
#if 0
|
|
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
//
|
|
class WatcherReceiver:
|
|
public Receiver
|
|
{
|
|
//#############################################################################
|
|
// Shared Data Support
|
|
//
|
|
public:
|
|
SharedData*
|
|
GetSharedData()
|
|
{return (SharedData*)sharedData;}
|
|
|
|
static Derivation ClassDerivations;
|
|
static SharedData DefaultData;
|
|
|
|
//##########################################################################
|
|
// Message Support
|
|
//
|
|
private:
|
|
static const HandlerEntry MessageHandlerEntries[];
|
|
|
|
protected:
|
|
static MessageHandlerSet MessageHandlers;
|
|
|
|
public:
|
|
void WatcherChangedHandler(WatcherChangedMessage *message);
|
|
|
|
//##########################################################################
|
|
// Testing Support
|
|
//
|
|
public:
|
|
ReceiverAttributeWatcherOf<Origin>
|
|
*linearOriginWatcher;
|
|
|
|
void
|
|
Tester();
|
|
|
|
//##########################################################################
|
|
// Construction and Destruction
|
|
//
|
|
public:
|
|
WatcherReceiver(SharedData &virtual_data = DefaultData);
|
|
~WatcherReceiver();
|
|
};
|
|
|
|
//#############################################################################
|
|
// Shared Data Support
|
|
//
|
|
Derivation
|
|
WatcherReceiver::ClassDerivations(Entity::ClassDerivations,"WatcherReceiver");
|
|
|
|
WatcherReceiver::SharedData
|
|
WatcherReceiver::DefaultData(
|
|
WatcherReceiver::ClassDerivations,
|
|
WatcherReceiver::MessageHandlers
|
|
);
|
|
|
|
//#############################################################################
|
|
// Message Support
|
|
//
|
|
const Receiver::HandlerEntry
|
|
WatcherReceiver::MessageHandlerEntries[]=
|
|
{
|
|
{
|
|
WatcherReceiver::WatcherChangedMessageID,
|
|
(WatcherReceiver::Handler)&WatcherReceiver::WatcherChangedHandler
|
|
}
|
|
};
|
|
|
|
WatcherReceiver::MessageHandlerSet
|
|
WatcherReceiver::MessageHandlers(
|
|
ELEMENTS(WatcherReceiver::MessageHandlerEntries),
|
|
WatcherReceiver::MessageHandlerEntries,
|
|
WatcherReceiver::MessageHandlers
|
|
);
|
|
|
|
void
|
|
WatcherReceiver::WatcherChangedHandler(WatcherChangedMessage *message)
|
|
{
|
|
Check(message);
|
|
Check(message->changedWatcher);
|
|
Check(message->changedWatcher->GetLinkedSystem());
|
|
Verify(
|
|
message->changedWatcher->GetAttributeID() ==
|
|
Entity::LocalOriginAttributeID
|
|
);
|
|
};
|
|
|
|
//#############################################################################
|
|
// Construction and Destruction
|
|
//
|
|
|
|
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
//
|
|
WatcherReceiver::WatcherReceiver(WatcherReceiver::SharedData &virtual_data):
|
|
Receiver(TrivialReceiverClassID, virtual_data)
|
|
{
|
|
linearOriginWatcher = NULL;
|
|
}
|
|
|
|
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
//
|
|
WatcherReceiver::~WatcherReceiver()
|
|
{
|
|
}
|
|
|
|
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
//
|
|
void
|
|
WatcherReceiver::Tester()
|
|
{
|
|
}
|
|
|
|
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
//
|
|
Logical
|
|
AttributeWatcher::TestClass()
|
|
{
|
|
DEBUG_STREAM << "Starting Watcher test...\n";
|
|
|
|
//
|
|
//--------------
|
|
// Create testEntity
|
|
//--------------
|
|
//
|
|
TestEntity::MakeMessage
|
|
message(
|
|
TestEntity::MakeMessageID,
|
|
sizeof(TestEntity::MakeMessage),
|
|
TestEntity::TrivialEntityClassID,
|
|
0,
|
|
TestEntity::DefaultFlags,
|
|
Origin::Identity
|
|
);
|
|
TestEntity *testEntity = TestEntity::Make(&message);
|
|
Register_Object(testEntity);
|
|
|
|
//
|
|
//------------------------
|
|
// Create watcher receiver
|
|
//------------------------
|
|
//
|
|
WatcherReceiver
|
|
watcherReceiver;
|
|
|
|
//
|
|
//---------------
|
|
// Create watcher
|
|
//---------------
|
|
//
|
|
watcherReceiver.linearOriginWatcher =
|
|
new ReceiverAttributeWatcherOf<Origin>(
|
|
testEntity,
|
|
Entity::LocalOriginAttributeID,
|
|
True,
|
|
&watcherReceiver
|
|
);
|
|
Register_Object(watcherReceiver.linearOriginWatcher);
|
|
|
|
//
|
|
//-------------
|
|
// Test watcher
|
|
//-------------
|
|
//
|
|
testEntity->Tester();
|
|
Test(testEntity->localOrigin.linearPosition == Point3D(2.0f,2.0f,2.0f));
|
|
Check(application);
|
|
application->ProcessAllEvents();
|
|
|
|
//
|
|
//-----------------
|
|
// Test destruction
|
|
//-----------------
|
|
//
|
|
Unregister_Object(testEntity);
|
|
delete testEntity;
|
|
|
|
return True;
|
|
}
|
|
#endif
|