From 68509d6d83ed01e24c7458d4e0c4a931969bc1e0 Mon Sep 17 00:00:00 2001 From: UnknownShadow200 Date: Sat, 3 Aug 2024 11:07:45 +1000 Subject: [PATCH] add make release which compiles at -O1 --- Makefile | 5 +++++ third_party/gldc/src/sh4.c | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 33ed3adfd..f551c3d10 100644 --- a/Makefile +++ b/Makefile @@ -137,6 +137,9 @@ ifdef TERMINAL CFLAGS += -DCC_WIN_BACKEND=CC_WIN_BACKEND_TERMINAL -DCC_GFX_BACKEND=CC_GFX_BACKEND_SOFTGPU LIBS := $(subst mwindows,mconsole,$(LIBS)) endif +ifdef RELEASE + CFLAGS += -O1 +endif default: $(PLAT) @@ -174,6 +177,8 @@ sdl3: $(MAKE) $(ENAME) SDL3=1 terminal: $(MAKE) $(ENAME) TERMINAL=1 +release: + $(MAKE) $(ENAME) RELEASE=1 # Some builds require more complex handling, so are moved to # separate makefiles to avoid having one giant messy makefile diff --git a/third_party/gldc/src/sh4.c b/third_party/gldc/src/sh4.c index 9cbae7b4e..6ea8d47d9 100644 --- a/third_party/gldc/src/sh4.c +++ b/third_party/gldc/src/sh4.c @@ -19,7 +19,7 @@ GL_FORCE_INLINE void _glPerspectiveDivideVertex(Vertex* vertex) { /* Convert to NDC (viewport already applied) */ vertex->x = vertex->x * f; vertex->y = vertex->y * f; - vertex->z = _glFastInvert(vertex->w); + vertex->z = f; }