From 10d0c6b4d2efe10b966737adbf79ffa5a4c4f046 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Mon, 19 Aug 2002 17:52:26 +0000 Subject: more o5_lights work; the only thing missing should be the flashlight now svn-id: r4775 --- gfx.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/gfx.cpp b/gfx.cpp index 94fbc8af5e..b4c00c6217 100644 --- a/gfx.cpp +++ b/gfx.cpp @@ -739,7 +739,10 @@ void Gdi::drawBitmap(byte *ptr, VirtScreen *vs, int x, int y, int h, byte twobufs; int numzbuf; int sx; + bool lightsOn; + // Check whether lights are turned on or not + lightsOn = (_vm->_features & GF_AFTER_V6) || (_vm->_vars[_vm->VAR_CURRENT_LIGHTS] & LIGHTMODE_screen); CHECK_HEAP; if (_vm->_features & GF_SMALL_HEADER) @@ -824,12 +827,12 @@ void Gdi::drawBitmap(byte *ptr, VirtScreen *vs, int x, int y, int h, _bgbak_ptr = where_draw_ptr; if (_vm->hasCharsetMask(sx << 3, y, (sx + 1) << 3, bottom)) { - if (flag & dbClear) + if (flag & dbClear || (!lightsOn && vs->number == 0)) clear8ColWithMasking(); else draw8ColWithMasking(); } else { - if (flag & dbClear) + if (flag & dbClear || (!lightsOn && vs->number == 0)) clear8Col(); else blit(_backbuff_ptr, _bgbak_ptr, 8, h); @@ -2256,7 +2259,6 @@ void Gdi::resetBackground(int top, int bottom, int strip) _numLinesToProcess = bottom - top; if (_numLinesToProcess) { if ((_vm->_features & GF_AFTER_V6) || (_vm->_vars[_vm->VAR_CURRENT_LIGHTS] & LIGHTMODE_screen)) { -// if (1 /*_vm->_vars[VAR_V5_DRAWFLAGS]&2*/ ) { if (_vm->hasCharsetMask(strip << 3, top, (strip + 1) << 3, bottom)) draw8ColWithMasking(); else -- cgit v1.2.3