must be within an epsilon distance of the plane
*/
-int FindFloatPlane( vec3_t normal, vec_t dist, int numPoints, vec3_t *points ) // NOTE: this has a side effect on the normal. Good or bad?
+int FindFloatPlane( vec3_t innormal, vec_t dist, int numPoints, vec3_t *points ) // NOTE: this has a side effect on the normal. Good or bad?
#ifdef USE_HASHING
plane_t *p;
vec_t d;
vec3_t centerofweight;
+ vec3_t normal;
VectorClear(centerofweight);
for(i = 0; i < numPoints; ++i)
VectorMA(centerofweight, 1.0 / numPoints, points[i], centerofweight);
/* hash the plane */
+ VectorCopy(innormal, normal);
SnapPlane( normal, &dist, centerofweight );
hash = (PLANE_HASHES - 1) & (int) fabs( dist );
{
int i;
plane_t *p;
+ vec3_t normal;
vec3_t centerofweight;
for(i = 0; i < numPoints; ++i)
VectorMA(centerofweight, 1.0 / numPoints, points[i], centerofweight);
+ VectorCopy(innormal, normal);
SnapPlane( normal, &dist, centerofweight );
for( i = 0, p = mapplanes; i < nummapplanes; i++, p++ )
{
continue;
if( s->contentFlags != contentFlags || s->compileFlags != compileFlags )
mixed = qtrue;
+
+ contentFlags |= s->contentFlags;
+ compileFlags |= s->compileFlags;
}
/* ydnar: getting rid of this stupid warning */
SetKeyValue(ent, "origin", string);
}
-brush_t *FinishBrush( void )
+brush_t *FinishBrush( qboolean noCollapseGroups )
{
brush_t *b;
}
/* add bevel planes */
- AddBrushBevels();
+ if(!noCollapseGroups)
+ AddBrushBevels();
/* keep it */
b = CopyBrush( buildBrush );
int planenum;
shaderInfo_t *si;
vec_t shift[ 2 ];
- vec_t rotate;
+ vec_t rotate = 0;
vec_t scale[ 2 ];
char name[ MAX_QPATH ];
char shader[ MAX_QPATH ];
parses a brush out of a map file and sets it up
*/
-static void ParseBrush( qboolean onlyLights )
+static void ParseBrush( qboolean onlyLights, qboolean noCollapseGroups )
{
brush_t *b;
}
/* finish the brush */
- b = FinishBrush();
+ b = FinishBrush(noCollapseGroups);
}
parses a single entity out of a map file
*/
-static qboolean ParseMapEntity( qboolean onlyLights )
+static qboolean ParseMapEntity( qboolean onlyLights, qboolean noCollapseGroups )
{
epair_t *ep;
const char *classname, *value;
g_bBrushPrimit = BPRIMIT_NEWBRUSHES;
/* parse brush primitive */
- ParseBrush( onlyLights );
+ ParseBrush( onlyLights, noCollapseGroups );
}
else
{
/* parse old brush format */
UnGetToken();
- ParseBrush( onlyLights );
+ ParseBrush( onlyLights, noCollapseGroups );
}
entitySourceBrushes++;
}
value = ValueForKey( &entities[ 0 ], "_celshader" );
if( value[ 0 ] != '\0' )
{
- sprintf( shader, "textures/%s", value );
- celShader = ShaderInfoForShader( shader );
- Sys_Printf( "Entity %d (%s) has cel shader %s\n", mapEnt->mapEntityNum, classname, celShader->shader );
+ if(strcmp(value, "none"))
+ {
+ sprintf( shader, "textures/%s", value );
+ celShader = ShaderInfoForShader( shader );
+ Sys_Printf( "Entity %d (%s) has cel shader %s\n", mapEnt->mapEntityNum, classname, celShader->shader );
+ }
+ else
+ {
+ celShader = NULL;
+ }
}
else
- celShader = *globalCelShader ? ShaderInfoForShader(globalCelShader) : NULL;
+ celShader = (*globalCelShader ? ShaderInfoForShader(globalCelShader) : NULL);
/* jal : entity based _shadeangle */
shadeAngle = 0.0f;
AdjustBrushesForOrigin( mapEnt );
/* group_info entities are just for editor grouping (fixme: leak!) */
- if( !Q_stricmp( "group_info", classname ) )
+ if( !noCollapseGroups && !Q_stricmp( "group_info", classname ) )
{
numEntities--;
return qtrue;
}
/* group entities are just for editor convenience, toss all brushes into worldspawn */
- if( funcGroup )
+ if( !noCollapseGroups && funcGroup )
{
MoveBrushesToWorld( mapEnt );
numEntities--;
loads a map file into a list of entities
*/
-void LoadMapFile( char *filename, qboolean onlyLights )
+void LoadMapFile( char *filename, qboolean onlyLights, qboolean noCollapseGroups )
{
FILE *file;
brush_t *b;
- int oldNumEntities, numMapBrushes;
+ int oldNumEntities = 0, numMapBrushes;
/* note it */
buildBrush = AllocBrush( MAX_BUILD_SIDES );
/* parse the map file */
- while( ParseMapEntity( onlyLights ) );
+ while( ParseMapEntity( onlyLights, noCollapseGroups ) );
/* light loading */
if( onlyLights )