Skip to content

Commit

Permalink
Oops, premature optimization; it broke changing phosphor blend level.
Browse files Browse the repository at this point in the history
  • Loading branch information
sa666666 committed Aug 7, 2017
1 parent 1dc78a9 commit 8759f34
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions src/emucore/TIASurface.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,6 @@ TIASurface::TIASurface(OSystem& system)
myBaseTiaSurface = myFB.allocateSurface(kTIAW*2, kTIAH);

memset(myRGBFramebuffer, 0, AtariNTSC::outWidth(kTIAW) * kTIAH);

// Precalculate the average colors for the 'phosphor' effect
for(Int16 c = 255; c >= 0; c--)
for(Int16 p = 255; p >= 0; p--)
myPhosphorPalette[c][p] = getPhosphor(c, p);
}

// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Expand Down Expand Up @@ -239,6 +234,14 @@ void TIASurface::enablePhosphor(bool enable, int blend)
myTiaSurface->setDirty();
mySLineSurface->setDirty();
memset(myRGBFramebuffer, 0, AtariNTSC::outWidth(kTIAW) * kTIAH * 4);

// Precalculate the average colors for the 'phosphor' effect
if(myUsePhosphor)
{
for(Int16 c = 255; c >= 0; c--)
for(Int16 p = 255; p >= 0; p--)
myPhosphorPalette[c][p] = getPhosphor(c, p);
}
}

// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Expand Down

0 comments on commit 8759f34

Please sign in to comment.