diff --git a/CMakeLists.txt b/CMakeLists.txt index dffeb34f..f3b334f4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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(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) -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(AUDIO_BACKEND "SDL2" CACHE STRING "Which audio backend the game should use: 'SDL2' or 'miniaudio'") +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(BACKEND_AUDIO "SDL2" CACHE STRING "Which audio backend the game should use: 'SDL2' or 'miniaudio'") 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) @@ -346,23 +346,23 @@ if(WARNINGS_FATAL) endif() endif() -if(RENDERER MATCHES "OpenGL3") +if(BACKEND_RENDERER MATCHES "OpenGL3") 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") -elseif(RENDERER MATCHES "SDLTexture") +elseif(BACKEND_RENDERER MATCHES "SDLTexture") 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") -elseif(RENDERER MATCHES "Software") +elseif(BACKEND_RENDERER MATCHES "Software") target_sources(CSE2 PRIVATE "src/Backends/Rendering/Software.cpp") else() - message(FATAL_ERROR "Invalid RENDERER selected") + message(FATAL_ERROR "Invalid BACKEND_RENDERER selected") endif() -if(AUDIO_BACKEND MATCHES "SDL2") +if(BACKEND_AUDIO MATCHES "SDL2") 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") # Link libdl, libm, and libpthread @@ -380,7 +380,7 @@ elseif(AUDIO_BACKEND MATCHES "miniaudio") target_link_libraries(CSE2 PRIVATE ${CMAKE_DL_LIBS}) else() - message(FATAL_ERROR "Invalid AUDIO_BACKEND selected") + message(FATAL_ERROR "Invalid BACKEND_AUDIO selected") endif() # Make some tweaks if we're targetting Windows @@ -545,7 +545,7 @@ else() target_link_libraries(CSE2 PRIVATE freetype) 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_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}) endif() -if(RENDERER MATCHES "OpenGLES2") +if(BACKEND_RENDERER MATCHES "OpenGLES2") find_package(OpenGLES2 REQUIRED) target_include_directories(CSE2 PRIVATE ${OPENGLES2_INCLUDE_DIR}) target_link_libraries(CSE2 PRIVATE ${OPENGLES2_LIBRARIES}) diff --git a/Makefile b/Makefile index e3cd4d7c..4879216c 100644 --- a/Makefile +++ b/Makefile @@ -6,8 +6,8 @@ PKGCONFIG ?= pkg-config ASSETS_DIRECTORY = assets # Default options -RENDERER = SDLTexture -AUDIO_BACKEND = SDL2 +BACKEND_RENDERER = SDLTexture +BACKEND_AUDIO = SDL2 ALL_CFLAGS = $(CFLAGS) ALL_CXXFLAGS = $(CXXFLAGS) @@ -246,7 +246,7 @@ ifneq ($(WINDOWS), 1) RESOURCES += ICON/ICON_MINI.bmp endif -ifeq ($(RENDERER), OpenGL3) +ifeq ($(BACKEND_RENDERER), OpenGL3) SOURCES += src/Backends/Rendering/OpenGL3.cpp external/glad/src/glad.c CSE2_CFLAGS += -Iexternal/glad/include CSE2_CXXFLAGS += -Iexternal/glad/include @@ -256,28 +256,28 @@ ifeq ($(RENDERER), OpenGL3) else CSE2_LIBS += -lGL -ldl endif -else ifeq ($(RENDERER), OpenGLES2) +else ifeq ($(BACKEND_RENDERER), OpenGLES2) SOURCES += src/Backends/Rendering/OpenGLES2.cpp CSE2_CFLAGS += $(shell $(PKGCONFIG) --cflags glesv2) CSE2_CXXFLAGS += $(shell $(PKGCONFIG) --cflags glesv2) CSE2_LIBS += $(shell $(PKGCONFIG) --libs glesv2) -else ifeq ($(RENDERER), SDLTexture) +else ifeq ($(BACKEND_RENDERER), SDLTexture) SOURCES += src/Backends/Rendering/SDLTexture.cpp -else ifeq ($(RENDERER), SDLSurface) +else ifeq ($(BACKEND_RENDERER), SDLSurface) SOURCES += src/Backends/Rendering/SDLSurface.cpp -else ifeq ($(RENDERER), Software) +else ifeq ($(BACKEND_RENDERER), Software) SOURCES += src/Backends/Rendering/Software.cpp else - $(error Invalid RENDERER selected) + $(error Invalid BACKEND_RENDERER selected) endif -ifeq ($(AUDIO_BACKEND), SDL2) +ifeq ($(BACKEND_AUDIO), SDL2) SOURCES += src/Backends/Audio/SDL2.cpp -else ifeq ($(AUDIO_BACKEND), miniaudio) +else ifeq ($(BACKEND_AUDIO), miniaudio) SOURCES += src/Backends/Audio/miniaudio.cpp CSE2_LIBS += -ldl -lm -lpthread else - $(error Invalid AUDIO_BACKEND selected) + $(error Invalid BACKEND_AUDIO selected) endif OBJECTS = $(addprefix obj/$(FILENAME)/, $(addsuffix .o, $(SOURCES))) diff --git a/README.md b/README.md index 7b19297b..fdb1acb7 100644 --- a/README.md +++ b/README.md @@ -65,13 +65,13 @@ Name | Function `-DJAPANESE=ON` | Enable the Japanese-language build (instead of the unofficial Aeon Genesis English translation) `-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 -`-DRENDERER=OpenGL3` | Use the hardware-accelerated OpenGL 3.2 renderer -`-DRENDERER=OpenGLES2` | Use the hardware-accelerated OpenGL ES 2.0 renderer -`-DRENDERER=SDLTexture` | Use the hardware-accelerated SDL2 Texture API renderer (default) -`-DRENDERER=SDLSurface` | Use the software-rendered SDL2 Surface API renderer -`-DRENDERER=Software` | Use the handwritten software renderer -`-DAUDIO_BACKEND=SDL2` | Use the SDL2-driven software audio-mixer -`-DAUDIO_BACKEND=miniaudio` | Use the miniaudio-driven software audio-mixer +`-DBACKEND_RENDERER=OpenGL3` | Use the hardware-accelerated OpenGL 3.2 renderer +`-DBACKEND_RENDERER=OpenGLES2` | Use the hardware-accelerated OpenGL ES 2.0 renderer +`-DBACKEND_RENDERER=SDLTexture` | Use the hardware-accelerated SDL2 Texture API renderer (default) +`-DBACKEND_RENDERER=SDLSurface` | Use the software-rendered SDL2 Surface API renderer +`-DBACKEND_RENDERER=Software` | Use the handwritten software renderer +`-DBACKEND_AUDIO=SDL2` | Use the SDL2-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_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) @@ -103,13 +103,13 @@ Name | Function `FIX_BUGS=1` | Fix various bugs in the game `WINDOWS=1` | Build for Windows `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 -`RENDERER=OpenGLES2` | Use the hardware-accelerated OpenGL ES 2.0 renderer -`RENDERER=SDLTexture` | Use the hardware-accelerated SDL2 Texture API renderer (default) -`RENDERER=SDLSurface` | Use the software-rendered SDL2 Surface API renderer -`RENDERER=Software` | Use the hand-written software renderer -`AUDIO_BACKEND=SDL2` | Use the SDL2-driven software audio-mixer -`AUDIO_BACKEND=miniaudio` | Use the miniaudio-driven software audio-mixer +`BACKEND_RENDERER=OpenGL3` | Use the hardware-accelerated OpenGL 3.2 renderer +`BACKEND_RENDERER=OpenGLES2` | Use the hardware-accelerated OpenGL ES 2.0 renderer +`BACKEND_RENDERER=SDLTexture` | Use the hardware-accelerated SDL2 Texture API renderer (default) +`BACKEND_RENDERER=SDLSurface` | Use the software-rendered SDL2 Surface API renderer +`BACKEND_RENDERER=Software` | Use the hand-written software renderer +`BACKEND_AUDIO=SDL2` | Use the SDL2-driven software audio-mixer +`BACKEND_AUDIO=miniaudio` | Use the miniaudio-driven software audio-mixer `WARNINGS=1` | Enable common compiler warnings `WARNINGS_ALL=1` | Enable ALL compiler warnings (Clang only) `WARNINGS_FATAL=1` | Make all compiler warnings errors