|
wavelength 1.0.0
|
Environment, PlayStation 2. More...
#include <psenviron.h>


Public Types | |
| enum | LightProgram { kLightProgramPoint = 0x6c , kLightProgramDirectional = 0x260 , kLightProgramAmbient = 0x373 , kLightProgramUnlit = 0x3d7 } |
| The VU1 lighting microprograms, by their addresses in VU1 code memory. More... | |
| Public Types inherited from RndEnviron | |
| enum | FogMode { kFogNone = 0 , kFogVertExp = 1 , kFogVertExp2 = 2 , kFogVertLinear = 3 , kFogPixelExp = 4 , kFogPixelExp2 = 5 , kFogPixelLinear = 6 } |
| The fog modes. More... | |
Public Member Functions | |
| PsEnviron (const char *pszName) | |
| Construct an environment. | |
| ~PsEnviron () override | |
| int | DrawShowing () override |
| Set the fog and the lights up for the drawables after the environment, and make it current. | |
| Public Member Functions inherited from RndEnviron | |
| 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 | SelectLights (const Transform *pXfm, const Sphere *pSphere) |
| Add the lighting block of the VU1 mesh microprogram to the packet, eight quadwords. | |
| static void | Init () |
| Install the environment factory for the class Environ of a .rnd file, and create the default environment and light. | |
| static void | Terminate () |
| Restore the generic environment factory. | |
| static RndObject * | New (const char *pszName) |
| Create an environment. | |
| Static Public Member Functions inherited from RndEnviron | |
| 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. | |
Additional Inherited Members | |
| Static Public Attributes inherited from RndEnviron | |
| 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 inherited from RndEnviron | |
| 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 inherited from RndEnviron | |
| 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 |
Environment, PlayStation 2.
The RTTI includes the class name and records RndEnviron as the one base. The class adds no data member. DrawShowing() turns the fog and the lights into the globals below, and SelectLights() sends them to VU1 ahead of each mesh. One point light, or else up to three directional lights, light the meshes. Spot lights are ignored.
|
inlineexplicit |
Construct an environment.
The binary expands the constructor inline in New().
| pszName | The registry key. |
|
inlineoverride |
|
overridevirtual |
Set the fog and the lights up for the drawables after the environment, and make it current.
Reimplemented from RndDrawable.
Add the lighting block of the VU1 mesh microprogram to the packet, eight quadwords.
The block is a quadword of settings, the base colour, and the lights moved into the space of the object. Without lighting the block is the settings alone and the cursor skips the rest. A point light out of reach of the bounds of the object, and an object without a transform, take the ambient program. The name is inferred.
| pXfm | The transform of the object drawn, or null. |
| pSphere | The bounding sphere of the object in its own space. A radius of 0 skips the reach test. It is read only for a point light and a transform. |
|
static |
Install the environment factory for the class Environ of a .rnd file, and create the default environment and light.
The name is inferred.
|
static |
Restore the generic environment factory.
The name is inferred.
|
inlinestatic |
Create an environment.
| pszName | The registry key. |