[Scummvm-cvs-logs] SF.net SVN: scummvm:[43984] scummvm/trunk/engines/sci/engine
fingolfin at users.sourceforge.net
fingolfin at users.sourceforge.net
Sun Sep 6 14:59:34 CEST 2009
Revision: 43984
http://scummvm.svn.sourceforge.net/scummvm/?rev=43984&view=rev
Author: fingolfin
Date: 2009-09-06 12:59:34 +0000 (Sun, 06 Sep 2009)
Log Message:
-----------
SCI: cleanup
Modified Paths:
--------------
scummvm/trunk/engines/sci/engine/intmap.cpp
scummvm/trunk/engines/sci/engine/intmap.h
scummvm/trunk/engines/sci/engine/ksound.cpp
scummvm/trunk/engines/sci/engine/vm.cpp
Modified: scummvm/trunk/engines/sci/engine/intmap.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/intmap.cpp 2009-09-06 12:59:07 UTC (rev 43983)
+++ scummvm/trunk/engines/sci/engine/intmap.cpp 2009-09-06 12:59:34 UTC (rev 43984)
@@ -115,7 +115,7 @@
clear();
while (true) {
s.syncAsSint32LE(key);
- if (key == 0xDEADBEEF)
+ if (key == INTMAPPER_MAGIC_KEY)
break;
s.syncAsSint32LE(idx);
// Insert into the IntMapper
@@ -133,7 +133,7 @@
node = node->next;
}
}
- uint32 tmp = 0xDEADBEEF;
+ uint32 tmp = INTMAPPER_MAGIC_KEY;
s.syncAsSint32LE(tmp);
}
}
Modified: scummvm/trunk/engines/sci/engine/intmap.h
===================================================================
--- scummvm/trunk/engines/sci/engine/intmap.h 2009-09-06 12:59:07 UTC (rev 43983)
+++ scummvm/trunk/engines/sci/engine/intmap.h 2009-09-06 12:59:34 UTC (rev 43984)
@@ -37,6 +37,8 @@
DCS_INT_HASH_MAX = 256
};
+const uint32 INTMAPPER_MAGIC_KEY = 0xDEADBEEF;
+
/**
* Defines a map from arbitrary integers to "small" integers, useable as index
* into small arrays. This class is somewhat like a hashmap, but not quite:
Modified: scummvm/trunk/engines/sci/engine/ksound.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/ksound.cpp 2009-09-06 12:59:07 UTC (rev 43983)
+++ scummvm/trunk/engines/sci/engine/ksound.cpp 2009-09-06 12:59:34 UTC (rev 43984)
@@ -825,7 +825,7 @@
s->resMan->sciVersion() >= SCI_VERSION_1_1) {
// Found a relevant audio resource, play it
s->_sound.stopAudio();
- warning("Initializing audio resource instead of requested sound resource %d\n", number);
+ warning("Initializing audio resource instead of requested sound resource %d", number);
sampleLen = s->_sound.startAudio(65535, number);
// Also create iterator, that will fire SI_FINISHED event, when the sound is done playing
s->_sound.sfx_add_song(build_timeriterator(s, sampleLen), 0, handle, number);
Modified: scummvm/trunk/engines/sci/engine/vm.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/vm.cpp 2009-09-06 12:59:07 UTC (rev 43983)
+++ scummvm/trunk/engines/sci/engine/vm.cpp 2009-09-06 12:59:34 UTC (rev 43984)
@@ -1569,7 +1569,6 @@
int script_instantiate_sci0(ResourceManager *resMan, SegManager *segMan, int script_nr) {
int objtype;
unsigned int objlength;
- reg_t reg;
int seg_id;
int relocation = -1;
int magic_pos_adder; // Usually 0; 2 for older SCI versions
@@ -1583,9 +1582,6 @@
if (was_new)
return seg_id;
- reg.segment = seg_id;
- reg.offset = 0;
-
Script *scr = segMan->getScript(seg_id);
if (oldScriptHeader) {
@@ -1601,7 +1597,7 @@
magic_pos_adder = 2; // Step over the funny prefix
if (locals_nr)
- segMan->scriptInitialiseLocalsZero(reg.segment, locals_nr);
+ segMan->scriptInitialiseLocalsZero(seg_id, locals_nr);
} else {
scr->mcpyInOut(0, script->data, script->size);
@@ -1611,9 +1607,12 @@
// Now do a first pass through the script objects to find the
// export table and local variable block
- objlength = 0;
+ reg_t reg;
+ reg.segment = seg_id;
reg.offset = magic_pos_adder;
+ objlength = 0;
+
do {
reg_t data_base;
reg_t addr;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list