From 3c82b6578fa3bd4b3d91c1933dd390581dbe08d1 Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Sun, 6 Jun 2010 23:00:33 +0000 Subject: Now that EngineState is not deleted when loading games, we can move some more state-related variables to it, and remove several FIXME's about non-const global variables. Also, the entries in the data stack are now deleted when loading (fixes a memory leak - thanks to digitall for this). svn-id: r49465 --- engines/sci/engine/state.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'engines/sci/engine/state.h') diff --git a/engines/sci/engine/state.h b/engines/sci/engine/state.h index 431aac884e..68e6a5516a 100644 --- a/engines/sci/engine/state.h +++ b/engines/sci/engine/state.h @@ -148,8 +148,26 @@ public: StackPtr stack_base; /**< Pointer to the least stack element */ StackPtr stack_top; /**< First invalid stack element */ + // Script state + ExecStack *xs; + reg_t *variables[4]; ///< global, local, temp, param, as immediate pointers + reg_t *variables_base[4]; ///< Used for referencing VM ops + SegmentId variables_seg[4]; ///< Same as above, contains segment IDs + int variables_max[4]; ///< Max. values for all variables + Script *script_000; /**< script 000, e.g. for globals */ + int loadFromLauncher; + + /** + * Set this to 1 to abort script execution immediately. Aborting will + * leave the debug exec stack intact. + * Set it to 2 to force a replay afterwards. + */ + int script_abort_flag; // Set to 1 to abort execution. Set to 2 to force a replay afterwards + int script_step_counter; // Counts the number of steps executed + int script_gc_interval; // Number of steps in between gcs + uint16 currentRoomNumber() const; void setRoomNumber(uint16 roomNumber); -- cgit v1.2.3