fix the build
This commit is contained in:
parent
aa110638d4
commit
d75792d9a9
|
|
@ -484,7 +484,7 @@ static int FilterBrushIntoTree_r( brush_t&& b, node_t *node ){
|
||||||
fragment all the detail brushes into the structural leafs
|
fragment all the detail brushes into the structural leafs
|
||||||
*/
|
*/
|
||||||
|
|
||||||
void FilterDetailBrushesIntoTree( entity_t *e, tree_t& tree ){
|
void FilterDetailBrushesIntoTree( const entity_t& e, tree_t& tree ){
|
||||||
int c_unique = 0, c_clusters = 0;
|
int c_unique = 0, c_clusters = 0;
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -494,7 +494,7 @@ void FilterDetailBrushesIntoTree( entity_t *e, tree_t& tree ){
|
||||||
/* walk the list of brushes */
|
/* walk the list of brushes */
|
||||||
c_unique = 0;
|
c_unique = 0;
|
||||||
c_clusters = 0;
|
c_clusters = 0;
|
||||||
for ( brush_t& b : e->brushes )
|
for ( const brush_t& b : e.brushes )
|
||||||
{
|
{
|
||||||
if ( !b.detail ) {
|
if ( !b.detail ) {
|
||||||
continue;
|
continue;
|
||||||
|
|
@ -515,12 +515,12 @@ void FilterDetailBrushesIntoTree( entity_t *e, tree_t& tree ){
|
||||||
Mark the leafs as opaque and areaportals
|
Mark the leafs as opaque and areaportals
|
||||||
=====================
|
=====================
|
||||||
*/
|
*/
|
||||||
void FilterStructuralBrushesIntoTree( entity_t *e, tree_t& tree ) {
|
void FilterStructuralBrushesIntoTree( const entity_t& e, tree_t& tree ) {
|
||||||
int c_unique = 0, c_clusters = 0;
|
int c_unique = 0, c_clusters = 0;
|
||||||
|
|
||||||
Sys_FPrintf( SYS_VRB, "--- FilterStructuralBrushesIntoTree ---\n" );
|
Sys_FPrintf( SYS_VRB, "--- FilterStructuralBrushesIntoTree ---\n" );
|
||||||
|
|
||||||
for ( brush_t& b : e->brushes ) {
|
for ( const brush_t& b : e.brushes ) {
|
||||||
if ( b.detail ) {
|
if ( b.detail ) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -217,12 +217,12 @@ static void SetCloneModelNumbers(){
|
||||||
matches brushsides back to their appropriate drawsurface and shader
|
matches brushsides back to their appropriate drawsurface and shader
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static void FixBrushSides( entity_t *e ){
|
static void FixBrushSides( const entity_t& e ){
|
||||||
/* note it */
|
/* note it */
|
||||||
Sys_FPrintf( SYS_VRB, "--- FixBrushSides ---\n" );
|
Sys_FPrintf( SYS_VRB, "--- FixBrushSides ---\n" );
|
||||||
|
|
||||||
/* walk list of drawsurfaces */
|
/* walk list of drawsurfaces */
|
||||||
for ( int i = e->firstDrawSurf; i < numMapDrawSurfs; i++ )
|
for ( int i = e.firstDrawSurf; i < numMapDrawSurfs; ++i )
|
||||||
{
|
{
|
||||||
/* get surface and try to early out */
|
/* get surface and try to early out */
|
||||||
const mapDrawSurface_t& ds = mapDrawSurfs[ i ];
|
const mapDrawSurface_t& ds = mapDrawSurfs[ i ];
|
||||||
|
|
@ -354,7 +354,7 @@ static void ProcessWorldModel( entity_t& e ){
|
||||||
AddEntitySurfaceModels( e );
|
AddEntitySurfaceModels( e );
|
||||||
|
|
||||||
/* generate bsp brushes from map brushes */
|
/* generate bsp brushes from map brushes */
|
||||||
EmitBrushes( e->brushes, &e->firstBrush, &e->numBrushes );
|
EmitBrushes( e.brushes, &e.firstBrush, &e.numBrushes );
|
||||||
|
|
||||||
/* add references to the detail brushes */
|
/* add references to the detail brushes */
|
||||||
FilterDetailBrushesIntoTree( e, tree );
|
FilterDetailBrushesIntoTree( e, tree );
|
||||||
|
|
@ -394,7 +394,7 @@ static void ProcessWorldModel( entity_t& e ){
|
||||||
/* ydnar: fog hull */
|
/* ydnar: fog hull */
|
||||||
if ( e.read_keyvalue( value, "_foghull" ) ) {
|
if ( e.read_keyvalue( value, "_foghull" ) ) {
|
||||||
const auto shader = String64()( "textures/", value );
|
const auto shader = String64()( "textures/", value );
|
||||||
MakeFogHullSurfs( e, shader );
|
MakeFogHullSurfs( shader );
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ydnar: bug 645: do flares for lights */
|
/* ydnar: bug 645: do flares for lights */
|
||||||
|
|
@ -482,10 +482,10 @@ static void ProcessSubModel( entity_t& e ){
|
||||||
AddEntitySurfaceModels( e );
|
AddEntitySurfaceModels( e );
|
||||||
|
|
||||||
/* generate bsp brushes from map brushes */
|
/* generate bsp brushes from map brushes */
|
||||||
EmitBrushes( e->brushes, &e->firstBrush, &e->numBrushes );
|
EmitBrushes( e.brushes, &e.firstBrush, &e.numBrushes );
|
||||||
|
|
||||||
/* just put all the brushes in headnode */
|
/* just put all the brushes in headnode */
|
||||||
tree.headnode->brushlist = e->brushes;
|
tree.headnode->brushlist = e.brushes;
|
||||||
|
|
||||||
/* subdivide each drawsurf as required by shader tesselation */
|
/* subdivide each drawsurf as required by shader tesselation */
|
||||||
if ( !nosubdivide ) {
|
if ( !nosubdivide ) {
|
||||||
|
|
|
||||||
|
|
@ -713,7 +713,7 @@ static void ProjectDecalOntoTriangles( decalProjector_t *dp, mapDrawSurface_t *d
|
||||||
projects decals onto world surfaces
|
projects decals onto world surfaces
|
||||||
*/
|
*/
|
||||||
|
|
||||||
void MakeEntityDecals( entity_t *e ){
|
void MakeEntityDecals( const entity_t& e ){
|
||||||
int i, j, fOld;
|
int i, j, fOld;
|
||||||
decalProjector_t dp;
|
decalProjector_t dp;
|
||||||
mapDrawSurface_t *ds;
|
mapDrawSurface_t *ds;
|
||||||
|
|
@ -739,10 +739,10 @@ void MakeEntityDecals( entity_t *e ){
|
||||||
}
|
}
|
||||||
|
|
||||||
/* get projector */
|
/* get projector */
|
||||||
TransformDecalProjector( &projectors[ i ], g_vector3_axes, e->origin, &dp );
|
TransformDecalProjector( &projectors[ i ], g_vector3_axes, e.origin, &dp );
|
||||||
|
|
||||||
/* walk the list of surfaces in the entity */
|
/* walk the list of surfaces in the entity */
|
||||||
for ( j = e->firstDrawSurf; j < numMapDrawSurfs; j++ )
|
for ( j = e.firstDrawSurf; j < numMapDrawSurfs; ++j )
|
||||||
{
|
{
|
||||||
/* get surface */
|
/* get surface */
|
||||||
ds = &mapDrawSurfs[ j ];
|
ds = &mapDrawSurfs[ j ];
|
||||||
|
|
|
||||||
|
|
@ -244,7 +244,7 @@ static void SplitMeshByPlane( mesh_t *in, const Plane3f& plane, mesh_t **front,
|
||||||
chops a patch up by a fog brush
|
chops a patch up by a fog brush
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static bool ChopPatchSurfaceByBrush( entity_t *e, mapDrawSurface_t *ds, const brush_t *b ){
|
static bool ChopPatchSurfaceByBrush( mapDrawSurface_t *ds, const brush_t *b ){
|
||||||
int i, j;
|
int i, j;
|
||||||
mesh_t *outside[MAX_BRUSH_SIDES];
|
mesh_t *outside[MAX_BRUSH_SIDES];
|
||||||
int numOutside;
|
int numOutside;
|
||||||
|
|
@ -357,7 +357,7 @@ winding_t WindingFromDrawSurf( const mapDrawSurface_t *ds ){
|
||||||
chops up a face drawsurface by a fog brush, with a potential fragment left inside
|
chops up a face drawsurface by a fog brush, with a potential fragment left inside
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static bool ChopFaceSurfaceByBrush( entity_t *e, mapDrawSurface_t *ds, const brush_t *b ){
|
static bool ChopFaceSurfaceByBrush( const entity_t& e, mapDrawSurface_t *ds, const brush_t *b ){
|
||||||
std::list<winding_t> outside;
|
std::list<winding_t> outside;
|
||||||
mapDrawSurface_t *newds;
|
mapDrawSurface_t *newds;
|
||||||
|
|
||||||
|
|
@ -443,7 +443,7 @@ static bool ChopFaceSurfaceByBrush( entity_t *e, mapDrawSurface_t *ds, const bru
|
||||||
call after the surface list has been pruned, before tjunction fixing
|
call after the surface list has been pruned, before tjunction fixing
|
||||||
*/
|
*/
|
||||||
|
|
||||||
void FogDrawSurfaces( entity_t *e ){
|
void FogDrawSurfaces( const entity_t& e ){
|
||||||
int fogged, numFogged;
|
int fogged, numFogged;
|
||||||
int numBaseDrawSurfs;
|
int numBaseDrawSurfs;
|
||||||
|
|
||||||
|
|
@ -503,7 +503,7 @@ void FogDrawSurfaces( entity_t *e ){
|
||||||
|
|
||||||
/* handle patches */
|
/* handle patches */
|
||||||
case ESurfaceType::Patch:
|
case ESurfaceType::Patch:
|
||||||
fogged = ChopPatchSurfaceByBrush( e, ds, fog.brush );
|
fogged = ChopPatchSurfaceByBrush( ds, fog.brush );
|
||||||
break;
|
break;
|
||||||
|
|
||||||
/* handle triangle surfaces (fixme: split triangle surfaces) */
|
/* handle triangle surfaces (fixme: split triangle surfaces) */
|
||||||
|
|
|
||||||
|
|
@ -1260,17 +1260,17 @@ void InsertModel( const char *name, int skin, int frame, const Matrix4& transfor
|
||||||
adds misc_model surfaces to the bsp
|
adds misc_model surfaces to the bsp
|
||||||
*/
|
*/
|
||||||
|
|
||||||
void AddTriangleModels( entity_t *eparent ){
|
void AddTriangleModels( entity_t& eparent ){
|
||||||
/* note it */
|
/* note it */
|
||||||
Sys_FPrintf( SYS_VRB, "--- AddTriangleModels ---\n" );
|
Sys_FPrintf( SYS_VRB, "--- AddTriangleModels ---\n" );
|
||||||
|
|
||||||
/* get current brush entity targetname */
|
/* get current brush entity targetname */
|
||||||
const char *targetName;
|
const char *targetName;
|
||||||
if ( eparent == &entities[0] ) {
|
if ( &eparent == &entities[0] ) {
|
||||||
targetName = "";
|
targetName = "";
|
||||||
}
|
}
|
||||||
else{ /* misc_model entities target non-worldspawn brush model entities */
|
else{ /* misc_model entities target non-worldspawn brush model entities */
|
||||||
if ( !eparent->read_keyvalue( targetName, "targetname" ) ) {
|
if ( !eparent.read_keyvalue( targetName, "targetname" ) ) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1302,7 +1302,7 @@ void AddTriangleModels( entity_t *eparent ){
|
||||||
const int frame = e.intForKey( "_frame", "frame" );
|
const int frame = e.intForKey( "_frame", "frame" );
|
||||||
|
|
||||||
int castShadows, recvShadows;
|
int castShadows, recvShadows;
|
||||||
if ( eparent == &entities[0] ) { /* worldspawn (and func_groups) default to cast/recv shadows in worldspawn group */
|
if ( &eparent == &entities[0] ) { /* worldspawn (and func_groups) default to cast/recv shadows in worldspawn group */
|
||||||
castShadows = WORLDSPAWN_CAST_SHADOWS;
|
castShadows = WORLDSPAWN_CAST_SHADOWS;
|
||||||
recvShadows = WORLDSPAWN_RECV_SHADOWS;
|
recvShadows = WORLDSPAWN_RECV_SHADOWS;
|
||||||
}
|
}
|
||||||
|
|
@ -1312,13 +1312,13 @@ void AddTriangleModels( entity_t *eparent ){
|
||||||
}
|
}
|
||||||
|
|
||||||
/* get explicit shadow flags */
|
/* get explicit shadow flags */
|
||||||
GetEntityShadowFlags( &e, eparent, &castShadows, &recvShadows );
|
GetEntityShadowFlags( &e, &eparent, &castShadows, &recvShadows );
|
||||||
|
|
||||||
/* get spawnflags */
|
/* get spawnflags */
|
||||||
const int spawnFlags = e.intForKey( "spawnflags" );
|
const int spawnFlags = e.intForKey( "spawnflags" );
|
||||||
|
|
||||||
/* get origin */
|
/* get origin */
|
||||||
const Vector3 origin = e.vectorForKey( "origin" ) - eparent->origin; /* offset by parent */
|
const Vector3 origin = e.vectorForKey( "origin" ) - eparent.origin; /* offset by parent */
|
||||||
|
|
||||||
/* get scale */
|
/* get scale */
|
||||||
Vector3 scale( 1 );
|
Vector3 scale( 1 );
|
||||||
|
|
@ -1410,6 +1410,6 @@ void AddTriangleModels( entity_t *eparent ){
|
||||||
|
|
||||||
|
|
||||||
/* insert the model */
|
/* insert the model */
|
||||||
InsertModel( model, skin, frame, transform, &remaps, celShader, *eparent, castShadows, recvShadows, spawnFlags, lightmapScale, lightmapSampleSize, shadeAngle, clipDepth );
|
InsertModel( model, skin, frame, transform, &remaps, celShader, eparent, castShadows, recvShadows, spawnFlags, lightmapScale, lightmapSampleSize, shadeAngle, clipDepth );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -372,7 +372,7 @@ static void GrowGroup_r( parseMesh_t *pm, int patchNum, int patchCount, parseMes
|
||||||
pull apart.
|
pull apart.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
void PatchMapDrawSurfs( entity_t *e ){
|
void PatchMapDrawSurfs( entity_t& e ){
|
||||||
int i, j, k, l, c1, c2;
|
int i, j, k, l, c1, c2;
|
||||||
parseMesh_t *pm;
|
parseMesh_t *pm;
|
||||||
parseMesh_t *check, *scan;
|
parseMesh_t *check, *scan;
|
||||||
|
|
@ -390,7 +390,7 @@ void PatchMapDrawSurfs( entity_t *e ){
|
||||||
Sys_FPrintf( SYS_VRB, "--- PatchMapDrawSurfs ---\n" );
|
Sys_FPrintf( SYS_VRB, "--- PatchMapDrawSurfs ---\n" );
|
||||||
|
|
||||||
patchCount = 0;
|
patchCount = 0;
|
||||||
for ( pm = e->patches; pm; pm = pm->next ) {
|
for ( pm = e.patches; pm; pm = pm->next ) {
|
||||||
meshes[patchCount] = pm;
|
meshes[patchCount] = pm;
|
||||||
patchCount++;
|
patchCount++;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1418,8 +1418,8 @@ Vector3 SnapWeldVector( const Vector3& a, const Vector3& b )
|
||||||
bool CreateBrushWindings( brush_t& brush );
|
bool CreateBrushWindings( brush_t& brush );
|
||||||
void WriteBSPBrushMap( const char *name, const brushlist_t& list );
|
void WriteBSPBrushMap( const char *name, const brushlist_t& list );
|
||||||
|
|
||||||
void FilterDetailBrushesIntoTree( entity_t *e, tree_t& tree );
|
void FilterDetailBrushesIntoTree( const entity_t& e, tree_t& tree );
|
||||||
void FilterStructuralBrushesIntoTree( entity_t *e, tree_t& tree );
|
void FilterStructuralBrushesIntoTree( const entity_t& e, tree_t& tree );
|
||||||
|
|
||||||
bool WindingIsTiny( const winding_t& w );
|
bool WindingIsTiny( const winding_t& w );
|
||||||
|
|
||||||
|
|
@ -1490,7 +1490,7 @@ void EmitBrushes( brushlist_t& brushes, int *firstBrush,
|
||||||
void EmitFogs();
|
void EmitFogs();
|
||||||
|
|
||||||
void BeginModel( const entity_t& e );
|
void BeginModel( const entity_t& e );
|
||||||
void EndModel( entity_t *e, node_t *headnode );
|
void EndModel( const entity_t& e, node_t *headnode );
|
||||||
|
|
||||||
|
|
||||||
/* tree.c */
|
/* tree.c */
|
||||||
|
|
@ -1500,16 +1500,16 @@ inline node_t *AllocNode(){ return new node_t(); }
|
||||||
|
|
||||||
/* patch.c */
|
/* patch.c */
|
||||||
void ParsePatch( bool onlyLights, entity_t& mapEnt, int mapPrimitiveNum );
|
void ParsePatch( bool onlyLights, entity_t& mapEnt, int mapPrimitiveNum );
|
||||||
void PatchMapDrawSurfs( entity_t *e );
|
void PatchMapDrawSurfs( entity_t& e );
|
||||||
|
|
||||||
|
|
||||||
/* tjunction.c */
|
/* tjunction.c */
|
||||||
void FixTJunctions( entity_t *e );
|
void FixTJunctions( const entity_t& e );
|
||||||
|
|
||||||
|
|
||||||
/* fog.c */
|
/* fog.c */
|
||||||
winding_t WindingFromDrawSurf( const mapDrawSurface_t *ds );
|
winding_t WindingFromDrawSurf( const mapDrawSurface_t *ds );
|
||||||
void FogDrawSurfaces( entity_t *e );
|
void FogDrawSurfaces( const entity_t& e );
|
||||||
int FogForPoint( const Vector3& point, float epsilon );
|
int FogForPoint( const Vector3& point, float epsilon );
|
||||||
int FogForBounds( const MinMax& minmax, float epsilon );
|
int FogForBounds( const MinMax& minmax, float epsilon );
|
||||||
void CreateMapFogs();
|
void CreateMapFogs();
|
||||||
|
|
@ -1524,7 +1524,7 @@ tree_t FaceBSP( facelist_t& list );
|
||||||
/* model.c */
|
/* model.c */
|
||||||
void assimp_init();
|
void assimp_init();
|
||||||
void InsertModel( const char *name, int skin, int frame, const Matrix4& transform, const std::list<remap_t> *remaps, shaderInfo_t *celShader, entity_t& entity, int castShadows, int recvShadows, int spawnFlags, float lightmapScale, int lightmapSampleSize, float shadeAngle, float clipDepth );
|
void InsertModel( const char *name, int skin, int frame, const Matrix4& transform, const std::list<remap_t> *remaps, shaderInfo_t *celShader, entity_t& entity, int castShadows, int recvShadows, int spawnFlags, float lightmapScale, int lightmapSampleSize, float shadeAngle, float clipDepth );
|
||||||
void AddTriangleModels( entity_t *e );
|
void AddTriangleModels( entity_t& eparent );
|
||||||
|
|
||||||
|
|
||||||
/* surface.c */
|
/* surface.c */
|
||||||
|
|
@ -1533,20 +1533,20 @@ void StripFaceSurface( mapDrawSurface_t *ds );
|
||||||
void MaxAreaFaceSurface( mapDrawSurface_t *ds );
|
void MaxAreaFaceSurface( mapDrawSurface_t *ds );
|
||||||
Vector3 CalcLightmapAxis( const Vector3& normal );
|
Vector3 CalcLightmapAxis( const Vector3& normal );
|
||||||
void ClassifySurfaces( int numSurfs, mapDrawSurface_t *ds );
|
void ClassifySurfaces( int numSurfs, mapDrawSurface_t *ds );
|
||||||
void ClassifyEntitySurfaces( entity_t *e );
|
void ClassifyEntitySurfaces( const entity_t& e );
|
||||||
void TidyEntitySurfaces( entity_t *e );
|
void TidyEntitySurfaces( const entity_t& e );
|
||||||
mapDrawSurface_t *CloneSurface( mapDrawSurface_t *src, shaderInfo_t *si );
|
mapDrawSurface_t *CloneSurface( mapDrawSurface_t *src, shaderInfo_t *si );
|
||||||
bool IsTriangleDegenerate( bspDrawVert_t *points, int a, int b, int c );
|
bool IsTriangleDegenerate( bspDrawVert_t *points, int a, int b, int c );
|
||||||
void ClearSurface( mapDrawSurface_t *ds );
|
void ClearSurface( mapDrawSurface_t *ds );
|
||||||
mapDrawSurface_t *DrawSurfaceForSide( const entity_t *e, const brush_t& b, const side_t& s, const winding_t& w );
|
mapDrawSurface_t *DrawSurfaceForSide( const entity_t& e, const brush_t& b, const side_t& s, const winding_t& w );
|
||||||
mapDrawSurface_t *DrawSurfaceForMesh( entity_t *e, parseMesh_t *p, mesh_t *mesh );
|
mapDrawSurface_t *DrawSurfaceForMesh( const entity_t& e, parseMesh_t *p, mesh_t *mesh );
|
||||||
mapDrawSurface_t *DrawSurfaceForFlare( int entNum, const Vector3& origin, const Vector3& normal, const Vector3& color, const char *flareShader, int lightStyle );
|
mapDrawSurface_t *DrawSurfaceForFlare( int entNum, const Vector3& origin, const Vector3& normal, const Vector3& color, const char *flareShader, int lightStyle );
|
||||||
void ClipSidesIntoTree( entity_t *e, const tree_t& tree );
|
void ClipSidesIntoTree( entity_t& e, const tree_t& tree );
|
||||||
void MakeDebugPortalSurfs( const tree_t& tree );
|
void MakeDebugPortalSurfs( const tree_t& tree );
|
||||||
void MakeFogHullSurfs( entity_t *e, const char *shader );
|
void MakeFogHullSurfs( const char *shader );
|
||||||
void SubdivideFaceSurfaces( entity_t *e );
|
void SubdivideFaceSurfaces( const entity_t& e );
|
||||||
void AddEntitySurfaceModels( entity_t *e );
|
void AddEntitySurfaceModels( entity_t& e );
|
||||||
void FilterDrawsurfsIntoTree( entity_t *e, tree_t& tree );
|
void FilterDrawsurfsIntoTree( entity_t& e, tree_t& tree );
|
||||||
|
|
||||||
|
|
||||||
/* surface_fur.c */
|
/* surface_fur.c */
|
||||||
|
|
@ -1559,7 +1559,7 @@ void Foliage( mapDrawSurface_t *src, entity_t& entity );
|
||||||
|
|
||||||
/* ydnar: surface_meta.c */
|
/* ydnar: surface_meta.c */
|
||||||
void ClearMetaTriangles();
|
void ClearMetaTriangles();
|
||||||
void MakeEntityMetaTriangles( entity_t *e );
|
void MakeEntityMetaTriangles( const entity_t& e );
|
||||||
void FixMetaTJunctions();
|
void FixMetaTJunctions();
|
||||||
void SmoothMetaTriangles();
|
void SmoothMetaTriangles();
|
||||||
void MergeMetaTriangles();
|
void MergeMetaTriangles();
|
||||||
|
|
@ -1575,7 +1575,7 @@ void LoadSurfaceExtraFile( const char *path );
|
||||||
|
|
||||||
/* decals.c */
|
/* decals.c */
|
||||||
void ProcessDecals();
|
void ProcessDecals();
|
||||||
void MakeEntityDecals( entity_t *e );
|
void MakeEntityDecals( const entity_t& e );
|
||||||
|
|
||||||
/* map.c */
|
/* map.c */
|
||||||
std::array<Vector3, 2> TextureAxisFromPlane( const plane_t& plane );
|
std::array<Vector3, 2> TextureAxisFromPlane( const plane_t& plane );
|
||||||
|
|
@ -1647,7 +1647,7 @@ const image_t *ImageLoad( const char *name );
|
||||||
|
|
||||||
|
|
||||||
/* shaders.c */
|
/* shaders.c */
|
||||||
void ColorMod( colorMod_t *am, int numVerts, bspDrawVert_t *drawVerts );
|
void ColorMod( const colorMod_t *am, int numVerts, bspDrawVert_t *drawVerts );
|
||||||
|
|
||||||
void TCMod( const tcMod_t& mod, Vector2& st );
|
void TCMod( const tcMod_t& mod, Vector2& st );
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -45,7 +45,7 @@ static int numCustSurfaceParms;
|
||||||
routines for dealing with vertex color/alpha modification
|
routines for dealing with vertex color/alpha modification
|
||||||
*/
|
*/
|
||||||
|
|
||||||
void ColorMod( colorMod_t *cm, int numVerts, bspDrawVert_t *drawVerts ){
|
void ColorMod( const colorMod_t *cm, int numVerts, bspDrawVert_t *drawVerts ){
|
||||||
/* dummy check */
|
/* dummy check */
|
||||||
if ( cm == NULL || numVerts < 1 || drawVerts == NULL ) {
|
if ( cm == NULL || numVerts < 1 || drawVerts == NULL ) {
|
||||||
return;
|
return;
|
||||||
|
|
|
||||||
|
|
@ -262,7 +262,7 @@ void ClearSurface( mapDrawSurface_t *ds ){
|
||||||
deletes all empty or bad surfaces from the surface list
|
deletes all empty or bad surfaces from the surface list
|
||||||
*/
|
*/
|
||||||
|
|
||||||
void TidyEntitySurfaces( entity_t *e ){
|
void TidyEntitySurfaces( const entity_t& e ){
|
||||||
int i, j, deleted;
|
int i, j, deleted;
|
||||||
mapDrawSurface_t *out, *in = NULL;
|
mapDrawSurface_t *out, *in = NULL;
|
||||||
|
|
||||||
|
|
@ -272,7 +272,7 @@ void TidyEntitySurfaces( entity_t *e ){
|
||||||
|
|
||||||
/* walk the surface list */
|
/* walk the surface list */
|
||||||
deleted = 0;
|
deleted = 0;
|
||||||
for ( i = e->firstDrawSurf, j = e->firstDrawSurf; j < numMapDrawSurfs; i++, j++ )
|
for ( i = e.firstDrawSurf, j = e.firstDrawSurf; j < numMapDrawSurfs; ++i, ++j )
|
||||||
{
|
{
|
||||||
/* get out surface */
|
/* get out surface */
|
||||||
out = &mapDrawSurfs[ i ];
|
out = &mapDrawSurfs[ i ];
|
||||||
|
|
@ -567,12 +567,12 @@ void ClassifySurfaces( int numSurfs, mapDrawSurface_t *ds ){
|
||||||
classifies all surfaces in an entity
|
classifies all surfaces in an entity
|
||||||
*/
|
*/
|
||||||
|
|
||||||
void ClassifyEntitySurfaces( entity_t *e ){
|
void ClassifyEntitySurfaces( const entity_t& e ){
|
||||||
/* note it */
|
/* note it */
|
||||||
Sys_FPrintf( SYS_VRB, "--- ClassifyEntitySurfaces ---\n" );
|
Sys_FPrintf( SYS_VRB, "--- ClassifyEntitySurfaces ---\n" );
|
||||||
|
|
||||||
/* walk the surface list */
|
/* walk the surface list */
|
||||||
for ( int i = e->firstDrawSurf; i < numMapDrawSurfs; ++i )
|
for ( int i = e.firstDrawSurf; i < numMapDrawSurfs; ++i )
|
||||||
{
|
{
|
||||||
FinishSurface( &mapDrawSurfs[ i ] );
|
FinishSurface( &mapDrawSurfs[ i ] );
|
||||||
ClassifySurfaces( 1, &mapDrawSurfs[ i ] );
|
ClassifySurfaces( 1, &mapDrawSurfs[ i ] );
|
||||||
|
|
@ -712,7 +712,7 @@ const double SNAP_INT_TO_FLOAT = ( 1.0 / SNAP_FLOAT_TO_INT );
|
||||||
|
|
||||||
static mapDrawSurface_t *DrawSurfaceForShader( const char *shader );
|
static mapDrawSurface_t *DrawSurfaceForShader( const char *shader );
|
||||||
|
|
||||||
mapDrawSurface_t *DrawSurfaceForSide( const entity_t *e, const brush_t& b, const side_t& s, const winding_t& w ){
|
mapDrawSurface_t *DrawSurfaceForSide( const entity_t& e, const brush_t& b, const side_t& s, const winding_t& w ){
|
||||||
mapDrawSurface_t *ds;
|
mapDrawSurface_t *ds;
|
||||||
shaderInfo_t *si, *parent;
|
shaderInfo_t *si, *parent;
|
||||||
bspDrawVert_t *dv;
|
bspDrawVert_t *dv;
|
||||||
|
|
@ -802,7 +802,7 @@ mapDrawSurface_t *DrawSurfaceForSide( const entity_t *e, const brush_t& b, const
|
||||||
/* round the xyz to a given precision and translate by origin */
|
/* round the xyz to a given precision and translate by origin */
|
||||||
for ( size_t i = 0; i < 3; i++ )
|
for ( size_t i = 0; i < 3; i++ )
|
||||||
dv->xyz[ i ] = SNAP_INT_TO_FLOAT * floor( dv->xyz[ i ] * SNAP_FLOAT_TO_INT + 0.5 );
|
dv->xyz[ i ] = SNAP_INT_TO_FLOAT * floor( dv->xyz[ i ] * SNAP_FLOAT_TO_INT + 0.5 );
|
||||||
vTranslated = dv->xyz + e->originbrush_origin;
|
vTranslated = dv->xyz + e.originbrush_origin;
|
||||||
|
|
||||||
/* ydnar: tek-fu celshading support for flat shaded shit */
|
/* ydnar: tek-fu celshading support for flat shaded shit */
|
||||||
if ( flat ) {
|
if ( flat ) {
|
||||||
|
|
@ -866,7 +866,7 @@ mapDrawSurface_t *DrawSurfaceForSide( const entity_t *e, const brush_t& b, const
|
||||||
moved here from patch.c
|
moved here from patch.c
|
||||||
*/
|
*/
|
||||||
|
|
||||||
mapDrawSurface_t *DrawSurfaceForMesh( entity_t *e, parseMesh_t *p, mesh_t *mesh ){
|
mapDrawSurface_t *DrawSurfaceForMesh( const entity_t& e, parseMesh_t *p, mesh_t *mesh ){
|
||||||
int i, numVerts;
|
int i, numVerts;
|
||||||
Plane3f plane;
|
Plane3f plane;
|
||||||
bool planar;
|
bool planar;
|
||||||
|
|
@ -1011,7 +1011,7 @@ mapDrawSurface_t *DrawSurfaceForMesh( entity_t *e, parseMesh_t *p, mesh_t *mesh
|
||||||
/* ydnar: gs mods: added support for explicit shader texcoord generation */
|
/* ydnar: gs mods: added support for explicit shader texcoord generation */
|
||||||
else if ( si->tcGen ) {
|
else if ( si->tcGen ) {
|
||||||
/* translate by origin and project the texture */
|
/* translate by origin and project the texture */
|
||||||
const Vector3 vTranslated = dv->xyz + e->origin;
|
const Vector3 vTranslated = dv->xyz + e.origin;
|
||||||
dv->st[ 0 ] = vector3_dot( si->vecs[ 0 ], vTranslated );
|
dv->st[ 0 ] = vector3_dot( si->vecs[ 0 ], vTranslated );
|
||||||
dv->st[ 1 ] = vector3_dot( si->vecs[ 1 ], vTranslated );
|
dv->st[ 1 ] = vector3_dot( si->vecs[ 1 ], vTranslated );
|
||||||
}
|
}
|
||||||
|
|
@ -1140,7 +1140,7 @@ static void AddSurfaceFlare( mapDrawSurface_t *ds, const Vector3& entityOrigin )
|
||||||
subdivides a face surface until it is smaller than the specified size (subdivisions)
|
subdivides a face surface until it is smaller than the specified size (subdivisions)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static void SubdivideFace_r( entity_t *e, const brush_t& brush, const side_t& side, winding_t& w, int fogNum, float subdivisions ){
|
static void SubdivideFace_r( const entity_t& e, const brush_t& brush, const side_t& side, winding_t& w, int fogNum, float subdivisions ){
|
||||||
int axis;
|
int axis;
|
||||||
MinMax bounds;
|
MinMax bounds;
|
||||||
const float epsilon = 0.1;
|
const float epsilon = 0.1;
|
||||||
|
|
@ -1209,12 +1209,12 @@ static void SubdivideFace_r( entity_t *e, const brush_t& brush, const side_t& si
|
||||||
ydnar: and subdivide surfaces that exceed specified texture coordinate range
|
ydnar: and subdivide surfaces that exceed specified texture coordinate range
|
||||||
*/
|
*/
|
||||||
|
|
||||||
void SubdivideFaceSurfaces( entity_t *e ){
|
void SubdivideFaceSurfaces( const entity_t& e ){
|
||||||
/* note it */
|
/* note it */
|
||||||
Sys_FPrintf( SYS_VRB, "--- SubdivideFaceSurfaces ---\n" );
|
Sys_FPrintf( SYS_VRB, "--- SubdivideFaceSurfaces ---\n" );
|
||||||
|
|
||||||
/* walk the list of original surfaces, numMapDrawSurfs may increase in the process */
|
/* walk the list of original surfaces, numMapDrawSurfs may increase in the process */
|
||||||
for ( mapDrawSurface_t& ds : Span( mapDrawSurfs + e->firstDrawSurf, numMapDrawSurfs ) )
|
for ( mapDrawSurface_t& ds : Span( mapDrawSurfs + e.firstDrawSurf, numMapDrawSurfs ) )
|
||||||
{
|
{
|
||||||
/* only subdivide brush sides */
|
/* only subdivide brush sides */
|
||||||
if ( ds.type != ESurfaceType::Face || ds.mapBrush == NULL || ds.sideRef == NULL || ds.sideRef->side == NULL ) {
|
if ( ds.type != ESurfaceType::Face || ds.mapBrush == NULL || ds.sideRef == NULL || ds.sideRef->side == NULL ) {
|
||||||
|
|
@ -1361,7 +1361,7 @@ static bool SideInBrush( side_t& side, const brush_t& b ){
|
||||||
culls obscured or buried brushsides from the map
|
culls obscured or buried brushsides from the map
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static void CullSides( entity_t *e ){
|
static void CullSides( entity_t& e ){
|
||||||
int k, l, first, second, dir;
|
int k, l, first, second, dir;
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -1372,7 +1372,7 @@ static void CullSides( entity_t *e ){
|
||||||
g_numCoinFaces = 0;
|
g_numCoinFaces = 0;
|
||||||
|
|
||||||
/* brush interator 1 */
|
/* brush interator 1 */
|
||||||
for ( brushlist_t::iterator b1 = e->brushes.begin(); b1 != e->brushes.end(); ++b1 )
|
for ( brushlist_t::iterator b1 = e.brushes.begin(); b1 != e.brushes.end(); ++b1 )
|
||||||
{
|
{
|
||||||
/* sides check */
|
/* sides check */
|
||||||
if ( b1->sides.empty() ) {
|
if ( b1->sides.empty() ) {
|
||||||
|
|
@ -1380,7 +1380,7 @@ static void CullSides( entity_t *e ){
|
||||||
}
|
}
|
||||||
|
|
||||||
/* brush iterator 2 */
|
/* brush iterator 2 */
|
||||||
for ( brushlist_t::iterator b2 = std::next( b1 ); b2 != e->brushes.end(); ++b2 )
|
for ( brushlist_t::iterator b2 = std::next( b1 ); b2 != e.brushes.end(); ++b2 )
|
||||||
{
|
{
|
||||||
/* sides check */
|
/* sides check */
|
||||||
if ( b2->sides.empty() ) {
|
if ( b2->sides.empty() ) {
|
||||||
|
|
@ -1542,7 +1542,7 @@ static void CullSides( entity_t *e ){
|
||||||
to be trimmed off automatically.
|
to be trimmed off automatically.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
void ClipSidesIntoTree( entity_t *e, const tree_t& tree ){
|
void ClipSidesIntoTree( entity_t& e, const tree_t& tree ){
|
||||||
/* ydnar: cull brush sides */
|
/* ydnar: cull brush sides */
|
||||||
CullSides( e );
|
CullSides( e );
|
||||||
|
|
||||||
|
|
@ -1550,7 +1550,7 @@ void ClipSidesIntoTree( entity_t *e, const tree_t& tree ){
|
||||||
Sys_FPrintf( SYS_VRB, "--- ClipSidesIntoTree ---\n" );
|
Sys_FPrintf( SYS_VRB, "--- ClipSidesIntoTree ---\n" );
|
||||||
|
|
||||||
/* walk the brush list */
|
/* walk the brush list */
|
||||||
for ( brush_t& b : e->brushes )
|
for ( brush_t& b : e.brushes )
|
||||||
{
|
{
|
||||||
/* walk the brush sides */
|
/* walk the brush sides */
|
||||||
for ( side_t& side : b.sides )
|
for ( side_t& side : b.sides )
|
||||||
|
|
@ -2198,9 +2198,9 @@ static void EmitFlareSurface( mapDrawSurface_t *ds ){
|
||||||
emits a bsp patch drawsurface
|
emits a bsp patch drawsurface
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static void EmitPatchSurface( entity_t *e, mapDrawSurface_t *ds ){
|
static void EmitPatchSurface( const entity_t& e, mapDrawSurface_t *ds ){
|
||||||
/* vortex: _patchMeta support */
|
/* vortex: _patchMeta support */
|
||||||
const bool forcePatchMeta = e->boolForKey( "_patchMeta", "patchMeta" );
|
const bool forcePatchMeta = e.boolForKey( "_patchMeta", "patchMeta" );
|
||||||
|
|
||||||
/* invert the surface if necessary */
|
/* invert the surface if necessary */
|
||||||
if ( ds->backSide || ds->shaderInfo->invert ) {
|
if ( ds->backSide || ds->shaderInfo->invert ) {
|
||||||
|
|
@ -2636,7 +2636,7 @@ void MakeDebugPortalSurfs( const tree_t& tree ){
|
||||||
generates drawsurfaces for a foghull (this MUST use a sky shader)
|
generates drawsurfaces for a foghull (this MUST use a sky shader)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
void MakeFogHullSurfs( entity_t *e, const char *shader ){
|
void MakeFogHullSurfs( const char *shader ){
|
||||||
shaderInfo_t *si;
|
shaderInfo_t *si;
|
||||||
mapDrawSurface_t *ds;
|
mapDrawSurface_t *ds;
|
||||||
int indexes[] =
|
int indexes[] =
|
||||||
|
|
@ -3005,16 +3005,13 @@ static int AddSurfaceModels( mapDrawSurface_t *ds, entity_t& entity ){
|
||||||
adds surfacemodels to an entity's surfaces
|
adds surfacemodels to an entity's surfaces
|
||||||
*/
|
*/
|
||||||
|
|
||||||
void AddEntitySurfaceModels( entity_t *e ){
|
void AddEntitySurfaceModels( entity_t& e ){
|
||||||
int i;
|
|
||||||
|
|
||||||
|
|
||||||
/* note it */
|
/* note it */
|
||||||
Sys_FPrintf( SYS_VRB, "--- AddEntitySurfaceModels ---\n" );
|
Sys_FPrintf( SYS_VRB, "--- AddEntitySurfaceModels ---\n" );
|
||||||
|
|
||||||
/* walk the surface list */
|
/* walk the surface list */
|
||||||
for ( i = e->firstDrawSurf; i < numMapDrawSurfs; i++ )
|
for ( int i = e.firstDrawSurf; i < numMapDrawSurfs; ++i )
|
||||||
numSurfaceModels += AddSurfaceModels( &mapDrawSurfs[ i ], *e );
|
numSurfaceModels += AddSurfaceModels( &mapDrawSurfs[ i ], e );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -3024,9 +3021,9 @@ void AddEntitySurfaceModels( entity_t *e ){
|
||||||
applies brush/volumetric color/alpha modulation to vertexes
|
applies brush/volumetric color/alpha modulation to vertexes
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static void VolumeColorMods( entity_t *e, mapDrawSurface_t *ds ){
|
static void VolumeColorMods( const entity_t& e, mapDrawSurface_t *ds ){
|
||||||
/* iterate brushes */
|
/* iterate brushes */
|
||||||
for ( const brush_t *b : e->colorModBrushes )
|
for ( const brush_t *b : e.colorModBrushes )
|
||||||
{
|
{
|
||||||
/* worldspawn alpha brushes affect all, grouped ones only affect original entity */
|
/* worldspawn alpha brushes affect all, grouped ones only affect original entity */
|
||||||
if ( b->entityNum != 0 && b->entityNum != ds->entityNum ) {
|
if ( b->entityNum != 0 && b->entityNum != ds->entityNum ) {
|
||||||
|
|
@ -3041,20 +3038,10 @@ static void VolumeColorMods( entity_t *e, mapDrawSurface_t *ds ){
|
||||||
/* iterate verts */
|
/* iterate verts */
|
||||||
for ( bspDrawVert_t& vert : Span( ds->verts, ds->numVerts ) )
|
for ( bspDrawVert_t& vert : Span( ds->verts, ds->numVerts ) )
|
||||||
{
|
{
|
||||||
/* iterate planes */
|
if( std::none_of( b->sides.cbegin(), b->sides.cend(), [&vert]( const side_t& side ){
|
||||||
size_t j;
|
return plane3_distance_to_point( mapplanes[ side.planenum ].plane, vert.xyz ) > 1.0f; } ) ) /* point-plane test */
|
||||||
for ( j = 0; j < b->sides.size(); ++j )
|
/* apply colormods */
|
||||||
{
|
|
||||||
/* point-plane test */
|
|
||||||
if ( plane3_distance_to_point( mapplanes[ b->sides[ j ].planenum ].plane, vert.xyz ) > 1.0f ) {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* apply colormods */
|
|
||||||
if ( j == b->sides.size() ) {
|
|
||||||
ColorMod( b->contentShader->colorMod, 1, &vert );
|
ColorMod( b->contentShader->colorMod, 1, &vert );
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -3068,7 +3055,7 @@ static void VolumeColorMods( entity_t *e, mapDrawSurface_t *ds ){
|
||||||
will have valid final indexes
|
will have valid final indexes
|
||||||
*/
|
*/
|
||||||
|
|
||||||
void FilterDrawsurfsIntoTree( entity_t *e, tree_t& tree ){
|
void FilterDrawsurfsIntoTree( entity_t& e, tree_t& tree ){
|
||||||
int refs;
|
int refs;
|
||||||
int numSurfs, numRefs, numSkyboxSurfaces;
|
int numSurfs, numRefs, numSkyboxSurfaces;
|
||||||
bool sb;
|
bool sb;
|
||||||
|
|
@ -3081,7 +3068,7 @@ void FilterDrawsurfsIntoTree( entity_t *e, tree_t& tree ){
|
||||||
numSurfs = 0;
|
numSurfs = 0;
|
||||||
numRefs = 0;
|
numRefs = 0;
|
||||||
numSkyboxSurfaces = 0;
|
numSkyboxSurfaces = 0;
|
||||||
for ( int i = e->firstDrawSurf; i < numMapDrawSurfs; ++i )
|
for ( int i = e.firstDrawSurf; i < numMapDrawSurfs; ++i )
|
||||||
{
|
{
|
||||||
/* get surface and try to early out */
|
/* get surface and try to early out */
|
||||||
mapDrawSurface_t *ds = &mapDrawSurfs[ i ];
|
mapDrawSurface_t *ds = &mapDrawSurfs[ i ];
|
||||||
|
|
@ -3122,12 +3109,12 @@ void FilterDrawsurfsIntoTree( entity_t *e, tree_t& tree ){
|
||||||
|
|
||||||
/* ydnar/sd: make foliage surfaces */
|
/* ydnar/sd: make foliage surfaces */
|
||||||
if ( !si->foliage.empty() ) {
|
if ( !si->foliage.empty() ) {
|
||||||
Foliage( ds, *e );
|
Foliage( ds, e );
|
||||||
}
|
}
|
||||||
|
|
||||||
/* create a flare surface if necessary */
|
/* create a flare surface if necessary */
|
||||||
if ( !strEmptyOrNull( si->flareShader ) ) {
|
if ( !strEmptyOrNull( si->flareShader ) ) {
|
||||||
AddSurfaceFlare( ds, e->origin );
|
AddSurfaceFlare( ds, e.origin );
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ydnar: don't emit nodraw surfaces (like nodraw fog) */
|
/* ydnar: don't emit nodraw surfaces (like nodraw fog) */
|
||||||
|
|
@ -3139,9 +3126,9 @@ void FilterDrawsurfsIntoTree( entity_t *e, tree_t& tree ){
|
||||||
BiasSurfaceTextures( ds );
|
BiasSurfaceTextures( ds );
|
||||||
|
|
||||||
/* ydnar: globalizing of fog volume handling (eek a hack) */
|
/* ydnar: globalizing of fog volume handling (eek a hack) */
|
||||||
if ( e != &entities[0] && !si->noFog ) {
|
if ( &e != &entities[0] && !si->noFog ) {
|
||||||
/* offset surface by entity origin */
|
/* offset surface by entity origin */
|
||||||
const MinMax minmax( ds->minmax.mins + e->origin, ds->minmax.maxs + e->origin );
|
const MinMax minmax( ds->minmax.mins + e.origin, ds->minmax.maxs + e.origin );
|
||||||
|
|
||||||
/* set the fog number for this surface */
|
/* set the fog number for this surface */
|
||||||
ds->fogNum = FogForBounds( minmax, 1.0f ); //% FogForPoint( origin, 0.0f );
|
ds->fogNum = FogForBounds( minmax, 1.0f ); //% FogForPoint( origin, 0.0f );
|
||||||
|
|
|
||||||
|
|
@ -341,13 +341,13 @@ static void SurfaceToMetaTriangles( mapDrawSurface_t *ds ){
|
||||||
creates triangles from a patch
|
creates triangles from a patch
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static void TriangulatePatchSurface( entity_t *e, mapDrawSurface_t *ds ){
|
static void TriangulatePatchSurface( const entity_t& e, mapDrawSurface_t *ds ){
|
||||||
int x, y, pw[ 5 ], r;
|
int x, y, pw[ 5 ], r;
|
||||||
mapDrawSurface_t *dsNew;
|
mapDrawSurface_t *dsNew;
|
||||||
mesh_t src, *subdivided, *mesh;
|
mesh_t src, *subdivided, *mesh;
|
||||||
|
|
||||||
/* vortex: _patchMeta, _patchQuality, _patchSubdivide support */
|
/* vortex: _patchMeta, _patchQuality, _patchSubdivide support */
|
||||||
const bool forcePatchMeta = e->boolForKey( "_patchMeta", "patchMeta" );
|
const bool forcePatchMeta = e.boolForKey( "_patchMeta", "patchMeta" );
|
||||||
|
|
||||||
/* try to early out */
|
/* try to early out */
|
||||||
if ( ds->numVerts == 0 || ds->type != ESurfaceType::Patch || ( !patchMeta && !forcePatchMeta ) ) {
|
if ( ds->numVerts == 0 || ds->type != ESurfaceType::Patch || ( !patchMeta && !forcePatchMeta ) ) {
|
||||||
|
|
@ -361,11 +361,11 @@ static void TriangulatePatchSurface( entity_t *e, mapDrawSurface_t *ds ){
|
||||||
|
|
||||||
int iterations;
|
int iterations;
|
||||||
int patchSubdivision;
|
int patchSubdivision;
|
||||||
if ( e->read_keyvalue( patchSubdivision, "_patchSubdivide", "patchSubdivide" ) ) {
|
if ( e.read_keyvalue( patchSubdivision, "_patchSubdivide", "patchSubdivide" ) ) {
|
||||||
iterations = IterationsForCurve( ds->longestCurve, patchSubdivision );
|
iterations = IterationsForCurve( ds->longestCurve, patchSubdivision );
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
const int patchQuality = e->intForKey( "_patchQuality", "patchQuality" );
|
const int patchQuality = e.intForKey( "_patchQuality", "patchQuality" );
|
||||||
iterations = IterationsForCurve( ds->longestCurve, patchSubdivisions / ( patchQuality == 0? 1 : patchQuality ) );
|
iterations = IterationsForCurve( ds->longestCurve, patchSubdivisions / ( patchQuality == 0? 1 : patchQuality ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -855,7 +855,7 @@ void EmitMetaStats(){
|
||||||
builds meta triangles from brush faces (tristrips and fans)
|
builds meta triangles from brush faces (tristrips and fans)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
void MakeEntityMetaTriangles( entity_t *e ){
|
void MakeEntityMetaTriangles( const entity_t& e ){
|
||||||
/* note it */
|
/* note it */
|
||||||
Sys_FPrintf( SYS_VRB, "--- MakeEntityMetaTriangles ---\n" );
|
Sys_FPrintf( SYS_VRB, "--- MakeEntityMetaTriangles ---\n" );
|
||||||
|
|
||||||
|
|
@ -864,10 +864,10 @@ void MakeEntityMetaTriangles( entity_t *e ){
|
||||||
Timer timer;
|
Timer timer;
|
||||||
|
|
||||||
/* walk the list of surfaces in the entity */
|
/* walk the list of surfaces in the entity */
|
||||||
for ( int i = e->firstDrawSurf; i < numMapDrawSurfs; ++i )
|
for ( int i = e.firstDrawSurf; i < numMapDrawSurfs; ++i )
|
||||||
{
|
{
|
||||||
/* print pacifier */
|
/* print pacifier */
|
||||||
if ( const int f = 10 * ( i - e->firstDrawSurf ) / ( numMapDrawSurfs - e->firstDrawSurf ); f != fOld ) {
|
if ( const int f = 10 * ( i - e.firstDrawSurf ) / ( numMapDrawSurfs - e.firstDrawSurf ); f != fOld ) {
|
||||||
fOld = f;
|
fOld = f;
|
||||||
Sys_FPrintf( SYS_VRB, "%d...", f );
|
Sys_FPrintf( SYS_VRB, "%d...", f );
|
||||||
}
|
}
|
||||||
|
|
@ -920,7 +920,7 @@ void MakeEntityMetaTriangles( entity_t *e ){
|
||||||
}
|
}
|
||||||
|
|
||||||
/* print time */
|
/* print time */
|
||||||
if ( ( numMapDrawSurfs - e->firstDrawSurf ) ) {
|
if ( ( numMapDrawSurfs - e.firstDrawSurf ) ) {
|
||||||
Sys_FPrintf( SYS_VRB, " (%d)\n", int( timer.elapsed_sec() ) );
|
Sys_FPrintf( SYS_VRB, " (%d)\n", int( timer.elapsed_sec() ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -548,7 +548,7 @@ static bool FixBrokenSurface( mapDrawSurface_t& ds ){
|
||||||
call after the surface list has been pruned
|
call after the surface list has been pruned
|
||||||
*/
|
*/
|
||||||
|
|
||||||
void FixTJunctions( entity_t *ent ){
|
void FixTJunctions( const entity_t& ent ){
|
||||||
int axialEdgeLines;
|
int axialEdgeLines;
|
||||||
|
|
||||||
/* meta mode has its own t-junction code (currently not as good as this code) */
|
/* meta mode has its own t-junction code (currently not as good as this code) */
|
||||||
|
|
@ -564,7 +564,7 @@ void FixTJunctions( entity_t *ent ){
|
||||||
// this actually creates axial edges, but it
|
// this actually creates axial edges, but it
|
||||||
// only creates originalEdge_t structures
|
// only creates originalEdge_t structures
|
||||||
// for non-axial edges
|
// for non-axial edges
|
||||||
for ( int i = ent->firstDrawSurf; i < numMapDrawSurfs; ++i )
|
for ( int i = ent.firstDrawSurf; i < numMapDrawSurfs; ++i )
|
||||||
{
|
{
|
||||||
/* get surface and early out if possible */
|
/* get surface and early out if possible */
|
||||||
mapDrawSurface_t& ds = mapDrawSurfs[ i ];
|
mapDrawSurface_t& ds = mapDrawSurfs[ i ];
|
||||||
|
|
@ -610,7 +610,7 @@ void FixTJunctions( entity_t *ent ){
|
||||||
Sys_FPrintf( SYS_VRB, "%9d degenerate edges\n", c_degenerateEdges );
|
Sys_FPrintf( SYS_VRB, "%9d degenerate edges\n", c_degenerateEdges );
|
||||||
|
|
||||||
// insert any needed vertexes
|
// insert any needed vertexes
|
||||||
for ( int i = ent->firstDrawSurf; i < numMapDrawSurfs; ++i )
|
for ( int i = ent.firstDrawSurf; i < numMapDrawSurfs; ++i )
|
||||||
{
|
{
|
||||||
/* get surface and early out if possible */
|
/* get surface and early out if possible */
|
||||||
mapDrawSurface_t& ds = mapDrawSurfs[ i ];
|
mapDrawSurface_t& ds = mapDrawSurfs[ i ];
|
||||||
|
|
|
||||||
|
|
@ -534,7 +534,7 @@ void BeginModel( const entity_t& e ){
|
||||||
finish a model's processing
|
finish a model's processing
|
||||||
*/
|
*/
|
||||||
|
|
||||||
void EndModel( entity_t *e, node_t *headnode ){
|
void EndModel( const entity_t& e, node_t *headnode ){
|
||||||
/* note it */
|
/* note it */
|
||||||
Sys_FPrintf( SYS_VRB, "--- EndModel ---\n" );
|
Sys_FPrintf( SYS_VRB, "--- EndModel ---\n" );
|
||||||
|
|
||||||
|
|
@ -544,6 +544,6 @@ void EndModel( entity_t *e, node_t *headnode ){
|
||||||
|
|
||||||
/* set surfaces and brushes */
|
/* set surfaces and brushes */
|
||||||
mod.numBSPSurfaces = bspDrawSurfaces.size() - mod.firstBSPSurface;
|
mod.numBSPSurfaces = bspDrawSurfaces.size() - mod.firstBSPSurface;
|
||||||
mod.firstBSPBrush = e->firstBrush;
|
mod.firstBSPBrush = e.firstBrush;
|
||||||
mod.numBSPBrushes = e->numBrushes;
|
mod.numBSPBrushes = e.numBrushes;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user