DayZ 1.26
DayZ Explorer by KGB
Загрузка...
Поиск...
Не найдено
Класс PPEClassBase

Created once, on manager init. Script-side representation of C++ material class, separate handling. Подробнее...

+ Граф наследования:PPEClassBase:

Защищенные члены

void PPEClassBase (string mat_path_override="")
 
void Init (string mat_path_override="")
 
void CreateMaterial ()
 
Material GetMaterial ()
 
void CreateDataStructure ()
 
void RegisterMaterialParameters ()
 inserted into associative array by parameter int value, parameter registration order does not matter (still ordered, though)
 
void RegisterParameterScalarBool (int idx, string parameter_name, bool default_value)
 
void RegisterParameterScalarInt (int idx, string parameter_name, int default_value, int min, int max)
 
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 the renderer can handle! When in doubt, try some higher/lower values...
 
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 the renderer can handle! When in doubt, try some higher/lower values...
 
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 the renderer can handle! When in doubt, try some higher/lower values...
 
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 the renderer can handle! When in doubt, try some higher/lower values...
 
void RegisterParameterVector (int idx, string parameter_name, array< float > default_values)
 
void RegisterParameterTexture (int idx, string parameter_name, string default_path)
 
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 RemoveRequest (int req_idx)
 unused, see 'RemoveActiveRequestFromMaterials' for more info
 
void OnUpdate (float timeslice, int order)
 generic update method, take care when overriding!
 
void SetFinalParameterValue (int parameter_idx)
 Clamps the values being set to defaults, if there is no request setting non-zero values on the parameter.
 
void ApplyValueChanges ()
 
void InsertUpdatedParameter (int mat_id)
 
void ParamUpdateRemove (int parameter_idx)
 Queue selected parameter for removal from the update queue.
 
void SetParameterUpdating (int order, int parameter_id)
 Queue specific parameter of this material to update.
 
void ParamUpdateQueueCleanup (int order)
 
string GetDefaultMaterialPath ()
 override this if you want to use different path by default; '.emat' is appended automatically
 
void ChangeMaterialPathUsed (string path)
 
string GetCurrentMaterialPath ()
 
int GetPostProcessEffectID ()
 Overriden in all material classes!
 
PPEMatClassParameterCommandData GetParameterCommandData (int parameter_idx)
 Some PP effects are handled as hard-coded exceptions, outside of material system. Default == PPEExceptions.NONE (systemic behaviour)
 
void DbgPrnt (string text)
 

Защищенные данные

PPEManager m_Manager
 
string m_MaterialPath = ""
 
Material m_Material
 
ref map< int, ref array< int > > m_ParameterUpdateQueueMap
 
ref array< intm_ParameterRemovalQueue
 
ref array< intm_UpdatedParameters
 
ref map< int, ref PPEMatClassParameterCommandDatam_MaterialParamMapStructure
 

Подробное описание

Created once, on manager init. Script-side representation of C++ material class, separate handling.

Конструктор(ы)

◆ PPEClassBase()

void PPEClassBase ( string mat_path_override = "")
inlineprotected
15 {
20 }
override Widget Init()
Definition DayZGame.c:122
void RegisterMaterialParameters()
inserted into associative array by parameter int value, parameter registration order does not matter ...
void CreateDataStructure()
Definition PPEMatClassesBase.c:47
void CreateMaterial()
Definition PPEMatClassesBase.c:35
Definition EntityAI.c:95

Перекрестные ссылки CreateDataStructure(), CreateMaterial(), Init() и RegisterMaterialParameters().

Методы

◆ ApplyValueChanges()

void ApplyValueChanges ( )
inlineprotected
270 {
271 int parameter_id;
272 for (int i = 0; i < m_UpdatedParameters.Count(); i++)
273 {
276 }
277
278 m_UpdatedParameters.Clear();
279 }
ref array< int > m_UpdatedParameters
Definition PPEMatClassesBase.c:10
void SetFinalParameterValue(int parameter_idx)
Clamps the values being set to defaults, if there is no request setting non-zero values on the parame...
Definition PPEMatClassesBase.c:228

