aboutsummaryrefslogtreecommitdiff
path: root/engines/saga
diff options
context:
space:
mode:
authorFilippos Karapetis2008-12-12 20:10:00 +0000
committerFilippos Karapetis2008-12-12 20:10:00 +0000
commitdcca0c9f66cdec863aec0e40e0714bc7845fd8c3 (patch)
treeb1c711291d462cc48a8dd9339c870e605c9d3435 /engines/saga
parent052e83cd2421f14c24063ab424b465f2029c5bf3 (diff)
downloadscummvm-rg350-dcca0c9f66cdec863aec0e40e0714bc7845fd8c3.tar.gz
scummvm-rg350-dcca0c9f66cdec863aec0e40e0714bc7845fd8c3.tar.bz2
scummvm-rg350-dcca0c9f66cdec863aec0e40e0714bc7845fd8c3.zip
Fixed a regression in my last commit where some sprites were not clipped correctly
svn-id: r35318
Diffstat (limited to 'engines/saga')
-rw-r--r--engines/saga/isomap.cpp2
-rw-r--r--engines/saga/puzzle.cpp2
-rw-r--r--engines/saga/sprite.cpp14
-rw-r--r--engines/saga/sprite.h6
4 files changed, 12 insertions, 12 deletions
diff --git a/engines/saga/isomap.cpp b/engines/saga/isomap.cpp
index 4619b52b7d..6caa1aa55f 100644
--- a/engines/saga/isomap.cpp
+++ b/engines/saga/isomap.cpp
@@ -406,7 +406,7 @@ void IsoMap::drawSprite(SpriteList &spriteList, int spriteNumber, const Location
_tileClip.top = CLIP<int>(spritePointer.y, 0, _vm->_scene->getHeight());
_tileClip.bottom = CLIP<int>(spritePointer.y + height, 0, _vm->_scene->getHeight());
- _vm->_sprite->drawClip(spritePointer, width, height, spriteBuffer);
+ _vm->_sprite->drawClip(spritePointer, width, height, spriteBuffer, true);
drawTiles(&location);
}
diff --git a/engines/saga/puzzle.cpp b/engines/saga/puzzle.cpp
index b149112128..7ae0c66648 100644
--- a/engines/saga/puzzle.cpp
+++ b/engines/saga/puzzle.cpp
@@ -207,7 +207,7 @@ void Puzzle::drawCurrentPiece() {
_vm->_actor->getSpriteParams(puzzle, frameNumber, spriteList);
_vm->_sprite->draw(*spriteList, _puzzlePiece,
- Point(_pieceInfo[_puzzlePiece].curX, _pieceInfo[_puzzlePiece].curY), 256);
+ Point(_pieceInfo[_puzzlePiece].curX, _pieceInfo[_puzzlePiece].curY), 256, true);
}
void Puzzle::movePiece(Point mousePt) {
diff --git a/engines/saga/sprite.cpp b/engines/saga/sprite.cpp
index 1808545c67..3a406ce13b 100644
--- a/engines/saga/sprite.cpp
+++ b/engines/saga/sprite.cpp
@@ -212,10 +212,10 @@ void Sprite::getScaledSpriteBuffer(SpriteList &spriteList, int spriteNumber, int
}
}
-void Sprite::drawClip(const Point &spritePointer, int width, int height, const byte *spriteBuffer) {
+void Sprite::drawClip(const Point &spritePointer, int width, int height, const byte *spriteBuffer, bool clipToScene) {
int clipWidth;
int clipHeight;
- Common::Rect clipRect(_vm->getDisplayClip());
+ Common::Rect clipRect = clipToScene ? _vm->_scene->getSceneClip() : _vm->getDisplayClip();
int i, j, jo, io;
byte *bufRowPointer;
@@ -263,7 +263,7 @@ void Sprite::drawClip(const Point &spritePointer, int width, int height, const b
_vm->_render->addDirtyRect(Common::Rect(x1, y1, x2, y2));
}
-void Sprite::draw(SpriteList &spriteList, int32 spriteNumber, const Point &screenCoord, int scale) {
+void Sprite::draw(SpriteList &spriteList, int32 spriteNumber, const Point &screenCoord, int scale, bool clipToScene) {
const byte *spriteBuffer = NULL;
int width = 0;
int height = 0;
@@ -276,10 +276,10 @@ void Sprite::draw(SpriteList &spriteList, int32 spriteNumber, const Point &scree
spritePointer.x = screenCoord.x + xAlign;
spritePointer.y = screenCoord.y + yAlign;
- drawClip(spritePointer, width, height, spriteBuffer);
+ drawClip(spritePointer, width, height, spriteBuffer, clipToScene);
}
-void Sprite::draw(SpriteList &spriteList, int32 spriteNumber, const Rect &screenRect, int scale) {
+void Sprite::draw(SpriteList &spriteList, int32 spriteNumber, const Rect &screenRect, int scale, bool clipToScene) {
const byte *spriteBuffer = NULL;
int width = 0;
int height = 0;
@@ -300,7 +300,7 @@ void Sprite::draw(SpriteList &spriteList, int32 spriteNumber, const Rect &screen
}
spritePointer.x = screenRect.left + xAlign + spw;
spritePointer.y = screenRect.top + yAlign + sph;
- drawClip(spritePointer, width, height, spriteBuffer);
+ drawClip(spritePointer, width, height, spriteBuffer, clipToScene);
}
bool Sprite::hitTest(SpriteList &spriteList, int spriteNumber, const Point &screenCoord, int scale, const Point &testPoint) {
@@ -370,7 +370,7 @@ void Sprite::drawOccluded(SpriteList &spriteList, int spriteNumber, const Point
clipData.sourceRect.right = width;
clipData.sourceRect.bottom = height;
- clipData.destRect = _vm->getDisplayClip();
+ clipData.destRect = _vm->_scene->getSceneClip();
if (!clipData.calcClip()) {
return;
diff --git a/engines/saga/sprite.h b/engines/saga/sprite.h
index 2f267f6cba..3d077f6389 100644
--- a/engines/saga/sprite.h
+++ b/engines/saga/sprite.h
@@ -77,12 +77,12 @@ public:
void drawOccluded(SpriteList &spriteList, int spriteNumber, const Point &screenCoord, int scale, int depth);
// draw scaled sprite using background scene mask
- void draw(SpriteList &spriteList, int32 spriteNumber, const Point &screenCoord, int scale);
+ void draw(SpriteList &spriteList, int32 spriteNumber, const Point &screenCoord, int scale, bool clipToScene = false);
// main function
- void drawClip(const Point &spritePointer, int width, int height, const byte *spriteBuffer);
+ void drawClip(const Point &spritePointer, int width, int height, const byte *spriteBuffer, bool clipToScene = false);
- void draw(SpriteList &spriteList, int32 spriteNumber, const Rect &screenRect, int scale);
+ void draw(SpriteList &spriteList, int32 spriteNumber, const Rect &screenRect, int scale, bool clipToScene = false);
void loadList(int resourceId, SpriteList &spriteList); // load or append spriteList
bool hitTest(SpriteList &spriteList, int spriteNumber, const Point &screenCoord, int scale, const Point &testPoint);