I discovered smokin' guns a few weeks ago.
As I found this game wonderful, I decided to browse a little bit the code & modify a few things .
First, I would like to answer to VBO's thread.
Tremfusion dev team did a patch (not perfect for the moment) about it for their codebase.
If you're interested in, here is the thread about it, & tremfusion's code.
P.S: There are still problems with intel chipsets with this patch.
I also did a few patches from release 229 of 1.1 branch.
The first files that I modified were Makefile & Makefile.local in order to have the power to compile with our own cflags if USE_CUSTOM_CFLAGS is equal to 1.
- Code: Select all
Index: Makefile
===================================================================
--- Makefile (révision 229)
+++ Makefile (copie de travail)
@@ -46,8 +46,8 @@
BUILD_MISSIONPACK=
endif
-ifneq ($(PLATFORM),darwin)
- BUILD_CLIENT_SMP = 0
+ifndef USE_CUSTOM_CFLAGS
+ USE_CUSTOM_CFLAGS=0
endif
#############################################################################
@@ -148,6 +148,10 @@
USE_LOCAL_HEADERS=1
endif
+ifneq ($(PLATFORM),darwin)
+ BUILD_CLIENT_SMP = 0
+endif
+
#############################################################################
BD=$(BUILD_DIR)/debug-$(PLATFORM)-$(ARCH)
@@ -272,19 +276,31 @@
BASE_CFLAGS += -DUSE_CODEC_VORBIS
endif
- OPTIMIZE = -O3 -ffast-math -funroll-loops -fomit-frame-pointer
+ ifeq ($(USE_CUSTOM_CFLAGS),0)
+ OPTIMIZE = -O3 -ffast-math -funroll-loops -fomit-frame-pointer
+ else
+ OPTIMIZE = ${CUSTOM_CFLAGS}
+ endif
ifeq ($(ARCH),x86_64)
- OPTIMIZE = -O3 -fomit-frame-pointer -ffast-math -funroll-loops \
- -falign-loops=2 -falign-jumps=2 -falign-functions=2 \
- -fstrength-reduce
+ ifeq ($(USE_CUSTOM_CFLAGS),0)
+ OPTIMIZE = -O3 -fomit-frame-pointer -ffast-math -funroll-loops \
+ -falign-loops=2 -falign-jumps=2 -falign-functions=2 \
+ -fstrength-reduce
+ else
+ OPTIMIZE = ${CUSTOM_CFLAGS}
+ endif
# experimental x86_64 jit compiler! you need GNU as
HAVE_VM_COMPILED = true
else
ifeq ($(ARCH),i386)
- OPTIMIZE = -O3 -march=i586 -fomit-frame-pointer -ffast-math \
- -funroll-loops -falign-loops=2 -falign-jumps=2 \
- -falign-functions=2 -fstrength-reduce
+ ifeq ($(USE_CUSTOM_CFLAGS),0)
+ OPTIMIZE = -O3 -march=i586 -fomit-frame-pointer -ffast-math \
+ -funroll-loops -falign-loops=2 -falign-jumps=2 \
+ -falign-functions=2 -fstrength-reduce
+ else
+ OPTIMIZE = ${CUSTOM_CFLAGS}
+ endif
HAVE_VM_COMPILED=true
else
ifeq ($(ARCH),ppc)
@@ -471,9 +487,13 @@
BASE_CFLAGS += -DUSE_CODEC_VORBIS
endif
- OPTIMIZE = -O3 -march=i586 -fno-omit-frame-pointer -ffast-math \
- -falign-loops=2 -funroll-loops -falign-jumps=2 -falign-functions=2 \
- -fstrength-reduce
+ ifeq ($(USE_CUSTOM_CFLAGS),0)
+ OPTIMIZE = -O3 -march=i586 -fno-omit-frame-pointer -ffast-math \
+ -falign-loops=2 -funroll-loops -falign-jumps=2 -falign-functions=2 \
+ -fstrength-reduce
+ else
+ OPTIMIZE = ${CUSTOM_CFLAGS}
+ endif
HAVE_VM_COMPILED = true
@@ -562,10 +582,16 @@
-fomit-frame-pointer -fexpensive-optimizations
else
ifeq ($(ARCH),i386)
- RELEASE_CFLAGS=$(BASE_CFLAGS) -DNDEBUG -O3 -mtune=pentiumpro \
- -march=pentium -fomit-frame-pointer -pipe -ffast-math \
- -falign-loops=2 -falign-jumps=2 -falign-functions=2 \
- -funroll-loops -fstrength-reduce
+ ifeq ($(USE_CUSTOM_CFLAGS),0)
+ OPTIMIZE= -O3 -mtune=pentiumpro -march=pentium \
+ -fomit-frame-pointer -pipe -ffast-math \
+ -falign-loops=2 -falign-jumps=2 -falign-functions=2 \
+ -funroll-loops -fstrength-reduce
+ else
+ OPTIMIZE= ${CUSTOM_CFLAGS}
+ endif
+
+ RELEASE_CFLAGS=$(BASE_CFLAGS) -DNDEBUG $(OPTIMIZE)
HAVE_VM_COMPILED=true
else
BASE_CFLAGS += -DNO_VM_COMPILED
@@ -623,10 +649,16 @@
endif
BASE_CFLAGS += -DNO_VM_COMPILED -I/usr/X11R6/include -I/usr/local/include
- RELEASE_CFLAGS=$(BASE_CFLAGS) -DNDEBUG -O3 \
- -march=pentium -fomit-frame-pointer -pipe -ffast-math \
- -falign-loops=2 -falign-jumps=2 -falign-functions=2 \
- -funroll-loops -fstrength-reduce
+
+ ifeq ($(USE_CUSTOM_CFLAGS),0)
+ OPTIMIZE = -O3 -march=pentium -fomit-frame-pointer -pipe \
+ -ffast-math -falign-loops=2 -falign-jumps=2 \
+ -falign-functions=2 -funroll-loops -fstrength-reduce
+ else
+ OPTIMIZE = ${CUSTOM_CFLAGS}
+ endif
+
+ RELEASE_CFLAGS=$(BASE_CFLAGS) -DNDEBUG $(OPTIMIZE)
HAVE_VM_COMPILED=false
DEBUG_CFLAGS=$(BASE_CFLAGS) -g
@@ -696,7 +728,14 @@
BASE_CFLAGS=-Dstricmp=strcasecmp -Xcpluscomm -woff 1185 \
-I. $(SDL_CFLAGS) -I$(ROOT)/usr/include -DNO_VM_COMPILED
- RELEASE_CFLAGS=$(BASE_CFLAGS) -O3
+
+ ifeq ($(USE_CUSTOM_CFLAGS),0)
+ OPTIMIZE = -O3
+ else
+ OPTIMIZE = ${CUSTOM_CFLAGS}
+ endif
+
+ RELEASE_CFLAGS=$(BASE_CFLAGS) $(OPTIMIZE)
DEBUG_CFLAGS=$(BASE_CFLAGS) -g
SHLIBEXT=so
@@ -736,19 +775,31 @@
BASE_CFLAGS = -Wall -fno-strict-aliasing -Wimplicit -Wstrict-prototypes \
-pipe -DUSE_ICON $(SDL_CFLAGS)
- OPTIMIZE = -O3 -ffast-math -funroll-loops
+ ifeq ($(USE_CUSTOM_CFLAGS),0)
+ OPTIMIZE = -O3 -ffast-math -funroll-loops
+ else
+ OPTIMIZE = ${CUSTOM_CFLAGS}
+ endif
ifeq ($(ARCH),sparc)
- OPTIMIZE = -O3 -ffast-math \
- -fstrength-reduce -falign-functions=2 \
- -mtune=ultrasparc3 -mv8plus -mno-faster-structs \
- -funroll-loops #-mv8plus
+ ifeq ($(USE_CUSTOM_CFLAGS),0)
+ OPTIMIZE = -O3 -ffast-math \
+ -fstrength-reduce -falign-functions=2 \
+ -mtune=ultrasparc3 -mv8plus -mno-faster-structs \
+ -funroll-loops #-mv8plus
+ else
+ OPTIMIZE = ${CUSTOM_CFLAGS}
+ endif
HAVE_VM_COMPILED=true
else
ifeq ($(ARCH),i386)
- OPTIMIZE = -O3 -march=i586 -fomit-frame-pointer -ffast-math \
- -funroll-loops -falign-loops=2 -falign-jumps=2 \
- -falign-functions=2 -fstrength-reduce
+ ifeq ($(USE_CUSTOM_CFLAGS),0)
+ OPTIMIZE = -O3 -march=i586 -fomit-frame-pointer -ffast-math \
+ -funroll-loops -falign-loops=2 -falign-jumps=2 \
+ -falign-functions=2 -fstrength-reduce
+ else
+ OPTIMIZE = ${CUSTOM_CFLAGS}
+ endif
HAVE_VM_COMPILED=true
BASE_CFLAGS += -m32
BASE_CFLAGS += -I/usr/X11/include/NVIDIA
@@ -782,7 +833,7 @@
#############################################################################
BASE_CFLAGS=-DNO_VM_COMPILED
DEBUG_CFLAGS=$(BASE_CFLAGS) -g
- RELEASE_CFLAGS=$(BASE_CFLAGS) -DNDEBUG -O3
+ RELEASE_CFLAGS=$(BASE_CFLAGS) -DNDEBUG
SHLIBEXT=so
SHLIBCFLAGS=-fPIC
- Code: Select all
Index: Makefile.local
===================================================================
--- Makefile.local (révision 229)
+++ Makefile.local (copie de travail)
@@ -12,7 +12,7 @@
endif
ifeq ($(BUILD_SERVER),)
# Build server by default
- BUILD_SERVER = 1
+ BUILD_SERVER = 0
endif
ifeq ($(BUILD_GAME_SO),)
# Don't build binary game by default
@@ -20,8 +20,13 @@
endif
ifeq ($(BUILD_GAME_QVM),)
# Build QVM game by default
- BUILD_GAME_QVM = 1
+ BUILD_GAME_QVM = 0
endif
+
+ifeq ($(USE_CUSTOM_CFLAGS),1)
+ CUSTOM_CFLAGS=$(CFLAGS)
+endif
+
########################################################################
# Don't modify the following or the build will just be broken
BUILD_STANDALONE = 1
I also applied a cellshading patch which I found in games/iourbanterror port's extra files. But he looks to work only with r_celoutline (I'll fix it later).
As I had to cross-compile a 1.1 client for friends who use windows ( ), I had to apply tremfusion's patches for cross-make-mingw.sh.
Here it is :
- Code: Select all
Index: cross-make-mingw.sh
===================================================================
--- cross-make-mingw.sh (révision 229)
+++ cross-make-mingw.sh (copie de travail)
@@ -1,6 +1,24 @@
#!/bin/sh
-export CC=i586-mingw32msvc-gcc
-export WINDRES=i586-mingw32msvc-windres
-export PLATFORM=mingw32
-exec make $*
+COMPILE_PLATFORM=`uname|sed -e s/_.*//|tr '[:upper:]' '[:lower:]'`
+
+if [ "$COMPILE_PLATFORM" = "darwin" ]
+then
+ export CC=i386-mingw32msvc-gcc
+ export WINDRES=i386-mingw32msvc-windres
+ export PLATFORM=mingw32
+ MAKE=make
+elif [ "$COMPILE_PLATFORM" = "freebsd" ]
+then
+ export CC=mingw32-gcc
+ export WINDRES=mingw32-windres
+ export PLATFORM=mingw32
+ MAKE=gmake
+else
+ export CC=i586-mingw32msvc-gcc
+ export WINDRES=i586-mingw32msvc-windres
+ export PLATFORM=mingw32
+fi
+
+exec $MAKE $*
+
I'll propose more client/server patches later.