change the 3d frameskipping method to take advantage of the rendering deferral system which was already there. now, whenever a 3d frame is requested, and it isnt rendered due to having been skipped, it has the capability to render itsself. This should resolve any issues like ideas frameskip synchronization -- let me know.

This commit is contained in:
zeromus 2009-04-03 18:46:01 +00:00
parent a077ddf472
commit b231f48093
6 changed files with 10 additions and 11 deletions

View File

@ -687,7 +687,7 @@ static void Control()
}
}
static void OGLRender(bool skipdraw)
static void OGLRender()
{
if(!BEGINGL()) return;

View File

@ -1374,12 +1374,15 @@ void gfx3d_VBlankSignal()
drawPending = TRUE;
}
void gfx3d_VBlankEndSignal(bool skipdraw)
void gfx3d_VBlankEndSignal(bool skipFrame)
{
//if we are skipping 3d frames then the 3d rendering will get held up here.
//but, as soon as we quit skipping frames, the held-up 3d frame will render
if(skipFrame) return;
if(!drawPending) return;
drawPending = FALSE;
gpu3D->NDS_3D_Render(skipdraw);
gpu3D->NDS_3D_Render();
}
#ifdef USE_GEOMETRY_FIFO_EMULATION

View File

@ -237,7 +237,7 @@ unsigned int gfx3d_glGetPosRes(unsigned int index);
unsigned short gfx3d_glGetVecRes(unsigned int index);
void gfx3d_glFlush(unsigned long v);
void gfx3d_VBlankSignal();
void gfx3d_VBlankEndSignal(bool skipdraw);
void gfx3d_VBlankEndSignal(bool skipFrame);
void gfx3d_Control(unsigned long v);
u32 gfx3d_GetGXstatus();
void gfx3d_sendCommandToFIFO(u32 val);

View File

@ -1145,11 +1145,8 @@ static void clipPoly(POLY* poly)
}
static void SoftRastRender(bool skipdraw)
static void SoftRastRender()
{
if(skipdraw)
return;
Fragment clearFragment;
clearFragment.color.components.r = gfx3d.clearColor&0x1F;
clearFragment.color.components.g = (gfx3d.clearColor>>5)&0x1F;

View File

@ -26,14 +26,13 @@ static void NDS_nullFunc1 (void){}
static char NDS_nullFunc2 (void){ return 1; }
static void NDS_nullFunc3 (int,unsigned short*) {}
static void NDS_nullFunc4 (int,unsigned short*,unsigned char*) {}
static void NDS_nullFunc5 (bool){}
GPU3DInterface gpu3DNull = {
"None",
NDS_nullFunc2, //NDS_3D_Init
NDS_nullFunc1, //NDS_3D_Reset
NDS_nullFunc1, //NDS_3D_Close
NDS_nullFunc5, //NDS_3D_Render
NDS_nullFunc1, //NDS_3D_Render
NDS_nullFunc1, //NDS_3D_VramReconfigureSignal
NDS_nullFunc4, //NDS_3D_GetLine
NDS_nullFunc3 //NDS_3D_GetLineCaptured

View File

@ -39,7 +39,7 @@ typedef struct Render3DInterface
void (CALL_CONVENTION* NDS_3D_Close) (void);
//called when the renderer should do its job and render the current display lists
void (CALL_CONVENTION* NDS_3D_Render) (bool skipdraw);
void (CALL_CONVENTION* NDS_3D_Render) (void);
//called when the emulator reconfigures its vram. you may need to invalidate your texture cache.
void (CALL_CONVENTION* NDS_3D_VramReconfigureSignal) ();