aboutsummaryrefslogtreecommitdiff
path: root/engines/toltecs/sprite.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'engines/toltecs/sprite.cpp')
-rw-r--r--engines/toltecs/sprite.cpp24
1 files changed, 12 insertions, 12 deletions
diff --git a/engines/toltecs/sprite.cpp b/engines/toltecs/sprite.cpp
index 787f15c15a..84b485d49b 100644
--- a/engines/toltecs/sprite.cpp
+++ b/engines/toltecs/sprite.cpp
@@ -287,7 +287,7 @@ void Screen::addDrawRequest(const DrawRequest &drawRequest) {
sprite.x -= xoffs;
sprite.y -= yoffs;
-
+
sprite.yerror = sprite.ydelta;
// Now we check if the sprite needs to be clipped
@@ -296,7 +296,7 @@ void Screen::addDrawRequest(const DrawRequest &drawRequest) {
if (sprite.y - _vm->_cameraY < 0) {
int16 clipHeight = ABS(sprite.y - _vm->_cameraY);
- int16 chopHeight, skipHeight, lineWidth;
+ int16 skipHeight = clipHeight;
byte *spriteFrameData;
sprite.height -= clipHeight;
@@ -307,8 +307,7 @@ void Screen::addDrawRequest(const DrawRequest &drawRequest) {
// If the sprite is scaled
if (sprite.flags & 3) {
- chopHeight = sprite.ydelta;
- skipHeight = clipHeight;
+ int16 chopHeight = sprite.ydelta;
if ((sprite.flags & 2) == 0) {
do {
chopHeight -= 100;
@@ -336,20 +335,21 @@ void Screen::addDrawRequest(const DrawRequest &drawRequest) {
// Now the sprite's offset is adjusted to point to the starting line
if ((sprite.flags & 0x10) == 0) {
- while (clipHeight--) {
- lineWidth = 0;
- while (lineWidth </*CHECKME was != */ sprite.origWidth) {
+ while (skipHeight--) {
+ int16 lineWidth = 0;
+ while (lineWidth < sprite.origWidth) {
sprite.offset++;
- lineWidth += (*spriteFrameData++) & 0x0F;
+ lineWidth += spriteFrameData[0] & 0x0F;
+ spriteFrameData++;
}
}
} else {
- lineWidth = 0;
- while (clipHeight--) {
+ while (skipHeight--) {
+ int16 lineWidth = 0;
while (lineWidth < sprite.origWidth) {
sprite.offset += 2;
- spriteFrameData++;
- lineWidth += *spriteFrameData++;
+ lineWidth += spriteFrameData[1];
+ spriteFrameData += 2;
}
}
}