reduce diff noise

This commit is contained in:
Thomas Debesse 2018-01-28 04:32:58 +01:00
parent 6649445a46
commit bf2da7441f
12 changed files with 129 additions and 146 deletions

View File

@ -39,7 +39,7 @@ void Save256Image( const char *name, byte *pixels, byte *palette,
void LoadTGA( const char *filename, byte **pixels, int *width, int *height );
void LoadTGABuffer( const byte *buffer, const byte* enddata, byte **pic, int *width, int *height );
void WriteTGA( const char *filename, byte *data, int width, int height );
int LoadJPGBuff( void *src_buffer, int src_size, unsigned char **pic, int *width, int *height );
void WriteTGAGray (const char *filename, byte *data, int width, int height);
int LoadJPGBuff( void *src_buffer, int src_size, unsigned char **pic, int *width, int *height );
void Load32BitImage( const char *name, unsigned **pixels, int *width, int *height );

View File

@ -318,22 +318,10 @@ void BuildFaceTree_r( node_t *node, face_t *list ){
}
}
#if 0
if((node->compileFlags & C_DETAIL) && isstruct)
Sys_FPrintf(SYS_ERR, "I am detail, my child is structural, this is a wtf1\n", node->has_structural_children);
#endif
for ( i = 0 ; i < 2 ; i++ ) {
BuildFaceTree_r( node->children[i], childLists[i] );
node->has_structural_children |= node->children[i]->has_structural_children;
}
#if 0
if((node->compileFlags & C_DETAIL) && !(node->children[0]->compileFlags & C_DETAIL) && node->children[0]->planenum != PLANENUM_LEAF)
Sys_FPrintf(SYS_ERR, "I am detail, my child is structural\n", node->has_structural_children);
if((node->compileFlags & C_DETAIL) && isstruct)
Sys_FPrintf(SYS_ERR, "I am detail, my child is structural, this is a wtf2\n", node->has_structural_children);
#endif
}

View File

@ -41,6 +41,7 @@ several games based on the Quake III Arena engine, in the form of "Q3Map2."
content and surface flags - also uses defines from game_quake3.h
------------------------------------------------------------------------------- */
#define UNV_CONT_NOALIENBUILD 0x1000
#define UNV_CONT_NOHUMANBUILD 0x2000
#define UNV_CONT_NOBUILD 0x4000
@ -90,13 +91,11 @@ game_t struct
/* default */
{ "default", Q_CONT_SOLID, -1, 0, -1, C_SOLID, -1 },
/* ydnar */
{ "lightgrid", 0, 0, 0, 0, C_LIGHTGRID, 0 },
{ "antiportal", 0, 0, 0, 0, C_ANTIPORTAL, 0 },
{ "skip", 0, 0, 0, 0, C_SKIP, 0 },
/* compiler */
{ "origin", Q_CONT_ORIGIN, Q_CONT_SOLID, 0, 0, C_ORIGIN | C_TRANSLUCENT, C_SOLID },
{ "areaportal", Q_CONT_AREAPORTAL, Q_CONT_SOLID, 0, 0, C_AREAPORTAL | C_TRANSLUCENT, C_SOLID },
@ -111,7 +110,6 @@ game_t struct
{ "nolightmap", 0, 0, Q_SURF_VERTEXLIT, 0, C_VERTEXLIT, 0 },
{ "pointlight", 0, 0, Q_SURF_VERTEXLIT, 0, C_VERTEXLIT, 0 },
/* game */
{ "nonsolid", 0, Q_CONT_SOLID, Q_SURF_NONSOLID, 0, 0, C_SOLID },
@ -144,7 +142,6 @@ game_t struct
{ "nodlight", 0, 0, Q_SURF_NODLIGHT, 0, 0, 0 },
{ "dust", 0, 0, Q_SURF_DUST, 0, 0, 0 },
/* unvanquished */
{"noalienbuild", UNV_CONT_NOALIENBUILD, 0, 0, 0, 0, 0 },
{"nohumanbuild", UNV_CONT_NOHUMANBUILD, 0, 0, 0, 0, 0 },
@ -154,13 +151,10 @@ game_t struct
{"nohumanbuildsurface", 0, 0, UNV_SURF_NOHUMANBUILDSURFACE, 0, 0, 0 },
{"nobuildsurface", 0, 0, UNV_SURF_NOBUILDSURFACE, 0, 0, 0 },
/* null */
{ NULL, 0, 0, 0, 0, 0, 0 }
}
}
/* end marker */
#endif

