mirror of
https://github.com/yquake2/yquake2remaster.git
synced 2024-11-29 07:41:47 +00:00
client: code style cleanup
This commit is contained in:
parent
27b41be951
commit
5d21429c36
3 changed files with 23 additions and 24 deletions
|
@ -65,7 +65,7 @@ option(CURL_SUPPORT "cURL support" ON)
|
||||||
option(OPENAL_SUPPORT "OpenAL support" ON)
|
option(OPENAL_SUPPORT "OpenAL support" ON)
|
||||||
option(SYSTEMWIDE_SUPPORT "Enable systemwide installation of game assets" OFF)
|
option(SYSTEMWIDE_SUPPORT "Enable systemwide installation of game assets" OFF)
|
||||||
option(SDL3_SUPPORT "Build against SDL 3 instead of SDL2" 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(GL3_RENDERER "Build the GL3 renderer" ON)
|
||||||
option(GLES1_RENDERER "Build the GLES1 renderer" OFF)
|
option(GLES1_RENDERER "Build the GLES1 renderer" OFF)
|
||||||
option(GLES3_RENDERER "Build the GLES3 renderer" ON)
|
option(GLES3_RENDERER "Build the GLES3 renderer" ON)
|
||||||
|
@ -169,10 +169,10 @@ unset(cpu)
|
||||||
|
|
||||||
# Systemwide installation of game assets.
|
# Systemwide installation of game assets.
|
||||||
if(${SYSTEMWIDE_SUPPORT})
|
if(${SYSTEMWIDE_SUPPORT})
|
||||||
add_definitions(-DSYSTEMWIDE)
|
add_definitions(-DSYSTEMWIDE)
|
||||||
if(NOT ${SYSTEMDIR} STREQUAL "")
|
if(NOT ${SYSTEMDIR} STREQUAL "")
|
||||||
add_definitions(-DSYSTEMDIR="${SYSTEMDIR}")
|
add_definitions(-DSYSTEMDIR="${SYSTEMDIR}")
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# We need to pass some options to minizip / unzip.
|
# We need to pass some options to minizip / unzip.
|
||||||
|
@ -195,11 +195,11 @@ else()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(GL1_RENDERER)
|
if(GL1_RENDERER)
|
||||||
# We need an OpenGL implementation.
|
# We need an OpenGL implementation.
|
||||||
set(OpenGL_GL_PREFERENCE GLVND)
|
set(OpenGL_GL_PREFERENCE GLVND)
|
||||||
find_package(OpenGL REQUIRED)
|
find_package(OpenGL REQUIRED)
|
||||||
list(APPEND yquake2IncludeDirectories ${OPENGL_INCLUDE_DIR})
|
list(APPEND yquake2IncludeDirectories ${OPENGL_INCLUDE_DIR})
|
||||||
list(APPEND yquake2OpenGLLinkerFlags ${OPENGL_LIBRARIES})
|
list(APPEND yquake2OpenGLLinkerFlags ${OPENGL_LIBRARIES})
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# backtrace lookup
|
# backtrace lookup
|
||||||
|
@ -260,7 +260,7 @@ else()
|
||||||
list(APPEND yquake2LinkerFlags "-rdynamic")
|
list(APPEND yquake2LinkerFlags "-rdynamic")
|
||||||
else()
|
else()
|
||||||
list(APPEND yquake2LinkerFlags "-lnetwork")
|
list(APPEND yquake2LinkerFlags "-lnetwork")
|
||||||
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
|
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
|
||||||
endif()
|
endif()
|
||||||
if (${CMAKE_SYSTEM_NAME} MATCHES "SunOS")
|
if (${CMAKE_SYSTEM_NAME} MATCHES "SunOS")
|
||||||
list(APPEND yquake2LinkerFlags "-lsocket -lnsl")
|
list(APPEND yquake2LinkerFlags "-lsocket -lnsl")
|
||||||
|
|
|
@ -1854,9 +1854,9 @@ GetRefAPI(refimport_t imp)
|
||||||
refexport.EndWorldRenderpass = RE_EndWorldRenderpass;
|
refexport.EndWorldRenderpass = RE_EndWorldRenderpass;
|
||||||
refexport.EndFrame = RE_EndFrame;
|
refexport.EndFrame = RE_EndFrame;
|
||||||
|
|
||||||
// Tell the client that we're unsing the
|
// Tell the client that we're unsing the
|
||||||
// new renderer restart API.
|
// new renderer restart API.
|
||||||
ri.Vid_RequestRestart(RESTART_NO);
|
ri.Vid_RequestRestart(RESTART_NO);
|
||||||
|
|
||||||
Swap_Init ();
|
Swap_Init ();
|
||||||
|
|
||||||
|
@ -1909,10 +1909,10 @@ RE_InitContext(void *win)
|
||||||
SDL_SetRenderVSync(renderer, 1);
|
SDL_SetRenderVSync(renderer, 1);
|
||||||
#else
|
#else
|
||||||
renderer = SDL_CreateRenderer(window, -1, SDL_RENDERER_ACCELERATED | SDL_RENDERER_PRESENTVSYNC);
|
renderer = SDL_CreateRenderer(window, -1, SDL_RENDERER_ACCELERATED | SDL_RENDERER_PRESENTVSYNC);
|
||||||
if(!renderer)
|
if(!renderer)
|
||||||
{
|
{
|
||||||
renderer = SDL_CreateRenderer(window, -1, SDL_RENDERER_SOFTWARE | SDL_RENDERER_PRESENTVSYNC);
|
renderer = SDL_CreateRenderer(window, -1, SDL_RENDERER_SOFTWARE | SDL_RENDERER_PRESENTVSYNC);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -1921,10 +1921,10 @@ RE_InitContext(void *win)
|
||||||
renderer = SDL_CreateRenderer(window, NULL);
|
renderer = SDL_CreateRenderer(window, NULL);
|
||||||
#else
|
#else
|
||||||
renderer = SDL_CreateRenderer(window, -1, SDL_RENDERER_ACCELERATED);
|
renderer = SDL_CreateRenderer(window, -1, SDL_RENDERER_ACCELERATED);
|
||||||
if(!renderer)
|
if(!renderer)
|
||||||
{
|
{
|
||||||
renderer = SDL_CreateRenderer(window, -1, SDL_RENDERER_SOFTWARE);
|
renderer = SDL_CreateRenderer(window, -1, SDL_RENDERER_SOFTWARE);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
if(!renderer) {
|
if(!renderer) {
|
||||||
|
|
|
@ -376,7 +376,7 @@ ShutdownGraphics(void)
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
SDL_GetWindowPosition(window,
|
SDL_GetWindowPosition(window,
|
||||||
&last_position_x, &last_position_y);
|
&last_position_x, &last_position_y);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* cleanly ungrab input (needs window) */
|
/* 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);
|
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))
|
if (!re.InitContext(window))
|
||||||
{
|
{
|
||||||
/* InitContext() should have logged an error. */
|
/* InitContext() should have logged an error. */
|
||||||
|
|
Loading…
Reference in a new issue