ISystem

#include

Public Types

enum LevelLoadOrigin {
eLLO_Unknown, eLLO_NewLevel, eLLO_Level2Level, eLLO_Resumed,
eLLO_MapCmd
}

Public Member Functions

virtual ILoadConfigurationEntrySink * GetCVarsWhiteListConfigSink () const =0
Will return NULL if no whitelisting.
virtual SSystemGlobalEnvironment * GetGlobalEnvironment ()=0
Returns pointer to the global environment structure.
virtual ISystemUserCallback * GetUserCallback () const =0
Returns the user-defined callback, notifies of system initialization flow.
virtual const char * GetRootFolder () const =0
Returns the root folder of the engine installation.
virtual bool DoFrame (uintptr_t hWnd=0, CEnumFlags< ESystemUpdateFlags > updateFlags=CEnumFlags< ESystemUpdateFlags >())=0
virtual void RenderBegin (uintptr_t hWnd)=0
virtual void RenderEnd (bool bRenderStats=true)=0
virtual bool Update (CEnumFlags< ESystemUpdateFlags > updateFlags, int nPauseMode=0)=0
Updates the engine's systems without creating a rendered frame.
virtual void DoWorkDuringOcclusionChecks ()=0
virtual bool NeedDoWorkDuringOcclusionChecks ()=0
virtual void RenderPhysicsHelpers ()=0
virtual IManualFrameStepController * GetManualFrameStepController () const =0
Get the manual frame step controller, allows for completely blocking per-frame update.
virtual bool UpdateLoadtime ()=0
Updates only require components during loading.
virtual void SynchronousLoadingTick (const char *pFunc, int line)=0
Update screen and call some important tick functions during loading.
virtual void RenderStatistics ()=0
virtual void RenderPhysicsStatistics (IPhysicalWorld *pWorld)=0
virtual uint32 GetUsedMemory ()=0
Returns the current used memory.
virtual const char * GetUserName ()=0
Retrieve the name of the user currently logged in to the computer.
virtual uint32 GetCPUFlags ()=0
Gets current supported CPU features flags. (CPUF_SSE, CPUF_SSE2, CPUF_3DNOW, CPUF_MMX)
virtual int GetLogicalCPUCount ()=0
Gets number of CPUs.
virtual void DumpMemoryUsageStatistics (bool bUseKB=false)=0
Dumps the memory usage statistics to the logging default MB. (can be KB)
virtual void Quit ()=0
Quits the application.
virtual void Relaunch (bool bRelaunch)=0
Tells the system if it is relaunching or not.
virtual bool IsQuitting () const =0
Returns true if the application is in the shutdown phase.
virtual bool IsShaderCacheGenMode () const =0
Returns true if the application was initialized to generate the shader cache.
virtual void SerializingFile (int mode)=0
Tells the system in which way we are using the serialization system.
virtual int IsSerializingFile () const =0
virtual bool IsRelaunch () const =0
virtual void DisplayErrorMessage (const char *acMessage, float fTime, const float *pfColor=0, bool bHardError=true)=0
virtual void FatalError (const char *sFormat,...) PRINTF_PARAMS(2
virtual void virtual void ReportBug (const char *sFormat,...) PRINTF_PARAMS(2
virtual bool CheckLogVerbosity (int verbosity)=0
virtual bool IsUIFrameworkMode ()
virtual void FillRandomMT (uint32 *pOutWords, uint32 numWords)=0
Fills the output array by random numbers using CMTRand_int32 generator.
virtual CRndGen & GetRandomGenerator ()=0
virtual IZLibCompressor * GetIZLibCompressor ()=0
virtual IZLibDecompressor * GetIZLibDecompressor ()=0
virtual ILZ4Decompressor * GetLZ4Decompressor ()=0
virtual ICryPerfHUD * GetPerfHUD ()=0
virtual IPlatformOS * GetPlatformOS ()=0
virtual INotificationNetwork * GetINotificationNetwork ()=0
virtual IHardwareMouse * GetIHardwareMouse ()=0
virtual IDialogSystem * GetIDialogSystem ()=0
virtual IFlowSystem * GetIFlowSystem ()=0
virtual IBudgetingSystem * GetIBudgetingSystem ()=0
virtual INameTable * GetINameTable ()=0
virtual IDiskProfiler * GetIDiskProfiler ()=0
virtual IFrameProfileSystem * GetIProfileSystem ()=0
virtual IValidator * GetIValidator ()=0
virtual IPhysicsDebugRenderer * GetIPhysicsDebugRenderer ()=0
virtual IPhysRenderer * GetIPhysRenderer ()=0
virtual ICharacterManager * GetIAnimationSystem ()=0
virtual IStreamEngine * GetStreamEngine ()=0
virtual ICmdLine * GetICmdLine ()=0
virtual ILog * GetILog ()=0
virtual ICryPak * GetIPak ()=0
virtual ICryFont * GetICryFont ()=0
virtual IEntitySystem * GetIEntitySystem ()=0
virtual IMemoryManager * GetIMemoryManager ()=0
virtual IAISystem * GetAISystem ()=0
virtual IMovieSystem * GetIMovieSystem ()=0
virtual IPhysicalWorld * GetIPhysicalWorld ()=0
virtual CryAudio::IAudioSystem * GetIAudioSystem ()=0
virtual I3DEngine * GetI3DEngine ()=0
virtual IScriptSystem * GetIScriptSystem ()=0
virtual IConsole * GetIConsole ()=0
virtual IRemoteConsole * GetIRemoteConsole ()=0
virtual IUserAnalyticsSystem * GetIUserAnalyticsSystem ()=0
virtual Cry::IPluginManager * GetIPluginManager ()=0
virtual IProjectManager * GetIProjectManager ()=0
virtual IResourceManager * GetIResourceManager ()=0
virtual IProfilingSystem * GetIProfilingSystem ()=0
virtual ISystemEventDispatcher * GetISystemEventDispatcher ()=0
virtual IFileChangeMonitor * GetIFileChangeMonitor ()=0
virtual WIN_HWND GetHWND ()=0
virtual INetwork * GetINetwork ()=0
virtual IRenderer * GetIRenderer ()=0
virtual IInput * GetIInput ()=0
virtual ITimer * GetITimer ()=0
virtual IThreadManager * GetIThreadManager ()=0
virtual IMonoEngineModule * GetIMonoEngineModule ()=0
virtual void SetLoadingProgressListener (ILoadingProgressListener *pListener)=0
virtual ISystem::ILoadingProgressListener * GetLoadingProgressListener () const =0
virtual void SetIFlowSystem (IFlowSystem *pFlowSystem)=0
virtual void SetIDialogSystem (IDialogSystem *pDialogSystem)=0
virtual void SetIMaterialEffects (IMaterialEffects *pMaterialEffects)=0
virtual void SetIParticleManager (IParticleManager *pParticleManager)=0
virtual void SetIOpticsManager (IOpticsManager *pOpticsManager)=0
virtual void SetIFileChangeMonitor (IFileChangeMonitor *pFileChangeMonitor)=0
virtual void SetIFlashUI (IFlashUI *pFlashUI)=0
virtual void SetIUIFramework (UIFramework::IUIFramework *pUIFramework)=0
virtual void ChangeUserPath (const char *sUserPath)=0
virtual void DebugStats (bool checkpoint, bool leaks)=0
virtual void DumpWinHeaps ()=0
virtual int DumpMMStats (bool log)=0
virtual void SetForceNonDevMode (const bool bValue)=0
virtual bool GetForceNonDevMode () const =0
virtual bool WasInDevMode () const =0
virtual bool IsDevMode () const =0
virtual bool IsMODValid (const char *szMODName) const =0
virtual XmlNodeRef CreateXmlNode (const char *sNodeName="", bool bReuseStrings=false)=0
Creates new xml node.
virtual XmlNodeRef LoadXmlFromBuffer (const char *buffer, size_t size, bool bReuseStrings=false)=0
Loads xml from memory buffer, returns 0 if load failed.
virtual XmlNodeRef LoadXmlFromFile (const char *sFilename, bool bReuseStrings=false)=0
Loads xml file, returns 0 if load failed.
virtual IXmlUtils * GetXmlUtils ()=0
Retrieves access to XML utilities interface.
virtual Serialization::IArchiveHost * GetArchiveHost () const =0
Interface to access different implementations of Serialization::IArchive in a centralized way.
virtual void SetViewCamera (CCamera &Camera)=0
virtual CCamera & GetViewCamera ()=0
virtual void IgnoreUpdates (bool bIgnore)=0
When ignore update sets to true, system will ignore and updates and render calls.
virtual void SetIProcess (IProcess *process)=0
virtual IProcess * GetIProcess ()=0
virtual void SetFrameProfiler (bool on, bool display, char *prefix)=0
Frame profiler functions.
virtual struct SLoadingTimeContainer * StartLoadingSectionProfiling (CLoadingTimeProfiler *pProfiler, const char *szFuncName)=0
Starts function loading stats profiling.
virtual void EndLoadingSectionProfiling (CLoadingTimeProfiler *pProfiler)=0
Ends function loading stats profiling.
virtual CBootProfilerRecord * StartBootSectionProfiler (const char *name, const char *args, EProfileDescription type)=0
Starts function profiling with bootprofiler (session must be started).
virtual void StopBootSectionProfiler (CBootProfilerRecord *record)=0
Ends function profiling with bootprofiler.
virtual void StartBootProfilerSession (const char *szName)=0
virtual void StopBootProfilerSession (const char *szName)=0
virtual void OnFrameStart (const char *szName)=0
game dll should call this on frame start
virtual void OnFrameEnd ()=0
game dll should call this on frame end
virtual void OutputLoadingTimeStats ()=0
Prints loading stats into log.
virtual const char * GetLoadingProfilerCallstack ()=0
Starts function loading stats profiling.
virtual const SFileVersion & GetFileVersion ()=0
Gets file version.
virtual const SFileVersion & GetProductVersion ()=0
Gets product version.
virtual const SFileVersion & GetBuildVersion ()=0
Gets build version.
virtual void SaveConfiguration ()=0
virtual void LoadConfiguration (const char *sFilename, ILoadConfigurationEntrySink *pSink=0, ELoadConfigurationType configType=eLoadConfigDefault)=0
virtual ESystemConfigSpec GetConfigSpec (bool bClient=true)=0
virtual ESystemConfigSpec GetMaxConfigSpec () const =0
virtual void SetConfigSpec (ESystemConfigSpec spec, bool bClient)=0
virtual void AutoDetectSpec (const bool detectResolution)=0
Detects and set optimal spec.
virtual int SetThreadState (ESubsystem subsys, bool bActive)=0
virtual ICrySizer * CreateSizer ()=0
Creates and returns a usable object implementing ICrySizer interface.
virtual bool IsPaused () const =0
virtual ILocalizationManager * GetLocalizationManager ()=0
Retrieves localized strings manager interface.
virtual struct IHmdManager * GetHmdManager ()=0
Gets the head mounted display manager.
virtual IAVI_Reader * CreateAVIReader ()=0
Creates an instance of the AVI Reader class.
virtual void ReleaseAVIReader (IAVI_Reader *pAVIReader)=0
Release the AVI reader.
virtual ITextModeConsole * GetITextModeConsole ()=0
virtual CPNoise3 * GetNoiseGen ()=0
Retrieves the perlin noise singleton instance.
virtual uint64 GetUpdateCounter ()=0
Retrieves system update counter.
virtual ICryFactoryRegistry * GetCryFactoryRegistry () const =0
Gets access to all registered factories.
virtual bool RegisterErrorObserver (IErrorObserver *errorObserver)=0
virtual bool UnregisterErrorObserver (IErrorObserver *errorObserver)=0
virtual bool IsLoading ()=0
Returns true if the system is loading a level currently.
virtual int GetApplicationInstance ()=0
Get the index of the currently running Crytek application, (0 = first instance, 1 = second instance, etc).
virtual sUpdateTimes & GetCurrentUpdateTimeStats ()=0
Retrieves the current stats for systems to update the respective time taken.
virtual const sUpdateTimes * GetUpdateTimeStats (uint32 &, uint32 &)=0
Retrieves the array of update times and the number of entries.
virtual void ClearErrorMessages ()=0
Clear all currently logged and drawn on screen error messages.
virtual void debug_GetCallStack (const char **pFunctions, int &nCount)=0
virtual void debug_LogCallStack (int nMaxFuncs=32, int nFlags=0)=0
virtual void ApplicationTest (const char *szParam)=0
virtual ITestSystem * GetITestSystem ()=0
virtual void ExecuteCommandLine ()=0
virtual void GetUpdateStats (SSystemUpdateStats &stats)=0
virtual void DumpMemoryCoverage ()=0
virtual ESystemGlobalState GetSystemGlobalState (void)=0
virtual void SetSystemGlobalState (const ESystemGlobalState systemGlobalState)=0
virtual void AddPlatformOSCreateFlag (const uint8 createFlag)=0
Add a PlatformOS create flag.
virtual void AsyncMemcpy (void *dst, const void *src, size_t size, int nFlags, volatile int *sync)=0
virtual void GetCheckpointData (ICheckpointData &data)=0
virtual void IncreaseCheckpointLoadCount ()=0
virtual void SetLoadOrigin (LevelLoadOrigin origin)=0
virtual bool IsSavingResourceList () const =0
virtual ICryFactory * LoadModuleWithFactory (const char *szDllName, const CryInterfaceID &moduleInterfaceId)=0
Loads a dynamic library and returns the first factory with the specified interface id contained inside the module.
template
std::shared_ptr< T > LoadModuleAndCreateFactoryInstance (const char *szDllName, const SSystemInitParams &initParams)
Loads a dynamic library and creates an instance of the first factory contained inside the module.
virtual bool UnloadEngineModule (const char *szDllName)=0
Unloads a dynamic library as well as the corresponding instance of the module class.
virtual void * GetRootWindowMessageHandler ()=0
virtual void RegisterWindowMessageHandler (IWindowMessageHandler *pHandler)=0
virtual void UnregisterWindowMessageHandler (IWindowMessageHandler *pHandler)=0
Unregister an IWindowMessageHandler that was previously registered using RegisterWindowMessageHandler.
virtual int PumpWindowMessage (bool bAll, WIN_HWND hWnd=0)=0
virtual bool IsImeSupported () const =0
virtual IImeManager * GetImeManager () const =0
Returns the IME manager in use.
virtual void virtual void virtual void WarningV (EValidatorModule module, EValidatorSeverity severity, int flags, const char *file, const char *format, va_list args)=0
virtual void Warning (EValidatorModule module, EValidatorSeverity severity, int flags, const char *file, const char *format,...)=0
virtual void WarningOnce (EValidatorModule module, EValidatorSeverity severity, int flags, const char *file, const char *format,...)=0
virtual bool CompressDataBlock (const void *input, size_t inputSize, void *output, size_t &outputSize, int level=3)=0
virtual bool DecompressDataBlock (const void *input, size_t inputSize, void *output, size_t &outputSize)=0

Detailed Description

Main Engine Interface. Initialize and dispatch all engine's subsystems.

Member Function Documentation

◆ ApplicationTest()

virtual void ISystem::ApplicationTest ( const char * szParam)
pure virtual

Can be called through console Example: #System.ApplicationTest("testcase0")

Parameters
szParam0 generates error.

◆ AsyncMemcpy()

virtual void ISystem::AsyncMemcpy ( void * dst,
const void * src,
size_t size,
int nFlags,
volatile int * sync
)
pure virtual

Asynchronous memcpy. Note sync variable will be incremented (in calling thread) before job starts and decremented when job finishes. Multiple async copies can therefore be tied to the same sync variable, therefore it's advised to wait for completion with while(*sync) (yield());.

◆ ChangeUserPath()

virtual void ISystem::ChangeUserPath ( const char * sUserPath)
pure virtual

Changes current user sub path, the path is always relative to the user documents folder. Example: "My Games\Crysis"

◆ CheckLogVerbosity()

virtual bool ISystem::CheckLogVerbosity ( int verbosity)
pure virtual

Compare specified verbosity level to the one currently set.

◆ CompressDataBlock()

virtual bool ISystem::CompressDataBlock ( const void * input,
size_t inputSize,
void * output,
size_t & outputSize,
int level = 3
)
pure virtual

Data compression.

◆ debug_GetCallStack()

virtual void ISystem::debug_GetCallStack ( const char ** pFunctions,
int & nCount
)
pure virtual

Fills array of function pointers, nCount return number of functions.

Note
Pass nCount to indicate maximum number of functions to get.
For debugging use only!, queries current C++ call stack.

◆ debug_LogCallStack()

virtual void ISystem::debug_LogCallStack ( int nMaxFuncs = 32,
int nFlags = 0
)
pure virtual

Logs current callstack.

Note
For debugging use only!, queries current C++ call stack.

◆ DisplayErrorMessage()

virtual void ISystem::DisplayErrorMessage ( const char * acMessage,
float fTime,
const float * pfColor = 0,
bool bHardError = true
)
pure virtual

Displays an error message to display info for certain time

Parameters
acMessageMessage to show.
fTimeAmount of seconds to show onscreen.

◆ DoFrame()

virtual bool ISystem::DoFrame ( uintptr_t hWnd = 0,
CEnumFlags< ESystemUpdateFlags > updateFlags = CEnumFlags< ESystemUpdateFlags >()
)
pure virtual

Starts a new frame, updates engine systems, game logic and finally renders.

Returns
Returns true if the engine should continue running, false to quit.

◆ DumpMemoryCoverage()

virtual void ISystem::DumpMemoryCoverage ( )
pure virtual

Useful to investigate memory fragmentation. Every time you call this from the console: #System.DumpMemoryCoverage() it adds a line to "MemoryCoverage.bmp" (generated the first time, there is a max line count).

◆ ExecuteCommandLine()

virtual void ISystem::ExecuteCommandLine ( )
pure virtual

Execute command line arguments. Should be after init game. Example: +g_gametype ASSAULT +map "testy"

◆ FatalError()

virtual void ISystem::FatalError ( const char * sFormat,
...
)
virtual

Displays error message. Logs it to console and file and error message box then terminates execution.

◆ GetConfigSpec()

virtual ESystemConfigSpec ISystem::GetConfigSpec ( bool bClient = true)
pure virtual

Retrieves current configuration specification for client or server.

Parameters
bClientIf true returns local client config spec, if false returns server config spec.

◆ GetForceNonDevMode()

virtual bool ISystem::GetForceNonDevMode ( ) const
pure virtual
Returns
true when running on a cheat protected server or a client that is connected to it (not used in singleplayer).

◆ GetIProcess()

virtual IProcess* ISystem::GetIProcess ( )
pure virtual

Gets the active process.

Returns
Pointer to the current active process.

◆ GetIResourceManager()

virtual IResourceManager* ISystem::GetIResourceManager ( )
pure virtual
Returns
Can be NULL, because it only exists when running through the editor, not in pure game mode.

◆ GetITestSystem()

virtual ITestSystem* ISystem::GetITestSystem ( )
pure virtual
Returns
0 if not activated, activate through #System.ApplicationTest.

◆ GetRootWindowMessageHandler()

virtual void* ISystem::GetRootWindowMessageHandler ( )
pure virtual

Gets the root window message handler function. The returned pointer is platform-specific: for Windows OS, the pointer is of type WNDPROC

◆ GetUpdateStats()

virtual void ISystem::GetUpdateStats ( SSystemUpdateStats & stats)
pure virtual

GetSystemUpdate stats (all systems update without except console). Very useful on dedicated server as we throttle it to fixed frequency.

Returns
zeroes if no updates happened yet.

◆ GetViewCamera()

virtual CCamera& ISystem::GetViewCamera ( )
pure virtual

Gets the camera that will be used for main rendering next frame Note that the camera might be overridden by user code, and is only considered final after Cry::IEnginePlugin::UpdateBeforeFinalizeCamera has been executed.

◆ IsImeSupported()

virtual bool ISystem::IsImeSupported ( ) const
pure virtual

Check if IME is supported on the current platform Note: This flag depends on compile-time settings, it cannot be enabled or disabled at runtime However, the support itself can typically be enabled/disabled through CVar

◆ IsPaused()

virtual bool ISystem::IsPaused ( ) const
pure virtual

Query if system is now paused. Pause flag is set when calling system update with pause mode.

◆ LoadConfiguration()

virtual void ISystem::LoadConfiguration ( const char * sFilename,
ILoadConfigurationEntrySink * pSink = 0,
ELoadConfigurationType configType = eLoadConfigDefault
)
pure virtual

Loads system configuration

Parameters
pCallback0 means normal LoadConfigVar behaviour is used.

◆ PumpWindowMessage()

virtual int ISystem::PumpWindowMessage ( bool bAll,
WIN_HWND hWnd = 0
)
pure virtual

Pumps window messages, informing all registered IWindowMessageHandlers If bAll is true, all available messages will be pumped If hWnd is not NULL, only messages for the given window are processed (ignored on non-windows platforms) Returns the number of messages pumped, or -1 if the OS indicated the application should quit Note: Calling GetMessage or PeekMessage yourself will skip the pre-process handling required for IME support

◆ RegisterErrorObserver()

virtual bool ISystem::RegisterErrorObserver ( IErrorObserver * errorObserver)
pure virtual

Registers listeners to CryAssert and error messages (may not be called if asserts are disabled). Each pointer can be registered only once (stl::push_back_unique). It will return false if the pointer is already registered. Returns true, otherwise.

◆ RegisterWindowMessageHandler()

virtual void ISystem::RegisterWindowMessageHandler ( IWindowMessageHandler * pHandler)
pure virtual

Register a IWindowMessageHandler that will be informed about window messages. The delivered messages are platform-specific.

◆ RenderStatistics()

virtual void ISystem::RenderStatistics ( )
pure virtual

Renders the statistics. This is called from RenderEnd, but if the Host application (Editor) doesn't employ the Render cycle in ISystem, it may call this method to render the essential statistics.

◆ ReportBug()

virtual void virtual void ISystem::ReportBug ( const char * sFormat,
...
)
virtual

Reports a bug using the crash handler. Logs an error to the console and launches the crash handler, then continues execution.

◆ SaveConfiguration()

virtual void ISystem::SaveConfiguration ( )
pure virtual

Saves system configuration.

◆ SetConfigSpec()

virtual void ISystem::SetConfigSpec ( ESystemConfigSpec spec,
bool bClient
)
pure virtual

Changes current configuration specification for client or server.

Parameters
bClientIf true changes client config spec (sys_spec variable changed), if false changes only server config spec (as known on the client).

◆ SetForceNonDevMode()

virtual void ISystem::SetForceNonDevMode ( const bool bValue)
pure virtual
Parameters
bValueSet to true when running on a cheat protected server or a client that is connected to it (not used in singleplayer).

◆ SetIProcess()

virtual void ISystem::SetIProcess ( IProcess * process)
pure virtual

Sets the active process.

Parameters
processPointer to a class that implement the IProcess interface.

◆ SetThreadState()

virtual int ISystem::SetThreadState ( ESubsystem subsys,
bool bActive
)
pure virtual

Thread management for subsystems

Returns
Non-0 if the state was indeed changed, 0 if already in that state.

◆ SetViewCamera()

virtual void ISystem::SetViewCamera ( CCamera & Camera)
pure virtual

Sets the camera that will be used for main rendering next frame. This has to be set before Cry::IEnginePlugin::UpdateBeforeFinalizeCamera is called in order to be set in time for occlusion culling and rendering.

◆ UnregisterErrorObserver()

virtual bool ISystem::UnregisterErrorObserver ( IErrorObserver * errorObserver)
pure virtual

Unregisters listeners to CryAssert and error messages. It will return false if the pointer is not registered. Otherwise, returns true.

◆ WarningV()

virtual void virtual void virtual void ISystem::WarningV ( EValidatorModule module,
EValidatorSeverity severity,
int flags,
const char * file,
const char * format,
va_list args
)
pure virtual

Report warning to current Validator object. Doesn't terminate the execution.