Перекрестные ссылки m_UpdatedParameters и SetFinalParameterValue().

◆ ChangeMaterialPathUsed()

void ChangeMaterialPathUsed ( string path)
inlineprotected
327 {
331 }
string path
Definition OptionSelectorMultistate.c:142
string m_MaterialPath
Definition PPEMatClassesBase.c:5
Material m_Material
Definition PPEMatClassesBase.c:6

Перекрестные ссылки CreateMaterial(), m_Material, m_MaterialPath и path.

◆ CreateDataStructure()

void CreateDataStructure ( )
inlineprotected
48 {
50 //m_ParameterUpdateQueue = new array<int>;
54 }
ref array< int > m_ParameterRemovalQueue
Definition PPEMatClassesBase.c:9
ref map< int, ref PPEMatClassParameterCommandData > m_MaterialParamMapStructure
Definition PPEMatClassesBase.c:12
ref map< int, ref array< int > > m_ParameterUpdateQueueMap
Definition PPEMatClassesBase.c:8

Перекрестные ссылки m_MaterialParamMapStructure, m_ParameterRemovalQueue, m_ParameterUpdateQueueMap и m_UpdatedParameters.

Используется в PPEClassBase().

◆ CreateMaterial()

void CreateMaterial ( )
inlineprotected
36 {
37 if (m_MaterialPath != "")
38 m_Material = GetGame().GetWorld().GetMaterial(m_MaterialPath);
39 }
proto native CGame GetGame()

Перекрестные ссылки GetGame(), m_Material и m_MaterialPath.

Используется в ChangeMaterialPathUsed() и PPEClassBase().

◆ DbgPrnt()

void DbgPrnt ( string text)
inlineprotected
381 {
382 //Debug.Log(""+text);
383 }

◆ GetCurrentMaterialPath()

string GetCurrentMaterialPath ( )
inlineprotected
334 {
335 return m_MaterialPath;
336 }

Перекрестные ссылки m_MaterialPath.

◆ GetDefaultMaterialPath()

string GetDefaultMaterialPath ( )
protected

override this if you want to use different path by default; '.emat' is appended automatically

Используется в Init().

◆ GetMaterial()

Material GetMaterial ( )
inlineprotected
42 {
43 return m_Material;
44 }

Перекрестные ссылки m_Material.

◆ GetParameterCommandData()

PPEMatClassParameterCommandData GetParameterCommandData ( int parameter_idx)
inlineprotected

Some PP effects are handled as hard-coded exceptions, outside of material system. Default == PPEExceptions.NONE (systemic behaviour)

351 {
353 }

Перекрестные ссылки m_MaterialParamMapStructure.

Используется в PPEDOF::SetFinalParameterValue(), PPEExposureNative::SetFinalParameterValue(), PPEEyeAccomodationNative::SetFinalParameterValue(), PPELightIntensityParamsNative::SetFinalParameterValue() и SetFinalParameterValue().

◆ GetPostProcessEffectID()

int GetPostProcessEffectID ( )
inlineprotected

◆ Init()

void Init ( string mat_path_override = "")
inlineprotected
23 {
24 if (mat_path_override != "")
25 {
27 }
28 else
29 {
31 }
33 }
PPEManager m_Manager
Definition PPEMatClassesBase.c:4
string GetDefaultMaterialPath()
override this if you want to use different path by default; '.emat' is appended automatically
Static component of PPE manager, used to hold the instance.
Definition PPEManager.c:3
static PPEManager GetPPEManager()
Returns the manager instance singleton.
Definition PPEManager.c:27

Перекрестные ссылки GetDefaultMaterialPath(), PPEManagerStatic::GetPPEManager(), m_Manager и m_MaterialPath.

◆ InsertParamValueData()

void InsertParamValueData ( PPERequestParamDataBase request_data)
inlineprotected

Distributes requester data to the material class structure and links them to appropriate parameter.

