aboutsummaryrefslogtreecommitdiff
path: root/engines/sherlock/tattoo/tattoo_scene.cpp
diff options
context:
space:
mode:
authorPaul Gilbert2015-08-21 20:55:31 -0400
committerPaul Gilbert2015-08-21 20:55:31 -0400
commit2f077dba80bb35555bde3360d3a43e4f49c7bcb2 (patch)
tree5a4a8803bbad6d1d92f8ff11ea29125c7062894a /engines/sherlock/tattoo/tattoo_scene.cpp
parent42944eb023f6ab7a879761722e772d5ab831d4f6 (diff)
downloadscummvm-rg350-2f077dba80bb35555bde3360d3a43e4f49c7bcb2.tar.gz
scummvm-rg350-2f077dba80bb35555bde3360d3a43e4f49c7bcb2.tar.bz2
scummvm-rg350-2f077dba80bb35555bde3360d3a43e4f49c7bcb2.zip
SHERLOCK: RT: Fix flickering newspaper inside Baker Street
Diffstat (limited to 'engines/sherlock/tattoo/tattoo_scene.cpp')
-rw-r--r--engines/sherlock/tattoo/tattoo_scene.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/engines/sherlock/tattoo/tattoo_scene.cpp b/engines/sherlock/tattoo/tattoo_scene.cpp
index 6f9673081f..2f88f4c715 100644
--- a/engines/sherlock/tattoo/tattoo_scene.cpp
+++ b/engines/sherlock/tattoo/tattoo_scene.cpp
@@ -43,15 +43,16 @@ struct ShapeEntry {
TattooPerson *_person;
bool _isAnimation;
int _yp;
+ int _objNum;
- ShapeEntry(TattooPerson *person, int yp) : _shape(nullptr), _person(person), _yp(yp), _isAnimation(false) {}
- ShapeEntry(Object *shape, int yp) : _shape(shape), _person(nullptr), _yp(yp), _isAnimation(false) {}
- ShapeEntry(int yp) : _shape(nullptr), _person(nullptr), _yp(yp), _isAnimation(true) {}
+ ShapeEntry(TattooPerson *person, int yp) : _shape(nullptr), _person(person), _yp(yp), _isAnimation(false), _objNum(-1) {}
+ ShapeEntry(Object *shape, int yp, int objNum) : _shape(shape), _person(nullptr), _yp(yp), _isAnimation(false), _objNum(objNum) {}
+ ShapeEntry(int yp) : _shape(nullptr), _person(nullptr), _yp(yp), _isAnimation(true), _objNum(-1) {}
};
typedef Common::List<ShapeEntry> ShapeList;
static bool sortImagesY(const ShapeEntry &s1, const ShapeEntry &s2) {
- return s1._yp <= s2._yp;
+ return s1._yp < s2._yp || (s1._yp == s2._yp && s1._objNum < s2._objNum);
}
/*----------------------------------------------------------------*/
@@ -149,10 +150,10 @@ void TattooScene::drawAllShapes() {
if (obj._type == ACTIVE_BG_SHAPE && (obj._misc == NORMAL_BEHIND || obj._misc == NORMAL_FORWARD)) {
if (obj._scaleVal == SCALE_THRESHOLD)
shapeList.push_back(ShapeEntry(&obj, obj._position.y + obj._imageFrame->_offset.y +
- obj._imageFrame->_height));
+ obj._imageFrame->_height, idx));
else
shapeList.push_back(ShapeEntry(&obj, obj._position.y + obj._imageFrame->sDrawYOffset(obj._scaleVal) +
- obj._imageFrame->sDrawYSize(obj._scaleVal)));
+ obj._imageFrame->sDrawYSize(obj._scaleVal), idx));
}
}