From 76444aa747e7bfed2293f048b98c03c2031bb3b3 Mon Sep 17 00:00:00 2001 From: Mikko Mononen Date: Fri, 25 Mar 2011 10:13:27 +0000 Subject: [PATCH] - Updated win32 project - Fixed VC compile errors --- DebugUtils/Source/DetourDebugDraw.cpp | 2 +- DebugUtils/Source/RecastDebugDraw.cpp | 4 +- Detour/Include/DetourNode.h | 2 +- DetourCrowd/Source/DetourCrowd.cpp | 2 +- DetourTileCache/DetourTileCacheBuilder.cpp | 41 +++++++++++---------- Recast/Source/RecastLayers.cpp | 2 +- RecastDemo/Bin/Recast.exe | Bin 330752 -> 336384 bytes RecastDemo/Build/VC9/Recast.vcproj | 37 ++++++++++++------- RecastDemo/Source/Sample_TempObstacles.cpp | 4 +- RecastDemo/Source/main.cpp | 12 +++++- 10 files changed, 63 insertions(+), 43 deletions(-) diff --git a/DebugUtils/Source/DetourDebugDraw.cpp b/DebugUtils/Source/DetourDebugDraw.cpp index effdd53..feab678 100755 --- a/DebugUtils/Source/DetourDebugDraw.cpp +++ b/DebugUtils/Source/DetourDebugDraw.cpp @@ -72,7 +72,7 @@ static void drawPolyBoundaries(duDebugDraw* dd, const dtMeshTile* tile, } } if (con) - c = duRGBA(255,255,255,24); + c = duRGBA(255,255,255,48); else c = duRGBA(0,0,0,48); } diff --git a/DebugUtils/Source/RecastDebugDraw.cpp b/DebugUtils/Source/RecastDebugDraw.cpp index e158c35..a9ef144 100644 --- a/DebugUtils/Source/RecastDebugDraw.cpp +++ b/DebugUtils/Source/RecastDebugDraw.cpp @@ -326,7 +326,7 @@ void duDebugDrawCompactHeightfieldDistance(duDebugDraw* dd, const rcCompactHeigh dd->end(); } -static void drawLayerPortals(duDebugDraw* dd, const rcHeightfieldLayer* layer, const unsigned int color) +static void drawLayerPortals(duDebugDraw* dd, const rcHeightfieldLayer* layer) { const float cs = layer->cs; const float ch = layer->ch; @@ -418,7 +418,7 @@ void duDebugDrawHeightfieldLayer(duDebugDraw* dd, const struct rcHeightfieldLaye dd->end(); // Portals - drawLayerPortals(dd, &layer, color); + drawLayerPortals(dd, &layer); } void duDebugDrawHeightfieldLayers(duDebugDraw* dd, const struct rcHeightfieldLayerSet& lset) diff --git a/Detour/Include/DetourNode.h b/Detour/Include/DetourNode.h index e46254f..e6aa6b9 100644 --- a/Detour/Include/DetourNode.h +++ b/Detour/Include/DetourNode.h @@ -28,7 +28,7 @@ enum dtNodeFlags }; typedef unsigned short dtNodeIndex; -static const dtNodeIndex DT_NULL_IDX = ~0; +static const dtNodeIndex DT_NULL_IDX = (dtNodeIndex)~0; struct dtNode { diff --git a/DetourCrowd/Source/DetourCrowd.cpp b/DetourCrowd/Source/DetourCrowd.cpp index 82b49e1..b0dc211 100644 --- a/DetourCrowd/Source/DetourCrowd.cpp +++ b/DetourCrowd/Source/DetourCrowd.cpp @@ -172,7 +172,7 @@ static int addNeighbour(const int idx, const float dist, static int getNeighbours(const float* pos, const float height, const float range, const dtCrowdAgent* skip, dtCrowdNeighbour* result, const int maxResult, - dtCrowdAgent** agents, const int nagents, dtProximityGrid* grid) + dtCrowdAgent** agents, const int /*nagents*/, dtProximityGrid* grid) { int n = 0; diff --git a/DetourTileCache/DetourTileCacheBuilder.cpp b/DetourTileCache/DetourTileCacheBuilder.cpp index c380f74..a3504f5 100644 --- a/DetourTileCache/DetourTileCacheBuilder.cpp +++ b/DetourTileCache/DetourTileCacheBuilder.cpp @@ -29,6 +29,7 @@ template class dtFixedArray T* m_ptr; const int m_size; inline T* operator=(T* p); + inline void operator=(dtFixedArray& p); inline dtFixedArray(); public: inline dtFixedArray(dtTileCacheAlloc* a, const int s) : m_alloc(a), m_ptr((T*)a->alloc(sizeof(T)*s)), m_size(s) {} @@ -471,7 +472,7 @@ static unsigned char getNeighbourReg(dtTileCacheLayer& layer, { // No connection, return portal or hard edge. if (portal & mask) - return 0xf8 + dir; + return 0xf8 + (unsigned char)dir; return 0xff; } @@ -598,7 +599,7 @@ static void simplifyContour(dtTempContour& cont, const float maxError) unsigned char ra = cont.verts[j*4+3]; unsigned char rb = cont.verts[i*4+3]; if (ra != rb) - cont.poly[cont.npoly++] = i; + cont.poly[cont.npoly++] = (unsigned short)i; } if (cont.npoly < 2) { @@ -629,8 +630,8 @@ static void simplifyContour(dtTempContour& cont, const float maxError) } } cont.npoly = 0; - cont.poly[cont.npoly++] = lli; - cont.poly[cont.npoly++] = uri; + cont.poly[cont.npoly++] = (unsigned short)lli; + cont.poly[cont.npoly++] = (unsigned short)uri; } // Add points until all raw points are within @@ -716,10 +717,10 @@ static void simplifyContour(dtTempContour& cont, const float maxError) } } -static int getCornerHeight(dtTileCacheLayer& layer, - const int x, const int y, const int z, - const int walkableClimb, - bool& shouldRemove) +static unsigned char getCornerHeight(dtTileCacheLayer& layer, + const int x, const int y, const int z, + const int walkableClimb, + bool& shouldRemove) { const int w = (int)layer.header->width; const int h = (int)layer.header->height; @@ -727,7 +728,7 @@ static int getCornerHeight(dtTileCacheLayer& layer, int n = 0; unsigned char portal = 0xf; - int height = 0; + unsigned char height = 0; for (int dz = -1; dz <= 0; ++dz) { @@ -741,7 +742,7 @@ static int getCornerHeight(dtTileCacheLayer& layer, const int h = (int)layer.heights[idx]; if (dtAbs(h-y) <= walkableClimb) { - height = dtMax(height, h); + height = dtMax(height, (unsigned char)h); portal &= (layer.cons[idx] >> 4); n++; } @@ -885,7 +886,7 @@ static unsigned short addVertex(unsigned short x, unsigned short y, unsigned sho } // Could not find, create new. - i = nv; nv++; + i = (unsigned short)nv; nv++; unsigned short* v = &verts[i*3]; v[0] = x; v[1] = y; @@ -1424,7 +1425,7 @@ static void pushBack(unsigned short v, unsigned short* arr, int& an) an++; } -static bool canRemoveVertex(dtTileCacheAlloc* alloc, dtTileCachePolyMesh& mesh, const unsigned short rem) +static bool canRemoveVertex(dtTileCachePolyMesh& mesh, const unsigned short rem) { // Count number of polygons to remove. int numRemovedVerts = 0; @@ -1499,8 +1500,8 @@ static bool canRemoveVertex(dtTileCacheAlloc* alloc, dtTileCachePolyMesh& mesh, if (!exists) { unsigned short* e = &edges[nedges*3]; - e[0] = a; - e[1] = b; + e[0] = (unsigned short)a; + e[1] = (unsigned short)b; e[2] = 1; nedges++; } @@ -1523,7 +1524,7 @@ static bool canRemoveVertex(dtTileCacheAlloc* alloc, dtTileCachePolyMesh& mesh, return true; } -static dtStatus removeVertex(dtTileCacheAlloc* alloc, dtTileCachePolyMesh& mesh, const unsigned short rem, const int maxTris) +static dtStatus removeVertex(dtTileCachePolyMesh& mesh, const unsigned short rem, const int maxTris) { // Count number of polygons to remove. int numRemovedVerts = 0; @@ -1702,7 +1703,8 @@ static dtStatus removeVertex(dtTileCacheAlloc* alloc, dtTileCachePolyMesh& mesh, return DT_SUCCESS; // Merge polygons. - if (MAX_VERTS_PER_POLY > 3) + int maxVertsPerPoly = MAX_VERTS_PER_POLY; + if (maxVertsPerPoly > 3) { for (;;) { @@ -1887,7 +1889,8 @@ dtStatus dtBuildTileCachePolyMesh(dtTileCacheAlloc* alloc, continue; // Merge polygons. - if (MAX_VERTS_PER_POLY > 3) + int maxVertsPerPoly =MAX_VERTS_PER_POLY ; + if (maxVertsPerPoly > 3) { for(;;) { @@ -1951,9 +1954,9 @@ dtStatus dtBuildTileCachePolyMesh(dtTileCacheAlloc* alloc, { if (vflags[i]) { - if (!canRemoveVertex(alloc, mesh, (unsigned short)i)) + if (!canRemoveVertex(mesh, (unsigned short)i)) continue; - dtStatus status = removeVertex(alloc, mesh, (unsigned short)i, maxTris); + dtStatus status = removeVertex(mesh, (unsigned short)i, maxTris); if (dtStatusFailed(status)) return status; // Remove vertex diff --git a/Recast/Source/RecastLayers.cpp b/Recast/Source/RecastLayers.cpp index f2d60d2..c9ed5e0 100644 --- a/Recast/Source/RecastLayers.cpp +++ b/Recast/Source/RecastLayers.cpp @@ -345,7 +345,7 @@ bool rcBuildHeightfieldLayers(rcContext* ctx, rcCompactHeightfield& chf, } // Merge non-overlapping regions that are close in height. - const int mergeHeight = walkableHeight * 4; + const unsigned short mergeHeight = (unsigned short)walkableHeight * 4; for (int i = 0; i < nregs; ++i) { diff --git a/RecastDemo/Bin/Recast.exe b/RecastDemo/Bin/Recast.exe index 27286a43bb13c3f1fe4bf5d9d854476b093e479f..2cbaf2a91529919414a7503509245456e9f19374 100644 GIT binary patch delta 156621 zcmdSCdwf$>_6M4Ca#|t;PJjRb0u+f-plY#IQxhdENgJSrwDg6Pf+N;i5K$9lv~7xM zN8)Y}=cv&U9UPq*U-J_O$Kt!CNO>s;Gn$Af;w!a)C=4PXx!-lpNm|gE-@U*8E_{-l zvma}(z4lsbuf6u#yG@T8n>HKQ*m({2;I(2{n?v5%@dx?$Z##aE-^c&?(T;v{e$|fW<=+B1zvSi{ zY6ycEt znZq~mOU2JoX*NG@Dv%)DG$($g*6lYgz4Zo-=Hx`=14m6deot+9k}u(YFAU_1elLl_ z%i*IuCxlCRZf$tY3w&z$)oiX*yKapT9(VT&gr zf@bAr%IVy>b7#v5?=+U5-qP;v?}-o7YhBW9DWmCE6WA;S8#7wszONUSD>+Z44D}br zhv|@6SICamY06`-g#;8dvMtpB23UnG-`)$0V6c40`3cVR6Wr$}D9vf+5q^FD0lt69 z+^l^$)k5RUimdn=mdc#{&Idn;ImPo^7|xs{&TC|PpsUbUE!4lUkfqN55AB!NY3j1o z4rj|9*2lKBCVMPZr;hcjq+-;p?p!!%!bnZ*{x40){iAl=YCCR)urqp_kqKMHQqKj> z@&!tmu8f*O>GRrW`TFzg7|u;l2lm>2CM`x)n%8fl)ZXukfj^##$JvK$S8Vm^cwFLj z<#O(P-5CDM`=z^ek7tfRdUas42_sa-4h6nE88~E!x^(5AT;cx0sj2v6VEaL*CR%0D zMV%I1>@bsD7o6aCAHjK1E8qFMXqR`e<4uCR6b#sJ`o zTHPy7O`SG2=cjlaO)acmaC!Uuz~)7rb3L(r_X!$SXh}nQR@}BjTs;gz9;~vMf`t|f zi?dRT!M0ai{e|@0fQ!bz08Ch!UAvp{SzQ;!<8jSYeoLNK!?@>=bH;m@^xc5$OQ&pQ z3mi4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