format pass

This commit is contained in:
2024-03-12 20:04:22 +11:00
parent c7b67c0bfd
commit 01a0dd932e

View File

@@ -111,8 +111,10 @@ void SetupWorld()
bool FlipSurface(SDL_Surface *surface) bool FlipSurface(SDL_Surface *surface)
{ {
if (!surface) return false; if (!surface || SDL_LockSurface(surface) < 0)
if (SDL_LockSurface(surface) < 0) return false; {
return false;
}
const int pitch = surface->pitch; const int pitch = surface->pitch;
const int numrows = surface->h; const int numrows = surface->h;
@@ -210,7 +212,7 @@ GLvoid ReSizeGLScene(GLsizei width, GLsizei height) // Resize And Initialize Th
glLoadIdentity(); // Reset The Modelview Matrix glLoadIdentity(); // Reset The Modelview Matrix
} }
int InitGL(GLvoid) // All Setup For OpenGL Goes Here int InitGL() // All Setup For OpenGL Goes Here
{ {
if (!LoadGLTextures()) // Jump To Texture Loading Routine if (!LoadGLTextures()) // Jump To Texture Loading Routine
{ {
@@ -231,7 +233,7 @@ int InitGL(GLvoid) // All Setup For OpenGL Goes Here
return 1; // Initialization Went OK return 1; // Initialization Went OK
} }
int DrawGLScene(GLvoid) // Here's Where We Do All The Drawing int DrawGLScene() // Here's Where We Do All The Drawing
{ {
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); // Clear The Screen And The Depth Buffer glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); // Clear The Screen And The Depth Buffer
glLoadIdentity(); // Reset The View glLoadIdentity(); // Reset The View
@@ -244,8 +246,8 @@ int DrawGLScene(GLvoid) // Here's Where We Do All The Drawing
int numtriangles; int numtriangles;
glRotatef(lookupdown,1.0f,0,0); glRotatef(lookupdown, 1.0f, 0.0f, 0.0f);
glRotatef(sceneroty,0,1.0f,0); glRotatef(sceneroty, 0.0f, 1.0f, 0.0f);
glTranslatef(xtrans, ytrans, ztrans); glTranslatef(xtrans, ytrans, ztrans);
glBindTexture(GL_TEXTURE_2D, texture[filter]); glBindTexture(GL_TEXTURE_2D, texture[filter]);
@@ -282,7 +284,7 @@ int DrawGLScene(GLvoid) // Here's Where We Do All The Drawing
return 1; // Everything Went OK return 1; // Everything Went OK
} }
GLvoid KillGLWindow(GLvoid) // Properly Kill The Window GLvoid KillGLWindow() // Properly Kill The Window
{ {
if (fullscreen) // Are We In Fullscreen Mode? if (fullscreen) // Are We In Fullscreen Mode?
{ {