209 void *
operator new(
size_t nSize) {
218 void operator delete(
void *pBlock) {
390 return new RndMat(pszName);
Stream of raw bytes, the base of the memory, file, and network streams.
Definition binstream.h:22
Text output stream.
Definition prnstream.h:16
void Save(BinStream &stream) const
Write the stage.
Transform & GetXfm()
Definition rndmat.h:165
RndTex * GetTex() const
Definition rndmat.h:135
void SetBlend(int nBlend)
Definition rndmat.h:115
RndMat * GetMat() const
Definition rndmat.h:125
void SetWrap(int nWrap)
Definition rndmat.h:155
void SetXfm(const Transform &xfm)
Definition rndmat.h:170
void SetMat(RndMat *pMat)
Definition rndmat.h:130
void SetUseXfm(int nUseXfm)
Definition rndmat.h:145
const Transform & GetXfm() const
Definition rndmat.h:160
void SetTex(RndTex *pTex)
Set the texture, moving the material's reference to it.
int GetGenMode() const
Definition rndmat.h:120
Stage()
Construct a multiplying stage with an identity transform and no texture.
int GetWrap() const
Definition rndmat.h:150
int GetBlend() const
Definition rndmat.h:110
void Load(BinStream &stream)
Read what Save() wrote, or an earlier version of it.
int GetUseXfm() const
Definition rndmat.h:140
void Print(PrnStream &stream) const
Write a description of the stage.
Color mLightColor
Definition rndmat.h:492
std::vector< Stage > & GetStages()
Definition rndmat.h:461
int mVertEdge
Definition rndmat.h:502
void Save(BinStream &stream) override
Write the material.
int mBlend
Definition rndmat.h:488
int mVertBase
Definition rndmat.h:498
int GetBlend() const
Definition rndmat.h:426
const Color & GetLightColor() const
Definition rndmat.h:451
int GetCull() const
Definition rndmat.h:436
virtual void SyncStage(int nStage)
Bring the platform state of one stage up to date.
Definition rndmat.h:293
int mMultiPass
Definition rndmat.h:512
int mEnable
Definition rndmat.h:496
RndMat(const char *pszName)
Construct an enabled material that blends by source alpha, with a black base colour,...
int mBaseAmbient
Definition rndmat.h:506
Color mBaseColor
Definition rndmat.h:490
virtual void SetLightColor(const Color &color)
Set the light colour.
Definition rndmat.h:316
static const char * sClassName
The class name a .rnd file writes, Mat.
Definition rndmat.h:399
const std::vector< Stage > & GetStages() const
Definition rndmat.h:456
void Replace(RndObject *pFrom, RndObject *pTo) override
Replace a stage texture with another object.
int GetBaseAmbient() const
Definition rndmat.h:416
int mVertLight
Definition rndmat.h:500
void Load(BinStream &stream) override
Read what Save() wrote, or an earlier version of it.
void ReleaseStageTex()
Drop the reference on every stage texture.
const char * ClassName() const override
Report the class name.
Definition rndmat.h:259
int GetVertBase() const
Definition rndmat.h:466
TexWrap
How texture coordinates outside the unit range wrap.
Definition rndmat.h:50
@ kTexWrapRepeat
Definition rndmat.h:52
@ kTexWrapMirror
Definition rndmat.h:53
@ kTexWrapClamp
Definition rndmat.h:51
virtual void Refresh()
Take a reference on every stage texture and bring every stage up to date.
static int sLoadRev
The version Load() read last, which Stage::Load() consults.
Definition rndmat.h:413
int mCull
Definition rndmat.h:508
virtual void SetEdgeColor(const Color &color)
Set the edge colour.
Definition rndmat.h:327
Blend
How a surface or a texture stage combines with what is beneath it.
Definition rndmat.h:23
@ kBlendMultiply2
Definition rndmat.h:28
@ kBlendDestAlpha
Definition rndmat.h:33
@ kBlendInvSrcAlpha
Definition rndmat.h:32
@ kBlendSrcAlpha
Definition rndmat.h:29
@ kBlendSrcAlphaAdd
Definition rndmat.h:30
@ kBlendDest
Definition rndmat.h:24
@ kBlendSrc
Definition rndmat.h:25
@ kBlendSrcAlphaCutout
Definition rndmat.h:36
@ kBlendSubtract
Definition rndmat.h:37
@ kBlendSrcAdd
Definition rndmat.h:31
@ kBlendAdd
Definition rndmat.h:26
@ kBlendSrcAlphaOpaque
Definition rndmat.h:35
@ kBlendInvDestAlpha
Definition rndmat.h:34
@ kBlendMultiply
Definition rndmat.h:27
std::vector< Stage > mStages
Definition rndmat.h:486
void SetBlend(int nBlend)
Definition rndmat.h:431
void AddStage()
Append a default stage.
void SetCull(int nCull)
Definition rndmat.h:441
static int sRev
The format version Save() writes and Load() accepts.
Definition rndmat.h:406
const Color & GetBaseColor() const
Definition rndmat.h:421
~RndMat() override
Drop the references on the stage textures.
int mNormalize
Definition rndmat.h:504
virtual void SetAlpha(float fAlpha)
Set the alpha of the base colour.
Definition rndmat.h:338
static RndObject * New(const char *pszName)
Create a material.
Definition rndmat.h:389
TexGen
How a texture stage produces its texture coordinates.
Definition rndmat.h:41
@ kTexGenPlanar
Definition rndmat.h:44
@ kTexGenOrthoCube
Definition rndmat.h:45
@ kTexGenLocalCube
Definition rndmat.h:46
@ kTexGenFixed
Definition rndmat.h:42
@ kTexGenSphere
Definition rndmat.h:43
virtual void SetLighting(int bEnable, int bVertBase, int bVertLight, int bVertEdge, int bNormalize, int bBaseAmbient)
Set the lighting switches.
void DumpText(PrnStream &stream) override
Write a description of the material.
int mFlat
Definition rndmat.h:510
Color mEdgeColor
Definition rndmat.h:494
const Color & GetEdgeColor() const
Definition rndmat.h:446
virtual void SetBaseColor(const Color &color)
Set the red, green, and blue of the base colour.
Definition rndmat.h:303
void Copy(const RndObject *pSource, int nFlags) override
Copy another material.
int GetVertLight() const
Definition rndmat.h:471
RndObject(const char *pszName)
Construct an object and register it under a name.
Texture, a bitmap loaded from a file or rendered to.
Definition rndtex.h:17
void * PoolMemAlloc(int nSize, const char *pszTag, int nAlign)
Allocate a block from the pool heaps and bill it to a tag.
void PoolMemFree(void *pBlock)
Return a block PoolMemAlloc() handed out to the pool heap that owns it.
BinStream & operator>>(BinStream &stream, std::vector< RndMat::Stage > &stages)
Read the stages of a material the stage writer wrote.
PrnStream & operator<<(PrnStream &stream, RndMat::Blend eBlend)
Write the name of a blend mode.
Linear colour with four float components.
Definition color.h:12
float b
Definition color.h:15
float r
Definition color.h:13
float g
Definition color.h:14