]> de.git.xonotic.org Git - xonotic/netradiant.git/blobdiff - tools/quake3/q3map2/lightmaps.c
my own uncrustify run
[xonotic/netradiant.git] / tools / quake3 / q3map2 / lightmaps.c
index 13f5c533bccd40a312e392cf2dc65a9a091b351d..34213d109709cf8ca1fd1b4286c1dd36f425b5de 100644 (file)
@@ -1,45 +1,45 @@
 /*
 /*
-Copyright (C) 1999-2007 id Software, Inc. and contributors.
-For a list of contributors, see the accompanying CONTRIBUTORS file.
+   Copyright (C) 1999-2007 id Software, Inc. and contributors.
+   For a list of contributors, see the accompanying CONTRIBUTORS file.
 
 
-This file is part of GtkRadiant.
+   This file is part of GtkRadiant.
 
 
-GtkRadiant is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
+   GtkRadiant is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
 
-GtkRadiant is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   GtkRadiant is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
 
-You should have received a copy of the GNU General Public License
-along with GtkRadiant; if not, write to the Free Software
-Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-*/
+   You should have received a copy of the GNU General Public License
+   along with GtkRadiant; if not, write to the Free Software
+   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
 
 #include "qbsp.h"
 
 
 /*
 
 
 #include "qbsp.h"
 
 
 /*
 
-  Lightmap allocation has to be done after all flood filling and
-  visible surface determination.
+   Lightmap allocation has to be done after all flood filling and
+   visible surface determination.
 
 
-*/
+ */
 
 
-int                                    numSortShaders;
-mapDrawSurface_t       **surfsOnShader;
+int numSortShaders;
+mapDrawSurface_t    **surfsOnShader;
 int allocatedSurfsOnShader;
 
 
 int allocatedSurfsOnShader;
 
 
-int            allocated[ LIGHTMAP_WIDTH ];
+int allocated[ LIGHTMAP_WIDTH ];
 
 
-int            numLightmaps = 1;
-int            c_exactLightmap = 0;
-int            c_planarPatch = 0;
-int            c_nonplanarLightmap = 0;
+int numLightmaps = 1;
+int c_exactLightmap = 0;
+int c_planarPatch = 0;
+int c_nonplanarLightmap = 0;
 
 
 void PrepareNewLightmap( void ) {
 
 
 void PrepareNewLightmap( void ) {
@@ -48,41 +48,40 @@ void PrepareNewLightmap( void ) {
 }
 
 /*
 }
 
 /*
-===============
-AllocLMBlock
+   ===============
+   AllocLMBlock
 
 
-returns a texture number and the position inside it
-===============
-*/
-qboolean AllocLMBlock (int w, int h, int *x, int *y)
-{
-       int             i, j;
-       int             best, best2;
+   returns a texture number and the position inside it
+   ===============
+ */
+qboolean AllocLMBlock( int w, int h, int *x, int *y ){
+       int i, j;
+       int best, best2;
 
        best = LIGHTMAP_HEIGHT;
 
 
        best = LIGHTMAP_HEIGHT;
 
-       for ( i=0 ; i <= LIGHTMAP_WIDTH-w ; i++ ) {
+       for ( i = 0 ; i <= LIGHTMAP_WIDTH - w ; i++ ) {
                best2 = 0;
 
                best2 = 0;
 
-               for (j=0 ; j<w ; j++) {
-                       if (allocated[i+j] >= best) {
+               for ( j = 0 ; j < w ; j++ ) {
+                       if ( allocated[i + j] >= best ) {
                                break;
                        }
                                break;
                        }
-                       if (allocated[i+j] > best2) {
-                               best2 = allocated[i+j];
+                       if ( allocated[i + j] > best2 ) {
+                               best2 = allocated[i + j];
                        }
                }
                        }
                }
-               if (j == w)     {       // this is a valid spot
+               if ( j == w ) {   // this is a valid spot
                        *x = i;
                        *y = best = best2;
                }
        }
 
                        *x = i;
                        *y = best = best2;
                }
        }
 
-       if (best + h > LIGHTMAP_HEIGHT) {
+       if ( best + h > LIGHTMAP_HEIGHT ) {
                return qfalse;
        }
 
                return qfalse;
        }
 
-       for (i=0 ; i<w ; i++) {
+       for ( i = 0 ; i < w ; i++ ) {
                allocated[*x + i] = best + h;
        }
 
                allocated[*x + i] = best + h;
        }
 
@@ -91,29 +90,26 @@ qboolean AllocLMBlock (int w, int h, int *x, int *y)
 
 
 /*
 
 
 /*
-===================
-AllocateLightmapForPatch
-===================
-*/
+   ===================
+   AllocateLightmapForPatch
+   ===================
+ */
 //#define LIGHTMAP_PATCHSHIFT
 
 
 
 /*
 //#define LIGHTMAP_PATCHSHIFT
 
 
 
 /*
-===================
-AllocateLightmapForSurface
-===================
-*/
+   ===================
+   AllocateLightmapForSurface
+   ===================
+ */
 
 //#define      LIGHTMAP_BLOCK  16
 
 
 
 /*
 
 //#define      LIGHTMAP_BLOCK  16
 
 
 
 /*
-===================
-AllocateLightmaps
-===================
-*/
-
-
-
+   ===================
+   AllocateLightmaps
+   ===================
+ */