- Do some minor code cleanup.
This commit is contained in:
rogerman 2016-07-13 23:14:38 +00:00
parent 3a11617bed
commit 6530d35c3e
2 changed files with 31 additions and 21 deletions

View File

@ -7687,15 +7687,20 @@ void GPUSubsystem::RenderLine(const u16 l, bool isFrameSkipRequested)
{ {
this->UpdateRenderProperties(); this->UpdateRenderProperties();
if (!isFramebufferRenderNeeded[GPUEngineID_Main])
{
if (!CommonSettings.showGpu.main) if (!CommonSettings.showGpu.main)
{ {
memset(this->_engineMain->renderedBuffer, 0, this->_engineMain->renderedWidth * this->_engineMain->renderedHeight * this->_displayInfo.pixelBytes); memset(this->_engineMain->renderedBuffer, 0, this->_engineMain->renderedWidth * this->_engineMain->renderedHeight * this->_displayInfo.pixelBytes);
} }
else if (this->_engineMain->GetIsMasterBrightFullIntensity() && (this->_engineMain->GetIORegisterMap().DISPCAPCNT.CaptureEnable == 0)) else if (this->_engineMain->GetIsMasterBrightFullIntensity())
{ {
this->_engineMain->ApplyMasterBrightness<true>(); this->_engineMain->ApplyMasterBrightness<true>();
} }
}
if (!isFramebufferRenderNeeded[GPUEngineID_Sub])
{
if (!CommonSettings.showGpu.sub) if (!CommonSettings.showGpu.sub)
{ {
memset(this->_engineSub->renderedBuffer, 0, this->_engineSub->renderedWidth * this->_engineSub->renderedHeight * this->_displayInfo.pixelBytes); memset(this->_engineSub->renderedBuffer, 0, this->_engineSub->renderedWidth * this->_engineSub->renderedHeight * this->_displayInfo.pixelBytes);
@ -7706,6 +7711,7 @@ void GPUSubsystem::RenderLine(const u16 l, bool isFrameSkipRequested)
} }
} }
} }
}
if (isFramebufferRenderNeeded[GPUEngineID_Main] && !isFrameSkipRequested) if (isFramebufferRenderNeeded[GPUEngineID_Main] && !isFrameSkipRequested)
{ {
@ -7718,16 +7724,20 @@ void GPUSubsystem::RenderLine(const u16 l, bool isFrameSkipRequested)
// originates from the top of the screen, the BG0 layer will only be enabled at line 46. This // originates from the top of the screen, the BG0 layer will only be enabled at line 46. This
// means that we need to check the states at that particular time to ensure that the 3D renderer // means that we need to check the states at that particular time to ensure that the 3D renderer
// finishes before we read the 3D framebuffer. Otherwise, the map will render incorrectly. // finishes before we read the 3D framebuffer. Otherwise, the map will render incorrectly.
if (CurrentRenderer->GetRenderNeedsFinish())
{
const bool need3DDisplayFramebuffer = this->_engineMain->WillRender3DLayer(); const bool need3DDisplayFramebuffer = this->_engineMain->WillRender3DLayer();
const bool need3DCaptureFramebuffer = this->_engineMain->WillCapture3DLayerDirect(); const bool need3DCaptureFramebuffer = this->_engineMain->WillCapture3DLayerDirect();
if ( CurrentRenderer->GetRenderNeedsFinish() && (need3DDisplayFramebuffer || need3DCaptureFramebuffer) ) if (need3DDisplayFramebuffer || need3DCaptureFramebuffer)
{ {
CurrentRenderer->SetFramebufferFlushStates(need3DDisplayFramebuffer, need3DCaptureFramebuffer); CurrentRenderer->SetFramebufferFlushStates(need3DDisplayFramebuffer, need3DCaptureFramebuffer);
CurrentRenderer->RenderFinish(); CurrentRenderer->RenderFinish();
CurrentRenderer->SetRenderNeedsFinish(false); CurrentRenderer->SetRenderNeedsFinish(false);
this->_event->DidRender3DEnd(); this->_event->DidRender3DEnd();
} }
}
this->_engineMain->RenderLine(l); this->_engineMain->RenderLine(l);
} }

View File

@ -57,7 +57,7 @@ protected:
// SoftRasterizer-specific methods // SoftRasterizer-specific methods
virtual Render3DError InitTables(); virtual Render3DError InitTables();
template<bool useHiResInterpolate> size_t performClipping(const VERTLIST *vertList, const POLYLIST *polyList, const INDEXLIST *indexList); template<bool USEHIRESINTERPOLATE> size_t performClipping(const VERTLIST *vertList, const POLYLIST *polyList, const INDEXLIST *indexList);
// Base rendering methods // Base rendering methods
virtual Render3DError BeginRender(const GFX3D &engine); virtual Render3DError BeginRender(const GFX3D &engine);