mirror of
https://github.com/libretro/scummvm.git
synced 2025-01-23 19:16:21 +00:00
Well, it *looks* as if that clipping code could be simplified. We'll see if somebody starts to yell about the changes, though :-)
svn-id: r15313
This commit is contained in:
parent
193c3bc8ee
commit
f974de7e16
@ -1218,35 +1218,13 @@ byte AkosRenderer::codec32(int xmoveCur, int ymoveCur) {
|
||||
dst.left = _actorX + xmoveCur;
|
||||
}
|
||||
|
||||
src.top = src.left = 0;
|
||||
src.right = _width - 1;
|
||||
src.bottom = _height - 1;
|
||||
|
||||
dst.top = _actorY + ymoveCur;
|
||||
dst.right = dst.left + _width - 1;
|
||||
dst.bottom = dst.top + _height - 1;
|
||||
|
||||
int diff;
|
||||
diff = dst.left - _clipOverride.left;
|
||||
if (diff < 0) {
|
||||
src.left -= diff;
|
||||
dst.left -= diff;
|
||||
}
|
||||
diff = dst.right - _clipOverride.right;
|
||||
if (diff > 0) {
|
||||
src.right -= diff;
|
||||
dst.right -= diff;
|
||||
}
|
||||
diff = dst.top - _clipOverride.top;
|
||||
if (diff < 0) {
|
||||
src.top -= diff;
|
||||
dst.top -= diff;
|
||||
}
|
||||
diff = dst.bottom - _clipOverride.bottom;
|
||||
if (diff > 0) {
|
||||
src.bottom -= diff;
|
||||
dst.bottom -= diff;
|
||||
}
|
||||
dst.clip(_clipOverride);
|
||||
src = dst;
|
||||
src.moveTo(0, 0);
|
||||
|
||||
_vm->markRectAsDirty(kMainVirtScreen, dst);
|
||||
|
||||
|
@ -1459,7 +1459,6 @@ static bool calcClipRects(int dst_w, int dst_h, int src_x, int src_y, int src_w,
|
||||
srcRect = Common::Rect(0, 0, src_w - 1, src_h - 1);
|
||||
dstRect = Common::Rect(src_x, src_y, src_x + src_w - 1, src_y + src_h - 1);
|
||||
Common::Rect r3;
|
||||
int diff;
|
||||
|
||||
if (rect) {
|
||||
r3 = *rect;
|
||||
@ -1472,31 +1471,9 @@ static bool calcClipRects(int dst_w, int dst_h, int src_x, int src_y, int src_w,
|
||||
} else {
|
||||
r3 = Common::Rect(0, 0, dst_w - 1, dst_h - 1);
|
||||
}
|
||||
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;
|
||||
}
|
||||
// TODO/FIXME: At this point, unless I am mistaken, srcRect == dstRect.moveTo(0, 0)
|
||||
// As such the code above could be simplified (i.e. srcRect could be removed,
|
||||
// and then the uses of the diff variables can be folded in).
|
||||
// In fact it looks to me as if the code above just does some simple clipping...
|
||||
// Since I don't have the HE games in questions, I can't test this, though.
|
||||
dstRect.clip(r3);
|
||||
srcRect = dstRect;
|
||||
srcRect.moveTo(0, 0);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user