From b14c5a3d9c9f48a0d0fe0ed2bb28db54a9b4a43a Mon Sep 17 00:00:00 2001 From: Zack Middleton Date: Sun, 9 Jun 2024 21:56:03 -0500 Subject: [PATCH] Add BUILD_RENDERER_OPENGL1 to disable opengl1 Have emscripten disable BUILD_RENDERER_OPENGL1 instead of hardcoded to disable opengl1 client. --- Makefile | 31 +++++++++++++++++++++++++------ README.md | 2 ++ 2 files changed, 27 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index ba45103e..8704d982 100644 --- a/Makefile +++ b/Makefile @@ -40,6 +40,9 @@ endif ifndef BUILD_MISSIONPACK BUILD_MISSIONPACK= endif +ifndef BUILD_RENDERER_OPENGL1 + BUILD_RENDERER_OPENGL1= +endif ifndef BUILD_RENDERER_OPENGL2 BUILD_RENDERER_OPENGL2= endif @@ -1073,6 +1076,7 @@ ifeq ($(PLATFORM),emscripten) HAVE_VM_COMPILED=false BUILD_GAME_SO=0 BUILD_GAME_QVM=0 + BUILD_RENDERER_OPENGL1=0 # Would be interesting to try to get the server working via WebRTC DataChannel. # This would enable P2P play, hosting a server in the browser. Also, # DataChannel is the only way to use UDP in the browser. @@ -1178,16 +1182,26 @@ ifneq ($(BUILD_SERVER),0) endif ifneq ($(BUILD_CLIENT),0) - ifneq ($(PLATFORM),emscripten) - TARGETS += $(B)/$(CLIENTBIN)$(FULLBINEXT) - endif - ifneq ($(USE_RENDERER_DLOPEN),0) - TARGETS += $(B)/renderer_opengl1_$(SHLIBNAME) + TARGETS += $(B)/$(CLIENTBIN)$(FULLBINEXT) + + ifneq ($(BUILD_RENDERER_OPENGL1),0) + TARGETS += $(B)/renderer_opengl1_$(SHLIBNAME) + endif ifneq ($(BUILD_RENDERER_OPENGL2),0) TARGETS += $(B)/renderer_opengl2_$(SHLIBNAME) endif else + ifneq ($(BUILD_RENDERER_OPENGL1),0) + TARGETS += $(B)/$(CLIENTBIN)$(FULLBINEXT) + + ifeq ($(PLATFORM),emscripten) + EMSCRIPTENOBJ+=$(B)/$(CLIENTBIN).wasm32.wasm + ifeq ($(EMSCRIPTEN_PRELOAD_FILE),1) + EMSCRIPTENOBJ+=$(B)/$(CLIENTBIN).wasm32.data + endif + endif + endif ifneq ($(BUILD_RENDERER_OPENGL2),0) TARGETS += $(B)/$(CLIENTBIN)_opengl2$(FULLBINEXT) @@ -3109,13 +3123,18 @@ ifneq ($(BUILD_GAME_SO),0) endif ifneq ($(BUILD_CLIENT),0) - $(INSTALL) $(STRIP_FLAG) -m 0755 $(BR)/$(CLIENTBIN)$(FULLBINEXT) $(COPYBINDIR)/$(CLIENTBIN)$(FULLBINEXT) ifneq ($(USE_RENDERER_DLOPEN),0) + $(INSTALL) $(STRIP_FLAG) -m 0755 $(BR)/$(CLIENTBIN)$(FULLBINEXT) $(COPYBINDIR)/$(CLIENTBIN)$(FULLBINEXT) + ifneq ($(BUILD_RENDERER_OPENGL1),0) $(INSTALL) $(STRIP_FLAG) -m 0755 $(BR)/renderer_opengl1_$(SHLIBNAME) $(COPYBINDIR)/renderer_opengl1_$(SHLIBNAME) + endif ifneq ($(BUILD_RENDERER_OPENGL2),0) $(INSTALL) $(STRIP_FLAG) -m 0755 $(BR)/renderer_opengl2_$(SHLIBNAME) $(COPYBINDIR)/renderer_opengl2_$(SHLIBNAME) endif else + ifneq ($(BUILD_RENDERER_OPENGL1),0) + $(INSTALL) $(STRIP_FLAG) -m 0755 $(BR)/$(CLIENTBIN)$(FULLBINEXT) $(COPYBINDIR)/$(CLIENTBIN)$(FULLBINEXT) + endif ifneq ($(BUILD_RENDERER_OPENGL2),0) $(INSTALL) $(STRIP_FLAG) -m 0755 $(BR)/$(CLIENTBIN)_opengl2$(FULLBINEXT) $(COPYBINDIR)/$(CLIENTBIN)_opengl2$(FULLBINEXT) endif diff --git a/README.md b/README.md index 51b27a8b..5873d06b 100644 --- a/README.md +++ b/README.md @@ -148,6 +148,8 @@ Makefile.local: SERVERBIN - rename 'ioq3ded' server binary CLIENTBIN - rename 'ioquake3' client binary USE_RENDERER_DLOPEN - build and use the renderer in a library + BUILD_RENDERER_OPENGL1 build the opengl1 client / renderer library + BUILD_RENDERER_OPENGL2 build the opengl2 client / renderer library USE_YACC - use yacc to update code/tools/lcc/lburg/gram.c BASEGAME - rename 'baseq3' BASEGAME_CFLAGS - custom CFLAGS for basegame