~rebel/horde3d/trunk

« back to all changes in this revision

Viewing changes to trunk/Tools/Dependencies/RecastNavigation/DetourTileCache/Source/DetourTileCacheBuilder.cpp

  • Committer: felix
  • Date: 2015-07-07 12:57:07 UTC
  • Revision ID: svn-v4:5ce291ac-9df0-446f-9e4f-d57731c4dda7::1699
- Updated RecastNavigation to latest version and fixed multiple issues.
- Adapted GameDetourComponent, GameDetourCrowdComponent, DetourCrowdDemo and AAA accordingly.

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
//
18
18
 
19
19
#include "DetourCommon.h"
 
20
#include "DetourMath.h"
20
21
#include "DetourStatus.h"
21
22
#include "DetourAssert.h"
22
23
#include "DetourTileCacheBuilder.h"
23
24
#include <string.h>
24
 
#include <math.h>
25
25
 
26
26
 
27
27
template<class T> class dtFixedArray
1068
1068
}
1069
1069
 
1070
1070
 
 
1071
// Last time I checked the if version got compiled using cmov, which was a lot faster than module (with idiv).
1071
1072
inline int prev(int i, int n) { return i-1 >= 0 ? i-1 : n-1; }
1072
1073
inline int next(int i, int n) { return i+1 < n ? i+1 : 0; }
1073
1074
 
1968
1969
        const float px = (pos[0]-orig[0])*ics;
1969
1970
        const float pz = (pos[2]-orig[2])*ics;
1970
1971
        
1971
 
        int minx = (int)floorf((bmin[0]-orig[0])*ics);
1972
 
        int miny = (int)floorf((bmin[1]-orig[1])*ich);
1973
 
        int minz = (int)floorf((bmin[2]-orig[2])*ics);
1974
 
        int maxx = (int)floorf((bmax[0]-orig[0])*ics);
1975
 
        int maxy = (int)floorf((bmax[1]-orig[1])*ich);
1976
 
        int maxz = (int)floorf((bmax[2]-orig[2])*ics);
 
1972
        int minx = (int)dtMathFloorf((bmin[0]-orig[0])*ics);
 
1973
        int miny = (int)dtMathFloorf((bmin[1]-orig[1])*ich);
 
1974
        int minz = (int)dtMathFloorf((bmin[2]-orig[2])*ics);
 
1975
        int maxx = (int)dtMathFloorf((bmax[0]-orig[0])*ics);
 
1976
        int maxy = (int)dtMathFloorf((bmax[1]-orig[1])*ich);
 
1977
        int maxz = (int)dtMathFloorf((bmax[2]-orig[2])*ics);
1977
1978
 
1978
1979
        if (maxx < 0) return DT_SUCCESS;
1979
1980
        if (minx >= w) return DT_SUCCESS;
2116
2117
 
2117
2118
bool dtTileCacheHeaderSwapEndian(unsigned char* data, const int dataSize)
2118
2119
{
 
2120
        dtIgnoreUnused(dataSize);
2119
2121
        dtTileCacheLayerHeader* header = (dtTileCacheLayerHeader*)data;
2120
2122
        
2121
2123
        int swappedMagic = DT_TILECACHE_MAGIC;