doom3-gpl
Doom 3 GPL source release
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Private Member Functions | Private Attributes | List of all members
idMaterial Class Reference

#include <Material.h>

Inheritance diagram for idMaterial:
idDecl

Public Member Functions

 idMaterial ()
 
virtual ~idMaterial ()
 
virtual size_t Size (void) const
 
virtual bool SetDefaultText (void)
 
virtual const char * DefaultDefinition (void) const
 
virtual bool Parse (const char *text, const int textLength)
 
virtual void FreeData (void)
 
virtual void Print (void) const
 
bool Save (const char *fileName=NULL)
 
virtual const char * ImageName (void) const
 
void ReloadImages (bool force) const
 
const int GetNumStages (void) const
 
const shaderStage_tGetStage (const int index) const
 
const shaderStage_tGetBumpStage (void) const
 
bool IsDrawn (void) const
 
bool HasAmbient (void) const
 
bool HasGui (void) const
 
bool HasSubview (void) const
 
bool SurfaceCastsShadow (void) const
 
bool ReceivesFog (void) const
 
bool ReceivesLighting (void) const
 
bool ReceivesLightingOnBackSides (void) const
 
bool ShouldCreateBackSides (void) const
 
bool UseUnsmoothedTangents (void) const
 
bool AllowOverlays (void) const
 
materialCoverage_t Coverage (void) const
 
bool HasHigherDmapPriority (const idMaterial &other) const
 
idUserInterfaceGlobalGui (void) const
 
bool IsDiscrete (void) const
 
bool NoFragment (void) const
 
bool IsFogLight () const
 
bool IsBlendLight () const
 
bool IsAmbientLight () const
 
bool LightCastsShadows () const
 
bool LightEffectsBackSides () const
 
idImageLightFalloffImage () const
 
const char * GetRenderBump () const
 
void SetMaterialFlag (const int flag) const
 
void ClearMaterialFlag (const int flag) const
 
bool TestMaterialFlag (const int flag) const
 
const int GetContentFlags (void) const
 
const int GetSurfaceFlags (void) const
 
const surfTypes_t GetSurfaceType (void) const
 
const char * GetDescription (void) const
 
const float GetSort (void) const
 
void SetSort (float s) const
 
deform_t Deform (void) const
 
const int GetDeformRegister (int index) const
 
const idDeclGetDeformDecl (void) const
 
texgen_t Texgen () const
 
const intGetTexGenRegisters (void) const
 
const cullType_t GetCullType (void) const
 
float GetEditorAlpha (void) const
 
int GetEntityGui (void) const
 
decalInfo_t GetDecalInfo (void) const
 
int Spectrum (void) const
 
float GetPolygonOffset (void) const
 
float GetSurfaceArea (void) const
 
void AddToSurfaceArea (float area)
 
int CinematicLength (void) const
 
void CloseCinematic (void) const
 
void ResetCinematicTime (int time) const
 
void UpdateCinematic (int time) const
 
idImageGetEditorImage (void) const
 
int GetImageWidth (void) const
 
int GetImageHeight (void) const
 
void SetGui (const char *_gui) const
 
void SetImageClassifications (int tag) const
 
const int GetNumRegisters () const
 
void EvaluateRegisters (float *regs, const float entityParms[MAX_ENTITY_SHADER_PARMS], const struct viewDef_s *view, idSoundEmitter *soundEmitter=NULL) const
 
const floatConstantRegisters () const
 
bool SuppressInSubview () const
 
bool IsPortalSky () const
 
void AddReference ()
 
- Public Member Functions inherited from idDecl
 idDecl (void)
 
virtual ~idDecl (void)
 
const char * GetName (void) const
 
declType_t GetType (void) const
 
declState_t GetState (void) const
 
bool IsImplicit (void) const
 
bool IsValid (void) const
 
void Invalidate (void)
 
void EnsureNotPurged (void)
 
int Index (void) const
 
int GetLineNum (void) const
 
const char * GetFileName (void) const
 
void GetText (char *text) const
 
int GetTextLength (void) const
 
void SetText (const char *text)
 
bool ReplaceSourceFileText (void)
 
bool SourceFileChanged (void) const
 
void MakeDefault (void)
 
bool EverReferenced (void) const
 
virtual void List (void) const
 

Private Member Functions

void CommonInit ()
 
void ParseMaterial (idLexer &src)
 
bool MatchToken (idLexer &src, const char *match)
 
void ParseSort (idLexer &src)
 
