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

View File

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

View File

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

View File

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