]> de.git.xonotic.org Git - xonotic/netradiant.git/blobdiff - contrib/bobtoolz/visfind.cpp
Revert partially (auto) "reformat code! now the code is only ugly on the *inside*"
[xonotic/netradiant.git] / contrib / bobtoolz / visfind.cpp
index f8e327ab5acde1adef97651aa844244a3842c8f0..629c163336688a4b1ca5808e84a0f7eef5617801 100644 (file)
@@ -2,11 +2,13 @@
 // Date: Oct 5, 2001
 // Written by: Brad Whitehead (whiteheb@gamerstv.net)
 
-#include "StdAfx.h"
+#include "visfind.h"
 #include "dialogs/dialogs-gtk.h"
 #include "DWinding.h"
 #include "bsploader.h"
 
+#include <list>
+
 typedef struct {
        int portalclusters;
        int leafbytes;           //leafbytes = ((portalclusters+63)&~63)>>3;
@@ -125,7 +127,7 @@ int bsp_countclusters_mask( byte *bitvector, byte *maskvector, int length ){
        return( c );
 }
 
-void AddCluster( list<DWinding*> *pointlist, dleaf_t *cl, qboolean* repeatlist, vec3_t clr ){
+void AddCluster( std::list<DWinding*> *pointlist, dleaf_t    *cl, bool* repeatlist, vec3_t clr ){
        DWinding*   w;
 
        int* leafsurf = &dleafsurfaces[cl->firstLeafSurface];
@@ -142,7 +144,7 @@ void AddCluster( list<DWinding*> *pointlist, dleaf_t *cl, qboolean* repeatlist,
 
                qdrawVert_t* vert = &drawVerts[surf->firstVert];
                if ( surf->firstVert + surf->numVerts > numDrawVerts ) {
-                       DoMessageBox( "Warning", "Warning", MB_OK );
+                       DoMessageBox( "Warning", "Warning", eMB_OK );
                }
 
                w = new DWinding();
@@ -169,11 +171,11 @@ void AddCluster( list<DWinding*> *pointlist, dleaf_t *cl, qboolean* repeatlist,
    CreateTrace
    =============
  */
-list<DWinding*> *CreateTrace( dleaf_t *leaf, int c, vis_header *header, byte *visdata, byte *seen ){
+std::list<DWinding*> *CreateTrace( dleaf_t *leaf, int c, vis_header *header, byte *visdata, byte *seen ){
        byte        *vis;
        int i, j, clusterNum;
-       list<DWinding*> *pointlist = new list<DWinding*>;
-       qboolean*   repeatlist = new qboolean[numDrawSurfaces];
+       std::list<DWinding*> *pointlist = new std::list<DWinding*>;
+       bool*   repeatlist = new bool[numDrawSurfaces];
        dleaf_t     *cl;
 
        vec3_t clrRnd[5] =  {
@@ -186,7 +188,7 @@ list<DWinding*> *CreateTrace( dleaf_t *leaf, int c, vis_header *header, byte *vi
 
        vec3_t clrGreen =   {0.f, 1.f, 0.f};
 
-       memset( repeatlist, 0, sizeof( qboolean ) * numDrawSurfaces );
+       memset( repeatlist, 0, sizeof( bool ) * numDrawSurfaces );
 
        vis = visdata + ( c * header->leafbytes );
 
@@ -219,7 +221,7 @@ list<DWinding*> *CreateTrace( dleaf_t *leaf, int c, vis_header *header, byte *vi
    setup for CreateTrace
    =============
  */
-list<DWinding*> *TraceCluster( int leafnum ){
+std::list<DWinding*> *TraceCluster( int leafnum ){
        byte seen[( MAX_MAP_LEAFS / 8 ) + 1];
        vis_header      *vheader;
        byte            *visdata;
@@ -236,14 +238,14 @@ list<DWinding*> *TraceCluster( int leafnum ){
        return CreateTrace( leaf, leaf->cluster, vheader, visdata, seen );
 }
 
-list<DWinding *>* BuildTrace( char* filename, vec3_t v_origin ){
+std::list<DWinding *>* BuildTrace( char* filename, vec3_t v_origin ){
        if ( !LoadBSPFile( filename ) ) {
                return NULL;
        }
 
        int leafnum = bsp_leafnumfororigin( v_origin );
 
-       list<DWinding*> *pointlist = TraceCluster( leafnum );
+       std::list<DWinding*> *pointlist = TraceCluster( leafnum );
 
        FreeBSPData();