DayZ 1.24
Loading...
Searching...
No Matches
PPEMatClassParameterFloat.c File Reference

Go to the source code of this file.

Classes

class  PPEMatClassParameterCommandData
 

Functions

class PPEMatClassParameterFloat extends PPEMatClassParameterCommandData PPEMatClassParameterFloatSaturation (int mat_idx, int parameter_idx, PPEClassBase parent)
 
void PPEMatClassParameterFloat (int mat_idx, int parameter_idx, PPEClassBase parent)
 
override void InitDefaults ()
 
override void InitCuttent ()
 
override int GetParameterVarType ()
 
override void Update (float timeslice, out Param p_total, out bool setting_defaults, int order)
 
void PrepareLayerInfo (int layer, float value, int operator)
 
override void SetParameterValueDefault (inout Param p_total)
 No active requests for the mat. parameter value change, sets the value to DEFAULT (zero?)
 

Variables

ref map< int, ref array< float, int > > m_LayerInfo
 
PPETemplateDefFloat m_Float
 
float m_ValueDefault
 
float m_ValueMin
 
float m_ValueMax
 

Function Documentation

◆ GetParameterVarType()

override int PPEMatClassParameterFloatSaturation::GetParameterVarType ( )
protected

Definition at line 263 of file PPEMatClassParameterFloat.c.

◆ InitCuttent()

override void PPEMatClassParameterFloatSaturation::InitCuttent ( )
protected

Definition at line 258 of file PPEMatClassParameterFloat.c.

