Merge branch 'master' into game/eliteforce

Conflicts:
	code/renderergl1/tr_main.c
	code/renderergl2/tr_main.c
This commit is contained in:
Zack Middleton 2015-07-09 18:42:11 -05:00
commit 6b9a3a47db
17 changed files with 124 additions and 40 deletions

View file

@ -356,7 +356,7 @@ MKDIR=mkdir
EXTRA_FILES=
CLIENT_EXTRA_FILES=
ifneq (,$(findstring "$(PLATFORM)", "linux" "gnu_kfreebsd" "kfreebsd-gnu"))
ifneq (,$(findstring "$(PLATFORM)", "linux" "gnu_kfreebsd" "kfreebsd-gnu" "gnu"))
ifeq ($(ARCH),x86_64)
LIB=lib64
@ -366,6 +366,10 @@ ifneq (,$(findstring "$(PLATFORM)", "linux" "gnu_kfreebsd" "kfreebsd-gnu"))
else
ifeq ($(ARCH),s390x)
LIB=lib64
else
ifeq ($(ARCH),aarch64)
LIB=lib64
endif
endif
endif
endif

View file

@ -36,10 +36,6 @@ ENDIF
ssemask DWORD 0FFFFFFFFh, 0FFFFFFFFh, 0FFFFFFFFh, 00000000h
ssecw DWORD 00001F80h
IFNDEF idx64
fpucw WORD 037Fh
ENDIF
.code
IFDEF idx64

View file

@ -2445,7 +2445,7 @@ int PC_Directive_eval(source_t *source)
token.whitespace_p = source->scriptstack->script_p;
token.endwhitespace_p = source->scriptstack->script_p;
token.linescrossed = 0;
sprintf(token.string, "%d", abs(value));
sprintf(token.string, "%ld", labs(value));
token.type = TT_NUMBER;
token.subtype = TT_INTEGER|TT_LONG|TT_DECIMAL;
PC_UnreadSourceToken(source, &token);
@ -2550,12 +2550,12 @@ int PC_DollarDirective_evalint(source_t *source)
token.whitespace_p = source->scriptstack->script_p;
token.endwhitespace_p = source->scriptstack->script_p;
token.linescrossed = 0;
sprintf(token.string, "%d", abs(value));
sprintf(token.string, "%ld", labs(value));
token.type = TT_NUMBER;
token.subtype = TT_INTEGER|TT_LONG|TT_DECIMAL;
#ifdef NUMBERVALUE
token.intvalue = abs(value);
token.intvalue = labs(value);
token.floatvalue = token.intvalue;
#endif //NUMBERVALUE

View file

