- ioquake3 resync to revision 2105 from 2098.

This commit is contained in:
zturtleman 2011-07-29 17:52:36 +00:00
parent 74fd246b05
commit 477584906e
103 changed files with 710 additions and 806 deletions

View file

@ -50,7 +50,7 @@ ifneq ($(PLATFORM),darwin)
endif
# ioquake3 svn version that this is based on
IOQ3_REVISION = 2098
IOQ3_REVISION = 2105
#############################################################################
#

View file

@ -120,8 +120,6 @@ New cvars
cl_mouseAccelStyle - Set to 1 for QuakeLive mouse acceleration
behaviour, 0 for standard q3
cl_mouseAccelOffset - Tuning the acceleration curve, see below
cl_gamename - Gamename sent to master server in
getserversExt query
in_joystickUseAnalog - Do not translate joystick axis events
to keyboard commands
@ -197,6 +195,10 @@ New cvars
through which other processes can control
the server while it is running.
Nonfunctional on Windows.
com_gamename - Gamename sent to master server in
getservers[Ext] query and infoResponse
"gamename" infostring value. Also used
for filtering local network games.
com_protocol - Specify protocol version number for
current ioquake3 protocol, see
"Network protocols" section below
@ -210,9 +212,6 @@ New cvars
holds custom pk3 files for your server
sv_banFile - Name of the file that is used for storing
the server bans
sv_heartbeat - Heartbeat string sent to master server
sv_flatline - Heartbeat string sent to master server
when server is killed
net_ip6 - IPv6 address to bind to
net_port6 - port to bind to using the ipv6 address
@ -527,25 +526,18 @@ Creating standalone games
+set com_homepath <homedirname>
to the command line. You can also control which kind of messages to send to
the master server:
to the command line. You can also control which game name to use when talking
to the master server:
+set sv_heartbeat <heartbeat> +set sv_flatline <flatline>
+set cl_gamename <gamename>
+set com_gamename <gamename>
The <heartbeat> and <flatline> message can be specific to your game. The
flatline message is sent to signal the master server that the game server is
quitting. Vanilla quake3 uses "QuakeArena-1" both for the heartbeat and
flatline messages.
The cl_gamename message is for dpmaster to specify which game the client
wants a server list for. It is only used in the new ipv6 based getServersExt
query.
So clients requesting a server list will only receive servers that have a
matching game name.
Example line:
+set com_basegame basefoo +set com_homepath .foo
+set sv_heartbeat fooalive +set sv_flatline foodead
+set cl_gamename foo
+set com_gamename foo
If you really changed parts that would make vanilla ioquake3 incompatible with

View file

@ -811,7 +811,7 @@ int AAS_CheckAreaForPossiblePortals(int areanum)
//
Com_Memset(numareafrontfaces, 0, sizeof(numareafrontfaces));
Com_Memset(numareabackfaces, 0, sizeof(numareabackfaces));
numareas = numfrontfaces = numbackfaces = 0;
numfrontfaces = numbackfaces = 0;
numfrontareas = numbackareas = 0;
frontplanenum = backplanenum = -1;
//add any adjacent areas with less presence types

View file

@ -29,14 +29,11 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*
*****************************************************************************/
#include "../qcommon/q_shared.h"
//debugging on
#define AAS_DEBUG
#define MAX_CLIENTS 64
#define MAX_MODELS 256 // these are sent over the net as 8 bits
#define MAX_SOUNDS 256 // so they cannot be blindly increased
#define MAX_CONFIGSTRINGS 1024
#define CS_SCORES 32
#define CS_MODELS (CS_SCORES+MAX_CLIENTS)
#define CS_SOUNDS (CS_MODELS+MAX_MODELS)

View file