View File

@ -1596,8 +1596,9 @@ void DirtyRawLightmap( int rawLightmapNum ){
static qboolean SubmapRawLuxel( rawLightmap_t *lm, int x, int y, float bx, float by, int *sampleCluster, vec3_t sampleOrigin, vec3_t sampleNormal ){
int i, *cluster, *cluster2;
float *origin, *origin2, *normal;
vec3_t originVecs[ 2 ];
float *origin, *origin2, *normal; //% , *normal2;
vec3_t originVecs[ 2 ]; //% , normalVecs[ 2 ];
/* calulate x vector */
if ( ( x < ( lm->sw - 1 ) && bx >= 0.0f ) || ( x == 0 && bx <= 0.0f ) ) {
@ -2784,7 +2785,6 @@ void SetupBrushesFlags( unsigned int mask_any, unsigned int test_any, unsigned i
bspShader_t *shader;
shaderInfo_t *si;
/* note it */
Sys_FPrintf( SYS_VRB, "--- SetupBrushes ---\n" );
@ -2822,11 +2822,11 @@ void SetupBrushesFlags( unsigned int mask_any, unsigned int test_any, unsigned i
/* or together compile flags */
compileFlags |= si->compileFlags;
allCompileFlags &= si->compileFlags;
}
/* determine if this brush is opaque to light */
if( (compileFlags & mask_any) == test_any && (allCompileFlags & mask_all) == test_all )
{
if ( ( compileFlags & mask_any ) == test_any && ( allCompileFlags & mask_all ) == test_all ) {
opaqueBrushes[ b >> 3 ] |= ( 1 << ( b & 7 ) );
numOpaqueBrushes++;
maxOpaqueBrush = i;
@ -2836,8 +2836,7 @@ void SetupBrushesFlags( unsigned int mask_any, unsigned int test_any, unsigned i
/* emit some statistics */
Sys_FPrintf( SYS_VRB, "%9d opaque brushes\n", numOpaqueBrushes );
}
void SetupBrushes( void )
{
void SetupBrushes( void ){
SetupBrushesFlags( C_TRANSLUCENT, 0, 0, 0 );
}

View File

@ -249,8 +249,9 @@ int main( int argc, char **argv ){
}
/* div0: minimap */
else if( !strcmp( argv[ 1 ], "-minimap" ) )
else if ( !strcmp( argv[ 1 ], "-minimap" ) ) {
r = MiniMapBSPMain( argc - 1, argv + 1 );
}
/* ydnar: otherwise create a bsp */
else{

View File

@ -389,8 +389,7 @@ void InsertModel( char *name, int frame, m4x4_t transform, remap_t *remap, shade
{
dv->lightmap[ j ][ 0 ] = 0.0f;
dv->lightmap[ j ][ 1 ] = 0.0f;
if(spawnFlags & 32) // spawnflag 32: model color -> alpha hack
{
if ( spawnFlags & 32 ) { // spawnflag 32: model color -> alpha hack
dv->color[ j ][ 0 ] = 255.0f;
dv->color[ j ][ 1 ] = 255.0f;
dv->color[ j ][ 2 ] = 255.0f;

View File

@ -64,9 +64,8 @@ void WriteFloat( FILE *f, vec_t v ){
}
}
void CountVisportals_r(node_t *node)
{
int i, s;
void CountVisportals_r( node_t *node ){
int s;
portal_t *p;
winding_t *w;
vec3_t normal;
@ -87,12 +86,13 @@ void CountVisportals_r(node_t *node)
{
w = p->winding;
s = ( p->nodes[1] == node );
if (w && p->nodes[0] == node)
{
if (!PortalPassable(p))
if ( w && p->nodes[0] == node ) {
if ( !PortalPassable( p ) ) {
continue;
if(p->nodes[0]->cluster == p->nodes[1]->cluster)
}
if ( p->nodes[0]->cluster == p->nodes[1]->cluster ) {
continue;
}
++num_visportals;
}
}
@ -129,8 +129,9 @@ void WritePortalFile_r( node_t *node ){
if ( !PortalPassable( p ) ) {
continue;
}
if(p->nodes[0]->cluster == p->nodes[1]->cluster)
if ( p->nodes[0]->cluster == p->nodes[1]->cluster ) {
continue;
}
--num_visportals;
// write out to the file
@ -139,8 +140,8 @@ void WritePortalFile_r( node_t *node ){
// plane the same way vis will, and flip the side orders if needed
// FIXME: is this still relevent?
WindingPlane( w, normal, &dist );
if ( DotProduct (p->plane.normal, normal) < 0.99 )
{ // backwards...
if ( DotProduct( p->plane.normal, normal ) < 0.99 ) { // backwards...
fprintf( pf,"%i %i %i ",w->numpoints, p->nodes[1]->cluster, p->nodes[0]->cluster );
}
else{
@ -170,9 +171,8 @@ void WritePortalFile_r( node_t *node ){
}
void CountSolidFaces_r (node_t *node)
{
int i, s;
void CountSolidFaces_r( node_t *node ){
int s;
portal_t *p;
winding_t *w;
@ -191,12 +191,13 @@ void CountSolidFaces_r (node_t *node)
{
w = p->winding;
s = ( p->nodes[1] == node );
if (w)
{
if (PortalPassable(p))
if ( w ) {
if ( PortalPassable( p ) ) {
continue;
if(p->nodes[0]->cluster == p->nodes[1]->cluster)
}
if ( p->nodes[0]->cluster == p->nodes[1]->cluster ) {
continue;
}
// write out to the file
++num_solidfaces;
@ -272,23 +273,23 @@ void WriteFaceFile_r( node_t *node ){
NumberLeafs_r
================
*/
void NumberLeafs_r (node_t *node, int c)
{
void NumberLeafs_r( node_t *node, int c ){
#if 0
portal_t *p;
#endif
if ( node->planenum != PLANENUM_LEAF ) {
// decision node
node->cluster = -99;
if(node->has_structural_children)
{
if ( node->has_structural_children ) {
NumberLeafs_r( node->children[0], c );
NumberLeafs_r( node->children[1], c );
}
else
{
if(c < 0)
if ( c < 0 ) {
c = num_visclusters++;
}
NumberLeafs_r( node->children[0], c );
NumberLeafs_r( node->children[1], c );
}
@ -303,8 +304,9 @@ void NumberLeafs_r (node_t *node, int c)
return;
}
if(c < 0)
if ( c < 0 ) {
c = num_visclusters++;
}
node->cluster = c;

View File

@ -1766,7 +1766,7 @@ void DirtyRawLightmap( int num );
void IlluminateRawLightmap( int num );
void IlluminateVertexes( int num );
void SetupBrushesFlags( int mask_any, int test_any, int mask_all, int test_all );
void SetupBrushesFlags( unsigned int mask_any, unsigned int test_any, unsigned int mask_all, unsigned int test_all );
void SetupBrushes( void );
void SetupClusters( void );
qboolean ClusterVisible( int a, int b );
@ -1897,7 +1897,7 @@ Q_EXTERN game_t games[]
,
#include "game_tremulous.h" /*LinuxManMikeC: must be after game_quake3.h, depends on #define's set in it */
,
#include "game_unvanquished.h" /* must be after game_quake3.h as they share defines! */
#include "game_unvanquished.h" /* must be after game_tremulous.h as they share defines! */
,
#include "game_tenebrae.h"
,
@ -2107,7 +2107,6 @@ Q_EXTERN qboolean nosort;
Q_EXTERN qboolean saveprt;
Q_EXTERN qboolean hint; /* ydnar */
Q_EXTERN char inbase[ MAX_QPATH ];
Q_EXTERN char inbase[ MAX_QPATH ];
Q_EXTERN char globalCelShader[ MAX_QPATH ];
/* other bits */

View File

@ -802,8 +802,9 @@ static void LoadShaderImages( shaderInfo_t *si ){
*/
shaderInfo_t *ShaderInfoForShaderNull( const char *shaderName ){
if(!strcmp(shaderName, "noshader"))
if ( !strcmp( shaderName, "noshader" ) ) {
return NULL;
}
return ShaderInfoForShader( shaderName );
}
@ -1464,7 +1465,7 @@ static void ParseShaderFile( const char *filename ){
si->lightmapSampleSize = atoi( token );
}
/* q3map_lightmapSampleSffset <value> */
/* q3map_lightmapSampleOffset <value> */
else if ( !Q_stricmp( token, "q3map_lightmapSampleOffset" ) ) {
GetTokenAppend( shaderText, qfalse );
si->lightmapSampleOffset = atof( token );