From e0bf735ff78e680ef2b57462fbac10438043d7ab Mon Sep 17 00:00:00 2001 From: Max Horn Date: Fri, 23 Aug 2002 23:16:39 +0000 Subject: modified version of patch #598622: Round corners for flashlight svn-id: r4811 --- scumm/gfx.cpp | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/scumm/gfx.cpp b/scumm/gfx.cpp index 5b4e43f1cf..5431c1aac0 100644 --- a/scumm/gfx.cpp +++ b/scumm/gfx.cpp @@ -643,8 +643,24 @@ void Scumm::drawFlashlight() blit(flashBuffer, bgbak, flashW*8, flashH); - // TODO - flashlight should have round corners - + // Round the corners. To do so, we simply hard-code a set of nicely + // rounded corners. + int corner_data[] = { 8, 6, 4, 3, 2, 2, 1, 1 }; + int minrow = 0; + int maxcol = flashW * 8 - 1; + int maxrow = (flashH - 1) * 320; + + for (i = 0; i < 8; i++, minrow += 320, maxrow -= 320) { + int d = corner_data[i]; + + for (j = 0; j < d; j++) { + flashBuffer[minrow + j] = 0; + flashBuffer[minrow + maxcol - j] = 0; + flashBuffer[maxrow + j] = 0; + flashBuffer[maxrow + maxcol - j] = 0; + } + } + _flashlightIsDrawn = true; } -- cgit v1.2.3