aboutsummaryrefslogtreecommitdiff
path: root/engines/access
diff options
context:
space:
mode:
authorPaul Gilbert2014-08-19 20:31:23 -0400
committerPaul Gilbert2014-08-19 20:31:23 -0400
commit6066afb020b6213bc6f9ef5ba5c3d7171c695340 (patch)
treeb60bb471f88443f2f1379b27f3bb695441cfdfde /engines/access
parentb4f74b9b5e3b5eebcd695f8c07dd2d78e6a53a61 (diff)
downloadscummvm-rg350-6066afb020b6213bc6f9ef5ba5c3d7171c695340.tar.gz
scummvm-rg350-6066afb020b6213bc6f9ef5ba5c3d7171c695340.tar.bz2
scummvm-rg350-6066afb020b6213bc6f9ef5ba5c3d7171c695340.zip
ACCESS: Fix z ordering of sprites on the screen
Diffstat (limited to 'engines/access')
-rw-r--r--engines/access/animation.cpp4
-rw-r--r--engines/access/animation.h2
-rw-r--r--engines/access/asurface.cpp4
-rw-r--r--engines/access/asurface.h2
-rw-r--r--engines/access/events.h2
-rw-r--r--engines/access/player.cpp2
-rw-r--r--engines/access/scripts.cpp2
7 files changed, 9 insertions, 9 deletions
diff --git a/engines/access/animation.cpp b/engines/access/animation.cpp
index 3a7424f1d0..d9a24e7a58 100644
--- a/engines/access/animation.cpp
+++ b/engines/access/animation.cpp
@@ -231,7 +231,7 @@ void Animation::setFrame1(AnimationFrame *frame) {
ie._spritesPtr = _vm->_objectsTable[part->_spritesIndex];
ie._frameNumber = part->_frameIndex;
ie._position = part->_position + _vm->_animation->_base;
- ie._priority = part->_priority - ie._position.y;
+ ie._offsetY = part->_offsetY - ie._position.y;
_vm->_images.addToList(&ie);
}
@@ -271,7 +271,7 @@ AnimationFramePart::AnimationFramePart(Common::MemoryReadStream &stream) {
_frameIndex = stream.readByte();
_position.x = stream.readUint16LE();
_position.y = stream.readUint16LE();
- _priority = stream.readUint16LE();
+ _offsetY = stream.readUint16LE();
}
/*------------------------------------------------------------------------*/
diff --git a/engines/access/animation.h b/engines/access/animation.h
index f70aa3239d..7e94f58cbd 100644
--- a/engines/access/animation.h
+++ b/engines/access/animation.h
@@ -129,7 +129,7 @@ public:
int _spritesIndex;
int _frameIndex;
Common::Point _position;
- int _priority;
+ int _offsetY;
public:
AnimationFramePart(Common::MemoryReadStream &stream);
};
diff --git a/engines/access/asurface.cpp b/engines/access/asurface.cpp
index 746e8d0f5a..44686ab8f4 100644
--- a/engines/access/asurface.cpp
+++ b/engines/access/asurface.cpp
@@ -85,14 +85,14 @@ SpriteFrame::~SpriteFrame() {
ImageEntry::ImageEntry() {
_frameNumber = 0;
_spritesPtr = nullptr;
- _priority = 0;
+ _offsetY = 0;
_flags = 0;
}
/*------------------------------------------------------------------------*/
static bool sortImagesY(const ImageEntry &ie1, const ImageEntry &ie2) {
- return ie1._priority < ie2._priority;
+ return (ie1._position.y + ie1._offsetY) < (ie2._position.y + ie2._offsetY);
}
void ImageEntryList::addToList(ImageEntry *ie) {
diff --git a/engines/access/asurface.h b/engines/access/asurface.h
index 460f73d2c0..88e156100b 100644
--- a/engines/access/asurface.h
+++ b/engines/access/asurface.h
@@ -116,7 +116,7 @@ class ImageEntry {
public:
int _frameNumber;
SpriteResource *_spritesPtr;
- int _priority;
+ int _offsetY;
Common::Point _position;
int _flags;
public:
diff --git a/engines/access/events.h b/engines/access/events.h
index 4c052f96f0..f7a5e9ce53 100644
--- a/engines/access/events.h
+++ b/engines/access/events.h
@@ -35,7 +35,7 @@ enum CursorType {
CURSOR_USE, CURSOR_TAKE, CURSOR_CLIMB, CURSOR_TALK, CURSOR_HELP
};
-#define GAME_FRAME_RATE 40
+#define GAME_FRAME_RATE 100
#define GAME_FRAME_TIME (1000 / GAME_FRAME_RATE)
class AccessEngine;
diff --git a/engines/access/player.cpp b/engines/access/player.cpp
index 72d6389602..f3593d5dfc 100644
--- a/engines/access/player.cpp
+++ b/engines/access/player.cpp
@@ -675,7 +675,7 @@ void Player::plotCom3() {
// Update the base ImageEntry fields for the player
_position.x = _rawPlayer.x;
_position.y = _rawPlayer.y - _playerOffset.y;
- _priority = _playerOffset.y;
+ _offsetY = _playerOffset.y;
_spritesPtr = _playerSprites;
_frameNumber = _frame;
diff --git a/engines/access/scripts.cpp b/engines/access/scripts.cpp
index b4a231c784..57f5788022 100644
--- a/engines/access/scripts.cpp
+++ b/engines/access/scripts.cpp
@@ -289,7 +289,7 @@ void Scripts::cmdSetTex() {
_vm->_player->_scrollFlag |= scrlTemp;
_vm->_player->_position = Common::Point(_vm->_player->_rawPlayer.x, _vm->_player->_rawPlayer.y - _vm->_player->_playerOffset.y);
- _vm->_player->_priority = _vm->_player->_playerOffset.y;
+ _vm->_player->_offsetY = _vm->_player->_playerOffset.y;
_vm->_player->_spritesPtr = _vm->_player->_playerSprites;
_vm->_player->_frameNumber = _vm->_player->_frame;