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

См. исходные тексты.

Структуры данных

class  PPEManagerStatic
 Static component of PPE manager, used to hold the instance. Подробнее...
 

Функции

void PPEManager ()
 
void Cleanup ()
 
void Init ()
 Launched from 'DayZGame.DeferredInit' to make earlier access, use, and updates impossible (downside of a non-static system)
 
void InitPPEManagerClassMap ()
 Ordered by 'PostProcessEffectType' for easy access through the same enum; ID saved all the same.
 
void RegisterPPEClass (PPEClassBase material_class)
 Registeres material class and creates data structure within.
 
void SendMaterialValueData (PPERequestParamDataBase data)
 
void SetMaterialParamUpdating (int material_id, int parameter_id, int order)
 Queues material/parameter to update (once)
 
void RemoveMaterialUpdating (int material_id, int order=0)
 Currently unused, requests remain in the hierarchy and are used when needed (slightly faster than constantly re-shuffilng the arrays)
 
void ClearMaterialUpdating ()
 
void SetRequestActive (PPERequesterBase request, bool active)
 Marks requester as 'active'. Currently indistinguiishable from 'updating' requester, can potentially be used for intermittently updated requesters.
 
void SetRequestUpdating (PPERequesterBase request, bool active)
 Marks requester as 'updating' and to be processed on manager update.
 
bool GetExistingRequester (typename req, out PPERequesterBase ret)
 
bool IsAnyRequesterRunning (array< typename > requesters)
 
void RemoveActiveRequestFromMaterials (PPERequesterBase req)
 
void RequestsCleanup ()
 Unused cleanup method, should it be ever needed.
 
void InsertUpdatedMaterial (int mat_id)
 Marks material class as updated and values to be set in the course of update - 'ProcessApplyValueChanges'.
 
void ProcessRequesterUpdates (float timeslice)
 
void ProcessMaterialUpdates (float timeslice)
 
void ProcessApplyValueChanges ()
 
void Update (float timeslice)
 
Param GetPostProcessDefaultValues (int material, int parameter)
 Returns default values as Param. See 'PPEConstants' file for various typedefs used.
 
Param GetPostProcessCurrentValues (int material, int parameter)
 Returns current values as Param. See 'PPEConstants' file for various typedefs used.
 
void ChangePPEMaterial (PostProcessPrioritiesCamera priority, PostProcessEffectType type, string path, bool scriptside_only)
 Changes material file associated with the script material class. Will be used very rarely, mostly set in C++ anyway.
 
void StopAllEffects (int mask=0)
 stops all effects of a certain kind
 
void DbgPrnt (string text)
 

Переменные

class PPEManagerStatic CAMERA_ID = 0
 
bool m_ManagerInitialized
 
ref map< int, ref PPEClassBasem_PPEClassMap
 
ref map< int, ref array< int > > m_PPEMaterialUpdateQueueMap
 
ref array< intm_UpdatedMaterials
 
ref array< ref PPERequesterBasem_ExistingPostprocessRequests
 
ref array< ref PPERequesterBasem_UpdatingRequests
 

Функции

◆ ChangePPEMaterial()

void ChangePPEMaterial ( PostProcessPrioritiesCamera priority,
PostProcessEffectType type,
string path,
bool scriptside_only )
protected

Changes material file associated with the script material class. Will be used very rarely, mostly set in C++ anyway.

357 {
358 if (m_PPEClassMap.Contains(type))
359 {
361 typename name = mat_class.Type();
363 postprocess_capsule.ChangeMaterialPathUsed(path);
364
365 if (postprocess_capsule.GetMaterial() == 0x0)
366 {
367 Debug.Log("PPEManager | Invalid material path " + path + " used for " + name );
368 return;
369 }
370
371 //m_PPEClassMap.Remove(type);
373 }
374
375 //can be sent script-side only to adapt to c++ options changes
376 if (!scriptside_only)
378 }
PlayerSpawnPresetDiscreteItemSetSlotData name
one set for cargo
string path
Definition OptionSelectorMultistate.c:142
class PPEManagerStatic CAMERA_ID
ref map< int, ref PPEClassBase > m_PPEClassMap
Definition PPEManager.c:58
Definition Debug.c:14
static void Log(string message=LOG_DEFAULT, string plugin=LOG_DEFAULT, string author=LOG_DEFAULT, string label=LOG_DEFAULT, string entity=LOG_DEFAULT)
Prints debug message with normal prio.
Definition Debug.c:136
Created once, on manager init. Script-side representation of C++ material class, separate handling.
Definition PPEMatClassesBase.c:3
Definition EntityAI.c:95
proto native void SetCameraPostProcessEffect(int cam, int priority, PostProcessEffectType type, string materialPath)

