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>
232 lines
6.4 KiB
C++
232 lines
6.4 KiB
C++
//===========================================================================//
|
|
// File: l4audrnd.hh //
|
|
// Project: MUNGA Brick: Audio Renderer Manager //
|
|
// Contents: //
|
|
//---------------------------------------------------------------------------//
|
|
// Date Who Modification //
|
|
// -------- --- ---------------------------------------------------------- //
|
|
// 01/30/95 ECH Initial coding. //
|
|
//---------------------------------------------------------------------------//
|
|
// Copyright (C) 1994, Virtual World Entertainment, Inc. //
|
|
// All Rights reserved worldwide //
|
|
// This unpublished sourcecode is PROPRIETARY and CONFIDENTIAL //
|
|
//===========================================================================//
|
|
|
|
#if !defined(L4AUDRND_HPP)
|
|
# define L4AUDRND_HPP
|
|
|
|
# if !defined(AUDREND_HPP)
|
|
# include <audrend.hpp>
|
|
# endif
|
|
|
|
# if !defined(L4AUDHDW_HPP)
|
|
# include <l4audhdw.hpp>
|
|
# endif
|
|
|
|
# if !defined(L4AUDIO_HPP)
|
|
# include <l4audio.hpp>
|
|
# endif
|
|
|
|
# if !defined(L4AUDRES_HPP)
|
|
# include <l4audres.hpp>
|
|
# endif
|
|
|
|
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ L4AudioRenderer ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
class L4AudioRenderer:
|
|
public AudioRenderer
|
|
{
|
|
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
// Construction, Destruction, Testing
|
|
//
|
|
public:
|
|
L4AudioRenderer(
|
|
RendererRate render_rate,
|
|
Logical mission_review_mode
|
|
);
|
|
~L4AudioRenderer();
|
|
|
|
Logical
|
|
TestInstance() const;
|
|
|
|
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
// Renderer support
|
|
//
|
|
public:
|
|
void
|
|
Initialize();
|
|
|
|
void
|
|
NotifyOfNewInterestingEntity(Entity *interesting_entity);
|
|
void
|
|
NotifyOfBecomingUninterestingEntity(Entity *uninteresting_entity);
|
|
|
|
protected:
|
|
void
|
|
ExecuteImplementation(
|
|
RendererComplexity complexity_update,
|
|
RendererOrigin::InterestingEntityIterator *iterator
|
|
);
|
|
|
|
private:
|
|
void
|
|
LoadMissionImplementation(Mission *mission);
|
|
void
|
|
ShutdownImplementation();
|
|
void
|
|
SuspendImplementation();
|
|
void
|
|
ResumeImplementation();
|
|
|
|
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
// Audio hardware accessors
|
|
//
|
|
public:
|
|
AudioCard*
|
|
GetFrontCard();
|
|
AudioCard*
|
|
GetRearCard();
|
|
|
|
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
// Audio Source support
|
|
//
|
|
public:
|
|
void
|
|
StartRequest(L4AudioSource *audio_source);
|
|
void
|
|
StopRequest(L4AudioSource *audio_source);
|
|
|
|
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
// Private methods
|
|
//
|
|
private:
|
|
void
|
|
CalculateMix();
|
|
void
|
|
RunningSourceCheckup();
|
|
//void
|
|
// RunningAudioSourceSort();
|
|
void
|
|
DormantSourceCheckup();
|
|
void
|
|
AudioSourceStopMaintenance(L4AudioSource *source);
|
|
void
|
|
AudioSourceSuspendMaintenance(L4AudioSource *source);
|
|
|
|
Logical
|
|
RequestAudioResources(
|
|
L4AudioSource *audio_source,
|
|
AudioChannelSet *channel_set_result
|
|
);
|
|
Logical
|
|
RequestAudioChannels(
|
|
AudioVoiceCount voices_requested,
|
|
AudioChannelSet *channel_set_request
|
|
);
|
|
|
|
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
// Private data
|
|
//
|
|
private:
|
|
Logical
|
|
missionReviewMode;
|
|
|
|
AudioHardware
|
|
audioHardware;
|
|
L4AudioResourceManager
|
|
audioResourceManager;
|
|
|
|
AudioFrameCount
|
|
nextCalculateMixFrame;
|
|
|
|
typedef VChainOf<L4AudioSource*, AudioWeighting>
|
|
RunningSourceSocket;
|
|
typedef VChainIteratorOf<L4AudioSource*, AudioWeighting>
|
|
RunningSourceIterator;
|
|
|
|
RunningSourceSocket
|
|
runningAudioSourceSocket;
|
|
|
|
typedef ChainOf<L4AudioSource*>
|
|
DormantSourceSocket;
|
|
typedef ChainIteratorOf<L4AudioSource*>
|
|
DormantSourceIterator;
|
|
|
|
DormantSourceSocket
|
|
dormantAudioSourceSocket;
|
|
|
|
typedef VChainOf<L4AudioSource*, Enumeration>
|
|
MixingSourceSocket;
|
|
typedef VChainIteratorOf<L4AudioSource*, Enumeration>
|
|
MixingSourceIterator;
|
|
|
|
MixingSourceSocket
|
|
mixingAudioSourceSocket;
|
|
};
|
|
|
|
//~~~~~~~~~~~~~~~~~~~~~~~~~ L4AudioRenderer inlines ~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
inline AudioCard*
|
|
L4AudioRenderer::GetFrontCard()
|
|
{
|
|
Check(this);
|
|
return audioHardware.GetFrontCard();
|
|
}
|
|
|
|
inline AudioCard*
|
|
L4AudioRenderer::GetRearCard()
|
|
{
|
|
Check(this);
|
|
return audioHardware.GetRearCard();
|
|
}
|
|
|
|
//~~~~~~~~~~~~~~~~~~~~~~ L4AudioRenderer profile macros ~~~~~~~~~~~~~~~~~~~~
|
|
|
|
#if defined(TRACE_AUDIO_RENDERER_RUNNING_SOURCES)
|
|
extern BitTrace Audio_Renderer_Running_Sources;
|
|
#define SET_AUDIO_RUNNING_SOURCES() Audio_Renderer_Running_Sources.Set()
|
|
#define CLEAR_AUDIO_RUNNING_SOURCES() Audio_Renderer_Running_Sources.Clear()
|
|
#else
|
|
#define SET_AUDIO_RUNNING_SOURCES()
|
|
#define CLEAR_AUDIO_RUNNING_SOURCES()
|
|
#endif
|
|
|
|
#if defined(TRACE_AUDIO_RENDERER_RUNNING_SORT)
|
|
extern BitTrace Audio_Renderer_Running_Sort;
|
|
#define SET_AUDIO_RUNNING_SORT() Audio_Renderer_Running_Sort.Set()
|
|
#define CLEAR_AUDIO_RUNNING_SORT() Audio_Renderer_Running_Sort.Clear()
|
|
#else
|
|
#define SET_AUDIO_RUNNING_SORT()
|
|
#define CLEAR_AUDIO_RUNNING_SORT()
|
|
#endif
|
|
|
|
#if defined(TRACE_AUDIO_RENDERER_CALCULATE_MIX)
|
|
extern BitTrace Audio_Renderer_Calculate_Mix;
|
|
#define SET_AUDIO_CALCULATE_MIX() Audio_Renderer_Calculate_Mix.Set()
|
|
#define CLEAR_AUDIO_CALCULATE_MIX() Audio_Renderer_Calculate_Mix.Clear()
|
|
#else
|
|
#define SET_AUDIO_CALCULATE_MIX()
|
|
#define CLEAR_AUDIO_CALCULATE_MIX()
|
|
#endif
|
|
|
|
#if defined(TRACE_AUDIO_RENDERER_EXECUTE_SOURCES)
|
|
extern BitTrace Audio_Renderer_Execute_Sources;
|
|
#define SET_AUDIO_EXECUTE_SOURCES() Audio_Renderer_Execute_Sources.Set()
|
|
#define CLEAR_AUDIO_EXECUTE_SOURCES() Audio_Renderer_Execute_Sources.Clear()
|
|
#else
|
|
#define SET_AUDIO_EXECUTE_SOURCES()
|
|
#define CLEAR_AUDIO_EXECUTE_SOURCES()
|
|
#endif
|
|
|
|
#if defined(TRACE_AUDIO_RENDERER_DORMANT_SOURCES)
|
|
extern BitTrace Audio_Renderer_Dormant_Sources;
|
|
#define SET_AUDIO_DORMANT_SOURCES() Audio_Renderer_Dormant_Sources.Set()
|
|
#define CLEAR_AUDIO_DORMANT_SOURCES() Audio_Renderer_Dormant_Sources.Clear()
|
|
#else
|
|
#define SET_AUDIO_DORMANT_SOURCES()
|
|
#define CLEAR_AUDIO_DORMANT_SOURCES()
|
|
#endif
|
|
|
|
#endif
|
|
|