void ParseBlend (idLexer &src, shaderStage_t *stage)
 
void ParseVertexParm (idLexer &src, newShaderStage_t *newStage)
 
void ParseFragmentMap (idLexer &src, newShaderStage_t *newStage)
 
void ParseStage (idLexer &src, const textureRepeat_t trpDefault=TR_REPEAT)
 
void ParseDeform (idLexer &src)
 
void ParseDecalInfo (idLexer &src)
 
bool CheckSurfaceParm (idToken *token)
 
int GetExpressionConstant (float f)
 
int GetExpressionTemporary (void)
 
expOp_tGetExpressionOp (void)
 
int EmitOp (int a, int b, expOpType_t opType)
 
int ParseEmitOp (idLexer &src, int a, expOpType_t opType, int priority)
 
int ParseTerm (idLexer &src)
 
int ParseExpressionPriority (idLexer &src, int priority)
 
int ParseExpression (idLexer &src)
 
void ClearStage (shaderStage_t *ss)
 
int NameToSrcBlendMode (const idStr &name)
 
int NameToDstBlendMode (const idStr &name)
 
void MultiplyTextureMatrix (textureStage_t *ts, int registers[2][3])
 
void SortInteractionStages ()
 
void AddImplicitStages (const textureRepeat_t trpDefault=TR_REPEAT)
 
void CheckForConstantRegisters ()
 

Private Attributes

idStr desc
 
idStr renderBump
 
idImagelightFalloffImage
 
int entityGui
 
idUserInterfacegui
 
bool noFog
 
int spectrum
 
float polygonOffset
 
int contentFlags
 
int surfaceFlags
 
int materialFlags
 
decalInfo_t decalInfo
 
float sort
 
deform_t deform
 
int deformRegisters [4]
 
const idDecldeformDecl
 
int texGenRegisters [MAX_TEXGEN_REGISTERS]
 
materialCoverage_t coverage
 
cullType_t cullType
 
bool shouldCreateBackSides
 
bool fogLight
 
bool blendLight
 
bool ambientLight
 
bool unsmoothedTangents
 
bool hasSubview
 
bool allowOverlays
 
int numOps
 
expOp_tops
 
int numRegisters
 
floatexpressionRegisters
 
floatconstantRegisters
 
int numStages
 
int numAmbientStages
 
shaderStage_tstages
 
struct mtrParsingData_spd
 
float surfaceArea
 
idStr editorImageName
 
idImageeditorImage
 
float editorAlpha
 
bool suppressInSubview
 
bool portalSky
 
int refCount
 

Additional Inherited Members

- Public Attributes inherited from idDecl
idDeclBasebase
 

Detailed Description

Definition at line 342 of file Material.h.

Constructor & Destructor Documentation

idMaterial::idMaterial ( )

Definition at line 132 of file Material.cpp.

idMaterial::~idMaterial ( )
virtual

Definition at line 145 of file Material.cpp.

Member Function Documentation

void idMaterial::AddImplicitStages ( const textureRepeat_t  trpDefault = TR_REPEAT)
private

Definition at line 1679 of file Material.cpp.

void idMaterial::AddReference ( )

Definition at line 2376 of file Material.cpp.

void idMaterial::AddToSurfaceArea ( float  area)
inline

Definition at line 546 of file Material.h.

bool idMaterial::AllowOverlays ( void  ) const
inline

Definition at line 422 of file Material.h.

void idMaterial::CheckForConstantRegisters ( )
private

Definition at line 2605 of file Material.cpp.

bool idMaterial::CheckSurfaceParm ( idToken token)
private

Definition at line 294 of file Material.cpp.

int idMaterial::CinematicLength ( void  ) const

Definition at line 2536 of file Material.cpp.

void idMaterial::ClearMaterialFlag ( const int  flag) const
inline

Definition at line 491 of file Material.h.

void idMaterial::ClearStage ( shaderStage_t ss)
private

Definition at line 739 of file Material.cpp.

void idMaterial::CloseCinematic ( void  ) const

Definition at line 2560 of file Material.cpp.

void idMaterial::CommonInit ( )
private

Definition at line 77 of file Material.cpp.

const float * idMaterial::ConstantRegisters ( ) const

Definition at line 2588 of file Material.cpp.

materialCoverage_t idMaterial::Coverage ( void  ) const
inline

Definition at line 428 of file Material.h.

const char * idMaterial::DefaultDefinition ( void  ) const
virtual

Reimplemented from idDecl.

Definition at line 2693 of file Material.cpp.

