BVB Source Codes

CRYENGINE Show AILog.h Source code

Return Download CRYENGINE: download AILog.h Source code - Download CRYENGINE Source code - Type:.h
  1. // Copyright 2001-2016 Crytek GmbH / Crytek Group. All rights reserved.
  2.  
  3. /********************************************************************
  4.    -------------------------------------------------------------------------
  5.    File name:   AILog.h
  6.    $Id$
  7.    Description:
  8.  
  9.    -------------------------------------------------------------------------
  10.    History:
  11.    - ?
  12.    - 2 Mar 2009                  : Evgeny Adamenkov: Removed IRenderer
  13.  
  14.  *********************************************************************/
  15. #ifndef AILOG_H
  16. #define AILOG_H
  17.  
  18. #if _MSC_VER > 1000
  19.         #pragma once
  20. #endif
  21.  
  22. #ifndef _RELEASE
  23.         #define ENABLE_AI_ASSERT
  24. #endif
  25.  
  26. /// Asserts that a condition is true. Can be enabled/disabled at compile time (will be enabled
  27. /// for testing). Can also be enabled/disabled at run time (if enabled at compile time), so
  28. /// code below this should handle the condition = false case. It should be used to trap
  29. /// logical/programming errors, NOT data/script errors - i.e. once the code has been tested and
  30. /// debugged, it should never get hit, whatever changes are made to data/script
  31. #ifdef ENABLE_AI_ASSERT
  32.         #define AIAssert(exp) CRY_ASSERT(exp)
  33. #else
  34.         #define AIAssert(exp) ((void)0)
  35. #endif
  36.  
  37. /// Default message verbosity levels based on type
  38. enum AI_LOG_VERBOSITY
  39. {
  40.         AI_LOG_OFF      = 0,
  41.         AI_LOG_ERROR    = 1,
  42.         AI_LOG_WARNING  = 1,
  43.         AI_LOG_PROGRESS = 1,
  44.         AI_LOG_EVENT    = 2,
  45.         AI_LOG_COMMENT  = 3,
  46. };
  47.  
  48. #ifndef CRYAISYSTEM_VERBOSITY
  49.         #define AIInitLog       (void)
  50.         #define AIWarning       (void)
  51.         #define AIError         (void)
  52.         #define AILogProgress   (void)
  53.         #define AILogEvent      (void)
  54.         #define AILogComment    (void)
  55.         #define AILogAlways     (void)
  56.         #define AILogLoading    (void)
  57.         #define AIWarningID     (void)
  58.         #define AIErrorID       (void)
  59.         #define AILogProgressID (void)
  60.         #define AILogEventID    (void)
  61.         #define AILogCommentID  (void)
  62. #else
  63.         #define AIWarningID     GetAISystem()->Warning
  64.         #define AIErrorID       GetAISystem()->Error
  65.         #define AILogProgressID GetAISystem()->LogProgress
  66.         #define AILogEventID    GetAISystem()->LogEvent
  67.         #define AILogCommentID  GetAISystem()->LogComment
  68. #endif
  69.  
  70. #ifdef CRYAISYSTEM_VERBOSITY
  71.  
  72. /// Sets up console variables etc
  73. void AIInitLog(struct ISystem* system);
  74.  
  75. /// Return the verbosity for the console output
  76. int AIGetLogConsoleVerbosity();
  77.  
  78. /// Return the verbosity for the file output
  79. int AIGetLogFileVerbosity();
  80.  
  81. /// Check the verbosity level for file/console output
  82. bool AICheckLogVerbosity(const AI_LOG_VERBOSITY CheckVerbosity);
  83.  
  84. /// Indicates if AI warnings/errors are enabled (e.g. for validation code you
  85. /// don't want to run if there would be no output)
  86. bool AIGetWarningErrorsEnabled();
  87.  
  88. /// Reports an AI Warning. This should be used when AI gets passed data from outside that
  89. /// is "bad", but we can handle it and it shouldn't cause serious problems.
  90. void AIWarning(const char* format, ...) PRINTF_PARAMS(1, 2);
  91.  
  92. /// Reports an AI Error. This should be used when AI either gets passed data that is so
  93. /// bad that we can't handle it, or we want to detect/check against a logical/programming
  94. /// error and be sure this check isn't ever compiled out (like an assert might be). Unless
  95. /// in performance critical code, prefer a manual test with AIError to using AIAssert.
  96. /// Note that in the editor this will return (so problems can be fixed). In game it will cause
  97. /// execution to halt.
  98. void AIError(const char* format, ...) PRINTF_PARAMS(1, 2);
  99.  
  100. /// Used to log progress points - e.g. startup/shutdown/loading of AI. With the default (for testers etc)
  101. /// verbosity settings this will write to the log file and the console.
  102. void AILogProgress(const char* format, ...) PRINTF_PARAMS(1, 2);
  103.  
  104. /// Used to log significant events like AI state changes. With the default (for testers etc)
  105. /// verbosity settings this will write to the log file, but not the console.
  106.  
  107. void AILogEvent(const char* format, ...) PRINTF_PARAMS(1, 2);
  108.  
  109. /// Used to log events like that AI people might be interested in during their private testing.
  110. /// With the default (for testers etc) verbosity settings this will not write to the log file
  111. /// or the console.
  112. void AILogComment(const char* format, ...) PRINTF_PARAMS(1, 2);
  113.  
  114. /// Should probably never be used since it bypasses verbosity checks
  115. void AILogAlways(const char* format, ...) PRINTF_PARAMS(1, 2);
  116.  
  117. /// Displays messages during loading - also gives an opportunity for system/display to update
  118. void AILogLoading(const char* format, ...) PRINTF_PARAMS(1, 2);
  119.  
  120. /// Overlays the saved messages - called from CAISystem::DebugDraw
  121. void AILogDisplaySavedMsgs();
  122.  
  123. #endif // CRYAISYSTEM_NO_VERBOSITY
  124.  
  125. #endif // file included
  126.  
downloadAILog.h Source code - Download CRYENGINE Source code
Related Source Codes/Software:
postal - 2017-06-11
reactide - Reactide is the first dedicated IDE for React web ... 2017-06-11
rkt - rkt is a pod-native container engine for Linux. It... 2017-06-11
uWebSockets - Tiny WebSockets https://for... 2017-06-11
realworld - TodoMVC for the RealWorld - Exemplary fullstack Me... 2017-06-11
CRYENGINE - CRYENGINE is a powerful real-time game development... 2017-06-11
goreplay - GoReplay is an open-source tool for capturing and ... 2017-06-10
pyenv - Simple Python version management 2017-06-10
redux-saga - An alternative side effect model for Redux apps ... 2017-06-10
angular-starter - 2017-06-10

 Back to top