Rename RENDERER and AUDIO_BACKEND

Now they're BACKEND_RENDERER and BACKEND_AUDIO
This commit is contained in:
Clownacy 2020-02-29 18:33:32 +00:00
parent 72672e142d
commit 156c01e672
3 changed files with 38 additions and 38 deletions

View file

@ -13,8 +13,8 @@ set(ASSETS_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/assets")
option(JAPANESE "Enable the Japanese-language build (instead of the unofficial Aeon Genesis English translation)" OFF) option(JAPANESE "Enable the Japanese-language build (instead of the unofficial Aeon Genesis English translation)" OFF)
option(FIX_BUGS "Fix various bugs in the game" OFF) option(FIX_BUGS "Fix various bugs in the game" OFF)
option(DEBUG_SAVE "Re-enable the ability to drag-and-drop save files onto the window" OFF) option(DEBUG_SAVE "Re-enable the ability to drag-and-drop save files onto the window" OFF)
set(RENDERER "SDLTexture" CACHE STRING "Which renderer the game should use: 'OpenGL3' for an OpenGL 3.2 renderer, 'OpenGLES2' for an OpenGL ES 2.0 renderer, 'SDLTexture' for SDL2's hardware-accelerated Texture API, 'SDLSurface' for SDL2's software-rendered Surface API, or 'Software' for a handwritten software renderer") set(BACKEND_RENDERER "SDLTexture" CACHE STRING "Which renderer the game should use: 'OpenGL3' for an OpenGL 3.2 renderer, 'OpenGLES2' for an OpenGL ES 2.0 renderer, 'SDLTexture' for SDL2's hardware-accelerated Texture API, 'SDLSurface' for SDL2's software-rendered Surface API, or 'Software' for a handwritten software renderer")
set(AUDIO_BACKEND "SDL2" CACHE STRING "Which audio backend the game should use: 'SDL2' or 'miniaudio'") set(BACKEND_AUDIO "SDL2" CACHE STRING "Which audio backend the game should use: 'SDL2' or 'miniaudio'")
option(LTO "Enable link-time optimisation" OFF) option(LTO "Enable link-time optimisation" OFF)
option(NATIVE_OPTIMIZATIONS "Enable processor-specific optimisations (executable might not work on other architectures) (GCC-compatible compilers only)" OFF) option(NATIVE_OPTIMIZATIONS "Enable processor-specific optimisations (executable might not work on other architectures) (GCC-compatible compilers only)" OFF)
@ -346,23 +346,23 @@ if(WARNINGS_FATAL)
endif() endif()
endif() endif()
if(RENDERER MATCHES "OpenGL3") if(BACKEND_RENDERER MATCHES "OpenGL3")
target_sources(CSE2 PRIVATE "src/Backends/Rendering/OpenGL3.cpp") target_sources(CSE2 PRIVATE "src/Backends/Rendering/OpenGL3.cpp")
elseif(RENDERER MATCHES "OpenGLES2") elseif(BACKEND_RENDERER MATCHES "OpenGLES2")
target_sources(CSE2 PRIVATE "src/Backends/Rendering/OpenGLES2.cpp") target_sources(CSE2 PRIVATE "src/Backends/Rendering/OpenGLES2.cpp")
elseif(RENDERER MATCHES "SDLTexture") elseif(BACKEND_RENDERER MATCHES "SDLTexture")
target_sources(CSE2 PRIVATE "src/Backends/Rendering/SDLTexture.cpp") target_sources(CSE2 PRIVATE "src/Backends/Rendering/SDLTexture.cpp")
elseif(RENDERER MATCHES "SDLSurface") elseif(BACKEND_RENDERER MATCHES "SDLSurface")
target_sources(CSE2 PRIVATE "src/Backends/Rendering/SDLSurface.cpp") target_sources(CSE2 PRIVATE "src/Backends/Rendering/SDLSurface.cpp")
elseif(RENDERER MATCHES "Software") elseif(BACKEND_RENDERER MATCHES "Software")
target_sources(CSE2 PRIVATE "src/Backends/Rendering/Software.cpp") target_sources(CSE2 PRIVATE "src/Backends/Rendering/Software.cpp")
else() else()
message(FATAL_ERROR "Invalid RENDERER selected") message(FATAL_ERROR "Invalid BACKEND_RENDERER selected")
endif() endif()
if(AUDIO_BACKEND MATCHES "SDL2") if(BACKEND_AUDIO MATCHES "SDL2")
target_sources(CSE2 PRIVATE "src/Backends/Audio/SDL2.cpp") target_sources(CSE2 PRIVATE "src/Backends/Audio/SDL2.cpp")
elseif(AUDIO_BACKEND MATCHES "miniaudio") elseif(BACKEND_AUDIO MATCHES "miniaudio")
target_sources(CSE2 PRIVATE "src/Backends/Audio/miniaudio.cpp") target_sources(CSE2 PRIVATE "src/Backends/Audio/miniaudio.cpp")
# Link libdl, libm, and libpthread # Link libdl, libm, and libpthread
@ -380,7 +380,7 @@ elseif(AUDIO_BACKEND MATCHES "miniaudio")
target_link_libraries(CSE2 PRIVATE ${CMAKE_DL_LIBS}) target_link_libraries(CSE2 PRIVATE ${CMAKE_DL_LIBS})
else() else()
message(FATAL_ERROR "Invalid AUDIO_BACKEND selected") message(FATAL_ERROR "Invalid BACKEND_AUDIO selected")
endif() endif()
# Make some tweaks if we're targetting Windows # Make some tweaks if we're targetting Windows
@ -545,7 +545,7 @@ else()
target_link_libraries(CSE2 PRIVATE freetype) target_link_libraries(CSE2 PRIVATE freetype)
endif() endif()
if(RENDERER MATCHES "OpenGL3") if(BACKEND_RENDERER MATCHES "OpenGL3")
target_sources(CSE2 PRIVATE "external/glad/src/glad.c" "external/glad/include/glad/glad.h" "external/glad/include/KHR/khrplatform.h") target_sources(CSE2 PRIVATE "external/glad/src/glad.c" "external/glad/include/glad/glad.h" "external/glad/include/KHR/khrplatform.h")
target_include_directories(CSE2 PRIVATE "external/glad/include") target_include_directories(CSE2 PRIVATE "external/glad/include")
@ -553,7 +553,7 @@ if(RENDERER MATCHES "OpenGL3")
target_link_libraries(CSE2 PRIVATE OpenGL::GL ${CMAKE_DL_LIBS}) target_link_libraries(CSE2 PRIVATE OpenGL::GL ${CMAKE_DL_LIBS})
endif() endif()
if(RENDERER MATCHES "OpenGLES2") if(BACKEND_RENDERER MATCHES "OpenGLES2")
find_package(OpenGLES2 REQUIRED) find_package(OpenGLES2 REQUIRED)
target_include_directories(CSE2 PRIVATE ${OPENGLES2_INCLUDE_DIR}) target_include_directories(CSE2 PRIVATE ${OPENGLES2_INCLUDE_DIR})
target_link_libraries(CSE2 PRIVATE ${OPENGLES2_LIBRARIES}) target_link_libraries(CSE2 PRIVATE ${OPENGLES2_LIBRARIES})

View file

@ -6,8 +6,8 @@ PKGCONFIG ?= pkg-config
ASSETS_DIRECTORY = assets ASSETS_DIRECTORY = assets
# Default options # Default options
RENDERER = SDLTexture BACKEND_RENDERER = SDLTexture
AUDIO_BACKEND = SDL2 BACKEND_AUDIO = SDL2
ALL_CFLAGS = $(CFLAGS) ALL_CFLAGS = $(CFLAGS)
ALL_CXXFLAGS = $(CXXFLAGS) ALL_CXXFLAGS = $(CXXFLAGS)
@ -246,7 +246,7 @@ ifneq ($(WINDOWS), 1)
RESOURCES += ICON/ICON_MINI.bmp RESOURCES += ICON/ICON_MINI.bmp
endif endif
ifeq ($(RENDERER), OpenGL3) ifeq ($(BACKEND_RENDERER), OpenGL3)
SOURCES += src/Backends/Rendering/OpenGL3.cpp external/glad/src/glad.c SOURCES += src/Backends/Rendering/OpenGL3.cpp external/glad/src/glad.c
CSE2_CFLAGS += -Iexternal/glad/include CSE2_CFLAGS += -Iexternal/glad/include
CSE2_CXXFLAGS += -Iexternal/glad/include CSE2_CXXFLAGS += -Iexternal/glad/include
@ -256,28 +256,28 @@ ifeq ($(RENDERER), OpenGL3)
else else
CSE2_LIBS += -lGL -ldl CSE2_LIBS += -lGL -ldl
endif endif
else ifeq ($(RENDERER), OpenGLES2) else ifeq ($(BACKEND_RENDERER), OpenGLES2)
SOURCES += src/Backends/Rendering/OpenGLES2.cpp SOURCES += src/Backends/Rendering/OpenGLES2.cpp
CSE2_CFLAGS += $(shell $(PKGCONFIG) --cflags glesv2) CSE2_CFLAGS += $(shell $(PKGCONFIG) --cflags glesv2)
CSE2_CXXFLAGS += $(shell $(PKGCONFIG) --cflags glesv2) CSE2_CXXFLAGS += $(shell $(PKGCONFIG) --cflags glesv2)
CSE2_LIBS += $(shell $(PKGCONFIG) --libs glesv2) CSE2_LIBS += $(shell $(PKGCONFIG) --libs glesv2)
else ifeq ($(RENDERER), SDLTexture) else ifeq ($(BACKEND_RENDERER), SDLTexture)
SOURCES += src/Backends/Rendering/SDLTexture.cpp SOURCES += src/Backends/Rendering/SDLTexture.cpp
else ifeq ($(RENDERER), SDLSurface) else ifeq ($(BACKEND_RENDERER), SDLSurface)
SOURCES += src/Backends/Rendering/SDLSurface.cpp SOURCES += src/Backends/Rendering/SDLSurface.cpp
else ifeq ($(RENDERER), Software) else ifeq ($(BACKEND_RENDERER), Software)
SOURCES += src/Backends/Rendering/Software.cpp SOURCES += src/Backends/Rendering/Software.cpp
else else
$(error Invalid RENDERER selected) $(error Invalid BACKEND_RENDERER selected)
endif endif
ifeq ($(AUDIO_BACKEND), SDL2) ifeq ($(BACKEND_AUDIO), SDL2)
SOURCES += src/Backends/Audio/SDL2.cpp SOURCES += src/Backends/Audio/SDL2.cpp
else ifeq ($(AUDIO_BACKEND), miniaudio) else ifeq ($(BACKEND_AUDIO), miniaudio)
SOURCES += src/Backends/Audio/miniaudio.cpp SOURCES += src/Backends/Audio/miniaudio.cpp
CSE2_LIBS += -ldl -lm -lpthread CSE2_LIBS += -ldl -lm -lpthread
else else
$(error Invalid AUDIO_BACKEND selected) $(error Invalid BACKEND_AUDIO selected)
endif endif
OBJECTS = $(addprefix obj/$(FILENAME)/, $(addsuffix .o, $(SOURCES))) OBJECTS = $(addprefix obj/$(FILENAME)/, $(addsuffix .o, $(SOURCES)))

View file

@ -65,13 +65,13 @@ Name | Function
`-DJAPANESE=ON` | Enable the Japanese-language build (instead of the unofficial Aeon Genesis English translation) `-DJAPANESE=ON` | Enable the Japanese-language build (instead of the unofficial Aeon Genesis English translation)
`-DFIX_BUGS=ON` | Fix various bugs in the game `-DFIX_BUGS=ON` | Fix various bugs in the game
`-DDEBUG_SAVE=ON` | Re-enable the ability to drag-and-drop save files onto the window `-DDEBUG_SAVE=ON` | Re-enable the ability to drag-and-drop save files onto the window
`-DRENDERER=OpenGL3` | Use the hardware-accelerated OpenGL 3.2 renderer `-DBACKEND_RENDERER=OpenGL3` | Use the hardware-accelerated OpenGL 3.2 renderer
`-DRENDERER=OpenGLES2` | Use the hardware-accelerated OpenGL ES 2.0 renderer `-DBACKEND_RENDERER=OpenGLES2` | Use the hardware-accelerated OpenGL ES 2.0 renderer
`-DRENDERER=SDLTexture` | Use the hardware-accelerated SDL2 Texture API renderer (default) `-DBACKEND_RENDERER=SDLTexture` | Use the hardware-accelerated SDL2 Texture API renderer (default)
`-DRENDERER=SDLSurface` | Use the software-rendered SDL2 Surface API renderer `-DBACKEND_RENDERER=SDLSurface` | Use the software-rendered SDL2 Surface API renderer
`-DRENDERER=Software` | Use the handwritten software renderer `-DBACKEND_RENDERER=Software` | Use the handwritten software renderer
`-DAUDIO_BACKEND=SDL2` | Use the SDL2-driven software audio-mixer `-DBACKEND_AUDIO=SDL2` | Use the SDL2-driven software audio-mixer
`-DAUDIO_BACKEND=miniaudio` | Use the miniaudio-driven software audio-mixer `-DBACKEND_AUDIO=miniaudio` | Use the miniaudio-driven software audio-mixer
`-DWARNINGS=ON` | Enable common compiler warnings (for GCC-compatible compilers and MSVC only) `-DWARNINGS=ON` | Enable common compiler warnings (for GCC-compatible compilers and MSVC only)
`-DWARNINGS_ALL=ON` | Enable ALL compiler warnings (for Clang and MSVC only) `-DWARNINGS_ALL=ON` | Enable ALL compiler warnings (for Clang and MSVC only)
`-DWARNINGS_FATAL=ON` | Stop compilation on any compiler warning (for GCC-compatible compilers and MSVC only) `-DWARNINGS_FATAL=ON` | Stop compilation on any compiler warning (for GCC-compatible compilers and MSVC only)
@ -103,13 +103,13 @@ Name | Function
`FIX_BUGS=1` | Fix various bugs in the game `FIX_BUGS=1` | Fix various bugs in the game
`WINDOWS=1` | Build for Windows `WINDOWS=1` | Build for Windows
`DEBUG_SAVE=1` | Re-enable the ability to drag-and-drop save files onto the window `DEBUG_SAVE=1` | Re-enable the ability to drag-and-drop save files onto the window
`RENDERER=OpenGL3` | Use the hardware-accelerated OpenGL 3.2 renderer `BACKEND_RENDERER=OpenGL3` | Use the hardware-accelerated OpenGL 3.2 renderer
`RENDERER=OpenGLES2` | Use the hardware-accelerated OpenGL ES 2.0 renderer `BACKEND_RENDERER=OpenGLES2` | Use the hardware-accelerated OpenGL ES 2.0 renderer
`RENDERER=SDLTexture` | Use the hardware-accelerated SDL2 Texture API renderer (default) `BACKEND_RENDERER=SDLTexture` | Use the hardware-accelerated SDL2 Texture API renderer (default)
`RENDERER=SDLSurface` | Use the software-rendered SDL2 Surface API renderer `BACKEND_RENDERER=SDLSurface` | Use the software-rendered SDL2 Surface API renderer
`RENDERER=Software` | Use the hand-written software renderer `BACKEND_RENDERER=Software` | Use the hand-written software renderer
`AUDIO_BACKEND=SDL2` | Use the SDL2-driven software audio-mixer `BACKEND_AUDIO=SDL2` | Use the SDL2-driven software audio-mixer
`AUDIO_BACKEND=miniaudio` | Use the miniaudio-driven software audio-mixer `BACKEND_AUDIO=miniaudio` | Use the miniaudio-driven software audio-mixer
`WARNINGS=1` | Enable common compiler warnings `WARNINGS=1` | Enable common compiler warnings
`WARNINGS_ALL=1` | Enable ALL compiler warnings (Clang only) `WARNINGS_ALL=1` | Enable ALL compiler warnings (Clang only)
`WARNINGS_FATAL=1` | Make all compiler warnings errors `WARNINGS_FATAL=1` | Make all compiler warnings errors