GPU: Fix bug where the backlight intensity would be incorrectly averaged if frameskipping is enabled. (Regression from commit f5c9a36.)

This commit is contained in:
rogerman 2017-10-04 00:32:43 -07:00
parent 6ca2dbe6d0
commit f4c01c4b57
1 changed files with 5 additions and 3 deletions

View File

@ -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;