merge some common parts of Swap() into VideoCommon

This commit is contained in:
degasus
2014-02-05 11:48:45 +01:00
parent 3551259c7a
commit d5f1f0d4a9
7 changed files with 28 additions and 31 deletions

View File

@ -30,6 +30,9 @@
#include "XFMemory.h"
#include "FifoPlayer/FifoRecorder.h"
#include "AVIDump.h"
#include "Debugger.h"
#include "Statistics.h"
#include "Core.h"
#include <cmath>
#include <string>
@ -117,7 +120,7 @@ void Renderer::RenderToXFB(u32 xfbAddr, u32 fbWidth, u32 fbHeight, const EFBRect
}
else
{
g_renderer->Swap(xfbAddr, fbWidth, fbHeight,sourceRc,Gamma);
Swap(xfbAddr, fbWidth, fbHeight,sourceRc,Gamma);
Common::AtomicStoreRelease(s_swapRequested, false);
}
}
@ -514,3 +517,20 @@ void SetViewport()
if (xfregs.viewport.wd != 0 && xfregs.viewport.ht != 0)
g_renderer->SetViewport();
}
void Renderer::Swap(u32 xfbAddr, u32 fbWidth, u32 fbHeight, const EFBRectangle& rc, float Gamma)
{
// TODO: merge more generic parts into VideoCommon
g_renderer->SwapImpl(xfbAddr, fbWidth, fbHeight, rc, Gamma);
frameCount++;
GFX_DEBUGGER_PAUSE_AT(NEXT_FRAME, true);
// Begin new frame
// Set default viewport and scissor, for the clear to work correctly
// New frame
stats.ResetFrame();
Core::Callback_VideoCopiedToXFB(XFBWrited || (g_ActiveConfig.bUseXFB && g_ActiveConfig.bUseRealXFB));
XFBWrited = false;
}