DayZ 1.24
Loading...
Searching...
No Matches
PPEDOF.c
Go to the documentation of this file.
1//---------------------------------------------------------
2//Native exceptions - legacy methods for direct access to specific postprocesses. Each one is evaluated and handled separately, this just connects them to the system.
3
6{
7 //g_Game.OverrideDOF(bool enable, float focusDistance, float focusLength, float focusLengthNear, float blur, float focusDepthOffset);
8 static const int PARAM_ENABLE = 0;
9 static const int PARAM_FOCUS_DIST = 1;
10 static const int PARAM_FOCUS_LEN = 2;
11 static const int PARAM_FOCUS_LEN_NEAR = 3;
12 static const int PARAM_BLUR = 4;
13 static const int PARAM_FOCUS_DEPTH_OFFSET = 5;
14
15 static const int L_0_ADS = 100;
16 static const int L_1_ADS = 100;
17 static const int L_2_ADS = 100;
18 static const int L_3_ADS = 100;
19 static const int L_4_ADS = 100;
20 static const int L_5_ADS = 100;
21
23 {
24 return PPEExceptions.DOF;
25 }
26
28 {
29 //no known max. 1000 used as max
31
32 RegisterParameterScalarFloat(PARAM_FOCUS_DIST, "FocusDistance", 2.0, 0.0, 1000.0); //2.0f used in code with null camera interpolation
33 RegisterParameterScalarFloat(PARAM_FOCUS_LEN, "FocusLength", -1.0, -1.0, 1000.0); //-1.0f used as code default
34 RegisterParameterScalarFloat(PARAM_FOCUS_LEN_NEAR, "FocusLengthNear", -1.0, -1.0, 1000.0); //-1.0f used as code default
35 RegisterParameterScalarFloat(PARAM_BLUR, "Blur", 1.0, 0.0, 1000.0); //1.0f used in code with null camera interpolation
36 RegisterParameterScalarFloat(PARAM_FOCUS_DEPTH_OFFSET, "FocusDepthOffset", 0.0, 0.0, 1000.0); //0.0f used as code default
37 }
38
39 override void ApplyValueChanges()
40 {
41 if (m_UpdatedParameters.Count() > 0)
42 {
43 SetFinalParameterValue(-1); //unique handling
44 }
45
46 m_UpdatedParameters.Clear();
47 }
48
51 {
53 bool is_enabled = Param1<bool>.Cast(enabled_par).param1;
54
55 if (is_enabled)
56 {
58
59 for (int i = 1; i < PARAM_FOCUS_DEPTH_OFFSET + 1; i++)
60 {
62 float value_var_float = Param1<float>.Cast(values).param1;
64 }
65
67 }
68 else
69 g_Game.OverrideDOF(false, 0.0, 0.0, 0.0, 0.0, 1.0);
70 }
71}
DayZGame g_Game
Definition DayZGame.c:3528
PPEExceptions
Created once, on manager init. Script-side representation of C++ material class, separate handling.
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 RegisterParameterScalarBool(int idx, string parameter_name, bool default_value)
PPEMatClassParameterCommandData GetParameterCommandData(int parameter_idx)
Some PP effects are handled as hard-coded exceptions, outside of material system. Default == PPEExcep...
ref array< int > m_UpdatedParameters
DOF postprocess, does not directly use materials.
Definition PPEDOF.c:6
static const int L_5_ADS
Definition PPEDOF.c:20
static const int L_1_ADS
Definition PPEDOF.c:16
override int GetPostProcessEffectID()
Definition PPEDOF.c:22
static const int PARAM_FOCUS_LEN
Definition PPEDOF.c:10
static const int L_4_ADS
Definition PPEDOF.c:19
static const int L_3_ADS
Definition PPEDOF.c:18
static const int PARAM_FOCUS_LEN_NEAR
Definition PPEDOF.c:11
static const int PARAM_FOCUS_DIST
Definition PPEDOF.c:9
static const int PARAM_BLUR
Definition PPEDOF.c:12
static const int PARAM_FOCUS_DEPTH_OFFSET
Definition PPEDOF.c:13
override void ApplyValueChanges()
Definition PPEDOF.c:39
static const int L_0_ADS
Definition PPEDOF.c:15
static const int L_2_ADS
Definition PPEDOF.c:17
static const int PARAM_ENABLE
Definition PPEDOF.c:8
override void SetFinalParameterValue(int parameter_idx)
Overriden to handle the specific exception.
Definition PPEDOF.c:50
override void RegisterMaterialParameters()
Definition PPEDOF.c:27
Param GetCurrentValues()
Careful, only actual values, WITHOUT string.
Base Param Class with no parameters. Used as general purpose parameter overloaded with Param1 to Para...
Definition param.c:12