[Scummvm-cvs-logs] SF.net SVN: scummvm:[35751] scummvm/trunk/engines/made
dreammaster at users.sourceforge.net
dreammaster at users.sourceforge.net
Tue Jan 6 11:40:38 CET 2009
Revision: 35751
http://scummvm.svn.sourceforge.net/scummvm/?rev=35751&view=rev
Author: dreammaster
Date: 2009-01-06 10:40:38 +0000 (Tue, 06 Jan 2009)
Log Message:
-----------
Changed sfGetSoundEnergy to use the correct soundEnergy value from decompressing sounds for proper lip-sync
Modified Paths:
--------------
scummvm/trunk/engines/made/scriptfuncs.cpp
scummvm/trunk/engines/made/sound.cpp
scummvm/trunk/engines/made/sound.h
Modified: scummvm/trunk/engines/made/scriptfuncs.cpp
===================================================================
--- scummvm/trunk/engines/made/scriptfuncs.cpp 2009-01-06 10:34:51 UTC (rev 35750)
+++ scummvm/trunk/engines/made/scriptfuncs.cpp 2009-01-06 10:40:38 UTC (rev 35751)
@@ -34,6 +34,7 @@
#include "made/database.h"
#include "made/screen.h"
#include "made/script.h"
+#include "made/sound.h"
#include "made/pmvplayer.h"
#include "made/scriptfuncs.h"
#include "made/music.h"
@@ -596,12 +597,9 @@
}
int16 ScriptFunctions::sfGetSoundEnergy(int16 argc, int16 *argv) {
- // This is called while in-game voices are played
- // Not sure what it's used for
- // -> It's used to animate mouths when NPCs are talking
- // FIXME: This is a workaround for the "sound energy" problem
- // At least the characters move their lips when talking now
- return _vm->_rnd->getRandomNumber(5);
+ // This is called while in-game voices are played to animate
+ // mouths when NPCs are talking
+ return soundEnergy;
}
int16 ScriptFunctions::sfClearText(int16 argc, int16 *argv) {
Modified: scummvm/trunk/engines/made/sound.cpp
===================================================================
--- scummvm/trunk/engines/made/sound.cpp 2009-01-06 10:34:51 UTC (rev 35750)
+++ scummvm/trunk/engines/made/sound.cpp 2009-01-06 10:40:38 UTC (rev 35751)
@@ -30,6 +30,8 @@
namespace Made {
+int soundEnergy = 0;
+
void decompressSound(byte *source, byte *dest, uint16 chunkSize, uint16 chunkCount) {
int16 prevSample = 0, workSample = 0;
@@ -67,6 +69,7 @@
case 0:
memset(soundBuffer, 0x80, workChunkSize);
workSample = 0;
+ soundEnergy = 0;
break;
case 1:
@@ -93,12 +96,14 @@
}
}
+ soundEnergy = type - 1;
break;
case 5:
for (i = 0; i < workChunkSize; i++)
soundBuffer[i] = *source++;
workSample = soundBuffer[workChunkSize - 1] - 128;
+ soundEnergy = 4;
break;
default:
Modified: scummvm/trunk/engines/made/sound.h
===================================================================
--- scummvm/trunk/engines/made/sound.h 2009-01-06 10:34:51 UTC (rev 35750)
+++ scummvm/trunk/engines/made/sound.h 2009-01-06 10:40:38 UTC (rev 35751)
@@ -32,6 +32,8 @@
namespace Made {
+extern int soundEnergy;
+
void decompressSound(byte *source, byte *dest, uint16 chunkSize, uint16 chunkCount);
} // End of namespace Made
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