From 6e2d0d139bba6af4d1066b93c0c6a553ffd393b2 Mon Sep 17 00:00:00 2001 From: Garux Date: Tue, 23 Sep 2025 04:46:33 +0500 Subject: [PATCH] define explicit AREA_INVALID constant --- tools/quake3/q3map2/portals.cpp | 8 ++++---- tools/quake3/q3map2/prtfile.cpp | 2 +- tools/quake3/q3map2/q3map2.h | 3 ++- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/tools/quake3/q3map2/portals.cpp b/tools/quake3/q3map2/portals.cpp index 6defab7b..056cb287 100644 --- a/tools/quake3/q3map2/portals.cpp +++ b/tools/quake3/q3map2/portals.cpp @@ -630,7 +630,7 @@ static int c_areas; */ static void FloodAreas_r( node_t *node ){ - if ( node->area != -1 ) { + if ( node->area != AREA_INVALID ) { return; } if ( node->cluster == -1 ) { @@ -678,7 +678,7 @@ static void FindAreas_r( node_t *node ){ return; } - if ( node->opaque || node->area != -1 ) { + if ( node->opaque || node->area != AREA_INVALID ) { return; } @@ -703,7 +703,7 @@ static void CheckAreas_r( const node_t *node ){ } if ( node->cluster != -1 ) { - if ( node->area == -1 ) { + if ( node->area == AREA_INVALID ) { Sys_Warning( "cluster %d has area set to -1\n", node->cluster ); } } @@ -717,7 +717,7 @@ static void CheckAreas_r( const node_t *node ){ */ static void FloodSkyboxArea_r( node_t *node ){ - if ( skyboxArea < 0 ) { + if ( skyboxArea == AREA_INVALID ) { return; } diff --git a/tools/quake3/q3map2/prtfile.cpp b/tools/quake3/q3map2/prtfile.cpp index db8e2708..7576bc88 100644 --- a/tools/quake3/q3map2/prtfile.cpp +++ b/tools/quake3/q3map2/prtfile.cpp @@ -274,7 +274,7 @@ static void NumberLeafs_r( node_t *node, int c ){ return; } - node->area = -1; + node->area = AREA_INVALID; if ( node->opaque ) { // solid block, viewpoint never inside diff --git a/tools/quake3/q3map2/q3map2.h b/tools/quake3/q3map2/q3map2.h index 7ce7c0e1..252152fa 100644 --- a/tools/quake3/q3map2/q3map2.h +++ b/tools/quake3/q3map2/q3map2.h @@ -130,6 +130,7 @@ #define CLIP_EPSILON 0.1f #define PLANESIDE_EPSILON 0.001f #define PLANENUM_LEAF -1 +constexpr int AREA_INVALID = -1; enum class EBrushType { @@ -1891,7 +1892,7 @@ inline const Vector3b debugColors[ 12 ] = { 128, 192, 128 } }; -inline int skyboxArea = -1; +inline int skyboxArea = AREA_INVALID; inline Matrix4 skyboxTransform;