fix formatting
This commit is contained in:
parent
977781a621
commit
0c390241c8
|
|
@ -250,16 +250,16 @@ static bool get_selection_bounds( vec3_t mins, vec3_t maxs ){
|
|||
return false;
|
||||
}
|
||||
|
||||
for ( i = 0 ; i < 3 ; i++ )
|
||||
for ( i = 0; i < 3; i++ )
|
||||
{
|
||||
mins[i] = 99999;
|
||||
maxs[i] = -99999;
|
||||
}
|
||||
|
||||
for ( b = selected_brushes->next ; b != selected_brushes ; b = b->next )
|
||||
for ( b = selected_brushes->next; b != selected_brushes; b = b->next )
|
||||
{
|
||||
if ( b->owner->eclass->fixedsize ) {
|
||||
for ( i = 0 ; i < 3 ; i++ )
|
||||
for ( i = 0; i < 3; i++ )
|
||||
{
|
||||
if ( b->owner->origin[i] < mins[i] ) {
|
||||
mins[i] = b->owner->origin[i];
|
||||
|
|
@ -271,7 +271,7 @@ static bool get_selection_bounds( vec3_t mins, vec3_t maxs ){
|
|||
}
|
||||
else
|
||||
{
|
||||
for ( i = 0 ; i < 3 ; i++ )
|
||||
for ( i = 0; i < 3; i++ )
|
||||
{
|
||||
if ( b->mins[i] < mins[i] ) {
|
||||
mins[i] = b->mins[i];
|
||||
|
|
|
|||
|
|
@ -150,7 +150,7 @@ public:
|
|||
}
|
||||
virtual void activate() const {
|
||||
bi->func();
|
||||
return ;
|
||||
return;
|
||||
}
|
||||
virtual EType getType() const {
|
||||
return bi->type;
|
||||
|
|
|
|||
|
|
@ -326,7 +326,7 @@ DPatch* DPatch::MergePatches( patch_merge_t merge_info, DPatch& p1, DPatch& p2 )
|
|||
void DPatch::Invert(){
|
||||
int i, j;
|
||||
|
||||
for ( i = 0 ; i < width ; i++ )
|
||||
for ( i = 0; i < width; i++ )
|
||||
{
|
||||
for ( j = 0; j < height / 2; j++ )
|
||||
{
|
||||
|
|
@ -378,9 +378,9 @@ void DPatch::Transpose(){
|
|||
int i, j;
|
||||
|
||||
if ( width > height ) {
|
||||
for ( i = 0 ; i < height ; i++ )
|
||||
for ( i = 0; i < height; i++ )
|
||||
{
|
||||
for ( j = i + 1 ; j < width ; j++ )
|
||||
for ( j = i + 1; j < width; j++ )
|
||||
{
|
||||
if ( j < height ) {
|
||||
// swap the value
|
||||
|
|
@ -396,9 +396,9 @@ void DPatch::Transpose(){
|
|||
}
|
||||
else
|
||||
{
|
||||
for ( i = 0 ; i < width ; i++ )
|
||||
for ( i = 0; i < width; i++ )
|
||||
{
|
||||
for ( j = i + 1 ; j < height ; j++ )
|
||||
for ( j = i + 1; j < height; j++ )
|
||||
{
|
||||
if ( j < width ) {
|
||||
// swap the value
|
||||
|
|
|
|||
|
|
@ -153,7 +153,7 @@ DWinding* DPlane::BaseWindingForPlane(){
|
|||
|
||||
max = -131072;
|
||||
x = -1;
|
||||
for ( i = 0 ; i < 3; i++ )
|
||||
for ( i = 0; i < 3; i++ )
|
||||
{
|
||||
v = (float)fabs( normal[i] );
|
||||
if ( v > max ) {
|
||||
|
|
|
|||
|
|
@ -62,7 +62,7 @@ vec_t DWinding::WindingArea(){
|
|||
vec_t total;
|
||||
|
||||
total = 0;
|
||||
for ( int i = 2; i < numpoints ; i++ )
|
||||
for ( int i = 2; i < numpoints; i++ )
|
||||
{
|
||||
VectorSubtract( p[i - 1], p[0], d1 );
|
||||
VectorSubtract( p[i], p[0], d2 );
|
||||
|
|
@ -117,7 +117,7 @@ void DWinding::WindingBounds( vec3_t mins, vec3_t maxs ){
|
|||
VectorCopy( mins, p[0] );
|
||||
VectorCopy( maxs, p[0] );
|
||||
|
||||
for ( int i = 1; i < numpoints ; i++ )
|
||||
for ( int i = 1; i < numpoints; i++ )
|
||||
{
|
||||
for ( int j = 0; j < 3; j++ )
|
||||
{
|
||||
|
|
@ -229,7 +229,7 @@ void DWinding::CheckWinding(){
|
|||
edgedist = DotProduct( p1, edgenormal );
|
||||
|
||||
// all other points must be on front side
|
||||
for ( j = 0 ; j < numpoints ; j++ )
|
||||
for ( j = 0; j < numpoints; j++ )
|
||||
{
|
||||
if ( j == i ) {
|
||||
continue;
|
||||
|
|
@ -249,7 +249,7 @@ DWinding* DWinding::ReverseWinding(){
|
|||
DWinding* c = new DWinding;
|
||||
c->AllocWinding( numpoints );
|
||||
|
||||
for ( int i = 0; i < numpoints ; i++ )
|
||||
for ( int i = 0; i < numpoints; i++ )
|
||||
VectorCopy( p[numpoints - 1 - i], c->p[i] );
|
||||
|
||||
return c;
|
||||
|
|
@ -414,7 +414,7 @@ void DWinding::ClipWindingEpsilon( DPlane* chopPlane, vec_t epsilon, DWinding **
|
|||
*front = f;
|
||||
*back = b;
|
||||
|
||||
for ( i = 0; i < numpoints ; i++ )
|
||||
for ( i = 0; i < numpoints; i++ )
|
||||
{
|
||||
p1 = p[i];
|
||||
|
||||
|
|
|
|||
|
|
@ -97,7 +97,7 @@ void SwapBlock( int *block, int sizeOfBlock ) {
|
|||
int i;
|
||||
|
||||
sizeOfBlock >>= 2;
|
||||
for ( i = 0 ; i < sizeOfBlock ; i++ ) {
|
||||
for ( i = 0; i < sizeOfBlock; i++ ) {
|
||||
block[i] = LittleLong( block[i] );
|
||||
}
|
||||
}
|
||||
|
|
@ -116,7 +116,7 @@ void SwapBSPFile( void ) {
|
|||
// SwapBlock( (int *)dmodels, nummodels * sizeof( dmodels[0] ) );
|
||||
|
||||
// shaders (don't swap the name)
|
||||
// for ( i = 0 ; i < numShaders ; i++ ) {
|
||||
// for ( i = 0; i < numShaders; i++ ) {
|
||||
// dshaders[i].contentFlags = LittleLong( dshaders[i].contentFlags );
|
||||
// dshaders[i].surfaceFlags = LittleLong( dshaders[i].surfaceFlags );
|
||||
// }
|
||||
|
|
@ -147,7 +147,7 @@ void SwapBSPFile( void ) {
|
|||
( (int *)&visBytes )[1] = LittleLong( ( (int *)&visBytes )[1] );
|
||||
|
||||
// drawverts (don't swap colors )
|
||||
for ( i = 0 ; i < numDrawVerts ; i++ ) {
|
||||
for ( i = 0; i < numDrawVerts; i++ ) {
|
||||
drawVerts[i].lightmap[0] = LittleFloat( drawVerts[i].lightmap[0] );
|
||||
drawVerts[i].lightmap[1] = LittleFloat( drawVerts[i].lightmap[1] );
|
||||
drawVerts[i].st[0] = LittleFloat( drawVerts[i].st[0] );
|
||||
|
|
@ -167,7 +167,7 @@ void SwapBSPFile( void ) {
|
|||
SwapBlock( (int *)drawSurfaces, numDrawSurfaces * sizeof( drawSurfaces[0] ) );
|
||||
|
||||
// fogs
|
||||
// for ( i = 0 ; i < numFogs ; i++ ) {
|
||||
// for ( i = 0; i < numFogs; i++ ) {
|
||||
// dfogs[i].brushNum = LittleLong( dfogs[i].brushNum );
|
||||
// dfogs[i].visibleSide = LittleLong( dfogs[i].visibleSide );
|
||||
// }
|
||||
|
|
|
|||
|
|
@ -69,7 +69,7 @@ bool CBspPortal::Build( char *def, unsigned int pointCnt, bool bInverse ){
|
|||
|
||||
for ( n = 0; n < point_count; n++ )
|
||||
{
|
||||
for (; *c != 0 && *c != '('; c++ ) ;
|
||||
for (; *c != 0 && *c != '('; c++ ){};
|
||||
|
||||
if ( *c == 0 ) {
|
||||
return false;
|
||||
|
|
|
|||
|
|
@ -129,7 +129,7 @@ char* TranslateString( char *buf ){
|
|||
|
||||
std::size_t l = strlen( buf );
|
||||
char* out = buf2;
|
||||
for ( std::size_t i = 0 ; i < l ; i++ )
|
||||
for ( std::size_t i = 0; i < l; i++ )
|
||||
{
|
||||
if ( buf[i] == '\n' ) {
|
||||
*out++ = '\r';
|
||||
|
|
|
|||
|
|
@ -622,7 +622,7 @@ void MakeBevel( vec3_t vMin, vec3_t vMax ){
|
|||
}
|
||||
}
|
||||
//does invert the matrix, else the patch face is on wrong side.
|
||||
for ( int i = 0 ; i < 3 ; i++ )
|
||||
for ( int i = 0; i < 3; i++ )
|
||||
{
|
||||
for ( int j = 0; j < 1; j++ )
|
||||
{
|
||||
|
|
|
|||
|
|
@ -291,7 +291,7 @@ GSList *AddToWadList( GSList *wadlist, const char *shadername, const char *wad )
|
|||
wadname = strdup( wad );
|
||||
}
|
||||
|
||||
for ( GSList *l = wadlist; l != NULL ; l = l->next )
|
||||
for ( GSList *l = wadlist; l != NULL; l = l->next )
|
||||
{
|
||||
if ( string_equal_nocase( (char *)l->data,wadname ) ) {
|
||||
free( wadname );
|
||||
|
|
@ -380,7 +380,7 @@ void UpdateWadKeyPair( void ){
|
|||
}
|
||||
else
|
||||
{
|
||||
for ( f = b->brush_faces ; f ; f = f->next )
|
||||
for ( f = b->brush_faces; f; f = f->next )
|
||||
{
|
||||
wadlist = AddToWadList( wadlist, f->pShader->getName(),NULL );
|
||||
}
|
||||
|
|
@ -397,7 +397,7 @@ void UpdateWadKeyPair( void ){
|
|||
}
|
||||
else
|
||||
{
|
||||
for ( f = b->brush_faces ; f ; f = f->next )
|
||||
for ( f = b->brush_faces; f; f = f->next )
|
||||
{
|
||||
wadlist = AddToWadList( wadlist, f->pShader->getName(),NULL );
|
||||
}
|
||||
|
|
|
|||
|
|
@ -81,7 +81,7 @@ bool CBspPortal::Build( char *def ){
|
|||
|
||||
for ( n = 0; n < point_count; n++ )
|
||||
{
|
||||
for (; *c != 0 && *c != '('; c++ ) ;
|
||||
for (; *c != 0 && *c != '('; c++ ){};
|
||||
|
||||
if ( *c == 0 ) {
|
||||
return false;
|
||||
|
|
|
|||
|
|
@ -122,7 +122,7 @@ const char *WINS_ErrorMessage( int error ){
|
|||
if ( error == errlist[search].errnum ) {
|
||||
return errlist[search].errstr;
|
||||
}
|
||||
} //end for
|
||||
}
|
||||
|
||||
return "Unknown error";
|
||||
} //end of the function WINS_ErrorMessage
|
||||
|
|
|
|||
|
|
@ -148,7 +148,7 @@ const char *WINS_ErrorMessage( int error ){
|
|||
if ( error == errlist[search].errnum ) {
|
||||
return errlist[search].errstr;
|
||||
}
|
||||
} //end for
|
||||
}
|
||||
|
||||
return "Unknown error";
|
||||
} //end of the function WINS_ErrorMessage
|
||||
|
|
|
|||
|
|
@ -101,7 +101,7 @@ vec_t VectorLength( const vec3_t v ){
|
|||
float length;
|
||||
|
||||
length = 0.0f;
|
||||
for ( i = 0 ; i < 3 ; i++ )
|
||||
for ( i = 0; i < 3; i++ )
|
||||
length += v[i] * v[i];
|
||||
length = (float)sqrt( length );
|
||||
|
||||
|
|
@ -111,7 +111,7 @@ vec_t VectorLength( const vec3_t v ){
|
|||
bool VectorCompare( const vec3_t v1, const vec3_t v2 ){
|
||||
int i;
|
||||
|
||||
for ( i = 0 ; i < 3 ; i++ )
|
||||
for ( i = 0; i < 3; i++ )
|
||||
if ( fabs( v1[i] - v2[i] ) > EQUAL_EPSILON ) {
|
||||
return false;
|
||||
}
|
||||
|
|
@ -290,7 +290,7 @@ void VectorSnap( vec3_t v ){
|
|||
|
||||
void VectorISnap( vec3_t point, int snap ){
|
||||
int i;
|
||||
for ( i = 0 ; i < 3 ; i++ )
|
||||
for ( i = 0; i < 3; i++ )
|
||||
{
|
||||
point[i] = (vec_t)FLOAT_SNAP( point[i], snap );
|
||||
}
|
||||
|
|
@ -298,7 +298,7 @@ void VectorISnap( vec3_t point, int snap ){
|
|||
|
||||
void VectorFSnap( vec3_t point, float snap ){
|
||||
int i;
|
||||
for ( i = 0 ; i < 3 ; i++ )
|
||||
for ( i = 0; i < 3; i++ )
|
||||
{
|
||||
point[i] = (vec_t)FLOAT_SNAP( point[i], snap );
|
||||
}
|
||||
|
|
@ -344,7 +344,7 @@ void AddPointToBounds( vec3_t v, vec3_t mins, vec3_t maxs ){
|
|||
}
|
||||
}
|
||||
|
||||
for ( i = 0 ; i < 3 ; i++ )
|
||||
for ( i = 0; i < 3; i++ )
|
||||
{
|
||||
val = v[i];
|
||||
if ( val < mins[i] ) {
|
||||
|
|
|
|||
|
|
@ -956,7 +956,7 @@ char *_pico_parse( picoParser_t *p, int allowLFs ){
|
|||
* skips the rest of the current line in parser.
|
||||
*/
|
||||
void _pico_parse_skip_rest( picoParser_t *p ){
|
||||
while ( _pico_parse_ex( p,0,0 ) ) ;
|
||||
while ( _pico_parse_ex( p,0,0 ) ){};
|
||||
}
|
||||
|
||||
/* _pico_parse_skip_braced:
|
||||
|
|
|
|||
|
|
@ -480,7 +480,7 @@ void PicoFreeShader( picoShader_t *shader ){
|
|||
|
||||
picoShader_t *PicoFindShader( picoModel_t *model, char *name, int caseSensitive ){
|
||||
int i;
|
||||
|
||||
|
||||
/* sanity checks */
|
||||
if ( model == NULL || name == NULL ) { /* sea: null name fix */
|
||||
return NULL;
|
||||
|
|
@ -2249,7 +2249,7 @@ void PicoAddTriangleToModel( picoModel_t *model, picoVec3_t** xyz, picoVec3_t**
|
|||
picoSurface_t* workSurface = NULL;
|
||||
|
||||
/* see if a surface already has the shader */
|
||||
for ( i = 0 ; i < model->numSurfaces ; i++ )
|
||||
for ( i = 0; i < model->numSurfaces; i++ )
|
||||
{
|
||||
workSurface = model->surface[i];
|
||||
if ( !name || !strcmp( workSurface->name, name ) ) {
|
||||
|
|
@ -2275,7 +2275,7 @@ void PicoAddTriangleToModel( picoModel_t *model, picoVec3_t** xyz, picoVec3_t**
|
|||
}
|
||||
|
||||
/* add the triangle data to the surface */
|
||||
for ( i = 0 ; i < 3 ; i++ )
|
||||
for ( i = 0; i < 3; i++ )
|
||||
{
|
||||
/* get the next free spot in the index array */
|
||||
int newVertIndex = PicoGetSurfaceNumIndexes( workSurface );
|
||||
|
|
@ -2293,11 +2293,11 @@ void PicoAddTriangleToModel( picoModel_t *model, picoVec3_t** xyz, picoVec3_t**
|
|||
PicoSetSurfaceNormal( workSurface, vertDataIndex, *normals[i] );
|
||||
|
||||
/* make sure to copy over all available ST's and colors for the vertex */
|
||||
for ( j = 0 ; j < numColors ; j++ )
|
||||
for ( j = 0; j < numColors; j++ )
|
||||
{
|
||||
PicoSetSurfaceColor( workSurface, j, vertDataIndex, colors[i][j] );
|
||||
}
|
||||
for ( j = 0 ; j < numSTs ; j++ )
|
||||
for ( j = 0; j < numSTs; j++ )
|
||||
{
|
||||
PicoSetSurfaceST( workSurface, j, vertDataIndex, st[i][j] );
|
||||
}
|
||||
|
|
|
|||
|
|
@ -81,7 +81,7 @@ const picoModule_t *picoModules[] =
|
|||
const picoModule_t **PicoModuleList( int *numModules ){
|
||||
/* get module count */
|
||||
if ( numModules != NULL ) {
|
||||
for ( ( *numModules ) = 0; picoModules[ *numModules ] != NULL; ( *numModules )++ ) ;
|
||||
for ( ( *numModules ) = 0; picoModules[ *numModules ] != NULL; ( *numModules )++ ){};
|
||||
}
|
||||
|
||||
/* return list of modules */
|
||||
|
|
|
|||
|
|
@ -259,7 +259,7 @@ typedef aseFace_t* aseFacesIter_t;
|
|||
picoSurface_t* PicoModelFindOrAddSurface( picoModel_t *model, picoShader_t* shader ){
|
||||
/* see if a surface already has the shader */
|
||||
int i = 0;
|
||||
for ( ; i < model->numSurfaces ; i++ )
|
||||
for ( ; i < model->numSurfaces; i++ )
|
||||
{
|
||||
picoSurface_t* workSurface = model->surface[i];
|
||||
if ( workSurface->shader == shader ) {
|
||||
|
|
@ -377,7 +377,7 @@ static void _ase_submit_triangles_unshared( picoModel_t* model, aseMaterial_t* m
|
|||
picoSurface_t* surface = PicoModelFindOrAddSurface( model, subMtl->shader );
|
||||
int j;
|
||||
/* we pull the data from the vertex, color and texcoord arrays using the face index data */
|
||||
for ( j = 0 ; j < 3 ; j++ )
|
||||
for ( j = 0; j < 3; j++ )
|
||||
{
|
||||
picoIndex_t index = (picoIndex_t)( ( ( i - faces ) * 3 ) + j );
|
||||
picoIndex_t size = (picoIndex_t)aseUniqueIndices_size( &indices );
|
||||
|
|
@ -433,7 +433,7 @@ static void _ase_submit_triangles( picoModel_t* model, aseMaterial_t* materials,
|
|||
picoIndex_t smooth[3];
|
||||
int j;
|
||||
/* we pull the data from the vertex, color and texcoord arrays using the face index data */
|
||||
for ( j = 0 ; j < 3 ; j++ )
|
||||
for ( j = 0; j < 3; j++ )
|
||||
{
|
||||
xyz[j] = &vertices[( *i ).indices[j]].xyz;
|
||||
normal[j] = &vertices[( *i ).indices[j]].normal;
|
||||
|
|
|
|||
|
|
@ -297,7 +297,7 @@ public:
|
|||
// It is safe to disconnect the signal handler currently being invoked.
|
||||
template<typename InputIterator, typename SignalHandlerInvoke>
|
||||
inline void invokeSignalHandlers( InputIterator first, InputIterator last, SignalHandlerInvoke invoke ){
|
||||
while ( first != last && invoke( *first++ ) != SIGNAL_STOP_EMISSION ) ;
|
||||
while ( first != last && invoke( *first++ ) != SIGNAL_STOP_EMISSION ){};
|
||||
}
|
||||
|
||||
class Signal0 : public SignalBase<SignalHandler>
|
||||
|
|
|
|||
|
|
@ -195,7 +195,7 @@ public:
|
|||
Vector3 hack( 0.57735f, 0.57735f, 0.57735f );
|
||||
int maxI = 0;
|
||||
float max = 0;
|
||||
for ( int i = 0; i < 3 ; ++i ){
|
||||
for ( int i = 0; i < 3; ++i ){
|
||||
if ( dir[i] < 0 ){
|
||||
hack[i] *= -1.f;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -50,12 +50,12 @@ void Texture_InitPalette( byte *pal ){
|
|||
gamma = 1.0; //g_qeglobals.d_savedinfo.fGamma;
|
||||
|
||||
if ( gamma == 1.0 ) {
|
||||
for ( i = 0 ; i < 256 ; i++ )
|
||||
for ( i = 0; i < 256; i++ )
|
||||
gammatable[i] = i;
|
||||
}
|
||||
else
|
||||
{
|
||||
for ( i = 0 ; i < 256 ; i++ )
|
||||
for ( i = 0; i < 256; i++ )
|
||||
{
|
||||
inf = (int)( 255 * pow( ( i + 0.5 ) / 255.5, gamma ) + 0.5 );
|
||||
if ( inf < 0 ) {
|
||||
|
|
@ -68,7 +68,7 @@ void Texture_InitPalette( byte *pal ){
|
|||
}
|
||||
}
|
||||
|
||||
for ( i = 0 ; i < 256 ; i++ )
|
||||
for ( i = 0; i < 256; i++ )
|
||||
{
|
||||
r = gammatable[pal[0]];
|
||||
g = gammatable[pal[1]];
|
||||
|
|
|
|||
|
|
@ -429,7 +429,7 @@ void AddPointToBounds( const Vector3& v, Vector3& mins, Vector3& maxs ){
|
|||
int i;
|
||||
float val;
|
||||
|
||||
for ( i = 0 ; i < 3 ; i++ )
|
||||
for ( i = 0; i < 3; i++ )
|
||||
{
|
||||
val = v[i];
|
||||
if ( val < mins[i] ) {
|
||||
|
|
@ -564,7 +564,7 @@ void EmitBrushPrimitTextureCoordinates( face_t * f, Winding * w ){
|
|||
ConvertTexMatWithQTexture( &f->brushprimit_texdef, 0, &f->brushprimit_texdef, f->pShader->getTexture() );
|
||||
}
|
||||
int i;
|
||||
for ( i = 0 ; i < w.numpoints ; i++ )
|
||||
for ( i = 0; i < w.numpoints; i++ )
|
||||
{
|
||||
x = vector3_dot( w.point_at( i ),texX );
|
||||
y = vector3_dot( w.point_at( i ),texY );
|
||||
|
|
@ -842,14 +842,14 @@ void TextureLockTransformation_BrushPrimit( face_t *f ){
|
|||
}
|
||||
else
|
||||
{
|
||||
for ( j = 0 ; j < 3 ; j++ )
|
||||
for ( j = 0; j < 3; j++ )
|
||||
rOrig[j] = vector3_dot( vector3_subtracted( Orig, txl_origin ), txl_matrix[j] ) + txl_origin[j];
|
||||
for ( j = 0 ; j < 3 ; j++ )
|
||||
for ( j = 0; j < 3; j++ )
|
||||
rvecS[j] = vector3_dot( vector3_subtracted( texS, txl_origin ), txl_matrix[j] ) + txl_origin[j];
|
||||
for ( j = 0 ; j < 3 ; j++ )
|
||||
for ( j = 0; j < 3; j++ )
|
||||
rvecT[j] = vector3_dot( vector3_subtracted( texT, txl_origin ), txl_matrix[j] ) + txl_origin[j];
|
||||
// we also need the axis base of the target plane, apply the transformation matrix to the normal too..
|
||||
for ( j = 0 ; j < 3 ; j++ )
|
||||
for ( j = 0; j < 3; j++ )
|
||||
rNormal[j] = vector3_dot( f->plane.normal, txl_matrix[j] );
|
||||
}
|
||||
|
||||
|
|
@ -1103,7 +1103,7 @@ void BPTexdef_Rotate( brushprimit_texdef_t& bp_td, float angle ){
|
|||
const float y1 = bp_td.coords[1][1];
|
||||
const float s = sin( degrees_to_radians( -angle ) );
|
||||
const float c = cos( degrees_to_radians( -angle ) );
|
||||
bp_td.coords[0][0] = x * c - y * s ;
|
||||
bp_td.coords[0][0] = x * c - y * s;
|
||||
bp_td.coords[0][1] = x * s + y * c;
|
||||
bp_td.coords[1][0] = x1 * c - y1 * s;
|
||||
bp_td.coords[1][1] = x1 * s + y1 * c;
|
||||
|
|
|
|||
|
|
@ -141,7 +141,7 @@ void Brush_ConstructPrism( Brush& brush, const AABB& bounds, std::size_t sides,
|
|||
|
||||
brush.addPlane( planepts[0], planepts[1], planepts[2], shader, projection );
|
||||
|
||||
for ( std::size_t i = 0 ; i < sides ; ++i )
|
||||
for ( std::size_t i = 0; i < sides; ++i )
|
||||
{
|
||||
const double sv = sin( i * c_2pi / sides );
|
||||
const double cv = cos( i * c_2pi / sides );
|
||||
|
|
@ -192,7 +192,7 @@ void Brush_ConstructCone( Brush& brush, const AABB& bounds, std::size_t sides, c
|
|||
|
||||
brush.addPlane( planepts[0], planepts[1], planepts[2], shader, projection );
|
||||
|
||||
for ( std::size_t i = 0 ; i < sides ; ++i )
|
||||
for ( std::size_t i = 0; i < sides; ++i )
|
||||
{
|
||||
double sv = sin( i * 3.14159265 * 2 / sides );
|
||||
double cv = cos( i * 3.14159265 * 2 / sides );
|
||||
|
|
|
|||
|
|
@ -217,9 +217,9 @@ inline void FacePlane_exportXML( const FacePlane& facePlane, XMLImporter& import
|
|||
|
||||
{
|
||||
// write planepts
|
||||
for ( int i = 0 ; i < 3 ; i++ )
|
||||
for ( int i = 0; i < 3; i++ )
|
||||
{
|
||||
for ( int j = 0 ; j < 3 ; j++ )
|
||||
for ( int j = 0; j < 3; j++ )
|
||||
{
|
||||
importer << Face::m_quantise( facePlane.planePoints()[i][j] ) << ' ';
|
||||
}
|
||||
|
|
|
|||
|
|
@ -251,7 +251,7 @@ void Camera_updateProjection( camera_t& camera ){
|
|||
}
|
||||
|
||||
void Camera_updateVectors( camera_t& camera ){
|
||||
for ( int i = 0 ; i < 3 ; i++ )
|
||||
for ( int i = 0; i < 3; i++ )
|
||||
{
|
||||
camera.vright[i] = camera.modelview[( i << 2 ) + 0];
|
||||
camera.vup[i] = camera.modelview[( i << 2 ) + 1];
|
||||
|
|
@ -2215,7 +2215,7 @@ void CamWnd::draw(){
|
|||
|
||||
void CamWnd::BenchMark(){
|
||||
double dStart = Sys_DoubleTime();
|
||||
for ( int i = 0 ; i < 100 ; i++ )
|
||||
for ( int i = 0; i < 100; i++ )
|
||||
{
|
||||
Vector3 angles;
|
||||
angles[CAMERA_ROLL] = 0;
|
||||
|
|
|
|||
|
|
@ -235,7 +235,7 @@ EntityClass *Eclass_InitFromText( const char *text ){
|
|||
return 0;
|
||||
}
|
||||
|
||||
for ( int i = 0 ; i < 2 ; i++ )
|
||||
for ( int i = 0; i < 2; i++ )
|
||||
{
|
||||
while ( *text != ')' )
|
||||
{
|
||||
|
|
@ -262,7 +262,7 @@ EntityClass *Eclass_InitFromText( const char *text ){
|
|||
{
|
||||
// any remaining words are parm flags
|
||||
const char* p = parms;
|
||||
for ( std::size_t i = 0 ; i < MAX_FLAGS ; i++ )
|
||||
for ( std::size_t i = 0; i < MAX_FLAGS; i++ )
|
||||
{
|
||||
p = COM_Parse( p );
|
||||
if ( !p ) {
|
||||
|
|
|
|||
|
|
@ -505,7 +505,7 @@ static bool EntityClass_parse( EntityClass& entityClass, Tokeniser& tokeniser ){
|
|||
CopiedString tmp( key );
|
||||
//ASSERT_MESSAGE( !string_equal_n( key, "editor_", 7 ), "unsupported editor key: " << makeQuoted( key ) );
|
||||
if ( string_equal_n( key, "editor_", 7 ) ) {
|
||||
globalErrorStream() << "unsupported editor key " << makeQuoted( key ) ;
|
||||
globalErrorStream() << "unsupported editor key " << makeQuoted( key );
|
||||
}
|
||||
EntityClassAttribute& attribute = EntityClass_insertAttribute( entityClass, key ).second;
|
||||
attribute.m_type = "string";
|
||||
|
|
|
|||
|
|
@ -1003,7 +1003,7 @@ void SurfaceFlags_setEntityClass( EntityClass* eclass ){
|
|||
|
||||
{
|
||||
// do a first pass to count the spawn flags, don't touch the widgets, we don't know in what state they are
|
||||
for ( int i = 0 ; i < MAX_FLAGS ; i++ )
|
||||
for ( int i = 0; i < MAX_FLAGS; i++ )
|
||||
{
|
||||
if ( eclass->flagnames[i] && eclass->flagnames[i][0] != 0 && strcmp( eclass->flagnames[i],"-" ) ) {
|
||||
spawn_table[spawnflag_count] = i;
|
||||
|
|
|
|||
|
|
@ -106,7 +106,7 @@ const GLubyte* qgluErrorString( GLenum errCode ){
|
|||
if ( errCode == glu_errlist[search].errnum ) {
|
||||
return (const GLubyte *)glu_errlist[search].errstr;
|
||||
}
|
||||
} //end for
|
||||
}
|
||||
return (const GLubyte *)"Unknown error";
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -554,7 +554,7 @@ public:
|
|||
vector3_scale( delta, m_axis );
|
||||
|
||||
Vector3 start( vector3_snapped( m_start, GetSnapGridSize() != 0.f ? GetSnapGridSize() : 1e-3f ) );
|
||||
for ( std::size_t i = 0; i < 3 ; ++i ){ //prevent snapping to 0 with big gridsize
|
||||
for ( std::size_t i = 0; i < 3; ++i ){ //prevent snapping to 0 with big gridsize
|
||||
if( float_snapped( m_start[i], 1e-3f ) != 0.f && start[i] == 0.f ){
|
||||
start[i] = GetSnapGridSize();
|
||||
}
|
||||
|
|
@ -627,7 +627,7 @@ public:
|
|||
delta = vector3_scaled( delta, m_axis ) + vector3_scaled( delta, m_axis2 );
|
||||
|
||||
Vector3 start( vector3_snapped( m_start, GetSnapGridSize() != 0.f ? GetSnapGridSize() : 1e-3f ) );
|
||||
for ( std::size_t i = 0; i < 3 ; ++i ){ //prevent snapping to 0 with big gridsize
|
||||
for ( std::size_t i = 0; i < 3; ++i ){ //prevent snapping to 0 with big gridsize
|
||||
if( float_snapped( m_start[i], 1e-3f ) != 0.f && start[i] == 0.f ){
|
||||
start[i] = GetSnapGridSize();
|
||||
}
|
||||
|
|
@ -6190,7 +6190,7 @@ public:
|
|||
case eUV:
|
||||
{
|
||||
const Vector3 uv_origin = matrix4_transformed_point( m_local2tex, m_origin );
|
||||
const Vector3 uv_start{ m_selectedV->vertex.x(), m_selectedU->vertex.y(), 0 } ;
|
||||
const Vector3 uv_start{ m_selectedV->vertex.x(), m_selectedU->vertex.y(), 0 };
|
||||
const Vector3 uv_current{ ( m_selectedV->vertex + matrix4_transformed_point( m_local2tex, current ) - matrix4_transformed_point( m_local2tex, m_start ) ).x(),
|
||||
( m_selectedU->vertex + matrix4_transformed_point( m_local2tex, current ) - matrix4_transformed_point( m_local2tex, m_start ) ).y(),
|
||||
0 };
|
||||
|
|
@ -6550,7 +6550,7 @@ public:
|
|||
current = vector3_subtracted( current, m_start );
|
||||
|
||||
if( snap ){
|
||||
for ( std::size_t i = 0; i < 3 ; ++i ){
|
||||
for ( std::size_t i = 0; i < 3; ++i ){
|
||||
if( fabs( current[i] ) >= fabs( current[(i + 1) % 3] ) ){
|
||||
current[(i + 1) % 3] = 0.f;
|
||||
}
|
||||
|
|
@ -6561,7 +6561,7 @@ public:
|
|||
}
|
||||
|
||||
bool set[3] = { true, true, true };
|
||||
for ( std::size_t i = 0; i < 3 ; ++i ){
|
||||
for ( std::size_t i = 0; i < 3; ++i ){
|
||||
if( fabs( current[i] ) < 1e-3f ){
|
||||
set[i] = false;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -482,7 +482,7 @@ void SurfaceInspector_ProjectTexture( GtkWidget* widget, EProjectTexture type ){
|
|||
direction = g_vector3_axes[GlobalXYWnd_getCurrentViewType()];
|
||||
break;
|
||||
case eProjectCam:
|
||||
//direction = -g_pParentWnd->GetCamWnd()->getCamera().vpn ;
|
||||
//direction = -g_pParentWnd->GetCamWnd()->getCamera().vpn;
|
||||
direction = -Camera_getViewVector( *g_pParentWnd->GetCamWnd() );
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -278,12 +278,12 @@ void Texture_InitPalette( byte *pal ){
|
|||
gamma = g_texture_globals.fGamma;
|
||||
|
||||
if ( gamma == 1.0 ) {
|
||||
for ( i = 0 ; i < 256 ; i++ )
|
||||
for ( i = 0; i < 256; i++ )
|
||||
gammatable[i] = i;
|
||||
}
|
||||
else
|
||||
{
|
||||
for ( i = 0 ; i < 256 ; i++ )
|
||||
for ( i = 0; i < 256; i++ )
|
||||
{
|
||||
inf = (int)( 255 * pow( ( i + 0.5 ) / 255.5, gamma ) + 0.5 );
|
||||
if ( inf < 0 ) {
|
||||
|
|
@ -296,7 +296,7 @@ void Texture_InitPalette( byte *pal ){
|
|||
}
|
||||
}
|
||||
|
||||
for ( i = 0 ; i < 256 ; i++ )
|
||||
for ( i = 0; i < 256; i++ )
|
||||
{
|
||||
r = gammatable[pal[0]];
|
||||
g = gammatable[pal[1]];
|
||||
|
|
|
|||
|
|
@ -128,7 +128,7 @@ void Winding_createInfinite( FixedWinding& winding, const Plane3& plane, double
|
|||
#if 0
|
||||
double max = -infinity;
|
||||
int x = -1;
|
||||
for ( int i = 0 ; i < 3; i++ )
|
||||
for ( int i = 0; i < 3; i++ )
|
||||
{
|
||||
double d = fabs( plane.normal()[i] );
|
||||
if ( d > max ) {
|
||||
|
|
|
|||
|
|
@ -911,7 +911,7 @@ void XYWnd::NewBrushDrag( int x, int y, bool square, bool cube ){
|
|||
}
|
||||
}
|
||||
|
||||
for ( int i = 0 ; i < 3 ; i++ )
|
||||
for ( int i = 0; i < 3; i++ )
|
||||
{
|
||||
if ( mins[i] == maxs[i] )
|
||||
return; // don't create a degenerate brush
|
||||
|
|
@ -1535,14 +1535,14 @@ void XYWnd::XY_DrawGrid( void ) {
|
|||
|
||||
glBegin( GL_LINES );
|
||||
int i = 0;
|
||||
for ( x = xb ; x < xe ; x += minor_step, ++i ) {
|
||||
for ( x = xb; x < xe; x += minor_step, ++i ) {
|
||||
if ( ( i & mask ) != 0 ) {
|
||||
glVertex2f( x, yb );
|
||||
glVertex2f( x, ye );
|
||||
}
|
||||
}
|
||||
i = 0;
|
||||
for ( y = yb ; y < ye ; y += minor_step, ++i ) {
|
||||
for ( y = yb; y < ye; y += minor_step, ++i ) {
|
||||
if ( ( i & mask ) != 0 ) {
|
||||
glVertex2f( xb, y );
|
||||
glVertex2f( xe, y );
|
||||
|
|
@ -1556,11 +1556,11 @@ void XYWnd::XY_DrawGrid( void ) {
|
|||
glColor4fv( vector4_to_array( Vector4( g_xywindow_globals.color_gridmajor, a ) ) );
|
||||
|
||||
glBegin( GL_LINES );
|
||||
for ( x = xb ; x <= xe ; x += step ) {
|
||||
for ( x = xb; x <= xe; x += step ) {
|
||||
glVertex2f( x, yb );
|
||||
glVertex2f( x, ye );
|
||||
}
|
||||
for ( y = yb ; y <= ye ; y += step ) {
|
||||
for ( y = yb; y <= ye; y += step ) {
|
||||
glVertex2f( xb, y );
|
||||
glVertex2f( xe, y );
|
||||
}
|
||||
|
|
@ -1584,14 +1584,14 @@ void XYWnd::XY_DrawGrid( void ) {
|
|||
|
||||
glBegin( GL_LINES );
|
||||
int i = 0;
|
||||
for ( x = xb_ ; x < xe_ ; x += minor_step, ++i ) {
|
||||
for ( x = xb_; x < xe_; x += minor_step, ++i ) {
|
||||
if ( ( i & mask ) != 0 ) {
|
||||
glVertex2f( x, yb_ );
|
||||
glVertex2f( x, ye_ );
|
||||
}
|
||||
}
|
||||
i = 0;
|
||||
for ( y = yb_ ; y < ye_ ; y += minor_step, ++i ) {
|
||||
for ( y = yb_; y < ye_; y += minor_step, ++i ) {
|
||||
if ( ( i & mask ) != 0 ) {
|
||||
glVertex2f( xb_, y );
|
||||
glVertex2f( xe_, y );
|
||||
|
|
@ -1605,11 +1605,11 @@ void XYWnd::XY_DrawGrid( void ) {
|
|||
glColor4fv( vector4_to_array( Vector4( g_xywindow_globals.color_gridmajor, .5f ) ) );
|
||||
|
||||
glBegin( GL_LINES );
|
||||
for ( x = xb_ ; x <= xe_ ; x += step ) {
|
||||
for ( x = xb_; x <= xe_; x += step ) {
|
||||
glVertex2f( x, yb_ );
|
||||
glVertex2f( x, ye_ );
|
||||
}
|
||||
for ( y = yb_ ; y <= ye_ ; y += step ) {
|
||||
for ( y = yb_; y <= ye_; y += step ) {
|
||||
glVertex2f( xb_, y );
|
||||
glVertex2f( xe_, y );
|
||||
}
|
||||
|
|
@ -1625,12 +1625,12 @@ void XYWnd::XY_DrawGrid( void ) {
|
|||
const float offx = m_vOrigin[nDim2] + h - ( 1 + GlobalOpenGL().m_font->getPixelHeight() ) / m_fScale;
|
||||
const float offy = m_vOrigin[nDim1] - w + 4 / m_fScale;
|
||||
const float fontDescent = ( GlobalOpenGL().m_font->getPixelDescent() - 1 ) / m_fScale;
|
||||
for ( x = xb - fmod( xb, stepx ); x <= xe ; x += stepx ) {
|
||||
for ( x = xb - fmod( xb, stepx ); x <= xe; x += stepx ) {
|
||||
glRasterPos2f( x, offx );
|
||||
sprintf( text, "%g", x );
|
||||
GlobalOpenGL().drawString( text );
|
||||
}
|
||||
for ( y = yb - fmod( yb, stepy ); y <= ye ; y += stepy ) {
|
||||
for ( y = yb - fmod( yb, stepy ); y <= ye; y += stepy ) {
|
||||
glRasterPos2f( offy, y - fontDescent );
|
||||
sprintf( text, "%g", y );
|
||||
GlobalOpenGL().drawString( text );
|
||||
|
|
@ -1708,14 +1708,14 @@ void XYWnd::XY_DrawBlockGrid(){
|
|||
|
||||
glBegin( GL_LINES );
|
||||
|
||||
for ( x = xb ; x <= xe ; x += g_xywindow_globals_private.blockSize )
|
||||
for ( x = xb; x <= xe; x += g_xywindow_globals_private.blockSize )
|
||||
{
|
||||
glVertex2f( x, yb );
|
||||
glVertex2f( x, ye );
|
||||
}
|
||||
|
||||
if ( m_viewType == XY ) {
|
||||
for ( y = yb ; y <= ye ; y += g_xywindow_globals_private.blockSize )
|
||||
for ( y = yb; y <= ye; y += g_xywindow_globals_private.blockSize )
|
||||
{
|
||||
glVertex2f( xb, y );
|
||||
glVertex2f( xe, y );
|
||||
|
|
@ -1728,8 +1728,8 @@ void XYWnd::XY_DrawBlockGrid(){
|
|||
// draw coordinate text if needed
|
||||
|
||||
if ( m_viewType == XY && m_fScale > .1 ) {
|
||||
for ( x = xb ; x < xe ; x += g_xywindow_globals_private.blockSize )
|
||||
for ( y = yb ; y < ye ; y += g_xywindow_globals_private.blockSize )
|
||||
for ( x = xb; x < xe; x += g_xywindow_globals_private.blockSize )
|
||||
for ( y = yb; y < ye; y += g_xywindow_globals_private.blockSize )
|
||||
{
|
||||
glRasterPos2f( x + ( g_xywindow_globals_private.blockSize / 2 ), y + ( g_xywindow_globals_private.blockSize / 2 ) );
|
||||
sprintf( text, "%i,%i",(int)floor( x / g_xywindow_globals_private.blockSize ), (int)floor( y / g_xywindow_globals_private.blockSize ) );
|
||||
|
|
|
|||
|
|
@ -270,7 +270,7 @@ void LoadLBM( const char *filename, byte **picture, byte **palette ){
|
|||
//
|
||||
// unpack PBM
|
||||
//
|
||||
for ( y = 0 ; y < bmhd.h ; y++, pic_p += bmhd.w )
|
||||
for ( y = 0; y < bmhd.h; ++y, pic_p += bmhd.w )
|
||||
{
|
||||
if ( bmhd.compression == cm_rle1 ) {
|
||||
body_p = LBMRLEDecompress( (byte *)body_p
|
||||
|
|
@ -586,9 +586,9 @@ void WritePCXfile( const char *filename, byte *data,
|
|||
// pack the image
|
||||
pack = &pcx->data;
|
||||
|
||||
for ( i = 0 ; i < height ; i++ )
|
||||
for ( i = 0; i < height; ++i )
|
||||
{
|
||||
for ( j = 0 ; j < width ; j++ )
|
||||
for ( j = 0; j < width; ++j )
|
||||
{
|
||||
if ( ( *data & 0xc0 ) != 0xc0 ) {
|
||||
*pack++ = *data++;
|
||||
|
|
@ -603,7 +603,7 @@ void WritePCXfile( const char *filename, byte *data,
|
|||
|
||||
// write the palette
|
||||
*pack++ = 0x0c; // palette ID byte
|
||||
for ( i = 0 ; i < 768 ; i++ )
|
||||
for ( i = 0; i < 768; ++i )
|
||||
*pack++ = *palette++;
|
||||
|
||||
// write output file
|
||||
|
|
@ -723,7 +723,7 @@ void LoadBMP( const char *filename, byte **pic, byte **palette, int *width, int
|
|||
pos += 1024;
|
||||
*palette = safe_malloc( 768 );
|
||||
|
||||
for ( i = 0 ; i < 256 ; i++ )
|
||||
for ( i = 0; i < 256; ++i )
|
||||
{
|
||||
( *palette )[i * 3 + 0] = bcPalette[i * 4 + 2];
|
||||
( *palette )[i * 3 + 1] = bcPalette[i * 4 + 1];
|
||||
|
|
@ -743,7 +743,7 @@ void LoadBMP( const char *filename, byte **pic, byte **palette, int *width, int
|
|||
pos += 768;
|
||||
*palette = safe_malloc( 768 );
|
||||
|
||||
for ( i = 0 ; i < 256 ; i++ ) {
|
||||
for ( i = 0; i < 256; ++i ) {
|
||||
( *palette )[i * 3 + 0] = bcPalette[i * 3 + 2];
|
||||
( *palette )[i * 3 + 1] = bcPalette[i * 3 + 1];
|
||||
( *palette )[i * 3 + 2] = bcPalette[i * 3 + 0];
|
||||
|
|
@ -786,7 +786,7 @@ void LoadBMP( const char *filename, byte **pic, byte **palette, int *width, int
|
|||
pos = bfOffBits;
|
||||
|
||||
if ( flipped ) {
|
||||
for ( i = 0 ; i < bcHeight ; i++ ) {
|
||||
for ( i = 0; i < bcHeight; ++i ) {
|
||||
memcpy( out + bcWidth * ( bcHeight - 1 - i ), in + pos, bcWidth );
|
||||
pos += bcWidth;
|
||||
}
|
||||
|
|
@ -1132,7 +1132,7 @@ void WriteTGA( const char *filename, const byte *data, int width, int height ) {
|
|||
|
||||
// swap rgb to bgr
|
||||
c = 18 + width * height * 4;
|
||||
for ( i = 18 ; i < c ; i += 4 )
|
||||
for ( i = 18; i < c; i += 4 )
|
||||
{
|
||||
buffer[i] = data[i - 18 + 2]; // blue
|
||||
buffer[i + 1] = data[i - 18 + 1]; // green
|
||||
|
|
@ -1199,7 +1199,7 @@ void Load32BitImage( const char *name, unsigned **pixels, int *width, int *heig
|
|||
size = *width * *height;
|
||||
pixels32 = safe_malloc( size * 4 );
|
||||
*pixels = (unsigned *)pixels32;
|
||||
for ( i = 0 ; i < size ; i++ ) {
|
||||
for ( i = 0; i < size; ++i ) {
|
||||
v = pixels8[i];
|
||||
pixels32[i * 4 + 0] = palette[ v * 3 + 0 ];
|
||||
pixels32[i * 4 + 1] = palette[ v * 3 + 1 ];
|
||||
|
|
|
|||
|
|
@ -148,7 +148,7 @@ void xml_Select( const char *msg, int entitynum, int brushnum, bool bError ){
|
|||
sprintf( buf, "Entity %i, Brush %i: %s", entitynum, brushnum, msg );
|
||||
node = xmlNewNode( NULL, (const xmlChar*)"select" );
|
||||
xmlNodeAddContent( node, (const xmlChar*)buf );
|
||||
level[0] = (int)'0' + ( bError ? SYS_ERR : SYS_WRN ) ;
|
||||
level[0] = (int)'0' + ( bError ? SYS_ERR : SYS_WRN );
|
||||
level[1] = 0;
|
||||
xmlSetProp( node, (const xmlChar*)"level", (const xmlChar *)level );
|
||||
// a 'select' information
|
||||
|
|
|
|||
|
|
@ -243,7 +243,7 @@ winding_t BaseWindingForPlane( const Plane3f& plane ){
|
|||
|
||||
max = -BOGUS_RANGE;
|
||||
x = -1;
|
||||
for ( i = 0 ; i < 3; i++ )
|
||||
for ( i = 0; i < 3; ++i )
|
||||
{
|
||||
v = fabs( plane.normal()[i] );
|
||||
if ( v > max ) {
|
||||
|
|
@ -653,7 +653,7 @@ void CheckWinding( const winding_t& w ){
|
|||
|
||||
const Plane3f faceplane = WindingPlane( w );
|
||||
|
||||
for ( size_t i = 0 ; i < w.size() ; i++ )
|
||||
for ( size_t i = 0; i < w.size(); ++i )
|
||||
{
|
||||
const Vector3& p1 = w[i];
|
||||
|
||||
|
|
@ -678,7 +678,7 @@ void CheckWinding( const winding_t& w ){
|
|||
const float edgedist = vector3_dot( p1, edgenormal ) + ON_EPSILON;
|
||||
|
||||
// all other points must be on front side
|
||||
for ( size_t j = 0 ; j < w.size() ; j++ )
|
||||
for ( size_t j = 0; j < w.size(); ++j )
|
||||
{
|
||||
if ( j == i ) {
|
||||
continue;
|
||||
|
|
|
|||
|
|
@ -189,7 +189,7 @@ void RunThreadsOn( int workcnt, bool showpacifier, void ( *func )( int ) ){
|
|||
}
|
||||
else
|
||||
{
|
||||
for ( i = 0 ; i < numthreads ; i++ )
|
||||
for ( i = 0; i < numthreads; ++i )
|
||||
{
|
||||
threadhandle[i] = CreateThread(
|
||||
NULL, // LPSECURITY_ATTRIBUTES lpThreadAttributes,
|
||||
|
|
@ -204,7 +204,7 @@ void RunThreadsOn( int workcnt, bool showpacifier, void ( *func )( int ) ){
|
|||
NULL ); // LPDWORD lpThreadId
|
||||
}
|
||||
|
||||
for ( i = 0 ; i < numthreads ; i++ )
|
||||
for ( i = 0; i < numthreads; ++i )
|
||||
WaitForSingleObject( threadhandle[i], INFINITE );
|
||||
}
|
||||
DeleteCriticalSection( &crit );
|
||||
|
|
@ -300,7 +300,7 @@ void RunThreadsOn( int workcnt, bool showpacifier, void ( *func )( int ) ){
|
|||
Error( "pthread_attr_setstacksize failed" );
|
||||
}
|
||||
|
||||
for ( i = 0 ; i < numthreads ; i++ )
|
||||
for ( i = 0; i < numthreads; ++i )
|
||||
{
|
||||
if ( pthread_create( &work_threads[i], attrib
|
||||
, (pthread_startroutine_t)func, (pthread_addr_t)i ) == -1 ) {
|
||||
|
|
@ -308,7 +308,7 @@ void RunThreadsOn( int workcnt, bool showpacifier, void ( *func )( int ) ){
|
|||
}
|
||||
}
|
||||
|
||||
for ( i = 0 ; i < numthreads ; i++ )
|
||||
for ( i = 0; i < numthreads; ++i )
|
||||
{
|
||||
if ( pthread_join( work_threads[i], &status ) == -1 ) {
|
||||
Error( "pthread_join failed" );
|
||||
|
|
@ -387,7 +387,7 @@ void RunThreadsOn( int workcnt, bool showpacifier, void ( *func )( int ) ){
|
|||
|
||||
init_lock( &lck );
|
||||
|
||||
for ( i = 0 ; i < numthreads - 1 ; i++ )
|
||||
for ( i = 0; i < numthreads - 1; ++i )
|
||||
{
|
||||
pid[i] = sprocsp( ( void ( * )( void *, size_t ) )func, PR_SALL, (void *)i
|
||||
, NULL, 0x200000 ); // 2 meg stacks
|
||||
|
|
@ -399,7 +399,7 @@ void RunThreadsOn( int workcnt, bool showpacifier, void ( *func )( int ) ){
|
|||
|
||||
func( i );
|
||||
|
||||
for ( i = 0 ; i < numthreads - 1 ; i++ )
|
||||
for ( i = 0; i < numthreads - 1; ++i )
|
||||
wait( NULL );
|
||||
|
||||
threaded = false;
|
||||
|
|
@ -571,14 +571,14 @@ void RunThreadsOn( int workcnt, bool showpacifier, void ( *func )( int ) ){
|
|||
}
|
||||
recursive_mutex_init( mattrib );
|
||||
|
||||
for ( i = 0 ; i < numthreads ; i++ )
|
||||
for ( i = 0; i < numthreads; ++i )
|
||||
{
|
||||
/* Default pthread attributes: joinable & non-realtime scheduling */
|
||||
if ( pthread_create( &work_threads[i], &attr, (void *(*)(void *)) func, (void*)(size_t)i ) != 0 ) {
|
||||
Error( "pthread_create failed" );
|
||||
}
|
||||
}
|
||||
for ( i = 0 ; i < numthreads ; i++ )
|
||||
for ( i = 0; i < numthreads; ++i )
|
||||
{
|
||||
if ( pthread_join( work_threads[i], NULL ) != 0 ) {
|
||||
Error( "pthread_join failed" );
|
||||
|
|
|
|||
|
|
@ -1275,7 +1275,7 @@ static int unzlocal_getShort (FILE* fin, uLong *pX)
|
|||
return UNZ_OK;
|
||||
|
||||
/*
|
||||
uLong x ;
|
||||
uLong x;
|
||||
int i;
|
||||
int err;
|
||||
|
||||
|
|
@ -1306,7 +1306,7 @@ static int unzlocal_getLong (FILE *fin, uLong *pX)
|
|||
return UNZ_OK;
|
||||
|
||||
/*
|
||||
uLong x ;
|
||||
uLong x;
|
||||
int i;
|
||||
int err;
|
||||
|
||||
|
|
@ -1417,13 +1417,13 @@ static uLong unzlocal_SearchCentralDir(FILE *fin)
|
|||
uBackRead = 4;
|
||||
while (uBackRead<uMaxBack)
|
||||
{
|
||||
uLong uReadSize,uReadPos ;
|
||||
uLong uReadSize,uReadPos;
|
||||
int i;
|
||||
if (uBackRead+BUFREADCOMMENT>uMaxBack)
|
||||
uBackRead = uMaxBack;
|
||||
else
|
||||
uBackRead+=BUFREADCOMMENT;
|
||||
uReadPos = uSizeFile-uBackRead ;
|
||||
uReadPos = uSizeFile-uBackRead;
|
||||
|
||||
uReadSize = ((BUFREADCOMMENT+4) < (uSizeFile-uReadPos)) ?
|
||||
(BUFREADCOMMENT+4) : (uSizeFile-uReadPos);
|
||||
|
|
@ -1478,7 +1478,7 @@ extern unzFile unzOpen (const char* path)
|
|||
unz_s us;
|
||||
unz_s *s;
|
||||
uLong central_pos,uL;
|
||||
FILE * fin ;
|
||||
FILE * fin;
|
||||
|
||||
uLong number_disk; /* number of the current dist, used for
|
||||
spaning ZIP, unsupported, always 0*/
|
||||
|
|
@ -1606,13 +1606,13 @@ static void unzlocal_DosDateToTmuDate (uLong ulDosDate, tm_unz* ptm)
|
|||
{
|
||||
uLong uDate;
|
||||
uDate = (uLong)(ulDosDate>>16);
|
||||
ptm->tm_mday = (uInt)(uDate&0x1f) ;
|
||||
ptm->tm_mon = (uInt)((((uDate)&0x1E0)/0x20)-1) ;
|
||||
ptm->tm_year = (uInt)(((uDate&0x0FE00)/0x0200)+1980) ;
|
||||
ptm->tm_mday = (uInt)(uDate&0x1f);
|
||||
ptm->tm_mon = (uInt)((((uDate)&0x1E0)/0x20)-1);
|
||||
ptm->tm_year = (uInt)(((uDate&0x0FE00)/0x0200)+1980);
|
||||
|
||||
ptm->tm_hour = (uInt) ((ulDosDate &0xF800)/0x800);
|
||||
ptm->tm_min = (uInt) ((ulDosDate&0x7E0)/0x20) ;
|
||||
ptm->tm_sec = (uInt) (2*(ulDosDate&0x1f)) ;
|
||||
ptm->tm_min = (uInt) ((ulDosDate&0x7E0)/0x20);
|
||||
ptm->tm_sec = (uInt) (2*(ulDosDate&0x1f));
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -1701,7 +1701,7 @@ static int unzlocal_GetCurrentFileInfoInternal (unzFile file,
|
|||
lSeek+=file_info.size_filename;
|
||||
if ((err==UNZ_OK) && (szFileName!=NULL))
|
||||
{
|
||||
uLong uSizeRead ;
|
||||
uLong uSizeRead;
|
||||
if (file_info.size_filename<fileNameBufferSize)
|
||||
{
|
||||
*(szFileName+file_info.size_filename)='\0';
|
||||
|
|
@ -1719,7 +1719,7 @@ static int unzlocal_GetCurrentFileInfoInternal (unzFile file,
|
|||
|
||||
if ((err==UNZ_OK) && (extraField!=NULL))
|
||||
{
|
||||
uLong uSizeRead ;
|
||||
uLong uSizeRead;
|
||||
if (file_info.size_file_extra<extraFieldBufferSize)
|
||||
uSizeRead = file_info.size_file_extra;
|
||||
else
|
||||
|
|
@ -1742,7 +1742,7 @@ static int unzlocal_GetCurrentFileInfoInternal (unzFile file,
|
|||
|
||||
if ((err==UNZ_OK) && (szComment!=NULL))
|
||||
{
|
||||
uLong uSizeRead ;
|
||||
uLong uSizeRead;
|
||||
if (file_info.size_file_comment<commentBufferSize)
|
||||
{
|
||||
*(szComment+file_info.size_file_comment)='\0';
|
||||
|
|
@ -1832,7 +1832,7 @@ extern int unzGoToNextFile (unzFile file)
|
|||
return UNZ_END_OF_LIST_OF_FILE;
|
||||
|
||||
s->pos_in_central_dir += SIZECENTRALDIRITEM + s->cur_file_info.size_filename +
|
||||
s->cur_file_info.size_file_extra + s->cur_file_info.size_file_comment ;
|
||||
s->cur_file_info.size_file_extra + s->cur_file_info.size_file_comment;
|
||||
s->num_file++;
|
||||
err = unzlocal_GetCurrentFileInfoInternal(file,&s->cur_file_info,
|
||||
&s->cur_file_info_internal,
|
||||
|
|
@ -1887,8 +1887,8 @@ extern int unzLocateFile (unzFile file, const char *szFileName, int iCaseSensiti
|
|||
err = unzGoToNextFile(file);
|
||||
}
|
||||
|
||||
s->num_file = num_fileSaved ;
|
||||
s->pos_in_central_dir = pos_in_central_dirSaved ;
|
||||
s->num_file = num_fileSaved;
|
||||
s->pos_in_central_dir = pos_in_central_dirSaved;
|
||||
return err;
|
||||
}
|
||||
|
||||
|
|
@ -2060,9 +2060,9 @@ extern int unzOpenCurrentFile (unzFile file)
|
|||
*/
|
||||
}
|
||||
pfile_in_zip_read_info->rest_read_compressed =
|
||||
s->cur_file_info.compressed_size ;
|
||||
s->cur_file_info.compressed_size;
|
||||
pfile_in_zip_read_info->rest_read_uncompressed =
|
||||
s->cur_file_info.uncompressed_size ;
|
||||
s->cur_file_info.uncompressed_size;
|
||||
|
||||
|
||||
pfile_in_zip_read_info->pos_in_zipfile =
|
||||
|
|
@ -2144,12 +2144,12 @@ extern int unzReadCurrentFile (unzFile file, void *buf, unsigned len)
|
|||
|
||||
if (pfile_in_zip_read_info->compression_method==0)
|
||||
{
|
||||
uInt uDoCopy,i ;
|
||||
uInt uDoCopy,i;
|
||||
if (pfile_in_zip_read_info->stream.avail_out <
|
||||
pfile_in_zip_read_info->stream.avail_in)
|
||||
uDoCopy = pfile_in_zip_read_info->stream.avail_out ;
|
||||
uDoCopy = pfile_in_zip_read_info->stream.avail_out;
|
||||
else
|
||||
uDoCopy = pfile_in_zip_read_info->stream.avail_in ;
|
||||
uDoCopy = pfile_in_zip_read_info->stream.avail_in;
|
||||
|
||||
for (i=0;i<uDoCopy;i++)
|
||||
*(pfile_in_zip_read_info->stream.next_out+i) =
|
||||
|
|
@ -2287,7 +2287,7 @@ extern int unzGetLocalExtrafield (unzFile file,void *buf,unsigned len)
|
|||
if (len>size_to_read)
|
||||
read_now = (uInt)size_to_read;
|
||||
else
|
||||
read_now = (uInt)len ;
|
||||
read_now = (uInt)len;
|
||||
|
||||
if (read_now==0)
|
||||
return 0;
|
||||
|
|
@ -2351,7 +2351,7 @@ extern int unzCloseCurrentFile (unzFile file)
|
|||
extern int unzGetGlobalComment (unzFile file, char *szComment, uLong uSizeBuf)
|
||||
{
|
||||
unz_s* s;
|
||||
uLong uReadThis ;
|
||||
uLong uReadThis;
|
||||
if (file==NULL)
|
||||
return UNZ_PARAMERROR;
|
||||
s=(unz_s*)file;
|
||||
|
|
|
|||
|
|
@ -352,7 +352,7 @@ bool CreateBrushWindings( brush_t& brush ){
|
|||
brush_t BrushFromBounds( const Vector3& mins, const Vector3& maxs ){
|
||||
brush_t b;
|
||||
b.sides.resize( 6 );
|
||||
for ( int i = 0 ; i < 3 ; i++ )
|
||||
for ( int i = 0; i < 3; ++i )
|
||||
{
|
||||
float dist = maxs[i];
|
||||
b.sides[i].planenum = FindFloatPlane( g_vector3_axes[i], dist, 1, &maxs );
|
||||
|
|
|
|||
|
|
@ -675,7 +675,7 @@ int BSPMain( Args& args ){
|
|||
Sys_Printf( "Leaving light entities on map after compile\n" );
|
||||
}
|
||||
while ( args.takeArg( "-nodetail" ) ) {
|
||||
Sys_Printf( "Ignoring detail brushes\n" ) ;
|
||||
Sys_Printf( "Ignoring detail brushes\n" );
|
||||
nodetail = true;
|
||||
}
|
||||
while ( args.takeArg( "-fulldetail" ) ) {
|
||||
|
|
|
|||
|
|
@ -410,7 +410,7 @@ bool ParseEntity( void ){
|
|||
void ParseEntities( void ){
|
||||
entities.clear();
|
||||
ParseFromMemory( bspEntData.data(), bspEntData.size() );
|
||||
while ( ParseEntity() ) ;
|
||||
while ( ParseEntity() ){};
|
||||
|
||||
/* ydnar: set number of bsp entities in case a map is loaded on top */
|
||||
numBSPEntities = entities.size();
|
||||
|
|
|
|||
|
|
@ -113,7 +113,7 @@ static void SelectSplitPlaneNum( const node_t *node, const facelist_t& list, int
|
|||
//Base score = 20000 perfectly balanced
|
||||
value = 20000 - ( abs( front - back ) );
|
||||
value -= plane.counter; // If we've already used this plane sometime in the past try not to use it again
|
||||
value -= facing ; // if we're going to have alot of other surfs use this plane, we want to get it in quickly.
|
||||
value -= facing; // if we're going to have alot of other surfs use this plane, we want to get it in quickly.
|
||||
value -= splits * 5; //more splits = bad
|
||||
value += sizeBias * 10; //We want a huge score bias based on plane size
|
||||
}
|
||||
|
|
|
|||
|
|
@ -73,13 +73,13 @@ void SplitMeshByPlane( mesh_t *in, const Plane3f& plane, mesh_t **front, mesh_t
|
|||
float frac;
|
||||
int frontAprox, backAprox;
|
||||
|
||||
for ( i = 0 ; i < 2 ; i++ ) {
|
||||
for ( i = 0; i < 2; ++i ) {
|
||||
dv = in->verts;
|
||||
c_front = 0;
|
||||
c_back = 0;
|
||||
c_on = 0;
|
||||
for ( h = 0 ; h < in->height ; h++ ) {
|
||||
for ( w = 0 ; w < in->width ; w++, dv++ ) {
|
||||
for ( h = 0; h < in->height; ++h ) {
|
||||
for ( w = 0; w < in->width; ++w, ++dv ) {
|
||||
d[h][w] = plane3_distance_to_point( plane, dv->xyz );
|
||||
if ( d[h][w] > ON_EPSILON ) {
|
||||
c_front++;
|
||||
|
|
@ -107,7 +107,7 @@ void SplitMeshByPlane( mesh_t *in, const Plane3f& plane, mesh_t **front, mesh_t
|
|||
|
||||
// find a split point
|
||||
split = -1;
|
||||
for ( w = 0 ; w < in->width - 1 ; w++ ) {
|
||||
for ( w = 0; w < in->width - 1; ++w ) {
|
||||
if ( ( d[0][w] < 0 ) != ( d[0][w + 1] < 0 ) ) {
|
||||
if ( split == -1 ) {
|
||||
split = w;
|
||||
|
|
@ -129,8 +129,8 @@ void SplitMeshByPlane( mesh_t *in, const Plane3f& plane, mesh_t **front, mesh_t
|
|||
}
|
||||
|
||||
// make sure the split point stays the same for all other rows
|
||||
for ( h = 1 ; h < in->height ; h++ ) {
|
||||
for ( w = 0 ; w < in->width - 1 ; w++ ) {
|
||||
for ( h = 1; h < in->height; ++h ) {
|
||||
for ( w = 0; w < in->width - 1; ++w ) {
|
||||
if ( ( d[h][w] < 0 ) != ( d[h][w + 1] < 0 ) ) {
|
||||
if ( w != split ) {
|
||||
Sys_Printf( "multiple crossing points for patch -- can't clip\n" );
|
||||
|
|
@ -191,8 +191,8 @@ void SplitMeshByPlane( mesh_t *in, const Plane3f& plane, mesh_t **front, mesh_t
|
|||
}
|
||||
|
||||
// distribute the points
|
||||
for ( w = 0 ; w < in->width ; w++ ) {
|
||||
for ( h = 0 ; h < in->height ; h++ ) {
|
||||
for ( w = 0; w < in->width; ++w ) {
|
||||
for ( h = 0; h < in->height; ++h ) {
|
||||
if ( w <= split ) {
|
||||
f->verts[ h * f->width + w ] = in->verts[ h * in->width + w ];
|
||||
}
|
||||
|
|
@ -257,14 +257,14 @@ bool ChopPatchSurfaceByBrush( entity_t *e, mapDrawSurface_t *ds, const brush_t *
|
|||
// only split by the top and bottom planes to avoid
|
||||
// some messy patch clipping issues
|
||||
|
||||
for ( i = 4 ; i <= 5 ; i++ ) {
|
||||
for ( i = 4; i <= 5; ++i ) {
|
||||
const plane_t& plane = mapplanes[ b->sides[ i ].planenum ];
|
||||
|
||||
SplitMeshByPlane( m, plane.plane, &front, &back );
|
||||
|
||||
if ( !back ) {
|
||||
// nothing actually contained inside
|
||||
for ( j = 0 ; j < numOutside ; j++ ) {
|
||||
for ( j = 0; j < numOutside; ++j ) {
|
||||
FreeMesh( outside[j] );
|
||||
}
|
||||
return false;
|
||||
|
|
|
|||
|
|
@ -1961,7 +1961,7 @@ static void FindOutLightmaps( rawLightmap_t *lm, bool fastAllocate ){
|
|||
else{
|
||||
i = ( ( numOutLightmaps - LIGHTMAP_RESERVE_COUNT ) / lightmapSearchBlockSize ) * lightmapSearchBlockSize;
|
||||
}
|
||||
for ( ; i < numOutLightmaps; i++ )
|
||||
for ( ; i < numOutLightmaps; ++i )
|
||||
{
|
||||
/* get the output lightmap */
|
||||
olm = &outLightmaps[ i ];
|
||||
|
|
|
|||
|
|
@ -854,7 +854,7 @@ std::array<Vector3, 2> TextureAxisFromPlane( const plane_t& plane ){
|
|||
float best = 0;
|
||||
int bestaxis = 0;
|
||||
|
||||
for ( int i = 0 ; i < 6 ; i++ )
|
||||
for ( int i = 0; i < 6; ++i )
|
||||
{
|
||||
const float dot = vector3_dot( plane.normal(), baseaxis[i * 3] );
|
||||
if ( dot > best + 0.0001f ) { /* ydnar: bug 637 fix, suggested by jmonroe */
|
||||
|
|
@ -889,16 +889,16 @@ void QuakeTextureVecs( const plane_t& plane, float shift[ 2 ], float rotate, flo
|
|||
|
||||
// rotate axis
|
||||
if ( rotate == 0 ) {
|
||||
sinv = 0 ; cosv = 1;
|
||||
sinv = 0; cosv = 1;
|
||||
}
|
||||
else if ( rotate == 90 ) {
|
||||
sinv = 1 ; cosv = 0;
|
||||
sinv = 1; cosv = 0;
|
||||
}
|
||||
else if ( rotate == 180 ) {
|
||||
sinv = 0 ; cosv = -1;
|
||||
sinv = 0; cosv = -1;
|
||||
}
|
||||
else if ( rotate == 270 ) {
|
||||
sinv = -1 ; cosv = 0;
|
||||
sinv = -1; cosv = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -927,7 +927,7 @@ void QuakeTextureVecs( const plane_t& plane, float shift[ 2 ], float rotate, flo
|
|||
tv = 2;
|
||||
}
|
||||
|
||||
for ( int i = 0 ; i < 2 ; i++ ) {
|
||||
for ( int i = 0; i < 2; ++i ) {
|
||||
const float ns = cosv * vecs[i][sv] - sinv * vecs[i][tv];
|
||||
const float nt = sinv * vecs[i][sv] + cosv * vecs[i][tv];
|
||||
vecs[i][sv] = ns;
|
||||
|
|
@ -1244,7 +1244,7 @@ void MoveBrushesToWorld( entity_t *ent ){
|
|||
/* move patches */
|
||||
if ( ent->patches != NULL ) {
|
||||
parseMesh_t *pm;
|
||||
for ( pm = ent->patches; pm->next != NULL; pm = pm->next ) ;
|
||||
for ( pm = ent->patches; pm->next != NULL; pm = pm->next ){};
|
||||
|
||||
pm->next = entities[ 0 ].patches;
|
||||
entities[ 0 ].patches = ent->patches;
|
||||
|
|
@ -1683,7 +1683,7 @@ void LoadMapFile( const char *filename, bool onlyLights, bool noCollapseGroups )
|
|||
buildBrush.sides.reserve( MAX_BUILD_SIDES );
|
||||
|
||||
/* parse the map file */
|
||||
while ( ParseMapEntity( onlyLights, noCollapseGroups ) ) ;
|
||||
while ( ParseMapEntity( onlyLights, noCollapseGroups ) ){};
|
||||
|
||||
/* light loading */
|
||||
if ( onlyLights ) {
|
||||
|
|
|
|||
|
|
@ -173,7 +173,7 @@ void MakeMeshNormals( mesh_t in ){
|
|||
|
||||
|
||||
wrapWidth = false;
|
||||
for ( i = 0 ; i < in.height ; i++ ) {
|
||||
for ( i = 0; i < in.height; ++i ) {
|
||||
if ( vector3_length( in.verts[i * in.width].xyz - in.verts[i * in.width + in.width - 1].xyz ) > 1.0 ) {
|
||||
break;
|
||||
}
|
||||
|
|
@ -183,7 +183,7 @@ void MakeMeshNormals( mesh_t in ){
|
|||
}
|
||||
|
||||
wrapHeight = false;
|
||||
for ( i = 0 ; i < in.width ; i++ ) {
|
||||
for ( i = 0; i < in.width; ++i ) {
|
||||
if ( vector3_length( in.verts[i].xyz - in.verts[i + ( in.height - 1 ) * in.width].xyz ) > 1.0 ) {
|
||||
break;
|
||||
}
|
||||
|
|
@ -193,16 +193,16 @@ void MakeMeshNormals( mesh_t in ){
|
|||
}
|
||||
|
||||
|
||||
for ( i = 0 ; i < in.width ; i++ ) {
|
||||
for ( j = 0 ; j < in.height ; j++ ) {
|
||||
for ( i = 0; i < in.width; ++i ) {
|
||||
for ( j = 0; j < in.height; ++j ) {
|
||||
count = 0;
|
||||
dv = &in.verts[j * in.width + i];
|
||||
const Vector3 base( dv->xyz );
|
||||
for ( k = 0 ; k < 8 ; k++ ) {
|
||||
for ( k = 0; k < 8; ++k ) {
|
||||
around[k].set( 0 );
|
||||
good[k] = false;
|
||||
|
||||
for ( dist = 1 ; dist <= 3 ; dist++ ) {
|
||||
for ( dist = 1; dist <= 3; ++dist ) {
|
||||
x = i + neighbors[k][0] * dist;
|
||||
y = j + neighbors[k][1] * dist;
|
||||
if ( wrapWidth ) {
|
||||
|
|
@ -238,7 +238,7 @@ void MakeMeshNormals( mesh_t in ){
|
|||
}
|
||||
|
||||
Vector3 sum( 0 );
|
||||
for ( k = 0 ; k < 8 ; k++ ) {
|
||||
for ( k = 0; k < 8; ++k ) {
|
||||
if ( !good[k] || !good[( k + 1 ) & 7] ) {
|
||||
continue; // didn't get two points
|
||||
}
|
||||
|
|
@ -320,16 +320,16 @@ mesh_t *SubdivideMesh( mesh_t in, float maxError, float minLength ){
|
|||
out.width = in.width;
|
||||
out.height = in.height;
|
||||
|
||||
for ( i = 0 ; i < in.width ; i++ ) {
|
||||
for ( j = 0 ; j < in.height ; j++ ) {
|
||||
for ( i = 0; i < in.width; ++i ) {
|
||||
for ( j = 0; j < in.height; ++j ) {
|
||||
expand[j][i] = in.verts[j * in.width + i];
|
||||
}
|
||||
}
|
||||
|
||||
// horizontal subdivisions
|
||||
for ( j = 0 ; j + 2 < out.width ; j += 2 ) {
|
||||
for ( j = 0; j + 2 < out.width; j += 2 ) {
|
||||
// check subdivided midpoints against control points
|
||||
for ( i = 0 ; i < out.height ; i++ ) {
|
||||
for ( i = 0; i < out.height; ++i ) {
|
||||
prevxyz = expand[i][j + 1].xyz - expand[i][j].xyz;
|
||||
nextxyz = expand[i][j + 2].xyz - expand[i][j + 1].xyz;
|
||||
midxyz = ( expand[i][j].xyz + expand[i][j + 1].xyz * 2 + expand[i][j + 2].xyz ) * 0.25;
|
||||
|
|
@ -357,12 +357,12 @@ mesh_t *SubdivideMesh( mesh_t in, float maxError, float minLength ){
|
|||
// insert two columns and replace the peak
|
||||
out.width += 2;
|
||||
|
||||
for ( i = 0 ; i < out.height ; i++ ) {
|
||||
for ( i = 0; i < out.height; ++i ) {
|
||||
LerpDrawVert( &expand[i][j], &expand[i][j + 1], &prev );
|
||||
LerpDrawVert( &expand[i][j + 1], &expand[i][j + 2], &next );
|
||||
LerpDrawVert( &prev, &next, &mid );
|
||||
|
||||
for ( k = out.width - 1 ; k > j + 3 ; k-- ) {
|
||||
for ( k = out.width - 1; k > j + 3; --k ) {
|
||||
expand[i][k] = expand[i][k - 2];
|
||||
}
|
||||
expand[i][j + 1] = prev;
|
||||
|
|
@ -376,9 +376,9 @@ mesh_t *SubdivideMesh( mesh_t in, float maxError, float minLength ){
|
|||
}
|
||||
|
||||
// vertical subdivisions
|
||||
for ( j = 0 ; j + 2 < out.height ; j += 2 ) {
|
||||
for ( j = 0; j + 2 < out.height; j += 2 ) {
|
||||
// check subdivided midpoints against control points
|
||||
for ( i = 0 ; i < out.width ; i++ ) {
|
||||
for ( i = 0; i < out.width; ++i ) {
|
||||
prevxyz = expand[j + 1][i].xyz - expand[j][i].xyz;
|
||||
nextxyz = expand[j + 2][i].xyz - expand[j + 1][i].xyz;
|
||||
midxyz = ( expand[j][i].xyz + expand[j + 1][i].xyz * 2 + expand[j + 2][i].xyz ) * 0.25;
|
||||
|
|
@ -405,12 +405,12 @@ mesh_t *SubdivideMesh( mesh_t in, float maxError, float minLength ){
|
|||
// insert two columns and replace the peak
|
||||
out.height += 2;
|
||||
|
||||
for ( i = 0 ; i < out.width ; i++ ) {
|
||||
for ( i = 0; i < out.width; ++i ) {
|
||||
LerpDrawVert( &expand[j][i], &expand[j + 1][i], &prev );
|
||||
LerpDrawVert( &expand[j + 1][i], &expand[j + 2][i], &next );
|
||||
LerpDrawVert( &prev, &next, &mid );
|
||||
|
||||
for ( k = out.height - 1 ; k > j + 3 ; k-- ) {
|
||||
for ( k = out.height - 1; k > j + 3; --k ) {
|
||||
expand[k][i] = expand[k - 2][i];
|
||||
}
|
||||
expand[j + 1][i] = prev;
|
||||
|
|
@ -426,7 +426,7 @@ mesh_t *SubdivideMesh( mesh_t in, float maxError, float minLength ){
|
|||
// collapse the verts
|
||||
|
||||
out.verts = &expand[0][0];
|
||||
for ( i = 1 ; i < out.height ; i++ ) {
|
||||
for ( i = 1; i < out.height; ++i ) {
|
||||
memmove( &out.verts[i * out.width], expand[i], out.width * sizeof( bspDrawVert_t ) );
|
||||
}
|
||||
|
||||
|
|
@ -482,7 +482,7 @@ mesh_t *SubdivideMesh2( mesh_t in, int iterations ){
|
|||
}
|
||||
|
||||
/* keep chopping */
|
||||
for ( ; iterations > 0; iterations-- )
|
||||
for ( ; iterations > 0; --iterations )
|
||||
{
|
||||
/* horizontal subdivisions */
|
||||
for ( j = 0; j + 2 < out.width; j += 4 )
|
||||
|
|
@ -500,7 +500,7 @@ mesh_t *SubdivideMesh2( mesh_t in, int iterations ){
|
|||
LerpDrawVert( &expand[ i ][ j + 1 ], &expand[ i ][ j + 2 ], &next );
|
||||
LerpDrawVert( &prev, &next, &mid );
|
||||
|
||||
for ( k = out.width - 1 ; k > j + 3; k-- )
|
||||
for ( k = out.width - 1; k > j + 3; --k )
|
||||
expand [ i ][ k ] = expand[ i ][ k - 2 ];
|
||||
expand[ i ][ j + 1 ] = prev;
|
||||
expand[ i ][ j + 2 ] = mid;
|
||||
|
|
@ -576,35 +576,35 @@ mesh_t *RemoveLinearMeshColumnsRows( mesh_t *in ) {
|
|||
out.width = in->width;
|
||||
out.height = in->height;
|
||||
|
||||
for ( i = 0 ; i < in->width ; i++ ) {
|
||||
for ( j = 0 ; j < in->height ; j++ ) {
|
||||
for ( i = 0; i < in->width; ++i ) {
|
||||
for ( j = 0; j < in->height; ++j ) {
|
||||
expand[j][i] = in->verts[j * in->width + i];
|
||||
}
|
||||
}
|
||||
|
||||
for ( j = 1 ; j < out.width - 1; j++ ) {
|
||||
for ( j = 1; j < out.width - 1; ++j ) {
|
||||
double maxLength = 0;
|
||||
for ( i = 0 ; i < out.height ; i++ ) {
|
||||
for ( i = 0; i < out.height; ++i ) {
|
||||
value_maximize( maxLength, vector3_length( expand[i][j].xyz - ProjectPointOntoVector( expand[i][j].xyz, expand[i][j - 1].xyz, expand[i][j + 1].xyz ) ) );
|
||||
}
|
||||
if ( maxLength < 0.1 ) {
|
||||
out.width--;
|
||||
for ( i = 0 ; i < out.height ; i++ ) {
|
||||
for ( k = j; k < out.width; k++ ) {
|
||||
for ( i = 0; i < out.height; ++i ) {
|
||||
for ( k = j; k < out.width; ++k ) {
|
||||
expand[i][k] = expand[i][k + 1];
|
||||
}
|
||||
}
|
||||
j--;
|
||||
}
|
||||
}
|
||||
for ( j = 1 ; j < out.height - 1; j++ ) {
|
||||
for ( j = 1; j < out.height - 1; ++j ) {
|
||||
double maxLength = 0;
|
||||
for ( i = 0 ; i < out.width ; i++ ) {
|
||||
for ( i = 0; i < out.width; ++i ) {
|
||||
value_maximize( maxLength, vector3_length( expand[j][i].xyz - ProjectPointOntoVector( expand[j][i].xyz, expand[j - 1][i].xyz, expand[j + 1][i].xyz ) ) );
|
||||
}
|
||||
if ( maxLength < 0.1 ) {
|
||||
out.height--;
|
||||
for ( i = 0 ; i < out.width ; i++ ) {
|
||||
for ( i = 0; i < out.width; ++i ) {
|
||||
for ( k = j; k < out.height; k++ ) {
|
||||
expand[k][i] = expand[k + 1][i];
|
||||
}
|
||||
|
|
@ -614,7 +614,7 @@ mesh_t *RemoveLinearMeshColumnsRows( mesh_t *in ) {
|
|||
}
|
||||
// collapse the verts
|
||||
out.verts = &expand[0][0];
|
||||
for ( i = 1 ; i < out.height ; i++ ) {
|
||||
for ( i = 1; i < out.height; ++i ) {
|
||||
memmove( &out.verts[i * out.width], expand[i], out.width * sizeof( bspDrawVert_t ) );
|
||||
}
|
||||
|
||||
|
|
@ -636,8 +636,8 @@ mesh_t *SubdivideMeshQuads( mesh_t *in, float minLength, int maxsize, int *width
|
|||
out.width = in->width;
|
||||
out.height = in->height;
|
||||
|
||||
for ( i = 0 ; i < in->width ; i++ ) {
|
||||
for ( j = 0 ; j < in->height ; j++ ) {
|
||||
for ( i = 0; i < in->width; ++i ) {
|
||||
for ( j = 0; j < in->height; ++j ) {
|
||||
expand[j][i] = in->verts[j * in->width + i];
|
||||
}
|
||||
}
|
||||
|
|
@ -650,9 +650,9 @@ mesh_t *SubdivideMeshQuads( mesh_t *in, float minLength, int maxsize, int *width
|
|||
|
||||
maxsubdivisions = ( maxsize - in->width ) / ( in->width - 1 );
|
||||
|
||||
for ( w = 0, j = 0 ; w < in->width - 1; w++, j += subdivisions + 1 ) {
|
||||
for ( w = 0, j = 0; w < in->width - 1; ++w, j += subdivisions + 1 ) {
|
||||
double maxLength = 0;
|
||||
for ( i = 0 ; i < out.height ; i++ ) {
|
||||
for ( i = 0; i < out.height; ++i ) {
|
||||
value_maximize( maxLength, vector3_length( expand[i][j + 1].xyz - expand[i][j].xyz ) );
|
||||
}
|
||||
|
||||
|
|
@ -665,11 +665,11 @@ mesh_t *SubdivideMeshQuads( mesh_t *in, float minLength, int maxsize, int *width
|
|||
|
||||
out.width += subdivisions;
|
||||
|
||||
for ( i = 0 ; i < out.height ; i++ ) {
|
||||
for ( k = out.width - 1 ; k > j + subdivisions; k-- ) {
|
||||
for ( i = 0; i < out.height; ++i ) {
|
||||
for ( k = out.width - 1; k > j + subdivisions; --k ) {
|
||||
expand[i][k] = expand[i][k - subdivisions];
|
||||
}
|
||||
for ( k = 1; k <= subdivisions; k++ )
|
||||
for ( k = 1; k <= subdivisions; ++k )
|
||||
{
|
||||
const float amount = (float) k / ( subdivisions + 1 );
|
||||
LerpDrawVertAmount( &expand[i][j], &expand[i][j + subdivisions + 1], amount, &expand[i][j + k] );
|
||||
|
|
@ -679,9 +679,9 @@ mesh_t *SubdivideMeshQuads( mesh_t *in, float minLength, int maxsize, int *width
|
|||
|
||||
maxsubdivisions = ( maxsize - in->height ) / ( in->height - 1 );
|
||||
|
||||
for ( h = 0, j = 0 ; h < in->height - 1; h++, j += subdivisions + 1 ) {
|
||||
for ( h = 0, j = 0; h < in->height - 1; ++h, j += subdivisions + 1 ) {
|
||||
double maxLength = 0;
|
||||
for ( i = 0 ; i < out.width ; i++ ) {
|
||||
for ( i = 0; i < out.width; ++i ) {
|
||||
value_maximize( maxLength, vector3_length( expand[j + 1][i].xyz - expand[j][i].xyz ) );
|
||||
}
|
||||
|
||||
|
|
@ -694,11 +694,11 @@ mesh_t *SubdivideMeshQuads( mesh_t *in, float minLength, int maxsize, int *width
|
|||
|
||||
out.height += subdivisions;
|
||||
|
||||
for ( i = 0 ; i < out.width ; i++ ) {
|
||||
for ( k = out.height - 1 ; k > j + subdivisions; k-- ) {
|
||||
for ( i = 0; i < out.width; ++i ) {
|
||||
for ( k = out.height - 1; k > j + subdivisions; --k ) {
|
||||
expand[k][i] = expand[k - subdivisions][i];
|
||||
}
|
||||
for ( k = 1; k <= subdivisions; k++ )
|
||||
for ( k = 1; k <= subdivisions; ++k )
|
||||
{
|
||||
const float amount = (float) k / ( subdivisions + 1 );
|
||||
LerpDrawVertAmount( &expand[j][i], &expand[j + subdivisions + 1][i], amount, &expand[j + k][i] );
|
||||
|
|
@ -708,7 +708,7 @@ mesh_t *SubdivideMeshQuads( mesh_t *in, float minLength, int maxsize, int *width
|
|||
|
||||
// collapse the verts
|
||||
out.verts = &expand[0][0];
|
||||
for ( i = 1 ; i < out.height ; i++ ) {
|
||||
for ( i = 1; i < out.height; ++i ) {
|
||||
memmove( &out.verts[i * out.width], expand[i], out.width * sizeof( bspDrawVert_t ) );
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -390,7 +390,7 @@ void PatchMapDrawSurfs( entity_t *e ){
|
|||
Sys_FPrintf( SYS_VRB, "--- PatchMapDrawSurfs ---\n" );
|
||||
|
||||
patchCount = 0;
|
||||
for ( pm = e->patches ; pm ; pm = pm->next ) {
|
||||
for ( pm = e->patches; pm; pm = pm->next ) {
|
||||
meshes[patchCount] = pm;
|
||||
patchCount++;
|
||||
}
|
||||
|
|
@ -401,19 +401,19 @@ void PatchMapDrawSurfs( entity_t *e ){
|
|||
bordering = safe_calloc( patchCount * patchCount );
|
||||
|
||||
// build the bordering matrix
|
||||
for ( k = 0 ; k < patchCount ; k++ ) {
|
||||
for ( k = 0; k < patchCount; ++k ) {
|
||||
bordering[k * patchCount + k] = 1;
|
||||
|
||||
for ( l = k + 1 ; l < patchCount ; l++ ) {
|
||||
for ( l = k + 1; l < patchCount; ++l ) {
|
||||
check = meshes[k];
|
||||
scan = meshes[l];
|
||||
c1 = scan->mesh.width * scan->mesh.height;
|
||||
v1 = scan->mesh.verts;
|
||||
|
||||
for ( i = 0 ; i < c1 ; i++, v1++ ) {
|
||||
for ( i = 0; i < c1; ++i, ++v1 ) {
|
||||
c2 = check->mesh.width * check->mesh.height;
|
||||
v2 = check->mesh.verts;
|
||||
for ( j = 0 ; j < c2 ; j++, v2++ ) {
|
||||
for ( j = 0; j < c2; ++j, ++v2 ) {
|
||||
if ( vector3_equal_epsilon( v1->xyz, v2->xyz, 1.f ) ) {
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -167,8 +167,8 @@ void MakeHeadnodePortals( tree_t& tree ){
|
|||
tree.outside_node.portals = NULL;
|
||||
tree.outside_node.opaque = false;
|
||||
|
||||
for ( int i = 0 ; i < 3 ; i++ )
|
||||
for ( int j = 0 ; j < 2 ; j++ )
|
||||
for ( int i = 0; i < 3; ++i )
|
||||
for ( int j = 0; j < 2; ++j )
|
||||
{
|
||||
portal_t *p = portals[j * 3 + i] = AllocPortal();
|
||||
|
||||
|
|
@ -184,9 +184,9 @@ void MakeHeadnodePortals( tree_t& tree ){
|
|||
}
|
||||
|
||||
// clip the basewindings by all the other planes
|
||||
for ( int i = 0 ; i < 6 ; i++ )
|
||||
for ( int i = 0; i < 6; ++i )
|
||||
{
|
||||
for ( int j = 0 ; j < 6 ; j++ )
|
||||
for ( int j = 0; j < 6; ++j )
|
||||
{
|
||||
if ( j == i ) {
|
||||
continue;
|
||||
|
|
|
|||
|
|
@ -156,7 +156,7 @@ int AddEdge( bspDrawVert_t& dv1, bspDrawVert_t& dv2, bool createNonAxial ) {
|
|||
}
|
||||
}
|
||||
|
||||
for ( i = 0 ; i < numEdgeLines ; i++ ) {
|
||||
for ( i = 0; i < numEdgeLines; ++i ) {
|
||||
e = &edgeLines[i];
|
||||
|
||||
if ( !float_equal_epsilon( vector3_dot( v1, e->normal1 ), e->dist1, POINT_ON_LINE_EPSILON )
|
||||
|
|
@ -350,7 +350,7 @@ void FixSurfaceJunctions( mapDrawSurface_t& ds ) {
|
|||
p = e->chain->prev;
|
||||
}
|
||||
|
||||
for ( ; p != e->chain ; ) {
|
||||
for ( ; p != e->chain; ) {
|
||||
if ( start < end ) {
|
||||
if ( p->intercept > end - ON_EPSILON ) {
|
||||
break;
|
||||
|
|
@ -413,7 +413,7 @@ void FixSurfaceJunctions( mapDrawSurface_t& ds ) {
|
|||
|
||||
// rotate the points so that the initial vertex is between
|
||||
// two non-subdivided edges
|
||||
for ( i = 0 ; i < numVerts ; i++ ) {
|
||||
for ( i = 0; i < numVerts; ++i ) {
|
||||
if ( originals[ ( i + 1 ) % numVerts ] == originals[ i ] ) {
|
||||
continue;
|
||||
}
|
||||
|
|
@ -441,12 +441,12 @@ void FixSurfaceJunctions( mapDrawSurface_t& ds ) {
|
|||
|
||||
/*
|
||||
memset ( &verts[numVerts], 0, sizeof( verts[numVerts] ) );
|
||||
for ( i = 0 ; i < numVerts ; i++ ) {
|
||||
for ( j = 0 ; j < 10 ; j++ ) {
|
||||
for ( i = 0; i < numVerts; ++i ) {
|
||||
for ( j = 0; j < 10; ++j ) {
|
||||
verts[numVerts].xyz[j] += verts[i].xyz[j];
|
||||
}
|
||||
}
|
||||
for ( j = 0 ; j < 10 ; j++ ) {
|
||||
for ( j = 0; j < 10; ++j ) {
|
||||
verts[numVerts].xyz[j] /= numVerts;
|
||||
}
|
||||
|
||||
|
|
@ -463,7 +463,7 @@ void FixSurfaceJunctions( mapDrawSurface_t& ds ) {
|
|||
ds.numVerts = numVerts;
|
||||
ds.verts = safe_malloc( numVerts * sizeof( *ds.verts ) );
|
||||
|
||||
for ( j = 0 ; j < ds.numVerts ; j++ ) {
|
||||
for ( j = 0; j < ds.numVerts; ++j ) {
|
||||
ds.verts[j] = verts[ ( j + i ) % ds.numVerts ];
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -300,7 +300,7 @@ void CalcVis( void ){
|
|||
// assemble the leaf vis lists by oring and compressing the portal lists
|
||||
//
|
||||
Sys_Printf( "creating leaf vis...\n" );
|
||||
for ( i = 0 ; i < portalclusters ; i++ )
|
||||
for ( i = 0; i < portalclusters; ++i )
|
||||
ClusterMerge( i );
|
||||
|
||||
totalvis = 0;
|
||||
|
|
@ -582,7 +582,7 @@ fixedWinding_t *TryMergeWinding( fixedWinding_t *f1, fixedWinding_t *f2, const V
|
|||
newf = NewFixedWinding( f1->numpoints + f2->numpoints );
|
||||
|
||||
// copy first polygon
|
||||
for ( k = ( i + 1 ) % f1->numpoints ; k != i ; k = ( k + 1 ) % f1->numpoints )
|
||||
for ( k = ( i + 1 ) % f1->numpoints; k != i; k = ( k + 1 ) % f1->numpoints )
|
||||
{
|
||||
if ( k == ( i + 1 ) % f1->numpoints && !keep2 ) {
|
||||
continue;
|
||||
|
|
@ -593,7 +593,7 @@ fixedWinding_t *TryMergeWinding( fixedWinding_t *f1, fixedWinding_t *f2, const V
|
|||
}
|
||||
|
||||
// copy second polygon
|
||||
for ( l = ( j + 1 ) % f2->numpoints ; l != j ; l = ( l + 1 ) % f2->numpoints )
|
||||
for ( l = ( j + 1 ) % f2->numpoints; l != j; l = ( l + 1 ) % f2->numpoints )
|
||||
{
|
||||
if ( l == ( j + 1 ) % f2->numpoints && !keep1 ) {
|
||||
continue;
|
||||
|
|
|
|||
|
|
@ -125,7 +125,7 @@ fixedWinding_t *VisChopWinding( fixedWinding_t *in, pstack_t *stack, const visP
|
|||
counts[0] = counts[1] = counts[2] = 0;
|
||||
|
||||
// determine sides for each point
|
||||
for ( i = 0 ; i < in->numpoints ; i++ )
|
||||
for ( i = 0; i < in->numpoints; ++i )
|
||||
{
|
||||
dists[i] = plane3_distance_to_point( split, in->points[i] );
|
||||
if ( dists[i] > ON_EPSILON ) {
|
||||
|
|
@ -157,7 +157,7 @@ fixedWinding_t *VisChopWinding( fixedWinding_t *in, pstack_t *stack, const visP
|
|||
|
||||
neww->numpoints = 0;
|
||||
|
||||
for ( i = 0 ; i < in->numpoints ; i++ )
|
||||
for ( i = 0; i < in->numpoints; ++i )
|
||||
{
|
||||
const Vector3& p1 = in->points[i];
|
||||
|
||||
|
|
@ -190,7 +190,7 @@ fixedWinding_t *VisChopWinding( fixedWinding_t *in, pstack_t *stack, const visP
|
|||
const Vector3& p2 = in->points[( i + 1 ) % in->numpoints];
|
||||
|
||||
dot = dists[i] / ( dists[i] - dists[i + 1] );
|
||||
for ( j = 0 ; j < 3 ; j++ )
|
||||
for ( j = 0; j < 3; ++j )
|
||||
{ // avoid round off error when possible
|
||||
if ( split.normal()[j] == 1 ) {
|
||||
mid[j] = split.dist();
|
||||
|
|
@ -236,14 +236,14 @@ fixedWinding_t *ClipToSeperators( fixedWinding_t *source, fixedWinding_t *pass,
|
|||
bool fliptest;
|
||||
|
||||
// check all combinations
|
||||
for ( i = 0 ; i < source->numpoints ; i++ )
|
||||
for ( i = 0; i < source->numpoints; ++i )
|
||||
{
|
||||
l = ( i + 1 ) % source->numpoints;
|
||||
|
||||
// find a vertex of pass that makes a plane that puts all of the
|
||||
// vertexes of pass on the front side and all of the vertexes of
|
||||
// source on the back side
|
||||
for ( j = 0 ; j < pass->numpoints ; j++ )
|
||||
for ( j = 0; j < pass->numpoints; ++j )
|
||||
{
|
||||
visPlane_t plane;
|
||||
// if points don't make a valid plane, skip it
|
||||
|
|
@ -257,7 +257,7 @@ fixedWinding_t *ClipToSeperators( fixedWinding_t *source, fixedWinding_t *pass,
|
|||
//
|
||||
#if 1
|
||||
fliptest = false;
|
||||
for ( k = 0 ; k < source->numpoints ; k++ )
|
||||
for ( k = 0; k < source->numpoints; ++k )
|
||||
{
|
||||
if ( k == i || k == l ) {
|
||||
continue;
|
||||
|
|
@ -292,7 +292,7 @@ fixedWinding_t *ClipToSeperators( fixedWinding_t *source, fixedWinding_t *pass,
|
|||
// this is the separating plane
|
||||
//
|
||||
counts[0] = counts[1] = counts[2] = 0;
|
||||
for ( k = 0 ; k < pass->numpoints ; k++ )
|
||||
for ( k = 0; k < pass->numpoints; ++k )
|
||||
{
|
||||
if ( k == j ) {
|
||||
continue;
|
||||
|
|
@ -444,7 +444,7 @@ void RecursiveLeafFlow( int leafnum, threaddata_t *thread, pstack_t *prevstack )
|
|||
|
||||
more = 0;
|
||||
prevmight = (long *)prevstack->mightsee;
|
||||
for ( j = 0 ; j < portallongs ; j++ )
|
||||
for ( j = 0; j < portallongs; ++j )
|
||||
{
|
||||
might[j] = prevmight[j] & test[j];
|
||||
more |= ( might[j] & ~vis[j] );
|
||||
|
|
@ -618,7 +618,7 @@ void PortalFlow( int portalnum ){
|
|||
data.pstack_head.source = p->winding;
|
||||
data.pstack_head.portalplane = p->plane;
|
||||
data.pstack_head.depth = 0;
|
||||
for ( i = 0 ; i < portallongs ; i++ )
|
||||
for ( i = 0; i < portallongs; ++i )
|
||||
( (long *)data.pstack_head.mightsee )[i] = ( (long *)p->portalflood )[i];
|
||||
|
||||
RecursiveLeafFlow( p->leaf, &data, &data.pstack_head );
|
||||
|
|
@ -743,7 +743,7 @@ void PassageFlow( int portalnum ){
|
|||
data.pstack_head.source = p->winding;
|
||||
data.pstack_head.portalplane = p->plane;
|
||||
data.pstack_head.depth = 0;
|
||||
for ( i = 0 ; i < portallongs ; i++ )
|
||||
for ( i = 0; i < portallongs; ++i )
|
||||
( (long *)data.pstack_head.mightsee )[i] = ( (long *)p->portalflood )[i];
|
||||
|
||||
RecursivePassageFlow( p, &data, &data.pstack_head );
|
||||
|
|
@ -998,7 +998,7 @@ void PassagePortalFlow( int portalnum ){
|
|||
data.pstack_head.source = p->winding;
|
||||
data.pstack_head.portalplane = p->plane;
|
||||
data.pstack_head.depth = 0;
|
||||
for ( i = 0 ; i < portallongs ; i++ )
|
||||
for ( i = 0; i < portallongs; ++i )
|
||||
( (long *)data.pstack_head.mightsee )[i] = ( (long *)p->portalflood )[i];
|
||||
|
||||
RecursivePassagePortalFlow( p, &data, &data.pstack_head );
|
||||
|
|
@ -1025,7 +1025,7 @@ fixedWinding_t *PassageChopWinding( fixedWinding_t *in, fixedWinding_t *out, con
|
|||
counts[0] = counts[1] = counts[2] = 0;
|
||||
|
||||
// determine sides for each point
|
||||
for ( i = 0 ; i < in->numpoints ; i++ )
|
||||
for ( i = 0; i < in->numpoints; ++i )
|
||||
{
|
||||
dists[i] = plane3_distance_to_point( split, in->points[i] );
|
||||
if ( dists[i] > ON_EPSILON ) {
|
||||
|
|
@ -1056,7 +1056,7 @@ fixedWinding_t *PassageChopWinding( fixedWinding_t *in, fixedWinding_t *out, con
|
|||
|
||||
neww->numpoints = 0;
|
||||
|
||||
for ( i = 0 ; i < in->numpoints ; i++ )
|
||||
for ( i = 0; i < in->numpoints; ++i )
|
||||
{
|
||||
const Vector3& p1 = in->points[i];
|
||||
|
||||
|
|
@ -1087,7 +1087,7 @@ fixedWinding_t *PassageChopWinding( fixedWinding_t *in, fixedWinding_t *out, con
|
|||
const Vector3& p2 = in->points[( i + 1 ) % in->numpoints];
|
||||
|
||||
dot = dists[i] / ( dists[i] - dists[i + 1] );
|
||||
for ( j = 0 ; j < 3 ; j++ )
|
||||
for ( j = 0; j < 3; ++j )
|
||||
{ // avoid round off error when possible
|
||||
if ( split.normal()[j] == 1 ) {
|
||||
mid[j] = split.dist();
|
||||
|
|
@ -1119,14 +1119,14 @@ int AddSeperators( const fixedWinding_t *source, const fixedWinding_t *pass, boo
|
|||
|
||||
numseperators = 0;
|
||||
// check all combinations
|
||||
for ( i = 0 ; i < source->numpoints ; i++ )
|
||||
for ( i = 0; i < source->numpoints; ++i )
|
||||
{
|
||||
l = ( i + 1 ) % source->numpoints;
|
||||
|
||||
// find a vertex of pass that makes a plane that puts all of the
|
||||
// vertexes of pass on the front side and all of the vertexes of
|
||||
// source on the back side
|
||||
for ( j = 0 ; j < pass->numpoints ; j++ )
|
||||
for ( j = 0; j < pass->numpoints; ++j )
|
||||
{
|
||||
visPlane_t plane;
|
||||
// if points don't make a valid plane, skip it
|
||||
|
|
@ -1140,7 +1140,7 @@ int AddSeperators( const fixedWinding_t *source, const fixedWinding_t *pass, boo
|
|||
//
|
||||
#if 1
|
||||
fliptest = false;
|
||||
for ( k = 0 ; k < source->numpoints ; k++ )
|
||||
for ( k = 0; k < source->numpoints; ++k )
|
||||
{
|
||||
if ( k == i || k == l ) {
|
||||
continue;
|
||||
|
|
@ -1175,7 +1175,7 @@ int AddSeperators( const fixedWinding_t *source, const fixedWinding_t *pass, boo
|
|||
// this is the separating plane
|
||||
//
|
||||
counts[0] = counts[1] = counts[2] = 0;
|
||||
for ( k = 0 ; k < pass->numpoints ; k++ )
|
||||
for ( k = 0; k < pass->numpoints; ++k )
|
||||
{
|
||||
if ( k == j ) {
|
||||
continue;
|
||||
|
|
@ -1465,7 +1465,7 @@ void BasePortalVis( int portalnum ){
|
|||
p->portalflood = safe_calloc( portalbytes );
|
||||
p->portalvis = safe_calloc( portalbytes );
|
||||
|
||||
for ( j = 0, tp = portals ; j < numportals * 2 ; j++, tp++ )
|
||||
for ( j = 0, tp = portals; j < numportals * 2; ++j, ++tp )
|
||||
{
|
||||
if ( j == portalnum ) {
|
||||
continue;
|
||||
|
|
@ -1507,7 +1507,7 @@ void BasePortalVis( int portalnum ){
|
|||
|
||||
|
||||
w = tp->winding;
|
||||
for ( k = 0 ; k < w->numpoints ; k++ )
|
||||
for ( k = 0; k < w->numpoints; ++k )
|
||||
{
|
||||
if ( plane3_distance_to_point( p->plane, w->points[k] ) > ON_EPSILON ) {
|
||||
break;
|
||||
|
|
@ -1518,7 +1518,7 @@ void BasePortalVis( int portalnum ){
|
|||
|
||||
}
|
||||
w = p->winding;
|
||||
for ( k = 0 ; k < w->numpoints ; k++ )
|
||||
for ( k = 0; k < w->numpoints; ++k )
|
||||
{
|
||||
if ( plane3_distance_to_point( tp->plane, w->points[k] ) < -ON_EPSILON ) {
|
||||
break;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user