[Scummvm-cvs-logs] SF.net SVN: scummvm: [21714] scummvm/trunk/engines/simon
kirben at users.sourceforge.net
kirben at users.sourceforge.net
Sat Apr 8 23:15:02 CEST 2006
Revision: 21714
Author: kirben
Date: 2006-04-08 23:06:10 -0700 (Sat, 08 Apr 2006)
ViewCVS: http://svn.sourceforge.net/scummvm/?rev=21714&view=rev
Log Message:
-----------
Add time code for FF and minor cleanup
Modified Paths:
--------------
scummvm/trunk/engines/simon/debug.h
scummvm/trunk/engines/simon/items.cpp
scummvm/trunk/engines/simon/simon.cpp
scummvm/trunk/engines/simon/simon.h
Modified: scummvm/trunk/engines/simon/debug.h
===================================================================
--- scummvm/trunk/engines/simon/debug.h 2006-04-09 05:47:37 UTC (rev 21713)
+++ scummvm/trunk/engines/simon/debug.h 2006-04-09 06:06:10 UTC (rev 21714)
@@ -1217,7 +1217,7 @@
"W|CLEAR_VGAPOINTER_ENTRY",
NULL,
"|VGA_POINTER_OP_3",
- NULL,
+ "|CENTRE_SCROLL",
/* 188 */
"BSJ|STRING2_IS",
"|CLEAR_MARKS",
Modified: scummvm/trunk/engines/simon/items.cpp
===================================================================
--- scummvm/trunk/engines/simon/items.cpp 2006-04-09 05:47:37 UTC (rev 21713)
+++ scummvm/trunk/engines/simon/items.cpp 2006-04-09 06:06:10 UTC (rev 21714)
@@ -1445,14 +1445,22 @@
void SimonEngine::o3_ifTime() {
// 124: if time
- uint time = getVarOrWord();
- setScriptCondition(true);
- warning("STUB: script opcode 124 (%d)", time);
+ time_t t;
+
+ uint a = getVarOrWord();
+ time(&t);
+ t -= _gameStoppedClock;
+ t -= a;
+ if (t >= _timeStore)
+ setScriptCondition(true);
+ else
+ setScriptCondition(false);
}
void SimonEngine::o3_setTime() {
// 131
- warning("STUB: script opcode 131");
+ time(&_timeStore);
+ _timeStore -= _gameStoppedClock;
}
void SimonEngine::o3_loadUserGame() {
@@ -1547,12 +1555,14 @@
void SimonEngine::o3_stopClock() {
// 193: pause clock
- warning("STUB: script opcode 193");
+ _clockStopped = time(NULL);
}
void SimonEngine::o3_restartClock() {
// 194: resume clock
- warning("STUB: script opcode 194");
+ if (_clockStopped != 0)
+ _gameStoppedClock += time(NULL) - _clockStopped;
+ _clockStopped = 0;
}
void SimonEngine::o3_setColour() {
Modified: scummvm/trunk/engines/simon/simon.cpp
===================================================================
--- scummvm/trunk/engines/simon/simon.cpp 2006-04-09 05:47:37 UTC (rev 21713)
+++ scummvm/trunk/engines/simon/simon.cpp 2006-04-09 06:06:10 UTC (rev 21714)
@@ -304,6 +304,8 @@
_printCharPixelCount = 0;
_numLettersToPrint = 0;
+ _clockStopped = 0;
+ _gameStoppedClock = 0;
_lastTime = 0;
_firstTimeStruct = 0;
@@ -2663,6 +2665,11 @@
scrollEvent();
}
+ if (getGameType() == GType_FF && getBitFlag(84)) {
+ // TODO
+ warning("Animation by Y value not supported");
+ }
+
vsp = _vgaSprites;
while (vsp->id != 0) {
@@ -2904,7 +2911,7 @@
if (_windowArray[a] == NULL)
return;
removeIconArray(a);
- video_copy_if_flag_0x8_c(_windowArray[a]);
+ resetWindow(_windowArray[a]);
_windowArray[a] = NULL;
if (_curWindow == a) {
_textWindow = NULL;
@@ -3265,7 +3272,7 @@
_lockWord &= ~0x8000;
}
-void SimonEngine::video_copy_if_flag_0x8_c(WindowBlock *window) {
+void SimonEngine::resetWindow(WindowBlock *window) {
if (window->flags & 8)
restoreWindow(window);
window->mode = 0;
Modified: scummvm/trunk/engines/simon/simon.h
===================================================================
--- scummvm/trunk/engines/simon/simon.h 2006-04-09 05:47:37 UTC (rev 21713)
+++ scummvm/trunk/engines/simon/simon.h 2006-04-09 06:06:10 UTC (rev 21714)
@@ -307,6 +307,8 @@
uint _numLettersToPrint;
uint _lastTime;
+ uint _clockStopped, _gameStoppedClock;
+ time_t _timeStore;
TimeEvent *_firstTimeStruct, *_pendingDeleteTimeEvent;
@@ -1032,7 +1034,7 @@
bool isSpriteLoaded(uint16 id, uint16 fileId);
- void video_copy_if_flag_0x8_c(WindowBlock *window);
+ void resetWindow(WindowBlock *window);
void delete_hitarea_by_index(uint index);
void windowPutChar(uint a);
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