152 {
154 bool exists = m_MaterialParamMapStructure.Find(request_data.GetParameterID(),param_data);
155 if ( !exists )
156 {
157 Error("PPEClassBase | InsertParamValueData | mat/par/req: " + GetPostProcessEffectID() + "/" + request_data.GetParameterID() + "/" + request_data.GetRequesterIDX() + " not registered in m_MaterialParamMapStructure!");
158 return;
159 }
160
161 request_data.SetDataActive(true);
162 request_data.SetUpdatingDataValues(true); //marks request data as updating
163 param_data.InsertRequestData(request_data);//<request_ID, data>
164
165 //DbgPrnt("PPEDebug | InsertParamValueData | mat/par/req: " + GetPostProcessEffectID() + "/" + request_data.GetParameterID() + "/" + request_data.GetRequesterIDX() + " | requester: " + request_data.m_Requester);
166 }
int GetPostProcessEffectID()
Overriden in all material classes!
Definition PPEMatClassesBase.c:339
Definition PPEMatClassParameterBool.c:2
void Error(string err)
Messagebox with error message.
Definition EnDebug.c:90

Перекрестные ссылки Error(), GetPostProcessEffectID() и m_MaterialParamMapStructure.

◆ InsertUpdatedParameter()

void InsertUpdatedParameter ( int mat_id)
inlineprotected
282 {
283 if ( m_UpdatedParameters.Find(mat_id) == -1 )
285 }

Перекрестные ссылки m_UpdatedParameters.

Используется в OnUpdate().

◆ OnUpdate()

void OnUpdate ( float timeslice,
int order )
inlineprotected

generic update method, take care when overriding!

202 {
203 int parameter_idx = -1;
204 //DbgPrnt("PPEDebug | PPEClassBase - OnUpdate | mat_id: " + GetPostProcessEffectID());
205
206 if ( m_ParameterUpdateQueueMap.Contains(order) )
207 {
208 //Print(m_ParameterUpdateQueueMap.Get(order));
209 for ( int i = 0; i < m_ParameterUpdateQueueMap.Get(order).Count(); i++ )
210 {
211 //DbgPrnt("PPEDebug | PPEClassBase - OnUpdate | parameter_idx: " + m_ParameterUpdateQueue.Get(i));
212 Param p_values; //TODO - move to material classes?
213 bool setting_defaults = false;
216
218 }
219 m_Manager.InsertUpdatedMaterial(GetPostProcessEffectID());
220
222 }
223 /*if ( !m_ParameterUpdateQueueMap.Contains(order) || m_ParameterUpdateQueueMap.Get(order).Count() < 1 )
224 m_Manager.RemoveMaterialUpdating(GetPostProcessEffectID(),order); //stops material from updating when no parameters are.*/
225 }
@ Count
Definition RandomGeneratorSyncManager.c:8
void InsertUpdatedParameter(int mat_id)
Definition PPEMatClassesBase.c:281
void ParamUpdateQueueCleanup(int order)
Definition PPEMatClassesBase.c:308
Base Param Class with no parameters. Used as general purpose parameter overloaded with Param1 to Para...
Definition param.c:12

Перекрестные ссылки Count, GetPostProcessEffectID(), InsertUpdatedParameter(), m_Manager, m_MaterialParamMapStructure, m_ParameterUpdateQueueMap и ParamUpdateQueueCleanup().

◆ ParamUpdateQueueCleanup()

void ParamUpdateQueueCleanup ( int order)
inlineprotected
309 {
310 //DbgPrnt("PPEDebug | PPEClassBase - ParamUpdateQueueCleanup | mat_id: " + GetPostProcessEffectID() + " | UpdateQueue count: " + m_ParameterUpdateQueue.Count());
311 //DbgPrnt("PPEDebug | PPEClassBase - ParamUpdateQueueCleanup | mat_id: " + GetPostProcessEffectID() + " | RemovalQueue count: " + m_ParameterRemovalQueue.Count());
312 for ( int i = 0; i < m_ParameterUpdateQueueMap.Get(order).Count(); i++ )
313 {
314 if ( m_ParameterRemovalQueue.Find(m_ParameterUpdateQueueMap.Get(order).Get(i)) != -1 )
315 {
316 //DbgPrnt("PPEDebug | PPEClassBase - ParamUpdateQueueCleanup | removing update of: " + m_ParameterUpdateQueue.Get(i));
317 //m_ParameterUpdateQueue.RemoveItem(m_ParameterUpdateQueue.Get(i));
318 }
319 }
320 m_ParameterUpdateQueueMap.Get(order).Clear();
321 }

