Merge branch 'master' of git://github.com/UberGames/RPG-X2.git

This commit is contained in:
Harry Young 2011-12-03 16:02:18 +01:00
commit f7a4f7443c
5 changed files with 564 additions and 966 deletions

View file

@ -1,7 +1,10 @@
// Copyright (C) 1999-2000 Id Software, Inc. /*
// *
// cg_consolecmds.c -- text commands typed in at the local console, or * Copyright (C) 1999-2000 Id Software, Inc.
// executed by a key binding *
* cg_consolecmds.c -- text commands typed in at the local console, or
* executed by a key binding
*/
#include "cg_local.h" #include "cg_local.h"
@ -88,20 +91,20 @@ static void CG_ClientPos_f ( void )
static void CG_ScoresDown_f( void ) { static void CG_ScoresDown_f( void ) {
if ( cg.scoresRequestTime + 2000 < cg.time ) { if ( cg.scoresRequestTime + 2000 < cg.time ) {
// the scores are more than two seconds out of data, /* the scores are more than two seconds out of data,
// so request new ones so request new ones */
cg.scoresRequestTime = cg.time; cg.scoresRequestTime = cg.time;
trap_SendClientCommand( "score" ); trap_SendClientCommand( "score" );
// leave the current scores up if they were already /* leave the current scores up if they were already
// displayed, but if this is the first hit, clear them out displayed, but if this is the first hit, clear them out */
if ( !cg.showScores ) { if ( !cg.showScores ) {
cg.showScores = qtrue; cg.showScores = qtrue;
cg.numScores = 0; cg.numScores = 0;
} }
} else { } else {
// show the cached contents even if they just pressed if it /* show the cached contents even if they just pressed if it
// is within two seconds is within two seconds */
cg.showScores = qtrue; cg.showScores = qtrue;
} }
} }
@ -141,25 +144,6 @@ static void CG_TellAttacker_f( void ) {
trap_SendClientCommand( command ); trap_SendClientCommand( command );
} }
/*
=================
Cmd_ShakeCamera_f
=================
*/
/*void CG_ShakeCamera_cmd( void ) {
//vec3_t end, start, forward, up;
//gclient_t *client;
//gentity_t *other;
//gentity_t *sayA;
//if ( ent->client->sess.sessionClass != PC_ADMIN ) {
// return;
//}
CG_CameraShake( 300, 30000 );
//AngleVectors(ent->parent->client->ps.viewangles, forward, right, up);
}*/
void CG_Cough_cmd( void ) void CG_Cough_cmd( void )
{ {
CG_Printf(" ,. \n"); CG_Printf(" ..:, :Xt. ,:. \n"); CG_Printf(" ,. \n"); CG_Printf(" ..:, :Xt. ,:. \n");
@ -182,96 +166,6 @@ void CG_Cough_cmd( void )
CG_Printf(" .+tti=,,iIt+;. \n"); CG_Printf(" .:;;:. ,;;;:. \n"); CG_Printf(" .+tti=,,iIt+;. \n"); CG_Printf(" .:;;:. ,;;;:. \n");
} }
/*
static const char* cmdStr[][] =
{ "rankList", "crewman\t - \tCrewman\n
cadet1\t - \tCadet 4th Class\n
cadet2\t - \tCadet 3rd Class\n
cadet3\t - \tCadet 2nd Class\n
cadet4\t - \tCadet 1st Class\n
ensign\t - \tEnsign\n
ltjg\t - \tLieutenant Junior Grade\n
lt\t - \tLieutenant\n
ltcmdr\t - \tLt.Commander\n
cmdr\t - \tCommander\n
capt\t - \tCaptain\n
cmmdr\t - \tCommodore\n
adm2\t - \tRear Admiral\n
adm3\t - \tVice Admiral\n
adm4\t - \tAdmiral\n
adm5\t - \tFleet Admiral\n
-=Use Page Up & Page Down to scroll=-\n" },
{ "classlist", "Command\n
Science\n
Security\n
Engineer\n
Medical\n
Alien\n" },
{ "adminlist", "admins\n
disarm_tripmine\n
drag\n
forcename\n
forcekill\n
forcekillradius\n
forceclass\n
forcerank\n
forcemodel\n
give\n
giveto\n
kicktarget\n
msg\n
n00b\n
revive\n
shake\n
undrag\n
-=Use Page Up & Page Down to scroll=-\n" };*/
/*const char* cmdStr[3][2] =
{
{ "rankList", "crewman\t - \tCrewman\ncadet1\t - \tCadet 4th Class\ncadet2\t - \tCadet 3rd Class\ncadet3\t - \tCadet 2nd Class\ncadet4\t - \tCadet 1st Class\nensign\t - \tEnsign\nltjg\t - \tLieutenant Junior Grade\nlt\t - \tLieutenant\nltcmdr\t - \tLt.Commander\ncmdr\t - \tCommander\ncapt\t - \tCaptain\ncmmdr\t - \tCommodore\nadm2\t - \tRear Admiral\nadm3\t - \tVice Admiral\nadm4\t - \tAdmiral\nadm5\t - \tFleet Admiral\n-=Use Page Up & Page Down to scroll=-\n" },
{ "classlist", "Command\nScience\nSecurity\nEngineer\nMedical\nAlien\n" },
{ "adminlist", "admins\ndisarm_tripmine\ndrag\nforcename\nforcekill\nforcekillradius\nforceclass\nforcerank\nforcemodel\ngive\ngiveto\nkicktarget\nmsg\nn00b\nrevive\nshake\nundrag\n-=Use Page Up & Page Down to scroll=-\n" }
};*/
/*
=========================
CG_CmdList_cmd
TiM: This is to help those keep track
of those freeky huge list of things
we've put in this mod
FIX: Meh... since the majority
of these are dynamic now and need calculation
I'll put them in separate funcs.
=========================
*/
/*void CG_CmdList_cmd ( void ) {
char StrArg[MAX_STRING_CHARS];
int i;
trap_Argv( 1, StrArg, sizeof(StrArg) );
if ( !StrArg[0] ) {
CG_Printf( "\nUsage: Displays a list of commands and variables for easy access\nCommand: cmdList <Name of list to show>\n\nAvailable lists are:\n" );
for ( i = 0; i < sizeof( cmdStr ) / sizeof( cmdStr[0] ); i++ ) {
CG_Printf( "%s\n", cmdStr[i][0] );
}
return;
}
for ( i = 0; i < sizeof( cmdStr ) / sizeof( cmdStr[0]); i++ ) {
if ( !Q_stricmp( StrArg, cmdStr[i][0]) ) {
CG_Printf( "\n%s\n", cmdStr[i][1] );
return;
}
}
CG_Printf( "ERROR: Invalid Argument. Please check for validity and spelling errors.\n" );
}*/
/* /*
========================= =========================
CG_RankList_cmd CG_RankList_cmd
@ -282,14 +176,14 @@ the names of all the ranks we can use ATM
void CG_RankList_cmd( void ) { void CG_RankList_cmd( void ) {
int i; int i;
//Print Titles /* Print Titles */
CG_Printf( S_COLOR_CYAN "RPG-X: Available Ranks\n"); CG_Printf( S_COLOR_CYAN "RPG-X: Available Ranks\n");
CG_Printf( S_COLOR_GREEN "Console Name \t - \t Formal Name\n" ); CG_Printf( S_COLOR_GREEN "Console Name \t - \t Formal Name\n" );
//Loop thru each val and print them /* Loop thru each val and print them */
for ( i = 0; i < MAX_RANKS; i++ ) { for ( i = 0; i < MAX_RANKS; i++ ) {
//if ( strlen( cgs.ranksData[i].consoleName ) < 1 || strlen( cgs.ranksData[i].formalName ) < 1 ) /*if ( strlen( cgs.ranksData[i].consoleName ) < 1 || strlen( cgs.ranksData[i].formalName ) < 1 )
// return; return; */
if ( cgs.ranksData[i].consoleName[0] ) if ( cgs.ranksData[i].consoleName[0] )
CG_Printf( "%s \t - \t %s\n", cgs.ranksData[i].consoleName, cgs.ranksData[i].formalName ); CG_Printf( "%s \t - \t %s\n", cgs.ranksData[i].consoleName, cgs.ranksData[i].formalName );
@ -308,14 +202,14 @@ the names of all the ranks we can use ATM
void CG_ClassList_cmd( void ) { void CG_ClassList_cmd( void ) {
int i; int i;
//Print Titles /* Print Titles */
CG_Printf( S_COLOR_CYAN "RPG-X: Available Classes\n"); CG_Printf( S_COLOR_CYAN "RPG-X: Available Classes\n");
CG_Printf( S_COLOR_GREEN "Formal Name\n" ); CG_Printf( S_COLOR_GREEN "Formal Name\n" );
//Loop thru each val and print them /* Loop thru each val and print them */
for ( i = 0; i < MAX_CLASSES; i++ ) { for ( i = 0; i < MAX_CLASSES; i++ ) {
//if ( strlen( cgs.ranksData[i].consoleName ) < 1 || strlen( cgs.ranksData[i].formalName ) < 1 ) /* if ( strlen( cgs.ranksData[i].consoleName ) < 1 || strlen( cgs.ranksData[i].formalName ) < 1 )
// return; return; */
if ( cgs.classData[i].formalName[0] ) if ( cgs.classData[i].formalName[0] )
CG_Printf( "%s\n", cgs.classData[i].formalName[0] ); CG_Printf( "%s\n", cgs.classData[i].formalName[0] );
@ -337,19 +231,19 @@ void CG_BeamList_cmd( void ) {
const char *locStr; const char *locStr;
int i; int i;
//Print Titles /* Print Titles */
CG_Printf( S_COLOR_CYAN "RPG-X Current Beam Locations\n" ); CG_Printf( S_COLOR_CYAN "RPG-X Current Beam Locations\n" );
CG_Printf( S_COLOR_GREEN "Location Name \t - \t Location Index\n" ); CG_Printf( S_COLOR_GREEN "Location Name \t - \t Location Index\n" );
//Based off the string data that is transmitted to the CG on Init /* Based off the string data that is transmitted to the CG on Init
//Get the name and index of each location Get the name and index of each location */
for ( i = 1; i < MAX_LOCATIONS; i++ ) { for ( i = 1; i < MAX_LOCATIONS; i++ ) {
locStr = CG_ConfigString( CS_LOCATIONS + i ); locStr = CG_ConfigString( CS_LOCATIONS + i );
if ( locStr[0] ) { if ( locStr[0] ) {
CG_Printf( "%s \t - \t%i\n", locStr, i ); CG_Printf( "%s \t - \t%i\n", locStr, i );
} }
locStr = NULL; //reset just in case locStr = NULL; /* reset just in case */
} }
} }
@ -381,8 +275,8 @@ void CG_Emote_f( void ) {
int i; int i;
animation_t *anims; animation_t *anims;
int animLength; int animLength;
//int animLengthUpper; /* int animLengthUpper;
//int animLengthLower; int animLengthLower; */
qboolean emoteFound=qfalse; qboolean emoteFound=qfalse;
argStr = CG_Argv( 1 ); argStr = CG_Argv( 1 );
@ -391,8 +285,8 @@ void CG_Emote_f( void ) {
return; return;
} }
//TiM: Hack override for eyes shut, angry eyes and alert mode. /* TiM: Hack override for eyes shut, angry eyes and alert mode.
//No more data is needed No more data is needed */
if ( !Q_stricmp( argStr, "eyes_shut" ) || !Q_stricmp( argStr, "eyes_frown" ) || !Q_stricmpn( argStr, "alert", 5 ) || !Q_stricmpn( argStr, "alert2", 6 ) ) if ( !Q_stricmp( argStr, "eyes_shut" ) || !Q_stricmp( argStr, "eyes_frown" ) || !Q_stricmpn( argStr, "alert", 5 ) || !Q_stricmpn( argStr, "alert2", 6 ) )
{ {
trap_SendClientCommand( va( "doEmote %s", argStr ) ); trap_SendClientCommand( va( "doEmote %s", argStr ) );
@ -404,9 +298,9 @@ void CG_Emote_f( void ) {
return; return;
} }
//find out emote in the list /* find out emote in the list
//value of numEmotes calced in bg_misc.c value of numEmotes calced in bg_misc.c
//or if an int was supplied as an arg, use that or if an int was supplied as an arg, use that */
/*if ( !argStr[0] >= '0' && argStr[0] <= '9' ) /*if ( !argStr[0] >= '0' && argStr[0] <= '9' )
{ {
i = atoi( argStr ); i = atoi( argStr );
@ -423,7 +317,7 @@ void CG_Emote_f( void ) {
else else
{*/ {*/
for ( i = 0; i < bg_numEmotes; i++ ) for ( i = 0; i < bg_numEmotes; i++ )
{ //i < sizeof( emoteList ) / sizeof( emoteList[0] ) { /* i < sizeof( emoteList ) / sizeof( emoteList[0] ) */
emote = &bg_emoteList[i]; emote = &bg_emoteList[i];
if ( emote && !Q_stricmp( emote->name, argStr ) ) if ( emote && !Q_stricmp( emote->name, argStr ) )
@ -432,7 +326,7 @@ void CG_Emote_f( void ) {
break; break;
} }
} }
//} /*} */
if ( !emoteFound ) { if ( !emoteFound ) {
CG_Printf( S_COLOR_RED "ERROR: Specified emote not found\n" ); CG_Printf( S_COLOR_RED "ERROR: Specified emote not found\n" );
@ -441,25 +335,25 @@ void CG_Emote_f( void ) {
anims = &cg_animsList[cgs.clientinfo[ cg.predictedPlayerState.clientNum ].animIndex].animations[ emote->enumName ]; anims = &cg_animsList[cgs.clientinfo[ cg.predictedPlayerState.clientNum ].animIndex].animations[ emote->enumName ];
//if anim num less than 0, then this is a stub anim /* if anim num less than 0, then this is a stub anim */
if ( !anims || anims->numFrames < 0 ) { if ( !anims || anims->numFrames < 0 ) {
CG_Printf( S_COLOR_RED "ERROR: Current character cannot perform that emote.\n" ); CG_Printf( S_COLOR_RED "ERROR: Current character cannot perform that emote.\n" );
return; return;
} }
//Anim length for lower model /* Anim length for lower model */
if ( !( emote->animFlags & EMOTE_LOOP_UPPER ) && !( emote->animFlags & EMOTE_LOOP_LOWER ) ) { if ( !( emote->animFlags & EMOTE_LOOP_UPPER ) && !( emote->animFlags & EMOTE_LOOP_LOWER ) ) {
//numFrames * (1000 / fps = frameLerp ) = time length /* numFrames * (1000 / fps = frameLerp ) = time length */
animLength = anims->numFrames * anims->frameLerp; animLength = anims->numFrames * anims->frameLerp;
} }
else { else {
animLength = -1; animLength = -1;
} }
//send the command to the server /* send the command to the server */
trap_SendClientCommand( va( "doEmote %i %i", i, animLength ) ); trap_SendClientCommand( va( "doEmote %i %i", i, animLength ) );
//add this emote to the emotes recently played menu /* add this emote to the emotes recently played menu */
{ {
int j; int j;
char* cvar; char* cvar;
@ -469,10 +363,10 @@ void CG_Emote_f( void ) {
for ( j = 1; j <= NUM_CVAR_STORES; j++ ) { for ( j = 1; j <= NUM_CVAR_STORES; j++ ) {
cvar = va( "ui_recentEmote%i", j ); cvar = va( "ui_recentEmote%i", j );
//found a free slot /* found a free slot */
trap_Cvar_VariableStringBuffer( cvar, buffer, 256 ); trap_Cvar_VariableStringBuffer( cvar, buffer, 256 );
//oh this emote's already here... no point adding it again /* oh this emote's already here... no point adding it again */
if ( atoi(buffer) == i ) { if ( atoi(buffer) == i ) {
foundSlot = qtrue; foundSlot = qtrue;
break; break;
@ -485,7 +379,7 @@ void CG_Emote_f( void ) {
} }
} }
//whup... no slot found. better push them all forward one /* whup... no slot found. better push them all forward one */
if ( !foundSlot ) { if ( !foundSlot ) {
char* cvar2; char* cvar2;
@ -730,7 +624,7 @@ void CG_ThirdPersonPitchUpUp_f ( void ) {
} }
//------------------------------------------------------------------------------ /*------------------------------------------------------------------------------*/
const char* cVars[] = { "cg_thirdPersonRange", "cg_thirdPersonAngle", const char* cVars[] = { "cg_thirdPersonRange", "cg_thirdPersonAngle",
"cg_thirdPersonVertOffset", "cg_thirdPersonHorzOffset", "cg_thirdPersonVertOffset", "cg_thirdPersonHorzOffset",
@ -740,8 +634,8 @@ vmCvar_t* TPSVars[] = { &cg_thirdPersonRange, &cg_thirdPersonAngle,
&cg_thirdPersonVertOffset, &cg_thirdPersonHorzOffset, &cg_thirdPersonVertOffset, &cg_thirdPersonHorzOffset,
&cg_thirdPersonPitchOffset }; &cg_thirdPersonPitchOffset };
//Set the third person values back to their hard-coded CVAR counter parts /* Set the third person values back to their hard-coded CVAR counter parts
//Ie revert any temporary changes. Ie revert any temporary changes. */
void CG_ThirdPersonRevert_f ( void ) { void CG_ThirdPersonRevert_f ( void ) {
int i; int i;
@ -750,14 +644,16 @@ void CG_ThirdPersonRevert_f ( void ) {
for (i = 0; i < 5; i++ ){ for (i = 0; i < 5; i++ ){
trap_Cvar_VariableStringBuffer ( cVars[i], value, sizeof( value ) ); trap_Cvar_VariableStringBuffer ( cVars[i], value, sizeof( value ) );
TPSVars[i]->value = atof( value ); TPSVars[i]->value = atof( value );
//Q_strncpyz( TPSVars[i]->string, value, 256 ); /* Q_strncpyz( TPSVars[i]->string, value, 256 ); */
} }
} }
//TiM : If the default values for these CVARs are changed in cg_main.c, update them here. /*
//I would consider linking directly to the values, but with scope, and then locating them in the * TiM : If the default values for these CVARs are changed in cg_main.c, update them here.
//struct array, this is way faster. * I would consider linking directly to the values, but with scope, and then locating them in the
//Resets the values to the game's defaults. Useful if you screwed up the view big time. * struct array, this is way faster.
* Resets the values to the game's defaults. Useful if you screwed up the view big time.
*/
void CG_ThirdPersonReset_f ( void ) { void CG_ThirdPersonReset_f ( void ) {
int defValues[] = { 80, 0, 16, 0, 0 }; int defValues[] = { 80, 0, 16, 0, 0 };
int i; int i;
@ -768,8 +664,10 @@ void CG_ThirdPersonReset_f ( void ) {
} }
} }
//Takes the current values from all of the thirdperson pointer variables, and sets the /*
//hard coded CVARs to the same value, effectively making them permanent * Takes the current values from all of the thirdperson pointer variables, and sets the
* hard coded CVARs to the same value, effectively making them permanent
*/
void CG_ThirdPersonCommit_f ( void ) { void CG_ThirdPersonCommit_f ( void ) {
int i; int i;
@ -780,43 +678,42 @@ void CG_ThirdPersonCommit_f ( void ) {
//since no screen changes occur. Let the user know something happened. //since no screen changes occur. Let the user know something happened.
} }
//Toggles between first and third person /* Toggles between first and third person */
void CG_ToggleThirdPerson_f ( void ) { void CG_ToggleThirdPerson_f ( void ) {
int value; int value;
value = !( cg_thirdPerson.integer > 0 ); //This is cool. It'll toggle the value each call. value = !( cg_thirdPerson.integer > 0 ); /* This is cool. It'll toggle the value each call. */
trap_Cvar_Set( "cg_thirdPerson", va( "%i", value ) ); trap_Cvar_Set( "cg_thirdPerson", va( "%i", value ) );
} }
//TiM - Test the ability to handle binary data streams /*TiM - Test the ability to handle binary data streams
//void CG_LoadBinaryData( void ) void CG_LoadBinaryData( void )
//{ {
// const char *fileRoute = "rpgx.idkey"; const char *fileRoute = "rpgx.idkey";
// fileHandle_t f; fileHandle_t f;
// int len; int len;
// byte buffer[SECURITY_SIZE]; byte buffer[SECURITY_SIZE];
// rpgxSecurityFile_t *c; rpgxSecurityFile_t *c;
//
// if (!fileRoute)
// return;
//
// len = trap_FS_FOpenFile( fileRoute, &f, FS_READ );
//
// if ( !len )
// return;
//
// trap_FS_Read( buffer, len, f );
//
// trap_FS_FCloseFile( f );
//
// c = (rpgxSecurityFile_t *)((byte *)buffer);
//
// CG_Printf( "ID: %i, Hash: %i, PID: %i\n", c->ID, c->hash > 0xFFFF ? 1 : 0, c->playerID > 0xFFFF ? 1 : 0);
// CG_Printf( "%i\n", (unsigned)atoi( sv_securityHash.string ) > 0xFFFF ? 1 : 0 );
//}
//================================================================================ if (!fileRoute)
return;
len = trap_FS_FOpenFile( fileRoute, &f, FS_READ );
if ( !len )
return;
trap_FS_Read( buffer, len, f );
trap_FS_FCloseFile( f );
c = (rpgxSecurityFile_t *)((byte *)buffer);
CG_Printf( "ID: %i, Hash: %i, PID: %i\n", c->ID, c->hash > 0xFFFF ? 1 : 0, c->playerID > 0xFFFF ? 1 : 0);
CG_Printf( "%i\n", (unsigned)atoi( sv_securityHash.string ) > 0xFFFF ? 1 : 0 );
}*/
/*================================================================================*/
typedef struct { typedef struct {
char *cmd; char *cmd;
@ -836,32 +733,32 @@ static consoleCommand_t commands[] = {
{ "+zoom", CG_ZoomDown_f }, { "+zoom", CG_ZoomDown_f },
{ "-zoom", CG_ZoomUp_f }, { "-zoom", CG_ZoomUp_f },
//TiM : Modelview code /* TiM : Modelview code */
{ "+thirdPersonForward", CG_ThirdPersonForwardDown_f }, //moving the camera forward { "+thirdPersonForward", CG_ThirdPersonForwardDown_f }, /* moving the camera forward */
{ "-thirdPersonForward", CG_ThirdPersonForwardUp_f }, { "-thirdPersonForward", CG_ThirdPersonForwardUp_f },
{ "+thirdPersonBackward", CG_ThirdPersonBackwardDown_f }, //moving the camera backward { "+thirdPersonBackward", CG_ThirdPersonBackwardDown_f }, /* moving the camera backward */
{ "-thirdPersonBackward", CG_ThirdPersonBackwardUp_f }, { "-thirdPersonBackward", CG_ThirdPersonBackwardUp_f },
{ "+thirdPersonLeft", CG_ThirdPersonLeftDown_f }, //moving the camera left { "+thirdPersonLeft", CG_ThirdPersonLeftDown_f }, /* moving the camera left */
{ "-thirdPersonLeft", CG_ThirdPersonLeftUp_f }, { "-thirdPersonLeft", CG_ThirdPersonLeftUp_f },
{ "+thirdPersonRight", CG_ThirdPersonRightDown_f }, //moving the camera right { "+thirdPersonRight", CG_ThirdPersonRightDown_f }, /* moving the camera right */
{ "-thirdPersonRight", CG_ThirdPersonRightUp_f }, { "-thirdPersonRight", CG_ThirdPersonRightUp_f },
{ "+thirdPersonUp", CG_ThirdPersonUpDown_f }, //moving the camera up { "+thirdPersonUp", CG_ThirdPersonUpDown_f }, /* moving the camera up */
{ "-thirdPersonUp", CG_ThirdPersonUpUp_f }, { "-thirdPersonUp", CG_ThirdPersonUpUp_f },
{ "+thirdPersonDown", CG_ThirdPersonDownDown_f }, //moving the camera down { "+thirdPersonDown", CG_ThirdPersonDownDown_f }, /* moving the camera down */
{ "-thirdPersonDown", CG_ThirdPersonDownUp_f }, { "-thirdPersonDown", CG_ThirdPersonDownUp_f },
{ "+thirdPersonAngleLeft", CG_ThirdPersonAngleLeftDown_f }, //rotating the camera left { "+thirdPersonAngleLeft", CG_ThirdPersonAngleLeftDown_f }, /* rotating the camera left */
{ "-thirdPersonAngleLeft", CG_ThirdPersonAngleLeftUp_f }, { "-thirdPersonAngleLeft", CG_ThirdPersonAngleLeftUp_f },
{ "+thirdPersonAngleRight", CG_ThirdPersonAngleRightDown_f }, //rotating the camera right { "+thirdPersonAngleRight", CG_ThirdPersonAngleRightDown_f }, /* rotating the camera right */
{ "-thirdPersonAngleRight", CG_ThirdPersonAngleRightUp_f }, { "-thirdPersonAngleRight", CG_ThirdPersonAngleRightUp_f },
{ "+thirdPersonPitchDown", CG_ThirdPersonPitchDownDown_f }, //pitching the camera down { "+thirdPersonPitchDown", CG_ThirdPersonPitchDownDown_f }, /* pitching the camera down */
{ "-thirdPersonPitchDown", CG_ThirdPersonPitchDownUp_f }, { "-thirdPersonPitchDown", CG_ThirdPersonPitchDownUp_f },
{ "+thirdPersonPitchUp", CG_ThirdPersonPitchUpDown_f }, //pitching the camera up { "+thirdPersonPitchUp", CG_ThirdPersonPitchUpDown_f }, /* pitching the camera up */
{ "-thirdPersonPitchUp", CG_ThirdPersonPitchUpUp_f }, { "-thirdPersonPitchUp", CG_ThirdPersonPitchUpUp_f },
{ "thirdPersonRevert", CG_ThirdPersonRevert_f }, //revert current view to previous settings { "thirdPersonRevert", CG_ThirdPersonRevert_f }, /* revert current view to previous settings */
{ "thirdPersonReset", CG_ThirdPersonReset_f }, //reset values to CVAR defaults { "thirdPersonReset", CG_ThirdPersonReset_f }, /* reset values to CVAR defaults */
{ "thirdPersonCommit", CG_ThirdPersonCommit_f }, //set CVARs to current settings { "thirdPersonCommit", CG_ThirdPersonCommit_f }, /* set CVARs to current settings */
{ "thirdPerson", CG_ToggleThirdPerson_f }, //Toggle the 3rd persn CVAR { "thirdPerson", CG_ToggleThirdPerson_f }, /* Toggle the 3rd persn CVAR */
//TiM /* TiM */
{ "clientPos", CG_ClientPos_f }, { "clientPos", CG_ClientPos_f },
{ "sizeup", CG_SizeUp_f }, { "sizeup", CG_SizeUp_f },
@ -872,18 +769,18 @@ static consoleCommand_t commands[] = {
{ "tell_target", CG_TellTarget_f }, { "tell_target", CG_TellTarget_f },
{ "tell_attacker", CG_TellAttacker_f }, { "tell_attacker", CG_TellAttacker_f },
{ "tcmd", CG_TargetCommand_f }, { "tcmd", CG_TargetCommand_f },
{ "loaddefered", CG_LoadDeferredPlayers }, // spelled wrong, but not changing for demo... { "loaddefered", CG_LoadDeferredPlayers }, /* spelled wrong, but not changing for demo... */
{ "+analysis", CG_ObjectivesDown_f }, { "+analysis", CG_ObjectivesDown_f },
{ "-analysis", CG_ObjectivesUp_f }, { "-analysis", CG_ObjectivesUp_f },
//{ "+shake", CG_ShakeCamera_cmd }, /*{ "+shake", CG_ShakeCamera_cmd },*/
{ "iloverpg-x", CG_Cough_cmd }, { "iloverpg-x", CG_Cough_cmd },
//{ "commandList", CG_CmdList_cmd }, /*{ "commandList", CG_CmdList_cmd },*/
{ "rankList", CG_RankList_cmd }, { "rankList", CG_RankList_cmd },
{ "locationList", CG_BeamList_cmd }, { "locationList", CG_BeamList_cmd },
{ "classList", CG_ClassList_cmd }, { "classList", CG_ClassList_cmd },
{ "emote", CG_Emote_f }, { "emote", CG_Emote_f },
{ "locedit", CG_LocEdit_f }, { "locedit", CG_LocEdit_f },
//{ "fileID", CG_LoadBinaryData } /*{ "fileID", CG_LoadBinaryData }*/
}; };
@ -926,25 +823,26 @@ void CG_InitConsoleCommands( void ) {
trap_AddCommand( commands[i].cmd ); trap_AddCommand( commands[i].cmd );
} }
// /*
// the game server will interpret these commands, which will be automatically * the game server will interpret these commands, which will be automatically
// forwarded to the server after they are not recognized locally * forwarded to the server after they are not recognized locally
// *
// TiM: This trap command also adds the commands to the 'tab list' that users can * TiM: This trap command also adds the commands to the 'tab list' that users can
// use thru the console, so adding any and all game side commands (that we want the users to know about/access of course lol ;P ) * use thru the console, so adding any and all game side commands (that we want the users to know about/access of course lol ;P )
// would be a good idea too. :) * would be a good idea too. :)
*/
trap_AddCommand ("kill"); trap_AddCommand ("kill");
trap_AddCommand ("say"); trap_AddCommand ("say");
trap_AddCommand ("say_team"); trap_AddCommand ("say_team");
// START MOD /* START MOD */
trap_AddCommand ("say_class"); trap_AddCommand ("say_class");
//trap_AddCommand ("giveTo"); /*trap_AddCommand ("giveTo");*/
trap_AddCommand ("forceName"); trap_AddCommand ("forceName");
trap_AddCommand ("forceKill"); trap_AddCommand ("forceKill");
trap_AddCommand ("forceKillRadius"); trap_AddCommand ("forceKillRadius");
trap_AddCommand ("forceClass"); trap_AddCommand ("forceClass");
trap_AddCommand ("kickTarget"); trap_AddCommand ("kickTarget");
// END MOD /* END MOD */
trap_AddCommand ("give"); trap_AddCommand ("give");
trap_AddCommand ("god"); trap_AddCommand ("god");
trap_AddCommand ("notarget"); trap_AddCommand ("notarget");
@ -957,9 +855,9 @@ void CG_InitConsoleCommands( void ) {
trap_AddCommand ("setviewpos"); trap_AddCommand ("setviewpos");
trap_AddCommand ("vote"); trap_AddCommand ("vote");
trap_AddCommand ("callvote"); trap_AddCommand ("callvote");
trap_AddCommand ("loaddeferred"); // spelled wrong, but not changing for demo trap_AddCommand ("loaddeferred"); /* spelled wrong, but not changing for demo */
//TiM - uh START MOD AGAIN /*TiM - uh START MOD AGAIN */
trap_AddCommand("laser"); trap_AddCommand("laser");
trap_AddCommand("flashlight"); trap_AddCommand("flashlight");
trap_AddCommand("cloak"); trap_AddCommand("cloak");
@ -971,7 +869,7 @@ void CG_InitConsoleCommands( void ) {
trap_AddCommand("shake"); trap_AddCommand("shake");
trap_AddCommand("drag"); trap_AddCommand("drag");
trap_AddCommand("undrag"); trap_AddCommand("undrag");
trap_AddCommand("flushTripmines"); //disarm_tripmines trap_AddCommand("flushTripmines"); /* disarm_tripmines */
trap_AddCommand("rank"); trap_AddCommand("rank");
trap_AddCommand("forceRank"); trap_AddCommand("forceRank");
trap_AddCommand("forceModel"); trap_AddCommand("forceModel");
@ -1011,17 +909,23 @@ void CG_InitConsoleCommands( void ) {
trap_AddCommand("mapsList"); trap_AddCommand("mapsList");
//END MOD AGAIN /*
//TiM - May I just say. WOAH! THAT'S A LOT!! O_O! * END MOD AGAIN
* TiM - May I just say. WOAH! THAT'S A LOT!! O_O!
*/
//START MOD AGAIN - xD /*
//by Marcin - 04/12/2008 * START MOD AGAIN - xD
* by Marcin - 04/12/2008
*/
trap_AddCommand("drop"); trap_AddCommand("drop");
trap_AddCommand("flushDropped"); trap_AddCommand("flushDropped");
//END MOD /* END MOD */
//START MOD ANOTHER TIME AGAIN xD /*
//GSIO01 | 08/05/2009 * START MOD ANOTHER TIME xD
* GSIO01 | 08/05/2009
*/
trap_AddCommand("lock"); trap_AddCommand("lock");
trap_AddCommand("ffColor"); trap_AddCommand("ffColor");
trap_AddCommand("remodulate"); trap_AddCommand("remodulate");
@ -1043,11 +947,11 @@ void CG_InitConsoleCommands( void ) {
trap_AddCommand("spawnTEnt"); trap_AddCommand("spawnTEnt");
trap_AddCommand("flushTEnts"); trap_AddCommand("flushTEnts");
//XPRERIMENTAL /* XPRERIMENTAL */
trap_AddCommand("universalTrans"); trap_AddCommand("universalTrans");
//END MOD /* END MOD */
//temp /* temp */
trap_AddCommand("ui_holodeck"); trap_AddCommand("ui_holodeck");
#ifdef XTRA #ifdef XTRA
@ -1062,7 +966,7 @@ void CG_InitConsoleCommands( void ) {
trap_AddCommand("lua_status"); trap_AddCommand("lua_status");
#endif #endif
// CCAM /* CCAM */
trap_AddCommand("camtest"); trap_AddCommand("camtest");
trap_AddCommand("camtestend"); trap_AddCommand("camtestend");
} }

View file

@ -1,22 +1,26 @@
// Copyright (C) 1999-2000 Id Software, Inc. /*
// * Copyright (C) 1999-2000 Id Software, Inc.
// cg_draw.c -- draw all of the graphical elements during *
// active (after loading) gameplay * cg_draw.c -- draw all of the graphical elements during
* active (after loading) gameplay
*/
#include "cg_local.h" #include "cg_local.h"
#include "cg_text.h" #include "cg_text.h"
#include "cg_screenfx.h" #include "cg_screenfx.h"
// set in CG_ParseTeamInfo /* set in CG_ParseTeamInfo */
int sortedTeamPlayers[TEAM_MAXOVERLAY]; int sortedTeamPlayers[TEAM_MAXOVERLAY];
int numSortedTeamPlayers; int numSortedTeamPlayers;
int drawTeamOverlayModificationCount = -1; int drawTeamOverlayModificationCount = -1;
//TiM: dCross /*
//qboolean CG_WorldCoordToScreenCoord(vec3_t worldCoord, float *x, float *y, qboolean clamp); * TiM: dCross
//end dCross * qboolean CG_WorldCoordToScreenCoord(vec3_t worldCoord, float *x, float *y, qboolean clamp);
* end dCross
*/
//TiM: Tricorder Parameters /* TiM: Tricorder Parameters */
vec3_t vfwd; vec3_t vfwd;
vec3_t vright; vec3_t vright;
vec3_t vup; vec3_t vup;
@ -31,7 +35,7 @@ extern void InitPostGameMenuStruct();
static void CG_InterfaceStartup(); static void CG_InterfaceStartup();
char *ingame_text[IGT_MAX]; // Holds pointers to ingame text char *ingame_text[IGT_MAX]; /* Holds pointers to ingame text */
int zoomFlashTime=0; int zoomFlashTime=0;
@ -43,58 +47,58 @@ int zoomFlashTime=0;
interfacegraphics_s interface_graphics[IG_MAX] = interfacegraphics_s interface_graphics[IG_MAX] =
{ {
// type timer x y width height file/text graphic, min max color style ptr /* type timer x y width height file/text graphic, min max color style ptr */
{ SG_VAR, 0.0, 0, 0, 0, 0, NULL, 0, 0, 0, CT_NONE, 0 }, // IG_GROW { SG_VAR, 0.0, 0, 0, 0, 0, NULL, 0, 0, 0, CT_NONE, 0 }, /* IG_GROW */
{ SG_VAR, 0.0, 0, 0, 0, 0, NULL, 0, 0, 0, CT_NONE, 0 }, // IG_HEALTH_START { SG_VAR, 0.0, 0, 0, 0, 0, NULL, 0, 0, 0, CT_NONE, 0 }, /* IG_HEALTH_START */
{ SG_GRAPHIC, 0.0, 5, 429, 32, 64, "gfx/interface/rpgx_healthbar_leftcorner", 0, 0, 0, CT_DKBROWN1, 0 }, // IG_HEALTH_BEGINCAP { SG_GRAPHIC, 0.0, 5, 429, 32, 64, "gfx/interface/rpgx_healthbar_leftcorner", 0, 0, 0, CT_DKBROWN1, 0 }, /* IG_HEALTH_BEGINCAP */
{ SG_GRAPHIC, 0.0, 64, 429, 6, 25, "gfx/interface/ammobar", 0, 0, 0, CT_DKBROWN1, 0 }, // IG_HEALTH_BOX1 { SG_GRAPHIC, 0.0, 64, 429, 6, 25, "gfx/interface/ammobar", 0, 0, 0, CT_DKBROWN1, 0 }, /* IG_HEALTH_BOX1 */
{ SG_GRAPHIC, 0.0, 72, 429, 0, 25, "gfx/interface/ammobar", 0, 0, 0, CT_LTBROWN1, 0 }, // IG_HEALTH_SLIDERFULL { SG_GRAPHIC, 0.0, 72, 429, 0, 25, "gfx/interface/ammobar", 0, 0, 0, CT_LTBROWN1, 0 }, /* IG_HEALTH_SLIDERFULL */
{ SG_GRAPHIC, 0.0, 0, 429, 0, 25, "gfx/interface/ammobar", 0, 0, 0, CT_DKBROWN1, 0 }, // IG_HEALTH_SLIDEREMPTY { SG_GRAPHIC, 0.0, 0, 429, 0, 25, "gfx/interface/ammobar", 0, 0, 0, CT_DKBROWN1, 0 }, /* IG_HEALTH_SLIDEREMPTY */
{ SG_GRAPHIC, 0.0, 72, 429, 16, 32, "gfx/interface/rpgx_healthbar_endcap", 0, 0, 147, CT_DKBROWN1, 0 }, // IG_HEALTH_ENDCAP { SG_GRAPHIC, 0.0, 72, 429, 16, 32, "gfx/interface/rpgx_healthbar_endcap", 0, 0, 147, CT_DKBROWN1, 0 }, /* IG_HEALTH_ENDCAP */
{ SG_NUMBER, 0.0, 23, 425, 16, 32, NULL, 0, 0, 0, CT_LTBROWN1, NUM_FONT_BIG }, // IG_HEALTH_COUNT { SG_NUMBER, 0.0, 23, 425, 16, 32, NULL, 0, 0, 0, CT_LTBROWN1, NUM_FONT_BIG }, /* IG_HEALTH_COUNT */
{ SG_VAR, 0.0, 0, 0, 0, 0, NULL, 0, 0, 0, CT_NONE, 0 }, // IG_HEALTH_END { SG_VAR, 0.0, 0, 0, 0, 0, NULL, 0, 0, 0, CT_NONE, 0 }, /* IG_HEALTH_END */
{ SG_VAR, 0.0, 0, 0, 0, 0, NULL, 0, 0, 0, CT_NONE, 0 }, // IG_ARMOR_START { SG_VAR, 0.0, 0, 0, 0, 0, NULL, 0, 0, 0, CT_NONE, 0 }, /* IG_ARMOR_START */
{ SG_GRAPHIC, 0.0, 20, 458, 32, 16, "gfx/interface/armorcap1", 0, 0, 0, CT_DKPURPLE1, 0 }, // IG_ARMOR_BEGINCAP { SG_GRAPHIC, 0.0, 20, 458, 32, 16, "gfx/interface/armorcap1", 0, 0, 0, CT_DKPURPLE1, 0 }, /* IG_ARMOR_BEGINCAP */
{ SG_GRAPHIC, 0.0, 64, 458, 6, 12, "gfx/interface/ammobar", 0, 0, 0, CT_DKPURPLE1, 0 }, // IG_ARMOR_BOX1 { SG_GRAPHIC, 0.0, 64, 458, 6, 12, "gfx/interface/ammobar", 0, 0, 0, CT_DKPURPLE1, 0 }, /* IG_ARMOR_BOX1 */
{ SG_GRAPHIC, 0.0, 72, 458, 0, 12, "gfx/interface/ammobar", 0, 0, 0, CT_LTPURPLE1, 0 }, // IG_ARMOR_SLIDERFULL { SG_GRAPHIC, 0.0, 72, 458, 0, 12, "gfx/interface/ammobar", 0, 0, 0, CT_LTPURPLE1, 0 }, /* IG_ARMOR_SLIDERFULL */
{ SG_GRAPHIC, 0.0, 0, 458, 0, 12, "gfx/interface/ammobar", 0, 0, 0, CT_DKPURPLE1, 0 }, // IG_ARMOR_SLIDEREMPTY { SG_GRAPHIC, 0.0, 0, 458, 0, 12, "gfx/interface/ammobar", 0, 0, 0, CT_DKPURPLE1, 0 }, /* IG_ARMOR_SLIDEREMPTY */
{ SG_GRAPHIC, 0.0, 72, 458, 16, 16, "gfx/interface/armorcap2", 0, 0, 147, CT_DKPURPLE1, 0 }, // IG_ARMOR_ENDCAP { SG_GRAPHIC, 0.0, 72, 458, 16, 16, "gfx/interface/armorcap2", 0, 0, 147, CT_DKPURPLE1, 0 }, /* IG_ARMOR_ENDCAP */
{ SG_NUMBER, 0.0, 44, 458, 16, 16, NULL, 0, 0, 0, CT_LTPURPLE1, NUM_FONT_SMALL }, // IG_ARMOR_COUNT { SG_NUMBER, 0.0, 44, 458, 16, 16, NULL, 0, 0, 0, CT_LTPURPLE1, NUM_FONT_SMALL }, /* IG_ARMOR_COUNT */
{ SG_VAR, 0.0, 0, 0, 0, 0, NULL, 0, 0, 0, CT_NONE, 0 }, // IG_ARMOR_END { SG_VAR, 0.0, 0, 0, 0, 0, NULL, 0, 0, 0, CT_NONE, 0 }, /* IG_ARMOR_END */
{ SG_VAR, 0.0, 0, 0, 0, 0, NULL, 0, 0, 0, CT_NONE, 0 }, // IG_AMMO_START { SG_VAR, 0.0, 0, 0, 0, 0, NULL, 0, 0, 0, CT_NONE, 0 }, /* IG_AMMO_START */
{ SG_GRAPHIC, 0.0, 613, 429, 32, 64, "gfx/interface/ammouppercap1", 0, 0, 0, CT_LTPURPLE2, 0 }, // IG_AMMO_UPPER_BEGINCAP { SG_GRAPHIC, 0.0, 613, 429, 32, 64, "gfx/interface/ammouppercap1", 0, 0, 0, CT_LTPURPLE2, 0 }, /* IG_AMMO_UPPER_BEGINCAP */
{ SG_GRAPHIC, 0.0, 607, 429, 16, 32, "gfx/interface/ammouppercap2", 0, 0, 572, CT_LTPURPLE2, 0 }, // IG_AMMO_UPPER_ENDCAP { SG_GRAPHIC, 0.0, 607, 429, 16, 32, "gfx/interface/ammouppercap2", 0, 0, 572, CT_LTPURPLE2, 0 }, /* IG_AMMO_UPPER_ENDCAP */
{ SG_GRAPHIC, 0.0, 613, 458, 16, 16, "gfx/interface/ammolowercap1", 0, 0, 0, CT_LTPURPLE2, 0 }, // IG_AMMO_LOWER_BEGINCAP { SG_GRAPHIC, 0.0, 613, 458, 16, 16, "gfx/interface/ammolowercap1", 0, 0, 0, CT_LTPURPLE2, 0 }, /* IG_AMMO_LOWER_BEGINCAP */
{ SG_GRAPHIC, 0.0, 578, 458, 0, 12, "gfx/interface/ammobar", 0, 0, 0, CT_LTPURPLE1, 0 }, // IG_AMMO_SLIDERFULL { SG_GRAPHIC, 0.0, 578, 458, 0, 12, "gfx/interface/ammobar", 0, 0, 0, CT_LTPURPLE1, 0 }, /* IG_AMMO_SLIDERFULL */
{ SG_GRAPHIC, 0.0, 0, 458, 0, 12, "gfx/interface/ammobar", 0, 0, 0, CT_DKPURPLE1, 0 }, // IG_AMMO_SLIDEREMPTY { SG_GRAPHIC, 0.0, 0, 458, 0, 12, "gfx/interface/ammobar", 0, 0, 0, CT_DKPURPLE1, 0 }, /* IG_AMMO_SLIDEREMPTY */
{ SG_GRAPHIC, 0.0, 607, 458, 16, 16, "gfx/interface/ammolowercap2", 0, 0, 572, CT_LTPURPLE2, 0 }, // IG_AMMO_LOWER_ENDCAP { SG_GRAPHIC, 0.0, 607, 458, 16, 16, "gfx/interface/ammolowercap2", 0, 0, 572, CT_LTPURPLE2, 0 }, /* IG_AMMO_LOWER_ENDCAP */
{ SG_NUMBER, 0.0, 573, 425, 16, 32, NULL, 0, 0, 0, CT_LTPURPLE1, NUM_FONT_BIG }, // IG_AMMO_COUNT { SG_NUMBER, 0.0, 573, 425, 16, 32, NULL, 0, 0, 0, CT_LTPURPLE1, NUM_FONT_BIG }, /* IG_AMMO_COUNT */
{ SG_VAR, 0.0, 0, 0, 0, 0, NULL, 0, 0, 0, CT_NONE, 0 }, // IG_AMMO_END { SG_VAR, 0.0, 0, 0, 0, 0, NULL, 0, 0, 0, CT_NONE, 0 }, /* IG_AMMO_END */
}; };
#define LOWEROVERLAY_Y (SCREEN_HEIGHT - ICON_SIZE - 15) #define LOWEROVERLAY_Y (SCREEN_HEIGHT - ICON_SIZE - 15)
//------------------------------------------------------ /*------------------------------------------------------*/
lensFlare_t lensFlare[MAX_LENS_FLARES]; lensFlare_t lensFlare[MAX_LENS_FLARES];
lensReflec_s lensReflec[10] = lensReflec_s lensReflec[10] =
{ {
//width, height, offset, positive, color, shadername, shaders placeholder /* width, height, offset, positive, color, shadername, shaders placeholder */
{ 23, 23, 0.192, qtrue, { 0.73, 0.50, 0.23 }, "gfx/effects/flares/flare_straight", 0 }, //Brown1 //5.2 { 23, 23, 0.192, qtrue, { 0.73, 0.50, 0.23 }, "gfx/effects/flares/flare_straight", 0 }, /* Brown1 5.2 */
{ 9, 9, 0.37, qtrue, { 0.37, 0.58, 0.55 }, "gfx/effects/flares/flare_straight", 0 }, //Aqua1 //2.7 { 9, 9, 0.37, qtrue, { 0.37, 0.58, 0.55 }, "gfx/effects/flares/flare_straight", 0 }, /* Aqua1 2.7 */
{ 14, 14, 0.25, qfalse, { 0.37, 0.79, 0.76 }, "gfx/effects/flares/flare_radial", 0 }, //Turquoise1 //4.0 { 14, 14, 0.25, qfalse, { 0.37, 0.79, 0.76 }, "gfx/effects/flares/flare_radial", 0 }, /* Turquoise1 4.0 */
{ 86, 86, 0.556, qfalse, { 0.73, 0.50, 0.23 }, "gfx/effects/flares/flare_inverseradial", 0 }, //BigBrownInverseRad //1.8 { 86, 86, 0.556, qfalse, { 0.73, 0.50, 0.23 }, "gfx/effects/flares/flare_inverseradial", 0 }, /* BigBrownInverseRad 1.8 */
{ 49, 49, 0.476, qfalse, { 0.73, 0.50, 0.23 }, "gfx/effects/flares/flare_straight", 0 }, //StraightBrown2 //2.1 { 49, 49, 0.476, qfalse, { 0.73, 0.50, 0.23 }, "gfx/effects/flares/flare_straight", 0 }, /* StraightBrown2 2.1 */
{ 35, 35, 0.667, qfalse, { 0.34, 0.40, 0.44 }, "gfx/effects/flares/flare_straight", 0 }, //Grey1 //1.5 { 35, 35, 0.667, qfalse, { 0.34, 0.40, 0.44 }, "gfx/effects/flares/flare_straight", 0 }, /* Grey1 1.5 */
{ 32, 32, 0.769, qfalse, { 0.20, 0.38, 0.62 }, "gfx/effects/flares/flare_radial", 0 }, //BlueRad //1.3 { 32, 32, 0.769, qfalse, { 0.20, 0.38, 0.62 }, "gfx/effects/flares/flare_radial", 0 }, /* BlueRad 1.3 */
{ 122, 122, 1.1, qfalse, { 0.31, 0.65, 0.36 }, "gfx/effects/flares/flare_inverseradial", 0 }, //BigInverseGreen //0.9 { 122, 122, 1.1, qfalse, { 0.31, 0.65, 0.36 }, "gfx/effects/flares/flare_inverseradial", 0 }, /* BigInverseGreen 0.9 */
{ 254, 254, 1.429, qfalse, { 1.00, 1.00, 1.00 }, "gfx/effects/flares/flare_chromadisc", 0 }, //ChromaHoop //0.7 { 254, 254, 1.429, qfalse, { 1.00, 1.00, 1.00 }, "gfx/effects/flares/flare_chromadisc", 0 }, /* ChromaHoop 0.7 */
{ 52, 52, 1.429, qtrue, { 0.40, 0.56, 0.42 }, "gfx/effects/flares/flare_inverseradial", 0 }, //Green offset //0.7 { 52, 52, 1.429, qtrue, { 0.40, 0.56, 0.42 }, "gfx/effects/flares/flare_inverseradial", 0 }, /* Green offset 0.7 */
}; };
#define HALF_SCREEN_WIDTH (SCREEN_WIDTH*0.5) #define HALF_SCREEN_WIDTH (SCREEN_WIDTH*0.5)
@ -109,19 +113,19 @@ void CG_InitLensFlare( vec3_t worldCoord,
{ {
int i; int i;
//First thing's first.... I understand if you hate flares :'( /* First thing's first.... I understand if you hate flares :'( */
if (!cg_dynamiclensflares.value) if (!cg_dynamiclensflares.value)
return; return;
for (i = 0; i < MAX_LENS_FLARES; i++) { //find the next free slot for (i = 0; i < MAX_LENS_FLARES; i++) { /* find the next free slot */
if ( !lensFlare[i].qfull ) { if ( !lensFlare[i].qfull ) {
//VectorCopy(worldCoord, lensFlare[i].worldCoord); /* VectorCopy(worldCoord, lensFlare[i].worldCoord); */
lensFlare[i].worldCoord[0] = worldCoord[0]; lensFlare[i].worldCoord[0] = worldCoord[0];
lensFlare[i].worldCoord[1] = worldCoord[1]; lensFlare[i].worldCoord[1] = worldCoord[1];
lensFlare[i].worldCoord[2] = worldCoord[2]; lensFlare[i].worldCoord[2] = worldCoord[2];
lensFlare[i].w1 = w1; lensFlare[i].w1 = w1;
lensFlare[i].h1 = h1; lensFlare[i].h1 = h1;
//VectorCopy(glowColor, lensFlare[i].glowColor); /* VectorCopy(glowColor, lensFlare[i].glowColor); */
lensFlare[i].glowColor[0] = glowColor[0]; lensFlare[i].glowColor[0] = glowColor[0];
lensFlare[i].glowColor[1] = glowColor[1]; lensFlare[i].glowColor[1] = glowColor[1];
lensFlare[i].glowColor[2] = glowColor[2]; lensFlare[i].glowColor[2] = glowColor[2];
@ -129,7 +133,7 @@ void CG_InitLensFlare( vec3_t worldCoord,
lensFlare[i].hazeOffset = hazeOffset; lensFlare[i].hazeOffset = hazeOffset;
lensFlare[i].minDist = minDist; lensFlare[i].minDist = minDist;
lensFlare[i].maxDist = maxDist; lensFlare[i].maxDist = maxDist;
//VectorCopy(streakColor, lensFlare[i].streakColor); /* VectorCopy(streakColor, lensFlare[i].streakColor); */
lensFlare[i].streakColor[0] = streakColor[0]; lensFlare[i].streakColor[0] = streakColor[0];
lensFlare[i].streakColor[1] = streakColor[1]; lensFlare[i].streakColor[1] = streakColor[1];
lensFlare[i].streakColor[2] = streakColor[2]; lensFlare[i].streakColor[2] = streakColor[2];
@ -178,13 +182,15 @@ static qboolean CG_WorldCoordToScreenCoord(vec3_t worldCoord, float *x, float *y
float xzi; float xzi;
float yzi; float yzi;
// xcenter = cg.refdef.width / 2;//gives screen coords adjusted for resolution /* xcenter = cg.refdef.width / 2;*//*gives screen coords adjusted for resolution*/
// ycenter = cg.refdef.height / 2;//gives screen coords adjusted for resolution /* ycenter = cg.refdef.height / 2;*//*gives screen coords adjusted for resolution*/
//NOTE: did it this way because most draw functions expect virtual 640x480 coords /*
// and adjust them for current resolution * NOTE: did it this way because most draw functions expect virtual 640x480 coords
//xcenter = 640 * 0.5;//gives screen coords in virtual 640x480, to be adjusted when drawn * and adjust them for current resolution
//ycenter = 480 * 0.5;//gives screen coords in virtual 640x480, to be adjusted when drawn */
/*xcenter = 640 * 0.5;*//*gives screen coords in virtual 640x480, to be adjusted when drawn*/
/*ycenter = 480 * 0.5;*//*gives screen coords in virtual 640x480, to be adjusted when drawn*/
xcenter = 640 >> 1; xcenter = 640 >> 1;
ycenter = 480 >> 1; ycenter = 480 >> 1;
@ -195,7 +201,7 @@ static qboolean CG_WorldCoordToScreenCoord(vec3_t worldCoord, float *x, float *y
transformed[1] = DotProduct(local,up); transformed[1] = DotProduct(local,up);
transformed[2] = DotProduct(local,fwd); transformed[2] = DotProduct(local,fwd);
// Make sure Z is not negative. /* Make sure Z is not negative. */
if(transformed[2] < 0.01) if(transformed[2] < 0.01)
{ {
if ( clamp ) if ( clamp )
@ -207,9 +213,9 @@ static qboolean CG_WorldCoordToScreenCoord(vec3_t worldCoord, float *x, float *y
return qfalse; return qfalse;
} }
} }
// Simple convert to screen coords. /* Simple convert to screen coords. */
xzi = xcenter / transformed[2] * (96.0/cg.refdef.fov_x);//90 //95 xzi = xcenter / transformed[2] * (96.0/cg.refdef.fov_x);/*90*/ /*95*/
yzi = ycenter / transformed[2] * (102.0/cg.refdef.fov_y);//90 //105 yzi = ycenter / transformed[2] * (102.0/cg.refdef.fov_y);/*90*/ /*105*/
*x = (float)(xcenter + xzi * transformed[0]); *x = (float)(xcenter + xzi * transformed[0]);
*y = (float)(ycenter - yzi * transformed[1]); *y = (float)(ycenter - yzi * transformed[1]);
@ -239,9 +245,11 @@ but much less worse than what was before. :)
static float CG_FlareScreenTrans(int x, int y, int xmin, int ymin, int xmax, int ymax ) static float CG_FlareScreenTrans(int x, int y, int xmin, int ymin, int xmax, int ymax )
{ {
//Think about it, when the XY points are in separate quadrants of the screen, /*
//they're all the same values anyway, but just either negative or positive. * Think about it, when the XY points are in separate quadrants of the screen,
//Making them all positive, and working on just that set kills about 8 birds with a fricken' huge stone. >:) * they're all the same values anyway, but just either negative or positive.
* Making them all positive, and working on just that set kills about 8 birds with a fricken' huge stone. >:)
*/
int lx = abs(x); int lx = abs(x);
int ly = abs(y); int ly = abs(y);
int lxmin = abs(xmin); int lxmin = abs(xmin);
@ -250,30 +258,30 @@ static float CG_FlareScreenTrans(int x, int y, int xmin, int ymin, int xmax, int
int lymax = abs(ymax); int lymax = abs(ymax);
int xDif = lxmax - lxmin; int xDif = lxmax - lxmin;
int yDif = lymax - lymin; int yDif = lymax - lymin;
float grad = ( (float)lymax/(float)lxmax ); //calc the grad as if (xmin, ymin) were the origin float grad = ( (float)lymax/(float)lxmax ); /* calc the grad as if (xmin, ymin) were the origin */
float alpha = 1.0; float alpha = 1.0;
//if xy is under minimums, just make it 1 :P /* if xy is under minimums, just make it 1 :P */
if (lx < lxmin && ly < lymin ) { if (lx < lxmin && ly < lymin ) {
return alpha; return alpha;
} }
if ( ly < (lx * grad) ) {//point is running along the side bar if ( ly < (lx * grad) ) {/* point is running along the side bar */
alpha = (float)( 1.0 - ( (float)lx - (float)lxmin ) / (float)xDif ); alpha = (float)( 1.0 - ( (float)lx - (float)lxmin ) / (float)xDif );
//CG_Printf("SIDE BAR!!!! alpha = %f, ly = %i, lymin = %i, yDif = %i\n", alpha, ly, lymin, yDif); /* CG_Printf("SIDE BAR!!!! alpha = %f, ly = %i, lymin = %i, yDif = %i\n", alpha, ly, lymin, yDif); */
} }
if ( ly > ( lx * grad) ) {//point is running along the top bar if ( ly > ( lx * grad) ) {/* point is running along the top bar */
alpha = (float)( 1.0 - ( (float)ly - (float)lymin ) / (float)yDif ); alpha = (float)( 1.0 - ( (float)ly - (float)lymin ) / (float)yDif );
//CG_Printf("TOP BAR!!!! alpha = %f, lx = %i, lxmin = %i, xDif = %i, xEq = %f\n", alpha, lx, lxmin, xDif, ((float)lx * grad) ); /* CG_Printf("TOP BAR!!!! alpha = %f, lx = %i, lxmin = %i, xDif = %i, xEq = %f\n", alpha, lx, lxmin, xDif, ((float)lx * grad) ); */
} }
//if xy has exceeded maxes, just make it 0 :P /* if xy has exceeded maxes, just make it 0 :P */
if ( lx >= lxmax || ly >= lymax ) if ( lx >= lxmax || ly >= lymax )
alpha = 0.0; alpha = 0.0;
//Lock it just in case something weird happened. :S /* Lock it just in case something weird happened. :S */
if ( alpha > 1.0 ) if ( alpha > 1.0 )
alpha = 1.0; alpha = 1.0;
if ( alpha < 0.0 ) if ( alpha < 0.0 )
@ -298,15 +306,15 @@ static float CG_CorrelateMaxMinDist( float len, int min, int max ) {
float alpha = 1.0; float alpha = 1.0;
if ( min == max && max == 0 ) //This means it will always be off if ( min == max && max == 0 ) /* This means it will always be off */
return 0.0; return 0.0;
if ( min <= 0 ) //this means that the parameter wants it to always be on if ( min <= 0 ) /* this means that the parameter wants it to always be on */
return alpha; return alpha;
alpha = /*1.0 -*/ ( len - (float)min ) / ((float)max - (float)min); //calculate the alpha alpha = /*1.0 -*/ ( len - (float)min ) / ((float)max - (float)min); /* calculate the alpha */
if (alpha > 1.0 ) //Clamp it.... again if (alpha > 1.0 ) /* Clamp it.... again */
alpha = 1.0; alpha = 1.0;
if (alpha < 0.0 ) if (alpha < 0.0 )
alpha = 0.0; alpha = 0.0;

File diff suppressed because it is too large Load diff

View file

@ -21,6 +21,9 @@
#elif defined WIN32 #elif defined WIN32
#define HOSTARCH "WIN32" #define HOSTARCH "WIN32"
#define EXTENSION "dll" #define EXTENSION "dll"
#elif defined __APPLE__
#define HOSTARCH "UNIX"
#define EXTENSION "dylib"
#endif #endif
#define Lua_RegisterGlobal(L, n, v) (lua_pushstring(L, v), lua_setglobal(L, n)) #define Lua_RegisterGlobal(L, n, v) (lua_pushstring(L, v), lua_setglobal(L, n))

View file

@ -244,30 +244,6 @@ typedef int clipHandle_t;
#define MAX_NAME_LENGTH 32 // max length of a client name #define MAX_NAME_LENGTH 32 // max length of a client name
//client->sess.sessionClass and client->ps.persistant[PERS_CLASS]
/*typedef enum
{//FIXME: restrict pickups to the proper PC?
PC_NOCLASS,//default
PC_INFILTRATOR,//fast, low attack
PC_SNIPER,//sneaky, snipe only
PC_HEAVY,//slow, heavy attack
PC_DEMO,//go boom
PC_MEDIC,//heal
PC_TECH,//operate
PC_BORG,//special weapons, slower, adapting shields
PC_ACTIONHERO,//has everything
PC_SECURITY,//for escorts
PC_MEDICAL,//for escorts
PC_COMMAND,//for escorts
PC_SCIENCE,//for escorts
PC_ENGINEER,//for escorts
PC_ALIEN,//for escorts
PC_ALPHAOMEGA22,//for escorts
PC_ADMIN,//for escorts
PC_N00B,//for escorts
NUM_PLAYER_CLASSES
} pclass_t;*/
typedef int pclass_t; typedef int pclass_t;
// paramters for command buffer stuffing // paramters for command buffer stuffing