[Scummvm-cvs-logs] CVS: scummvm/simon simon.cpp,1.546,1.547 simon.h,1.165,1.166 vga.cpp,1.161,1.162
kirben
kirben at users.sourceforge.net
Fri Nov 18 04:42:00 CET 2005
Update of /cvsroot/scummvm/scummvm/simon
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22197/simon
Modified Files:
simon.cpp simon.h vga.cpp
Log Message:
Updates to FF path finding.
Index: simon.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/simon/simon.cpp,v
retrieving revision 1.546
retrieving revision 1.547
diff -u -d -r1.546 -r1.547
--- simon.cpp 18 Nov 2005 02:31:24 -0000 1.546
+++ simon.cpp 18 Nov 2005 12:40:03 -0000 1.547
@@ -2671,7 +2671,7 @@
_exitCutscene = false;
_skipSpeech = false;
while (_vgaWaitFor != 0) {
- if (_skipSpeech && getGameType() == GType_SIMON2) {
+ if (_skipSpeech && (getGameType() == GType_SIMON2 || getGameType() == GType_FF)) {
if (_vgaWaitFor == 200 && !vc_get_bit(14)) {
skip_speech();
break;
@@ -3204,7 +3204,7 @@
vc_write_var(86, 2);
break;
case 63: // F5
- if (getGameType() == GType_SIMON2)
+ if (getGameType() == GType_SIMON2 || getGameType() == GType_FF)
_exitCutscene = true;
break;
case 'p':
@@ -4100,7 +4100,7 @@
#endif
break;
case OSystem::EVENT_RBUTTONDOWN:
- if (getGameType() == GType_SIMON2)
+ if (getGameType() == GType_SIMON2 || getGameType() == GType_FF)
_skipSpeech = true;
else
_exitCutscene = true;
Index: simon.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/simon/simon.h,v
retrieving revision 1.165
retrieving revision 1.166
diff -u -d -r1.165 -r1.166
--- simon.h 15 Nov 2005 08:12:30 -0000 1.165
+++ simon.h 18 Nov 2005 12:40:03 -0000 1.166
@@ -750,7 +750,7 @@
void vc76_setScaleXOffs();
void vc77_setScaleYOffs();
void vc78_computeXY();
- void vc79_pathUnk2();
+ void vc79_computePosNum();
void vc80_setOverlayImage();
void vc81_setRandom();
void vc82_pathUnk3();
Index: vga.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/simon/vga.cpp,v
retrieving revision 1.161
retrieving revision 1.162
diff -u -d -r1.161 -r1.162
--- vga.cpp 18 Nov 2005 02:31:24 -0000 1.161
+++ vga.cpp 18 Nov 2005 12:40:03 -0000 1.162
@@ -111,7 +111,7 @@
&SimonEngine::vc76_setScaleXOffs,
&SimonEngine::vc77_setScaleYOffs,
&SimonEngine::vc78_computeXY,
- &SimonEngine::vc79_pathUnk2,
+ &SimonEngine::vc79_computePosNum,
&SimonEngine::vc80_setOverlayImage,
&SimonEngine::vc81_setRandom,
&SimonEngine::vc82_pathUnk3,
@@ -754,6 +754,11 @@
return;
}
+ if (getGameType() == GType_FF && height > 480) {
+ debug(0, "Vertical scrolling not supported\n");
+ return;
+ }
+
if (getGameType() == GType_SIMON1 || getGameType() == GType_SIMON2) {
if (state.flags & 0x10) {
state.depack_src = vc10_uncompressFlip(state.depack_src, width, height);
@@ -1561,11 +1566,12 @@
if (getGameType() == GType_FF) {
VgaSprite *vsp = find_cur_sprite();
- int x, x2, y, y1, y2, ydiff, count = 0;
+ int16 x, x2, y, y1, y2, ydiff;
+ uint pos = 0;
- while(vsp->x < readUint16Wrapper(p + 2)) {
+ while(vsp->x > readUint16Wrapper(p + 2)) {
p += 2;
- count++;
+ pos++;
}
y1 = readUint16Wrapper(p + 1);
@@ -1593,7 +1599,7 @@
//checkScrollY(y, diff);
_variableArray[11] = readUint16Wrapper(p);
- _variableArray[13] = count;
+ _variableArray[13] = pos;
} else {
uint b = (uint16)_variableArray[13];
p += b * 2 + 1;
@@ -2056,12 +2062,15 @@
// Scale X related
vsp->image = vc_read_next_word();
- int xoffs = vc_read_next_word();
+ int16 xoffs = vc_read_next_word();
int var = vc_read_next_word();
+ vsp->x += xoffs;
vsp->flags = 0x40;
- debug(0, "STUB: vc76_setScaleXOffs: image %d xoffs %d flag %d", vsp->image, xoffs, var);
+ _variableArray[var] = vsp->x;
+
+ debug(0, "STUB: vc76_setScaleXOffs: image %d xoffs %d var %d", vsp->image, xoffs, var);
}
void SimonEngine::vc77_setScaleYOffs() {
@@ -2069,12 +2078,15 @@
// Scale Y related
vsp->image = vc_read_next_word();
- int yoffs = vc_read_next_word();
+ int16 yoffs = vc_read_next_word();
int var = vc_read_next_word();
+ vsp->y += yoffs;
vsp->flags = 0x40;
- debug(0, "STUB: vc77_setScaleYOffs: image %d yoffs %d flag %d", vsp->image, yoffs, var);
+ _variableArray[var] = vsp->y;
+
+ debug(0, "STUB: vc77_setScaleYOffs: image %d yoffs %d var %d", vsp->image, yoffs, var);
}
void SimonEngine::vc78_computeXY() {
@@ -2082,14 +2094,15 @@
uint a = (uint16)_variableArray[12];
uint b = (uint16)_variableArray[13];
+
const uint16 *p = _pathFindArray[a - 1];
p += b * 2;
- uint posx = readUint16Wrapper(p);
+ uint16 posx = readUint16Wrapper(p);
_variableArray[15] = posx;
vsp->x = posx;
- uint posy = readUint16Wrapper(p + 1);
+ uint16 posy = readUint16Wrapper(p + 1);
_variableArray[16] = posy;
vsp->y = posy;
@@ -2099,9 +2112,18 @@
}
}
-void SimonEngine::vc79_pathUnk2() {
- // Pathfinder related
- debug(0, "STUB: vc79_pathUnk2");
+void SimonEngine::vc79_computePosNum() {
+ uint a = (uint16)_variableArray[12];
+ uint pos = 0;
+ const uint16 *p = _pathFindArray[a - 1];
+
+ int16 y = vc_read_next_word();
+ while(y > readUint16Wrapper(p + 1)) {
+ p += 2;
+ pos++;
+ }
+
+ _variableArray[13] = pos;
}
void SimonEngine::vc80_setOverlayImage() {
@@ -2125,6 +2147,7 @@
void SimonEngine::vc82_pathUnk3() {
// Set var to path position
int var = vc_read_next_word();
+
debug(0, "STUB: vc82_pathUnk3: var %d", var);
}
More information about the Scummvm-git-logs
mailing list