From: Thomas Debesse Date: Fri, 7 Oct 2016 12:45:36 +0000 (+0200) Subject: revert "allocate bigger first" X-Git-Tag: xonotic-v0.8.2~3^2 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=b062569fee159545c517c66adc5c8a341a68217c;p=xonotic%2Fnetradiant.git 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 --- 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; }