mirror of
https://github.com/yquake2/yquake2remaster.git
synced 2024-11-10 07:12:07 +00:00
There's no need for the softrenderer to be build conditionally.
We want to build the softrenderer each time and on all platforms. Building it only at user request will lead to code rot.
This commit is contained in:
parent
1ed7762edd
commit
17f289c761
3 changed files with 38 additions and 86 deletions
|
@ -40,7 +40,6 @@ string(REPLACE "-O3" "-O2" CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE}")
|
|||
option(ZIP_SUPPORT "ZIP support" ON)
|
||||
option(OGG_SUPPORT "OGG Vorbis playback support (Music)" ON)
|
||||
option(OPENAL_SUPPORT "OpenAL support" ON)
|
||||
option(SOFTRENDERER_SUPPORT "Enabled the software renderer" ON)
|
||||
option(SYSTEMWIDE_SUPPORT "Enable systemwide installation of game assets" OFF)
|
||||
|
||||
# These variables will act as our list of include folders and linker flags
|
||||
|
@ -132,10 +131,6 @@ if(${OPENAL_SUPPORT})
|
|||
endif()
|
||||
endif()
|
||||
|
||||
if (${SOFTRENDERER_SUPPORT})
|
||||
add_definitions(-DREFSOFT)
|
||||
endif()
|
||||
|
||||
if(${CMAKE_SYSTEM_NAME} MATCHES "Windows")
|
||||
list(APPEND yquake2LinkerFlags "-lm -static-libgcc")
|
||||
else()
|
||||
|
@ -504,39 +499,37 @@ set(GL3-Header
|
|||
${COMMON_SRC_DIR}/header/shared.h
|
||||
)
|
||||
|
||||
if (${SOFTRENDERER_SUPPORT})
|
||||
set(SOFT-Source
|
||||
${REF_SRC_DIR}/soft/r_aclip.c
|
||||
${REF_SRC_DIR}/soft/r_alias.c
|
||||
${REF_SRC_DIR}/soft/r_bsp.c
|
||||
${REF_SRC_DIR}/soft/r_draw.c
|
||||
${REF_SRC_DIR}/soft/r_edge.c
|
||||
${REF_SRC_DIR}/soft/r_image.c
|
||||
${REF_SRC_DIR}/soft/r_light.c
|
||||
${REF_SRC_DIR}/soft/r_main.c
|
||||
${REF_SRC_DIR}/soft/r_misc.c
|
||||
${REF_SRC_DIR}/soft/r_model.c
|
||||
${REF_SRC_DIR}/soft/r_part.c
|
||||
${REF_SRC_DIR}/soft/r_poly.c
|
||||
${REF_SRC_DIR}/soft/r_polyse.c
|
||||
${REF_SRC_DIR}/soft/r_rast.c
|
||||
${REF_SRC_DIR}/soft/r_scan.c
|
||||
${REF_SRC_DIR}/soft/r_sprite.c
|
||||
${REF_SRC_DIR}/soft/r_surf.c
|
||||
${REF_SRC_DIR}/files/pcx.c
|
||||
${REF_SRC_DIR}/files/stb.c
|
||||
${REF_SRC_DIR}/files/wal.c
|
||||
${COMMON_SRC_DIR}/shared/shared.c
|
||||
${COMMON_SRC_DIR}/md4.c
|
||||
)
|
||||
set(SOFT-Source
|
||||
${REF_SRC_DIR}/soft/r_aclip.c
|
||||
${REF_SRC_DIR}/soft/r_alias.c
|
||||
${REF_SRC_DIR}/soft/r_bsp.c
|
||||
${REF_SRC_DIR}/soft/r_draw.c
|
||||
${REF_SRC_DIR}/soft/r_edge.c
|
||||
${REF_SRC_DIR}/soft/r_image.c
|
||||
${REF_SRC_DIR}/soft/r_light.c
|
||||
${REF_SRC_DIR}/soft/r_main.c
|
||||
${REF_SRC_DIR}/soft/r_misc.c
|
||||
${REF_SRC_DIR}/soft/r_model.c
|
||||
${REF_SRC_DIR}/soft/r_part.c
|
||||
${REF_SRC_DIR}/soft/r_poly.c
|
||||
${REF_SRC_DIR}/soft/r_polyse.c
|
||||
${REF_SRC_DIR}/soft/r_rast.c
|
||||
${REF_SRC_DIR}/soft/r_scan.c
|
||||
${REF_SRC_DIR}/soft/r_sprite.c
|
||||
${REF_SRC_DIR}/soft/r_surf.c
|
||||
${REF_SRC_DIR}/files/pcx.c
|
||||
${REF_SRC_DIR}/files/stb.c
|
||||
${REF_SRC_DIR}/files/wal.c
|
||||
${COMMON_SRC_DIR}/shared/shared.c
|
||||
${COMMON_SRC_DIR}/md4.c
|
||||
)
|
||||
|
||||
set(SOFT-Header
|
||||
${REF_SRC_DIR}/soft/header/adivtab.h
|
||||
${REF_SRC_DIR}/soft/header/local.h
|
||||
${REF_SRC_DIR}/soft/header/model.h
|
||||
${COMMON_SRC_DIR}/header/shared.h
|
||||
)
|
||||
endif ()
|
||||
set(SOFT-Header
|
||||
${REF_SRC_DIR}/soft/header/adivtab.h
|
||||
${REF_SRC_DIR}/soft/header/local.h
|
||||
${REF_SRC_DIR}/soft/header/model.h
|
||||
${COMMON_SRC_DIR}/header/shared.h
|
||||
)
|
||||
|
||||
# Main Quake 2 executable
|
||||
add_executable(quake2 ${Client-Source} ${Client-Header} ${Platform-Specific-Source}
|
||||
|
@ -595,13 +588,11 @@ set_target_properties(ref_gl3 PROPERTIES
|
|||
target_link_libraries(ref_gl3 ${yquake2LinkerFlags} ${yquake2SDLLinkerFlags})
|
||||
|
||||
# Build the soft renderer dynamic library
|
||||
if (${SOFTRENDERER_SUPPORT})
|
||||
add_library(ref_soft MODULE ${SOFT-Source} ${SOFT-Header} ${REF-Platform-Specific-Source})
|
||||
set_target_properties(ref_soft PROPERTIES
|
||||
PREFIX ""
|
||||
LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/release
|
||||
RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/release
|
||||
SUFFIX ${CMAKE_SHARED_LIBRARY_SUFFIX}
|
||||
)
|
||||
target_link_libraries(ref_soft ${yquake2LinkerFlags} ${yquake2SDLLinkerFlags})
|
||||
endif()
|
||||
add_library(ref_soft MODULE ${SOFT-Source} ${SOFT-Header} ${REF-Platform-Specific-Source})
|
||||
set_target_properties(ref_soft PROPERTIES
|
||||
PREFIX ""
|
||||
LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/release
|
||||
RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/release
|
||||
SUFFIX ${CMAKE_SHARED_LIBRARY_SUFFIX}
|
||||
)
|
||||
target_link_libraries(ref_soft ${yquake2LinkerFlags} ${yquake2SDLLinkerFlags})
|
||||
|
|
28
Makefile
28
Makefile
|
@ -27,9 +27,6 @@
|
|||
# User configurable options
|
||||
# -------------------------
|
||||
|
||||
# Build soft render
|
||||
WITH_REFSOFT:=yes
|
||||
|
||||
# Enables CD audio playback. CD audio playback is used
|
||||
# for the background music and doesn't add any further
|
||||
# dependencies. It should work on all platforms where
|
||||
|
@ -349,7 +346,6 @@ config:
|
|||
@echo "WITH_ZIP = $(WITH_ZIP)"
|
||||
@echo "WITH_SYSTEMWIDE = $(WITH_SYSTEMWIDE)"
|
||||
@echo "WITH_SYSTEMDIR = $(WITH_SYSTEMDIR)"
|
||||
@echo "WITH_REFSOFT = $(WITH_REFSOFT)"
|
||||
@echo "============================"
|
||||
@echo ""
|
||||
ifeq ($(WITH_SDL2),yes)
|
||||
|
@ -413,10 +409,6 @@ release/quake2.exe : CFLAGS += -DZIP -DNOUNCRYPT
|
|||
release/quake2.exe : LDFLAGS += -lz
|
||||
endif
|
||||
|
||||
ifeq ($(WITH_REFSOFT),yes)
|
||||
release/quake2.exe : CFLAGS += -DREFSOFT
|
||||
endif
|
||||
|
||||
ifeq ($(WITH_SDL2),yes)
|
||||
release/quake2.exe : CFLAGS += -DSDL2
|
||||
endif
|
||||
|
@ -482,10 +474,6 @@ ifeq ($(WITH_X11GAMMA),yes)
|
|||
release/quake2 : CFLAGS += -DX11GAMMA
|
||||
endif
|
||||
|
||||
ifeq ($(WITH_REFSOFT),yes)
|
||||
release/quake2 : CFLAGS += -DREFSOFT
|
||||
endif
|
||||
|
||||
ifeq ($(WITH_SDL2),yes)
|
||||
release/quake2 : CFLAGS += -DSDL2
|
||||
endif
|
||||
|
@ -667,14 +655,9 @@ build/ref_gl3/%.o: %.c
|
|||
|
||||
ifeq ($(YQ2_OSTYPE), Windows)
|
||||
|
||||
ifeq ($(WITH_REFSOFT),yes)
|
||||
ref_soft:
|
||||
@echo "===> Building ref_soft.dll"
|
||||
$(MAKE) release/ref_soft.dll
|
||||
else
|
||||
ref_soft:
|
||||
@echo "===> No soft render"
|
||||
endif
|
||||
|
||||
ifeq ($(WITH_SDL2),yes)
|
||||
release/ref_soft.dll : CFLAGS += -DSDL2
|
||||
|
@ -684,15 +667,9 @@ release/ref_soft.dll : LDFLAGS += -shared
|
|||
|
||||
else ifeq ($(YQ2_OSTYPE), Darwin)
|
||||
|
||||
ifeq ($(WITH_REFSOFT),yes)
|
||||
ref_soft:
|
||||
@echo "===> Building ref_soft.dylib"
|
||||
$(MAKE) release/ref_soft.dylib
|
||||
else
|
||||
ref_soft:
|
||||
@echo "===> No soft render"
|
||||
endif
|
||||
|
||||
|
||||
ifeq ($(WITH_SDL2),yes)
|
||||
release/ref_soft.dylib : CFLAGS += -DSDL2
|
||||
|
@ -702,14 +679,9 @@ release/ref_soft.dylib : LDFLAGS += -shared
|
|||
|
||||
else # not Windows or Darwin
|
||||
|
||||
ifeq ($(WITH_REFSOFT),yes)
|
||||
ref_soft:
|
||||
@echo "===> Building ref_soft.so"
|
||||
$(MAKE) release/ref_soft.so
|
||||
else
|
||||
ref_soft:
|
||||
@echo "===> No soft render"
|
||||
endif
|
||||
|
||||
release/ref_soft.so : CFLAGS += -fPIC
|
||||
release/ref_soft.so : LDFLAGS += -shared
|
||||
|
|
|
@ -73,7 +73,6 @@ GetRenderer(void)
|
|||
{
|
||||
return 1;
|
||||
}
|
||||
#ifdef REFSOFT
|
||||
else if (Q_stricmp(vid_renderer->string, "soft") == 0)
|
||||
{
|
||||
return 2;
|
||||
|
@ -82,12 +81,6 @@ GetRenderer(void)
|
|||
{
|
||||
return 3;
|
||||
}
|
||||
#else
|
||||
else
|
||||
{
|
||||
return 2;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
static int
|
||||
|
@ -168,13 +161,11 @@ ApplyChanges(void *unused)
|
|||
Cvar_Set("vid_renderer", "gl3");
|
||||
restart = true;
|
||||
}
|
||||
#ifdef REFSOFT
|
||||
else if (s_renderer_list.curvalue == 2)
|
||||
{
|
||||
Cvar_Set("vid_renderer", "soft");
|
||||
restart = true;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
/* custom mode */
|
||||
|
@ -250,9 +241,7 @@ VID_MenuInit(void)
|
|||
static const char *renderers[] = {
|
||||
"[OpenGL 1.4]",
|
||||
"[OpenGL 3.2]",
|
||||
#ifdef REFSOFT
|
||||
"[Software ]",
|
||||
#endif
|
||||
"[Custom ]",
|
||||
0
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue