106 const char*
GetAttribute(
int stage,
const char* attribName,
const char* defaultString =
"");
107 int GetAttributeInt(
int stage,
const char* attribName,
const char* defaultString =
"0");
108 float GetAttributeFloat(
int stage,
const char* attribName,
const char* defaultString =
"0");
109 bool GetAttributeBool(
int stage,
const char* attribName,
const char* defaultString =
"0");
112 void SetAttribute(
int stage,
const char* attribName,
const char*
value,
bool addUndo =
true);
126 void AddStage(
int stageType,
const char* stageName,
bool addUndo =
true);
127 void InsertStage(
int stage,
int stageType,
const char* stageName,
bool addUndo =
true);
130 void MoveStage(
int from,
int to,
bool addUndo =
true);
void EnableStage(int stage, bool enabled)
Specifies the enabled state of a single stage.
void ClearEditMaterial()
Cleans up the edit material by deleting the stage data structures.
GLsizei const GLfloat * value
void Delete()
Deletes the material.
void Save()
Saves the material.
int FindStage(int stageType, const char *name)
Returns the index of the stage with the specified type and name or -1 if the stage does not exist...
idMaterial * renderMaterial
void WriteMaterialDef(int stage, idFile_Memory *file, int type, int indent)
Writes a set of material attributes to a file.
void SourceModify(SourceModifyOwner *owner)
Called when the editor modifies the source of the material.
bool ParseMaterialDef(idToken *token, idLexer *src, int type, idDict *dict)
Finds the appropriate material definition for the supplied token and initializes the internal diction...
void SetAttributeFloat(int stage, const char *attribName, float value, bool addUndo=true)
Sets an attribute float in the material or a stage.
void SetAttributeInt(int stage, const char *attribName, int value, bool addUndo=true)
Sets an attribute int in the material or a stage.
void OnMaterialChanged()
Sets the proper internal states and notifies the MaterialDocManager once a material has been changed...
void ReplaceSourceText()
Writes the internal dictionary data to the standard format and replaces the idMaterial source text wi...
GLuint GLuint GLsizei GLenum type
const char * GenerateSourceText()
Writes the internal dictionary data to the standard format.
void MoveStage(int from, int to, bool addUndo=true)
Moves a stage from one location to another.
Dictionary representation of a material.
void ApplyMaterialChanges(bool force=false)
Applies any changes to the material.
SourceModifyOwner * sourceModifyOwner
void RemoveStage(int stage, bool addUndo=true)
Removes a stage from the material.
void WriteSpecialMapStage(int stage, idFile_Memory *file)
Writes a single special stage.
void ParseMaterial(idLexer *src)
Parses the source text from an idMaterial and initializes the editor dictionary representation of the...
void InsertStage(int stage, int stageType, const char *stageName, bool addUndo=true)
Inserts a new stage to the material at a specified location.
const char * GetEditSourceText()
Returns the appropriate source for the editing.
GLsizei GLsizei GLcharARB * source
void WriteStage(int stage, idFile_Memory *file)
Writes a single stage.
void SetAttribute(int stage, const char *attribName, const char *value, bool addUndo=true)
Sets an attribute string in the material or a stage.
void AddSpecialMapStage(const char *stageName, const char *map)
Adds a special stage to the material.
Responsible for managing a single material that is being viewed and/or edited.
void AddStage(int stageType, const char *stageName, bool addUndo=true)
Adds a stage to the material.
bool IsSourceModified()
Returns true if the source text of this material has been edited.
void SetMaterialName(const char *materialName, bool addUndo=true)
Sets the material name.
GLsizei GLsizei GLenum GLenum const GLvoid * data
int GetStageCount()
Returns the number of stages in this material.
int GetAttributeInt(int stage, const char *attribName, const char *defaultString="0")
Returns an attribute int from the material or a stage.
void ParseStage(idLexer *src)
Parses a single stage from the source text from an idMaterial and initializes the editor dictionary r...
void SetAttributeBool(int stage, const char *attribName, bool value, bool addUndo=true)
Sets an attribute bool in the material or a stage.
const char * GetAttribute(int stage, const char *attribName, const char *defaultString="")
Returns an attribute string from the material or a stage.
MaterialDocManager * manager
void ParseMaterialText(const char *source)
Passes text to a render material for parsing.
void SetData(int stage, idDict *data)
Sets the entire dictionary for a material or stage.
bool GetAttributeBool(int stage, const char *attribName, const char *defaultString="0")
Returns an attribute bool from the material or a stage.
void EnableAllStages(bool enabled)
Sets the enabled state of all stages.
Implemented by the edit window that is responsible for modifying the material source text...
~MaterialDoc(void)
Destructor for MaterialDoc.
virtual ~SourceModifyOwner()
Responsible for managing the materials that are being viewed and/or edited.
void SetRenderMaterial(idMaterial *material, bool parseMaterial=true, bool parseRenderMatierial=false)
Initializes the MaterialDoc instance with a specific idMaterial.
void ApplySourceModify(idStr &text)
Applies any source changes to the edit representation of the material.
float GetAttributeFloat(int stage, const char *attribName, const char *defaultString="0")
Returns an attribute float from the material or a stage.
MEMaterial_t editMaterial
MEStage_t GetStage(int stage)
Returns a copy of the specified stage.
virtual idStr GetSourceText()
bool IsStageEnabled(int stage)
Returns the enabled state of a stage.
Dictionary representation of a Material Stage.
void ClearStages()
Removes all stages from the material.
idList< MEStage_t * > stages
MaterialDoc(void)
Constructor for MaterialDoc.