|
wavelength 1.0.0
|
Lighting and fog environment, made current for the drawables after it when it is drawn. More...
#include <rndenviron.h>


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 |
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.
| enum RndEnviron::FogMode |
|
explicit |
Construct an environment without lights, with a black ambient colour and no white fog.
| pszName | The registry key. |
|
override |
Drop the references on the lights.
|
inline |
Allocate an environment, billed to the class name.
| nSize | The object size the compiler supplies. |
|
inline |
Release an environment.
| pBlock | The block. |
|
overridevirtual |
Add the lights to a list.
The children are not added.
| objects | The list to add to. |
Reimplemented from RndDrawable.
|
inlineoverridevirtual |
Make the environment current.
Reimplemented from RndDrawable.
|
overridevirtual |
Write a description of the environment and its base.
| stream | The stream to write to. |
Reimplemented from RndDrawable.
|
overridevirtual |
Write the environment and its base.
| stream | The stream to write to. |
Reimplemented from RndDrawable.
Replace a referenced light with another.
A light that becomes null is removed. A replacement already among the lights is reported.
| pFrom | The object being replaced. |
| pTo | The replacement, or null. |
Reimplemented from RndDrawable.
|
inlineoverridevirtual |
Report the class name.
Implements RndObject.
|
overridevirtual |
Copy another environment and its base.
| pSource | The environment to copy from. |
| nFlags | The set of fields to copy. |
Reimplemented from RndDrawable.
|
overridevirtual |
Read what Save() wrote.
| stream | The stream to read from. |
Reimplemented from RndDrawable.
| void RndEnviron::AddLight | ( | RndLight * | pLight | ) |
Add a light, or report one already among the lights.
| pLight | The light. |
|
static |
Create the default environment and add it to the default camera.
The name is inferred.
|
inlinestatic |
Create an environment.
| pszName | The registry key. |
|
inline |
|
inline |
| color | The ambient colour. |
|
inline |
|
inline |
| color | The fog colour. |
|
inline |
|
inline |
| fFogDensity | The density of exponential fog. |
|
inline |
|
inline |
| fFogEnd | The distance fog is full at. |
|
inline |
|
inline |
| fFogStart | The distance fog starts at. |
|
inline |
|
inline |
|
protected |
Drop the references on the lights.
The name is inferred.
|
protected |
Take references on the lights.
The name is inferred.
|
staticconstexpr |
The bit of the Copy() flags that keeps the lights rather than copying the source's.
|
static |
The class name a .rnd file writes, Environ.
|
static |
The environment drawn last.
|
static |
The environment CreateDefault() made.
|
static |
|
protected |
The lights.
|
protected |
The ambient colour.
|
protected |
The distance fog starts at.
|
protected |
The distance fog is full at.
|
protected |
The density of exponential fog.
|
protected |
The fog colour.
|
protected |
The FogMode.