]> de.git.xonotic.org Git - xonotic/netradiant.git/blobdiff - contrib/prtview/portals.cpp
Merge branch 'msys2thread' into 'master'
[xonotic/netradiant.git] / contrib / prtview / portals.cpp
index a896fcd4276e48ae18eee8d08ea66acea1655109..7a2d99d15ee76bea40ca854201e4a147d2d1a66c 100644 (file)
  */
 
 #include "portals.h"
+#include "globaldefs.h"
 #include <string.h>
 #include <stdlib.h>
-#ifndef __APPLE__
+#if !GDEF_OS_MACOS
 #include <search.h>
 #endif
 #include <stdio.h>
@@ -30,7 +31,7 @@
 
 #include "prtview.h"
 
-#define LINE_BUF 1000
+const int LINE_BUF = 1000;
 
 CPortals portals;
 CPortalsRender render;
@@ -271,7 +272,7 @@ void CPortals::Load(){
                }
 
                if ( !portal[n].Build( buf ) ) {
-                       if ( first && sscanf( buf, "%d %d", &test_vals_1, &test_vals_2 ) == 1 ) { // skip additional counts of later data, not needed
+                       if ( first && sscanf( buf, "%d %d", (int *) &test_vals_1, (int *) &test_vals_2 ) == 1 ) { // skip additional counts of later data, not needed
                                // We can count on hint flags being in the file
                                hint_flags = true;
                                continue;
@@ -603,7 +604,7 @@ void CPortalsDrawSolid::render( RenderStateFlags state ) const {
 }
 
 void CPortalsDrawSolidOutline::render( RenderStateFlags state ) const {
-       for ( int n = 0; n < portals.portal_count; n++ )
+       for ( unsigned int n = 0; n < portals.portal_count; n++ )
        {
                if ( portals.lines == 2 && !portals.portal[n].hint ) {
                        continue;
@@ -613,26 +614,26 @@ void CPortalsDrawSolidOutline::render( RenderStateFlags state ) const {
                        if ( clip.min[0] < portals.portal[n].min[0] ) {
                                continue;
                        }
-                       else if ( clip.min[1] < portals.portal[n].min[1] ) {
+                       if ( clip.min[1] < portals.portal[n].min[1] ) {
                                continue;
                        }
-                       else if ( clip.min[2] < portals.portal[n].min[2] ) {
+                       if ( clip.min[2] < portals.portal[n].min[2] ) {
                                continue;
                        }
-                       else if ( clip.max[0] > portals.portal[n].max[0] ) {
+                       if ( clip.max[0] > portals.portal[n].max[0] ) {
                                continue;
                        }
-                       else if ( clip.max[1] > portals.portal[n].max[1] ) {
+                       if ( clip.max[1] > portals.portal[n].max[1] ) {
                                continue;
                        }
-                       else if ( clip.max[2] > portals.portal[n].max[2] ) {
+                       if ( clip.max[2] > portals.portal[n].max[2] ) {
                                continue;
                        }
                }
 
                glBegin( GL_LINE_LOOP );
 
-               for ( int p = 0; p < portals.portal[n].point_count; p++ )
+               for ( unsigned int p = 0; p < portals.portal[n].point_count; p++ )
                        glVertex3fv( portals.portal[n].inner_point[p].p );
 
                glEnd();