Surface locking fix [zinx]

This commit is contained in:
hpsolo
2001-06-04 23:09:41 +00:00
parent 9a4681fdad
commit 2b329a6e53

View File

@@ -60,7 +60,6 @@ int gl_start(int width, int height, int req_depth, int FullScreen)
}
gl_clearwin();
SurfaceLocking = SDL_MUSTLOCK(surface);
SDL_WarpMouse(SurfaceX / 4, SurfaceY / 4);
// Grab mouse in fullscreen mode
@@ -110,19 +109,6 @@ void gl_end()
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 NumBytesPerLine;
extern unsigned char *WinVidMemStart;
@@ -262,8 +248,6 @@ void gl_drawwin()
if (curblank != 0)
return;
LockSurface();
if (BilinearFilter)
{
glfilters = GL_LINEAR;
@@ -275,8 +259,6 @@ void gl_drawwin()
glfilters = GL_NEAREST;
}
glLoadIdentity();
if (En2xSaI)
{
/* We have to use copy640x480x16bwin for 2xSaI */
@@ -416,21 +398,13 @@ void gl_drawwin()
{
glBegin(GL_QUADS);
glTexCoord1f(0.0f);
glVertex3f(-1.0f,
(SurfaceY - i * 2.0) / SurfaceY,
-1.0f);
glVertex3f(-1.0f, (SurfaceY - i * 2.0) / SurfaceY, -1.0f);
glTexCoord1f(0.0f);
glVertex3f(1.0f,
(SurfaceY - i * 2.0) / SurfaceY,
-1.0f);
glVertex3f(1.0f, (SurfaceY - i * 2.0) / SurfaceY, -1.0f);
glTexCoord1f(1.0f);
glVertex3f(1.0f,
(SurfaceY -
(i + 256) * 2.0) / SurfaceY, -1.0f);
glVertex3f(1.0f, (SurfaceY - (i + 256) * 2.0) / SurfaceY, -1.0f);
glTexCoord1f(1.0f);
glVertex3f(-1.0f,
(SurfaceY -
(i + 256) * 2.0) / SurfaceY, -1.0f);
glVertex3f(-1.0f, (SurfaceY - (i + 256) * 2.0) / SurfaceY, -1.0f);
glEnd();
}
@@ -438,5 +412,5 @@ void gl_drawwin()
glEnable(GL_TEXTURE_2D);
}
}
UnlockSurface();
SDL_GL_SwapBuffers();
}