diff --git a/DebugUtils/Include/DebugDraw.h b/DebugUtils/Include/DebugDraw.h index 00b544d..1a6b3e7 100644 --- a/DebugUtils/Include/DebugDraw.h +++ b/DebugUtils/Include/DebugDraw.h @@ -27,7 +27,7 @@ enum duDebugDrawPrimitives DU_DRAW_POINTS, DU_DRAW_LINES, DU_DRAW_TRIS, - DU_DRAW_QUADS, + DU_DRAW_QUADS }; /// Abstract debug draw interface. @@ -197,15 +197,15 @@ class duDisplayList : public duDebugDraw int m_size; int m_cap; - bool m_depthMask; duDebugDrawPrimitives m_prim; float m_primSize; + bool m_depthMask; void resize(int cap); public: duDisplayList(int cap = 512); - ~duDisplayList(); + virtual ~duDisplayList(); virtual void depthMask(bool state); virtual void begin(duDebugDrawPrimitives prim, float size = 1.0f); virtual void vertex(const float x, const float y, const float z, unsigned int color); diff --git a/DebugUtils/Include/DetourDebugDraw.h b/DebugUtils/Include/DetourDebugDraw.h index ff2ca2f..d1a808f 100755 --- a/DebugUtils/Include/DetourDebugDraw.h +++ b/DebugUtils/Include/DetourDebugDraw.h @@ -27,7 +27,7 @@ enum DrawNavMeshFlags { DU_DRAWNAVMESH_OFFMESHCONS = 0x01, DU_DRAWNAVMESH_CLOSEDLIST = 0x02, - DU_DRAWNAVMESH_COLOR_TILES = 0x04, + DU_DRAWNAVMESH_COLOR_TILES = 0x04 }; void duDebugDrawNavMesh(struct duDebugDraw* dd, const dtNavMesh& mesh, unsigned char flags); diff --git a/DebugUtils/Include/RecastDump.h b/DebugUtils/Include/RecastDump.h index 6a722fd..18cc891 100644 --- a/DebugUtils/Include/RecastDump.h +++ b/DebugUtils/Include/RecastDump.h @@ -21,7 +21,7 @@ struct duFileIO { - virtual ~duFileIO() = 0; + virtual ~duFileIO(); virtual bool isWriting() const = 0; virtual bool isReading() const = 0; virtual bool write(const void* ptr, const size_t size) = 0; @@ -39,5 +39,4 @@ bool duReadCompactHeightfield(struct rcCompactHeightfield& chf, duFileIO* io); void duLogBuildTimes(rcContext& ctx, const int totalTileUsec); - #endif // RECAST_DUMP_H diff --git a/DebugUtils/Source/DebugDraw.cpp b/DebugUtils/Source/DebugDraw.cpp index d0179bc..9256992 100644 --- a/DebugUtils/Source/DebugDraw.cpp +++ b/DebugUtils/Source/DebugDraw.cpp @@ -530,9 +530,9 @@ duDisplayList::duDisplayList(int cap) : m_color(0), m_size(0), m_cap(0), - m_depthMask(true), m_prim(DU_DRAW_LINES), - m_primSize(1.0f) + m_primSize(1.0f), + m_depthMask(true) { if (cap < 8) cap = 8; diff --git a/DebugUtils/Source/RecastDump.cpp b/DebugUtils/Source/RecastDump.cpp index 2093825..5810899 100644 --- a/DebugUtils/Source/RecastDump.cpp +++ b/DebugUtils/Source/RecastDump.cpp @@ -25,10 +25,9 @@ #include "RecastAlloc.h" #include "RecastDump.h" - duFileIO::~duFileIO() { - // Empty + // Defined out of line to fix the weak v-tables warning } static void ioprintf(duFileIO* io, const char* format, ...) diff --git a/Detour/Include/DetourNavMesh.h b/Detour/Include/DetourNavMesh.h index cb5414f..34819e1 100644 --- a/Detour/Include/DetourNavMesh.h +++ b/Detour/Include/DetourNavMesh.h @@ -99,7 +99,7 @@ static const int DT_MAX_AREAS = 64; enum dtTileFlags { /// The navigation mesh owns the tile memory and is responsible for freeing it. - DT_TILE_FREE_DATA = 0x01, + DT_TILE_FREE_DATA = 0x01 }; /// Vertex flags returned by dtNavMeshQuery::findStraightPath. @@ -107,32 +107,32 @@ enum dtStraightPathFlags { DT_STRAIGHTPATH_START = 0x01, ///< The vertex is the start position in the path. DT_STRAIGHTPATH_END = 0x02, ///< The vertex is the end position in the path. - DT_STRAIGHTPATH_OFFMESH_CONNECTION = 0x04, ///< The vertex is the start of an off-mesh connection. + DT_STRAIGHTPATH_OFFMESH_CONNECTION = 0x04 ///< The vertex is the start of an off-mesh connection. }; /// Options for dtNavMeshQuery::findStraightPath. enum dtStraightPathOptions { DT_STRAIGHTPATH_AREA_CROSSINGS = 0x01, ///< Add a vertex at every polygon edge crossing where area changes. - DT_STRAIGHTPATH_ALL_CROSSINGS = 0x02, ///< Add a vertex at every polygon edge crossing. + DT_STRAIGHTPATH_ALL_CROSSINGS = 0x02 ///< Add a vertex at every polygon edge crossing. }; /// Options for dtNavMeshQuery::initSlicedFindPath and updateSlicedFindPath enum dtFindPathOptions { - DT_FINDPATH_ANY_ANGLE = 0x02, ///< use raycasts during pathfind to "shortcut" (raycast still consider costs) + DT_FINDPATH_ANY_ANGLE = 0x02 ///< use raycasts during pathfind to "shortcut" (raycast still consider costs) }; /// Options for dtNavMeshQuery::raycast enum dtRaycastOptions { - DT_RAYCAST_USE_COSTS = 0x01, ///< Raycast should calculate movement cost along the ray and fill RaycastHit::cost + DT_RAYCAST_USE_COSTS = 0x01 ///< Raycast should calculate movement cost along the ray and fill RaycastHit::cost }; enum dtDetailTriEdgeFlags { - DT_DETAIL_EDGE_BOUNDARY = 0x01, ///< Detail triangle edge is part of the poly boundary + DT_DETAIL_EDGE_BOUNDARY = 0x01 ///< Detail triangle edge is part of the poly boundary }; @@ -146,7 +146,7 @@ enum dtPolyTypes /// The polygon is a standard convex polygon that is part of the surface of the mesh. DT_POLYTYPE_GROUND = 0, /// The polygon is an off-mesh connection consisting of two vertices. - DT_POLYTYPE_OFFMESH_CONNECTION = 1, + DT_POLYTYPE_OFFMESH_CONNECTION = 1 }; diff --git a/Detour/Include/DetourNavMeshQuery.h b/Detour/Include/DetourNavMeshQuery.h index 08b70a8..fc5dec8 100644 --- a/Detour/Include/DetourNavMeshQuery.h +++ b/Detour/Include/DetourNavMeshQuery.h @@ -152,7 +152,7 @@ struct dtRaycastHit class dtPolyQuery { public: - virtual ~dtPolyQuery() { } + virtual ~dtPolyQuery(); /// Called for each batch of unique polygons touched by the search area in dtNavMeshQuery::queryPolygons. /// This can be called multiple times for a single query. diff --git a/Detour/Include/DetourNode.h b/Detour/Include/DetourNode.h index db09747..8918d46 100644 --- a/Detour/Include/DetourNode.h +++ b/Detour/Include/DetourNode.h @@ -25,7 +25,7 @@ enum dtNodeFlags { DT_NODE_OPEN = 0x01, DT_NODE_CLOSED = 0x02, - DT_NODE_PARENT_DETACHED = 0x04, // parent of the node is not adjacent. Found using raycast. + DT_NODE_PARENT_DETACHED = 0x04 // parent of the node is not adjacent. Found using raycast. }; typedef unsigned short dtNodeIndex; diff --git a/Detour/Source/DetourNavMeshQuery.cpp b/Detour/Source/DetourNavMeshQuery.cpp index b48618f..cebe26b 100644 --- a/Detour/Source/DetourNavMeshQuery.cpp +++ b/Detour/Source/DetourNavMeshQuery.cpp @@ -117,6 +117,11 @@ void dtFreeNavMeshQuery(dtNavMeshQuery* navmesh) dtFree(navmesh); } +dtPolyQuery::~dtPolyQuery() +{ + // Defined out of line to fix the weak v-tables warning +} + ////////////////////////////////////////////////////////////////////////////////////////// /// @class dtNavMeshQuery @@ -630,6 +635,8 @@ public: { } + virtual ~dtFindNearestPolyQuery(); + dtPolyRef nearestRef() const { return m_nearestRef; } const float* nearestPoint() const { return m_nearestPoint; } bool isOverPoly() const { return m_overPoly; } @@ -672,6 +679,11 @@ public: } }; +dtFindNearestPolyQuery::~dtFindNearestPolyQuery() +{ + // Defined out of line to fix the weak v-tables warning +} + /// @par /// /// @note If the search box does not intersect any polygons the search will @@ -847,6 +859,8 @@ public: { } + virtual ~dtCollectPolysQuery(); + int numCollected() const { return m_numCollected; } bool overflowed() const { return m_overflow; } @@ -868,6 +882,11 @@ public: } }; +dtCollectPolysQuery::~dtCollectPolysQuery() +{ + // Defined out of line to fix the weak v-tables warning +} + /// @par /// /// If no polygons are found, the function will return #DT_SUCCESS with a diff --git a/DetourCrowd/Include/DetourCrowd.h b/DetourCrowd/Include/DetourCrowd.h index 9520508..854546f 100644 --- a/DetourCrowd/Include/DetourCrowd.h +++ b/DetourCrowd/Include/DetourCrowd.h @@ -66,7 +66,7 @@ enum CrowdAgentState { DT_CROWDAGENT_STATE_INVALID, ///< The agent is not in a valid state. DT_CROWDAGENT_STATE_WALKING, ///< The agent is traversing a normal navigation mesh polygon. - DT_CROWDAGENT_STATE_OFFMESH, ///< The agent is traversing an off-mesh connection. + DT_CROWDAGENT_STATE_OFFMESH ///< The agent is traversing an off-mesh connection. }; /// Configuration parameters for a crowd agent. @@ -108,7 +108,7 @@ enum MoveRequestState DT_CROWDAGENT_TARGET_REQUESTING, DT_CROWDAGENT_TARGET_WAITING_FOR_QUEUE, DT_CROWDAGENT_TARGET_WAITING_FOR_PATH, - DT_CROWDAGENT_TARGET_VELOCITY, + DT_CROWDAGENT_TARGET_VELOCITY }; /// Represents an agent managed by a #dtCrowd object. @@ -188,7 +188,7 @@ enum UpdateFlags DT_CROWD_OBSTACLE_AVOIDANCE = 2, DT_CROWD_SEPARATION = 4, DT_CROWD_OPTIMIZE_VIS = 8, ///< Use #dtPathCorridor::optimizePathVisibility() to optimize the agent path. - DT_CROWD_OPTIMIZE_TOPO = 16, ///< Use dtPathCorridor::optimizePathTopology() to optimize the agent path. + DT_CROWD_OPTIMIZE_TOPO = 16 ///< Use dtPathCorridor::optimizePathTopology() to optimize the agent path. }; struct dtCrowdAgentDebugInfo diff --git a/DetourTileCache/Include/DetourTileCache.h b/DetourTileCache/Include/DetourTileCache.h index 7571336..0d346f1 100644 --- a/DetourTileCache/Include/DetourTileCache.h +++ b/DetourTileCache/Include/DetourTileCache.h @@ -3,16 +3,13 @@ #include "DetourStatus.h" - - typedef unsigned int dtObstacleRef; - typedef unsigned int dtCompressedTileRef; /// Flags for addTile enum dtCompressedTileFlags { - DT_COMPRESSEDTILE_FREE_DATA = 0x01, ///< Navmesh owns the tile memory and should free it. + DT_COMPRESSEDTILE_FREE_DATA = 0x01 ///< Navmesh owns the tile memory and should free it. }; struct dtCompressedTile @@ -32,14 +29,14 @@ enum ObstacleState DT_OBSTACLE_EMPTY, DT_OBSTACLE_PROCESSING, DT_OBSTACLE_PROCESSED, - DT_OBSTACLE_REMOVING, + DT_OBSTACLE_REMOVING }; enum ObstacleType { DT_OBSTACLE_CYLINDER, DT_OBSTACLE_BOX, // AABB - DT_OBSTACLE_ORIENTED_BOX, // OBB + DT_OBSTACLE_ORIENTED_BOX // OBB }; struct dtObstacleCylinder @@ -97,13 +94,10 @@ struct dtTileCacheParams struct dtTileCacheMeshProcess { - virtual ~dtTileCacheMeshProcess() { } - - virtual void process(struct dtNavMeshCreateParams* params, - unsigned char* polyAreas, unsigned short* polyFlags) = 0; + virtual ~dtTileCacheMeshProcess(); + virtual void process(struct dtNavMeshCreateParams* params, unsigned char* polyAreas, unsigned short* polyFlags) = 0; }; - class dtTileCache { public: @@ -219,7 +213,7 @@ private: enum ObstacleRequestAction { REQUEST_ADD, - REQUEST_REMOVE, + REQUEST_REMOVE }; struct ObstacleRequest diff --git a/DetourTileCache/Include/DetourTileCacheBuilder.h b/DetourTileCache/Include/DetourTileCacheBuilder.h index ff61091..9a6844c 100644 --- a/DetourTileCache/Include/DetourTileCacheBuilder.h +++ b/DetourTileCache/Include/DetourTileCacheBuilder.h @@ -78,7 +78,7 @@ struct dtTileCachePolyMesh struct dtTileCacheAlloc { - virtual ~dtTileCacheAlloc() {} + virtual ~dtTileCacheAlloc(); virtual void reset() {} @@ -95,7 +95,7 @@ struct dtTileCacheAlloc struct dtTileCacheCompressor { - virtual ~dtTileCacheCompressor() { } + virtual ~dtTileCacheCompressor(); virtual int maxCompressedSize(const int bufferSize) = 0; virtual dtStatus compress(const unsigned char* buffer, const int bufferSize, diff --git a/DetourTileCache/Source/DetourTileCache.cpp b/DetourTileCache/Source/DetourTileCache.cpp index a82cd13..6f97ab5 100644 --- a/DetourTileCache/Source/DetourTileCache.cpp +++ b/DetourTileCache/Source/DetourTileCache.cpp @@ -239,6 +239,11 @@ const dtTileCacheObstacle* dtTileCache::getObstacleByRef(dtObstacleRef ref) return ob; } +dtTileCacheMeshProcess::~dtTileCacheMeshProcess() +{ + // Defined out of line to fix the weak v-tables warning +} + dtStatus dtTileCache::addTile(unsigned char* data, const int dataSize, unsigned char flags, dtCompressedTileRef* result) { // Make sure the data is in right format. diff --git a/DetourTileCache/Source/DetourTileCacheBuilder.cpp b/DetourTileCache/Source/DetourTileCacheBuilder.cpp index 05e34ac..796e165 100644 --- a/DetourTileCache/Source/DetourTileCacheBuilder.cpp +++ b/DetourTileCache/Source/DetourTileCacheBuilder.cpp @@ -23,6 +23,15 @@ #include "DetourTileCacheBuilder.h" #include +dtTileCacheAlloc::~dtTileCacheAlloc() +{ + // Defined out of line to fix the weak v-tables warning +} + +dtTileCacheCompressor::~dtTileCacheCompressor() +{ + // Defined out of line to fix the weak v-tables warning +} template class dtFixedArray { diff --git a/Recast/Include/Recast.h b/Recast/Include/Recast.h index 4d55738..a36d7ad 100644 --- a/Recast/Include/Recast.h +++ b/Recast/Include/Recast.h @@ -28,7 +28,7 @@ enum rcLogCategory { RC_LOG_PROGRESS = 1, ///< A progress log entry. RC_LOG_WARNING, ///< A warning log entry. - RC_LOG_ERROR, ///< An error log entry. + RC_LOG_ERROR ///< An error log entry. }; /// Recast performance timer categories. @@ -101,7 +101,6 @@ enum rcTimerLabel class rcContext { public: - /// Contructor. /// @param[in] state TRUE if the logging and performance timers should be enabled. [Default: true] inline rcContext(bool state = true) : m_logEnabled(state), m_timerEnabled(state) {} @@ -140,9 +139,8 @@ public: inline int getAccumulatedTime(const rcTimerLabel label) const { return m_timerEnabled ? doGetAccumulatedTime(label) : -1; } protected: - /// Clears all log entries. - virtual void doResetLog() {} + virtual void doResetLog(); /// Logs a message. /// @param[in] category The category of the message. @@ -564,7 +562,7 @@ static const int RC_AREA_BORDER = 0x20000; enum rcBuildContoursFlags { RC_CONTOUR_TESS_WALL_EDGES = 0x01, ///< Tessellate solid (impassable) edges during contour simplification. - RC_CONTOUR_TESS_AREA_EDGES = 0x02, ///< Tessellate edges between areas during contour simplification. + RC_CONTOUR_TESS_AREA_EDGES = 0x02 ///< Tessellate edges between areas during contour simplification. }; /// Applied to the region id field of contour vertices in order to extract the region id. diff --git a/Recast/Source/Recast.cpp b/Recast/Source/Recast.cpp index 1b71710..4cf145c 100644 --- a/Recast/Source/Recast.cpp +++ b/Recast/Source/Recast.cpp @@ -94,6 +94,11 @@ void rcContext::log(const rcLogCategory category, const char* format, ...) doLog(category, msg, len); } +void rcContext::doResetLog() +{ + // Defined out of line to fix the weak v-tables warning +} + rcHeightfield* rcAllocHeightfield() { return rcNew(RC_ALLOC_PERM); diff --git a/Recast/Source/RecastMeshDetail.cpp b/Recast/Source/RecastMeshDetail.cpp index 1999200..40bfc9b 100644 --- a/Recast/Source/RecastMeshDetail.cpp +++ b/Recast/Source/RecastMeshDetail.cpp @@ -284,7 +284,7 @@ static unsigned short getHeight(const float fx, const float fy, const float fz, enum EdgeValues { EV_UNDEF = -1, - EV_HULL = -2, + EV_HULL = -2 }; static int findEdge(const int* edges, int nedges, int s, int t) diff --git a/RecastDemo/Include/ChunkyTriMesh.h b/RecastDemo/Include/ChunkyTriMesh.h index 6584979..0870d64 100644 --- a/RecastDemo/Include/ChunkyTriMesh.h +++ b/RecastDemo/Include/ChunkyTriMesh.h @@ -29,7 +29,7 @@ struct rcChunkyTriMeshNode struct rcChunkyTriMesh { - inline rcChunkyTriMesh() : nodes(0), nnodes(0), tris(0), ntris(0), maxTrisPerChunk(0) {}; + inline rcChunkyTriMesh() : nodes(0), nnodes(0), tris(0), ntris(0), maxTrisPerChunk(0) {} inline ~rcChunkyTriMesh() { delete [] nodes; delete [] tris; } rcChunkyTriMeshNode* nodes; diff --git a/RecastDemo/Include/CrowdTool.h b/RecastDemo/Include/CrowdTool.h index 8c170ef..a298066 100644 --- a/RecastDemo/Include/CrowdTool.h +++ b/RecastDemo/Include/CrowdTool.h @@ -122,7 +122,7 @@ class CrowdTool : public SampleTool TOOLMODE_CREATE, TOOLMODE_MOVE_TARGET, TOOLMODE_SELECT, - TOOLMODE_TOGGLE_POLYS, + TOOLMODE_TOGGLE_POLYS }; ToolMode m_mode; diff --git a/RecastDemo/Include/NavMeshTesterTool.h b/RecastDemo/Include/NavMeshTesterTool.h index 01f4680..080170e 100644 --- a/RecastDemo/Include/NavMeshTesterTool.h +++ b/RecastDemo/Include/NavMeshTesterTool.h @@ -43,7 +43,7 @@ class NavMeshTesterTool : public SampleTool TOOLMODE_DISTANCE_TO_WALL, TOOLMODE_FIND_POLYS_IN_CIRCLE, TOOLMODE_FIND_POLYS_IN_SHAPE, - TOOLMODE_FIND_LOCAL_NEIGHBOURHOOD, + TOOLMODE_FIND_LOCAL_NEIGHBOURHOOD }; ToolMode m_toolMode; @@ -110,4 +110,5 @@ public: void drawAgent(const float* pos, float r, float h, float c, const unsigned int col); }; -#endif // NAVMESHTESTERTOOL_H \ No newline at end of file +#endif // NAVMESHTESTERTOOL_H + diff --git a/RecastDemo/Include/PerfTimer.h b/RecastDemo/Include/PerfTimer.h index ed62c18..ce0f296 100644 --- a/RecastDemo/Include/PerfTimer.h +++ b/RecastDemo/Include/PerfTimer.h @@ -29,4 +29,5 @@ typedef __int64 TimeVal; TimeVal getPerfTime(); int getPerfTimeUsec(const TimeVal duration); -#endif // PERFTIMER_H \ No newline at end of file +#endif // PERFTIMER_H + diff --git a/RecastDemo/Include/Sample.h b/RecastDemo/Include/Sample.h index aa46f86..608c3db 100644 --- a/RecastDemo/Include/Sample.h +++ b/RecastDemo/Include/Sample.h @@ -47,7 +47,7 @@ enum SamplePolyAreas SAMPLE_POLYAREA_ROAD, SAMPLE_POLYAREA_DOOR, SAMPLE_POLYAREA_GRASS, - SAMPLE_POLYAREA_JUMP, + SAMPLE_POLYAREA_JUMP }; enum SamplePolyFlags { @@ -69,12 +69,12 @@ enum SamplePartitionType { SAMPLE_PARTITION_WATERSHED, SAMPLE_PARTITION_MONOTONE, - SAMPLE_PARTITION_LAYERS, + SAMPLE_PARTITION_LAYERS }; struct SampleTool { - virtual ~SampleTool() {} + virtual ~SampleTool(); virtual int type() = 0; virtual void init(class Sample* sample) = 0; virtual void reset() = 0; @@ -88,7 +88,7 @@ struct SampleTool }; struct SampleToolState { - virtual ~SampleToolState() {} + virtual ~SampleToolState(); virtual void init(class Sample* sample) = 0; virtual void reset() = 0; virtual void handleRender() = 0; diff --git a/RecastDemo/Include/TestCase.h b/RecastDemo/Include/TestCase.h index 49dcb23..8991e57 100644 --- a/RecastDemo/Include/TestCase.h +++ b/RecastDemo/Include/TestCase.h @@ -27,7 +27,7 @@ class TestCase enum TestType { TEST_PATHFIND, - TEST_RAYCAST, + TEST_RAYCAST }; struct Test @@ -111,4 +111,4 @@ private: TestCase& operator=(const TestCase&); }; -#endif // TESTCASE_H \ No newline at end of file +#endif // TESTCASE_H diff --git a/RecastDemo/Include/ValueHistory.h b/RecastDemo/Include/ValueHistory.h index 2da5390..1e83a21 100644 --- a/RecastDemo/Include/ValueHistory.h +++ b/RecastDemo/Include/ValueHistory.h @@ -47,4 +47,5 @@ void drawGraph(const GraphParams* p, const ValueHistory* graph, int idx, const char* label, const unsigned int col); -#endif // VALUEHISTORY_H \ No newline at end of file +#endif // VALUEHISTORY_H + diff --git a/RecastDemo/Include/imgui.h b/RecastDemo/Include/imgui.h index 325829b..3d7346e 100644 --- a/RecastDemo/Include/imgui.h +++ b/RecastDemo/Include/imgui.h @@ -22,14 +22,14 @@ enum imguiMouseButton { IMGUI_MBUT_LEFT = 0x01, - IMGUI_MBUT_RIGHT = 0x02, + IMGUI_MBUT_RIGHT = 0x02 }; enum imguiTextAlign { IMGUI_ALIGN_LEFT, IMGUI_ALIGN_CENTER, - IMGUI_ALIGN_RIGHT, + IMGUI_ALIGN_RIGHT }; inline unsigned int imguiRGBA(unsigned char r, unsigned char g, unsigned char b, unsigned char a=255) @@ -68,7 +68,7 @@ enum imguiGfxCmdType IMGUI_GFXCMD_TRIANGLE, IMGUI_GFXCMD_LINE, IMGUI_GFXCMD_TEXT, - IMGUI_GFXCMD_SCISSOR, + IMGUI_GFXCMD_SCISSOR }; struct imguiGfxRect diff --git a/RecastDemo/Include/imguiRenderGL.h b/RecastDemo/Include/imguiRenderGL.h index b148341..33cd017 100644 --- a/RecastDemo/Include/imguiRenderGL.h +++ b/RecastDemo/Include/imguiRenderGL.h @@ -23,4 +23,5 @@ bool imguiRenderGLInit(const char* fontpath); void imguiRenderGLDestroy(); void imguiRenderGLDraw(); -#endif // IMGUI_RENDER_GL_H \ No newline at end of file +#endif // IMGUI_RENDER_GL_H + diff --git a/RecastDemo/Source/Filelist.cpp b/RecastDemo/Source/Filelist.cpp index 7e05130..bd715c4 100644 --- a/RecastDemo/Source/Filelist.cpp +++ b/RecastDemo/Source/Filelist.cpp @@ -55,10 +55,10 @@ void scanDirectoryAppend(const string& path, const string& ext, vector& return; } - int extLen = strlen(ext.c_str()); + size_t extLen = strlen(ext.c_str()); while ((current = readdir(dp)) != 0) { - int len = strlen(current->d_name); + size_t len = strlen(current->d_name); if (len > extLen && strncmp(current->d_name + len - extLen, ext.c_str(), extLen) == 0) { filelist.push_back(current->d_name); diff --git a/RecastDemo/Source/Sample.cpp b/RecastDemo/Source/Sample.cpp index d8c4cfd..2b5a7a2 100644 --- a/RecastDemo/Source/Sample.cpp +++ b/RecastDemo/Source/Sample.cpp @@ -35,6 +35,16 @@ # define snprintf _snprintf #endif +SampleTool::~SampleTool() +{ + // Defined out of line to fix the weak v-tables warning +} + +SampleToolState::~SampleToolState() +{ + // Defined out of line to fix the weak v-tables warning +} + unsigned int SampleDebugDraw::areaToCol(unsigned int area) { switch(area) diff --git a/RecastDemo/Source/SampleInterfaces.cpp b/RecastDemo/Source/SampleInterfaces.cpp index 72bb34c..a9fd3ae 100644 --- a/RecastDemo/Source/SampleInterfaces.cpp +++ b/RecastDemo/Source/SampleInterfaces.cpp @@ -184,7 +184,7 @@ public: } } }; -GLCheckerTexture g_tex; +static GLCheckerTexture g_tex; void DebugDrawGL::depthMask(bool state) diff --git a/RecastDemo/Source/Sample_TempObstacles.cpp b/RecastDemo/Source/Sample_TempObstacles.cpp index 6c1367f..4dd4e5f 100644 --- a/RecastDemo/Source/Sample_TempObstacles.cpp +++ b/RecastDemo/Source/Sample_TempObstacles.cpp @@ -109,6 +109,8 @@ static int calcLayerBufferSize(const int gridWidth, const int gridHeight) struct FastLZCompressor : public dtTileCacheCompressor { + virtual ~FastLZCompressor(); + virtual int maxCompressedSize(const int bufferSize) { return (int)(bufferSize* 1.05f); @@ -129,6 +131,11 @@ struct FastLZCompressor : public dtTileCacheCompressor } }; +FastLZCompressor::~FastLZCompressor() +{ + // Defined out of line to fix the weak v-tables warning +} + struct LinearAllocator : public dtTileCacheAlloc { unsigned char* buffer; @@ -141,10 +148,7 @@ struct LinearAllocator : public dtTileCacheAlloc resize(cap); } - ~LinearAllocator() - { - dtFree(buffer); - } + virtual ~LinearAllocator(); void resize(const size_t cap) { @@ -176,6 +180,12 @@ struct LinearAllocator : public dtTileCacheAlloc } }; +LinearAllocator::~LinearAllocator() +{ + // Defined out of line to fix the weak v-tables warning + dtFree(buffer); +} + struct MeshProcess : public dtTileCacheMeshProcess { InputGeom* m_geom; @@ -184,6 +194,8 @@ struct MeshProcess : public dtTileCacheMeshProcess { } + virtual ~MeshProcess(); + inline void init(InputGeom* geom) { m_geom = geom; @@ -228,8 +240,10 @@ struct MeshProcess : public dtTileCacheMeshProcess } }; - - +MeshProcess::~MeshProcess() +{ + // Defined out of line to fix the weak v-tables warning +} static const int MAX_LAYERS = 32; @@ -494,7 +508,7 @@ enum DrawDetailType DRAWDETAIL_AREAS, DRAWDETAIL_REGIONS, DRAWDETAIL_CONTOURS, - DRAWDETAIL_MESH, + DRAWDETAIL_MESH }; void drawDetail(duDebugDraw* dd, dtTileCache* tc, const int tx, const int ty, int type) @@ -667,9 +681,6 @@ void drawObstacles(duDebugDraw* dd, const dtTileCache* tc) } } - - - class TempObstacleHilightTool : public SampleTool { Sample_TempObstacles* m_sample; @@ -687,9 +698,7 @@ public: m_hitPos[0] = m_hitPos[1] = m_hitPos[2] = 0; } - virtual ~TempObstacleHilightTool() - { - } + virtual ~TempObstacleHilightTool(); virtual int type() { return TOOL_TILE_HIGHLIGHT; } @@ -764,6 +773,10 @@ public: } }; +TempObstacleHilightTool::~TempObstacleHilightTool() +{ + // Defined out of line to fix the weak v-tables warning +} class TempObstacleCreateTool : public SampleTool { @@ -775,9 +788,7 @@ public: { } - virtual ~TempObstacleCreateTool() - { - } + virtual ~TempObstacleCreateTool(); virtual int type() { return TOOL_TEMP_OBSTACLE; } @@ -819,9 +830,10 @@ public: virtual void handleRenderOverlay(double* /*proj*/, double* /*model*/, int* /*view*/) { } }; - - - +TempObstacleCreateTool::~TempObstacleCreateTool() +{ + // Defined out of line to fix the weak v-tables warning +} Sample_TempObstacles::Sample_TempObstacles() : m_keepInterResults(false), diff --git a/RecastDemo/Source/Sample_TileMesh.cpp b/RecastDemo/Source/Sample_TileMesh.cpp index 1de5581..42fe307 100644 --- a/RecastDemo/Source/Sample_TileMesh.cpp +++ b/RecastDemo/Source/Sample_TileMesh.cpp @@ -87,9 +87,7 @@ public: m_hitPos[0] = m_hitPos[1] = m_hitPos[2] = 0; } - virtual ~NavMeshTileTool() - { - } + virtual ~NavMeshTileTool(); virtual int type() { return TOOL_TILE_EDIT; } @@ -172,8 +170,10 @@ public: } }; - - +NavMeshTileTool::~NavMeshTileTool() +{ + // Defined out of line to fix the weak v-tables warning +} Sample_TileMesh::Sample_TileMesh() : m_keepInterResults(false), diff --git a/RecastDemo/Source/main.cpp b/RecastDemo/Source/main.cpp index 1a31e75..90c6dbb 100644 --- a/RecastDemo/Source/main.cpp +++ b/RecastDemo/Source/main.cpp @@ -135,7 +135,6 @@ int main(int /*argc*/, char** /*argv*/) return -1; } - float t = 0.0f; float timeAcc = 0.0f; Uint32 prevFrameTime = SDL_GetTicks(); int mousePos[2] = {0, 0}; @@ -354,8 +353,6 @@ int main(int /*argc*/, char** /*argv*/) Uint32 time = SDL_GetTicks(); float dt = (time - prevFrameTime) / 1000.0f; prevFrameTime = time; - - t += dt; // Hit test mesh. if (processHitTest && geom && sample)