|
| | PsEnviron (const HxStr &name) |
| | Construct an environment with no lights and no fog.
|
| virtual | ~PsEnviron () |
| | Environ (const HxStr &name) |
| | Construct an environment with no lights and no fog.
|
| virtual | ~Environ () |
| virtual const HxStr & | ClassName () const |
| | Report the class key a .rnd file writes for an environment.
|
| virtual void | DumpText (Dbg &sink) |
| | Write a description of this environment to sink.
|
| virtual void | Save (Stream &stream) |
| | Write this environment's serialised form to stream.
|
| virtual void | Replace (Object *pFrom, Object *pTo) |
| | Repoint a light entry when the object it addressed is replaced.
|
| virtual void | Copy (const Object *pSource, unsigned nFlags) |
| | Copy the state of pSource into this environment.
|
| virtual void | Load (Stream &stream) |
| | Read this environment's serialised form from stream.
|
| void | AddLight (Light *pLight) |
| | Append a light to mLights.
|
| void | RemoveLight (Light *pLight) |
| | Remove a light from mLights.
|
| void | RemoveAllLights () |
| | Drop this environment's reference on every light and empty mLights.
|
| | Drawable () |
| | Construct a visible drawable with no children.
|
| virtual | ~Drawable () |
| | Drop this object's references on its children.
|
| void | Draw () |
| | Draw this object followed by each of its children.
|
| Drawable * | Parent () |
| | Report the drawable that draws this one.
|
| void | AddDraw (Drawable *pDraw, Drawable *pBefore) |
| | Insert pDraw into mDraws in front of pBefore.
|
| void | AddDraw (Drawable *pDraw) |
| | Insert pDraw at the front of mDraws.
|
| void | RemoveDraw (Drawable *pDraw) |
| | Erase pDraw from mDraws.
|
| void | RemoveAllDraws () |
| | Empty mDraws, dropping this object's reference on every entry.
|
| void | MoveDraw (Drawable *pDraw, int nSteps) |
| | Move pDraw nSteps places later in mDraws, or earlier for a negative count.
|
| virtual void | SetShowing (int nShowing) |
| | Set whether this object draws at all.
|
| void | SetShowingRecursive (int nShowing) |
| | Set whether this object and every drawable beneath it in mDraws draw at all.
|
| virtual void | SetHighlight (int nHighlight) |
| | Set whether this object draws with its highlight treatment.
|
| int | GetHighlight () const |
| | Report the highlight flag.
|
| int | GetShowing () const |
| | Report the showing flag.
|
| std::list< Drawable * > & | GetDraws () |
| | Report the child list.
|
| | Object () |
| | Construct an unnamed object.
|
| | Object (const HxStr &name) |
| | Construct an object and register it under name.
|
| virtual | ~Object () |
| | Erase the registry entry and release the name buffer.
|
| void | SetName (const HxStr &name) |
| | Re-register this object under a different name.
|
| void | AddRef (Object *pReferrer) |
| | Register pReferrer as a store of a pointer to this object.
|
| void | RemoveRef (Object *pReferrer) |
| | Drop one registration made by AddRef().
|
|
| static Environ * | NewEnviron (const HxStr &name) |
| | Build a PlayStation 2 environment the class registry vends.
|
| static void | Init () |
| | Install the PlayStation 2 environment factory and build the default scene fixtures.
|
| static void | Terminate () |
| | Undo what Init() installs.
|
| static Environ * | NewEnviron (const HxStr &name) |
| | Build an environment the class registry vends.
|
| static void * | operator new (size_t nSize) |
| | Allocate an environment block under the tag "Rnd::Environ".
|
| static void | operator delete (void *pBlock) |
| | Release a block operator new() allocated.
|
| static Drawable * | Find (const HxStr &name) |
| | Resolve a registry key to a drawable.
|
Lighting and fog a subtree is drawn under, PlayStation 2.
Its RTTI descriptor is at 0x008ef250. It has Rnd::Environ as its only public non-virtual base at offset 0. The class does not add a data member. Its allocator at 0x005b27b0 requests the same 0x80 bytes the base does, under the same "Rnd::Environ" tag, and its constructor writes only the two vtable pointers.
Two vtables belong to the class. The four-entry table at 0x00833968 is addressed by the Rnd::Drawable vptr at 0x10, and the eight-entry table at 0x00833920 by the Rnd::Object subobject vptr. DrawShowing() is the only entry that is not the base implementation.
| void Rnd::PsEnviron::Init |
( |
| ) |
|
|
static |
Install the PlayStation 2 environment factory and build the default scene fixtures.
Rnd::g_pfnNewEnviron becomes NewEnviron(), which is how a .rnd file naming the unchanged "Environ" key loads this subclass. The environment named "[default environ]" is then built with a direct allocation rather than through the factory, marked internal, and added to the draw list of Rnd::PsCam::sDefault. A light named "[default light]" follows, built through Rnd::g_pfnNewLight, marked internal, added to the environment, and made a transform child of Rnd::PsCam::sDefault.
- Ghidra address:
- NTSC-U/C: 0x005aea68
- Ghidra address:
- PAL: 0x005f0fd0
| virtual int Rnd::PsEnviron::DrawShowing |
( |
| ) |
|
|
protectedvirtual |
Make this environment the current one, program fog, and build the light records.
Vtable slot 3 of the Rnd::Drawable table. Rnd::g_nFogEnabled becomes non-zero whenever the fog mode is anything other than None, and the two fog terms are then set so that a camera space depth maps onto the byte range the GS fog register takes. The scale is 255.0 divided by the fog start less the fog end, and the offset is the negated fog end scaled by it. With no fog the scale is zero and the offset 255.0, which fogs no pixel at all. The fog colour is packed into the low three bytes of GS register 0x3d.
Both record vectors are then emptied and each entry of mLights appended to one of them, a directional light contributing the negated second basis row of its world transform and a point light its translation row and its range. A spot light is skipped. The routine ends by making this environment Rnd::Environ::sCurrent.
- Returns
- Non-zero, which draws the children as well.
- Ghidra address:
- NTSC-U/C: 0x005aecb8
- Ghidra address:
- PAL: 0x005f1260
Reimplemented from Rnd::Environ.