ACCESS: Improve usage of ImageEntry _flags IMGFLAG enum

This commit is contained in:
Paul Gilbert 2014-11-26 18:33:03 -05:00
parent 953321cc26
commit fde1ea9d0e
4 changed files with 17 additions and 14 deletions

View file

@ -360,12 +360,12 @@ void AccessEngine::plotList1() {
Common::Rect destBounds = bounds;
if (_buffer2.clip(bounds)) {
ie._flags |= 1;
ie._flags |= IMGFLAG_CROPPED;
} else {
ie._flags &= ~1;
ie._flags &= ~IMGFLAG_CROPPED;
if (_buffer2._leftSkip != 0 || _buffer2._rightSkip != 0
|| _buffer2._topSkip != 0 || _buffer2._bottomSkip != 0)
ie._flags |= 1;
ie._flags |= IMGFLAG_CROPPED;
_newRects.push_back(bounds);
@ -373,7 +373,7 @@ void AccessEngine::plotList1() {
_buffer2._rightSkip /= _scale;
bounds.setWidth(bounds.width() / _scale);
if (ie._flags & 2) {
if (ie._flags & IMGFLAG_BACKWARDS) {
_buffer2.sPlotB(frame, destBounds);
} else {
_buffer2.sPlotF(frame, destBounds);
@ -386,6 +386,8 @@ void AccessEngine::plotList1() {
}
}
}
ie._flags |= IMGFLAG_DRAWN;
}
}

View file

@ -1147,10 +1147,10 @@ void Guard::guardSee() {
void Guard::setGuardFrame() {
ImageEntry ie;
ie._flags = 8;
ie._flags = IMGFLAG_UNSCALED;
if (_vm->_guardLocation == 4)
ie._flags |= 2;
ie._flags |= IMGFLAG_BACKWARDS;
ie._spritesPtr = _vm->_objectsTable[37];
ie._frameNumber = _guardCel;
ie._position = _position;

View file

@ -301,7 +301,7 @@ void AmazonScripts::jungleMove() {
for (int i = 0; i < count; ++i) {
ImageEntry ie;
ie._flags = 8;
ie._flags = IMGFLAG_UNSCALED;
ie._spritesPtr = _vm->_objectsTable[24];
ie._frameNumber = _jCnt[i] + frameOffset;
ie._position = Common::Point(_jungleX[i], jungleY[i]);
@ -437,7 +437,7 @@ void AmazonScripts::pan() {
for (int i = 0; i < _pNumObj; i++) {
ImageEntry ie;
ie._flags= 8;
ie._flags = IMGFLAG_UNSCALED;
ie._position = Common::Point(_pObjX[i], _pObjY[i]);
ie._offsetY = 255;
ie._spritesPtr = _pObject[i];
@ -1046,7 +1046,7 @@ void AmazonScripts::plotTorchSpear(int indx, const int *&buf) {
int idx = indx;
ImageEntry ie;
ie._flags = 8;
ie._flags = IMGFLAG_UNSCALED;
ie._spritesPtr = _vm->_objectsTable[62];
ie._frameNumber = buf[(idx / 2)];
ie._position = Common::Point(_game->_pitPos.x + buf[(idx / 2) + 1], _game->_pitPos.y + buf[(idx / 2) + 2]);
@ -1057,7 +1057,7 @@ void AmazonScripts::plotTorchSpear(int indx, const int *&buf) {
void AmazonScripts::plotPit(int indx, const int *&buf) {
int idx = indx;
ImageEntry ie;
ie._flags = 8;
ie._flags = IMGFLAG_UNSCALED;
ie._spritesPtr = _vm->_objectsTable[62];
ie._frameNumber = buf[(idx / 2)];
ie._position = Common::Point(_game->_pitPos.x, _game->_pitPos.y);
@ -1233,7 +1233,7 @@ void AmazonScripts::ANT() {
}
ImageEntry ie;
ie._flags = 8;
ie._flags = IMGFLAG_UNSCALED;
ie._spritesPtr = _vm->_objectsTable[61];
ie._frameNumber = buf[(idx / 2)];
ie._position = Common::Point(_game->_antPos.x, _game->_antPos.y);
@ -1730,7 +1730,7 @@ void AmazonScripts::plotRiver() {
}
ImageEntry ie;
ie._flags = 8;
ie._flags = IMGFLAG_UNSCALED;
ie._spritesPtr = _vm->_objectsTable[45];
ie._frameNumber = _game->_canoeFrame;
ie._position.x = (_vm->_screen->_scrollCol * 16) + _vm->_screen->_scrollX + 160;
@ -1741,7 +1741,7 @@ void AmazonScripts::plotRiver() {
RiverStruct *cur = _game->_topList;
while (cur <= _game->_botList) {
if (cur[0]._id != -1) {
ie._flags = 8;
ie._flags = IMGFLAG_UNSCALED;
ie._spritesPtr = _vm->_objectsTable[45];
ie._frameNumber = 0;
ie._position.x = cur[0]._field5;

View file

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