[Scummvm-cvs-logs] CVS: scummvm/scumm wiz_he.cpp,2.26,2.27
kirben
kirben at users.sourceforge.net
Wed Mar 30 05:35:57 CEST 2005
- Previous message: [Scummvm-cvs-logs] CVS: scummvm/scumm intern.h,2.405,2.406 script_v100he.cpp,2.102,2.103 script_v72he.cpp,2.225,2.226 script_v7he.cpp,2.136,2.137 script_v80he.cpp,2.81,2.82 script_v90he.cpp,2.198,2.199 wiz_he.cpp,2.25,2.26 wiz_he.h,2.11,2.12
- Next message: [Scummvm-cvs-logs] CVS: scummvm/scumm akos.cpp,1.212,1.213 wiz_he.cpp,2.27,2.28
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Update of /cvsroot/scummvm/scummvm/scumm
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16666/scumm
Modified Files:
wiz_he.cpp
Log Message:
Revert cleanup from scumm/gfx.cpp revision 2.348.
Clipping isn't compatible, due to negative values.
Fixes many sprite glitches, since code is used to calculating offsets for images.
Index: wiz_he.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/wiz_he.cpp,v
retrieving revision 2.26
retrieving revision 2.27
diff -u -d -r2.26 -r2.27
--- wiz_he.cpp 30 Mar 2005 11:49:53 -0000 2.26
+++ wiz_he.cpp 30 Mar 2005 13:34:24 -0000 2.27
@@ -231,23 +231,44 @@
}
static bool calcClipRects(int dst_w, int dst_h, int src_x, int src_y, int src_w, int src_h, const Common::Rect *rect, Common::Rect &srcRect, Common::Rect &dstRect) {
+ srcRect = Common::Rect(0, 0, src_w, src_h);
+ dstRect = Common::Rect(src_x, src_y, src_x + src_w, src_y + src_h);
Common::Rect r3;
+ int diff;
+
if (rect) {
r3 = *rect;
- Common::Rect r4(dst_w, dst_h);
+ Common::Rect r4(0, 0, dst_w, dst_h);
if (r3.intersects(r4)) {
r3.clip(r4);
} else {
return false;
}
} else {
- r3 = Common::Rect(dst_w, dst_h);
+ r3 = Common::Rect(0, 0, dst_w, dst_h);
}
- dstRect = Common::Rect(src_x, src_y, src_x + src_w, src_y + src_h);
- dstRect.clip(r3);
- srcRect = dstRect;
- srcRect.moveTo(0, 0);
- return srcRect.isValidRect() && dstRect.isValidRect();
+ diff = dstRect.left - r3.left;
+ if (diff < 0) {
+ srcRect.left -= diff;
+ dstRect.left -= diff;
+ }
+ diff = dstRect.right - r3.right;
+ if (diff > 0) {
+ srcRect.right -= diff;
+ dstRect.right -= diff;
+ }
+ diff = dstRect.top - r3.top;
+ if (diff < 0) {
+ srcRect.top -= diff;
+ dstRect.top -= diff;
+ }
+ diff = dstRect.bottom - r3.bottom;
+ if (diff > 0) {
+ srcRect.bottom -= diff;
+ dstRect.bottom -= diff;
+ }
+
+ return true;
}
void Wiz::copyWizImage(uint8 *dst, const uint8 *src, int dstw, int dsth, int srcx, int srcy, int srcw, int srch, const Common::Rect *rect) {
- Previous message: [Scummvm-cvs-logs] CVS: scummvm/scumm intern.h,2.405,2.406 script_v100he.cpp,2.102,2.103 script_v72he.cpp,2.225,2.226 script_v7he.cpp,2.136,2.137 script_v80he.cpp,2.81,2.82 script_v90he.cpp,2.198,2.199 wiz_he.cpp,2.25,2.26 wiz_he.h,2.11,2.12
- Next message: [Scummvm-cvs-logs] CVS: scummvm/scumm akos.cpp,1.212,1.213 wiz_he.cpp,2.27,2.28
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the Scummvm-git-logs
mailing list