aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/scicore/resource.cpp
diff options
context:
space:
mode:
authorFilippos Karapetis2009-04-25 08:50:42 +0000
committerFilippos Karapetis2009-04-25 08:50:42 +0000
commitf1893d8f25b8f4fc5f6ed48e61dec0c2050bd567 (patch)
treef2d7efbb07066bfa142f4e130b96ebef479e2ad9 /engines/sci/scicore/resource.cpp
parent86debbd679d20f1188d2ba015e9d108cbbc85f1a (diff)
downloadscummvm-rg350-f1893d8f25b8f4fc5f6ed48e61dec0c2050bd567.tar.gz
scummvm-rg350-f1893d8f25b8f4fc5f6ed48e61dec0c2050bd567.tar.bz2
scummvm-rg350-f1893d8f25b8f4fc5f6ed48e61dec0c2050bd567.zip
WIP (still non-working) code for speech sync in CD talkie games (like e.g. KQ5 CD and SQ4 CD), taken from Greg's SCI implementation.
svn-id: r40142
Diffstat (limited to 'engines/sci/scicore/resource.cpp')
-rw-r--r--engines/sci/scicore/resource.cpp32
1 files changed, 32 insertions, 0 deletions
diff --git a/engines/sci/scicore/resource.cpp b/engines/sci/scicore/resource.cpp
index ec738fea44..6132e4bae5 100644
--- a/engines/sci/scicore/resource.cpp
+++ b/engines/sci/scicore/resource.cpp
@@ -1167,4 +1167,36 @@ int ResourceManager::decompress(Resource *res, Common::File *file) {
return error;
}
+void ResourceSync::startSync(Object *obj) {
+ _syncTime = _syncCue = 0xFFFF;
+ // TODO: Convert the following from Greg's code to SCI's code
+ //obj.setPropertyN(g_sci->_objOfs[0x33], 0); // Greg's
+ //obj->variables[s->game_obj.offset[0x33]] = 0; // something like this?
+ _ptr = (uint16 *)data;
+ //syncStarted = true; // not used
+}
+
+void ResourceSync::nextSync(Object *obj) {
+ if (_ptr) {
+ _syncTime = READ_LE_UINT16(_ptr);
+ if (_syncTime == 0xFFFF) {
+ stopSync();
+ } else {
+ _syncCue = READ_LE_UINT16(_ptr + 1);
+ _ptr += 2;
+ }
+ // TODO: Convert the following from Greg's code to SCI's code
+ //obj.setPropertyN(g_sci->_objOfs[0x32], _syncTime); // Greg's
+ //obj->variables[s->game_obj.offset[0x32]] = _syncTime; // something like this?
+ //obj.setPropertyN(g_sci->_objOfs[0x33], _syncCue); // Greg's
+ //obj->variables[s->game_obj.offset[0x33]] = _syncCue; // something like this?
+ }
+}
+//--------------------------------
+void ResourceSync::stopSync() {
+ _ptr = 0;
+ _syncCue = 0xFFFF;
+ //syncStarted = false; // not used
+}
+
} // End of namespace Sci