deform_t idMaterial::Deform ( void  ) const
inline

Definition at line 516 of file Material.h.

int idMaterial::EmitOp ( int  a,
int  b,
expOpType_t  opType 
)
private

Definition at line 447 of file Material.cpp.

void idMaterial::EvaluateRegisters ( float regs,
const float  entityParms[MAX_ENTITY_SHADER_PARMS],
const struct viewDef_s view,
idSoundEmitter soundEmitter = NULL 
) const

Definition at line 2397 of file Material.cpp.

void idMaterial::FreeData ( void  )
virtual

Reimplemented from idDecl.

Definition at line 153 of file Material.cpp.

const shaderStage_t * idMaterial::GetBumpStage ( void  ) const

Definition at line 2709 of file Material.cpp.

const int idMaterial::GetContentFlags ( void  ) const
inline

Definition at line 497 of file Material.h.

const cullType_t idMaterial::GetCullType ( void  ) const
inline

Definition at line 531 of file Material.h.

decalInfo_t idMaterial::GetDecalInfo ( void  ) const
inline

Definition at line 537 of file Material.h.

const idDecl* idMaterial::GetDeformDecl ( void  ) const
inline

Definition at line 522 of file Material.h.

const int idMaterial::GetDeformRegister ( int  index) const
inline

Definition at line 519 of file Material.h.

const char* idMaterial::GetDescription ( void  ) const
inline

Definition at line 506 of file Material.h.

float idMaterial::GetEditorAlpha ( void  ) const
inline

Definition at line 533 of file Material.h.

idImage * idMaterial::GetEditorImage ( void  ) const

Definition at line 190 of file Material.cpp.

int idMaterial::GetEntityGui ( void  ) const
inline

Definition at line 535 of file Material.h.

int idMaterial::GetExpressionConstant ( float  f)
private

Definition at line 391 of file Material.cpp.

expOp_t * idMaterial::GetExpressionOp ( void  )
private

Definition at line 432 of file Material.cpp.

int idMaterial::GetExpressionTemporary ( void  )
private

Definition at line 416 of file Material.cpp.

int idMaterial::GetImageHeight ( void  ) const

Definition at line 2526 of file Material.cpp.

int idMaterial::GetImageWidth ( void  ) const

Definition at line 2516 of file Material.cpp.

const int idMaterial::GetNumRegisters ( ) const
inline

Definition at line 575 of file Material.h.

const int idMaterial::GetNumStages ( void  ) const
inline

Definition at line 365 of file Material.h.

float idMaterial::GetPolygonOffset ( void  ) const
inline

Definition at line 543 of file Material.h.

const char* idMaterial::GetRenderBump ( ) const
inline

Definition at line 485 of file Material.h.

const float idMaterial::GetSort ( void  ) const
inline

Definition at line 509 of file Material.h.

const shaderStage_t* idMaterial::GetStage ( const int  index) const
inline

Definition at line 368 of file Material.h.

float idMaterial::GetSurfaceArea ( void  ) const
inline

Definition at line 545 of file Material.h.

const int idMaterial::GetSurfaceFlags ( void  ) const
inline

Definition at line 500 of file Material.h.

const surfTypes_t idMaterial::GetSurfaceType ( void  ) const
inline

Definition at line 503 of file Material.h.

const int* idMaterial::GetTexGenRegisters ( void  ) const
inline

Definition at line 528 of file Material.h.

idUserInterface* idMaterial::GlobalGui ( void  ) const
inline

Definition at line 435 of file Material.h.

bool idMaterial::HasAmbient ( void  ) const
inline

Definition at line 381 of file Material.h.

bool idMaterial::HasGui ( void  ) const
inline

Definition at line 384 of file Material.h.

bool idMaterial::HasHigherDmapPriority ( const idMaterial other) const
inline

Definition at line 431 of file Material.h.

bool idMaterial::HasSubview ( void  ) const
inline

Definition at line 388 of file Material.h.

const char * idMaterial::ImageName ( void  ) const
virtual

Definition at line 2626 of file Material.cpp.

bool idMaterial::IsAmbientLight ( ) const
inline

Definition at line 464 of file Material.h.

bool idMaterial::IsBlendLight ( ) const
inline

Definition at line 461 of file Material.h.

bool idMaterial::IsDiscrete ( void  ) const
inline

Definition at line 441 of file Material.h.

bool idMaterial::IsDrawn ( void  ) const
inline

Definition at line 378 of file Material.h.

bool idMaterial::IsFogLight ( ) const
inline

Definition at line 458 of file Material.h.

bool idMaterial::IsPortalSky ( ) const
inline

Definition at line 587 of file Material.h.

bool idMaterial::LightCastsShadows ( ) const
inline

Definition at line 468 of file Material.h.

bool idMaterial::LightEffectsBackSides ( ) const
inline

Definition at line 477 of file Material.h.

idImage* idMaterial::LightFalloffImage ( ) const
inline

Definition at line 480 of file Material.h.

bool idMaterial::MatchToken ( idLexer src,
const char *  match 
)
private

Definition at line 320 of file Material.cpp.

void idMaterial::MultiplyTextureMatrix ( textureStage_t ts,
int  registers[2][3] 
)
private

Definition at line 1025 of file Material.cpp.

int idMaterial::NameToDstBlendMode ( const idStr name)
private

Definition at line 785 of file Material.cpp.

int idMaterial::NameToSrcBlendMode ( const idStr name)
private

Definition at line 753 of file Material.cpp.

bool idMaterial::NoFragment ( void  ) const
inline

Definition at line 452 of file Material.h.

bool idMaterial::Parse ( const char *  text,
const int  textLength 
)
virtual

Reimplemented from idDecl.

Definition at line 2122 of file Material.cpp.

void idMaterial::ParseBlend ( idLexer src,
shaderStage_t stage 
)
private

Definition at line 815 of file Material.cpp.

void idMaterial::ParseDecalInfo ( idLexer src)
private

Definition at line 372 of file Material.cpp.

void idMaterial::ParseDeform ( idLexer src)
private

Definition at line 1584 of file Material.cpp.

int idMaterial::ParseEmitOp ( idLexer src,
int  a,
expOpType_t  opType,
int  priority 
)
private

Definition at line 494 of file Material.cpp.

int idMaterial::ParseExpression ( idLexer src)
private

Definition at line 729 of file Material.cpp.

int idMaterial::ParseExpressionPriority ( idLexer src,
int  priority 
)
private

Definition at line 654 of file Material.cpp.

void idMaterial::ParseFragmentMap ( idLexer src,
newShaderStage_t newStage 
)
private

Definition at line 924 of file Material.cpp.

void idMaterial::ParseMaterial ( idLexer src)
private

Definition at line 1783 of file Material.cpp.

void idMaterial::ParseSort ( idLexer src)
private

Definition at line 333 of file Material.cpp.

void idMaterial::ParseStage ( idLexer src,
const textureRepeat_t  trpDefault = TR_REPEAT 
)
private

Definition at line 1079 of file Material.cpp.

int idMaterial::ParseTerm ( idLexer src)
private

Definition at line 508 of file Material.cpp.

void idMaterial::ParseVertexParm ( idLexer src,
newShaderStage_t newStage 
)
private

Definition at line 874 of file Material.cpp.

void idMaterial::Print ( void  ) const
virtual

Reimplemented from idDecl.

Definition at line 2345 of file Material.cpp.

bool idMaterial::ReceivesFog ( void  ) const
inline

Definition at line 396 of file Material.h.

bool idMaterial::ReceivesLighting ( void  ) const
inline

Definition at line 401 of file Material.h.

bool idMaterial::ReceivesLightingOnBackSides ( void  ) const
inline

Definition at line 405 of file Material.h.

void idMaterial::ReloadImages ( bool  force) const

Definition at line 2723 of file Material.cpp.

void idMaterial::ResetCinematicTime ( int  time) const

Definition at line 2575 of file Material.cpp.

bool idMaterial::Save ( const char *  fileName = NULL)

Definition at line 2367 of file Material.cpp.

bool idMaterial::SetDefaultText ( void  )
virtual

Reimplemented from idDecl.

Definition at line 2667 of file Material.cpp.

void idMaterial::SetGui ( const char *  _gui) const

Definition at line 2111 of file Material.cpp.

void idMaterial::SetImageClassifications ( int  tag) const

Definition at line 2644 of file Material.cpp.

void idMaterial::SetMaterialFlag ( const int  flag) const
inline

Definition at line 488 of file Material.h.

void idMaterial::SetSort ( float  s) const
inline

Definition at line 513 of file Material.h.

bool idMaterial::ShouldCreateBackSides ( void  ) const
inline

Definition at line 412 of file Material.h.

size_t idMaterial::Size ( void  ) const
virtual

Reimplemented from idDecl.

Definition at line 2658 of file Material.cpp.

