16 Init(mat_path_override);
22 protected void Init(
string mat_path_override =
"")
24 if (mat_path_override !=
"")
63 parameter_data.RegisterDefaults(p);
72 parameter_data.RegisterDefaults(p);
82 parameter_data.RegisterDefaults(p);
92 bool boo =
Class.
CastTo(parameter_data,type.Spawn());
94 parameter_data.RegisterDefaults(p);
96 parameter_data.SetParameterIndex(idx);
97 parameter_data.SetParent(
this);
106 parameter_data.RegisterDefaults(p);
115 bool boo =
Class.
CastTo(parameter_data,type.Spawn());
117 parameter_data.RegisterDefaults(p);
119 parameter_data.SetParameterIndex(idx);
120 parameter_data.SetParent(
this);
127 PPEMatClassParameterVector parameter_data =
new PPEMatClassParameterVector(
GetPostProcessEffectID(),idx,
this);
128 parameter_data.RegisterDefaults(p);
136 PPEMatClassParameterTexture parameter_data =
new PPEMatClassParameterTexture(
GetPostProcessEffectID(),idx,
this);
137 parameter_data.RegisterDefaults(p);
144 PPEMatClassParameterResource parameter_data =
new PPEMatClassParameterResource(
GetPostProcessEffectID(),idx,
this);
145 parameter_data.RegisterDefaults(p);
203 int parameter_idx = -1;
213 bool setting_defaults =
false;
235 case PPEConstants.VAR_TYPE_BOOL:
236 bool value_var_bool = Param1<bool>.Cast(values).param1;
238 m_Material.SetParamByIndex(parameter_idx,value_var_bool);
242 case PPEConstants.VAR_TYPE_INT:
243 int value_var_int = Param1<int>.Cast(values).param1;
245 m_Material.SetParamByIndex(parameter_idx,value_var_int);
249 case PPEConstants.VAR_TYPE_FLOAT:
250 float value_var_float = Param1<float>.Cast(values).param1;
252 m_Material.SetParamByIndex(parameter_idx,value_var_float);
256 case PPEConstants.VAR_TYPE_COLOR:
257 float color[4] = {0,0,0,0};
258 color[0] = Param4<float,float,float,float>.Cast(values).param1;
259 color[1] = Param4<float,float,float,float>.Cast(values).param2;
260 color[2] = Param4<float,float,float,float>.Cast(values).param3;
261 color[3] = Param4<float,float,float,float>.Cast(values).param4;
263 m_Material.SetParamByIndex(parameter_idx,color);
Super root of all classes in Enforce script.
void DbgPrnt(string text)
int GetPostProcessEffectID()
Overriden in all material classes!
void RegisterParameterScalarInt(int idx, string parameter_name, int default_value, int min, int max)
ref array< int > m_ParameterRemovalQueue
void RegisterMaterialParameters()
inserted into associative array by parameter int value, parameter registration order does not matter ...
ref array< int > m_UpdatedParameters
void InsertUpdatedParameter(int mat_id)
void RegisterParameterScalarBool(int idx, string parameter_name, bool default_value)
void RegisterParameterResource(int idx, string parameter_name, string default_path)
void InsertParamValueData(PPERequestParamDataBase request_data)
Distributes requester data to the material class structure and links them to appropriate parameter.
void CreateDataStructure()
string GetCurrentMaterialPath()
ref map< int, ref PPEMatClassParameterCommandData > m_MaterialParamMapStructure
void SetParameterUpdating(int order, int parameter_id)
Queue specific parameter of this material to update.
void Init(string mat_path_override="")
void ParamUpdateRemove(int parameter_idx)
Queue selected parameter for removal from the update queue.
void RegisterParameterScalarFloat(int idx, string parameter_name, float default_value, float min, float max)
WARNING - min/max values are usually taken from Workbench defaults, may not be actual min/max values ...
void PPEClassBase(string mat_path_override="")
void RegisterParameterColor(int idx, string parameter_name, float r, float g, float b, float a)
WARNING - min/max values are usually taken from Workbench defaults, may not be actual min/max values ...
ref map< int, ref array< int > > m_ParameterUpdateQueueMap
string GetDefaultMaterialPath()
override this if you want to use different path by default; '.emat' is appended automatically
void RegisterParameterVector(int idx, string parameter_name, array< float > default_values)
void ParamUpdateQueueCleanup(int order)
void SetFinalParameterValue(int parameter_idx)
Clamps the values being set to defaults, if there is no request setting non-zero values on the parame...
void ChangeMaterialPathUsed(string path)
PPEMatClassParameterCommandData GetParameterCommandData(int parameter_idx)
Some PP effects are handled as hard-coded exceptions, outside of material system. Default == PPEExcep...
void RegisterParameterTexture(int idx, string parameter_name, string default_path)
void RegisterParameterScalarFloatEx(int idx, string parameter_name, float default_value, float min, float max, typename type)
WARNING - min/max values are usually taken from Workbench defaults, may not be actual min/max values ...
void RemoveRequest(int req_idx)
unused, see 'RemoveActiveRequestFromMaterials' for more info
void OnUpdate(float timeslice, int order)
generic update method, take care when overriding!
void RegisterParameterColorEx(int idx, string parameter_name, float r, float g, float b, float a, typename type)
WARNING - min/max values are usually taken from Workbench defaults, may not be actual min/max values ...
Static component of PPE manager, used to hold the instance.
static PPEManager GetPPEManager()
Returns the manager instance singleton.
Param GetCurrentValues()
Careful, only actual values, WITHOUT string.
override int GetParameterVarType()
void InsertRequestData(PPERequestParamDataBase request_data)
Data for one material parameter, requester side.
void SetUpdatingDataValues(bool state)
void SetDataActive(bool state)
Base Param Class with no parameters.
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
PostProcessEffectType
Post-process effect type.
void Error(string err)
Messagebox with error message.
static proto bool CastTo(out Class to, Class from)
Try to safely down-cast base class to child class.
Param5< string, float, float, float, float > PPETemplateDefColor
Param4< string, int, int, int > PPETemplateDefInt
Param4< string, float, float, float > PPETemplateDefFloat
Param2 PPETemplateDefBool
Param2< string, string > PPETemplateDefTexture
Param2< string, string > PPETemplateDefResource
Param2< string, ref array< float > > PPETemplateDefVector
void PPEMatClassParameterColor(int mat_idx, int parameter_idx, PPEClassBase parent)
void PPEMatClassParameterFloat(int mat_idx, int parameter_idx, PPEClassBase parent)