*/
#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>
#include "prtview.h"
-#define LINE_BUF 1000
+const int LINE_BUF = 1000;
CPortals portals;
CPortalsRender render;
}
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;
}
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;
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();