wavelength 1.0.0
Loading...
Searching...
No Matches
RndEnviron Class Reference

Lighting and fog environment, made current for the drawables after it when it is drawn. More...

#include <rndenviron.h>

Inheritance diagram for RndEnviron:
Collaboration diagram for RndEnviron:

Public Types

enum  FogMode {
  kFogNone = 0 , kFogVertExp = 1 , kFogVertExp2 = 2 , kFogVertLinear = 3 ,
  kFogPixelExp = 4 , kFogPixelExp2 = 5 , kFogPixelLinear = 6
}
 The fog modes. More...

Public Member Functions

 RndEnviron (const char *pszName)
 Construct an environment without lights, with a black ambient colour and no white fog.
 ~RndEnviron () override
 Drop the references on the lights.
void * operator new (size_t nSize)
 Allocate an environment, billed to the class name.
void operator delete (void *pBlock)
 Release an environment.
void ListDrawObjects (std::list< RndObject * > &objects) override
 Add the lights to a list.
int DrawShowing () override
 Make the environment current.
void DumpText (PrnStream &stream) override
 Write a description of the environment and its base.
void Save (BinStream &stream) override
 Write the environment and its base.
void Replace (RndObject *pFrom, RndObject *pTo) override
 Replace a referenced light with another.
const char * ClassName () const override
 Report the class name.
void Copy (const RndObject *pSource, int nFlags) override
 Copy another environment and its base.
void Load (BinStream &stream) override
 Read what Save() wrote.
void AddLight (RndLight *pLight)
 Add a light, or report one already among the lights.
const Color & GetAmbientColor () const
void SetAmbientColor (const Color &color)
const Color & GetFogColor () const
void SetFogColor (const Color &color)
float GetFogDensity () const
void SetFogDensity (float fFogDensity)
float GetFogEnd () const
void SetFogEnd (float fFogEnd)
float GetFogStart () const
void SetFogStart (float fFogStart)
const std::list< RndLight * > & GetLights () const
std::list< RndLight * > & GetLights ()
Public Member Functions inherited from RndDrawable
 RndDrawable ()
 Construct a showing drawable without a highlight or children.
 ~RndDrawable () override
 Drop the references on the children.
virtual void ListDrawables (std::list< RndDrawable * > &drawables)
 Add the drawables to draw this frame to a list.
virtual void SetShowing (int nShowing)
 Set whether the drawable draws at all.
virtual void SetHighlight (int nHighlight)
 Set whether the drawable draws with its highlight treatment.
RndDrawable * Parent ()
 Find the drawable whose children include this one.
void Draw ()
 Draw the drawable and then its children, when it is showing.
bool AddDraw (RndDrawable *pDraw, RndDrawable *pBefore)
 Add a child before another.
void RemoveDraw (RndDrawable *pDraw)
 Remove a child.
void ClearDraws ()
 Remove every child.
int GetShowing () const
const std::list< RndDrawable * > & GetDraws () const
Public Member Functions inherited from RndObject
 RndObject (const char *pszName)
 Construct an object and register it under a name.
virtual ~RndObject ()
 Notify every referrer, then erase the registration.
void SetName (const char *pszName)
 Register the object under a different name.
void AddRef (RndObject *pReferrer)
 Register an object as a store of a pointer to this one.
void RemoveRef (RndObject *pReferrer)
 Drop the first registration AddRef() made for a referrer.
const char * GetName () const
const std::list< RndObject * > & GetRefs () const
int GetInternal () const
void SetInternal (int nInternal)

Static Public Member Functions

static void CreateDefault ()
 Create the default environment and add it to the default camera.
static RndObject * New (const char *pszName)
 Create an environment.
Static Public Member Functions inherited from RndDrawable
static void CollectChildren (std::list< RndObject * > &objects, RndDrawable *pDrawable)
 Append every draw descendant of a drawable, depth first, each before its descendants.

Static Public Attributes

static constexpr int kCopyKeepLights = 1
 The bit of the Copy() flags that keeps the lights rather than copying the source's.
static const char * sClassName
 The class name a .rnd file writes, Environ.
static RndEnviron * sCurrent
 The environment drawn last.
static RndEnviron * sDefault
 The environment CreateDefault() made.
static int sRev
 The format version Save() writes and Load() accepts.
Static Public Attributes inherited from RndDrawable
static int sRev
 The format version Save() writes and Load() accepts.
Static Public Attributes inherited from RndObject
static constexpr int kCopyChildLists = 0x200
 The bit of the Copy() flags that copies the child lists of the mix-ins.

Protected Member Functions

void ReleaseRefs ()
 Drop the references on the lights.
void AcquireRefs ()
 Take references on the lights.
