Dayz Explorer  1.24.157551 (v105080)
Dayz Code Explorer by Zeroy
ppercameraads_opt.c
Go to the documentation of this file.
1 class PPERequester_CameraADS extends PPERequester_GameplayBase
2 {
3  void SetValuesOptics(out array<float> mask_array, out array<float> lens_array, float gauss = 0.0)
4  {
5  //mask
6  GetGame().ResetPPMask();
7  if (mask_array.Count() != 4)
8  {
9  mask_array = {0.0,0.0,0.0,0.0};
10  }
11  GetGame().AddPPMask(mask_array[0], mask_array[1], mask_array[2], mask_array[3]);
12 
13  //lens
14  if (lens_array.Count() != 4)
15  {
16  lens_array = {0.0,0.0,0.0,0.0};
17  }
18  SetTargetValueFloat(PostProcessEffectType.Glow,PPEGlow.PARAM_LENSDISTORT,false,lens_array[0],PPEGlow.L_27_ADS,PPOperators.SET);
19  SetTargetValueFloat(PostProcessEffectType.Glow,PPEGlow.PARAM_MAXCHROMABBERATION,false,lens_array[1],PPEGlow.L_28_ADS,PPOperators.SET);
20  SetTargetValueFloat(PostProcessEffectType.Glow,PPEGlow.PARAM_LENSCENTERX,false,lens_array[2],PPEGlow.L_29_ADS,PPOperators.SET);
21  SetTargetValueFloat(PostProcessEffectType.Glow,PPEGlow.PARAM_LENSCENTERY,false,lens_array[3],PPEGlow.L_30_ADS,PPOperators.SET);
22 
23  //DOF - no DOF in optics
25 
26  //blur
27  SetTargetValueFloat(PostProcessEffectType.GaussFilter,PPEGaussFilter.PARAM_INTENSITY,false,gauss,PPEGaussFilter.L_0_ADS,PPOperators.ADD_RELATIVE);
28  }
29 
30  void SetValuesIronsights(out array<float> DOF_array)
31  {
32  //mask - no mask
33  GetGame().ResetPPMask();
34 
35  //lens - no lens
37  SetTargetValueFloatDefault(PostProcessEffectType.Glow,PPEGlow.PARAM_MAXCHROMABBERATION);
40 
41  //DOF
42  SetTargetValueBool(PPEExceptions.DOF,PPEDOF.PARAM_ENABLE,DOF_array[0],PPEDOF.L_0_ADS,PPOperators.SET);
43  SetTargetValueFloat(PPEExceptions.DOF,PPEDOF.PARAM_FOCUS_DIST,false,DOF_array[1],PPEDOF.L_1_ADS,PPOperators.SET);
44  SetTargetValueFloat(PPEExceptions.DOF,PPEDOF.PARAM_FOCUS_LEN,false,DOF_array[2],PPEDOF.L_2_ADS,PPOperators.SET);
45  SetTargetValueFloat(PPEExceptions.DOF,PPEDOF.PARAM_FOCUS_LEN_NEAR,false,DOF_array[3],PPEDOF.L_3_ADS,PPOperators.SET);
46  SetTargetValueFloat(PPEExceptions.DOF,PPEDOF.PARAM_BLUR,false,DOF_array[4],PPEDOF.L_4_ADS,PPOperators.SET);
47  SetTargetValueFloat(PPEExceptions.DOF,PPEDOF.PARAM_FOCUS_DEPTH_OFFSET,false,DOF_array[5],PPEDOF.L_5_ADS,PPOperators.SET);
48 
49  //blur - no gauss blur (DOF bokeh only)
51  }
52 
53  override protected void OnStop(Param par = null)
54  {
55  super.OnStop(par);
56 
57  if ( !GetGame() )
58  return;
59 
60  GetGame().ResetPPMask();
61  //material parameter values reset by default on stop
62  }
63 }
PostProcessEffectType
PostProcessEffectType
Post-process effect type.
Definition: enworld.c:71
GetGame
proto native CGame GetGame()
Param
Base Param Class with no parameters. Used as general purpose parameter overloaded with Param1 to Para...
Definition: param.c:11
SetTargetValueBool
protected void SetTargetValueBool(int mat_id, int param_idx, bool val, int priority_layer, int operator=PPOperators.SET)
Definition: pperequestplatformsbase.c:76
OnStop
protected void OnStop(Param par=null)
automatically resets all material parameters of this requester to defaults
Definition: pperequestplatformsbase.c:358
PPEGaussFilter
GaussFilter - PostProcessEffectType.GaussFilter.
Definition: ppegaussfilter.c:2
SetTargetValueFloatDefault
protected void SetTargetValueFloatDefault(int mat_id, int param_idx)
Definition: pperequestplatformsbase.c:176
PPEGlow
Glow - PostProcessEffectType.Glow.
Definition: ppeglow.c:7
PPERequester_GameplayBase
base, not to be used directly, would lead to layering collisions!
Definition: pperbloodloss.c:1
SetTargetValueFloat
protected void SetTargetValueFloat(int mat_id, int param_idx, bool relative, float val, int priority_layer, int operator=PPOperators.ADD_RELATIVE)
Definition: pperequestplatformsbase.c:153
PPEExceptions
PPEExceptions
Definition: ppeconstants.c:41
array< float >
PPOperators
PPOperators
PP operators, specify operation between subsequent layers.
Definition: ppeconstants.c:51
PPEDOF
DOF postprocess, does not directly use materials.
Definition: ppedof.c:5
SetTargetValueBoolDefault
protected void SetTargetValueBoolDefault(int mat_id, int param_idx)
Definition: pperequestplatformsbase.c:98