From e0917fd547c742a6857beea1ccc6245c0d8caeee Mon Sep 17 00:00:00 2001 From: Graham Pentheny Date: Sun, 31 Aug 2025 23:24:05 -0400 Subject: [PATCH] Clean up includes in cpp files --- RecastDemo/Source/AppData.cpp | 1 - RecastDemo/Source/InputGeom.cpp | 10 +------- RecastDemo/Source/PartitionedMesh.cpp | 6 ----- RecastDemo/Source/Sample.cpp | 5 ---- RecastDemo/Source/SampleInterfaces.cpp | 6 ----- RecastDemo/Source/Sample_SoloMesh.cpp | 7 ------ RecastDemo/Source/Sample_TempObstacles.cpp | 15 ++++++------ RecastDemo/Source/Sample_TileMesh.cpp | 12 +++------- RecastDemo/Source/TestCase.cpp | 7 ------ RecastDemo/Source/Tool_ConvexVolume.cpp | 4 ---- RecastDemo/Source/Tool_Crowd.cpp | 11 +++------ RecastDemo/Source/Tool_NavMeshPrune.cpp | 4 ---- RecastDemo/Source/Tool_NavMeshTester.cpp | 7 +----- RecastDemo/Source/Tool_OffMeshConnection.cpp | 5 ---- RecastDemo/Source/ValueHistory.cpp | 6 ----- RecastDemo/Source/main.cpp | 24 ++++++++------------ 16 files changed, 26 insertions(+), 104 deletions(-) diff --git a/RecastDemo/Source/AppData.cpp b/RecastDemo/Source/AppData.cpp index 65bb6b9e..40749bb5 100644 --- a/RecastDemo/Source/AppData.cpp +++ b/RecastDemo/Source/AppData.cpp @@ -2,7 +2,6 @@ #include "InputGeom.h" #include "Sample.h" -#include "TestCase.h" #include "SDL_opengl.h" diff --git a/RecastDemo/Source/InputGeom.cpp b/RecastDemo/Source/InputGeom.cpp index 0b8e30bb..3d4fdd0c 100644 --- a/RecastDemo/Source/InputGeom.cpp +++ b/RecastDemo/Source/InputGeom.cpp @@ -19,16 +19,8 @@ #include "InputGeom.h" #include "PartitionedMesh.h" -#include "DebugDraw.h" +#include "SampleInterfaces.h" #include "Recast.h" -#include "Sample.h" - -#include -#include -#include -#include - -#include namespace { diff --git a/RecastDemo/Source/PartitionedMesh.cpp b/RecastDemo/Source/PartitionedMesh.cpp index f3f64d1d..f1ed0217 100644 --- a/RecastDemo/Source/PartitionedMesh.cpp +++ b/RecastDemo/Source/PartitionedMesh.cpp @@ -18,12 +18,6 @@ #include "PartitionedMesh.h" -#include -#include -#include - -#include - struct IndexedBounds { float bmin[2]; diff --git a/RecastDemo/Source/Sample.cpp b/RecastDemo/Source/Sample.cpp index 594d7ad2..4c6c1edd 100644 --- a/RecastDemo/Source/Sample.cpp +++ b/RecastDemo/Source/Sample.cpp @@ -20,17 +20,12 @@ #include "DetourCrowd.h" #include "DetourDebugDraw.h" -#include "DetourNavMesh.h" -#include "DetourNavMeshQuery.h" #include "InputGeom.h" -#include "Recast.h" #include "RecastDebugDraw.h" #include "imguiHelpers.h" #include -#include - const char* toolNames[] = { "None", "Create Tiles", diff --git a/RecastDemo/Source/SampleInterfaces.cpp b/RecastDemo/Source/SampleInterfaces.cpp index b6819858..355a80cb 100644 --- a/RecastDemo/Source/SampleInterfaces.cpp +++ b/RecastDemo/Source/SampleInterfaces.cpp @@ -1,13 +1,7 @@ #include "SampleInterfaces.h" -#include "PerfTimer.h" -#include "Recast.h" #include "SDL_opengl.h" -#include -#include -#include - #ifdef WIN32 # define snprintf _snprintf # include diff --git a/RecastDemo/Source/Sample_SoloMesh.cpp b/RecastDemo/Source/Sample_SoloMesh.cpp index 0fc65c43..39a58586 100644 --- a/RecastDemo/Source/Sample_SoloMesh.cpp +++ b/RecastDemo/Source/Sample_SoloMesh.cpp @@ -19,14 +19,10 @@ #include "Sample_SoloMesh.h" #include "DetourDebugDraw.h" -#include "DetourNavMesh.h" #include "DetourNavMeshBuilder.h" #include "InputGeom.h" -#include "Recast.h" #include "RecastDebugDraw.h" -#include "RecastDump.h" #include "SDL_opengl.h" -#include "Sample.h" #include "Tool_ConvexVolume.h" #include "Tool_Crowd.h" #include "Tool_NavMeshPrune.h" @@ -35,9 +31,6 @@ #include -#include -#include - const char* Sample_SoloMesh::drawModeNames[]{ "Input Mesh", "Navmesh", diff --git a/RecastDemo/Source/Sample_TempObstacles.cpp b/RecastDemo/Source/Sample_TempObstacles.cpp index cfc81f2f..5b1b2331 100644 --- a/RecastDemo/Source/Sample_TempObstacles.cpp +++ b/RecastDemo/Source/Sample_TempObstacles.cpp @@ -18,26 +18,27 @@ #include "SDL_opengl.h" -#include -#include -#include -#include "PartitionedMesh.h" #include "DetourCommon.h" #include "DetourDebugDraw.h" -#include "DetourNavMesh.h" #include "DetourNavMeshBuilder.h" #include "DetourTileCache.h" #include "InputGeom.h" +#include "PartitionedMesh.h" #include "Recast.h" #include "RecastDebugDraw.h" #include "Sample.h" #include "Sample_TempObstacles.h" -#include "fastlz.h" -#include "imguiHelpers.h" #include "Tool_ConvexVolume.h" #include "Tool_Crowd.h" #include "Tool_NavMeshTester.h" #include "Tool_OffMeshConnection.h" +#include "fastlz.h" +#include "imguiHelpers.h" + +#include + +#include +#include #ifdef WIN32 # define snprintf _snprintf diff --git a/RecastDemo/Source/Sample_TileMesh.cpp b/RecastDemo/Source/Sample_TileMesh.cpp index 53e25968..b97ddedd 100644 --- a/RecastDemo/Source/Sample_TileMesh.cpp +++ b/RecastDemo/Source/Sample_TileMesh.cpp @@ -18,25 +18,19 @@ #include "Sample_TileMesh.h" -#include "SDL_opengl.h" -#include "imguiHelpers.h" - -#include -#include -#include -#include "PartitionedMesh.h" #include "DetourDebugDraw.h" #include "DetourNavMesh.h" #include "DetourNavMeshBuilder.h" #include "InputGeom.h" -#include "Recast.h" +#include "PartitionedMesh.h" #include "RecastDebugDraw.h" -#include "Sample.h" +#include "SDL_opengl.h" #include "Tool_ConvexVolume.h" #include "Tool_Crowd.h" #include "Tool_NavMeshPrune.h" #include "Tool_NavMeshTester.h" #include "Tool_OffMeshConnection.h" +#include "imguiHelpers.h" #include diff --git a/RecastDemo/Source/TestCase.cpp b/RecastDemo/Source/TestCase.cpp index c9579cd4..0cba3304 100644 --- a/RecastDemo/Source/TestCase.cpp +++ b/RecastDemo/Source/TestCase.cpp @@ -19,18 +19,11 @@ #include "TestCase.h" #include "DetourCommon.h" -#include "DetourNavMesh.h" #include "DetourNavMeshQuery.h" #include "SDL_opengl.h" #include "SampleInterfaces.h" #include "imguiHelpers.h" -#include -#include -#include -#include -#include "PerfTimer.h" - #include #ifdef WIN32 diff --git a/RecastDemo/Source/Tool_ConvexVolume.cpp b/RecastDemo/Source/Tool_ConvexVolume.cpp index b74d6d5c..fe138fcf 100644 --- a/RecastDemo/Source/Tool_ConvexVolume.cpp +++ b/RecastDemo/Source/Tool_ConvexVolume.cpp @@ -19,14 +19,10 @@ #include "Tool_ConvexVolume.h" #include "InputGeom.h" -#include "Recast.h" -#include "Sample.h" #include "imguiHelpers.h" #include -#include - namespace { /// Returns true if 'c' is left of line 'a'-'b'. inline bool left(const float* a, const float* b, const float* c) diff --git a/RecastDemo/Source/Tool_Crowd.cpp b/RecastDemo/Source/Tool_Crowd.cpp index 765228ef..5f6d80c1 100644 --- a/RecastDemo/Source/Tool_Crowd.cpp +++ b/RecastDemo/Source/Tool_Crowd.cpp @@ -18,19 +18,14 @@ #include "Tool_Crowd.h" -#include -#include -#include -#include #include "DetourCommon.h" -#include "DetourCrowd.h" #include "DetourDebugDraw.h" #include "DetourNode.h" -#include "DetourObstacleAvoidance.h" -#include "InputGeom.h" -#include "Sample.h" +#include "Recast.h" #include "imguiHelpers.h" +#include + #ifdef WIN32 # define snprintf _snprintf #endif diff --git a/RecastDemo/Source/Tool_NavMeshPrune.cpp b/RecastDemo/Source/Tool_NavMeshPrune.cpp index da88f37a..6a599606 100644 --- a/RecastDemo/Source/Tool_NavMeshPrune.cpp +++ b/RecastDemo/Source/Tool_NavMeshPrune.cpp @@ -21,14 +21,10 @@ #include "DetourCommon.h" #include "DetourDebugDraw.h" #include "DetourNavMesh.h" -#include "InputGeom.h" -#include "Sample.h" #include "imguiHelpers.h" #include -#include - namespace { void floodNavmesh(const dtNavMesh* navmesh, NavmeshFlags* flags, const dtPolyRef start, const unsigned char flag) diff --git a/RecastDemo/Source/Tool_NavMeshTester.cpp b/RecastDemo/Source/Tool_NavMeshTester.cpp index b8064ef5..c40af77d 100644 --- a/RecastDemo/Source/Tool_NavMeshTester.cpp +++ b/RecastDemo/Source/Tool_NavMeshTester.cpp @@ -20,18 +20,13 @@ #include "DetourCommon.h" #include "DetourDebugDraw.h" -#include "DetourNavMesh.h" #include "DetourPathCorridor.h" -#include "SDL_opengl.h" -#include "Sample.h" #include "imguiHelpers.h" #include -#include - // Uncomment this to dump all the requests in stdout. -#define DUMP_REQS +//#define DUMP_REQS namespace { diff --git a/RecastDemo/Source/Tool_OffMeshConnection.cpp b/RecastDemo/Source/Tool_OffMeshConnection.cpp index 999d8224..25b08992 100644 --- a/RecastDemo/Source/Tool_OffMeshConnection.cpp +++ b/RecastDemo/Source/Tool_OffMeshConnection.cpp @@ -20,15 +20,10 @@ #include "DetourDebugDraw.h" #include "InputGeom.h" -#include "Recast.h" -#include "Sample.h" #include "imguiHelpers.h" #include -#include -#include - void OffMeshConnectionTool::init(Sample* newSample) { if (sample == newSample) diff --git a/RecastDemo/Source/ValueHistory.cpp b/RecastDemo/Source/ValueHistory.cpp index b8ae1c13..747e8bcb 100644 --- a/RecastDemo/Source/ValueHistory.cpp +++ b/RecastDemo/Source/ValueHistory.cpp @@ -1,11 +1,5 @@ #include "ValueHistory.h" -#include - -#include -#include -#include - #ifdef WIN32 # define snprintf _snprintf #endif diff --git a/RecastDemo/Source/main.cpp b/RecastDemo/Source/main.cpp index 8cb617e8..cfefd274 100644 --- a/RecastDemo/Source/main.cpp +++ b/RecastDemo/Source/main.cpp @@ -17,32 +17,28 @@ // #include "AppData.h" +#include "InputGeom.h" #include "SDL.h" #include "SDL_keycode.h" #include "SDL_opengl.h" - -#include -#include -#include -#include -#include -#ifdef __APPLE__ -# include -#else -# include -#endif - -#include "InputGeom.h" -#include "Recast.h" +#include "Sample.h" #include "Sample_SoloMesh.h" #include "Sample_TempObstacles.h" #include "Sample_TileMesh.h" #include "TestCase.h" #include "imguiHelpers.h" +#include +#include + #include #include #include +#ifdef __APPLE__ +# include +#else +# include +#endif struct SampleItem {