]> de.git.xonotic.org Git - xonotic/netradiant.git/blobdiff - tools/quake3/q3map2/lightmaps_ydnar.c
revert "allocate bigger first"
[xonotic/netradiant.git] / tools / quake3 / q3map2 / lightmaps_ydnar.c
index 19791c4a7118738b539d877e5d2d150c4fc534cd..462331f1ad79ebdef34173719157122209db6f18 100644 (file)
@@ -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;
 }