@ -428,23 +428,28 @@ Returns waterlevel for entity origin
int CG_WaterLevel(centity_t *cent) {
vec3_t point;
int contents, sample1, sample2, anim, waterlevel;
int viewheight;
// get waterlevel, accounting for ducking
waterlevel = 0;
VectorCopy(cent->lerpOrigin, point);
point[2] += MINS_Z + 1;
anim = cent->currentState.legsAnim & ~ANIM_TOGGLEBIT;
if (anim == LEGS_WALKCR || anim == LEGS_IDLECR) {
point[2] += CROUCH_VIEWHEIGHT;
viewheight = CROUCH_VIEWHEIGHT;
} else {
point[2] += DEFAULT_VIEWHEIGHT;
viewheight = DEFAULT_VIEWHEIGHT;
}
//
// get waterlevel, accounting for ducking
//
waterlevel = 0;
point[0] = cent->lerpOrigin[0];
point[1] = cent->lerpOrigin[1];
point[2] = cent->lerpOrigin[2] + MINS_Z + 1;
contents = CG_PointContents(point, -1);
if (contents & MASK_WATER) {
sample2 = point[2] - MINS_Z;
sample2 = viewheight - MINS_Z;
sample1 = sample2 / 2;
waterlevel = 1;
point[2] = cent->lerpOrigin[2] + MINS_Z + sample1;
@ -489,7 +494,7 @@ void CG_PainEvent( centity_t *cent, int health ) {
snd = "*pain100_1.wav";
}
// play a gurp sound instead of a normal pain sound
if (CG_WaterLevel(cent) >= 1) {
if (CG_WaterLevel(cent) == 3) {
if (rand()&1) {
trap_S_StartSound(NULL, cent->currentState.number, CHAN_VOICE, CG_CustomSound(cent->currentState.number, "sound/player/gurp1.wav"));
} else {
@ -1164,7 +1169,7 @@ void CG_EntityEvent( centity_t *cent, vec3_t position ) {
case EV_DEATH3:
DEBUGNAME("EV_DEATHx");
if (CG_WaterLevel(cent) >= 1) {
if (CG_WaterLevel(cent) == 3) {
trap_S_StartSound(NULL, es->number, CHAN_VOICE, CG_CustomSound(es->number, "*drown.wav"));
} else {
trap_S_StartSound(NULL, es->number, CHAN_VOICE, CG_CustomSound(es->number, va("*death%i.wav", event - EV_DEATH1 + 1)));

View file

@ -480,7 +480,7 @@ static void CG_MapRestart( void ) {
#ifdef MISSIONPACK
if (cg_singlePlayerActive.integer) {
trap_Cvar_Set("ui_matchStartTime", va("%i", cg.time));
if (cg_recordSPDemo.integer && cg_recordSPDemoName.string && *cg_recordSPDemoName.string) {
if (cg_recordSPDemo.integer && *cg_recordSPDemoName.string) {
trap_SendConsoleCommand(va("set g_synchronousclients 1 ; record %s \n", cg_recordSPDemoName.string));
}
}

View file

@ -122,17 +122,6 @@ static ID_INLINE void WRITE_2BYTES( int x )
bufIndex += 2;
}
/*
===============
WRITE_1BYTES
===============
*/
static ID_INLINE void WRITE_1BYTES( int x )
{
buffer[ bufIndex ] = x;
bufIndex += 1;
}
/*
===============
START_CHUNK

View file

@ -94,8 +94,8 @@ typedef struct {
qboolean looping, holdAtEnd, dirty, alterGameState, silent, shader;
fileHandle_t iFile;
e_status status;
unsigned int startTime;
unsigned int lastTime;
int startTime;
int lastTime;
long tfps;
long RoQPlayed;
long ROQSize;

View file

@ -606,10 +606,10 @@ usercmd_t CL_CreateCmd( void ) {
// draw debug graphs of turning for mouse testing
if ( cl_debugMove->integer ) {
if ( cl_debugMove->integer == 1 ) {
SCR_DebugGraph( abs(cl.viewangles[YAW] - oldAngles[YAW]) );
SCR_DebugGraph( fabs(cl.viewangles[YAW] - oldAngles[YAW]) );
}
if ( cl_debugMove->integer == 2 ) {
SCR_DebugGraph( abs(cl.viewangles[PITCH] - oldAngles[PITCH]) );
SCR_DebugGraph( fabs(cl.viewangles[PITCH] - oldAngles[PITCH]) );
}
}

View file

@ -169,14 +169,16 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
//================================================================= LINUX ===
#if defined(__linux__) || defined(__FreeBSD_kernel__)
#if defined(__linux__) || defined(__FreeBSD_kernel__) || defined(__GNU__)
#include <endian.h>
#if defined(__linux__)
#define OS_STRING "linux"
#else
#elif defined(__FreeBSD_kernel__)
#define OS_STRING "kFreeBSD"
#else
#define OS_STRING "GNU"
#endif
#define ID_INLINE inline
@ -205,6 +207,8 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#define ARCH_STRING "sparc"
#elif defined __arm__
#define ARCH_STRING "arm"
#elif defined __aarch64__
#define ARCH_STRING "aarch64"
#elif defined __cris__
#define ARCH_STRING "cris"
#elif defined __hppa__

View file

@ -1012,6 +1012,10 @@ int R_SpriteFogNum( trRefEntity_t *ent ) {
return 0;
}
if ( ent->e.renderfx & RF_CROSSHAIR ) {
return 0;
}
#ifdef ELITEFORCE
radius = ent->e.data.sprite.radius;
#else

View file

@ -1578,6 +1578,23 @@ static qboolean ParseShader( char **text )
return qfalse;
}
if ( r_greyscale->integer )
{
float luminance;
luminance = LUMA( shader.fogParms.color[0], shader.fogParms.color[1], shader.fogParms.color[2] );
VectorSet( shader.fogParms.color, luminance, luminance, luminance );
}
else if ( r_greyscale->value )
{
float luminance;
luminance = LUMA( shader.fogParms.color[0], shader.fogParms.color[1], shader.fogParms.color[2] );
shader.fogParms.color[0] = LERP( shader.fogParms.color[0], luminance, r_greyscale->value );
shader.fogParms.color[1] = LERP( shader.fogParms.color[1], luminance, r_greyscale->value );
shader.fogParms.color[2] = LERP( shader.fogParms.color[2], luminance, r_greyscale->value );
}
token = COM_ParseExt( text, qfalse );
if ( !token[0] )
{

View file

@ -1680,6 +1680,10 @@ int R_SpriteFogNum( trRefEntity_t *ent ) {
return 0;
}
if ( ent->e.renderfx & RF_CROSSHAIR ) {
return 0;
}
#ifdef ELITEFORCE
radius = ent->e.data.sprite.radius;
#else

View file

@ -1866,6 +1866,23 @@ static qboolean ParseShader( char **text )
return qfalse;
}
if ( r_greyscale->integer )
{
float luminance;
luminance = LUMA( shader.fogParms.color[0], shader.fogParms.color[1], shader.fogParms.color[2] );
VectorSet( shader.fogParms.color, luminance, luminance, luminance );
}
else if ( r_greyscale->value )
{
float luminance;
luminance = LUMA( shader.fogParms.color[0], shader.fogParms.color[1], shader.fogParms.color[2] );
shader.fogParms.color[0] = LERP( shader.fogParms.color[0], luminance, r_greyscale->value );
shader.fogParms.color[1] = LERP( shader.fogParms.color[1], luminance, r_greyscale->value );
shader.fogParms.color[2] = LERP( shader.fogParms.color[2], luminance, r_greyscale->value );
}
token = COM_ParseExt( text, qfalse );
if ( !token[0] )
{

View file

@ -130,21 +130,21 @@ static void GLimp_DetectAvailableModes(void)
{
int i, j;
char buf[ MAX_STRING_CHARS ] = { 0 };
size_t numSDLModes;
int numSDLModes;
SDL_Rect *modes;
int numModes = 0;
int display = SDL_GetWindowDisplayIndex( SDL_window );
SDL_DisplayMode windowMode;
int display = SDL_GetWindowDisplayIndex( SDL_window );
numSDLModes = SDL_GetNumDisplayModes( display );
if( SDL_GetWindowDisplayMode( SDL_window, &windowMode ) < 0 )
if( SDL_GetWindowDisplayMode( SDL_window, &windowMode ) < 0 || numSDLModes <= 0 )
{
ri.Printf( PRINT_WARNING, "Couldn't get window display mode, no resolutions detected\n" );
return;
}
numSDLModes = SDL_GetNumDisplayModes( display );
modes = SDL_calloc( numSDLModes, sizeof( SDL_Rect ) );
modes = SDL_calloc( (size_t)numSDLModes, sizeof( SDL_Rect ) );
if ( !modes )
{
ri.Error( ERR_FATAL, "Out of memory" );

View file

@ -410,6 +410,7 @@ char **Sys_ListFiles( const char *directory, const char *extension, char *filter
intptr_t findhandle;
int flag;
int i;
int extLen;
if (filter) {
@ -443,6 +444,8 @@ char **Sys_ListFiles( const char *directory, const char *extension, char *filter
flag = _A_SUBDIR;
}
extLen = strlen( extension );
Com_sprintf( search, sizeof(search), "%s\\*%s", directory, extension );
// search
@ -456,6 +459,14 @@ char **Sys_ListFiles( const char *directory, const char *extension, char *filter
do {
if ( (!wantsubs && flag ^ ( findinfo.attrib & _A_SUBDIR )) || (wantsubs && findinfo.attrib & _A_SUBDIR) ) {
if (*extension) {
if ( strlen( findinfo.name ) < extLen ||
Q_stricmp(
findinfo.name + strlen( findinfo.name ) - extLen,
extension ) ) {
continue; // didn't match
}
}
if ( nfiles == MAX_FOUND_FILES - 1 ) {
break;
}

View file

@ -0,0 +1,30 @@
#!/bin/bash
localPATH=`pwd`
export BUILD_CLIENT="0"
export BUILD_SERVER="1"
export USE_CURL="1"
export USE_CODEC_OPUS="1"
export USE_VOIP="1"
export COPYDIR="~/ioquake3"
IOQ3REMOTE="https://github.com/ioquake/ioq3.git"
IOQ3LOCAL="/tmp/ioquake3compile"
JOPTS="-j2"
echo "This process requires you to have the following installed through your distribution:
make
git
and all of the ioquake3 dependencies necessary for an ioquake3 server.
If you do not have the necessary dependencies this script will bail out.
Please post a message to http://community.ioquake.org/ asking for help and include whatever error messages you received during the compile phase.
Please edit this script. Inside you will find a COPYDIR variable you can alter to change where ioquake3 will be installed to."
while true; do
read -p "Are you ready to compile ioquake3 in the $IOQ3LOCAL directory, and have it installed into $COPYDIR? " yn
case $yn in
[Yy]* )
if [ -x "$(command -v git)" ] && [ -x "$(command -v make)" ] ; then
git clone $IOQ3REMOTE $IOQ3LOCAL && cd $IOQ3LOCAL && make $JOPTS && make copyfiles && cd $localPATH && rm -rf $IOQ3LOCAL
fi
exit;;
[Nn]* ) exit;;
* ) echo "Please answer yes or no.";;
esac
done

View file

@ -0,0 +1,3 @@
#!/bin/sh
echo "Edit this script to change the path to ioquake3's dedicated server executable and which binary if you aren't on x86_64.\n Set the sv_dlURL setting to a url like http://yoursite.com/ioquake3_path for ioquake3 clients to download extra data"
~/ioquake3/ioq3ded.x86_64 +set dedicated 2 +set sv_allowDownload 1 +set sv_dlURL "" +set com_hunkmegs 64