Imports the current Win32 source for the pod-racing game 'Red Planet', built on the MUNGA engine and its L4 (Win32/DirectX) platform layer: - MUNGA / MUNGA_L4: cross-platform engine core and Win32 backend - RP / RP_L4: Red Planet game logic and Win32 application - DivLoader, Setup1: asset loader and installer project - lib, MUNGA_L4/openal, MUNGA_L4/sos: third-party audio dependencies Removed stale Subversion metadata and added .gitignore/.gitattributes. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
154 lines
3.6 KiB
C++
154 lines
3.6 KiB
C++
#include "rp.h"
|
|
#pragma hdrstop
|
|
|
|
#include "vtvsub.h"
|
|
#include "vtv.h"
|
|
#include "..\munga\app.h"
|
|
#include "vtvmppr.h"
|
|
|
|
VTVSubsystem::SharedData
|
|
VTVSubsystem::DefaultData(
|
|
VTVSubsystem::GetClassDerivations(),
|
|
VTVSubsystem::GetMessageHandlers(),
|
|
VTVSubsystem::GetAttributeIndex(),
|
|
VTVSubsystem::StateCount
|
|
);
|
|
|
|
Derivation* VTVSubsystem::GetClassDerivations()
|
|
{
|
|
static Derivation classDerivations(Subsystem::GetClassDerivations(), "VTVSubsystem");
|
|
return &classDerivations;
|
|
}
|
|
|
|
//#############################################################################
|
|
// Messaging Support
|
|
//
|
|
//const Receiver::HandlerEntry
|
|
// VTVSubsystem::MessageHandlerEntries[]=
|
|
//{
|
|
//};
|
|
//
|
|
//Receiver::MessageHandlerSet
|
|
// VTVSubsystem::MessageHandlers(
|
|
// ELEMENTS(VTVSubsystem::MessageHandlerEntries),
|
|
// VTVSubsystem::MessageHandlerEntries,
|
|
// Subsystem::MessageHandlers
|
|
// );
|
|
|
|
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
//
|
|
VTVSubsystem::VTVSubsystem(
|
|
VTV *entity,
|
|
int subsystem_ID,
|
|
SubsystemResource *model,
|
|
SharedData &shared_data,
|
|
// these two fields added 12-28-95 by cpb
|
|
void *control_destination,
|
|
Receiver::MessageID message_id
|
|
):
|
|
Subsystem(entity, subsystem_ID, model, shared_data)
|
|
{
|
|
controlDestination = control_destination;
|
|
controlMessageID = message_id;
|
|
Check_Fpu();
|
|
}
|
|
|
|
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
//
|
|
VTVSubsystem::~VTVSubsystem()
|
|
{
|
|
Check(this);
|
|
Check_Fpu();
|
|
}
|
|
|
|
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
//
|
|
Logical
|
|
VTVSubsystem::TestInstance() const
|
|
{
|
|
return IsDerivedFrom(*GetClassDerivations());
|
|
}
|
|
|
|
void
|
|
VTVSubsystem::EnterConfiguration(
|
|
ControlsButton *direct_target,
|
|
Receiver *receiver,
|
|
Receiver::MessageID active_message_id,
|
|
Receiver::MessageID config_message_id
|
|
)
|
|
{
|
|
Check(this);
|
|
|
|
Check(application);
|
|
ControlsManager
|
|
*controls_mgr = application->GetControlsManager();
|
|
Check(controls_mgr);
|
|
|
|
//-------------------------------------------
|
|
// Tell controls mgr that we're configuring
|
|
//-------------------------------------------
|
|
controls_mgr->StartMappableButtonsConfigure(
|
|
direct_target, // direct mapping (if used)
|
|
receiver, // targeted receiver
|
|
receiver, // dependant
|
|
active_message_id, // activation message ID (if used)
|
|
(ModeMask) 0, // remove_mode_mask
|
|
(ModeMask) 0 // add_mode_mask
|
|
);
|
|
|
|
//-----------------------------------------------------------
|
|
// Create temporary mappings for configuration
|
|
//-----------------------------------------------------------
|
|
Check(GetEntity());
|
|
|
|
VTVControlsMapper
|
|
*mapper = (VTVControlsMapper*) GetEntity()->GetSubsystem(
|
|
VTV::ControlsMapperSubsystem
|
|
);
|
|
|
|
if (mapper != NULL)
|
|
{
|
|
Check(mapper);
|
|
|
|
mapper->CreateTemporaryEventMappings(
|
|
receiver,
|
|
config_message_id
|
|
);
|
|
}
|
|
Check_Fpu();
|
|
}
|
|
|
|
void
|
|
VTVSubsystem::ExitConfiguration()
|
|
{
|
|
Check(application);
|
|
ControlsManager
|
|
*controls_mgr = application->GetControlsManager();
|
|
Check(controls_mgr);
|
|
|
|
//------------------------------------------------
|
|
// Tell controls mgr we're through
|
|
//------------------------------------------------
|
|
controls_mgr->StopMappableButtonsConfigure(
|
|
(ModeMask) 0, // remove_mode_mask
|
|
(ModeMask) 0 // add_mode_mask
|
|
);
|
|
//-----------------------------------------------------------
|
|
// Remove temporary mappings for configuration
|
|
//-----------------------------------------------------------
|
|
Check(GetEntity());
|
|
|
|
VTVControlsMapper
|
|
*mapper = (VTVControlsMapper*) GetEntity()->GetSubsystem(
|
|
VTV::ControlsMapperSubsystem
|
|
);
|
|
|
|
if (mapper != NULL)
|
|
{
|
|
Check(mapper);
|
|
|
|
mapper->RemoveTemporaryEventMappings();
|
|
}
|
|
Check_Fpu();
|
|
}
|