259{
260 protected ref map<int, ref array<float, int>> m_LayerInfo; //<priority,<value,operator>>
261
263 protected float m_ValueDefault;
264 protected float m_ValueMin;
265 protected float m_ValueMax;
266
268 {
270 }
271
272 override void InitDefaults()
273 {
274 Class.CastTo(m_Float, m_Defaults);
275 //m_Float = PPETemplateDefFloat.Cast(m_Defaults);
276 m_ValueDefault = m_Float.param2;
277 m_ValueMin = m_Float.param3;
278 m_ValueMax = m_Float.param4;
279 }
280
281 override void InitCuttent()
282 {
283 m_CurrentValues = new Param1<float>(m_ValueDefault);
284 }
285
286 override int GetParameterVarType()
287 {
288 return PPEConstants.VAR_TYPE_FLOAT;
289 }
290
291 override void Update(float timeslice, out Param p_total, out bool setting_defaults, int order)
292 {
294
295 int active_request_count = 0;
296
298
299 bool setting_value_zero = false;
300
301 float float_value_temp = 0.0;
302 float float_value_default = 0.0;
303 float float_value_total = 0.0;
304
305 if (p_total == null)
306 p_total = new Param1<float>(0.0);
307
308 if (m_RequestMap.Count() > 0)
309 m_LayerInfo.Clear();
310 else
311 {
312 //DbgPrnt("m_RequestMap.Count() is zero! Using default values. | mat/par: " + m_MaterialIndex + "/" + m_ParameterIndex);
314 m_Parent.ParamUpdateRemove(m_ParameterIndex);
315 return;
316 }
317
318 for (int i = 0; i < m_RequestMap.Count(); i++)
319 {
320 req_data = PPERequestParamDataFloat.Cast(m_RequestMap.GetElement(i));
321
322 if (req_data == null)
323 {
324 Error("Debug | PPEMatClassParameterFloat | req_data not found! | " + this + " | mat/par: " + m_MaterialIndex + "/" + m_ParameterIndex);
325 continue;
326 }
327
328 setting_value_zero = req_data.IsSettingDefaultValues();
329
330 if (setting_value_zero && !req_data.GetUpdatingDataValues() && !req_data.IsDataActive())
331 {
332 //DbgPrnt("Is Default, not updating | idx: " + i + " | mat/par/req: " + m_MaterialIndex + "/" + m_ParameterIndex + "/" + req_data.GetRequesterIDX());
333 continue;
334 }
335
337 {
338 req_data.m_FloatTarget = 0;//min;
339 //DbgPrnt("PPEDebug | PPEMatClassParameterFloat - UpdateParameterValues | !data.m_DefaultTargetSet | mat/par/req: " + m_MaterialIndex + "/" + m_ParameterIndex + "/" + req_data.GetRequesterIDX() + " | req_data.m_FloatTarget: " + req_data.m_FloatTarget);
340 }
341 else
343
344 //evaluation
345 //--------------------------------
346 req_data.m_FloatLast = req_data.m_FloatCurrent;
347
348 if (!req_data.GetUpdatingDataValues() && req_data.IsDataActive()) //set to exact value, not updating anymore
349 {
350 float_value_temp = req_data.m_FloatCurrent;
351 PrepareLayerInfo(req_data.GetPriorityLayer(), float_value_temp, req_data.GetInteractionMask());
352 //DbgPrnt("PPEDebug | PPEMatClassParameterFloat - UpdateParameterValues | !req_data.m_UpdatingData | mat/par/req: " + m_MaterialIndex + "/" + m_ParameterIndex + "/" + req_data.GetRequesterIDX() + " | not updating, addaing current value into mix: " + float_value_temp);
353 continue;
354 }
355
356 float_value_temp = req_data.m_FloatTarget;
357
358 //DbgPrnt("PPEDebug | PPEMatClassParameterFloat - UpdateParameterValues | mat/par/req: " + m_MaterialIndex + "/" + m_ParameterIndex + "/" + req_data.GetRequesterIDX());
359 req_data.SetUpdatingDataValues(false);
361 {
362 req_data.SetDataActive(false);
363 //RemovePriorityInfo(req_data.GetPriorityLayer()); //redundant?
364 }
365 else
366 {
367 float_value_temp = req_data.m_FloatTarget;
368 PrepareLayerInfo(req_data.GetPriorityLayer(), float_value_temp, req_data.GetInteractionMask());
369 }
370
371 req_data.m_FloatCurrent = float_value_temp;
372 }
373
374 //---------------------------
375 //MASK handling and calculation
376 float value;
377 int operator;
378 bool override_active = false;
379
380 if (m_ValueMax == 0.0)
382 else
384
385 //float_value_total = Math.InverseLerp(m_ValueMin,m_ValueMax,m_ValueDefault);
387
388 for (i = 0; i < m_LayerInfo.Count(); i++)
389 {
390 if (override_active)
391 break;
392
393 value = m_LayerInfo.Get(m_CommandLayersArray.Get(i)).Get(LAYER_INFO_VALUE);
394 operator = m_LayerInfo.Get(m_CommandLayersArray.Get(i)).Get(LAYER_INFO_OPERATOR);
395
396 switch (operator)
397 {
398 case PPOperators.LOWEST:
400 break;
401
402 case PPOperators.HIGHEST:
404 break;
405
406 case PPOperators.ADD:
407 //float_value_total = float_value_total + value - float_value_default;
409 break;
410
411 case PPOperators.ADD_RELATIVE:
413 break;
414
415 case PPOperators.SUBSTRACT:
416 //float_value_total = float_value_total - value + float_value_default;
418 break;
419
420 case PPOperators.SUBSTRACT_RELATIVE:
422 break;
423
424 case PPOperators.SUBSTRACT_REVERSE:
425 //float_value_total = value - float_value_default - float_value_total;
427 break;
428
429 case PPOperators.SUBSTRACT_REVERSE_RELATIVE:
431 break;
432
433 case PPOperators.MULTIPLICATIVE:
434 //float_value_total = Math.Lerp(float_value_default, float_value_total, value);
436 break;
437
438 case PPOperators.OVERRIDE:
440 break;
441
442 case PPOperators.SET:
444 break;
445 }
446
447 //DbgPrnt("m_LayerInfo | float_value_total pre-clamp: " + float_value_total + " | i: " + i);
449
450 if (operator == PPOperators.OVERRIDE)
451 {
452 //DbgPrnt("m_LayerInfo | PPOperators.OVERRIDE at: " + i);
453 override_active = true;
454 }
455
456 //RemovePriorityInfo(m_CommandLayersArray.Get(i));
457 }
458
459 m_CommandLayersArray.Clear();
460
461 //TODO - consider moving this up, if possible
462 if (active_request_count == 0)
464 else
465 {
467 Param1<float>.Cast(p_total).param1 = res; //converts back to absolute values
468 }
469
470 //DbgPrnt("PPEDebug | PPEMatClassParameterFloat - UpdateParameterValues | mat/par/req: " + m_MaterialIndex + "/" + m_ParameterIndex + "/" + req_data.GetRequesterIDX() + " | parameter update end, removing from queue");
471 m_Parent.ParamUpdateRemove(m_ParameterIndex);
472
473 m_CurrentValues = p_total;
474 }
475
476 void PrepareLayerInfo(int layer, float value, int operator)
477 {
478 m_LayerInfo.Set(layer, {value, operator});
479 AddPriorityInfo(layer);
480 }
481
484 {
485 p_total = new Param1<float>(PPETemplateDefFloat.Cast(m_Defaults).param2);
486 m_CurrentValues = p_total;
487 //DbgPrnt("PPEDebug | PPEMatClassParameterFloat - UpdateParameterValues | exit 3 - zero value");
488 }
489}
490
492{
494 {
495 m_Dependencies = new map<int, ref array<int>>;
496 m_Dependencies.Set(PostProcessEffectType.Glow, {PPEGlow.PARAM_COLORIZATIONCOLOR, PPEGlow.PARAM_OVERLAYCOLOR});
497 }
498}
PPOperators
PP operators, specify operation between subsequent layers.
override void SetParameterValueDefault(inout Param p_total)
No active requests for the mat. parameter value change, sets the value to DEFAULT (zero?...
class PPEMatClassParameterFloat extends PPEMatClassParameterCommandData PPEMatClassParameterFloatSaturation(int mat_idx, int parameter_idx, PPEClassBase parent)
override void InitCuttent()
override int GetParameterVarType()
void PPEMatClassParameterFloat(int mat_idx, int parameter_idx, PPEClassBase parent)
void PrepareLayerInfo(int layer, float value, int operator)
float m_ValueDefault
ref map< int, ref array< float, int > > m_LayerInfo
PPETemplateDefFloat m_Float
override void InitDefaults()
void PPERequestParamDataFloat(int requester_idx, int mat_id, int param_id, int data_type=0, int priority=0, int mask=PPOperators.SET, bool relative=false)
Widget m_Parent
Definition SizeToChild.c:86
Super root of all classes in Enforce script.
Definition EnScript.c:11
Definition EnMath.c:7
Created once, on manager init. Script-side representation of C++ material class, separate handling.
Base Param Class with no parameters. Used as general purpose parameter overloaded with Param1 to Para...
Definition param.c:12
PostProcessEffectType
Post-process effect type.
Definition EnWorld.c:72
void Error(string err)
Messagebox with error message.
Definition EnDebug.c:90
static proto bool CastTo(out Class to, Class from)
Try to safely down-cast base class to child class.
static proto float Max(float x, float y)
Returns bigger of two given values.
static proto float Lerp(float a, float b, float time)
Linearly interpolates between 'a' and 'b' given 'time'.
static proto float Min(float x, float y)
Returns smaller of two given values.
static proto float Clamp(float value, float min, float max)
Clamps 'value' to 'min' if it is lower than 'min', or to 'max' if it is higher than 'max'.
proto native volatile void Update()

◆ InitDefaults()

override void PPEMatClassParameterFloatSaturation::InitDefaults ( )
protected

Definition at line 249 of file PPEMatClassParameterFloat.c.

250{
251 protected ref map<int, ref array<float, int>> m_LayerInfo; //<priority,<value,operator>>
252
254 protected float m_ValueDefault;
255 protected float m_ValueMin;
256 protected float m_ValueMax;
257
259 {
261 }
262
263 override void InitDefaults()
264 {
265 Class.CastTo(m_Float, m_Defaults);
266 //m_Float = PPETemplateDefFloat.Cast(m_Defaults);
267 m_ValueDefault = m_Float.param2;
268 m_ValueMin = m_Float.param3;
269 m_ValueMax = m_Float.param4;
270 }
271
272 override void InitCuttent()
273 {
274 m_CurrentValues = new Param1<float>(m_ValueDefault);
275 }
276
277 override int GetParameterVarType()
278 {
279 return PPEConstants.VAR_TYPE_FLOAT;
280 }
281
282 override void Update(float timeslice, out Param p_total, out bool setting_defaults, int order)
283 {
285
286 int active_request_count = 0;
287
289
290 bool setting_value_zero = false;
291
292 float float_value_temp = 0.0;
293 float float_value_default = 0.0;
294 float float_value_total = 0.0;
295
296 if (p_total == null)
297 p_total = new Param1<float>(0.0);
298
299 if (m_RequestMap.Count() > 0)
300 m_LayerInfo.Clear();
301 else
302 {
303 //DbgPrnt("m_RequestMap.Count() is zero! Using default values. | mat/par: " + m_MaterialIndex + "/" + m_ParameterIndex);
305 m_Parent.ParamUpdateRemove(m_ParameterIndex);
306 return;
307 }
308
309 for (int i = 0; i < m_RequestMap.Count(); i++)
310 {
311 req_data = PPERequestParamDataFloat.Cast(m_RequestMap.GetElement(i));
312
313 if (req_data == null)
314 {
315 Error("Debug | PPEMatClassParameterFloat | req_data not found! | " + this + " | mat/par: " + m_MaterialIndex + "/" + m_ParameterIndex);
316 continue;
317 }
318
319 setting_value_zero = req_data.IsSettingDefaultValues();
320
321 if (setting_value_zero && !req_data.GetUpdatingDataValues() && !req_data.IsDataActive())
322 {
323 //DbgPrnt("Is Default, not updating | idx: " + i + " | mat/par/req: " + m_MaterialIndex + "/" + m_ParameterIndex + "/" + req_data.GetRequesterIDX());
324 continue;
325 }
326
328 {
329 req_data.m_FloatTarget = 0;//min;
330 //DbgPrnt("PPEDebug | PPEMatClassParameterFloat - UpdateParameterValues | !data.m_DefaultTargetSet | mat/par/req: " + m_MaterialIndex + "/" + m_ParameterIndex + "/" + req_data.GetRequesterIDX() + " | req_data.m_FloatTarget: " + req_data.m_FloatTarget);
331 }
332 else
334
335 //evaluation
336 //--------------------------------
337 req_data.m_FloatLast = req_data.m_FloatCurrent;
338
339 if (!req_data.GetUpdatingDataValues() && req_data.IsDataActive()) //set to exact value, not updating anymore
340 {
341 float_value_temp = req_data.m_FloatCurrent;
342 PrepareLayerInfo(req_data.GetPriorityLayer(), float_value_temp, req_data.GetInteractionMask());
343 //DbgPrnt("PPEDebug | PPEMatClassParameterFloat - UpdateParameterValues | !req_data.m_UpdatingData | mat/par/req: " + m_MaterialIndex + "/" + m_ParameterIndex + "/" + req_data.GetRequesterIDX() + " | not updating, addaing current value into mix: " + float_value_temp);
344 continue;
345 }
346
347 float_value_temp = req_data.m_FloatTarget;
348
349 //DbgPrnt("PPEDebug | PPEMatClassParameterFloat - UpdateParameterValues | mat/par/req: " + m_MaterialIndex + "/" + m_ParameterIndex + "/" + req_data.GetRequesterIDX());
350 req_data.SetUpdatingDataValues(false);
352 {
353 req_data.SetDataActive(false);
354 //RemovePriorityInfo(req_data.GetPriorityLayer()); //redundant?
355 }
356 else
357 {
358 float_value_temp = req_data.m_FloatTarget;
359 PrepareLayerInfo(req_data.GetPriorityLayer(), float_value_temp, req_data.GetInteractionMask());
360 }
361
362 req_data.m_FloatCurrent = float_value_temp;
363 }
364
365 //---------------------------
366 //MASK handling and calculation
367 float value;
368 int operator;
369 bool override_active = false;
370
371 if (m_ValueMax == 0.0)
373 else
375
376 //float_value_total = Math.InverseLerp(m_ValueMin,m_ValueMax,m_ValueDefault);
378
379 for (i = 0; i < m_LayerInfo.Count(); i++)
380 {
381 if (override_active)
382 break;
383
384 value = m_LayerInfo.Get(m_CommandLayersArray.Get(i)).Get(LAYER_INFO_VALUE);
385 operator = m_LayerInfo.Get(m_CommandLayersArray.Get(i)).Get(LAYER_INFO_OPERATOR);
386
387 switch (operator)
388 {
389 case PPOperators.LOWEST:
391 break;
392
393 case PPOperators.HIGHEST:
395 break;
396
397 case PPOperators.ADD:
398 //float_value_total = float_value_total + value - float_value_default;
400 break;
401
402 case PPOperators.ADD_RELATIVE:
404 break;
405
406 case PPOperators.SUBSTRACT:
407 //float_value_total = float_value_total - value + float_value_default;
409 break;
410
411 case PPOperators.SUBSTRACT_RELATIVE:
413 break;
414
415 case PPOperators.SUBSTRACT_REVERSE:
416 //float_value_total = value - float_value_default - float_value_total;
418 break;
419
420 case PPOperators.SUBSTRACT_REVERSE_RELATIVE:
422 break;
423
424 case PPOperators.MULTIPLICATIVE:
425 //float_value_total = Math.Lerp(float_value_default, float_value_total, value);
427 break;
428
429 case PPOperators.OVERRIDE:
431 break;
432
433 case PPOperators.SET:
435 break;
436 }
437
438 //DbgPrnt("m_LayerInfo | float_value_total pre-clamp: " + float_value_total + " | i: " + i);
440
441 if (operator == PPOperators.OVERRIDE)
442 {
443 //DbgPrnt("m_LayerInfo | PPOperators.OVERRIDE at: " + i);
444 override_active = true;
445 }
446
447 //RemovePriorityInfo(m_CommandLayersArray.Get(i));
448 }
449
450 m_CommandLayersArray.Clear();
451
452 //TODO - consider moving this up, if possible
453 if (active_request_count == 0)
455 else
456 {
458 Param1<float>.Cast(p_total).param1 = res; //converts back to absolute values
459 }
460
461 //DbgPrnt("PPEDebug | PPEMatClassParameterFloat - UpdateParameterValues | mat/par/req: " + m_MaterialIndex + "/" + m_ParameterIndex + "/" + req_data.GetRequesterIDX() + " | parameter update end, removing from queue");
462 m_Parent.ParamUpdateRemove(m_ParameterIndex);
463
464 m_CurrentValues = p_total;
465 }
466
467 void PrepareLayerInfo(int layer, float value, int operator)
468 {
469 m_LayerInfo.Set(layer, {value, operator});
470 AddPriorityInfo(layer);
471 }
472
475 {
476 p_total = new Param1<float>(PPETemplateDefFloat.Cast(m_Defaults).param2);
477 m_CurrentValues = p_total;
478 //DbgPrnt("PPEDebug | PPEMatClassParameterFloat - UpdateParameterValues | exit 3 - zero value");
479 }
480}
481
483{
485 {
486 m_Dependencies = new map<int, ref array<int>>;
487 m_Dependencies.Set(PostProcessEffectType.Glow, {PPEGlow.PARAM_COLORIZATIONCOLOR, PPEGlow.PARAM_OVERLAYCOLOR});
488 }
489}

◆ PPEMatClassParameterFloat()

void PPEMatClassParameterFloatSaturation::PPEMatClassParameterFloat ( int mat_idx,
int parameter_idx,
PPEClassBase parent )
protected

Definition at line 244 of file PPEMatClassParameterFloat.c.

245{
246 protected ref map<int, ref array<float, int>> m_LayerInfo; //<priority,<value,operator>>
247
249 protected float m_ValueDefault;
250 protected float m_ValueMin;
251 protected float m_ValueMax;
252
254 {
256 }
257
258 override void InitDefaults()
259 {
260 Class.CastTo(m_Float, m_Defaults);
261 //m_Float = PPETemplateDefFloat.Cast(m_Defaults);
262 m_ValueDefault = m_Float.param2;
263 m_ValueMin = m_Float.param3;
264 m_ValueMax = m_Float.param4;
265 }
266
267 override void InitCuttent()
268 {
269 m_CurrentValues = new Param1<float>(m_ValueDefault);
270 }
271
272 override int GetParameterVarType()
273 {
274 return PPEConstants.VAR_TYPE_FLOAT;
275 }
276
277 override void Update(float timeslice, out Param p_total, out bool setting_defaults, int order)
278 {
280
281 int active_request_count = 0;
282
284
285 bool setting_value_zero = false;
286
287 float float_value_temp = 0.0;
288 float float_value_default = 0.0;
289 float float_value_total = 0.0;
290
291 if (p_total == null)
292 p_total = new Param1<float>(0.0);
293
294 if (m_RequestMap.Count() > 0)
295 m_LayerInfo.Clear();
296 else
297 {
298 //DbgPrnt("m_RequestMap.Count() is zero! Using default values. | mat/par: " + m_MaterialIndex + "/" + m_ParameterIndex);
300 m_Parent.ParamUpdateRemove(m_ParameterIndex);
301 return;
302 }
303
304 for (int i = 0; i < m_RequestMap.Count(); i++)
305 {
306 req_data = PPERequestParamDataFloat.Cast(m_RequestMap.GetElement(i));
307
308 if (req_data == null)
309 {
310 Error("Debug | PPEMatClassParameterFloat | req_data not found! | " + this + " | mat/par: " + m_MaterialIndex + "/" + m_ParameterIndex);
311 continue;
312 }
313
314 setting_value_zero = req_data.IsSettingDefaultValues();
315
316 if (setting_value_zero && !req_data.GetUpdatingDataValues() && !req_data.IsDataActive())
317 {
318 //DbgPrnt("Is Default, not updating | idx: " + i + " | mat/par/req: " + m_MaterialIndex + "/" + m_ParameterIndex + "/" + req_data.GetRequesterIDX());
319 continue;
320 }
321
323 {
324 req_data.m_FloatTarget = 0;//min;
325 //DbgPrnt("PPEDebug | PPEMatClassParameterFloat - UpdateParameterValues | !data.m_DefaultTargetSet | mat/par/req: " + m_MaterialIndex + "/" + m_ParameterIndex + "/" + req_data.GetRequesterIDX() + " | req_data.m_FloatTarget: " + req_data.m_FloatTarget);
326 }
327 else
329
330 //evaluation
331 //--------------------------------
332 req_data.m_FloatLast = req_data.m_FloatCurrent;
333
334 if (!req_data.GetUpdatingDataValues() && req_data.IsDataActive()) //set to exact value, not updating anymore
335 {
336 float_value_temp = req_data.m_FloatCurrent;
337 PrepareLayerInfo(req_data.GetPriorityLayer(), float_value_temp, req_data.GetInteractionMask());
338 //DbgPrnt("PPEDebug | PPEMatClassParameterFloat - UpdateParameterValues | !req_data.m_UpdatingData | mat/par/req: " + m_MaterialIndex + "/" + m_ParameterIndex + "/" + req_data.GetRequesterIDX() + " | not updating, addaing current value into mix: " + float_value_temp);
339 continue;
340 }
341
342 float_value_temp = req_data.m_FloatTarget;
343
344 //DbgPrnt("PPEDebug | PPEMatClassParameterFloat - UpdateParameterValues | mat/par/req: " + m_MaterialIndex + "/" + m_ParameterIndex + "/" + req_data.GetRequesterIDX());
345 req_data.SetUpdatingDataValues(false);
347 {
348 req_data.SetDataActive(false);
349 //RemovePriorityInfo(req_data.GetPriorityLayer()); //redundant?
350 }
351 else
352 {
353 float_value_temp = req_data.m_FloatTarget;
354 PrepareLayerInfo(req_data.GetPriorityLayer(), float_value_temp, req_data.GetInteractionMask());
355 }
356
357 req_data.m_FloatCurrent = float_value_temp;
358 }
359
360 //---------------------------
361 //MASK handling and calculation
362 float value;
363 int operator;
364 bool override_active = false;
365
366 if (m_ValueMax == 0.0)
368 else
370
371 //float_value_total = Math.InverseLerp(m_ValueMin,m_ValueMax,m_ValueDefault);
373
374 for (i = 0; i < m_LayerInfo.Count(); i++)
375 {
376 if (override_active)
377 break;
378
379 value = m_LayerInfo.Get(m_CommandLayersArray.Get(i)).Get(LAYER_INFO_VALUE);
380 operator = m_LayerInfo.Get(m_CommandLayersArray.Get(i)).Get(LAYER_INFO_OPERATOR);
381
382 switch (operator)
383 {
384 case PPOperators.LOWEST:
386 break;
387
388 case PPOperators.HIGHEST:
390 break;
391
392 case PPOperators.ADD:
393 //float_value_total = float_value_total + value - float_value_default;
395 break;
396
397 case PPOperators.ADD_RELATIVE:
399 break;
400
401 case PPOperators.SUBSTRACT:
402 //float_value_total = float_value_total - value + float_value_default;
404 break;
405
406 case PPOperators.SUBSTRACT_RELATIVE:
408 break;
409
410 case PPOperators.SUBSTRACT_REVERSE:
411 //float_value_total = value - float_value_default - float_value_total;
413 break;
414
415 case PPOperators.SUBSTRACT_REVERSE_RELATIVE:
417 break;
418
419 case PPOperators.MULTIPLICATIVE:
420 //float_value_total = Math.Lerp(float_value_default, float_value_total, value);
422 break;
423
424 case PPOperators.OVERRIDE:
426 break;
427
428 case PPOperators.SET:
430 break;
431 }
432
433 //DbgPrnt("m_LayerInfo | float_value_total pre-clamp: " + float_value_total + " | i: " + i);
435
436 if (operator == PPOperators.OVERRIDE)
437 {
438 //DbgPrnt("m_LayerInfo | PPOperators.OVERRIDE at: " + i);
439 override_active = true;
440 }
441
442 //RemovePriorityInfo(m_CommandLayersArray.Get(i));
443 }
444
445 m_CommandLayersArray.Clear();
446
447 //TODO - consider moving this up, if possible
448 if (active_request_count == 0)
450 else
451 {
453 Param1<float>.Cast(p_total).param1 = res; //converts back to absolute values
454 }
455
456 //DbgPrnt("PPEDebug | PPEMatClassParameterFloat - UpdateParameterValues | mat/par/req: " + m_MaterialIndex + "/" + m_ParameterIndex + "/" + req_data.GetRequesterIDX() + " | parameter update end, removing from queue");
457 m_Parent.ParamUpdateRemove(m_ParameterIndex);
458
459 m_CurrentValues = p_total;
460 }
461
462 void PrepareLayerInfo(int layer, float value, int operator)
463 {
464 m_LayerInfo.Set(layer, {value, operator});
465 AddPriorityInfo(layer);
466 }
467
470 {
471 p_total = new Param1<float>(PPETemplateDefFloat.Cast(m_Defaults).param2);
472 m_CurrentValues = p_total;
473 //DbgPrnt("PPEDebug | PPEMatClassParameterFloat - UpdateParameterValues | exit 3 - zero value");
474 }
475}
476
478{
480 {
481 m_Dependencies = new map<int, ref array<int>>;
482 m_Dependencies.Set(PostProcessEffectType.Glow, {PPEGlow.PARAM_COLORIZATIONCOLOR, PPEGlow.PARAM_OVERLAYCOLOR});
483 }
484}

Referenced by PPEClassBase::RegisterParameterScalarFloat(), and PPEClassBase::RegisterParameterScalarFloatEx().

◆ PPEMatClassParameterFloatSaturation()

class PPEMatClassParameterFloat extends PPEMatClassParameterCommandData PPEMatClassParameterFloatSaturation ( int mat_idx,
int parameter_idx,
PPEClassBase parent )

Definition at line 1 of file PPEMatClassParameterFloat.c.

237 {
238 m_Dependencies = new map<int, ref array<int>>;
239 m_Dependencies.Set(PostProcessEffectType.Glow, {PPEGlow.PARAM_COLORIZATIONCOLOR, PPEGlow.PARAM_OVERLAYCOLOR});
240 }

Referenced by PPEColors::RegisterMaterialParameters(), and PPEGlow::RegisterMaterialParameters().

◆ PrepareLayerInfo()

void PPEMatClassParameterFloatSaturation::PrepareLayerInfo ( int layer,
float value,
int operator )
protected

Definition at line 453 of file PPEMatClassParameterFloat.c.

454{
455 protected ref map<int, ref array<float, int>> m_LayerInfo; //<priority,<value,operator>>
456
458 protected float m_ValueDefault;
459 protected float m_ValueMin;
460 protected float m_ValueMax;
461
463 {
465 }
466
467 override void InitDefaults()
468 {
469 Class.CastTo(m_Float, m_Defaults);
470 //m_Float = PPETemplateDefFloat.Cast(m_Defaults);
471 m_ValueDefault = m_Float.param2;
472 m_ValueMin = m_Float.param3;
473 m_ValueMax = m_Float.param4;
474 }
475
476 override void InitCuttent()
477 {
478 m_CurrentValues = new Param1<float>(m_ValueDefault);
479 }
480
481 override int GetParameterVarType()
482 {
483 return PPEConstants.VAR_TYPE_FLOAT;
484 }
485
486 override void Update(float timeslice, out Param p_total, out bool setting_defaults, int order)
487 {
489
490 int active_request_count = 0;
491
493
494 bool setting_value_zero = false;
495
496 float float_value_temp = 0.0;
497 float float_value_default = 0.0;
498 float float_value_total = 0.0;
499
500 if (p_total == null)
501 p_total = new Param1<float>(0.0);
502
503 if (m_RequestMap.Count() > 0)
504 m_LayerInfo.Clear();
505 else
506 {
507 //DbgPrnt("m_RequestMap.Count() is zero! Using default values. | mat/par: " + m_MaterialIndex + "/" + m_ParameterIndex);
509 m_Parent.ParamUpdateRemove(m_ParameterIndex);
510 return;
511 }
512
513 for (int i = 0; i < m_RequestMap.Count(); i++)
514 {
515 req_data = PPERequestParamDataFloat.Cast(m_RequestMap.GetElement(i));
516
517 if (req_data == null)
518 {
519 Error("Debug | PPEMatClassParameterFloat | req_data not found! | " + this + " | mat/par: " + m_MaterialIndex + "/" + m_ParameterIndex);
520 continue;
521 }
522
523 setting_value_zero = req_data.IsSettingDefaultValues();
524
525 if (setting_value_zero && !req_data.GetUpdatingDataValues() && !req_data.IsDataActive())
526 {
527 //DbgPrnt("Is Default, not updating | idx: " + i + " | mat/par/req: " + m_MaterialIndex + "/" + m_ParameterIndex + "/" + req_data.GetRequesterIDX());
528 continue;
529 }
530
532 {
533 req_data.m_FloatTarget = 0;//min;
534 //DbgPrnt("PPEDebug | PPEMatClassParameterFloat - UpdateParameterValues | !data.m_DefaultTargetSet | mat/par/req: " + m_MaterialIndex + "/" + m_ParameterIndex + "/" + req_data.GetRequesterIDX() + " | req_data.m_FloatTarget: " + req_data.m_FloatTarget);
535 }
536 else
538
539 //evaluation
540 //--------------------------------
541 req_data.m_FloatLast = req_data.m_FloatCurrent;
542
543 if (!req_data.GetUpdatingDataValues() && req_data.IsDataActive()) //set to exact value, not updating anymore
544 {
545 float_value_temp = req_data.m_FloatCurrent;
546 PrepareLayerInfo(req_data.GetPriorityLayer(), float_value_temp, req_data.GetInteractionMask());
547 //DbgPrnt("PPEDebug | PPEMatClassParameterFloat - UpdateParameterValues | !req_data.m_UpdatingData | mat/par/req: " + m_MaterialIndex + "/" + m_ParameterIndex + "/" + req_data.GetRequesterIDX() + " | not updating, addaing current value into mix: " + float_value_temp);
548 continue;
549 }
550
551 float_value_temp = req_data.m_FloatTarget;
552
553 //DbgPrnt("PPEDebug | PPEMatClassParameterFloat - UpdateParameterValues | mat/par/req: " + m_MaterialIndex + "/" + m_ParameterIndex + "/" + req_data.GetRequesterIDX());
554 req_data.SetUpdatingDataValues(false);
556 {
557 req_data.SetDataActive(false);
558 //RemovePriorityInfo(req_data.GetPriorityLayer()); //redundant?
559 }
560 else
561 {
562 float_value_temp = req_data.m_FloatTarget;
563 PrepareLayerInfo(req_data.GetPriorityLayer(), float_value_temp, req_data.GetInteractionMask());
564 }
565
566 req_data.m_FloatCurrent = float_value_temp;
567 }
568
569 //---------------------------
570 //MASK handling and calculation
571 float value;
572 int operator;
573 bool override_active = false;
574
575 if (m_ValueMax == 0.0)
577 else
579
580 //float_value_total = Math.InverseLerp(m_ValueMin,m_ValueMax,m_ValueDefault);
582
583 for (i = 0; i < m_LayerInfo.Count(); i++)
584 {
585 if (override_active)
586 break;
587
588 value = m_LayerInfo.Get(m_CommandLayersArray.Get(i)).Get(LAYER_INFO_VALUE);
589 operator = m_LayerInfo.Get(m_CommandLayersArray.Get(i)).Get(LAYER_INFO_OPERATOR);
590
591 switch (operator)
592 {
593 case PPOperators.LOWEST:
595 break;
596
597 case PPOperators.HIGHEST:
599 break;
600
601 case PPOperators.ADD:
602 //float_value_total = float_value_total + value - float_value_default;
604 break;
605
606 case PPOperators.ADD_RELATIVE:
608 break;
609
610 case PPOperators.SUBSTRACT:
611 //float_value_total = float_value_total - value + float_value_default;
613 break;
614
615 case PPOperators.SUBSTRACT_RELATIVE:
617 break;
618
619 case PPOperators.SUBSTRACT_REVERSE:
620 //float_value_total = value - float_value_default - float_value_total;
622 break;
623
624 case PPOperators.SUBSTRACT_REVERSE_RELATIVE:
626 break;
627
628 case PPOperators.MULTIPLICATIVE:
629 //float_value_total = Math.Lerp(float_value_default, float_value_total, value);
631 break;
632
633 case PPOperators.OVERRIDE:
635 break;
636
637 case PPOperators.SET:
639 break;
640 }
641
642 //DbgPrnt("m_LayerInfo | float_value_total pre-clamp: " + float_value_total + " | i: " + i);
644
645 if (operator == PPOperators.OVERRIDE)
646 {
647 //DbgPrnt("m_LayerInfo | PPOperators.OVERRIDE at: " + i);
648 override_active = true;
649 }
650
651 //RemovePriorityInfo(m_CommandLayersArray.Get(i));
652 }
653
654 m_CommandLayersArray.Clear();
655
656 //TODO - consider moving this up, if possible
657 if (active_request_count == 0)
659 else
660 {
662 Param1<float>.Cast(p_total).param1 = res; //converts back to absolute values
663 }
664
665 //DbgPrnt("PPEDebug | PPEMatClassParameterFloat - UpdateParameterValues | mat/par/req: " + m_MaterialIndex + "/" + m_ParameterIndex + "/" + req_data.GetRequesterIDX() + " | parameter update end, removing from queue");
666 m_Parent.ParamUpdateRemove(m_ParameterIndex);
667
668 m_CurrentValues = p_total;
669 }
670
671 void PrepareLayerInfo(int layer, float value, int operator)
672 {
673 m_LayerInfo.Set(layer, {value, operator});
674 AddPriorityInfo(layer);
675 }
676
679 {
680 p_total = new Param1<float>(PPETemplateDefFloat.Cast(m_Defaults).param2);
681 m_CurrentValues = p_total;
682 //DbgPrnt("PPEDebug | PPEMatClassParameterFloat - UpdateParameterValues | exit 3 - zero value");
683 }
684}
685
687{
689 {
690 m_Dependencies = new map<int, ref array<int>>;
691 m_Dependencies.Set(PostProcessEffectType.Glow, {PPEGlow.PARAM_COLORIZATIONCOLOR, PPEGlow.PARAM_OVERLAYCOLOR});
692 }
693}

◆ SetParameterValueDefault()

override void PPEMatClassParameterFloatSaturation::SetParameterValueDefault ( inout Param p_total)
protected

No active requests for the mat. parameter value change, sets the value to DEFAULT (zero?)

Definition at line 460 of file PPEMatClassParameterFloat.c.

461{
462 protected ref map<int, ref array<float, int>> m_LayerInfo; //<priority,<value,operator>>
463
465 protected float m_ValueDefault;
466 protected float m_ValueMin;
467 protected float m_ValueMax;
468
470 {
472 }
473
474 override void InitDefaults()
475 {
476 Class.CastTo(m_Float, m_Defaults);
477 //m_Float = PPETemplateDefFloat.Cast(m_Defaults);
478 m_ValueDefault = m_Float.param2;
479 m_ValueMin = m_Float.param3;
480 m_ValueMax = m_Float.param4;
481 }
482
483 override void InitCuttent()
484 {
485 m_CurrentValues = new Param1<float>(m_ValueDefault);
486 }
487
488 override int GetParameterVarType()
489 {
490 return PPEConstants.VAR_TYPE_FLOAT;
491 }
492
493 override void Update(float timeslice, out Param p_total, out bool setting_defaults, int order)
494 {
496
497 int active_request_count = 0;
498
500
501 bool setting_value_zero = false;
502
503 float float_value_temp = 0.0;
504 float float_value_default = 0.0;
505 float float_value_total = 0.0;
506
507 if (p_total == null)
508 p_total = new Param1<float>(0.0);
509
510 if (m_RequestMap.Count() > 0)
511 m_LayerInfo.Clear();
512 else
513 {
514 //DbgPrnt("m_RequestMap.Count() is zero! Using default values. | mat/par: " + m_MaterialIndex + "/" + m_ParameterIndex);
516 m_Parent.ParamUpdateRemove(m_ParameterIndex);
517 return;
518 }
519
520 for (int i = 0; i < m_RequestMap.Count(); i++)
521 {
522 req_data = PPERequestParamDataFloat.Cast(m_RequestMap.GetElement(i));
523
524 if (req_data == null)
525 {
526 Error("Debug | PPEMatClassParameterFloat | req_data not found! | " + this + " | mat/par: " + m_MaterialIndex + "/" + m_ParameterIndex);
527 continue;
528 }
529
530 setting_value_zero = req_data.IsSettingDefaultValues();
531
532 if (setting_value_zero && !req_data.GetUpdatingDataValues() && !req_data.IsDataActive())
533 {
534 //DbgPrnt("Is Default, not updating | idx: " + i + " | mat/par/req: " + m_MaterialIndex + "/" + m_ParameterIndex + "/" + req_data.GetRequesterIDX());
535 continue;
536 }
537
539 {
540 req_data.m_FloatTarget = 0;//min;
541 //DbgPrnt("PPEDebug | PPEMatClassParameterFloat - UpdateParameterValues | !data.m_DefaultTargetSet | mat/par/req: " + m_MaterialIndex + "/" + m_ParameterIndex + "/" + req_data.GetRequesterIDX() + " | req_data.m_FloatTarget: " + req_data.m_FloatTarget);
542 }
543 else
545
546 //evaluation
547 //--------------------------------
548 req_data.m_FloatLast = req_data.m_FloatCurrent;
549
550 if (!req_data.GetUpdatingDataValues() && req_data.IsDataActive()) //set to exact value, not updating anymore
551 {
552 float_value_temp = req_data.m_FloatCurrent;
553 PrepareLayerInfo(req_data.GetPriorityLayer(), float_value_temp, req_data.GetInteractionMask());
554 //DbgPrnt("PPEDebug | PPEMatClassParameterFloat - UpdateParameterValues | !req_data.m_UpdatingData | mat/par/req: " + m_MaterialIndex + "/" + m_ParameterIndex + "/" + req_data.GetRequesterIDX() + " | not updating, addaing current value into mix: " + float_value_temp);
555 continue;
556 }
557
558 float_value_temp = req_data.m_FloatTarget;
559
560 //DbgPrnt("PPEDebug | PPEMatClassParameterFloat - UpdateParameterValues | mat/par/req: " + m_MaterialIndex + "/" + m_ParameterIndex + "/" + req_data.GetRequesterIDX());
561 req_data.SetUpdatingDataValues(false);
563 {
564 req_data.SetDataActive(false);
565 //RemovePriorityInfo(req_data.GetPriorityLayer()); //redundant?
566 }
567 else
568 {
569 float_value_temp = req_data.m_FloatTarget;
570 PrepareLayerInfo(req_data.GetPriorityLayer(), float_value_temp, req_data.GetInteractionMask());
571 }
572
573 req_data.m_FloatCurrent = float_value_temp;
574 }
575
576 //---------------------------
577 //MASK handling and calculation
578 float value;
579 int operator;
580 bool override_active = false;
581
582 if (m_ValueMax == 0.0)
584 else
586
587 //float_value_total = Math.InverseLerp(m_ValueMin,m_ValueMax,m_ValueDefault);
589
590 for (i = 0; i < m_LayerInfo.Count(); i++)
591 {
592 if (override_active)
593 break;
594
595 value = m_LayerInfo.Get(m_CommandLayersArray.Get(i)).Get(LAYER_INFO_VALUE);
596 operator = m_LayerInfo.Get(m_CommandLayersArray.Get(i)).Get(LAYER_INFO_OPERATOR);
597
598 switch (operator)
599 {
600 case PPOperators.LOWEST:
602 break;
603
604 case PPOperators.HIGHEST:
606 break;
607
608 case PPOperators.ADD:
609 //float_value_total = float_value_total + value - float_value_default;
611 break;
612
613 case PPOperators.ADD_RELATIVE:
615 break;
616
617 case PPOperators.SUBSTRACT:
618 //float_value_total = float_value_total - value + float_value_default;
620 break;
621
622 case PPOperators.SUBSTRACT_RELATIVE:
624 break;
625
626 case PPOperators.SUBSTRACT_REVERSE:
627 //float_value_total = value - float_value_default - float_value_total;
629 break;
630
631 case PPOperators.SUBSTRACT_REVERSE_RELATIVE:
633 break;
634
635 case PPOperators.MULTIPLICATIVE:
636 //float_value_total = Math.Lerp(float_value_default, float_value_total, value);
638 break;
639
640 case PPOperators.OVERRIDE:
642 break;
643
644 case PPOperators.SET:
646 break;
647 }
648
649 //DbgPrnt("m_LayerInfo | float_value_total pre-clamp: " + float_value_total + " | i: " + i);
651
652 if (operator == PPOperators.OVERRIDE)
653 {
654 //DbgPrnt("m_LayerInfo | PPOperators.OVERRIDE at: " + i);
655 override_active = true;
656 }
657
658 //RemovePriorityInfo(m_CommandLayersArray.Get(i));
659 }
660
661 m_CommandLayersArray.Clear();
662
663 //TODO - consider moving this up, if possible
664 if (active_request_count == 0)
666 else
667 {
669 Param1<float>.Cast(p_total).param1 = res; //converts back to absolute values
670 }
671
672 //DbgPrnt("PPEDebug | PPEMatClassParameterFloat - UpdateParameterValues | mat/par/req: " + m_MaterialIndex + "/" + m_ParameterIndex + "/" + req_data.GetRequesterIDX() + " | parameter update end, removing from queue");
673 m_Parent.ParamUpdateRemove(m_ParameterIndex);
674
675 m_CurrentValues = p_total;
676 }
677
678 void PrepareLayerInfo(int layer, float value, int operator)
679 {
680 m_LayerInfo.Set(layer, {value, operator});
681 AddPriorityInfo(layer);
682 }
683
686 {
687 p_total = new Param1<float>(PPETemplateDefFloat.Cast(m_Defaults).param2);
688 m_CurrentValues = p_total;
689 //DbgPrnt("PPEDebug | PPEMatClassParameterFloat - UpdateParameterValues | exit 3 - zero value");
690 }
691}
692
694{
696 {
697 m_Dependencies = new map<int, ref array<int>>;
698 m_Dependencies.Set(PostProcessEffectType.Glow, {PPEGlow.PARAM_COLORIZATIONCOLOR, PPEGlow.PARAM_OVERLAYCOLOR});
699 }
700}

◆ Update()

override void PPEMatClassParameterFloatSaturation::Update ( float timeslice,
out Param p_total,
out bool setting_defaults,
int order )
protected

Definition at line 268 of file PPEMatClassParameterFloat.c.

269{
270 protected ref map<int, ref array<float, int>> m_LayerInfo; //<priority,<value,operator>>
271
273 protected float m_ValueDefault;
274 protected float m_ValueMin;
275 protected float m_ValueMax;
276
278 {
280 }
281
282 override void InitDefaults()
283 {
284 Class.CastTo(m_Float, m_Defaults);
285 //m_Float = PPETemplateDefFloat.Cast(m_Defaults);
286 m_ValueDefault = m_Float.param2;
287 m_ValueMin = m_Float.param3;
288 m_ValueMax = m_Float.param4;
289 }
290
291 override void InitCuttent()
292 {
293 m_CurrentValues = new Param1<float>(m_ValueDefault);
294 }
295
296 override int GetParameterVarType()
297 {
298 return PPEConstants.VAR_TYPE_FLOAT;
299 }
300
301 override void Update(float timeslice, out Param p_total, out bool setting_defaults, int order)
302 {
304
305 int active_request_count = 0;
306
308
309 bool setting_value_zero = false;
310
311 float float_value_temp = 0.0;
312 float float_value_default = 0.0;
313 float float_value_total = 0.0;
314
315 if (p_total == null)
316 p_total = new Param1<float>(0.0);
317
318 if (m_RequestMap.Count() > 0)
319 m_LayerInfo.Clear();
320 else
321 {
322 //DbgPrnt("m_RequestMap.Count() is zero! Using default values. | mat/par: " + m_MaterialIndex + "/" + m_ParameterIndex);
324 m_Parent.ParamUpdateRemove(m_ParameterIndex);
325 return;
326 }
327
328 for (int i = 0; i < m_RequestMap.Count(); i++)
329 {
330 req_data = PPERequestParamDataFloat.Cast(m_RequestMap.GetElement(i));
331
332 if (req_data == null)
333 {
334 Error("Debug | PPEMatClassParameterFloat | req_data not found! | " + this + " | mat/par: " + m_MaterialIndex + "/" + m_ParameterIndex);
335 continue;
336 }
337
338 setting_value_zero = req_data.IsSettingDefaultValues();
339
340 if (setting_value_zero && !req_data.GetUpdatingDataValues() && !req_data.IsDataActive())
341 {
342 //DbgPrnt("Is Default, not updating | idx: " + i + " | mat/par/req: " + m_MaterialIndex + "/" + m_ParameterIndex + "/" + req_data.GetRequesterIDX());
343 continue;
344 }
345
347 {
348 req_data.m_FloatTarget = 0;//min;
349 //DbgPrnt("PPEDebug | PPEMatClassParameterFloat - UpdateParameterValues | !data.m_DefaultTargetSet | mat/par/req: " + m_MaterialIndex + "/" + m_ParameterIndex + "/" + req_data.GetRequesterIDX() + " | req_data.m_FloatTarget: " + req_data.m_FloatTarget);
350 }
351 else
353
354 //evaluation
355 //--------------------------------
356 req_data.m_FloatLast = req_data.m_FloatCurrent;
357
358 if (!req_data.GetUpdatingDataValues() && req_data.IsDataActive()) //set to exact value, not updating anymore
359 {
360 float_value_temp = req_data.m_FloatCurrent;
361 PrepareLayerInfo(req_data.GetPriorityLayer(), float_value_temp, req_data.GetInteractionMask());
362 //DbgPrnt("PPEDebug | PPEMatClassParameterFloat - UpdateParameterValues | !req_data.m_UpdatingData | mat/par/req: " + m_MaterialIndex + "/" + m_ParameterIndex + "/" + req_data.GetRequesterIDX() + " | not updating, addaing current value into mix: " + float_value_temp);
363 continue;
364 }
365
366 float_value_temp = req_data.m_FloatTarget;
367
368 //DbgPrnt("PPEDebug | PPEMatClassParameterFloat - UpdateParameterValues | mat/par/req: " + m_MaterialIndex + "/" + m_ParameterIndex + "/" + req_data.GetRequesterIDX());
369 req_data.SetUpdatingDataValues(false);
371 {
372 req_data.SetDataActive(false);
373 //RemovePriorityInfo(req_data.GetPriorityLayer()); //redundant?
374 }
375 else
376 {
377 float_value_temp = req_data.m_FloatTarget;
378 PrepareLayerInfo(req_data.GetPriorityLayer(), float_value_temp, req_data.GetInteractionMask());
379 }
380
381 req_data.m_FloatCurrent = float_value_temp;
382 }
383
384 //---------------------------
385 //MASK handling and calculation
386 float value;
387 int operator;
388 bool override_active = false;
389
390 if (m_ValueMax == 0.0)
392 else
394
395 //float_value_total = Math.InverseLerp(m_ValueMin,m_ValueMax,m_ValueDefault);
397
398 for (i = 0; i < m_LayerInfo.Count(); i++)
399 {
400 if (override_active)
401 break;
402
403 value = m_LayerInfo.Get(m_CommandLayersArray.Get(i)).Get(LAYER_INFO_VALUE);
404 operator = m_LayerInfo.Get(m_CommandLayersArray.Get(i)).Get(LAYER_INFO_OPERATOR);
405
406 switch (operator)
407 {
408 case PPOperators.LOWEST:
410 break;
411
412 case PPOperators.HIGHEST:
414 break;
415
416 case PPOperators.ADD:
417 //float_value_total = float_value_total + value - float_value_default;
419 break;
420
421 case PPOperators.ADD_RELATIVE:
423 break;
424
425 case PPOperators.SUBSTRACT:
426 //float_value_total = float_value_total - value + float_value_default;
428 break;
429
430 case PPOperators.SUBSTRACT_RELATIVE:
432 break;
433
434 case PPOperators.SUBSTRACT_REVERSE:
435 //float_value_total = value - float_value_default - float_value_total;
437 break;
438
439 case PPOperators.SUBSTRACT_REVERSE_RELATIVE:
441 break;
442
443 case PPOperators.MULTIPLICATIVE:
444 //float_value_total = Math.Lerp(float_value_default, float_value_total, value);
446 break;
447
448 case PPOperators.OVERRIDE:
450 break;
451
452 case PPOperators.SET:
454 break;
455 }
456
457 //DbgPrnt("m_LayerInfo | float_value_total pre-clamp: " + float_value_total + " | i: " + i);
459
460 if (operator == PPOperators.OVERRIDE)
461 {
462 //DbgPrnt("m_LayerInfo | PPOperators.OVERRIDE at: " + i);
463 override_active = true;
464 }
465
466 //RemovePriorityInfo(m_CommandLayersArray.Get(i));
467 }
468
469 m_CommandLayersArray.Clear();
470
471 //TODO - consider moving this up, if possible
472 if (active_request_count == 0)
474 else
475 {
477 Param1<float>.Cast(p_total).param1 = res; //converts back to absolute values
478 }
479
480 //DbgPrnt("PPEDebug | PPEMatClassParameterFloat - UpdateParameterValues | mat/par/req: " + m_MaterialIndex + "/" + m_ParameterIndex + "/" + req_data.GetRequesterIDX() + " | parameter update end, removing from queue");
481 m_Parent.ParamUpdateRemove(m_ParameterIndex);
482
483 m_CurrentValues = p_total;
484 }
485
486 void PrepareLayerInfo(int layer, float value, int operator)
487 {
488 m_LayerInfo.Set(layer, {value, operator});
489 AddPriorityInfo(layer);
490 }
491
494 {
495 p_total = new Param1<float>(PPETemplateDefFloat.Cast(m_Defaults).param2);
496 m_CurrentValues = p_total;
497 //DbgPrnt("PPEDebug | PPEMatClassParameterFloat - UpdateParameterValues | exit 3 - zero value");
498 }
499}
500
502{
504 {
505 m_Dependencies = new map<int, ref array<int>>;
506 m_Dependencies.Set(PostProcessEffectType.Glow, {PPEGlow.PARAM_COLORIZATIONCOLOR, PPEGlow.PARAM_OVERLAYCOLOR});
507 }
508}

Variable Documentation

◆ m_Float

PPETemplateDefFloat m_Float
protected

◆ m_LayerInfo

ref map<int, ref array<float, int> > m_LayerInfo
protected

Definition at line 237 of file PPEMatClassParameterFloat.c.

◆ m_ValueDefault

◆ m_ValueMax

◆ m_ValueMin