PC Stable Documentation
 
All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
Loading...
Searching...
No Matches
PPEManager.c File Reference

Data Structures

class  PPEManagerStatic
 Static component of PPE manager, used to hold the instance. More...
 

Functions

void PPEManager ()
 
void Cleanup ()
 
void Init ()
 Launched from 'DayZGame.DeferredInit' to make earlier access, use, and updates impossible (downside of a non-static system)
 
protected void InitPPEManagerClassMap ()
 Ordered by 'PostProcessEffectType' for easy access through the same enum; ID saved all the same.
 
protected 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)
 
protected 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)
 
protected void RemoveActiveRequestFromMaterials (PPERequesterBase req)
 
protected 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'.
 
protected void ProcessRequesterUpdates (float timeslice)
 
protected void ProcessMaterialUpdates (float timeslice)
 
protected 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)
 

Variables

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

Function Documentation

◆ ChangePPEMaterial()

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.

References CAMERA_ID, PPEClassBase::ChangeMaterialPathUsed(), PPEClassBase::GetMaterial(), Debug::Log(), m_PPEClassMap, name, path, and SetCameraPostProcessEffect().

◆ Cleanup()

◆ ClearMaterialUpdating()

protected void ClearMaterialUpdating ( )

◆ DbgPrnt()

void DbgPrnt ( string  text)

◆ GetExistingRequester()

bool GetExistingRequester ( typename req  ,
out PPERequesterBase  ret 
)

◆ GetPostProcessCurrentValues()

Param GetPostProcessCurrentValues ( int  material,
int  parameter 
)

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

References PPEMatClassParameterCommandData::GetCurrentValues(), PPEClassBase::GetParameterCommandData(), and m_PPEClassMap.

◆ GetPostProcessDefaultValues()

Param GetPostProcessDefaultValues ( int  material,
int  parameter 
)

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

References PPEMatClassParameterCommandData::GetDefaultValues(), PPEClassBase::GetParameterCommandData(), and m_PPEClassMap.

◆ Init()

void Init ( )

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

References CALL_CATEGORY_GUI, GetGame(), CGame::GetUpdateQueue(), InitPPEManagerClassMap(), ScriptInvoker::Insert(), m_ExistingPostprocessRequests, m_ManagerInitialized, m_PPEMaterialUpdateQueueMap, m_UpdatedMaterials, m_UpdatingRequests, and Update().

◆ InitPPEManagerClassMap()

protected void InitPPEManagerClassMap ( )

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

References m_PPEClassMap, and RegisterPPEClass().

Referenced by Init().

◆ InsertUpdatedMaterial()

void InsertUpdatedMaterial ( int  mat_id)

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

References m_UpdatedMaterials.

◆ IsAnyRequesterRunning()

bool IsAnyRequesterRunning ( array< typename requesters)

◆ PPEManager()

void PPEManager ( )

◆ ProcessApplyValueChanges()

protected void ProcessApplyValueChanges ( )

◆ ProcessMaterialUpdates()

protected void ProcessMaterialUpdates ( float  timeslice)

◆ ProcessRequesterUpdates()

protected void ProcessRequesterUpdates ( float  timeslice)

References m_UpdatingRequests, and PPERequesterBase::OnUpdate().

Referenced by Update().

◆ RegisterPPEClass()

protected void RegisterPPEClass ( PPEClassBase  material_class)

Registeres material class and creates data structure within.

References PPEClassBase::GetPostProcessEffectID(), and m_PPEClassMap.

Referenced by InitPPEManagerClassMap().

◆ RemoveActiveRequestFromMaterials()

protected void RemoveActiveRequestFromMaterials ( PPERequesterBase  req)

/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.

References PPERequesterBase::GetActiveRequestStructure(), PPERequesterBase::GetRequesterIDX(), m_PPEClassMap, and PPEClassBase::RemoveRequest().

◆ RemoveMaterialUpdating()

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)

References m_PPEMaterialUpdateQueueMap.

◆ RequestsCleanup()

protected void RequestsCleanup ( )

Unused cleanup method, should it be ever needed.

Referenced by Update().

◆ SendMaterialValueData()

◆ SetMaterialParamUpdating()

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

Queues material/parameter to update (once)

References m_PPEClassMap, m_PPEMaterialUpdateQueueMap, and PPEClassBase::SetParameterUpdating().

Referenced by SendMaterialValueData().

◆ SetRequestActive()

void SetRequestActive ( PPERequesterBase  request,
bool  active 
)

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

References m_ExistingPostprocessRequests.

◆ SetRequestUpdating()

void SetRequestUpdating ( PPERequesterBase  request,
bool  active 
)

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

References Debug::Log(), and m_UpdatingRequests.

◆ StopAllEffects()

void StopAllEffects ( int  mask = 0)

stops all effects of a certain kind

References m_ExistingPostprocessRequests.

◆ Update()

Variable Documentation

◆ 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).

Referenced by ChangePPEMaterial().

◆ m_ExistingPostprocessRequests

protected ref array<ref PPERequesterBase> m_ExistingPostprocessRequests

◆ m_ManagerInitialized

protected bool m_ManagerInitialized

Referenced by Cleanup(), Init(), PPEManager(), and Update().

◆ m_PPEClassMap

◆ m_PPEMaterialUpdateQueueMap

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

◆ m_UpdatedMaterials

protected ref array<int> m_UpdatedMaterials

◆ m_UpdatingRequests

protected ref array<ref PPERequesterBase> m_UpdatingRequests