mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-24 14:49:42 -06:00
Frameskipping! Complete with GUI! Even my most naive approach resulted in great speeds, even with graphic-intensive games such as Pikmin.
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@3949 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
@ -116,6 +116,8 @@ static int s_targetheight;
|
||||
static FramebufferManager s_framebufferManager;
|
||||
static GLuint s_tempScreenshotFramebuffer = 0;
|
||||
|
||||
static bool s_skipSwap = false;
|
||||
|
||||
#ifndef _WIN32
|
||||
int OSDChoice = 0 , OSDTime = 0, OSDInternalW = 0, OSDInternalH = 0;
|
||||
#endif
|
||||
@ -791,6 +793,8 @@ void Renderer::ClearScreen(const EFBRectangle& rc, bool colorEnable, bool alphaE
|
||||
|
||||
void Renderer::RenderToXFB(u32 xfbAddr, u32 fbWidth, u32 fbHeight, const EFBRectangle& sourceRc)
|
||||
{
|
||||
s_skipSwap = g_bSkipCurrentFrame;
|
||||
|
||||
g_VideoInitialize.pCopiedToXFB(false);
|
||||
|
||||
#ifdef XXX_ENABLE_CPU_CONTROLLED_SWAPPING
|
||||
@ -814,6 +818,9 @@ void Renderer::RenderToXFB(u32 xfbAddr, u32 fbWidth, u32 fbHeight, const EFBRect
|
||||
// This function has the final picture. We adjust the aspect ratio here.
|
||||
void Renderer::Swap(u32 xfbAddr, FieldType field, u32 fbWidth, u32 fbHeight)
|
||||
{
|
||||
if(s_skipSwap)
|
||||
return;
|
||||
|
||||
const XFBSource* xfbSource = s_framebufferManager.GetXFBSource(xfbAddr, fbWidth, fbHeight);
|
||||
if (!xfbSource)
|
||||
{
|
||||
@ -1088,18 +1095,18 @@ void Renderer::SwapBuffers()
|
||||
}
|
||||
}
|
||||
#endif
|
||||
// Copy the rendered frame to the real window
|
||||
// Copy the rendered frame to the real window
|
||||
OpenGL_SwapBuffers();
|
||||
|
||||
|
||||
GL_REPORT_ERRORD();
|
||||
|
||||
|
||||
// Clear framebuffer
|
||||
glClearColor(0, 0, 0, 0);
|
||||
glClear(GL_COLOR_BUFFER_BIT);
|
||||
|
||||
GL_REPORT_ERRORD();
|
||||
GL_REPORT_ERRORD();
|
||||
|
||||
// Clean out old stuff from caches
|
||||
// Clean out old stuff from caches
|
||||
VertexShaderCache::ProgressiveCleanup();
|
||||
PixelShaderCache::ProgressiveCleanup();
|
||||
TextureMngr::ProgressiveCleanup();
|
||||
|
@ -20,6 +20,8 @@
|
||||
#include <fstream>
|
||||
#include <vector>
|
||||
|
||||
#include "Fifo.h"
|
||||
|
||||
#include "Config.h"
|
||||
#include "Statistics.h"
|
||||
#include "MemoryUtil.h"
|
||||
@ -185,6 +187,11 @@ void Flush()
|
||||
|
||||
GL_REPORT_ERRORD();
|
||||
|
||||
if(g_bSkipCurrentFrame) {
|
||||
ResetBuffer();
|
||||
return;
|
||||
}
|
||||
|
||||
glBindBuffer(GL_ARRAY_BUFFER, s_vboBuffers[s_nCurVBOIndex]);
|
||||
glBufferData(GL_ARRAY_BUFFER, s_pCurBufferPointer - s_pBaseBufferPointer, s_pBaseBufferPointer, GL_STREAM_DRAW);
|
||||
GL_REPORT_ERRORD();
|
||||
|
@ -448,6 +448,10 @@ void Video_AddMessage(const char* pstr, u32 milliseconds)
|
||||
OSD::AddMessage(pstr, milliseconds);
|
||||
}
|
||||
|
||||
void Video_SetRendering(bool bEnabled) {
|
||||
Fifo_SetRendering(bEnabled);
|
||||
}
|
||||
|
||||
static volatile struct
|
||||
{
|
||||
u32 xfbAddr;
|
||||
|
Reference in New Issue
Block a user