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>
77 lines
2.0 KiB
C++
77 lines
2.0 KiB
C++
#pragma once
|
|
|
|
#include "style.h"
|
|
#include "vector3d.h"
|
|
|
|
class Environment
|
|
{
|
|
#if defined(USE_SIGNATURE)
|
|
friend int Is_Signature_Bad(const Environment *p);
|
|
#endif
|
|
|
|
public:
|
|
Scalar gravityConstant;
|
|
Scalar airDensity;
|
|
Scalar audioReverbTime;
|
|
Scalar audioAverageSurfaceReflectivity;
|
|
Scalar audioAirAbsorption;
|
|
Vector3D windVelocity;
|
|
Scalar ambientTemperature; // Kelvin
|
|
|
|
const Vector3D& GetWindVelocity() { return windVelocity; }
|
|
|
|
Environment() {}
|
|
Environment(Scalar gravity, Scalar air_density, Scalar reverb_time, Scalar surface_reflectivity, Scalar air_absorption, const Vector3D &wind_velocity, Scalar ambient_temperature)
|
|
: gravityConstant(gravity), airDensity(air_density), audioReverbTime(reverb_time), audioAverageSurfaceReflectivity(surface_reflectivity), audioAirAbsorption(air_absorption), windVelocity(wind_velocity), ambientTemperature(ambient_temperature)
|
|
{
|
|
}
|
|
|
|
Logical TestInstance() const;
|
|
};
|
|
|
|
//~~~~~~~~~~~~~~~~~~~~~~~~~ Environment functions ~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
void Convert_From_Ascii(const char *str, Environment *environment);
|
|
|
|
inline MemoryStream& MemoryStream_Read(MemoryStream* stream, Environment *output)
|
|
{
|
|
return stream->ReadBytes(output, sizeof(*output));
|
|
}
|
|
inline MemoryStream& MemoryStream_Write(MemoryStream* stream, const Environment *input)
|
|
{
|
|
return stream->WriteBytes(input, sizeof(*input));
|
|
}
|
|
|
|
//##########################################################################
|
|
//###################### EnvironmentList #############################
|
|
//##########################################################################
|
|
|
|
class EnvironmentList SIGNATURED
|
|
{
|
|
protected:
|
|
int environmentCount;
|
|
|
|
Environment *environmentArray;
|
|
|
|
public:
|
|
EnvironmentList(int environments);
|
|
virtual ~EnvironmentList();
|
|
|
|
int GetEnvironmentCount()
|
|
{
|
|
Check(this);
|
|
return environmentCount;
|
|
}
|
|
|
|
virtual Environment& GetEnvironment(int index)
|
|
{
|
|
Check(this);
|
|
Verify((unsigned)index < environmentCount);
|
|
return environmentArray[index];
|
|
}
|
|
|
|
Logical TestInstance() const;
|
|
};
|
|
|
|
extern EnvironmentList *Environments;
|