void idMaterial::SortInteractionStages ( )
private

Definition at line 1742 of file Material.cpp.

int idMaterial::Spectrum ( void  ) const
inline

Definition at line 541 of file Material.h.

bool idMaterial::SuppressInSubview ( ) const
inline

Definition at line 586 of file Material.h.

bool idMaterial::SurfaceCastsShadow ( void  ) const
inline

Definition at line 392 of file Material.h.

bool idMaterial::TestMaterialFlag ( const int  flag) const
inline

Definition at line 494 of file Material.h.

texgen_t idMaterial::Texgen ( ) const

Definition at line 2499 of file Material.cpp.

void idMaterial::UpdateCinematic ( int  time) const

Definition at line 2548 of file Material.cpp.

bool idMaterial::UseUnsmoothedTangents ( void  ) const
inline

Definition at line 417 of file Material.h.

Member Data Documentation

bool idMaterial::allowOverlays
private

Definition at line 658 of file Material.h.

bool idMaterial::ambientLight
private

Definition at line 655 of file Material.h.

bool idMaterial::blendLight
private

Definition at line 654 of file Material.h.

float* idMaterial::constantRegisters
private

Definition at line 666 of file Material.h.

int idMaterial::contentFlags
private

Definition at line 635 of file Material.h.

materialCoverage_t idMaterial::coverage
private

Definition at line 649 of file Material.h.

cullType_t idMaterial::cullType
private

Definition at line 650 of file Material.h.

decalInfo_t idMaterial::decalInfo
private

Definition at line 639 of file Material.h.

deform_t idMaterial::deform
private

Definition at line 643 of file Material.h.

const idDecl* idMaterial::deformDecl
private

Definition at line 645 of file Material.h.

int idMaterial::deformRegisters[4]
private

Definition at line 644 of file Material.h.

idStr idMaterial::desc
private

Definition at line 620 of file Material.h.

float idMaterial::editorAlpha
private

Definition at line 682 of file Material.h.

idImage* idMaterial::editorImage
mutableprivate

Definition at line 681 of file Material.h.

idStr idMaterial::editorImageName
private

Definition at line 680 of file Material.h.

int idMaterial::entityGui
private

Definition at line 625 of file Material.h.

float* idMaterial::expressionRegisters
private

Definition at line 664 of file Material.h.

bool idMaterial::fogLight
private

Definition at line 653 of file Material.h.

idUserInterface* idMaterial::gui
mutableprivate

Definition at line 627 of file Material.h.

bool idMaterial::hasSubview
private

Definition at line 657 of file Material.h.

idImage* idMaterial::lightFalloffImage
private

Definition at line 623 of file Material.h.

int idMaterial::materialFlags
mutableprivate

Definition at line 637 of file Material.h.

bool idMaterial::noFog
private

Definition at line 629 of file Material.h.

int idMaterial::numAmbientStages
private

Definition at line 669 of file Material.h.

int idMaterial::numOps
private

Definition at line 660 of file Material.h.

int idMaterial::numRegisters
private

Definition at line 663 of file Material.h.

int idMaterial::numStages
private

Definition at line 668 of file Material.h.

expOp_t* idMaterial::ops
private

Definition at line 661 of file Material.h.

struct mtrParsingData_s* idMaterial::pd
private

Definition at line 673 of file Material.h.

float idMaterial::polygonOffset
private

Definition at line 633 of file Material.h.

bool idMaterial::portalSky
private

Definition at line 685 of file Material.h.

int idMaterial::refCount
private

Definition at line 686 of file Material.h.

idStr idMaterial::renderBump
private

Definition at line 621 of file Material.h.

bool idMaterial::shouldCreateBackSides
private

Definition at line 651 of file Material.h.

float idMaterial::sort
mutableprivate

Definition at line 642 of file Material.h.

int idMaterial::spectrum
private

Definition at line 631 of file Material.h.

shaderStage_t* idMaterial::stages
private

Definition at line 671 of file Material.h.

bool idMaterial::suppressInSubview
private

Definition at line 684 of file Material.h.

float idMaterial::surfaceArea
private

Definition at line 675 of file Material.h.

int idMaterial::surfaceFlags
private

Definition at line 636 of file Material.h.

int idMaterial::texGenRegisters[MAX_TEXGEN_REGISTERS]
private

Definition at line 647 of file Material.h.

bool idMaterial::unsmoothedTangents
private

Definition at line 656 of file Material.h.


The documentation for this class was generated from the following files: