Permalink
Browse files

GPU: Fix bug where the backlight intensity would be incorrectly avera…

…ged if frameskipping is enabled. (Regression from commit f5c9a36.)
  • Loading branch information...
rogerman committed Oct 4, 2017
1 parent 6ca2dbe commit f4c01c4b577ba51d52fc41054f57feb28ea773fc
Showing with 5 additions and 3 deletions.
  1. +5 −3 desmume/src/GPU.cpp
View
@@ -8115,11 +8115,9 @@ void GPUSubsystem::RenderLine(const size_t l)
this->_displayInfo.needConvertColorFormat[NDSDisplayID_Main] = (OUTPUTFORMAT == NDSColorFormat_BGR666_Rev);
this->_displayInfo.needConvertColorFormat[NDSDisplayID_Touch] = (OUTPUTFORMAT == NDSColorFormat_BGR666_Rev);
// Set the average backlight intensity and then reset the current total.
// Set the average backlight intensity over 263 H-blanks.
this->_displayInfo.backlightIntensity[NDSDisplayID_Main] = this->_backlightIntensityTotal[NDSDisplayID_Main] / 263.0f;
this->_displayInfo.backlightIntensity[NDSDisplayID_Touch] = this->_backlightIntensityTotal[NDSDisplayID_Touch] / 263.0f;
this->_backlightIntensityTotal[NDSDisplayID_Main] = 0.0f;
this->_backlightIntensityTotal[NDSDisplayID_Touch] = 0.0f;
this->_engineMain->UpdateMasterBrightnessDisplayInfo(this->_displayInfo);
this->_engineSub->UpdateMasterBrightnessDisplayInfo(this->_displayInfo);
@@ -8137,6 +8135,10 @@ void GPUSubsystem::RenderLine(const size_t l)
}
}
// Reset the current backlight intensity total.
this->_backlightIntensityTotal[NDSDisplayID_Main] = 0.0f;
this->_backlightIntensityTotal[NDSDisplayID_Touch] = 0.0f;
if (this->_frameNeedsFinish)
{
this->_frameNeedsFinish = false;

0 comments on commit f4c01c4

Please sign in to comment.