aboutsummaryrefslogtreecommitdiff
path: root/engines/scumm/gfx.cpp
diff options
context:
space:
mode:
authorRobert Crossfield2019-05-05 22:41:20 +1000
committerFilippos Karapetis2019-05-05 15:41:20 +0300
commit71172add9cffd7747cefe6d1c07f6fccc7460075 (patch)
tree38f1c8e016409af3f066c47e4b2f9083cdba50b8 /engines/scumm/gfx.cpp
parent8787bbb39029ef6fc901ded8a09fba4215e03f79 (diff)
downloadscummvm-rg350-71172add9cffd7747cefe6d1c07f6fccc7460075.tar.gz
scummvm-rg350-71172add9cffd7747cefe6d1c07f6fccc7460075.tar.bz2
scummvm-rg350-71172add9cffd7747cefe6d1c07f6fccc7460075.zip
SCUMM: Original V0-V2 flashlight shape and size for MM/Zak (#10947, #10951)
Diffstat (limited to 'engines/scumm/gfx.cpp')
-rw-r--r--engines/scumm/gfx.cpp47
1 files changed, 26 insertions, 21 deletions
diff --git a/engines/scumm/gfx.cpp b/engines/scumm/gfx.cpp
index f35c1e52fc..9bf5133c82 100644
--- a/engines/scumm/gfx.cpp
+++ b/engines/scumm/gfx.cpp
@@ -1460,27 +1460,32 @@ void ScummEngine_v5::drawFlashlight() {
blit(_flashlight.buffer, vs->pitch, bgbak, vs->pitch, _flashlight.w, _flashlight.h, vs->format.bytesPerPixel);
- // Round the corners. To do so, we simply hard-code a set of nicely
- // rounded corners.
- static const int corner_data[] = { 8, 6, 4, 3, 2, 2, 1, 1 };
- int minrow = 0;
- int maxcol = (_flashlight.w - 1) * vs->format.bytesPerPixel;
- int maxrow = (_flashlight.h - 1) * vs->pitch;
-
- for (i = 0; i < 8; i++, minrow += vs->pitch, maxrow -= vs->pitch) {
- int d = corner_data[i];
-
- for (j = 0; j < d; j++) {
- if (vs->format.bytesPerPixel == 2) {
- WRITE_UINT16(&_flashlight.buffer[minrow + 2 * j], 0);
- WRITE_UINT16(&_flashlight.buffer[minrow + maxcol - 2 * j], 0);
- WRITE_UINT16(&_flashlight.buffer[maxrow + 2 * j], 0);
- WRITE_UINT16(&_flashlight.buffer[maxrow + maxcol - 2 * j], 0);
- } else {
- _flashlight.buffer[minrow + j] = 0;
- _flashlight.buffer[minrow + maxcol - j] = 0;
- _flashlight.buffer[maxrow + j] = 0;
- _flashlight.buffer[maxrow + maxcol - j] = 0;
+ // C64 does not round the flashlight
+ if (_game.platform != Common::kPlatformC64) {
+
+ // Round the corners. To do so, we simply hard-code a set of nicely
+ // rounded corners.
+ static const int corner_data[] = { 8, 6, 4, 3, 2, 2, 1, 1 };
+ int minrow = 0;
+ int maxcol = (_flashlight.w - 1) * vs->format.bytesPerPixel;
+ int maxrow = (_flashlight.h - 1) * vs->pitch;
+
+ for (i = 0; i < 8; i++, minrow += vs->pitch, maxrow -= vs->pitch) {
+ int d = corner_data[i];
+
+ for (j = 0; j < d; j++) {
+ if (vs->format.bytesPerPixel == 2) {
+ WRITE_UINT16(&_flashlight.buffer[minrow + 2 * j], 0);
+ WRITE_UINT16(&_flashlight.buffer[minrow + maxcol - 2 * j], 0);
+ WRITE_UINT16(&_flashlight.buffer[maxrow + 2 * j], 0);
+ WRITE_UINT16(&_flashlight.buffer[maxrow + maxcol - 2 * j], 0);
+ }
+ else {
+ _flashlight.buffer[minrow + j] = 0;
+ _flashlight.buffer[minrow + maxcol - j] = 0;
+ _flashlight.buffer[maxrow + j] = 0;
+ _flashlight.buffer[maxrow + maxcol - j] = 0;
+ }
}
}
}