Перекрестные ссылки Count, m_ParameterRemovalQueue и m_ParameterUpdateQueueMap.

Используется в OnUpdate().

◆ ParamUpdateRemove()

void ParamUpdateRemove ( int parameter_idx)
inlineprotected

Queue selected parameter for removal from the update queue.

289 {
290 if ( m_ParameterRemovalQueue.Find(parameter_idx) == -1 )
292 }

Перекрестные ссылки m_ParameterRemovalQueue.

◆ RegisterMaterialParameters()

void RegisterMaterialParameters ( )
protected

inserted into associative array by parameter int value, parameter registration order does not matter (still ordered, though)

Используется в PPEClassBase().

◆ RegisterParameterColor()

void RegisterParameterColor ( int idx,
string parameter_name,
float r,
float g,
float b,
float a )
inlineprotected

WARNING - min/max values are usually taken from Workbench defaults, may not be actual min/max values the renderer can handle! When in doubt, try some higher/lower values...

103 {
106 parameter_data.RegisterDefaults(p);
108 }
Param5< string, float, float, float, float > PPETemplateDefColor
Definition PPEConstants.c:88
void PPEMatClassParameterColor(int mat_idx, int parameter_idx, PPEClassBase parent)
Definition PPEMatClassParameterColor.c:48
Definition PPEMatClassParameterColor.c:318

Перекрестные ссылки GetPostProcessEffectID(), m_MaterialParamMapStructure и PPEMatClassParameterColor().

Используется в PPEColors::RegisterMaterialParameters(), PPEDistort::RegisterMaterialParameters(), PPEGhost::RegisterMaterialParameters() и PPEGlow::RegisterMaterialParameters().

◆ RegisterParameterColorEx()

void RegisterParameterColorEx ( int idx,
string parameter_name,
float r,
float g,
float b,
float a,
typename type  )
inlineprotected

WARNING - min/max values are usually taken from Workbench defaults, may not be actual min/max values the renderer can handle! When in doubt, try some higher/lower values...

112 {
115 bool boo = Class.CastTo(parameter_data,type.Spawn());
116 //Print("RegisterParameterColorEx: " + boo );
117 parameter_data.RegisterDefaults(p);
118 parameter_data.SetMaterialIndex(GetPostProcessEffectID());
119 parameter_data.SetParameterIndex(idx);
120 parameter_data.SetParent(this);
122 }
Super root of all classes in Enforce script.
Definition EnScript.c:11
static proto bool CastTo(out Class to, Class from)
Try to safely down-cast base class to child class.

Перекрестные ссылки Class::CastTo(), GetPostProcessEffectID() и m_MaterialParamMapStructure.

Используется в PPEColors::RegisterMaterialParameters() и PPEGlow::RegisterMaterialParameters().

◆ RegisterParameterResource()

void RegisterParameterResource ( int idx,
string parameter_name,
string default_path )
inlineprotected

◆ RegisterParameterScalarBool()

void RegisterParameterScalarBool ( int idx,
string parameter_name,
bool default_value )
inlineprotected

◆ RegisterParameterScalarFloat()

void RegisterParameterScalarFloat ( int idx,
string parameter_name,
float default_value,
float min,
float max )
inlineprotected

WARNING - min/max values are usually taken from Workbench defaults, may not be actual min/max values the renderer can handle! When in doubt, try some higher/lower values...

78 {
80
82 parameter_data.RegisterDefaults(p);
84 }
Param4< string, float, float, float > PPETemplateDefFloat
Definition PPEConstants.c:87
void PPEMatClassParameterFloat(int mat_idx, int parameter_idx, PPEClassBase parent)
Definition PPEMatClassParameterFloat.c:252

