[Scummvm-cvs-logs] SF.net SVN: scummvm:[54896] scummvm/trunk/engines/mohawk
fuzzie at users.sourceforge.net
fuzzie at users.sourceforge.net
Mon Dec 13 00:59:46 CET 2010
Revision: 54896
http://scummvm.svn.sourceforge.net/scummvm/?rev=54896&view=rev
Author: fuzzie
Date: 2010-12-12 23:59:46 +0000 (Sun, 12 Dec 2010)
Log Message:
-----------
MOHAWK: Use named constants for LB timing modes
Modified Paths:
--------------
scummvm/trunk/engines/mohawk/livingbooks.cpp
scummvm/trunk/engines/mohawk/livingbooks.h
Modified: scummvm/trunk/engines/mohawk/livingbooks.cpp
===================================================================
--- scummvm/trunk/engines/mohawk/livingbooks.cpp 2010-12-12 23:11:23 UTC (rev 54895)
+++ scummvm/trunk/engines/mohawk/livingbooks.cpp 2010-12-12 23:59:46 UTC (rev 54896)
@@ -1591,7 +1591,7 @@
_loopMode = 0;
_delayMin = 0;
_delayMax = 0;
- _timingMode = 0;
+ _timingMode = kLBAutoNone;
_periodMin = 0;
_periodMax = 0;
_controlMode = 0;
@@ -1960,7 +1960,7 @@
void LBItem::setEnabled(bool enabled) {
if (enabled && _neverEnabled && !_playing) {
- if (_timingMode == 2) {
+ if (_timingMode == kLBAutoUserIdle) {
setNextTime(_periodMin, _periodMax);
debug(2, "Enable time startup");
}
@@ -1981,7 +1981,7 @@
if (_playing && _loopMode == 0xFFFF)
stop();
- if (!_playing && _timingMode == 2)
+ if (!_playing && _timingMode == kLBAutoUserIdle)
setNextTime(_periodMin, _periodMax);
return _visible && _globalVisible && _rect.contains(point);
@@ -1996,7 +1996,7 @@
if (togglePlaying(_playing, true)) {
_nextTime = 0;
- } else if (_loops == 0 && _timingMode == 2) {
+ } else if (_loops == 0 && _timingMode == kLBAutoUserIdle) {
debug(9, "Looping in update()");
setNextTime(_periodMin, _periodMax);
}
@@ -2086,7 +2086,7 @@
}
}
- if (_timingMode == 2) {
+ if (_timingMode == kLBAutoUserIdle) {
debug(9, "Looping in done() - %d to %d", _periodMin, _periodMax);
setNextTime(_periodMin, _periodMax);
}
@@ -2116,35 +2116,35 @@
switch (phase) {
case 0xFFFE:
- if (_timingMode == 7) {
+ if (_timingMode == kLBAutoLoad) {
debug(2, "Phase load: time startup");
setNextTime(_periodMin, _periodMax);
}
break;
case 0xFFFF:
runScript(kLBEventPhaseCreate);
- if (_timingMode == 6) {
+ if (_timingMode == kLBAutoCreate) {
debug(2, "Phase create: time startup");
setNextTime(_periodMin, _periodMax);
}
break;
case 0:
runScript(kLBEventPhaseInit);
- if (_timingMode == 5) {
+ if (_timingMode == kLBAutoInit) {
debug(2, "Phase init: time startup");
setNextTime(_periodMin, _periodMax);
}
break;
case 1:
runScript(kLBEventPhaseIntro);
- if (_timingMode == 1 || _timingMode == 2) {
+ if (_timingMode == kLBAutoIntro || _timingMode == kLBAutoUserIdle) {
debug(2, "Phase intro: time startup");
setNextTime(_periodMin, _periodMax);
}
break;
case 2:
runScript(kLBEventPhaseMain);
- if (_timingMode == 2 || _timingMode == 3) {
+ if (_timingMode == kLBAutoUserIdle || _timingMode == kLBAutoMain) {
debug(2, "Phase main: time startup");
setNextTime(_periodMin, _periodMax);
}
@@ -2162,7 +2162,7 @@
}
void LBItem::notify(uint16 data, uint16 from) {
- if (_timingMode == 4) {
+ if (_timingMode == kLBAutoSync) {
// TODO: is this correct?
if (_periodMin == from && _periodMax == data) {
debug(2, "Handling notify 0x%04x (from %d)", data, from);
Modified: scummvm/trunk/engines/mohawk/livingbooks.h
===================================================================
--- scummvm/trunk/engines/mohawk/livingbooks.h 2010-12-12 23:11:23 UTC (rev 54895)
+++ scummvm/trunk/engines/mohawk/livingbooks.h 2010-12-12 23:59:46 UTC (rev 54896)
@@ -55,7 +55,19 @@
kLBPlayMode = 6
};
+// automatic modes used in _timingMode
enum {
+ kLBAutoNone = 0,
+ kLBAutoIntro = 1,
+ kLBAutoUserIdle = 2,
+ kLBAutoMain = 3,
+ kLBAutoSync = 4,
+ kLBAutoInit = 5,
+ kLBAutoCreate = 6,
+ kLBAutoLoad = 7
+};
+
+enum {
kLBStaticTextItem = 0x1,
kLBPictureItem = 0x2,
kLBEditTextItem = 0x14,
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