C# Class MaterialsOptimizer.Material

Mostra file Open project: Patapom/GodComplex Class Usage Examples

Public Properties

Property Type Description
m_errors string
m_forbiddenParms List
m_glossMinMax float2
m_height Layer.Texture
m_isUsingCloudParms bool
m_isUsingVegetationParms bool
m_isUsingWaterParms bool
m_layers List
m_lightMap Layer.Texture
m_metallicMinMax float2
m_name string
m_options Options
m_parms Parms
m_physicsMaterial string
m_programs Programs
m_sourceFileName System.IO.FileInfo
m_states States
m_unknownVariables List
m_version int
m_warnings string

Private Properties

Property Type Description
CheckSafeTokens bool
Parse void
ParseOptions void
ReadListOfStrings void
RecordCommentVariable void
RecordSingleLineCommentVariable void
WriteListOfStrings void

Public Methods

Method Description
CheckSafeOptionsTokens ( string token, int value ) : void
CleanUp ( int &_clearedOptionsCount, int &_removedTexturesCount, int &_blackColorConstantsCount, int &_swappedSlotsCount, int &_missingTexturesReplacedCount, int &_removedHasOcclusionMapOptionsCount, int &_reUseOptionsSetCount ) : void

This function cleans the material from automatically recoverable errors and warnings

CleanUpUselessComments ( List _unknownStrings ) : void
ClearErrorLevel ( ) : void
CollectDiffuseGlossTextures ( Dictionary _diffuse2GlossMaps ) : void
Export ( StringWriter W ) : void

This attempts to re-export a valid material for a M2 file

Material ( BinaryReader R ) : System
Material ( FileInfo _sourceFileName, string _name, string _content ) : System
Optimize ( int &_totalDiffuseGlossTexturesReplaced ) : bool

This function optimizes the material by compacting diffuse and gloss textures into a single "_dg" texture whenever possible

RaiseErrorLevel ( ERROR_LEVEL _errorLevel ) : void
Read ( BinaryReader R ) : void
RecordCommentOption ( string _token, Parser P ) : void
RecordCommentVariable ( string _token, Parser P ) : void
RecordForbiddenVariable ( string _token, Parser P ) : void
RecordSingleLineCommentOption ( string _token, Parser P ) : void
RecordSingleLineCommentVariable ( string _token, Parser P ) : void
RecordUnknownOption ( string _token, Parser P ) : void
RecordUnknownOption ( string _token, int value, Parser P ) : void
RecordUnknownVariable ( string _token, Parser P ) : void
ToString ( ) : string
Write ( BinaryWriter W ) : void

Private Methods

Method Description
CheckSafeTokens ( string token ) : bool
Parse ( string _block ) : void
ParseOptions ( string _options ) : void
ReadListOfStrings ( BinaryReader R, List _list ) : void
RecordCommentVariable ( List _variables, string _token, Parser P ) : void
RecordSingleLineCommentVariable ( List _variables, string _token, Parser P ) : void
WriteListOfStrings ( BinaryWriter W, List _list ) : void

Method Details

CheckSafeOptionsTokens() public method

public CheckSafeOptionsTokens ( string token, int value ) : void
token string
value int
return void

CleanUp() public method

This function cleans the material from automatically recoverable errors and warnings
public CleanUp ( int &_clearedOptionsCount, int &_removedTexturesCount, int &_blackColorConstantsCount, int &_swappedSlotsCount, int &_missingTexturesReplacedCount, int &_removedHasOcclusionMapOptionsCount, int &_reUseOptionsSetCount ) : void
_clearedOptionsCount int
_removedTexturesCount int
_blackColorConstantsCount int
_swappedSlotsCount int
_missingTexturesReplacedCount int
_removedHasOcclusionMapOptionsCount int
_reUseOptionsSetCount int
return void

CleanUpUselessComments() public method

public CleanUpUselessComments ( List _unknownStrings ) : void
_unknownStrings List
return void

