r375 - in trunk/code: client qcommon renderer tools/lcc unix
DONOTREPLY at icculus.org
DONOTREPLY at icculus.org
Sat Nov 26 10:01:28 EST 2005
Author: tma
Date: 2005-11-26 10:01:28 -0500 (Sat, 26 Nov 2005)
New Revision: 375
Modified:
trunk/code/client/snd_mix.c
trunk/code/client/snd_openal.c
trunk/code/qcommon/q_platform.h
trunk/code/qcommon/qcommon.h
trunk/code/renderer/tr_shade.c
trunk/code/renderer/tr_shade_calc.c
trunk/code/renderer/tr_surface.c
trunk/code/tools/lcc/Makefile
trunk/code/unix/Makefile
trunk/code/unix/sdl_glimp.c
trunk/code/unix/unix_main.c
Log:
* Disable ccache by default. If you want it, add USE_CCACHE=1 to Makefile.local
* Remove -gfull from linux section in Makefile -- it's darwin only
* Cast away some warnings that surfaced from using "new" AL headers
* Various whitespace and consistency fixes
Modified: trunk/code/client/snd_mix.c
===================================================================
--- trunk/code/client/snd_mix.c 2005-11-26 07:59:00 UTC (rev 374)
+++ trunk/code/client/snd_mix.c 2005-11-26 15:01:28 UTC (rev 375)
@@ -467,15 +467,14 @@
}
static void S_PaintChannelFrom16( channel_t *ch, const sfx_t *sc, int count, int sampleOffset, int bufferOffset ) {
- #if idppc_altivec
- extern cvar_t *com_altivec;
- if (com_altivec->integer) {
- // must be in a seperate function or G3 systems will crash.
- S_PaintChannelFrom16_altivec( ch, sc, count, sampleOffset, bufferOffset );
- return;
- }
- #endif
- S_PaintChannelFrom16_scalar( ch, sc, count, sampleOffset, bufferOffset );
+#if idppc_altivec
+ if (com_altivec->integer) {
+ // must be in a seperate function or G3 systems will crash.
+ S_PaintChannelFrom16_altivec( ch, sc, count, sampleOffset, bufferOffset );
+ return;
+ }
+#endif
+ S_PaintChannelFrom16_scalar( ch, sc, count, sampleOffset, bufferOffset );
}
void S_PaintChannelFromWavelet( channel_t *ch, sfx_t *sc, int count, int sampleOffset, int bufferOffset ) {
Modified: trunk/code/client/snd_openal.c
===================================================================
--- trunk/code/client/snd_openal.c 2005-11-26 07:59:00 UTC (rev 374)
+++ trunk/code/client/snd_openal.c 2005-11-26 15:01:28 UTC (rev 375)
@@ -847,8 +847,8 @@
// Set up the position and velocity
VectorScale(entityList[entnum].origin, POSITION_SCALE, sorigin);
- qalSourcefv(srcList[src].source, AL_POSITION, sorigin);
- qalSourcefv(srcList[src].source, AL_VELOCITY, velocity);
+ qalSourcefv(srcList[src].source, AL_POSITION, (ALfloat *)sorigin);
+ qalSourcefv(srcList[src].source, AL_VELOCITY, (ALfloat *)velocity);
// Flag it
entityList[entnum].touched = qtrue;
@@ -1067,7 +1067,7 @@
// Create a buffer, and stuff the data into it
qalGenBuffers(1, &buffer);
- qalBufferData(buffer, format, data, (samples * width * channels), rate);
+ qalBufferData(buffer, format, (ALvoid *)data, (samples * width * channels), rate);
// Shove the data onto the streamSource
qalSourceQueueBuffers(streamSource, 1, &buffer);
@@ -1384,7 +1384,7 @@
// Set OpenAL listener paramaters
VectorScale(origin, POSITION_SCALE, sorigin);
- qalListenerfv(AL_POSITION, origin);
+ qalListenerfv(AL_POSITION, (ALfloat *)origin);
qalListenerfv(AL_VELOCITY, velocity);
qalListenerfv(AL_ORIENTATION, orientation);
}
Modified: trunk/code/qcommon/q_platform.h
===================================================================
--- trunk/code/qcommon/q_platform.h 2005-11-26 07:59:00 UTC (rev 374)
+++ trunk/code/qcommon/q_platform.h 2005-11-26 15:01:28 UTC (rev 375)
@@ -39,11 +39,18 @@
#endif
#if (defined(powerc) || defined(powerpc) || defined(ppc) || \
- defined(__ppc) || defined(__ppc__)) && !defined(C_ONLY)
+ defined(__ppc) || defined(__ppc__)) && !defined(C_ONLY)
#define idppc 1
#if defined(__VEC__)
#define idppc_altivec 1
+#ifdef MACOS_X // Apple's GCC does this differently than the FSF.
+#define VECCONST_UINT8(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p) \
+ (vector unsigned char) (a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p)
#else
+#define VECCONST_UINT8(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p) \
+ (vector unsigned char) {a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p}
+#endif
+#else
#define idppc_altivec 0
#endif
#else
@@ -51,14 +58,8 @@
#define idppc_altivec 0
#endif
-#if (MACOS_X) // Apple's GCC does this differently than the FSF.
- #define VECCONST_UINT8(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p) (vector unsigned char) (a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p)
-#else
- #define VECCONST_UINT8(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p) (vector unsigned char) {a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p}
#endif
-#endif
-
#ifndef __ASM_I386__ // don't include the C bits if included from qasm.h
// for windows fastcall option
Modified: trunk/code/qcommon/qcommon.h
===================================================================
--- trunk/code/qcommon/qcommon.h 2005-11-26 07:59:00 UTC (rev 374)
+++ trunk/code/qcommon/qcommon.h 2005-11-26 15:01:28 UTC (rev 375)
@@ -748,6 +748,7 @@
extern cvar_t *com_buildScript; // for building release pak files
extern cvar_t *com_journal;
extern cvar_t *com_cameraMode;
+extern cvar_t *com_altivec;
// both client and server must agree to pause
extern cvar_t *cl_paused;
Modified: trunk/code/renderer/tr_shade.c
===================================================================
--- trunk/code/renderer/tr_shade.c 2005-11-26 07:59:00 UTC (rev 374)
+++ trunk/code/renderer/tr_shade.c 2005-11-26 15:01:28 UTC (rev 375)
@@ -463,11 +463,6 @@
floatColorVec0 = vec_perm(floatColorVec0,floatColorVec0,floatColorVecPerm);
for ( i = 0 ; i < tess.numVertexes ; i++, texCoords += 2, colors += 4 ) {
int clip = 0;
-#define DIST0 dist0
-#define DIST1 dist1
-#define DIST2 dist2
-#define TEXCOORDS0 texCoords0
-#define TEXCOORDS1 texCoords1
vec_t dist0, dist1, dist2;
dist0 = origin0 - tess.xyz[i][0];
@@ -476,42 +471,42 @@
backEnd.pc.c_dlightVertexes++;
- TEXCOORDS0 = 0.5f + DIST0 * scale;
- TEXCOORDS1 = 0.5f + DIST1 * scale;
+ texCoords0 = 0.5f + dist0 * scale;
+ texCoords1 = 0.5f + dist1 * scale;
if( !r_dlightBacks->integer &&
// dist . tess.normal[i]
- ( DIST0 * tess.normal[i][0] +
- DIST1 * tess.normal[i][1] +
- DIST2 * tess.normal[i][2] ) < 0.0f ) {
+ ( dist0 * tess.normal[i][0] +
+ dist1 * tess.normal[i][1] +
+ dist2 * tess.normal[i][2] ) < 0.0f ) {
clip = 63;
} else {
- if ( TEXCOORDS0 < 0.0f ) {
+ if ( texCoords0 < 0.0f ) {
clip |= 1;
- } else if ( TEXCOORDS0 > 1.0f ) {
+ } else if ( texCoords0 > 1.0f ) {
clip |= 2;
}
- if ( TEXCOORDS1 < 0.0f ) {
+ if ( texCoords1 < 0.0f ) {
clip |= 4;
- } else if ( TEXCOORDS1 > 1.0f ) {
+ } else if ( texCoords1 > 1.0f ) {
clip |= 8;
}
- texCoords[0] = TEXCOORDS0;
- texCoords[1] = TEXCOORDS1;
+ texCoords[0] = texCoords0;
+ texCoords[1] = texCoords1;
// modulate the strength based on the height and color
- if ( DIST2 > radius ) {
+ if ( dist2 > radius ) {
clip |= 16;
modulate = 0.0f;
- } else if ( DIST2 < -radius ) {
+ } else if ( dist2 < -radius ) {
clip |= 32;
modulate = 0.0f;
} else {
- DIST2 = Q_fabs(DIST2);
- if ( DIST2 < radius * 0.5f ) {
+ dist2 = Q_fabs(dist2);
+ if ( dist2 < radius * 0.5f ) {
modulate = 1.0f;
} else {
- modulate = 2.0f * (radius - DIST2) * scale;
+ modulate = 2.0f * (radius - dist2) * scale;
}
}
}
@@ -526,11 +521,6 @@
colorChar = vec_sel(colorChar,vSel,vSel); // RGBARGBARGBARGBA replace alpha with 255
vec_ste((vector unsigned int)colorChar,0,(unsigned int *)colors); // store color
}
-#undef DIST0
-#undef DIST1
-#undef DIST2
-#undef TEXCOORDS0
-#undef TEXCOORDS1
// build a list of triangles that need light
numIndexes = 0;
@@ -614,53 +604,48 @@
floatColor[2] = dl->color[2] * 255.0f;
for ( i = 0 ; i < tess.numVertexes ; i++, texCoords += 2, colors += 4 ) {
int clip = 0;
-#define DIST0 dist[0]
-#define DIST1 dist[1]
-#define DIST2 dist[2]
-#define TEXCOORDS0 texCoords[0]
-#define TEXCOORDS1 texCoords[1]
vec3_t dist;
VectorSubtract( origin, tess.xyz[i], dist );
backEnd.pc.c_dlightVertexes++;
- TEXCOORDS0 = 0.5f + DIST0 * scale;
- TEXCOORDS1 = 0.5f + DIST1 * scale;
+ texCoords[0] = 0.5f + dist[0] * scale;
+ texCoords[1] = 0.5f + dist[1] * scale;
if( !r_dlightBacks->integer &&
// dist . tess.normal[i]
- ( DIST0 * tess.normal[i][0] +
- DIST1 * tess.normal[i][1] +
- DIST2 * tess.normal[i][2] ) < 0.0f ) {
+ ( dist[0] * tess.normal[i][0] +
+ dist[1] * tess.normal[i][1] +
+ dist[2] * tess.normal[i][2] ) < 0.0f ) {
clip = 63;
} else {
- if ( TEXCOORDS0 < 0.0f ) {
+ if ( texCoords[0] < 0.0f ) {
clip |= 1;
- } else if ( TEXCOORDS0 > 1.0f ) {
+ } else if ( texCoords[0] > 1.0f ) {
clip |= 2;
}
- if ( TEXCOORDS1 < 0.0f ) {
+ if ( texCoords[1] < 0.0f ) {
clip |= 4;
- } else if ( TEXCOORDS1 > 1.0f ) {
+ } else if ( texCoords[1] > 1.0f ) {
clip |= 8;
}
- texCoords[0] = TEXCOORDS0;
- texCoords[1] = TEXCOORDS1;
+ texCoords[0] = texCoords[0];
+ texCoords[1] = texCoords[1];
// modulate the strength based on the height and color
- if ( DIST2 > radius ) {
+ if ( dist[2] > radius ) {
clip |= 16;
modulate = 0.0f;
- } else if ( DIST2 < -radius ) {
+ } else if ( dist[2] < -radius ) {
clip |= 32;
modulate = 0.0f;
} else {
- DIST2 = Q_fabs(DIST2);
- if ( DIST2 < radius * 0.5f ) {
+ dist[2] = Q_fabs(dist[2]);
+ if ( dist[2] < radius * 0.5f ) {
modulate = 1.0f;
} else {
- modulate = 2.0f * (radius - DIST2) * scale;
+ modulate = 2.0f * (radius - dist[2]) * scale;
}
}
}
@@ -670,11 +655,6 @@
colors[2] = myftol(floatColor[2] * modulate);
colors[3] = 255;
}
-#undef DIST0
-#undef DIST1
-#undef DIST2
-#undef TEXCOORDS0
-#undef TEXCOORDS1
// build a list of triangles that need light
numIndexes = 0;
@@ -719,15 +699,14 @@
}
static void ProjectDlightTexture( void ) {
- #if idppc_altivec
- extern cvar_t *com_altivec;
- if (com_altivec->integer) {
- // must be in a seperate function or G3 systems will crash.
- ProjectDlightTexture_altivec();
- return;
- }
- #endif
- ProjectDlightTexture_scalar();
+#if idppc_altivec
+ if (com_altivec->integer) {
+ // must be in a seperate function or G3 systems will crash.
+ ProjectDlightTexture_altivec();
+ return;
+ }
+#endif
+ ProjectDlightTexture_scalar();
}
Modified: trunk/code/renderer/tr_shade_calc.c
===================================================================
--- trunk/code/renderer/tr_shade_calc.c 2005-11-26 07:59:00 UTC (rev 374)
+++ trunk/code/renderer/tr_shade_calc.c 2005-11-26 15:01:28 UTC (rev 375)
@@ -1219,14 +1219,13 @@
void RB_CalcDiffuseColor( unsigned char *colors )
{
- #if idppc_altivec
- extern cvar_t *com_altivec;
- if (com_altivec->integer) {
- // must be in a seperate function or G3 systems will crash.
- RB_CalcDiffuseColor_altivec( colors );
- return;
- }
- #endif
- RB_CalcDiffuseColor_scalar( colors );
+#if idppc_altivec
+ if (com_altivec->integer) {
+ // must be in a seperate function or G3 systems will crash.
+ RB_CalcDiffuseColor_altivec( colors );
+ return;
+ }
+#endif
+ RB_CalcDiffuseColor_scalar( colors );
}
Modified: trunk/code/renderer/tr_surface.c
===================================================================
--- trunk/code/renderer/tr_surface.c 2005-11-26 07:59:00 UTC (rev 374)
+++ trunk/code/renderer/tr_surface.c 2005-11-26 15:01:28 UTC (rev 375)
@@ -838,28 +838,23 @@
static void LerpMeshVertexes(md3Surface_t *surf, float backlerp)
{
- #if idppc_altivec
-
- // !!! FIXME: figure out what's broken and remove this.
- #ifndef NDEBUG
- static int already_complained = 0;
- if (!already_complained)
- {
- already_complained = 1;
- Com_Printf("WARNING! FIXME! Altivec mesh lerping broken in debug builds!\n");
- }
- #else
- extern cvar_t *com_altivec;
- if (com_altivec->integer) {
- // must be in a seperate function or G3 systems will crash.
- LerpMeshVertexes_altivec( surf, backlerp );
- return;
- }
- #endif
-
- #endif // idppc_altivec
-
- LerpMeshVertexes_scalar( surf, backlerp );
+#if idppc_altivec
+ // !!! FIXME: figure out what's broken and remove this.
+#ifndef NDEBUG
+ static int already_complained = 0;
+ if (!already_complained) {
+ already_complained = 1;
+ Com_Printf("WARNING! FIXME! Altivec mesh lerping broken in debug builds!\n");
+ }
+#else
+ if (com_altivec->integer) {
+ // must be in a seperate function or G3 systems will crash.
+ LerpMeshVertexes_altivec( surf, backlerp );
+ return;
+ }
+#endif
+#endif // idppc_altivec
+ LerpMeshVertexes_scalar( surf, backlerp );
}
Modified: trunk/code/tools/lcc/Makefile
===================================================================
--- trunk/code/tools/lcc/Makefile 2005-11-26 07:59:00 UTC (rev 374)
+++ trunk/code/tools/lcc/Makefile 2005-11-26 15:01:28 UTC (rev 375)
@@ -22,17 +22,8 @@
BUILDDIR=build
BD=$(BUILDDIR)/
-ifeq ($(PLATFORM),darwin)
- LCC_CFLAGS += -DMACOS_X=1
-endif
-
-ifndef USE_CCACHE
- USE_CCACHE=0
-endif
-
ifeq ($(USE_CCACHE),1)
CC := ccache $(CC)
- CXX := ccache $(CXX)
endif
ifeq ($(PLATFORM),SunOS)
Modified: trunk/code/unix/Makefile
===================================================================
--- trunk/code/unix/Makefile 2005-11-26 07:59:00 UTC (rev 374)
+++ trunk/code/unix/Makefile 2005-11-26 15:01:28 UTC (rev 375)
@@ -54,7 +54,7 @@
endif
ifndef USE_CCACHE
-USE_CCACHE=1
+USE_CCACHE=0
endif
export USE_CCACHE
@@ -118,7 +118,6 @@
GLIBC=-glibc
CC=gcc
- CXX=g++
ifeq ($(ARCH),alpha)
ARCH=axp
@@ -138,9 +137,6 @@
BASE_CFLAGS = -Wall -fno-strict-aliasing -Wimplicit -Wstrict-prototypes -pipe
- # Always include debug symbols...you can strip the binary later...
- BASE_CFLAGS += -gfull
-
ifeq ($(USE_OPENAL),1)
BASE_CFLAGS += -DUSE_OPENAL=1
ifeq ($(USE_OPENAL_DLOPEN),1)
@@ -244,12 +240,11 @@
ifeq ($(PLATFORM),darwin)
GLIBC=
CC=gcc
- CXX=g++
VM_PPC=vm_ppc_new
BASE_CFLAGS = -Wall -fno-strict-aliasing -Wimplicit -Wstrict-prototypes
- BASE_CFLAGS += -DMACOS_X=1 -fno-common -pipe
+ BASE_CFLAGS += -DMACOS_X -fno-common -pipe
# Always include debug symbols...you can strip the binary later...
BASE_CFLAGS += -gfull
@@ -269,7 +264,7 @@
OPTIMIZE = -O3 -ffast-math -fomit-frame-pointer -falign-loops=16
ifeq ($(ARCH),ppc)
- BASE_CFLAGS += -faltivec
+ BASE_CFLAGS += -faltivec
ifneq ($(VM_PPC),)
HAVE_VM_COMPILED=true
endif
@@ -300,7 +295,7 @@
ifeq ($(USE_SDL),1)
# We copy sdlmain before ranlib'ing it so that subversion doesn't think
# the file has been modified by each build.
- LIBSDLMAIN=$(B)/libSDLmain.a
+ LIBSDLMAIN=$(B)/libSDLmain.a
LIBSDLMAINSRC=../libs/macosx/libSDLmain.a
CLIENT_LDFLAGS=-framework Cocoa -framework OpenGL ../libs/macosx/libSDL-1.2.0.dylib
else
@@ -345,7 +340,6 @@
GLIBC=-mingw
CC=gcc
- CXX=g++
WINDRES=windres
ifeq ($(ARCH),i386)
@@ -508,7 +502,6 @@
GLIBC= #libc is irrelevant
CC=gcc
- CXX=g++
INSTALL=ginstall
MKDIR=gmkdir
COPYDIR="/usr/local/share/games/quake3"
@@ -636,7 +629,6 @@
ifeq ($(USE_CCACHE),1)
CC := ccache $(CC)
- CXX := ccache $(CXX)
endif
ifneq ($(BUILD_SERVER),1)
@@ -668,7 +660,6 @@
endif
DO_CC=$(CC) $(NOTSHLIBCFLAGS) $(CFLAGS) -o $@ -c $<
-DO_CXX=$(CXX) $(NOTSHLIBCFLAGS) $(CFLAGS) -o $@ -c $<
DO_SMP_CC=$(CC) $(NOTSHLIBCFLAGS) $(CFLAGS) -DSMP -o $@ -c $<
DO_BOT_CC=$(CC) $(NOTSHLIBCFLAGS) $(CFLAGS) -DBOTLIB -o $@ -c $< # $(SHLIBCFLAGS) # bk001212
DO_DEBUG_CC=$(CC) $(NOTSHLIBCFLAGS) $(DEBUG_CFLAGS) -o $@ -c $<
@@ -1007,11 +998,11 @@
$(B)/client/sdl_snd.o \
ifeq ($(ARCH),i386)
- I386OBJS := \
- $(B)/client/ftola.o \
- $(B)/client/snapvectora.o \
- $(B)/client/snd_mixa.o \
- $(B)/client/matha.o \
+ I386OBJS := \
+ $(B)/client/ftola.o \
+ $(B)/client/snapvectora.o \
+ $(B)/client/snd_mixa.o \
+ $(B)/client/matha.o \
Q3POBJ += $(I386OBJS)
Q3POBJ_SMP += $(I386OBJS)
@@ -1344,7 +1335,7 @@
endif
$(B)/$(PLATFORM)q3ded$(BINEXT): $(Q3DOBJ)
- $(CC) -o $@ $(Q3DOBJ) $(LDFLAGS)
+ $(CC) -o $@ $(Q3DOBJ) $(LDFLAGS)
$(B)/ded/sv_bot.o : $(SDIR)/sv_bot.c; $(DO_DED_CC)
$(B)/ded/sv_client.o : $(SDIR)/sv_client.c; $(DO_DED_CC)
@@ -1459,7 +1450,7 @@
Q3CGVMOBJ = $(Q3CGOBJ_:%.o=%.asm) $(B)/baseq3/game/bg_lib.asm
$(B)/baseq3/cgame$(ARCH).$(SHLIBEXT) : $(Q3CGOBJ)
- $(CC) $(SHLIBLDFLAGS) -o $@ $(Q3CGOBJ)
+ $(CC) $(SHLIBLDFLAGS) -o $@ $(Q3CGOBJ)
$(B)/baseq3/vm/cgame.qvm: $(Q3CGVMOBJ) $(CGDIR)/cg_syscalls.asm
$(Q3ASM) -o $@ $(Q3CGVMOBJ) $(CGDIR)/cg_syscalls.asm
@@ -1550,7 +1541,7 @@
Q3GVMOBJ = $(Q3GOBJ_:%.o=%.asm) $(B)/baseq3/game/bg_lib.asm
$(B)/baseq3/qagame$(ARCH).$(SHLIBEXT) : $(Q3GOBJ)
- $(CC) $(SHLIBLDFLAGS) -o $@ $(Q3GOBJ)
+ $(CC) $(SHLIBLDFLAGS) -o $@ $(Q3GOBJ)
$(B)/baseq3/vm/qagame.qvm: $(Q3GVMOBJ) $(GDIR)/g_syscalls.asm
$(Q3ASM) -o $@ $(Q3GVMOBJ) $(GDIR)/g_syscalls.asm
Modified: trunk/code/unix/sdl_glimp.c
===================================================================
--- trunk/code/unix/sdl_glimp.c 2005-11-26 07:59:00 UTC (rev 374)
+++ trunk/code/unix/sdl_glimp.c 2005-11-26 15:01:28 UTC (rev 375)
@@ -267,10 +267,10 @@
// This is a bug in the current SDL/macosx...have to toggle it a few
// times to get the cursor to hide.
- #if defined(MACOS_X)
+#if defined(MACOS_X)
SDL_ShowCursor(1);
SDL_ShowCursor(0);
- #endif
+#endif
}
static void uninstall_grabs(void)
Modified: trunk/code/unix/unix_main.c
===================================================================
--- trunk/code/unix/unix_main.c 2005-11-26 07:59:00 UTC (rev 374)
+++ trunk/code/unix/unix_main.c 2005-11-26 15:01:28 UTC (rev 375)
@@ -364,24 +364,22 @@
static void Sys_DetectAltivec(void)
{
- extern cvar_t *com_altivec;
-
// Only detect if user hasn't forcibly disabled it.
if (com_altivec->integer) {
- #if idppc_altivec
- #if MACOS_X
- {
- long feat = 0;
- OSErr err = Gestalt(gestaltPowerPCProcessorFeatures, &feat);
- if ((err==noErr) && ((1 << gestaltPowerPCHasVectorInstructions) & feat))
- com_altivec->integer = 1;
- }
- #else // !!! FIXME: PowerPC Linux, etc: how to detect?
- com_altivec->integer = 1;
- #endif
- #else
- com_altivec->integer = 0; // not an Altivec system, so never use it.
- #endif
+#if idppc_altivec
+#ifdef MACOS_X
+ long feat = 0;
+ OSErr err = Gestalt(gestaltPowerPCProcessorFeatures, &feat);
+ if ((err==noErr) && ((1 << gestaltPowerPCHasVectorInstructions) & feat)) {
+ Cvar_Set( "com_altivec", "1" );
+ }
+#else // !!! FIXME: PowerPC Linux, etc: how to detect?
+ Cvar_Set( "com_altivec", "1" );
+#endif
+#else
+ // not an Altivec system, so never use it.
+ Cvar_Set( "com_altivec", "0" );
+#endif
}
}
@@ -705,9 +703,9 @@
return;
}
- #if USE_SDL_VIDEO
+#if USE_SDL_VIDEO
SDL_UnloadObject(dllHandle);
- #else
+#else
dlclose( dllHandle );
{
const char* err; // rb010123 - now const
@@ -715,7 +713,7 @@
if ( err != NULL )
Com_Printf ( "Sys_UnloadGame failed on dlclose: \"%s\"!\n", err );
}
- #endif
+#endif
}
@@ -745,11 +743,11 @@
fn = FS_BuildOSPath( base, gamedir, fname );
Com_Printf( "Sys_LoadDll(%s)... \n", fn );
- #if USE_SDL_VIDEO
+#if USE_SDL_VIDEO
libHandle = SDL_LoadObject(fn);
- #else
+#else
libHandle = dlopen( fn, Q_RTLD );
- #endif
+#endif
if(!libHandle) {
Com_Printf( "Sys_LoadDll(%s) failed:\n\"%s\"\n", fn, do_dlerror() );
@@ -827,14 +825,15 @@
#else
Com_Printf ( "Sys_LoadDll(%s) failed dlsym(vmMain):\n\"%s\" !\n", name, err );
#endif
- #if USE_SDL_VIDEO
+#if USE_SDL_VIDEO
SDL_UnloadObject(libHandle);
- #else
+#else
dlclose( libHandle );
err = do_dlerror();
- if ( err != NULL )
+ if ( err != NULL ) {
Com_Printf ( "Sys_LoadDll(%s) failed dlcose:\n\"%s\"\n", name, err );
- #endif
+ }
+#endif
return NULL;
}
More information about the quake3-commits
mailing list