From: Jamie W. <ja...@sp...> - 2002-01-25 05:49:10
|
This patch against the current quake2 head removes architecture specific code, allowing one to build on things like mipsel and arm. commit log entry: =3D=3D=3D=3D=3D=3D - removes architecture specific code from Makefile, linux/sys_linux.c - fixes build errors on alpha machines with -Werror, cleaned up some typecasting - typo correction in ctf/g_save.c - Used README.sdl from relnev's 0.0.8 code (to match the rest of the sync) - SVGALib code doesn't use <asm/io.h> =3D=3D=3D=3D=3D=3D diff -u -r1.6 .cvsignore --- .cvsignore 2002/01/07 05:02:03 1.6 +++ .cvsignore 2002/01/25 05:31:48 @@ -3,6 +3,6 @@ *.opt *.plg .vimrc -debugi386 +debug* quake2 -releasei386 +release* diff -u -r1.6 Makefile --- Makefile 2002/01/12 02:14:07 1.6 +++ Makefile 2002/01/25 05:31:50 @@ -11,7 +11,7 @@ # Here are your build options, no more will be added! # (Note: not all options are available for all platforms). # quake2 (uses OSS for sound, cdrom ioctls for cd audio) is automatically = built. -# game{i386,axp,ppc}.so is automatically built. +# game$(ARCH).so is automatically built. BUILD_SDLQUAKE2=3DYES # sdlquake2 executable (uses SDL for cdrom and sound) BUILD_SVGA=3DYES # SVGAlib driver. Seems to work fine. BUILD_X11=3DYES # X11 software driver. Works somewhat ok. @@ -22,48 +22,46 @@ BUILD_CTFDLL=3DYES # gamei386.so for ctf # i can add support for building xatrix and rogue libs if needed =20 +# unportable # Check OS type. -OSTYPE :=3D $(shell uname -s) +#OSTYPE :=3D $(shell uname -s) +# +#ifneq ($(OSTYPE),Linux) +#$(error OS $(OSTYPE) is currently not supported) +#endif =20 -ifneq ($(OSTYPE),Linux) -$(error OS $(OSTYPE) is currently not supported) -endif - # this nice line comes from the linux kernel makefile -ARCH :=3D $(shell uname -m | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ -e s/= arm.*/arm/ -e s/sa110/arm/ -e s/alpha/axp/) +ARCH :=3D $(shell uname -m | sed -e s/i.86/i386/ -e s/sun4u/sparc/ -e s/sp= arc64/sparc/ -e s/arm.*/arm/ -e s/sa110/arm/ -e s/alpha/axp/) +#ARCH :=3D $(shell uname -m | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ -e s= /arm.*/arm/ -e s/sa110/arm/ -e s/alpha/axp/) =20 -ifneq ($(ARCH),i386) -ifneq ($(ARCH),axp) -ifneq ($(ARCH),ppc) -ifneq ($(ARCH),sparc) -$(error arch $(ARCH) is currently not supported) -endif -endif -endif -endif +# This is preventing builds on sparc and ia64, etc +#ifneq ($(ARCH),i386) +#ifneq ($(ARCH),axp) +#ifneq ($(ARCH),ppc) +#$(error arch $(ARCH) is currently not supported) +#endif +#endif +#endif =20 CC=3Dgcc =20 -ifeq ($(ARCH),axp) -RELEASE_CFLAGS=3D$(BASE_CFLAGS) -O2 -ffast-math -funroll-loops \ +# make this more port friendly +#ifeq ($(ARCH),axp) +RELEASE_CFLAGS=3D$(BASE_CFLAGS) -ffast-math -funroll-loops \ -fomit-frame-pointer -fexpensive-optimizations -endif +#endif +# +#ifeq ($(ARCH),ppc) +#RELEASE_CFLAGS=3D$(BASE_CFLAGS) -ffast-math -funroll-loops \ +# -fomit-frame-pointer -fexpensive-optimizations +#endif =20 -ifeq ($(ARCH),ppc) -RELEASE_CFLAGS=3D$(BASE_CFLAGS) -O2 -ffast-math -funroll-loops \ - -fomit-frame-pointer -fexpensive-optimizations -endif - -ifeq ($(ARCH),sparc) -RELEASE_CFLAGS=3D$(BASE_CFLAGS) -O2 -ffast-math -funroll-loops \ - -fomit-frame-pointer -fexpensive-optimizations -endif - ifeq ($(ARCH),i386) -RELEASE_CFLAGS=3D$(BASE_CFLAGS) -O2 -ffast-math -funroll-loops -malign-loo= ps=3D2 \ - -malign-jumps=3D2 -malign-functions=3D2 +#RELEASE_CFLAGS=3D$(BASE_CFLAGS) -O2 -ffast-math -funroll-loops -malign-lo= ops=3D2 \ +# -malign-jumps=3D2 -malign-functions=3D2 -g +RELEASE_CFLAGS+=3D-O2 -malign-loops=3D2 -malign-jumps=3D2 -malign-function= s=3D2 -g # compiler bugs with gcc 2.96 and 3.0.1 can cause bad builds with heavy op= ts. -#RELEASE_CFLAGS=3D$(BASE_CFLAGS) -O6 -march=3Di686 -ffast-math -funroll-lo= ops \ +#RELEASE_CFLAGS=3D$(BASE_CFLAGS) -O6 -m486 -ffast-math -funroll-loops \ # -fomit-frame-pointer -fexpensive-optimizations -malign-loops=3D2 \ # -malign-jumps=3D2 -malign-functions=3D2 endif @@ -85,8 +83,12 @@ CTF_DIR=3D$(MOUNT_DIR)/ctf XATRIX_DIR=3D$(MOUNT_DIR)/xatrix =20 -BASE_CFLAGS=3D-Dstricmp=3Dstrcasecmp -Wall -Werror +BASE_CFLAGS=3D-Dstricmp=3Dstrcasecmp -Wall -Werror -pipe =20 +ifneq ($(ARCH),i386) + BASE_CFLAGS+=3D-DC_ONLY +endif + DEBUG_CFLAGS=3D$(BASE_CFLAGS) -g =20 LDFLAGS=3D-lm -ldl @@ -114,11 +116,12 @@ SHLIBCFLAGS=3D-fPIC SHLIBLDFLAGS=3D-shared =20 -DO_CC=3D$(CC) $(CFLAGS) -o $@ -c $< -DO_SHLIB_CC=3D$(CC) $(CFLAGS) $(SHLIBCFLAGS) -o $@ -c $< -DO_GL_SHLIB_CC=3D$(CC) $(CFLAGS) $(SHLIBCFLAGS) $(GLCFLAGS) -o $@ -c $< -DO_AS=3D$(CC) $(CFLAGS) -DELF -x assembler-with-cpp -o $@ -c $< -DO_SHLIB_AS=3D$(CC) $(CFLAGS) $(SHLIBCFLAGS) -DELF -x assembler-with-cpp -= o $@ -c $< +# added $(ARCH) here as make would munge the quoting in BASE_CFLAGS above +DO_CC=3D$(CC) -DARCH=3D\""$(ARCH)"\" $(CFLAGS) -o $@ -c $< +DO_SHLIB_CC=3D$(CC) -DARCH=3D\""$(ARCH)"\" $(CFLAGS) $(SHLIBCFLAGS) -o $@ = -c $< +DO_GL_SHLIB_CC=3D$(CC) -DARCH=3D\""$(ARCH)"\" $(CFLAGS) $(SHLIBCFLAGS) $(G= LCFLAGS) -o $@ -c $< +DO_AS=3D$(CC) -DARCH=3D\""$(ARCH)"\" $(CFLAGS) -DELF -x assembler-with-cpp= -o $@ -c $< +DO_SHLIB_AS=3D$(CC) -DARCH=3D\""$(ARCH)"\" $(CFLAGS) $(SHLIBCFLAGS) -DELF = -x assembler-with-cpp -o $@ -c $< =20 ##########################################################################= ### # SETUP AND BUILD @@ -132,74 +135,16 @@ TARGETS +=3D $(BUILDDIR)/ctf/game$(ARCH).$(SHLIBEXT) endif =20 -ifeq ($(ARCH),axp) ifeq ($(strip $(BUILD_SDLQUAKE2)),YES) TARGETS +=3D $(BUILDDIR)/sdlquake2 endif - - ifeq ($(strip $(BUILD_SVGA)),YES) - $(warning Warning: SVGAlib support not supported for $(ARCH)) - endif - - ifeq ($(strip $(BUILD_X11)),YES) - $(warning Warning: X11 support not supported for $(ARCH)) - endif - - ifeq ($(strip $(BUILD_GLX)),YES) - $(warning Warning: support not supported for $(ARCH)) - endif - - ifeq ($(strip $(BUILD_FXGL)),YES) - $(warning Warning: FXGL support not supported for $(ARCH)) - endif =20 - ifeq ($(strip $(BUILD_SDL)),YES) - $(warning Warning: SDL support not supported for $(ARCH)) - endif - - ifeq ($(strip $(BUILD_SDLGL)),YES) - $(warning Warning: SDLGL support not supported for $(ARCH)) - endif -endif # ARCH axp - -ifeq ($(ARCH),ppc) - ifeq ($(strip $(BUILD_SDLQUAKE2)),YES) - $(warning Warning: SDLQuake2 not supported for $(ARCH)) - endif -=20 - ifeq ($(strip $(BUILD_SVGA)),YES) - $(warning Warning: SVGAlib support not supported for $(ARCH)) - endif - - ifeq ($(strip $(BUILD_X11)),YES) - $(warning Warning: X11 support not supported for $(ARCH)) - endif - - ifeq ($(strip $(BUILD_GLX)),YES) - $(warning Warning: GLX support not supported for $(ARCH)) - endif - - ifeq ($(strip $(BUILD_FXGL)),YES) - $(warning Warning: FXGL support not supported for $(ARCH)) - endif - - ifeq ($(strip $(BUILD_SDL)),YES) - $(warning Warning: SDL support not supported for $(ARCH)) - endif - - ifeq ($(strip $(BUILD_SDLGL)),YES) - TARGETS +=3D $(BUILDDIR)/ref_sdlgl.$(SHLIBEXT) - endif -endif # ARCH ppc - +# svgalib just doesn't work with non-i386 at the moment, so don't bother ifeq ($(ARCH),i386) - ifeq ($(strip $(BUILD_SDLQUAKE2)),YES) - TARGETS +=3D $(BUILDDIR)/sdlquake2 - endif - ifeq ($(strip $(BUILD_SVGA)),YES) TARGETS +=3D $(BUILDDIR)/ref_soft.$(SHLIBEXT) endif +endif =20 ifeq ($(strip $(BUILD_X11)),YES) TARGETS +=3D $(BUILDDIR)/ref_softx.$(SHLIBEXT) @@ -220,7 +165,6 @@ ifeq ($(strip $(BUILD_SDLGL)),YES) TARGETS +=3D $(BUILDDIR)/ref_sdlgl.$(SHLIBEXT) endif -endif # ARCH i386 =20 all: build_debug build_release =20 @@ -307,11 +251,11 @@ $(BUILDDIR)/client/cd_sdl.o \ $(BUILDDIR)/client/snd_sdl.o =20 -ifeq ($(ARCH),axp) -QUAKE2_AS_OBJS =3D #blank +# more i386 asm +ifeq ($(ARCH),i386) +QUAKE2_AS_OBJS =3D $(BUILDDIR)/client/snd_mixa.o else -QUAKE2_AS_OBJS =3D \ - $(BUILDDIR)/client/snd_mixa.o +QUAKE2_AS_OBJS =3D #blank endif =20 $(BUILDDIR)/quake2 : $(QUAKE2_OBJS) $(QUAKE2_LNX_OBJS) $(QUAKE2_AS_OBJS) @@ -401,7 +345,7 @@ $(BUILDDIR)/client/files.o : $(COMMON_DIR)/files.c $(DO_CC) =20 -$(BUILDDIR)/client/mdfour.o : $(COMMON_DIR)/mdfour.c +$(BUILDDIR)/client/mdfour.o : $(COMMON_DIR)/mdfour.c $(DO_CC) =20 $(BUILDDIR)/client/net_chan.o : $(COMMON_DIR)/net_chan.c @@ -1020,7 +964,12 @@ $(BUILDDIR)/ref_soft/r_scan.o \ $(BUILDDIR)/ref_soft/r_sprite.o \ $(BUILDDIR)/ref_soft/r_surf.o \ - \ + $(BUILDDIR)/ref_soft/q_shared.o \ + $(BUILDDIR)/ref_soft/q_shlinux.o \ + $(BUILDDIR)/ref_soft/glob.o + +ifeq ($(ARCH),i386) +REF_SOFT_OBJS +=3D \ $(BUILDDIR)/ref_soft/r_aclipa.o \ $(BUILDDIR)/ref_soft/r_draw16.o \ $(BUILDDIR)/ref_soft/r_drawa.o \ @@ -1031,11 +980,8 @@ $(BUILDDIR)/ref_soft/math.o \ $(BUILDDIR)/ref_soft/d_polysa.o \ $(BUILDDIR)/ref_soft/r_varsa.o \ - $(BUILDDIR)/ref_soft/sys_dosa.o \ - \ - $(BUILDDIR)/ref_soft/q_shared.o \ - $(BUILDDIR)/ref_soft/q_shlinux.o \ - $(BUILDDIR)/ref_soft/glob.o + $(BUILDDIR)/ref_soft/sys_dosa.o +endif =20 REF_SOFT_SVGA_OBJS =3D \ $(BUILDDIR)/ref_soft/rw_svgalib.o \ @@ -1283,6 +1229,6 @@ $(REF_GL_OBJS) =20 distclean: - @-rm -rf $(BUILD_DEBUG_DIR) $(BUILD_RELEASE_DIR) - @-rm -f `find . \( -not -type d \) -and \ + -rm -rf $(BUILD_DEBUG_DIR) $(BUILD_RELEASE_DIR) + -rm -f `find . \( -not -type d \) -and \ \( -name '*~' \) -type f -print` diff -u -r1.4 cl_cin.c --- client/cl_cin.c 2002/01/07 04:54:10 1.4 +++ client/cl_cin.c 2002/01/25 05:31:52 @@ -412,7 +412,7 @@ =20 if (input - in.data !=3D in.count && input - in.data !=3D in.count+1) { - Com_Printf ("Decompression overread by %i", (input - in.data) - in.count= ); + Com_Printf ("Decompression overread by %i", (int) (input - in.data) - in= .count); } out.count =3D out_p - out.data; =20 diff -u -r1.4 cl_scrn.c --- client/cl_scrn.c 2002/01/12 02:14:08 1.4 +++ client/cl_scrn.c 2002/01/25 05:31:54 @@ -614,11 +614,11 @@ */ if ( a->model =3D=3D b->model ) { - return ( ( int ) a->skin - ( int ) b->skin ); + return (long int) a->skin - (long int) b->skin; } else { - return ( ( int ) a->model - ( int ) b->model ); + return (long int) a->model - (long int) b->model; } } =20 diff -u -r1.3 snd_mem.c --- client/snd_mem.c 2002/01/12 02:14:08 1.3 +++ client/snd_mem.c 2002/01/25 05:31:55 @@ -253,7 +253,7 @@ memcpy (str, data_p, 4); data_p +=3D 4; iff_chunk_len =3D GetLittleLong(); - Com_Printf ("0x%x : %s (%d)\n", (int)(data_p - 4), str, iff_chunk_len); + Com_Printf ("0x%p : %s (%d)\n", data_p - 4, str, iff_chunk_len); data_p +=3D (iff_chunk_len + 1) & ~1; } while (data_p < iff_end); } diff -u -r1.8 g_save.c --- ctf/g_save.c 2002/01/12 03:23:32 1.8 +++ ctf/g_save.c 2002/01/25 05:31:57 @@ -175,7 +175,7 @@ //ZOID //This game.dll only supports deathmatch if (!deathmatch->value) { - gi.dprintf("Forcing deathmatch."); + gi.dprintf("Forcing deathmatch.\n"); gi.cvar_set("deathmatch", "1"); } //force coop off diff -u -r1.1 README.sdl --- docs/README.sdl 2002/01/12 02:14:08 1.1 +++ docs/README.sdl 2002/01/25 05:31:58 @@ -11,14 +11,34 @@ Be sure to install SDL 1.2 (http://www.libsdl.org) if you want to use the softsdl or sdlgl drivers, or the sdlquake2 binary. =20 -You can change what drivers you wish to build by editing the Makefile and -changing the BUILD_ lines at the very top. - 'make' will, by default, build both the debug and release files. To build fully optimized binaries: make build_release The resulting binaries are then put in releasei386. =20 =20 +Makefile options: +----------------- +(quake2 and gamei386.so are always built, but the following options can be + changed by editing the Makefile) +BUILD_SDLQUAKE2 Build sdlquake2, a quake2 binary that uses SDL for + CD audio and sound access (default =3D YES). +BUILD_SVGA Build ref_soft.so, a quake2 video driver that uses + SVGAlib (default =3D NO). +BUILD_X11 Build ref_softx.so, a quake2 video driver that uses + X11 (default =3D YES). +BUILD_GLX Build ref_glx.so, a quake2 video driver that uses + X11's GLX (default =3D YES). +BUILD_FXGL Build ref_gl.so [might be renamed to fxgl later],= =20 + a quake2 video driver that uses fxMesa (default =3D + NO). This option is currently untested because I = do=20 + not have a Voodoo 1 or 2. +BUILD_SDL Build ref_softsdl.so, a quake2 video driver that + uses SDL (default =3D YES). +BUILD_SDLGL Build ref_sdlgl.so, a quake2 video driver that uses + OpenGL with SDL (default =3D YES). +BUILD_CTFDLL Build the Threewave CTF gamei386.so (default =3D N= O). + + To install the Quake2 gamedata: ------------------------------- (installdir is wherever you want to install quake2, and cdromdir is wherev= er @@ -59,11 +79,20 @@ Configuration files and such are saved in ~/.quake2/, so <installdir> can = be made read-only or whatever. =20 -WARNING: Please do not make quake2 or any of the libraries suid root! +WARNING: Please do not make quake2 or any of the libraries suid root! Doi= ng +so is at your own risk. =20 -NOTE: Save games will most likely not work across different versions or -builds (this is due to how savegames were stored). +NOTE: Save games will not work across different versions or builds, because +of the way they are stored. =20 +Dedicated Server: +----------------- +If there is a demand for it, I can add support for an explicit q2ded binar= y. +Else, using +set dedicated 1 should be fine. + +Joystick Support: +----------------- +None yet. =20 Commonly used commands: ----------------------- @@ -80,28 +109,63 @@ snd_restart // restart sound driver basedir <dir> // point quake2 to where the data is gl_driver <libGL.so> // point quake2 to your libGL +dedicated 1 // run quake2 as a dedicated server + +When using these commands on the quake2 command line, use +set to cause the +variables be set before the config files are loaded (important for +gl_driver). e.g. +./quake2 +set vid_ref glx +set gl_driver /usr/lib/libGL.so.1 + +If quake2 crashes when trying to load an OpenGL based driver (glx, sdlgl), +make sure its not loading the wrong libGL. =20 +Have a NVIDIA card and it _still_ crashes? Try=20 +export LD_PRELOAD=3D/usr/lib/libGL.so, and run quake2 again. =20 +Is lighting slow in OpenGL (while firing, explosions, etc.)? Disable +multitexturing (gl_ext_multitexture 0; vid_restart). + + Website: -------- -I'll post any updates I make at http://www.icculus.org/quake/=20 +I'll post any updates I make at http://www.icculus.org/quake2/=20 (which currently redirects to http://www.icculus.org/~relnev/) =20 +Mailing List: +------------- +to subscribe: send a blank email to qua...@ic... +to post: send email to qu...@ic... + Anonymous CVS access: --------------------- cvs -d:pserver:ano...@ic...:/cvs/cvsroot login (password is "anonymous" without the quotes.) cvs -z3 -d:pserver:ano...@ic...:/cvs/cvsroot co quake2 =20 -Questions: ----------- -What's the best way of handling international keyboards with SDL? +Bugzilla: +--------- +https://bugzilla.icculus.org =20 TODO: ----- +Try out RCG's key idea. Fix save games. +Verify FXGL works. +Joystick support. +Fullscreen/DGA support in X11 driver. +Fully switch to glext.h. Suggestions, anyone? =20 +v0.0.8: [01/04/02] +------- ++ Fixed C-only ref_soft building. ++ SDL CD audio looping fix (Robert B=E4uml) ++ ~/.quake2/<game> added to the search path for mods. (Ludwig Nussel) ++ Minor change to fix compilation with OpenGL 1.3 headers. ++ Fixed changing video drivers using the menu. ++ Fixed autoexec.cfg on startup. ++ Sparc Linux support (Vincent Cojot) + v0.0.7: [12/28/01] ------- + Merged in Quake2 3.21 source. @@ -150,7 +214,10 @@ Stephen Anthony William Aoki Robert B=E4uml +Vincent Cojot +Michel D=E4nzer Ryan C. Gordon Ludwig Nussel +Peter van Paassen Zachary 'zakk' Slater Matti Valtonen diff -u -r1.4 rw_in_svgalib.c --- linux/rw_in_svgalib.c 2002/01/03 04:22:46 1.4 +++ linux/rw_in_svgalib.c 2002/01/25 05:32:00 @@ -26,8 +26,6 @@ #include <signal.h> #include <sys/mman.h> =20 -#include <asm/io.h> - #include "vga.h" #include "vgakeyboard.h" #include "vgamouse.h" diff -u -r1.4 rw_svgalib.c --- linux/rw_svgalib.c 2002/01/12 02:14:08 1.4 +++ linux/rw_svgalib.c 2002/01/25 05:32:00 @@ -42,8 +42,6 @@ #include <unistd.h> #include <sys/mman.h> =20 -#include <asm/io.h> - #include "vga.h" #include "vgakeyboard.h" #include "vgamouse.h" diff -u -r1.7 sys_linux.c --- linux/sys_linux.c 2002/01/12 02:14:08 1.7 +++ linux/sys_linux.c 2002/01/25 05:32:01 @@ -40,7 +40,7 @@ #include <dlfcn.h> =20 #include "../qcommon/qcommon.h" - +#include "../game/game.h" #include "../linux/rw_linux.h" =20 cvar_t *nostdout; @@ -214,22 +214,13 @@ */ void *Sys_GetGameAPI (void *parms) { - void *(*GetGameAPI) (void *); + game_export_t *(*GetGameAPI) (game_import_t *); =20 char name[MAX_OSPATH]; char *path; char *str_p; -#if defined __i386__ - const char *gamename =3D "gamei386.so"; -#elif defined __alpha__ - const char *gamename =3D "gameaxp.so"; -#elif defined __powerpc__ - const char *gamename =3D "gameppc.so"; -#elif defined __sparc__ - const char *gamename =3D "gamesparc.so"; -#else -#error Unknown arch -#endif + + const char *gamename =3D "game"ARCH".so"; =20 setreuid(getuid(), getuid()); setegid(getgid()); @@ -265,7 +256,7 @@ } } =20 - GetGameAPI =3D (void *)dlsym (game_library, "GetGameAPI"); + GetGameAPI =3D (game_export_t * (*)(game_import_t *)) dlsym(game_library,= "GetGameAPI"); =20 if (!GetGameAPI) { diff -u -r1.9 common.c --- qcommon/common.c 2002/01/12 02:14:09 1.9 +++ qcommon/common.c 2002/01/25 05:32:05 @@ -69,7 +69,7 @@ static int rd_buffersize; static void (*rd_flush)(int target, char *buffer); =20 -void Com_BeginRedirect (int target, char *buffer, int buffersize, void (*f= lush)) +void Com_BeginRedirect (int target, char *buffer, int buffersize, void (*f= lush)(int, char*)) { if (!target || !buffer || !buffersize || !flush) return; diff -u -r1.8 qcommon.h --- qcommon/qcommon.h 2002/01/12 03:23:32 1.8 +++ qcommon/qcommon.h 2002/01/25 05:32:08 @@ -735,7 +735,7 @@ #define PRINT_ALL 0 #define PRINT_DEVELOPER 1 // only print when "developer 1" =20 -void Com_BeginRedirect (int target, char *buffer, int buffersize, void (*= flush)); +void Com_BeginRedirect (int target, char *buffer, int buffersize, void (*= flush)(int, char*)); void Com_EndRedirect (void); void Com_Printf (char *fmt, ...) __attribute__((format(printf,1,2))); void Com_DPrintf (char *fmt, ...) __attribute__((format(printf,1,2))); diff -u -r1.2 r_edge.c --- ref_soft/r_edge.c 2001/12/22 21:49:58 1.2 +++ ref_soft/r_edge.c 2002/01/25 05:32:11 @@ -1074,7 +1074,7 @@ =20 // make a stable color for each surface by taking the low // bits of the msurface pointer - D_FlatFillSurface (s, (int)s->msurf & 0xFF); + D_FlatFillSurface (s, (long int) s->msurf & 0xFF); D_DrawZSpans (s->spans); } } diff -u -r1.2 r_surf.c --- ref_soft/r_surf.c 2001/12/22 21:49:58 1.2 +++ ref_soft/r_surf.c 2002/01/25 05:32:12 @@ -450,7 +450,7 @@ if ((size <=3D 0) || (size > 0x10000)) ri.Sys_Error (ERR_FATAL,"D_SCAlloc: bad cache size %d\n", size); =09 - size =3D (int)&((surfcache_t *)0)->data[size]; + size =3D (long int)&((surfcache_t *)0)->data[size]; size =3D (size + 3) & ~3; if (size > sc_size) ri.Sys_Error (ERR_FATAL,"D_SCAlloc: %i > cache size of %i",size, sc_size= ); --=20 ja...@sp... http://spacepants.org/jaq.gpg =20 When C++ is your hammer, everything looks like a thumb -- Latest seen from Steven M. Haflich, in c.l.l |