diff options
-rw-r--r-- | engines/macventure/image.cpp | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/engines/macventure/image.cpp b/engines/macventure/image.cpp index aeb5a501a8..172121af0b 100644 --- a/engines/macventure/image.cpp +++ b/engines/macventure/image.cpp @@ -530,27 +530,24 @@ void ImageAsset::calculateSectionToDraw(Graphics::ManagedSurface *target, int &o } void ImageAsset::calculateSectionInDirection(uint targetWhole, uint originWhole, int &originPosition, uint &startPosition, uint &blittedWhole) { + startPosition = 0; blittedWhole = originWhole; - if (originPosition + blittedWhole > targetWhole) { - if (originPosition > (int)targetWhole) { - blittedWhole = 0; - } else { - blittedWhole = (blittedWhole) - ((blittedWhole + originPosition) - targetWhole); - } - } if (originPosition < 0) { if (ABS(originPosition) > (int)blittedWhole) { blittedWhole = 0; } else { blittedWhole -= -originPosition; } - } - - startPosition = 0; - if (originPosition < 0) { startPosition = -originPosition; originPosition = 0; } + if (originPosition + blittedWhole > targetWhole) { + if (originPosition > (int)targetWhole) { + blittedWhole = 0; + } else { + blittedWhole = targetWhole - originPosition; + } + } } } // End of namespace MacVenture |