Перекрестные ссылки CAMERA_ID, Debug::Log(), m_PPEClassMap, name, path и SetCameraPostProcessEffect().

◆ Cleanup()

void Cleanup ( )
protected
71 {
72 PPERequesterBank.Cleanup();
73
75 {
78 m_UpdatingRequests.Clear();
79 m_PPEClassMap.Clear();
80 }
81 }
ref map< int, ref array< int > > m_PPEMaterialUpdateQueueMap
Definition PPEManager.c:59
bool m_ManagerInitialized
Definition PPEManager.c:57
ref array< ref PPERequesterBase > m_ExistingPostprocessRequests
Definition PPEManager.c:61
ref array< ref PPERequesterBase > m_UpdatingRequests
Definition PPEManager.c:62

Перекрестные ссылки m_ExistingPostprocessRequests, m_ManagerInitialized, m_PPEClassMap, m_PPEMaterialUpdateQueueMap и m_UpdatingRequests.

◆ ClearMaterialUpdating()

void ClearMaterialUpdating ( )
protected
190 {
192 }

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

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

◆ DbgPrnt()

void DbgPrnt ( string text)
protected
396 {
397 //Debug.Log(""+text);
398 }

◆ GetExistingRequester()

bool GetExistingRequester ( typename req ,
out PPERequesterBase ret )
protected
233 {
234 int idx = m_ExistingPostprocessRequests.Find(PPERequesterBank.GetRequester(req));
235 if (idx > -1)
236 {
238 return true;
239 }
240 return false;
241 }

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

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

◆ GetPostProcessCurrentValues()

Param GetPostProcessCurrentValues ( int material,
int parameter )
protected

Returns current values as Param. See 'PPEConstants' file for various typedefs used.

348 {
350 return mat_class.GetParameterCommandData(parameter).GetCurrentValues();
351 }

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

◆ GetPostProcessDefaultValues()

Param GetPostProcessDefaultValues ( int material,
int parameter )
protected

Returns default values as Param. See 'PPEConstants' file for various typedefs used.

341 {
343 return mat_class.GetParameterCommandData(parameter).GetDefaultValues();
344 }

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

◆ Init()

void Init ( )
protected

Launched from 'DayZGame.DeferredInit' to make earlier access, use, and updates impossible (downside of a non-static system)

85 {
86 //DbgPrnt("PPEDebug | PPEManager | m_ManagerInitialized: " + m_ManagerInitialized);
88 {
94
95 GetGame().GetUpdateQueue(CALL_CATEGORY_GUI).Insert(this.Update); //can be safely and easily 'disabled' here
97 }
98 }
ref array< int > m_UpdatedMaterials
Definition PPEManager.c:60
void InitPPEManagerClassMap()
Ordered by 'PostProcessEffectType' for easy access through the same enum; ID saved all the same.
Definition PPEManager.c:101
proto native CGame GetGame()
const int CALL_CATEGORY_GUI
Definition tools.c:9
proto native volatile void Update()
Definition PlayerSoundManager.c:125

Перекрестные ссылки CALL_CATEGORY_GUI, GetGame(), InitPPEManagerClassMap(), m_ExistingPostprocessRequests, m_ManagerInitialized, m_PPEMaterialUpdateQueueMap, m_UpdatedMaterials, m_UpdatingRequests и Update().

◆ InitPPEManagerClassMap()

void InitPPEManagerClassMap ( )
protected

Ordered by 'PostProcessEffectType' for easy access through the same enum; ID saved all the same.

102 {
103 if (m_PPEClassMap)
104 {
105 delete m_PPEClassMap;
106 }
108
109 RegisterPPEClass(new PPENone()); //dummy
136 }
void RegisterPPEClass(PPEClassBase material_class)
Registeres material class and creates data structure within.
Definition PPEManager.c:139
ChromAber - PostProcessEffectType.ChromAber.
Definition PPEChromAber.c:3
ColorGrading - PostProcessEffectType.ColorGrading.
Definition PPEColorGrading.c:4
Colors - PostProcessEffectType.Colors.
Definition PPEColors.c:4
DOF postprocess, does not directly use materials.
Definition PPEDOF.c:6
DepthOfField - PostProcessEffectType.DepthOfField.
Definition PPEDepthOfField.c:4
Distort - PostProcessEffectType.Distort.
Definition PPEDistort.c:3
DynamicBlur - PostProcessEffectType.DynamicBlur.
Definition PPEDynamicBlur.c:3
EV postprocess, does not directly use materials.
Definition PPEExposureNative.c:6
Eye Accomodation postprocess, does not directly use materials.
Definition PPEEyeAccomodationNative.c:6
FXAA - PostProcessEffectType.FXAA.
Definition PPEFXAA.c:3
FilmGrain - PostProcessEffectType.FilmGrain.
Definition PPEFilmGrain.c:7
GaussFilter - PostProcessEffectType.GaussFilter.
Definition PPEGaussFilter.c:3
Ghost - PostProcessEffectType.Ghost.
Definition PPEGhost.c:3
Glow - PostProcessEffectType.Glow.
Definition PPEGlow.c:8
GodRays - PostProcessEffectType.GodRays.
Definition PPEGodRays.c:3
HBAO - PostProcessEffectType.HBAO.
Definition PPEHBAO.c:4
g_Game.NightVissionLightParams, does not directly use materials. Controls light multiplication and fi...
Definition PPELightIntensityParamsNative.c:6
Median - PostProcessEffectType.Median.
Definition PPEMedian.c:4
Dummy class - PostProcessEffectType.None.
Definition PPENone.c:3
RadialBlur - PostProcessEffectType.RadialBlur.
Definition PPERadialBlur.c:3
Rain - PostProcessEffectType.Rain.
Definition PPERain.c:3
Rotation Blur.
Definition PPERotBlur.c:3
SMAA - PostProcessEffectType.SMAA.
Definition PPESMAA.c:3
SSAO - PostProcessEffectType.SSAO.
Definition PPESSAO.c:3
SunMask - PostProcessEffectType.SunMask.
Definition PPESunMask.c:4
UnderWater - PostProcessEffectType.UnderWater.
Definition PPEUnderWater.c:3
WetDistort - PostProcessEffectType.WetDistort.
Definition PPEWetDistort.c:3

Перекрестные ссылки m_PPEClassMap и RegisterPPEClass().

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

◆ InsertUpdatedMaterial()

void InsertUpdatedMaterial ( int mat_id)
protected

Marks material class as updated and values to be set in the course of update - 'ProcessApplyValueChanges'.

279 {
280 if ( m_UpdatedMaterials.Find(mat_id) == -1 )
282 }

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

◆ IsAnyRequesterRunning()

bool IsAnyRequesterRunning ( array< typename > requesters)
protected
244 {
245 foreach (typename requesterType : requesters)
246 {
249 if (ppeRequester && ppeRequester.IsRequesterRunning())
250 return true;
251 }
252
253 return false;
254 }
bool GetExistingRequester(typename req, out PPERequesterBase ret)
Definition PPEManager.c:232
Definition PPERequestPlatformsBase.c:3

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

◆ PPEManager()

void PPEManager ( )
protected
65 {
67 PPERequesterBank.Init();
68 }

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

Используется в PPEManagerStatic::CreateManagerStatic().

◆ ProcessApplyValueChanges()

void ProcessApplyValueChanges ( )
protected
315 {
316 int material_id;
317 for (int i = 0; i < m_UpdatedMaterials.Count(); i++)
318 {
321 mat_class.ApplyValueChanges();
322 }
323
324 m_UpdatedMaterials.Clear();
326 }
void ClearMaterialUpdating()
Definition PPEManager.c:189

Перекрестные ссылки ClearMaterialUpdating(), m_PPEClassMap и m_UpdatedMaterials.

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

◆ ProcessMaterialUpdates()

void ProcessMaterialUpdates ( float timeslice)
protected
300 {
301 for (int i = 0; i < m_PPEMaterialUpdateQueueMap.Count(); i++) //orders (levels?)
302 {
303 //DbgPrnt("PPEDebug | ProcessMaterialUpdates | GetKey " + i + ": " + m_PPEMaterialUpdateQueueMap.GetKey(i));
304 //DbgPrnt("PPEDebug | ProcessMaterialUpdates | GetElement - count " + i + ": " + m_PPEMaterialUpdateQueueMap.GetElement(i).Count());
305
306 for (int j = 0; j < m_PPEMaterialUpdateQueueMap.GetElement(i).Count(); j++)
307 {
309 mat_class.OnUpdate(timeslice,i);
310 }
311 }
312 }
@ Count
Definition RandomGeneratorSyncManager.c:8

Перекрестные ссылки Count, m_PPEClassMap и m_PPEMaterialUpdateQueueMap.

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

◆ ProcessRequesterUpdates()

void ProcessRequesterUpdates ( float timeslice)
protected
288 {
290 for (int i = 0; i < m_UpdatingRequests.Count(); i++)
291 {
292 //DbgPrnt("PPEDebug | ProcessRequesterUpdates | m_UpdatingRequests[i]: " + m_UpdatingRequests[i]);
293 req = m_UpdatingRequests.Get(i);
294 if (req)
295 req.OnUpdate(timeslice);
296 }
297 }

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

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

◆ RegisterPPEClass()

void RegisterPPEClass ( PPEClassBase material_class)
protected

Registeres material class and creates data structure within.

140 {
141 m_PPEClassMap.Set(material_class.GetPostProcessEffectID(), material_class);
142 }

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

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

◆ RemoveActiveRequestFromMaterials()

void RemoveActiveRequestFromMaterials ( PPERequesterBase req)
protected

/brief Originally designed to rip the requester data from all relevant mat/params, but that proved too costly and volatile. /note Still, it is here, use at your own peril.

261 {
262 int count = req.GetActiveRequestStructure().Count();
263 int mat_id;
264 for (int i = 0; i < count; i++)
265 {
266 mat_id = req.GetActiveRequestStructure().GetKey(i);
268 mat_class.RemoveRequest(req.GetRequesterIDX());
269 }
270 }

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

◆ RemoveMaterialUpdating()

void RemoveMaterialUpdating ( int material_id,
int order = 0 )
protected

Currently unused, requests remain in the hierarchy and are used when needed (slightly faster than constantly re-shuffilng the arrays)

179 {
180 if ( m_PPEMaterialUpdateQueueMap.Contains(order) )
181 {
183
184 if ( m_PPEMaterialUpdateQueueMap.Get(order).Count() == 0)
186 }
187 }

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

◆ RequestsCleanup()

void RequestsCleanup ( )
protected

Unused cleanup method, should it be ever needed.

274 {
275 }

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

◆ SendMaterialValueData()

void SendMaterialValueData ( PPERequestParamDataBase data)
protected
145 {
146 //DbgPrnt("DataVerification | m_ColorTarget | SendMaterialValueData: " + PPERequestParamDataColor.Cast(data).m_ColorTarget[0] + "/" + PPERequestParamDataColor.Cast(data).m_ColorTarget[1] + "/" + PPERequestParamDataColor.Cast(data).m_ColorTarget[2] + "/" + PPERequestParamDataColor.Cast(data).m_ColorTarget[3]);
147 PPEClassBase mat_class = m_PPEClassMap.Get(data.GetMaterialID());
148 mat_class.InsertParamValueData(data);
149 SetMaterialParamUpdating(data.GetMaterialID(),data.GetParameterID(),PPEConstants.DEPENDENCY_ORDER_BASE);
150 }
void SetMaterialParamUpdating(int material_id, int parameter_id, int order)
Queues material/parameter to update (once)
Definition PPEManager.c:153

Перекрестные ссылки m_PPEClassMap и SetMaterialParamUpdating().

◆ SetMaterialParamUpdating()

void SetMaterialParamUpdating ( int material_id,
int parameter_id,
int order )
protected

Queues material/parameter to update (once)

