ACCESS: Further fixes for panning

This commit is contained in:
Paul Gilbert 2014-11-22 22:17:39 -05:00
parent 1d60368724
commit 30f602b6cb
4 changed files with 15 additions and 10 deletions

View file

@ -72,7 +72,7 @@ AccessEngine::AccessEngine(OSystem *syst, const AccessGameDescription *gameDesc)
_scaleT1 = 0; _scaleT1 = 0;
_scaleMaxY = 0; _scaleMaxY = 0;
_scaleI = 0; _scaleI = 0;
_scaleFlag = false; _imgUnscaled = false;
_canSaveLoad = false; _canSaveLoad = false;
_eseg = nullptr; _eseg = nullptr;
@ -351,13 +351,13 @@ void AccessEngine::plotList1() {
for (uint idx = 0; idx < _images.size(); ++idx) { for (uint idx = 0; idx < _images.size(); ++idx) {
ImageEntry &ie = _images[idx]; ImageEntry &ie = _images[idx];
_scaleFlag = (ie._flags & 8) != 0; _imgUnscaled = (ie._flags & IMGFLAG_UNSCALED) != 0;
Common::Point pt = ie._position - _screen->_bufferStart; Common::Point pt = ie._position - _screen->_bufferStart;
SpriteResource *sprites = ie._spritesPtr; SpriteResource *sprites = ie._spritesPtr;
SpriteFrame *frame = sprites->getFrame(ie._frameNumber); SpriteFrame *frame = sprites->getFrame(ie._frameNumber);
Common::Rect bounds(pt.x, pt.y, pt.x + frame->w, pt.y + frame->h); Common::Rect bounds(pt.x, pt.y, pt.x + frame->w, pt.y + frame->h);
if (!_scaleFlag) { if (!_imgUnscaled) {
bounds.setWidth(_screen->_scaleTable1[frame->w]); bounds.setWidth(_screen->_scaleTable1[frame->w]);
bounds.setHeight(_screen->_scaleTable1[frame->h]); bounds.setHeight(_screen->_scaleTable1[frame->h]);
} }
@ -376,7 +376,7 @@ void AccessEngine::plotList1() {
_newRects.push_back(bounds); _newRects.push_back(bounds);
if (!_scaleFlag) { if (!_imgUnscaled) {
_buffer2._rightSkip /= _scale; _buffer2._rightSkip /= _scale;
bounds.setWidth(bounds.width() / _scale); bounds.setWidth(bounds.width() / _scale);
@ -386,7 +386,7 @@ void AccessEngine::plotList1() {
_buffer2.sPlotF(frame, destBounds); _buffer2.sPlotF(frame, destBounds);
} }
} else { } else {
if (ie._flags & 2) { if (ie._flags & IMGFLAG_BACKWARDS) {
_buffer2.plotB(frame, Common::Point(destBounds.left, destBounds.top)); _buffer2.plotB(frame, Common::Point(destBounds.left, destBounds.top));
} else { } else {
_buffer2.plotF(frame, Common::Point(destBounds.left, destBounds.top)); _buffer2.plotF(frame, Common::Point(destBounds.left, destBounds.top));

View file

@ -189,7 +189,7 @@ public:
int _scaleT1; int _scaleT1;
int _scaleMaxY; int _scaleMaxY;
int _scaleI; int _scaleI;
bool _scaleFlag; bool _imgUnscaled;
bool _canSaveLoad; bool _canSaveLoad;
Resource *_eseg; Resource *_eseg;

View file

@ -425,11 +425,11 @@ void AmazonScripts::pan() {
for (int i = 0; i < _pNumObj; i++) { for (int i = 0; i < _pNumObj; i++) {
_pObjZ[i] += _zTrack; _pObjZ[i] += _zTrack;
_pObjXl[i] += (_pObjZ[i] * tx) & 0xff; _pObjXl[i] += (_pObjZ[i] * tx) & 0xff;
_pObjX[i] += (_pObjZ[i] * tx) >> 8 + (_pObjXl[i] >> 8); _pObjX[i] += ((_pObjZ[i] * tx) >> 8) + (_pObjXl[i] >> 8);
_pObjXl[i] &= 0xff; _pObjXl[i] &= 0xff;
_pObjYl[i] += (_pObjZ[i] * ty) & 0xff; _pObjYl[i] += (_pObjZ[i] * ty) & 0xff;
_pObjY[i] += (_pObjZ[i] * ty) >> 8 + (_pObjYl[i] >> 8); _pObjY[i] += ((_pObjZ[i] * ty) >> 8) + (_pObjYl[i] >> 8);
_pObjYl[i] &= 0xff; _pObjYl[i] &= 0xff;
} }
} }
@ -697,8 +697,9 @@ void AmazonScripts::mWhileDoOpen() {
_zCam = 270; _zCam = 270;
_vm->_timers[24]._timer = _vm->_timers[24]._initTm = 1; _vm->_timers[24]._timer = _vm->_timers[24]._initTm = 1;
++_vm->_timers[24]._flag; ++_vm->_timers[24]._flag;
_pNumObj = 10; _vm->_timers.updateTimers();
_pNumObj = 10;
for (int i = 0; i < _pNumObj; i++) { for (int i = 0; i < _pNumObj; i++) {
_pObject[i] = _vm->_objectsTable[1]; _pObject[i] = _vm->_objectsTable[1];
_pImgNum[i] = OPENING_OBJS[i][0]; _pImgNum[i] = OPENING_OBJS[i][0];
@ -732,6 +733,8 @@ void AmazonScripts::mWhileDoOpen() {
} }
events.pollEvents(); events.pollEvents();
g_system->delayMillis(10);
if (events._leftButton || events._rightButton || events._keypresses.size() > 0) { if (events._leftButton || events._rightButton || events._keypresses.size() > 0) {
_game->_skipStart = true; _game->_skipStart = true;
_vm->_sound->newMusic(10, 1); _vm->_sound->newMusic(10, 1);

View file

@ -131,6 +131,8 @@ public:
SpriteFrame *getFrame(int idx) { return _frames[idx]; } SpriteFrame *getFrame(int idx) { return _frames[idx]; }
}; };
enum ImageFlag { IMGFLAG_BACKWARDS = 2, IMGFLAG_UNSCALED = 8 };
class ImageEntry { class ImageEntry {
public: public:
int _frameNumber; int _frameNumber;