Subversion Repository Public Repository

Divide-Framework

This repository has no backups
This repository's network speed is throttled to 100KB/sec

Diff Revisions 336 vs 337 for /trunk/Source Code/Libs/src/ReCast/DetourTileCache/Include/DetourTileCacheBuilder.h

Diff revisions: vs.
  @@ -31,94 +31,94 @@
31 31
32 32 struct dtTileCacheLayerHeader
33 33 {
34 - int magic; ///< Data magic
35 - int version; ///< Data version
36 - int tx,ty,tlayer;
37 - float bmin[3], bmax[3];
38 - unsigned short hmin, hmax; ///< Height min/max range
39 - unsigned char width, height; ///< Dimension of the layer.
40 - unsigned char minx, maxx, miny, maxy; ///< Usable sub-region.
34 + int magic; ///< Data magic
35 + int version; ///< Data version
36 + int tx,ty,tlayer;
37 + float bmin[3], bmax[3];
38 + unsigned short hmin, hmax; ///< Height min/max range
39 + unsigned char width, height; ///< Dimension of the layer.
40 + unsigned char minx, maxx, miny, maxy; ///< Usable sub-region.
41 41 };
42 42
43 43 struct dtTileCacheLayer
44 44 {
45 - dtTileCacheLayerHeader* header;
46 - unsigned char regCount; ///< Region count.
47 - unsigned char* heights;
48 - unsigned char* areas;
49 - unsigned char* cons;
50 - unsigned char* regs;
45 + dtTileCacheLayerHeader* header;
46 + unsigned char regCount; ///< Region count.
47 + unsigned char* heights;
48 + unsigned char* areas;
49 + unsigned char* cons;
50 + unsigned char* regs;
51 51 };
52 52
53 53 struct dtTileCacheContour
54 54 {
55 - int nverts;
56 - unsigned char* verts;
57 - unsigned char reg;
58 - unsigned char area;
55 + int nverts;
56 + unsigned char* verts;
57 + unsigned char reg;
58 + unsigned char area;
59 59 };
60 60
61 61 struct dtTileCacheContourSet
62 62 {
63 - int nconts;
64 - dtTileCacheContour* conts;
63 + int nconts;
64 + dtTileCacheContour* conts;
65 65 };
66 66
67 67 struct dtTileCachePolyMesh
68 68 {
69 - int nvp;
70 - int nverts; ///< Number of vertices.
71 - int npolys; ///< Number of polygons.
72 - unsigned short* verts; ///< Vertices of the mesh, 3 elements per vertex.
73 - unsigned short* polys; ///< Polygons of the mesh, nvp*2 elements per polygon.
74 - unsigned short* flags; ///< Per polygon flags.
75 - unsigned char* areas; ///< Area ID of polygons.
69 + int nvp;
70 + int nverts; ///< Number of vertices.
71 + int npolys; ///< Number of polygons.
72 + unsigned short* verts; ///< Vertices of the mesh, 3 elements per vertex.
73 + unsigned short* polys; ///< Polygons of the mesh, nvp*2 elements per polygon.
74 + unsigned short* flags; ///< Per polygon flags.
75 + unsigned char* areas; ///< Area ID of polygons.
76 76 };
77 77
78 78
79 79 struct dtTileCacheAlloc
80 80 {
81 - virtual ~dtTileCacheAlloc() { }
81 + virtual ~dtTileCacheAlloc() { }
82 82
83 - virtual void reset()
84 - {
85 - }
86 -
87 - virtual void* alloc(const int size)
88 - {
89 - return dtAlloc(size, DT_ALLOC_TEMP);
90 - }
91 -
92 - virtual void free(void* ptr)
93 - {
94 - dtFree(ptr);
95 - }
83 + virtual void reset()
84 + {
85 + }
86 +
87 + virtual void* alloc(const int size)
88 + {
89 + return dtAlloc(size, DT_ALLOC_TEMP);
90 + }
91 +
92 + virtual void free(void* ptr)
93 + {
94 + dtFree(ptr);
95 + }
96 96 };
97 97
98 98 struct dtTileCacheCompressor
99 99 {
100 - virtual ~dtTileCacheCompressor() { }
100 + virtual ~dtTileCacheCompressor() { }
101 101
102 - virtual int maxCompressedSize(const int bufferSize) = 0;
103 - virtual dtStatus compress(const unsigned char* buffer, const int bufferSize,
104 - unsigned char* compressed, const int maxCompressedSize, int* compressedSize) = 0;
105 - virtual dtStatus decompress(const unsigned char* compressed, const int compressedSize,
106 - unsigned char* buffer, const int maxBufferSize, int* bufferSize) = 0;
102 + virtual int maxCompressedSize(const int bufferSize) = 0;
103 + virtual dtStatus compress(const unsigned char* buffer, const int bufferSize,
104 + unsigned char* compressed, const int maxCompressedSize, int* compressedSize) = 0;
105 + virtual dtStatus decompress(const unsigned char* compressed, const int compressedSize,
106 + unsigned char* buffer, const int maxBufferSize, int* bufferSize) = 0;
107 107 };
108 108
109 109
110 110 dtStatus dtBuildTileCacheLayer(dtTileCacheCompressor* comp,
111 - dtTileCacheLayerHeader* header,
112 - const unsigned char* heights,
113 - const unsigned char* areas,
114 - const unsigned char* cons,
115 - unsigned char** outData, int* outDataSize);
111 + dtTileCacheLayerHeader* header,
112 + const unsigned char* heights,
113 + const unsigned char* areas,
114 + const unsigned char* cons,
115 + unsigned char** outData, int* outDataSize);
116 116
117 117 void dtFreeTileCacheLayer(dtTileCacheAlloc* alloc, dtTileCacheLayer* layer);
118 118
119 119 dtStatus dtDecompressTileCacheLayer(dtTileCacheAlloc* alloc, dtTileCacheCompressor* comp,
120 - unsigned char* compressed, const int compressedSize,
121 - dtTileCacheLayer** layerOut);
120 + unsigned char* compressed, const int compressedSize,
121 + dtTileCacheLayer** layerOut);
122 122
123 123 dtTileCacheContourSet* dtAllocTileCacheContourSet(dtTileCacheAlloc* alloc);
124 124 void dtFreeTileCacheContourSet(dtTileCacheAlloc* alloc, dtTileCacheContourSet* cset);
  @@ -127,25 +127,25 @@
127 127 void dtFreeTileCachePolyMesh(dtTileCacheAlloc* alloc, dtTileCachePolyMesh* lmesh);
128 128
129 129 dtStatus dtMarkCylinderArea(dtTileCacheLayer& layer, const float* orig, const float cs, const float ch,
130 - const float* pos, const float radius, const float height, const unsigned char areaId);
130 + const float* pos, const float radius, const float height, const unsigned char areaId);
131 131
132 132 dtStatus dtBuildTileCacheRegions(dtTileCacheAlloc* alloc,
133 - dtTileCacheLayer& layer,
134 - const int walkableClimb);
133 + dtTileCacheLayer& layer,
134 + const int walkableClimb);
135 135
136 136 dtStatus dtBuildTileCacheContours(dtTileCacheAlloc* alloc,
137 - dtTileCacheLayer& layer,
138 - const int walkableClimb, const float maxError,
139 - dtTileCacheContourSet& lcset);
137 + dtTileCacheLayer& layer,
138 + const int walkableClimb, const float maxError,
139 + dtTileCacheContourSet& lcset);
140 140
141 141 dtStatus dtBuildTileCachePolyMesh(dtTileCacheAlloc* alloc,
142 - dtTileCacheContourSet& lcset,
143 - dtTileCachePolyMesh& mesh);
142 + dtTileCacheContourSet& lcset,
143 + dtTileCachePolyMesh& mesh);
144 144
145 145 /// Swaps the endianess of the compressed tile data's header (#dtTileCacheLayerHeader).
146 146 /// Tile layer data does not need endian swapping as it consits only of bytes.
147 - /// @param[in,out] data The tile data array.
148 - /// @param[in] dataSize The size of the data array.
147 + /// @param[in,out] data The tile data array.
148 + /// @param[in] dataSize The size of the data array.
149 149 bool dtTileCacheHeaderSwapEndian(unsigned char* data, const int dataSize);
150 150
151 151