client: code style cleanup

This commit is contained in:
Denis Pauk 2024-11-24 23:01:09 +02:00
parent 27b41be951
commit 5d21429c36
3 changed files with 23 additions and 24 deletions

View file

@ -65,7 +65,7 @@ option(CURL_SUPPORT "cURL support" ON)
option(OPENAL_SUPPORT "OpenAL support" ON)
option(SYSTEMWIDE_SUPPORT "Enable systemwide installation of game assets" OFF)
option(SDL3_SUPPORT "Build against SDL 3 instead of SDL2" OFF)
option(GL1_RENDERER "Build the GL3 renderer" ON)
option(GL1_RENDERER "Build the GL1 renderer" ON)
option(GL3_RENDERER "Build the GL3 renderer" ON)
option(GLES1_RENDERER "Build the GLES1 renderer" OFF)
option(GLES3_RENDERER "Build the GLES3 renderer" ON)
@ -169,10 +169,10 @@ unset(cpu)
# Systemwide installation of game assets.
if(${SYSTEMWIDE_SUPPORT})
add_definitions(-DSYSTEMWIDE)
if(NOT ${SYSTEMDIR} STREQUAL "")
add_definitions(-DSYSTEMDIR="${SYSTEMDIR}")
endif()
add_definitions(-DSYSTEMWIDE)
if(NOT ${SYSTEMDIR} STREQUAL "")
add_definitions(-DSYSTEMDIR="${SYSTEMDIR}")
endif()
endif()
# We need to pass some options to minizip / unzip.
@ -195,11 +195,11 @@ else()
endif()
if(GL1_RENDERER)
# We need an OpenGL implementation.
set(OpenGL_GL_PREFERENCE GLVND)
find_package(OpenGL REQUIRED)
list(APPEND yquake2IncludeDirectories ${OPENGL_INCLUDE_DIR})
list(APPEND yquake2OpenGLLinkerFlags ${OPENGL_LIBRARIES})
# We need an OpenGL implementation.
set(OpenGL_GL_PREFERENCE GLVND)
find_package(OpenGL REQUIRED)
list(APPEND yquake2IncludeDirectories ${OPENGL_INCLUDE_DIR})
list(APPEND yquake2OpenGLLinkerFlags ${OPENGL_LIBRARIES})
endif()
# backtrace lookup
@ -260,7 +260,7 @@ else()
list(APPEND yquake2LinkerFlags "-rdynamic")
else()
list(APPEND yquake2LinkerFlags "-lnetwork")
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
endif()
if (${CMAKE_SYSTEM_NAME} MATCHES "SunOS")
list(APPEND yquake2LinkerFlags "-lsocket -lnsl")

View file

@ -1854,9 +1854,9 @@ GetRefAPI(refimport_t imp)
refexport.EndWorldRenderpass = RE_EndWorldRenderpass;
refexport.EndFrame = RE_EndFrame;
// Tell the client that we're unsing the
// Tell the client that we're unsing the
// new renderer restart API.
ri.Vid_RequestRestart(RESTART_NO);
ri.Vid_RequestRestart(RESTART_NO);
Swap_Init ();
@ -1909,10 +1909,10 @@ RE_InitContext(void *win)
SDL_SetRenderVSync(renderer, 1);
#else
renderer = SDL_CreateRenderer(window, -1, SDL_RENDERER_ACCELERATED | SDL_RENDERER_PRESENTVSYNC);
if(!renderer)
{
renderer = SDL_CreateRenderer(window, -1, SDL_RENDERER_SOFTWARE | SDL_RENDERER_PRESENTVSYNC);
}
if(!renderer)
{
renderer = SDL_CreateRenderer(window, -1, SDL_RENDERER_SOFTWARE | SDL_RENDERER_PRESENTVSYNC);
}
#endif
}
else
@ -1921,10 +1921,10 @@ RE_InitContext(void *win)
renderer = SDL_CreateRenderer(window, NULL);
#else
renderer = SDL_CreateRenderer(window, -1, SDL_RENDERER_ACCELERATED);
if(!renderer)
{
renderer = SDL_CreateRenderer(window, -1, SDL_RENDERER_SOFTWARE);
}
if(!renderer)
{
renderer = SDL_CreateRenderer(window, -1, SDL_RENDERER_SOFTWARE);
}
#endif
}
if(!renderer) {

View file

@ -376,7 +376,7 @@ ShutdownGraphics(void)
}
else {
SDL_GetWindowPosition(window,
&last_position_x, &last_position_y);
&last_position_x, &last_position_y);
}
/* cleanly ungrab input (needs window) */
@ -640,8 +640,7 @@ GLimp_InitGraphics(int fullscreen, int *pwidth, int *pheight)
Com_Printf("Real display mode: %ix%i@%i\n", mode.w, mode.h, mode.refresh_rate);
}
/* Initialize rendering context. */
/* Initialize rendering context. */
if (!re.InitContext(window))
{
/* InitContext() should have logged an error. */