Erase old contents of RGB buffer when toggling phosphor and Blargg

effects (fixes #175).

Right idea, but I always forget that memset operates on bytes,
but the RGB buffer contains uInt32 (so multiply by 4).
This commit is contained in:
Stephen Anthony 2017-07-13 19:27:21 -02:30
parent 626ff450d9
commit fbb73b72f1
1 changed files with 3 additions and 2 deletions

View File

@ -228,8 +228,10 @@ void TIASurface::enablePhosphor(bool enable, int blend)
myUsePhosphor = enable;
myPhosphorPercent = blend / 100.0;
myFilter = Filter(enable ? uInt8(myFilter) | 0x01 : uInt8(myFilter) & 0x10);
myTiaSurface->setDirty();
mySLineSurface->setDirty();
memset(myRGBFramebuffer, 0, AtariNTSC::outWidth(kTIAW) * kTIAH * 4);
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@ -278,8 +280,7 @@ void TIASurface::enableNTSC(bool enable)
myTiaSurface->setDirty();
mySLineSurface->setDirty();
memset(myRGBFramebuffer, 0, AtariNTSC::outWidth(kTIAW) * kTIAH);
memset(myRGBFramebuffer, 0, AtariNTSC::outWidth(kTIAW) * kTIAH * 4);
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -