diff --git a/DetourCrowd/Source/DetourObstacleAvoidance.cpp b/DetourCrowd/Source/DetourObstacleAvoidance.cpp index 3b2ff2c..8466c81 100644 --- a/DetourCrowd/Source/DetourObstacleAvoidance.cpp +++ b/DetourCrowd/Source/DetourObstacleAvoidance.cpp @@ -331,7 +331,7 @@ float dtObstacleAvoidanceQuery::processSample(const float* vcand, const float cs // find the threshold hit time to bail out based on the early out penalty // (see how the penalty is calculated below to understnad) float minPen = minPenalty - vpen - vcpen; - float tThresold = ((double)m_params.weightToi/(double)minPen - 0.1) * (double)m_params.horizTime; + float tThresold = (m_params.weightToi / minPen - 0.1f) * m_params.horizTime; if (tThresold - m_params.horizTime > -FLT_EPSILON) return minPenalty; // already too much @@ -528,7 +528,6 @@ int dtObstacleAvoidanceQuery::sampleVelocityAdaptive(const float* pos, const flo const int nd = dtClamp(ndivs, 1, DT_MAX_PATTERN_DIVS); const int nr = dtClamp(nrings, 1, DT_MAX_PATTERN_RINGS); - const int nd2 = nd / 2; const float da = (1.0f/nd) * DT_PI*2; const float ca = cosf(da); const float sa = sinf(da); diff --git a/RecastDemo/Include/SlideShow.h b/RecastDemo/Include/SlideShow.h index 90f2a61..8e6bcc0 100644 --- a/RecastDemo/Include/SlideShow.h +++ b/RecastDemo/Include/SlideShow.h @@ -35,7 +35,6 @@ class SlideShow void purgeImage(); bool loadImage(const char* path); - bool m_showSlides; bool m_showCurSlide; float m_slideAlpha; int m_curSlide; diff --git a/RecastDemo/Include/TestCase.h b/RecastDemo/Include/TestCase.h index 74994f1..3269042 100644 --- a/RecastDemo/Include/TestCase.h +++ b/RecastDemo/Include/TestCase.h @@ -39,10 +39,13 @@ class TestCase } TestType type; - float spos[3], epos[3]; - float nspos[3], nepos[3]; + float spos[3]; + float epos[3]; + float nspos[3]; + float nepos[3]; float radius; - int includeFlags, excludeFlags; + unsigned short includeFlags; + unsigned short excludeFlags; bool expand; float* straight; diff --git a/RecastDemo/Source/ChunkyTriMesh.cpp b/RecastDemo/Source/ChunkyTriMesh.cpp index 47e8778..2991d4f 100644 --- a/RecastDemo/Source/ChunkyTriMesh.cpp +++ b/RecastDemo/Source/ChunkyTriMesh.cpp @@ -118,12 +118,12 @@ static void subdivide(BoundsItem* items, int nitems, int imin, int imax, int tri if (axis == 0) { // Sort along x-axis - qsort(items+imin, inum, sizeof(BoundsItem), compareItemX); + qsort(items+imin, static_cast(inum), sizeof(BoundsItem), compareItemX); } else if (axis == 1) { // Sort along y-axis - qsort(items+imin, inum, sizeof(BoundsItem), compareItemY); + qsort(items+imin, static_cast(inum), sizeof(BoundsItem), compareItemY); } int isplit = imin+inum/2; diff --git a/RecastDemo/Source/Sample_TempObstacles.cpp b/RecastDemo/Source/Sample_TempObstacles.cpp index 04f66a5..0594cc3 100644 --- a/RecastDemo/Source/Sample_TempObstacles.cpp +++ b/RecastDemo/Source/Sample_TempObstacles.cpp @@ -672,7 +672,6 @@ class TempObstacleHilightTool : public SampleTool Sample_TempObstacles* m_sample; float m_hitPos[3]; bool m_hitPosSet; - float m_agentRadius; int m_drawType; public: @@ -680,7 +679,6 @@ public: TempObstacleHilightTool() : m_sample(0), m_hitPosSet(false), - m_agentRadius(0), m_drawType(DRAWDETAIL_AREAS) { m_hitPos[0] = m_hitPos[1] = m_hitPos[2] = 0; diff --git a/RecastDemo/Source/TestCase.cpp b/RecastDemo/Source/TestCase.cpp index 2afab4f..f625171 100644 --- a/RecastDemo/Source/TestCase.cpp +++ b/RecastDemo/Source/TestCase.cpp @@ -146,7 +146,7 @@ bool TestCase::load(const char* filePath) test->expand = false; test->next = m_tests; m_tests = test; - sscanf(row+2, "%f %f %f %f %f %f %x %x", + sscanf(row+2, "%f %f %f %f %f %f %hx %hx", &test->spos[0], &test->spos[1], &test->spos[2], &test->epos[0], &test->epos[1], &test->epos[2], &test->includeFlags, &test->excludeFlags); @@ -160,7 +160,7 @@ bool TestCase::load(const char* filePath) test->expand = false; test->next = m_tests; m_tests = test; - sscanf(row+2, "%f %f %f %f %f %f %x %x", + sscanf(row+2, "%f %f %f %f %f %f %hx %hx", &test->spos[0], &test->spos[1], &test->spos[2], &test->epos[0], &test->epos[1], &test->epos[2], &test->includeFlags, &test->excludeFlags); @@ -204,8 +204,8 @@ void TestCase::doTests(dtNavMesh* navmesh, dtNavMeshQuery* navquery) iter->nstraight = 0; dtQueryFilter filter; - filter.setIncludeFlags((unsigned short)iter->includeFlags); - filter.setExcludeFlags((unsigned short)iter->excludeFlags); + filter.setIncludeFlags(iter->includeFlags); + filter.setExcludeFlags(iter->excludeFlags); // Find start points TimeVal findNearestPolyStart = getPerfTime(); diff --git a/RecastDemo/Source/main.cpp b/RecastDemo/Source/main.cpp index 68223dc..e2a3052 100644 --- a/RecastDemo/Source/main.cpp +++ b/RecastDemo/Source/main.cpp @@ -139,7 +139,7 @@ int main(int /*argc*/, char** /*argv*/) float timeAcc = 0.0f; Uint32 prevFrameTime = SDL_GetTicks(); int mousePos[2] = {0, 0}; - float origMousePos[2] = {0, 0}; // Used to compute mouse movement totals across frames. + int origMousePos[2] = {0, 0}; // Used to compute mouse movement totals across frames. float cameraEulers[] = {45, -45}; float cameraPos[] = {0, 0, 0};