aboutsummaryrefslogtreecommitdiff
path: root/engines/prince/prince.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'engines/prince/prince.cpp')
-rw-r--r--engines/prince/prince.cpp51
1 files changed, 16 insertions, 35 deletions
diff --git a/engines/prince/prince.cpp b/engines/prince/prince.cpp
index 6abc4bf6b4..48bf932f41 100644
--- a/engines/prince/prince.cpp
+++ b/engines/prince/prince.cpp
@@ -709,51 +709,32 @@ void PrinceEngine::showTexts() {
void PrinceEngine::showSprite(Graphics::Surface *backAnimSurface, int destX, int destY) {
int sprWidth = backAnimSurface->w;
int sprHeight = backAnimSurface->h;
- int sprModulo = 0;
-
destX -= _picWindowX;
- if (destX < 0) { // x1 on visible part of screen?
- // X1 signed, we add spriteWidth for x2
- if (sprWidth + destX < 1) {
- //exit - x2 is negative - out of window
- return; // don't draw
- } else {
- //esi += -1 * destX;
- sprWidth -= -1 * destX;
- sprModulo += -1 * destX;
- destX = 0; // x1 = 0;
+ destY -= _picWindowY;
+
+ // if x1 is on visible part of screen
+ if (destX < 0) {
+ if (destX + sprWidth < 1) {
+ //x2 is negative - out of window
+ return;
}
}
- //left_x_check_ok
- if (destX >= kNormalWidth) { // x1 outside of screen on right side
- return; // don't draw
- }
- if (destX + sprWidth > kNormalWidth) { // x2 too far?
- sprWidth -= destX - kNormalWidth;
- sprModulo += destX - kNormalWidth;
+ // if x1 is outside of screen on right side
+ if (destX >= kNormalWidth) {
+ return;
}
- //right_x_check_ok
- destY -= _picWindowY;
+
if (destY < 0) {
- if (sprHeight + destY < 1) {
- //exit - y2 is negative - out of window
- return; // don't draw
- } else {
- sprHeight -= -1 * destY;
- //esi += (sprWidth + sprModulo) * (-1 * destY);
- destY = 0;
+ if (destY + sprHeight < 1) {
+ //y2 is negative - out of window
+ return;
}
}
- //upper_y_check_ok
if (destY >= kNormalHeight) {
- return; // don't draw
- }
- if (destY + sprHeight > kNormalHeight) {
- sprHeight -= destY + sprHeight - kNormalHeight;
+ return;
}
- //lower_y_check_ok
- _graph->drawTransparent(destX, destY, backAnimSurface); // TODO
+ _graph->drawTransparent(destX, destY, backAnimSurface);
}
void PrinceEngine::showBackAnims() {