diff --git a/Detour/Source/DetourStatNavMesh.cpp b/Detour/Source/DetourStatNavMesh.cpp index 6cada2a..46886a7 100755 --- a/Detour/Source/DetourStatNavMesh.cpp +++ b/Detour/Source/DetourStatNavMesh.cpp @@ -567,7 +567,6 @@ float dtStatNavMesh::findDistanceToWall(dtStatPolyRef centerRef, const float* ce { actualNode->flags &= ~DT_NODE_CLOSED; actualNode->pidx = newNode.pidx; - actualNode->cost = newNode.cost; actualNode->total = newNode.total; if (actualNode->flags & DT_NODE_OPEN) @@ -663,7 +662,6 @@ int dtStatNavMesh::findPolysAround(dtStatPolyRef centerRef, const float* centerP { actualNode->flags &= ~DT_NODE_CLOSED; actualNode->pidx = newNode.pidx; - actualNode->cost = newNode.cost; actualNode->total = newNode.total; if (actualNode->flags & DT_NODE_OPEN) diff --git a/Detour/Source/DetourTileNavMesh.cpp b/Detour/Source/DetourTileNavMesh.cpp index 3e7d58b..25cbe0a 100644 --- a/Detour/Source/DetourTileNavMesh.cpp +++ b/Detour/Source/DetourTileNavMesh.cpp @@ -493,7 +493,7 @@ bool dtTiledNavMesh::closestPointToPoly(dtTilePolyRef ref, const float* pos, flo if (m_tiles[it].salt != salt || m_tiles[it].header == 0) return false; const dtTileHeader* h = m_tiles[it].header; - if (ip >= h->npolys) return false; + if (ip >= (unsigned int)h->npolys) return false; const dtTilePoly* poly = &h->polys[ip]; float closestDistSqr = FLT_MAX; @@ -692,7 +692,7 @@ int dtTiledNavMesh::findPath(dtTilePolyRef startRef, dtTilePolyRef endRef, m_openList->push(startNode); dtNode* lastBestNode = startNode; - unsigned short lastBestNodeCost = startNode->total; + float lastBestNodeCost = startNode->total; while (!m_openList->empty()) { dtNode* bestNode = m_openList->pop(); @@ -943,7 +943,7 @@ bool dtTiledNavMesh::getPortalPoints(dtTilePolyRef from, dtTilePolyRef to, float dtDecodeTileId(from, salt, it, ip); if (it >= DT_MAX_TILES) return false; if (m_tiles[it].salt != salt || m_tiles[it].header == 0) return false; - if (ip >= m_tiles[it].header->npolys) return false; + if (ip >= (unsigned int)m_tiles[it].header->npolys) return false; const dtTileHeader* fromHeader = m_tiles[it].header; const dtTilePoly* fromPoly = &fromHeader->polys[ip]; @@ -1172,7 +1172,6 @@ int dtTiledNavMesh::findPolysAround(dtTilePolyRef centerRef, const float* center { actualNode->flags &= ~DT_NODE_CLOSED; actualNode->pidx = newNode.pidx; - actualNode->cost = newNode.cost; actualNode->total = newNode.total; if (actualNode->flags & DT_NODE_OPEN) @@ -1313,7 +1312,6 @@ float dtTiledNavMesh::findDistanceToWall(dtTilePolyRef centerRef, const float* c { actualNode->flags &= ~DT_NODE_CLOSED; actualNode->pidx = newNode.pidx; - actualNode->cost = newNode.cost; actualNode->total = newNode.total; if (actualNode->flags & DT_NODE_OPEN) @@ -1343,7 +1341,7 @@ const dtTilePoly* dtTiledNavMesh::getPolyByRef(dtTilePolyRef ref) const dtDecodeTileId(ref, salt, it, ip); if (it >= DT_MAX_TILES) return 0; if (m_tiles[it].salt != salt || m_tiles[it].header == 0) return 0; - if (ip >= m_tiles[it].header->npolys) return 0; + if (ip >= (unsigned int)m_tiles[it].header->npolys) return 0; return &m_tiles[it].header->polys[ip]; } @@ -1353,7 +1351,7 @@ const float* dtTiledNavMesh::getPolyVertsByRef(dtTilePolyRef ref) const dtDecodeTileId(ref, salt, it, ip); if (it >= DT_MAX_TILES) return 0; if (m_tiles[it].salt != salt || m_tiles[it].header == 0) return 0; - if (ip >= m_tiles[it].header->npolys) return 0; + if (ip >= (unsigned int)m_tiles[it].header->npolys) return 0; return m_tiles[it].header->verts; } @@ -1363,6 +1361,6 @@ const dtTileLink* dtTiledNavMesh::getPolyLinksByRef(dtTilePolyRef ref) const dtDecodeTileId(ref, salt, it, ip); if (it >= DT_MAX_TILES) return 0; if (m_tiles[it].salt != salt || m_tiles[it].header == 0) return 0; - if (ip >= m_tiles[it].header->npolys) return 0; + if (ip >= (unsigned int)m_tiles[it].header->npolys) return 0; return m_tiles[it].header->links; } diff --git a/RecastDemo/Bin/Recast.exe b/RecastDemo/Bin/Recast.exe index 51cbaa7..aaf996c 100644 Binary files a/RecastDemo/Bin/Recast.exe and b/RecastDemo/Bin/Recast.exe differ diff --git a/RecastDemo/Build/VC9/Recast.vcproj b/RecastDemo/Build/VC9/Recast.vcproj index 1651016..be6e079 100644 --- a/RecastDemo/Build/VC9/Recast.vcproj +++ b/RecastDemo/Build/VC9/Recast.vcproj @@ -41,7 +41,7 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/RecastDemo/Source/Sample_StatMesh.cpp b/RecastDemo/Source/Sample_StatMesh.cpp index 4063389..dbe19ef 100644 --- a/RecastDemo/Source/Sample_StatMesh.cpp +++ b/RecastDemo/Source/Sample_StatMesh.cpp @@ -309,7 +309,7 @@ void Sample_StatMesh::toolRenderOverlay(double* proj, double* model, int* view) if (m_eposSet && gluProject((GLdouble)m_epos[0], (GLdouble)m_epos[1], (GLdouble)m_epos[2], model, proj, view, &x, &y, &z)) { - imguiDrawText((int)x, (float)(y-25), IMGUI_ALIGN_CENTER, "End", imguiRGBA(0,0,0,220)); + imguiDrawText((int)x, (int)(y-25), IMGUI_ALIGN_CENTER, "End", imguiRGBA(0,0,0,220)); } } diff --git a/RecastDemo/Source/imguiRenderGL.cpp b/RecastDemo/Source/imguiRenderGL.cpp index 2cd9676..7a8665e 100644 --- a/RecastDemo/Source/imguiRenderGL.cpp +++ b/RecastDemo/Source/imguiRenderGL.cpp @@ -16,6 +16,7 @@ // 3. This notice may not be removed or altered from any source distribution. // +#define _USE_MATH_DEFINES #include #include "imgui.h" #include "SDL.h" @@ -280,10 +281,10 @@ static void getBakedQuad(stbtt_bakedchar *chardata, int pw, int ph, int char_ind int round_x = STBTT_ifloor(*xpos + b->xoff); int round_y = STBTT_ifloor(*ypos - b->yoff); - q->x0 = round_x; - q->y0 = round_y; - q->x1 = round_x + b->x1 - b->x0; - q->y1 = round_y - b->y1 + b->y0; + q->x0 = (float)round_x; + q->y0 = (float)round_y; + q->x1 = (float)round_x + b->x1 - b->x0; + q->y1 = (float)round_y - b->y1 + b->y0; q->s0 = b->x0 / (float)pw; q->t0 = b->y0 / (float)pw; @@ -366,7 +367,7 @@ void imguiRenderGLDraw() int nq = imguiGetRenderQueueSize(); glDisable(GL_SCISSOR_TEST); - for (unsigned i = 0; i < nq; ++i) + for (int i = 0; i < nq; ++i) { const imguiGfxCmd& cmd = q[i]; if (cmd.type == IMGUI_GFXCMD_RECT) diff --git a/RecastDemo/Source/main.cpp b/RecastDemo/Source/main.cpp index d7ee13c..bef87f3 100644 --- a/RecastDemo/Source/main.cpp +++ b/RecastDemo/Source/main.cpp @@ -224,7 +224,7 @@ int main(int argc, char *argv[]) const SDL_VideoInfo* vi = SDL_GetVideoInfo(); int width = vi->current_w - 20; - int height = vi->current_h - 50; + int height = vi->current_h - 80; SDL_Surface* screen = SDL_SetVideoMode(width, height, 0, SDL_OPENGL); if (!screen) { @@ -241,13 +241,6 @@ int main(int argc, char *argv[]) return -1; } -/* if(!g_font.create("font.cfnt")) - { - printf("Could not load font.\n"); - SDL_Quit(); - return -1; - }*/ - float t = 0.0f; Uint32 lastTime = SDL_GetTicks(); int mx = 0, my = 0; @@ -721,7 +714,7 @@ int main(int argc, char *argv[]) const float r = 25.0f; for (int i = 0; i < 20; ++i) { - const float a = (float)i / 20.0f * M_PI*2; + const float a = (float)i / 20.0f * (float)M_PI*2; const float fx = (float)x + cosf(a)*r; const float fy = (float)y + sinf(a)*r; glVertex2f(fx,fy);