aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Gilbert2014-11-22 19:24:33 -0500
committerPaul Gilbert2014-12-12 22:38:22 -0500
commit1d60368724198d9c5fd201ab628ef46d285bb73b (patch)
tree182e3951aba965af013c7e95b616806a719b69ce
parent1d70d61d2b9935c3d64711757e9da67091ba0bc2 (diff)
downloadscummvm-rg350-1d60368724198d9c5fd201ab628ef46d285bb73b.tar.gz
scummvm-rg350-1d60368724198d9c5fd201ab628ef46d285bb73b.tar.bz2
scummvm-rg350-1d60368724198d9c5fd201ab628ef46d285bb73b.zip
ACCESS: Tweaks to mWhileDoOpen and fixes to pan method
-rw-r--r--engines/access/amazon/amazon_resources.cpp3
-rw-r--r--engines/access/amazon/amazon_resources.h3
-rw-r--r--engines/access/amazon/amazon_scripts.cpp30
3 files changed, 22 insertions, 14 deletions
diff --git a/engines/access/amazon/amazon_resources.cpp b/engines/access/amazon/amazon_resources.cpp
index 4df2c0c42e..ead6410bec 100644
--- a/engines/access/amazon/amazon_resources.cpp
+++ b/engines/access/amazon/amazon_resources.cpp
@@ -1524,7 +1524,7 @@ const int TORCH[12] = {
const int SPEAR[3] = {30, -13, 1};
-const int openObj[10][4] = {
+const int OPENING_OBJS[10][4] = {
{8, -80, 120, 30},
{13, 229, 0, 50},
{12, 78, 0, 50},
@@ -1746,4 +1746,5 @@ const byte *RIVEROBJECTTBL[6] = {
};
} // End of namespace Amazon
+
} // End of namespace Access
diff --git a/engines/access/amazon/amazon_resources.h b/engines/access/amazon/amazon_resources.h
index f7e1b0371b..b29bdab2c3 100644
--- a/engines/access/amazon/amazon_resources.h
+++ b/engines/access/amazon/amazon_resources.h
@@ -82,7 +82,7 @@ extern const int TORCH[12];
extern const int SPEAR[3];
-extern const int openObj[10][4];
+extern const int OPENING_OBJS[10][4];
extern const byte MAP0[26];
extern const byte MAP1[27];
@@ -98,6 +98,7 @@ extern const byte RIVER2OBJECTS[530];
extern const byte ENDRIVER2[10];
extern const byte *RIVEROBJECTTBL[6];
+
} // End of namespace Amazon
} // End of namespace Access
diff --git a/engines/access/amazon/amazon_scripts.cpp b/engines/access/amazon/amazon_scripts.cpp
index d3377f97a5..d4018c2def 100644
--- a/engines/access/amazon/amazon_scripts.cpp
+++ b/engines/access/amazon/amazon_scripts.cpp
@@ -425,9 +425,12 @@ void AmazonScripts::pan() {
for (int i = 0; i < _pNumObj; i++) {
_pObjZ[i] += _zTrack;
_pObjXl[i] += (_pObjZ[i] * tx) & 0xff;
- _pObjX[i] += (_pObjZ[i] * tx) >> 8;
+ _pObjX[i] += (_pObjZ[i] * tx) >> 8 + (_pObjXl[i] >> 8);
+ _pObjXl[i] &= 0xff;
+
_pObjYl[i] += (_pObjZ[i] * ty) & 0xff;
- _pObjY[i] += (_pObjZ[i] * ty) >> 8;
+ _pObjY[i] += (_pObjZ[i] * ty) >> 8 + (_pObjYl[i] >> 8);
+ _pObjYl[i] &= 0xff;
}
}
@@ -435,7 +438,7 @@ void AmazonScripts::pan() {
ImageEntry ie;
ie._flags= 8;
ie._position = Common::Point(_pObjX[i], _pObjY[i]);
- ie._offsetY = 0xFF;
+ ie._offsetY = 255;
ie._spritesPtr = _pObject[i];
ie._frameNumber = _pImgNum[i];
@@ -666,16 +669,16 @@ void AmazonScripts::mWhileDoOpen() {
screen.forceFadeOut();
_game->_skipStart = false;
if (_vm->_conversation != 2) {
+ // Cutscene at start of chapter 1
screen.setPanel(3);
_game->startChapter(1);
_game->establishCenter(0, 1);
}
Resource *data = _vm->_files->loadFile(1, 0);
- SpriteResource *spr = new SpriteResource(_vm, data);
+ _vm->_objectsTable[1] = new SpriteResource(_vm, data);
delete data;
- _vm->_objectsTable[1] = spr;
_vm->_files->_setPaletteFlag = false;
_vm->_files->loadScreen(1, 2);
_vm->_buffer2.copyFrom(*_vm->_screen);
@@ -698,10 +701,10 @@ void AmazonScripts::mWhileDoOpen() {
for (int i = 0; i < _pNumObj; i++) {
_pObject[i] = _vm->_objectsTable[1];
- _pImgNum[i] = openObj[i][0];
- _pObjX[i] = openObj[i][1];
- _pObjY[i] = openObj[i][2];
- _pObjZ[i] = openObj[i][3];
+ _pImgNum[i] = OPENING_OBJS[i][0];
+ _pObjX[i] = OPENING_OBJS[i][1];
+ _pObjY[i] = OPENING_OBJS[i][2];
+ _pObjZ[i] = OPENING_OBJS[i][3];
_pObjXl[i] = _pObjYl[i] = 0;
}
@@ -727,11 +730,14 @@ void AmazonScripts::mWhileDoOpen() {
startFl = true;
screen.forceFadeIn();
}
- events.pollEvents();
- warning("TODO: check on KEYBUFCNT");
- if (events._leftButton || events._rightButton) {
+
+ events.pollEvents();
+ if (events._leftButton || events._rightButton || events._keypresses.size() > 0) {
_game->_skipStart = true;
_vm->_sound->newMusic(10, 1);
+
+ events.debounceLeft();
+ events.zeroKeys();
break;
}