@ -382,18 +382,6 @@ void AAS_Accelerate(vec3_t velocity, float frametime, vec3_t wishdir, float wish
}
} //end of the function AAS_Accelerate
//===========================================================================
//
// Parameter: -
// Returns: -
// Changes Globals: -
//===========================================================================
void AAS_AirControl(vec3_t start, vec3_t end, vec3_t velocity, vec3_t cmdmove)
{
vec3_t dir;
VectorSubtract(end, start, dir);
} //end of the function AAS_AirControl
//===========================================================================
// applies ground friction to the given velocity
//
// Parameter: -
@ -518,7 +506,8 @@ int AAS_ClientMovementPrediction(struct aas_clientmove_s *move,
float phys_maxstep, phys_maxsteepness, phys_jumpvel, friction;
float gravity, delta, maxvel, wishspeed, accelerate;
//float velchange, newvel;
int n, i, j, pc, step, swimming, ax, crouch, event, jump_frame, areanum;
//int ax;
int n, i, j, pc, step, swimming, crouch, event, jump_frame, areanum;
int areas[20], numareas;
vec3_t points[20];
vec3_t org, end, feet, start, stepend, lastorg, wishdir;
@ -574,7 +563,7 @@ int AAS_ClientMovementPrediction(struct aas_clientmove_s *move,
//apply command movement
if (n < cmdframes)
{
ax = 0;
//ax = 0;
maxvel = phys_maxwalkvelocity;
accelerate = phys_airaccelerate;
VectorCopy(cmdmove, wishdir);
@ -598,13 +587,13 @@ int AAS_ClientMovementPrediction(struct aas_clientmove_s *move,
{
accelerate = phys_walkaccelerate;
} //end else
ax = 2;
//ax = 2;
} //end if
if (swimming)
{
maxvel = phys_maxswimvelocity;
accelerate = phys_swimaccelerate;
ax = 3;
//ax = 3;
} //end if
else
{

View file

@ -289,7 +289,7 @@ int AAS_GetJumpPadInfo(int ent, vec3_t areastart, vec3_t absmins, vec3_t absmaxs
//===========================================================================
int AAS_BestReachableFromJumpPadArea(vec3_t origin, vec3_t mins, vec3_t maxs)
{
int area2num, ent, bot_visualizejumppads, bestareanum;
int ent, bot_visualizejumppads, bestareanum;
float volume, bestareavolume;
vec3_t areastart, cmdmove, bboxmins, bboxmaxs;
vec3_t absmins, absmaxs, velocity;
@ -327,7 +327,6 @@ int AAS_BestReachableFromJumpPadArea(vec3_t origin, vec3_t mins, vec3_t maxs)
//
VectorSet(cmdmove, 0, 0, 0);
Com_Memset(&move, 0, sizeof(aas_clientmove_t));
area2num = 0;
AAS_ClientMovementHitBBox(&move, -1, areastart, PRESENCE_NORMAL, qfalse,
velocity, cmdmove, 0, 30, 0.1f, bboxmins, bboxmaxs, bot_visualizejumppads);
if (move.frames < 30)
@ -837,7 +836,6 @@ int AAS_Reachability_Swim(int area1num, int area2num)
{
int i, j, face1num, face2num, side1;
aas_area_t *area1, *area2;
aas_areasettings_t *areasettings;
aas_lreachability_t *lreach;
aas_face_t *face1;
aas_plane_t *plane;
@ -875,7 +873,6 @@ int AAS_Reachability_Swim(int area1num, int area2num)
{
//
face1 = &aasworld.faces[face1num];
areasettings = &aasworld.areasettings[area1num];
//create a new reachability link
lreach = AAS_AllocReachability();
if (!lreach) return qfalse;
@ -1062,7 +1059,8 @@ int AAS_Reachability_Step_Barrier_WaterJump_WalkOffLedge(int area1num, int area2
int ground_bestarea2groundedgenum, ground_foundreach;
int water_bestarea2groundedgenum, water_foundreach;
int side1, area1swim, faceside1, groundface1num;
float dist, dist1, dist2, diff, invgravitydot, ortdot;
float dist, dist1, dist2, diff, ortdot;
//float invgravitydot;
float x1, x2, x3, x4, y1, y2, y3, y4, tmp, y;
float length, ground_bestlength, water_bestlength, ground_bestdist, water_bestdist;
vec3_t v1, v2, v3, v4, tmpv, p1area1, p1area2, p2area1, p2area2;
@ -1073,7 +1071,7 @@ int AAS_Reachability_Step_Barrier_WaterJump_WalkOffLedge(int area1num, int area2
vec3_t testpoint;
aas_plane_t *plane;
aas_area_t *area1, *area2;
aas_face_t *groundface1, *groundface2, *ground_bestface1, *water_bestface1;
aas_face_t *groundface1, *groundface2;
aas_edge_t *edge1, *edge2;
aas_lreachability_t *lreach;
aas_trace_t trace;
@ -1172,7 +1170,7 @@ int AAS_Reachability_Step_Barrier_WaterJump_WalkOffLedge(int area1num, int area2
//edges if they overlap in the direction orthogonal to
//the gravity direction
CrossProduct(invgravity, normal, ort);
invgravitydot = DotProduct(invgravity, invgravity);
//invgravitydot = DotProduct(invgravity, invgravity);
ortdot = DotProduct(ort, ort);
//projection into the step plane
//NOTE: since gravity is vertical this is just the z coordinate
@ -1302,7 +1300,6 @@ int AAS_Reachability_Step_Barrier_WaterJump_WalkOffLedge(int area1num, int area2
ground_bestlength = length;
ground_foundreach = qtrue;
ground_bestarea2groundedgenum = edge1num;
ground_bestface1 = groundface1;
//best point towards area1
VectorCopy(start, ground_beststart);
//normal is pointing into area2
@ -1323,7 +1320,6 @@ int AAS_Reachability_Step_Barrier_WaterJump_WalkOffLedge(int area1num, int area2
water_bestlength = length;
water_foundreach = qtrue;
water_bestarea2groundedgenum = edge1num;
water_bestface1 = groundface1;
//best point towards area1
VectorCopy(start, water_beststart);
//normal is pointing into area2
@ -2852,9 +2848,9 @@ void AAS_Reachability_Teleport(void)
botimport.Print(PRT_ERROR, "teleporter destination (%s) in solid\n", target);
continue;
} //end if
/*
area2num = AAS_PointAreaNum(trace.endpos);
//
/*
if (!AAS_AreaTeleporter(area2num) &&
!AAS_AreaJumpPad(area2num) &&
!AAS_AreaGrounded(area2num))
@ -3396,7 +3392,6 @@ void AAS_Reachability_FuncBobbing(void)
//
for (i = 0; i < 2; i++)
{
firststartreach = firstendreach = NULL;
//
if (i == 0)
{
@ -3492,7 +3487,8 @@ void AAS_Reachability_JumpPad(void)
int face2num, i, ret, area2num, visualize, ent, bot_visualizejumppads;
//int modelnum, ent2;
//float dist, time, height, gravity, forward;
float speed, zvel, hordist;
float speed, zvel;
//float hordist;
aas_face_t *face2;
aas_area_t *area2;
aas_lreachability_t *lreach;
@ -3714,7 +3710,7 @@ void AAS_Reachability_JumpPad(void)
//direction towards the face center
VectorSubtract(facecenter, areastart, dir);
dir[2] = 0;
hordist = VectorNormalize(dir);
//hordist = VectorNormalize(dir);
//if (hordist < 1.6 * facecenter[2] - areastart[2])
{
//get command movement
@ -3997,7 +3993,8 @@ void AAS_SetWeaponJumpAreaFlags(void)
int AAS_Reachability_WeaponJump(int area1num, int area2num)
{
int face2num, i, n, ret, visualize;
float speed, zvel, hordist;
float speed, zvel;
//float hordist;
aas_face_t *face2;
aas_area_t *area1, *area2;
aas_lreachability_t *lreach;
@ -4057,7 +4054,7 @@ int AAS_Reachability_WeaponJump(int area1num, int area2num)
//direction towards the face center
VectorSubtract(facecenter, areastart, dir);
dir[2] = 0;
hordist = VectorNormalize(dir);
//hordist = VectorNormalize(dir);
//if (hordist < 1.6 * (facecenter[2] - areastart[2]))
{
//get command movement

View file

@ -506,9 +506,11 @@ void AAS_CalculateAreaTravelTimes(void)
aas_reversedlink_t *revlink;
aas_reachability_t *reach;
aas_areasettings_t *settings;
#ifdef DEBUG
int starttime;
starttime = Sys_MilliSeconds();
#endif
//if there are still area travel times, free the memory
if (aasworld.areatraveltimes) FreeMemory(aasworld.areatraveltimes);
//get the total size of all the area travel times
@ -887,7 +889,8 @@ void AAS_InitRoutingUpdate(void)
//===========================================================================
void AAS_CreateAllRoutingCache(void)
{
int i, j, t;
int i, j;
//int t;
aasworld.initialized = qtrue;
botimport.Print(PRT_MESSAGE, "AAS_CreateAllRoutingCache\n");
@ -898,7 +901,8 @@ void AAS_CreateAllRoutingCache(void)
{
if (i == j) continue;
if (!AAS_AreaReachability(j)) continue;
t = AAS_AreaTravelTimeToGoalArea(i, aasworld.areas[i].center, j, TFL_DEFAULT);
AAS_AreaTravelTimeToGoalArea(i, aasworld.areas[i].center, j, TFL_DEFAULT);
//t = AAS_AreaTravelTimeToGoalArea(i, aasworld.areas[i].center, j, TFL_DEFAULT);
//Log_Write("traveltime from %d to %d is %d", i, j, t);
} //end for
} //end for

View file

@ -844,7 +844,6 @@ void BotReplaceReplySynonyms(char *string, unsigned long int context)
if (!(syn->context & context)) continue;
for (synonym = syn->firstsynonym->next; synonym; synonym = synonym->next)
{
str2 = synonym->string;
//if the synonym is not at the front of the string continue
str2 = StringContainsWord(str1, synonym->string, qfalse);
if (!str2 || str2 != str1) continue;
@ -2939,7 +2938,6 @@ int BotAllocChatState(void)
//========================================================================
void BotFreeChatState(int handle)
{
bot_chatstate_t *cs;
bot_consolemessage_t m;
int h;
@ -2953,7 +2951,6 @@ void BotFreeChatState(int handle)
botimport.Print(PRT_FATAL, "invalid chat state %d\n", handle);
return;
} //end if
cs = botchatstates[handle];
if (LibVarGetValue("bot_reloadcharacters"))
{
BotFreeChatFile(handle);

View file

@ -51,7 +51,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
//===========================================================================
int GeneticSelection(int numranks, float *rankings)
{
float sum, select;
float sum;
int i, index;
sum = 0;
@ -64,7 +64,7 @@ int GeneticSelection(int numranks, float *rankings)
{
//select a bot where the ones with the higest rankings have
//the highest chance of being selected
select = random() * sum;
//sum *= random();
for (i = 0; i < numranks; i++)
{
if (rankings[i] < 0) continue;

View file

@ -238,9 +238,9 @@ void BotInterbreedGoalFuzzyLogic(int parent1, int parent2, int child)
//===========================================================================
void BotSaveGoalFuzzyLogic(int goalstate, char *filename)
{
bot_goalstate_t *gs;
//bot_goalstate_t *gs;
gs = BotGoalStateFromHandle(goalstate);
//gs = BotGoalStateFromHandle(goalstate);
//WriteWeightConfig(filename, gs->itemweightconfig);
} //end of the function BotSaveGoalFuzzyLogic

View file

@ -848,7 +848,6 @@ int BotMovementViewTarget(int movestate, bot_goal_t *goal, int travelflags, floa
ms = BotMoveStateFromHandle(movestate);
if (!ms) return qfalse;
reachnum = 0;
//if the bot has no goal or no last reachability
if (!ms->lastreachnum || !goal) return qfalse;
@ -997,12 +996,13 @@ void MoverBottomCenter(aas_reachability_t *reach, vec3_t bottomcenter)
//===========================================================================
float BotGapDistance(vec3_t origin, vec3_t hordir, int entnum)
{
float dist, startz;
int dist;
float startz;
vec3_t start, end;
aas_trace_t trace;
//do gap checking
startz = origin[2];
//startz = origin[2];
//this enables walking down stairs more fluidly
{
VectorCopy(origin, start);
@ -1030,7 +1030,7 @@ float BotGapDistance(vec3_t origin, vec3_t hordir, int entnum)
end[2] -= 20;
if (AAS_PointContents(end) & CONTENTS_WATER) break;
//if a gap is found slow down
//botimport.Print(PRT_MESSAGE, "gap at %f\n", dist);
//botimport.Print(PRT_MESSAGE, "gap at %i\n", dist);
return dist;
} //end if
startz = trace.endpos[2];
@ -1480,7 +1480,6 @@ bot_moveresult_t BotTravel_BarrierJump(bot_movestate_t *ms, aas_reachability_t *
//===========================================================================
bot_moveresult_t BotFinishTravel_BarrierJump(bot_movestate_t *ms, aas_reachability_t *reach)
{
float dist;
vec3_t hordir;
bot_moveresult_t_cleared( result );
@ -1490,7 +1489,6 @@ bot_moveresult_t BotFinishTravel_BarrierJump(bot_movestate_t *ms, aas_reachabili
hordir[0] = reach->end[0] - ms->origin[0];
hordir[1] = reach->end[1] - ms->origin[1];
hordir[2] = 0;
dist = VectorNormalize(hordir);
//
BotCheckBlocked(ms, hordir, qtrue, &result);
//
@ -1567,7 +1565,6 @@ bot_moveresult_t BotTravel_WaterJump(bot_movestate_t *ms, aas_reachability_t *re
bot_moveresult_t BotFinishTravel_WaterJump(bot_movestate_t *ms, aas_reachability_t *reach)
{
vec3_t dir, pnt;
float dist;
bot_moveresult_t_cleared( result );
//botimport.Print(PRT_MESSAGE, "BotFinishTravel_WaterJump\n");
@ -1583,7 +1580,6 @@ bot_moveresult_t BotFinishTravel_WaterJump(bot_movestate_t *ms, aas_reachability
dir[0] += crandom() * 10;
dir[1] += crandom() * 10;
dir[2] += 70 + crandom() * 10;
dist = VectorNormalize(dir);
//elemantary actions
EA_Move(ms->client, dir, 400);
//set the ideal view angles
@ -1721,7 +1717,6 @@ bot_moveresult_t BotFinishTravel_WalkOffLedge(bot_movestate_t *ms, aas_reachabil
VectorCopy(dir, hordir);
hordir[2] = 0;
//
dist = VectorNormalize(hordir);
speed = 400;
} //end if
//
@ -1788,6 +1783,7 @@ bot_moveresult_t BotTravel_Jump(bot_movestate_t *ms, aas_reachability_t *reach)
bot_moveresult_t BotTravel_Jump(bot_movestate_t *ms, aas_reachability_t *reach)
{
vec3_t hordir, dir1, dir2, mins, maxs, start, end;
int gapdist;
float dist1, dist2, speed;
bot_moveresult_t_cleared( result );
bsp_trace_t trace;
@ -1808,13 +1804,13 @@ bot_moveresult_t BotTravel_Jump(bot_movestate_t *ms, aas_reachability_t *reach)
trace = AAS_Trace(start, mins, maxs, end, ms->entitynum, MASK_PLAYERSOLID);
if (trace.startsolid) VectorCopy(start, trace.endpos);
//check for a gap
for (dist1 = 0; dist1 < 80; dist1 += 10)
for (gapdist = 0; gapdist < 80; gapdist += 10)
{
VectorMA(start, dist1+10, hordir, end);
VectorMA(start, gapdist+10, hordir, end);
end[2] += 1;
if (AAS_PointAreaNum(end) != ms->reachareanum) break;
} //end for
if (dist1 < 80) VectorMA(reach->start, dist1, hordir, trace.endpos);
if (gapdist < 80) VectorMA(reach->start, gapdist, hordir, trace.endpos);
// dist1 = BotGapDistance(start, hordir, ms->entitynum);
// if (dist1 && dist1 <= trace.fraction * 80) VectorMA(reach->start, dist1-20, hordir, trace.endpos);
//
@ -1860,6 +1856,7 @@ bot_moveresult_t BotTravel_Jump(bot_movestate_t *ms, aas_reachability_t *reach)
{
vec3_t hordir, dir1, dir2, start, end, runstart;
// vec3_t runstart, dir1, dir2, hordir;
int gapdist;
float dist1, dist2, speed;
bot_moveresult_t_cleared( result );
@ -1875,13 +1872,13 @@ bot_moveresult_t BotTravel_Jump(bot_movestate_t *ms, aas_reachability_t *reach)
start[2] += 1;
VectorMA(reach->start, 80, hordir, runstart);
//check for a gap
for (dist1 = 0; dist1 < 80; dist1 += 10)
for (gapdist = 0; gapdist < 80; gapdist += 10)
{
VectorMA(start, dist1+10, hordir, end);
VectorMA(start, gapdist+10, hordir, end);
end[2] += 1;
if (AAS_PointAreaNum(end) != ms->reachareanum) break;
} //end for
if (dist1 < 80) VectorMA(reach->start, dist1, hordir, runstart);
if (gapdist < 80) VectorMA(reach->start, gapdist, hordir, runstart);
//
VectorSubtract(ms->origin, reach->start, dir1);
dir1[2] = 0;
@ -2867,7 +2864,6 @@ bot_moveresult_t BotFinishTravel_WeaponJump(bot_movestate_t *ms, aas_reachabilit
//===========================================================================
bot_moveresult_t BotTravel_JumpPad(bot_movestate_t *ms, aas_reachability_t *reach)
{
float dist, speed;
vec3_t hordir;
bot_moveresult_t_cleared( result );
@ -2875,12 +2871,10 @@ bot_moveresult_t BotTravel_JumpPad(bot_movestate_t *ms, aas_reachability_t *reac
hordir[0] = reach->start[0] - ms->origin[0];
hordir[1] = reach->start[1] - ms->origin[1];
hordir[2] = 0;
dist = VectorNormalize(hordir);
//
BotCheckBlocked(ms, hordir, qtrue, &result);
speed = 400;
//elemantary action move in direction
EA_Move(ms->client, hordir, speed);
EA_Move(ms->client, hordir, 400);
VectorCopy(hordir, result.movedir);
//
return result;

View file

@ -1698,7 +1698,6 @@ int PC_EvaluateTokens(source_t *source, token_t *tokens, signed long int *intval
int questmarkintvalue = 0;
float questmarkfloatvalue = 0;
int gotquestmarkvalue = qfalse;
int lastoperatortype = 0;
//
operator_t operator_heap[MAX_OPERATORS];
int numoperators = 0;
@ -2087,7 +2086,6 @@ int PC_EvaluateTokens(source_t *source, token_t *tokens, signed long int *intval
else Log_Write("result value = %f", v1->floatvalue);
#endif //DEBUG_EVAL
if (error) break;
lastoperatortype = o->operator;
//if not an operator with arity 1
if (o->operator != P_LOGIC_NOT
&& o->operator != P_BIN_NOT)

View file

@ -1222,9 +1222,9 @@ static float CG_DrawTeamOverlay( float y, qboolean right, qboolean upper ) {
p = CG_ConfigString(CS_LOCATIONS + ci->location);
if (!p || !*p)
p = "unknown";
len = CG_DrawStrlen(p);
if (len > lwidth)
len = lwidth;
// len = CG_DrawStrlen(p);
// if (len > lwidth)
// len = lwidth;
// xx = x + TINYCHAR_WIDTH * 2 + TINYCHAR_WIDTH * pwidth +
// ((lwidth/2 - len/2) * TINYCHAR_WIDTH);
@ -1974,8 +1974,8 @@ CG_DrawTeamInfo
*/
#ifndef MISSIONPACK
static void CG_DrawTeamInfo( void ) {
int w, h;
int i, len;
int h;
int i;
vec4_t hcolor;
int chatHeight;
@ -1996,16 +1996,6 @@ static void CG_DrawTeamInfo( void ) {
h = (cgs.teamChatPos - cgs.teamLastChatPos) * TINYCHAR_HEIGHT;
w = 0;
for (i = cgs.teamLastChatPos; i < cgs.teamChatPos; i++) {
len = CG_DrawStrlen(cgs.teamChatMsgs[i % chatHeight]);
if (len > w)
w = len;
}
w *= TINYCHAR_WIDTH;
w += TINYCHAR_WIDTH * 2;
if ( cg.snap->ps.persistant[PERS_TEAM] == TEAM_RED ) {
hcolor[0] = 1.0f;
hcolor[1] = 0.0f;
@ -2550,7 +2540,7 @@ CG_DrawCrosshair3D
*/
static void CG_DrawCrosshair3D(void)
{
float w, h;
float w;
qhandle_t hShader;
float f;
int ca;
@ -2573,14 +2563,13 @@ static void CG_DrawCrosshair3D(void)
return;
}
w = h = cg_crosshairSize.value;
w = cg_crosshairSize.value;
// pulse the size of the crosshair when picking up items
f = cg.time - cg.itemPickupBlendTime;
if ( f > 0 && f < ITEM_BLOB_TIME ) {
f /= ITEM_BLOB_TIME;
w *= ( 1 + f );
h *= ( 1 + f );
}
ca = cg_drawCrosshair.integer;
@ -2795,7 +2784,6 @@ static void CG_DrawTeamVote(void) {
static qboolean CG_DrawScoreboard( void ) {
#ifdef MISSIONPACK
static qboolean firstTime = qtrue;
float fade, *fadeColor;
if (menuScoreboard) {
menuScoreboard->window.flags &= ~WINDOW_FORCED;
@ -2819,20 +2807,15 @@ static qboolean CG_DrawScoreboard( void ) {
}
if ( cg.showScores || cg.predictedPlayerState.pm_type == PM_DEAD || cg.predictedPlayerState.pm_type == PM_INTERMISSION ) {
fade = 1.0;
fadeColor = colorWhite;
} else {
fadeColor = CG_FadeColor( cg.scoreFadeTime, FADE_TIME );
if ( !fadeColor ) {
if ( !CG_FadeColor( cg.scoreFadeTime, FADE_TIME ) ) {
// next time scoreboard comes up, don't print killer
cg.deferredPlayerLoading = 0;
cg.killerName[0] = 0;
firstTime = qtrue;
return qfalse;
}
fade = *fadeColor;
}
}
if (menuScoreboard == NULL) {
if ( cgs.gametype >= GT_TEAM ) {
@ -3006,9 +2989,12 @@ static void CG_DrawWarmup( void ) {
int w;
int sec;
int i;
float scale;
clientInfo_t *ci1, *ci2;
#ifdef MISSIONPACK
float scale;
#else
int cw;
#endif
clientInfo_t *ci1, *ci2;
const char *s;
sec = cg.warmup;
@ -3117,30 +3103,41 @@ static void CG_DrawWarmup( void ) {
break;
}
}
scale = 0.45f;
#ifdef MISSIONPACK
switch ( cg.warmupCount ) {
case 0:
cw = 28;
scale = 0.54f;
break;
case 1:
cw = 24;
scale = 0.51f;
break;
case 2:
cw = 20;
scale = 0.48f;
break;
default:
cw = 16;
scale = 0.45f;
break;
}
#ifdef MISSIONPACK
w = CG_Text_Width(s, scale, 0);
CG_Text_Paint(320 - w / 2, 125, scale, colorWhite, s, 0, 0, ITEM_TEXTSTYLE_SHADOWEDMORE);
w = CG_Text_Width(s, scale, 0);
CG_Text_Paint(320 - w / 2, 125, scale, colorWhite, s, 0, 0, ITEM_TEXTSTYLE_SHADOWEDMORE);
#else
switch ( cg.warmupCount ) {
case 0:
cw = 28;
break;
case 1:
cw = 24;
break;
case 2:
cw = 20;
break;
default:
cw = 16;
break;
}
w = CG_DrawStrlen( s );
CG_DrawStringExt( 320 - w * cw/2, 70, s, colorWhite,
qfalse, qtrue, cw, (int)(cw * 1.5), 0 );

View file

@ -852,7 +852,8 @@ Also called by client movement prediction code
void CG_AdjustPositionForMover( const vec3_t in, int moverNum, int fromTime, int toTime, vec3_t out ) {
centity_t *cent;
vec3_t oldOrigin, origin, deltaOrigin;
vec3_t oldAngles, angles, deltaAngles;
vec3_t oldAngles, angles;
//vec3_t deltaAngles;
if ( moverNum <= 0 || moverNum >= ENTITYNUM_MAX_NORMAL ) {
VectorCopy( in, out );
@ -872,7 +873,7 @@ void CG_AdjustPositionForMover( const vec3_t in, int moverNum, int fromTime, int
BG_EvaluateTrajectory( &cent->currentState.apos, toTime, angles );
VectorSubtract( origin, oldOrigin, deltaOrigin );
VectorSubtract( angles, oldAngles, deltaAngles );
//VectorSubtract( angles, oldAngles, deltaAngles );
VectorAdd( in, deltaOrigin, out );

View file

@ -745,11 +745,10 @@ void CG_EntityEvent( centity_t *cent, vec3_t position ) {
DEBUGNAME("EV_JUMP_PAD");
// CG_Printf( "EV_JUMP_PAD w/effect #%i\n", es->eventParm );
{
localEntity_t *smoke;
vec3_t up = {0, 0, 1};
smoke = CG_SmokePuff( cent->lerpOrigin, up,
CG_SmokePuff( cent->lerpOrigin, up,
32,
1, 1, 1, 0.33f,
1000,

View file

@ -175,10 +175,6 @@ typedef struct {
int painDirection; // flip from 0 to 1
int lightningFiring;
// railgun trail spawning
vec3_t railgunImpact;
qboolean railgunFlash;
int railFireTime;
// machinegun spinning
@ -560,7 +556,6 @@ typedef struct weaponInfo_s {
sfxHandle_t readySound;
sfxHandle_t firingSound;
qboolean loopFireSound;
} weaponInfo_t;
@ -1129,7 +1124,7 @@ typedef struct {
sfxHandle_t sfx_ric1;
sfxHandle_t sfx_ric2;
sfxHandle_t sfx_ric3;
sfxHandle_t sfx_railg;
//sfxHandle_t sfx_railg;
sfxHandle_t sfx_rockexp;
sfxHandle_t sfx_plasmaexp;
#ifdef MISSIONPACK
@ -1154,7 +1149,6 @@ typedef struct {
sfxHandle_t obeliskRespawnSound;
sfxHandle_t winnerSound;
sfxHandle_t loserSound;
sfxHandle_t youSuckSound;
#endif
sfxHandle_t gibSound;
sfxHandle_t gibBounce1Sound;

View file

@ -742,9 +742,6 @@ void CG_AddKamikaze( localEntity_t *le ) {
le->angles.trBase[1] = random() * 360;
le->angles.trBase[2] = random() * 360;
}
else {
c = 0;
}
memset(&shockwave, 0, sizeof(shockwave));
shockwave.hModel = cgs.media.kamikazeShockWave;
shockwave.reType = RT_MODEL;

View file

@ -901,7 +901,7 @@ static void CG_RegisterSounds( void ) {
cgs.media.sfx_ric1 = trap_S_RegisterSound ("sound/weapons/machinegun/ric1.wav", qfalse);
cgs.media.sfx_ric2 = trap_S_RegisterSound ("sound/weapons/machinegun/ric2.wav", qfalse);
cgs.media.sfx_ric3 = trap_S_RegisterSound ("sound/weapons/machinegun/ric3.wav", qfalse);
cgs.media.sfx_railg = trap_S_RegisterSound ("sound/weapons/railgun/railgf1a.wav", qfalse);
//cgs.media.sfx_railg = trap_S_RegisterSound ("sound/weapons/railgun/railgf1a.wav", qfalse);
cgs.media.sfx_rockexp = trap_S_RegisterSound ("sound/weapons/rocket/rocklx1a.wav", qfalse);
cgs.media.sfx_plasmaexp = trap_S_RegisterSound ("sound/weapons/plasma/plasmx1a.wav", qfalse);
#ifdef MISSIONPACK
@ -918,7 +918,6 @@ static void CG_RegisterSounds( void ) {
cgs.media.kamikazeFarSound = trap_S_RegisterSound( "sound/items/kam_explode_far.wav", qfalse );
cgs.media.winnerSound = trap_S_RegisterSound( "sound/feedback/voc_youwin.wav", qfalse );
cgs.media.loserSound = trap_S_RegisterSound( "sound/feedback/voc_youlose.wav", qfalse );
cgs.media.youSuckSound = trap_S_RegisterSound( "sound/misc/yousuck.wav", qfalse );
cgs.media.wstbimplSound = trap_S_RegisterSound("sound/weapons/proxmine/wstbimpl.wav", qfalse);
cgs.media.wstbimpmSound = trap_S_RegisterSound("sound/weapons/proxmine/wstbimpm.wav", qfalse);

View file

@ -161,52 +161,43 @@ void CG_SelectPrevPlayer() {
static void CG_DrawPlayerArmorIcon( rectDef_t *rect, qboolean draw2D ) {
centity_t *cent;
playerState_t *ps;
vec3_t angles;
vec3_t origin;
if ( cg_drawStatus.integer == 0 ) {
if ( cg_drawStatus.integer == 0 ) {
return;
}
cent = &cg_entities[cg.snap->ps.clientNum];
ps = &cg.snap->ps;
if ( draw2D || !cg_draw3dIcons.integer && cg_drawIcons.integer ) {
CG_DrawPic( rect->x, rect->y + rect->h/2 + 1, rect->w, rect->h, cgs.media.armorIcon );
} else if (cg_draw3dIcons.integer) {
VectorClear( angles );
origin[0] = 90;
origin[1] = 0;
origin[2] = -10;
angles[YAW] = ( cg.time & 2047 ) * 360 / 2048.0;
CG_Draw3DModel( rect->x, rect->y, rect->w, rect->h, cgs.media.armorModel, 0, origin, angles );
}
} else if (cg_draw3dIcons.integer) {
VectorClear( angles );
origin[0] = 90;
origin[1] = 0;
origin[2] = -10;
angles[YAW] = ( cg.time & 2047 ) * 360 / 2048.0;
CG_Draw3DModel( rect->x, rect->y, rect->w, rect->h, cgs.media.armorModel, 0, origin, angles );
}
}
static void CG_DrawPlayerArmorValue(rectDef_t *rect, float scale, vec4_t color, qhandle_t shader, int textStyle) {
char num[16];
int value;
centity_t *cent;
int value;
playerState_t *ps;
cent = &cg_entities[cg.snap->ps.clientNum];
ps = &cg.snap->ps;
value = ps->stats[STAT_ARMOR];
if (shader) {
trap_R_SetColor( color );
trap_R_SetColor( color );
CG_DrawPic(rect->x, rect->y, rect->w, rect->h, shader);
trap_R_SetColor( NULL );
trap_R_SetColor( NULL );
} else {
Com_sprintf (num, sizeof(num), "%i", value);
value = CG_Text_Width(num, scale, 0);
CG_Text_Paint(rect->x + (rect->w - value) / 2, rect->y + rect->h, scale, color, num, 0, 0, textStyle);
CG_Text_Paint(rect->x + (rect->w - value) / 2, rect->y + rect->h, scale, color, num, 0, 0, textStyle);
}
}
@ -220,29 +211,27 @@ static float healthColors[4][4] = {
static void CG_DrawPlayerAmmoIcon( rectDef_t *rect, qboolean draw2D ) {
centity_t *cent;
playerState_t *ps;
vec3_t angles;
vec3_t origin;
cent = &cg_entities[cg.snap->ps.clientNum];
ps = &cg.snap->ps;
if ( draw2D || !cg_draw3dIcons.integer && cg_drawIcons.integer ) {
qhandle_t icon;
icon = cg_weapons[ cg.predictedPlayerState.weapon ].ammoIcon;
qhandle_t icon;
icon = cg_weapons[ cg.predictedPlayerState.weapon ].ammoIcon;
if ( icon ) {
CG_DrawPic( rect->x, rect->y, rect->w, rect->h, icon );
CG_DrawPic( rect->x, rect->y, rect->w, rect->h, icon );
}
} else if (cg_draw3dIcons.integer) {
if ( cent->currentState.weapon && cg_weapons[ cent->currentState.weapon ].ammoModel ) {
VectorClear( angles );
origin[0] = 70;
origin[1] = 0;
origin[2] = 0;
angles[YAW] = 90 + 20 * sin( cg.time / 1000.0 );
CG_Draw3DModel( rect->x, rect->y, rect->w, rect->h, cg_weapons[ cent->currentState.weapon ].ammoModel, 0, origin, angles );
}
}
} else if (cg_draw3dIcons.integer) {
if ( cent->currentState.weapon && cg_weapons[ cent->currentState.weapon ].ammoModel ) {
VectorClear( angles );
origin[0] = 70;
origin[1] = 0;
origin[2] = 0;
angles[YAW] = 90 + 20 * sin( cg.time / 1000.0 );
CG_Draw3DModel( rect->x, rect->y, rect->w, rect->h, cg_weapons[ cent->currentState.weapon ].ammoModel, 0, origin, angles );
}
}
}
static void CG_DrawPlayerAmmoValue(rectDef_t *rect, float scale, vec4_t color, qhandle_t shader, int textStyle) {
@ -366,7 +355,7 @@ static void CG_DrawSelectedPlayerArmor( rectDef_t *rect, float scale, vec4_t col
}
qhandle_t CG_StatusHandle(int task) {
qhandle_t h = cgs.media.assaultShader;
qhandle_t h;
switch (task) {
case TEAMTASK_OFFENSE :
h = cgs.media.assaultShader;

View file

@ -858,9 +858,7 @@ void CG_AddParticles (void)
float alpha;
float time, time2;
vec3_t org;
int color;
cparticle_t *active, *tail;
int type;
vec3_t rotate_ang;
if (!initparticles)
@ -965,16 +963,12 @@ void CG_AddParticles (void)
if (alpha > 1.0)
alpha = 1;
color = p->color;
time2 = time*time;
org[0] = p->org[0] + p->vel[0]*time + p->accel[0]*time2;
org[1] = p->org[1] + p->vel[1]*time + p->accel[1]*time2;
org[2] = p->org[2] + p->vel[2]*time + p->accel[2]*time2;
type = p->type;
CG_AddParticleToScene (p, org, alpha);
}
@ -1682,8 +1676,8 @@ qboolean ValidBloodPool (vec3_t start)
vec3_t angles;
vec3_t right, up;
vec3_t this_pos, x_pos, center_pos, end_pos;
float x, y;
float fwidth, fheight;
int x, y;
int fwidth, fheight;
trace_t trace;
vec3_t normal;

View file

@ -2003,7 +2003,6 @@ CG_DustTrail
*/
static void CG_DustTrail( centity_t *cent ) {
int anim;
localEntity_t *dust;
vec3_t end, vel;
trace_t tr;
@ -2039,7 +2038,7 @@ static void CG_DustTrail( centity_t *cent ) {
end[2] -= 16;
VectorSet(vel, 0, 0, -30);
dust = CG_SmokePuff( end, vel,
CG_SmokePuff( end, vel,
24,
.8f, .8f, 0.7f, 0.33f,
500,

View file

@ -304,7 +304,10 @@ CG_CheckLocalSounds
==================
*/
void CG_CheckLocalSounds( playerState_t *ps, playerState_t *ops ) {
int highScore, health, armor, reward;
int highScore, reward;
#ifdef MISSIONPACK
int health, armor;
#endif
sfxHandle_t sfx;
// don't play the sounds if the player just changed teams
@ -314,9 +317,9 @@ void CG_CheckLocalSounds( playerState_t *ps, playerState_t *ops ) {
// hit changes
if ( ps->persistant[PERS_HITS] > ops->persistant[PERS_HITS] ) {
#ifdef MISSIONPACK
armor = ps->persistant[PERS_ATTACKEE_ARMOR] & 0xff;
health = ps->persistant[PERS_ATTACKEE_ARMOR] >> 8;
#ifdef MISSIONPACK
if (armor > 50 ) {
trap_S_StartLocalSound( cgs.media.hitSoundHighArmor, CHAN_LOCAL_SOUND );
} else if (armor || health > 100) {

View file

@ -214,7 +214,7 @@ CG_RailTrail
==========================
*/
void CG_RailTrail (clientInfo_t *ci, vec3_t start, vec3_t end) {
vec3_t axis[36], move, move2, next_move, vec, temp;
vec3_t axis[36], move, move2, vec, temp;
float len;
int i, j, skip;
@ -262,7 +262,6 @@ void CG_RailTrail (clientInfo_t *ci, vec3_t start, vec3_t end) {
AxisClear( re->axis );
VectorMA(move, 20, vec, move);
VectorCopy(move, next_move);
VectorScale (vec, SPACING, vec);
if (cg_oldRail.integer != 0) {
@ -467,7 +466,6 @@ static void CG_PlasmaTrail( centity_t *cent, const weaponInfo_t *wi ) {
vec3_t velocity, xvelocity, origin;
vec3_t offset, xoffset;
vec3_t v[3];
int t, startTime, step;
float waterScale = 1.0f;
@ -475,11 +473,7 @@ static void CG_PlasmaTrail( centity_t *cent, const weaponInfo_t *wi ) {
return;
}
step = 50;
es = &cent->currentState;
startTime = cent->trailTime;
t = step * ( (startTime + step) / step );
BG_EvaluateTrajectory( &es->pos, cg.time, origin );
@ -524,21 +518,21 @@ static void CG_PlasmaTrail( centity_t *cent, const weaponInfo_t *wi ) {
VectorScale( xvelocity, waterScale, le->pos.trDelta );
AxisCopy( axisDefault, re->axis );
re->shaderTime = cg.time / 1000.0f;
re->reType = RT_SPRITE;
re->radius = 0.25f;
re->shaderTime = cg.time / 1000.0f;
re->reType = RT_SPRITE;
re->radius = 0.25f;
re->customShader = cgs.media.railRingsShader;
le->bounceFactor = 0.3f;
re->shaderRGBA[0] = wi->flashDlightColor[0] * 63;
re->shaderRGBA[1] = wi->flashDlightColor[1] * 63;
re->shaderRGBA[2] = wi->flashDlightColor[2] * 63;
re->shaderRGBA[3] = 63;
re->shaderRGBA[0] = wi->flashDlightColor[0] * 63;
re->shaderRGBA[1] = wi->flashDlightColor[1] * 63;
re->shaderRGBA[2] = wi->flashDlightColor[2] * 63;
re->shaderRGBA[3] = 63;
le->color[0] = wi->flashDlightColor[0] * 0.2;
le->color[1] = wi->flashDlightColor[1] * 0.2;
le->color[2] = wi->flashDlightColor[2] * 0.2;
le->color[3] = 0.25f;
le->color[0] = wi->flashDlightColor[0] * 0.2;
le->color[1] = wi->flashDlightColor[1] * 0.2;
le->color[2] = wi->flashDlightColor[2] * 0.2;
le->color[3] = 0.25f;
le->angles.trType = TR_LINEAR;
le->angles.trTime = cg.time;
@ -679,8 +673,6 @@ void CG_RegisterWeapon( int weaponNum ) {
weaponInfo->handsModel = trap_R_RegisterModel( "models/weapons2/shotgun/shotgun_hand.md3" );
}
weaponInfo->loopFireSound = qfalse;
switch ( weaponNum ) {
case WP_GAUNTLET:
MAKERGB( weaponInfo->flashDlightColor, 0.6f, 0.6f, 1.0f );
@ -709,8 +701,6 @@ void CG_RegisterWeapon( int weaponNum ) {
weaponInfo->missileModel = trap_R_RegisterModel( "models/ammo/rocket/rocket.md3" );
weaponInfo->missileTrailFunc = CG_GrappleTrail;
weaponInfo->missileDlight = 200;
weaponInfo->wiTrailTime = 2000;
weaponInfo->trailRadius = 64;
MAKERGB( weaponInfo->missileDlightColor, 1, 0.75f, 0 );
weaponInfo->readySound = trap_S_RegisterSound( "sound/weapons/melee/fsthum.wav", qfalse );
weaponInfo->firingSound = trap_S_RegisterSound( "sound/weapons/melee/fstrun.wav", qfalse );
@ -730,7 +720,6 @@ void CG_RegisterWeapon( int weaponNum ) {
#ifdef MISSIONPACK
case WP_CHAINGUN:
weaponInfo->firingSound = trap_S_RegisterSound( "sound/weapons/vulcan/wvulfire.wav", qfalse );
weaponInfo->loopFireSound = qtrue;
MAKERGB( weaponInfo->flashDlightColor, 1, 1, 0 );
weaponInfo->flashSound[0] = trap_S_RegisterSound( "sound/weapons/vulcan/vulcanf1b.wav", qfalse );
weaponInfo->flashSound[1] = trap_S_RegisterSound( "sound/weapons/vulcan/vulcanf2b.wav", qfalse );
@ -1204,28 +1193,6 @@ static void CG_LightningBolt( centity_t *cent, vec3_t origin ) {
*/
/*
===============
CG_SpawnRailTrail
Origin will be the exact tag point, which is slightly
different than the muzzle point used for determining hits.
===============
*/
static void CG_SpawnRailTrail( centity_t *cent, vec3_t origin ) {
clientInfo_t *ci;
if ( cent->currentState.weapon != WP_RAILGUN ) {
return;
}
if ( !cent->pe.railgunFlash ) {
return;
}
cent->pe.railgunFlash = qtrue;
ci = &cgs.clientinfo[ cent->currentState.clientNum ];
CG_RailTrail( ci, origin, cent->pe.railgunImpact );
}
/*
======================
@ -1407,7 +1374,7 @@ void CG_AddPlayerWeapon( refEntity_t *parent, playerState_t *ps, centity_t *cent
// continuous flash
} else {
// impulse flash
if ( cg.time - cent->muzzleFlashTime > MUZZLE_FLASH_TIME && !cent->pe.railgunFlash ) {
if ( cg.time - cent->muzzleFlashTime > MUZZLE_FLASH_TIME ) {
return;
}
}
@ -1444,9 +1411,6 @@ void CG_AddPlayerWeapon( refEntity_t *parent, playerState_t *ps, centity_t *cent
// add lightning bolt
CG_LightningBolt( nonPredictedCent, flash.origin );
// add rail trail
CG_SpawnRailTrail( cent, flash.origin );
if ( weapon->flashDlightColor[0] || weapon->flashDlightColor[1] || weapon->flashDlightColor[2] ) {
trap_R_AddLightToScene( flash.origin, 300 + (rand()&31), weapon->flashDlightColor[0],
weapon->flashDlightColor[1], weapon->flashDlightColor[2] );
@ -2029,6 +1993,7 @@ void CG_MissileHitWall( int weapon, int clientNum, vec3_t origin, vec3_t dir, im
case WP_RAILGUN:
mod = cgs.media.ringFlashModel;
shader = cgs.media.railExplosionShader;
//sfx = cgs.media.sfx_railg;
sfx = cgs.media.sfx_plasmaexp;
mark = cgs.media.energyMarkShader;
radius = 24;
@ -2076,15 +2041,6 @@ void CG_MissileHitWall( int weapon, int clientNum, vec3_t origin, vec3_t dir, im
}
mark = cgs.media.bulletMarkShader;
r = rand() & 3;
if ( r < 2 ) {
sfx = cgs.media.sfx_ric1;
} else if ( r == 2 ) {
sfx = cgs.media.sfx_ric2;
} else {
sfx = cgs.media.sfx_ric3;
}
radius = 8;
break;
#endif

View file

@ -827,7 +827,6 @@ or bursted delayed packets.
#define RESET_TIME 500
void CL_AdjustTimeDelta( void ) {
int resetTime;
int newDelta;
int deltaDelta;
@ -838,13 +837,6 @@ void CL_AdjustTimeDelta( void ) {
return;
}
// if the current time is WAY off, just correct to the current value
if ( com_sv_running->integer ) {
resetTime = 100;
} else {
resetTime = RESET_TIME;
}
newDelta = cl.snap.serverTime - cls.realtime;
deltaDelta = abs( newDelta - cl.serverTimeDelta );
@ -952,8 +944,8 @@ void CL_FirstSnapshot( void ) {
clc.speexInitialized = qtrue;
clc.voipMuteAll = qfalse;
Cmd_AddCommand ("voip", CL_Voip_f);
Cvar_Set("cl_voipSendTarget", "all");
clc.voipTarget1 = clc.voipTarget2 = clc.voipTarget3 = 0x7FFFFFFF;
Cvar_Set("cl_voipSendTarget", "spatial");
Com_Memset(clc.voipTargets, ~0, sizeof(clc.voipTargets));
}
#endif
}

View file

@ -937,10 +937,6 @@ static void setupQuad( long xOff, long yOff )
cin.oldysize = cinTable[currentHandle].ysize;
cin.oldxsize = cinTable[currentHandle].xsize;
numQuadCels = (cinTable[currentHandle].CIN_WIDTH*cinTable[currentHandle].CIN_HEIGHT) / (16);
numQuadCels += numQuadCels/4 + numQuadCels/16;
numQuadCels += 64; // for overflow
numQuadCels = (cinTable[currentHandle].xsize*cinTable[currentHandle].ysize) / (16);
numQuadCels += numQuadCels/4;
numQuadCels += 64; // for overflow
@ -1147,7 +1143,7 @@ redump:
case ZA_SOUND_MONO:
if (!cinTable[currentHandle].silent) {
ssize = RllDecodeMonoToStereo( framedata, sbuf, cinTable[currentHandle].RoQFrameSize, 0, (unsigned short)cinTable[currentHandle].roq_flags);
S_RawSamples( 0, ssize, 22050, 2, 1, (byte *)sbuf, 1.0f );
S_RawSamples(0, ssize, 22050, 2, 1, (byte *)sbuf, 1.0f, -1);
}
break;
case ZA_SOUND_STEREO:
@ -1157,7 +1153,7 @@ redump:
s_rawend[0] = s_soundtime;
}
ssize = RllDecodeStereoToStereo( framedata, sbuf, cinTable[currentHandle].RoQFrameSize, 0, (unsigned short)cinTable[currentHandle].roq_flags);
S_RawSamples( 0, ssize, 22050, 2, 2, (byte *)sbuf, 1.0f );
S_RawSamples(0, ssize, 22050, 2, 2, (byte *)sbuf, 1.0f, -1);
}
break;
case ROQ_QUAD_INFO:
@ -1610,7 +1606,6 @@ void CIN_DrawCinematic (int handle) {
void CL_PlayCinematic_f(void) {
char *arg, *s;
qboolean holdatend;
int bits = CIN_system;
Com_DPrintf("CL_PlayCinematic_f\n");
@ -1621,7 +1616,6 @@ void CL_PlayCinematic_f(void) {
arg = Cmd_Argv( 1 );
s = Cmd_Argv(2);
holdatend = qfalse;
if ((s && s[0] == '1') || Q_stricmp(arg,"demoend.roq")==0 || Q_stricmp(arg,"end.roq")==0) {
bits |= CIN_hold;
}

View file

@ -279,10 +279,6 @@ void IN_CenterView (void) {
//==========================================================================
cvar_t *cl_upspeed;
cvar_t *cl_forwardspeed;
cvar_t *cl_sidespeed;
cvar_t *cl_yawspeed;
cvar_t *cl_pitchspeed;
@ -399,13 +395,9 @@ CL_JoystickMove
=================
*/
void CL_JoystickMove( usercmd_t *cmd ) {
int movespeed;
float anglespeed;
if ( in_speed.active ^ cl_run->integer ) {
movespeed = 2;
} else {
movespeed = 1;
if ( !(in_speed.active ^ cl_run->integer) ) {
cmd->buttons |= BUTTON_TURBO;
}
@ -617,10 +609,10 @@ usercmd_t CL_CreateCmd( void ) {
// draw debug graphs of turning for mouse testing
if ( cl_debugMove->integer ) {
if ( cl_debugMove->integer == 1 ) {
SCR_DebugGraph( abs(cl.viewangles[YAW] - oldAngles[YAW]), 0 );
SCR_DebugGraph( abs(cl.viewangles[YAW] - oldAngles[YAW]) );
}
if ( cl_debugMove->integer == 2 ) {
SCR_DebugGraph( abs(cl.viewangles[PITCH] - oldAngles[PITCH]), 0 );
SCR_DebugGraph( abs(cl.viewangles[PITCH] - oldAngles[PITCH]) );
}
}
@ -636,7 +628,6 @@ Create a new usercmd_t structure for this frame
=================
*/
void CL_CreateNewCommands( void ) {
usercmd_t *cmd;
int cmdNum;
// no need to create usercmds until we have a gamestate
@ -658,7 +649,6 @@ void CL_CreateNewCommands( void ) {
cl.cmdNumber++;
cmdNum = cl.cmdNumber & CMD_MASK;
cl.cmds[cmdNum] = CL_CreateCmd ();
cmd = &cl.cmds[cmdNum];
}
/*
@ -799,83 +789,53 @@ void CL_WritePacket( void ) {
}
#ifdef USE_VOIP
if (clc.voipOutgoingDataSize > 0) { // only send if data.
// Move cl_voipSendTarget from a string to the bitmasks if needed.
if (cl_voipSendTarget->modified) {
char buffer[32];
const char *target = cl_voipSendTarget->string;
if (clc.voipOutgoingDataSize > 0)
{
if((clc.voipFlags & VOIP_SPATIAL) || Com_IsVoipTarget(clc.voipTargets, sizeof(clc.voipTargets), -1))
{
MSG_WriteByte (&buf, clc_voip);
MSG_WriteByte (&buf, clc.voipOutgoingGeneration);
MSG_WriteLong (&buf, clc.voipOutgoingSequence);
MSG_WriteByte (&buf, clc.voipOutgoingDataFrames);
MSG_WriteData (&buf, clc.voipTargets, sizeof(clc.voipTargets));
MSG_WriteByte(&buf, clc.voipFlags);
MSG_WriteShort (&buf, clc.voipOutgoingDataSize);
MSG_WriteData (&buf, clc.voipOutgoingData, clc.voipOutgoingDataSize);
if (Q_stricmp(target, "attacker") == 0) {
int player = VM_Call( cgvm, CG_LAST_ATTACKER );
Com_sprintf(buffer, sizeof (buffer), "%d", player);
target = buffer;
} else if (Q_stricmp(target, "crosshair") == 0) {
int player = VM_Call( cgvm, CG_CROSSHAIR_PLAYER );
Com_sprintf(buffer, sizeof (buffer), "%d", player);
target = buffer;
// If we're recording a demo, we have to fake a server packet with
// this VoIP data so it gets to disk; the server doesn't send it
// back to us, and we might as well eliminate concerns about dropped
// and misordered packets here.
if(clc.demorecording && !clc.demowaiting)
{
const int voipSize = clc.voipOutgoingDataSize;
msg_t fakemsg;
byte fakedata[MAX_MSGLEN];
MSG_Init (&fakemsg, fakedata, sizeof (fakedata));
MSG_Bitstream (&fakemsg);
MSG_WriteLong (&fakemsg, clc.reliableAcknowledge);
MSG_WriteByte (&fakemsg, svc_voip);
MSG_WriteShort (&fakemsg, clc.clientNum);
MSG_WriteByte (&fakemsg, clc.voipOutgoingGeneration);
MSG_WriteLong (&fakemsg, clc.voipOutgoingSequence);
MSG_WriteByte (&fakemsg, clc.voipOutgoingDataFrames);
MSG_WriteShort (&fakemsg, clc.voipOutgoingDataSize );
MSG_WriteData (&fakemsg, clc.voipOutgoingData, voipSize);
MSG_WriteByte (&fakemsg, svc_EOF);
CL_WriteDemoMessage (&fakemsg, 0);
}
if ((*target == '\0') || (Q_stricmp(target, "all") == 0)) {
const int all = 0x7FFFFFFF;
clc.voipTarget1 = clc.voipTarget2 = clc.voipTarget3 = all;
} else if (Q_stricmp(target, "none") == 0) {
clc.voipTarget1 = clc.voipTarget2 = clc.voipTarget3 = 0;
} else {
const char *ptr = target;
clc.voipTarget1 = clc.voipTarget2 = clc.voipTarget3 = 0;
do {
if ((*ptr == ',') || (*ptr == '\0')) {
const int val = atoi(target);
target = ptr + 1;
if ((val >= 0) && (val < 31)) {
clc.voipTarget1 |= (1 << (val-0));
} else if ((val >= 31) && (val < 62)) {
clc.voipTarget2 |= (1 << (val-31));
} else if ((val >= 62) && (val < 93)) {
clc.voipTarget3 |= (1 << (val-62));
}
}
} while (*(ptr++));
}
cl_voipSendTarget->modified = qfalse;
clc.voipOutgoingSequence += clc.voipOutgoingDataFrames;
clc.voipOutgoingDataSize = 0;
clc.voipOutgoingDataFrames = 0;
}
MSG_WriteByte (&buf, clc_voip);
MSG_WriteByte (&buf, clc.voipOutgoingGeneration);
MSG_WriteLong (&buf, clc.voipOutgoingSequence);
MSG_WriteByte (&buf, clc.voipOutgoingDataFrames);
MSG_WriteLong (&buf, clc.voipTarget1);
MSG_WriteLong (&buf, clc.voipTarget2);
MSG_WriteLong (&buf, clc.voipTarget3);
MSG_WriteShort (&buf, clc.voipOutgoingDataSize);
MSG_WriteData (&buf, clc.voipOutgoingData, clc.voipOutgoingDataSize);
// If we're recording a demo, we have to fake a server packet with
// this VoIP data so it gets to disk; the server doesn't send it
// back to us, and we might as well eliminate concerns about dropped
// and misordered packets here.
if ( clc.demorecording && !clc.demowaiting ) {
const int voipSize = clc.voipOutgoingDataSize;
msg_t fakemsg;
byte fakedata[MAX_MSGLEN];
MSG_Init (&fakemsg, fakedata, sizeof (fakedata));
MSG_Bitstream (&fakemsg);
MSG_WriteLong (&fakemsg, clc.reliableAcknowledge);
MSG_WriteByte (&fakemsg, svc_voip);
MSG_WriteShort (&fakemsg, clc.clientNum);
MSG_WriteByte (&fakemsg, clc.voipOutgoingGeneration);
MSG_WriteLong (&fakemsg, clc.voipOutgoingSequence);
MSG_WriteByte (&fakemsg, clc.voipOutgoingDataFrames);
MSG_WriteShort (&fakemsg, clc.voipOutgoingDataSize );
MSG_WriteData (&fakemsg, clc.voipOutgoingData, voipSize);
MSG_WriteByte (&fakemsg, svc_EOF);
CL_WriteDemoMessage (&fakemsg, 0);
else
{
// We have data, but no targets. Silently discard all data
clc.voipOutgoingDataSize = 0;
clc.voipOutgoingDataFrames = 0;
}
clc.voipOutgoingSequence += clc.voipOutgoingDataFrames;
clc.voipOutgoingDataSize = 0;
clc.voipOutgoingDataFrames = 0;
} else
}
#endif
if ( count >= 1 ) {

View file

@ -109,8 +109,6 @@ cvar_t *cl_guidServerUniq;
cvar_t *cl_consoleKeys;
cvar_t *cl_gamename;
clientActive_t cl;
clientConnection_t clc;
clientStatic_t cls;
@ -291,6 +289,88 @@ void CL_VoipNewGeneration(void)
clc.voipOutgoingSequence = 0;
}
/*
===============
CL_VoipParseTargets
sets clc.voipTargets according to cl_voipSendTarget
Generally we don't want who's listening to change during a transmission,
so this is only called when the key is first pressed
===============
*/
void CL_VoipParseTargets(void)
{
const char *target = cl_voipSendTarget->string;
char *end;
int val;
Com_Memset(clc.voipTargets, 0, sizeof(clc.voipTargets));
clc.voipFlags &= ~VOIP_SPATIAL;
while(target)
{
while(*target == ',' || *target == ' ')
target++;
if(!*target)
break;
if(isdigit(*target))
{
val = strtol(target, &end, 10);
target = end;
}
else
{
if(!Q_stricmpn(target, "all", 3))
{
Com_Memset(clc.voipTargets, ~0, sizeof(clc.voipTargets));
return;
}
if(!Q_stricmpn(target, "spatial", 7))
{
clc.voipFlags |= VOIP_SPATIAL;
target += 7;
continue;
}
else
{
if(!Q_stricmpn(target, "attacker", 8))
{
val = VM_Call(cgvm, CG_LAST_ATTACKER);
target += 8;
}
else if(!Q_stricmpn(target, "crosshair", 9))
{
val = VM_Call(cgvm, CG_CROSSHAIR_PLAYER);
target += 9;
}
else
{
while(*target && *target != ',' && *target != ' ')
target++;
continue;
}
if(val < 0)
continue;
}
}
if(val < 0 || val >= MAX_CLIENTS)
{
Com_Printf(S_COLOR_YELLOW "WARNING: VoIP "
"target %d is not a valid client "
"number\n", val);
continue;
}
clc.voipTargets[val / 8] |= 1 << (val % 8);
}
}
/*
===============
CL_CaptureVoip
@ -342,8 +422,9 @@ void CL_CaptureVoip(void)
cl_voipSend->modified = qfalse;
if (dontCapture) {
cl_voipSend->integer = 0;
if(dontCapture)
{
Cvar_Set("cl_voipSend", "0");
return;
}
@ -357,16 +438,15 @@ void CL_CaptureVoip(void)
// try to get more audio data from the sound card...
if (initialFrame) {
float gain = cl_voipGainDuringCapture->value;
if (gain < 0.0f) gain = 0.0f; else if (gain >= 1.0f) gain = 1.0f;
S_MasterGain(cl_voipGainDuringCapture->value);
S_MasterGain(Com_Clamp(0.0f, 1.0f, cl_voipGainDuringCapture->value));
S_StartCapture();
CL_VoipNewGeneration();
CL_VoipParseTargets();
}
if ((cl_voipSend->integer) || (finalFrame)) { // user wants to capture audio?
int samples = S_AvailableCaptureSamples();
const int mult = (finalFrame) ? 1 : 12; // 12 == 240ms of audio.
const int mult = (finalFrame) ? 1 : 4; // 4 == 80ms of audio.
// enough data buffered in audio hardware to process yet?
if (samples >= (clc.speexFrameSize * mult)) {
@ -378,8 +458,8 @@ void CL_CaptureVoip(void)
int wpos = 0;
int pos = 0;
if (samples > (clc.speexFrameSize * 12))
samples = (clc.speexFrameSize * 12);
if (samples > (clc.speexFrameSize * 4))
samples = (clc.speexFrameSize * 4);
// !!! FIXME: maybe separate recording from encoding, so voipPower
// !!! FIXME: updates faster than 4Hz?
@ -498,9 +578,8 @@ CL_ChangeReliableCommand
======================
*/
void CL_ChangeReliableCommand( void ) {
int r, index, l;
int index, l;
r = clc.reliableSequence - (random() * 5);
index = clc.reliableSequence & ( MAX_RELIABLE_COMMANDS - 1 );
l = strlen(clc.reliableCommands[ index ]);
if ( l >= MAX_STRING_CHARS - 1 ) {
@ -2225,9 +2304,9 @@ void CL_CheckForResend( void ) {
#endif
// The challenge request shall be followed by a client challenge so no malicious server can hijack this connection.
// Add the heartbeat gamename so the server knows we're running the correct game and can reject the client
// Add the gamename so the server knows we're running the correct game or can reject the client
// with a meaningful message
Com_sprintf(data, sizeof(data), "getchallenge %d %s", clc.challenge, Cvar_VariableString("sv_heartbeat"));
Com_sprintf(data, sizeof(data), "getchallenge %d %s", clc.challenge, com_gamename->string);
NET_OutOfBandPrint(NS_CLIENT, clc.serverAddress, "%s", data);
break;
@ -2917,7 +2996,7 @@ void CL_Frame ( int msec ) {
cls.realtime += cls.frametime;
if ( cl_timegraph->integer ) {
SCR_DebugGraph ( cls.realFrametime * 0.25, 0 );
SCR_DebugGraph ( cls.realFrametime * 0.25 );
}
// see if we need to update any userinfo
@ -3391,8 +3470,6 @@ void CL_Init( void ) {
// ~ and `, as keys and characters
cl_consoleKeys = Cvar_Get( "cl_consoleKeys", "~ ` 0x7e 0x60", CVAR_ARCHIVE);
cl_gamename = Cvar_Get("cl_gamename", GAMENAME_FOR_MASTER, CVAR_TEMP);
// userinfo
Cvar_Get ("name", "UnnamedPlayer", CVAR_USERINFO | CVAR_ARCHIVE );
Cvar_Get ("rate", "25000", CVAR_USERINFO | CVAR_ARCHIVE );
@ -3420,7 +3497,7 @@ void CL_Init( void ) {
#ifdef USE_VOIP
cl_voipSend = Cvar_Get ("cl_voipSend", "0", 0);
cl_voipSendTarget = Cvar_Get ("cl_voipSendTarget", "all", 0);
cl_voipSendTarget = Cvar_Get ("cl_voipSendTarget", "spatial", 0);
cl_voipGainDuringCapture = Cvar_Get ("cl_voipGainDuringCapture", "0.2", CVAR_ARCHIVE);
cl_voipCaptureMult = Cvar_Get ("cl_voipCaptureMult", "2.0", CVAR_ARCHIVE);
cl_voipUseVAD = Cvar_Get ("cl_voipUseVAD", "0", CVAR_ARCHIVE);
@ -3615,9 +3692,19 @@ void CL_ServerInfoPacket( netadr_t from, msg_t *msg ) {
char info[MAX_INFO_STRING];
char *infoString;
int prot;
char *gamename;
infoString = MSG_ReadString( msg );
// if this isn't the correct gamename, ignore it
gamename = Info_ValueForKey( infoString, "gamename" );
if (gamename && *gamename && strcmp(gamename, com_gamename->string))
{
Com_DPrintf( "Game mismatch in info packet: %s\n", infoString );
return;
}
// if this isn't the correct protocol version, ignore it
prot = atoi( Info_ValueForKey( infoString, "protocol" ) );
@ -3719,10 +3806,8 @@ CL_GetServerStatus
===================
*/
serverStatus_t *CL_GetServerStatus( netadr_t from ) {
serverStatus_t *serverStatus;
int i, oldest, oldestTime;
serverStatus = NULL;
for (i = 0; i < MAX_SERVERSTATUSREQUESTS; i++) {
if ( NET_CompareAdr( from, cl_serverStatusList[i].address ) ) {
return &cl_serverStatusList[i];
@ -3999,16 +4084,17 @@ void CL_GlobalServers_f( void ) {
if(v4enabled)
{
Com_sprintf(command, sizeof(command), "getserversExt %s %s",
cl_gamename->string, Cmd_Argv(2));
com_gamename->string, Cmd_Argv(2));
}
else
{
Com_sprintf(command, sizeof(command), "getserversExt %s %s ipv6",
cl_gamename->string, Cmd_Argv(2));
com_gamename->string, Cmd_Argv(2));
}
}
else
Com_sprintf(command, sizeof(command), "getservers %s", Cmd_Argv(2));
Com_sprintf(command, sizeof(command), "getservers %s %s",
com_gamename->string, Cmd_Argv(2));
for (i=3; i < count; i++)
{
@ -4246,7 +4332,6 @@ qboolean CL_UpdateVisiblePings_f(int source) {
if (slots < MAX_PINGREQUESTS) {
serverInfo_t *server = NULL;
max = (source == AS_GLOBAL) ? MAX_GLOBAL_SERVERS : MAX_OTHER_SERVERS;
switch (source) {
case AS_LOCAL :
server = &cls.localServers[0];

View file

@ -663,6 +663,29 @@ qboolean CL_ShouldIgnoreVoipSender(int sender)
return qfalse;
}
/*
=====================
CL_PlayVoip
Play raw data
=====================
*/
static void CL_PlayVoip(int sender, int samplecnt, const byte *data, int flags)
{
if(flags & VOIP_DIRECT)
{
S_RawSamples(sender + 1, samplecnt, clc.speexSampleRate, 2, 1,
data, clc.voipGain[sender], -1);
}
if(flags & VOIP_SPATIAL)
{
S_RawSamples(sender + MAX_CLIENTS + 1, samplecnt, clc.speexSampleRate, 2, 1,
data, 1.0f, sender);
}
}
/*
=====================
CL_ParseVoip
@ -679,6 +702,7 @@ void CL_ParseVoip ( msg_t *msg ) {
const int sequence = MSG_ReadLong(msg);
const int frames = MSG_ReadByte(msg);
const int packetsize = MSG_ReadShort(msg);
const int flags = MSG_ReadBits(msg, VOIP_FLAGCNT);
char encoded[1024];
int seqdiff = sequence - clc.voipIncomingSequence[sender];
int written = 0;
@ -769,8 +793,8 @@ void CL_ParseVoip ( msg_t *msg ) {
if ((written + clc.speexFrameSize) * 2 > sizeof (decoded)) {
Com_DPrintf("VoIP: playback %d bytes, %d samples, %d frames\n",
written * 2, written, i);
S_RawSamples(sender + 1, written, clc.speexSampleRate, 2, 1,
(const byte *) decoded, clc.voipGain[sender]);
CL_PlayVoip(sender, written, (const byte *) decoded, flags);
written = 0;
}
@ -793,10 +817,8 @@ void CL_ParseVoip ( msg_t *msg ) {
Com_DPrintf("VoIP: playback %d bytes, %d samples, %d frames\n",
written * 2, written, i);
if (written > 0) {
S_RawSamples(sender + 1, written, clc.speexSampleRate, 2, 1,
(const byte *) decoded, clc.voipGain[sender]);
}
if(written > 0)
CL_PlayVoip(sender, written, (const byte *) decoded, flags);
clc.voipIncomingSequence[sender] = sequence + frames;
}

View file

@ -395,25 +395,18 @@ DEBUG GRAPH
===============================================================================
*/
typedef struct
{
float value;
int color;
} graphsamp_t;
static int current;
static graphsamp_t values[1024];
static float values[1024];
/*
==============
SCR_DebugGraph
==============
*/
void SCR_DebugGraph (float value, int color)
void SCR_DebugGraph (float value)
{
values[current&1023].value = value;
values[current&1023].color = color;
current++;
values[current] = value;
current = (current + 1) % ARRAY_LEN(values);
}
/*
@ -425,7 +418,6 @@ void SCR_DrawDebugGraph (void)
{
int a, x, y, w, i, h;
float v;
int color;
//
// draw the graph
@ -440,9 +432,8 @@ void SCR_DrawDebugGraph (void)
for (a=0 ; a<w ; a++)
{
i = (current-1-a+1024) & 1023;
v = values[i].value;
color = values[i].color;
i = (ARRAY_LEN(values)+current-1-(a % ARRAY_LEN(values))) % ARRAY_LEN(values);
v = values[i];
v = v * cl_graphscale->integer + cl_graphshift->integer;
if (v < 0)

View file

@ -250,9 +250,10 @@ typedef struct {
qboolean voipMuteAll;
// outgoing data...
int voipTarget1; // these three ints make up a bit mask of 92 bits.
int voipTarget2; // the bits say who a VoIP pack is addressed to:
int voipTarget3; // (1 << clientnum). See cl_voipSendTarget cvar.
// if voipTargets[i / 8] & (1 << (i % 8)),
// then we are sending to clientnum i.
uint8_t voipTargets[(MAX_CLIENTS + 7) / 8];
uint8_t voipFlags;
SpeexPreprocessState *speexPreprocessor;
SpeexBits speexEncoderBits;
void *speexEncoder;
@ -563,7 +564,7 @@ void CL_SaveConsoleHistory( void );
void SCR_Init (void);
void SCR_UpdateScreen (void);
void SCR_DebugGraph (float value, int color);
void SCR_DebugGraph (float value);
int SCR_GetBigStringWidth( const char *str ); // returns in virtual 640x480 coordinates

View file

@ -131,7 +131,6 @@ S_ReadRIFFHeader
static qboolean S_ReadRIFFHeader(fileHandle_t file, snd_info_t *info)
{
char dump[16];
int wav_format;
int bits;
int fmtlen = 0;
@ -146,7 +145,7 @@ static qboolean S_ReadRIFFHeader(fileHandle_t file, snd_info_t *info)
}
// Save the parameters
wav_format = FGetLittleShort(file);
FGetLittleShort(file); // wav_format
info->channels = FGetLittleShort(file);
info->rate = FGetLittleLong(file);
FGetLittleLong(file);

View file

@ -916,7 +916,8 @@ S_Base_RawSamples
Music streaming
============
*/
void S_Base_RawSamples( int stream, int samples, int rate, int width, int s_channels, const byte *data, float volume ) {
void S_Base_RawSamples( int stream, int samples, int rate, int width, int s_channels, const byte *data, float volume, int entityNum)
{
int i;
int src, dst;
float scale;
@ -927,9 +928,16 @@ void S_Base_RawSamples( int stream, int samples, int rate, int width, int s_chan
return;
}
if(entityNum >= 0)
{
// FIXME: support spatialized raw streams, e.g. for VoIP
return;
}
if ( (stream < 0) || (stream >= MAX_RAW_STREAMS) ) {
return;
}
rawsamples = s_rawsamples[stream];
if(s_muted->integer)
@ -1395,8 +1403,8 @@ void S_UpdateBackgroundTrack( void ) {
if(r > 0)
{
// add to raw buffer
S_Base_RawSamples( 0, fileSamples, s_backgroundStream->info.rate,
s_backgroundStream->info.width, s_backgroundStream->info.channels, raw, s_musicVolume->value );
S_Base_RawSamples(0, fileSamples, s_backgroundStream->info.rate,
s_backgroundStream->info.width, s_backgroundStream->info.channels, raw, s_musicVolume->value, -1);
}
else
{

View file

@ -125,7 +125,7 @@ typedef struct
void (*StartLocalSound)( sfxHandle_t sfx, int channelNum );
void (*StartBackgroundTrack)( const char *intro, const char *loop );
void (*StopBackgroundTrack)( void );
void (*RawSamples)(int stream, int samples, int rate, int width, int channels, const byte *data, float volume);
void (*RawSamples)(int stream, int samples, int rate, int width, int channels, const byte *data, float volume, int entityNum);
void (*StopAllSounds)( void );
void (*ClearLoopingSounds)( qboolean killall );
void (*AddLoopingSound)( int entityNum, const vec3_t origin, const vec3_t velocity, sfxHandle_t sfx );
@ -186,7 +186,7 @@ extern vec3_t listener_up;
extern dma_t dma;
#define MAX_RAW_SAMPLES 16384
#define MAX_RAW_STREAMS 128
#define MAX_RAW_STREAMS (MAX_CLIENTS * 2 + 1)
extern portable_samplepair_t s_rawsamples[MAX_RAW_STREAMS][MAX_RAW_SAMPLES];
extern int s_rawend[MAX_RAW_STREAMS];

View file

@ -129,11 +129,10 @@ S_RawSamples
=================
*/
void S_RawSamples (int stream, int samples, int rate, int width, int channels,
const byte *data, float volume)
const byte *data, float volume, int entityNum)
{
if( si.RawSamples ) {
si.RawSamples( stream, samples, rate, width, channels, data, volume );
}
if(si.RawSamples)
si.RawSamples(stream, samples, rate, width, channels, data, volume, entityNum);
}
/*

View file

@ -243,8 +243,6 @@ S_AL_BufferUnload
*/
static void S_AL_BufferUnload(sfxHandle_t sfx)
{
ALenum error;
if(knownSfx[sfx].filename[0] == '\0')
return;
@ -254,7 +252,7 @@ static void S_AL_BufferUnload(sfxHandle_t sfx)
// Delete it
S_AL_ClearError( qfalse );
qalDeleteBuffers(1, &knownSfx[sfx].buffer);
if((error = qalGetError()) != AL_NO_ERROR)
if(qalGetError() != AL_NO_ERROR)
Com_Printf( S_COLOR_RED "ERROR: Can't delete sound buffer for %s\n",
knownSfx[sfx].filename);
@ -521,6 +519,7 @@ typedef struct src_s
qboolean isLocked; // This is locked (un-allocatable)
qboolean isLooping; // Is this a looping effect (attached to an entity)
qboolean isTracking; // Is this object tracking its owner
qboolean isStream; // Is this source a stream
float curGain; // gain employed if source is within maxdistance.
float scaleGain; // Last gain value for this source. 0 if muted.
@ -672,7 +671,6 @@ qboolean S_AL_SrcInit( void )
{
int i;
int limit;
ALenum error;
// Clear the sources data structure
memset(srcList, 0, sizeof(srcList));
@ -691,7 +689,7 @@ qboolean S_AL_SrcInit( void )
for(i = 0; i < limit; i++)
{
qalGenSources(1, &srcList[i].alSource);
if((error = qalGetError()) != AL_NO_ERROR)
if(qalGetError() != AL_NO_ERROR)
break;
srcCount++;
}
@ -744,13 +742,8 @@ S_AL_SrcSetup
static void S_AL_SrcSetup(srcHandle_t src, sfxHandle_t sfx, alSrcPriority_t priority,
int entity, int channel, qboolean local)
{
ALuint buffer;
src_t *curSource;
// Mark the SFX as used, and grab the raw AL buffer
S_AL_BufferUse(sfx);
buffer = S_AL_BufferGet(sfx);
// Set up src struct
curSource = &srcList[src];
@ -763,12 +756,19 @@ static void S_AL_SrcSetup(srcHandle_t src, sfxHandle_t sfx, alSrcPriority_t prio
curSource->isLocked = qfalse;
curSource->isLooping = qfalse;
curSource->isTracking = qfalse;
curSource->isStream = qfalse;
curSource->curGain = s_alGain->value * s_volume->value;
curSource->scaleGain = curSource->curGain;
curSource->local = local;
// Set up OpenAL source
qalSourcei(curSource->alSource, AL_BUFFER, buffer);
if(sfx >= 0)
{
// Mark the SFX as used, and grab the raw AL buffer
S_AL_BufferUse(sfx);
qalSourcei(curSource->alSource, AL_BUFFER, S_AL_BufferGet(sfx));
}
qalSourcef(curSource->alSource, AL_PITCH, 1.0f);
S_AL_Gain(curSource->alSource, curSource->curGain);
qalSourcefv(curSource->alSource, AL_POSITION, vec3_origin);
@ -1320,7 +1320,7 @@ static void S_AL_SrcLoop( alSrcPriority_t priority, sfxHandle_t sfx,
VectorClear(sorigin);
qalSourcefv(curSource->alSource, AL_POSITION, sorigin);
qalSourcefv(curSource->alSource, AL_VELOCITY, sorigin);
qalSourcefv(curSource->alSource, AL_VELOCITY, vec3_origin);
}
else
{
@ -1343,8 +1343,8 @@ static void S_AL_SrcLoop( alSrcPriority_t priority, sfxHandle_t sfx,
else
VectorClear(svelocity);
qalSourcefv( curSource->alSource, AL_POSITION, (ALfloat *)sorigin );
qalSourcefv( curSource->alSource, AL_VELOCITY, (ALfloat *)velocity );
qalSourcefv(curSource->alSource, AL_POSITION, (ALfloat *) sorigin);
qalSourcefv(curSource->alSource, AL_VELOCITY, (ALfloat *) svelocity);
}
}
@ -1557,14 +1557,17 @@ void S_AL_SrcUpdate( void )
continue;
}
// Check if it's done, and flag it
qalGetSourcei(curSource->alSource, AL_SOURCE_STATE, &state);
if(state == AL_STOPPED)
if(!curSource->isStream)
{
curSource->isPlaying = qfalse;
S_AL_SrcKill(i);
continue;
}
// Check if it's done, and flag it
qalGetSourcei(curSource->alSource, AL_SOURCE_STATE, &state);
if(state == AL_STOPPED)
{
curSource->isPlaying = qfalse;
S_AL_SrcKill(i);
continue;
}
}
// Query relativity of source, don't move if it's true
qalGetSourcei(curSource->alSource, AL_SOURCE_RELATIVE, &state);
@ -1614,32 +1617,57 @@ static ALuint streamSources[MAX_RAW_STREAMS];
S_AL_AllocateStreamChannel
=================
*/
static void S_AL_AllocateStreamChannel( int stream )
static void S_AL_AllocateStreamChannel(int stream, int entityNum)
{
srcHandle_t cursrc;
ALuint alsrc;
if ((stream < 0) || (stream >= MAX_RAW_STREAMS))
return;
// Allocate a streamSource at high priority
streamSourceHandles[stream] = S_AL_SrcAlloc(SRCPRI_STREAM, -2, 0);
if(streamSourceHandles[stream] == -1)
return;
if(entityNum >= 0)
{
// This is a stream that tracks an entity
// Allocate a streamSource at normal priority
cursrc = S_AL_SrcAlloc(SRCPRI_ENTITY, entityNum, 0);
if(cursrc < 0)
return;
// Lock the streamSource so nobody else can use it, and get the raw streamSource
S_AL_SrcLock(streamSourceHandles[stream]);
streamSources[stream] = S_AL_SrcGet(streamSourceHandles[stream]);
S_AL_SrcSetup(cursrc, -1, SRCPRI_ENTITY, entityNum, 0, qfalse);
alsrc = S_AL_SrcGet(cursrc);
srcList[cursrc].isTracking = qtrue;
srcList[cursrc].isStream = qtrue;
}
else
{
// Unspatialized stream source
// make sure that after unmuting the S_AL_Gain in S_Update() does not turn
// volume up prematurely for this source
srcList[streamSourceHandles[stream]].scaleGain = 0.0f;
// Allocate a streamSource at high priority
cursrc = S_AL_SrcAlloc(SRCPRI_STREAM, -2, 0);
if(cursrc < 0)
return;
// Set some streamSource parameters
qalSourcei (streamSources[stream], AL_BUFFER, 0 );
qalSourcei (streamSources[stream], AL_LOOPING, AL_FALSE );
qalSource3f(streamSources[stream], AL_POSITION, 0.0, 0.0, 0.0);
qalSource3f(streamSources[stream], AL_VELOCITY, 0.0, 0.0, 0.0);
qalSource3f(streamSources[stream], AL_DIRECTION, 0.0, 0.0, 0.0);
qalSourcef (streamSources[stream], AL_ROLLOFF_FACTOR, 0.0 );
qalSourcei (streamSources[stream], AL_SOURCE_RELATIVE, AL_TRUE );
alsrc = S_AL_SrcGet(cursrc);
// Lock the streamSource so nobody else can use it, and get the raw streamSource
S_AL_SrcLock(cursrc);
// make sure that after unmuting the S_AL_Gain in S_Update() does not turn
// volume up prematurely for this source
srcList[cursrc].scaleGain = 0.0f;
// Set some streamSource parameters
qalSourcei (alsrc, AL_BUFFER, 0 );
qalSourcei (alsrc, AL_LOOPING, AL_FALSE );
qalSource3f(alsrc, AL_POSITION, 0.0, 0.0, 0.0);
qalSource3f(alsrc, AL_VELOCITY, 0.0, 0.0, 0.0);
qalSource3f(alsrc, AL_DIRECTION, 0.0, 0.0, 0.0);
qalSourcef (alsrc, AL_ROLLOFF_FACTOR, 0.0 );
qalSourcei (alsrc, AL_SOURCE_RELATIVE, AL_TRUE );
}
streamSourceHandles[stream] = cursrc;
streamSources[stream] = alsrc;
}
/*
@ -1654,6 +1682,7 @@ static void S_AL_FreeStreamChannel( int stream )
// Release the output streamSource
S_AL_SrcUnlock(streamSourceHandles[stream]);
S_AL_SrcKill(streamSourceHandles[stream]);
streamSources[stream] = 0;
streamSourceHandles[stream] = -1;
}
@ -1664,7 +1693,7 @@ S_AL_RawSamples
=================
*/
static
void S_AL_RawSamples(int stream, int samples, int rate, int width, int channels, const byte *data, float volume)
void S_AL_RawSamples(int stream, int samples, int rate, int width, int channels, const byte *data, float volume, int entityNum)
{
ALuint buffer;
ALuint format;
@ -1677,7 +1706,7 @@ void S_AL_RawSamples(int stream, int samples, int rate, int width, int channels,
// Create the streamSource if necessary
if(streamSourceHandles[stream] == -1)
{
S_AL_AllocateStreamChannel(stream);
S_AL_AllocateStreamChannel(stream, entityNum);
// Failed?
if(streamSourceHandles[stream] == -1)
@ -1694,8 +1723,11 @@ void S_AL_RawSamples(int stream, int samples, int rate, int width, int channels,
// Shove the data onto the streamSource
qalSourceQueueBuffers(streamSources[stream], 1, &buffer);
// Volume
S_AL_Gain (streamSources[stream], volume * s_volume->value * s_alGain->value);
if(entityNum < 0)
{
// Volume
S_AL_Gain (streamSources[stream], volume * s_volume->value * s_alGain->value);
}
}
/*
@ -2106,7 +2138,6 @@ S_AL_Respatialize
static
void S_AL_Respatialize( int entityNum, const vec3_t origin, vec3_t axis[3], int inwater )
{
float velocity[3] = {0.0f, 0.0f, 0.0f};
float orientation[6];
vec3_t sorigin;
@ -2124,7 +2155,7 @@ void S_AL_Respatialize( int entityNum, const vec3_t origin, vec3_t axis[3], int
// Set OpenAL listener paramaters
qalListenerfv(AL_POSITION, (ALfloat *)sorigin);
qalListenerfv(AL_VELOCITY, velocity);
qalListenerfv(AL_VELOCITY, vec3_origin);
qalListenerfv(AL_ORIENTATION, orientation);
}
@ -2406,20 +2437,26 @@ qboolean S_AL_Init( soundInterface_t *si )
{
char devicenames[16384] = "";
const char *devicelist;
#ifdef _WIN32
const char *defaultdevice;
#endif
int curlen;
// get all available devices + the default device name.
if(enumeration_all_ext)
{
devicelist = qalcGetString(NULL, ALC_ALL_DEVICES_SPECIFIER);
#ifdef _WIN32
defaultdevice = qalcGetString(NULL, ALC_DEFAULT_ALL_DEVICES_SPECIFIER);
#endif
}
else
{
// We don't have ALC_ENUMERATE_ALL_EXT but normal enumeration.
devicelist = qalcGetString(NULL, ALC_DEVICE_SPECIFIER);
#ifdef _WIN32
defaultdevice = qalcGetString(NULL, ALC_DEFAULT_DEVICE_SPECIFIER);
#endif
enumeration_ext = qtrue;
}

View file

@ -33,8 +33,8 @@ void S_StopBackgroundTrack( void );
// cinematics and voice-over-network will send raw samples
// 1.0 volume will be direct output of source samples
void S_RawSamples (int stream, int samples, int rate, int width, int channels,
const byte *data, float volume);
void S_RawSamples(int stream, int samples, int rate, int width, int channels,
const byte *data, float volume, int entityNum);
// stop all sounds and the background track
void S_StopAllSounds( void );

View file

@ -985,9 +985,9 @@ BotChatTime
==================
*/
float BotChatTime(bot_state_t *bs) {
int cpm;
//int cpm;
cpm = trap_Characteristic_BInteger(bs->character, CHARACTERISTIC_CHAT_CPM, 1, 4000);
//cpm = trap_Characteristic_BInteger(bs->character, CHARACTERISTIC_CHAT_CPM, 1, 4000);
return 2.0; //(float) trap_BotChatLength(bs->cs) * 30 / cpm;
}

View file

@ -699,9 +699,7 @@ int BotGetLongTermGoal(bot_state_t *bs, int tfl, int retreat, bot_goal_t *goal)
bs->ltgtype = 0;
}
//
if (bs->camp_range > 0) {
//FIXME: move around a bit
}
//FIXME: move around a bit
//
trap_BotResetAvoidReach(bs->ms);
return qfalse;

View file

@ -4496,7 +4496,8 @@ open, which buttons to activate etc.
*/
void BotAIBlocked(bot_state_t *bs, bot_moveresult_t *moveresult, int activate) {
int movetype, bspent;
vec3_t hordir, start, end, mins, maxs, sideward, angles, up = {0, 0, 1};
vec3_t hordir, sideward, angles, up = {0, 0, 1};
//vec3_t start, end, mins, maxs;
aas_entityinfo_t entinfo;
bot_activategoal_t activategoal;
@ -4558,11 +4559,11 @@ void BotAIBlocked(bot_state_t *bs, bot_moveresult_t *moveresult, int activate) {
movetype = MOVE_WALK;
// if there's an obstacle at the bot's feet and head then
// the bot might be able to crouch through
VectorCopy(bs->origin, start);
start[2] += 18;
VectorMA(start, 5, hordir, end);
VectorSet(mins, -16, -16, -24);
VectorSet(maxs, 16, 16, 4);
//VectorCopy(bs->origin, start);
//start[2] += 18;
//VectorMA(start, 5, hordir, end);
//VectorSet(mins, -16, -16, -24);
//VectorSet(maxs, 16, 16, 4);
//
//bsptrace = AAS_Trace(start, mins, maxs, end, bs->entitynum, MASK_PLAYERSOLID);
//if (bsptrace.fraction >= 1) movetype = MOVE_CROUCH;

View file

@ -196,7 +196,6 @@ typedef struct bot_state_s
float lastair_time; //last time the bot had air
float teleport_time; //last time the bot teleported
float camp_time; //last time camped
float camp_range; //camp range
float weaponchange_time; //time the bot started changing weapons
float firethrottlewait_time; //amount of time to wait
float firethrottleshoot_time; //amount of time to shoot
@ -268,11 +267,6 @@ typedef struct bot_state_s
int ctfstrategy; //ctf strategy
char subteam[32]; //sub team name
float formation_dist; //formation team mate intervening space
char formation_teammate[16]; //netname of the team mate the bot uses for relative positioning
float formation_angle; //angle relative to the formation team mate
vec3_t formation_dir; //the direction the formation is moving in
vec3_t formation_origin; //origin the bot uses for relative positioning
bot_goal_t formation_goal; //formation goal
bot_activategoal_t *activatestack; //first activate goal on the stack
bot_activategoal_t activategoalheap[MAX_ACTIVATESTACK]; //activate goal heap

View file

@ -514,7 +514,8 @@ voiceCommand_t voiceCommands[] = {
};
int BotVoiceChatCommand(bot_state_t *bs, int mode, char *voiceChat) {
int i, voiceOnly, clientNum, color;
int i, clientNum;
//int voiceOnly, color;
char *ptr, buf[MAX_MESSAGE_SIZE], *cmd;
if (!TeamPlayIsOn()) {
@ -529,13 +530,13 @@ int BotVoiceChatCommand(bot_state_t *bs, int mode, char *voiceChat) {
cmd = buf;
for (ptr = cmd; *cmd && *cmd > ' '; cmd++);
while (*cmd && *cmd <= ' ') *cmd++ = '\0';
voiceOnly = atoi(ptr);
//voiceOnly = atoi(ptr);
for (ptr = cmd; *cmd && *cmd > ' '; cmd++);
while (*cmd && *cmd <= ' ') *cmd++ = '\0';
clientNum = atoi(ptr);
for (ptr = cmd; *cmd && *cmd > ' '; cmd++);
while (*cmd && *cmd <= ' ') *cmd++ = '\0';
color = atoi(ptr);
//color = atoi(ptr);
if (!BotSameTeam(bs, clientNum)) {
return qfalse;

View file

@ -236,7 +236,7 @@ PM_StepSlideMove
*/
void PM_StepSlideMove( qboolean gravity ) {
vec3_t start_o, start_v;
vec3_t down_o, down_v;
// vec3_t down_o, down_v;
trace_t trace;
// float down_dist, up_dist;
// vec3_t delta, delta2;
@ -260,8 +260,8 @@ void PM_StepSlideMove( qboolean gravity ) {
return;
}
VectorCopy (pm->ps->origin, down_o);
VectorCopy (pm->ps->velocity, down_v);
//VectorCopy (pm->ps->origin, down_o);
//VectorCopy (pm->ps->velocity, down_v);
VectorCopy (start_o, up);
up[2] += STEPSIZE;

View file

@ -756,7 +756,6 @@ void ClientEvents( gentity_t *ent, int oldEventSequence ) {
int event;
gclient_t *client;
int damage;
vec3_t dir;
vec3_t origin, angles;
// qboolean fired;
gitem_t *item;
@ -784,7 +783,6 @@ void ClientEvents( gentity_t *ent, int oldEventSequence ) {
} else {
damage = 5;
}
VectorSet (dir, 0, 0, 1);
ent->pain_debounce_time = level.time + 200; // no normal pain sound
G_Damage (ent, NULL, NULL, NULL, NULL, damage, 0, MOD_FALLING);
break;
@ -1842,7 +1840,6 @@ while a slow client may have multiple ClientEndFrame between ClientThink.
*/
void ClientEndFrame( gentity_t *ent ) {
int i;
clientPersistant_t *pers;
// STONELANCE
// if ( ent->client->sess.sessionTeam == TEAM_SPECTATOR ) {
@ -1852,8 +1849,6 @@ void ClientEndFrame( gentity_t *ent ) {
return;
}
pers = &ent->client->pers;
// turn off any expired powerups
for ( i = 0 ; i < MAX_POWERUPS ; i++ ) {
// STONELANCE

View file

@ -235,7 +235,6 @@ LookAtKiller
*/
void LookAtKiller( gentity_t *self, gentity_t *inflictor, gentity_t *attacker ) {
vec3_t dir;
vec3_t angles;
if ( attacker && attacker != self ) {
VectorSubtract (attacker->s.pos.trBase, self->s.pos.trBase, dir);
@ -247,10 +246,6 @@ void LookAtKiller( gentity_t *self, gentity_t *inflictor, gentity_t *attacker )
}
self->client->ps.stats[STAT_DEAD_YAW] = vectoyaw ( dir );
angles[YAW] = vectoyaw ( dir );
angles[PITCH] = 0;
angles[ROLL] = 0;
}
/*
@ -901,7 +896,6 @@ void G_Damage( gentity_t *targ, gentity_t *inflictor, gentity_t *attacker,
vec3_t dir, vec3_t point, int damage, int dflags, int mod ) {
gclient_t *client;
int take;
int save;
int asave;
int knockback;
int max;
@ -1112,7 +1106,6 @@ void G_Damage( gentity_t *targ, gentity_t *inflictor, gentity_t *attacker,
damage = 1;
}
take = damage;
save = 0;
// save some from armor
asave = CheckArmor (targ, take, dflags);

View file

@ -301,7 +301,7 @@ int Pickup_Health (gentity_t *ent, gentity_t *other) {
// small and mega healths will go over the max
#ifdef MISSIONPACK
if( other->client && bg_itemlist[other->client->ps.stats[STAT_PERSISTANT_POWERUP]].giTag == PW_GUARD ) {
if( bg_itemlist[other->client->ps.stats[STAT_PERSISTANT_POWERUP]].giTag == PW_GUARD ) {
max = other->client->ps.stats[STAT_MAX_HEALTH];
}
else

View file

@ -840,7 +840,7 @@ void QDECL G_DebugLogPrintf( const char *fmt, ... ) __attribute__ ((format (prin
// END
void SendScoreboardMessageToAllClients( void );
void QDECL G_Printf( const char *fmt, ... ) __attribute__ ((format (printf, 1, 2)));
void QDECL G_Error( const char *fmt, ... ) __attribute__ ((format (printf, 1, 2)));
void QDECL G_Error( const char *fmt, ... ) __attribute__ ((noreturn, format (printf, 1, 2)));
//
// g_client.c
@ -1013,7 +1013,7 @@ extern vmCvar_t car_friction_scale;
// END
void trap_Printf( const char *fmt );
void trap_Error( const char *fmt );
void trap_Error(const char *fmt) __attribute__((noreturn));
int trap_Milliseconds( void );
int trap_Argc( void );
void trap_Argv( int n, char *buffer, int bufferLength );

View file

@ -2150,8 +2150,6 @@ Advances the non-player objects in the world
void G_RunFrame( int levelTime ) {
int i;
gentity_t *ent;
int msec;
int start, end;
// if we are waiting for the level to restart, do nothing
if ( level.restarted ) {
@ -2166,7 +2164,6 @@ int start, end;
level.framenum++;
level.previousTime = level.time;
level.time = levelTime;
msec = level.time - level.previousTime;
// get any cvar changes
G_UpdateCvars();
@ -2182,7 +2179,6 @@ int start, end;
//
// go through all allocated objects
//
start = trap_Milliseconds();
ent = &g_entities[0];
for (i=0 ; i<level.num_entities ; i++, ent++) {
if ( !ent->inuse ) {
@ -2242,9 +2238,7 @@ int start, end;
G_RunThink( ent );
}
end = trap_Milliseconds();
start = trap_Milliseconds();
// perform final fixups on the players
ent = &g_entities[0];
for (i=0 ; i < level.maxclients ; i++, ent++ ) {
@ -2252,7 +2246,6 @@ start = trap_Milliseconds();
ClientEndFrame( ent );
}
}
end = trap_Milliseconds();
// see if it is time to do a tournement restart
CheckTournament();

View file

@ -46,8 +46,10 @@ void trap_Printf( const char *fmt ) {
syscall( G_PRINT, fmt );
}
void trap_Error( const char *fmt ) {
syscall( G_ERROR, fmt );
void trap_Error(const char *fmt)
{
syscall(G_ERROR, fmt);
exit(1);
}
int trap_Milliseconds( void ) {

View file

@ -88,16 +88,6 @@ const char *TeamName(int team) {
return "FREE";
}
const char *OtherTeamName(int team) {
if (team==TEAM_RED)
return "BLUE";
else if (team==TEAM_BLUE)
return "RED";
else if (team==TEAM_SPECTATOR)
return "SPECTATOR";
return "FREE";
}
const char *TeamColorString(int team) {
if (team==TEAM_RED)
return S_COLOR_RED;
@ -383,7 +373,6 @@ void Team_FragBonuses(gentity_t *targ, gentity_t *inflictor, gentity_t *attacker
targ->client->pers.teamState.lasthurtcarrier = 0;
attacker->client->ps.persistant[PERS_DEFEND_COUNT]++;
team = attacker->client->sess.sessionTeam;
// add the sprite over the player's head
attacker->client->ps.eFlags &= ~(EF_AWARD_IMPRESSIVE | EF_AWARD_EXCELLENT | EF_AWARD_GAUNTLET | EF_AWARD_ASSIST | EF_AWARD_DEFEND | EF_AWARD_CAP );
attacker->client->ps.eFlags |= EF_AWARD_DEFEND;
@ -401,7 +390,6 @@ void Team_FragBonuses(gentity_t *targ, gentity_t *inflictor, gentity_t *attacker
targ->client->pers.teamState.lasthurtcarrier = 0;
attacker->client->ps.persistant[PERS_DEFEND_COUNT]++;
team = attacker->client->sess.sessionTeam;
// add the sprite over the player's head
attacker->client->ps.eFlags &= ~(EF_AWARD_IMPRESSIVE | EF_AWARD_EXCELLENT | EF_AWARD_GAUNTLET | EF_AWARD_ASSIST | EF_AWARD_DEFEND | EF_AWARD_CAP );
attacker->client->ps.eFlags |= EF_AWARD_DEFEND;

View file

@ -70,7 +70,6 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
int OtherTeam(int team);
const char *TeamName(int team);
const char *OtherTeamName(int team);
const char *TeamColorString(int team);
void AddTeamScore(vec3_t origin, int team, int score);

View file

@ -397,7 +397,6 @@ void ShotgunPattern( vec3_t origin, vec3_t origin2, int seed, gentity_t *ent ) {
float r, u;
vec3_t end;
vec3_t forward, right, up;
int oldScore;
qboolean hitClient = qfalse;
// derive the right and up vectors from the forward vector, because
@ -406,8 +405,6 @@ void ShotgunPattern( vec3_t origin, vec3_t origin2, int seed, gentity_t *ent ) {
PerpendicularVector( right, forward );
CrossProduct( forward, right, up );
oldScore = ent->client->ps.persistant[PERS_SCORE];
// generate the "random" spread pattern
for ( i = 0 ; i < DEFAULT_SHOTGUN_COUNT ; i++ ) {
r = Q_crandom( &seed ) * DEFAULT_SHOTGUN_SPREAD * 16;

View file

@ -524,14 +524,15 @@ spx_int32_t *seed
VARDECL(int *ind);
VARDECL(int *signs);
const signed char *shape_cb;
int shape_cb_size, subvect_size, nb_subvect;
//int shape_cb_size;
int subvect_size, nb_subvect;
const split_cb_params *params;
int have_sign;
params = (const split_cb_params *) par;
subvect_size = params->subvect_size;
nb_subvect = params->nb_subvect;
shape_cb_size = 1<<params->shape_bits;
//shape_cb_size = 1<<params->shape_bits;
shape_cb = params->shape_cb;
have_sign = params->have_sign;

View file

@ -463,7 +463,7 @@ int jitter_buffer_get(JitterBuffer *jitter, JitterBufferPacket *packet, spx_int3
{
int i;
unsigned int j;
int incomplete = 0;
//int incomplete = 0;
spx_int16_t opt;
if (start_offset != NULL)
@ -568,7 +568,7 @@ int jitter_buffer_get(JitterBuffer *jitter, JitterBufferPacket *packet, spx_int3
if (found)
{
i=besti;
incomplete = 1;
//incomplete = 1;
/*fprintf (stderr, "incomplete: %d %d %d %d\n", jitter->packets[i].timestamp, jitter->pointer_timestamp, chunk_size, jitter->packets[i].span);*/
}
}

View file

@ -1300,7 +1300,7 @@ int nb_decode(void *state, SpeexBits *bits, void *vout)
{
int offset;
spx_word16_t *exc;
spx_word16_t *sp;
//spx_word16_t *sp;
spx_word16_t *innov_save = NULL;
spx_word16_t tmp;
@ -1309,7 +1309,7 @@ int nb_decode(void *state, SpeexBits *bits, void *vout)
/* Excitation */
exc=st->exc+offset;
/* Original signal */
sp=out+offset;
//sp=out+offset;
if (st->innov_save)
innov_save = st->innov_save+offset;
@ -1502,13 +1502,13 @@ int nb_decode(void *state, SpeexBits *bits, void *vout)
{
int offset;
spx_word16_t *sp;
spx_word16_t *exc;
//spx_word16_t *exc;
/* Offset relative to start of frame */
offset = st->subframeSize*sub;
/* Original signal */
sp=out+offset;
/* Excitation */
exc=st->exc+offset;
//exc=st->exc+offset;
/* LSP interpolation (quantized and unquantized) */
lsp_interpolate(st->old_qlsp, qlsp, interp_qlsp, st->lpcSize, sub, st->nbSubframes);

View file

@ -126,7 +126,7 @@ float vbr_analysis(VBRState *vbr, spx_word16_t *sig, int len, int pitch, float p
int i;
float ener=0, ener1=0, ener2=0;
float qual=7;
int va;
//int va;
float log_energy;
float non_st=0;
float voicing;
@ -159,7 +159,7 @@ float vbr_analysis(VBRState *vbr, spx_word16_t *sig, int len, int pitch, float p
|| (voicing<0 && non_st < .05))
{
float tmp;
va = 0;
//va = 0;
vbr->consec_noise++;
if (pow_ener > 3*vbr->noise_level)
tmp = 3*vbr->noise_level;
@ -171,7 +171,7 @@ float vbr_analysis(VBRState *vbr, spx_word16_t *sig, int len, int pitch, float p
vbr->noise_accum_count = .95*vbr->noise_accum_count + .05;
}
} else {
va = 1;
//va = 1;
vbr->consec_noise=0;
}

View file

@ -83,7 +83,7 @@ static void UI_DisplayDownloadInfo( const char *downloadName ) {
downloadCount = trap_Cvar_VariableValue( "cl_downloadCount" );
downloadTime = trap_Cvar_VariableValue( "cl_downloadTime" );
leftWidth = width = UI_ProportionalStringWidth( dlText ) * UI_ProportionalSizeScale( style );
leftWidth = UI_ProportionalStringWidth( dlText ) * UI_ProportionalSizeScale( style );
width = UI_ProportionalStringWidth( etaText ) * UI_ProportionalSizeScale( style );
if (width > leftWidth) leftWidth = width;
width = UI_ProportionalStringWidth( xferText ) * UI_ProportionalSizeScale( style );

View file

@ -106,20 +106,6 @@ static void Demos_MenuEvent( void *ptr, int event ) {
}
/*
=================
UI_DemosMenu_Key
=================
*/
static sfxHandle_t UI_DemosMenu_Key( int key ) {
menucommon_s *item;
item = Menu_ItemAtCursor( &s_demos.menu );
return Menu_DefaultKey( &s_demos.menu, key );
}
/*
===============
Demos_MenuInit
@ -132,7 +118,6 @@ static void Demos_MenuInit( void ) {
int protocol, protocolLegacy;
memset( &s_demos, 0 ,sizeof(demos_t) );
s_demos.menu.key = UI_DemosMenu_Key;
Demos_Cache();

View file

@ -833,7 +833,7 @@ void UI_SPSkillMenu_Cache( void );
// ui_syscalls.c
//
void trap_Print( const char *string );
void trap_Error( const char *string );
void trap_Error( const char *string ) __attribute__((noreturn));
int trap_Milliseconds( void );
void trap_Cvar_Register( vmCvar_t *vmCvar, const char *varName, const char *defaultValue, int flags );
void trap_Cvar_Update( vmCvar_t *vmCvar );

View file

@ -335,7 +335,6 @@ void MenuField_Draw( menufield_s *f )
int x;
int y;
int w;
int h;
int style;
qboolean focus;
float *color;
@ -346,13 +345,11 @@ void MenuField_Draw( menufield_s *f )
if (f->generic.flags & QMF_SMALLFONT)
{
w = SMALLCHAR_WIDTH;
h = SMALLCHAR_HEIGHT;
style = UI_SMALLFONT;
}
else
{
w = BIGCHAR_WIDTH;
h = BIGCHAR_HEIGHT;
style = UI_BIGFONT;
}

View file

@ -856,13 +856,11 @@ void ArenaServers_LoadFavorites( void )
int i;
int j;
int numtempitems;
char emptyinfo[MAX_INFO_STRING];
char adrstr[MAX_ADDRESSLENGTH];
servernode_t templist[MAX_FAVORITESERVERS];
qboolean found;
found = qfalse;
emptyinfo[0] = '\0';
// copy the old
memcpy( templist, g_favoriteserverlist, sizeof(servernode_t)*MAX_FAVORITESERVERS );

View file

@ -727,7 +727,6 @@ static void UI_SPLevelMenu_Init( void ) {
skill = (int)trap_Cvar_VariableValue( "g_spSkill" );
if( skill < 1 || skill > 5 ) {
trap_Cvar_Set( "g_spSkill", "2" );
skill = 2;
}
memset( &levelMenuInfo, 0, sizeof(levelMenuInfo) );

View file

@ -138,7 +138,7 @@ void CMod_LoadSubmodels( lump_t *l ) {
Com_Error( ERR_DROP, "MAX_SUBMODELS exceeded" );
}
for ( i=0 ; i<count ; i++, in++, out++)
for ( i=0 ; i<count ; i++, in++)
{
out = &cm.cmodels[i];

View file

@ -732,7 +732,8 @@ get the first intersection of the ray with the sphere
*/
void CM_TraceThroughSphere( traceWork_t *tw, vec3_t origin, float radius, vec3_t start, vec3_t end ) {
float l1, l2, length, scale, fraction;
float a, b, c, d, sqrtd;
//float a;
float b, c, d, sqrtd;
vec3_t v1, dir, intersection;
// if inside the sphere
@ -768,7 +769,7 @@ void CM_TraceThroughSphere( traceWork_t *tw, vec3_t origin, float radius, vec3_t
//
VectorSubtract(start, origin, v1);
// dir is normalized so a = 1
a = 1.0f;//dir[0] * dir[0] + dir[1] * dir[1] + dir[2] * dir[2];
//a = 1.0f;//dir[0] * dir[0] + dir[1] * dir[1] + dir[2] * dir[2];
b = 2.0f * (dir[0] * v1[0] + dir[1] * v1[1] + dir[2] * v1[2]);
c = v1[0] * v1[0] + v1[1] * v1[1] + v1[2] * v1[2] - (radius+RADIUS_EPSILON) * (radius+RADIUS_EPSILON);
@ -820,7 +821,8 @@ the cylinder extends halfheight above and below the origin
*/
void CM_TraceThroughVerticalCylinder( traceWork_t *tw, vec3_t origin, float radius, float halfheight, vec3_t start, vec3_t end) {
float length, scale, fraction, l1, l2;
float a, b, c, d, sqrtd;
//float a;
float b, c, d, sqrtd;
vec3_t v1, dir, start2d, end2d, org2d, intersection;
// 2d coordinates
@ -866,7 +868,7 @@ void CM_TraceThroughVerticalCylinder( traceWork_t *tw, vec3_t origin, float radi
//
VectorSubtract(start, origin, v1);
// dir is normalized so we can use a = 1
a = 1.0f;// * (dir[0] * dir[0] + dir[1] * dir[1]);
//a = 1.0f;// * (dir[0] * dir[0] + dir[1] * dir[1]);
b = 2.0f * (v1[0] * dir[0] + v1[1] * dir[1]);
c = v1[0] * v1[0] + v1[1] * v1[1] - (radius+RADIUS_EPSILON) * (radius+RADIUS_EPSILON);

View file

@ -269,7 +269,6 @@ void Cmd_Exec_f( void ) {
char *c;
void *v;
} f;
int len;
char filename[MAX_QPATH];
if (Cmd_Argc () != 2) {
@ -279,7 +278,7 @@ void Cmd_Exec_f( void ) {
Q_strncpyz( filename, Cmd_Argv(1), sizeof( filename ) );
COM_DefaultExtension( filename, sizeof( filename ), ".cfg" );
len = FS_ReadFile( filename, &f.v);
FS_ReadFile( filename, &f.v);
if (!f.c) {
Com_Printf ("couldn't exec %s\n",Cmd_Argv(1));
return;

View file

@ -86,6 +86,7 @@ cvar_t *com_minimized;
cvar_t *com_maxfpsMinimized;
cvar_t *com_abnormalExit;
cvar_t *com_standalone;
cvar_t *com_gamename;
cvar_t *com_protocol;
#ifdef LEGACY_PROTOCOL
cvar_t *com_legacyprotocol;
@ -931,10 +932,11 @@ Z_TagMalloc
*/
#ifdef ZONE_DEBUG
void *Z_TagMallocDebug( int size, int tag, char *label, char *file, int line ) {
int allocSize;
#else
void *Z_TagMalloc( int size, int tag ) {
#endif
int extra, allocSize;
int extra;
memblock_t *start, *rover, *new, *base;
memzone_t *zone;
@ -949,7 +951,9 @@ void *Z_TagMalloc( int size, int tag ) {
zone = mainzone;
}
#ifdef ZONE_DEBUG
allocSize = size;
#endif
//
// scan through the block list looking for the first free block
// of sufficient size
@ -1088,7 +1092,10 @@ void Z_LogZoneHeap( memzone_t *zone, char *name ) {
if (!logfile || !FS_Initialized())
return;
size = allocSize = numBlocks = 0;
size = numBlocks = 0;
#ifdef ZONE_DEBUG
allocSize = 0;
#endif
Com_sprintf(buf, sizeof(buf), "\r\n================\r\n%s log\r\n================\r\n", name);
FS_Write(buf, strlen(buf), logfile);
for (block = zone->blocklist.next ; block->next != &zone->blocklist; block = block->next) {
@ -2790,6 +2797,7 @@ void Com_Init( char *commandLine ) {
s = va("%s %s %s", Q3_VERSION, PLATFORM_STRING, __DATE__ );
com_version = Cvar_Get ("version", s, CVAR_ROM | CVAR_SERVERINFO );
com_gamename = Cvar_Get("com_gamename", GAMENAME_FOR_MASTER, CVAR_SERVERINFO | CVAR_INIT);
com_protocol = Cvar_Get("com_protocol", va("%i", PROTOCOL_VERSION), CVAR_SERVERINFO | CVAR_INIT);
#ifdef LEGACY_PROTOCOL
com_legacyprotocol = Cvar_Get("com_legacyprotocol", va("%i", PROTOCOL_LEGACY_VERSION), CVAR_INIT);
@ -3108,7 +3116,6 @@ void Com_Frame( void ) {
else
minMsec = 1;
timeVal = 0;
do
{
if(com_sv_running->integer)
@ -3588,3 +3595,33 @@ void Com_RandomBytes( byte *string, int len )
string[i] = (unsigned char)( rand() % 255 );
}
/*
==================
Com_IsVoipTarget
Returns non-zero if given clientNum is enabled in voipTargets, zero otherwise.
If clientNum is negative return if any bit is set.
==================
*/
qboolean Com_IsVoipTarget(uint8_t *voipTargets, int voipTargetsSize, int clientNum)
{
int index;
if(clientNum < 0)
{
for(index = 0; index < voipTargetsSize; index++)
{
if(voipTargets[index])
return qtrue;
}
return qfalse;
}
index = clientNum >> 3;
if(index < voipTargetsSize)
return (voipTargets[index] & (1 << (clientNum & 0x07)));
return qfalse;
}

View file

@ -2481,7 +2481,7 @@ int FS_GetModList( char *listbuf, int bufsize ) {
qboolean bDrop = qfalse;
*listbuf = 0;
nMods = nPotential = nTotal = 0;
nMods = nTotal = 0;
pFiles0 = Sys_ListFiles( fs_homepath->string, NULL, NULL, &dummy, qtrue );
pFiles1 = Sys_ListFiles( fs_basepath->string, NULL, NULL, &dummy, qtrue );
@ -3000,7 +3000,7 @@ we are not interested in a download string format, we want something human-reada
*/
qboolean FS_ComparePaks( char *neededpaks, int len, qboolean dlstring ) {
searchpath_t *sp;
qboolean havepak, badchecksum;
qboolean havepak;
char *origpos = neededpaks;
int i;
@ -3012,7 +3012,6 @@ qboolean FS_ComparePaks( char *neededpaks, int len, qboolean dlstring ) {
for ( i = 0 ; i < fs_numServerReferencedPaks ; i++ )
{
// Ok, see if we have this pak file
badchecksum = qfalse;
havepak = qfalse;
// never autodownload any of the id paks

View file

@ -1208,7 +1208,6 @@ void MSG_WriteDeltaPlayerstate( msg_t *msg, struct playerState_s *from, struct p
int ammobits;
int powerupbits;
int numFields;
int c;
netField_t *field;
int *fromF, *toF;
float fullFloat;
@ -1219,8 +1218,6 @@ void MSG_WriteDeltaPlayerstate( msg_t *msg, struct playerState_s *from, struct p
Com_Memset (&dummy, 0, sizeof(dummy));
}
c = msg->cursize;
numFields = ARRAY_LEN( playerStateFields );
lc = 0;
@ -1268,7 +1265,6 @@ void MSG_WriteDeltaPlayerstate( msg_t *msg, struct playerState_s *from, struct p
MSG_WriteBits( msg, *toF, field->bits );
}
}
c = msg->cursize - c;
//

View file

@ -243,7 +243,6 @@ copied out.
*/
qboolean Netchan_Process( netchan_t *chan, msg_t *msg ) {
int sequence;
int qport;
int fragmentStart, fragmentLength;
qboolean fragmented;
@ -264,7 +263,7 @@ qboolean Netchan_Process( netchan_t *chan, msg_t *msg ) {
// read the qport if we are a server
if ( chan->sock == NS_SERVER ) {
qport = MSG_ReadShort( msg );
MSG_ReadShort( msg );
}
#ifdef LEGACY_PROTOCOL

View file

@ -1073,7 +1073,6 @@ NET_OpenSocks
*/
void NET_OpenSocks( int port ) {
struct sockaddr_in address;
int err;
struct hostent *h;
int len;
qboolean rfc1929;
@ -1084,14 +1083,12 @@ void NET_OpenSocks( int port ) {
Com_Printf( "Opening connection to SOCKS server.\n" );
if ( ( socks_socket = socket( AF_INET, SOCK_STREAM, IPPROTO_TCP ) ) == INVALID_SOCKET ) {
err = socketError;
Com_Printf( "WARNING: NET_OpenSocks: socket: %s\n", NET_ErrorString() );
return;
}
h = gethostbyname( net_socksServer->string );
if ( h == NULL ) {
err = socketError;
Com_Printf( "WARNING: NET_OpenSocks: gethostbyname: %s\n", NET_ErrorString() );
return;
}
@ -1104,7 +1101,6 @@ void NET_OpenSocks( int port ) {
address.sin_port = htons( (short)net_socksPort->integer );
if ( connect( socks_socket, (struct sockaddr *)&address, sizeof( address ) ) == SOCKET_ERROR ) {
err = socketError;
Com_Printf( "NET_OpenSocks: connect: %s\n", NET_ErrorString() );
return;
}
@ -1132,7 +1128,6 @@ void NET_OpenSocks( int port ) {
buf[2] = 2; // method #2 - method id #02: username/password
}
if ( send( socks_socket, (void *)buf, len, 0 ) == SOCKET_ERROR ) {
err = socketError;
Com_Printf( "NET_OpenSocks: send: %s\n", NET_ErrorString() );
return;
}
@ -1140,7 +1135,6 @@ void NET_OpenSocks( int port ) {
// get the response
len = recv( socks_socket, (void *)buf, 64, 0 );
if ( len == SOCKET_ERROR ) {
err = socketError;
Com_Printf( "NET_OpenSocks: recv: %s\n", NET_ErrorString() );
return;
}
@ -1179,7 +1173,6 @@ void NET_OpenSocks( int port ) {
// send it
if ( send( socks_socket, (void *)buf, 3 + ulen + plen, 0 ) == SOCKET_ERROR ) {
err = socketError;
Com_Printf( "NET_OpenSocks: send: %s\n", NET_ErrorString() );
return;
}
@ -1187,7 +1180,6 @@ void NET_OpenSocks( int port ) {
// get the response
len = recv( socks_socket, (void *)buf, 64, 0 );
if ( len == SOCKET_ERROR ) {
err = socketError;
Com_Printf( "NET_OpenSocks: recv: %s\n", NET_ErrorString() );
return;
}
@ -1209,7 +1201,6 @@ void NET_OpenSocks( int port ) {
*(int *)&buf[4] = INADDR_ANY;
*(short *)&buf[8] = htons( (short)port ); // port
if ( send( socks_socket, (void *)buf, 10, 0 ) == SOCKET_ERROR ) {
err = socketError;
Com_Printf( "NET_OpenSocks: send: %s\n", NET_ErrorString() );
return;
}
@ -1217,7 +1208,6 @@ void NET_OpenSocks( int port ) {
// get the response
len = recv( socks_socket, (void *)buf, 64, 0 );
if( len == SOCKET_ERROR ) {
err = socketError;
Com_Printf( "NET_OpenSocks: recv: %s\n", NET_ErrorString() );
return;
}

View file

@ -553,8 +553,9 @@ int COM_Compress( char *data_p ) {
}
}
}
*out = 0;
}
*out = 0;
return out - data_p;
}

View file

@ -32,36 +32,29 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#define BASEGAME "baseq3r"
#define CLIENT_WINDOW_TITLE "Q3Rally"
#define CLIENT_WINDOW_MIN_TITLE "Q3R"
#if 1 // use standard quake3 master protocol
#define GAMENAME_FOR_MASTER "Quake3Arena"
#define HEARTBEAT_FOR_MASTER "QuakeArena-1"
#define FLATLINE_FOR_MASTER HEARTBEAT_FOR_MASTER
#else
#define GAMENAME_FOR_MASTER "Q3Rally" // must NOT contain whitespaces
#define HEARTBEAT_FOR_MASTER GAMENAME_FOR_MASTER
#define FLATLINE_FOR_MASTER GAMENAME_FOR_MASTER "dead"
#endif
#define HOMEPATH_NAME_UNIX ".q3rally"
#define HOMEPATH_NAME_WIN "Q3Rally"
#define HOMEPATH_NAME_MACOSX HOMEPATH_NAME_WIN
#define GAMENAME_FOR_MASTER "Q3Rally" // must NOT contain whitespace
// #define LEGACY_PROTOCOL // You probably don't need this for your standalone game
#else
#define PRODUCT_NAME "ioq3"
#define BASEGAME "baseq3"
#define CLIENT_WINDOW_TITLE "ioquake3"
#define CLIENT_WINDOW_MIN_TITLE "ioq3"
#define GAMENAME_FOR_MASTER "Quake3Arena"
#define HEARTBEAT_FOR_MASTER "QuakeArena-1"
#define FLATLINE_FOR_MASTER HEARTBEAT_FOR_MASTER
#define HOMEPATH_NAME_UNIX ".q3a"
#define HOMEPATH_NAME_WIN "Quake3"
#define HOMEPATH_NAME_MACOSX HOMEPATH_NAME_WIN
#define GAMENAME_FOR_MASTER "Quake3Arena"
#define LEGACY_PROTOCOL
#endif
// Heartbeat for dpmaster protocol. You shouldn't change this unless you know what you're doing
#define HEARTBEAT_FOR_MASTER "DarkPlaces"
#define BASETA "missionpack"
#ifdef _MSC_VER
#ifndef PRODUCT_VERSION
#define PRODUCT_VERSION "1.36"
#endif
@ -1023,6 +1016,23 @@ typedef struct {
char string[MAX_CVAR_VALUE_STRING];
} vmCvar_t;
/*
==============================================================
VoIP
==============================================================
*/
// if you change the count of flags be sure to also change VOIP_FLAGNUM
#define VOIP_SPATIAL 0x01 // spatialized voip message
#define VOIP_DIRECT 0x02 // non-spatialized voip message
// number of flags voip knows. You will have to bump protocol version number if you
// change this.
#define VOIP_FLAGCNT 2
/*
==============================================================

View file

@ -252,7 +252,7 @@ PROTOCOL
==============================================================
*/
#define PROTOCOL_VERSION 70
#define PROTOCOL_VERSION 71
#define PROTOCOL_LEGACY_VERSION 68
// 1.31 - 67
@ -835,6 +835,8 @@ int Com_RealTime(qtime_t *qtime);
qboolean Com_SafeMode( void );
void Com_RunAndTimeServerPacket(netadr_t *evFrom, msg_t *buf);
qboolean Com_IsVoipTarget(uint8_t *voipTargets, int voipTargetsSize, int clientNum);
void Com_StartupVariable( const char *match );
// checks for and removes command line "+set var arg" constructs
// if match is NULL, all set commands will be executed, otherwise
@ -870,6 +872,7 @@ extern cvar_t *sv_paused;
extern cvar_t *cl_packetdelay;
extern cvar_t *sv_packetdelay;
extern cvar_t *com_gamename;
extern cvar_t *com_protocol;
#ifdef LEGACY_PROTOCOL
extern cvar_t *com_legacyprotocol;
@ -1027,7 +1030,7 @@ void Key_WriteBindings( fileHandle_t f );
void S_ClearSoundBuffer( void );
// call before filesystem access
void SCR_DebugGraph (float value, int color); // FIXME: move logging to common?
void SCR_DebugGraph (float value); // FIXME: move logging to common?
// AVI files have the start of pixel lines 4 byte-aligned
#define AVI_LINE_PADDING 4
@ -1089,7 +1092,7 @@ void *Sys_GetBotLibAPI( void *parms );
char *Sys_GetCurrentUser( void );
void QDECL Sys_Error( const char *error, ...) __attribute__ ((noreturn)) __attribute__ ((format (printf, 1, 2)));
void QDECL Sys_Error( const char *error, ...) __attribute__ ((noreturn, format (printf, 1, 2)));
void Sys_Quit (void) __attribute__ ((noreturn));
char *Sys_GetClipboardData( void ); // note that this isn't journaled...

View file

@ -217,7 +217,6 @@ VM_LoadSymbols
===============
*/
void VM_LoadSymbols( vm_t *vm ) {
int len;
union {
char *c;
void *v;
@ -239,7 +238,7 @@ void VM_LoadSymbols( vm_t *vm ) {
COM_StripExtension(vm->name, name, sizeof(name));
Com_sprintf( symbols, sizeof( symbols ), "vm/%s.map", name );
len = FS_ReadFile( symbols, &mapfile.v );
FS_ReadFile( symbols, &mapfile.v );
if ( !mapfile.c ) {
Com_Printf( "Couldn't load symbol file: %s\n", symbols );
return;
@ -365,7 +364,6 @@ Load a .qvm file
=================
*/
vmHeader_t *VM_LoadQVM( vm_t *vm, qboolean alloc ) {
int length;
int dataLength;
int i;
char filename[MAX_QPATH];
@ -378,7 +376,7 @@ vmHeader_t *VM_LoadQVM( vm_t *vm, qboolean alloc ) {
Com_sprintf( filename, sizeof(filename), "vm/%s.qvm", vm->name );
Com_Printf( "Loading vm file %s...\n", filename );
length = FS_ReadFileDir(filename, vm->searchPath, &header.v);
FS_ReadFileDir(filename, vm->searchPath, &header.v);
if ( !header.h ) {
Com_Printf( "Failed.\n" );

View file

@ -237,7 +237,6 @@ void VM_PrepareInterpreter( vm_t *vm, vmHeader_t *header ) {
}
int_pc = 0;
instruction = 0;
code = (byte *)header + header->codeOffset;
// Now that the code has been expanded to int-sized opcodes, we'll translate instruction index
//into an index into codeBase[], which contains opcodes and operands.

View file

@ -1716,7 +1716,6 @@ int VM_CallCompiled(vm_t *vm, int *args)
{
byte stack[OPSTACK_SIZE + 15];
void *entryPoint;
int programCounter;
int programStack, stackOnEntry;
byte *image;
int *opStack;
@ -1733,8 +1732,6 @@ int VM_CallCompiled(vm_t *vm, int *args)
// set up the stack frame
image = vm->dataBase;
programCounter = 0;
programStack -= 48;
*(int *)&image[ programStack + 44] = args[9];

View file

@ -445,11 +445,6 @@ void RB_BeginDrawingView (void) {
// 2D images again
backEnd.projection2D = qfalse;
//
// set the modelview matrix for the viewer
//
SetViewportAndScissor();
// ensures that depth writes are enabled for the depth clear
GL_State( GLS_DEFAULT );
// clear relevant buffers
@ -470,6 +465,11 @@ void RB_BeginDrawingView (void) {
}
qglClear( clearBits );
//
// set the modelview matrix for the viewer
//
SetViewportAndScissor();
if ( ( backEnd.refdef.rdflags & RDF_HYPERSPACE ) )
{
RB_Hyperspace();
@ -753,7 +753,7 @@ void RE_StretchRaw (int x, int y, int w, int h, int cols, int rows, const byte *
// we definately want to sync every frame for the cinematics
qglFinish();
start = end = 0;
start = 0;
if ( r_speeds->integer ) {
start = ri.Milliseconds();
}

View file

@ -204,10 +204,9 @@ static int neighbors[8][2] = {
VectorAdd( normal, sum, sum );
count++;
}
if ( count == 0 ) {
//printf("bad normal\n");
count = 1;
}
//if ( count == 0 ) {
// printf("bad normal\n");
//}
VectorNormalize2( sum, dv->normal );
}
}

View file

@ -114,7 +114,7 @@ This is called at surface tesselation time
*/
void RB_AddFlare( void *surface, int fogNum, vec3_t point, vec3_t color, vec3_t normal ) {
int i;
flare_t *f, *oldest;
flare_t *f;
vec3_t local;
float d = 1;
vec4_t eye, clip, normalized, window;
@ -152,7 +152,6 @@ void RB_AddFlare( void *surface, int fogNum, vec3_t point, vec3_t color, vec3_t
}
// see if a flare with a matching surface, scene, and view exists
oldest = r_flareStructs;
for ( f = r_activeFlares ; f ; f = f->next ) {
if ( f->surface == surface && f->frameSceneNum == backEnd.viewParms.frameSceneNum
&& f->inPortal == backEnd.viewParms.isPortal ) {

View file

@ -1098,14 +1098,11 @@ R_CreateFogImage
static void R_CreateFogImage( void ) {
int x,y;
byte *data;
float g;
float d;
float borderColor[4];
data = ri.Hunk_AllocateTempMemory( FOG_S * FOG_T * 4 );
g = 2.0;
// S is distance, T is depth
for (x=0 ; x<FOG_S ; x++) {
for (y=0 ; y<FOG_T ; y++) {

View file

@ -791,8 +791,6 @@ static uint8_t PredictPaeth(uint8_t a, uint8_t b, uint8_t c)
int p;
int pa, pb, pc;
Pr = 0;
p = ((int) a) + ((int) b) - ((int) c);
pa = abs(p - ((int) a));
pb = abs(p - ((int) b));

View file

@ -912,7 +912,6 @@ static qboolean SurfIsOffscreen( const drawSurf_t *drawSurf, vec4_t clipDest[128
for ( i = 0; i < tess.numIndexes; i += 3 )
{
vec3_t normal;
float dot;
float len;
VectorSubtract( tess.xyz[tess.indexes[i]], tr.viewParms.or.origin, normal );
@ -923,7 +922,7 @@ static qboolean SurfIsOffscreen( const drawSurf_t *drawSurf, vec4_t clipDest[128
shortest = len;
}
if ( ( dot = DotProduct( normal, tess.normal[tess.indexes[i]] ) ) >= 0 )
if ( DotProduct( normal, tess.normal[tess.indexes[i]] ) >= 0 )
{
numTriangles--;
}
@ -1269,7 +1268,6 @@ void R_AddEntitySurfaces (void) {
if ( (ent->e.renderfx & RF_THIRD_PERSON) && !tr.viewParms.isPortal) {
break;
}
shader = R_GetShaderByHandle( ent->e.customShader );
R_AddDrawSurf( &entitySurface, tr.defaultShader, 0, 0 );
break;
default:

View file

@ -272,6 +272,10 @@ int R_MarkFragments( int numPoints, const vec3_t *points, const vec3_t projectio
vec3_t v1, v2;
int *indexes;
if (numPoints <= 0) {
return 0;
}
//increment view count for double check prevention
tr.viewCount++;

View file

@ -931,7 +931,7 @@ static qboolean R_LoadMD4( model_t *mod, void *buffer, const char *mod_name ) {
// swap all the frames
frameSize = (size_t)( &((md4Frame_t *)0)->bones[ md4->numBones ] );
for ( i = 0 ; i < md4->numFrames ; i++, frame++) {
for ( i = 0 ; i < md4->numFrames ; i++) {
frame = (md4Frame_t *) ( (byte *)md4 + md4->ofsFrames + i * frameSize );
frame->radius = LittleFloat( frame->radius );
for ( j = 0 ; j < 3 ; j++ ) {

View file

@ -885,8 +885,8 @@ static void ComputeJointMats( iqmData_t *data, int frame, int oldframe,
int *joint = data->jointParents;
int i;
if ( oldframe == frame ) {
mat1 = mat2 = data->poseMats + 12 * data->num_joints * frame;
if ( oldframe == frame ) {
mat1 = data->poseMats + 12 * data->num_joints * frame;
for( i = 0; i < data->num_joints; i++, joint++ ) {
if( *joint >= 0 ) {
Matrix34Multiply( mat + 12 * *joint,

View file

@ -109,7 +109,7 @@ typedef struct {
void (QDECL *Printf)( int printLevel, const char *fmt, ...) __attribute__ ((format (printf, 2, 3)));
// abort the game
void (QDECL *Error)( int errorLevel, const char *fmt, ...) __attribute__ ((format (printf, 2, 3)));
void (QDECL *Error)( int errorLevel, const char *fmt, ...) __attribute__ ((noreturn, format (printf, 2, 3)));
// milliseconds should only be used for profiling, never
// for anything game related. Get time from the refdef

View file

@ -1174,8 +1174,10 @@ static void RB_IterateStagesGeneric( shaderCommands_t *input )
void RB_StageIteratorGeneric( void )
{
shaderCommands_t *input;
shader_t *shader;
input = &tess;
shader = input->shader;
RB_DeformTessGeometry();
@ -1192,10 +1194,10 @@ void RB_StageIteratorGeneric( void )
//
// set face culling appropriately
//
GL_Cull( input->shader->cullType );
GL_Cull( shader->cullType );
// set polygon offset if necessary
if ( input->shader->polygonOffset )
if ( shader->polygonOffset )
{
qglEnable( GL_POLYGON_OFFSET_FILL );
qglPolygonOffset( r_offsetFactor->value, r_offsetUnits->value );
@ -1207,7 +1209,7 @@ void RB_StageIteratorGeneric( void )
// to avoid compiling those arrays since they will change
// during multipass rendering
//
if ( tess.numPasses > 1 || input->shader->multitextureEnv )
if ( tess.numPasses > 1 || shader->multitextureEnv )
{
setArraysOnce = qfalse;
qglDisableClientState (GL_COLOR_ARRAY);
@ -1275,7 +1277,7 @@ void RB_StageIteratorGeneric( void )
//
// reset polygon offset
//
if ( input->shader->polygonOffset )
if ( shader->polygonOffset )
{
qglDisable( GL_POLYGON_OFFSET_FILL );
}
@ -1291,7 +1293,6 @@ void RB_StageIteratorVertexLitTexture( void )
shader_t *shader;
input = &tess;
shader = input->shader;
//
@ -1312,7 +1313,7 @@ void RB_StageIteratorVertexLitTexture( void )
//
// set face culling appropriately
//
GL_Cull( input->shader->cullType );
GL_Cull( shader->cullType );
//
// set arrays and lock
@ -1365,8 +1366,10 @@ void RB_StageIteratorVertexLitTexture( void )
void RB_StageIteratorLightmappedMultitexture( void ) {
shaderCommands_t *input;
shader_t *shader;
input = &tess;
shader = input->shader;
//
// log this call
@ -1380,7 +1383,7 @@ void RB_StageIteratorLightmappedMultitexture( void ) {
//
// set face culling appropriately
//
GL_Cull( input->shader->cullType );
GL_Cull( shader->cullType );
//
// set color, pointers, and lock

View file

@ -634,7 +634,7 @@ void RB_CalcColorFromOneMinusEntity( unsigned char *dstColors )
for ( i = 0; i < tess.numVertexes; i++, pColors++ )
{
*pColors = * ( int * ) invModulate;
*pColors = c;
}
}

View file

@ -618,14 +618,14 @@ void R_BuildCloudData( shaderCommands_t *input )
tess.numIndexes = 0;
tess.numVertexes = 0;
if ( input->shader->sky.cloudHeight )
if ( shader->sky.cloudHeight )
{
for ( i = 0; i < MAX_SHADER_STAGES; i++ )
{
if ( !tess.xstages[i] ) {
break;
}
FillCloudBox( input->shader, i );
FillCloudBox( shader, i );
}
}
}

View file

@ -928,10 +928,6 @@ static void RB_SurfaceFace( srfSurfaceFace_t *surf ) {
tess.numIndexes += surf->numIndices;
v = surf->points[0];
ndx = tess.numVertexes;
numPoints = surf->numPoints;
if ( tess.shader->needsNormal ) {
@ -1046,7 +1042,6 @@ static void RB_SurfaceGrid( srfGridMesh_t *cv ) {
// in the tess structure, so we may have to issue it in multiple passes
used = 0;
rows = 0;
while ( used < lodHeight - 1 ) {
// see how many rows of both verts and indexes we can add without overflowing
do {

View file

@ -63,7 +63,6 @@ static qboolean R_CullGrid( srfGridMesh_t *cv ) {
} else {
sphereCull = R_CullPointAndRadius( cv->localOrigin, cv->meshRadius );
}
boxCull = CULL_OUT;
// check for trivial reject
if ( sphereCull == CULL_OUT )

View file

@ -43,6 +43,7 @@ typedef struct voipServerPacket_s
int frames;
int len;
int sender;
int flags;
byte data[1024];
} voipServerPacket_t;
#endif
@ -293,8 +294,6 @@ extern cvar_t *sv_lanForceRate;
extern cvar_t *sv_strictAuth;
#endif
extern cvar_t *sv_banFile;
extern cvar_t *sv_heartbeat;
extern cvar_t *sv_flatline;
extern serverBan_t serverBans[SERVER_MAXBANS];
extern int serverBansCount;
@ -362,10 +361,6 @@ int SV_WriteDownloadToClient(client_t *cl , msg_t *msg);
int SV_SendDownloadMessages(void);
int SV_SendQueuedMessages(void);
#ifdef USE_VOIP
void SV_WriteVoipToClient( client_t *cl, msg_t *msg );
#endif
//
// sv_ccmds.c

View file

@ -70,10 +70,10 @@ void SV_GetChallenge(netadr_t from)
if(gameName && *gameName)
{
// reject client if the heartbeat string sent by the client doesn't match ours
if(strcmp(gameName, sv_heartbeat->string))
if(strcmp(gameName, com_gamename->string))
{
NET_OutOfBandPrint(NS_SERVER, from, "print\nGame mismatch: This is a %s server\n",
sv_heartbeat->string);
com_gamename->string);
return;
}
}
@ -1176,56 +1176,6 @@ int SV_SendDownloadMessages(void)
return numDLs;
}
#ifdef USE_VOIP
/*
==================
SV_WriteVoipToClient
Check to see if there is any VoIP queued for a client, and send if there is.
==================
*/
void SV_WriteVoipToClient( client_t *cl, msg_t *msg )
{
if(*cl->downloadName)
{
cl->queuedVoipPackets = 0;
return; // no VoIP allowed if download is going, to save bandwidth.
}
if(cl->queuedVoipPackets)
{
int totalbytes = 0;
int i;
voipServerPacket_t *packet;
// Write as many VoIP packets as we reasonably can...
for(i = cl->queuedVoipIndex; i < cl->queuedVoipPackets; i++)
{
packet = cl->voipPacket[i % ARRAY_LEN(cl->voipPacket)];
totalbytes += packet->len;
if (totalbytes > (msg->maxsize - msg->cursize) / 2)
break;
MSG_WriteByte(msg, svc_voip);
MSG_WriteShort(msg, packet->sender);
MSG_WriteByte(msg, (byte) packet->generation);
MSG_WriteLong(msg, packet->sequence);
MSG_WriteByte(msg, packet->frames);
MSG_WriteShort(msg, packet->len);
MSG_WriteData(msg, packet->data, packet->len);
Z_Free(packet);
}
cl->queuedVoipPackets -= i;
cl->queuedVoipIndex += i;
cl->queuedVoipIndex %= ARRAY_LEN(cl->voipPacket);
}
}
#endif
/*
=================
SV_Disconnect_f
@ -1263,7 +1213,6 @@ static void SV_VerifyPaks_f( client_t *cl ) {
//
if ( sv_pure->integer != 0 ) {
bGood = qtrue;
nChkSum1 = nChkSum2 = 0;
// we run the game, so determine which cgame and ui the client "should" be running
bGood = (FS_FileIsInPAK("vm/cgame.qvm", &nChkSum1) == 1);
@ -1800,8 +1749,15 @@ static void SV_UserMove( client_t *cl, msg_t *msg, qboolean delta ) {
#ifdef USE_VOIP
static
qboolean SV_ShouldIgnoreVoipSender(const client_t *cl)
/*
==================
SV_ShouldIgnoreVoipSender
Blocking of voip packets based on source client
==================
*/
static qboolean SV_ShouldIgnoreVoipSender(const client_t *cl)
{
if (!sv_voip->integer)
return qtrue; // VoIP disabled on this server.
@ -1814,33 +1770,25 @@ qboolean SV_ShouldIgnoreVoipSender(const client_t *cl)
}
static
void SV_UserVoip( client_t *cl, msg_t *msg ) {
const int sender = (int) (cl - svs.clients);
const int generation = MSG_ReadByte(msg);
const int sequence = MSG_ReadLong(msg);
const int frames = MSG_ReadByte(msg);
const int recip1 = MSG_ReadLong(msg);
const int recip2 = MSG_ReadLong(msg);
const int recip3 = MSG_ReadLong(msg);
const int packetsize = MSG_ReadShort(msg);
void SV_UserVoip(client_t *cl, msg_t *msg)
{
int sender, generation, sequence, frames, packetsize;
uint8_t recips[(MAX_CLIENTS + 7) / 8];
int flags;
byte encoded[sizeof(cl->voipPacket[0]->data)];
client_t *client = NULL;
voipServerPacket_t *packet = NULL;
int i;
if (generation < 0)
return; // short/invalid packet, bail.
else if (sequence < 0)
return; // short/invalid packet, bail.
else if (frames < 0)
return; // short/invalid packet, bail.
else if (recip1 < 0)
return; // short/invalid packet, bail.
else if (recip2 < 0)
return; // short/invalid packet, bail.
else if (recip3 < 0)
return; // short/invalid packet, bail.
else if (packetsize < 0)
sender = cl - svs.clients;
generation = MSG_ReadByte(msg);
sequence = MSG_ReadLong(msg);
frames = MSG_ReadByte(msg);
MSG_ReadData(msg, recips, sizeof(recips));
flags = MSG_ReadByte(msg);
packetsize = MSG_ReadShort(msg);
if (msg->readcount > msg->cursize)
return; // short/invalid packet, bail.
if (packetsize > sizeof (encoded)) { // overlarge packet?
@ -1865,10 +1813,6 @@ void SV_UserVoip( client_t *cl, msg_t *msg ) {
// !!! FIXME: reject if not speex narrowband codec.
// !!! FIXME: decide if this is bogus data?
// (the three recip* values are 31 bits each (ignores sign bit so we can
// get a -1 error from MSG_ReadLong() ... ), allowing for 93 clients.)
assert( sv_maxclients->integer < 93 );
// decide who needs this VoIP packet sent to them...
for (i = 0, client = svs.clients; i < sv_maxclients->integer ; i++, client++) {
if (client->state != CS_ACTIVE)
@ -1876,18 +1820,20 @@ void SV_UserVoip( client_t *cl, msg_t *msg ) {
else if (i == sender)
continue; // don't send voice packet back to original author.
else if (!client->hasVoip)
continue; // no VoIP support, or support disabled.
continue; // no VoIP support, or unsupported protocol
else if (client->muteAllVoip)
continue; // client is ignoring everyone.
else if (client->ignoreVoipFromClient[sender])
continue; // client is ignoring this talker.
else if (*cl->downloadName) // !!! FIXME: possible to DoS?
continue; // no VoIP allowed if downloading, to save bandwidth.
else if ( ((i >= 0) && (i < 31)) && ((recip1 & (1 << (i-0))) == 0) )
continue; // not addressed to this player.
else if ( ((i >= 31) && (i < 62)) && ((recip2 & (1 << (i-31))) == 0) )
continue; // not addressed to this player.
else if ( ((i >= 62) && (i < 93)) && ((recip3 & (1 << (i-62))) == 0) )
if(Com_IsVoipTarget(recips, sizeof(recips), i))
flags |= VOIP_DIRECT;
else
flags &= ~VOIP_DIRECT;
if (!(flags & (VOIP_SPATIAL | VOIP_DIRECT)))
continue; // not addressed to this player.
// Transmit this packet to the client.
@ -1902,6 +1848,7 @@ void SV_UserVoip( client_t *cl, msg_t *msg ) {
packet->len = packetsize;
packet->generation = generation;
packet->sequence = sequence;
packet->flags = flags;
memcpy(packet->data, encoded, packetsize);
client->voipPacket[(client->queuedVoipIndex + client->queuedVoipPackets) % ARRAY_LEN(client->voipPacket)] = packet;

View file

@ -662,8 +662,8 @@ void SV_Init (void)
sv_pure = Cvar_Get ("sv_pure", "1", CVAR_SYSTEMINFO );
}
#ifdef USE_VOIP
sv_voip = Cvar_Get ("sv_voip", "1", CVAR_SYSTEMINFO | CVAR_LATCH);
Cvar_CheckRange( sv_voip, 0, 1, qtrue );
sv_voip = Cvar_Get("sv_voip", "1", CVAR_SYSTEMINFO | CVAR_LATCH);
Cvar_CheckRange(sv_voip, 0, 1, qtrue);
#endif
Cvar_Get ("sv_paks", "", CVAR_SYSTEMINFO | CVAR_ROM );
Cvar_Get ("sv_pakNames", "", CVAR_SYSTEMINFO | CVAR_ROM );
@ -695,8 +695,6 @@ void SV_Init (void)
sv_strictAuth = Cvar_Get ("sv_strictAuth", "1", CVAR_ARCHIVE );
#endif
sv_banFile = Cvar_Get("sv_banFile", "serverbans.dat", CVAR_ARCHIVE);
sv_heartbeat = Cvar_Get("sv_heartbeat", HEARTBEAT_FOR_MASTER, CVAR_INIT);
sv_flatline = Cvar_Get("sv_flatline", FLATLINE_FOR_MASTER, CVAR_INIT);
// initialize bot cvars so they are listed and can be set before loading the botlib
SV_BotInitCvars();

View file

@ -61,9 +61,6 @@ cvar_t *sv_lanForceRate; // dedicated 1 (LAN) server forces local client rates t
cvar_t *sv_strictAuth;
#endif
cvar_t *sv_banFile;
cvar_t *sv_heartbeat; // Heartbeat string that is sent to the master
cvar_t *sv_flatline; // If the master server supports it we can send a flatline
// when server is killed
serverBan_t serverBans[SERVER_MAXBANS];
int serverBansCount = 0;
@ -338,11 +335,11 @@ Informs all masters that this server is going down
void SV_MasterShutdown( void ) {
// send a hearbeat right now
svs.nextHeartbeatTime = -9999;
SV_MasterHeartbeat(sv_flatline->string);
SV_MasterHeartbeat(HEARTBEAT_FOR_MASTER);
// send it again to minimize chance of drops
svs.nextHeartbeatTime = -9999;
SV_MasterHeartbeat(sv_flatline->string);
SV_MasterHeartbeat(HEARTBEAT_FOR_MASTER);
// when the master tries to poll the server, it won't respond, so
// it will be removed from the list
@ -644,6 +641,8 @@ void SVC_Info( netadr_t from ) {
// to prevent timed spoofed reply packets that add ghost servers
Info_SetValueForKey( infostring, "challenge", Cmd_Argv(1) );
Info_SetValueForKey( infostring, "gamename", com_gamename->string );
#ifdef LEGACY_PROTOCOL
if(com_legacyprotocol->integer > 0)
Info_SetValueForKey(infostring, "protocol", va("%i", com_legacyprotocol->integer));
@ -1154,7 +1153,7 @@ void SV_Frame( int msec ) {
SV_SendClientMessages();
// send a heartbeat to the master if needed
SV_MasterHeartbeat(sv_heartbeat->string);
SV_MasterHeartbeat(HEARTBEAT_FOR_MASTER);
}
/*

View file

@ -521,6 +521,53 @@ static void SV_BuildClientSnapshot( client_t *client ) {
}
}
#ifdef USE_VOIP
/*
==================
SV_WriteVoipToClient
Check to see if there is any VoIP queued for a client, and send if there is.
==================
*/
static void SV_WriteVoipToClient(client_t *cl, msg_t *msg)
{
int totalbytes = 0;
int i;
voipServerPacket_t *packet;
if(cl->queuedVoipPackets)
{
// Write as many VoIP packets as we reasonably can...
for(i = 0; i < cl->queuedVoipPackets; i++)
{
packet = cl->voipPacket[(i + cl->queuedVoipIndex) % ARRAY_LEN(cl->voipPacket)];
if(!*cl->downloadName)
{
totalbytes += packet->len;
if (totalbytes > (msg->maxsize - msg->cursize) / 2)
break;
MSG_WriteByte(msg, svc_voip);
MSG_WriteShort(msg, packet->sender);
MSG_WriteByte(msg, (byte) packet->generation);
MSG_WriteLong(msg, packet->sequence);
MSG_WriteByte(msg, packet->frames);
MSG_WriteShort(msg, packet->len);
MSG_WriteBits(msg, packet->flags, VOIP_FLAGCNT);
MSG_WriteData(msg, packet->data, packet->len);
}
Z_Free(packet);
}
cl->queuedVoipPackets -= i;
cl->queuedVoipIndex += i;
cl->queuedVoipIndex %= ARRAY_LEN(cl->voipPacket);
}
}
#endif
/*
=======================
SV_SendMessageToClient
@ -610,11 +657,11 @@ void SV_SendClientMessages(void)
if(*c->downloadName)
continue; // Client is downloading, don't send snapshots
if(c->netchan.unsentFragments || c->netchan_start_queue)
{
c->rateDelayed = qtrue;
if(c->netchan.unsentFragments || c->netchan_start_queue)
{
c->rateDelayed = qtrue;
continue; // Drop this snapshot if the packet queue is still full or delta compression will break
}
}
if(!(c->netchan.remoteAddress.type == NA_LOOPBACK ||
(sv_lanForceRate->integer && Sys_IsLANAddress(c->netchan.remoteAddress))))

View file

@ -382,9 +382,6 @@ SV_AreaEntities_r
static void SV_AreaEntities_r( worldSector_t *node, areaParms_t *ap ) {
svEntity_t *check, *next;
sharedEntity_t *gcheck;
int count;
count = 0;
for ( check = node->entities ; check ; check = next ) {
next = check->nextEntityInWorldSector;
@ -680,7 +677,7 @@ int SV_PointContents( const vec3_t p, int passEntityNum ) {
angles = vec3_origin; // boxes don't rotate
}
c2 = CM_TransformedPointContents (p, clipHandle, hit->s.origin, hit->s.angles);
c2 = CM_TransformedPointContents (p, clipHandle, hit->s.origin, angles);
contents |= c2;
}

View file

@ -405,9 +405,9 @@ char **Sys_ListFiles( const char *directory, const char *extension, char *filter
continue;
if (*extension) {
if ( strlen( d->d_name ) < strlen( extension ) ||
if ( strlen( d->d_name ) < extLen ||
Q_stricmp(
d->d_name + strlen( d->d_name ) - strlen( extension ),
d->d_name + strlen( d->d_name ) - extLen,
extension ) ) {
continue; // didn't match
}

View file

@ -915,7 +915,7 @@ void UI_SPSkillMenu_Cache( void );
// ui_syscalls.c
//
void trap_Print( const char *string );
void trap_Error( const char *string );
void trap_Error(const char *string) __attribute__((noreturn));
int trap_Milliseconds( void );
void trap_Cvar_Register( vmCvar_t *vmCvar, const char *varName, const char *defaultValue, int flags );
void trap_Cvar_Update( vmCvar_t *vmCvar );

View file

@ -5018,7 +5018,6 @@ UI_Init
*/
void _UI_Init( qboolean inGameLoad ) {
const char *menuSet;
int start;
//uiInfo.inGameLoad = inGameLoad;
@ -5102,8 +5101,6 @@ void _UI_Init( qboolean inGameLoad ) {
AssetCache();
start = trap_Milliseconds();
uiInfo.teamCount = 0;
uiInfo.characterCount = 0;
uiInfo.aliasCount = 0;
@ -5493,9 +5490,6 @@ void UI_DrawConnectScreen( qboolean overlay ) {
yStart = 130;
scale = 0.5f;
} else {
centerPoint = 320;
yStart = 32;
scale = 0.6f;
return;
}

View file

@ -246,6 +246,7 @@ void String_Init(void) {
}
}
#if 0
/*
=================
PC_SourceWarning
@ -267,6 +268,7 @@ static __attribute__ ((format (printf, 2, 3))) void PC_SourceWarning(int handle,
Com_Printf(S_COLOR_YELLOW "WARNING: %s, line %d: %s\n", filename, line, string);
}
#endif
/*
=================
@ -1528,12 +1530,8 @@ int Item_Slider_OverSlider(itemDef_t *item, float x, float y) {
int Item_ListBox_OverLB(itemDef_t *item, float x, float y) {
rectDef_t r;
listBoxDef_t *listPtr;
int thumbstart;
int count;
count = DC->feederCount(item->special);
listPtr = (listBoxDef_t*)item->typeData;
if (item->window.flags & WINDOW_HORIZONTAL) {
// check if on left arrow
r.x = item->window.rect.x;
@ -2592,16 +2590,9 @@ static rectDef_t *Item_CorrectedTextRect(itemDef_t *item) {
void Menu_HandleKey(menuDef_t *menu, int key, qboolean down) {
int i;
itemDef_t *item = NULL;
qboolean inHandler = qfalse;
if (inHandler) {
return;
}
inHandler = qtrue;
if (g_waitingForKey && down) {
Item_Bind_HandleKey(g_bindItem, key, down);
inHandler = qfalse;
return;
}
@ -2609,7 +2600,6 @@ void Menu_HandleKey(menuDef_t *menu, int key, qboolean down) {
if (!Item_TextField_HandleKey(g_editItem, key)) {
g_editingField = qfalse;
g_editItem = NULL;
inHandler = qfalse;
return;
} else if (key == K_MOUSE1 || key == K_MOUSE2 || key == K_MOUSE3) {
g_editingField = qfalse;
@ -2621,18 +2611,16 @@ void Menu_HandleKey(menuDef_t *menu, int key, qboolean down) {
}
if (menu == NULL) {
inHandler = qfalse;
return;
}
// see if the mouse is within the window bounds and if so is this a mouse click
// see if the mouse is within the window bounds and if so is this a mouse click
if (down && !(menu->window.flags & WINDOW_POPUP) && !Rect_ContainsPoint(&menu->window.rect, DC->cursorx, DC->cursory)) {
static qboolean inHandleKey = qfalse;
if (!inHandleKey && ( key == K_MOUSE1 || key == K_MOUSE2 || key == K_MOUSE3 ) ) {
inHandleKey = qtrue;
Menus_HandleOOBClick(menu, key, down);
inHandleKey = qfalse;
inHandler = qfalse;
return;
}
}
@ -2647,13 +2635,11 @@ void Menu_HandleKey(menuDef_t *menu, int key, qboolean down) {
if (item != NULL) {
if (Item_HandleKey(item, key, down)) {
Item_Action(item);
inHandler = qfalse;
return;
}
}
if (!down) {
inHandler = qfalse;
return;
}
@ -2744,7 +2730,6 @@ void Menu_HandleKey(menuDef_t *menu, int key, qboolean down) {
}
break;
}
inHandler = qfalse;
}
void ToWindowCoords(float *x, float *y, windowDef_t *window) {
@ -3036,8 +3021,6 @@ void Item_TextField_Paint(itemDef_t *item) {
DC->getCVarString(item->cvar, buff, sizeof(buff));
}
parent = (menuDef_t*)item->parent;
if (item->window.flags & WINDOW_HASFOCUS) {
lowLight[0] = 0.8 * parent->focusColor[0];
lowLight[1] = 0.8 * parent->focusColor[1];
@ -3375,11 +3358,9 @@ void BindingFromName(const char *cvar) {
void Item_Slider_Paint(itemDef_t *item) {
vec4_t newColor, lowLight;
float x, y, value;
float x, y;
menuDef_t *parent = (menuDef_t*)item->parent;
value = (item->cvar) ? DC->getCVarValue(item->cvar) : 0;
if (item->window.flags & WINDOW_HASFOCUS) {
lowLight[0] = 0.8 * parent->focusColor[0];
lowLight[1] = 0.8 * parent->focusColor[1];
@ -3402,12 +3383,10 @@ void Item_Slider_Paint(itemDef_t *item) {
x = Item_Slider_ThumbPosition(item);
DC->drawHandlePic( x - (SLIDER_THUMB_WIDTH / 2), y - 2, SLIDER_THUMB_WIDTH, SLIDER_THUMB_HEIGHT, DC->Assets.sliderThumb );
}
void Item_Bind_Paint(itemDef_t *item) {
vec4_t newColor, lowLight;
float value;
int maxChars = 0;
menuDef_t *parent = (menuDef_t*)item->parent;
editFieldDef_t *editPtr = (editFieldDef_t*)item->typeData;
@ -3415,8 +3394,6 @@ void Item_Bind_Paint(itemDef_t *item) {
maxChars = editPtr->maxPaintChars;
}
value = (item->cvar) ? DC->getCVarValue(item->cvar) : 0;
if (item->window.flags & WINDOW_HASFOCUS) {
if (g_bindItem == item) {
lowLight[0] = 0.8f * 1.0f;
@ -3439,7 +3416,7 @@ void Item_Bind_Paint(itemDef_t *item) {
BindingFromName(item->cvar);
DC->drawText(item->textRect.x + item->textRect.w + 8, item->textRect.y, item->textscale, newColor, g_nameBind1, 0, maxChars, item->textStyle);
} else {
DC->drawText(item->textRect.x, item->textRect.y, item->textscale, newColor, (value != 0) ? "FIXME" : "FIXME", 0, maxChars, item->textStyle);
DC->drawText(item->textRect.x, item->textRect.y, item->textscale, newColor, "FIXME", 0, maxChars, item->textStyle);
}
}
@ -3644,7 +3621,8 @@ void Item_Image_Paint(itemDef_t *item) {
}
void Item_ListBox_Paint(itemDef_t *item) {
float x, y, size, count, i, thumb;
float x, y, size, thumb;
int count, i;
qhandle_t image;
qhandle_t optionalImage;
listBoxDef_t *listPtr = (listBoxDef_t*)item->typeData;
@ -3797,12 +3775,9 @@ void Item_ListBox_Paint(itemDef_t *item) {
void Item_OwnerDraw_Paint(itemDef_t *item) {
menuDef_t *parent;
if (item == NULL) {
return;
}
parent = (menuDef_t*)item->parent;
if (DC->ownerDrawItem) {
vec4_t color, lowLight;

Some files were not shown because too many files have changed in this diff Show more