Skip to content

Commit

Permalink
PRINCE: showHeroShadow - shadowLine data reading fix
Browse files Browse the repository at this point in the history
  • Loading branch information
lukaslw committed Aug 15, 2014
1 parent 1354146 commit 89bda02
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions engines/prince/hero.cpp
Expand Up @@ -240,7 +240,6 @@ static void plot(int x, int y, int color, void *data) {
shadowLine->_shadLineLen++;
}

// FIXME - horizontal line with wrong colors in the middle of shadow appears in loc. 12, 23
void Hero::showHeroShadow(Graphics::Surface *screen, DrawNode *drawNode) {
Hero *heroData = (Hero *)drawNode->data;
int16 heroSurfaceWidth = drawNode->s->w;
Expand Down Expand Up @@ -500,18 +499,18 @@ void Hero::showHeroShadow(Graphics::Surface *screen, DrawNode *drawNode) {
}
//skip_line
//next_line
if (*(shadowLineStart + 2) < *(shadowLineStart - 2)) {
if (READ_UINT16(shadowLineStart + 2) < READ_UINT16(shadowLineStart - 2)) {
//minus_y
shadBitAddr -= PrinceEngine::kMaxPicWidth / 8;
shadPosY--;
diffY--;
} else if (*(shadowLineStart + 2) > *(shadowLineStart - 2)) {
} else if (READ_UINT16(shadowLineStart + 2) > READ_UINT16(shadowLineStart - 2)) {
shadBitAddr += PrinceEngine::kMaxPicWidth / 8;
shadPosY++;
diffY++;
}
//no_change_y
if (*shadowLineStart < *(shadowLineStart - 4)) {
if (READ_UINT16(shadowLineStart) < READ_UINT16(shadowLineStart - 4)) {
//minus_x
shadPosX--;
//rol
Expand All @@ -522,7 +521,7 @@ void Hero::showHeroShadow(Graphics::Surface *screen, DrawNode *drawNode) {
shadBitMask <<= 1;
}
diffX--;
} else if (*shadowLineStart > *(shadowLineStart - 4)) {
} else if (READ_UINT16(shadowLineStart) > READ_UINT16(shadowLineStart - 4)) {
shadPosX++;
//ror
if (shadBitMask == 1) {
Expand Down

0 comments on commit 89bda02

Please sign in to comment.