Skip to content

Commit

Permalink
ACCESS: Further fixes for panning
Browse files Browse the repository at this point in the history
  • Loading branch information
dreammaster committed Dec 13, 2014
1 parent 1d60368 commit 30f602b
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 10 deletions.
10 changes: 5 additions & 5 deletions engines/access/access.cpp
Expand Up @@ -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;

Expand Down Expand Up @@ -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]);
}
Expand All @@ -376,7 +376,7 @@ void AccessEngine::plotList1() {

_newRects.push_back(bounds);

if (!_scaleFlag) {
if (!_imgUnscaled) {
_buffer2._rightSkip /= _scale;
bounds.setWidth(bounds.width() / _scale);

Expand All @@ -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));
Expand Down
2 changes: 1 addition & 1 deletion engines/access/access.h
Expand Up @@ -189,7 +189,7 @@ class AccessEngine : public Engine {
int _scaleT1;
int _scaleMaxY;
int _scaleI;
bool _scaleFlag;
bool _imgUnscaled;
bool _canSaveLoad;

Resource *_eseg;
Expand Down
11 changes: 7 additions & 4 deletions engines/access/amazon/amazon_scripts.cpp
Expand Up @@ -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;
}
}
Expand Down Expand Up @@ -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];
Expand Down Expand Up @@ -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);
Expand Down
2 changes: 2 additions & 0 deletions engines/access/asurface.h
Expand Up @@ -131,6 +131,8 @@ class SpriteResource {
SpriteFrame *getFrame(int idx) { return _frames[idx]; }
};

enum ImageFlag { IMGFLAG_BACKWARDS = 2, IMGFLAG_UNSCALED = 8 };

class ImageEntry {
public:
int _frameNumber;
Expand Down

0 comments on commit 30f602b

Please sign in to comment.