From b062569fee159545c517c66adc5c8a341a68217c Mon Sep 17 00:00:00 2001 From: Thomas Debesse Date: Fri, 7 Oct 2016 14:45:36 +0200 Subject: [PATCH 1/1] 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; } -- 2.39.2