Protected Member Functions inherited from RndDrawable
void ReleaseDrawRefs ()
 Drop the reference on every child without emptying the list.
void AcquireDrawRefs ()
 Take a reference on every child.

Protected Attributes

std::list< RndLight * > mLights
Color mAmbientColor
float mFogStart
float mFogEnd
float mFogDensity
Color mFogColor
int mFogMode
Protected Attributes inherited from RndDrawable
int mShowing
Protected Attributes inherited from RndObject
std::list< RndObject * > mRefs
String mName

Detailed Description

Lighting and fog environment, made current for the drawables after it when it is drawn.

The RTTI includes the class name and records RndDrawable as the one base.

Member Enumeration Documentation

◆ FogMode

The fog modes.

Enumerator
kFogNone 

No fog.

kFogVertExp 

Exponential fog per vertex.

kFogVertExp2 

Squared exponential fog per vertex.

kFogVertLinear 

Linear fog per vertex.

kFogPixelExp 

Exponential fog per pixel.

kFogPixelExp2 

Squared exponential fog per pixel.

kFogPixelLinear 

Linear fog per pixel.

Constructor & Destructor Documentation

◆ RndEnviron()

RndEnviron::RndEnviron ( const char * pszName)
explicit

Construct an environment without lights, with a black ambient colour and no white fog.

Parameters
pszNameThe registry key.
Ghidra address:
NTSC-U/C: 0x00224cf0
Ghidra address:
PAL: 0x0022daa8

◆ ~RndEnviron()

RndEnviron::~RndEnviron ( )
override

Drop the references on the lights.

Ghidra address:
NTSC-U/C: 0x003812c8
Ghidra address:
PAL: 0x003ef9e0

Member Function Documentation

◆ operator new()

void * RndEnviron::operator new ( size_t nSize)
inline

Allocate an environment, billed to the class name.

Parameters
nSizeThe object size the compiler supplies.
Returns
The block.

◆ operator delete()

void RndEnviron::operator delete ( void * pBlock)
inline

Release an environment.

Parameters
pBlockThe block.

◆ ListDrawObjects()

void RndEnviron::ListDrawObjects ( std::list< RndObject * > & objects)
overridevirtual

Add the lights to a list.

The children are not added.

Parameters
objectsThe list to add to.
Ghidra address:
NTSC-U/C: 0x00225818
Ghidra address:
PAL: 0x0022e5d0

Reimplemented from RndDrawable.

◆ DrawShowing()

int RndEnviron::DrawShowing ( )
inlineoverridevirtual

Make the environment current.

Returns
1, to draw the children.
Ghidra address:
NTSC-U/C: 0x003812a0
Ghidra address:
PAL: 0x003ef9b8

Reimplemented from RndDrawable.

◆ DumpText()

void RndEnviron::DumpText ( PrnStream & stream)
overridevirtual

Write a description of the environment and its base.

Parameters
streamThe stream to write to.
Ghidra address:
NTSC-U/C: 0x00224fc8
Ghidra address:
PAL: 0x0022dd80

Reimplemented from RndDrawable.

◆ Save()

void RndEnviron::Save ( BinStream & stream)
overridevirtual

Write the environment and its base.

Parameters
streamThe stream to write to.
Ghidra address:
NTSC-U/C: 0x00225128
Ghidra address:
PAL: 0x0022dee0

Reimplemented from RndDrawable.

◆ Replace()

void RndEnviron::Replace ( RndObject * pFrom,
RndObject * pTo )
overridevirtual

Replace a referenced light with another.

A light that becomes null is removed. A replacement already among the lights is reported.

Parameters
pFromThe object being replaced.
pToThe replacement, or null.
Ghidra address:
NTSC-U/C: 0x00224b30
Ghidra address:
PAL: 0x0022d8e8

Reimplemented from RndDrawable.

◆ ClassName()

const char * RndEnviron::ClassName ( ) const
inlineoverridevirtual

Report the class name.

Returns
sClassName.
Ghidra address:
NTSC-U/C: 0x00381528
Ghidra address:
PAL: 0x003efc40

Implements RndObject.

◆ Copy()

void RndEnviron::Copy ( const RndObject * pSource,
int nFlags )
overridevirtual

Copy another environment and its base.

Parameters
pSourceThe environment to copy from.
nFlagsThe set of fields to copy.
Ghidra address:
NTSC-U/C: 0x00225540
Ghidra address:
PAL: 0x0022e2f8

Reimplemented from RndDrawable.

◆ Load()

void RndEnviron::Load ( BinStream & stream)
overridevirtual

Read what Save() wrote.

Parameters
streamThe stream to read from.
Ghidra address:
NTSC-U/C: 0x002253e0
Ghidra address:
PAL: 0x0022e198