Перекрестные ссылки GetPostProcessEffectID(), m_MaterialParamMapStructure и PPEMatClassParameterFloat().

Используется в PPEDOF::RegisterMaterialParameters(), PPEExposureNative::RegisterMaterialParameters(), PPEEyeAccomodationNative::RegisterMaterialParameters(), PPELightIntensityParamsNative::RegisterMaterialParameters(), PPEChromAber::RegisterMaterialParameters(), PPEColors::RegisterMaterialParameters(), PPEDepthOfField::RegisterMaterialParameters(), PPEDistort::RegisterMaterialParameters(), PPEDynamicBlur::RegisterMaterialParameters(), PPEFilmGrain::RegisterMaterialParameters(), PPEGaussFilter::RegisterMaterialParameters(), PPEGhost::RegisterMaterialParameters(), PPEGlow::RegisterMaterialParameters(), PPEGodRays::RegisterMaterialParameters(), PPEHBAO::RegisterMaterialParameters(), PPERadialBlur::RegisterMaterialParameters(), PPERain::RegisterMaterialParameters(), PPERotBlur::RegisterMaterialParameters(), PPESnowfall::RegisterMaterialParameters(), PPESSAO::RegisterMaterialParameters(), PPEUnderWater::RegisterMaterialParameters() и PPEWetDistort::RegisterMaterialParameters().

◆ RegisterParameterScalarFloatEx()

void RegisterParameterScalarFloatEx ( int idx,
string parameter_name,
float default_value,
float min,
float max,
typename type  )
inlineprotected

WARNING - min/max values are usually taken from Workbench defaults, may not be actual min/max values the renderer can handle! When in doubt, try some higher/lower values...

88 {
90
92 bool boo = Class.CastTo(parameter_data,type.Spawn());
93 //Print("RegisterParameterColorEx: " + boo );
94 parameter_data.RegisterDefaults(p);
95 parameter_data.SetMaterialIndex(GetPostProcessEffectID());
96 parameter_data.SetParameterIndex(idx);
97 parameter_data.SetParent(this);
99 }

Перекрестные ссылки Class::CastTo(), GetPostProcessEffectID(), m_MaterialParamMapStructure и PPEMatClassParameterFloat().

Используется в PPEColors::RegisterMaterialParameters() и PPEGlow::RegisterMaterialParameters().

◆ RegisterParameterScalarInt()

void RegisterParameterScalarInt ( int idx,
string parameter_name,
int default_value,
int min,
int max )
inlineprotected

◆ RegisterParameterTexture()

void RegisterParameterTexture ( int idx,
string parameter_name,
string default_path )
inlineprotected
134 {
137 parameter_data.RegisterDefaults(p);
139 }
Param2< string, string > PPETemplateDefTexture
Definition PPEConstants.c:91

Перекрестные ссылки GetPostProcessEffectID() и m_MaterialParamMapStructure.

◆ RegisterParameterVector()

void RegisterParameterVector ( int idx,
string parameter_name,
array< float > default_values )
inlineprotected
125 {
128 parameter_data.RegisterDefaults(p);
130 }
Param2< string, ref array< float > > PPETemplateDefVector
Definition PPEConstants.c:90

Перекрестные ссылки GetPostProcessEffectID() и m_MaterialParamMapStructure.

Используется в PPEColors::RegisterMaterialParameters() и PPEGlow::RegisterMaterialParameters().

◆ RemoveRequest()

void RemoveRequest ( int req_idx)
inlineprotected

unused, see 'RemoveActiveRequestFromMaterials' for more info