154 {
155 if ( order > PPEConstants.DEPENDENCY_ORDER_HIGHEST )
156 {
157 //DbgPrnt("PPEDebug | PPEManager - SetMaterialParamUpdating | Order higher than max, ignoring! | mat/par/ord: " + material_id + "/" + parameter_id + "/" + order);
158 return;
159 }
160
162
163 //DbgPrnt("PPEDebug | PPEManager - SetMaterialParamUpdating | mat/par: " + material_id + "/" + parameter_id);
164 //insert material into queue
165 if ( !m_PPEMaterialUpdateQueueMap.Contains(order) )
167
169 if ( found == -1 )
170 {
172 }
173
174 mat_class.SetParameterUpdating(order,parameter_id);
175 }

Перекрестные ссылки m_PPEClassMap и m_PPEMaterialUpdateQueueMap.

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

◆ SetRequestActive()

void SetRequestActive ( PPERequesterBase request,
bool active )
protected

Marks requester as 'active'. Currently indistinguiishable from 'updating' requester, can potentially be used for intermittently updated requesters.

196 {
198 if ( active && found == -1 )
199 {
201 }
202 else if ( !active && found > -1 ) //should always be found in this case, redundant?
203 {
204 //RemoveActiveRequestFromMaterials(request);
205
207 }
208 }

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

◆ SetRequestUpdating()

void SetRequestUpdating ( PPERequesterBase request,
bool active )
protected

Marks requester as 'updating' and to be processed on manager update.

212 {
214 {
215 Debug.Log("PPEManager | SetRequestUpdating | !m_UpdatingRequests");
216 return;
217 }
218
219 int idx = m_UpdatingRequests.Find(request);
220
221 if ( active && idx == -1 )
222 {
224 }
225 else if ( !active && idx > -1 )
226 {
227 m_UpdatingRequests.Remove(idx);
228 }
229 }

Перекрестные ссылки Debug::Log() и m_UpdatingRequests.

◆ StopAllEffects()

void StopAllEffects ( int mask = 0)
protected

stops all effects of a certain kind

382 {
384 {
386 {
387 if (requester.GetCategoryMask() & mask)
388 {
389 requester.Stop();
390 }
391 }
392 }
393 }

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

◆ Update()

void Update ( float timeslice)
protected
329 {
331 return;
332
336 RequestsCleanup(); //unused
337 }
void RequestsCleanup()
Unused cleanup method, should it be ever needed.
Definition PPEManager.c:273
void ProcessRequesterUpdates(float timeslice)
Definition PPEManager.c:287
void ProcessApplyValueChanges()
Definition PPEManager.c:314
void ProcessMaterialUpdates(float timeslice)
Definition PPEManager.c:299

Перекрестные ссылки m_ManagerInitialized, ProcessApplyValueChanges(), ProcessMaterialUpdates(), ProcessRequesterUpdates() и RequestsCleanup().

Переменные

◆ CAMERA_ID

class PPEManagerStatic CAMERA_ID = 0

/brief Postprocess manager, responsible for updates, receiving, and re-distributing requester data to their respective destinations. /par Basic post process flow outline: Getting a registered 'PPERequester' instance from the 'PPERequesterBank'

/par Launching the requester, either through an overriden 'Start' method, or custom method with some setters (both flag it as active and to be processed)

/par On render update, PPEManager: Handles queued requester changes, re-distributes individual commands to material structure

/par
Updates the material/parameter structure and calculates the blend values

/par
Sets the final values via native functions (only called once per changed parameter - optimization stonks)

/note Requester serves as a centralized platform for specific effec/group of effects. Although technically the direct commands to mat/param would be feasible, this allows for easier control of effect groups, /note and clearer command hierarchy (no value setters without clear parentage).

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

◆ m_ExistingPostprocessRequests

ref array<ref PPERequesterBase> m_ExistingPostprocessRequests
protected

◆ m_ManagerInitialized

bool m_ManagerInitialized
protected

Используется в Cleanup(), Init(), PPEManager() и Update().

◆ m_PPEClassMap

◆ m_PPEMaterialUpdateQueueMap

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

◆ m_UpdatedMaterials

ref array<int> m_UpdatedMaterials
protected

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

◆ m_UpdatingRequests

ref array<ref PPERequesterBase> m_UpdatingRequests
protected