Reimplemented from RndDrawable.

◆ AddLight()

void RndEnviron::AddLight ( RndLight * pLight)

Add a light, or report one already among the lights.

Parameters
pLightThe light.
Ghidra address:
NTSC-U/C: 0x00225720
Ghidra address:
PAL: 0x0022e4d8

◆ CreateDefault()

void RndEnviron::CreateDefault ( )
static

Create the default environment and add it to the default camera.

The name is inferred.

Ghidra address:
NTSC-U/C: 0x00224a98
Ghidra address:
PAL: 0x0022d850

◆ New()

RndObject * RndEnviron::New ( const char * pszName)
inlinestatic

Create an environment.

Parameters
pszNameThe registry key.
Returns
The environment.
Ghidra address:
NTSC-U/C: 0x00381540
Ghidra address:
PAL: 0x003efc58

◆ GetAmbientColor()

const Color & RndEnviron::GetAmbientColor ( ) const
inline
Returns
The ambient colour.

◆ SetAmbientColor()

void RndEnviron::SetAmbientColor ( const Color & color)
inline
Parameters
colorThe ambient colour.

◆ GetFogColor()

const Color & RndEnviron::GetFogColor ( ) const
inline
Returns
The fog colour.

◆ SetFogColor()

void RndEnviron::SetFogColor ( const Color & color)
inline
Parameters
colorThe fog colour.

◆ GetFogDensity()

float RndEnviron::GetFogDensity ( ) const
inline
Returns
The density of exponential fog.

◆ SetFogDensity()

void RndEnviron::SetFogDensity ( float fFogDensity)
inline
Parameters
fFogDensityThe density of exponential fog.

◆ GetFogEnd()

float RndEnviron::GetFogEnd ( ) const
inline
Returns
The distance fog is full at.

◆ SetFogEnd()

void RndEnviron::SetFogEnd ( float fFogEnd)
inline
Parameters
fFogEndThe distance fog is full at.

◆ GetFogStart()

float RndEnviron::GetFogStart ( ) const
inline
Returns
The distance fog starts at.

◆ SetFogStart()

void RndEnviron::SetFogStart ( float fFogStart)
inline
Parameters
fFogStartThe distance fog starts at.

◆ GetLights() [1/2]

const std::list< RndLight * > & RndEnviron::GetLights ( ) const
inline
Returns
The lights.

◆ GetLights() [2/2]

std::list< RndLight * > & RndEnviron::GetLights ( )
inline
Returns
The lights, for writing.

◆ ReleaseRefs()

void RndEnviron::ReleaseRefs ( )
protected

Drop the references on the lights.

The name is inferred.

Ghidra address:
NTSC-U/C: 0x002252d0
Ghidra address:
PAL: 0x0022e088

◆ AcquireRefs()

void RndEnviron::AcquireRefs ( )
protected

Take references on the lights.

The name is inferred.

Ghidra address:
NTSC-U/C: 0x00225358
Ghidra address:
PAL: 0x0022e110

Member Data Documentation

◆ kCopyKeepLights

int RndEnviron::kCopyKeepLights = 1
staticconstexpr

The bit of the Copy() flags that keeps the lights rather than copying the source's.

◆ sClassName

const char* RndEnviron::sClassName
static

The class name a .rnd file writes, Environ.

Ghidra address:
NTSC-U/C: 0x003b09a8
Ghidra address:
PAL: 0x0042f840

◆ sCurrent

RndEnviron* RndEnviron::sCurrent
static

The environment drawn last.

Ghidra address:
NTSC-U/C: 0x003b09ac
Ghidra address:
PAL: 0x0042f844

◆ sDefault

RndEnviron* RndEnviron::sDefault
static

The environment CreateDefault() made.

Ghidra address:
NTSC-U/C: 0x003b09b0
Ghidra address:
PAL: 0x0042f848

◆ sRev

int RndEnviron::sRev
static

The format version Save() writes and Load() accepts.

Ghidra address:
NTSC-U/C: 0x003b09b4
Ghidra address:
PAL: 0x0042f84c

◆ mLights

std::list<RndLight *> RndEnviron::mLights
protected

The lights.

◆ mAmbientColor

Color RndEnviron::mAmbientColor
protected

The ambient colour.

◆ mFogStart

float RndEnviron::mFogStart
protected

The distance fog starts at.

◆ mFogEnd

float RndEnviron::mFogEnd
protected

The distance fog is full at.

◆ mFogDensity

float RndEnviron::mFogDensity
protected

The density of exponential fog.

◆ mFogColor

Color RndEnviron::mFogColor
protected

The fog colour.

◆ mFogMode

int RndEnviron::mFogMode
protected

The FogMode.


The documentation for this class was generated from the following file: