[Scummvm-cvs-logs] SF.net SVN: scummvm:[45284] scummvm/trunk/engines/sword2
fingolfin at users.sourceforge.net
fingolfin at users.sourceforge.net
Tue Oct 20 21:51:33 CEST 2009
Revision: 45284
http://scummvm.svn.sourceforge.net/scummvm/?rev=45284&view=rev
Author: fingolfin
Date: 2009-10-20 19:51:32 +0000 (Tue, 20 Oct 2009)
Log Message:
-----------
SWORD2: Turned static vars in Logic::fnISpeak into member vars of class Logic
Modified Paths:
--------------
scummvm/trunk/engines/sword2/function.cpp
scummvm/trunk/engines/sword2/logic.cpp
scummvm/trunk/engines/sword2/logic.h
Modified: scummvm/trunk/engines/sword2/function.cpp
===================================================================
--- scummvm/trunk/engines/sword2/function.cpp 2009-10-20 19:12:54 UTC (rev 45283)
+++ scummvm/trunk/engines/sword2/function.cpp 2009-10-20 19:51:32 UTC (rev 45284)
@@ -778,9 +778,6 @@
// 8 animation mode 0 lip synced,
// 1 just straight animation
- static bool cycle_skip = false;
- static bool speechRunning;
-
// Set up the pointers which we know we'll always need
ObjectLogic obLogic(decodePtr(params[S_OB_LOGIC]));
@@ -806,12 +803,12 @@
// Drop out for 1st cycle to allow walks/anims to end and
// display last frame before system locks while speech loaded
- if (!cycle_skip) {
- cycle_skip = true;
+ if (!_cycleSkip) {
+ _cycleSkip = true;
return IR_REPEAT;
}
- cycle_skip = false;
+ _cycleSkip = false;
_vm->_debugger->_textNumber = params[S_TEXT];
@@ -934,7 +931,7 @@
// Is it to be speech or subtitles or both?
// Assume not running until know otherwise
- speechRunning = false;
+ _speechRunning = false;
// New fudge for 'fx' subtitles: If speech is selected, and
// this line is allowed speech (not if it's an fx subtitle!)
@@ -962,14 +959,14 @@
// playing now. (We might want to do this the
// next cycle, don't know yet.)
- speechRunning = true;
+ _speechRunning = true;
_vm->_sound->unpauseSpeech();
} else {
debug(5, "ERROR: PlayCompSpeech(wav=%d (res=%d pos=%d)) returned %.8x", params[S_WAV], text_res, local_text, rv);
}
}
- if (_vm->getSubtitles() || !speechRunning) {
+ if (_vm->getSubtitles() || !_speechRunning) {
// We want subtitles, or the speech failed to load.
// Either way, we're going to show the text so create
// the text sprite.
@@ -995,7 +992,7 @@
if (obGraph.getAnimPc() == (int32)anim_head.noAnimFrames) {
// End of animation - restart from frame 0
obGraph.setAnimPc(0);
- } else if (speechRunning && _vm->_sound->amISpeaking() == RDSE_QUIET) {
+ } else if (_speechRunning && _vm->_sound->amISpeaking() == RDSE_QUIET) {
// The speech is running, but we're at a quiet
// bit. Restart from frame 0 (closed mouth).
obGraph.setAnimPc(0);
@@ -1024,11 +1021,11 @@
// If playing a sample
- if (speechRunning) {
+ if (_speechRunning) {
// Has it finished?
if (_vm->_sound->getSpeechStatus() == RDSE_SAMPLEFINISHED)
speechFinished = true;
- } else if (!speechRunning && _speechTime) {
+ } else if (!_speechRunning && _speechTime) {
// Counting down text time because there is no sample - this
// ends the speech
@@ -1075,7 +1072,7 @@
speechFinished = true;
// if speech sample playing, halt it prematurely
- if (speechRunning)
+ if (_speechRunning)
_vm->_sound->stopSpeech();
}
}
@@ -1100,7 +1097,7 @@
obGraph.setAnimPc(0);
}
- speechRunning = false;
+ _speechRunning = false;
// no longer in a script function loop
obLogic.setLooping(0);
Modified: scummvm/trunk/engines/sword2/logic.cpp
===================================================================
--- scummvm/trunk/engines/sword2/logic.cpp 2009-10-20 19:12:54 UTC (rev 45283)
+++ scummvm/trunk/engines/sword2/logic.cpp 2009-10-20 19:51:32 UTC (rev 45284)
@@ -48,6 +48,9 @@
memset(_syncList, 0, sizeof(_syncList));
_router = new Router(_vm);
+ _cycleSkip = false;
+ _speechRunning = false;
+
setupOpcodes();
}
Modified: scummvm/trunk/engines/sword2/logic.h
===================================================================
--- scummvm/trunk/engines/sword2/logic.h 2009-10-20 19:12:54 UTC (rev 45283)
+++ scummvm/trunk/engines/sword2/logic.h 2009-10-20 19:51:32 UTC (rev 45284)
@@ -113,6 +113,10 @@
// Set by fnPassMega()
byte _engineMega[56];
+
+ bool _cycleSkip;
+ bool _speechRunning;
+
public:
Logic(Sword2Engine *vm);
~Logic();
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