trim all trailing spaces in mbspc altogether

This commit is contained in:
Garux
2024-12-10 10:29:56 +05:00
parent 79f435721b
commit af7c039b21
23 changed files with 120 additions and 120 deletions
+1 -1
View File
@@ -20,7 +20,7 @@ New features:
1. When MBSPC is used for converting BSP files to MAP files, the correct
texture name is written for every brush side (but see Note 1.).
2. Added a new switch '-entlist'. This will produce a list of entity
definitions from a BSP file in an editable ASCII text file.
+1 -1
View File
@@ -65,7 +65,7 @@ int NonConvex(tmp_face_t *face1, tmp_face_t *face2, int side1, int side2)
int i;
winding_t *w1, *w2;
plane_t *plane1, *plane2;
w1 = face1->winding;
w2 = face2->winding;
+1 -1
View File
@@ -398,7 +398,7 @@ int AAS_WriteAASLump(FILE *fp, aas_header_t *h, int lumpnum, void *data, int len
aas_lump_t *lump;
lump = &h->lumps[lumpnum];
lump->fileofs = LittleLong(ftell(fp));
lump->filelen = LittleLong(length);
+1 -1
View File
@@ -807,7 +807,7 @@ void AAS_CreateMapBrushes(mapbrush_t *brush, entity_t *mapent, int addbevels)
//liquid brushes are expanded for the maximum possible bounding box
if (brush->contents & (CONTENTS_WATER
| CONTENTS_LAVA
| CONTENTS_SLIME
| CONTENTS_SLIME
| CONTENTS_TELEPORTER
| CONTENTS_JUMPPAD
| CONTENTS_DONOTENTER
+6 -6
View File
@@ -284,7 +284,7 @@ void AAS_FreeMaxAAS(void)
if (aasworld.clusters) FreeMemory(aasworld.clusters);
aasworld.clusters = NULL;
aasworld.numclusters = 0;
Log_Print("freed ");
PrintMemorySize(allocatedaasmem);
Log_Print(" of AAS memory\n");
@@ -316,7 +316,7 @@ unsigned AAS_HashVec(vec3_t vec)
Log_Print("This should never happen!\n");
return -1;
} //end if
return y*VERTEX_HASH_SIZE + x;
} //end of the function AAS_HashVec
//===========================================================================
@@ -338,7 +338,7 @@ qboolean AAS_GetVertex(vec3_t v, int *vnum)
#ifdef VERTEX_HASHING
int h, vn;
vec3_t vert;
for (i = 0; i < 3; i++)
{
if ( fabs(v[i] - Q_rint(v[i])) < INTEGRAL_EPSILON)
@@ -560,7 +560,7 @@ qboolean AAS_GetEdge(vec3_t v1, vec3_t v2, int *edgenum)
int AAS_PlaneTypeForNormal(vec3_t normal)
{
vec_t ax, ay, az;
//NOTE: epsilon used
if ( (normal[0] >= 1.0 -NORMAL_EPSILON) ||
(normal[0] <= -1.0 + NORMAL_EPSILON)) return PLANE_X;
@@ -568,11 +568,11 @@ int AAS_PlaneTypeForNormal(vec3_t normal)
(normal[1] <= -1.0 + NORMAL_EPSILON)) return PLANE_Y;
if ( (normal[2] >= 1.0 -NORMAL_EPSILON) ||
(normal[2] <= -1.0 + NORMAL_EPSILON)) return PLANE_Z;
ax = fabs(normal[0]);
ay = fabs(normal[1]);
az = fabs(normal[2]);
if (ax >= ay && ax >= az) return PLANE_ANYX;
if (ay >= ax && ay >= az) return PLANE_ANYY;
return PLANE_ANYZ;
+5 -5
View File
@@ -501,7 +501,7 @@ bspbrush_t *ClipBrushToBox(bspbrush_t *brush, vec3_t clipmins, vec3_t clipmaxs)
for (i=0 ; i<brush->numsides ; i++)
{
p = brush->sides[i].planenum & ~1;
if (p == maxplanenums[0] || p == maxplanenums[1]
if (p == maxplanenums[0] || p == maxplanenums[1]
|| p == minplanenums[0] || p == minplanenums[1])
{
brush->sides[i].texinfo = TEXINFO_NODE;
@@ -709,13 +709,13 @@ qboolean BrushGE (bspbrush_t *b1, bspbrush_t *b2)
//never have a ladder brush bite something else
if ( (b1->original->contents & CONTENTS_LADDER)
&& !(b2->original->contents & CONTENTS_LADDER))
{
{
return false;
} //end if
} //end if
#endif //ME
// detail brushes never bite structural brushes
if ( (b1->original->contents & CONTENTS_DETAIL)
if ( (b1->original->contents & CONTENTS_DETAIL)
&& !(b2->original->contents & CONTENTS_DETAIL) )
{
return false;
@@ -773,7 +773,7 @@ newlist:
keep = b1;
continue;
} //end if
for (b2 = b1->next; b2; b2 = b2->next)
{
if (BrushesDisjoint (b1, b2))
@@ -980,7 +980,7 @@ tree_t *ProcessWorldBrushes(int brush_start, int brush_end)
else
{
//Carves any intersecting solid brushes into the minimum number
//of non-intersecting brushes.
//of non-intersecting brushes.
if (!nocsg)
{
brushes = ChopBrushes(brushes);
+13 -13
View File
@@ -99,7 +99,7 @@ unsigned HashVec (vec3_t vec)
if ( x < 0 || x >= HASH_SIZE || y < 0 || y >= HASH_SIZE )
Error ("HashVec: point outside valid range");
return y*HASH_SIZE + x;
}
@@ -128,9 +128,9 @@ int GetVertexnum (vec3_t in)
else
vert[i] = in[i];
}
h = HashVec (vert);
for (vnum=hashverts[h] ; vnum ; vnum=vertexchain[vnum])
{
p = dvertexes[vnum].point;
@@ -139,7 +139,7 @@ int GetVertexnum (vec3_t in)
&& fabs(p[2]-vert[2])<POINT_EPSILON )
return vnum;
}
// emit a vertex
if (numvertexes == MAX_MAP_VERTS)
Error ("numvertexes == MAX_MAP_VERTS");
@@ -154,7 +154,7 @@ int GetVertexnum (vec3_t in)
c_uniqueverts++;
numvertexes++;
return numvertexes-1;
}
#else
@@ -663,7 +663,7 @@ int GetEdge2 (int v1, int v2, face_t *f)
edge->v[0] = v1;
edge->v[1] = v2;
edgefaces[numedges-1][0] = f;
return numedges-1;
}
@@ -699,7 +699,7 @@ face_t *TryMerge (face_t *f1, face_t *f2, vec3_t planenormal)
return NULL;
if (f1->contents != f2->contents)
return NULL;
nw = TryMergeWinding (f1->w, f2->w, planenormal);
if (!nw)
@@ -728,7 +728,7 @@ void MergeNodeFaces (node_t *node)
plane = &mapplanes[node->planenum];
merged = NULL;
for (f1 = node->faces ; f1 ; f1 = f1->next)
{
if (f1->merged || f1->split[0] || f1->split[1])
@@ -745,7 +745,7 @@ void MergeNodeFaces (node_t *node)
//the result of the convex/concave test in TryMergeWinding(),
//which depends on the normal, is flipped. This causes faces
//that shouldn't be merged to be merged and faces that
//should be merged to not be merged.
//should be merged to not be merged.
//the following added line fixes this bug
//thanks to: Alexander Malmberg <alexander@malmberg.org>
plane = &mapplanes[f1->planenum];
@@ -754,7 +754,7 @@ void MergeNodeFaces (node_t *node)
if (!merged)
continue;
// add merged to the end of the node face list
// add merged to the end of the node face list
// so it will be checked against all the faces again
for (end = node->faces ; end->next ; end = end->next)
;
@@ -801,7 +801,7 @@ void SubdivideFace (node_t *node, face_t *f)
{
mins = 999999;
maxs = -999999;
VectorCopy (tex->vecs[axis], temp);
w = f->w;
for (i=0 ; i<w->numpoints ; i++)
@@ -823,10 +823,10 @@ void SubdivideFace (node_t *node, face_t *f)
}
else if (maxs - mins <= subdivide_size)
break;
// split it
c_subdivide++;
v = VectorNormalize (temp);
dist = (mins + subdivide_size - 16)/v;
+2 -2
View File
@@ -174,7 +174,7 @@ int draw_socket;
void GLS_BeginScene (void)
{
WSADATA winsockdata;
WORD wVersionRequested;
WORD wVersionRequested;
struct sockaddr_in address;
int r;
@@ -182,7 +182,7 @@ void GLS_BeginScene (void)
{
wins_init = true;
wVersionRequested = MAKEWORD(1, 1);
wVersionRequested = MAKEWORD(1, 1);
r = WSAStartup (MAKEWORD(1, 1), &winsockdata);
+7 -7
View File
@@ -57,7 +57,7 @@ epair_t *ParseEpair(script_t *script)
e = GetMemory(sizeof(epair_t));
memset (e, 0, sizeof(epair_t));
PS_ExpectAnyToken(script, &token);
StripDoubleQuotes(token.string);
if (strlen(token.string) >= MAX_KEY-1)
@@ -93,7 +93,7 @@ qboolean ParseEntity(script_t *script)
if (strcmp(token.string, "{"))
Error ("ParseEntity: { not found");
if (num_entities == MAX_MAP_ENTITIES)
Error ("num_entities == MAX_MAP_ENTITIES");
@@ -111,14 +111,14 @@ qboolean ParseEntity(script_t *script)
e->next = mapent->epairs;
mapent->epairs = e;
} while (1);
return true;
} //end of the function ParseEntity
void PrintEntity (entity_t *ent)
{
epair_t *ep;
printf ("------- entity %p -------\n", ent);
for (ep=ent->epairs ; ep ; ep=ep->next)
{
@@ -130,7 +130,7 @@ void PrintEntity (entity_t *ent)
void SetKeyValue (entity_t *ent, char *key, char *value)
{
epair_t *ep;
for (ep=ent->epairs ; ep ; ep=ep->next)
if (!strcmp (ep->key, key) )
{
@@ -148,7 +148,7 @@ void SetKeyValue (entity_t *ent, char *key, char *value)
char *ValueForKey (entity_t *ent, char *key)
{
epair_t *ep;
for (ep=ent->epairs ; ep ; ep=ep->next)
if (!strcmp (ep->key, key) )
return ep->value;
@@ -158,7 +158,7 @@ char *ValueForKey (entity_t *ent, char *key)
vec_t FloatForKey (entity_t *ent, char *key)
{
char *k;
k = ValueForKey (ent, key);
return atof(k);
}
+3 -3
View File
@@ -128,7 +128,7 @@ double VectorLength(vec3_t v)
{
int i;
double length;
length = 0;
for (i=0 ; i< 3 ; i++)
length += v[i]*v[i];
@@ -140,11 +140,11 @@ double VectorLength(vec3_t v)
qboolean VectorCompare (vec3_t v1, vec3_t v2)
{
int i;
for (i=0 ; i<3 ; i++)
if (fabs(v1[i]-v2[i]) > EQUAL_EPSILON)
return false;
return true;
}
+1 -1
View File
@@ -260,7 +260,7 @@ memoryblock_t *BlockFromPointer(void *ptr, char *str)
} //end if
if (block->ptr != ptr)
{
Error("%s: memory block pointer invalid\n", str);
} //end if
return block;
+2 -2
View File
@@ -50,7 +50,7 @@ vec_t WindingArea (winding_t *w);
void WindingCenter (winding_t *w, vec3_t center);
//clips the given winding to the given plane and gives the front
//and back part of the clipped winding
void ClipWindingEpsilon (winding_t *in, vec3_t normal, vec_t dist,
void ClipWindingEpsilon (winding_t *in, vec3_t normal, vec_t dist,
vec_t epsilon, winding_t **front, winding_t **back);
//returns the fragment of the given winding that is on the front
//side of the cliping plane. The original is freed.
@@ -103,7 +103,7 @@ void RemoveEqualPoints(winding_t *w, float epsilon);
winding_t *AddWindingPoint(winding_t *w, vec3_t point, int spot);
//returns true if the point is on one of the winding 'edges'
//when the point is on one of the edged the number of the first
//point of the edge is stored in 'spot'
//point of the edge is stored in 'spot'
int PointOnWinding(winding_t *w, vec3_t normal, float dist, vec3_t point, int *spot);
//find a plane separating the two windings
//true is returned when the windings area adjacent
+1 -1
View File
@@ -43,7 +43,7 @@ void Vector2Angles(vec3_t value1, vec3_t angles)
{
float forward;
float yaw, pitch;
if (value1[1] == 0 && value1[0] == 0)
{
yaw = 0;
+9 -9
View File
@@ -285,7 +285,7 @@ void Q2_ParseBrush (script_t *script, entity_t *mapent)
side->contents |= CONTENTS_DETAIL;
if (fulldetail)
side->contents &= ~CONTENTS_DETAIL;
if (!(side->contents & ((LAST_VISIBLE_CONTENTS-1)
if (!(side->contents & ((LAST_VISIBLE_CONTENTS-1)
| CONTENTS_PLAYERCLIP|CONTENTS_MONSTERCLIP|CONTENTS_MIST) ) )
side->contents |= CONTENTS_SOLID;
@@ -370,7 +370,7 @@ void Q2_ParseBrush (script_t *script, entity_t *mapent)
} //end if
#endif //ME
// allow detail brushes to be removed
// allow detail brushes to be removed
if (nodetail && (b->contents & CONTENTS_DETAIL) )
{
b->numsides = 0;
@@ -432,7 +432,7 @@ void Q2_ParseBrush (script_t *script, entity_t *mapent)
AddBrushBevels(b);
nummapbrushes++;
mapent->numbrushes++;
mapent->numbrushes++;
}
/*
@@ -502,7 +502,7 @@ qboolean Q2_ParseMapEntity(script_t *script)
if (strcmp(token.string, "{") )
Error ("ParseEntity: { not found");
if (num_entities == MAX_MAP_ENTITIES)
Error ("num_entities == MAX_MAP_ENTITIES");
@@ -598,7 +598,7 @@ LoadMapFile
================
*/
void Q2_LoadMapFile(char *filename)
{
{
int i;
script_t *script;
@@ -623,7 +623,7 @@ void Q2_LoadMapFile(char *filename)
nummapbrushsides = 0;
num_entities = 0;
while (Q2_ParseMapEntity(script))
{
}
@@ -726,7 +726,7 @@ void Q2_SetBrushModelNumbers(entity_t *mapent)
//head node (root) of the bsp tree
n = dmodels[mapent->modelnum].headnode;
pn = 0;
do
{
//if we are in a leaf (negative node number)
@@ -811,7 +811,7 @@ void Q2_BSPBrushToMapBrush(dbrush_t *bspbrush, entity_t *mapent)
side->contents |= CONTENTS_DETAIL;
if (fulldetail)
side->contents &= ~CONTENTS_DETAIL;
if (!(side->contents & ((LAST_VISIBLE_CONTENTS-1)
if (!(side->contents & ((LAST_VISIBLE_CONTENTS-1)
| CONTENTS_PLAYERCLIP|CONTENTS_MONSTERCLIP|CONTENTS_MIST) ) )
side->contents |= CONTENTS_SOLID;
@@ -895,7 +895,7 @@ void Q2_BSPBrushToMapBrush(dbrush_t *bspbrush, entity_t *mapent)
return;
} //end if
// allow detail brushes to be removed
// allow detail brushes to be removed
if (nodetail && (b->contents & CONTENTS_DETAIL) )
{
b->numsides = 0;
+18 -18
View File
@@ -67,9 +67,9 @@ int Sin_BrushContents(mapbrush_t *b)
if (s->contents != contents)
{
#ifdef SIN
if (
if (
( s->contents & CONTENTS_DETAIL && !(contents & CONTENTS_DETAIL) ) ||
( !(s->contents & CONTENTS_DETAIL) && contents & CONTENTS_DETAIL )
( !(s->contents & CONTENTS_DETAIL) && contents & CONTENTS_DETAIL )
)
{
s->contents |= CONTENTS_DETAIL;
@@ -164,17 +164,17 @@ void ParseBrush (entity_t *mapent)
GetToken (true);
if (strcmp (token, "(") )
Error ("parsing brush");
for (j=0 ; j<3 ; j++)
{
GetToken (false);
planepts[i][j] = atoi(token);
}
GetToken (false);
if (strcmp (token, ")") )
Error ("parsing brush");
}
@@ -190,9 +190,9 @@ void ParseBrush (entity_t *mapent)
td.shift[1] = atoi(token);
GetToken (false);
#ifdef SIN
td.rotate = atof(token);
td.rotate = atof(token);
#else
td.rotate = atoi(token);
td.rotate = atoi(token);
#endif
GetToken (false);
td.scale[0] = atof(token);
@@ -239,7 +239,7 @@ void ParseBrush (entity_t *mapent)
side->contents |= CONTENTS_DETAIL;
if (fulldetail)
side->contents &= ~CONTENTS_DETAIL;
if (!(side->contents & ((LAST_VISIBLE_CONTENTS-1)
if (!(side->contents & ((LAST_VISIBLE_CONTENTS-1)
| CONTENTS_PLAYERCLIP|CONTENTS_MONSTERCLIP|CONTENTS_MIST) ) )
side->contents |= CONTENTS_SOLID;
@@ -294,7 +294,7 @@ void ParseBrush (entity_t *mapent)
#ifdef SIN
side->texinfo = TexinfoForBrushTexture (&mapplanes[planenum],
&td, vec3_origin, &newref);
//
//
// save off lightinfo
//
side->lightinfo = LightinfoForBrushTexture ( &td );
@@ -319,7 +319,7 @@ void ParseBrush (entity_t *mapent)
// get the content for the entire brush
b->contents = Sin_BrushContents (b);
// allow detail brushes to be removed
// allow detail brushes to be removed
if (nodetail && (b->contents & CONTENTS_DETAIL) )
{
b->numsides = 0;
@@ -381,7 +381,7 @@ void ParseBrush (entity_t *mapent)
AddBrushBevels (b);
nummapbrushes++;
mapent->numbrushes++;
mapent->numbrushes++;
} //*/
/*
@@ -451,7 +451,7 @@ qboolean Sin_ParseMapEntity (void)
if (strcmp (token, "{") )
Error ("ParseEntity: { not found");
if (num_entities == MAX_MAP_ENTITIES)
Error ("num_entities == MAX_MAP_ENTITIES");
@@ -560,7 +560,7 @@ qboolean Sin_ParseMapEntity (void)
#ifdef SIN
s->texinfo = TexinfoForBrushTexture (&mapplanes[s->planenum],
&side_brushtextures[s-brushsides], mapent->origin, &side_newrefs[s-brushsides]);
//
//
// save off lightinfo
//
s->lightinfo = LightinfoForBrushTexture ( &side_brushtextures[s-brushsides] );
@@ -659,7 +659,7 @@ LoadMapFile
================
* /
void Sin_LoadMapFile (char *filename)
{
{
int i;
#ifdef SIN
int num_detailsides=0;
@@ -675,7 +675,7 @@ void Sin_LoadMapFile (char *filename)
nummapbrushsides = 0;
num_entities = 0;
while (ParseMapEntity ())
{
}
@@ -837,7 +837,7 @@ void Sin_SetBrushModelNumbers(entity_t *mapent)
//head node (root) of the bsp tree
n = sin_dmodels[mapent->modelnum].headnode;
pn = 0;
do
{
//if we are in a leaf (negative node number)
@@ -922,7 +922,7 @@ void Sin_BSPBrushToMapBrush(sin_dbrush_t *bspbrush, entity_t *mapent)
side->contents |= CONTENTS_DETAIL;
if (fulldetail)
side->contents &= ~CONTENTS_DETAIL;
if (!(side->contents & ((LAST_VISIBLE_CONTENTS-1)
if (!(side->contents & ((LAST_VISIBLE_CONTENTS-1)
| CONTENTS_PLAYERCLIP|CONTENTS_MONSTERCLIP|CONTENTS_MIST) ) )
side->contents |= CONTENTS_SOLID;
@@ -1003,7 +1003,7 @@ void Sin_BSPBrushToMapBrush(sin_dbrush_t *bspbrush, entity_t *mapent)
return;
} //end if
// allow detail brushes to be removed
// allow detail brushes to be removed
if (nodetail && (b->contents & CONTENTS_DETAIL) )
{
b->numsides = 0;
+17 -17
View File
@@ -39,7 +39,7 @@ int c_portalmemory;
portal_t *AllocPortal (void)
{
portal_t *p;
p = GetMemory(sizeof(portal_t));
memset (p, 0, sizeof(portal_t));
@@ -50,12 +50,12 @@ portal_t *AllocPortal (void)
{
c_peak_portals = c_active_portals;
} //end if
c_portalmemory += MemorySize(p);
c_portalmemory += MemorySize(p);
} //end if
// p->nextportal = portallist;
// portallist = p;
return p;
} //end of the function AllocPortal
//===========================================================================
@@ -169,7 +169,7 @@ qboolean Portal_EntityFlood (portal_t *p, int s)
|| p->nodes[1]->planenum != PLANENUM_LEAF)
Error ("Portal_EntityFlood: not a leaf");
// can never cross to a solid
// can never cross to a solid
if ( (p->nodes[0]->contents & CONTENTS_SOLID)
|| (p->nodes[1]->contents & CONTENTS_SOLID) )
return false;
@@ -197,7 +197,7 @@ void AddPortalToNodes (portal_t *p, node_t *front, node_t *back)
p->nodes[0] = front;
p->next[0] = front->portals;
front->portals = p;
p->nodes[1] = back;
p->next[1] = back->portals;
back->portals = p;
@@ -215,14 +215,14 @@ void RemovePortalFromNode (portal_t *portal, node_t *l)
int s, i, n;
portal_t *p;
portal_t *portals[4096];
// remove reference to the current portal
pp = &l->portals;
while (1)
{
t = *pp;
if (!t)
Error ("RemovePortalFromNode: portal not in leaf");
Error ("RemovePortalFromNode: portal not in leaf");
if ( t == portal )
break;
@@ -234,7 +234,7 @@ void RemovePortalFromNode (portal_t *portal, node_t *l)
else
Error ("RemovePortalFromNode: portal not bounding leaf");
}
if (portal->nodes[0] == l)
{
*pp = portal->next[0];
@@ -242,7 +242,7 @@ void RemovePortalFromNode (portal_t *portal, node_t *l)
} //end if
else if (portal->nodes[1] == l)
{
*pp = portal->next[1];
*pp = portal->next[1];
portal->nodes[1] = NULL;
} //end else if
else
@@ -277,7 +277,7 @@ void PrintPortal (portal_t *p)
{
int i;
winding_t *w;
w = p->winding;
for (i=0 ; i<w->numpoints ; i++)
printf ("(%5.0f,%5.0f,%5.0f)\n",w->p[i][0]
@@ -311,7 +311,7 @@ void MakeHeadnodePortals (tree_t *tree)
Error("empty BSP tree");
}
}
tree->outside_node.planenum = PLANENUM_LEAF;
tree->outside_node.brushlist = NULL;
tree->outside_node.portals = NULL;
@@ -324,7 +324,7 @@ void MakeHeadnodePortals (tree_t *tree)
p = AllocPortal ();
portals[n] = p;
pl = &bplanes[n];
memset (pl, 0, sizeof(*pl));
if (j)
@@ -341,7 +341,7 @@ void MakeHeadnodePortals (tree_t *tree)
p->winding = BaseWindingForPlane (pl->normal, pl->dist);
AddPortalToNodes (p, node, &tree->outside_node);
}
// clip the basewindings by all the other planes
for (i=0 ; i<6 ; i++)
{
@@ -414,7 +414,7 @@ void MakeNodePortal (node_t *node)
w = BaseWindingForNode (node);
// clip the portal by all the other portals in the node
for (p = node->portals; p && w; p = p->next[side])
for (p = node->portals; p && w; p = p->next[side])
{
if (p->nodes[0] == node)
{
@@ -490,7 +490,7 @@ void SplitNodePortals (node_t *node)
f = node->children[0];
b = node->children[1];
for (p = node->portals ; p ; p = next_portal)
for (p = node->portals ; p ; p = next_portal)
{
if (p->nodes[0] == node) side = 0;
else if (p->nodes[1] == node) side = 1;
@@ -557,7 +557,7 @@ void SplitNodePortals (node_t *node)
else AddPortalToNodes (p, other_node, f);
continue;
}
// the winding is split
new_portal = AllocPortal();
*new_portal = *p;
@@ -593,7 +593,7 @@ void CalcNodeBounds (node_t *node)
// calc mins/maxs for both leaves and nodes
ClearBounds (node->mins, node->maxs);
for (p = node->portals ; p ; p = p->next[s])
for (p = node->portals ; p ; p = p->next[s])
{
s = (p->nodes[1] == node);
for (i=0 ; i<p->winding->numpoints ; i++)
+7 -7
View File
@@ -53,7 +53,7 @@ WritePortalFile_r
*/
void WritePortalFile_r (node_t *node)
{
int i, s;
int i, s;
portal_t *p;
winding_t *w;
vec3_t normal;
@@ -66,7 +66,7 @@ void WritePortalFile_r (node_t *node)
WritePortalFile_r (node->children[1]);
return;
}
if (node->contents & CONTENTS_SOLID)
return;
@@ -79,7 +79,7 @@ void WritePortalFile_r (node_t *node)
if (!Portal_VisFlood (p))
continue;
// write out to the file
// sometimes planes get turned around when they are very near
// the changeover point between different axis. interpret the
// plane the same way vis will, and flip the side orders if needed
@@ -143,7 +143,7 @@ void NumberLeafs_r (node_t *node)
NumberLeafs_r (node->children[1]);
return;
}
// either a leaf or a detail cluster
if ( node->contents & CONTENTS_SOLID )
@@ -165,7 +165,7 @@ void NumberLeafs_r (node_t *node)
p = p->next[0];
}
else
p = p->next[1];
p = p->next[1];
}
}
@@ -260,14 +260,14 @@ void WritePortalFile (tree_t *tree)
// set the cluster field in every leaf and count the total number of portals
NumberLeafs_r (headnode);
// write the file
sprintf (filename, "%s.prt", source);
printf ("writing %s\n", filename);
pf = fopen (filename, "w");
if (!pf)
Error ("Error opening %s", filename);
fprintf (pf, "%s\n", PORTALFILE);
fprintf (pf, "%i\n", num_visclusters);
fprintf (pf, "%i\n", num_visportals);
+2 -2
View File
@@ -106,7 +106,7 @@ typedef struct
typedef struct
{
int ident;
int version;
int version;
sin_lump_t lumps[SINHEADER_LUMPS];
} sin_dheader_t;
@@ -290,7 +290,7 @@ typedef struct
short side;
int firstedge; // we must support > 64k edges
short numedges;
short numedges;
short texinfo;
// lighting info
+6 -6
View File
@@ -87,10 +87,10 @@ void TextureAxisFromPlane(plane_t *pln, vec3_t xv, vec3_t yv)
int bestaxis;
vec_t dot,best;
int i;
best = 0;
bestaxis = 0;
for (i=0 ; i<6 ; i++)
{
dot = DotProduct (pln->normal, baseaxis[i*3]);
@@ -100,7 +100,7 @@ void TextureAxisFromPlane(plane_t *pln, vec3_t xv, vec3_t yv)
bestaxis = i;
}
}
VectorCopy (baseaxis[bestaxis*3+1], xv);
VectorCopy (baseaxis[bestaxis*3+2], yv);
} //end of the function TextureAxisFromPlane
@@ -149,7 +149,7 @@ int TexinfoForBrushTexture(plane_t *plane, brush_texture_t *bt, vec3_t origin)
else if (bt->rotate == 270)
{ sinv = -1 ; cosv = 0; }
else
{
{
ang = bt->rotate / 180 * Q_PI;
sinv = sin(ang);
cosv = cos(ang);
@@ -161,14 +161,14 @@ int TexinfoForBrushTexture(plane_t *plane, brush_texture_t *bt, vec3_t origin)
sv = 1;
else
sv = 2;
if (vecs[1][0])
tv = 0;
else if (vecs[1][1])
tv = 1;
else
tv = 2;
for (i=0 ; i<2 ; i++)
{
ns = cosv * vecs[i][sv] - sinv * vecs[i][tv];
+1 -1
View File
@@ -47,7 +47,7 @@ typedef struct
winding_t *AllocWinding (int points);
vec_t WindingArea (winding_t *w);
void WindingCenter (winding_t *w, vec3_t center);
void ClipWindingEpsilon (winding_t *in, vec3_t normal, vec_t dist,
void ClipWindingEpsilon (winding_t *in, vec3_t normal, vec_t dist,
vec_t epsilon, winding_t **front, winding_t **back);
winding_t *ChopWinding (winding_t *in, vec3_t normal, vec_t dist);
winding_t *CopyWinding (winding_t *w);
+1 -1
View File
@@ -64,7 +64,7 @@ qboolean CM_AreasConnected( int area1, int area2 );
int CM_WriteAreaBits( byte *buffer, int area );
// cm_tag.c
int CM_LerpTag( orientation_t *tag, clipHandle_t model, int startFrame, int endFrame,
int CM_LerpTag( orientation_t *tag, clipHandle_t model, int startFrame, int endFrame,
float frac, const char *tagName );
+8 -8
View File
@@ -114,7 +114,7 @@ void MSG_ReadDeltaUsercmdKey( msg_t *msg, int key, usercmd_t *from, usercmd_t *t
void MSG_WriteDeltaEntity( msg_t *msg, struct entityState_s *from, struct entityState_s *to
, qboolean force );
void MSG_ReadDeltaEntity( msg_t *msg, entityState_t *from, entityState_t *to,
void MSG_ReadDeltaEntity( msg_t *msg, entityState_t *from, entityState_t *to,
int number );
void MSG_WriteDeltaPlayerstate( msg_t *msg, struct playerState_s *from, struct playerState_s *to );
@@ -219,7 +219,7 @@ void NET_Sleep(int msec);
#define MAX_DOWNLOAD_WINDOW 8 // max of eight download frames
#define MAX_DOWNLOAD_BLKSIZE 2048 // 2048 byte block chunks
/*
Netchan handles packet fragmentation and out of order / duplicate suppression
@@ -239,7 +239,7 @@ typedef struct {
// incoming fragment assembly buffer
int fragmentSequence;
int fragmentLength;
int fragmentLength;
byte fragmentBuffer[MAX_MSGLEN];
// outgoing fragment buffer
@@ -356,7 +356,7 @@ enum svc_ops_e {
//
enum clc_ops_e {
clc_bad,
clc_nop,
clc_nop,
clc_move, // [[usercmd_t]
clc_moveNoDelta, // [[usercmd_t]
clc_clientCommand, // [string] message
@@ -746,9 +746,9 @@ const char *FS_LoadedPakPureChecksums( void );
const char *FS_ReferencedPakNames( void );
const char *FS_ReferencedPakChecksums( void );
const char *FS_ReferencedPakPureChecksums( void );
// Returns a space separated string containing the checksums of all loaded
// AND referenced pk3 files. Servers with sv_pure set will get this string
// back from clients for pure validation
// Returns a space separated string containing the checksums of all loaded
// AND referenced pk3 files. Servers with sv_pure set will get this string
// back from clients for pure validation
void FS_ClearPakReferences( int flags );
// clears referenced booleans on loaded pk3s
@@ -1177,7 +1177,7 @@ qboolean Sys_LowPhysicalMemory(void);
#define INTERNAL_NODE (HMAX+1)
typedef struct nodetype {
struct nodetype *left, *right, *parent; /* tree structure */
struct nodetype *left, *right, *parent; /* tree structure */
struct nodetype *next, *prev; /* doubly-linked list */
struct nodetype **head; /* highest ranked node in block */
int weight;
+7 -7
View File
@@ -23,14 +23,14 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#if defined(STRICTUNZIP) || defined(STRICTZIPUNZIP)
/* like the STRICT of WIN32, we define a pointer that cannot be converted
from (void*) without cast */
typedef struct TagunzFile__ { int unused; } unzFile__;
typedef struct TagunzFile__ { int unused; } unzFile__;
typedef unzFile__ *unzFile;
#else
typedef void* unzFile;
#endif
/* tm_unz contain date/time info */
typedef struct tm_unz_s
typedef struct tm_unz_s
{
unsigned int tm_sec; /* seconds after the minute - [0,59] */
unsigned int tm_min; /* minutes after the hour - [0,59] */
@@ -58,8 +58,8 @@ typedef struct unz_file_info_s
unsigned long compression_method; /* compression method 2 unsigned chars */
unsigned long dosDate; /* last mod file date in Dos fmt 4 unsigned chars */
unsigned long crc; /* crc-32 4 unsigned chars */
unsigned long compressed_size; /* compressed size 4 unsigned chars */
unsigned long uncompressed_size; /* uncompressed size 4 unsigned chars */
unsigned long compressed_size; /* compressed size 4 unsigned chars */
unsigned long uncompressed_size; /* uncompressed size 4 unsigned chars */
unsigned long size_filename; /* filename length 2 unsigned chars */
unsigned long size_file_extra; /* extra field length 2 unsigned chars */
unsigned long size_file_comment; /* file comment length 2 unsigned chars */
@@ -294,7 +294,7 @@ extern int unzCloseCurrentFile (unzFile file);
Return UNZ_CRCERROR if all the file was read but the CRC is not good
*/
extern int unzReadCurrentFile (unzFile file, void* buf, unsigned len);
/*
@@ -317,7 +317,7 @@ extern long unztell(unzFile file);
extern int unzeof (unzFile file);
/*
return 1 if the end of file was reached, 0 elsewhere
return 1 if the end of file was reached, 0 elsewhere
*/
extern int unzGetLocalExtrafield (unzFile file, void* buf, unsigned len);
@@ -331,6 +331,6 @@ extern int unzGetLocalExtrafield (unzFile file, void* buf, unsigned len);
if buf!=NULL, len is the size of the buffer, the extra header is copied in
buf.
the return value is the number of unsigned chars copied in buf, or (if <0)
the return value is the number of unsigned chars copied in buf, or (if <0)
the error code
*/