mirror of
https://github.com/TTimo/GtkRadiant.git
synced 2024-11-10 07:11:54 +00:00
tools: reduce diff noise
This commit is contained in:
parent
4d3c983a16
commit
01d635a135
29 changed files with 40 additions and 61 deletions
|
@ -321,7 +321,7 @@ Fail:
|
|||
}
|
||||
|
||||
int lwValidateObject( const char *filename, picoMemStream_t *fp, unsigned int *failID, int *failpos ){
|
||||
unsigned int id, formsize, type;
|
||||
unsigned int id, type;
|
||||
|
||||
/* open the file */
|
||||
|
||||
|
@ -333,7 +333,7 @@ int lwValidateObject( const char *filename, picoMemStream_t *fp, unsigned int *f
|
|||
|
||||
set_flen( 0 );
|
||||
id = getU4( fp );
|
||||
formsize = getU4( fp );
|
||||
/* formsize = */ getU4( fp );
|
||||
type = getU4( fp );
|
||||
if ( 12 != get_flen() ) {
|
||||
return PICO_PMV_ERROR_SIZE;
|
||||
|
|
|
@ -19,7 +19,6 @@
|
|||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
|
||||
#include "aselib.h"
|
||||
#include "inout.h"
|
||||
|
||||
|
|
|
@ -297,7 +297,9 @@ void Q_getwd( char *out ){
|
|||
strcat( out, "\\" );
|
||||
#else
|
||||
// Gef: Changed from getwd() to getcwd() to avoid potential buffer overflow
|
||||
if( !getcwd ( out, 256 ) ) *out = 0;
|
||||
if ( !getcwd( out, 256 ) ) {
|
||||
*out = 0;
|
||||
}
|
||||
strcat( out, "/" );
|
||||
#endif
|
||||
while ( out[i] != 0 )
|
||||
|
|
|
@ -683,7 +683,6 @@ void WritePCXfile( const char *filename, byte *data,
|
|||
void LoadBMP( const char *filename, byte **pic, byte **palette, int *width, int *height ){
|
||||
byte *out;
|
||||
int i;
|
||||
int bfSize;
|
||||
int bfOffBits;
|
||||
int structSize;
|
||||
int bcWidth;
|
||||
|
@ -705,7 +704,7 @@ void LoadBMP( const char *filename, byte **pic, byte **palette, int *width, int
|
|||
Error( "%s is not a bmp file", filename );
|
||||
}
|
||||
|
||||
bfSize = bufLittleLong( in, len, &pos );
|
||||
/* bfSize = */ bufLittleLong( in, len, &pos );
|
||||
bufLittleShort( in, len, &pos );
|
||||
bufLittleShort( in, len, &pos );
|
||||
bfOffBits = bufLittleLong( in, len, &pos );
|
||||
|
@ -756,7 +755,6 @@ void LoadBMP( const char *filename, byte **pic, byte **palette, int *width, int
|
|||
}
|
||||
else {
|
||||
Error( "%s had strange struct size", filename );
|
||||
return;
|
||||
}
|
||||
|
||||
if ( bcPlanes != 1 ) {
|
||||
|
|
|
@ -242,7 +242,7 @@ void Broadcast_Setup( const char *dest ){
|
|||
char sMsg[1024];
|
||||
|
||||
Net_Setup();
|
||||
Net_StringToAddress( (char *)dest, &address );
|
||||
Net_StringToAddress( dest, &address );
|
||||
brdcst_socket = Net_Connect( &address, 0 );
|
||||
if ( brdcst_socket ) {
|
||||
// send in a header
|
||||
|
|
|
@ -287,13 +287,13 @@ static void j_putRGBAScanline( unsigned char* jpegline, int widthPix, unsigned c
|
|||
|
||||
for ( count = 0; count < widthPix; count++ )
|
||||
{
|
||||
unsigned char iRed, iBlu, iGrn, iAlp;
|
||||
unsigned char iRed, iBlu, iGrn /* , iAlp */;
|
||||
unsigned char *oRed, *oBlu, *oGrn, *oAlp;
|
||||
|
||||
iRed = *( jpegline + count * 4 + 0 );
|
||||
iGrn = *( jpegline + count * 4 + 1 );
|
||||
iBlu = *( jpegline + count * 4 + 2 );
|
||||
iAlp = *( jpegline + count * 4 + 3 );
|
||||
/* iAlp = *( jpegline + count * 4 + 3 ); */
|
||||
|
||||
oRed = outBuf + offset + count * 4 + 0;
|
||||
oGrn = outBuf + offset + count * 4 + 1;
|
||||
|
|
|
@ -19,7 +19,6 @@
|
|||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
|
||||
#include "cmdlib.h"
|
||||
#include "qthreads.h"
|
||||
#include "mutex.h"
|
||||
|
|
|
@ -19,7 +19,6 @@
|
|||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
|
||||
#include <stddef.h>
|
||||
|
||||
#include "cmdlib.h"
|
||||
|
|
|
@ -306,12 +306,11 @@ skipspace:
|
|||
==============
|
||||
*/
|
||||
qboolean TokenAvailable( void ) {
|
||||
int oldLine, oldScriptLine;
|
||||
int oldLine;
|
||||
qboolean r;
|
||||
|
||||
/* save */
|
||||
oldLine = scriptline;
|
||||
oldScriptLine = script->line;
|
||||
|
||||
/* test */
|
||||
r = GetToken( qtrue );
|
||||
|
|
|
@ -424,6 +424,7 @@ void ThreadSetDefault( void ){
|
|||
/* default to one thread, only multi-thread when specifically told to */
|
||||
numthreads = 1;
|
||||
}
|
||||
|
||||
if ( numthreads > 1 ) {
|
||||
Sys_Printf( "threads: %d\n", numthreads );
|
||||
}
|
||||
|
|
|
@ -146,7 +146,8 @@ static void vfsInitPakFile( const char *filename ){
|
|||
g_pakFiles = g_slist_append( g_pakFiles, file );
|
||||
|
||||
vfsFixDOSName( filename_inzip );
|
||||
filename_lower = g_ascii_strdown( filename_inzip, -1 );//-1 null terminated string
|
||||
//-1 null terminated string
|
||||
filename_lower = g_ascii_strdown( filename_inzip, -1 );
|
||||
|
||||
file->name = strdup( filename_lower );
|
||||
file->size = file_info.uncompressed_size;
|
||||
|
@ -197,7 +198,6 @@ void vfsInitDirectory( const char *path ){
|
|||
dirlist = g_strdup( name );
|
||||
|
||||
{
|
||||
|
||||
char *ext = strrchr( dirlist, '.' );
|
||||
|
||||
if ( ext != NULL && ( !Q_stricmp( ext, ".pk3dir" ) || !Q_stricmp( ext, ".dpkdir" ) ) ) {
|
||||
|
|
|
@ -277,6 +277,8 @@ void SnapWeldVector( vec3_t a, vec3_t b, vec3_t out ){
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
==================
|
||||
SnapWeldVectorAccu
|
||||
|
|
|
@ -270,7 +270,6 @@ void ProcessWorldModel( void ){
|
|||
char level[ 2 ], shader[ 1024 ];
|
||||
const char *value;
|
||||
|
||||
|
||||
/* sets integer blockSize from worldspawn "_blocksize" key if it exists */
|
||||
value = ValueForKey( &entities[ 0 ], "_blocksize" );
|
||||
if ( value[ 0 ] == '\0' ) {
|
||||
|
|
|
@ -821,7 +821,6 @@ entity_t *FindTargetEntity( const char *target ){
|
|||
void GetEntityShadowFlags( const entity_t *ent, const entity_t *ent2, int *castShadows, int *recvShadows ){
|
||||
const char *value;
|
||||
|
||||
|
||||
/* get cast shadows */
|
||||
if ( castShadows != NULL ) {
|
||||
value = ValueForKey( ent, "_castShadows" );
|
||||
|
|
|
@ -43,7 +43,7 @@
|
|||
|
||||
LEAK FILE GENERATION
|
||||
|
||||
Save out name.line for qe3 to read
|
||||
Save out name.lin for qe3 to read
|
||||
==============================================================================
|
||||
*/
|
||||
|
||||
|
|
|
@ -794,7 +794,6 @@ int LightContributionToSample( trace_t *trace ){
|
|||
float d;
|
||||
vec3_t pushedOrigin;
|
||||
|
||||
|
||||
/* project sample point into light plane */
|
||||
d = DotProduct( trace->origin, light->normal ) - light->dist;
|
||||
if ( d < 3.0f ) {
|
||||
|
@ -919,7 +918,6 @@ int LightContributionToSample( trace_t *trace ){
|
|||
float distByNormal, radiusAtDist, sampleRadius;
|
||||
vec3_t pointAtDist, distToSample;
|
||||
|
||||
|
||||
/* do cone calculation */
|
||||
distByNormal = -DotProduct( trace->displacement, light->normal );
|
||||
if ( distByNormal < 0.0f ) {
|
||||
|
@ -1316,7 +1314,6 @@ void TraceGrid( int num ){
|
|||
contribution_t contributions[ MAX_CONTRIBUTIONS ];
|
||||
trace_t trace;
|
||||
|
||||
|
||||
/* get grid points */
|
||||
gp = &rawGridPoints[ num ];
|
||||
bgp = &bspGridPoints[ num ];
|
||||
|
@ -1507,6 +1504,7 @@ void TraceGrid( int num ){
|
|||
if ( color[ j ] < minGridLight[ j ] ) {
|
||||
color[ j ] = minGridLight[ j ];
|
||||
}
|
||||
|
||||
ColorToBytes( color, bgp->ambient[ i ], 1.0f );
|
||||
ColorToBytes( gp->directed[ i ], bgp->directed[ i ], 1.0f );
|
||||
}
|
||||
|
@ -1724,10 +1722,6 @@ void LightWorld( void ){
|
|||
/* dirty them up */
|
||||
if ( dirty ) {
|
||||
Sys_Printf( "--- DirtyRawLightmap ---\n" );
|
||||
|
||||
|
||||
|
||||
|
||||
RunThreadsOnIndividual( numRawLightmaps, qtrue, DirtyRawLightmap );
|
||||
}
|
||||
|
||||
|
@ -1954,12 +1948,6 @@ int LightMain( int argc, char **argv ){
|
|||
Sys_Printf( "Dark lightmap seams enabled\n" );
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
else if ( !strcmp( argv[ i ], "-shadeangle" ) ) {
|
||||
shadeAngleDegrees = atof( argv[ i + 1 ] );
|
||||
if ( shadeAngleDegrees < 0.0f ) {
|
||||
|
|
|
@ -257,7 +257,6 @@ static void RadSample( int lightmapNum, bspDrawSurface_t *ds, rawLightmap_t *lm,
|
|||
float st[ 2 ], lightmap[ 2 ], *radLuxel;
|
||||
radVert_t *rv[ 3 ];
|
||||
|
||||
|
||||
/* initial setup */
|
||||
ClearBounds( mins, maxs );
|
||||
VectorClear( average );
|
||||
|
@ -544,6 +543,9 @@ static void RadSubdivideDiffuseLight( int lightmapNum, bspDrawSurface_t *ds, raw
|
|||
|
||||
/* bouncing light? */
|
||||
if ( !bouncing ) {
|
||||
/* This is weird. This actually handles surfacelight and not
|
||||
* bounces. */
|
||||
|
||||
/* handle first-pass lights in normal q3a style */
|
||||
value = si->value;
|
||||
light->photons = value * area * areaScale;
|
||||
|
|
|
@ -2274,8 +2274,6 @@ void IlluminateRawLightmap( int rawLightmapNum ){
|
|||
{
|
||||
/* get cluster */
|
||||
cluster = SUPER_CLUSTER( x, y );
|
||||
//% if( *cluster < 0 )
|
||||
//% continue;
|
||||
|
||||
/* get particulars */
|
||||
luxel = SUPER_LUXEL( lightmapNum, x, y );
|
||||
|
@ -2323,6 +2321,7 @@ void IlluminateRawLightmap( int rawLightmapNum ){
|
|||
( lm->splotchFix && ( luxel[ 0 ] <= ambientColor[ 0 ] || luxel[ 1 ] <= ambientColor[ 1 ] || luxel[ 2 ] <= ambientColor[ 2 ] ) ) ) {
|
||||
filterColor = qtrue;
|
||||
}
|
||||
|
||||
if ( deluxemap && lightmapNum == 0 && ( *cluster < 0 || filter ) ) {
|
||||
filterDir = qtrue;
|
||||
}
|
||||
|
|
|
@ -38,7 +38,6 @@
|
|||
|
||||
|
||||
|
||||
|
||||
/* -------------------------------------------------------------------------------
|
||||
|
||||
this file contains code that doe lightmap allocation and projection that
|
||||
|
|
|
@ -308,6 +308,7 @@ void SnapPlaneImproved( vec3_t normal, vec_t *dist, int numPoints, const vec3_t
|
|||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
FindFloatPlane()
|
||||
ydnar: changed to allow a number of test points to be supplied that
|
||||
|
@ -1278,7 +1279,6 @@ void AdjustBrushesForOrigin( entity_t *ent ){
|
|||
brush_t *b;
|
||||
parseMesh_t *p;
|
||||
|
||||
|
||||
/* walk brush list */
|
||||
for ( b = ent->brushes; b != NULL; b = b->next )
|
||||
{
|
||||
|
|
|
@ -231,7 +231,6 @@ void ParsePatch( qboolean onlyLights ){
|
|||
float longestCurve;
|
||||
int maxIterations;
|
||||
|
||||
|
||||
MatchToken( "{" );
|
||||
|
||||
/* get texture */
|
||||
|
|
|
@ -98,6 +98,7 @@ void LokiInitPaths( char *argv0 ){
|
|||
/* this is kinda crap, but hey */
|
||||
strcpy( installPath, "../" );
|
||||
#else
|
||||
|
||||
char temp[ MAX_OS_PATH ];
|
||||
char *home;
|
||||
char *path;
|
||||
|
|
|
@ -102,6 +102,7 @@ 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...
|
||||
fprintf( pf,"%i %i %i ",w->numpoints, p->nodes[1]->cluster, p->nodes[0]->cluster );
|
||||
}
|
||||
|
|
|
@ -806,7 +806,6 @@ shaderInfo_t *ShaderInfoForShader( const char *shaderName ){
|
|||
shaderInfo_t *si;
|
||||
char shader[ MAX_QPATH ];
|
||||
|
||||
|
||||
/* dummy check */
|
||||
if ( shaderName == NULL || shaderName[ 0 ] == '\0' ) {
|
||||
Sys_FPrintf( SYS_WRN, "WARNING: Null or empty shader name\n" );
|
||||
|
@ -1332,7 +1331,6 @@ static void ParseShaderFile( const char *filename ){
|
|||
else if ( !Q_stricmp( token, "q3map_surfacemodel" ) ) {
|
||||
surfaceModel_t *model;
|
||||
|
||||
|
||||
/* allocate new model and attach it */
|
||||
model = safe_malloc( sizeof( *model ) );
|
||||
memset( model, 0, sizeof( *model ) );
|
||||
|
|
|
@ -2538,7 +2538,6 @@ void EmitPatchSurface( mapDrawSurface_t *ds ){
|
|||
if ( ds->backSide || ds->shaderInfo->invert ) {
|
||||
bspDrawVert_t *dv1, *dv2, temp;
|
||||
|
||||
|
||||
/* walk the verts, flip the normal */
|
||||
for ( i = 0; i < ds->numVerts; i++ )
|
||||
VectorScale( ds->verts[ i ].normal, -1.0f, ds->verts[ i ].normal );
|
||||
|
@ -2755,7 +2754,6 @@ static void EmitTriangleSurface( mapDrawSurface_t *ds ){
|
|||
int i, temp;
|
||||
bspDrawSurface_t *out;
|
||||
|
||||
|
||||
/* invert the surface if necessary */
|
||||
if ( ds->backSide || ds->shaderInfo->invert ) {
|
||||
/* walk the indexes, reverse the triangle order */
|
||||
|
|
|
@ -316,7 +316,6 @@ void TriangulatePatchSurface( mapDrawSurface_t *ds ){
|
|||
mapDrawSurface_t *dsNew;
|
||||
mesh_t src, *subdivided, *mesh;
|
||||
|
||||
|
||||
/* try to early out */
|
||||
if ( ds->numVerts == 0 || ds->type != SURFACE_PATCH || patchMeta == qfalse ) {
|
||||
return;
|
||||
|
@ -854,7 +853,6 @@ void FixMetaTJunctions( void ){
|
|||
VectorSet( metaVerts[ tri->indexes[ k ] ].color[ 0 ], 255, 204, 0 );
|
||||
VectorSet( metaVerts[ tri->indexes[ ( k + 1 ) % 3 ] ].color[ 0 ], 255, 204, 0 );
|
||||
|
||||
|
||||
/* the edge opposite the zero-weighted vertex was hit, so use that as an amount */
|
||||
a = &metaVerts[ tri->indexes[ k % 3 ] ];
|
||||
b = &metaVerts[ tri->indexes[ ( k + 1 ) % 3 ] ];
|
||||
|
@ -945,7 +943,6 @@ void SmoothMetaTriangles( void ){
|
|||
int indexes[ MAX_SAMPLES ];
|
||||
vec3_t votes[ MAX_SAMPLES ];
|
||||
|
||||
|
||||
/* note it */
|
||||
Sys_FPrintf( SYS_VRB, "--- SmoothMetaTriangles ---\n" );
|
||||
|
||||
|
@ -973,6 +970,7 @@ void SmoothMetaTriangles( void ){
|
|||
else{
|
||||
shadeAngle = defaultShadeAngle;
|
||||
}
|
||||
|
||||
if ( shadeAngle > maxShadeAngle ) {
|
||||
maxShadeAngle = shadeAngle;
|
||||
}
|
||||
|
|
|
@ -55,7 +55,8 @@ typedef struct edgeLine_s {
|
|||
vec3_t origin;
|
||||
vec3_t dir;
|
||||
|
||||
edgePoint_t chain; // unused element of doubly linked list
|
||||
// unused element of doubly linked list
|
||||
edgePoint_t chain;
|
||||
} edgeLine_t;
|
||||
|
||||
typedef struct {
|
||||
|
@ -67,7 +68,6 @@ typedef struct {
|
|||
originalEdge_t originalEdges[MAX_ORIGINAL_EDGES];
|
||||
int numOriginalEdges;
|
||||
|
||||
|
||||
#define MAX_EDGE_LINES 0x10000
|
||||
edgeLine_t edgeLines[MAX_EDGE_LINES];
|
||||
int numEdgeLines;
|
||||
|
@ -636,7 +636,6 @@ void FixTJunctions( entity_t *ent ){
|
|||
int axialEdgeLines;
|
||||
originalEdge_t *e;
|
||||
|
||||
|
||||
/* meta mode has its own t-junction code (currently not as good as this code) */
|
||||
//% if( meta )
|
||||
//% return;
|
||||
|
|
Loading…
Reference in a new issue