ScriptEngine.h 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497
  1. /*
  2. ** Command & Conquer Generals(tm)
  3. ** Copyright 2025 Electronic Arts Inc.
  4. **
  5. ** This program is free software: you can redistribute it and/or modify
  6. ** it under the terms of the GNU General Public License as published by
  7. ** the Free Software Foundation, either version 3 of the License, or
  8. ** (at your option) any later version.
  9. **
  10. ** This program is distributed in the hope that it will be useful,
  11. ** but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. ** GNU General Public License for more details.
  14. **
  15. ** You should have received a copy of the GNU General Public License
  16. ** along with this program. If not, see <http://www.gnu.org/licenses/>.
  17. */
  18. ////////////////////////////////////////////////////////////////////////////////
  19. // //
  20. // (c) 2001-2003 Electronic Arts Inc. //
  21. // //
  22. ////////////////////////////////////////////////////////////////////////////////
  23. // FILE: ScriptEngine.h ///////////////////////////////////////////////////////////////////////////
  24. // Script evaluation engine.
  25. // Author: John Ahlquist, Nov. 2001
  26. ///////////////////////////////////////////////////////////////////////////////////////////////////
  27. #pragma once
  28. #ifndef __SCRIPTENGINE_H_
  29. #define __SCRIPTENGINE_H_
  30. #include "Common/GameType.h"
  31. #include "Common/GameMemory.h"
  32. #include "Common/STLTypedefs.h"
  33. #include "Common/Science.h"
  34. #include "Common/Snapshot.h"
  35. #include "Common/SubsystemInterface.h"
  36. #include "GameLogic/Scripts.h"
  37. class DataChunkInput;
  38. struct DataChunkInfo;
  39. class DataChunkOutput;
  40. class Team;
  41. class Object;
  42. class ThingTemplate;
  43. class Player;
  44. class PolygonTrigger;
  45. class ObjectTypes;
  46. #ifdef _INTERNAL
  47. #define SPECIAL_SCRIPT_PROFILING
  48. #endif
  49. // Slightly odd place to put breeze info, but the breeze info is
  50. // set by script, so it's as good a place as any. john a.
  51. struct BreezeInfo
  52. {
  53. Real m_direction; ///< Direction of the breeze in radians. 0 == +x direction.
  54. Coord2D m_directionVec; ///< sin/cos of direction, for efficiency.
  55. Real m_intensity; ///< How far to sway back & forth in radians. 0 = none.
  56. Real m_lean; ///< How far to lean with the wind in radians. 0 = none.
  57. Real m_randomness; ///< Randomness 0=perfectly uniform, 1 = +- up to 50% randomly.
  58. Short m_breezePeriod; ///< How many frames it takes to sway forward & back.
  59. Short m_breezeVersion; ///< Incremented each time the settings are updated.
  60. };
  61. // This could belong elsewhere, but for now...
  62. struct NamedReveal
  63. {
  64. AsciiString m_revealName;
  65. AsciiString m_waypointName;
  66. Real m_radiusToReveal;
  67. AsciiString m_playerName;
  68. };
  69. struct TScriptListReadInfo
  70. {
  71. Int numLists;
  72. ScriptList *readLists[MAX_PLAYER_COUNT];
  73. };
  74. struct TCounter
  75. {
  76. Int value;
  77. AsciiString name;
  78. Bool isCountdownTimer;
  79. };
  80. struct TFlag
  81. {
  82. Bool value;
  83. AsciiString name;
  84. };
  85. typedef std::list<AsciiString> ListAsciiString;
  86. typedef std::list<AsciiString>::iterator ListAsciiStringIt;
  87. typedef std::pair<AsciiString, UnsignedInt> PairAsciiStringUINT;
  88. typedef std::list<PairAsciiStringUINT> ListAsciiStringUINT;
  89. typedef ListAsciiStringUINT::iterator ListAsciiStringUINTIt;
  90. typedef std::map< const ThingTemplate *, Int, std::less<const ThingTemplate *> > AttackPriorityMap;
  91. typedef std::pair<AsciiString, ObjectID> AsciiStringObjectIDPair;
  92. typedef std::list<AsciiStringObjectIDPair> ListAsciiStringObjectID;
  93. typedef std::list<AsciiStringObjectIDPair>::iterator ListAsciiStringObjectIDIt;
  94. typedef std::pair<AsciiString, Coord3D> AsciiStringCoord3DPair;
  95. typedef std::list<AsciiStringCoord3DPair> ListAsciiStringCoord3D;
  96. typedef ListAsciiStringCoord3D::iterator ListAsciiStringCoord3DIt;
  97. typedef std::map< AsciiString, Int > ObjectTypeCount;
  98. typedef std::vector<Player *> VectorPlayerPtr;
  99. typedef VectorPlayerPtr::iterator VectorPlayerPtrIt;
  100. typedef std::vector<ObjectTypes*> AllObjectTypes;
  101. typedef AllObjectTypes::iterator AllObjectTypesIt;
  102. typedef std::vector<NamedReveal> VecNamedReveal;
  103. typedef VecNamedReveal::iterator VecNamedRevealIt;
  104. class AttackPriorityInfo : public MemoryPoolObject, public Snapshot
  105. {
  106. MEMORY_POOL_GLUE_WITH_USERLOOKUP_CREATE(AttackPriorityInfo, "AttackPriorityInfo")
  107. // friend bad for MPOs. (srj)
  108. //friend class ScriptEngine;
  109. public:
  110. AttackPriorityInfo();
  111. //~AttackPriorityInfo();
  112. public:
  113. void setPriority(const ThingTemplate *tThing, Int priority);
  114. Int getPriority(const ThingTemplate *tThing) const;
  115. AsciiString getName(void) const {return m_name;}
  116. #ifdef _DEBUG
  117. void dumpPriorityInfo(void);
  118. #endif
  119. void friend_setName(const AsciiString& n) { m_name = n; }
  120. void friend_setDefaultPriority(Int n) { m_defaultPriority = n; }
  121. void reset(void);
  122. protected:
  123. // sanapshot methods
  124. virtual void crc( Xfer *xfer );
  125. virtual void xfer( Xfer *xfer );
  126. virtual void loadPostProcess( void );
  127. AsciiString m_name;
  128. Int m_defaultPriority;
  129. AttackPriorityMap *m_priorityMap;
  130. };
  131. class SequentialScript : public MemoryPoolObject, public Snapshot
  132. {
  133. MEMORY_POOL_GLUE_WITH_USERLOOKUP_CREATE(SequentialScript, "SequentialScript")
  134. public:
  135. enum { START_INSTRUCTION = -1 };
  136. Team *m_teamToExecOn;
  137. ObjectID m_objectID;
  138. Script *m_scriptToExecuteSequentially;
  139. Int m_currentInstruction; // Which action within m_scriptToExecuteSequentially am I currently executing?
  140. Int m_timesToLoop; // 0 = do once, >0, loop till 0, <0, loop infinitely
  141. Int m_framesToWait; // 0 = transition to next instruction, >0 = countdown to 0, <0 = advance on idle only
  142. Bool m_dontAdvanceInstruction; // Must be set every frame by the instruction requesting the wait.
  143. // so this parm tells us how many we've been idle so far.
  144. SequentialScript *m_nextScriptInSequence;
  145. SequentialScript();
  146. protected:
  147. // snapshot methods
  148. virtual void crc( Xfer *xfer );
  149. virtual void xfer( Xfer *xfer );
  150. virtual void loadPostProcess( void );
  151. };
  152. EMPTY_DTOR(SequentialScript)
  153. #ifdef NOT_IN_USE
  154. class SequentialScriptStatus : public MemoryPoolObject, public Snapshot
  155. {
  156. MEMORY_POOL_GLUE_WITH_USERLOOKUP_CREATE(SequentialScriptStatus, "SequentialScriptStatus")
  157. public:
  158. ObjectID m_objectID;
  159. AsciiString m_sequentialScriptCompleted;
  160. Bool m_isExecutingSequentially;
  161. protected:
  162. // snapshot methods
  163. virtual void crc( Xfer *xfer );
  164. virtual void xfer( Xfer *xfer );
  165. virtual void loadPostProcess( void );
  166. };
  167. #endif
  168. //-----------------------------------------------------------------------------
  169. // ScriptEngine
  170. //-----------------------------------------------------------------------------
  171. /** Implementation for the Script Engine singleton */
  172. //-----------------------------------------------------------------------------
  173. class ScriptEngine : public SubsystemInterface,
  174. public Snapshot
  175. {
  176. public:
  177. enum {MAX_COUNTERS=256, MAX_FLAGS=256, MAX_ATTACK_PRIORITIES=256};
  178. enum TFade {FADE_NONE, FADE_SUBTRACT, FADE_ADD, FADE_SATURATE, FADE_MULTIPLY};
  179. ScriptEngine();
  180. virtual ~ScriptEngine();
  181. virtual void init( void ); ///< Init
  182. virtual void reset( void ); ///< Reset
  183. virtual void update( void ); ///< Update
  184. void appendSequentialScript(const SequentialScript *scriptToSequence);
  185. void removeSequentialScript(SequentialScript *scriptToRemove);
  186. void notifyOfTeamDestruction(Team *teamDestroyed);
  187. void notifyOfObjectCreationOrDestruction(void);
  188. UnsignedInt getFrameObjectCountChanged(void) {return m_frameObjectCountChanged;}
  189. void setSequentialTimer(Object *obj, Int frameCount);
  190. void setSequentialTimer(Team *team, Int frameCount);
  191. void removeAllSequentialScripts(Object *obj);
  192. void removeAllSequentialScripts(Team *team);
  193. AsciiString getStats(Real *curTime, Real *script1Time, Real *script2Time);
  194. virtual void newMap( ); ///< reset script engine for new map
  195. virtual const ActionTemplate *getActionTemplate( Int ndx); ///< Get the template for a script action.
  196. virtual const ConditionTemplate *getConditionTemplate( Int ndx); ///< Get the template for a script Condition.
  197. virtual void startEndGameTimer(void); ///< Starts the end game timer after a mission is won or lost.
  198. Bool isGameEnding( void ) { return m_endGameTimer >= 0; }
  199. virtual void startQuickEndGameTimer(void); ///< Starts the quick end game timer after a campaign is won or lost.
  200. virtual void startCloseWindowTimer(void); ///< Starts the timer to close windows after a mission is won or lost.
  201. virtual void runScript(const AsciiString& scriptName, Team *pThisTeam=NULL); ///< Runs a script.
  202. virtual void runObjectScript(const AsciiString& scriptName, Object *pThisObject=NULL); ///< Runs a script attached to this object.
  203. virtual Team *getTeamNamed(const AsciiString& teamName); ///< Gets the named team. May be null.
  204. virtual Player *getSkirmishEnemyPlayer(void); ///< Gets the ai's enemy Human player. May be null.
  205. virtual Player *getCurrentPlayer(void); ///< Gets the player that owns the current script. May be null.
  206. virtual Player *getPlayerFromAsciiString(const AsciiString& skirmishPlayerString);
  207. void setObjectsShouldReceiveDifficultyBonus(Bool receive) { m_objectsShouldReceiveDifficultyBonus = receive; }
  208. Bool getObjectsShouldReceiveDifficultyBonus() const { return m_objectsShouldReceiveDifficultyBonus; }
  209. void setChooseVictimAlwaysUsesNormal(Bool receive) { m_ChooseVictimAlwaysUsesNormal = receive; }
  210. Bool getChooseVictimAlwaysUsesNormal() const { return m_ChooseVictimAlwaysUsesNormal; }
  211. Bool hasShownMPLocalDefeatWindow(void);
  212. void markMPLocalDefeatWindowShown(void);
  213. // NOTE NOTE NOTE: do not store of the return value of this call (getObjectTypeList) beyond the life of the
  214. // function it will be used in, as it can be deleted from under you if maintenance is performed on the object.
  215. virtual ObjectTypes *getObjectTypes(const AsciiString& objectTypeList);
  216. virtual void doObjectTypeListMaintenance(const AsciiString& objectTypeList, const AsciiString& objectType, Bool addObject);
  217. /// Return the trigger area with the given name
  218. virtual PolygonTrigger *getQualifiedTriggerAreaByName( AsciiString name );
  219. // For other systems to evaluate Conditions, execute Actions, etc.
  220. ///< if pThisTeam is specified, then scripts in here can use <This Team> to mean the team this script is attached to.
  221. virtual Bool evaluateConditions( Script *pScript, Team *pThisTeam = NULL, Player *pPlayer=NULL );
  222. virtual void friend_executeAction( ScriptAction *pActionHead, Team *pThisTeam = NULL); ///< Use this at yer peril.
  223. virtual Object *getUnitNamed(const AsciiString& unitName); ///< Gets the named unit. May be null.
  224. virtual Bool didUnitExist(const AsciiString& unitName);
  225. virtual void addObjectToCache( Object* pNewObject );
  226. virtual void removeObjectFromCache( Object* pDeadObject );
  227. virtual void transferObjectName( const AsciiString& unitName, Object *pNewObject );
  228. virtual void notifyOfObjectDestruction( Object *pDeadObject );
  229. virtual void notifyOfCompletedVideo( const AsciiString& completedVideo ); ///< Notify the script engine that a video has completed
  230. virtual void notifyOfTriggeredSpecialPower( Int playerIndex, const AsciiString& completedPower, ObjectID sourceObj );
  231. virtual void notifyOfMidwaySpecialPower ( Int playerIndex, const AsciiString& completedPower, ObjectID sourceObj );
  232. virtual void notifyOfCompletedSpecialPower( Int playerIndex, const AsciiString& completedPower, ObjectID sourceObj );
  233. virtual void notifyOfCompletedUpgrade ( Int playerIndex, const AsciiString& upgrade, ObjectID sourceObj );
  234. virtual void notifyOfAcquiredScience ( Int playerIndex, ScienceType science );
  235. virtual void signalUIInteract(const AsciiString& hookName); ///< Notify that a UI button was pressed and some flag should go true, for one frame only.
  236. virtual Bool isVideoComplete( const AsciiString& completedVideo, Bool removeFromList ); ///< Determine whether a video has completed
  237. virtual Bool isSpeechComplete( const AsciiString& completedSpeech, Bool removeFromList ); ///< Determine whether a speech has completed
  238. virtual Bool isAudioComplete( const AsciiString& completedAudio, Bool removeFromList ); ///< Determine whether a sound has completed
  239. virtual Bool isSpecialPowerTriggered( Int playerIndex, const AsciiString& completedPower, Bool removeFromList, ObjectID sourceObj );
  240. virtual Bool isSpecialPowerMidway ( Int playerIndex, const AsciiString& completedPower, Bool removeFromList, ObjectID sourceObj );
  241. virtual Bool isSpecialPowerComplete ( Int playerIndex, const AsciiString& completedPower, Bool removeFromList, ObjectID sourceObj );
  242. virtual Bool isUpgradeComplete ( Int playerIndex, const AsciiString& upgrade, Bool removeFromList, ObjectID sourceObj );
  243. virtual Bool isScienceAcquired ( Int playerIndex, ScienceType science, Bool removeFromList );
  244. void setToppleDirection( const AsciiString& objectName, const Coord3D *direction );
  245. virtual void adjustToppleDirection( Object *object, Coord2D *direction);
  246. virtual void adjustToppleDirection( Object *object, Coord3D *direction);
  247. virtual const Script *findScriptByName(const AsciiString& scriptName) {return findScript(scriptName);} ///< Finds a script.
  248. const BreezeInfo& getBreezeInfo() const {return m_breezeInfo;}
  249. Bool isTimeFrozenScript( void ); ///< Ask whether a script has frozen time or not
  250. void doFreezeTime( void );
  251. void doUnfreezeTime( void );
  252. /// The following functions are used to update and query the debug window
  253. Bool isTimeFrozenDebug( void ); ///< Ask whether the debug window has requested a pause.
  254. Bool isTimeFast( void ); ///< Ask whether the debug window has requested a fast forward.
  255. void forceUnfreezeTime( void ); ///< Force that time becomes unfrozen temporarily.
  256. void AppendDebugMessage(const AsciiString& strToAdd, Bool forcePause);
  257. void AdjustDebugVariableData(const AsciiString& variableName, Int value, Bool forcePause);
  258. void clearTeamFlags(void); ///< Hack for dustin.
  259. void clearFlag(const AsciiString &name); ///< Hack for dustin.
  260. TFade getFade(void) {return m_fade;}
  261. Real getFadeValue(void) {return m_curFadeValue;}
  262. AsciiString getCurrentTrackName() const { return m_currentTrackName; }
  263. void setCurrentTrackName(AsciiString a) { m_currentTrackName = a; }
  264. GameDifficulty getGlobalDifficulty( void ) const { return m_gameDifficulty; }
  265. void setGlobalDifficulty( GameDifficulty difficulty );
  266. /// Attack priority stuff.
  267. const AttackPriorityInfo *getDefaultAttackInfo(void);
  268. const AttackPriorityInfo *getAttackInfo(const AsciiString& name);
  269. const TCounter *getCounter(const AsciiString& counterName);
  270. void createNamedMapReveal(const AsciiString& revealName, const AsciiString& waypointName, Real radiusToReveal, const AsciiString& playerName);
  271. void doNamedMapReveal(const AsciiString& revealName);
  272. void undoNamedMapReveal(const AsciiString& revealName);
  273. void removeNamedMapReveal(const AsciiString& revealName);
  274. Int getObjectCount(Int playerIndex, const AsciiString& objectTypeName) const;
  275. void setObjectCount(Int playerIndex, const AsciiString& objectTypeName, Int newCount);
  276. //Kris: Moved to public... so that I can refresh it when building abilities in script dialogs.
  277. void createNamedCache( void );
  278. ///Begin VTUNE
  279. void setEnableVTune(Bool value);
  280. Bool getEnableVTune() const;
  281. ///End VTUNE
  282. //#if defined(_DEBUG) || defined(_INTERNAL)
  283. void debugVictory( void );
  284. //#endif
  285. protected:
  286. // snapshot methods
  287. virtual void crc( Xfer *xfer );
  288. virtual void xfer( Xfer *xfer );
  289. virtual void loadPostProcess( void );
  290. Int allocateCounter( const AsciiString& name);
  291. Int allocateFlag( const AsciiString& name);
  292. void executeScripts( Script *pScriptHead );
  293. void executeScript( Script *pScript );
  294. Script *findScript(const AsciiString& name);
  295. ScriptGroup *findGroup(const AsciiString& name);
  296. void setSway( ScriptAction *pAction );
  297. void setCounter( ScriptAction *pAction );
  298. void addCounter( ScriptAction *pAction );
  299. void subCounter( ScriptAction *pAction );
  300. void setFade( ScriptAction *pAction );
  301. void setFlag( ScriptAction *pAction );
  302. void pauseTimer( ScriptAction *pAction );
  303. void restartTimer( ScriptAction *pAction );
  304. void setTimer( ScriptAction *pAction, Bool milisecondTimer, Bool random);
  305. void adjustTimer( ScriptAction *pAction, Bool milisecondTimer, Bool add);
  306. void enableScript( ScriptAction *pAction );
  307. void disableScript( ScriptAction *pAction );
  308. void callSubroutine( ScriptAction *pAction );
  309. void checkConditionsForTeamNames(Script *pScript);
  310. Bool evaluateCounter( Condition *pCondition );
  311. Bool evaluateFlag( Condition *pCondition );
  312. Bool evaluateTimer( Condition *pCondition );
  313. Bool evaluateCondition( Condition *pCondition );
  314. void executeActions( ScriptAction *pActionHead );
  315. void setPriorityThing( ScriptAction *pAction );
  316. void setPriorityKind( ScriptAction *pAction );
  317. void setPriorityDefault( ScriptAction *pAction );
  318. // For Object types maintenance.
  319. void removeObjectTypes(ObjectTypes *typesToRemove);
  320. void particleEditorUpdate( void );
  321. void updateFades( void );
  322. AttackPriorityInfo *findAttackInfo(const AsciiString& name, Bool addIfNotFound);
  323. protected:
  324. /// Stuff to execute scripts sequentially
  325. typedef std::vector<SequentialScript*> VecSequentialScriptPtr;
  326. typedef VecSequentialScriptPtr::iterator VecSequentialScriptPtrIt;
  327. VecSequentialScriptPtr m_sequentialScripts;
  328. void evaluateAndProgressAllSequentialScripts( void );
  329. VecSequentialScriptPtrIt cleanupSequentialScript(VecSequentialScriptPtrIt it, Bool cleanDanglers);
  330. Bool hasUnitCompletedSequentialScript( Object *object, const AsciiString& sequentialScriptName );
  331. Bool hasTeamCompletedSequentialScript( Team *team, const AsciiString& sequentialScriptName );
  332. protected:
  333. ActionTemplate m_actionTemplates[ScriptAction::NUM_ITEMS];
  334. ConditionTemplate m_conditionTemplates[Condition::NUM_ITEMS];
  335. TCounter m_counters[MAX_COUNTERS];
  336. Int m_numCounters;
  337. TFlag m_flags[MAX_FLAGS];
  338. Int m_numFlags;
  339. AttackPriorityInfo m_attackPriorityInfo[MAX_ATTACK_PRIORITIES];
  340. Int m_numAttackInfo;
  341. Int m_endGameTimer;
  342. Int m_closeWindowTimer;
  343. Team *m_callingTeam; ///< Team that is calling script, used for THIS_TEAM
  344. Object *m_callingObject; ///< Object that is calling script, used for THIS_OBJECT
  345. Team *m_conditionTeam; ///< Team that is being used to evaluate conditions, used for THIS_TEAM
  346. Object *m_conditionObject; ///< Unit that is being used to evaluate conditions, used for THIS_OBJECT
  347. VecNamedRequests m_namedObjects;
  348. Bool m_firstUpdate;
  349. Player *m_currentPlayer;
  350. Player *m_skirmishHumanPlayer;
  351. AsciiString m_currentTrackName;
  352. TFade m_fade;
  353. Real m_minFade;
  354. Real m_maxFade;
  355. Real m_curFadeValue;
  356. Int m_curFadeFrame;
  357. Int m_fadeFramesIncrease;
  358. Int m_fadeFramesHold;
  359. Int m_fadeFramesDecrease;
  360. UnsignedInt m_frameObjectCountChanged;
  361. ObjectTypeCount m_objectCounts[MAX_PLAYER_COUNT];
  362. /// These are three separate lists rather than one to increase speed efficiency
  363. ListAsciiString m_completedVideo;
  364. ListAsciiStringUINT m_testingSpeech;
  365. ListAsciiStringUINT m_testingAudio;
  366. ListAsciiString m_uiInteractions;
  367. ListAsciiStringObjectID m_triggeredSpecialPowers[MAX_PLAYER_COUNT];
  368. ListAsciiStringObjectID m_midwaySpecialPowers [MAX_PLAYER_COUNT];
  369. ListAsciiStringObjectID m_finishedSpecialPowers [MAX_PLAYER_COUNT];
  370. ListAsciiStringObjectID m_completedUpgrades [MAX_PLAYER_COUNT];
  371. ScienceVec m_acquiredSciences [MAX_PLAYER_COUNT];
  372. ListAsciiStringCoord3D m_toppleDirections;
  373. VecNamedReveal m_namedReveals;
  374. BreezeInfo m_breezeInfo;
  375. GameDifficulty m_gameDifficulty;
  376. Bool m_freezeByScript;
  377. AllObjectTypes m_allObjectTypeLists;
  378. Bool m_objectsShouldReceiveDifficultyBonus;
  379. Bool m_ChooseVictimAlwaysUsesNormal;
  380. Bool m_shownMPLocalDefeatWindow;
  381. #ifdef SPECIAL_SCRIPT_PROFILING
  382. #ifdef DEBUG_LOGGING
  383. double m_numFrames;
  384. double m_totalUpdateTime;
  385. double m_maxUpdateTime;
  386. double m_curUpdateTime;
  387. #endif
  388. #endif
  389. }; // end class ScriptEngine
  390. extern ScriptEngine *TheScriptEngine; ///< singleton definition
  391. #endif // end __SCRIPTENGINE_H_