From 82acc9660942603b8f2eb0a70fc1e3aa2074b46f Mon Sep 17 00:00:00 2001 From: Victor Luchits Date: Tue, 28 Jun 2016 12:03:22 +0300 Subject: [PATCH 1/5] Fix default minimum/ambience color for sRGB lightmaps --- tools/quake3/q3map2/light.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/quake3/q3map2/light.c b/tools/quake3/q3map2/light.c index a408e35a..2571d4d2 100644 --- a/tools/quake3/q3map2/light.c +++ b/tools/quake3/q3map2/light.c @@ -1910,14 +1910,14 @@ void LightWorld( const char *BSPFilePath, qboolean fastAllocate ){ /* find the optional minimum lighting values */ GetVectorForKey( &entities[ 0 ], "_color", color ); + if ( VectorLength( color ) == 0.0f ) { + VectorSet( color, 1.0, 1.0, 1.0 ); + } if ( colorsRGB ) { color[0] = Image_LinearFloatFromsRGBFloat( color[0] ); color[1] = Image_LinearFloatFromsRGBFloat( color[1] ); color[2] = Image_LinearFloatFromsRGBFloat( color[2] ); } - if ( VectorLength( color ) == 0.0f ) { - VectorSet( color, 1.0, 1.0, 1.0 ); - } /* ambient */ f = FloatForKey( &entities[ 0 ], "_ambient" ); From 30126305751373d1d9e7df39fcae3068549a625d Mon Sep 17 00:00:00 2001 From: Victor Luchits Date: Thu, 14 Jul 2016 02:00:20 +0300 Subject: [PATCH 2/5] -game qfusion updates --- tools/quake3/q3map2/game_qfusion.h | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/tools/quake3/q3map2/game_qfusion.h b/tools/quake3/q3map2/game_qfusion.h index 3df7e141..5cd5b038 100644 --- a/tools/quake3/q3map2/game_qfusion.h +++ b/tools/quake3/q3map2/game_qfusion.h @@ -103,21 +103,21 @@ { "qfusion", /* -game x */ - "baseq3", /* default base game data dir */ - ".q3a", /* unix home sub-dir */ - "quake", /* magic path word */ + "base", /* default base game data dir */ + ".qfusion", /* unix home sub-dir */ + "qfusion", /* magic path word */ "scripts", /* shader directory */ - 2048, /* max lightmapped surface verts */ - 2048, /* max surface verts */ - 12288, /* max surface indexes */ - qtrue, /* flares */ + 65535, /* max lightmapped surface verts */ + 65535, /* max surface verts */ + 393210, /* max surface indexes */ + qfalse, /* flares */ "flareshader", /* default flare shader */ qfalse, /* wolf lighting model? */ 512, /* lightmap width/height */ 1.0f, /* lightmap gamma */ - qfalse, /* lightmap sRGB */ - qfalse, /* texture sRGB */ - qfalse, /* color sRGB */ + qtrue, /* lightmap sRGB */ + qtrue, /* texture sRGB */ + qtrue, /* color sRGB */ 0.0f, /* lightmap exposure */ 1.0f, /* lightmap compensate */ 1.0f, /* lightgrid scale */ @@ -125,15 +125,15 @@ qtrue, /* light angle attenuation uses half-lambert curve */ qtrue, /* disable shader lightstyles hack */ qtrue, /* keep light entities on bsp */ - 8, /* default patchMeta subdivisions tolerance */ + 4, /* default patchMeta subdivisions tolerance */ qtrue, /* patch casting enabled */ qtrue, /* compile deluxemaps */ 0, /* deluxemaps default mode */ - 256, /* minimap size */ + 512, /* minimap size */ 1.0f, /* minimap sharpener */ - 0.0f, /* minimap border */ + 1.0f / 66.0f, /* minimap border */ qtrue, /* minimap keep aspect */ - MINIMAP_MODE_WHITE, /* minimap mode */ + MINIMAP_MODE_GRAY, /* minimap mode */ "../minimaps/%s.tga", /* minimap name format */ "FBSP", /* bsp file prefix */ 1, /* bsp file version */ From b062569fee159545c517c66adc5c8a341a68217c Mon Sep 17 00:00:00 2001 From: Thomas Debesse Date: Fri, 7 Oct 2016 14:45:36 +0200 Subject: [PATCH 3/5] revert "allocate bigger first" partial revert of d4fa608 see #54 "allocate bigger first" change was meant to save allocation time keeping same lightmap file size, actually wastes both time and size --- tools/quake3/q3map2/lightmaps_ydnar.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tools/quake3/q3map2/lightmaps_ydnar.c b/tools/quake3/q3map2/lightmaps_ydnar.c index 19791c4a..462331f1 100644 --- a/tools/quake3/q3map2/lightmaps_ydnar.c +++ b/tools/quake3/q3map2/lightmaps_ydnar.c @@ -2310,12 +2310,6 @@ static int CompareRawLightmap( const void *a, const void *b ){ /* get min number of surfaces */ min = ( alm->numLightSurfaces < blm->numLightSurfaces ? alm->numLightSurfaces : blm->numLightSurfaces ); - /* compare size, allocate bigger first */ - diff = ( blm->w * blm->h ) - ( alm->w * alm->h ); - if ( diff != 0 ) { - return diff; - } - /* iterate */ for ( i = 0; i < min; i++ ) { @@ -2338,6 +2332,12 @@ static int CompareRawLightmap( const void *a, const void *b ){ return diff; } + /* compare size */ + diff = ( blm->w * blm->h ) - ( alm->w * alm->h ); + if ( diff != 0 ) { + return diff; + } + /* must be equivalent */ return 0; } From 6aa642ef010fc792d98f40cdb7dd7cb1fcbbfda7 Mon Sep 17 00:00:00 2001 From: Rudolf Polzer Date: Wed, 19 Oct 2016 15:22:12 -0400 Subject: [PATCH 4/5] Sorry - nullptr doesn't work with the default Makefile and I don't trust the rest of the code to compile with -std=c++11 yet. --- contrib/bobtoolz/DPatch.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/bobtoolz/DPatch.cpp b/contrib/bobtoolz/DPatch.cpp index 5916d7e0..be49df4e 100644 --- a/contrib/bobtoolz/DPatch.cpp +++ b/contrib/bobtoolz/DPatch.cpp @@ -302,7 +302,7 @@ DPatch* DPatch::MergePatches( patch_merge_t merge_info, DPatch *p1, DPatch *p2 ) int newHeight = p1->height + p2->height - 1; if ( newHeight > MAX_PATCH_HEIGHT ) { - return nullptr; + return NULL; } DPatch* newPatch = new DPatch(); From d93ae92b7fae8a1e88e64906cbf01c2bf59b6716 Mon Sep 17 00:00:00 2001 From: Mattia Basaglia Date: Sun, 12 Mar 2017 19:34:42 +0000 Subject: [PATCH 5/5] Fix compilation --- libs/container/hashtable.h | 1 + libs/splines/q_shared.h | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/libs/container/hashtable.h b/libs/container/hashtable.h index 2c5677ce..0f174d20 100644 --- a/libs/container/hashtable.h +++ b/libs/container/hashtable.h @@ -25,6 +25,7 @@ #include #include #include +#include #include "debugging/debugging.h" diff --git a/libs/splines/q_shared.h b/libs/splines/q_shared.h index 6cad80bc..6ebfb99f 100644 --- a/libs/splines/q_shared.h +++ b/libs/splines/q_shared.h @@ -228,7 +228,7 @@ typedef enum { #define MAX_QINT 0x7fffffff #define MIN_QINT ( -MAX_QINT - 1 ) -#ifndef max +#if !defined(__cplusplus) && !defined(max) #define max( x, y ) ( ( ( x ) > ( y ) ) ? ( x ) : ( y ) ) #define min( x, y ) ( ( ( x ) < ( y ) ) ? ( x ) : ( y ) ) #endif