This commit is contained in:
Daveo 2001-08-13 16:30:05 +00:00
parent 98e513df54
commit 232f8d7f71
2 changed files with 27 additions and 17 deletions

View file

@ -220,6 +220,7 @@ void MainLoop()
s_paulScene.render(); s_paulScene.render();
#endif #endif
while(DrawSync(1));
VidSwapDraw(); VidSwapDraw();
PrimDisplay(); PrimDisplay();

View file

@ -41,6 +41,8 @@ static int DrawLoadIcon=0;
static RECT LoadBackRect; static RECT LoadBackRect;
static int LoadTime=0; static int LoadTime=0;
static const int LoadBackInc=8; static const int LoadBackInc=8;
static DISPENV *VblDispEnv=0;
static DRAWENV *VblDrawEnv=0;
/*****************************************************************************/ /*****************************************************************************/
// Altered to keep aspect ratio // Altered to keep aspect ratio
@ -142,6 +144,18 @@ static void VidVSyncCallback()
FrameCounter++; FrameCounter++;
TickCount++; TickCount++;
if (DrawLoadIcon) LoadingIcon(); if (DrawLoadIcon) LoadingIcon();
// PutDispEnv(&Screen[FrameFlipFlag].Disp);
// PutDrawEnv(&Screen[FrameFlipFlag].Draw);
if (VblDispEnv)
{
PutDispEnv(VblDispEnv);
VblDispEnv=0;
}
if (VblDrawEnv)
{
PutDrawEnv(VblDrawEnv);
VblDrawEnv=0;
}
if (VbFunc) if (VbFunc)
{ {
@ -339,32 +353,27 @@ int ScreenClipBox=0;
#endif #endif
void VidSwapDraw() void VidSwapDraw()
{ {
DRAWENV *Draw;
DISPENV *Disp;
int LastFrame=FrameFlipFlag; int LastFrame=FrameFlipFlag;
int ScrH=VidGetScrH()*FrameFlipFlag; int ScrH=VidGetScrH()*FrameFlipFlag;
FrameFlipFlag^=1; FrameFlipFlag^=1;
TickBuffer[FrameFlipFlag]=TickCount; TickCount=0; TickBuffer[FrameFlipFlag]=TickCount; TickCount=0;
Draw=&Screen[FrameFlipFlag].Draw; Screen[FrameFlipFlag].Disp.disp.x=0;
Disp=&Screen[FrameFlipFlag].Disp; Screen[FrameFlipFlag].Disp.disp.y=ScrH;
Disp->disp.x=0; Screen[FrameFlipFlag].Disp.disp.w=ScreenW;
Disp->disp.y=ScrH; Screen[FrameFlipFlag].Disp.disp.h=ScreenH;
Disp->disp.w=ScreenW; Screen[FrameFlipFlag].Disp.screen.x=ScreenXOfs;
Disp->disp.h=ScreenH; Screen[FrameFlipFlag].Disp.screen.y=ScreenYOfs;
Disp->screen.x=ScreenXOfs; Screen[FrameFlipFlag].Disp.screen.w=256;
Disp->screen.y=ScreenYOfs; Screen[FrameFlipFlag].Disp.screen.h=ScreenH;
Disp->screen.w=256; VblDispEnv=&Screen[FrameFlipFlag].Disp;
Disp->screen.h=256; VblDrawEnv=&Screen[FrameFlipFlag].Draw;
PutDispEnv(Disp);
PutDrawEnv(Draw);
VSync(0); // < -need this here, not in game (vsync miss bug) VSync(0); // < -need this here, not in game (vsync miss bug)
// If set, load background screen // If set, load background screen
if (ScreenImage) if (ScreenImage)
{ {
LoadImage(&Screen[LastFrame].Disp.disp ,(u_long*)ScreenImage); LoadImage(&Screen[LastFrame].Disp.disp ,(u_long*)ScreenImage);
DrawSync(0); while(DrawSync(1));
} }