IOQ3 commit 2104

This commit is contained in:
Richard Allen 2011-08-04 18:13:35 +00:00
parent fe23de1b86
commit 5568663169
58 changed files with 134 additions and 233 deletions

View file

@ -270,7 +270,6 @@ ifneq (,$(findstring "$(PLATFORM)", "linux" "gnu_kfreebsd" "kfreebsd-gnu"))
BASE_CFLAGS = -Wall -fno-strict-aliasing -Wimplicit -Wstrict-prototypes \ BASE_CFLAGS = -Wall -fno-strict-aliasing -Wimplicit -Wstrict-prototypes \
-pipe -DUSE_ICON -pipe -DUSE_ICON
BASE_CFLAGS += -Wno-unused-but-set-variable
CLIENT_CFLAGS = $(SDL_CFLAGS) CLIENT_CFLAGS = $(SDL_CFLAGS)
SERVER_CFLAGS = SERVER_CFLAGS =

View file

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

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 } //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 // applies ground friction to the given velocity
// //
// Parameter: - // Parameter: -
@ -518,7 +506,8 @@ int AAS_ClientMovementPrediction(struct aas_clientmove_s *move,
float phys_maxstep, phys_maxsteepness, phys_jumpvel, friction; float phys_maxstep, phys_maxsteepness, phys_jumpvel, friction;
float gravity, delta, maxvel, wishspeed, accelerate; float gravity, delta, maxvel, wishspeed, accelerate;
//float velchange, newvel; //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; int areas[20], numareas;
vec3_t points[20]; vec3_t points[20];
vec3_t org, end, feet, start, stepend, lastorg, wishdir; vec3_t org, end, feet, start, stepend, lastorg, wishdir;
@ -574,7 +563,7 @@ int AAS_ClientMovementPrediction(struct aas_clientmove_s *move,
//apply command movement //apply command movement
if (n < cmdframes) if (n < cmdframes)
{ {
ax = 0; //ax = 0;
maxvel = phys_maxwalkvelocity; maxvel = phys_maxwalkvelocity;
accelerate = phys_airaccelerate; accelerate = phys_airaccelerate;
VectorCopy(cmdmove, wishdir); VectorCopy(cmdmove, wishdir);
@ -598,13 +587,13 @@ int AAS_ClientMovementPrediction(struct aas_clientmove_s *move,
{ {
accelerate = phys_walkaccelerate; accelerate = phys_walkaccelerate;
} //end else } //end else
ax = 2; //ax = 2;
} //end if } //end if
if (swimming) if (swimming)
{ {
maxvel = phys_maxswimvelocity; maxvel = phys_maxswimvelocity;
accelerate = phys_swimaccelerate; accelerate = phys_swimaccelerate;
ax = 3; //ax = 3;
} //end if } //end if
else 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 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; float volume, bestareavolume;
vec3_t areastart, cmdmove, bboxmins, bboxmaxs; vec3_t areastart, cmdmove, bboxmins, bboxmaxs;
vec3_t absmins, absmaxs, velocity; 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); VectorSet(cmdmove, 0, 0, 0);
Com_Memset(&move, 0, sizeof(aas_clientmove_t)); Com_Memset(&move, 0, sizeof(aas_clientmove_t));
area2num = 0;
AAS_ClientMovementHitBBox(&move, -1, areastart, PRESENCE_NORMAL, qfalse, AAS_ClientMovementHitBBox(&move, -1, areastart, PRESENCE_NORMAL, qfalse,
velocity, cmdmove, 0, 30, 0.1f, bboxmins, bboxmaxs, bot_visualizejumppads); velocity, cmdmove, 0, 30, 0.1f, bboxmins, bboxmaxs, bot_visualizejumppads);
if (move.frames < 30) if (move.frames < 30)
@ -837,7 +836,6 @@ int AAS_Reachability_Swim(int area1num, int area2num)
{ {
int i, j, face1num, face2num, side1; int i, j, face1num, face2num, side1;
aas_area_t *area1, *area2; aas_area_t *area1, *area2;
aas_areasettings_t *areasettings;
aas_lreachability_t *lreach; aas_lreachability_t *lreach;
aas_face_t *face1; aas_face_t *face1;
aas_plane_t *plane; aas_plane_t *plane;
@ -875,7 +873,6 @@ int AAS_Reachability_Swim(int area1num, int area2num)
{ {
// //
face1 = &aasworld.faces[face1num]; face1 = &aasworld.faces[face1num];
areasettings = &aasworld.areasettings[area1num];
//create a new reachability link //create a new reachability link
lreach = AAS_AllocReachability(); lreach = AAS_AllocReachability();
if (!lreach) return qfalse; 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 ground_bestarea2groundedgenum, ground_foundreach;
int water_bestarea2groundedgenum, water_foundreach; int water_bestarea2groundedgenum, water_foundreach;
int side1, area1swim, faceside1, groundface1num; 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 x1, x2, x3, x4, y1, y2, y3, y4, tmp, y;
float length, ground_bestlength, water_bestlength, ground_bestdist, water_bestdist; float length, ground_bestlength, water_bestlength, ground_bestdist, water_bestdist;
vec3_t v1, v2, v3, v4, tmpv, p1area1, p1area2, p2area1, p2area2; 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; vec3_t testpoint;
aas_plane_t *plane; aas_plane_t *plane;
aas_area_t *area1, *area2; 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_edge_t *edge1, *edge2;
aas_lreachability_t *lreach; aas_lreachability_t *lreach;
aas_trace_t trace; 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 //edges if they overlap in the direction orthogonal to
//the gravity direction //the gravity direction
CrossProduct(invgravity, normal, ort); CrossProduct(invgravity, normal, ort);
invgravitydot = DotProduct(invgravity, invgravity); //invgravitydot = DotProduct(invgravity, invgravity);
ortdot = DotProduct(ort, ort); ortdot = DotProduct(ort, ort);
//projection into the step plane //projection into the step plane
//NOTE: since gravity is vertical this is just the z coordinate //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_bestlength = length;
ground_foundreach = qtrue; ground_foundreach = qtrue;
ground_bestarea2groundedgenum = edge1num; ground_bestarea2groundedgenum = edge1num;
ground_bestface1 = groundface1;
//best point towards area1 //best point towards area1
VectorCopy(start, ground_beststart); VectorCopy(start, ground_beststart);
//normal is pointing into area2 //normal is pointing into area2
@ -1323,7 +1320,6 @@ int AAS_Reachability_Step_Barrier_WaterJump_WalkOffLedge(int area1num, int area2
water_bestlength = length; water_bestlength = length;
water_foundreach = qtrue; water_foundreach = qtrue;
water_bestarea2groundedgenum = edge1num; water_bestarea2groundedgenum = edge1num;
water_bestface1 = groundface1;
//best point towards area1 //best point towards area1
VectorCopy(start, water_beststart); VectorCopy(start, water_beststart);
//normal is pointing into area2 //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); botimport.Print(PRT_ERROR, "teleporter destination (%s) in solid\n", target);
continue; continue;
} //end if } //end if
/*
area2num = AAS_PointAreaNum(trace.endpos); area2num = AAS_PointAreaNum(trace.endpos);
// //
/*
if (!AAS_AreaTeleporter(area2num) && if (!AAS_AreaTeleporter(area2num) &&
!AAS_AreaJumpPad(area2num) && !AAS_AreaJumpPad(area2num) &&
!AAS_AreaGrounded(area2num)) !AAS_AreaGrounded(area2num))
@ -3396,7 +3392,6 @@ void AAS_Reachability_FuncBobbing(void)
// //
for (i = 0; i < 2; i++) for (i = 0; i < 2; i++)
{ {
firststartreach = firstendreach = NULL;
// //
if (i == 0) if (i == 0)
{ {
@ -3492,7 +3487,8 @@ void AAS_Reachability_JumpPad(void)
int face2num, i, ret, area2num, visualize, ent, bot_visualizejumppads; int face2num, i, ret, area2num, visualize, ent, bot_visualizejumppads;
//int modelnum, ent2; //int modelnum, ent2;
//float dist, time, height, gravity, forward; //float dist, time, height, gravity, forward;
float speed, zvel, hordist; float speed, zvel;
//float hordist;
aas_face_t *face2; aas_face_t *face2;
aas_area_t *area2; aas_area_t *area2;
aas_lreachability_t *lreach; aas_lreachability_t *lreach;
@ -3714,7 +3710,7 @@ void AAS_Reachability_JumpPad(void)
//direction towards the face center //direction towards the face center
VectorSubtract(facecenter, areastart, dir); VectorSubtract(facecenter, areastart, dir);
dir[2] = 0; dir[2] = 0;
hordist = VectorNormalize(dir); //hordist = VectorNormalize(dir);
//if (hordist < 1.6 * facecenter[2] - areastart[2]) //if (hordist < 1.6 * facecenter[2] - areastart[2])
{ {
//get command movement //get command movement
@ -3997,7 +3993,8 @@ void AAS_SetWeaponJumpAreaFlags(void)
int AAS_Reachability_WeaponJump(int area1num, int area2num) int AAS_Reachability_WeaponJump(int area1num, int area2num)
{ {
int face2num, i, n, ret, visualize; int face2num, i, n, ret, visualize;
float speed, zvel, hordist; float speed, zvel;
//float hordist;
aas_face_t *face2; aas_face_t *face2;
aas_area_t *area1, *area2; aas_area_t *area1, *area2;
aas_lreachability_t *lreach; aas_lreachability_t *lreach;
@ -4057,7 +4054,7 @@ int AAS_Reachability_WeaponJump(int area1num, int area2num)
//direction towards the face center //direction towards the face center
VectorSubtract(facecenter, areastart, dir); VectorSubtract(facecenter, areastart, dir);
dir[2] = 0; dir[2] = 0;
hordist = VectorNormalize(dir); //hordist = VectorNormalize(dir);
//if (hordist < 1.6 * (facecenter[2] - areastart[2])) //if (hordist < 1.6 * (facecenter[2] - areastart[2]))
{ {
//get command movement //get command movement

View file

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

View file

@ -844,7 +844,6 @@ void BotReplaceReplySynonyms(char *string, unsigned long int context)
if (!(syn->context & context)) continue; if (!(syn->context & context)) continue;
for (synonym = syn->firstsynonym->next; synonym; synonym = synonym->next) for (synonym = syn->firstsynonym->next; synonym; synonym = synonym->next)
{ {
str2 = synonym->string;
//if the synonym is not at the front of the string continue //if the synonym is not at the front of the string continue
str2 = StringContainsWord(str1, synonym->string, qfalse); str2 = StringContainsWord(str1, synonym->string, qfalse);
if (!str2 || str2 != str1) continue; if (!str2 || str2 != str1) continue;
@ -2939,7 +2938,6 @@ int BotAllocChatState(void)
//======================================================================== //========================================================================
void BotFreeChatState(int handle) void BotFreeChatState(int handle)
{ {
bot_chatstate_t *cs;
bot_consolemessage_t m; bot_consolemessage_t m;
int h; int h;
@ -2953,7 +2951,6 @@ void BotFreeChatState(int handle)
botimport.Print(PRT_FATAL, "invalid chat state %d\n", handle); botimport.Print(PRT_FATAL, "invalid chat state %d\n", handle);
return; return;
} //end if } //end if
cs = botchatstates[handle];
if (LibVarGetValue("bot_reloadcharacters")) if (LibVarGetValue("bot_reloadcharacters"))
{ {
BotFreeChatFile(handle); 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) int GeneticSelection(int numranks, float *rankings)
{ {
float sum, select; float sum;
int i, index; int i, index;
sum = 0; sum = 0;
@ -64,7 +64,7 @@ int GeneticSelection(int numranks, float *rankings)
{ {
//select a bot where the ones with the higest rankings have //select a bot where the ones with the higest rankings have
//the highest chance of being selected //the highest chance of being selected
select = random() * sum; //sum *= random();
for (i = 0; i < numranks; i++) for (i = 0; i < numranks; i++)
{ {
if (rankings[i] < 0) continue; 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) void BotSaveGoalFuzzyLogic(int goalstate, char *filename)
{ {
bot_goalstate_t *gs; //bot_goalstate_t *gs;
gs = BotGoalStateFromHandle(goalstate); //gs = BotGoalStateFromHandle(goalstate);
//WriteWeightConfig(filename, gs->itemweightconfig); //WriteWeightConfig(filename, gs->itemweightconfig);
} //end of the function BotSaveGoalFuzzyLogic } //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); ms = BotMoveStateFromHandle(movestate);
if (!ms) return qfalse; if (!ms) return qfalse;
reachnum = 0;
//if the bot has no goal or no last reachability //if the bot has no goal or no last reachability
if (!ms->lastreachnum || !goal) return qfalse; 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 BotGapDistance(vec3_t origin, vec3_t hordir, int entnum)
{ {
float dist, startz; int dist;
float startz;
vec3_t start, end; vec3_t start, end;
aas_trace_t trace; aas_trace_t trace;
//do gap checking //do gap checking
startz = origin[2]; //startz = origin[2];
//this enables walking down stairs more fluidly //this enables walking down stairs more fluidly
{ {
VectorCopy(origin, start); VectorCopy(origin, start);
@ -1030,7 +1030,7 @@ float BotGapDistance(vec3_t origin, vec3_t hordir, int entnum)
end[2] -= 20; end[2] -= 20;
if (AAS_PointContents(end) & CONTENTS_WATER) break; if (AAS_PointContents(end) & CONTENTS_WATER) break;
//if a gap is found slow down //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; return dist;
} //end if } //end if
startz = trace.endpos[2]; 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) bot_moveresult_t BotFinishTravel_BarrierJump(bot_movestate_t *ms, aas_reachability_t *reach)
{ {
float dist;
vec3_t hordir; vec3_t hordir;
bot_moveresult_t_cleared( result ); 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[0] = reach->end[0] - ms->origin[0];
hordir[1] = reach->end[1] - ms->origin[1]; hordir[1] = reach->end[1] - ms->origin[1];
hordir[2] = 0; hordir[2] = 0;
dist = VectorNormalize(hordir);
// //
BotCheckBlocked(ms, hordir, qtrue, &result); 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) bot_moveresult_t BotFinishTravel_WaterJump(bot_movestate_t *ms, aas_reachability_t *reach)
{ {
vec3_t dir, pnt; vec3_t dir, pnt;
float dist;
bot_moveresult_t_cleared( result ); bot_moveresult_t_cleared( result );
//botimport.Print(PRT_MESSAGE, "BotFinishTravel_WaterJump\n"); //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[0] += crandom() * 10;
dir[1] += crandom() * 10; dir[1] += crandom() * 10;
dir[2] += 70 + crandom() * 10; dir[2] += 70 + crandom() * 10;
dist = VectorNormalize(dir);
//elemantary actions //elemantary actions
EA_Move(ms->client, dir, 400); EA_Move(ms->client, dir, 400);
//set the ideal view angles //set the ideal view angles
@ -1721,7 +1717,6 @@ bot_moveresult_t BotFinishTravel_WalkOffLedge(bot_movestate_t *ms, aas_reachabil
VectorCopy(dir, hordir); VectorCopy(dir, hordir);
hordir[2] = 0; hordir[2] = 0;
// //
dist = VectorNormalize(hordir);
speed = 400; speed = 400;
} //end if } //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) bot_moveresult_t BotTravel_Jump(bot_movestate_t *ms, aas_reachability_t *reach)
{ {
vec3_t hordir, dir1, dir2, mins, maxs, start, end; vec3_t hordir, dir1, dir2, mins, maxs, start, end;
int gapdist;
float dist1, dist2, speed; float dist1, dist2, speed;
bot_moveresult_t_cleared( result ); bot_moveresult_t_cleared( result );
bsp_trace_t trace; 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); trace = AAS_Trace(start, mins, maxs, end, ms->entitynum, MASK_PLAYERSOLID);
if (trace.startsolid) VectorCopy(start, trace.endpos); if (trace.startsolid) VectorCopy(start, trace.endpos);
//check for a gap //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; end[2] += 1;
if (AAS_PointAreaNum(end) != ms->reachareanum) break; if (AAS_PointAreaNum(end) != ms->reachareanum) break;
} //end for } //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); // dist1 = BotGapDistance(start, hordir, ms->entitynum);
// if (dist1 && dist1 <= trace.fraction * 80) VectorMA(reach->start, dist1-20, hordir, trace.endpos); // 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 hordir, dir1, dir2, start, end, runstart;
// vec3_t runstart, dir1, dir2, hordir; // vec3_t runstart, dir1, dir2, hordir;
int gapdist;
float dist1, dist2, speed; float dist1, dist2, speed;
bot_moveresult_t_cleared( result ); 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; start[2] += 1;
VectorMA(reach->start, 80, hordir, runstart); VectorMA(reach->start, 80, hordir, runstart);
//check for a gap //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; end[2] += 1;
if (AAS_PointAreaNum(end) != ms->reachareanum) break; if (AAS_PointAreaNum(end) != ms->reachareanum) break;
} //end for } //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); VectorSubtract(ms->origin, reach->start, dir1);
dir1[2] = 0; 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) bot_moveresult_t BotTravel_JumpPad(bot_movestate_t *ms, aas_reachability_t *reach)
{ {
float dist, speed;
vec3_t hordir; vec3_t hordir;
bot_moveresult_t_cleared( result ); 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[0] = reach->start[0] - ms->origin[0];
hordir[1] = reach->start[1] - ms->origin[1]; hordir[1] = reach->start[1] - ms->origin[1];
hordir[2] = 0; hordir[2] = 0;
dist = VectorNormalize(hordir);
// //
BotCheckBlocked(ms, hordir, qtrue, &result); BotCheckBlocked(ms, hordir, qtrue, &result);
speed = 400;
//elemantary action move in direction //elemantary action move in direction
EA_Move(ms->client, hordir, speed); EA_Move(ms->client, hordir, 400);
VectorCopy(hordir, result.movedir); VectorCopy(hordir, result.movedir);
// //
return result; return result;

View file

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

View file

@ -842,7 +842,6 @@ or bursted delayed packets.
#define RESET_TIME 500 #define RESET_TIME 500
void CL_AdjustTimeDelta( void ) { void CL_AdjustTimeDelta( void ) {
int resetTime;
int newDelta; int newDelta;
int deltaDelta; int deltaDelta;
@ -853,13 +852,6 @@ void CL_AdjustTimeDelta( void ) {
return; 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; newDelta = cl.snap.serverTime - cls.realtime;
deltaDelta = abs( newDelta - cl.serverTimeDelta ); deltaDelta = abs( newDelta - cl.serverTimeDelta );

View file

@ -937,10 +937,6 @@ static void setupQuad( long xOff, long yOff )
cin.oldysize = cinTable[currentHandle].ysize; cin.oldysize = cinTable[currentHandle].ysize;
cin.oldxsize = cinTable[currentHandle].xsize; 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 = (cinTable[currentHandle].xsize*cinTable[currentHandle].ysize) / (16);
numQuadCels += numQuadCels/4; numQuadCels += numQuadCels/4;
numQuadCels += 64; // for overflow numQuadCels += 64; // for overflow
@ -1610,7 +1606,6 @@ void CIN_DrawCinematic (int handle) {
void CL_PlayCinematic_f(void) { void CL_PlayCinematic_f(void) {
char *arg, *s; char *arg, *s;
qboolean holdatend;
int bits = CIN_system; int bits = CIN_system;
Com_DPrintf("CL_PlayCinematic_f\n"); Com_DPrintf("CL_PlayCinematic_f\n");
@ -1621,7 +1616,6 @@ void CL_PlayCinematic_f(void) {
arg = Cmd_Argv( 1 ); arg = Cmd_Argv( 1 );
s = Cmd_Argv(2); s = Cmd_Argv(2);
holdatend = qfalse;
if ((s && s[0] == '1') || Q_stricmp(arg,"demoend.roq")==0 || Q_stricmp(arg,"end.roq")==0) { if ((s && s[0] == '1') || Q_stricmp(arg,"demoend.roq")==0 || Q_stricmp(arg,"end.roq")==0) {
bits |= CIN_hold; 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_yawspeed;
cvar_t *cl_pitchspeed; cvar_t *cl_pitchspeed;
@ -399,13 +395,9 @@ CL_JoystickMove
================= =================
*/ */
void CL_JoystickMove( usercmd_t *cmd ) { void CL_JoystickMove( usercmd_t *cmd ) {
int movespeed;
float anglespeed; float anglespeed;
if ( in_speed.active ^ cl_run->integer ) { if ( !(in_speed.active ^ cl_run->integer) ) {
movespeed = 2;
} else {
movespeed = 1;
cmd->buttons |= BUTTON_WALKING; cmd->buttons |= BUTTON_WALKING;
} }
@ -617,10 +609,10 @@ usercmd_t CL_CreateCmd( void ) {
// draw debug graphs of turning for mouse testing // draw debug graphs of turning for mouse testing
if ( cl_debugMove->integer ) { if ( cl_debugMove->integer ) {
if ( cl_debugMove->integer == 1 ) { 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 ) { 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 ) { void CL_CreateNewCommands( void ) {
usercmd_t *cmd;
int cmdNum; int cmdNum;
// no need to create usercmds until we have a gamestate // no need to create usercmds until we have a gamestate
@ -658,7 +649,6 @@ void CL_CreateNewCommands( void ) {
cl.cmdNumber++; cl.cmdNumber++;
cmdNum = cl.cmdNumber & CMD_MASK; cmdNum = cl.cmdNumber & CMD_MASK;
cl.cmds[cmdNum] = CL_CreateCmd (); cl.cmds[cmdNum] = CL_CreateCmd ();
cmd = &cl.cmds[cmdNum];
} }
/* /*

View file

@ -440,9 +440,7 @@ void CL_CaptureVoip(void)
// try to get more audio data from the sound card... // try to get more audio data from the sound card...
if (initialFrame) { if (initialFrame) {
float gain = cl_voipGainDuringCapture->value; S_MasterGain(Com_Clamp(0.0f, 1.0f, cl_voipGainDuringCapture->value));
if (gain < 0.0f) gain = 0.0f; else if (gain >= 1.0f) gain = 1.0f;
S_MasterGain(cl_voipGainDuringCapture->value);
S_StartCapture(); S_StartCapture();
CL_VoipNewGeneration(); CL_VoipNewGeneration();
CL_VoipParseTargets(); CL_VoipParseTargets();
@ -582,9 +580,8 @@ CL_ChangeReliableCommand
====================== ======================
*/ */
void CL_ChangeReliableCommand( void ) { void CL_ChangeReliableCommand( void ) {
int r, index, l; int index, l;
r = clc.reliableSequence - (random() * 5);
index = clc.reliableSequence & ( MAX_RELIABLE_COMMANDS - 1 ); index = clc.reliableSequence & ( MAX_RELIABLE_COMMANDS - 1 );
l = strlen(clc.reliableCommands[ index ]); l = strlen(clc.reliableCommands[ index ]);
if ( l >= MAX_STRING_CHARS - 1 ) { if ( l >= MAX_STRING_CHARS - 1 ) {
@ -3001,7 +2998,7 @@ void CL_Frame ( int msec ) {
cls.realtime += cls.frametime; cls.realtime += cls.frametime;
if ( cl_timegraph->integer ) { 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 // see if we need to update any userinfo
@ -3803,10 +3800,8 @@ CL_GetServerStatus
=================== ===================
*/ */
serverStatus_t *CL_GetServerStatus( netadr_t from ) { serverStatus_t *CL_GetServerStatus( netadr_t from ) {
serverStatus_t *serverStatus;
int i, oldest, oldestTime; int i, oldest, oldestTime;
serverStatus = NULL;
for (i = 0; i < MAX_SERVERSTATUSREQUESTS; i++) { for (i = 0; i < MAX_SERVERSTATUSREQUESTS; i++) {
if ( NET_CompareAdr( from, cl_serverStatusList[i].address ) ) { if ( NET_CompareAdr( from, cl_serverStatusList[i].address ) ) {
return &cl_serverStatusList[i]; return &cl_serverStatusList[i];
@ -4330,7 +4325,6 @@ qboolean CL_UpdateVisiblePings_f(int source) {
if (slots < MAX_PINGREQUESTS) { if (slots < MAX_PINGREQUESTS) {
serverInfo_t *server = NULL; serverInfo_t *server = NULL;
max = (source == AS_GLOBAL) ? MAX_GLOBAL_SERVERS : MAX_OTHER_SERVERS;
switch (source) { switch (source) {
case AS_LOCAL : case AS_LOCAL :
server = &cls.localServers[0]; server = &cls.localServers[0];

View file

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

View file

@ -564,7 +564,7 @@ void CL_SaveConsoleHistory( void );
void SCR_Init (void); void SCR_Init (void);
void SCR_UpdateScreen (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 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) static qboolean S_ReadRIFFHeader(fileHandle_t file, snd_info_t *info)
{ {
char dump[16]; char dump[16];
int wav_format;
int bits; int bits;
int fmtlen = 0; int fmtlen = 0;
@ -146,7 +145,7 @@ static qboolean S_ReadRIFFHeader(fileHandle_t file, snd_info_t *info)
} }
// Save the parameters // Save the parameters
wav_format = FGetLittleShort(file); FGetLittleShort(file); // wav_format
info->channels = FGetLittleShort(file); info->channels = FGetLittleShort(file);
info->rate = FGetLittleLong(file); info->rate = FGetLittleLong(file);
FGetLittleLong(file); FGetLittleLong(file);

View file

@ -353,8 +353,6 @@ S_AL_BufferUnload
*/ */
static void S_AL_BufferUnload(sfxHandle_t sfx) static void S_AL_BufferUnload(sfxHandle_t sfx)
{ {
ALenum error;
if(knownSfx[sfx].filename[0] == '\0') if(knownSfx[sfx].filename[0] == '\0')
return; return;
@ -364,7 +362,7 @@ static void S_AL_BufferUnload(sfxHandle_t sfx)
// Delete it // Delete it
S_AL_ClearError( qfalse ); S_AL_ClearError( qfalse );
qalDeleteBuffers(1, &knownSfx[sfx].buffer); 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", Com_Printf( S_COLOR_RED "ERROR: Can't delete sound buffer for %s\n",
knownSfx[sfx].filename); knownSfx[sfx].filename);
@ -785,7 +783,6 @@ qboolean S_AL_SrcInit( void )
{ {
int i; int i;
int limit; int limit;
ALenum error;
// Clear the sources data structure // Clear the sources data structure
memset(srcList, 0, sizeof(srcList)); memset(srcList, 0, sizeof(srcList));
@ -804,7 +801,7 @@ qboolean S_AL_SrcInit( void )
for(i = 0; i < limit; i++) for(i = 0; i < limit; i++)
{ {
qalGenSources(1, &srcList[i].alSource); qalGenSources(1, &srcList[i].alSource);
if((error = qalGetError()) != AL_NO_ERROR) if(qalGetError() != AL_NO_ERROR)
break; break;
srcCount++; srcCount++;
} }
@ -3176,20 +3173,26 @@ qboolean S_AL_Init( soundInterface_t *si )
{ {
char devicenames[16384] = ""; char devicenames[16384] = "";
const char *devicelist; const char *devicelist;
#ifdef _WIN32
const char *defaultdevice; const char *defaultdevice;
#endif
int curlen; int curlen;
// get all available devices + the default device name. // get all available devices + the default device name.
if(enumeration_all_ext) if(enumeration_all_ext)
{ {
devicelist = qalcGetString(NULL, ALC_ALL_DEVICES_SPECIFIER); devicelist = qalcGetString(NULL, ALC_ALL_DEVICES_SPECIFIER);
#ifdef _WIN32
defaultdevice = qalcGetString(NULL, ALC_DEFAULT_ALL_DEVICES_SPECIFIER); defaultdevice = qalcGetString(NULL, ALC_DEFAULT_ALL_DEVICES_SPECIFIER);
#endif
} }
else else
{ {
// We don't have ALC_ENUMERATE_ALL_EXT but normal enumeration. // We don't have ALC_ENUMERATE_ALL_EXT but normal enumeration.
devicelist = qalcGetString(NULL, ALC_DEVICE_SPECIFIER); devicelist = qalcGetString(NULL, ALC_DEVICE_SPECIFIER);
#ifdef _WIN32
defaultdevice = qalcGetString(NULL, ALC_DEFAULT_DEVICE_SPECIFIER); defaultdevice = qalcGetString(NULL, ALC_DEFAULT_DEVICE_SPECIFIER);
#endif
enumeration_ext = qtrue; enumeration_ext = qtrue;
} }

View file

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

View file

@ -463,7 +463,7 @@ int jitter_buffer_get(JitterBuffer *jitter, JitterBufferPacket *packet, spx_int3
{ {
int i; int i;
unsigned int j; unsigned int j;
int incomplete = 0; //int incomplete = 0;
spx_int16_t opt; spx_int16_t opt;
if (start_offset != NULL) if (start_offset != NULL)
@ -568,7 +568,7 @@ int jitter_buffer_get(JitterBuffer *jitter, JitterBufferPacket *packet, spx_int3
if (found) if (found)
{ {
i=besti; 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);*/ /*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; int offset;
spx_word16_t *exc; spx_word16_t *exc;
spx_word16_t *sp; //spx_word16_t *sp;
spx_word16_t *innov_save = NULL; spx_word16_t *innov_save = NULL;
spx_word16_t tmp; spx_word16_t tmp;
@ -1309,7 +1309,7 @@ int nb_decode(void *state, SpeexBits *bits, void *vout)
/* Excitation */ /* Excitation */
exc=st->exc+offset; exc=st->exc+offset;
/* Original signal */ /* Original signal */
sp=out+offset; //sp=out+offset;
if (st->innov_save) if (st->innov_save)
innov_save = st->innov_save+offset; innov_save = st->innov_save+offset;
@ -1502,13 +1502,13 @@ int nb_decode(void *state, SpeexBits *bits, void *vout)
{ {
int offset; int offset;
spx_word16_t *sp; spx_word16_t *sp;
spx_word16_t *exc; //spx_word16_t *exc;
/* Offset relative to start of frame */ /* Offset relative to start of frame */
offset = st->subframeSize*sub; offset = st->subframeSize*sub;
/* Original signal */ /* Original signal */
sp=out+offset; sp=out+offset;
/* Excitation */ /* Excitation */
exc=st->exc+offset; //exc=st->exc+offset;
/* LSP interpolation (quantized and unquantized) */ /* LSP interpolation (quantized and unquantized) */
lsp_interpolate(st->old_qlsp, qlsp, interp_qlsp, st->lpcSize, sub, st->nbSubframes); 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; int i;
float ener=0, ener1=0, ener2=0; float ener=0, ener1=0, ener2=0;
float qual=7; float qual=7;
int va; //int va;
float log_energy; float log_energy;
float non_st=0; float non_st=0;
float voicing; 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)) || (voicing<0 && non_st < .05))
{ {
float tmp; float tmp;
va = 0; //va = 0;
vbr->consec_noise++; vbr->consec_noise++;
if (pow_ener > 3*vbr->noise_level) if (pow_ener > 3*vbr->noise_level)
tmp = 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; vbr->noise_accum_count = .95*vbr->noise_accum_count + .05;
} }
} else { } else {
va = 1; //va = 1;
vbr->consec_noise=0; vbr->consec_noise=0;
} }

View file

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

View file

@ -111,20 +111,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 Demos_MenuInit
@ -137,7 +123,6 @@ static void Demos_MenuInit( void ) {
int protocol, protocolLegacy; int protocol, protocolLegacy;
memset( &s_demos, 0 ,sizeof(demos_t) ); memset( &s_demos, 0 ,sizeof(demos_t) );
s_demos.menu.key = UI_DemosMenu_Key;
Demos_Cache(); Demos_Cache();

View file

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

View file

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

View file

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

View file

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

View file

@ -138,7 +138,7 @@ void CMod_LoadSubmodels( lump_t *l ) {
Com_Error( ERR_DROP, "MAX_SUBMODELS exceeded" ); 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]; 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 ) { void CM_TraceThroughSphere( traceWork_t *tw, vec3_t origin, float radius, vec3_t start, vec3_t end ) {
float l1, l2, length, scale, fraction; float l1, l2, length, scale, fraction;
float a, b, c, d, sqrtd; //float a;
float b, c, d, sqrtd;
vec3_t v1, dir, intersection; vec3_t v1, dir, intersection;
// if inside the sphere // 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); VectorSubtract(start, origin, v1);
// dir is normalized so a = 1 // 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]); 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); 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) { 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 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; vec3_t v1, dir, start2d, end2d, org2d, intersection;
// 2d coordinates // 2d coordinates
@ -866,7 +868,7 @@ void CM_TraceThroughVerticalCylinder( traceWork_t *tw, vec3_t origin, float radi
// //
VectorSubtract(start, origin, v1); VectorSubtract(start, origin, v1);
// dir is normalized so we can use a = 1 // 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]); 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); 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; char *c;
void *v; void *v;
} f; } f;
int len;
char filename[MAX_QPATH]; char filename[MAX_QPATH];
if (Cmd_Argc () != 2) { if (Cmd_Argc () != 2) {
@ -279,7 +278,7 @@ void Cmd_Exec_f( void ) {
Q_strncpyz( filename, Cmd_Argv(1), sizeof( filename ) ); Q_strncpyz( filename, Cmd_Argv(1), sizeof( filename ) );
COM_DefaultExtension( filename, sizeof( filename ), ".cfg" ); COM_DefaultExtension( filename, sizeof( filename ), ".cfg" );
len = FS_ReadFile( filename, &f.v); FS_ReadFile( filename, &f.v);
if (!f.c) { if (!f.c) {
Com_Printf ("couldn't exec %s\n",Cmd_Argv(1)); Com_Printf ("couldn't exec %s\n",Cmd_Argv(1));
return; return;

View file

@ -930,10 +930,11 @@ Z_TagMalloc
*/ */
#ifdef ZONE_DEBUG #ifdef ZONE_DEBUG
void *Z_TagMallocDebug( int size, int tag, char *label, char *file, int line ) { void *Z_TagMallocDebug( int size, int tag, char *label, char *file, int line ) {
int allocSize;
#else #else
void *Z_TagMalloc( int size, int tag ) { void *Z_TagMalloc( int size, int tag ) {
#endif #endif
int extra, allocSize; int extra;
memblock_t *start, *rover, *new, *base; memblock_t *start, *rover, *new, *base;
memzone_t *zone; memzone_t *zone;
@ -948,7 +949,9 @@ void *Z_TagMalloc( int size, int tag ) {
zone = mainzone; zone = mainzone;
} }
#ifdef ZONE_DEBUG
allocSize = size; allocSize = size;
#endif
// //
// scan through the block list looking for the first free block // scan through the block list looking for the first free block
// of sufficient size // of sufficient size
@ -1087,7 +1090,10 @@ void Z_LogZoneHeap( memzone_t *zone, char *name ) {
if (!logfile || !FS_Initialized()) if (!logfile || !FS_Initialized())
return; 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); Com_sprintf(buf, sizeof(buf), "\r\n================\r\n%s log\r\n================\r\n", name);
FS_Write(buf, strlen(buf), logfile); FS_Write(buf, strlen(buf), logfile);
for (block = zone->blocklist.next ; block->next != &zone->blocklist; block = block->next) { for (block = zone->blocklist.next ; block->next != &zone->blocklist; block = block->next) {
@ -3105,7 +3111,6 @@ void Com_Frame( void ) {
else else
minMsec = 1; minMsec = 1;
timeVal = 0;
do do
{ {
if(com_sv_running->integer) if(com_sv_running->integer)

View file

@ -2443,7 +2443,7 @@ int FS_GetModList( char *listbuf, int bufsize ) {
qboolean bDrop = qfalse; qboolean bDrop = qfalse;
*listbuf = 0; *listbuf = 0;
nMods = nPotential = nTotal = 0; nMods = nTotal = 0;
pFiles0 = Sys_ListFiles( fs_homepath->string, NULL, NULL, &dummy, qtrue ); pFiles0 = Sys_ListFiles( fs_homepath->string, NULL, NULL, &dummy, qtrue );
pFiles1 = Sys_ListFiles( fs_basepath->string, NULL, NULL, &dummy, qtrue ); pFiles1 = Sys_ListFiles( fs_basepath->string, NULL, NULL, &dummy, qtrue );
@ -2946,7 +2946,7 @@ we are not interested in a download string format, we want something human-reada
*/ */
qboolean FS_ComparePaks( char *neededpaks, int len, qboolean dlstring ) { qboolean FS_ComparePaks( char *neededpaks, int len, qboolean dlstring ) {
searchpath_t *sp; searchpath_t *sp;
qboolean havepak, badchecksum; qboolean havepak;
char *origpos = neededpaks; char *origpos = neededpaks;
int i; int i;
@ -2958,7 +2958,6 @@ qboolean FS_ComparePaks( char *neededpaks, int len, qboolean dlstring ) {
for ( i = 0 ; i < fs_numServerReferencedPaks ; i++ ) for ( i = 0 ; i < fs_numServerReferencedPaks ; i++ )
{ {
// Ok, see if we have this pak file // Ok, see if we have this pak file
badchecksum = qfalse;
havepak = qfalse; havepak = qfalse;
// never autodownload any of the id paks // 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 ammobits;
int powerupbits; int powerupbits;
int numFields; int numFields;
int c;
netField_t *field; netField_t *field;
int *fromF, *toF; int *fromF, *toF;
float fullFloat; float fullFloat;
@ -1219,8 +1218,6 @@ void MSG_WriteDeltaPlayerstate( msg_t *msg, struct playerState_s *from, struct p
Com_Memset (&dummy, 0, sizeof(dummy)); Com_Memset (&dummy, 0, sizeof(dummy));
} }
c = msg->cursize;
numFields = ARRAY_LEN( playerStateFields ); numFields = ARRAY_LEN( playerStateFields );
lc = 0; lc = 0;
@ -1268,7 +1265,6 @@ void MSG_WriteDeltaPlayerstate( msg_t *msg, struct playerState_s *from, struct p
MSG_WriteBits( msg, *toF, field->bits ); 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 ) { qboolean Netchan_Process( netchan_t *chan, msg_t *msg ) {
int sequence; int sequence;
int qport;
int fragmentStart, fragmentLength; int fragmentStart, fragmentLength;
qboolean fragmented; qboolean fragmented;
@ -264,7 +263,7 @@ qboolean Netchan_Process( netchan_t *chan, msg_t *msg ) {
// read the qport if we are a server // read the qport if we are a server
if ( chan->sock == NS_SERVER ) { if ( chan->sock == NS_SERVER ) {
qport = MSG_ReadShort( msg ); MSG_ReadShort( msg );
} }
#ifdef LEGACY_PROTOCOL #ifdef LEGACY_PROTOCOL

View file

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

View file

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

View file

@ -1027,7 +1027,7 @@ void Key_WriteBindings( fileHandle_t f );
void S_ClearSoundBuffer( void ); void S_ClearSoundBuffer( void );
// call before filesystem access // 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 // AVI files have the start of pixel lines 4 byte-aligned
#define AVI_LINE_PADDING 4 #define AVI_LINE_PADDING 4
@ -1089,7 +1089,7 @@ void *Sys_GetBotLibAPI( void *parms );
char *Sys_GetCurrentUser( void ); 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)); void Sys_Quit (void) __attribute__ ((noreturn));
char *Sys_GetClipboardData( void ); // note that this isn't journaled... char *Sys_GetClipboardData( void ); // note that this isn't journaled...

View file

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

View file

@ -237,7 +237,6 @@ void VM_PrepareInterpreter( vm_t *vm, vmHeader_t *header ) {
} }
int_pc = 0; int_pc = 0;
instruction = 0; instruction = 0;
code = (byte *)header + header->codeOffset;
// Now that the code has been expanded to int-sized opcodes, we'll translate instruction index // 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. //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]; byte stack[OPSTACK_SIZE + 15];
void *entryPoint; void *entryPoint;
int programCounter;
int programStack, stackOnEntry; int programStack, stackOnEntry;
byte *image; byte *image;
int *opStack; int *opStack;
@ -1733,8 +1732,6 @@ int VM_CallCompiled(vm_t *vm, int *args)
// set up the stack frame // set up the stack frame
image = vm->dataBase; image = vm->dataBase;
programCounter = 0;
programStack -= 48; programStack -= 48;
*(int *)&image[ programStack + 44] = args[9]; *(int *)&image[ programStack + 44] = args[9];

View file

@ -966,7 +966,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 // we definately want to sync every frame for the cinematics
qglFinish(); qglFinish();
start = end = 0; start = 0;
if ( r_speeds->integer ) { if ( r_speeds->integer ) {
start = ri.Milliseconds(); start = ri.Milliseconds();
} }

View file

@ -204,10 +204,9 @@ static int neighbors[8][2] = {
VectorAdd( normal, sum, sum ); VectorAdd( normal, sum, sum );
count++; count++;
} }
if ( count == 0 ) { //if ( count == 0 ) {
// printf("bad normal\n"); // printf("bad normal\n");
count = 1; //}
}
VectorNormalize2( sum, dv->normal ); 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 ) { void RB_AddFlare( void *surface, int fogNum, vec3_t point, vec3_t color, vec3_t normal ) {
int i; int i;
flare_t *f, *oldest; flare_t *f;
vec3_t local; vec3_t local;
float d = 1; float d = 1;
vec4_t eye, clip, normalized, window; 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 // see if a flare with a matching surface, scene, and view exists
oldest = r_flareStructs;
for ( f = r_activeFlares ; f ; f = f->next ) { for ( f = r_activeFlares ; f ; f = f->next ) {
if ( f->surface == surface && f->frameSceneNum == backEnd.viewParms.frameSceneNum if ( f->surface == surface && f->frameSceneNum == backEnd.viewParms.frameSceneNum
&& f->inPortal == backEnd.viewParms.isPortal ) { && f->inPortal == backEnd.viewParms.isPortal ) {

View file

@ -1497,14 +1497,11 @@ R_CreateFogImage
static void R_CreateFogImage( void ) { static void R_CreateFogImage( void ) {
int x,y; int x,y;
byte *data; byte *data;
float g;
float d; float d;
float borderColor[4]; float borderColor[4];
data = ri.Hunk_AllocateTempMemory( FOG_S * FOG_T * 4 ); data = ri.Hunk_AllocateTempMemory( FOG_S * FOG_T * 4 );
g = 2.0;
// S is distance, T is depth // S is distance, T is depth
for (x=0 ; x<FOG_S ; x++) { for (x=0 ; x<FOG_S ; x++) {
for (y=0 ; y<FOG_T ; y++) { 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 p;
int pa, pb, pc; int pa, pb, pc;
Pr = 0;
p = ((int) a) + ((int) b) - ((int) c); p = ((int) a) + ((int) b) - ((int) c);
pa = abs(p - ((int) a)); pa = abs(p - ((int) a));
pb = abs(p - ((int) b)); pb = abs(p - ((int) b));

View file

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

View file

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

View file

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

View file

@ -886,7 +886,7 @@ static void ComputeJointMats( iqmData_t *data, int frame, int oldframe,
int i; int i;
if ( oldframe == frame ) { if ( oldframe == frame ) {
mat1 = mat2 = data->poseMats + 12 * data->num_joints * frame; mat1 = data->poseMats + 12 * data->num_joints * frame;
for( i = 0; i < data->num_joints; i++, joint++ ) { for( i = 0; i < data->num_joints; i++, joint++ ) {
if( *joint >= 0 ) { if( *joint >= 0 ) {
Matrix34Multiply( mat + 12 * *joint, 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))); void (QDECL *Printf)( int printLevel, const char *fmt, ...) __attribute__ ((format (printf, 2, 3)));
// abort the game // 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 // milliseconds should only be used for profiling, never
// for anything game related. Get time from the refdef // for anything game related. Get time from the refdef

View file

@ -3047,8 +3047,10 @@ static void RB_RenderShadowmap( shaderCommands_t *input )
void RB_StageIteratorGeneric( void ) void RB_StageIteratorGeneric( void )
{ {
shaderCommands_t *input; shaderCommands_t *input;
shader_t *shader;
input = &tess; input = &tess;
shader = input->shader;
if (!input->numVertexes || !input->numIndexes) if (!input->numVertexes || !input->numIndexes)
{ {
@ -3070,10 +3072,10 @@ void RB_StageIteratorGeneric( void )
// //
// set face culling appropriately // set face culling appropriately
// //
GL_Cull( input->shader->cullType ); GL_Cull( shader->cullType );
// set polygon offset if necessary // set polygon offset if necessary
if ( input->shader->polygonOffset ) if ( shader->polygonOffset )
{ {
qglEnable( GL_POLYGON_OFFSET_FILL ); qglEnable( GL_POLYGON_OFFSET_FILL );
qglPolygonOffset( r_offsetFactor->value, r_offsetUnits->value ); qglPolygonOffset( r_offsetFactor->value, r_offsetUnits->value );
@ -3085,7 +3087,7 @@ void RB_StageIteratorGeneric( void )
// to avoid compiling those arrays since they will change // to avoid compiling those arrays since they will change
// during multipass rendering // during multipass rendering
// //
if ( tess.numPasses > 1 || input->shader->multitextureEnv ) if ( tess.numPasses > 1 || shader->multitextureEnv )
{ {
setArraysOnce = qfalse; setArraysOnce = qfalse;
qglDisableClientState (GL_COLOR_ARRAY); qglDisableClientState (GL_COLOR_ARRAY);
@ -3153,7 +3155,7 @@ void RB_StageIteratorGeneric( void )
// //
// reset polygon offset // reset polygon offset
// //
if ( input->shader->polygonOffset ) if ( shader->polygonOffset )
{ {
qglDisable( GL_POLYGON_OFFSET_FILL ); qglDisable( GL_POLYGON_OFFSET_FILL );
} }
@ -3329,7 +3331,6 @@ void RB_StageIteratorVertexLitTexture( void )
} }
input = &tess; input = &tess;
shader = input->shader; shader = input->shader;
// //
@ -3350,7 +3351,7 @@ void RB_StageIteratorVertexLitTexture( void )
// //
// set face culling appropriately // set face culling appropriately
// //
GL_Cull( input->shader->cullType ); GL_Cull( shader->cullType );
// //
// set arrays and lock // set arrays and lock
@ -3404,6 +3405,7 @@ void RB_StageIteratorVertexLitTexture( void )
void RB_StageIteratorLightmappedMultitexture( void ) { void RB_StageIteratorLightmappedMultitexture( void ) {
shaderCommands_t *input; shaderCommands_t *input;
shader_t *shader;
if(glRefConfig.vertexBufferObject && r_arb_vertex_buffer_object->integer) if(glRefConfig.vertexBufferObject && r_arb_vertex_buffer_object->integer)
{ {
@ -3413,6 +3415,7 @@ void RB_StageIteratorLightmappedMultitexture( void ) {
} }
input = &tess; input = &tess;
shader = input->shader;
// //
// log this call // log this call
@ -3426,7 +3429,7 @@ void RB_StageIteratorLightmappedMultitexture( void ) {
// //
// set face culling appropriately // set face culling appropriately
// //
GL_Cull( input->shader->cullType ); GL_Cull( shader->cullType );
// //
// set color, pointers, and lock // set color, pointers, and lock
@ -3516,8 +3519,10 @@ void RB_StageIteratorLightmappedMultitexture( void ) {
*/ */
void RB_EndSurface( void ) { void RB_EndSurface( void ) {
shaderCommands_t *input; shaderCommands_t *input;
shader_t *shader;
input = &tess; input = &tess;
shader = input->shader;
if (input->numIndexes == 0 || input->numVertexes == 0) { if (input->numIndexes == 0 || input->numVertexes == 0) {
return; return;

View file

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

View file

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

View file

@ -1355,7 +1355,6 @@ static void RB_SurfaceGrid( srfGridMesh_t *srf ) {
// in the tess structure, so we may have to issue it in multiple passes // in the tess structure, so we may have to issue it in multiple passes
used = 0; used = 0;
rows = 0;
while ( used < lodHeight - 1 ) { while ( used < lodHeight - 1 ) {
// see how many rows of both verts and indexes we can add without overflowing // see how many rows of both verts and indexes we can add without overflowing
do { do {

View file

@ -1213,7 +1213,6 @@ static void SV_VerifyPaks_f( client_t *cl ) {
// //
if ( sv_pure->integer != 0 ) { if ( sv_pure->integer != 0 ) {
bGood = qtrue;
nChkSum1 = nChkSum2 = 0; nChkSum1 = nChkSum2 = 0;
// we run the game, so determine which cgame and ui the client "should" be running // we run the game, so determine which cgame and ui the client "should" be running
bGood = (FS_FileIsInPAK("vm/cgame.qvm", &nChkSum1) == 1); bGood = (FS_FileIsInPAK("vm/cgame.qvm", &nChkSum1) == 1);

View file

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

View file

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