struct ISystem { struct ILoadingProgressListener { }; enum LevelLoadOrigin { eLLO_Unknown, eLLO_NewLevel, eLLO_Level2Level, eLLO_Resumed, eLLO_MapCmd }; struct ICheckpointData { int m_totalLoads; LevelLoadOrigin m_loadOrigin; }; };
ISystem.h
Main Engine Interface. Initialize and dispatch all engine's subsystems.
struct ICheckpointData { int m_totalLoads; LevelLoadOrigin m_loadOrigin; };
ISystem.h
struct ILoadingProgressListener { };
ISystem.h
virtual ~ILoadingProgressListener();
virtual void OnLoadingProgress(int steps) = 0;
enum LevelLoadOrigin { eLLO_Unknown, eLLO_NewLevel, eLLO_Level2Level, eLLO_Resumed, eLLO_MapCmd };
ISystem.h
virtual ~ISystem();
Add a PlatformOS create flag
virtual void AddPlatformOSCreateFlag(const uint8 createFlag) = 0;
Can be called through console
virtual void ApplicationTest(const char * szParam) = 0;
Parameters |
Description |
const char * szParam |
0 generates error |
#System.ApplicationTest("testcase0")
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());
virtual void AsyncMemcpy(void* dst, const void* src, size_t size, int nFlags, volatile int* sync) = 0;
Detects and set optimal spec.
virtual void AutoDetectSpec(const bool detectResolution) = 0;
Changes current user sub path, the path is always relative to the user documents folder.
virtual void ChangeUserPath(const char * sUserPath) = 0;
"My GamesCrysis"
Compare specified verbosity level to the one currently set.
virtual bool CheckLogVerbosity(int verbosity) = 0;
Clear all currently logged and drawn on screen error messages
virtual void ClearErrorMessages() = 0;
virtual bool CompressDataBlock(const void * input, size_t inputSize, void * output, size_t& outputSize, int level = 3) = 0;
Creates an instance of the AVI Reader class.
virtual IAVI_Reader * CreateAVIReader() = 0;
virtual IFlashPlayerBootStrapper* CreateFlashPlayerBootStrapper() const = 0;
Creates an instance of the IFlashPlayer interface.
virtual IFlashPlayer* CreateFlashPlayerInstance() const = 0;
Creates and returns a usable object implementing ICrySizer interface.
virtual ICrySizer* CreateSizer() = 0;
Creates new xml node.
virtual XmlNodeRef CreateXmlNode(const char * sNodeName = "", bool bReuseStrings = false) = 0;
virtual void debug_GetCallStack(const char ** pFunctions, int & nCount) = 0;
Notes: Pass nCount to indicate maximum number of functions to get. For debugging use only, query current C++ call stack.
Fills array of function pointers, nCount return number of functions.
Logs current callstack. Notes: For debugging use only!, query current C++ call stack.
virtual void debug_LogCallStack(int nMaxFuncs = 32, int nFlags = 0) = 0;
virtual void DebugStats(bool checkpoint, bool leaks) = 0;
virtual const char *GetGamePath()=0;
virtual bool DecompressDataBlock(const void * input, size_t inputSize, void * output, size_t& outputSize) = 0;
Displays an error message to display info for certain time
virtual void DisplayErrorMessage(const char* acMessage, float fTime, const float* pfColor = 0, bool bHardError = true) = 0;
Parameters |
Description |
const char* acMessage |
Message to show |
float fTime |
Amount of seconds to show onscreen |
Optimisation: do part of the update while waiting for occlusion queries to complete
virtual void DoWorkDuringOcclusionChecks() = 0;
virtual void DumpMemoryCoverage() = 0;
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).
Dumps the memory usage statistics to the logging default MB. (can be KB)
virtual void DumpMemoryUsageStatistics(bool bUseKB = false) = 0;
virtual int DumpMMStats(bool log) = 0;
virtual void DumpWinHeaps() = 0;
Ends function loading stats profiling.
virtual void EndLoadingSectionProfiling(CLoadingTimeProfiler * pProfiler) = 0;
virtual void ExecuteCommandLine() = 0;
Execute command line arguments. Should be after init game.
+g_gametype ASSAULT +map "testy"
virtual void FatalError(const char * sFormat, ...);
Displays error message. Logs it to console and file and error message box then terminates execution.
virtual IAISystem * GetAISystem() = 0;
Get the index of the currently running Crytek application. (0 = first instance, 1 = second instance, etc)
virtual int GetApplicationInstance() = 0;
Gets build version.
virtual const SFileVersion& GetBuildVersion() = 0;
virtual void GetCheckpointData(ICheckpointData& data) = 0;
defined(CVARS_WHITELIST)
virtual unsigned int GetCompressedFileSize(const char * filename) = 0;
Retrieves current configuration specification for client or server.
virtual ESystemConfigSpec GetConfigSpec(bool bClient = true) = 0;
Parameters |
Description |
bool bClient = true |
If true returns local client config spec, if false returns server config spec. |
Gets current supported CPU features flags. (CPUF_SSE, CPUF_SSE2, CPUF_3DNOW, CPUF_MMX)
virtual int GetCPUFlags() = 0;
Retrieves the crc32 singleton instance.
virtual Crc32Gen* GetCrc32Gen() = 0;
Gets access to all registered factories.
virtual ICryFactoryRegistry* GetCryFactoryRegistry() const = 0;
Retrieves the current stats for systems to update the respective time taken
virtual sUpdateTimes& GetCurrentUpdateTimeStats() = 0;
virtual ILoadConfigurationEntrySink* GetCVarsWhiteListConfigSink() const = 0;
will return NULL if no whitelisting
virtual char* GetDeveloperName(char* devName) = 0;
virtual struct IEvaluationManager* GetEvaluationManager() = 0;
Gets file version.
virtual const SFileVersion& GetFileVersion() = 0;
virtual void GetFlashProfileResults(float& accumTime, bool reset) const = 0;
virtual bool GetForceNonDevMode() const = 0;
True when running on a cheat protected server or a client that is connected to it (not used in singleplayer).
Returns pointer to the global environment structure.
virtual SSystemGlobalEnvironment* GetGlobalEnvironment() = 0;
Gets instance of a head mounted display device. It is currently possible to have only one device per type, so far. To choose which device will be your current one, use the console variable sys_CurrentHMDType = IHMDDevice::DeviceType.
virtual IHMDDevice* GetHMDDevice() const = 0;
virtual WIN_HWND GetHWND() = 0;
virtual I3DEngine * GetI3DEngine() = 0;
virtual ICharacterManager * GetIAnimationSystem() = 0;
virtual IAudioSystem * GetIAudioSystem() = 0;
virtual IBudgetingSystem * GetIBudgetingSystem() = 0;
virtual ICmdLine * GetICmdLine() = 0;
virtual IConsole * GetIConsole() = 0;
virtual ICryFont * GetICryFont() = 0;
Retrieves IDataProbe interface.
virtual IDataProbe* GetIDataProbe() = 0;
virtual IDialogSystem * GetIDialogSystem() = 0;
virtual IDiskProfiler * GetIDiskProfiler() = 0;
virtual IEntitySystem * GetIEntitySystem() = 0;
virtual IFileChangeMonitor * GetIFileChangeMonitor() = 0;
virtual IFlowSystem * GetIFlowSystem() = 0;
virtual IGame * GetIGame() = 0;
virtual IHardwareMouse * GetIHardwareMouse() = 0;
virtual IInput * GetIInput() = 0;
virtual ILog * GetILog() = 0;
virtual IMemoryManager * GetIMemoryManager() = 0;
virtual IMovieSystem * GetIMovieSystem() = 0;
virtual IMusicSystem * GetIMusicSystem() = 0;
virtual INameTable * GetINameTable() = 0;
virtual INetwork * GetINetwork() = 0;
virtual INotificationNetwork * GetINotificationNetwork() = 0;
virtual ICryPak * GetIPak() = 0;
virtual IPhysicalWorld * GetIPhysicalWorld() = 0;
virtual IPhysicsDebugRenderer* GetIPhysicsDebugRenderer() = 0;
Gets the active process.
virtual IProcess* GetIProcess() = 0;
A pointer to the current active process.
virtual IFrameProfileSystem * GetIProfileSystem() = 0;
virtual IProfilingSystem * GetIProfilingSystem() = 0;
virtual IRemoteConsole * GetIRemoteConsole() = 0;
virtual IRenderer * GetIRenderer() = 0;
virtual IResourceManager * GetIResourceManager() = 0;
Can be NULL, because it only exists when running through the editor, not in pure game mode.
virtual IScriptSystem * GetIScriptSystem() = 0;
virtual ISystemEventDispatcher * GetISystemEventDispatcher() = 0;
virtual ITestSystem * GetITestSystem() = 0;
0 if not activated, activate through #System.ApplicationTest
virtual ITextModeConsole * GetITextModeConsole() = 0;
virtual IThreadTaskManager * GetIThreadTaskManager() = 0;
virtual ITimer * GetITimer() = 0;
virtual IValidator * GetIValidator() = 0;
virtual IVisualLog * GetIVisualLog() = 0;
virtual IZLibCompressor * GetIZLibCompressor() = 0;
virtual IZLibDecompressor * GetIZLibDecompressor() = 0;
virtual struct ILevelEncrypter * GetLevelEncrypter() = 0;
Starts function loading stats profiling.
virtual const char* GetLoadingProfilerCallstack() = 0;
virtual ISystem::ILoadingProgressListener * GetLoadingProgressListener() const = 0;
Retrieves localized strings manager interface.
virtual ILocalizationManager* GetLocalizationManager() = 0;
Gets number of CPUs
virtual int GetLogicalCPUCount() = 0;
virtual ILZ4Decompressor * GetLZ4Decompressor() = 0;
virtual ESystemConfigSpec GetMaxConfigSpec() const = 0;
Retrieves the perlin noise singleton instance.
virtual CPNoise3* GetNoiseGen() = 0;
virtual ICryPerfHUD * GetPerfHUD() = 0;
virtual IPlatformOS * GetPlatformOS() = 0;
Gets product version.
virtual const SFileVersion& GetProductVersion() = 0;
Returns the root folder specified by the command line option "-root "
virtual const char* GetRootFolder() const = 0;
virtual IStreamEngine * GetStreamEngine() = 0;
virtual ESystemGlobalState GetSystemGlobalState() = 0;
Retrieves system update counter.
virtual uint64 GetUpdateCounter() = 0;
virtual void GetUpdateStats(SSystemUpdateStats& stats) = 0;
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
Retrieves the array of update times and the number of entries
virtual const sUpdateTimes* GetUpdateTimeStats(uint32&, uint32&) = 0;
Returns the current used memory.
virtual uint32 GetUsedMemory() = 0;
Retrieve the name of the user currently logged in to the computer.
virtual const char * GetUserName() = 0;
virtual CCamera& GetViewCamera() = 0;
Retrieves access to XML utilities interface.
virtual IXmlUtils* GetXmlUtils() = 0;
virtual void GFxAmpAdvanceFrame() = 0;
virtual void GFxAmpEnable(bool bEnable) = 0;
Test if specified HMD device type is available. Parameter "type" should have value from IHMDDevice::DeviceType enum. (using unsigned int so we don't pollute ISystem.h with IHMDDevice.h)
virtual bool HasHMDDevice(unsigned int type) const = 0;
virtual uint32 HashStringLowerSeed(const char* string, const uint32 seed) = 0;
virtual uint32 HashStringSeed(const char* string, const uint32 seed) = 0;
Just for DLL based version: implementation for CryStringUtils::HashString[Lower]Seed
virtual void IgnoreUpdates(bool bIgnore) = 0;
When ignore update sets to true, system will ignore and updates and render calls.
virtual void IncreaseCheckpointLoadCount() = 0;
Loads a dynamic library, creates and initializes an instance of the module class
virtual bool IntializeEngineModule(const char * dllName, const char * moduleClassName, const SSystemInitParams & initParams, bool bQuitIfNotFound) = 0;
Returns if the assert window from CryAssert is visible. OBS1: needed by the editor, as in some cases it can freeze if during an assert engine it will handle some events such as mouse movement in a CryPhysics assert. OBS2: it will always return false, if asserts are disabled or ignored.
virtual bool IsAssertDialogVisible() const = 0;
virtual bool IsDevMode() const = 0;
virtual bool IsMODValid(const char * szMODName) const = 0;
Query if system is now paused. Pause flag is set when calling system update with pause mode.
virtual bool IsPaused() const = 0;
Returns true if the application is in the shutdown phase.
virtual bool IsQuitting() const = 0;
virtual bool IsRelaunch() const = 0;
virtual int IsSerializingFile() const = 0;
Returns true if the application was initialized to generate the shader cache.
virtual bool IsShaderCacheGenMode() const = 0;
virtual bool IsTestMode() const = 0;
True if system running in Test mode.
virtual bool IsUIFrameworkMode();
Loads system configuration
virtual void LoadConfiguration(const char * sFilename, ILoadConfigurationEntrySink * pSink = 0) = 0;
Parameters |
Description |
pCallback |
0 means normal LoadConfigVar behaviour is used |
Loads xml from memory buffer, returns 0 if load failed.
virtual XmlNodeRef LoadXmlFromBuffer(const char * buffer, size_t size, bool bReuseStrings = false) = 0;
Loads xml file, returns 0 if load failed.
virtual XmlNodeRef LoadXmlFromFile(const char * sFilename, bool bReuseStrings = false) = 0;
virtual bool NeedDoWorkDuringOcclusionChecks() = 0;
Called after the processing of the assert message box(Windows or Xbox). It will be called even when asserts are disabled by the console variables.
virtual void OnAssert(const char* condition, const char* message, const char* fileName, unsigned int fileLineNumber) = 0;
Prints loading stats into log.
virtual void OutputLoadingTimeStats() = 0;
Quits the application.
virtual void Quit() = 0;
virtual unsigned int ReadCompressedFile(const char * filename, void * data, unsigned int maxbitlen) = 0;
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.
virtual bool RegisterErrorObserver(IErrorObserver* errorObserver) = 0;
Tells the system if it is relaunching or not.
virtual void Relaunch(bool bRelaunch) = 0;
Releases ISystem.
virtual void Release() = 0;
virtual void ReleaseAVIReader(IAVI_Reader * pAVIReader) = 0;
Release the AVI reader
Renders subsystems.
virtual void Render() = 0;
Begins rendering frame.
virtual void RenderBegin() = 0;
Ends rendering frame and swap back buffer.
virtual void RenderEnd(bool bRenderStats = true) = 0;
virtual void RenderPhysicsStatistics(IPhysicalWorld* pWorld) = 0;
virtual void RenderStatistics() = 0;
virtual void ReportBug(const char * sFormat, ...);
Reports a bug using the crash handler. Logs an error to the console and launches the crash handler, then continues execution.
virtual void ResetFlashMeshCache() const = 0;
virtual void ResetWatchdogTimer() = 0;
Reset the watchdog timer
Saves system configuration.
virtual void SaveConfiguration() = 0;
Tells the system in which way we are using the serialization system.
virtual void SerializingFile(int mode) = 0;
Sets the AssertVisisble internal variable. Typically it should only be called by CryAssert.
virtual void SetAssertVisible(bool bAssertVisble) = 0;
Changes current configuration specification for client or server.
virtual void SetConfigSpec(ESystemConfigSpec spec, bool bClient) = 0;
Parameters |
Description |
bool bClient |
If true changes client config spec (sys_spec variable changed), if false changes only server config spec (as known on the client). |
virtual void SetFlashLoadMovieHandler(IFlashLoadMovieHandler* pHandler) const = 0;
virtual void SetForceNonDevMode(const bool bValue) = 0;
Parameters |
Description |
const bool bValue |
Set to true when running on a cheat protected server or a client that is connected to it (not used in singleplayer). |
Frame profiler functions
virtual void SetFrameProfiler(bool on, bool display, char * prefix) = 0;
virtual void SetIDialogSystem(IDialogSystem* pDialogSystem) = 0;
virtual void SetIFileChangeMonitor(IFileChangeMonitor* pFileChangeMonitor) = 0;
virtual void SetIFlashUI(IFlashUI* pFlashUI) = 0;
virtual void SetIFlowSystem(IFlowSystem* pFlowSystem) = 0;
Game is created after System init, so has to be set explicitly.
virtual void SetIGame(IGame* pGame) = 0;
virtual void SetIMaterialEffects(IMaterialEffects* pMaterialEffects) = 0;
virtual void SetIOpticsManager(IOpticsManager* pOpticsManager) = 0;
virtual void SetIParticleManager(IParticleManager* pParticleManager) = 0;
Sets the active process
virtual void SetIProcess(IProcess * process) = 0;
Parameters |
Description |
IProcess * process |
A pointer to a class that implement the IProcess interface. |
virtual void SetIVisualLog(IVisualLog* pVisualLog) = 0;
virtual void SetLoadingProgressListener(ILoadingProgressListener * pListener) = 0;
virtual void SetLoadOrigin(LevelLoadOrigin origin) = 0;
virtual void SetSystemGlobalState(const ESystemGlobalState systemGlobalState) = 0;
Thread management for subsystems
virtual int SetThreadState(ESubsystem subsys, bool bActive) = 0;
Non-0 if the state was indeed changed, 0 if already in that state.
virtual void SetViewCamera(CCamera & Camera) = 0;
virtual int ShowMessage(const char* text, const char* caption, unsigned int uType) = 0;
Report message by provider or by using CryMessageBox. Doesn't terminate the execution.
Starts frame session
virtual void StartBootProfilerSessionFrames(const char* pName) = 0;
Starts function profiling with bootprofiler (session must be started).
virtual CBootProfilerRecord* StartBootSectionProfiler(const char* name, const char* args) = 0;
Starts function loading stats profiling.
virtual struct SLoadingTimeContainer * StartLoadingSectionProfiling(CLoadingTimeProfiler * pProfiler, const char * szFuncName) = 0;
virtual bool SteamInit() = 0;
Initializes Steam if needed and returns if it was successful
Stops frame session
virtual void StopBootProfilerSessionFrames() = 0;
Ends function profiling with bootprofiler.
virtual void StopBootSectionProfiler(CBootProfilerRecord* record) = 0;
virtual void SynchronousLoadingTick(const char* pFunc, int line) = 0;
! Update screen and call some important tick functions during loading.
Unregisters listeners to CryAssert and error messages. It will return false if the pointer is not registered. Otherwise, returns true.
virtual bool UnregisterErrorObserver(IErrorObserver* errorObserver) = 0;
Updates all subsystems (including the ScriptSink() )
virtual bool Update(int updateFlags = 0, int nPauseMode = 0) = 0;
Parameters |
Description |
int nPauseMode = 0 |
0=normal(no pause), 1=menu/pause, 2=cutscene |
flags |
One or more flags from ESystemUpdateFlags structure. |
Updates only require components during loading
virtual bool UpdateLoadtime() = 0;
virtual void Warning(EValidatorModule module, EValidatorSeverity severity, int flags, const char * file, const char * format, ...) = 0;
virtual void WarningV(EValidatorModule module, EValidatorSeverity severity, int flags, const char * file, const char * format, va_list args) = 0;
Report warning to current Validator object. Doesn't terminate the execution.
virtual bool WasInDevMode() const = 0;
Compressed file read & write
virtual bool WriteCompressedFile(const char * filename, void * data, unsigned int bitlen) = 0;