aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Horn2009-05-18 15:07:04 +0000
committerMax Horn2009-05-18 15:07:04 +0000
commit9da07f21fe5edf8e3820a25f488a12491ccfc9d3 (patch)
tree5b158e76bd654542a3a9880005c22f582d1851a6
parent99713ca7fa078adf7c2e2b29f210bf8aa85d89ac (diff)
downloadscummvm-rg350-9da07f21fe5edf8e3820a25f488a12491ccfc9d3.tar.gz
scummvm-rg350-9da07f21fe5edf8e3820a25f488a12491ccfc9d3.tar.bz2
scummvm-rg350-9da07f21fe5edf8e3820a25f488a12491ccfc9d3.zip
SCI: cleanup
svn-id: r40689
-rw-r--r--engines/sci/engine/game.cpp6
-rw-r--r--engines/sci/engine/state.cpp2
-rw-r--r--engines/sci/engine/state.h2
-rw-r--r--engines/sci/sci.cpp6
4 files changed, 4 insertions, 12 deletions
diff --git a/engines/sci/engine/game.cpp b/engines/sci/engine/game.cpp
index 5b25fea6e2..6f55e2655b 100644
--- a/engines/sci/engine/game.cpp
+++ b/engines/sci/engine/game.cpp
@@ -401,14 +401,14 @@ int script_init_engine(EngineState *s, sci_version_t version) {
return 1;
}
- s->script_000_segment = script_get_segment(s, 0, SCRIPT_GET_LOCK);
+ SegmentId script_000_segment = script_get_segment(s, 0, SCRIPT_GET_LOCK);
- if (s->script_000_segment <= 0) {
+ if (script_000_segment <= 0) {
sciprintf("Failed to instantiate script.000\n");
return 1;
}
- s->script_000 = s->seg_manager->getScript(s->script_000_segment);
+ s->script_000 = s->seg_manager->getScript(script_000_segment);
s->sys_strings = s->seg_manager->allocateSysStrings(&s->sys_strings_segment);
s->string_frag_segment = s->seg_manager->allocateStringFrags();
diff --git a/engines/sci/engine/state.cpp b/engines/sci/engine/state.cpp
index a1f6c4096f..374f997fdb 100644
--- a/engines/sci/engine/state.cpp
+++ b/engines/sci/engine/state.cpp
@@ -116,10 +116,8 @@ EngineState::EngineState() : _dirseeker(this) {
stack_base = 0;
stack_top = 0;
- parser_segment = 0;
parser_base = NULL_REG;
parser_event = NULL_REG;
- script_000_segment = 0;
script_000 = 0;
string_frag_segment = 0;
diff --git a/engines/sci/engine/state.h b/engines/sci/engine/state.h
index f6ec22a394..75e9668e15 100644
--- a/engines/sci/engine/state.h
+++ b/engines/sci/engine/state.h
@@ -224,10 +224,8 @@ public:
StackPtr stack_base; /**< Pointer to the least stack element */
StackPtr stack_top; /**< First invalid stack element */
- SegmentId parser_segment; /**< A heap area used by the parser for error reporting */
reg_t parser_base; /**< Base address for the parser error reporting mechanism */
reg_t parser_event; /**< The event passed to Parse() and later used by Said() */
- SegmentId script_000_segment;
Script *script_000; /**< script 000, e.g. for globals */
uint16 currentRoomNumber() { return KP_UINT(script_000->locals_block->_locals[13]); }
diff --git a/engines/sci/sci.cpp b/engines/sci/sci.cpp
index 725ad94ac4..a185305788 100644
--- a/engines/sci/sci.cpp
+++ b/engines/sci/sci.cpp
@@ -93,10 +93,6 @@ static void init_console() {
"SCI01 priority table debugging flags: 1:Disable, 2:Print on change\n");
}
-static int init_gamestate(EngineState *gamestate, sci_version_t version) {
- return script_init_engine(gamestate, version);
-}
-
SciEngine::SciEngine(OSystem *syst, const SciGameDescription *desc)
: Engine(syst), _gameDescription(desc) {
// Put your engine in a sane state, but do nothing big yet;
@@ -230,7 +226,7 @@ Common::Error SciEngine::run() {
error ("Unknown SCI version in game entry");
}
- if (init_gamestate(gamestate, version))
+ if (script_init_engine(gamestate, version))
return Common::kUnknownError;