change scanlines hotkey delta to 2

fix scanline underflow
This commit is contained in:
thrust26 2019-06-01 22:38:16 +02:00
parent 288eb5b1e5
commit dd88e3a7fe
2 changed files with 3 additions and 2 deletions

View File

@ -439,11 +439,11 @@ void EventHandler::handleEvent(Event::Type event, bool pressed, bool repeat)
return;
case Event::ScanlinesDecrease:
if (pressed) myOSystem.frameBuffer().tiaSurface().setScanlineIntensity(-5);
if (pressed) myOSystem.frameBuffer().tiaSurface().setScanlineIntensity(-2);
return;
case Event::ScanlinesIncrease:
if (pressed) myOSystem.frameBuffer().tiaSurface().setScanlineIntensity(+5);
if (pressed) myOSystem.frameBuffer().tiaSurface().setScanlineIntensity(+2);
return;
case Event::PreviousAttribute:

View File

@ -202,6 +202,7 @@ uInt32 TIASurface::enableScanlines(int relative, int absolute)
FBSurface::Attributes& attr = mySLineSurface->attributes();
if(relative == 0) attr.blendalpha = absolute;
else attr.blendalpha += relative;
attr.blendalpha = std::max(0, Int32(attr.blendalpha));
attr.blendalpha = std::min(100u, attr.blendalpha);
mySLineSurface->applyAttributes();