|
wavelength 1.0.0
|
Material, PlayStation 2. More...
#include <psmat.h>


Public Member Functions | |
| PsMat (const char *pszName) | |
| Construct a material. | |
| ~PsMat () override | |
| void * | operator new (size_t nSize) |
| Allocate a material from its pool. | |
| void | operator delete (void *pBlock) |
| Return a material to its pool. | |
| int | Select (int nPass) |
| Select one pass of the material for drawing. | |
| void | SelectBlendMode (int nPass) |
| Program the GS blend, dither, alpha test, and alpha correction for a pass. | |
| void | SelectStageClamp (const Stage &stage) |
| Clamp the texture coordinates of a stage, or let them repeat. | |
| int | TexFunction (int nBlend) |
| Report the GS texture function a blend draws its texture with. | |
| void | BindStageTexture (int nPass) |
| Bind the texture of a pass's stage and set the colour scale for its texture function. | |
| void | SetupUvXfm (int nPass) |
| Build the texture coordinate transform of a pass's stage into g_uvXfm and g_stageXfm. | |
| Public Member Functions inherited from RndMat | |
| RndMat (const char *pszName) | |
| Construct an enabled material that blends by source alpha, with a black base colour, a white light colour, and a black edge colour. | |
| ~RndMat () override | |
| Drop the references on the stage textures. | |
| void * | operator new (size_t nSize) |
| Allocate a material, billed to the class name. | |
| void | operator delete (void *pBlock) |
| Release a material. | |
| void | DumpText (PrnStream &stream) override |
| Write a description of the material. | |
| void | Save (BinStream &stream) override |
| Write the material. | |
| void | Replace (RndObject *pFrom, RndObject *pTo) override |
| Replace a stage texture with another object. | |
| const char * | ClassName () const override |
| Report the class name. | |
| void | Copy (const RndObject *pSource, int nFlags) override |
| Copy another material. | |
| void | Load (BinStream &stream) override |
| Read what Save() wrote, or an earlier version of it. | |
| virtual void | SyncStage (int nStage) |
| Bring the platform state of one stage up to date. | |
| virtual void | SetBaseColor (const Color &color) |
| Set the red, green, and blue of the base colour. | |
| virtual void | SetLightColor (const Color &color) |
| Set the light colour. | |
| virtual void | SetEdgeColor (const Color &color) |
| Set the edge colour. | |
| virtual void | SetAlpha (float fAlpha) |
| Set the alpha of the base colour. | |
| virtual void | SetLighting (int bEnable, int bVertBase, int bVertLight, int bVertEdge, int bNormalize, int bBaseAmbient) |
| Set the lighting switches. | |
| virtual void | Refresh () |
| Take a reference on every stage texture and bring every stage up to date. | |
| void | AddStage () |
| Append a default stage. | |
| int | GetBaseAmbient () const |
| const Color & | GetBaseColor () const |
| int | GetBlend () const |
| void | SetBlend (int nBlend) |
| int | GetCull () const |
| void | SetCull (int nCull) |
| const Color & | GetEdgeColor () const |
| const Color & | GetLightColor () const |
| const std::vector< Stage > & | GetStages () const |
| std::vector< Stage > & | GetStages () |
| int | GetVertBase () const |
| int | GetVertLight () 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 | SelectDefault () |
| Forget the selected material and return the GS to opaque drawing with the default dither. | |
| static void | SelectAlphaBlend () |
| Blend by the source alpha, and make the next Select() of the selected material select its blend again. | |
| static void | Init () |
| Install the material factory for the class Mat of a .rnd file. | |
| static RndObject * | New (const char *pszName) |
| Create a material. | |
| Static Public Member Functions inherited from RndMat | |
| static RndObject * | New (const char *pszName) |
| Create a material. | |
Static Public Attributes | |
| static PsMat * | sCurrent |
| The material Select() last selected, or null. | |
| Static Public Attributes inherited from RndMat | |
| static const char * | sClassName |
| The class name a .rnd file writes, Mat. | |
| static int | sRev |
| The format version Save() writes and Load() accepts. | |
| static int | sLoadRev |
| The version Load() read last, which Stage::Load() consults. | |
| 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. | |
Additional Inherited Members | |
| Public Types inherited from RndMat | |
| enum | Blend { kBlendDest = 0 , kBlendSrc = 1 , kBlendAdd = 2 , kBlendMultiply = 3 , kBlendMultiply2 = 4 , kBlendSrcAlpha = 5 , kBlendSrcAlphaAdd = 6 , kBlendSrcAdd = 7 , kBlendInvSrcAlpha = 8 , kBlendDestAlpha = 9 , kBlendInvDestAlpha = 10 , kBlendSrcAlphaOpaque = 11 , kBlendSrcAlphaCutout = 12 , kBlendSubtract = 13 } |
| How a surface or a texture stage combines with what is beneath it. More... | |
| enum | TexGen { kTexGenFixed = 0 , kTexGenSphere = 1 , kTexGenPlanar = 2 , kTexGenOrthoCube = 3 , kTexGenLocalCube = 4 } |
| How a texture stage produces its texture coordinates. More... | |
| enum | TexWrap { kTexWrapClamp = 0 , kTexWrapRepeat = 1 , kTexWrapMirror = 2 } |
| How texture coordinates outside the unit range wrap. More... | |
| Protected Member Functions inherited from RndMat | |
| void | ReleaseStageTex () |
| Drop the reference on every stage texture. | |
| Protected Attributes inherited from RndMat | |
| std::vector< Stage > | mStages |
| int | mBlend |
| Color | mBaseColor |
| Color | mLightColor |
| Color | mEdgeColor |
| int | mEnable |
| int | mVertBase |
| int | mVertLight |
| int | mVertEdge |
| int | mNormalize |
| int | mBaseAmbient |
| int | mCull |
| int | mFlat |
| int | mMultiPass |
| Protected Attributes inherited from RndObject | |
| std::list< RndObject * > | mRefs |
| String | mName |
Material, PlayStation 2.
The RTTI includes the class name and records RndMat as the one base. The class adds no data member and overrides only the destructor. It selects a material for drawing: the GS blend, alpha test, and clamp registers, the stage texture, and the globals the mesh and particle paths read. The material last selected is cached in sCurrent.
|
inlineexplicit |
Construct a material.
The binary expands the constructor inline in New().
| pszName | The registry key. |
|
inlineoverride |
|
inline |
Allocate a material from its pool.
| nSize | The object size the compiler supplies. |
|
inline |
Return a material to its pool.
| pBlock | The block. |
| int PsMat::Select | ( | int | nPass | ) |
Select one pass of the material for drawing.
A material that is already selected and has fewer than two stages changes nothing, beyond selecting its blend again after SelectAlphaBlend(). Otherwise the blend, the stage texture, and the texture coordinate transform of the pass are selected.
| nPass | The pass. The pass is also the stage. |
| void PsMat::SelectBlendMode | ( | int | nPass | ) |
Program the GS blend, dither, alpha test, and alpha correction for a pass.
The first pass takes the surface blend and the later passes the blend of their stage. The name is inferred.
| nPass | The pass. |
| void PsMat::SelectStageClamp | ( | const Stage & | stage | ) |
Clamp the texture coordinates of a stage, or let them repeat.
The name is inferred.
| stage | The stage. |
| int PsMat::TexFunction | ( | int | nBlend | ) |
Report the GS texture function a blend draws its texture with.
The name is inferred.
| nBlend | The Blend. |
| void PsMat::BindStageTexture | ( | int | nPass | ) |
Bind the texture of a pass's stage and set the colour scale for its texture function.
A stage without a texture, or with RndMat::kBlendDest, binds nothing. The name is inferred.
| nPass | The pass. |
| void PsMat::SetupUvXfm | ( | int | nPass | ) |
Build the texture coordinate transform of a pass's stage into g_uvXfm and g_stageXfm.
The name is inferred.
| nPass | The pass. |
|
static |
Forget the selected material and return the GS to opaque drawing with the default dither.
|
static |
|
static |
Install the material factory for the class Mat of a .rnd file.
The name is inferred.
|
inlinestatic |
Create a material.
| pszName | The registry key. |
|
static |
The material Select() last selected, or null.