* 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
This commit is contained in:
Tim Angus 2005-11-26 15:01:28 +00:00
parent 877f360812
commit 382c6adb54
11 changed files with 125 additions and 170 deletions

View file

@ -468,7 +468,6 @@ static void S_PaintChannelFrom16_scalar( channel_t *ch, const sfx_t *sc, int cou
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 );

View file

@ -847,8 +847,8 @@ static void S_AL_SrcLoop( alSrcPriority_t priority, sfxHandle_t sfx,
// 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 @@ void S_AL_RawSamples(int samples, int rate, int width, int channels, const byte
// 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 @@ void S_AL_Respatialize( int entityNum, const vec3_t origin, vec3_t axis[3], int
// 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);
}

View file

@ -43,6 +43,13 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#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
@ -51,12 +58,6 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#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

View file

@ -748,6 +748,7 @@ extern cvar_t *com_blood;
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;

View file

@ -463,11 +463,6 @@ static void ProjectDlightTexture_altivec( void ) {
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 @@ static void ProjectDlightTexture_altivec( void ) {
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 @@ static void ProjectDlightTexture_altivec( void ) {
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 @@ static void ProjectDlightTexture_scalar( void ) {
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 @@ static void ProjectDlightTexture_scalar( void ) {
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;
@ -720,7 +700,6 @@ static void ProjectDlightTexture_scalar( void ) {
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();

View file

@ -1220,7 +1220,6 @@ static void RB_CalcDiffuseColor_scalar( unsigned char *colors )
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 );

View file

@ -839,26 +839,21 @@ static void LerpMeshVertexes_scalar(md3Surface_t *surf, float backlerp)
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)
{
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 );
}

View file

@ -22,17 +22,8 @@ RMDIR=rmdir
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)

View file

@ -54,7 +54,7 @@ DXSDK_DIR=C:/DXSDK
endif
ifndef USE_CCACHE
USE_CCACHE=1
USE_CCACHE=0
endif
export USE_CCACHE
@ -118,7 +118,6 @@ ifeq ($(PLATFORM),linux)
GLIBC=-glibc
CC=gcc
CXX=g++
ifeq ($(ARCH),alpha)
ARCH=axp
@ -138,9 +137,6 @@ ifeq ($(PLATFORM),linux)
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 @@ else # ifeq Linux
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
@ -345,7 +340,6 @@ ifeq ($(PLATFORM),mingw32)
GLIBC=-mingw
CC=gcc
CXX=g++
WINDRES=windres
ifeq ($(ARCH),i386)
@ -508,7 +502,6 @@ ifeq ($(PLATFORM),SunOS)
GLIBC= #libc is irrelevant
CC=gcc
CXX=g++
INSTALL=ginstall
MKDIR=gmkdir
COPYDIR="/usr/local/share/games/quake3"
@ -636,7 +629,6 @@ endif #SunOS
ifeq ($(USE_CCACHE),1)
CC := ccache $(CC)
CXX := ccache $(CXX)
endif
ifneq ($(BUILD_SERVER),1)
@ -668,7 +660,6 @@ ifeq ($(GENERATE_DEPENDENCIES),1)
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 $<

View file

@ -364,23 +364,21 @@ void Sys_Quit (void) {
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
{
#ifdef MACOS_X
long feat = 0;
OSErr err = Gestalt(gestaltPowerPCProcessorFeatures, &feat);
if ((err==noErr) && ((1 << gestaltPowerPCHasVectorInstructions) & feat))
com_altivec->integer = 1;
if ((err==noErr) && ((1 << gestaltPowerPCHasVectorInstructions) & feat)) {
Cvar_Set( "com_altivec", "1" );
}
#else // !!! FIXME: PowerPC Linux, etc: how to detect?
com_altivec->integer = 1;
Cvar_Set( "com_altivec", "1" );
#endif
#else
com_altivec->integer = 0; // not an Altivec system, so never use it.
// not an Altivec system, so never use it.
Cvar_Set( "com_altivec", "0" );
#endif
}
}
@ -832,8 +830,9 @@ void *Sys_LoadDll( const char *name, char *fqpath ,
#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
return NULL;