Surface locking fix [zinx]
This commit is contained in:
@@ -60,7 +60,6 @@ int gl_start(int width, int height, int req_depth, int FullScreen)
|
|||||||
}
|
}
|
||||||
|
|
||||||
gl_clearwin();
|
gl_clearwin();
|
||||||
SurfaceLocking = SDL_MUSTLOCK(surface);
|
|
||||||
SDL_WarpMouse(SurfaceX / 4, SurfaceY / 4);
|
SDL_WarpMouse(SurfaceX / 4, SurfaceY / 4);
|
||||||
|
|
||||||
// Grab mouse in fullscreen mode
|
// Grab mouse in fullscreen mode
|
||||||
@@ -110,19 +109,6 @@ void gl_end()
|
|||||||
free(glvidbuffer);
|
free(glvidbuffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void LockSurface(void)
|
|
||||||
{
|
|
||||||
if (SurfaceLocking)
|
|
||||||
SDL_LockSurface(surface);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void UnlockSurface(void)
|
|
||||||
{
|
|
||||||
if (SurfaceLocking)
|
|
||||||
SDL_UnlockSurface(surface);
|
|
||||||
SDL_GL_SwapBuffers();
|
|
||||||
}
|
|
||||||
|
|
||||||
extern DWORD AddEndBytes;
|
extern DWORD AddEndBytes;
|
||||||
extern DWORD NumBytesPerLine;
|
extern DWORD NumBytesPerLine;
|
||||||
extern unsigned char *WinVidMemStart;
|
extern unsigned char *WinVidMemStart;
|
||||||
@@ -262,8 +248,6 @@ void gl_drawwin()
|
|||||||
if (curblank != 0)
|
if (curblank != 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
LockSurface();
|
|
||||||
|
|
||||||
if (BilinearFilter)
|
if (BilinearFilter)
|
||||||
{
|
{
|
||||||
glfilters = GL_LINEAR;
|
glfilters = GL_LINEAR;
|
||||||
@@ -275,8 +259,6 @@ void gl_drawwin()
|
|||||||
glfilters = GL_NEAREST;
|
glfilters = GL_NEAREST;
|
||||||
}
|
}
|
||||||
|
|
||||||
glLoadIdentity();
|
|
||||||
|
|
||||||
if (En2xSaI)
|
if (En2xSaI)
|
||||||
{
|
{
|
||||||
/* We have to use copy640x480x16bwin for 2xSaI */
|
/* We have to use copy640x480x16bwin for 2xSaI */
|
||||||
@@ -416,21 +398,13 @@ void gl_drawwin()
|
|||||||
{
|
{
|
||||||
glBegin(GL_QUADS);
|
glBegin(GL_QUADS);
|
||||||
glTexCoord1f(0.0f);
|
glTexCoord1f(0.0f);
|
||||||
glVertex3f(-1.0f,
|
glVertex3f(-1.0f, (SurfaceY - i * 2.0) / SurfaceY, -1.0f);
|
||||||
(SurfaceY - i * 2.0) / SurfaceY,
|
|
||||||
-1.0f);
|
|
||||||
glTexCoord1f(0.0f);
|
glTexCoord1f(0.0f);
|
||||||
glVertex3f(1.0f,
|
glVertex3f(1.0f, (SurfaceY - i * 2.0) / SurfaceY, -1.0f);
|
||||||
(SurfaceY - i * 2.0) / SurfaceY,
|
|
||||||
-1.0f);
|
|
||||||
glTexCoord1f(1.0f);
|
glTexCoord1f(1.0f);
|
||||||
glVertex3f(1.0f,
|
glVertex3f(1.0f, (SurfaceY - (i + 256) * 2.0) / SurfaceY, -1.0f);
|
||||||
(SurfaceY -
|
|
||||||
(i + 256) * 2.0) / SurfaceY, -1.0f);
|
|
||||||
glTexCoord1f(1.0f);
|
glTexCoord1f(1.0f);
|
||||||
glVertex3f(-1.0f,
|
glVertex3f(-1.0f, (SurfaceY - (i + 256) * 2.0) / SurfaceY, -1.0f);
|
||||||
(SurfaceY -
|
|
||||||
(i + 256) * 2.0) / SurfaceY, -1.0f);
|
|
||||||
glEnd();
|
glEnd();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -438,5 +412,5 @@ void gl_drawwin()
|
|||||||
glEnable(GL_TEXTURE_2D);
|
glEnable(GL_TEXTURE_2D);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
UnlockSurface();
|
SDL_GL_SwapBuffers();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user