Minor structural changes to OpenGL code, still functionally equivilent

This commit is contained in:
theoddone33
2001-05-30 04:12:19 +00:00
parent f1d8a4a98f
commit d734e32e74

View File

@@ -608,10 +608,12 @@ DWORD LockSurface(void)
if (!UseOpenGL) { if (!UseOpenGL) {
#endif #endif
SurfBuf = surface->pixels; SurfBuf = surface->pixels;
return(surface->pitch);
#ifdef __OPENGL__ #ifdef __OPENGL__
} else {
return (512);
} }
#endif #endif
return(surface->pitch);
} }
void UnlockSurface(void) void UnlockSurface(void)
@@ -622,6 +624,8 @@ void UnlockSurface(void)
#endif #endif
SDL_Flip(surface); SDL_Flip(surface);
#ifdef __OPENGL__ #ifdef __OPENGL__
} else {
SDL_GL_SwapBuffers();
} }
#endif #endif
} }
@@ -1141,6 +1145,9 @@ void drawscreenwin(void)
UpdateVFrame(); UpdateVFrame();
if(curblank!=0) return; if(curblank!=0) return;
Temp1=LockSurface();
if(Temp1==0) { return; }
#ifdef __OPENGL__ #ifdef __OPENGL__
if (UseOpenGL) { if (UseOpenGL) {
@@ -1174,14 +1181,9 @@ void drawscreenwin(void)
glTexCoord2f(0.0f, 2.240/2.560); glVertex3f(-ratiox, -1.0f, -1.0f); glTexCoord2f(0.0f, 2.240/2.560); glVertex3f(-ratiox, -1.0f, -1.0f);
glEnd(); glEnd();
SDL_GL_SwapBuffers();
} else { } else {
#endif #endif
Temp1=LockSurface();
if(Temp1==0) { return; }
ScreenPtr=vidbuffer; ScreenPtr=vidbuffer;
ScreenPtr+=16*2+32*2+256*2; ScreenPtr+=16*2+32*2+256*2;
SurfBufD=(DWORD) &SurfBuf[0]; SurfBufD=(DWORD) &SurfBuf[0];
@@ -1628,10 +1630,10 @@ void drawscreenwin(void)
} }
} }
UnlockSurface();
#ifdef __OPENGL__ #ifdef __OPENGL__
} }
#endif #endif
UnlockSurface();
} }
extern char fulladdtab[65536*2]; extern char fulladdtab[65536*2];