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>
165 lines
4.6 KiB
C++
165 lines
4.6 KiB
C++
//===========================================================================//
|
|
// File: audwgt.hpp //
|
|
// Project: MUNGA Brick: Audio Renderer //
|
|
// Contents: Interface specification for audio weighting //
|
|
//---------------------------------------------------------------------------//
|
|
// Date Who Modification //
|
|
// -------- --- ---------------------------------------------------------- //
|
|
// 05/02/96 ECH Initial coding. //
|
|
//---------------------------------------------------------------------------//
|
|
// Copyright (C) 1996, Virtual World Entertainment, Inc. //
|
|
// All Rights reserved worldwide //
|
|
// This unpublished sourcecode is PROPRIETARY and CONFIDENTIAL //
|
|
//===========================================================================//
|
|
|
|
#if !defined(AUDWGT_HPP)
|
|
#define AUDWGT_HPP
|
|
|
|
# if !defined(STYLE_HPP)
|
|
# include <style.hpp>
|
|
# endif
|
|
|
|
# if !defined(AUDIO_HPP)
|
|
# include <audio.hpp>
|
|
# endif
|
|
|
|
//##########################################################################
|
|
//######################## AudioWeighting ############################
|
|
//##########################################################################
|
|
|
|
class AudioWeighting SIGNATURED
|
|
{
|
|
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
// Construction, Destruction, and Testing
|
|
//
|
|
public:
|
|
AudioWeighting();
|
|
AudioWeighting(const AudioWeighting&);
|
|
AudioWeighting(
|
|
AudioSourcePriority audio_priority,
|
|
AudioControlValue audio_volume
|
|
);
|
|
|
|
AudioWeighting&
|
|
operator=(const AudioWeighting&);
|
|
|
|
Logical
|
|
TestInstance() const;
|
|
|
|
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
// Logical Operators
|
|
//
|
|
public:
|
|
Logical
|
|
operator<(const AudioWeighting&) const;
|
|
Logical
|
|
operator<=(const AudioWeighting&) const;
|
|
Logical
|
|
operator>(const AudioWeighting&) const;
|
|
Logical
|
|
operator>=(const AudioWeighting&) const;
|
|
Logical
|
|
operator==(const AudioWeighting&) const;
|
|
Logical
|
|
operator!=(const AudioWeighting&) const;
|
|
|
|
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
// Public Constants
|
|
//
|
|
public:
|
|
static const AudioWeighting
|
|
Null;
|
|
|
|
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
// Private Data
|
|
//
|
|
private:
|
|
Scalar
|
|
weight;
|
|
};
|
|
|
|
//~~~~~~~~~~~~~~~~~~~~~~~~~~ AudioWeighting inlines ~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
inline AudioWeighting::AudioWeighting():
|
|
weight(0.0f)
|
|
{
|
|
}
|
|
|
|
inline AudioWeighting::AudioWeighting(const AudioWeighting &audio_weighting):
|
|
weight(audio_weighting.weight)
|
|
{
|
|
}
|
|
|
|
inline AudioWeighting::AudioWeighting(
|
|
AudioSourcePriority audio_priority,
|
|
AudioControlValue audio_volume
|
|
)
|
|
{
|
|
Verify(
|
|
(Enumeration)audio_priority >= 0 &&
|
|
(Enumeration)audio_priority < AUDIO_SOURCE_PRIORITY_COUNT
|
|
);
|
|
Verify(
|
|
(Enumeration)audio_priority >= (Enumeration)MinAudioSourcePriority &&
|
|
(Enumeration)audio_priority <= (Enumeration)MaxAudioSourcePriority
|
|
);
|
|
Verify(
|
|
audio_volume >= 0.0f &&
|
|
audio_volume <= 1.0f
|
|
);
|
|
weight = 0.0f -(Scalar)audio_priority - audio_volume;
|
|
}
|
|
|
|
inline AudioWeighting&
|
|
AudioWeighting::operator=(const AudioWeighting &audio_weighting)
|
|
{
|
|
Check(this);
|
|
weight = audio_weighting.weight;
|
|
return *this;
|
|
}
|
|
|
|
inline Logical
|
|
AudioWeighting::operator<(const AudioWeighting &audio_weighting) const
|
|
{
|
|
Check(this);
|
|
return weight < audio_weighting.weight;
|
|
}
|
|
|
|
inline Logical
|
|
AudioWeighting::operator<=(const AudioWeighting &audio_weighting) const
|
|
{
|
|
Check(this);
|
|
return weight <= audio_weighting.weight;
|
|
}
|
|
|
|
inline Logical
|
|
AudioWeighting::operator>(const AudioWeighting &audio_weighting) const
|
|
{
|
|
Check(this);
|
|
return weight > audio_weighting.weight;
|
|
}
|
|
|
|
inline Logical
|
|
AudioWeighting::operator>=(const AudioWeighting &audio_weighting) const
|
|
{
|
|
Check(this);
|
|
return weight >= audio_weighting.weight;
|
|
}
|
|
|
|
inline Logical
|
|
AudioWeighting::operator==(const AudioWeighting &audio_weighting) const
|
|
{
|
|
Check(this);
|
|
return Close_Enough(weight, audio_weighting.weight, 0.01f);
|
|
}
|
|
|
|
inline Logical
|
|
AudioWeighting::operator!=(const AudioWeighting &audio_weighting) const
|
|
{
|
|
Check(this);
|
|
return !Close_Enough(weight, audio_weighting.weight, 0.01f);
|
|
}
|
|
|
|
#endif
|
|
|