Cleaned up last and Replaced all ints in cgame by int32_t

Signed-off-by: Harry Young <hendrik.gerritzen@googlemail.com>
This commit is contained in:
Harry Young 2013-08-16 15:43:41 +02:00
parent e9c546ffc3
commit 2e27219e28
66 changed files with 1433 additions and 1433 deletions

View File

@ -20,7 +20,7 @@ static void CG_ObjectivesUp_f( void )
}
void CG_TargetCommand_f( void ) {
int targetNum;
int32_t targetNum;
char test[4];
targetNum = CG_CrosshairPlayer();
@ -42,7 +42,7 @@ Keybinding command
=================
*/
static void CG_SizeUp_f (void) {
trap_Cvar_Set("cg_viewsize", va("%i",(int)(cg_viewsize.integer+10)));
trap_Cvar_Set("cg_viewsize", va("%i",(int32_t)(cg_viewsize.integer+10)));
}
@ -54,7 +54,7 @@ Keybinding command
=================
*/
static void CG_SizeDown_f (void) {
trap_Cvar_Set("cg_viewsize", va("%i",(int)(cg_viewsize.integer-10)));
trap_Cvar_Set("cg_viewsize", va("%i",(int32_t)(cg_viewsize.integer-10)));
}
@ -66,9 +66,9 @@ Debugging command to print the current view position
=============
*/
static void CG_Viewpos_f (void) {
CG_Printf ("%s (%i %i %i) : %i\n", cgs.mapname, (int)cg.refdef.vieworg[0],
(int)cg.refdef.vieworg[1], (int)cg.refdef.vieworg[2],
(int)cg.refdefViewAngles[YAW]);
CG_Printf ("%s (%i %i %i) : %i\n", cgs.mapname, (int32_t)cg.refdef.vieworg[0],
(int32_t)cg.refdef.vieworg[1], (int32_t)cg.refdef.vieworg[2],
(int32_t)cg.refdefViewAngles[YAW]);
}
/*
@ -115,7 +115,7 @@ static void CG_ScoresUp_f( void ) {
}
static void CG_TellTarget_f( void ) {
int clientNum;
int32_t clientNum;
char command[128];
char message[128];
@ -130,7 +130,7 @@ static void CG_TellTarget_f( void ) {
}
static void CG_TellAttacker_f( void ) {
int clientNum;
int32_t clientNum;
char command[128];
char message[128];
@ -174,7 +174,7 @@ the names of all the ranks we can use ATM
=========================
*/
void CG_RankList_cmd( void ) {
int i;
int32_t i;
/* Print Titles */
CG_Printf( S_COLOR_CYAN "RPG-X: Available Ranks\n");
@ -197,7 +197,7 @@ the names of all the ranks we can use ATM
=========================
*/
void CG_ClassList_cmd( void ) {
int i;
int32_t i;
/* Print Titles */
CG_Printf( S_COLOR_CYAN "RPG-X: Available Classes\n");
@ -223,7 +223,7 @@ to beam to various locations.
*/
void CG_BeamList_cmd( void ) {
const char *locStr;
int i;
int32_t i;
/* Print Titles */
CG_Printf( S_COLOR_CYAN "RPG-X Current Beam Locations\n" );
@ -266,9 +266,9 @@ Although not as bad as the alternative...
void CG_Emote_f( void ) {
const char *argStr;
emoteList_t *emote = NULL;
int i;
int32_t i;
animation_t *anims;
int animLength;
int32_t animLength;
qboolean emoteFound=qfalse;
argStr = CG_Argv( 1 );
@ -292,7 +292,7 @@ void CG_Emote_f( void ) {
/* find out emote in the list
value of numEmotes calced in bg_misc.c
or if an int was supplied as an arg, use that */
or if an int32_t was supplied as an arg, use that */
for ( i = 0; i < bg_numEmotes; i++ )
{
emote = &bg_emoteList[i];
@ -330,7 +330,7 @@ void CG_Emote_f( void ) {
/* add this emote to the emotes recently played menu */
{
int j;
int32_t j;
char* cvar;
char buffer[256];
qboolean foundSlot=qfalse;
@ -406,7 +406,7 @@ void CG_LocEdit_f(void) {
if(f) {
if((argptr = CG_Argv(2)) != NULL) {
int i = atoi(argptr);
int32_t i = atoi(argptr);
if(i) {
trap_FS_Write("LocationsList2\n", 15, f);
} else {
@ -612,7 +612,7 @@ vmCvar_t* TPSVars[] = { &cg_thirdPersonRange, &cg_thirdPersonAngle,
Ie revert any temporary changes. */
void CG_ThirdPersonRevert_f ( void ) {
int i;
int32_t i;
char value[MAX_TOKEN_CHARS];
for (i = 0; i < 5; i++ ){
@ -628,8 +628,8 @@ void CG_ThirdPersonRevert_f ( void ) {
* Resets the values to the game's defaults. Useful if you screwed up the view big time.
*/
void CG_ThirdPersonReset_f ( void ) {
int defValues[] = { 80, 0, 16, 0, 0 };
int i;
int32_t defValues[] = { 80, 0, 16, 0, 0 };
int32_t i;
for (i = 0; i < 5; i++ ) {
TPSVars[i]->value = defValues[i];
@ -642,7 +642,7 @@ void CG_ThirdPersonReset_f ( void ) {
* hard coded CVARs to the same value, effectively making them permanent
*/
void CG_ThirdPersonCommit_f ( void ) {
int i;
int32_t i;
for (i = 0; i < 5; i++ ) {
trap_Cvar_Set( cVars[i], va("%f", TPSVars[i]->value ) );
@ -653,7 +653,7 @@ void CG_ThirdPersonCommit_f ( void ) {
/* Toggles between first and third person */
void CG_ToggleThirdPerson_f ( void ) {
int value;
int32_t value;
value = !( cg_thirdPerson.integer > 0 ); /* This is cool. It'll toggle the value each call. */
@ -743,7 +743,7 @@ Cmd_Argc() / Cmd_Argv()
*/
qboolean CG_ConsoleCommand( void ) {
const char *cmd;
int i;
int32_t i;
cmd = CG_Argv(0);
@ -766,7 +766,7 @@ so it can perform tab completion
=================
*/
void CG_InitConsoleCommands( void ) {
int i;
int32_t i;
for ( i = 0 ; i < sizeof( commands ) / sizeof( commands[0] ) ; i++ ) {
trap_AddCommand( commands[i].cmd );

View File

@ -10,9 +10,9 @@
#include "cg_screenfx.h"
/* set in CG_ParseTeamInfo */
int sortedTeamPlayers[TEAM_MAXOVERLAY];
int numSortedTeamPlayers;
int drawTeamOverlayModificationCount = -1;
int32_t sortedTeamPlayers[TEAM_MAXOVERLAY];
int32_t numSortedTeamPlayers;
int32_t drawTeamOverlayModificationCount = -1;
/*
* TiM: dCross
@ -27,7 +27,7 @@ vec3_t vup;
vec3_t vfwd_n;
vec3_t vright_n;
vec3_t vup_n;
int infoStringCount;
int32_t infoStringCount;
static qboolean drawCrosshairName=qfalse;
@ -37,7 +37,7 @@ static void CG_InterfaceStartup(void);
char *ingame_text[IGT_MAX]; /* Holds pointers to ingame text */
int zoomFlashTime=0;
int32_t zoomFlashTime=0;
interfacegraphics_s interface_graphics[IG_MAX] =
{
@ -99,13 +99,13 @@ lensReflec_s lensReflec[10] =
#define HALF_SCREEN_HEIGHT (SCREEN_HEIGHT*0.5)
void CG_InitLensFlare( vec3_t worldCoord,
int w1, int h1,
vec3_t glowColor, float glowOffset, float hazeOffset, int minDist, int maxDist,
vec3_t streakColor, int streakDistMin, int streakDistMax, int streakW, int streakH, qboolean whiteStreaks,
int reflecDistMin, int reflecDistMax, qboolean reflecAnamorphic, qboolean defReflecs,
qboolean clamp, float maxAlpha, int startTime, int upTime, int holdTime, int downTime )
int32_t w1, int32_t h1,
vec3_t glowColor, float glowOffset, float hazeOffset, int32_t minDist, int32_t maxDist,
vec3_t streakColor, int32_t streakDistMin, int32_t streakDistMax, int32_t streakW, int32_t streakH, qboolean whiteStreaks,
int32_t reflecDistMin, int32_t reflecDistMax, qboolean reflecAnamorphic, qboolean defReflecs,
qboolean clamp, float maxAlpha, int32_t startTime, int32_t upTime, int32_t holdTime, int32_t downTime )
{
int i;
int32_t i;
/* First thing's first.... I understand if you hate flares :'( */
if (!cg_dynamiclensflares.value)
@ -165,7 +165,7 @@ correlates that to an XY value on your screen!! O_o
static qboolean CG_WorldCoordToScreenCoord(vec3_t worldCoord, float *x, float *y, qboolean clamp)
{
int xcenter, ycenter;
int32_t xcenter, ycenter;
vec3_t local, transformed;
vec3_t fwd;
vec3_t right;
@ -229,21 +229,21 @@ of jerkiness if the point crosses this line,
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(int32_t x, int32_t y, int32_t xmin, int32_t ymin, int32_t xmax, int32_t 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.
* Making them all positive, and working on just that set kills about 8 birds with a fricken' huge stone. >:)
*/
int lx = abs(x);
int ly = abs(y);
int lxmin = abs(xmin);
int lymin = abs(ymin);
int lxmax = abs(xmax);
int lymax = abs(ymax);
int xDif = lxmax - lxmin;
int yDif = lymax - lymin;
int32_t lx = abs(x);
int32_t ly = abs(y);
int32_t lxmin = abs(xmin);
int32_t lymin = abs(ymin);
int32_t lxmax = abs(xmax);
int32_t lymax = abs(ymax);
int32_t xDif = lxmax - lxmin;
int32_t yDif = lymax - lymin;
float grad = ( (float)lymax/(float)lxmax ); /* calc the grad as if (xmin, ymin) were the origin */
float alpha = 1.0;
@ -286,7 +286,7 @@ so elements can fade in or out
depending on relative distance :)
================
*/
static float CG_CorrelateMaxMinDist( float len, int min, int max ) {
static float CG_CorrelateMaxMinDist( float len, int32_t min, int32_t max ) {
float alpha = 1.0;
@ -318,9 +318,9 @@ and also has an option
to fade in as well as out
================
*/
float CG_FadeAlpha( int startMsec, int totalMsec, qboolean fade_in ) {
float CG_FadeAlpha( int32_t startMsec, int32_t totalMsec, qboolean fade_in ) {
static float alpha;
int t;
int32_t t;
if ( startMsec == 0 ) {
return (fade_in ? 0.0 : 1.0);
@ -357,7 +357,7 @@ to make the flare fade out
*/
static float prevFrac = 0.0;
static int fadeTime, fadeInTime;
static int32_t fadeTime, fadeInTime;
static qboolean CG_FlareTraceTrans ( vec3_t origin, float* alpha )
{
@ -415,44 +415,44 @@ processor-intensive, totally un-necessary lensflare engine ;P
Parameters Key:
vec3_t worldCoord : Position in world to draw the flare
int w1, h1 : Initial (Maximum) w + h of the flare core
int32_t w1, h1 : Initial (Maximum) w + h of the flare core
vec3_t glowColor : Color of the flare's glow
float glowOffset : Multiplier how much bigger the glow is than the core
float hazeOffset : Multiplier how much bigger the surrounding haze is to the core
int minDist : Minimum distance before the flare loses all brightness (Set to 0 if always normal size)
int maxDist : Maximum distance for flare's brightness
int32_t minDist : Minimum distance before the flare loses all brightness (Set to 0 if always normal size)
int32_t maxDist : Maximum distance for flare's brightness
vec3_t streakColor : Color of the flare's lens reflections (if 0,0,0, then a default blue is used)
int streakDistMin : Distance at where the flare is totally transparent (Set to 0 if always on)
int streakDistMax : Distance at where the flare is totally opaque (Set to same as above to turn it always off)
int streakW : Length of the anamorphic lens streak
int streakH : Height of the anamorphic lens streak
int32_t streakDistMin : Distance at where the flare is totally transparent (Set to 0 if always on)
int32_t streakDistMax : Distance at where the flare is totally opaque (Set to same as above to turn it always off)
int32_t streakW : Length of the anamorphic lens streak
int32_t streakH : Height of the anamorphic lens streak
qboolean whiteStreaks : Adds white streaks to the center of normal streaks ;P
int reflecDistMin : Distance at where the reflections are totally transparent (Set to NULL if always on)
int reflecDistMax : Distance at where the reflections are totally opaque (Set to same value as above if wanted off)
int32_t reflecDistMin : Distance at where the reflections are totally transparent (Set to NULL if always on)
int32_t reflecDistMax : Distance at where the reflections are totally opaque (Set to same value as above if wanted off)
qboolean reflecAnamorphic : Enables anamorphic lens reflections
qboolean defReflecs : Makes the Lens Reflections default colors
qboolean clamp : If qtrue, the lensflare will not resize as the distance changes
float maxAlpha : All alpha values of the elements in the flare will not exceed this number
int upTime : How long it takes for the flare to go from 0 intense to maximum intense
int holdTime : How long the flare stays at max intensity for
int downTime : How long it takes for the flare to go from max intensity to 0.
int32_t upTime : How long it takes for the flare to go from 0 intense to maximum intense
int32_t holdTime : How long the flare stays at max intensity for
int32_t downTime : How long it takes for the flare to go from max intensity to 0.
**************************************************************/
void CG_DrawLensFlare( lensFlare_t *flare )
{
int w = flare->w1;
int h = flare->h1;
int32_t w = flare->w1;
int32_t h = flare->h1;
float x, y, streakX, streakY;
int xCart, yCart;
int32_t xCart, yCart;
vec4_t color, reflecColor, strkColor;
int xMax, yMax;
int32_t xMax, yMax;
vec3_t distDif, black = {0.0, 0.0, 0.0};
int maxTime = flare->upTime + flare->holdTime + flare->downTime;
int tMaxTime = maxTime + flare->startTime;
int tUpTime = flare->upTime + flare->startTime;
int tHoldTime = flare->upTime + flare->holdTime + flare->startTime;
int tDownTime = flare->upTime + flare->holdTime + flare->downTime + flare->startTime;
int32_t maxTime = flare->upTime + flare->holdTime + flare->downTime;
int32_t tMaxTime = maxTime + flare->startTime;
int32_t tUpTime = flare->upTime + flare->startTime;
int32_t tHoldTime = flare->upTime + flare->holdTime + flare->startTime;
int32_t tDownTime = flare->upTime + flare->holdTime + flare->downTime + flare->startTime;
float length;
float reflecAlpha = 1.0; //alpha channel of reflections
@ -504,8 +504,8 @@ void CG_DrawLensFlare( lensFlare_t *flare )
h = h * CG_CorrelateMaxMinDist(length, flare->minDist, flare->maxDist );
}
xCart = (int)(x - HALF_SCREEN_WIDTH ); //Re-orient the EF drawing engine so co-ord (0,0) is in the middle of the screen)
yCart = (int)(y - HALF_SCREEN_HEIGHT );
xCart = (int32_t)(x - HALF_SCREEN_WIDTH ); //Re-orient the EF drawing engine so co-ord (0,0) is in the middle of the screen)
yCart = (int32_t)(y - HALF_SCREEN_HEIGHT );
streakX = (xCart - (flare->streakW*0.5)) + HALF_SCREEN_WIDTH; //Calculate X value of lens streak based on flare position
streakY = (yCart - (flare->streakH*0.5)) + HALF_SCREEN_HEIGHT; //Calculate Y value of lens streak based on flare position
@ -544,7 +544,7 @@ void CG_DrawLensFlare( lensFlare_t *flare )
//Lens Reflections - those cool circly bits that go in the opposite direction of the flare
if ( reflecAlpha != 0.0 ) {//Sheez, only do this if we really WANT it O_o
int i;
int32_t i;
for( i = 0; i < 10; i++ ) {
//if they wanted the cool photoshoppy style reflections
@ -659,7 +659,7 @@ CG_DrawHead
Used for both the status bar and the scoreboard
================
*/
void CG_DrawHead( float x, float y, float w, float h, int clientNum, vec3_t headAngles ) {
void CG_DrawHead( float x, float y, float w, float h, int32_t clientNum, vec3_t headAngles ) {
clipHandle_t cm;
clientInfo_t *ci;
playerState_t *ps;
@ -718,7 +718,7 @@ CG_DrawFlagModel
Used for both the status bar and the scoreboard
================
*/
void CG_DrawFlagModel( float x, float y, float w, float h, int team ) {
void CG_DrawFlagModel( float x, float y, float w, float h, int32_t team ) {
qhandle_t cm;
vec3_t origin, angles;
vec3_t mins, maxs;
@ -755,7 +755,7 @@ RPG-X | Phenix | 09/06/2005
I dont know who commented this out but it's going back in ;)
================
*/
static int CG_DrawStatusBarHead( float x ) {
static int32_t CG_DrawStatusBarHead( float x ) {
vec3_t angles;
float size;
float frac;
@ -816,7 +816,7 @@ CG_DrawTeamBackground
================
*/
void CG_DrawTeamBackground( int x, int y, int w, int h, float alpha, int team, qboolean scoreboard )
void CG_DrawTeamBackground( int32_t x, int32_t y, int32_t w, int32_t h, float alpha, int32_t team, qboolean scoreboard )
{
vec4_t hcolor;
@ -855,14 +855,14 @@ static void CG_DrawAmmo(centity_t *cent)
return;
}
static int CG_DrawHealth(centity_t *cent)
static int32_t CG_DrawHealth(centity_t *cent)
{
float value;
playerState_t *ps;
char *health_str = NULL;
int health_barwidth;
int32_t health_barwidth;
vec_t *health_txtcolor = NULL;
int health_txteffect = 0;
int32_t health_txteffect = 0;
ps = &cg.snap->ps;
@ -907,8 +907,8 @@ static int CG_DrawHealth(centity_t *cent)
return health_barwidth;
} else {
int x = 3;
int y = 435;
int32_t x = 3;
int32_t y = 435;
//Draw the text
UI_DrawProportionalString(x + 46, y + 11, health_str, health_txteffect, health_txtcolor);
@ -963,10 +963,10 @@ static void CG_DrawStatusBar( void )
{
centity_t *cent;
vec3_t angles;
int y=0;
int32_t y=0;
vec4_t whiteA;
vec3_t tmpVec, eAngle, forward, dAngle;
int healthBarWidth;
int32_t healthBarWidth;
whiteA[0] = whiteA[1] = whiteA[2] = 1.0f; whiteA[3] = 0.3f;
@ -1017,7 +1017,7 @@ static void CG_DrawStatusBar( void )
//
if(cg.predictedPlayerState.powerups[PW_EVOSUIT] || cg.predictedPlayerState.powerups[PW_FLIGHT] || cg.predictedPlayerState.powerups[PW_INVIS]){
//RPG-X | Phenix | 08/06/2005
int yZ = 478 - SMALLCHAR_HEIGHT;
int32_t yZ = 478 - SMALLCHAR_HEIGHT;
// UI_BIGFONT
//DEBUG
if(cg.predictedPlayerState.powerups[PW_EVOSUIT]) {
@ -1048,22 +1048,22 @@ static void CG_DrawStatusBar( void )
vec4_t radColor;
CG_DrawPic(40, 100, 100, 100, cgs.media.radarShader);
int i;
int32_t i;
for (i = 0; i < cg.snap->numEntities; i++) // Go through all entities in VIS range
{
if ( cg.snap->entities[i].eType == ET_PLAYER ) // If the Entity is a Player
{
// Calculate How Far Away They Are
int x = (cg.snap->entities[i].pos.trBase[0] - cg.predictedPlayerState.origin[0]);
int32_t x = (cg.snap->entities[i].pos.trBase[0] - cg.predictedPlayerState.origin[0]);
y = (cg.snap->entities[i].pos.trBase[1] - cg.predictedPlayerState.origin[1]);
int z = (cg.snap->entities[i].pos.trBase[2] - cg.predictedPlayerState.origin[2]);
int32_t z = (cg.snap->entities[i].pos.trBase[2] - cg.predictedPlayerState.origin[2]);
tmpVec[0] = x;
tmpVec[1] = y;
tmpVec[2] = 0.0;
// Convert Vector to Angle
vectoangles(tmpVec, eAngle);
int h = sqrt((x*x) + (y*y)); // Get Range
int32_t h = sqrt((x*x) + (y*y)); // Get Range
// We only Want "YAW" value
dAngle[0] = 0.0;
@ -1224,7 +1224,7 @@ CG_DrawSnapshot
*/
static float CG_DrawSnapshot( float y ) {
char *s;
int w;
int32_t w;
s = va( "time:%i frametime:%i snap:%i cmd:%i", cg.snap->serverTime, cg.frametime,
cg.latestSnapshotNum, cgs.serverCommandSequence );
@ -1248,10 +1248,10 @@ CG_DrawFPS
#define FPS_FRAMES 4
static float CG_DrawFPS( float y ) {
char *s;
static int previousTimes[FPS_FRAMES];
static int index;
static int previous;
int t, frameTime;
static int32_t previousTimes[FPS_FRAMES];
static int32_t index;
static int32_t previous;
int32_t t, frameTime;
// don't use serverTime, because that will be drifting to
// correct for internet lag changes, timescales, timedemos, etc
@ -1263,17 +1263,17 @@ static float CG_DrawFPS( float y ) {
index++;
if ( index > FPS_FRAMES ) {
// average multiple frames together to smooth changes out a bit
int total = 0, i;
int32_t total = 0, i;
for ( i = 0 ; i < FPS_FRAMES ; i++ ) {
total += previousTimes[i];
}
if ( !total ) {
total = 1;
}
int fps = 1000 * FPS_FRAMES / total;
int32_t fps = 1000 * FPS_FRAMES / total;
s = va( "%ifps", fps );
int w = UI_ProportionalStringWidth(s,UI_BIGFONT);
int32_t w = UI_ProportionalStringWidth(s,UI_BIGFONT);
//RPG-X | Phenix | 08/06/2005
// Changed "- w" to "- (w + 50)" to account for lagometer
if ( !cg_lagometer.integer ) {
@ -1292,9 +1292,9 @@ CG_DrawTimer
*/
static float CG_DrawTimer( float y ) {
char *s;
int w;
int mins, seconds, tens;
int msec;
int32_t w;
int32_t mins, seconds, tens;
int32_t msec;
msec = cg.time - cgs.levelStartTime;
@ -1377,20 +1377,20 @@ CG_DrawPowerups
================
*/
static float CG_DrawPowerups( float y ) {
int sorted[MAX_POWERUPS];
int sortedTime[MAX_POWERUPS];
int i, j, k;
int active;
int32_t sorted[MAX_POWERUPS];
int32_t sortedTime[MAX_POWERUPS];
int32_t i, j, k;
int32_t active;
playerState_t *ps;
int t;
int32_t t;
gitem_t *item;
int x;
int color;
int32_t x;
int32_t color;
float size;
float f;
static float colors[2][4] = {
{ 0.2, 1.0, 0.2, 1.0 } , { 1.0, 0.2, 0.2, 1.0 } };
int hasHoldable;
int32_t hasHoldable;
hasHoldable = cg.snap->ps.stats[STAT_HOLDABLE_ITEM];
@ -1454,7 +1454,7 @@ static float CG_DrawPowerups( float y ) {
vec4_t modulate;
f = (float)( t - cg.time ) / POWERUP_BLINK_TIME;
f -= (int)f;
f -= (int32_t)f;
modulate[0] = modulate[1] = modulate[2] = modulate[3] = f;
trap_R_SetColor( modulate );
}
@ -1504,8 +1504,8 @@ static void CG_DrawLowerRight( void ) {
CG_DrawPickupItem
===================
*/
static int CG_DrawPickupItem( int y ) {
int value;
static int32_t CG_DrawPickupItem( int32_t y ) {
int32_t value;
float *fadeColor;
if ( cg.snap->ps.stats[STAT_HEALTH] <= 0 ) {
@ -1558,7 +1558,7 @@ CG_DrawHoldableItem
===================
*/
static void CG_DrawHoldableItem( void ) {
int value;
int32_t value;
value = cg.snap->ps.stats[STAT_HOLDABLE_ITEM];
if ( value )
@ -1577,9 +1577,9 @@ static void CG_DrawHoldableItem( void ) {
{//holding nothing...
if ( cg.snap->ps.stats[STAT_USEABLE_PLACED] > 0 )
{//it's a timed countdown to getting a holdable, display the number in seconds
int sec;
int32_t sec;
char *s;
int w;
int32_t w;
sec = cg.snap->ps.stats[STAT_USEABLE_PLACED];
@ -1604,7 +1604,7 @@ CG_DrawReward
*/
static void CG_DrawReward( void ) {
float *color;
int i;
int32_t i;
float x, y;
if ( !cg_drawRewards.integer ) {
@ -1638,11 +1638,11 @@ LAGOMETER
typedef struct {
int frameSamples[LAG_SAMPLES];
int frameCount;
int snapshotFlags[LAG_SAMPLES];
int snapshotSamples[LAG_SAMPLES];
int snapshotCount;
int32_t frameSamples[LAG_SAMPLES];
int32_t frameCount;
int32_t snapshotFlags[LAG_SAMPLES];
int32_t snapshotSamples[LAG_SAMPLES];
int32_t snapshotCount;
} lagometer_t;
lagometer_t lagometer;
@ -1655,7 +1655,7 @@ Adds the current interpolate / extrapolate bar for this frame
==============
*/
void CG_AddLagometerFrameInfo( void ) {
int offset;
int32_t offset;
offset = cg.time - cg.latestSnapshotTime;
lagometer.frameSamples[ lagometer.frameCount & ( LAG_SAMPLES - 1) ] = offset;
@ -1695,10 +1695,10 @@ Should we draw something differnet for long lag vs no packets?
*/
static void CG_DrawDisconnect( void ) {
float x, y;
int cmdNum;
int32_t cmdNum;
usercmd_t cmd;
const char *s;
int w;
int32_t w;
// draw the phone jack if we are completely past our buffers
cmdNum = trap_GetCurrentCmdNumber() - CMD_BACKUP + 1;
@ -1737,10 +1737,10 @@ CG_DrawLagometer
==============
*/
static void CG_DrawLagometer( void ) {
int a, x, y, i;
int32_t a, x, y, i;
float v;
float ax, ay, aw, ah, mid, range;
int color;
int32_t color;
float vscale;
if ( !cg_lagometer.integer ) {
@ -1857,18 +1857,18 @@ CG_DrawSelfdestructTimer
*/
static float CG_DrawSelfdestructTimer( void ) {
char *s;
int msec = cg.selfdestructTime - cg.time;
int32_t msec = cg.selfdestructTime - cg.time;
if (msec > 0){
int mins = msec / 60000;
int tens = (msec - (mins * 60000)) / 10000;
int seconds = (msec - (mins * 60000) - (tens * 10000)) / 1000;
int remainder = msec - (mins * 60000) - (tens * 10000) - (seconds * 1000);
int32_t mins = msec / 60000;
int32_t tens = (msec - (mins * 60000)) / 10000;
int32_t seconds = (msec - (mins * 60000) - (tens * 10000)) / 1000;
int32_t remainder = msec - (mins * 60000) - (tens * 10000) - (seconds * 1000);
s = va( "%i:%i%i.%i", mins, tens, seconds, remainder );
int w = UI_ProportionalStringWidth("SELF-DESTRUCT IN",UI_SMALLFONT);
int32_t w = UI_ProportionalStringWidth("SELF-DESTRUCT IN",UI_SMALLFONT);
UI_DrawProportionalString(320 - (w / 2), 10, "SELF-DESTRUCT IN", UI_SMALLFONT, colorTable[CT_RED]);
w = UI_ProportionalStringWidth(s,UI_SMALLFONT);
@ -1908,7 +1908,7 @@ Called for important messages that should stay in the center of the screen
for a few moments
==============
*/
void CG_CenterPrint( const char *str, int y, int charWidth ) {
void CG_CenterPrint( const char *str, int32_t y, int32_t charWidth ) {
char *s;
Q_strncpyz( cg.centerPrint, str, sizeof(cg.centerPrint) );
@ -1935,8 +1935,8 @@ CG_DrawCenterString
*/
static void CG_DrawCenterString( void ) {
char *start;
int l;
int x, y, w;
int32_t l;
int32_t x, y, w;
float *color;
if ( !cg.centerPrintTime ) {
@ -1995,11 +1995,11 @@ static void CG_DrawCrosshair(void) {
float f;
float x = 0;
float y = 0; //float
int weaponCrosshairNum;
int32_t weaponCrosshairNum;
trace_t trace;
vec3_t start, end;
int ignore;
int32_t ignore;
vec3_t d_f;
vec3_t pitchConstraint;
vec3_t worldPoint;
@ -2138,14 +2138,14 @@ CG_LabelCrosshairEntity
=================
*/
static void CG_LabelViewEntity( int clientNum, vec3_t origin, vec3_t entMins, vec3_t entMaxs, char *name, qboolean scanAll, vec4_t color, qboolean drawHealth, int health, char *pClass, char *rank, char *race, char* age, char *height, char *weight, char *weapon )
static void CG_LabelViewEntity( int32_t clientNum, vec3_t origin, vec3_t entMins, vec3_t entMaxs, char *name, qboolean scanAll, vec4_t color, qboolean drawHealth, int32_t health, char *pClass, char *rank, char *race, char* age, char *height, char *weight, char *weapon )
{//ID teammates, ID enemies, ID objectives, etc.
vec3_t center, maxs, mins, top, bottom, topLeft, topRight, bottomLeft, bottomRight;
vec3_t worldEast = {1.0f, 0, 0}, worldNorth = {0, 1.0f, 0}, worldUp = {0, 0, 1.0f};
float x = 0, y = 0;
float topLeftx, topLefty, topRightx, topRighty, bottomLeftx, bottomLefty, bottomRightx, bottomRighty;
int corner, topSize, bottomSize, leftSize, rightSize;
int charIndex, classCharIndex, rankCharIndex, ageCharIndex, raceCharIndex, htCharIndex, wtCharIndex, weapCharIndex, healthCharIndex;
int32_t corner, topSize, bottomSize, leftSize, rightSize;
int32_t charIndex, classCharIndex, rankCharIndex, ageCharIndex, raceCharIndex, htCharIndex, wtCharIndex, weapCharIndex, healthCharIndex;
float lineHorzLength = 8.0f, lineVertLength = 8.0f, lineWidth = 2.0f;
float fUpDot, fEastDot, fNorthDot, uNorthDot, uEastDot;
qboolean doTopLeft = qfalse;
@ -2414,7 +2414,7 @@ static void CG_LabelViewEntity( int clientNum, vec3_t origin, vec3_t entMins, ve
Com_sprintf( showHealth, sizeof( showHealth ), "%s: %i", "Health", health );
if ( healthCharIndex > 0 && showHealth[0] ) {
int len = strlen( showHealth );
int32_t len = strlen( showHealth );
if ( healthCharIndex > len+1 )
{
@ -2434,7 +2434,7 @@ static void CG_LabelViewEntity( int clientNum, vec3_t origin, vec3_t entMins, ve
case 5:
if ( charIndex > 0 && name )
{
int len = strlen(name);
int32_t len = strlen(name);
if ( charIndex > len+1 )
{
charIndex = len+1;
@ -2452,7 +2452,7 @@ static void CG_LabelViewEntity( int clientNum, vec3_t origin, vec3_t entMins, ve
case 6://class
if ( classCharIndex > 0 && pClass )
{
int len = strlen(pClass);
int32_t len = strlen(pClass);
if ( classCharIndex > len+1 )
{
classCharIndex = len+1;
@ -2470,7 +2470,7 @@ static void CG_LabelViewEntity( int clientNum, vec3_t origin, vec3_t entMins, ve
case 7://rank
if ( rankCharIndex > 0 && rank )
{
int len = strlen(rank);
int32_t len = strlen(rank);
if ( rankCharIndex > len+1 )
{
rankCharIndex = len+1;
@ -2488,7 +2488,7 @@ static void CG_LabelViewEntity( int clientNum, vec3_t origin, vec3_t entMins, ve
case 8://age
if ( ageCharIndex > 0 && age )
{
int len = strlen(age);
int32_t len = strlen(age);
if ( ageCharIndex > len+1 )
{
ageCharIndex = len+1;
@ -2506,7 +2506,7 @@ static void CG_LabelViewEntity( int clientNum, vec3_t origin, vec3_t entMins, ve
case 9://race
if ( raceCharIndex > 0 && race )
{
int len = strlen(race);
int32_t len = strlen(race);
if ( raceCharIndex > len+1 )
{
raceCharIndex = len+1;
@ -2524,7 +2524,7 @@ static void CG_LabelViewEntity( int clientNum, vec3_t origin, vec3_t entMins, ve
case 10://height
if ( htCharIndex > 0 && height )
{
int len = strlen(height);
int32_t len = strlen(height);
if ( htCharIndex > len+1 )
{
htCharIndex = len+1;
@ -2542,7 +2542,7 @@ static void CG_LabelViewEntity( int clientNum, vec3_t origin, vec3_t entMins, ve
case 11://weight
if ( wtCharIndex > 0 && weight )
{
int len = strlen(weight);
int32_t len = strlen(weight);
if ( wtCharIndex > len+1 )
{
wtCharIndex = len+1;
@ -2560,7 +2560,7 @@ static void CG_LabelViewEntity( int clientNum, vec3_t origin, vec3_t entMins, ve
case 12://weapon
if ( weapCharIndex > 0 && weapon )
{
int len = strlen(weapon);
int32_t len = strlen(weapon);
if ( weapCharIndex > len+1 )
{
weapCharIndex = len+1;
@ -2615,7 +2615,7 @@ static void CG_ScanForCrosshairEntity( void ) {
}
// if the player is in fog, don't show it
int content = trap_CM_PointContents( trace.endpos, 0 );
int32_t content = trap_CM_PointContents( trace.endpos, 0 );
if ( content & CONTENTS_FOG ) {
return;
}
@ -2644,7 +2644,7 @@ CG_DrawCrosshairNames
=====================
*/
extern qboolean PM_PlayerCrouching ( int legsAnim );
extern qboolean PM_PlayerCrouching ( int32_t legsAnim );
static vec3_t playerMins = {-12, -12, -24}; //RPG-X : TiM - {-15, -15, -24}
static vec3_t playerMaxs = {12, 12, 32}; // {15, 15, 32}
@ -2652,9 +2652,9 @@ static void CG_DrawCrosshairNames( void ) {
float *color;
char name[MAX_QPATH];
centity_t *cent;
int x, y;
int32_t x, y;
qboolean tinyFont;
int drawFlags;
int32_t drawFlags;
if ( !cg_drawCrosshair.integer )
{
@ -2701,8 +2701,8 @@ static void CG_DrawCrosshairNames( void ) {
char weapstr[128];
char agestr[128];
char classstr[128];
int i, irank;
int score = 0;
int32_t i, irank;
int32_t score = 0;
clientInfo_t *ci;
for ( i = 0; i < cgs.maxclients; i++ ) {
@ -2875,8 +2875,8 @@ static void CG_DrawCrosshairNames( void ) {
CG_WorldCoordToScreenCoord( org, &x2, &y2, qfalse);
x = (int)x2;
y = (int)y2;
x = (int32_t)x2;
y = (int32_t)y2;
tinyFont = qtrue;
drawFlags = UI_CENTER|UI_BOTTOM|UI_TINYFONT;
@ -2920,7 +2920,7 @@ CG_DrawVote
*/
static void CG_DrawVote(void) {
char *s;
int sec;
int32_t sec;
if ( !cgs.voteTime ) {
return;
@ -2958,7 +2958,7 @@ CG_DrawAbridgedObjective
*/
static void CG_DrawAbridgedObjective(void)
{
int i,pixelLen,x,y;
int32_t i,pixelLen,x,y;
for (i=0;i<MAX_OBJECTIVES;i++)
{
@ -3029,8 +3029,8 @@ CG_DrawWarmup
*/
extern void CG_AddGameModNameToGameName( char *gamename );
static void CG_DrawWarmup( void ) {
int w;
int sec;
int32_t w;
int32_t sec;
const char *s;
sec = cg.warmup;
@ -3095,7 +3095,7 @@ CG_DrawZoomMask
static void CG_DrawZoomMask( void )
{
float amt = 1, size, /*val,*/ start_x, start_y;
int width, height, i;
int32_t width, height, i;
vec4_t color1;
//TiM: New system. :) Base zoom on current active weapon. :)
@ -3134,7 +3134,7 @@ static void CG_DrawZoomMask( void )
trap_R_SetColor( color1 );
if ( cg.snap->ps.weapon == WP_7 ) {
static int TR116LoopTime = 0;
static int32_t TR116LoopTime = 0;
//Loop the whirring sight sound
if ( TR116LoopTime < cg.time )
@ -3193,7 +3193,7 @@ static void CG_DrawZoomMask( void )
}
// Convert zoom and view axis into some numbers to throw onto the screen
int x, y;
int32_t x, y;
if ( cg.snap->ps.weapon == WP_7 ) {
x = 74;
y = 340;
@ -3245,9 +3245,9 @@ Now I'm going to kill you Phenix!!!!
*/
static void CG_DrawAdminMsg( void ) {
float y;
int t;
int i, msgRow, msgCol;
int biggestW, w;
int32_t t;
int32_t i, msgRow, msgCol;
int32_t biggestW, w;
char message[35][45];
char *thisMessage;
char *p, *currRow;
@ -3345,7 +3345,7 @@ CG_Draw2D
=================
*/
static void CG_Draw2D( void ) {
int i;
int32_t i;
//TiM : Testing this API function...
//trap_R_SetColor( colorTable[ CT_RED ] );

View File

@ -101,8 +101,8 @@ CG_DrawChar
Coordinates and size in 640*480 virtual screen size
===============
*/
void CG_DrawChar( int x, int y, int width, int height, int ch ) {
int row, col;
void CG_DrawChar( int32_t x, int32_t y, int32_t width, int32_t height, int32_t ch ) {
int32_t row, col;
float frow, fcol;
float size,size2;
float ax, ay, aw, ah;
@ -146,12 +146,12 @@ to a fixed color.
Coordinates are at 640 by 480 virtual resolution
==================
*/
void CG_DrawStringExt( int x, int y, const char *string, const float *setColor,
qboolean forceColor, qboolean shadow, int charWidth, int charHeight, int maxChars ) {
void CG_DrawStringExt( int32_t x, int32_t y, const char *string, const float *setColor,
qboolean forceColor, qboolean shadow, int32_t charWidth, int32_t charHeight, int32_t maxChars ) {
vec4_t color;
const char *s;
int xx;
int cnt;
int32_t xx;
int32_t cnt;
if (maxChars <= 0)
maxChars = 32767; // do them all!
@ -199,7 +199,7 @@ void CG_DrawStringExt( int x, int y, const char *string, const float *setColor,
trap_R_SetColor( NULL );
}
void CG_DrawBigString( int x, int y, const char *s, float alpha ) {
void CG_DrawBigString( int32_t x, int32_t y, const char *s, float alpha ) {
float color[4];
color[0] = color[1] = color[2] = 1.0;
@ -207,11 +207,11 @@ void CG_DrawBigString( int x, int y, const char *s, float alpha ) {
CG_DrawStringExt( x, y, s, color, qfalse, qtrue, BIGCHAR_WIDTH, BIGCHAR_HEIGHT, 0 );
}
void CG_DrawBigStringColor( int x, int y, const char *s, vec4_t color ) {
void CG_DrawBigStringColor( int32_t x, int32_t y, const char *s, vec4_t color ) {
CG_DrawStringExt( x, y, s, color, qtrue, qtrue, BIGCHAR_WIDTH, BIGCHAR_HEIGHT, 0 );
}
void CG_DrawSmallString( int x, int y, const char *s, float alpha ) {
void CG_DrawSmallString( int32_t x, int32_t y, const char *s, float alpha ) {
float color[4];
color[0] = color[1] = color[2] = 1.0;
@ -219,7 +219,7 @@ void CG_DrawSmallString( int x, int y, const char *s, float alpha ) {
CG_DrawStringExt( x, y, s, color, qfalse, qfalse, SMALLCHAR_WIDTH, SMALLCHAR_HEIGHT, 0 );
}
void CG_DrawSmallStringColor( int x, int y, const char *s, vec4_t color ) {
void CG_DrawSmallStringColor( int32_t x, int32_t y, const char *s, vec4_t color ) {
CG_DrawStringExt( x, y, s, color, qtrue, qfalse, SMALLCHAR_WIDTH, SMALLCHAR_HEIGHT, 0 );
}
@ -230,9 +230,9 @@ CG_DrawStrlen
Returns character count, skiping color escape codes
=================
*/
int CG_DrawStrlen( const char *str ) {
int32_t CG_DrawStrlen( const char *str ) {
const char *s = str;
int count = 0;
int32_t count = 0;
while ( *s ) {
if ( Q_IsColorString( s ) ) {
@ -254,7 +254,7 @@ This repeats a 64*64 tile graphic to fill the screen around a sized down
refresh window.
=============
*/
static void CG_TileClearBox( int x, int y, int w, int h, qhandle_t hShader ) {
static void CG_TileClearBox( int32_t x, int32_t y, int32_t w, int32_t h, qhandle_t hShader ) {
float s1, t1, s2, t2;
s1 = x / 64;
@ -274,8 +274,8 @@ Clear around a sized down screen
==============
*/
void CG_TileClear( void ) {
int top, bottom, left, right;
int w, h;
int32_t top, bottom, left, right;
int32_t w, h;
w = cgs.glconfig.vidWidth;
h = cgs.glconfig.vidHeight;
@ -310,9 +310,9 @@ void CG_TileClear( void ) {
CG_FadeColor
================
*/
float *CG_FadeColor( int startMsec, int totalMsec ) {
float *CG_FadeColor( int32_t startMsec, int32_t totalMsec ) {
static vec4_t color;
int t;
int32_t t;
if ( startMsec == 0 ) {
return NULL;
@ -341,7 +341,7 @@ float *CG_FadeColor( int startMsec, int totalMsec ) {
CG_TeamColor
================
*/
float *CG_TeamColor( int team ) {
float *CG_TeamColor( int32_t team ) {
static vec4_t red = {1, 0.2, 0.2, 1};
static vec4_t blue = {0.2, 0.2, 1, 1};
static vec4_t other = {1, 1, 1, 1};
@ -366,9 +366,9 @@ float *CG_TeamColor( int team ) {
CG_GetColorForHealth
=================
*/
void CG_GetColorForHealth( int health, int armor, vec4_t hcolor ) {
int count;
int max;
void CG_GetColorForHealth( int32_t health, int32_t armor, vec4_t hcolor ) {
int32_t count;
int32_t max;
// calculate the total points of damage that can
// be sustained at the current health / armor level
@ -417,11 +417,11 @@ void CG_ColorForHealth( vec4_t hcolor ) {
}
static int propMapTiny[CHARMAX][3];
static int propMap[CHARMAX][3];
static int propMapBig[CHARMAX][3];
static int32_t propMapTiny[CHARMAX][3];
static int32_t propMap[CHARMAX][3];
static int32_t propMapBig[CHARMAX][3];
static int propMapB[26][3] = {
static int32_t propMapB[26][3] = {
{11, 12, 33},
{49, 12, 31},
{85, 12, 31},
@ -465,7 +465,7 @@ static int propMapB[26][3] = {
UI_DrawBannerString
=================
*/
static void UI_DrawBannerString2( int x, int y, const char* str, vec4_t color )
static void UI_DrawBannerString2( int32_t x, int32_t y, const char* str, vec4_t color )
{
const char* s;
char ch;
@ -494,11 +494,11 @@ static void UI_DrawBannerString2( int x, int y, const char* str, vec4_t color )
}
else if ( ch >= 'A' && ch <= 'Z' ) {
ch -= 'A';
fcol = (float)propMapB[(int)ch][0] / 256;
frow = (float)propMapB[(int)ch][1] / 256;
fwidth = (float)propMapB[(int)ch][2] / 256;
fcol = (float)propMapB[(int32_t)ch][0] / 256;
frow = (float)propMapB[(int32_t)ch][1] / 256;
fwidth = (float)propMapB[(int32_t)ch][2] / 256;
fheight = (float)PROPB_HEIGHT / 256;
aw = (float)(propMapB[(int)ch][2] * cgs.screenXScale);
aw = (float)(propMapB[(int32_t)ch][2] * cgs.screenXScale);
ah = (float)(PROPB_HEIGHT * cgs.screenYScale);
trap_R_DrawStretchPic( ax, ay, aw, ah, fcol, frow, fcol+fwidth, frow+fheight, cgs.media.charsetPropB );
ax += (aw + (float)PROPB_GAP_WIDTH * cgs.screenXScale);
@ -509,10 +509,10 @@ static void UI_DrawBannerString2( int x, int y, const char* str, vec4_t color )
trap_R_SetColor( NULL );
}
void UI_DrawBannerString( int x, int y, const char* str, int style, vec4_t color ) {
void UI_DrawBannerString( int32_t x, int32_t y, const char* str, int32_t style, vec4_t color ) {
const char * s;
int ch;
int width;
int32_t ch;
int32_t width;
vec4_t drawcolor;
// find the width of the drawn text
@ -560,12 +560,12 @@ void UI_DrawBannerString( int x, int y, const char* str, int style, vec4_t color
UI_ProportionalSizeScale
=================
*/
int UI_ProportionalStringWidth( const char* str,int style )
int32_t UI_ProportionalStringWidth( const char* str,int32_t style )
{
const char * s;
int ch;
int charWidth;
int width;
int32_t ch;
int32_t charWidth;
int32_t width;
char holdStr[2048];
Q_strncpyz( holdStr, str, MAX_STRINGWIDTH );
@ -630,7 +630,7 @@ int UI_ProportionalStringWidth( const char* str,int style )
return width;
}
static int specialTinyPropChars[CHARMAX][2] = {
static int32_t specialTinyPropChars[CHARMAX][2] = {
{0, 0},
{0, 0},{0, 0},{0, 0},{0, 0},{0, 0},{0, 0},{0, 0},{0, 0},{0, 0},{0, 0}, // 10
{0, 0},{0, 0},{0, 0},{0, 0},{0, 0},{0, 0},{0, 0},{0, 0},{0, 0},{0, 0}, // 20
@ -661,7 +661,7 @@ static int specialTinyPropChars[CHARMAX][2] = {
};
static int specialPropChars[CHARMAX][2] = {
static int32_t specialPropChars[CHARMAX][2] = {
{0, 0},
{0, 0},{0, 0},{0, 0},{0, 0},{0, 0},{0, 0},{0, 0},{0, 0},{0, 0},{0, 0}, // 10
{0, 0},{0, 0},{0, 0},{0, 0},{0, 0},{0, 0},{0, 0},{0, 0},{0, 0},{0, 0}, // 20
@ -692,7 +692,7 @@ static int specialPropChars[CHARMAX][2] = {
};
static int specialBigPropChars[CHARMAX][2] = {
static int32_t specialBigPropChars[CHARMAX][2] = {
{0, 0},
{0, 0},{0, 0},{0, 0},{0, 0},{0, 0},{0, 0},{0, 0},{0, 0},{0, 0},{0, 0}, // 10
{0, 0},{0, 0},{0, 0},{0, 0},{0, 0},{0, 0},{0, 0},{0, 0},{0, 0},{0, 0}, // 20
@ -738,7 +738,7 @@ static void UI_AdjustForWidescreen( float *x, float *w )
UI_DrawProportionalString2
=================
*/
static void UI_DrawProportionalString2( int x, int y, const char* str, vec4_t color, float sizeScale,int style, qhandle_t charset,qboolean forceColor )
static void UI_DrawProportionalString2( int32_t x, int32_t y, const char* str, vec4_t color, float sizeScale,int32_t style, qhandle_t charset,qboolean forceColor )
{
const char* s;
unsigned char ch;
@ -750,8 +750,8 @@ static void UI_DrawProportionalString2( int x, int y, const char* str, vec4_t co
float fcol;
float fwidth;
float fheight;
int colorI;
int special;
int32_t colorI;
int32_t special;
// draw the colored text
trap_R_SetColor( color );
@ -940,7 +940,7 @@ static void UI_DrawProportionalString2( int x, int y, const char* str, vec4_t co
UI_ProportionalSizeScale
=================
*/
float UI_ProportionalSizeScale( int style )
float UI_ProportionalSizeScale( int32_t style )
{
if( style & UI_SMALLFONT )
{
@ -956,10 +956,10 @@ float UI_ProportionalSizeScale( int style )
UI_DrawProportionalString
=================
*/
void UI_DrawProportionalString( int x, int y, const char* str, int style, vec4_t color )
void UI_DrawProportionalString( int32_t x, int32_t y, const char* str, int32_t style, vec4_t color )
{
vec4_t drawcolor;
int width;
int32_t width;
float sizeScale;
qhandle_t charset;
@ -1059,12 +1059,12 @@ Take x,y positions as if 640 x 480 and scales them to the proper resolution
==============
*/
void CG_DrawNumField (int x, int y, int width, int value,int charWidth,int charHeight,int style)
void CG_DrawNumField (int32_t x, int32_t y, int32_t width, int32_t value,int32_t charWidth,int32_t charHeight,int32_t style)
{
char num[16], *ptr;
int l;
int frame;
int xWidth;
int32_t l;
int32_t frame;
int32_t xWidth;
if (width < 1) {
return;
@ -1139,9 +1139,9 @@ void CG_DrawNumField (int x, int y, int width, int value,int charWidth,int charH
CG_PrintInterfaceGraphics
================
*/
void CG_PrintInterfaceGraphics(int min,int max)
void CG_PrintInterfaceGraphics(int32_t min,int32_t max)
{
int i;
int32_t i;
vec4_t drawcolor;
// Printing graphics
@ -1196,10 +1196,10 @@ void CG_PrintInterfaceGraphics(int min,int max)
CG_ParseFontParms
=================
*/
static char *CG_ParseFontParms(char *buffer,int propArray[CHARMAX][3])
static char *CG_ParseFontParms(char *buffer,int32_t propArray[CHARMAX][3])
{
char *token;
int i,i2;
int32_t i,i2;
while ( buffer )
{
@ -1260,7 +1260,7 @@ CG_LoadFonts
void CG_LoadFonts(void)
{
char buffer[FONT_BUFF_LENGTH];
int len;
int32_t len;
fileHandle_t f;
char *holdBuf;
@ -1459,12 +1459,12 @@ By TiM
*/
qboolean CG_LoadRanks( void ) {
fileHandle_t file;
int file_len;
int32_t file_len;
char charText[32000];
char *textPtr;
char fileName[MAX_QPATH];
int i;
int rankCount=0;
int32_t i;
int32_t rankCount=0;
char *token;
qboolean DefaultRankLoaded = qfalse;
@ -1715,12 +1715,12 @@ crosshairs.
*/
qboolean CG_LoadCrosshairs(void) {
fileHandle_t f;
int file_len;
int32_t file_len;
char charText[20000];
char *token, *textPtr;
char *fileName = "ext_data/crosshairs.dat";
int cHairCount = 0;
//int i;
int32_t cHairCount = 0;
//int32_t i;
//load file and get file length
file_len = trap_FS_FOpenFile( fileName, &f, FS_READ );

View File

@ -18,14 +18,14 @@ void CG_BubbleTrail( vec3_t start, vec3_t end, float spacing ) {
vec3_t move;
vec3_t vec;
float len;
int i;
int32_t i;
VectorCopy (start, move);
VectorSubtract (end, start, vec);
len = VectorNormalize (vec);
// advance a random amount first
i = rand() % (int)spacing;
i = rand() % (int32_t)spacing;
VectorMA( move, i, vec, move );
VectorScale (vec, spacing, vec);
@ -77,10 +77,10 @@ localEntity_t *CG_SmokePuff( const vec3_t p, const vec3_t vel,
float radius,
float r, float g, float b, float a,
float duration,
int startTime,
int leFlags,
int32_t startTime,
int32_t leFlags,
qhandle_t hShader ) {
static int seed = 0x92;
static int32_t seed = 0x92;
localEntity_t *le;
refEntity_t *re;
@ -190,9 +190,9 @@ CG_MakeExplosion
*/
localEntity_t *CG_MakeExplosion( vec3_t origin, vec3_t dir,
qhandle_t hModel, qhandle_t shader,
int msec, float scale, qboolean isSprite ) {
int32_t msec, float scale, qboolean isSprite ) {
localEntity_t *ex;
int offset;
int32_t offset;
vec3_t tmpVec, newOrigin;
if ( msec <= 0 ) {
@ -253,10 +253,10 @@ localEntity_t *CG_MakeExplosion( vec3_t origin, vec3_t dir,
localEntity_t *CG_MakeExplosion2( vec3_t origin, vec3_t dir,
qhandle_t hModel, int numFrames, qhandle_t shader,
int msec, qboolean isSprite, float scale, int flags) {
qhandle_t hModel, int32_t numFrames, qhandle_t shader,
int32_t msec, qboolean isSprite, float scale, int32_t flags) {
localEntity_t *ex;
int offset;
int32_t offset;
vec3_t tmpVec, newOrigin;
if ( msec <= 0 ) {
@ -327,7 +327,7 @@ intensity ranges from 1 (minor tremble) to 16 (major quake)
-------------------------
*/
void CG_ExplosionEffects( vec3_t origin, int intensity, int radius)
void CG_ExplosionEffects( vec3_t origin, int32_t intensity, int32_t radius)
{
//FIXME: When exactly is the vieworg calculated in relation to the rest of the frame?s
@ -362,7 +362,7 @@ qboolean SmokeThink( localEntity_t *le )
vec3_t origin;
vec3_t dir;
float speed;
int i;
int32_t i;
VectorCopy( le->data.spawner.dir, dir );
//clamp the smoke vector
@ -405,7 +405,7 @@ Creates a smoke effect
======================
*/
void CG_Smoke( vec3_t position, vec3_t dir, int killTime, int radius )
void CG_Smoke( vec3_t position, vec3_t dir, int32_t killTime, int32_t radius )
{
FX_AddSpawner( position, dir, NULL, NULL, qfalse, 0, 0.15, killTime, SmokeThink, radius ); //
}
@ -452,7 +452,7 @@ RPG-X | Marcin | 24/12/2008
======================
*/
void CG_Fire( vec3_t position, vec3_t direction, int killTime, int radius, int fxEnt )
void CG_Fire( vec3_t position, vec3_t direction, int32_t killTime, int32_t radius, int32_t fxEnt )
{
if(fxEnt)
FX_AddSpawner( position, direction, NULL, NULL, qfalse, 500, 0, killTime + 1000, FireThink, radius );

View File

@ -18,7 +18,7 @@ tag location
*/
void CG_PositionEntityOnTag( refEntity_t *entity, const refEntity_t *parent,
qhandle_t parentModel, char *tagName ) {
int i;
int32_t i;
orientation_t lerped;
// lerp the tag
@ -48,7 +48,7 @@ tag location
*/
void CG_PositionRotatedEntityOnTag( refEntity_t *entity, const refEntity_t *parent,
qhandle_t parentModel, char *tagName ) {
int i;
int32_t i;
orientation_t lerped;
vec3_t tempAxis[3];
@ -123,8 +123,8 @@ static void CG_EntityEffects( centity_t *cent ) {
// constant light glow
if ( cent->currentState.constantLight ) {
int cl;
int i, r, g, b;
int32_t cl;
int32_t i, r, g, b;
cl = cent->currentState.constantLight;
r = cl & 255;
@ -259,7 +259,7 @@ static void CG_General( centity_t *cent ) {
// add to refresh list
if ( s1->eFlags & EF_ITEMPLACEHOLDER ) // object is "spawning" in
{
int msec;
int32_t msec;
if ( !cent->miscTime )
{
@ -270,7 +270,7 @@ static void CG_General( centity_t *cent ) {
if ( msec < ITEM_SCALEUP_TIME )
{
float alpha;
int a;
int32_t a;
alpha = (float)msec * ITEM_SCALEUP_DIV;
if ( s1->eventParm == 255 )
{
@ -346,7 +346,7 @@ static void CG_Item( centity_t *cent ) {
refEntity_t ent;
entityState_t *es;
gitem_t *item;
int msec;
int32_t msec;
// RPG-X: Marcin: Custom angles for each weapon so they lie on the ground correctly. - 06/12/2008
const vec3_t weaponangles[WP_NUM_WEAPONS] = {
@ -429,8 +429,8 @@ static void CG_Item( centity_t *cent ) {
frame = (cg.time * 0.01);
ent.renderfx|=RF_WRAP_FRAMES;
ent.oldframe = (int)frame;
ent.frame = (int)frame+1;
ent.oldframe = (int32_t)frame;
ent.frame = (int32_t)frame+1;
ent.backlerp = (float)(ent.frame) - frame;
// and they are scaled too
@ -497,7 +497,7 @@ static void CG_Item( centity_t *cent ) {
if (item->giType != IT_TEAM && msec >= 0 && msec < ITEM_SCALEUP_TIME && !(es->eFlags & EF_ITEMPLACEHOLDER))
{ // if just respawned, fade in, but don't do this for flags.
float alpha;
int a;
int32_t a;
alpha = (float)msec * ITEM_SCALEUP_DIV;
a = alpha * 255.0;
@ -580,7 +580,7 @@ static void CG_Missile( centity_t *cent, qboolean altfire ) {
}
//RPG-X: RedTechie - non-admin see no tripmines! But first by popular demand check CVAR
info = CG_ConfigString( CS_SERVERINFO );
int rpg_tripmines = atoi( Info_ValueForKey( info, "rpg_invisibletripmines" ) );
int32_t rpg_tripmines = atoi( Info_ValueForKey( info, "rpg_invisibletripmines" ) );
if (!weapon->alt_missileModel || (!cgs.clientinfo[cg.snap->ps.clientNum].isAdmin/*cg.snap->ps.persistant[PERS_CLASS] != PC_ADMIN*/ && rpg_tripmines == 1)) {
//if there is no missile then we're done
return;
@ -794,7 +794,7 @@ CG_AdjustPositionForMover
Also called by client movement prediction code
=========================
*/
void CG_AdjustPositionForMover( const vec3_t in, int moverNum, int fromTime, int toTime, vec3_t out ) {
void CG_AdjustPositionForMover( const vec3_t in, int32_t moverNum, int32_t fromTime, int32_t toTime, vec3_t out ) {
centity_t *cent;
vec3_t oldOrigin, origin, deltaOrigin;
vec3_t oldAngles, angles /*, deltaAngles*/;
@ -958,13 +958,13 @@ CG_AddPacketEntities
===============
*/
void CG_AddPacketEntities( void ) {
int num;
int32_t num;
centity_t *cent;
playerState_t *ps;
// set cg.frameInterpolation
if ( cg.nextSnap ) {
int delta;
int32_t delta;
delta = (cg.nextSnap->serverTime - cg.snap->serverTime);
if ( delta == 0 ) {
@ -1050,7 +1050,7 @@ FX whilst it is in action
static void CG_Turbolift( centity_t* cent )
{
int i;
int32_t i;
centity_t *player;
//TiM - find all of the cents inside the lift, and make it so they orient to their view angles.
//Otherwise, when they teleport, the entire body snaps around, looking weird and/or painful.

View File

@ -13,7 +13,7 @@ qboolean SparkThink( localEntity_t *le )
vec3_t dir, direction, start, end;
vec3_t velocity;
float scale = 0, alpha = 0;
int numSparks = 0, i = 0, j = 0;
int32_t numSparks = 0, i = 0, j = 0;
sfxHandle_t snd = cgs.media.envSparkSound1;
switch(irandom(1, 3))
@ -142,7 +142,7 @@ Creates a spark effect
======================
*/
void CG_Spark( vec3_t origin, vec3_t normal, int delay, int killTime )
void CG_Spark( vec3_t origin, vec3_t normal, int32_t delay, int32_t killTime )
{
// give it a lifetime of 10 seconds because the refresh thinktime in g_fx.c is 10 seconds
FX_AddSpawner( origin, normal, NULL, NULL, qfalse, delay, 1.5, killTime, SparkThink, 100 ); //10000
@ -200,7 +200,7 @@ Creates a steam effect
======================
*/
void CG_Steam( vec3_t position, vec3_t dir, int killTime )
void CG_Steam( vec3_t position, vec3_t dir, int32_t killTime )
{
// give it a lifetime of 10 seconds because the refresh thinktime in g_fx.c is 10 seconds
FX_AddSpawner( position, dir, NULL, NULL, qfalse, 0, 0.15, killTime, SteamThink, 100 ); //
@ -221,13 +221,13 @@ Creates a electricity bolt effect
void BoltSparkSpew( vec3_t origin, vec3_t normal )
{
float scale = 1.0f + ( random() * 1.0f );
int num = 0, i = 0;
int32_t num = 0, i = 0;
vec3_t vel;
trap_R_AddLightToScene( origin, 75 + (rand()&31), 1.0, 0.8, 1.0 );
// Drop some sparks
num = (int)(random() * 2) + 2;
num = (int32_t)(random() * 2) + 2;
for ( i = 0; i < num; i++ )
{
@ -407,7 +407,7 @@ qboolean DripCallback( localEntity_t *le )
qboolean DripSplash( localEntity_t *le )
{
float scale = 1.0f + ( random() * 1.0f );
int num = 0, i = 0;
int32_t num = 0, i = 0;
vec3_t vel, normal, origin;
qhandle_t shader = 0;
@ -429,7 +429,7 @@ qboolean DripSplash( localEntity_t *le )
VectorCopy(le->refEntity.origin, origin);
// splashing water droplets. which, I'm fairly certain, is an alternative band from Europe.
num = (int)(random() * 2) + 6;
num = (int32_t)(random() * 2) + 6;
for ( i = 0; i < num; i++ )
{
@ -465,8 +465,8 @@ qboolean JackTheDripper( localEntity_t *le )
vec3_t vel, down = {0,0,-1}, end, origin, new_origin;
float time, dis, diameter = 1.0;
qhandle_t shader = 0;
int maxDripsPerLifetime = 200; // given a 10 second lifetime
int desiredDrips = 1 + (int)(le->data.spawner.variance * (maxDripsPerLifetime-1)); // range of (1...max)
int32_t maxDripsPerLifetime = 200; // given a 10 second lifetime
int32_t desiredDrips = 1 + (int32_t)(le->data.spawner.variance * (maxDripsPerLifetime-1)); // range of (1...max)
float percentLife = 1.0f - (le->endTime - cg.time)*le->lifeRate;
localEntity_t *splash = NULL;
@ -485,7 +485,7 @@ qboolean JackTheDripper( localEntity_t *le )
}
// do we need to add a drip to maintain our drips-per-second rate?
while ( (int)(flrandom(percentLife-0.05,percentLife+0.05)*desiredDrips) > le->data.spawner.data2)
while ( (int32_t)(flrandom(percentLife-0.05,percentLife+0.05)*desiredDrips) > le->data.spawner.data2)
{
VectorCopy(le->refEntity.origin, origin);
@ -524,7 +524,7 @@ qboolean JackTheDripper( localEntity_t *le )
}
//------------------------------------------------------------------------------
void CG_Drip(centity_t *cent, int killTime )
void CG_Drip(centity_t *cent, int32_t killTime )
{
vec3_t down = {0,0,-1};
localEntity_t *le = NULL;
@ -549,8 +549,8 @@ void CG_Drip(centity_t *cent, int killTime )
//------------------------------------------------------------------------------
void CG_Chunks( vec3_t origin, vec3_t dir, float scale, material_type_t type )
{
int i, j, k;
int numChunks;
int32_t i, j, k;
int32_t numChunks;
float baseScale = 1.0f, dist, radius;
vec3_t v;
sfxHandle_t snd = 0;
@ -665,7 +665,7 @@ void CG_Chunks( vec3_t origin, vec3_t dir, float scale, material_type_t type )
//The fun part is corellating the height and direction to the bezier function... heh
void CG_FountainSpurt( vec3_t org, vec3_t end )
{
int /*i,*/ t;
int32_t /*i,*/ t;
vec3_t org1, org2, cpt1, cpt2;
vec3_t dir/*, dir2*/;
//vec3_t rgb = { 0.4f, 0.7f, 0.8f };
@ -800,7 +800,7 @@ void CG_ElectricalExplosion( vec3_t start, vec3_t dir, float radius )
{
localEntity_t *le;
vec3_t pos, temp/*, angles*/;
int i, numSparks;
int32_t i, numSparks;
float scale;
// Spawn some delayed smoke
@ -868,7 +868,7 @@ void FX_PhaserFire2(vec3_t startpos, vec3_t endpos, vec3_t normal, qboolean impa
refEntity_t beam;
//float size;
//vec3_t velocity;
//int sparks;
//int32_t sparks;
vec3_t rgb = { 1,0.9,0.6}, rgb2={1,0.3,0};
// Draw beam first.
@ -911,7 +911,7 @@ void CG_PhaserFX(centity_t *cent) {
le = FX_AddSpawner(cent->currentState.origin, cent->currentState.origin2, NULL, NULL, qfalse, 0, 0, cent->currentState.time2, PhaserFX_Think, 10);
le->data.spawner.data1 = cent->currentState.angles[0];
le->data.spawner.data2 = cent->currentState.angles[2];
le->data.spawner.nextthink = cg.time + (int)cent->currentState.angles[1];
le->data.spawner.nextthink = cg.time + (int32_t)cent->currentState.angles[1];
}
qboolean TorpedoQFX_Think(localEntity_t *le)
@ -1043,7 +1043,7 @@ qboolean ParticleFire_Think(localEntity_t *le) {
vec3_t origin;
vec3_t dir = { 0, 0 , 15 };
float speed;
int i;
int32_t i;
vec3_t startRGB = { 1, 0.2, 0 };
vec3_t endRGB = { 1, 0.9, 0.7 };
@ -1079,7 +1079,7 @@ qboolean ParticleFire_Think(localEntity_t *le) {
return qtrue;
}
void CG_ParticleFire(vec3_t origin, int killtime, int size) {
void CG_ParticleFire(vec3_t origin, int32_t killtime, int32_t size) {
FX_AddSpawner(origin, NULL, NULL, NULL, qfalse, 0, 0, killtime, ParticleFire_Think, 10);
}
@ -1173,7 +1173,7 @@ void FX_DisruptorFire2(vec3_t startpos, vec3_t endpos, vec3_t normal, qboolean i
refEntity_t beam;
//float size;
//vec3_t velocity;
//int sparks;
//int32_t sparks;
vec3_t rgb = { 1,0.9,0.6}, rgb2={1,0.3,0};
// Draw beam first.
@ -1216,7 +1216,7 @@ void CG_DisruptorFX(centity_t *cent) {
le = FX_AddSpawner(cent->currentState.origin, cent->currentState.origin2, NULL, NULL, qfalse, 0, 0, cent->currentState.time2, DisruptorFX_Think, 10);
le->data.spawner.data1 = cent->currentState.angles[0];
le->data.spawner.data2 = cent->currentState.angles[2];
le->data.spawner.nextthink = cg.time + (int)cent->currentState.angles[1];
le->data.spawner.nextthink = cg.time + (int32_t)cent->currentState.angles[1];
}
// Additional ports from SP by Harry Young
@ -1232,11 +1232,11 @@ void CG_SmallSpark( vec3_t origin, vec3_t normal )
{
vec3_t dir, direction, start, end, velocity;
float scale;
int numSparks;
int32_t numSparks;
AngleVectors( normal, normal, NULL, NULL );
int j;
int32_t j;
for ( j = 0; j < 3; j ++ )
normal[j] = normal[j] + (0.1f * crandom());
@ -1244,7 +1244,7 @@ void CG_SmallSpark( vec3_t origin, vec3_t normal )
numSparks = 6 + (random() * 4.0f );
int i;
int32_t i;
for ( i = 0; i < numSparks; i++ )
{
scale = 0.1f + (random() *0.2f );
@ -1293,7 +1293,7 @@ void CG_FireLaser( vec3_t start, vec3_t end, vec3_t normal, vec3_t laserRGB, flo
vec3_t dir, right, up, angles, work, pos,
sRGB;
float scale = 1.0f;
int life = 0;
int32_t life = 0;
// Orient the laser spray
VectorSubtract( end, start, dir );
@ -1338,7 +1338,7 @@ void CG_FireLaser( vec3_t start, vec3_t end, vec3_t normal, vec3_t laserRGB, flo
0.0f,
200,
cgs.media.waterDropShader );
int t;
int32_t t;
for ( t=0; t < 2; t ++ )
{
VectorMA( pos, crandom() * 0.5f, right, work );
@ -1465,7 +1465,7 @@ void CG_ElectricFire( vec3_t origin, vec3_t normal )
vec3_t dir, direction, start, end;
vec3_t velocity;
float scale, alpha;
int numSparks, i, j;
int32_t numSparks, i, j;
AngleVectors( normal, normal, NULL, NULL);
@ -1555,7 +1555,7 @@ Creates an orange electricity bolt effect with a pulse that travels down the bea
void ForgeBoltFireback( vec3_t start, vec3_t end, vec3_t velocity, vec3_t user )
{
FX_AddElectricity( start, end, 1.0, user[DATA_RADIUS], 5.0, 1.0, 0.0, 200, cgs.media.pjBoltShader,
(int)user[DATA_EFFECTS], user[DATA_CHAOS] );
(int32_t)user[DATA_EFFECTS], user[DATA_CHAOS] );
}
#endif
@ -1612,7 +1612,7 @@ bool ForgeBoltPulse( FXPrimitive *fx, centity_t *ent )
void CG_ForgeBolt( centity_t *cent )
{
qboolean pulse;
int effects;
int32_t effects;
float chaos, radius;
// Set up all of the parms
@ -1681,7 +1681,7 @@ Create directed and scaled plasma jet
===========================
*/
void CG_Plasma( vec3_t start, vec3_t end, vec3_t sRGB, vec3_t eRGB, int startalpha, int endalpha )
void CG_Plasma( vec3_t start, vec3_t end, vec3_t sRGB, vec3_t eRGB, int32_t startalpha, int32_t endalpha )
{
vec3_t v;
float len, salpha = (startalpha / 255) , ealpha = (endalpha / 255);
@ -1797,7 +1797,7 @@ void CG_TransporterStream( centity_t *cent )
{
vec3_t vel, accel, dir, pos, right, up;
float len, time, acceleration, scale, dis, vf;
int t;
int32_t t;
VectorSubtract( cent->currentState.origin2, cent->lerpOrigin, dir );
len = VectorNormalize( dir );
MakeNormalVectors( dir, right, up );
@ -1885,7 +1885,7 @@ qboolean explosionTrailThink( localEntity_t *fx )
vec3_t direction, origin, new_org, angles, dir;
trace_t trace;
float scale;
int i;
int32_t i;
qboolean remove = qfalse;
VectorCopy( fx->m_origin, origin );
@ -1914,14 +1914,14 @@ qboolean explosionTrailThink( localEntity_t *fx )
VectorSubtract( cg.refdef.vieworg, origin, direction );
VectorNormalize( direction );
for ( i = 0; i < 3 + (int)remove * 6; i++)
for ( i = 0; i < 3 + (int32_t)remove * 6; i++)
{
angles[2] = crandom() * 360;
AngleVectors( angles, NULL, dir, NULL );
VectorMA( origin, random() * 50.0f, dir, new_org );
le = CG_MakeExplosion( new_org, direction, cgs.media.explosionModel, 6, cgs.media.surfaceExplosionShader, 400 + (int)remove * 800, qfalse, random() * 1.0 + 0.8 );//random() * 1.0 + 1.0 );
le = CG_MakeExplosion( new_org, direction, cgs.media.explosionModel, 6, cgs.media.surfaceExplosionShader, 400 + (int32_t)remove * 800, qfalse, random() * 1.0 + 0.8 );//random() * 1.0 + 1.0 );
}
le->light = 150;
@ -2037,8 +2037,8 @@ void CG_ShimmeryThing( vec3_t start, vec3_t end, vec3_t content )
{
vec3_t normal, angles, base, top, dir;
float len;
int i;
int taper = content[2];
int32_t i;
int32_t taper = content[2];
VectorSubtract( end, start, normal );
len = VectorNormalize( normal );
@ -2112,7 +2112,7 @@ void CG_Borg_Bolt_dynamic( centity_t *cent )
// If the length is pretty short, then spawn a glow spark
if ( len > 0 && len < 12 )
{
int ct, t;
int32_t ct, t;
vec3_t angles, dir, vel;
localEntity_t *particle;

View File

@ -16,7 +16,7 @@ CG_PlaceString
Also called by scoreboard drawing
===================
*/
const char *CG_PlaceString( int rank ) {
const char *CG_PlaceString( int32_t rank ) {
static char str[64];
static char str2[64];
char *s, *t;
@ -80,8 +80,8 @@ CG_Obituary
=============
*/
static void CG_Obituary( entityState_t *ent ) {
int mod;
int target, attacker;
int32_t mod;
int32_t target, attacker;
char *method;
const char *targetInfo;
const char *attackerInfo;
@ -286,7 +286,7 @@ CG_UseItem
===============
*/
static void CG_UseItem( centity_t *cent ) {
int itemNum;
int32_t itemNum;
entityState_t *es;
es = &cent->currentState;
@ -341,7 +341,7 @@ CG_ItemPickup
A new item was picked up this frame
================
*/
static void CG_ItemPickup( int itemNum ) {
static void CG_ItemPickup( int32_t itemNum ) {
cg.itemPickup = itemNum;
cg.itemPickupTime = cg.time;
cg.itemPickupBlendTime = cg.time;
@ -352,8 +352,8 @@ static void CG_ItemPickup( int itemNum ) {
if ( bg_itemlist[itemNum].giType == IT_WEAPON )
{
int nCurWpn = cg.predictedPlayerState.weapon;
int nNewWpn = bg_itemlist[itemNum].giTag;
int32_t nCurWpn = cg.predictedPlayerState.weapon;
int32_t nNewWpn = bg_itemlist[itemNum].giTag;
// kef -- check cg_autoswitch...
//
@ -409,7 +409,7 @@ CG_PainEvent
Also called by playerstate transition
================
*/
void CG_PainEvent( centity_t *cent, int health ) {
void CG_PainEvent( centity_t *cent, int32_t health ) {
char *snd;
// don't do more than two pain sounds a second
@ -445,13 +445,13 @@ also called by CG_CheckPlayerstateEvents
#define DEBUGNAME(x) if(cg_debugEvents.integer){CG_Printf(x"\n");}
void CG_EntityEvent( centity_t *cent, vec3_t position ) {
entityState_t *es;
int event;
int32_t event;
vec3_t dir;
const char *s;
int clientNum;
int32_t clientNum;
clientInfo_t *ci;
vec3_t normal = { 0, 0, 1 };
int a, b;
int32_t a, b;
refEntity_t legs;
refEntity_t torso;
@ -613,8 +613,8 @@ void CG_EntityEvent( centity_t *cent, vec3_t position ) {
break;
{
float oldStep;
int delta;
int step;
int32_t delta;
int32_t step;
if ( clientNum != cg.predictedPlayerState.clientNum ) {
break;
@ -700,7 +700,7 @@ void CG_EntityEvent( centity_t *cent, vec3_t position ) {
DEBUGNAME("EV_ITEM_PICKUP");
{
gitem_t *item;
int index;
int32_t index;
index = es->eventParm; // player predicted
@ -731,7 +731,7 @@ void CG_EntityEvent( centity_t *cent, vec3_t position ) {
DEBUGNAME("EV_GLOBAL_ITEM_PICKUP");
{
gitem_t *item;
int index;
int32_t index;
index = es->eventParm; // player predicted
@ -1380,7 +1380,7 @@ case EV_SHAKE_SOUND:
case EV_OBJECTIVE_COMPLETE:
if ( es->eventParm == 0 )
{//Special code meaning clear all objectives
int i;
int32_t i;
for ( i = 0; i < MAX_OBJECTIVES; i++ )
{
cgs.objectives[i].complete = qfalse;

View File

@ -19,8 +19,8 @@ CG_DrawLoadingIcons
===================
*/
static void CG_DrawLoadingIcons( void ) {
// int n;
int x, y;
// int32_t n;
int32_t x, y;
trap_R_SetColor( colorTable[CT_WHITE]);
@ -57,7 +57,7 @@ void CG_LoadingString( const char *s ) {
CG_LoadingItem
===================
*/
void CG_LoadingItem( int itemNum ) {
void CG_LoadingItem( int32_t itemNum ) {
gitem_t *item;
item = &bg_itemlist[itemNum];
@ -74,7 +74,7 @@ void CG_LoadingItem( int itemNum ) {
CG_LoadingClient
===================
*/
void CG_LoadingClient( int clientNum ) {
void CG_LoadingClient( int32_t clientNum ) {
const char *info;
char *skin;
char personality[MAX_QPATH];
@ -120,12 +120,12 @@ void CG_DrawInformation( void ) {
const char *s;
const char *info;
const char *sysInfo;
int y,x;
// int value;
int32_t y,x;
// int32_t value;
qhandle_t levelshot;
// qhandle_t detail;
char buf[1024];
int strlength,length;
int32_t strlength,length;
//trap_Cvar_Set ("rpg_playIntro", "1");
@ -282,7 +282,7 @@ CG_LoadBar
*/
void CG_LoadBar(void)
{
int x,y,pad;
int32_t x,y,pad;
// Round LCARS buttons
y = 309;
@ -473,9 +473,9 @@ void CG_LoadBar(void)
}
static int missionYcnt;
static int missionYpos;
static int missionInfoScreenY;
static int32_t missionYcnt;
static int32_t missionYpos;
static int32_t missionInfoScreenY;
#define OBJ_HORIZONTAL_BORDER_X 15 // Where graphic starts
#define OBJ_HORIZONTAL_BORDER_WIDTH 30 // Thickness of graphic
@ -499,13 +499,13 @@ static int missionInfoScreenY;
ObjectivePrint_Line
====================
*/
static void ObjectivePrint_Line(int strIndex,int color,centity_t *cent)
static void ObjectivePrint_Line(int32_t strIndex,int32_t color,centity_t *cent)
{
char *str,*strBegin;
int y,pixelLen;
int32_t y,pixelLen;
char holdText[1024], holdText2[2];
char finalText[MAX_OBJ_LENGTH];
int len, maxPixLength, charHeight;
int32_t len, maxPixLength, charHeight;
assert(cgs.objectives[strIndex].text);
@ -547,7 +547,7 @@ static void ObjectivePrint_Line(int strIndex,int color,centity_t *cent)
else
{
pixelLen = 0;
int charLen = 0;
int32_t charLen = 0;
holdText2[1] = '\0';
strBegin = str;
@ -598,14 +598,14 @@ static void ObjectivePrint_Line(int strIndex,int color,centity_t *cent)
}
}
static int Objective_LineCnt(int strIndex,centity_t *cent)
static int32_t Objective_LineCnt(int32_t strIndex,centity_t *cent)
{
char *str,*strBegin;
int pixelLen;
int32_t pixelLen;
char holdText[1024], holdText2[2];
char finalText[MAX_OBJ_LENGTH];
int len, maxPixLength;
int lineCnt;
int32_t len, maxPixLength;
int32_t lineCnt;
assert(cgs.objectives[strIndex].text);
str = cgs.objectives[strIndex].text;
@ -629,7 +629,7 @@ static int Objective_LineCnt(int strIndex,centity_t *cent)
else
{
pixelLen = 0;
int charLen = 0;
int32_t charLen = 0;
holdText2[1] = '\0';
strBegin = str;
@ -682,8 +682,8 @@ Objectives_Draw
*/
static void Objectives_Draw( centity_t *cent )
{
int objCnt,i,lineCnt,maxLines;
int total,textYCnt,length,color;
int32_t objCnt,i,lineCnt,maxLines;
int32_t total,textYCnt,length,color;
vec4_t newColor;
objCnt=0;

File diff suppressed because it is too large Load Diff

View File

@ -19,7 +19,7 @@ This is called at startup and for tournement restarts
===================
*/
void CG_InitLocalEntities( void ) {
int i;
int32_t i;
memset( cg_localEntities, 0, sizeof( cg_localEntities ) );
cg_activeLocalEntities.next = &cg_activeLocalEntities;
@ -111,7 +111,7 @@ CG_ReflectVelocity
void CG_ReflectVelocity( localEntity_t *le, trace_t *trace ) {
vec3_t velocity;
float dot;
int hitTime;
int32_t hitTime;
// reflect the velocity on the trace plane
hitTime = cg.time - cg.frametime + cg.frametime * trace->fraction;
@ -297,7 +297,7 @@ void CG_AddExplosion( localEntity_t *ex )
// calculate model frame
if ( ex->lifeRate > 0 ) {
float frac = (cg.time - ex->startTime) * ex->lifeRate;
int f = floor(frac);
int32_t f = floor(frac);
if ( f < 0 ) {
f = 0;
}
@ -1116,7 +1116,7 @@ void CG_AddFragment( localEntity_t *le ) {
if ( le->pos.trType == TR_STATIONARY ) {
// sink into the ground if near the removal time
int t;
int32_t t;
t = le->endTime - cg.time;
if ( t < SINK_TIME ) {
@ -1150,7 +1150,7 @@ void CG_AddFragment( localEntity_t *le ) {
BG_EvaluateTrajectory( &le->angles, cg.time, angles );
AnglesToAxis( angles, le->refEntity.axis );
int k;
int32_t k;
for(k = 0; k < 3; k++)
{
VectorScale(le->refEntity.axis[k], le->data.fragment.radius, le->refEntity.axis[k]);

View File

@ -25,7 +25,7 @@ void QDECL LUA_LOG(const char *fmt, ...)
{
va_list argptr;
char buff[1024], string[1024];
int min, tens, sec;
int32_t min, tens, sec;
va_start(argptr, fmt);
Com_sprintf(buff, sizeof(buff), fmt, argptr);
@ -44,9 +44,9 @@ void QDECL LUA_LOG(const char *fmt, ...)
}
}
qboolean LoadLuaFile(char *path, int num_vm)
qboolean LoadLuaFile(char *path, int32_t num_vm)
{
int flen = 0;
int32_t flen = 0;
char *code;
fileHandle_t f;
lvm_t *vm;
@ -117,8 +117,8 @@ qboolean CG_LuaInit()
return qtrue;
}
qboolean CG_LuaResume(lvm_t *vm, lua_State *T, char *func, int nargs) {
int res = lua_resume(T, NULL, nargs);
qboolean CG_LuaResume(lvm_t *vm, lua_State *T, char *func, int32_t nargs) {
int32_t res = lua_resume(T, NULL, nargs);
if(res == LUA_ERRRUN) {
LUA_LOG("Lua: %s error running lua script: %s\n", func, lua_tostring(T, -1));
@ -139,9 +139,9 @@ qboolean CG_LuaResume(lvm_t *vm, lua_State *T, char *func, int nargs) {
return qtrue;
}
qboolean CG_LuaCall(lvm_t * vm, char *func, int nargs, int nresults)
qboolean CG_LuaCall(lvm_t * vm, char *func, int32_t nargs, int32_t nresults)
{
int res = lua_pcall(vm->L, nargs, nresults, 0);
int32_t res = lua_pcall(vm->L, nargs, nresults, 0);
if(res == LUA_ERRRUN)
{
@ -208,7 +208,7 @@ qboolean CG_LuaGetFunction(lvm_t * vm, char *name)
qboolean CG_LuaStartVM(lvm_t * vm)
{
int res = 0;
int32_t res = 0;
char homepath[MAX_QPATH], gamepath[MAX_QPATH];
vm->L = luaL_newstate();
@ -310,7 +310,7 @@ void CG_LuaStopVM(lvm_t * vm)
void CG_LuaShutdown()
{
int i;
int32_t i;
lvm_t *vm;
for(i = 0; i < NUM_VMS; i++)
@ -327,7 +327,7 @@ void CG_LuaShutdown()
void CG_LuaStatus(void)
{
int i, cnt = 0;
int32_t i, cnt = 0;
for(i = 0; i < NUM_VMS; i++)
if(lVM[i])
@ -361,7 +361,7 @@ void CG_LuaStatus(void)
lvm_t *CG_LuaGetVM(lua_State * L)
{
int i;
int32_t i;
for(i = 0; i < NUM_VMS; i++)
if(lVM[i] && lVM[i]->L == L)

View File

@ -31,11 +31,11 @@
#define Lua_RegConstString(L, n) (lua_pushstring(L, #n), lua_pushstring(L, n), lua_settable(L, -3))
typedef struct {
int id;
int32_t id;
char filename[MAX_QPATH];
char *code;
int code_size;
int error;
int32_t code_size;
int32_t error;
lua_State *L;
} lvm_t;
@ -44,8 +44,8 @@ extern lvm_t *lVM[NUM_VMS];
void QDECL LUA_DEBUG(const char *fmt, ...);
void QDECL LUA_LOG(const char *fmt, ...);
qboolean CG_LuaInit(void);
qboolean CG_LuaCall(lvm_t *vm, char *func, int nargs, int nresults);
qboolean CG_LuaResume(lvm_t *vm, lua_State *T, char *func, int nargs);
qboolean CG_LuaCall(lvm_t *vm, char *func, int32_t nargs, int32_t nresults);
qboolean CG_LuaResume(lvm_t *vm, lua_State *T, char *func, int32_t nargs);
qboolean CG_LuaGetFunction(lvm_t *vm, char *name);
qboolean CG_LuaGetFunctionT(lua_State *T, char *name);
qboolean CG_LuaStartVM(lvm_t *vm);
@ -55,17 +55,17 @@ void CG_LuaStatus(void);
lvm_t *CG_LuaGetVM(lua_State *L);
// lua_cgame.c
int Luaopen_CGame(lua_State *L);
int32_t Luaopen_CGame(lua_State *L);
// lua_qmath.c
int Luaopen_Qmath(lua_State *L);
int32_t Luaopen_Qmath(lua_State *L);
// lua_vector.c
int Luaopen_Vector(lua_State *L);
int32_t Luaopen_Vector(lua_State *L);
void Lua_PushVector(lua_State *L, vec3_t v);
vec_t *Lua_GetVector(lua_State *L, int argNum);
int Lua_IsVector(lua_State *L, int index);
vec3_t *Lua_GetVectorMisc(lua_State *L, int *index);
vec_t *Lua_GetVector(lua_State *L, int32_t argNum);
int32_t Lua_IsVector(lua_State *L, int32_t index);
vec3_t *Lua_GetVectorMisc(lua_State *L, int32_t *index);
// lua_cfx.c
typedef struct {
@ -74,7 +74,7 @@ typedef struct {
typedef struct {
cfx_t **cfx;
int cnt;
int32_t cnt;
} cfxList_t;
void Lua_CFX_LoadMapFxFile(void);
@ -84,16 +84,16 @@ typedef struct {
centity_t *e;
} cent_t;
int Luaopen_Cent(lua_State *L);
int32_t Luaopen_Cent(lua_State *L);
void Lua_PushCent(lua_State *L, centity_t *ent);
cent_t *Lua_GetCent(lua_State *L, int argNum);
cent_t *Lua_GetCent(lua_State *L, int32_t argNum);
// lua_refent.c
typedef struct {
refEntity_t *r;
} rent_t;
int Luaopen_Rent(lua_State *L);
int32_t Luaopen_Rent(lua_State *L);
void Lua_PushRent(lua_State *L, refEntity_t *rent);
rent_t *Lua_GetRent(lua_State *L, int argNum);
rent_t *Lua_GetRent(lua_State *L, int32_t argNum);
#endif

View File

@ -8,7 +8,7 @@
#include "cg_local.h"
#include "cg_text.h"
void CG_Init( int serverMessageNum, int serverCommandSequence );
void CG_Init( int32_t serverMessageNum, int32_t serverCommandSequence );
void CG_Shutdown( void );
void CG_LoadIngameText(void);
void CG_LoadObjectivesForMap(void);
@ -20,9 +20,9 @@ qboolean CG_LoadUsablesStrings( void );
extern void FX_InitSinTable(void);
int cg_liftEnts[MAX_CLIENTS];
int cg_numAnims;
int cg_numSndAnims;
int32_t cg_liftEnts[MAX_CLIENTS];
int32_t cg_numAnims;
int32_t cg_numSndAnims;
animsSndList_t cg_animsSndList[MAX_CLIENTS];
@ -36,7 +36,7 @@ This is the only way control passes into the module.
This must be the very first function compiled into the .q3vm file
================
*/
Q_EXPORT intptr_t vmMain( int command, int arg0, int arg1, int arg2, int arg3, int arg4, int arg5, int arg6 ) {
Q_EXPORT intptr_t vmMain( int32_t command, int32_t arg0, int32_t arg1, int32_t arg2, int32_t arg3, int32_t arg4, int32_t arg5, int32_t arg6 ) {
switch ( command ) {
case CG_INIT:
CG_Init( arg0, arg1 );
@ -200,7 +200,7 @@ typedef struct {
vmCvar_t *vmCvar;
char *cvarName;
char *defaultString;
int cvarFlags;
int32_t cvarFlags;
} cvarTable_t;
static cvarTable_t cvarTable[] = {
@ -340,7 +340,7 @@ CG_PrecacheRemapShaders
void CG_PrecacheRemapShaders(void) {
char filepath[MAX_QPATH];
fileHandle_t f;
int len;
int32_t len;
char* data;
char* ptr;
char* token;
@ -397,7 +397,7 @@ CG_RegisterCvars
=================
*/
void CG_RegisterCvars( void ) {
int i;
int32_t i;
cvarTable_t *cv;
char var[MAX_TOKEN_CHARS];
@ -418,7 +418,7 @@ CG_UpdateCvars
=================
*/
void CG_UpdateCvars( void ) {
int i;
int32_t i;
cvarTable_t *cv;
for ( i = 0, cv = cvarTable ; i < CVAR_TABLE_SIZE ; i++, cv++ )
@ -442,7 +442,7 @@ void CG_UpdateCvars( void ) {
}
int CG_CrosshairPlayer( void ) {
int32_t CG_CrosshairPlayer( void ) {
if ( cg.time > ( cg.crosshairClientTime + 1000 ) ) {
return -1;
}
@ -450,7 +450,7 @@ int CG_CrosshairPlayer( void ) {
}
int CG_LastAttacker( void ) {
int32_t CG_LastAttacker( void ) {
if ( !cg.attackerTime ) {
return -1;
}
@ -530,7 +530,7 @@ void QDECL Com_Printf( const char *msg, ... ) {
CG_Argv
================
*/
const char *CG_Argv( int arg ) {
const char *CG_Argv( int32_t arg ) {
static char buffer[MAX_STRING_CHARS];
trap_Argv( arg, buffer, sizeof( buffer ) );
@ -548,11 +548,11 @@ CG_RegisterItemSounds
The server says this item is used on this level
=================
*/
static void CG_RegisterItemSounds( int itemNum ) {
static void CG_RegisterItemSounds( int32_t itemNum ) {
gitem_t *item;
char data[MAX_QPATH];
char *s, *start;
int len;
int32_t len;
item = &bg_itemlist[ itemNum ];
@ -600,7 +600,7 @@ called during a precache command
*/
static void CG_RegisterSounds( void )
{
int i;
int32_t i;
char items[MAX_ITEMS+1];
char name[MAX_QPATH];
const char *soundName;
@ -748,7 +748,7 @@ This function may execute for a couple of minutes with a slow disk.
=================
*/
static void CG_RegisterGraphics( void ) {
int i;
int32_t i;
char items[MAX_ITEMS+1];
static char *sb_nums[11] = {
@ -929,7 +929,7 @@ static void CG_RegisterGraphics( void ) {
for ( i = 1 ; i < cgs.numInlineModels ; i++ ) {
char name[10];
vec3_t mins, maxs;
int j;
int32_t j;
Com_sprintf( name, sizeof(name), "*%i", i );
cgs.inlineDrawModel[i] = trap_R_RegisterModel( name );
@ -1084,7 +1084,7 @@ CG_RegisterClients
===================
*/
static void CG_RegisterClients( void ) {
int i;
int32_t i;
cg.loadLCARSStage = 8; // Loading bar stage 8
CG_LoadingString( "clients" );
@ -1115,7 +1115,7 @@ static void CG_RegisterClients( void ) {
CG_ConfigString
=================
*/
const char *CG_ConfigString( int index ) {
const char *CG_ConfigString( int32_t index ) {
if ( index < 0 || index >= MAX_CONFIGSTRINGS ) {
CG_Error( "CG_ConfigString: bad index: %i", index );
}
@ -1142,7 +1142,7 @@ void CG_StartMusic( void ) {
trap_S_StartBackgroundTrack( parm1, parm2 );
}
extern int altAmmoUsage[];
extern int32_t altAmmoUsage[];
void CG_InitModRules( void )
{
if ( cgs.pModDisintegration )
@ -1163,9 +1163,9 @@ Called after every level change or subsystem restart
Will perform callbacks to make the loading info screen update.
=================
*/
void CG_Init( int serverMessageNum, int serverCommandSequence ) {
void CG_Init( int32_t serverMessageNum, int32_t serverCommandSequence ) {
const char *s;
int i;
int32_t i;
// clear everything
memset( &cgs, 0, sizeof( cgs ) );
@ -1357,8 +1357,8 @@ void CG_ParseIngameText(void)
{
char *token;
char *buffer;
int i;
int len;
int32_t i;
int32_t len;
COM_BeginParseSession();
@ -1434,7 +1434,7 @@ CG_LoadIngameText
*/
void CG_LoadIngameText(void)
{
int len;
int32_t len;
fileHandle_t f;
char fileName[MAX_QPATH];
@ -1473,7 +1473,7 @@ CG_LoadObjectivesForMap
*/
void CG_LoadObjectivesForMap(void)
{
int len, objnum = 0;
int32_t len, objnum = 0;
char *token;
char *buf;
fileHandle_t f;
@ -1541,12 +1541,12 @@ void CG_LoadObjectivesForMap(void)
qboolean CG_LoadClasses( void )
{
fileHandle_t f;
int file_len;
int32_t file_len;
char buffer[32000];
char *token, *textPtr;
char filePath[MAX_QPATH];
int numClasses=0;
int i;
int32_t numClasses=0;
int32_t i;
Com_sprintf( filePath, sizeof( filePath ), "ext_data/classes/%s.classes", cgs.classSet );
@ -1627,7 +1627,7 @@ qboolean CG_LoadClasses( void )
for ( i = 0; i < 3; i++ )
{
cgs.classData[numClasses].radarColor[i] = (int)Com_Clamp( 0, 255, (int)temp[i] );
cgs.classData[numClasses].radarColor[i] = (int32_t)Com_Clamp( 0, 255, (int32_t)temp[i] );
}
continue;
@ -1669,7 +1669,7 @@ qboolean CG_LoadClasses( void )
if ( !Q_stricmpn( token, "medical", 7 ) )
{
if ( COM_ParseInt( &textPtr, (int *)&cgs.classData[numClasses].isMedic ) )
if ( COM_ParseInt( &textPtr, (int32_t *)&cgs.classData[numClasses].isMedic ) )
{
CG_Printf( S_COLOR_RED "ERROR: Class medic check for class %i was invalid.\n", numClasses );
continue;
@ -1680,7 +1680,7 @@ qboolean CG_LoadClasses( void )
if( !Q_stricmpn( token, "isBorg", 6 ) )
{
if( COM_ParseInt( &textPtr, (int *)&cgs.classData[numClasses].isBorg ) )
if( COM_ParseInt( &textPtr, (int32_t *)&cgs.classData[numClasses].isBorg ) )
{
CG_Printf( S_COLOR_RED "ERROR: Class borg check for class %i was invalid.\n", numClasses );
continue;
@ -1690,7 +1690,7 @@ qboolean CG_LoadClasses( void )
if ( !Q_stricmpn( token, "hasRanks", 8 ) )
{
if ( COM_ParseInt( &textPtr, (int *)&cgs.classData[numClasses].showRanks ) )
if ( COM_ParseInt( &textPtr, (int32_t *)&cgs.classData[numClasses].showRanks ) )
{
CG_Printf( S_COLOR_RED "ERROR: Class Ranks check for class %i was invalid.\n", numClasses );
continue;
@ -1752,11 +1752,11 @@ qboolean CG_LoadUsablesStrings( void )
char fileRoute[MAX_QPATH];
char mapRoute[MAX_QPATH];
char buffer[20000];
int file_len;
int32_t file_len;
char *textPtr, *token;
fileHandle_t f;
int i;
int strLen;
int32_t i;
int32_t strLen;
//setup the file route
Com_sprintf( mapRoute, sizeof( mapRoute ), "%s", cgs.mapname );

View File

@ -25,7 +25,7 @@ This is called at startup and for tournement restarts
===================
*/
void CG_InitMarkPolys( void ) {
int i;
int32_t i;
memset( cg_markPolys, 0, sizeof(cg_markPolys) );
@ -72,7 +72,7 @@ markPoly_t *CG_AllocMark( void ) {
if ( !cg_freeMarkPolys ) {
// no free entities, so free the one at the end of the chain
// remove the oldest active entity
int time = cg_activeMarkPolys.prevMark->time;
int32_t time = cg_activeMarkPolys.prevMark->time;
while (cg_activeMarkPolys.prevMark && time == cg_activeMarkPolys.prevMark->time) {
CG_FreeMarkPoly( cg_activeMarkPolys.prevMark );
}
@ -114,8 +114,8 @@ void CG_ImpactMark( qhandle_t markShader, const vec3_t origin, const vec3_t dir,
float texCoordScale;
vec3_t originalPoints[4];
byte colors[4];
int i, j;
int numFragments;
int32_t i, j;
int32_t numFragments;
markFragment_t markFragments[MAX_MARK_FRAGMENTS], *mf;
vec3_t markPoints[MAX_MARK_POINTS];
vec3_t projection;
@ -181,7 +181,7 @@ void CG_ImpactMark( qhandle_t markShader, const vec3_t origin, const vec3_t dir,
VectorSubtract( v->xyz, origin, delta );
v->st[0] = 0.5 + DotProduct( delta, axis[1] ) * texCoordScale;
v->st[1] = 0.5 + DotProduct( delta, axis[2] ) * texCoordScale;
*(int *)v->modulate = *(int *)colors;
*(int32_t *)v->modulate = *(int32_t *)colors;
}
// if it is a temporary (shadow) mark, add it immediately and forget about it
@ -215,10 +215,10 @@ CG_AddMarks
#define MARK_DIV_3000 1.0/3000.0
void CG_AddMarks( void ) {
int j;
int32_t j;
markPoly_t *mp, *next;
int t;
int fade;
int32_t t;
int32_t fade;
if ( !cg_addMarks.integer ) {
return;

View File

@ -5,8 +5,8 @@
typedef struct motionblurDot_s {
qboolean active;
refEntity_t refEnt;
int startTime;
int lifeTime;
int32_t startTime;
int32_t lifeTime;
} motionblurDot_t;
//static motionblurDot_t cg_motionblurDots[MAX_MOTIONBLURDOTS];
@ -16,7 +16,7 @@ typedef struct motionblurDot_s {
void CG_MotionBlur(void) {
//motionblurDot_t *dot;
//vec3_t pos, axis[3];
//int i;
//int32_t i;
/*if ( !cg.snap->ps.powerups[PW_BOOST] && cg.snap->ps.timers[tmZanzoken] < 1 && !cg.snap->ps.timers[tmTransform]) {

View File

@ -37,10 +37,10 @@ stringID_table_t BoltonTable[BOLTON_MAX + 1] =
{ NULL, -1 }
};
int timeParam;
//int beamTimeParam; //RPG-X : TiM - Beaming
int32_t timeParam;
//int32_t beamTimeParam; //RPG-X : TiM - Beaming
int entNum;
int32_t entNum;
/*
================
@ -48,9 +48,9 @@ CG_CustomSound
================
*/
sfxHandle_t CG_CustomSound( int clientNum, const char *soundName ) {
sfxHandle_t CG_CustomSound( int32_t clientNum, const char *soundName ) {
clientInfo_t *ci;
int i;
int32_t i;
if ( soundName[0] != '*' ) {
return trap_S_RegisterSound( soundName );
@ -80,16 +80,16 @@ ANIM SOUND CONFIG LOADING AND PLAYING
*/
/*
void CG_PlayerAnimSounds( animsounds_t *animSounds, int frame, const vec3_t org, int entNum )
void CG_PlayerAnimSounds( animsounds_t *animSounds, int32_t frame, const vec3_t org, int32_t entNum )
play any keyframed sounds - only when start a new frame
This func is called once for legs and once for torso
*/
//void CG_PlayerAnimSounds( animsounds_t *animSounds, int frame, int entNum, qboolean metal )
void CG_PlayerAnimSounds( animsounds_t *animSounds, int frame, int eNum, int surfType)
//void CG_PlayerAnimSounds( animsounds_t *animSounds, int32_t frame, int32_t entNum, qboolean metal )
void CG_PlayerAnimSounds( animsounds_t *animSounds, int32_t frame, int32_t eNum, int32_t surfType)
{
int i;
int holdSnd = -1;
int32_t i;
int32_t holdSnd = -1;
qboolean playSound = qfalse;
/*if ( entNum == cg.predictedPlayerState.clientNum && !cg.renderingThirdPerson )
@ -159,12 +159,12 @@ void CG_PlayerAnimSounds( animsounds_t *animSounds, int frame, int eNum, int sur
}
}
void ParseAnimationSndBlock(const char *filename, animsounds_t *animSounds, animation_t *animations, int *i,char **text_p)
void ParseAnimationSndBlock(const char *filename, animsounds_t *animSounds, animation_t *animations, int32_t *i,char **text_p)
{
char *token;
char soundString[MAX_QPATH];
int lowestVal, highestVal;
int animNum, num, n;
int32_t lowestVal, highestVal;
int32_t animNum, num, n;
// get past starting bracket
while(1)
@ -307,14 +307,14 @@ This file's presence is not required
======================
*/
static int CG_ParseAnimationSndFile( const char *filename, int animFileIndex )
static int32_t CG_ParseAnimationSndFile( const char *filename, int32_t animFileIndex )
{
char *text_p;
int len;
int32_t len;
char *token;
char text[20000];
fileHandle_t f;
int i, j, upper_i, lower_i;
int32_t i, j, upper_i, lower_i;
animsounds_t *lowerAnimSounds;
animsounds_t *upperAnimSounds;
animation_t *animations;
@ -423,13 +423,13 @@ A lot more efficient considering how many freakin more animations we introduced
*/
//
//static qboolean CG_ParseAnimationFile( const char *filename, clientInfo_t *ci ) {
static int CG_ParseAnimationFile( const char* filename/*, clientInfo_t *ci*/ ) {
static int32_t CG_ParseAnimationFile( const char* filename/*, clientInfo_t *ci*/ ) {
char *text_p, *prev;
int len;
int i;
int32_t len;
int32_t i;
char *token;
float fps;
int skip;
int32_t skip;
char text[20000];
fileHandle_t f;
animation_t *animations;
@ -438,7 +438,7 @@ static int CG_ParseAnimationFile( const char* filename/*, clientInfo_t *ci*/ ) {
if ( cg_numAnims > 0 ) {
for ( i = 0; i <= cg_numAnims; i++ ) {
if ( !Q_stricmpn( cg_animsList[i].animFileRoute, filename, (int)strlen( filename ) ) ) { //We found a matching anim set
if ( !Q_stricmpn( cg_animsList[i].animFileRoute, filename, (int32_t)strlen( filename ) ) ) { //We found a matching anim set
//Com_Printf( S_COLOR_RED "Using index: %i\n", i );
return i;
}
@ -694,9 +694,9 @@ static qboolean CG_ParseSkinSetDataFile( clientInfo_t *ci, const char *skinSetFr
char* token;
char* textPtr;
char buffer[5000];
int len;
int32_t len;
fileHandle_t f;
int n, i;
int32_t n, i;
if ( ( skinStar = strstr( skinSetFrame, "*" ) ) == NULL )
{
@ -712,7 +712,7 @@ static qboolean CG_ParseSkinSetDataFile( clientInfo_t *ci, const char *skinSetFr
Com_sprintf( skinSetName, sizeof( skinSetName ), "%s%s", skinName, skinStar );
}
//star is at end
else if ((int)(skinStar - skinSetFrame)+1 == (int)strlen(skinSetFrame) )
else if ((int32_t)(skinStar - skinSetFrame)+1 == (int32_t)strlen(skinSetFrame) )
{
Q_strncpyz( skinSetName, skinSetFrame, strlen( skinSetFrame ) );
Q_strcat( skinSetName, sizeof( skinSetName ), skinName );
@ -950,12 +950,12 @@ a character model.
static qboolean CG_ParseModelDataFile( clientInfo_t *ci, const char *charName,
const char *modelName, const char *skinName ) {
fileHandle_t file;
int file_len;
int32_t file_len;
char charText[20000];
char *textPtr;
char fileName[MAX_QPATH];
//char animPath[MAX_QPATH];
int i, n;
int32_t i, n;
char *token;
char legsFileRoute[MAX_QPATH];
char animSndFileRoute[MAX_QPATH];
@ -1096,7 +1096,7 @@ static qboolean CG_ParseModelDataFile( clientInfo_t *ci, const char *charName,
continue;
}
ci->torsoModel = trap_R_RegisterModel( token );
//Com_Printf("Torsomodel passed as %s, %i\n", token, (int)ci->torsoModel);
//Com_Printf("Torsomodel passed as %s, %i\n", token, (int32_t)ci->torsoModel);
if (!ci->torsoModel) {
Com_Printf( S_COLOR_RED "ERROR: Unable to load torso model: %s\n", token);
@ -1286,7 +1286,7 @@ static qboolean CG_ParseModelDataFile( clientInfo_t *ci, const char *charName,
if ( ci->animIndex == -1 && strlen( legsFileRoute ) > 0 ) {
//get length of file route
i = (int)strlen(legsFileRoute);
i = (int32_t)strlen(legsFileRoute);
while( 1 ) {
//if we looped all the way to the end.... ie BAD
@ -1358,12 +1358,12 @@ CLIENT INFO
//This function has been rpg-x'ed®! (by J2J and fixed by RedTechie)
static qboolean CG_ParseAnimationFile( const char *filename, clientInfo_t *ci ) {
char *text_p;
int len;
int i;
int32_t len;
int32_t i;
char *token;
// char aniname[255];
float fps;
int skip;
int32_t skip;
char text[20000];
// char text2[20000];
fileHandle_t f;
@ -1574,7 +1574,7 @@ CG_ColorFromString
====================
*/
/*static void CG_ColorFromString( const char *v, vec3_t color ) {
int val;
int32_t val;
VectorClear( color );
@ -1604,9 +1604,9 @@ Load it now, taking the disk hits.
This will usually be deferred to a safe time
===================
*/
static void CG_LoadClientInfo( clientInfo_t *ci , int clientNum) {
static void CG_LoadClientInfo( clientInfo_t *ci , int32_t clientNum) {
const char *dir, *fallback;
int i;
int32_t i;
const char *s;
char temp_string[200];
@ -1672,7 +1672,7 @@ static void CG_LoadClientInfo( clientInfo_t *ci , int clientNum) {
// teamplay game where groups are defined.
// most of the time this will not hit
void updateSkin(int clientNum, char *new_model)
void updateSkin(int32_t clientNum, char *new_model)
{
char model_string[200];
@ -1692,7 +1692,7 @@ CG_CopyClientInfoModel
======================
*/
static void CG_CopyClientInfoModel( clientInfo_t *from, clientInfo_t *to ) {
//int i;
//int32_t i;
VectorCopy( from->headOffset, to->headOffset );
to->footsteps = from->footsteps;
@ -1768,7 +1768,7 @@ CG_ScanForExistingClientInfo
======================
*/
static qboolean CG_ScanForExistingClientInfo( clientInfo_t *ci ) {
int i;
int32_t i;
clientInfo_t *match;
for ( i = 0 ; i < cgs.maxclients ; i++ ) {
@ -1803,8 +1803,8 @@ We aren't going to load it now, so grab some other
client's info to use until we have some spare time.
======================
*/
static void CG_SetDeferredClientInfo( clientInfo_t *ci, int clientNum ) {
int i;
static void CG_SetDeferredClientInfo( clientInfo_t *ci, int32_t clientNum ) {
int32_t i;
clientInfo_t *match;
// find the first valid clientinfo and grab its stuff
@ -1831,7 +1831,7 @@ static void CG_SetDeferredClientInfo( clientInfo_t *ci, int clientNum ) {
CG_NewClientInfo
======================
*/
void CG_NewClientInfo( int clientNum ) {
void CG_NewClientInfo( int32_t clientNum ) {
clientInfo_t *ci;
clientInfo_t newInfo;
const char *configstring;
@ -1839,7 +1839,7 @@ void CG_NewClientInfo( int clientNum ) {
char *model = NULL;
char *skin = NULL;
size_t len;
//int i;
//int32_t i;
ci = &cgs.clientinfo[clientNum];
@ -1938,7 +1938,7 @@ void CG_NewClientInfo( int clientNum ) {
Q_strncpyz( newInfo.charName, v, sizeof( newInfo.charName ) ); //just set it
} else { //otherwise, isolate the first bit, and copy that
len = strlen( v );
Q_strncpyz( newInfo.charName, v, ((int)len - (int)strlen(model)) + 1 );
Q_strncpyz( newInfo.charName, v, ((int32_t)len - (int32_t)strlen(model)) + 1 );
}
//Com_Printf("%s\n", newInfo.charName);
@ -1967,7 +1967,7 @@ void CG_NewClientInfo( int clientNum ) {
}
else {
if ( !skin[1] ) {
Q_strncpyz( newInfo.modelName, model, (int)strlen(model) );
Q_strncpyz( newInfo.modelName, model, (int32_t)strlen(model) );
}
}
@ -1978,7 +1978,7 @@ void CG_NewClientInfo( int clientNum ) {
}
} else {
skin++; //QVMNOTE
Q_strncpyz( newInfo.modelName, model, ((int)len - (int)strlen(skin)) );
Q_strncpyz( newInfo.modelName, model, ((int32_t)len - (int32_t)strlen(skin)) );
Q_strncpyz( newInfo.skinName, skin, sizeof( newInfo.skinName ) );
}
@ -2063,7 +2063,7 @@ so deferred players can be loaded
======================
*/
void CG_LoadDeferredPlayers( void ) {
int i;
int32_t i;
clientInfo_t *ci;
// scan for a deferred player to load
@ -2091,7 +2091,7 @@ be set up so it may be displayed
independantly of its spawner player.
======================
*/
void CG_NewDecoyInfo( int decoyNum ) {
void CG_NewDecoyInfo( int32_t decoyNum ) {
clientInfo_t *ci;
char *userinfo;
char *v;
@ -2131,13 +2131,13 @@ void CG_NewDecoyInfo( int decoyNum ) {
//First thing's first. We need to isolate these into three strings: model, char, skin
{
int len;
int32_t len;
//step 1, take the first bit of the string and put it in the charName var.
if ( ( temp = strchr( v, '/') ) == NULL ) { //if there's no slash
Q_strncpyz( ci->charName, v, sizeof( ci->charName ) ); //just set it
} else { //otherwise, isolate the first bit, and copy that
len = strlen( v );
Q_strncpyz( ci->charName, v, ((int)len - (int)strlen(temp)) + 1 );
Q_strncpyz( ci->charName, v, ((int32_t)len - (int32_t)strlen(temp)) + 1 );
}
//Com_Printf("%s\n", newInfo.charName);
@ -2166,7 +2166,7 @@ void CG_NewDecoyInfo( int decoyNum ) {
}
else {
if ( !temp2[1] ) {
Q_strncpyz( ci->modelName, temp, (int)strlen(temp) );
Q_strncpyz( ci->modelName, temp, (int32_t)strlen(temp) );
}
}
@ -2177,7 +2177,7 @@ void CG_NewDecoyInfo( int decoyNum ) {
}
} else {
temp2++;
Q_strncpyz( ci->modelName, temp, ((int)len - (int)strlen(temp2)) );
Q_strncpyz( ci->modelName, temp, ((int32_t)len - (int32_t)strlen(temp2)) );
Q_strncpyz( ci->skinName, temp2, sizeof( ci->skinName ) );
}
}
@ -2198,7 +2198,7 @@ void CG_NewDecoyInfo( int decoyNum ) {
//Okay... if another player actively has the skin we want, let's pilfer that rather than load it like a schmuck rofl.
{
clientInfo_t *match;
int i;
int32_t i;
for ( i = 0; i < cgs.maxclients; i++ ) {
match = &cgs.clientinfo[i];
@ -2253,7 +2253,7 @@ CG_SetLerpFrameAnimation
may include ANIM_TOGGLEBIT
===============
*/
static void CG_SetLerpFrameAnimation( clientInfo_t *ci, lerpFrame_t *lf, int newAnimation ) {
static void CG_SetLerpFrameAnimation( clientInfo_t *ci, lerpFrame_t *lf, int32_t newAnimation ) {
animation_t *anim;
lf->animationNumber = newAnimation;
@ -2285,7 +2285,7 @@ Sets cg.snap, cg.oldFrame, and cg.backlerp
cg.time should be between oldFrameTime and frameTime after exit
===============
*/
static qboolean CG_RunLerpFrame( clientInfo_t *ci, lerpFrame_t *lf, int newAnimation, float speedScale ) {
static qboolean CG_RunLerpFrame( clientInfo_t *ci, lerpFrame_t *lf, int32_t newAnimation, float speedScale ) {
animation_t *anim;
qboolean newFrame = qfalse;
@ -2331,7 +2331,7 @@ static qboolean CG_RunLerpFrame( clientInfo_t *ci, lerpFrame_t *lf, int newAnima
} else {
lf->frameTime = lf->oldFrameTime + frameLerp;//anim->frameLerp;
}
int f = ( lf->frameTime - lf->animationTime ) / frameLerp;//anim->frameLerp;
int32_t f = ( lf->frameTime - lf->animationTime ) / frameLerp;//anim->frameLerp;
//f *= speedScale; // adjust for haste, etc
if ( f >= anim->numFrames ) {
f -= anim->numFrames;
@ -2379,7 +2379,7 @@ CG_ClearLerpFrame
===============
*/
//This function has been rpg-x'ed®! (by RedTechie)
void CG_ClearLerpFrame( clientInfo_t *ci, lerpFrame_t *lf, int animationNumber ) { //RPG-X: RedTechie - Changed type from static void to void
void CG_ClearLerpFrame( clientInfo_t *ci, lerpFrame_t *lf, int32_t animationNumber ) { //RPG-X: RedTechie - Changed type from static void to void
if(!lf) return;
@ -2408,14 +2408,14 @@ void CG_ClearLerpFrame( clientInfo_t *ci, lerpFrame_t *lf, int animationNumber )
CG_PlayerAnimation
===============
*/
extern qboolean PM_PlayerWalking( int anim );
extern qboolean PM_PlayerRunning( int anim );
extern qboolean PM_PlayerCrouchWalking( int anim );
extern qboolean PM_PlayerWalking( int32_t anim );
extern qboolean PM_PlayerRunning( int32_t anim );
extern qboolean PM_PlayerCrouchWalking( int32_t anim );
static void CG_PlayerAnimation( centity_t *cent, int *legsOld, int *legs, float *legsBackLerp,
int *torsoOld, int *torso, float *torsoBackLerp ) {
static void CG_PlayerAnimation( centity_t *cent, int32_t *legsOld, int32_t *legs, float *legsBackLerp,
int32_t *torsoOld, int32_t *torso, float *torsoBackLerp ) {
clientInfo_t *ci;
int clientNum;
int32_t clientNum;
float speedScale=1;
qboolean newLegsFrame = qfalse;
qboolean newTorsoFrame = qfalse;
@ -2487,7 +2487,7 @@ static void CG_PlayerAnimation( centity_t *cent, int *legsOld, int *legs, float
//qboolean metal = qfalse; //Uberhack meant specifically for metal clank surfaces
vec3_t mins = { -16, -16, 0 };
vec3_t maxs = { 16, 16, 0 };
int surfType;
int32_t surfType;
//TiM: Lower based sounds are always to do with things like shoes clopping n' stuff.
//This portion of code makes sure the player is on a solid surface in order to play this sound
@ -2651,7 +2651,7 @@ CG_AddPainTwitch
=================
*/
static void CG_AddPainTwitch( centity_t *cent, vec3_t torsoAngles ) {
int t;
int32_t t;
float f;
t = cg.time - cent->pe.painTime;
@ -2690,16 +2690,16 @@ Handles seperate torso motion
#define YAW_DELTA 100 //max yaw a head can turn around without looking like an exorcist spoof ;P
#define PITCH_DELTA 35 //max pitch a head can tilt before looking like the player sepearated their neck O_o
extern qboolean PM_PlayerIdling ( int torsoAnim, int legsAnim );
extern qboolean PM_PlayerIdling ( int32_t torsoAnim, int32_t legsAnim );
static void CG_PlayerAngles( centity_t *cent, vec3_t legs[3], vec3_t torso[3], vec3_t head[3] ) {
vec3_t legsAngles, torsoAngles, headAngles;
float dest;
//float delta;
static int movementOffsets[8] = { 0, 22, 45, -22, 0, 22, -45, -22 }; //{ 0, 22, 45, -22, 0, 22, -45, -22 };
static int32_t movementOffsets[8] = { 0, 22, 45, -22, 0, 22, -45, -22 }; //{ 0, 22, 45, -22, 0, 22, -45, -22 };
vec3_t velocity;
float speed;
int dir;
int32_t dir;
qboolean offsetPitch;
clientInfo_t* ci;
@ -2935,7 +2935,7 @@ static void CG_PlayerAngles( centity_t *cent, vec3_t legs[3], vec3_t torso[3], v
if ( cent->currentState.eFlags & EF_TALKING ) {
if ( cg.time > ci->nextTalkAngle || (!ci->talkAngles[PITCH] && !ci->talkAngles[YAW] && !ci->talkAngles[ROLL]) ) {
int i;
int32_t i;
for ( i = 0; i < 3; i++ ) {
ci->talkAngles[i] = flrandom( -4, 4 );
}
@ -3010,7 +3010,7 @@ CG_HasteTrail
/*static void CG_HasteTrail( centity_t *cent ) {
localEntity_t *smoke;
vec3_t origin, pos2;
int anim;
int32_t anim;
if ( cent->trailTime > cg.time ) {
return;
@ -3087,8 +3087,8 @@ CG_TrailItem
frame = (cg.time / 100.0);
ent.renderfx|=RF_WRAP_FRAMES;
ent.oldframe = (int)frame;
ent.frame = (int)frame+1;
ent.oldframe = (int32_t)frame;
ent.frame = (int32_t)frame+1;
ent.backlerp = (float)(ent.frame) - frame;
// if the player is looking at himself in 3rd person, don't show the flag solid, 'cause he can't see!!!
@ -3119,7 +3119,7 @@ CG_PlayerPowerups
===============
*/
static void CG_PlayerPowerups( centity_t *cent ) {
int powerups;
int32_t powerups;
powerups = cent->currentState.powerups;
if ( !powerups ) {
@ -3188,9 +3188,9 @@ Float a sprite over the player's head
===============
*/
static void CG_PlayerFloatSprite( centity_t *cent, qhandle_t shader ) {
int rf;
int32_t rf;
refEntity_t ent;
int team;
int32_t team;
if ( cent->currentState.number == cg.snap->ps.clientNum && !cg.renderingThirdPerson ) {
rf = RF_THIRD_PERSON; // only show in mirrors
@ -3239,7 +3239,7 @@ Float sprites over the player's head
===============
*/
static void CG_PlayerSprites( centity_t *cent ) {
// int team;
// int32_t team;
if ( cent->currentState.eFlags & EF_CONNECTION )
{
@ -3262,14 +3262,14 @@ model itself
*/
#define PLAYER_BEAM_FADETIME_DIV 1.0/(float)PLAYER_BEAM_FADETIME
void CG_CalcBeamAlpha( int powerups, beamData_t *beamData ) {
void CG_CalcBeamAlpha( int32_t powerups, beamData_t *beamData ) {
float beamAlpha = 1.0;
if ( ( powerups & ( 1 << PW_BEAM_OUT ) ) || ( powerups & ( 1 << PW_QUAD ) ) ) {
//TiM - SP transporter FX, also base alpha off of phase in transport cycle
//bTime = cg.time - beamData->beamTimeParam;
int bTime = cg.time - beamData->beamTimeParam;
int32_t bTime = cg.time - beamData->beamTimeParam;
if (bTime > PLAYER_BEAM_FADE ) {
if ( bTime < ( PLAYER_BEAM_FADE + PLAYER_BEAM_FADETIME) ) {
@ -3385,7 +3385,7 @@ Draw a mark at the water surface
static void CG_PlayerSplash( centity_t *cent ) {
vec3_t start, end;
trace_t trace;
int contents;
int32_t contents;
polyVert_t verts[4];
float beamRatio = 1.0;
@ -3483,7 +3483,7 @@ static void CG_PlayerSplash( centity_t *cent ) {
trap_R_AddPolyToScene( cgs.media.wakeMarkShader, 4, verts );
}
static int timestamp;
static int32_t timestamp;
/*
===============
@ -3493,7 +3493,7 @@ Adds a piece with modifications or duplications for powerups
Also called by CG_Missile for quad rockets, but nobody can tell...
===============
*/
void CG_AddRefEntityWithPowerups( refEntity_t *ent, int powerups, int eFlags, beamData_t *beamData, int cloakTime, int decloakTime, qboolean borg )
void CG_AddRefEntityWithPowerups( refEntity_t *ent, int32_t powerups, int32_t eFlags, beamData_t *beamData, int32_t cloakTime, int32_t decloakTime, qboolean borg )
{
//TiM : No more flickering. Flickering Starfleet officers is bad
@ -3553,7 +3553,7 @@ void CG_AddRefEntityWithPowerups( refEntity_t *ent, int powerups, int eFlags, be
{ // Dead. timestamp holds the time of death.
float alpha;
int a;
int32_t a;
// First draw the entity itself.
//alpha = (timestamp - cg.time)/2500.0;
@ -3613,7 +3613,7 @@ void CG_AddRefEntityWithPowerups( refEntity_t *ent, int powerups, int eFlags, be
}
else if (powerups & (1<<PW_DISINTEGRATE))
{
int dtime;
int32_t dtime;
dtime = cg.time-timeParam;
if (dtime < 1000)
@ -3635,14 +3635,14 @@ void CG_AddRefEntityWithPowerups( refEntity_t *ent, int powerups, int eFlags, be
}
else if (powerups & (1<<PW_EXPLODE))
{
int dtime;
int32_t dtime;
dtime = cg.time-timeParam;
if (dtime < 300)
{
ent->renderfx |= RF_FORCE_ENT_ALPHA;
ent->shaderRGBA[3] = (int)(255.0 - (dtime / 300.0) * 254.0);
ent->shaderRGBA[3] = (int32_t)(255.0 - (dtime / 300.0) * 254.0);
trap_R_AddRefEntityToScene( ent );
ent->renderfx &= ~RF_FORCE_ENT_ALPHA;
ent->shaderRGBA[3] = 255;
@ -3670,7 +3670,7 @@ void CG_AddRefEntityWithPowerups( refEntity_t *ent, int powerups, int eFlags, be
//SP Transporter Effect
else if ( powerups & ( 1 << PW_BEAM_OUT ) || powerups & ( 1 << PW_QUAD ) )
{
int btime;
int32_t btime;
btime = cg.time - beamData->beamTimeParam;
if ( btime <= PLAYER_BEAM_FADE ) {
@ -3693,7 +3693,7 @@ void CG_AddRefEntityWithPowerups( refEntity_t *ent, int powerups, int eFlags, be
if (btime > PLAYER_BEAM_FADE && btime < (PLAYER_BEAM_FADE + PLAYER_BEAM_FADETIME) )
{
ent->renderfx |= RF_FORCE_ENT_ALPHA;
ent->shaderRGBA[3] = (int)(255 * beamData->beamAlpha);
ent->shaderRGBA[3] = (int32_t)(255 * beamData->beamAlpha);
}
if ( ent->shaderRGBA[3] > 0 ) {
@ -3759,7 +3759,7 @@ void CG_AddRefEntityWithPowerups( refEntity_t *ent, int powerups, int eFlags, be
if (powerups & (1<<PW_ARCWELD_DISINT))
{
int dtime;
int32_t dtime;
dtime = cg.time-timeParam;
@ -3770,8 +3770,8 @@ void CG_AddRefEntityWithPowerups( refEntity_t *ent, int powerups, int eFlags, be
// ent->shaderTime = timeParam / 1000.0f;
ent->shaderRGBA[0] =
ent->shaderRGBA[1] =
//ent->shaderRGBA[2] = (int)(1.0 + ((4000.0 - dtime) / 4000.0f * 254.0f ));
ent->shaderRGBA[2] = (int)(1.0 + ((4000.0 - dtime) * 0.00025f + 256.0f));
//ent->shaderRGBA[2] = (int32_t)(1.0 + ((4000.0 - dtime) / 4000.0f * 254.0f ));
ent->shaderRGBA[2] = (int32_t)(1.0 + ((4000.0 - dtime) * 0.00025f + 256.0f));
ent->shaderRGBA[3] = 255;
trap_R_AddRefEntityToScene( ent );
@ -3789,10 +3789,10 @@ void CG_AddRefEntityWithPowerups( refEntity_t *ent, int powerups, int eFlags, be
#define MIN_SHIELD_TIME 1750.0
void CG_PlayerShieldHit(int entitynum, vec3_t dir, int amount)
void CG_PlayerShieldHit(int32_t entitynum, vec3_t dir, int32_t amount)
{
centity_t *cent;
int time;
int32_t time;
if (entitynum<0 || entitynum >= MAX_CLIENTS)
{
@ -3822,7 +3822,7 @@ void CG_PlayerShieldHit(int entitynum, vec3_t dir, int amount)
/*void CG_DrawPlayerShield(centity_t *cent, vec3_t origin)
{
refEntity_t ent;
int alpha;
int32_t alpha;
float scale;
// Don't draw the shield when the player is dead.
@ -3924,7 +3924,7 @@ void CG_PlayerShieldHit(int entitynum, vec3_t dir, int amount)
//------------------------------------------------------------------------------
//Equip mode features
void CG_AttachHolsters ( centity_t *cent, refEntity_t *parent, int weapon )
void CG_AttachHolsters ( centity_t *cent, refEntity_t *parent, int32_t weapon )
{
refEntity_t holster;
refEntity_t holsterInner;
@ -3960,7 +3960,7 @@ void CG_AttachHolsters ( centity_t *cent, refEntity_t *parent, int weapon )
}
void CG_AttachTools ( centity_t *cent, refEntity_t *parent, int weaponNum )
void CG_AttachTools ( centity_t *cent, refEntity_t *parent, int32_t weaponNum )
{
refEntity_t tool;
weaponInfo_t *weaponInfo;
@ -4091,13 +4091,13 @@ void CG_Player( centity_t *cent ) {
refEntity_t legs;
refEntity_t torso;
refEntity_t head;
int clientNum;
int renderfx;
int32_t clientNum;
int32_t renderfx;
qboolean shadow, borg = qfalse;
float shadowPlane = 0;
//alpha value
float alpha = cg_thirdPersonAlpha.value;
int i = 0;
int32_t i = 0;
rankModelData_t* rankModelData = NULL;
qboolean rankDataValidated = qfalse;
qboolean isDecoy = qfalse;
@ -4366,7 +4366,7 @@ void CG_Player( centity_t *cent ) {
cg.fpsBody.sizeOffset = 0.9f;
//normalize, but don't take Z-axis (vertical) into account
//cg.fpsBody.offset = 0 + (int)sqrt( (temp[0]*temp[0]) + (temp[1]*temp[1]) );
//cg.fpsBody.offset = 0 + (int32_t)sqrt( (temp[0]*temp[0]) + (temp[1]*temp[1]) );
cg.fpsBody.offset = 2;
cg.fpsBody.anim = cent->currentState.legsAnim ; //+15 for good measure :P
@ -5118,7 +5118,7 @@ void CG_ResetPlayerEntity( centity_t *cent ) {
}
if ( cg_debugPosition.integer ) {
CG_Printf("%i ResetPlayerEntity yaw=%i\n", cent->currentState.number, (int)cent->pe.torso.yawAngle );
CG_Printf("%i ResetPlayerEntity yaw=%i\n", cent->currentState.number, (int32_t)cent->pe.torso.yawAngle );
}
}

View File

@ -15,9 +15,9 @@ If the ammo has gone low enough to generate the warning, play a sound
==============
*/
void CG_CheckAmmo( void ) {
int i;
int total;
int weapons;
int32_t i;
int32_t total;
int32_t weapons;
if ( cg.lowAmmoWarning > 2 )
{//a timed message, draws for a specific amount of time
@ -76,9 +76,9 @@ void CG_CheckAmmo( void ) {
CG_DamageFeedback
==============
*/
void CG_DamageFeedback( int yawByte, int pitchByte, int damage, int shielddamage ) {
void CG_DamageFeedback( int32_t yawByte, int32_t pitchByte, int32_t damage, int32_t shielddamage ) {
float kick;
int health;
int32_t health;
float scale;
vec3_t dir;
vec3_t angles;
@ -208,8 +208,8 @@ CG_CheckPlayerstateEvents
==============
*/
void CG_CheckPlayerstateEvents( playerState_t *ps, playerState_t *ops ) {
int i;
int event;
int32_t i;
int32_t event;
centity_t *cent;
if ( ps->externalEvent && ps->externalEvent != ops->externalEvent ) {
@ -247,13 +247,13 @@ CG_CheckLocalSounds
*/
void CG_CheckLocalSounds( playerState_t *ps, playerState_t *ops )
{
// int highScore;
// int32_t highScore;
// The most important thing to know is if you are doing damage.
//RPG-X - TiM
/*if ( ps->persistant[PERS_HITS] > ops->persistant[PERS_HITS] )
{
int diffhit, diffshields;
int32_t diffhit, diffshields;
diffhit = ps->persistant[PERS_HITS] - ops->persistant[PERS_HITS];
diffshields = ps->persistant[PERS_SHIELDS] - ops->persistant[PERS_SHIELDS];
@ -295,8 +295,8 @@ void CG_CheckLocalSounds( playerState_t *ps, playerState_t *ops )
void CG_CheckDamageDealt(playerState_t *ps, playerState_t *ops)
{
static int damagetime;
static int damageamount;
static int32_t damagetime;
static int32_t damageamount;
if (cg_reportDamage.integer)
{

View File

@ -9,9 +9,9 @@
static pmove_t cg_pmove;
static int cg_numSolidEntities;
static int32_t cg_numSolidEntities;
static centity_t *cg_solidEntities[MAX_ENTITIES_IN_SNAPSHOT];
static int cg_numTriggerEntities;
static int32_t cg_numTriggerEntities;
static centity_t *cg_triggerEntities[MAX_ENTITIES_IN_SNAPSHOT];
/*
@ -24,7 +24,7 @@ efficient collision detection
====================
*/
void CG_BuildSolidList( void ) {
int i;
int32_t i;
centity_t *cent;
snapshot_t *snap;
entityState_t *ent;
@ -65,8 +65,8 @@ CG_ClipMoveToEntities
#define SHIELD_HALFTHICKNESS 4 // should correspond with the #define in g_active.c
static void CG_ClipMoveToEntities ( const vec3_t start, const vec3_t mins, const vec3_t maxs, const vec3_t end,
int skipNumber, int mask, trace_t *tr ) {
int i, x, zd, zu;
int32_t skipNumber, int32_t mask, trace_t *tr ) {
int32_t i, x, zd, zu;
trace_t trace;
entityState_t *ent;
clipHandle_t cmodel;
@ -185,7 +185,7 @@ CG_Trace
================
*/
void CG_Trace( trace_t *result, const vec3_t start, const vec3_t mins, const vec3_t maxs, const vec3_t end,
int skipNumber, int mask ) {
int32_t skipNumber, int32_t mask ) {
trace_t t;
trap_CM_BoxTrace ( &t, start, end, mins, maxs, 0, mask);
@ -201,12 +201,12 @@ void CG_Trace( trace_t *result, const vec3_t start, const vec3_t mins, const vec
CG_PointContents
================
*/
int CG_PointContents( const vec3_t point, int passEntityNum ) {
int i;
int32_t CG_PointContents( const vec3_t point, int32_t passEntityNum ) {
int32_t i;
entityState_t *ent;
centity_t *cent;
clipHandle_t cmodel;
int contents;
int32_t contents;
contents = trap_CM_PointContents (point, 0);
@ -245,7 +245,7 @@ cg.snap->player_state and cg.nextFrame->player_state
*/
static void CG_InterpolatePlayerState( qboolean grabAngles ) {
float f;
int i;
int32_t i;
playerState_t *out;
snapshot_t *prev, *next;
@ -258,7 +258,7 @@ static void CG_InterpolatePlayerState( qboolean grabAngles ) {
// if we are still allowing local input, short circuit the view angles
if ( grabAngles ) {
usercmd_t cmd;
int cmdNum;
int32_t cmdNum;
cmdNum = trap_GetCurrentCmdNumber();
trap_GetUserCmd( cmdNum, &cmd );
@ -381,7 +381,7 @@ Predict push triggers and items
=========================
*/
static void CG_TouchTriggerPrediction( void ) {
int i;
int32_t i;
trace_t trace;
entityState_t *ent;
clipHandle_t cmodel;
@ -481,7 +481,7 @@ to ease the jerk.
=================
*/
void CG_PredictPlayerState( void ) {
int cmdNum, current;
int32_t cmdNum, current;
playerState_t oldPlayerState;
qboolean moved;
usercmd_t oldestCmd;
@ -626,7 +626,7 @@ void CG_PredictPlayerState( void ) {
CG_Printf("Prediction miss: %f\n", len);
}
if ( cg_errorDecay.integer ) {
int t;
int32_t t;
float f;
t = cg.time - cg.predictedErrorTime;

View File

@ -21,20 +21,20 @@
// but they may not be sent if a client's rate level is exceeded, or
// they may be dropped by the network.
typedef struct {
int snapFlags; // SNAPFLAG_RATE_DELAYED, etc
int ping;
int32_t snapFlags; // SNAPFLAG_RATE_DELAYED, etc
int32_t ping;
int serverTime; // server time the message is valid for (in msec)
int32_t serverTime; // server time the message is valid for (in msec)
byte areamask[MAX_MAP_AREA_BYTES]; // portalarea visibility bits
playerState_t ps; // complete information about the current player at this time
int numEntities; // all of the entities that need to be presented
int32_t numEntities; // all of the entities that need to be presented
entityState_t entities[MAX_ENTITIES_IN_SNAPSHOT]; // at the time of this snapshot
int numServerCommands; // text based server commands to execute when this
int serverCommandSequence; // snapshot becomes current
int32_t numServerCommands; // text based server commands to execute when this
int32_t serverCommandSequence; // snapshot becomes current
} snapshot_t;
@ -139,7 +139,7 @@ functions exported to the main executable
typedef enum {
CG_INIT,
// void CG_Init( int serverMessageNum, int serverCommandSequence )
// void CG_Init( int32_t serverMessageNum, int32_t serverCommandSequence )
// called when the level loads or when the renderer is restarted
// all media should be registered at this time
// cgame will display loading status by calling SCR_Update, which
@ -159,15 +159,15 @@ typedef enum {
// command is not known to the game
CG_DRAW_ACTIVE_FRAME,
// void (*CG_DrawActiveFrame)( int serverTime, stereoFrame_t stereoView, qboolean demoPlayback );
// void (*CG_DrawActiveFrame)( int32_t serverTime, stereoFrame_t stereoView, qboolean demoPlayback );
// Generates and draws a game scene and status information at the given time.
// If demoPlayback is set, local movement prediction will not be enabled
CG_CROSSHAIR_PLAYER,
// int (*CG_CrosshairPlayer)( void );
// int32_t (*CG_CrosshairPlayer)( void );
CG_LAST_ATTACKER
// int (*CG_LastAttacker)( void );
// int32_t (*CG_LastAttacker)( void );
} cgameExport_t;
//----------------------------------------------

View File

@ -74,10 +74,10 @@
static qboolean localClient; // true if local client has been displayed
static void CG_ClipString(char *buffer,char *name,int pixelCnt,int font)
static void CG_ClipString(char *buffer,char *name,int32_t pixelCnt,int32_t font)
{
char str[2];
int length;
int32_t length;
str[1] = '\0';
@ -131,9 +131,9 @@ static void CG_ClipString(char *buffer,char *name,int pixelCnt,int font)
*/
//Modified by TiM for the new rank system
static void CG_DrawRank(int x, int y, pclass_t pClass, int score) {
int classno;
int score_log;
static void CG_DrawRank(int32_t x, int32_t y, pclass_t pClass, int32_t score) {
int32_t classno;
int32_t score_log;
rankMenuData_t* ScoreMenuData;
//Q_log2
@ -243,7 +243,7 @@ static qboolean AW_Draw( void );
CG_DrawClientScoreboard_Big
=======================
*/
static void CG_DrawClientScore_Big( int y, score_t *score, float *color, float fade, qboolean largeFormat ) {
static void CG_DrawClientScore_Big( int32_t y, score_t *score, float *color, float fade, qboolean largeFormat ) {
char string[1024];
char string2[1024];
//RPG-X: Not Needed without a head
@ -291,7 +291,7 @@ static void CG_DrawClientScore_Big( int y, score_t *score, float *color, float f
UI_DrawProportionalString( SB_NAME_X_BIG, y , string, UI_TINYFONT, colorTable[CT_WHITE]);
}
else {
int clipLength;
int32_t clipLength;
//draw rank image
CG_DrawRank( SB_RANK_X_BIG, y-2,ci->pClass, score->score);
@ -338,7 +338,7 @@ static void CG_DrawClientScore_Big( int y, score_t *score, float *color, float f
//player client Num
//Com_sprintf(string,sizeof(string), "%i", intClamp); //RPG-X: J2J Switched Scoore to Client No.
int intClamp = Com_Clamp( 0, 128, cg_entities[score->client].currentState.clientNum );
int32_t intClamp = Com_Clamp( 0, 128, cg_entities[score->client].currentState.clientNum );
UI_DrawProportionalString( SB_SCORE_X_BIG, y , va("%i", intClamp), UI_TINYFONT | UI_LEFT, colorTable[CT_WHITE]);
//player time
@ -364,12 +364,12 @@ static void CG_DrawClientScore_Big( int y, score_t *score, float *color, float f
CG_DrawClientScoreboard
=======================
*/
static void CG_DrawClientScore( int y, score_t *score, float *color, float fade, qboolean largeFormat ) {
static void CG_DrawClientScore( int32_t y, score_t *score, float *color, float fade, qboolean largeFormat ) {
//char string[1024];
//char string2[1024];
//vec3_t headAngles;
clientInfo_t *ci;
//int picSize;
//int32_t picSize;
//char /**worstEnemy,*/*faveWeapon=0;
//float hcolor[4];
//gitem_t * item;
@ -406,11 +406,11 @@ static void CG_DrawClientScore( int y, score_t *score, float *color, float fade,
CG_TeamScoreboard
=================
*/
static int CG_TeamScoreboard( int y, team_t team, float fade, int maxClients, int lineHeight ) {
int i;
static int32_t CG_TeamScoreboard( int32_t y, team_t team, float fade, int32_t maxClients, int32_t lineHeight ) {
int32_t i;
score_t *score;
float color[4];
int count;
int32_t count;
clientInfo_t *ci;
color[0] = color[1] = color[2] = 1.0;
@ -481,18 +481,18 @@ Draw the normal in-game scoreboard
*/
qboolean CG_DrawScoreboard( void )
{
int y, i, n1 = 0, n2 = 0; // n3 = 0;
int32_t y, i, n1 = 0, n2 = 0; // n3 = 0;
float fade;
float *fadeColor;
char *s;
//RPG-X: RedTechie dont need buf with all the print team code commented out
//char buf[64];
int maxClients;
int lineHeight;
int32_t maxClients;
int32_t lineHeight;
float hcolor[4];
int inIntermission;
int32_t inIntermission;
char gamename[1024];
//int gOffset = 20;
//int32_t gOffset = 20;
inIntermission = (
(cg.snap->ps.pm_type==PM_INTERMISSION)
@ -694,10 +694,10 @@ Draw the oversize scoreboard for tournements
void CG_DrawTourneyScoreboard( void ) {
const char *s;
vec4_t color;
int min, tens, ones;
int32_t min, tens, ones;
clientInfo_t *ci;
int y;
int i,w;
int32_t y;
int32_t i,w;
// request more scores regularly
if ( cg.scoresRequestTime + 2000 < cg.time ) {
@ -800,38 +800,38 @@ FROM DrawScoreboard()
typedef struct {
int phase;
int ignoreKeysTime;
int starttime;
int scoreboardtime;
int serverId;
int32_t phase;
int32_t ignoreKeysTime;
int32_t starttime;
int32_t scoreboardtime;
int32_t serverId;
int playerGameRank;
int32_t playerGameRank;
qboolean playersTeamWon;
int playerTied;
int32_t playerTied;
char placeNames[3][64];
char winTeamText[64];
char losTeamText[64];
char winTeamMVPText[64];
char nameOfMVP[64];
int scoreOfMVP;
int totalCaptures;
int totalPoints;
int losCaptures;
int losPoints;
int secondPlaceTied;
int32_t scoreOfMVP;
int32_t totalCaptures;
int32_t totalPoints;
int32_t losCaptures;
int32_t losPoints;
int32_t secondPlaceTied;
int level;
int numClients;
int won;
int numAwards;
int awardsEarned[9];
int awardsLevels[9];
int32_t level;
int32_t numClients;
int32_t won;
int32_t numAwards;
int32_t awardsEarned[9];
int32_t awardsLevels[9];
qboolean playedSound[9];
int lastTier;
int32_t lastTier;
sfxHandle_t winnerSound;
int winnerDelay;
int32_t winnerDelay;
sfxHandle_t youPlacedSound;
sfxHandle_t commendationsSound;
@ -866,7 +866,7 @@ char *cg_medalNames[AWARD_MAX] =
};
*/
int cg_medalNames[AWARD_MAX] =
int32_t cg_medalNames[AWARD_MAX] =
{
IGT_EFFICIENCY, // AWARD_EFFICIENCY, Accuracy
IGT_SHARPSHOOTER, // AWARD_SHARPSHOOTER, Most compression rifle frags
@ -950,7 +950,7 @@ char *cg_medalStreakNames[AWARD_STREAK_MAX] = {
};
*/
int cg_medalStreakNames[AWARD_STREAK_MAX] = {
int32_t cg_medalStreakNames[AWARD_STREAK_MAX] = {
IGT_NONE, // AWARD_NONE
IGT_ACE, // AWARD_STREAK_ACE,
IGT_EXPERT, // AWARD_STREAK_EXPERT,
@ -958,7 +958,7 @@ int cg_medalStreakNames[AWARD_STREAK_MAX] = {
IGT_CHAMPION // AWARD_STREAK_CHAMPION,
};
int cg_medalTeamNames[TEAM_MAX] = {
int32_t cg_medalTeamNames[TEAM_MAX] = {
IGT_NONE, // AWARD_NONE
IGT_MVP, // TEAM_MVP,
IGT_DEFENDER, // TEAM_DEFENDER,
@ -970,9 +970,9 @@ int cg_medalTeamNames[TEAM_MAX] = {
// spaced by 70 pixels apart
//static int medalLocations[6] = {570, 500, 430, 360, 290};
//static int32_t medalLocations[6] = {570, 500, 430, 360, 290};
/*static void AW_DrawMedal( int medal, int amount, int x, int y )
/*static void AW_DrawMedal( int32_t medal, int32_t amount, int32_t x, int32_t y )
{
char buf[20];
qhandle_t hShader;
@ -1010,20 +1010,20 @@ int cg_medalTeamNames[TEAM_MAX] = {
}*/
//========================
// DrawTheMedals(int max)
// DrawTheMedals(int32_t max)
//
// This function cycles from 0 to max and calls some functions to Draw the Picture and
// the text below for efficency.
//
//========================
//RPG-X: RedTechie - No awards
/*static int presentedTeamAward[TEAM_MAX];
static void AW_DrawTheMedals( int max ) {
int n, i;
int medal;
int amount;
int x, y;
int extraAwardOffset = 0;
/*static int32_t presentedTeamAward[TEAM_MAX];
static void AW_DrawTheMedals( int32_t max ) {
int32_t n, i;
int32_t medal;
int32_t amount;
int32_t x, y;
int32_t extraAwardOffset = 0;
for( n = 0; n < max; n++ ) {
x = medalLocations[n] - extraAwardOffset;
@ -1054,8 +1054,8 @@ static void AW_DrawTheMedals( int max ) {
}
}
static int awardNextDebounceTime = 0;
static void AW_PresentMedal( int medal, int amount, int timer, int awardNum )
static int32_t awardNextDebounceTime = 0;
static void AW_PresentMedal( int32_t medal, int32_t amount, int32_t timer, int32_t awardNum )
{
vec4_t color;
@ -1104,22 +1104,22 @@ static void AW_PresentMedal( int medal, int amount, int timer, int awardNum )
}
*/
//========================
// DrawAwardsPresentation(int timer)
// DrawAwardsPresentation(int32_t timer)
//
// This function incriments the timer and then calles the above function to actually draw the
// award icons. This function also triggers the sounds for winning the medals.
//
//========================
//RPG-X: RedTechie - No awards
/*static int extraAwardTime = 0;
/*static int32_t extraAwardTime = 0;
static qboolean allTeamAwardsAnnounced = qfalse;
static int awardNum = 0;
static int nextTeamAward = 0;
static void AW_DrawAwardsPresentation( int timer ) {
int medal;
int amount;
int i=0;
int teamAward = 0;
static int32_t awardNum = 0;
static int32_t nextTeamAward = 0;
static void AW_DrawAwardsPresentation( int32_t timer ) {
int32_t medal;
int32_t amount;
int32_t i=0;
int32_t teamAward = 0;
if ( !postgameMenuInfo.numAwards )
{
@ -1199,7 +1199,7 @@ AW_Draw
*/
static qboolean AW_Draw( void )
{
int timer;
int32_t timer;
vec4_t white, yellow; // new colors
// RED GREEN BLUE ALPHA
@ -1382,7 +1382,7 @@ AW_SPPostgameMenu_Cache
=================
void AW_SPPostgameMenu_Cache( void ) {
int n;
int32_t n;
qboolean buildscript;
buildscript = trap_Cvar_VariableValue("com_buildscript");
@ -1410,9 +1410,9 @@ AW_SPPostgameMenu_Cache
we are in a team game.
=================
*/
static void AW_Prepname( int index)
static void AW_Prepname( int32_t index)
{
// int len;
// int32_t len;
char name[64]; // The winning team's name.. Red/Blue/ Klingon...
char MVPname[64];
char otherName[64];
@ -1469,12 +1469,12 @@ AW_SPPostgameMenu_f
*/
void AW_SPPostgameMenu_f( void ) {
int playerGameRank;
int playerClientNum;
int playerTeam;
int n, clNum[3] = {0,0,0};
int awardFlags;
int numNames;
int32_t playerGameRank;
int32_t playerClientNum;
int32_t playerTeam;
int32_t n, clNum[3] = {0,0,0};
int32_t awardFlags;
int32_t numNames;
char temp_string[200];
memset( &postgameMenuInfo, 0, sizeof(postgameMenuInfo) );

View File

@ -4,7 +4,7 @@
// this is the list of currently drawing fx and their start times and end times
screenFX_t theScreenFX;
int CG_GetScreenEffectEndTime(int event)
int32_t CG_GetScreenEffectEndTime(int32_t event)
{
switch (event)
{
@ -20,7 +20,7 @@ int CG_GetScreenEffectEndTime(int event)
}
// maybe play a sound or something?
void CG_BeginScreenEffect(int event)
void CG_BeginScreenEffect(int32_t event)
{
switch (event)
{
@ -34,9 +34,9 @@ void CG_BeginScreenEffect(int event)
// when adding a new effect, we'll either take an empty slot in theScreenFX or
//overwrite the oldest effect
void CG_AddFullScreenEffect(int screenfx, int clientNum)
void CG_AddFullScreenEffect(int32_t screenfx, int32_t clientNum)
{
int i = 0, oldestTime = cg.time, oldestEffect = 0;
int32_t i = 0, oldestTime = cg.time, oldestEffect = 0;
if (clientNum != cg.predictedPlayerState.clientNum)
{ // only add screen effects for our client
@ -157,11 +157,11 @@ static void CG_DrawDirectionalScreenQuad(float alpha, qhandle_t screenshader)
ent.data.sprite.radius = 4;
ent.customShader = screenshader;
* (unsigned int *) ent.shaderRGBA = 0xffffffff;
* (unsigned int *) ent.data.sprite.vertRGBA[0] = 0xffffffff;
* (unsigned int *) ent.data.sprite.vertRGBA[1] = 0xffffffff;
* (unsigned int *) ent.data.sprite.vertRGBA[2] = 0xffffffff;
* (unsigned int *) ent.data.sprite.vertRGBA[3] = 0xffffffff;
* (unsigned int32_t *) ent.shaderRGBA = 0xffffffff;
* (unsigned int32_t *) ent.data.sprite.vertRGBA[0] = 0xffffffff;
* (unsigned int32_t *) ent.data.sprite.vertRGBA[1] = 0xffffffff;
* (unsigned int32_t *) ent.data.sprite.vertRGBA[2] = 0xffffffff;
* (unsigned int32_t *) ent.data.sprite.vertRGBA[3] = 0xffffffff;
// left
val = alpha*(0.5 + 0.5*(cg.damageX - fabs(cg.damageY)));
@ -341,10 +341,10 @@ static void CG_DrawScreenBlob(float redalpha, float greenalpha)
void CG_DrawFullScreenEffect(int screenfx, int start, int end)
void CG_DrawFullScreenEffect(int32_t screenfx, int32_t start, int32_t end)
{
float alpha, alpha2 = 0.0; //TiM - second alpha
int end2, start2;
int32_t end2, start2;
alpha = (float)(end-cg.time)/(float)(end-start);
@ -385,7 +385,7 @@ void CG_DrawFullScreenEffect(int screenfx, int start, int end)
void CG_DrawFullScreenFX( void )
{
int i = 0, t;
int32_t i = 0, t;
float alpha, redalpha, greenalpha;
if ( (cg.snap->ps.clientNum != cg.predictedPlayerState.clientNum) || cg.renderingThirdPerson )

View File

@ -15,14 +15,14 @@ enum screenfx_e
typedef struct screenFX_s
{
int events[MAX_SCREENFX];
int cgStartTimes[MAX_SCREENFX];
int cgEndTimes[MAX_SCREENFX];
int32_t events[MAX_SCREENFX];
int32_t cgStartTimes[MAX_SCREENFX];
int32_t cgEndTimes[MAX_SCREENFX];
} screenFX_t;
extern screenFX_t theScreenFX;
void CG_AddFullScreenEffect(int screenfx, int clientNum);
void CG_AddFullScreenEffect(int32_t screenfx, int32_t clientNum);
void CG_DrawFullScreenFX(void);

View File

@ -16,7 +16,7 @@ CG_ParseScores
=================
*/
static void CG_ParseScores( void ) {
int i, powerups, eliminated;
int32_t i, powerups, eliminated;
cg.numScores = atoi( CG_Argv( 1 ) );
if ( cg.numScores > MAX_CLIENTS ) {
@ -59,8 +59,8 @@ CG_ParseTeamInfo
=================
*/
static void CG_ParseTeamInfo( void ) {
int i;
int client;
int32_t i;
int32_t client;
numSortedTeamPlayers = atoi( CG_Argv( 1 ) );
@ -84,9 +84,9 @@ CG_ParseHealthInfo
=================
*/
static void CG_ParseHealthInfo( void ) {
int i;
int client;
int numHealthInfoClients = 0;
int32_t i;
int32_t client;
int32_t numHealthInfoClients = 0;
numHealthInfoClients = atoi( CG_Argv( 1 ) );
@ -141,7 +141,7 @@ CG_ParseWarmup
*/
static void CG_ParseWarmup( void ) {
const char *info;
int warmup;
int32_t warmup;
info = CG_ConfigString( CS_WARMUP );
@ -187,7 +187,7 @@ data.
*/
void CG_ClientShakeCamera ( void ) {
float intensity;
int duration;
int32_t duration;
char *str;
str = (char *)CG_ConfigString( CS_CAMERA_SHAKE );
@ -209,12 +209,12 @@ CG_ParseClassData
/*void CG_ParseClassData( void )
{
char *str;
int i;
int32_t i;
char *val;
char *lineChar;
char *lineCharEnd;
int colorBits;
int classBits;
int32_t colorBits;
int32_t classBits;
str = (char *)CG_ConfigString( CS_CLASS_DATA );
@ -284,7 +284,7 @@ CG_ConfigStringModified
*/
static void CG_ConfigStringModified( void ) {
const char *str;
int num;
int32_t num;
num = atoi( CG_Argv( 1 ) );
@ -352,10 +352,10 @@ CG_AddToTeamChat
=======================
*/
static void CG_AddToTeamChat( const char *str ) {
int len;
int32_t len;
char *p, *ls;
int lastcolor;
int chatHeight;
int32_t lastcolor;
int32_t chatHeight;
if (cg_teamChatHeight.integer < TEAMCHAT_HEIGHT) {
chatHeight = cg_teamChatHeight.integer;
@ -472,11 +472,11 @@ an ID and save it to file
static void CG_EncodeIDFile( void )
{
unsigned int playerID;
uint32_t playerID;
char *IP;
char strSubnet[3];
int intSubnet[4];
int i, j;
int32_t intSubnet[4];
int32_t i, j;
memset(strSubnet, 0, sizeof(strSubnet));
@ -533,7 +533,7 @@ static void CG_EncodeIDFile( void )
{
fileHandle_t f;
//unsigned char buffer[SECURITY_SIZE];
int fileLen;
int32_t fileLen;
rpgxSecurityFile_t sF;
fileLen = trap_FS_FOpenFile( SECURITY_FILE, &f, FS_READ );
@ -587,10 +587,10 @@ static void CG_EncodeIDFile( void )
ConcatArgs
==================
*/
char *ConcatArgs2( int start ) {
int i, c, tlen;
char *ConcatArgs2( int32_t start ) {
int32_t i, c, tlen;
static char line[MAX_STRING_CHARS];
int len;
int32_t len;
char arg[MAX_STRING_CHARS];
len = 0;
@ -780,7 +780,7 @@ static void CG_ServerCommand( void ) {
//TiM: Purge all active effects
if ( !strcmp( cmd, "cg_flushFX" ) ) {
int i;
int32_t i;
for ( i = 0; i < MAX_LOCAL_ENTITIES; i ++ ) {
cg_localEntities[i].endTime = cg.time;
@ -961,7 +961,7 @@ Execute all of the server commands that were received along
with this this snapshot.
====================
*/
void CG_ExecuteNewServerCommands( int latestSequence ) {
void CG_ExecuteNewServerCommands( int32_t latestSequence ) {
while ( cgs.serverCommandSequence < latestSequence ) {
if ( trap_GetServerCommand( ++cgs.serverCommandSequence ) ) {
CG_ServerCommand();

View File

@ -79,7 +79,7 @@ FIXME: Also called by map_restart?
==================
*/
void CG_SetInitialSnapshot( snapshot_t *snap ) {
int i;
int32_t i;
centity_t *cent;
entityState_t *state;
@ -122,7 +122,7 @@ The transition point from snap to nextSnap has passed
static void CG_TransitionSnapshot( void ) {
centity_t *cent;
snapshot_t *oldFrame;
int i;
int32_t i;
if ( !cg.snap ) {
CG_Error( "CG_TransitionSnapshot: NULL cg.snap" );
@ -196,7 +196,7 @@ A new snapshot has just been read in from the client system.
===================
*/
static void CG_SetNextSnap( snapshot_t *snap ) {
int num;
int32_t num;
entityState_t *es;
centity_t *cent;
@ -319,7 +319,7 @@ of an interpolating one)
*/
void CG_ProcessSnapshots( void ) {
snapshot_t *snap;
int n;
int32_t n;
// see what the latest snapshot the client system has is
trap_GetCurrentSnapshotNumber( &n, &cg.latestSnapshotTime );

View File

@ -5,7 +5,7 @@
#include "cg_local.h"
//TiM | Hack coz VC 6 can't understand Thilo's defnitions :S
//typedef int intptr_t;
//typedef int32_t intptr_t;
static intptr_t (QDECL *syscall)( intptr_t arg, ... ) = (intptr_t (QDECL *)( intptr_t, ...))-1;
@ -14,16 +14,16 @@ Q_EXPORT void dllEntry( intptr_t (QDECL *syscallptr)( intptr_t arg,... ) ) {
syscall = syscallptr;
}
/*static int (QDECL *syscall)( int arg, ... ) = (int (QDECL *)( int, ...))-1;
/*static int32_t (QDECL *syscall)( int32_t arg, ... ) = (int32_t (QDECL *)( int32_t, ...))-1;
void dllEntry( int (QDECL *syscallptr)( int arg,... ) ) {
void dllEntry( int32_t (QDECL *syscallptr)( int32_t arg,... ) ) {
syscall = syscallptr;
}*/
int PASSFLOAT( float x ) {
int floatTemp;
int32_t PASSFLOAT( float x ) {
int32_t floatTemp;
floatTemp = x;
return floatTemp;
}
@ -36,11 +36,11 @@ void trap_Error( const char *fmt ) {
syscall( CG_ERROR, fmt );
}
int trap_Milliseconds( void ) {
int32_t trap_Milliseconds( void ) {
return syscall( CG_MILLISECONDS );
}
void trap_Cvar_Register( vmCvar_t *vmCvar, const char *varName, const char *defaultValue, int flags ) {
void trap_Cvar_Register( vmCvar_t *vmCvar, const char *varName, const char *defaultValue, int32_t flags ) {
syscall( CG_CVAR_REGISTER, vmCvar, varName, defaultValue, flags );
}
@ -56,31 +56,31 @@ void trap_Cvar_Set_No_Modify( const char *var_name, const char *value ) {
syscall( CG_CVAR_SET_NO_MODIFY, var_name, value );
}
void trap_Cvar_VariableStringBuffer( const char *var_name, char *buffer, int bufsize ) {
void trap_Cvar_VariableStringBuffer( const char *var_name, char *buffer, int32_t bufsize ) {
syscall( CG_CVAR_VARIABLESTRINGBUFFER, var_name, buffer, bufsize );
}
int trap_Argc( void ) {
int32_t trap_Argc( void ) {
return syscall( CG_ARGC );
}
void trap_Argv( int n, char *buffer, int bufferLength ) {
void trap_Argv( int32_t n, char *buffer, int32_t bufferLength ) {
syscall( CG_ARGV, n, buffer, bufferLength );
}
void trap_Args( char *buffer, int bufferLength ) {
void trap_Args( char *buffer, int32_t bufferLength ) {
syscall( CG_ARGS, buffer, bufferLength );
}
int trap_FS_FOpenFile( const char *qpath, fileHandle_t *f, fsMode_t mode ) {
int32_t trap_FS_FOpenFile( const char *qpath, fileHandle_t *f, fsMode_t mode ) {
return syscall( CG_FS_FOPENFILE, qpath, f, mode );
}
void trap_FS_Read( void *buffer, int len, fileHandle_t f ) {
void trap_FS_Read( void *buffer, int32_t len, fileHandle_t f ) {
syscall( CG_FS_READ, buffer, len, f );
}
void trap_FS_Write( const void *buffer, int len, fileHandle_t f ) {
void trap_FS_Write( const void *buffer, int32_t len, fileHandle_t f ) {
syscall( CG_FS_WRITE, buffer, len, f );
}
@ -108,11 +108,11 @@ void trap_CM_LoadMap( const char *mapname ) {
syscall( CG_CM_LOADMAP, mapname );
}
int trap_CM_NumInlineModels( void ) {
int32_t trap_CM_NumInlineModels( void ) {
return syscall( CG_CM_NUMINLINEMODELS );
}
clipHandle_t trap_CM_InlineModel( int index ) {
clipHandle_t trap_CM_InlineModel( int32_t index ) {
return syscall( CG_CM_INLINEMODEL, index );
}
@ -120,39 +120,39 @@ clipHandle_t trap_CM_TempBoxModel( const vec3_t mins, const vec3_t maxs ) {
return syscall( CG_CM_TEMPBOXMODEL, mins, maxs );
}
int trap_CM_PointContents( const vec3_t p, clipHandle_t model ) {
int32_t trap_CM_PointContents( const vec3_t p, clipHandle_t model ) {
return syscall( CG_CM_POINTCONTENTS, p, model );
}
int trap_CM_TransformedPointContents( const vec3_t p, clipHandle_t model, const vec3_t origin, const vec3_t angles ) {
int32_t trap_CM_TransformedPointContents( const vec3_t p, clipHandle_t model, const vec3_t origin, const vec3_t angles ) {
return syscall( CG_CM_TRANSFORMEDPOINTCONTENTS, p, model, origin, angles );
}
void trap_CM_BoxTrace( trace_t *results, const vec3_t start, const vec3_t end,
const vec3_t mins, const vec3_t maxs,
clipHandle_t model, int brushmask ) {
clipHandle_t model, int32_t brushmask ) {
syscall( CG_CM_BOXTRACE, results, start, end, mins, maxs, model, brushmask );
}
void trap_CM_TransformedBoxTrace( trace_t *results, const vec3_t start, const vec3_t end,
const vec3_t mins, const vec3_t maxs,
clipHandle_t model, int brushmask,
clipHandle_t model, int32_t brushmask,
const vec3_t origin, const vec3_t angles ) {
syscall( CG_CM_TRANSFORMEDBOXTRACE, results, start, end, mins, maxs, model, brushmask, origin, angles );
}
int trap_CM_MarkFragments( int numPoints, const vec3_t *points,
int32_t trap_CM_MarkFragments( int32_t numPoints, const vec3_t *points,
const vec3_t projection,
int maxPoints, vec3_t pointBuffer,
int maxFragments, markFragment_t *fragmentBuffer ) {
int32_t maxPoints, vec3_t pointBuffer,
int32_t maxFragments, markFragment_t *fragmentBuffer ) {
return syscall( CG_CM_MARKFRAGMENTS, numPoints, points, projection, maxPoints, pointBuffer, maxFragments, fragmentBuffer );
}
void trap_S_StartSound( vec3_t origin, int entityNum, int entchannel, sfxHandle_t sfx ) {
void trap_S_StartSound( vec3_t origin, int32_t entityNum, int32_t entchannel, sfxHandle_t sfx ) {
syscall( CG_S_STARTSOUND, origin, entityNum, entchannel, sfx );
}
void trap_S_StartLocalSound( sfxHandle_t sfx, int channelNum ) {
void trap_S_StartLocalSound( sfxHandle_t sfx, int32_t channelNum ) {
syscall( CG_S_STARTLOCALSOUND, sfx, channelNum );
}
@ -160,15 +160,15 @@ void trap_S_ClearLoopingSounds( void ) {
syscall( CG_S_CLEARLOOPINGSOUNDS );
}
void trap_S_AddLoopingSound( int entityNum, const vec3_t origin, const vec3_t velocity, sfxHandle_t sfx ) {
void trap_S_AddLoopingSound( int32_t entityNum, const vec3_t origin, const vec3_t velocity, sfxHandle_t sfx ) {
syscall( CG_S_ADDLOOPINGSOUND, entityNum, origin, velocity, sfx );
}
void trap_S_UpdateEntityPosition( int entityNum, const vec3_t origin ) {
void trap_S_UpdateEntityPosition( int32_t entityNum, const vec3_t origin ) {
syscall( CG_S_UPDATEENTITYPOSITION, entityNum, origin );
}
void trap_S_Respatialize( int entityNum, const vec3_t origin, vec3_t axis[3], int inwater ) {
void trap_S_Respatialize( int32_t entityNum, const vec3_t origin, vec3_t axis[3], int32_t inwater ) {
syscall( CG_S_RESPATIALIZE, entityNum, origin, axis, inwater );
}
@ -212,7 +212,7 @@ void trap_R_AddRefEntityToScene( const refEntity_t *re ) {
syscall( CG_R_ADDREFENTITYTOSCENE, re );
}
void trap_R_AddPolyToScene( qhandle_t hShader , int numVerts, const polyVert_t *verts ) {
void trap_R_AddPolyToScene( qhandle_t hShader , int32_t numVerts, const polyVert_t *verts ) {
syscall( CG_R_ADDPOLYTOSCENE, hShader, numVerts, verts );
}
@ -237,7 +237,7 @@ void trap_R_ModelBounds( clipHandle_t model, vec3_t mins, vec3_t maxs ) {
syscall( CG_R_MODELBOUNDS, model, mins, maxs );
}
void trap_R_LerpTag( orientation_t *tag, clipHandle_t mod, int startFrame, int endFrame,
void trap_R_LerpTag( orientation_t *tag, clipHandle_t mod, int32_t startFrame, int32_t endFrame,
float frac, const char *tagName ) {
syscall( CG_R_LERPTAG, tag, mod, startFrame, endFrame, PASSFLOAT(frac), tagName );
}
@ -250,31 +250,31 @@ void trap_GetGameState( gameState_t *gamestate ) {
syscall( CG_GETGAMESTATE, gamestate );
}
void trap_GetCurrentSnapshotNumber( int *snapshotNumber, int *serverTime ) {
void trap_GetCurrentSnapshotNumber( int32_t *snapshotNumber, int32_t *serverTime ) {
syscall( CG_GETCURRENTSNAPSHOTNUMBER, snapshotNumber, serverTime );
}
qboolean trap_GetSnapshot( int snapshotNumber, snapshot_t *snapshot ) {
qboolean trap_GetSnapshot( int32_t snapshotNumber, snapshot_t *snapshot ) {
return syscall( CG_GETSNAPSHOT, snapshotNumber, snapshot );
}
qboolean trap_GetServerCommand( int serverCommandNumber ) {
qboolean trap_GetServerCommand( int32_t serverCommandNumber ) {
return syscall( CG_GETSERVERCOMMAND, serverCommandNumber );
}
int trap_GetCurrentCmdNumber( void ) {
int32_t trap_GetCurrentCmdNumber( void ) {
return syscall( CG_GETCURRENTCMDNUMBER );
}
qboolean trap_GetUserCmd( int cmdNumber, usercmd_t *ucmd ) {
qboolean trap_GetUserCmd( int32_t cmdNumber, usercmd_t *ucmd ) {
return syscall( CG_GETUSERCMD, cmdNumber, ucmd );
}
void trap_SetUserCmdValue( int stateValue, float sensitivityScale ) {
void trap_SetUserCmdValue( int32_t stateValue, float sensitivityScale ) {
syscall( CG_SETUSERCMDVALUE, stateValue, PASSFLOAT(sensitivityScale) );
}
void testPrintInt( char *string, int i ) {
void testPrintInt( char *string, int32_t i ) {
syscall( CG_TESTPRINTINT, string, i );
}
@ -282,7 +282,7 @@ void testPrintFloat( char *string, float f ) {
syscall( CG_TESTPRINTFLOAT, string, PASSFLOAT(f) );
}
int trap_MemoryRemaining( void ) {
int32_t trap_MemoryRemaining( void ) {
return syscall( CG_MEMORY_REMAINING );
}

View File

@ -140,7 +140,7 @@ static void CG_AddTestModel (void) {
VectorCopy( cg.refdef.viewaxis[2], cg.testModelEntity.axis[2] );
// allow the position to be adjusted
int i;
int32_t i;
for (i=0 ; i<3 ; i++) {
cg.testModelEntity.origin[i] += cg.refdef.viewaxis[0][i] * cg_gun_x.value;
cg.testModelEntity.origin[i] += cg.refdef.viewaxis[1][i] * cg_gun_y.value;
@ -161,7 +161,7 @@ Sets the coordinates of the rendered window
=================
*/
static void CG_CalcVrect (void) {
int size;
int32_t size;
// the intermission should allways be full screen
if ( cg.snap->ps.pm_type == PM_INTERMISSION ) {
@ -233,7 +233,7 @@ vec3_t cameraIdealTarget, cameraIdealLoc; //location and view angles of where
vec3_t cameraCurTarget={0,0,0}, cameraCurLoc={0,0,0}; //Current view and location of camera
vec3_t CameraOldLoc={0,0,0}, cameraNewLoc={0,0,0}; //Backup data for the lerp func
int cameraLastFrame=0;
int32_t cameraLastFrame=0;
float cameraLastYaw=0;
float cameraStiffFactor=0.0f;
@ -627,7 +627,7 @@ static void CG_OffsetThirdPersonView( void ) {
float focusDist;
float forwardScale, sideScale;
char medicrevive[32];
int medicrevive_int;
int32_t medicrevive_int;
vec3_t camPlayerPos; //TiM
//cg.refdef.vieworg[2] += cg.predictedPlayerState.viewheight;
@ -750,7 +750,7 @@ static void CG_OffsetThirdPersonView( void ) {
// this causes a compiler bug on mac MrC compiler
static void CG_StepOffset( void ) {
int timeDelta;
int32_t timeDelta;
// smooth out stair climbing
timeDelta = cg.time - cg.stepTime;
@ -774,9 +774,9 @@ static void CG_OffsetFirstPersonView( void ) {
float speed;
float f;
vec3_t predictedVelocity;
int timeDelta;
int32_t timeDelta;
char medicrevive[32];
int medicrevive_int;
int32_t medicrevive_int;
if ( cg.snap->ps.pm_type == PM_INTERMISSION ) {
return;
@ -938,7 +938,7 @@ CGCam_Shake
-------------------------
*/
void CG_CameraShake( float intensity, int duration, qboolean addRumbleSound )
void CG_CameraShake( float intensity, int32_t duration, qboolean addRumbleSound )
{
if ( intensity > MAX_SHAKE_INTENSITY )
intensity = MAX_SHAKE_INTENSITY;
@ -968,7 +968,7 @@ void CG_UpdateCameraShake( vec3_t origin, vec3_t angles )
float intensity_scale, intensity;
//float ranIntensity;
float ratio;
int i;
int32_t i;
//TiM - restart a server loop shake
if ( cg.shake_duration <= 0 && cg.shake_serverIndex > (cg.time - cgs.levelStartTime ) ) {
@ -1015,7 +1015,7 @@ void CG_UpdateCameraShake( vec3_t origin, vec3_t angles )
//ranIntensity = flrandom( ( 10000.0f * ( 1.0f - Q_fabs( intensity ) ) ), ( 30000.0f * ( 1.0f - Q_fabs( intensity ) )) );
cg.shake_lastLerp = cg.shake_nextLerp;
//cg.shake_nextLerp = cg.time + (int)ranIntensity;
//cg.shake_nextLerp = cg.time + (int32_t)ranIntensity;
cg.shake_nextLerp = cg.time + irandom( 30, 40 );
if( cg.shake_nextLerp > ( cg.shake_start + cg.shake_duration ) ) {
@ -1171,11 +1171,11 @@ Fixed fov at intermissions, otherwise account for fov variable and zooms.
#define FOV_MAX 120
static int CG_CalcFov( void ) {
static int32_t CG_CalcFov( void ) {
float x;
int contents;
int32_t contents;
float fov_x, fov_y;
int inwater;
int32_t inwater;
qboolean warpEffect=qfalse;
if ( cg.predictedPlayerState.pm_type == PM_INTERMISSION ) {
@ -1223,7 +1223,7 @@ static int CG_CalcFov( void ) {
}
else
{//still zooming
static int zoomSoundTime = 0;
static int32_t zoomSoundTime = 0;
if ( zoomSoundTime < cg.time )
{
@ -1294,7 +1294,7 @@ CG_CalcViewValues
Sets cg.refdef view values
===============
*/
static int CG_CalcViewValues( void ) {
static int32_t CG_CalcViewValues( void ) {
playerState_t *ps;
memset( &cg.refdef, 0, sizeof( cg.refdef ) );
@ -1327,7 +1327,7 @@ static int CG_CalcViewValues( void ) {
// add error decay
if ( cg_errorDecay.value > 0 ) {
int t;
int32_t t;
float f;
t = cg.time - cg.predictedErrorTime;
@ -1370,8 +1370,8 @@ CG_PowerupTimerSounds
=====================
*/
/*static void CG_PowerupTimerSounds( void ) {
int i;
int t;
int32_t i;
int32_t t;
// powerup timers going away
for ( i = 0 ; i < MAX_POWERUPS ; i++ ) {
@ -1405,9 +1405,9 @@ CG_IntroModel
This is when the player is starting the level.
=============
*/
/*void CG_AddIntroModel(playerState_t *ps, int time)
/*void CG_AddIntroModel(playerState_t *ps, int32_t time)
{
static int soundpoint=0, lasttime=999999;
static int32_t soundpoint=0, lasttime=999999;
refEntity_t doorbox;
float alpha;
byte a;
@ -1552,8 +1552,8 @@ CG_DrawActiveFrame
Generates and draws a game scene and status information at the given time.
=================
*/
void CG_DrawActiveFrame( int serverTime, stereoFrame_t stereoView, qboolean demoPlayback ) {
int inwater;
void CG_DrawActiveFrame( int32_t serverTime, stereoFrame_t stereoView, qboolean demoPlayback ) {
int32_t inwater;
char cvarYaw[16]; //an uber long floating point value lol
float yaw;

View File

@ -5,7 +5,7 @@
#include "fx_local.h"
//RPG-X : TiM - Weapons Arrays
static int RAweapons[8] = { WP_3,
static int32_t RAweapons[8] = { WP_3,
WP_2,
WP_6,
WP_7,
@ -38,8 +38,8 @@ The server says this item is used on this level
typedef struct wpnBarrelInfo_s
{
weapon_t giTag;
int numBarrels;
int flashTime;
int32_t numBarrels;
int32_t flashTime;
} wpnBarrelInfo_t;
wpnBarrelInfo_t wpnBarrelData[] =
@ -92,13 +92,13 @@ wpnBarrelInfo_t wpnBarrelData[] =
// {WP_0, 0},
//};
void CG_RegisterWeapon( int weaponNum ) {
void CG_RegisterWeapon( int32_t weaponNum ) {
weaponInfo_t *weaponInfo;
gitem_t *item, *ammo;
char path[MAX_QPATH];
vec3_t mins, maxs;
int i;
int numBarrels = 0;
int32_t i;
int32_t numBarrels = 0;
wpnBarrelInfo_t *barrelInfo = NULL;
@ -453,7 +453,7 @@ CG_RegisterItemVisuals
The server says this item is used on this level
=================
*/
void CG_RegisterItemVisuals( int itemNum ) {
void CG_RegisterItemVisuals( int32_t itemNum ) {
itemInfo_t *itemInfo;
gitem_t *item;
@ -515,7 +515,7 @@ CG_MapTorsoToWeaponFrame
=================
*/
static int CG_MapTorsoToWeaponFrame( clientInfo_t *ci, int frame ) {
static int32_t CG_MapTorsoToWeaponFrame( clientInfo_t *ci, int32_t frame ) {
animation_t *anim;
// change weapon
@ -572,7 +572,7 @@ CG_CalculateWeaponPosition
//BOOKMARK
static void CG_CalculateWeaponPosition( vec3_t origin, vec3_t angles ) {
float scale;
int delta;
int32_t delta;
float fracsin;
VectorCopy( cg.refdef.vieworg, origin );
@ -788,7 +788,7 @@ CG_MachinegunSpinAngle
static float CG_MachinegunSpinAngle( centity_t *cent ) {
float angle;
int delta = cg.time - cent->pe.barrelTime;
int32_t delta = cg.time - cent->pe.barrelTime;
if ( cent->pe.barrelSpinning ) {
angle = cent->pe.barrelAngle + delta * SPIN_SPEED;
} else {
@ -816,7 +816,7 @@ CG_AddWeaponWithPowerups
========================
*/
static void CG_AddWeaponWithPowerups( refEntity_t *gun, int powerups, beamData_t* beamData, int cloakTime, int decloakTime ) //
static void CG_AddWeaponWithPowerups( refEntity_t *gun, int32_t powerups, beamData_t* beamData, int32_t cloakTime, int32_t decloakTime ) //
{
// add powerup effects
if ( powerups & ( 1 << PW_INVIS ) || ( !(powerups & ( 1 << PW_INVIS )) && decloakTime > 0 ) ) {
@ -842,7 +842,7 @@ static void CG_AddWeaponWithPowerups( refEntity_t *gun, int powerups, beamData_t
}
else if ( powerups & ( 1 << PW_BEAM_OUT ) || powerups & ( 1 << PW_QUAD ) )
{
int btime;
int32_t btime;
btime = cg.time - beamData->beamTimeParam;
if ( btime <= PLAYER_BEAM_FADE ) {
@ -865,7 +865,7 @@ static void CG_AddWeaponWithPowerups( refEntity_t *gun, int powerups, beamData_t
if (btime > PLAYER_BEAM_FADE && btime < (PLAYER_BEAM_FADE + PLAYER_BEAM_FADETIME) )
{
gun->renderfx |= RF_FORCE_ENT_ALPHA;
gun->shaderRGBA[3] = (int)(255 * beamData->beamAlpha);
gun->shaderRGBA[3] = (int32_t)(255 * beamData->beamAlpha);
}
if ( gun->shaderRGBA[3] > 0 ) {
@ -1073,7 +1073,7 @@ void CG_AddPlayerWeapon( refEntity_t *parent, playerState_t *ps, centity_t *cent
weapon_t weaponNum;
weaponInfo_t *weapon;
centity_t *nonPredictedCent;
int i = 0, numBarrels = 0;
int32_t i = 0, numBarrels = 0;
wpnBarrelInfo_t *barrelInfo = NULL;
char filename[MAX_QPATH];
@ -1529,7 +1529,7 @@ WEAPON SELECTION
==============================================================================
*/
void static CG_RegisterWeaponIcon( int weaponNum ) {
void static CG_RegisterWeaponIcon( int32_t weaponNum ) {
weaponInfo_t *weaponInfo;
gitem_t *item;
@ -1563,7 +1563,7 @@ RPG-X | Phenix | 08/06/2005
RPG-X | TiM | 5/1/2006
===========================
*/
void CG_DrawWeaponIcon ( int x, int y, int weapon )
void CG_DrawWeaponIcon ( int32_t x, int32_t y, int32_t weapon )
{
/*vec4_t color;
@ -1604,7 +1604,7 @@ CG_DrawWeaponSelect
===================
*/
static int weaponRows[6][3] = { { WP_1, 0, 0 },
static int32_t weaponRows[6][3] = { { WP_1, 0, 0 },
{ WP_2, WP_3, WP_4 },
{ WP_5, WP_6, WP_7 },
{ WP_8, WP_9, WP_10 },
@ -1612,10 +1612,10 @@ static int weaponRows[6][3] = { { WP_1, 0, 0 },
{ WP_14, WP_15, 0 } };
void CG_DrawWeaponSelect( void ) {
int i, rowCount, cellCount;
int bits;
//int count;
int x, y, defaultX, defaultY;
int32_t i, rowCount, cellCount;
int32_t bits;
//int32_t count;
int32_t x, y, defaultX, defaultY;
char *name;
float *color;
qboolean WeapOnThisRow = qfalse;
@ -1706,7 +1706,7 @@ void CG_DrawWeaponSelect( void ) {
CG_WeaponSelectable
===============
*/
static qboolean CG_WeaponSelectable( int i ) {
static qboolean CG_WeaponSelectable( int32_t i ) {
if ( !cg.snap->ps.ammo[i] ) {
return qfalse;
}
@ -1717,7 +1717,7 @@ static qboolean CG_WeaponSelectable( int i ) {
return qtrue;
}
extern int altAmmoUsage[];
extern int32_t altAmmoUsage[];
/*
{
0, //WP_0,
@ -1742,7 +1742,7 @@ extern int altAmmoUsage[];
CG_WeaponAltSelectable
===============
*/
static qboolean CG_WeaponAltSelectable( int i ) {
static qboolean CG_WeaponAltSelectable( int32_t i ) {
if ( cg.snap->ps.ammo[i] < altAmmoUsage[cg.snap->ps.weapon]) {
return qfalse;
}
@ -1760,10 +1760,10 @@ CG_NextWeapon_f
===============
*/
void CG_NextWeapon_f( void ) {
int i; //, topWeapon
int original;
// int newWeapons[16];
// int bits;
int32_t i; //, topWeapon
int32_t original;
// int32_t newWeapons[16];
// int32_t bits;
if ( !cg.snap ) {
return;
@ -1804,10 +1804,10 @@ CG_PrevWeapon_f
===============
*/
void CG_PrevWeapon_f( void ) {
int i; //, topWeapon
int original;
// int newWeapons[16];
// int bits;
int32_t i; //, topWeapon
int32_t original;
// int32_t newWeapons[16];
// int32_t bits;
if ( !cg.snap ) {
return;
@ -1843,7 +1843,7 @@ CG_Weapon_f
===============
*/
/*TiM : Here for reference
static int weaponRows[6][3] = { WP_1, 0, 0,
static int32_t weaponRows[6][3] = { WP_1, 0, 0,
WP_2, WP_3, WP_4,
WP_5, WP_6, WP_7,
WP_8, WP_9, WP_10,
@ -1851,16 +1851,16 @@ static int weaponRows[6][3] = { WP_1, 0, 0,
WP_14, WP_NEUTRINO_PROBE, 0 };*/
void CG_Weapon_f( void ) {
int num;
//int newWeapons[16];
int i;
int bits;
int weaponsOnRow;
int weaponGot[6];
int onRow;
int onCol;
int rowsUsed;
int currentWeaponCol;
int32_t num;
//int32_t newWeapons[16];
int32_t i;
int32_t bits;
int32_t weaponsOnRow;
int32_t weaponGot[6];
int32_t onRow;
int32_t onCol;
int32_t rowsUsed;
int32_t currentWeaponCol;
if ( !cg.snap ) {
return;
@ -1984,7 +1984,7 @@ The current weapon has just run out of ammo
===================
*/
void CG_OutOfAmmoChange( qboolean altfire ) {
int i;
int32_t i;
cg.weaponSelectTime = cg.time;
@ -2026,12 +2026,12 @@ CG_FireWeapon
Caused by an EV_FIRE_WEAPON event
================
*/
int tris_state = 0;
int32_t tris_state = 0;
void CG_FireWeapon( centity_t *cent, qboolean alt_fire ) {
entityState_t *ent;
weaponInfo_t *weap;
int rpg_effectsgun;
int rpg_tripmines;
int32_t rpg_effectsgun;
int32_t rpg_tripmines;
const char *info;
//const char *info2;
@ -2145,7 +2145,7 @@ CG_MissileHitWall
Caused by an EV_MISSILE_MISS event, or directly by local bullet tracing
=================
*/
void CG_MissileHitWall( centity_t *cent, int weapon, vec3_t origin, vec3_t dir )
void CG_MissileHitWall( centity_t *cent, int32_t weapon, vec3_t origin, vec3_t dir )
{
qhandle_t mod;
qhandle_t mark;
@ -2156,7 +2156,7 @@ void CG_MissileHitWall( centity_t *cent, int weapon, vec3_t origin, vec3_t dir )
vec3_t lightColor;
localEntity_t *le;
qboolean isSprite;
int duration;
int32_t duration;
qboolean alphaFade;
// weaponInfo_t *weaponInfo = &cg_weapons[weapon];
@ -2272,7 +2272,7 @@ void CG_MissileHitWall( centity_t *cent, int weapon, vec3_t origin, vec3_t dir )
CG_MissileHitPlayer
=================
*/
void CG_MissileHitPlayer( centity_t *cent, int weapon, vec3_t origin, vec3_t dir)
void CG_MissileHitPlayer( centity_t *cent, int32_t weapon, vec3_t origin, vec3_t dir)
{
if (cent)
{ // Showing blood is a no-no.
@ -2293,9 +2293,9 @@ Caused by an EV_BOUNCE | EV_BOUNCE_HALF event
*/
// big fixme. none of these sounds should be registered at runtime
void CG_BounceEffect( centity_t *cent, int weapon, vec3_t origin, vec3_t normal )
void CG_BounceEffect( centity_t *cent, int32_t weapon, vec3_t origin, vec3_t normal )
{
int rpg_tripmines;
int32_t rpg_tripmines;
const char *info;
switch( weapon )
@ -2346,7 +2346,7 @@ CG_CalcMuzzlePoint
======================
*/
extern qboolean PM_PlayerCrouching ( int legsAnim );
extern qboolean PM_PlayerCrouching ( int32_t legsAnim );
qboolean CG_CalcMuzzlePoint( centity_t *cent, vec3_t muzzle, qboolean isDecoy ) {
vec3_t forward;
@ -2390,7 +2390,7 @@ void CG_SurfaceExplosion( vec3_t origin, vec3_t normal, float radius, float shak
vec3_t sprayvel, velocity = { 0, 0, 0 };
vec3_t temp_org, temp_vel;
float scale;
int i, numSparks;
int32_t i, numSparks;
//Sparks

View File

@ -77,7 +77,7 @@ void FX_CompressionShot( vec3_t start, vec3_t dir )
if ( render_impact )
{
traceEnt = &cg_entities[trace.entityNum];
int clientNum = traceEnt->currentState.clientNum;
int32_t clientNum = traceEnt->currentState.clientNum;
if ( (trace.entityNum != ENTITYNUM_WORLD) && clientNum >= 0 && clientNum < MAX_CLIENTS )
{
FX_CompressionHit(trace.endpos);
@ -119,7 +119,7 @@ void FX_CompressionAltShot( vec3_t start, vec3_t dir )
if ( render_impact )
{
traceEnt = &cg_entities[trace.entityNum];
int clientNum = traceEnt->currentState.clientNum;
int32_t clientNum = traceEnt->currentState.clientNum;
if ( (trace.entityNum != ENTITYNUM_WORLD) && clientNum >= 0 && clientNum < MAX_CLIENTS )
{
FX_CompressionHit(trace.endpos);
@ -144,7 +144,7 @@ void FX_CompressionExplosion( vec3_t start, vec3_t origin, vec3_t normal, qboole
vec3_t velocity; //, shot_dir;
vec3_t hitpos;
float scale;
int i, j, numSparks;
int32_t i, j, numSparks;
weaponInfo_t *weaponInfo = &cg_weapons[WP_6];
float distance;
@ -222,7 +222,7 @@ void FX_CompressionExplosion( vec3_t start, vec3_t origin, vec3_t normal, qboole
if (!altfire)
{
int size = 2;
int32_t size = 2;
CG_InitLensFlare( origin,
350, 350,
color, 1.2, 2.0, 1600, 200,
@ -408,7 +408,7 @@ void FX_PrifleBeamFire( vec3_t startpos, vec3_t endpos, vec3_t normal, qboolean
// "Fun" sparks... Not when empty.
if ( spark && !empty)
{
int sparks = (rand() & 1) + 1;
int32_t sparks = (rand() & 1) + 1;
for(;sparks>0;sparks--)
{
float size = 0.2f + (random() * 0.4);

View File

@ -33,13 +33,13 @@ Fun "crawling" electricity ( credit goes to Josh for this one )
-------------------------
*/
void FX_DisruptorDischarge( vec3_t origin, vec3_t normal, int count, float dist_out, float dist_side )
void FX_DisruptorDischarge( vec3_t origin, vec3_t normal, int32_t count, float dist_out, float dist_side )
{
trace_t trace;
vec3_t org, dir, dest;
vec3_t vr;
int i;
int discharge = dist_side;
int32_t i;
int32_t discharge = dist_side;
vectoangles( normal, dir );
dir[ROLL] += random() * 360;
@ -54,7 +54,7 @@ void FX_DisruptorDischarge( vec3_t origin, vec3_t normal, int count, float dist_
AngleVectors( dir, NULL, vr, NULL );
//Move to the side in a random direction
discharge += (int)( crandom() * 8.0f );
discharge += (int32_t)( crandom() * 8.0f );
VectorMA( org, discharge, vr, org );
//Trace back to find a surface
@ -91,10 +91,10 @@ Main fire impact
#define DISCHARGE_DIST 8
#define DISCHARGE_SIDE_DIST 24
void FX_DisruptorWeaponHitWall( vec3_t origin, vec3_t dir, int size )
void FX_DisruptorWeaponHitWall( vec3_t origin, vec3_t dir, int32_t size )
{
vec3_t vel, /*accel,*/ hitpos, direction, org;
//int i, t;
//int32_t i, t;
weaponInfo_t *weaponInfo = &cg_weapons[WP_10];
CG_InitLensFlare( origin,
@ -274,7 +274,7 @@ void FX_DisruptorBeamFire( vec3_t startpos, vec3_t endpos, vec3_t normal, qboole
// "Fun" sparks... Not when empty.
if ( spark && !empty)
{
int sparks = (rand() & 1) + 1;
int32_t sparks = (rand() & 1) + 1;
for(;sparks>0;sparks--)
{
float size = 0.2f + (random() * 0.4);

View File

@ -50,7 +50,7 @@ void FX_GrenadeExplode( vec3_t origin, vec3_t normal )
localEntity_t *le;
qhandle_t null = 0;
vec3_t direction, org, vel;
int i;
int32_t i;
VectorSet( direction, 0,0,1 );
@ -90,7 +90,7 @@ void FX_GrenadeExplode( vec3_t origin, vec3_t normal )
{
localEntity_t *le;
vec3_t direction, org, vel;
int i;
int32_t i;
VectorCopy( norm, direction);
@ -131,7 +131,7 @@ void FX_GrenadeShrapnelExplode( vec3_t origin, vec3_t norm )
localEntity_t *le;
//FXTrail *fx;
vec3_t direction, org, vel;
int i;
int32_t i;
CG_InitLensFlare( origin,
350, 350,
@ -219,7 +219,7 @@ By: RedTechie - From SP
VectorMA( start, len, diff, org );
//fx =
FX_AddLine( end, start, (int)(random() * 3.2f), 2.0f + random() * 2, 0, 0.5f, 0.1f, 150 + random() * 150, cgs.media.orangeTrailShader );
FX_AddLine( end, start, (int32_t)(random() * 3.2f), 2.0f + random() * 2, 0, 0.5f, 0.1f, 150 + random() * 150, cgs.media.orangeTrailShader );
//if ( fx == NULL )
// return;
@ -253,10 +253,10 @@ void FX_fxfunc_Explosion( vec3_t start, vec3_t origin, vec3_t normal )
// vec3_t end;
// trace_t trace;
float scale;
int i, j, numSparks;
int32_t i, j, numSparks;
//weaponInfo_t *weaponInfo = &cg_weapons[WP_6];
//float scale, dscale;
// int s;
// int32_t s;
// vec3_t new_org;
//Sparks

View File

@ -17,7 +17,7 @@ void FX_HypoSpray( vec3_t origin, vec3_t dir, qboolean red ) // When not red, i
{
vec3_t vel, angles, work;
float scale, dscale;
int i;
int32_t i;
localEntity_t *le;
vectoangles( dir, angles );

View File

@ -131,7 +131,7 @@ void FX_Detpack(vec3_t origin)
localEntity_t *le;
qhandle_t null = 0;
vec3_t direction, org, vel, norm = {0,0,1};
int i;
int32_t i;
VectorCopy( norm, direction);
@ -181,7 +181,7 @@ void FX_Detpack(vec3_t origin)
//RPG-X ToDo: Modify force field Code Here
void FX_DrawPortableShield(centity_t *cent)
{
int xaxis, height, posWidth, negWidth; // light;
int32_t xaxis, height, posWidth, negWidth; // light;
vec3_t start, end, normal;
//vec4_t RGBA;
float halfHeight;
@ -224,13 +224,13 @@ void FX_DrawPortableShield(centity_t *cent)
//This way, we canhave it flare on events, and invisible the rest of the time
//tho make sure admins can see it
if((int)cent->currentState.origin2[0] == 1) {
if((int32_t)cent->currentState.origin2[0] == 1) {
shader = cgs.media.shieldActivateShaderBorg;
}
else if((int)cent->currentState.origin2[0] == 2) {
else if((int32_t)cent->currentState.origin2[0] == 2) {
shader = cgs.media.shieldActivateShaderYellow;
}
else if((int)cent->currentState.origin2[0] == 3) {
else if((int32_t)cent->currentState.origin2[0] == 3) {
shader = cgs.media.shieldActivateShaderRed;
}
else {

View File

@ -5,7 +5,7 @@
void FXE_Spray (vec3_t direction, float speed, float variation, float cone, vec3_t velocity)
{
vec3_t dir;
int i;
int32_t i;
//Randomize the direction
for (i = 0; i < 3; i ++ )
@ -1077,8 +1077,8 @@ Adds a spawner -- basically, a local entity with a think function. Spawners don'
associated with them inherently, but the spawner's think fn probably generates them.
===============
*/
localEntity_t *FX_AddSpawner( vec3_t origin, vec3_t dir, vec3_t velocity, vec3_t user, qboolean gravity, int delay,
float variance, float killTime, qboolean (*thinkFn)(localEntity_t *le), int radius )
localEntity_t *FX_AddSpawner( vec3_t origin, vec3_t dir, vec3_t velocity, vec3_t user, qboolean gravity, int32_t delay,
float variance, float killTime, qboolean (*thinkFn)(localEntity_t *le), int32_t radius )
{
localEntity_t *le = NULL;

View File

@ -83,8 +83,8 @@ localEntity_t *FX_AddParticle( vec3_t origin, vec3_t velocity, qboolean gravity,
float startalpha, float endalpha, float roll, float elasticity,
float killTime, qhandle_t shader, qboolean (*thinkFn)(localEntity_t *le));
localEntity_t *FX_AddSpawner( vec3_t origin, vec3_t dir, vec3_t velocity, vec3_t user, qboolean gravity, int delay,
float variance, float killTime, qboolean (*thinkFn)(localEntity_t *le), int radius );
localEntity_t *FX_AddSpawner( vec3_t origin, vec3_t dir, vec3_t velocity, vec3_t user, qboolean gravity, int32_t delay,
float variance, float killTime, qboolean (*thinkFn)(localEntity_t *le), int32_t radius );
/*
* phaser
@ -102,8 +102,8 @@ void FX_CompressionExplosion( vec3_t start, vec3_t origin, vec3_t normal, qboole
void FX_CompressionHit( vec3_t origin );
void FX_PrifleBeamFire( vec3_t startpos, vec3_t endpos, vec3_t normal, qboolean spark, qboolean impact, qboolean empty );
void FX_ProbeBeam( vec3_t origin, vec3_t dir, int clientNum, qboolean alt_fire );
void FX_RegenBeam( vec3_t origin, vec3_t dir, int clientNum, qboolean alt_fire );
void FX_ProbeBeam( vec3_t origin, vec3_t dir, int32_t clientNum, qboolean alt_fire );
void FX_RegenBeam( vec3_t origin, vec3_t dir, int32_t clientNum, qboolean alt_fire );
/*
* tetrion disruptor
@ -137,7 +137,7 @@ void FX_Detpack(vec3_t origin);
* Disruptor Weapon
*/
void FX_DisruptorBeamFire( vec3_t startpos, vec3_t endpos, vec3_t normal, qboolean spark, qboolean impact, qboolean empty );
void FX_DisruptorWeaponHitWall( vec3_t origin, vec3_t dir, int size );
void FX_DisruptorWeaponHitWall( vec3_t origin, vec3_t dir, int32_t size );
/*
* Quantum Burst
@ -153,7 +153,7 @@ void FX_QuantumColumns( vec3_t origin );
*/
void FX_Transporter(vec3_t origin);
void FX_TransporterPad( vec3_t origin );
void FX_SPTransporterLensFlares( centity_t* cent, vec3_t headVector, int startTime );
void FX_SPTransporterLensFlares( centity_t* cent, vec3_t headVector, int32_t startTime );
/* Holdable, portable shield item */
@ -171,7 +171,7 @@ void FX_PlayerShieldHit( centity_t *cent );
void FX_Disruptor( vec3_t org, float length );
void FX_ExplodeBits( vec3_t org);
void FX_qFlash( centity_t* cent, vec3_t org, int timeIndex );
void FX_qFlash( centity_t* cent, vec3_t org, int32_t timeIndex );
/*
* sin table

View File

@ -40,7 +40,7 @@ qboolean MakeDisruptorShard( localEntity_t *le )
void FX_Disruptor( vec3_t org, float length )
{//FIXME: make it move with owner?
vec3_t org1, org2, normal={0,0,1};
int t;
int32_t t;
VectorMA( org, 48, normal, org1 );
VectorMA( org, -48, normal, org2 );
@ -66,10 +66,10 @@ void FX_EnergyGibs(vec3_t origin )
localEntity_t *le;
refEntity_t *re;
vec3_t dir;
int i, j, k;
int chunkModel=0;
int32_t i, j, k;
int32_t chunkModel=0;
float baseScale = 0.7f, dist;
int numChunks;
int32_t numChunks;
numChunks = irandom( 10, 15 );
@ -139,7 +139,7 @@ void FX_ExplodeBits( vec3_t org)
{
float width, length;
vec3_t vel, pos;
int i;
int32_t i;
FX_EnergyGibs(org);
@ -157,7 +157,7 @@ void FX_ExplodeBits( vec3_t org)
#define Q_FLASH_SIZE 110
void FX_qFlash( centity_t* cent, vec3_t org, int timeIndex ) {
void FX_qFlash( centity_t* cent, vec3_t org, int32_t timeIndex ) {
trace_t tr;
refEntity_t flare;
float frac;
@ -204,7 +204,7 @@ void FX_qFlash( centity_t* cent, vec3_t org, int timeIndex ) {
#define PROBE_BEAM_LENGTH 32
//TiM - Beam FX for the Neutrino Probe weapon
void FX_ProbeBeam( vec3_t origin, vec3_t dir, int clientNum, qboolean alt_fire )
void FX_ProbeBeam( vec3_t origin, vec3_t dir, int32_t clientNum, qboolean alt_fire )
{
trace_t tr;
refEntity_t beam;
@ -257,7 +257,7 @@ void FX_ProbeBeam( vec3_t origin, vec3_t dir, int clientNum, qboolean alt_fire )
}
#define REGEN_BEAM_LENGTH 64
void FX_RegenBeam( vec3_t origin, vec3_t dir, int clientNum, qboolean alt_fire )
void FX_RegenBeam( vec3_t origin, vec3_t dir, int32_t clientNum, qboolean alt_fire )
{
trace_t tr;
vec3_t end;

View File

@ -150,7 +150,7 @@ void FX_PhaserFire( vec3_t startpos, vec3_t endpos, vec3_t normal, qboolean spar
// "Fun" sparks... Not when empty.
if ( spark && !empty)
{
int sparks = (rand() & 1) + 1;
int32_t sparks = (rand() & 1) + 1;
for(;sparks>0;sparks--)
{
float size = 0.2f + (random() * 0.4);
@ -184,7 +184,7 @@ void FX_PhaserAltFire( vec3_t start, vec3_t end, vec3_t normal, qboolean spark,
refEntity_t beam;
vec3_t rgb = { 1,0.6,0.5}, rgb2={1,0.3,0};
float len;
int color;
int32_t color;
VectorSubtract(end, start, diff);
len = VectorNormalize(diff);
@ -322,13 +322,13 @@ void FX_PhaserAltFire( vec3_t start, vec3_t end, vec3_t normal, qboolean spark,
{
// kef -- fixme. dunno what the deal is with this velocity vector
VectorClear(vel);
int sparks = (rand() & 3) + 1;
int32_t sparks = (rand() & 3) + 1;
// Set random starting pos...
end2[0] = flrandom(-1.0, 1.0) + end[0];
end2[1] = flrandom(-1.0, 1.0) + end[1];
end2[2] = flrandom(-1.0, 1.0) + end[2];
int i;
int32_t i;
for( i = 0; i < sparks; i++ )
{
scale = 0.5f + (random() * 0.5);

View File

@ -110,7 +110,7 @@ void FX_QuantumHitWall( vec3_t origin, vec3_t normal )
vec3_t dir, org;
vec3_t vel;
float scale;
int i;
int32_t i;
weaponInfo_t *weaponInfo = &cg_weapons[WP_9];
CG_InitLensFlare( origin,
@ -189,7 +189,7 @@ void FX_QuantumAltHitWall( vec3_t origin, vec3_t normal )
vec3_t dir, org;
vec3_t vel;
float scale;
int i;
int32_t i;
vec3_t RGB={1.0, 0.6, 0.3}, RGB2={1.0, 0.3, 0.0};
weaponInfo_t *weaponInfo = &cg_weapons[WP_9];
@ -259,7 +259,7 @@ void FX_QuantumAltHitWall( vec3_t origin, vec3_t normal )
qboolean FX_QuantumSparkle( localEntity_t *le)
{
int t, i;
int32_t t, i;
vec3_t org, v;
for ( i = 0; i < 4; i ++ )
@ -281,7 +281,7 @@ void FX_QuantumFizzles( vec3_t origin )
{
float v;
vec3_t dir, vel, org;
int i;
int32_t i;
for ( i = 0; i < 32; i++ )
{

View File

@ -32,18 +32,18 @@ Planned timing:
-------------------------
*/
void FX_SPTransporterLensFlares( centity_t* cent, vec3_t headVector, int startTime ) {
void FX_SPTransporterLensFlares( centity_t* cent, vec3_t headVector, int32_t startTime ) {
refEntity_t flare;
trace_t tr;
int i;
int direction = 1;
int timeOffset = 0; //250 - time between first and second flares appearing;
int32_t i;
int32_t direction = 1;
int32_t timeOffset = 0; //250 - time between first and second flares appearing;
float ratio;
float dlightRatio;
vec3_t origin, tempOrigin;
int width;
int height;
int32_t width;
int32_t height;
//Hrmm... we have a glitch lol. Since DEPTHHACK is on, the flare will be drawn
//from ANYWHERE IN THE LEVEL! O_o

View File

@ -66,7 +66,7 @@ static list_iter_p list_iterator(list_p list, char init) {
* \param end indicator where to add the data
* \return Count of elements in the list
*/
static int list_add(list_p list, void* data, dataType_t type, size_t size, char end) {
static int32_t list_add(list_p list, void* data, dataType_t type, size_t size, char end) {
lnode_p node = (lnode_p)malloc(sizeof(struct linked_node));
node->cont = (container_p)malloc(sizeof(container));
@ -121,7 +121,7 @@ static int list_add(list_p list, void* data, dataType_t type, size_t size, char
* \param size size of data
* \return Count of elements in the list
*/
static int list_append(list_p list, void* data, dataType_t type, size_t size) {
static int32_t list_append(list_p list, void* data, dataType_t type, size_t size) {
return list_add(list, data, type, size, LIST_BACK);
}
@ -137,7 +137,7 @@ static int list_append(list_p list, void* data, dataType_t type, size_t size) {
* \param size size of data
* \return Count of elements in the list
*/
static int list_prepend(list_p list, void* data, dataType_t type, size_t size) {
static int32_t list_prepend(list_p list, void* data, dataType_t type, size_t size) {
return list_add(list, data, type, size, LIST_FRONT);
}
@ -151,7 +151,7 @@ static int list_prepend(list_p list, void* data, dataType_t type, size_t size) {
* \param end indicator where to insert
* \return Count of elements in the list
*/
static int list_add_ptr(list_p list, void* data, dataType_t type, char end) {
static int32_t list_add_ptr(list_p list, void* data, dataType_t type, char end) {
lnode_p node = (lnode_p)malloc(sizeof(struct linked_node));
node->cont = (container_p)malloc(sizeof(container));
@ -199,7 +199,7 @@ static int list_add_ptr(list_p list, void* data, dataType_t type, char end) {
* \param type type of data
* \return Count of elements in list
*/
static int list_append_ptr(list_p list, void* data, dataType_t type) {
static int32_t list_append_ptr(list_p list, void* data, dataType_t type) {
return list_add_ptr(list, data, type, LIST_BACK);
}
@ -212,7 +212,7 @@ static int list_append_ptr(list_p list, void* data, dataType_t type) {
* \param type type of data
* \return Count of elements in list
*/
static int list_prepend_ptr(list_p list, void* data, dataType_t type) {
static int32_t list_prepend_ptr(list_p list, void* data, dataType_t type) {
return list_add_ptr(list, data, type, LIST_FRONT);
}
@ -437,11 +437,11 @@ static void list_remove(list_p list, char end) {
* \param list pointer to a list
* \param idx index of the element to remove
*/
static void list_remove_at(list_p list, int idx) {
static void list_remove_at(list_p list, int32_t idx) {
container_p cont;
list_iter_p iter;
lnode_p target = NULL;
int i;
int32_t i;
if(idx < 0 || idx >= list->length || list->length == 0) {
return;
@ -533,10 +533,10 @@ void destroy_iterator(list_iter_p iter) {
* \param idx index
* \return element at given index or NULL if index is out of bounds
*/
static container_p list_at(list_p list, int idx) {
static container_p list_at(list_p list, int32_t idx) {
list_iter_p iter;
container_p c = NULL;
int i;
int32_t i;
if(idx < 0 || idx >= list->length || list == NULL) {
return NULL;

View File

@ -95,18 +95,18 @@ typedef struct list * list_p;
* Struct describing a list.
*/
struct list{
int length; /*!< count of elements in the list */
int32_t length; /*!< count of elements in the list */
lnode_p first; /*!< first element of the list */
lnode_p last; /*!< last element of the list */
void (*destructor)(void*); /*!< pointer to destructor for data. Default is free. */
list_iter_p (*iterator)(list_p list, char init); /*!< creates a new list iterator */
int (*add_ptr)(list_p list, void* data, dataType_t type, char end); /*!< add a pointer to the list */
int (*append_ptr)(list_p list, void* data, dataType_t type); /*!< append a pointer to the list */
int (*prepend_ptr)(list_p list, void* data, dataType_t type); /*!< prepend a pointer to the list */
int (*add)(list_p list, void* data, dataType_t type, size_t size, char end); /*!< add data to the list */
int (*append)(list_p list, void* data, dataType_t type, size_t size); /*!< append data to the list */
int (*prepend)(list_p list, void* data, dataType_t type, size_t size); /*!< prepend data to the list */
container_p (*at)(list_p list, int idx); /*!< get container at given index */
int32_t (*add_ptr)(list_p list, void* data, dataType_t type, char end); /*!< add a pointer to the list */
int32_t (*append_ptr)(list_p list, void* data, dataType_t type); /*!< append a pointer to the list */
int32_t (*prepend_ptr)(list_p list, void* data, dataType_t type); /*!< prepend a pointer to the list */
int32_t (*add)(list_p list, void* data, dataType_t type, size_t size, char end); /*!< add data to the list */
int32_t (*append)(list_p list, void* data, dataType_t type, size_t size); /*!< append data to the list */
int32_t (*prepend)(list_p list, void* data, dataType_t type, size_t size); /*!< prepend data to the list */
container_p (*at)(list_p list, int32_t idx); /*!< get container at given index */
void (*clear)(list_p list); /*!< clear the list */
container_p (*current)(list_iter_p iter); /*!< get the current element for the iterator */
container_p (*cycl_next)(list_iter_p iter); /*!< get the next element for the iterator (cyclic access) */
@ -118,7 +118,7 @@ struct list{
container_p (*poll)(list_p list); /*<! poll */
container_p (*pop)(list_p list); /*<! pop */
void (*remove)(list_p list, char end); /*!< remove an element from the list */
void (*removeAt)(list_p list, int idx); /*!< remove an element at a specified index */
void (*removeAt)(list_p list, int32_t idx); /*!< remove an element at a specified index */
};
/**

View File

@ -1,13 +1,13 @@
#include "cg_lua.h"
#ifdef CG_LUA
static int Cent_GC(lua_State * L)
static int32_t Cent_GC(lua_State * L)
{
return 0;
}
static int Cent_ToString(lua_State * L)
static int32_t Cent_ToString(lua_State * L)
{
cent_t *cent;
centity_t *ent;
@ -36,7 +36,7 @@ static const luaL_Reg Centity_meta[] = {
ent->timestamp;
}*/
int Luaopen_Cent(lua_State * L)
int32_t Luaopen_Cent(lua_State * L)
{
luaL_newmetatable(L, "cgame.centity");
@ -64,7 +64,7 @@ void Lua_PushCent(lua_State * L, centity_t * ent)
}
}
cent_t *Lua_GetCent(lua_State * L, int argNum)
cent_t *Lua_GetCent(lua_State * L, int32_t argNum)
{
void *ud;

View File

@ -4,13 +4,13 @@
#include "cg_lua.h"
#ifdef CG_LUA
static int Refent_GC(lua_State * L)
static int32_t Refent_GC(lua_State * L)
{
return 0;
}
static int Refent_ToString(lua_State * L)
static int32_t Refent_ToString(lua_State * L)
{
rent_t *rent;
refEntity_t *ent;
@ -24,7 +24,7 @@ static int Refent_ToString(lua_State * L)
return 1;
}
static int Refent_GetRenderfx(lua_State *L) {
static int32_t Refent_GetRenderfx(lua_State *L) {
rent_t *rent;
rent = Lua_GetRent(L, 1);
@ -33,19 +33,19 @@ static int Refent_GetRenderfx(lua_State *L) {
return 1;
}
static int Refent_SetRenderfx(lua_State *L) {
static int32_t Refent_SetRenderfx(lua_State *L) {
rent_t *rent;
int renderfx;
int32_t renderfx;
rent = Lua_GetRent(L, 1);
renderfx = (int)luaL_checknumber(L, 2);
renderfx = (int32_t)luaL_checknumber(L, 2);
rent->r->renderfx = renderfx;
return 1;
}
static int Refent_GetType(lua_State *L) {
static int32_t Refent_GetType(lua_State *L) {
rent_t *rent;
rent = Lua_GetRent(L, 1);
@ -54,12 +54,12 @@ static int Refent_GetType(lua_State *L) {
return 1;
}
static int Refent_SetType(lua_State *L) {
static int32_t Refent_SetType(lua_State *L) {
//rent_t *rent;
refEntityType_t type;
//rent = Lua_GetRent(L, 1);
type = (refEntityType_t)((int)luaL_checknumber(L, 2));
type = (refEntityType_t)((int32_t)luaL_checknumber(L, 2));
if(type < 0 || type >= RT_MAX_REF_ENTITY_TYPE)
return 1;
@ -67,7 +67,7 @@ static int Refent_SetType(lua_State *L) {
return 1;
}
static int Refent_GetHmodel(lua_State *L) {
static int32_t Refent_GetHmodel(lua_State *L) {
rent_t *rent;
rent = Lua_GetRent(L, 1);
@ -76,19 +76,19 @@ static int Refent_GetHmodel(lua_State *L) {
return 1;
}
static int Refent_SetHmodel(lua_State *L) {
static int32_t Refent_SetHmodel(lua_State *L) {
rent_t *rent;
int hmodel;
int32_t hmodel;
rent = Lua_GetRent(L, 1);
hmodel = (int)luaL_checknumber(L, 2);
hmodel = (int32_t)luaL_checknumber(L, 2);
rent->r->hModel = hmodel;
return 1;
}
static int Refent_GetLightingOrigin(lua_State *L) {
static int32_t Refent_GetLightingOrigin(lua_State *L) {
rent_t *rent;
rent = Lua_GetRent(L, 1);
@ -97,7 +97,7 @@ static int Refent_GetLightingOrigin(lua_State *L) {
return 1;
}
static int Refent_SetLightingOrigin(lua_State *L) {
static int32_t Refent_SetLightingOrigin(lua_State *L) {
rent_t *rent;
vec_t *origin;
@ -109,7 +109,7 @@ static int Refent_SetLightingOrigin(lua_State *L) {
return 1;
}
static int Refent_GetShadowPlane(lua_State *L) {
static int32_t Refent_GetShadowPlane(lua_State *L) {
rent_t *rent;
rent = Lua_GetRent(L, 1);
@ -118,7 +118,7 @@ static int Refent_GetShadowPlane(lua_State *L) {
return 1;
}
static int Refent_SetShadowPlane(lua_State *L) {
static int32_t Refent_SetShadowPlane(lua_State *L) {
rent_t *rent;
float sp;
@ -130,7 +130,7 @@ static int Refent_SetShadowPlane(lua_State *L) {
return 1;
}
static int Refent_GetAxis0(lua_State *L) {
static int32_t Refent_GetAxis0(lua_State *L) {
rent_t *rent;
rent = Lua_GetRent(L, 1);
@ -139,7 +139,7 @@ static int Refent_GetAxis0(lua_State *L) {
return 1;
}
static int Refent_SetAxis0(lua_State *L) {
static int32_t Refent_SetAxis0(lua_State *L) {
rent_t *rent;
vec_t *axis;
@ -151,7 +151,7 @@ static int Refent_SetAxis0(lua_State *L) {
return 1;
}
static int Refent_GetAxis1(lua_State *L) {
static int32_t Refent_GetAxis1(lua_State *L) {
rent_t *rent;
rent = Lua_GetRent(L, 1);
@ -160,7 +160,7 @@ static int Refent_GetAxis1(lua_State *L) {
return 1;
}
static int Refent_SetAxis1(lua_State *L) {
static int32_t Refent_SetAxis1(lua_State *L) {
rent_t *rent;
vec_t *axis;
@ -172,7 +172,7 @@ static int Refent_SetAxis1(lua_State *L) {
return 1;
}
static int Refent_GetAxis2(lua_State *L) {
static int32_t Refent_GetAxis2(lua_State *L) {
rent_t *rent;
rent = Lua_GetRent(L, 1);
@ -181,7 +181,7 @@ static int Refent_GetAxis2(lua_State *L) {
return 1;
}
static int Refent_SetAxis2(lua_State *L) {
static int32_t Refent_SetAxis2(lua_State *L) {
rent_t *rent;
vec_t *axis;
@ -193,16 +193,16 @@ static int Refent_SetAxis2(lua_State *L) {
return 1;
}
static int Refent_UseNormAxis(lua_State *L) {
static int32_t Refent_UseNormAxis(lua_State *L) {
rent_t *rent;
rent = Lua_GetRent(L, 1);
lua_pushboolean(L, (int)(!(rent->r->nonNormalizedAxes)));
lua_pushboolean(L, (int32_t)(!(rent->r->nonNormalizedAxes)));
return 1;
}
static int Refent_SetUseNormAxis(lua_State *L) {
static int32_t Refent_SetUseNormAxis(lua_State *L) {
rent_t *rent;
qboolean b;
@ -214,7 +214,7 @@ static int Refent_SetUseNormAxis(lua_State *L) {
return 1;
}
static int Refent_GetOrigin(lua_State *L) {
static int32_t Refent_GetOrigin(lua_State *L) {
rent_t *rent;
rent = Lua_GetRent(L, 1);
@ -223,7 +223,7 @@ static int Refent_GetOrigin(lua_State *L) {
return 1;
}
static int Refent_SetOrigin(lua_State *L) {
static int32_t Refent_SetOrigin(lua_State *L) {
rent_t *rent;
vec_t *origin;
@ -235,7 +235,7 @@ static int Refent_SetOrigin(lua_State *L) {
return 1;
}
static int Refent_GetFrame(lua_State *L) {
static int32_t Refent_GetFrame(lua_State *L) {
rent_t *rent;
rent = Lua_GetRent(L, 1);
@ -244,19 +244,19 @@ static int Refent_GetFrame(lua_State *L) {
return 1;
}
static int Refent_SetFrame(lua_State *L) {
static int32_t Refent_SetFrame(lua_State *L) {
rent_t *rent;
int frame;
int32_t frame;
rent = Lua_GetRent(L, 1);
frame = (int)luaL_checknumber(L, 2);
frame = (int32_t)luaL_checknumber(L, 2);
rent->r->frame = frame;
return 1;
}
static int Refent_GetOldOrigin(lua_State *L) {
static int32_t Refent_GetOldOrigin(lua_State *L) {
rent_t *rent;
rent = Lua_GetRent(L, 1);
@ -265,7 +265,7 @@ static int Refent_GetOldOrigin(lua_State *L) {
return 1;
}
static int Refent_SetOldOrigin(lua_State *L) {
static int32_t Refent_SetOldOrigin(lua_State *L) {
rent_t *rent;
vec_t *vec;
@ -277,7 +277,7 @@ static int Refent_SetOldOrigin(lua_State *L) {
return 1;
}
static int Refent_GetOldFrame(lua_State *L) {
static int32_t Refent_GetOldFrame(lua_State *L) {
rent_t *rent;
rent = Lua_GetRent(L, 1);
@ -286,19 +286,19 @@ static int Refent_GetOldFrame(lua_State *L) {
return 1;
}
static int Refent_SetOldFrame(lua_State *L) {
static int32_t Refent_SetOldFrame(lua_State *L) {
rent_t *rent;
int of;
int32_t of;
rent = Lua_GetRent(L, 1);
of = (int)luaL_checknumber(L, 2);
of = (int32_t)luaL_checknumber(L, 2);
rent->r->oldframe = of;
return 1;
}
static int Refent_GetBacklerp(lua_State *L) {
static int32_t Refent_GetBacklerp(lua_State *L) {
rent_t *rent;
rent = Lua_GetRent(L, 1);
@ -307,7 +307,7 @@ static int Refent_GetBacklerp(lua_State *L) {
return 1;
}
static int Refent_SetBacklerp(lua_State *L) {
static int32_t Refent_SetBacklerp(lua_State *L) {
rent_t *rent;
float bl;
@ -319,7 +319,7 @@ static int Refent_SetBacklerp(lua_State *L) {
return 1;
}
static int Refent_GetSkinNum(lua_State *L) {
static int32_t Refent_GetSkinNum(lua_State *L) {
rent_t *rent;
rent = Lua_GetRent(L, 1);
@ -328,19 +328,19 @@ static int Refent_GetSkinNum(lua_State *L) {
return 1;
}
static int Refent_SetSkinNum(lua_State *L) {
static int32_t Refent_SetSkinNum(lua_State *L) {
rent_t *rent;
int sn;
int32_t sn;
rent = Lua_GetRent(L, 1);
sn = (int)luaL_checknumber(L, 2);
sn = (int32_t)luaL_checknumber(L, 2);
rent->r->skinNum = sn;
return 1;
}
static int Refent_GetCustomSkin(lua_State *L) {
static int32_t Refent_GetCustomSkin(lua_State *L) {
rent_t *rent;
rent = Lua_GetRent(L, 1);
@ -349,19 +349,19 @@ static int Refent_GetCustomSkin(lua_State *L) {
return 1;
}
static int Refent_SetCustomSkin(lua_State *L) {
static int32_t Refent_SetCustomSkin(lua_State *L) {
rent_t *rent;
int cs;
int32_t cs;
rent = Lua_GetRent(L, 1);
cs = (int)luaL_checknumber(L, 2);
cs = (int32_t)luaL_checknumber(L, 2);
rent->r->customSkin = cs;
return 1;
}
static int Refent_GetCustomShader(lua_State *L) {
static int32_t Refent_GetCustomShader(lua_State *L) {
rent_t *rent;
rent = Lua_GetRent(L, 1);
@ -370,12 +370,12 @@ static int Refent_GetCustomShader(lua_State *L) {
return 1;
}
static int Refent_SetCustomShader(lua_State *L) {
static int32_t Refent_SetCustomShader(lua_State *L) {
rent_t *rent;
int cs;
int32_t cs;
rent = Lua_GetRent(L, 1);
cs = (int)luaL_checknumber(L, 2);
cs = (int32_t)luaL_checknumber(L, 2);
rent->r->customShader = cs;
@ -434,7 +434,7 @@ static const luaL_Reg Refentity_meta[] = {
{NULL, NULL}
};
int Luaopen_Rent(lua_State * L)
int32_t Luaopen_Rent(lua_State * L)
{
luaL_newmetatable(L, "cgame.refentity");
@ -462,7 +462,7 @@ void Lua_PushRent(lua_State * L, refEntity_t * rent)
}
}
rent_t *Lua_GetRent(lua_State * L, int argNum)
rent_t *Lua_GetRent(lua_State * L, int32_t argNum)
{
void *ud;

View File

@ -40,7 +40,7 @@ typedef struct {
typedef struct poly_s {
qhandle_t hShader;
int numVerts;
int32_t numVerts;
polyVert_t *verts;
} poly_t;
@ -67,7 +67,7 @@ typedef enum {
typedef struct {
refEntityType_t reType;
int renderfx;
int32_t renderfx;
qhandle_t hModel; // opaque type outside refresh
@ -78,15 +78,15 @@ typedef struct {
vec3_t axis[3]; // rotation vectors
qboolean nonNormalizedAxes; // axis are not normalized, i.e. they have scale
float origin[3]; // also used as MODEL_BEAM's "from"
int frame; // also used as MODEL_BEAM's diameter
int32_t frame; // also used as MODEL_BEAM's diameter
// previous data for frame interpolation
float oldorigin[3]; // also used as MODEL_BEAM's "to"
int oldframe;
int32_t oldframe;
float backlerp; // 0.0 = current, 1.0 = old
// texturing
int skinNum; // inline skin index
int32_t skinNum; // inline skin index
qhandle_t customSkin; // NULL for default skin
qhandle_t customShader; // use one image for the entire thing
@ -142,15 +142,15 @@ typedef struct {
#define MAX_RENDER_STRING_LENGTH 32
typedef struct {
int x, y, width, height;
int32_t x, y, width, height;
float fov_x, fov_y;
vec3_t vieworg;
vec3_t viewaxis[3]; // transformation matrix
// time in milliseconds for shader effects and other time dependent rendering issues
int time;
int32_t time;
int rdflags; // RDF_NOWORLDMODEL, etc
int32_t rdflags; // RDF_NOWORLDMODEL, etc
// 1 bits will prevent the associated area from rendering at all
byte areamask[MAX_MAP_AREA_BYTES];
@ -206,10 +206,10 @@ typedef struct {
char version_string[MAX_STRING_CHARS];
char extensions_string[2*MAX_STRING_CHARS];
int maxTextureSize; // queried from GL
int maxActiveTextures; // multitexture ability
int32_t maxTextureSize; // queried from GL
int32_t maxActiveTextures; // multitexture ability
int colorBits, depthBits, stencilBits;
int32_t colorBits, depthBits, stencilBits;
glDriverType_t driverType;
glHardwareType_t hardwareType;
@ -219,13 +219,13 @@ typedef struct {
qboolean textureEnvAddAvailable;
qboolean textureFilterAnisotropicAvailable;
int vidWidth, vidHeight;
int32_t vidWidth, vidHeight;
// aspect is the screen's physical width / height, which may be different
// than scrWidth / scrHeight if the pixels are non-square
// normal screens should be 4/3, but wide aspect monitors may be 16/9
float windowAspect;
int displayFrequency;
int32_t displayFrequency;
// synonymous with "does rendering consume the entire screen?", therefore
// a Voodoo or Voodoo2 will have this set to TRUE, as will a Win32 ICD that

View File

@ -62,9 +62,9 @@ static void UI_AddBotsMenu_BotEvent( void* ptr, int32_t event ) {
return;
}
addBotsMenuInfo.bots[addBotsMenuInfo.selectedBotNum].color = (double*)colorTable[CT_DKGOLD1];
addBotsMenuInfo.bots[addBotsMenuInfo.selectedBotNum].color = (float*)colorTable[CT_DKGOLD1];
addBotsMenuInfo.selectedBotNum = ((menucommon_s*)ptr)->id - ID_BOTNAME0;
addBotsMenuInfo.bots[addBotsMenuInfo.selectedBotNum].color = (double*)colorTable[CT_YELLOW];
addBotsMenuInfo.bots[addBotsMenuInfo.selectedBotNum].color = (float*)colorTable[CT_YELLOW];
}

View File

@ -1543,8 +1543,8 @@ void UI_AdminMenu( qboolean fromConsole ) {
typedef struct {
int32_t id;
char model[MAX_QPATH];
double height;
double weight;
float height;
float weight;
char race[MAX_NAME_LENGTH];
char age[MAX_NAME_LENGTH];
int32_t classId;

View File

@ -1502,8 +1502,8 @@ void UI_AdminMenu( qboolean fromConsole ) {
typedef struct {
int32_t id;
char model[MAX_QPATH];
double height;
double weight;
float height;
float weight;
char race[MAX_NAME_LENGTH];
char age[MAX_NAME_LENGTH];
int32_t classId;

View File

@ -68,7 +68,7 @@ const char menuEmptyLine[] = " ";
UI_ClampCvar
=================
*/
double UI_ClampCvar( double min, double max, double value )
float UI_ClampCvar( float min, float max, float value )
{
if ( value < min ) return min;
if ( value > max ) return max;
@ -167,7 +167,7 @@ void UI_ForceMenuOff (void)
UI_LerpColor
=================
*/
static void UI_LerpColor(vec4_t a, vec4_t b, vec4_t c, double t)
static void UI_LerpColor(vec4_t a, vec4_t b, vec4_t c, float t)
{
int32_t i;
@ -238,14 +238,14 @@ static void UI_DrawBannerString2( int32_t x, int32_t y, const char* str, vec4_t
{
const char* s;
char ch;
double ax;
double ay;
double aw;
double ah;
double frow;
double fcol;
double fwidth;
double fheight;
float ax;
float ay;
float aw;
float ah;
float frow;
float fcol;
float fwidth;
float fheight;
/* draw the colored text */
trap_R_SetColor( color );
@ -259,18 +259,18 @@ static void UI_DrawBannerString2( int32_t x, int32_t y, const char* str, vec4_t
{
ch = *s & 255;
if ( ch == ' ' ) {
ax += ((double)PROPB_SPACE_WIDTH + (double)PROPB_GAP_WIDTH)* uis.scalex;
ax += ((float)PROPB_SPACE_WIDTH + (float)PROPB_GAP_WIDTH)* uis.scalex;
}
else if ( ch >= 'A' && ch <= 'Z' ) {
ch -= 'A';
fcol = (double)propMapB[(int32_t)ch][0] / 256.0f; /*256.0f*/
frow = (double)propMapB[(int32_t)ch][1] / 256.0f;
fwidth = (double)propMapB[(int32_t)ch][2] / 256.0f;
fheight = (double)PROPB_HEIGHT / 256.0f;
aw = (double)propMapB[(int32_t)ch][2] * uis.scalex;
ah = (double)PROPB_HEIGHT * uis.scaley;
fcol = (float)propMapB[(int32_t)ch][0] / 256.0f; /*256.0f*/
frow = (float)propMapB[(int32_t)ch][1] / 256.0f;
fwidth = (float)propMapB[(int32_t)ch][2] / 256.0f;
fheight = (float)PROPB_HEIGHT / 256.0f;
aw = (float)propMapB[(int32_t)ch][2] * uis.scalex;
ah = (float)PROPB_HEIGHT * uis.scaley;
trap_R_DrawStretchPic( ax, ay, aw, ah, fcol, frow, fcol+fwidth, frow+fheight, uis.charsetPropB );
ax += (aw + (double)PROPB_GAP_WIDTH * uis.scalex);
ax += (aw + (float)PROPB_GAP_WIDTH * uis.scalex);
}
s++;
}
@ -493,15 +493,15 @@ static void UI_DrawProportionalString2( int32_t x, int32_t y, const char* str, v
{
const char* s;
unsigned char ch;
double ax;
double ay,holdY;
double aw;
double ah;
double frow;
double fcol;
double fwidth;
double fheight;
double sizeScale;
float ax;
float ay,holdY;
float aw;
float ah;
float frow;
float fcol;
float fwidth;
float fheight;
float sizeScale;
int32_t colorI;
int32_t special;
@ -543,19 +543,19 @@ static void UI_DrawProportionalString2( int32_t x, int32_t y, const char* str, v
ch = *s & 255;
if ( ch == ' ' ) {
aw = (double)PROP_SPACE_TINY_WIDTH;
aw = (float)PROP_SPACE_TINY_WIDTH;
}
else if ( propMap[ch][2] != -1 ) {
/* Because some foreign characters were a little different */
special = specialTinyPropChars[ch][0];
ay = holdY + (specialTinyPropChars[ch][1] * uis.scaley);
fcol = (double ) propMapTiny[ch][0] / 256.0f; /*256.0f*/
frow = (double)propMapTiny[ch][1] / 256.0f;
fwidth = (double)propMapTiny[ch][2] / 256.0f;
fheight = (double)(PROP_TINY_HEIGHT + special) / 256.0f;
aw = (double)propMapTiny[ch][2] * uis.scalex * sizeScale;
ah = (double)(PROP_TINY_HEIGHT+ special) * uis.scaley * sizeScale;
fcol = (float ) propMapTiny[ch][0] / 256.0f; /*256.0f*/
frow = (float)propMapTiny[ch][1] / 256.0f;
fwidth = (float)propMapTiny[ch][2] / 256.0f;
fheight = (float)(PROP_TINY_HEIGHT + special) / 256.0f;
aw = (float)propMapTiny[ch][2] * uis.scalex * sizeScale;
ah = (float)(PROP_TINY_HEIGHT+ special) * uis.scaley * sizeScale;
/* TiM - adjust for widescreen */
if ( UI_IsWidescreen() )
@ -572,11 +572,11 @@ static void UI_DrawProportionalString2( int32_t x, int32_t y, const char* str, v
}
ax += (aw + (double)PROP_GAP_TINY_WIDTH * uis.scalex * sizeScale);
ax += (aw + (float)PROP_GAP_TINY_WIDTH * uis.scalex * sizeScale);
/* again adjust for widescreen */
if ( UI_IsWidescreen() )
ax -= ((double)PROP_GAP_TINY_WIDTH * uis.scalex * sizeScale)*(1.0f-uis.widescreen.ratio);
ax -= ((float)PROP_GAP_TINY_WIDTH * uis.scalex * sizeScale)*(1.0f-uis.widescreen.ratio);
s++;
}
@ -597,19 +597,19 @@ static void UI_DrawProportionalString2( int32_t x, int32_t y, const char* str, v
ch = *s & 255;
if ( ch == ' ' ) {
aw = (double)PROP_SPACE_BIG_WIDTH * uis.scalex;
aw = (float)PROP_SPACE_BIG_WIDTH * uis.scalex;
}
else if ( propMap[ch][2] != -1 ) {
/* Because some foreign characters were a little different */
special = specialBigPropChars[ch][0];
ay = holdY + (specialBigPropChars[ch][1] * uis.scaley);
fcol = (double ) propMapBig[ch][0] / 256.0f; /* 256.0f */
frow = (double)propMapBig[ch][1] / 256.0f;
fwidth = (double)propMapBig[ch][2] / 256.0f;
fheight = (double)(PROP_BIG_HEIGHT+ special) / 256.0f;
aw = (double)propMapBig[ch][2] * uis.scalex * sizeScale;
ah = (double)(PROP_BIG_HEIGHT+ special) * uis.scaley * sizeScale;
fcol = (float ) propMapBig[ch][0] / 256.0f; /* 256.0f */
frow = (float)propMapBig[ch][1] / 256.0f;
fwidth = (float)propMapBig[ch][2] / 256.0f;
fheight = (float)(PROP_BIG_HEIGHT+ special) / 256.0f;
aw = (float)propMapBig[ch][2] * uis.scalex * sizeScale;
ah = (float)(PROP_BIG_HEIGHT+ special) * uis.scaley * sizeScale;
/* TiM - adjust for widescreen */
if ( UI_IsWidescreen() )
@ -625,11 +625,11 @@ static void UI_DrawProportionalString2( int32_t x, int32_t y, const char* str, v
}
ax += (aw + (double)PROP_GAP_BIG_WIDTH * uis.scalex * sizeScale);
ax += (aw + (float)PROP_GAP_BIG_WIDTH * uis.scalex * sizeScale);
/* again adjust for widescreen */
if ( UI_IsWidescreen() )
ax -= ((double)PROP_GAP_BIG_WIDTH * uis.scalex * sizeScale)*(1.0f-uis.widescreen.ratio);
ax -= ((float)PROP_GAP_BIG_WIDTH * uis.scalex * sizeScale)*(1.0f-uis.widescreen.ratio);
s++;
}
@ -650,19 +650,19 @@ static void UI_DrawProportionalString2( int32_t x, int32_t y, const char* str, v
ch = *s & 255;
if ( ch == ' ' ) {
aw = (double)PROP_SPACE_WIDTH * uis.scalex * sizeScale;
aw = (float)PROP_SPACE_WIDTH * uis.scalex * sizeScale;
}
else if ( propMap[ch][2] != -1 ) {
/* Because some foreign characters were a little different */
special = specialPropChars[ch][0];
ay = holdY + (specialPropChars[ch][1] * uis.scaley);
fcol = (double)propMap[ch][0] / 256.0f;
frow = (double)propMap[ch][1] / 256.0f;
fwidth = (double)propMap[ch][2] / 256.0f;
fheight = (double)(PROP_HEIGHT+ special) / 256.0f;
aw = (double)propMap[ch][2] * uis.scalex * sizeScale;
ah = (double)(PROP_HEIGHT+ special) * uis.scaley * sizeScale;
fcol = (float)propMap[ch][0] / 256.0f;
frow = (float)propMap[ch][1] / 256.0f;
fwidth = (float)propMap[ch][2] / 256.0f;
fheight = (float)(PROP_HEIGHT+ special) / 256.0f;
aw = (float)propMap[ch][2] * uis.scalex * sizeScale;
ah = (float)(PROP_HEIGHT+ special) * uis.scaley * sizeScale;
/* TiM - adjust for widescreen */
if ( ui_handleWidescreen.integer && uis.widescreen.ratio )
@ -678,11 +678,11 @@ static void UI_DrawProportionalString2( int32_t x, int32_t y, const char* str, v
}
ax += (aw + (double)PROP_GAP_WIDTH * uis.scalex * sizeScale);
ax += (aw + (float)PROP_GAP_WIDTH * uis.scalex * sizeScale);
/* again adjust for widescreen */
if ( UI_IsWidescreen() )
ax -= ((double)PROP_GAP_WIDTH * uis.scalex * sizeScale)*(1.0f-uis.widescreen.ratio);
ax -= ((float)PROP_GAP_WIDTH * uis.scalex * sizeScale)*(1.0f-uis.widescreen.ratio);
s++;
}
@ -696,7 +696,7 @@ static void UI_DrawProportionalString2( int32_t x, int32_t y, const char* str, v
UI_ProportionalSizeScale
=================
*/
double UI_ProportionalSizeScale( int32_t style ) {
float UI_ProportionalSizeScale( int32_t style ) {
if( style & UI_SMALLFONT ) {
return PROP_SMALL_SIZE_SCALE;
}
@ -713,7 +713,7 @@ UI_DrawProportionalString
void UI_DrawProportionalString( int32_t x, int32_t y, const char* str, int32_t style, vec4_t color ) {
vec4_t drawcolor;
int32_t width;
double sizeScale;
float sizeScale;
int32_t charstyle=0;
if ((style & UI_BLINK) && ((uis.realtime/BLINK_DIVISOR) & 1))
@ -818,12 +818,12 @@ static void UI_DrawString2( int32_t x, int32_t y, const char* str, vec4_t color,
char ch;
int32_t forceColor = qfalse; /* APSFIXME; */
vec4_t tempcolor;
double ax;
double ay;
double aw;
double ah;
double frow;
double fcol;
float ax;
float ay;
float aw;
float ah;
float frow;
float fcol;
if (y < -charh)
/* offscreen */
@ -900,7 +900,7 @@ void UI_DrawString( int32_t x, int32_t y, const char* str, int32_t style, vec4_t
int32_t charh;
vec4_t newcolor;
vec4_t lowlight;
double *drawcolor;
float *drawcolor;
vec4_t dropcolor;
if( !str ) {
@ -2042,7 +2042,7 @@ UI_AdjustFrom640
Adjusted for resolution and screen aspect ratio
================
*/
void UI_AdjustFrom640( double *x, double *y, double *w, double *h ) {
void UI_AdjustFrom640( float *x, float *y, float *w, float *h ) {
/* expect valid pointers */
/* *x = *x * uis.scale + uis.bias;*/
*x *= uis.scalex;
@ -2062,7 +2062,7 @@ void UI_AdjustFrom640( double *x, double *y, double *w, double *h ) {
}
}
void UI_DrawNamedPic( double x, double y, double width, double height, const char *picname ) {
void UI_DrawNamedPic( float x, float y, float width, float height, const char *picname ) {
qhandle_t hShader;
hShader = trap_R_RegisterShaderNoMip( picname );
@ -2070,16 +2070,16 @@ void UI_DrawNamedPic( double x, double y, double width, double height, const cha
trap_R_DrawStretchPic( x, y, width, height, 0, 0, 1, 1, hShader );
}
void UI_DrawHandleStretchPic( double x, double y, double w, double h, double s0, double t0, double s1, double t1, qhandle_t hShader ) {
void UI_DrawHandleStretchPic( float x, float y, float w, float h, float s0, float t0, float s1, float t1, qhandle_t hShader ) {
UI_AdjustFrom640( &x, &y, &w, &h );
trap_R_DrawStretchPic( x, y, w, h, s0, t0, s1, t1, hShader );
}
void UI_DrawHandlePic( double x, double y, double w, double h, qhandle_t hShader ) {
double s0;
double s1;
double t0;
double t1;
void UI_DrawHandlePic( float x, float y, float w, float h, qhandle_t hShader ) {
float s0;
float s1;
float t0;
float t1;
/* TiM - security check */
if ( w == 0.0f || h == 0.0f )
@ -2116,7 +2116,7 @@ UI_FillRect
Coordinates are 640*480 virtual values
=================
*/
void UI_FillRect( double x, double y, double width, double height, const double *color ) {
void UI_FillRect( float x, float y, float width, float height, const float *color ) {
trap_R_SetColor( color );
UI_AdjustFrom640( &x, &y, &width, &height );
@ -2132,7 +2132,7 @@ UI_DrawRect
Coordinates are 640*480 virtual values
=================
*/
void UI_DrawRect( double x, double y, double width, double height, const double *color ) {
void UI_DrawRect( float x, float y, float width, float height, const float *color ) {
trap_R_SetColor( color );
UI_AdjustFrom640( &x, &y, &width, &height );

View File

@ -129,7 +129,7 @@ static void UI_CDKeyMenu_DrawKey( void *self )
menufield_s *f;
qboolean focus;
int32_t style;
double *color;
float *color;
int32_t x, y;
f = (menufield_s *)self;

View File

@ -38,7 +38,7 @@ void *holdControlPtr;
int32_t holdControlEvent;
static menuaction_s *vid_apply_action;
double setup_menubuttons[8][2] =
float setup_menubuttons[8][2] =
{
{125,62},
{125,86},
@ -278,8 +278,8 @@ typedef struct {
typedef struct
{
char* name;
double defaultvalue;
double value;
float defaultvalue;
float value;
} configcvar_t;
#define SAVE_NOOP 0
@ -748,7 +748,7 @@ Controls_GetCvarDefault
=================
*/
/*
static double Controls_GetCvarDefault( char* name )
static float Controls_GetCvarDefault( char* name )
{
configcvar_t* cvarptr;
int32_t i;
@ -771,7 +771,7 @@ static double Controls_GetCvarDefault( char* name )
Controls_GetCvarValue
=================
*/
static double Controls_GetCvarValue( char* name )
static float Controls_GetCvarValue( char* name )
{
configcvar_t* cvarptr;
int32_t i;

View File

@ -122,7 +122,7 @@ static qhandle_t spaceBackdrop;
int32_t i;
static double cm_buttons[9][2] =
static float cm_buttons[9][2] =
{
{129,62},
{129,86},
@ -711,8 +711,8 @@ static void UI_drawLogo ( void )
refEntity_t ent;
vec3_t origin = {0.0, 0.0, 0.0};
vec3_t angles;
double adjust;
double x, y, w, h;
float adjust;
float x, y, w, h;
//vec4_t color = {0.5, 0, 0, 1};
// setup the refdef
@ -733,7 +733,7 @@ static void UI_drawLogo ( void )
refdef.width = w;
refdef.height = h;
adjust = 0; // JDC: Kenneth asked me to stop this 1.0 * sin( (double)uis.realtime / 1000 );
adjust = 0; // JDC: Kenneth asked me to stop this 1.0 * sin( (float)uis.realtime / 1000 );
refdef.fov_x = 17 + adjust; //60 //TiM: Controls width scale
refdef.fov_y = 19.6875 + adjust; //19.6875
@ -749,7 +749,7 @@ static void UI_drawLogo ( void )
memset( &ent, 0, sizeof(ent) );
adjust = 20.0/300.0 * uis.realtime; //5.0 * sin( (double)uis.realtime / 5000 );
adjust = 20.0/300.0 * uis.realtime; //5.0 * sin( (float)uis.realtime / 5000 );
VectorSet( angles, 0, 180 + adjust, 0 );
AnglesToAxis( angles, ent.axis );
ent.hModel = s_credits.logoModel;

View File

@ -334,7 +334,7 @@ static void UI_InGameMenu_Draw( void )
{
char* playerClass;
char string[256];
double scale;
float scale;
int32_t y=191;
int32_t yOffset = 23;
// char* team;
@ -498,7 +498,7 @@ static void UI_InGameMenu_Draw( void )
//Q_strncpyz( string, string, 25 );
UI_DrawProportionalString( 270, y, string, UI_LEFT|UI_SMALLFONT, colorTable[CT_LTGOLD1]);
scale = trap_Cvar_VariableValue( "height" ) * (double)BASE_HEIGHT;
scale = trap_Cvar_VariableValue( "height" ) * (float)BASE_HEIGHT;
Com_sprintf( string, sizeof(string), "%s: %3.2f%s", menu_normal_text[MNT_HEIGHT], scale, HEIGHT_UNIT );
//Q_strncpyz( string, string, 25 );
@ -509,9 +509,9 @@ static void UI_InGameMenu_Draw( void )
//Q_strncpyz( string, string, 25 );
UI_DrawProportionalString( 270, y, string, UI_LEFT|UI_SMALLFONT, colorTable[CT_LTGOLD1]);
scale = trap_Cvar_VariableValue( "height" ) * trap_Cvar_VariableValue( "weight" ) * (double)BASE_WEIGHT;
scale = trap_Cvar_VariableValue( "height" ) * trap_Cvar_VariableValue( "weight" ) * (float)BASE_WEIGHT;
if ( s_ingame.playerinfo.gender == GENDER_FEMALE )
scale *= (double)FEMALE_OFFSET;
scale *= (float)FEMALE_OFFSET;
Com_sprintf( string, sizeof(string), "%s: %3.2f%s", menu_normal_text[MNT_WEIGHT], scale, WEIGHT_UNIT );
//Q_strncpyz( string, string, 25 );

View File

@ -85,7 +85,7 @@ static struct
static struct
{
menuframework_s menu;
double timer;
float timer;
qhandle_t cornerPic;
// int32_t menuType; // 0 = library, 1 = astrometrics
} s_libraryaccessing;
@ -408,7 +408,7 @@ static void TurnOnLogDesc(char *s,int32_t lineWidth,int32_t startY)
}
static void UI_Draw3DModel( double x, double y, double w, double h, qhandle_t model, vec3_t origin, vec3_t angles)
static void UI_Draw3DModel( float x, float y, float w, float h, qhandle_t model, vec3_t origin, vec3_t angles)
{
refdef_t refdef;
refEntity_t ent;

View File

@ -1522,10 +1522,10 @@ typedef struct
{
menucommon_s generic;
double minvalue;
double maxvalue;
double curvalue;
double defvalue; //RPG-X: TiM | I'm going to make it if u click the button part, it'll reset to this default value
float minvalue;
float maxvalue;
float curvalue;
float defvalue; //RPG-X: TiM | I'm going to make it if u click the button part, it'll reset to this default value
int32_t focusWidth; // For graph
int32_t focusHeight; // For graph
@ -1553,7 +1553,7 @@ typedef struct
int32_t textcolor; // Normal color
int32_t textcolor2; // Highlight color
double range;
float range;
qboolean mouseDown;
} menuslider_s;
@ -1648,7 +1648,7 @@ typedef struct
int32_t width;
int32_t height;
/*@shared@*/ double* focuscolor;
/*@shared@*/ float* focuscolor;
int32_t color; // Normal color
int32_t color2; // Highlight color
@ -1675,8 +1675,8 @@ typedef struct
int32_t normaltextEnum3; // Enum from normal menu text
int32_t buttontextEnum3; // Enum from button text
int32_t style;
/*@shared@*/ double *color; // Normal color
/*@shared@*/ double *color2; // Highlight color
/*@shared@*/ float *color; // Normal color
/*@shared@*/ float *color2; // Highlight color
int32_t focusX;
int32_t focusY;
int32_t focusWidth;
@ -1686,7 +1686,7 @@ typedef struct
typedef struct
{
int32_t type; // STRING or GRAPHIC
double timer; // When it changes
float timer; // When it changes
int32_t x; // X position
int32_t y; // Y positon
int32_t width; // Graphic width
@ -1993,11 +1993,11 @@ typedef struct {
int32_t frame;
int32_t frameTime; // time when ->frame will be exactly on
double backlerp;
float backlerp;
double yawAngle;
float yawAngle;
qboolean yawing;
double pitchAngle;
float pitchAngle;
qboolean pitching;
int32_t animationNumber; // may include ANIM_TOGGLEBIT
@ -2037,8 +2037,8 @@ typedef struct {
gender_t gender;
double height;
double weight;
float height;
float weight;
qhandle_t legsModel;
qhandle_t legsSkin;
@ -2096,7 +2096,7 @@ typedef struct {
qboolean newModel;
qboolean barrelSpinning;
double barrelAngle;
float barrelAngle;
int32_t barrelTime;
//TiM - Just to give this thing a little spice. :)
@ -2109,9 +2109,9 @@ typedef struct {
int32_t realWeapon;
} playerInfo_t;
void UI_DrawPlayer( double x, double y, double w, double h, vec3_t pOrigin, playerInfo_t *pi, int32_t time ); //RPG-X : TiM- origin
void UI_DrawPlayer( float x, float y, float w, float h, vec3_t pOrigin, playerInfo_t *pi, int32_t time ); //RPG-X : TiM- origin
void UI_PlayerInfo_SetModel( playerInfo_t *pi, const char *model );
void UI_PlayerInfo_SetInfo( playerInfo_t *pi, int32_t legsAnim, int32_t torsoAnim, vec3_t viewAngles, vec3_t moveAngles, weapon_t weaponNum, double height, double weight, qboolean chat );
void UI_PlayerInfo_SetInfo( playerInfo_t *pi, int32_t legsAnim, int32_t torsoAnim, vec3_t viewAngles, vec3_t moveAngles, weapon_t weaponNum, float height, float weight, qboolean chat );
qboolean UI_RegisterClientModelname( playerInfo_t *pi, const char *modelSkinName );
//
@ -2161,9 +2161,9 @@ typedef struct {
qhandle_t cursor;
qhandle_t rb_on;
qhandle_t rb_off;
double scalex;
double scaley;
// double bias;
float scalex;
float scaley;
// float bias;
qboolean demoversion;
qboolean firstdraw;
@ -2195,21 +2195,21 @@ extern void UI_KeyEvent( int32_t key );
extern void UI_MouseEvent( int32_t dx, int32_t dy );
extern void UI_Refresh( int32_t realtime );
extern qboolean UI_ConsoleCommand( void );
extern double UI_ClampCvar( double min, double max, double value );
extern void UI_DrawNamedPic( double x, double y, double width, double height, const char *picname );
extern void UI_DrawHandlePic( double x, double y, double w, double h, qhandle_t hShader );
extern void UI_DrawHandleStretchPic( double x, double y, double w, double h, double s0, double t0, double s1, double t1, qhandle_t hShader );
extern void UI_FillRect( double x, double y, double width, double height, const double *color );
extern void UI_DrawRect( double x, double y, double width, double height, const double *color );
//extern void UI_LerpColor(vec4_t a, vec4_t b, vec4_t c, double t);
extern float UI_ClampCvar( float min, float max, float value );
extern void UI_DrawNamedPic( float x, float y, float width, float height, const char *picname );
extern void UI_DrawHandlePic( float x, float y, float w, float h, qhandle_t hShader );
extern void UI_DrawHandleStretchPic( float x, float y, float w, float h, float s0, float t0, float s1, float t1, qhandle_t hShader );
extern void UI_FillRect( float x, float y, float width, float height, const float *color );
extern void UI_DrawRect( float x, float y, float width, float height, const float *color );
//extern void UI_LerpColor(vec4_t a, vec4_t b, vec4_t c, float t);
extern void UI_DrawBannerString( int32_t x, int32_t y, const char* str, int32_t style, vec4_t color );
extern double UI_ProportionalSizeScale( int32_t style );
extern float UI_ProportionalSizeScale( int32_t style );
extern void UI_DrawProportionalString( int32_t x, int32_t y, const char* str, int32_t style, vec4_t color );
extern int32_t UI_ProportionalStringWidth( const char* str,int32_t style );
extern void UI_DrawString( int32_t x, int32_t y, const char* str, int32_t style, vec4_t color, qboolean highRes );
extern void UI_DrawChar( int32_t x, int32_t y, int32_t ch, int32_t style, vec4_t color );
extern qboolean UI_CursorInRect (int32_t x, int32_t y, int32_t width, int32_t height);
extern void UI_AdjustFrom640( double *x, double *y, double *w, double *h );
extern void UI_AdjustFrom640( float *x, float *y, float *w, float *h );
//extern void UI_DrawTextBox (int32_t x, int32_t y, int32_t width, int32_t lines);
extern qboolean UI_IsFullscreen( void );
@ -2272,9 +2272,9 @@ int32_t trap_Milliseconds( void );
void trap_Cvar_Register( vmCvar_t *vmCvar, const char *varName, const char *defaultValue, int32_t flags );
void trap_Cvar_Update( vmCvar_t *vmCvar );
void trap_Cvar_Set( const char *var_name, const char *value );
double trap_Cvar_VariableValue( const char *var_name );
float trap_Cvar_VariableValue( const char *var_name );
void trap_Cvar_VariableStringBuffer( const char *var_name, char *buffer, int32_t bufsize );
void trap_Cvar_SetValue( const char *var_name, double value );
void trap_Cvar_SetValue( const char *var_name, float value );
void trap_Cvar_Reset( const char *name );
void trap_Cvar_Create( const char *var_name, const char *var_value, int32_t flags );
void trap_Cvar_InfoStringBuffer( int32_t bit, char *buffer, int32_t bufsize );
@ -2292,12 +2292,12 @@ qhandle_t trap_R_RegisterShaderNoMip( const char *name );
void trap_R_ClearScene( void );
void trap_R_AddRefEntityToScene( const refEntity_t *re );
void trap_R_AddPolyToScene( qhandle_t hShader , int32_t numVerts, const polyVert_t *verts );
void trap_R_AddLightToScene( const vec3_t org, double intensity, double r, double g, double b );
void trap_R_AddLightToScene( const vec3_t org, float intensity, float r, float g, float b );
void trap_R_RenderScene( const refdef_t *fd );
void trap_R_SetColor( const double *rgba );
void trap_R_DrawStretchPic( double x, double y, double w, double h, double s1, double t1, double s2, double t2, qhandle_t hShader );
void trap_R_SetColor( const float *rgba );
void trap_R_DrawStretchPic( float x, float y, float w, float h, float s1, float t1, float s2, float t2, qhandle_t hShader );
void trap_UpdateScreen( void );
void trap_CM_LerpTag( orientation_t *tag, clipHandle_t mod, int32_t startFrame, int32_t endFrame, double frac, const char *tagName );
void trap_CM_LerpTag( orientation_t *tag, clipHandle_t mod, int32_t startFrame, int32_t endFrame, float frac, const char *tagName );
void trap_S_StartLocalSound( sfxHandle_t sfx, int32_t channelNum );
sfxHandle_t trap_S_RegisterSound( const char *sample );
void trap_Key_KeynumToStringBuf( int32_t keynum, char *buf, int32_t buflen );
@ -2355,7 +2355,7 @@ void UI_DisplayOptionsMenu( void );
//
//void UI_SoundOptionsMenu_Cache( void );
//void UI_SoundOptionsMenu( void );
extern double setup_menubuttons[8][2];
extern float setup_menubuttons[8][2];
void UI_SoundMenu( void);
void UI_SoundMenu_Cache(void);

View File

@ -618,7 +618,7 @@ END MOD
static double mm_buttons[6][2] =
static float mm_buttons[6][2] =
{
{129,62},
{129,86},
@ -628,7 +628,7 @@ static double mm_buttons[6][2] =
{305,109}
};
static double federationTimer;
static float federationTimer;
// Data for Welcome In Menu
static struct
@ -999,8 +999,8 @@ MainArenaServers_Compare
=================
*/
static int32_t QDECL MainArenaServers_Compare( const void *arg1, const void *arg2 ) {
double f1;
double f2;
float f1;
float f2;
table_t* t1;
table_t* t2;
@ -1612,8 +1612,8 @@ Phenix
refEntity_t ent;
vec3_t origin = {0.0, 0.0, 0.0};
vec3_t angles;
double adjust;
double x, y, w, h;
float adjust;
float x, y, w, h;
//vec4_t color = {0.5, 0, 0, 1};
// setup the refdef
@ -1635,7 +1635,7 @@ Phenix
refdef.width = w;
refdef.height = h;
adjust = 0; // JDC: Kenneth asked me to stop this 1.0 * sin( (double)uis.realtime / 1000 );
adjust = 0; // JDC: Kenneth asked me to stop this 1.0 * sin( (float)uis.realtime / 1000 );
refdef.fov_x = 10 + adjust; //60 //TiM: Controls width scale // yeah.... coz it's the FOV lol //17
//that being the case, we have to aim for a value of 10
//(10's what I use in MD3View... anything higher and it starts to distort)
@ -1655,7 +1655,7 @@ Phenix
memset( &ent, 0, sizeof(ent) );
adjust = 20.0/300.0 * uis.realtime; //5.0 * sin( (double)uis.realtime / 5000 );
adjust = 20.0/300.0 * uis.realtime; //5.0 * sin( (float)uis.realtime / 5000 );
VectorSet( angles, 0, 180 + adjust, 0 );
AnglesToAxis( angles, ent.axis );
ent.hModel = s_main.logoModel;
@ -1743,7 +1743,7 @@ static void Player_DrawPlayer( void ) //*self )
vec3_t viewangles;
vec3_t origin = {-3, 5, -3 };//{ 0, 3.8, 0};
char buf[MAX_QPATH];
// double yaw;
// float yaw;
trap_Cvar_VariableStringBuffer( "model", buf, sizeof( buf ) );
@ -1847,7 +1847,7 @@ static weapongraphics_s weapon_graphics[UI_NUM_WEAPONS] = //was WP_NUM_WEAPONS,
};
/*static void UI_Draw3DModel( double x, double y, double w, double h, qhandle_t model, vec3_t origin, vec3_t angles, vec3_t weaponMidpoint ) {
/*static void UI_Draw3DModel( float x, float y, float w, float h, qhandle_t model, vec3_t origin, vec3_t angles, vec3_t weaponMidpoint ) {
refdef_t refdef;
refEntity_t ent;
@ -1954,7 +1954,7 @@ static void M_MainMenu_Graphics (void)
char string[256];
char temp[128];
int32_t i;
double scale;
float scale;
servernode_t* node;
int32_t style;
@ -2109,7 +2109,7 @@ static void M_MainMenu_Graphics (void)
}
UI_DrawProportionalString( 270, y, string, UI_LEFT|UI_SMALLFONT, colorTable[CT_LTGOLD1]);
scale = trap_Cvar_VariableValue( "height" ) * (double)BASE_HEIGHT;
scale = trap_Cvar_VariableValue( "height" ) * (float)BASE_HEIGHT;
Com_sprintf( string, sizeof( string ), "%s: %3.2f%s", menu_normal_text[MNT_HEIGHT], scale, HEIGHT_UNIT );
if ( strlen( string ) > 20 )
@ -2148,9 +2148,9 @@ static void M_MainMenu_Graphics (void)
}
UI_DrawProportionalString( 270, y, string, UI_LEFT|UI_SMALLFONT, colorTable[CT_LTGOLD1]);
scale = trap_Cvar_VariableValue( "height" ) * trap_Cvar_VariableValue( "weight" ) * (double)BASE_WEIGHT;
scale = trap_Cvar_VariableValue( "height" ) * trap_Cvar_VariableValue( "weight" ) * (float)BASE_WEIGHT;
if ( s_main.playerinfo.gender == GENDER_FEMALE )
scale *= (double)FEMALE_OFFSET;
scale *= (float)FEMALE_OFFSET;
Com_sprintf( string, sizeof( string ), "%s: %3.2f%s", menu_normal_text[MNT_WEIGHT], scale, WEIGHT_UNIT );
if ( strlen( string ) > 20 )

View File

@ -1113,7 +1113,7 @@ static void PlayerModel_DrawPlayer( void *self )
return;
}
UI_DrawPlayer( (double)b->generic.x, (double)b->generic.y, (double)b->width, (double)b->height, origin, &s_playermodel.playerinfo, (int32_t)(uis.realtime/1.5) );
UI_DrawPlayer( (float)b->generic.x, (float)b->generic.y, (float)b->width, (float)b->height, origin, &s_playermodel.playerinfo, (int32_t)(uis.realtime/1.5) );
}
/*

View File

@ -22,7 +22,7 @@
static int32_t dp_realtime;
static double jumpHeight;
static float jumpHeight;
//TiM : Bolton Table
stringID_table_t BoltonTable[BOLTON_MAX + 1] =
@ -442,7 +442,7 @@ static void UI_RunLerpFrame( playerInfo_t *ci, lerpFrame_t *lf, int32_t newAnima
if ( lf->frameTime == lf->oldFrameTime ) {
lf->backlerp = 0;
} else {
lf->backlerp = 1.0 - (double)( dp_realtime - lf->oldFrameTime ) / ( lf->frameTime - lf->oldFrameTime );
lf->backlerp = 1.0 - (float)( dp_realtime - lf->oldFrameTime ) / ( lf->frameTime - lf->oldFrameTime );
}
}
@ -452,8 +452,8 @@ static void UI_RunLerpFrame( playerInfo_t *ci, lerpFrame_t *lf, int32_t newAnima
UI_PlayerAnimation
===============
*/
static void UI_PlayerAnimation( playerInfo_t *pi, int32_t *legsOld, int32_t *legs, double *legsBackLerp,
int32_t *torsoOld, int32_t *torso, double *torsoBackLerp ) {
static void UI_PlayerAnimation( playerInfo_t *pi, int32_t *legsOld, int32_t *legs, float *legsBackLerp,
int32_t *torsoOld, int32_t *torso, float *torsoBackLerp ) {
// legs animation
pi->legsAnimationTimer -= uis.frametime;
@ -495,11 +495,11 @@ static void UI_PlayerAnimation( playerInfo_t *pi, int32_t *legsOld, int32_t *leg
UI_SwingAngles
==================
*/
static void UI_SwingAngles( double destination, double swingTolerance, double clampTolerance,
double speed, double *angle, qboolean *swinging ) {
double swing;
double move;
double scale;
static void UI_SwingAngles( float destination, float swingTolerance, float clampTolerance,
float speed, float *angle, qboolean *swinging ) {
float swing;
float move;
float scale;
if ( !*swinging ) {
// see if a swing should be started
@ -557,7 +557,7 @@ static void UI_SwingAngles( double destination, double swingTolerance, double cl
UI_MovedirAdjustment
======================
*/
/*static double UI_MovedirAdjustment( playerInfo_t *pi ) {
/*static float UI_MovedirAdjustment( playerInfo_t *pi ) {
vec3_t relativeAngles;
vec3_t moveVector;
@ -603,7 +603,7 @@ UI_PlayerAngles
*/
static void UI_PlayerAngles( playerInfo_t *pi, vec3_t legs[3], vec3_t torso[3], vec3_t head[3] ) {
vec3_t legsAngles, torsoAngles, headAngles;
double dest;
float dest;
VectorCopy( pi->viewAngles, headAngles );
headAngles[YAW] = AngleMod( headAngles[YAW] );
@ -682,10 +682,10 @@ static void UI_PlayerFloatSprite( playerInfo_t *pi, vec3_t origin, qhandle_t sha
UI_MachinegunSpinAngle
======================
*/
/*double UI_MachinegunSpinAngle( playerInfo_t *pi ) {
/*float UI_MachinegunSpinAngle( playerInfo_t *pi ) {
int32_t delta;
double angle;
double speed;
float angle;
float speed;
int32_t torsoAnim;
delta = dp_realtime - pi->barrelTime;
@ -696,7 +696,7 @@ UI_MachinegunSpinAngle
delta = COAST_TIME;
}
speed = 0.5 * ( SPIN_SPEED + (double)( COAST_TIME - delta ) / COAST_TIME );
speed = 0.5 * ( SPIN_SPEED + (float)( COAST_TIME - delta ) / COAST_TIME );
angle = pi->barrelAngle + delta * speed;
}
@ -719,7 +719,7 @@ UI_MachinegunSpinAngle
UI_DrawPlayer
===============
*/
void UI_DrawPlayer( double x, double y, double w, double h, vec3_t pOrigin, playerInfo_t *pi, int32_t time ) { //RPG-X : TiM- Origin added
void UI_DrawPlayer( float x, float y, float w, float h, vec3_t pOrigin, playerInfo_t *pi, int32_t time ) { //RPG-X : TiM- Origin added
refdef_t refdef;
refEntity_t legs;
refEntity_t torso;
@ -730,8 +730,8 @@ void UI_DrawPlayer( double x, double y, double w, double h, vec3_t pOrigin, play
int32_t renderfx;
vec3_t mins = {-16, -24, -24};
vec3_t maxs = {16, 16, 32};
double len;
double xx;
float len;
float xx;
if ( !pi->legsModel || !pi->torsoModel || !pi->headModel || !pi->animations[0].numFrames ) {
return;
@ -767,7 +767,7 @@ void UI_DrawPlayer( double x, double y, double w, double h, vec3_t pOrigin, play
refdef.width = w;
refdef.height = h;
refdef.fov_x = (int32_t)((double)refdef.width / 640.0f * 10.0f); //RPG-X : TiM- 90.0f //Anyone else noticed how the high FOV value distorted the model horribly in the menus? O_o
refdef.fov_x = (int32_t)((float)refdef.width / 640.0f * 10.0f); //RPG-X : TiM- 90.0f //Anyone else noticed how the high FOV value distorted the model horribly in the menus? O_o
xx = refdef.width / tan( refdef.fov_x / 360 * M_PI );
refdef.fov_y = atan2( refdef.height, xx );
refdef.fov_y *= ( 360 / M_PI );
@ -817,10 +817,10 @@ void UI_DrawPlayer( double x, double y, double w, double h, vec3_t pOrigin, play
UI_ForceTorsoAnim( pi, anim );
//play lower
pi->legsAnimationTimer = pi->animations[ anim ].numFrames * pi->animations[ anim ].frameLerp * ((double)uis.realtime/(double)dp_realtime);
pi->legsAnimationTimer = pi->animations[ anim ].numFrames * pi->animations[ anim ].frameLerp * ((float)uis.realtime/(float)dp_realtime);
pi->lowerEmoting = qtrue;
pi->torsoAnimationTimer = pi->animations[ anim ].numFrames * pi->animations[ anim ].frameLerp * ((double)uis.realtime/(double)dp_realtime);
pi->torsoAnimationTimer = pi->animations[ anim ].numFrames * pi->animations[ anim ].frameLerp * ((float)uis.realtime/(float)dp_realtime);
pi->upperEmoting = qtrue;
pi->nextEmoteTime = uis.realtime + ( irandom( 10, 20 ) * 1000 ) + pi->legsAnimationTimer;
@ -994,7 +994,7 @@ static qboolean UI_ParseAnimationFile( const char *filename, animation_t *animat
int32_t len;
int32_t i;
char *token;
double fps;
float fps;
int32_t skip;
char text[20000];
fileHandle_t f;
@ -1867,7 +1867,7 @@ void UI_PlayerInfo_SetModel( playerInfo_t *pi, const char *model ) {
UI_PlayerInfo_SetInfo
===============
*/
void UI_PlayerInfo_SetInfo( playerInfo_t *pi, int32_t legsAnim, int32_t torsoAnim, vec3_t viewAngles, vec3_t moveAngles, weapon_t weaponNumber, double height, double weight, qboolean chat ) {
void UI_PlayerInfo_SetInfo( playerInfo_t *pi, int32_t legsAnim, int32_t torsoAnim, vec3_t viewAngles, vec3_t moveAngles, weapon_t weaponNumber, float height, float weight, qboolean chat ) {
int32_t currentAnim;
weapon_t weaponNum;

View File

@ -49,8 +49,8 @@ typedef struct {
//char age[36];
//char race[36];
//double height;
//double weight;
//float height;
//float weight;
} initialData_t;
typedef struct {
@ -235,9 +235,9 @@ const char* prank_items_actual3[] =
};*/
/*static double yawDelta3;
static double yaw3 = 180 - 30;
static double placeHolder3 = 180 - 30;*/
/*static float yawDelta3;
static float yaw3 = 180 - 30;
static float placeHolder3 = 180 - 30;*/
/*
=======================
@ -467,7 +467,7 @@ static void PlayerSettings_DrawPlayer( void *self )
UI_PlayerInfo_SetInfo( &s_playersettings.playerinfo, BOTH_WALK1, BOTH_WALK1, viewangles, vec3_origin, WP_0, s_playersettings.height.curvalue, s_playersettings.weight.curvalue, qfalse );
b = (menubitmap_s*) self;
UI_DrawPlayer( (double)b->generic.x, (double)b->generic.y, (double)b->width, (double)b->height, origin, &s_playersettings.playerinfo, (int32_t)(uis.realtime/1.5) );
UI_DrawPlayer( (float)b->generic.x, (float)b->generic.y, (float)b->width, (float)b->height, origin, &s_playersettings.playerinfo, (int32_t)(uis.realtime/1.5) );
/*if ( uis.spinView == qtrue && !trap_Key_IsDown( K_MOUSE1 )) {
uis.spinView = qfalse;
@ -658,7 +658,7 @@ static void PlayerSettings_SetMenuItems( void )
//Player Height
{
double height = trap_Cvar_VariableValue( "height" );
float height = trap_Cvar_VariableValue( "height" );
//If height was defined, but filled with no value
//We don't want infinitely flat players rofl
@ -672,7 +672,7 @@ static void PlayerSettings_SetMenuItems( void )
//Player Weight
{
double weight = trap_Cvar_VariableValue( "weight" );
float weight = trap_Cvar_VariableValue( "weight" );
//If height was defined, but filled with no value
//We don't want infinitely thin players rofl
@ -905,13 +905,13 @@ void PlayerSettingsMenu_Graphics (void)
//TiM - Player weight and height parameters
{
double ht = s_playersettings.height.curvalue * (double)BASE_HEIGHT;
double wt = s_playersettings.weight.curvalue * s_playersettings.height.curvalue * (double)BASE_WEIGHT;
float ht = s_playersettings.height.curvalue * (float)BASE_HEIGHT;
float wt = s_playersettings.weight.curvalue * s_playersettings.height.curvalue * (float)BASE_WEIGHT;
char htStr[12];
char wtStr[12];
if ( s_playersettings.playerinfo.gender == GENDER_FEMALE )
wt *= (double)FEMALE_OFFSET;
wt *= (float)FEMALE_OFFSET;
Com_sprintf( htStr, sizeof(htStr), "%4.2f%s", ht, HEIGHT_UNIT );
Com_sprintf( wtStr, sizeof(wtStr), "%4.2f%s", wt, WEIGHT_UNIT );

View File

@ -256,7 +256,7 @@ Crosshair_Draw
/*
static void Crosshair_Draw( void *self ) {
menulist_s *s;
double *color;
float *color;
int32_t x, y;
int32_t style;
qboolean focus;

View File

@ -255,7 +255,7 @@ static void Text_Draw(menuframework_s *menu, menutext_s *t )
char buff[512];
char buff2[512];
char buff3[512];
double *color;
float *color;
x = t->generic.x;
y = t->generic.y;
@ -387,7 +387,7 @@ static void BText_Draw( menutext_s *t )
{
int32_t x;
int32_t y;
double* color;
float* color;
x = t->generic.x;
y = t->generic.y;
@ -411,7 +411,7 @@ static void PText_Init( menutext_s *t )
int32_t y;
int32_t w;
int32_t h;
double sizeScale;
float sizeScale;
sizeScale = UI_ProportionalSizeScale( t->style );
@ -442,7 +442,7 @@ static void PText_Draw( menutext_s *t )
{
int32_t x;
int32_t y;
double * color;
float * color;
int32_t style;
x = t->generic.x;
@ -519,12 +519,12 @@ Bitmap_Draw
*/
void Bitmap_Draw( menubitmap_s *b )
{
double x;
double y;
double w;
double h;
float x;
float y;
float w;
float h;
vec4_t tempcolor;
double* color;
float* color;
char highlight;
int32_t textStyle;
menuframework_s *menu;
@ -741,7 +741,7 @@ static void Action_Draw( menuaction_s *a )
{
int32_t x, y;
int32_t style;
// double* color;
// float* color;
int32_t textColor,buttonColor;
style = 0;
@ -884,7 +884,7 @@ static void RadioButton_Draw( menuradiobutton_s *rb )
{
int32_t x;
int32_t y;
double *color;
float *color;
int32_t style;
qboolean focus;
@ -986,7 +986,7 @@ static sfxHandle_t Slider_Key( menuslider_s *s, int32_t key )
case K_MOUSE1:
x = uis.cursorx - s->generic.x;
oldvalue = s->curvalue;
s->curvalue = (x/(double)(s->focusWidth)) * (s->maxvalue-s->minvalue) + s->minvalue;
s->curvalue = (x/(float)(s->focusWidth)) * (s->maxvalue-s->minvalue) + s->minvalue;
//TiM | If a default was set, reset it in this case
if ( x < 0 && s->defvalue ) {
@ -1083,7 +1083,7 @@ static void Slider_Draw( menuslider_s *s )
}
if ( s->mouseDown ) {
s->curvalue = ((uis.cursorx - s->generic.x)/(double)(s->focusWidth)) * (s->maxvalue-s->minvalue) + s->minvalue;
s->curvalue = ((uis.cursorx - s->generic.x)/(float)(s->focusWidth)) * (s->maxvalue-s->minvalue) + s->minvalue;
s->curvalue = Com_Clamp( s->minvalue, s->maxvalue, s->curvalue);
s->generic.parent->noNewSelecting = qtrue;
@ -1111,7 +1111,7 @@ static void Slider_Draw( menuslider_s *s )
// clamp thumb
if (s->maxvalue > s->minvalue)
{
s->range = ( s->curvalue - s->minvalue ) / ( double ) ( s->maxvalue - s->minvalue );
s->range = ( s->curvalue - s->minvalue ) / ( float ) ( s->maxvalue - s->minvalue );
if ( s->range < 0)
{
s->range = 0;
@ -1155,7 +1155,7 @@ Slider_Draw
*/
static void Slider_Draw( menuslider_s *s )
{
double *color;
float *color;
int32_t style;
int32_t i;
int32_t x;
@ -1200,7 +1200,7 @@ static void Slider_Draw( menuslider_s *s )
// clamp thumb
if (s->maxvalue > s->minvalue)
{
s->range = ( s->curvalue - s->minvalue ) / ( double ) ( s->maxvalue - s->minvalue );
s->range = ( s->curvalue - s->minvalue ) / ( float ) ( s->maxvalue - s->minvalue );
if ( s->range < 0)
s->range = 0;
else if ( s->range > 1)
@ -1324,7 +1324,7 @@ static sfxHandle_t SpinControl_InitListRender( menulist_s* s ) {
//MIGHTNEEDFIXME: UI_RIGHT...? Eh, If I need it, I'll come back here hehe
//If we can, cause it's cool, move the list up 1/3 of it's height
heightOffset = (double)( s->drawList.down - s->drawList.up ) * (double)0.33;
heightOffset = (float)( s->drawList.down - s->drawList.up ) * (float)0.33;
s->drawList.up -= heightOffset;
s->drawList.down -= heightOffset;
@ -1981,7 +1981,7 @@ void ScrollList_Draw( menulist_s *l )
int32_t i;
int32_t base;
int32_t column;
double* color;
float* color;
qboolean hasfocus;
int32_t style;

View File

@ -163,7 +163,7 @@ static int32_t noyes_items[] =
0
};
static double server_buttons[5][2] =
static float server_buttons[5][2] =
{
{274, 72}, // Server type
{274, 92}, // Sort by
@ -314,8 +314,8 @@ ArenaServers_Compare
=================
*/
static int32_t QDECL ArenaServers_Compare( const void *arg1, const void *arg2 ) {
double f1;
double f2;
float f1;
float f2;
servernode_t* t1;
servernode_t* t2;

View File

@ -136,7 +136,7 @@ void UI_ResetMenu(void) {
trap_GetClientState( &cstate );
if ( cstate.connState >= CA_CONNECTED ) {
// double on top of running game
// float on top of running game
s_reset.menu.fullscreen = qfalse;
}
else {

View File

@ -70,7 +70,7 @@ M_sqlMenu_Graphics
*/
static void M_sqlMenu_Graphics (void)
{
double bg[] = { 0, 0, 0, 0.7 };
float bg[] = { 0, 0, 0, 0.7 };
trap_R_SetColor(bg);
UI_DrawHandlePic(160, 120, 320, 240, box_rounded);

View File

@ -2126,7 +2126,7 @@ PlayerName_Draw
static void PlayerName_Draw( void *item )
{
menutext_s *s;
double *color;
float *color;
int32_t x, y;
int32_t style;
qboolean focus;
@ -3342,7 +3342,7 @@ AdvancedServer_Update
static void AdvancedServer_Update( void)
{
int32_t holdInt;
double holdFloat;
float holdFloat;
// Set colors to normal
s_advancedserver.repawntime.field.titlecolor = CT_DKGOLD1;
@ -4352,7 +4352,7 @@ static void UI_AdvancedServerMenu_Init(int32_t fromMenu)
Com_sprintf( s_advancedserver.runspeed.field.buffer, 5, "%i", (int32_t)Com_Clamp( 150, 1000, trap_Cvar_VariableValue( "g_speed" ) ) );
Com_sprintf( s_advancedserver.gravity.field.buffer, 5, "%i", (int32_t)Com_Clamp( 0, 5000, trap_Cvar_VariableValue( "g_gravity" ) ) );
Com_sprintf( s_advancedserver.knockback.field.buffer, 6, "%i", (int32_t)Com_Clamp( 0, 10000, trap_Cvar_VariableValue( "g_knockback" ) ) );
Com_sprintf( s_advancedserver.dmgmult.field.buffer, 12, "%f", (double)Com_Clamp( 0.0, 100.0, trap_Cvar_VariableValue( "g_dmgmult" ) ) );
Com_sprintf( s_advancedserver.dmgmult.field.buffer, 12, "%f", (float)Com_Clamp( 0.0, 100.0, trap_Cvar_VariableValue( "g_dmgmult" ) ) );
Com_sprintf( s_advancedserver.bot_minplayers.field.buffer, 3, "%i", (int32_t)Com_Clamp( 0, 64, trap_Cvar_VariableValue( "bot_minplayers" ) ) );
Com_sprintf( s_advancedserver.forceplayerrespawn.field.buffer, 3, "%i", (int32_t)Com_Clamp( 0, 120, trap_Cvar_VariableValue( "g_forcerespawn" ) ) );
Com_sprintf( s_advancedserver.respawninvulnerability.field.buffer, 3, "%i", (int32_t)Com_Clamp( 0, 30, trap_Cvar_VariableValue( "g_ghostRespawn" ) ) );

View File

@ -20,7 +20,7 @@ void dllEntry( int32_t (QDECL *syscallptr)( int32_t arg,... ) ) {
syscall = syscallptr;
}*/
int32_t PASSFLOAT( double x ) {
int32_t PASSFLOAT( float x ) {
int32_t floatTemp;
floatTemp = x;
return floatTemp;
@ -50,8 +50,8 @@ void trap_Cvar_Set( const char *var_name, const char *value ) {
syscall( UI_CVAR_SET, var_name, value );
}
double trap_Cvar_VariableValue( const char *var_name ) {
double temp;
float trap_Cvar_VariableValue( const char *var_name ) {
float temp;
temp = syscall( UI_CVAR_VARIABLEVALUE, var_name );
return temp;
}
@ -60,7 +60,7 @@ void trap_Cvar_VariableStringBuffer( const char *var_name, char *buffer, int32_t
syscall( UI_CVAR_VARIABLESTRINGBUFFER, var_name, buffer, bufsize );
}
void trap_Cvar_SetValue( const char *var_name, double value ) {
void trap_Cvar_SetValue( const char *var_name, float value ) {
syscall( UI_CVAR_SETVALUE, var_name, PASSFLOAT( value ) );
}
@ -132,7 +132,7 @@ void trap_R_AddPolyToScene( qhandle_t hShader , int32_t numVerts, const polyVert
syscall( UI_R_ADDPOLYTOSCENE, hShader, numVerts, verts );
}
void trap_R_AddLightToScene( const vec3_t org, double intensity, double r, double g, double b ) {
void trap_R_AddLightToScene( const vec3_t org, float intensity, float r, float g, float b ) {
syscall( UI_R_ADDLIGHTTOSCENE, org, PASSFLOAT(intensity), PASSFLOAT(r), PASSFLOAT(g), PASSFLOAT(b) );
}
@ -140,11 +140,11 @@ void trap_R_RenderScene( const refdef_t *fd ) {
syscall( UI_R_RENDERSCENE, fd );
}
void trap_R_SetColor( const double *rgba ) {
void trap_R_SetColor( const float *rgba ) {
syscall( UI_R_SETCOLOR, rgba );
}
void trap_R_DrawStretchPic( double x, double y, double w, double h, double s1, double t1, double s2, double t2, qhandle_t hShader ) {
void trap_R_DrawStretchPic( float x, float y, float w, float h, float s1, float t1, float s2, float t2, qhandle_t hShader ) {
syscall( UI_R_DRAWSTRETCHPIC, PASSFLOAT(x), PASSFLOAT(y), PASSFLOAT(w), PASSFLOAT(h), PASSFLOAT(s1), PASSFLOAT(t1), PASSFLOAT(s2), PASSFLOAT(t2), hShader );
}
@ -152,7 +152,7 @@ void trap_UpdateScreen( void ) {
syscall( UI_UPDATESCREEN );
}
void trap_CM_LerpTag( orientation_t *tag, clipHandle_t mod, int32_t startFrame, int32_t endFrame, double frac, const char *tagName ) {
void trap_CM_LerpTag( orientation_t *tag, clipHandle_t mod, int32_t startFrame, int32_t endFrame, float frac, const char *tagName ) {
syscall( UI_CM_LERPTAG, tag, mod, startFrame, endFrame, PASSFLOAT(frac), tagName );
}

View File

@ -231,7 +231,7 @@ static void UI_TeamOrdersMenu_ListDraw( void *self ) {
int32_t x;
int32_t y;
int32_t i;
double *color;
float *color;
qboolean hasfocus;
int32_t style;

View File

@ -1849,8 +1849,8 @@ M_VideoDriverMenu_Graphics
*/
void M_VideoDriverMenu_Graphics (void)
{
double labelColor[] = { 0, 1.0, 0, 1.0 };
double textColor[] = { 1, 1, 1, 1 };
float labelColor[] = { 0, 1.0, 0, 1.0 };
float textColor[] = { 1, 1, 1, 1 };
int32_t x,y,x2;
UI_MenuFrame(&s_videodriver.menu);