Complete disaster-recovery snapshot: engine/game source, game data assets, VC6 toolchain + DX SDKs, build outputs, deployed game, and _UNUSED archive. Large binaries in Git LFS; text preserved byte-for-byte (core.autocrlf=false, no eol attributes). See RECOVERY.md for the one-clone rebuild procedure.
156 lines
4.0 KiB
C++
156 lines
4.0 KiB
C++
//===========================================================================//
|
|
// File: audcmp.hpp //
|
|
// Project: MUNGA Brick: Audio manager //
|
|
// Contents: //
|
|
//---------------------------------------------------------------------------//
|
|
// Date Who Modification //
|
|
// -------- --- ---------------------------------------------------------- //
|
|
// 01/30/95 ECH Initial coding. //
|
|
//---------------------------------------------------------------------------//
|
|
// Copyright (C) 1994-1995, Virtual World Entertainment, Inc. //
|
|
// All Rights reserved worldwide //
|
|
// This unpublished sourcecode is PROPRIETARY and CONFIDENTIAL //
|
|
//===========================================================================//
|
|
|
|
#pragma once
|
|
|
|
#include "Adept.hpp"
|
|
#include "Channel.hpp"
|
|
|
|
namespace Adept {
|
|
|
|
//#########################################################################
|
|
//######################## RandomizerOf #############################
|
|
//#########################################################################
|
|
|
|
template <class T> class RandomizerOf:
|
|
public ChannelOf<T>
|
|
{
|
|
public:
|
|
static void
|
|
InitializeClass();
|
|
static void
|
|
TerminateClass();
|
|
|
|
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
// Constructor/Destructor
|
|
//
|
|
public:
|
|
~RandomizerOf();
|
|
|
|
static RandomizerOf<T>*
|
|
Create(
|
|
MemoryStream *stream,
|
|
ComponentWeb *owning_web
|
|
);
|
|
|
|
protected:
|
|
RandomizerOf(
|
|
ClassData *class_data,
|
|
MemoryStream *stream,
|
|
ComponentWeb *owning_web
|
|
);
|
|
|
|
void
|
|
SkipStreamData(MemoryStream *stream);
|
|
|
|
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
// Virtual data
|
|
//
|
|
public:
|
|
static ClassData
|
|
*DefaultData;
|
|
|
|
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
// Component execution
|
|
//
|
|
public:
|
|
void
|
|
Execute();
|
|
|
|
protected:
|
|
T
|
|
minValue,
|
|
valueRange;
|
|
|
|
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
// Tool Support
|
|
//
|
|
public:
|
|
static ClassData*
|
|
CreateFactoryRequest(FactoryRequestParameters *parameters);
|
|
|
|
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
// Test support
|
|
//
|
|
public:
|
|
void
|
|
TestInstance();
|
|
};
|
|
|
|
//
|
|
// Class Data Support
|
|
//
|
|
template <class T> ChannelOf<T>::ClassData*
|
|
RandomizerOf<T>::DefaultData = NULL;
|
|
|
|
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
//
|
|
template <class T> void
|
|
RandomizerOf<T>::TerminateClass()
|
|
{
|
|
Unregister_Object(DefaultData);
|
|
delete DefaultData;
|
|
DefaultData = NULL;
|
|
}
|
|
|
|
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
//
|
|
template <class T> RandomizerOf<T>::~RandomizerOf()
|
|
{
|
|
}
|
|
|
|
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
//
|
|
template <class T> RandomizerOf<T>::RandomizerOf(
|
|
ClassData *class_data,
|
|
MemoryStream *stream,
|
|
ComponentWeb *owning_web
|
|
):
|
|
ChannelOf<T>(class_data, stream, owning_web)
|
|
{
|
|
*stream >> minValue >> valueRange;
|
|
Verify(valueRange >= 0);
|
|
}
|
|
|
|
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
//
|
|
template <class T> void
|
|
RandomizerOf<T>::SkipStreamData(MemoryStream *stream)
|
|
{
|
|
Check_Object(this);
|
|
Check_Object(stream);
|
|
|
|
ChannelOf<T>::SkipStreamData(stream);
|
|
#if defined(_ARMOR)
|
|
Scalar value;
|
|
*stream >> value;
|
|
Verify(value == minValue);
|
|
*stream >> value;
|
|
Verify(value == valueRange);
|
|
#else
|
|
stream->AdvancePointer(2*sizeof(T));
|
|
#endif
|
|
}
|
|
|
|
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
//
|
|
template <class T> void
|
|
RandomizerOf<T>::TestInstance()
|
|
{
|
|
Verify(IsDerivedFrom(DefaultData));
|
|
}
|
|
|
|
}
|
|
|