Dayz 1.25
Dayz Code 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.

355 {
356 if (m_PPEClassMap.Contains(type))
357 {
359 typename name = mat_class.Type();
361 postprocess_capsule.ChangeMaterialPathUsed(path);
362
363 if (postprocess_capsule.GetMaterial() == 0x0)
364 {
365 Debug.Log("PPEManager | Invalid material path " + path + " used for " + name );
366 return;
367 }
368
369 //m_PPEClassMap.Remove(type);
371 }
372
373 //can be sent script-side only to adapt to c++ options changes
374 if (!scriptside_only)
376 }
PlayerSpawnPresetDiscreteItemSetSlotData name
one set for cargo
string path
Definition OptionSelectorMultistate.c:135
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
188 {
190 }

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

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

◆ DbgPrnt()

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

◆ GetExistingRequester()

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

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

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

◆ GetPostProcessCurrentValues()

Param GetPostProcessCurrentValues ( int material,
int parameter )
protected

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

346 {
348 return mat_class.GetParameterCommandData(parameter).GetCurrentValues();
349 }

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

◆ GetPostProcessDefaultValues()

Param GetPostProcessDefaultValues ( int material,
int parameter )
protected

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

339 {
341 return mat_class.GetParameterCommandData(parameter).GetDefaultValues();
342 }

Перекрестные ссылки 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
134 }
void RegisterPPEClass(PPEClassBase material_class)
Registeres material class and creates data structure within.
Definition PPEManager.c:137
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
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
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'.

277 {
278 if ( m_UpdatedMaterials.Find(mat_id) == -1 )
280 }

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

◆ IsAnyRequesterRunning()

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

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

◆ PPEManager()

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

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

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

◆ ProcessApplyValueChanges()

void ProcessApplyValueChanges ( )
protected
313 {
314 int material_id;
315 for (int i = 0; i < m_UpdatedMaterials.Count(); i++)
316 {
319 mat_class.ApplyValueChanges();
320 }
321
322 m_UpdatedMaterials.Clear();
324 }
void ClearMaterialUpdating()
Definition PPEManager.c:187

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

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

◆ ProcessMaterialUpdates()

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

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

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

◆ ProcessRequesterUpdates()

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

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

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

◆ RegisterPPEClass()

void RegisterPPEClass ( PPEClassBase material_class)
protected

Registeres material class and creates data structure within.

138 {
139 m_PPEClassMap.Set(material_class.GetPostProcessEffectID(), material_class);
140 }

Перекрестные ссылки 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.

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

Перекрестные ссылки 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)

177 {
178 if ( m_PPEMaterialUpdateQueueMap.Contains(order) )
179 {
181
182 if ( m_PPEMaterialUpdateQueueMap.Get(order).Count() == 0)
184 }
185 }

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

◆ RequestsCleanup()

void RequestsCleanup ( )
protected

Unused cleanup method, should it be ever needed.

272 {
273 }

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

◆ SendMaterialValueData()

void SendMaterialValueData ( PPERequestParamDataBase data)
protected
143 {
144 //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]);
145 PPEClassBase mat_class = m_PPEClassMap.Get(data.GetMaterialID());
146 mat_class.InsertParamValueData(data);
147 SetMaterialParamUpdating(data.GetMaterialID(),data.GetParameterID(),PPEConstants.DEPENDENCY_ORDER_BASE);
148 }
void SetMaterialParamUpdating(int material_id, int parameter_id, int order)
Queues material/parameter to update (once)
Definition PPEManager.c:151

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

◆ SetMaterialParamUpdating()

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

Queues material/parameter to update (once)

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

Перекрестные ссылки 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.

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

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

◆ SetRequestUpdating()

void SetRequestUpdating ( PPERequesterBase request,
bool active )
protected

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

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

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

◆ StopAllEffects()

void StopAllEffects ( int mask = 0)
protected

stops all effects of a certain kind

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

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

◆ Update()

void Update ( float timeslice)
protected
327 {
329 return;
330
334 RequestsCleanup(); //unused
335 }
void RequestsCleanup()
Unused cleanup method, should it be ever needed.
Definition PPEManager.c:271
void ProcessRequesterUpdates(float timeslice)
Definition PPEManager.c:285
void ProcessApplyValueChanges()
Definition PPEManager.c:312
void ProcessMaterialUpdates(float timeslice)
Definition PPEManager.c:297

Перекрестные ссылки 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