[Scummvm-cvs-logs] SF.net SVN: scummvm:[35318] scummvm/trunk/engines/saga
thebluegr at users.sourceforge.net
thebluegr at users.sourceforge.net
Fri Dec 12 21:10:00 CET 2008
Revision: 35318
http://scummvm.svn.sourceforge.net/scummvm/?rev=35318&view=rev
Author: thebluegr
Date: 2008-12-12 20:10:00 +0000 (Fri, 12 Dec 2008)
Log Message:
-----------
Fixed a regression in my last commit where some sprites were not clipped correctly
Modified Paths:
--------------
scummvm/trunk/engines/saga/isomap.cpp
scummvm/trunk/engines/saga/puzzle.cpp
scummvm/trunk/engines/saga/sprite.cpp
scummvm/trunk/engines/saga/sprite.h
Modified: scummvm/trunk/engines/saga/isomap.cpp
===================================================================
--- scummvm/trunk/engines/saga/isomap.cpp 2008-12-12 17:12:05 UTC (rev 35317)
+++ scummvm/trunk/engines/saga/isomap.cpp 2008-12-12 20:10:00 UTC (rev 35318)
@@ -406,7 +406,7 @@
_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);
}
Modified: scummvm/trunk/engines/saga/puzzle.cpp
===================================================================
--- scummvm/trunk/engines/saga/puzzle.cpp 2008-12-12 17:12:05 UTC (rev 35317)
+++ scummvm/trunk/engines/saga/puzzle.cpp 2008-12-12 20:10:00 UTC (rev 35318)
@@ -207,7 +207,7 @@
_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) {
Modified: scummvm/trunk/engines/saga/sprite.cpp
===================================================================
--- scummvm/trunk/engines/saga/sprite.cpp 2008-12-12 17:12:05 UTC (rev 35317)
+++ scummvm/trunk/engines/saga/sprite.cpp 2008-12-12 20:10:00 UTC (rev 35318)
@@ -212,10 +212,10 @@
}
}
-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 @@
_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 @@
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 @@
}
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 @@
clipData.sourceRect.right = width;
clipData.sourceRect.bottom = height;
- clipData.destRect = _vm->getDisplayClip();
+ clipData.destRect = _vm->_scene->getSceneClip();
if (!clipData.calcClip()) {
return;
Modified: scummvm/trunk/engines/saga/sprite.h
===================================================================
--- scummvm/trunk/engines/saga/sprite.h 2008-12-12 17:12:05 UTC (rev 35317)
+++ scummvm/trunk/engines/saga/sprite.h 2008-12-12 20:10:00 UTC (rev 35318)
@@ -77,12 +77,12 @@
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);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list