ClearErrorLevel() public method

public ClearErrorLevel ( ) : void
return void

CollectDiffuseGlossTextures() public method

public CollectDiffuseGlossTextures ( Dictionary _diffuse2GlossMaps ) : void
_diffuse2GlossMaps Dictionary
return void

Export() public method

This attempts to re-export a valid material for a M2 file
public Export ( StringWriter W ) : void
W System.IO.StringWriter
return void

Material() public method

public Material ( BinaryReader R ) : System
R System.IO.BinaryReader
return System

Material() public method

public Material ( FileInfo _sourceFileName, string _name, string _content ) : System
_sourceFileName System.IO.FileInfo
_name string
_content string
return System

Optimize() public method

This function optimizes the material by compacting diffuse and gloss textures into a single "_dg" texture whenever possible
public Optimize ( int &_totalDiffuseGlossTexturesReplaced ) : bool
_totalDiffuseGlossTexturesReplaced int
return bool

RaiseErrorLevel() public method

public RaiseErrorLevel ( ERROR_LEVEL _errorLevel ) : void
_errorLevel ERROR_LEVEL
return void

Read() public method

public Read ( BinaryReader R ) : void
R System.IO.BinaryReader
return void

RecordCommentOption() public method

public RecordCommentOption ( string _token, Parser P ) : void
_token string
P Parser
return void

RecordCommentVariable() public method

public RecordCommentVariable ( string _token, Parser P ) : void
_token string
P Parser
return void

RecordForbiddenVariable() public method

public RecordForbiddenVariable ( string _token, Parser P ) : void
_token string
P Parser
return void

RecordSingleLineCommentOption() public method

public RecordSingleLineCommentOption ( string _token, Parser P ) : void
_token string
P Parser
return void

RecordSingleLineCommentVariable() public method

public RecordSingleLineCommentVariable ( string _token, Parser P ) : void
_token string
P Parser
return void

RecordUnknownOption() public method

public RecordUnknownOption ( string _token, Parser P ) : void
_token string
P Parser
return void

RecordUnknownOption() public method

public RecordUnknownOption ( string _token, int value, Parser P ) : void
_token string
value int
P Parser
return void

RecordUnknownVariable() public method

public RecordUnknownVariable ( string _token, Parser P ) : void
_token string
P Parser
return void

ToString() public method

public ToString ( ) : string
return string

Write() public method

public Write ( BinaryWriter W ) : void
W System.IO.BinaryWriter
return void

Property Details

m_errors public_oe property

public string m_errors
return string

m_forbiddenParms public_oe property

public List m_forbiddenParms
return List

m_glossMinMax public_oe property

public float2 m_glossMinMax
return float2

m_height public_oe property

public Layer.Texture m_height
return Layer.Texture

m_isUsingCloudParms public_oe property

public bool m_isUsingCloudParms
return bool

m_isUsingVegetationParms public_oe property

public bool m_isUsingVegetationParms
return bool

m_isUsingWaterParms public_oe property

public bool m_isUsingWaterParms
return bool

m_layers public_oe property

public List m_layers
return List

m_lightMap public_oe property

public Layer.Texture m_lightMap
return Layer.Texture

m_metallicMinMax public_oe property

public float2 m_metallicMinMax
return float2

m_name public_oe property

public string m_name
return string

m_options public_oe property

public Options m_options
return Options

m_parms public_oe property

public Parms m_parms
return Parms

m_physicsMaterial public_oe property

public string m_physicsMaterial
return string

m_programs public_oe property

public Programs m_programs
return Programs

m_sourceFileName public_oe property

public FileInfo,System.IO m_sourceFileName
return System.IO.FileInfo

m_states public_oe property

public States m_states
return States

m_unknownVariables public_oe property

public List m_unknownVariables
return List

m_version public_oe property

public int m_version
return int

m_warnings public_oe property

public string m_warnings
return string