171 {
172 /*for (int i = 0; i < m_ActiveMaterialRequestMap.Count(); i++)
173 {
174 ActiveParameterRequestsMap dbg = m_ActiveMaterialRequestMap.Get(i);
175 //DbgPrnt("PPEDebug | dbg size: " + dbg.Count());
176
177 if ( m_ActiveMaterialRequestMap.Get(i).Contains(req_idx) )
178 {
179 m_ActiveMaterialRequestMap.Get(i).Remove(req_idx);
180
181 dbg = m_ActiveMaterialRequestMap.Get(i);
182
183 if ( !m_ActiveMaterialRequestMap.Get(i) || m_ActiveMaterialRequestMap.Get(i).Count() < 1 )
184 {
185 if (m_ParameterUpdateQueue.IsValidIndex(i))
186 {
187 DbgPrnt("PPEDebug | PPEClassBase - RemoveRequest | Removing: " + i);
188 DbgPrnt("PPEDebug | PPEClassBase - RemoveRequest | exit 4 - last request removal");
189 m_ParameterRemovalQueue.Insert(m_ParameterUpdateQueue.Get(i));
190 }
191 else
192 DbgPrnt("PPEDebug | PPEClassBase - RemoveRequest | Update queue no. " + i + " already removed!");
193 }
194 }
195 //Adds to update one more time
196 m_Manager.SetMaterialParamUpdating(GetPostProcessEffectID(),i);
197 }*/
198 }

◆ SetFinalParameterValue()

void SetFinalParameterValue ( int parameter_idx)
inlineprotected

Clamps the values being set to defaults, if there is no request setting non-zero values on the parameter.

229 {
232
233 switch (var_type)
234 {
235 case PPEConstants.VAR_TYPE_BOOL:
236 bool value_var_bool = Param1<bool>.Cast(values).param1;
237
239 //Print("DebugValues | PPEConstants.VAR_TYPE_BOOL | bool val: " + value_var_bool);
240 break;
241
242 case PPEConstants.VAR_TYPE_INT:
243 int value_var_int = Param1<int>.Cast(values).param1;
244
246 //Print("DebugValues | PPEConstants.VAR_TYPE_BOOL | bool val: " + value_var_bool);
247 break;
248
249 case PPEConstants.VAR_TYPE_FLOAT:
250 float value_var_float = Param1<float>.Cast(values).param1;
251
253 //Print("DebugValues | PPEConstants.VAR_TYPE_FLOAT | float val: " + value_var_float);
254 break;
255
256 case PPEConstants.VAR_TYPE_COLOR:
257 float color[4] = {0,0,0,0};
262
264 //Print("DebugValues | PPEConstants.VAR_TYPE_COLOR | color val:: " + color[0] + " " + color[1] + " " + color[2] + " " + color[3]);
265 break;
266 }
267 }
proto void SetParamByIndex(int paramIndex, void value)
PPEMatClassParameterCommandData GetParameterCommandData(int parameter_idx)
Some PP effects are handled as hard-coded exceptions, outside of material system. Default == PPEExcep...
Definition PPEMatClassesBase.c:350
Param GetCurrentValues()
Careful, only actual values, WITHOUT string.
Definition PPEMatClassParameterCommandData.c:122
override int GetParameterVarType()
Definition PPEMatClassParameterBool.c:24

Перекрестные ссылки PPEMatClassParameterCommandData::GetCurrentValues(), GetParameterCommandData(), PPEMatClassParameterCommandData::GetParameterVarType(), m_Material и Material::SetParamByIndex().

Используется в ApplyValueChanges().

◆ SetParameterUpdating()

void SetParameterUpdating ( int order,
int parameter_id )
inlineprotected

Queue specific parameter of this material to update.

296 {
297 if ( !m_ParameterUpdateQueueMap.Contains(order) )
298 {
300 }
301
302 if ( m_ParameterUpdateQueueMap.Get(order).Find(parameter_id) == -1 )
303 {
305 }
306 }

Перекрестные ссылки m_ParameterUpdateQueueMap.

Поля

◆ m_Manager

PPEManager m_Manager
protected

Используется в Init() и OnUpdate().

◆ m_Material

Material m_Material
protected

◆ m_MaterialParamMapStructure

◆ m_MaterialPath

string m_MaterialPath = ""
protected

◆ m_ParameterRemovalQueue

ref array<int> m_ParameterRemovalQueue
protected

◆ m_ParameterUpdateQueueMap

ref map<int, ref array<int> > m_ParameterUpdateQueueMap
protected

◆ m_UpdatedParameters


Объявления и описания членов класса находятся в файле: