aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoryinsimei2017-06-16 06:42:19 +0200
committerEugene Sandulenko2017-07-13 18:27:45 +0200
commitbbde5f4bf4d46bc0c6f32cc197f698aa89676f70 (patch)
tree277fac3007331c9f7b6568204749e25402490af2
parent5baae657fd42f5635024cd659c04a1160fdddaf7 (diff)
downloadscummvm-rg350-bbde5f4bf4d46bc0c6f32cc197f698aa89676f70.tar.gz
scummvm-rg350-bbde5f4bf4d46bc0c6f32cc197f698aa89676f70.tar.bz2
scummvm-rg350-bbde5f4bf4d46bc0c6f32cc197f698aa89676f70.zip
SLUDGE: remove #ifndef of cursor display and formatting code
-rw-r--r--engines/sludge/cursors.cpp27
-rw-r--r--engines/sludge/sprites.cpp8
2 files changed, 18 insertions, 17 deletions
diff --git a/engines/sludge/cursors.cpp b/engines/sludge/cursors.cpp
index 519b6366dd..232dca86a3 100644
--- a/engines/sludge/cursors.cpp
+++ b/engines/sludge/cursors.cpp
@@ -43,40 +43,37 @@ void pickAnimCursor(personaAnimation *pp) {
}
void displayCursor() {
-#if 0
- if (mouseCursorAnim && mouseCursorAnim -> numFrames) {
+ if (mouseCursorAnim && mouseCursorAnim->numFrames) {
- int spriteNum = mouseCursorAnim -> frames[mouseCursorFrameNum].frameNum;
+ int spriteNum = mouseCursorAnim->frames[mouseCursorFrameNum].frameNum;
int flipMe = 0;
if (spriteNum < 0) {
spriteNum = -spriteNum;
flipMe = 1;
- if (spriteNum >= mouseCursorAnim -> theSprites -> bank.total) spriteNum = 0;
+ if (spriteNum >= mouseCursorAnim->theSprites->bank.total)
+ spriteNum = 0;
} else {
- if (spriteNum >= mouseCursorAnim -> theSprites -> bank.total) flipMe = 2;
+ if (spriteNum >= mouseCursorAnim->theSprites->bank.total)
+ flipMe = 2;
}
if (flipMe != 2) {
- (flipMe ? flipFontSprite : fontSprite)(input.mouseX, input.mouseY,
- mouseCursorAnim -> theSprites -> bank.sprites[spriteNum],
- mouseCursorAnim -> theSprites -> bank.myPalette /* ( spritePalette&) NULL*/);
+ (flipMe ? flipFontSprite : fontSprite)(input.mouseX, input.mouseY, mouseCursorAnim->theSprites->bank.sprites[spriteNum],
+ mouseCursorAnim->theSprites->bank.myPalette /* ( spritePalette&) NULL*/);
}
- if (++ mouseCursorCountUp >= mouseCursorAnim -> frames[mouseCursorFrameNum].howMany) {
+ if (++mouseCursorCountUp >= mouseCursorAnim->frames[mouseCursorFrameNum].howMany) {
mouseCursorCountUp = 0;
- mouseCursorFrameNum ++;
- mouseCursorFrameNum %= mouseCursorAnim -> numFrames;
+ mouseCursorFrameNum++;
+ mouseCursorFrameNum %= mouseCursorAnim->numFrames;
}
}
-#endif
}
void pasteCursor(int x, int y, personaAnimation *c) {
if (c->numFrames)
- pasteSpriteToBackDrop(x, y,
- c->theSprites->bank.sprites[c->frames[0].frameNum],
- c->theSprites->bank.myPalette);
+ pasteSpriteToBackDrop(x, y, c->theSprites->bank.sprites[c->frames[0].frameNum], c->theSprites->bank.myPalette);
}
} // End of namespace Sludge
diff --git a/engines/sludge/sprites.cpp b/engines/sludge/sprites.cpp
index b6701d4fa3..18370951ec 100644
--- a/engines/sludge/sprites.cpp
+++ b/engines/sludge/sprites.cpp
@@ -501,9 +501,13 @@ void fontSprite(bool flip, int x, int y, sprite &single, const spritePalette &fo
// Use Transparent surface to scale and blit
Graphics::TransparentSurface tmp(single.surface, false);
- Graphics::TransparentSurface tmp2(single.burnSurface, false);
tmp.blit(renderSurface, x1, y1, (flip? Graphics::FLIP_H : Graphics::FLIP_NONE));
- tmp2.blit(renderSurface, x1, y1, (flip? Graphics::FLIP_H : Graphics::FLIP_NONE), 0, TS_RGB(fontPal.originalRed, fontPal.originalGreen, fontPal.originalBlue));
+
+ if (single.burnSurface.getPixels() != nullptr) {
+ Graphics::TransparentSurface tmp2(single.burnSurface, false);
+ tmp2.blit(renderSurface, x1, y1, (flip? Graphics::FLIP_H : Graphics::FLIP_NONE), 0, TS_RGB(fontPal.originalRed, fontPal.originalGreen, fontPal.originalBlue));
+
+ }
#if 0
float x2 = x1 + (float) single.surface.w / cameraZoom;