X-Git-Url: http://de.git.xonotic.org/?p=xonotic%2Fnetradiant.git;a=blobdiff_plain;f=tools%2Fquake3%2Fq3map2%2Fprtfile.c;h=2cd7015c35acb47090c90e996b8121cfcfdb9a25;hp=b5c09484156c3290bfc749a378a512ca0b624f23;hb=b13a86abcfa99aa0898d11e90a9c4e811b55d432;hpb=7fc621fc78d0e040dc2c12f38dc53dd9048215dc diff --git a/tools/quake3/q3map2/prtfile.c b/tools/quake3/q3map2/prtfile.c index b5c09484..2cd7015c 100644 --- a/tools/quake3/q3map2/prtfile.c +++ b/tools/quake3/q3map2/prtfile.c @@ -102,7 +102,7 @@ void CountVisportals_r( node_t *node ){ ================= */ void WritePortalFile_r( node_t *node ){ - int i, s; + int i, s, flags; portal_t *p; winding_t *w; vec3_t normal; @@ -146,14 +146,20 @@ void WritePortalFile_r( node_t *node ){ fprintf( pf,"%i %i %i ",w->numpoints, p->nodes[0]->cluster, p->nodes[1]->cluster ); } + flags = 0; + /* ydnar: added this change to make antiportals work */ - if ( p->compileFlags & C_HINT ) { - fprintf( pf, "1 " ); + if( p->compileFlags & C_HINT ) { + flags |= 1; } - else{ - fprintf( pf, "0 " ); + + /* divVerent: I want farplanedist to not kill skybox. So... */ + if( p->compileFlags & C_SKY ) { + flags |= 2; } + fprintf( pf, "%d ", flags ); + /* write the winding */ for ( i = 0 ; i < w->numpoints ; i++ ) { @@ -365,17 +371,15 @@ void NumberClusters( tree_t *tree ) { WritePortalFile ================ */ -void WritePortalFile( tree_t *tree ){ - char filename[1024]; +void WritePortalFile( tree_t *tree, const char *portalFilePath ){ Sys_FPrintf( SYS_VRB,"--- WritePortalFile ---\n" ); // write the file - sprintf( filename, "%s.prt", source ); - Sys_Printf( "writing %s\n", filename ); - pf = fopen( filename, "w" ); + Sys_Printf( "writing %s\n", portalFilePath ); + pf = fopen( portalFilePath, "w" ); if ( !pf ) { - Error( "Error opening %s", filename ); + Error( "Error opening %s", portalFilePath ); } fprintf( pf, "%s\n", PORTALFILE );