diff --git a/RecastDemo/Source/OffMeshConnectionTool.cpp b/RecastDemo/Source/OffMeshConnectionTool.cpp index 78761b98..1e66bd64 100644 --- a/RecastDemo/Source/OffMeshConnectionTool.cpp +++ b/RecastDemo/Source/OffMeshConnectionTool.cpp @@ -152,17 +152,17 @@ void OffMeshConnectionTool::handleRenderOverlay(double* proj, double* model, int // Draw start and end point labels if (hitPosSet && gluProject((GLdouble)hitPos[0], (GLdouble)hitPos[1], (GLdouble)hitPos[2], model, proj, view, &x, &y, &z)) { - DrawScreenspaceText(x, y - 25, IM_COL32(0, 0, 0, 220), "Start", true); + DrawScreenspaceText(static_cast(x), static_cast(y) - 25, IM_COL32(0, 0, 0, 220), "Start", true); } // Tool help const int h = view[3]; if (!hitPosSet) { - DrawScreenspaceText(280, h - 40, IM_COL32(255, 255, 255, 192), "LMB: Create new connection. SHIFT+LMB: Delete existing connection, click near start or end point."); + DrawScreenspaceText(280, static_cast(h) - 40, IM_COL32(255, 255, 255, 192), "LMB: Create new connection. SHIFT+LMB: Delete existing connection, click near start or end point."); } else { - DrawScreenspaceText(280, h - 40, IM_COL32(255, 255, 255, 192), "LMB: Set connection end point and finish."); + DrawScreenspaceText(280, static_cast(h) - 40, IM_COL32(255, 255, 255, 192), "LMB: Set connection end point and finish."); } } diff --git a/RecastDemo/Source/Sample_TempObstacles.cpp b/RecastDemo/Source/Sample_TempObstacles.cpp index 8c396bd5..36fedcce 100644 --- a/RecastDemo/Source/Sample_TempObstacles.cpp +++ b/RecastDemo/Source/Sample_TempObstacles.cpp @@ -584,11 +584,11 @@ void drawDetailOverlay(const dtTileCache* tileCache, const int tileX, const int { char text[128]; snprintf(text, 128, "(%d,%d)/%d", tile->header->tx, tile->header->ty, tile->header->tlayer); - DrawScreenspaceText(x, y - 25, IM_COL32(0, 0, 0, 220), text, true); - snprintf(text, 128, "Compressed: %.1f kB", tile->dataSize / 1024.0f); - DrawScreenspaceText(x, y - 45, IM_COL32(0, 0, 0, 128), text, true); - snprintf(text, 128, "Raw:%.1fkB", rawSize / 1024.0f); - DrawScreenspaceText(x, y - 65, IM_COL32(0, 0, 0, 128), text, true); + DrawScreenspaceText(static_cast(x), static_cast(y) - 25, IM_COL32(0, 0, 0, 220), text, true); + snprintf(text, 128, "Compressed: %.1f kB", static_cast(tile->dataSize) / 1024.0f); + DrawScreenspaceText(static_cast(x), static_cast(y) - 45, IM_COL32(0, 0, 0, 128), text, true); + snprintf(text, 128, "Raw:%.1fkB", static_cast(rawSize) / 1024.0f); + DrawScreenspaceText(static_cast(x), static_cast(y) - 65, IM_COL32(0, 0, 0, 128), text, true); } } } diff --git a/RecastDemo/Source/Sample_TileMesh.cpp b/RecastDemo/Source/Sample_TileMesh.cpp index d238c861..e3b15cbf 100644 --- a/RecastDemo/Source/Sample_TileMesh.cpp +++ b/RecastDemo/Source/Sample_TileMesh.cpp @@ -167,13 +167,13 @@ public: m_sample->getTilePos(m_hitPos, tx, ty); char text[32]; snprintf(text, 32, "(%d,%d)", tx, ty); - DrawScreenspaceText(x, y, IM_COL32(0, 0, 0, 220), text, true); + DrawScreenspaceText(static_cast(x), static_cast(y), IM_COL32(0, 0, 0, 220), text, true); } // Tool help DrawScreenspaceText( 280, - view[3] - 40, + static_cast(view[3]) - 40, IM_COL32(255, 255, 255, 192), "LMB: Rebuild hit tile. Shift+LMB: Clear hit tile."); } @@ -541,7 +541,7 @@ void Sample_TileMesh::handleRenderOverlay(double* proj, double* model, int* view { char text[64]; snprintf(text, 64, "%.3fms / %dTris / %.1fkB", tileBuildTime, tileTriCount, tileMemUsage); - DrawScreenspaceText(x, y, IM_COL32(0, 0, 0, 220), text); + DrawScreenspaceText(static_cast(x), static_cast(y), IM_COL32(0, 0, 0, 220), text); } if (tool) @@ -558,7 +558,7 @@ void Sample_TileMesh::handleMeshChanged(InputGeom* geom) const BuildSettings* buildSettings = geom->getBuildSettings(); if (buildSettings && buildSettings->tileSize > 0) { - tileSize = buildSettings->tileSize; + tileSize = static_cast(buildSettings->tileSize); } cleanup(); @@ -631,7 +631,7 @@ void Sample_TileMesh::collectSettings(BuildSettings& settings) { Sample::collectSettings(settings); - settings.tileSize = tileSize; + settings.tileSize = static_cast(tileSize); } void Sample_TileMesh::buildTile(const float* pos) diff --git a/RecastDemo/Source/TestCase.cpp b/RecastDemo/Source/TestCase.cpp index ab306f5d..5ea75af9 100644 --- a/RecastDemo/Source/TestCase.cpp +++ b/RecastDemo/Source/TestCase.cpp @@ -428,7 +428,6 @@ bool TestCase::handleRenderOverlay(double* proj, double* model, int* view) { GLdouble x, y, z; char text[64]; - char subtext[64]; int n = 0; static constexpr float LABEL_DIST = 1.0f; @@ -456,7 +455,7 @@ bool TestCase::handleRenderOverlay(double* proj, double* model, int* view) pt[1] += 0.5f; } - if (gluProject((GLdouble)pt[0], (GLdouble)pt[1], (GLdouble)pt[2], model, proj, view, &x, &y, &z)) + if (gluProject(pt[0], pt[1], pt[2], model, proj, view, &x, &y, &z)) { snprintf(text, 64, "Path %d\n", n); unsigned int col = IM_COL32(0, 0, 0, 128); @@ -464,15 +463,13 @@ bool TestCase::handleRenderOverlay(double* proj, double* model, int* view) { col = IM_COL32(255, 192, 0, 220); } - DrawScreenspaceText(x, y - 25, col, text, true); + DrawScreenspaceText(static_cast(x), static_cast(y) - 25, col, text, true); } n++; } - static int resScroll = 0; - - ImGui::SetNextWindowPos(ImVec2(10, view[3] - 10 - 350), ImGuiCond_Always); // Position in screen space + ImGui::SetNextWindowPos(ImVec2(10, static_cast(view[3]) - 10 - 350), ImGuiCond_Always); // Position in screen space ImGui::SetNextWindowSize(ImVec2(200, 350), ImGuiCond_Always); // Size of the window ImGui::Begin("Test Results"); @@ -484,10 +481,10 @@ bool TestCase::handleRenderOverlay(double* proj, double* model, int* view) if (ImGui::CollapsingHeader(text, ImGuiTreeNodeFlags_DefaultOpen)) { - ImGui::Text("Total: %.4f ms", (float)total / 1000.0f); - ImGui::Text("Poly: %.4f ms", (float)iter->findNearestPolyTime / 1000.0f); - ImGui::Text("Path: %.4f ms", (float)iter->findPathTime / 1000.0f); - ImGui::Text("Straight: %.4f ms", (float)iter->findStraightPathTime / 1000.0f); + ImGui::Text("Total: %.4f ms", static_cast(total) / 1000.0f); + ImGui::Text("Poly: %.4f ms", static_cast(iter->findNearestPolyTime) / 1000.0f); + ImGui::Text("Path: %.4f ms", static_cast(iter->findPathTime) / 1000.0f); + ImGui::Text("Straight: %.4f ms", static_cast(iter->findStraightPathTime) / 1000.0f); ImGui::Separator(); }