Fixed several detail mesh issues. Fixed issue 106.
This commit is contained in:
parent
8a2963bce0
commit
e1355c4a33
@ -595,10 +595,10 @@ void duDebugDrawPolyMeshDetail(duDebugDraw* dd, const struct rcPolyMeshDetail& d
|
||||
|
||||
for (int i = 0; i < dmesh.nmeshes; ++i)
|
||||
{
|
||||
const unsigned short* m = &dmesh.meshes[i*4];
|
||||
const unsigned short bverts = m[0];
|
||||
const unsigned short btris = m[2];
|
||||
const unsigned short ntris = m[3];
|
||||
const unsigned int* m = &dmesh.meshes[i*4];
|
||||
const unsigned int bverts = m[0];
|
||||
const unsigned int btris = m[2];
|
||||
const int ntris = (int)m[3];
|
||||
const float* verts = &dmesh.verts[bverts*3];
|
||||
const unsigned char* tris = &dmesh.tris[btris*4];
|
||||
|
||||
@ -618,10 +618,10 @@ void duDebugDrawPolyMeshDetail(duDebugDraw* dd, const struct rcPolyMeshDetail& d
|
||||
const unsigned int coli = duRGBA(0,0,0,64);
|
||||
for (int i = 0; i < dmesh.nmeshes; ++i)
|
||||
{
|
||||
const unsigned short* m = &dmesh.meshes[i*4];
|
||||
const unsigned short bverts = m[0];
|
||||
const unsigned short btris = m[2];
|
||||
const unsigned short ntris = m[3];
|
||||
const unsigned int* m = &dmesh.meshes[i*4];
|
||||
const unsigned int bverts = m[0];
|
||||
const unsigned int btris = m[2];
|
||||
const int ntris = (int)m[3];
|
||||
const float* verts = &dmesh.verts[bverts*3];
|
||||
const unsigned char* tris = &dmesh.tris[btris*4];
|
||||
|
||||
@ -650,10 +650,10 @@ void duDebugDrawPolyMeshDetail(duDebugDraw* dd, const struct rcPolyMeshDetail& d
|
||||
const unsigned int cole = duRGBA(0,0,0,64);
|
||||
for (int i = 0; i < dmesh.nmeshes; ++i)
|
||||
{
|
||||
const unsigned short* m = &dmesh.meshes[i*4];
|
||||
const unsigned short bverts = m[0];
|
||||
const unsigned short btris = m[2];
|
||||
const unsigned short ntris = m[3];
|
||||
const unsigned int* m = &dmesh.meshes[i*4];
|
||||
const unsigned int bverts = m[0];
|
||||
const unsigned int btris = m[2];
|
||||
const int ntris = (int)m[3];
|
||||
const float* verts = &dmesh.verts[bverts*3];
|
||||
const unsigned char* tris = &dmesh.tris[btris*4];
|
||||
|
||||
@ -678,9 +678,9 @@ void duDebugDrawPolyMeshDetail(duDebugDraw* dd, const struct rcPolyMeshDetail& d
|
||||
const unsigned int colv = duRGBA(0,0,0,64);
|
||||
for (int i = 0; i < dmesh.nmeshes; ++i)
|
||||
{
|
||||
const unsigned short* m = &dmesh.meshes[i*4];
|
||||
const unsigned short bverts = m[0];
|
||||
const unsigned short nverts = m[1];
|
||||
const unsigned int* m = &dmesh.meshes[i*4];
|
||||
const unsigned int bverts = m[0];
|
||||
const int nverts = (int)m[1];
|
||||
const float* verts = &dmesh.verts[bverts*3];
|
||||
for (int j = 0; j < nverts; ++j)
|
||||
dd->vertex(&verts[j*3], colv);
|
||||
|
@ -117,12 +117,12 @@ bool duDumpPolyMeshDetailToObj(rcPolyMeshDetail& dmesh, duFileIO* io)
|
||||
|
||||
for (int i = 0; i < dmesh.nmeshes; ++i)
|
||||
{
|
||||
const unsigned short* m = &dmesh.meshes[i*4];
|
||||
const unsigned short bverts = m[0];
|
||||
const unsigned short btris = m[2];
|
||||
const unsigned short ntris = m[3];
|
||||
const unsigned int* m = &dmesh.meshes[i*4];
|
||||
const unsigned int bverts = m[0];
|
||||
const unsigned int btris = m[2];
|
||||
const unsigned int ntris = m[3];
|
||||
const unsigned char* tris = &dmesh.tris[btris*4];
|
||||
for (int j = 0; j < ntris; ++j)
|
||||
for (unsigned int j = 0; j < ntris; ++j)
|
||||
{
|
||||
ioprintf(io, "f %d %d %d\n",
|
||||
(int)(bverts+tris[j*4+0])+1,
|
||||
|
@ -81,10 +81,10 @@ struct dtPoly
|
||||
// Stucture describing polygon detail triangles.
|
||||
struct dtPolyDetail
|
||||
{
|
||||
unsigned short vertBase; // Offset to detail vertex array.
|
||||
unsigned short vertCount; // Number of vertices in the detail mesh.
|
||||
unsigned short triBase; // Offset to detail triangle array.
|
||||
unsigned short triCount; // Number of triangles.
|
||||
unsigned int vertBase; // Offset to detail vertex array.
|
||||
unsigned int triBase; // Offset to detail triangle array.
|
||||
unsigned char vertCount; // Number of vertices in the detail mesh.
|
||||
unsigned char triCount; // Number of triangles.
|
||||
};
|
||||
|
||||
// Stucture describing a link to another polygon.
|
||||
|
@ -36,7 +36,7 @@ struct dtNavMeshCreateParams
|
||||
int polyCount; // Number of polygons
|
||||
int nvp; // Number of verts per polygon.
|
||||
// Navmesh Detail
|
||||
const unsigned short* detailMeshes; // Detail meshes, uses same format as rcPolyMeshDetail.
|
||||
const unsigned int* detailMeshes; // Detail meshes, uses same format as rcPolyMeshDetail.
|
||||
const float* detailVerts; // Detail mesh vertices, uses same format as rcPolyMeshDetail (wu).
|
||||
int detailVertsCount; // Total number of detail vertices
|
||||
const unsigned char* detailTris; // Array of detail tris per detail mesh.
|
||||
|
@ -492,13 +492,13 @@ bool dtCreateNavMeshData(dtNavMeshCreateParams* params, unsigned char** outData,
|
||||
for (int i = 0; i < params->polyCount; ++i)
|
||||
{
|
||||
dtPolyDetail& dtl = navDMeshes[i];
|
||||
const int vb = params->detailMeshes[i*4+0];
|
||||
const int ndv = params->detailMeshes[i*4+1];
|
||||
const int vb = (int)params->detailMeshes[i*4+0];
|
||||
const int ndv = (int)params->detailMeshes[i*4+1];
|
||||
const int nv = navPolys[i].vertCount;
|
||||
dtl.vertBase = vbase;
|
||||
dtl.vertCount = (unsigned short)(ndv-nv);
|
||||
dtl.triBase = params->detailMeshes[i*4+2];
|
||||
dtl.triCount = params->detailMeshes[i*4+3];
|
||||
dtl.vertBase = (unsigned int)vbase;
|
||||
dtl.vertCount = (unsigned char)(ndv-nv);
|
||||
dtl.triBase = (unsigned int)params->detailMeshes[i*4+2];
|
||||
dtl.triCount = (unsigned char)params->detailMeshes[i*4+3];
|
||||
// Copy vertices except the first 'nv' verts which are equal to nav poly verts.
|
||||
if (ndv-nv)
|
||||
{
|
||||
@ -680,9 +680,7 @@ bool dtNavMeshDataSwapEndian(unsigned char* data, const int /*dataSize*/)
|
||||
{
|
||||
dtPolyDetail* pd = &detailMeshes[i];
|
||||
swapEndian(&pd->vertBase);
|
||||
swapEndian(&pd->vertCount);
|
||||
swapEndian(&pd->triBase);
|
||||
swapEndian(&pd->triCount);
|
||||
}
|
||||
|
||||
// Detail verts
|
||||
|
@ -248,15 +248,17 @@ void rcFreePolyMesh(rcPolyMesh* pmesh);
|
||||
// Each submesh represents a polygon in the polymesh and they are stored in
|
||||
// exactly same order. Each submesh is described as 4 values:
|
||||
// base vertex, vertex count, base triangle, triangle count. That is,
|
||||
// const unsigned char* t = &dtl.tris[(tbase+i)*3]; and
|
||||
// const float* v = &dtl.verts[(vbase+t[j])*3];
|
||||
// const unsigned char* t = &dmesh.tris[(tbase+i)*3]; and
|
||||
// const float* v = &dmesh.verts[(vbase+t[j])*3];
|
||||
// If the input polygon has 'n' vertices, those vertices are first in the
|
||||
// submesh vertex list. This allows to compres the mesh by not storing the
|
||||
// first vertices and using the polymesh vertices instead.
|
||||
// Max number of vertices per submesh is 127 and
|
||||
// max number of triangles per submesh is 255.
|
||||
|
||||
struct rcPolyMeshDetail
|
||||
{
|
||||
unsigned short* meshes; // Pointer to all mesh data.
|
||||
unsigned int* meshes; // Pointer to all mesh data.
|
||||
float* verts; // Pointer to all vertex data.
|
||||
unsigned char* tris; // Pointer to all triangle data.
|
||||
int nmeshes; // Number of meshes.
|
||||
|
@ -1163,6 +1163,15 @@ bool rcBuildPolyMesh(rcContext* ctx, rcContourSet& cset, int nvp, rcPolyMesh& me
|
||||
}
|
||||
memset(mesh.flags, 0, sizeof(unsigned short) * mesh.npolys);
|
||||
|
||||
if (mesh.nverts > 0xffff)
|
||||
{
|
||||
ctx->log(RC_LOG_ERROR, "rcMergePolyMeshes: The resulting mesh has too many vertices %d (max %d). Data can be corrupted.", mesh.nverts, 0xffff);
|
||||
}
|
||||
if (mesh.npolys > 0xffff)
|
||||
{
|
||||
ctx->log(RC_LOG_ERROR, "rcMergePolyMeshes: The resulting mesh has too many polygons %d (max %d). Data can be corrupted.", mesh.npolys, 0xffff);
|
||||
}
|
||||
|
||||
ctx->stopTimer(RC_TIMER_BUILD_POLYMESH);
|
||||
|
||||
return true;
|
||||
@ -1298,6 +1307,15 @@ bool rcMergePolyMeshes(rcContext* ctx, rcPolyMesh** meshes, const int nmeshes, r
|
||||
return false;
|
||||
}
|
||||
|
||||
if (mesh.nverts > 0xffff)
|
||||
{
|
||||
ctx->log(RC_LOG_ERROR, "rcMergePolyMeshes: The resulting mesh has too many vertices %d (max %d). Data can be corrupted.", mesh.nverts, 0xffff);
|
||||
}
|
||||
if (mesh.npolys > 0xffff)
|
||||
{
|
||||
ctx->log(RC_LOG_ERROR, "rcMergePolyMeshes: The resulting mesh has too many polygons %d (max %d). Data can be corrupted.", mesh.npolys, 0xffff);
|
||||
}
|
||||
|
||||
ctx->stopTimer(RC_TIMER_MERGE_POLYMESH);
|
||||
|
||||
return true;
|
||||
|
@ -484,12 +484,21 @@ static void delaunayHull(rcContext* ctx, const int npts, const float* pts,
|
||||
t[2] = tris[tris.size()-2];
|
||||
t[3] = tris[tris.size()-1];
|
||||
tris.resize(tris.size()-4);
|
||||
--i;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
inline float getJitterX(const int i)
|
||||
{
|
||||
return (((i * 0x8da6b343) & 0xffff) / 65535.0f * 2.0f) - 1.0f;
|
||||
}
|
||||
|
||||
inline float getJitterY(const int i)
|
||||
{
|
||||
return (((i * 0xd8163841) & 0xffff) / 65535.0f * 2.0f) - 1.0f;
|
||||
}
|
||||
|
||||
static bool buildPolyDetail(rcContext* ctx, const float* in, const int nin,
|
||||
const float sampleDist, const float sampleMaxError,
|
||||
@ -497,9 +506,10 @@ static bool buildPolyDetail(rcContext* ctx, const float* in, const int nin,
|
||||
float* verts, int& nverts, rcIntArray& tris,
|
||||
rcIntArray& edges, rcIntArray& samples)
|
||||
{
|
||||
static const int MAX_VERTS = 256;
|
||||
static const int MAX_EDGE = 64;
|
||||
float edge[(MAX_EDGE+1)*3];
|
||||
static const int MAX_VERTS = 127;
|
||||
static const int MAX_TRIS = 255; // Max tris for delaunay is 2n-2-k (n=num verts, k=num hull verts).
|
||||
static const int MAX_VERTS_PER_EDGE = 32;
|
||||
float edge[(MAX_VERTS_PER_EDGE+1)*3];
|
||||
int hull[MAX_VERTS];
|
||||
int nhull = 0;
|
||||
|
||||
@ -546,9 +556,10 @@ static bool buildPolyDetail(rcContext* ctx, const float* in, const int nin,
|
||||
float dz = vi[2] - vj[2];
|
||||
float d = sqrtf(dx*dx + dz*dz);
|
||||
int nn = 1 + (int)floorf(d/sampleDist);
|
||||
if (nn > MAX_EDGE) nn = MAX_EDGE;
|
||||
if (nn >= MAX_VERTS_PER_EDGE) nn = MAX_VERTS_PER_EDGE-1;
|
||||
if (nverts+nn >= MAX_VERTS)
|
||||
nn = MAX_VERTS-1-nverts;
|
||||
|
||||
for (int k = 0; k <= nn; ++k)
|
||||
{
|
||||
float u = (float)k/(float)nn;
|
||||
@ -559,7 +570,7 @@ static bool buildPolyDetail(rcContext* ctx, const float* in, const int nin,
|
||||
pos[1] = getHeight(pos[0],pos[1],pos[2], cs, ics, chf.ch, hp)*chf.ch;
|
||||
}
|
||||
// Simplify samples.
|
||||
int idx[MAX_EDGE] = {0,nn};
|
||||
int idx[MAX_VERTS_PER_EDGE] = {0,nn};
|
||||
int nidx = 2;
|
||||
for (int k = 0; k < nidx-1; )
|
||||
{
|
||||
@ -667,36 +678,47 @@ static bool buildPolyDetail(rcContext* ctx, const float* in, const int nin,
|
||||
samples.push(x);
|
||||
samples.push(getHeight(pt[0], pt[1], pt[2], cs, ics, chf.ch, hp));
|
||||
samples.push(z);
|
||||
samples.push(0); // Not added
|
||||
}
|
||||
}
|
||||
|
||||
// Add the samples starting from the one that has the most
|
||||
// error. The procedure stops when all samples are added
|
||||
// or when the max error is within treshold.
|
||||
const int nsamples = samples.size()/3;
|
||||
const int nsamples = samples.size()/4;
|
||||
for (int iter = 0; iter < nsamples; ++iter)
|
||||
{
|
||||
if (nverts >= MAX_VERTS)
|
||||
break;
|
||||
|
||||
// Find sample with most error.
|
||||
float bestpt[3] = {0,0,0};
|
||||
float bestd = 0;
|
||||
int besti = -1;
|
||||
for (int i = 0; i < nsamples; ++i)
|
||||
{
|
||||
const int* s = &samples[i*4];
|
||||
if (s[3]) continue; // skip added.
|
||||
float pt[3];
|
||||
pt[0] = samples[i*3+0]*sampleDist;
|
||||
pt[1] = samples[i*3+1]*chf.ch;
|
||||
pt[2] = samples[i*3+2]*sampleDist;
|
||||
// The sample location is jittered to get rid of some bad triangulations
|
||||
// which are cause by symmetrical data from the grid structure.
|
||||
pt[0] = s[0]*sampleDist + getJitterX(i)*cs*0.1f;
|
||||
pt[1] = s[1]*chf.ch;
|
||||
pt[2] = s[2]*sampleDist + getJitterY(i)*cs*0.1f;
|
||||
float d = distToTriMesh(pt, verts, nverts, &tris[0], tris.size()/4);
|
||||
if (d < 0) continue; // did not hit the mesh.
|
||||
if (d > bestd)
|
||||
{
|
||||
bestd = d;
|
||||
besti = i;
|
||||
rcVcopy(bestpt,pt);
|
||||
}
|
||||
}
|
||||
// If the max error is within accepted threshold, stop tesselating.
|
||||
if (bestd <= sampleMaxError)
|
||||
if (bestd <= sampleMaxError || besti == -1)
|
||||
break;
|
||||
|
||||
// Mark sample as added.
|
||||
samples[besti*4+3] = 1;
|
||||
// Add the new sample point.
|
||||
rcVcopy(&verts[nverts*3],bestpt);
|
||||
nverts++;
|
||||
@ -706,12 +728,16 @@ static bool buildPolyDetail(rcContext* ctx, const float* in, const int nin,
|
||||
edges.resize(0);
|
||||
tris.resize(0);
|
||||
delaunayHull(ctx, nverts, verts, nhull, hull, tris, edges);
|
||||
|
||||
if (nverts >= MAX_VERTS)
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
const int ntris = tris.size()/4;
|
||||
if (ntris > MAX_TRIS)
|
||||
{
|
||||
tris.resize(MAX_TRIS*4);
|
||||
ctx->log(RC_LOG_ERROR, "rcBuildPolyMeshDetail: Shrinking triangle count from %d to max %d.", ntris, MAX_TRIS);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -993,7 +1019,7 @@ bool rcBuildPolyMeshDetail(rcContext* ctx, const rcPolyMesh& mesh, const rcCompa
|
||||
dmesh.nmeshes = mesh.npolys;
|
||||
dmesh.nverts = 0;
|
||||
dmesh.ntris = 0;
|
||||
dmesh.meshes = (unsigned short*)rcAlloc(sizeof(unsigned short)*dmesh.nmeshes*4, RC_ALLOC_PERM);
|
||||
dmesh.meshes = (unsigned int*)rcAlloc(sizeof(unsigned int)*dmesh.nmeshes*4, RC_ALLOC_PERM);
|
||||
if (!dmesh.meshes)
|
||||
{
|
||||
ctx->log(RC_LOG_ERROR, "rcBuildPolyMeshDetail: Out of memory 'dmesh.meshes' (%d).", dmesh.nmeshes*4);
|
||||
@ -1069,10 +1095,10 @@ bool rcBuildPolyMeshDetail(rcContext* ctx, const rcPolyMesh& mesh, const rcCompa
|
||||
// Store detail submesh.
|
||||
const int ntris = tris.size()/4;
|
||||
|
||||
dmesh.meshes[i*4+0] = (unsigned short)dmesh.nverts;
|
||||
dmesh.meshes[i*4+1] = (unsigned short)nverts;
|
||||
dmesh.meshes[i*4+2] = (unsigned short)dmesh.ntris;
|
||||
dmesh.meshes[i*4+3] = (unsigned short)ntris;
|
||||
dmesh.meshes[i*4+0] = (unsigned int)dmesh.nverts;
|
||||
dmesh.meshes[i*4+1] = (unsigned int)nverts;
|
||||
dmesh.meshes[i*4+2] = (unsigned int)dmesh.ntris;
|
||||
dmesh.meshes[i*4+3] = (unsigned int)ntris;
|
||||
|
||||
// Store vertices, allocate more memory if necessary.
|
||||
if (dmesh.nverts+nverts > vcap)
|
||||
@ -1150,7 +1176,7 @@ bool rcMergePolyMeshDetails(rcContext* ctx, rcPolyMeshDetail** meshes, const int
|
||||
}
|
||||
|
||||
mesh.nmeshes = 0;
|
||||
mesh.meshes = (unsigned short*)rcAlloc(sizeof(unsigned short)*maxMeshes*4, RC_ALLOC_PERM);
|
||||
mesh.meshes = (unsigned int*)rcAlloc(sizeof(unsigned int)*maxMeshes*4, RC_ALLOC_PERM);
|
||||
if (!mesh.meshes)
|
||||
{
|
||||
ctx->log(RC_LOG_ERROR, "rcBuildPolyMeshDetail: Out of memory 'pmdtl.meshes' (%d).", maxMeshes*4);
|
||||
@ -1180,11 +1206,11 @@ bool rcMergePolyMeshDetails(rcContext* ctx, rcPolyMeshDetail** meshes, const int
|
||||
if (!dm) continue;
|
||||
for (int j = 0; j < dm->nmeshes; ++j)
|
||||
{
|
||||
unsigned short* dst = &mesh.meshes[mesh.nmeshes*4];
|
||||
unsigned short* src = &dm->meshes[j*4];
|
||||
dst[0] = (unsigned short)mesh.nverts+src[0];
|
||||
unsigned int* dst = &mesh.meshes[mesh.nmeshes*4];
|
||||
unsigned int* src = &dm->meshes[j*4];
|
||||
dst[0] = (unsigned int)mesh.nverts+src[0];
|
||||
dst[1] = src[1];
|
||||
dst[2] = (unsigned short)mesh.ntris+src[2];
|
||||
dst[2] = (unsigned int)mesh.ntris+src[2];
|
||||
dst[3] = src[3];
|
||||
mesh.nmeshes++;
|
||||
}
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -284,14 +284,14 @@
|
||||
<key>PBXSmartGroupTreeModuleOutlineStateSelectionKey</key>
|
||||
<array>
|
||||
<array>
|
||||
<integer>59</integer>
|
||||
<integer>51</integer>
|
||||
<integer>36</integer>
|
||||
<integer>27</integer>
|
||||
<integer>1</integer>
|
||||
<integer>0</integer>
|
||||
</array>
|
||||
</array>
|
||||
<key>PBXSmartGroupTreeModuleOutlineStateVisibleRectKey</key>
|
||||
<string>{{0, 451}, {264, 607}}</string>
|
||||
<string>{{0, 181}, {264, 607}}</string>
|
||||
</dict>
|
||||
<key>PBXTopSmartGroupGIDs</key>
|
||||
<array/>
|
||||
@ -326,7 +326,7 @@
|
||||
<key>PBXProjectModuleGUID</key>
|
||||
<string>6B8632A30F78115100E2684A</string>
|
||||
<key>PBXProjectModuleLabel</key>
|
||||
<string>DetourNavMeshQuery.cpp</string>
|
||||
<string>RecastDebugDraw.cpp</string>
|
||||
<key>PBXSplitModuleInNavigatorKey</key>
|
||||
<dict>
|
||||
<key>Split0</key>
|
||||
@ -334,11 +334,11 @@
|
||||
<key>PBXProjectModuleGUID</key>
|
||||
<string>6B8632A40F78115100E2684A</string>
|
||||
<key>PBXProjectModuleLabel</key>
|
||||
<string>DetourNavMeshQuery.cpp</string>
|
||||
<string>RecastDebugDraw.cpp</string>
|
||||
<key>_historyCapacity</key>
|
||||
<integer>0</integer>
|
||||
<key>bookmark</key>
|
||||
<string>6BD66861124351D70021A7A4</string>
|
||||
<string>6BD6695E124377D40021A7A4</string>
|
||||
<key>history</key>
|
||||
<array>
|
||||
<string>6BBB4AA5115B4F3400CF791D</string>
|
||||
@ -377,27 +377,17 @@
|
||||
<string>6BD4029B12243A8000995864</string>
|
||||
<string>6BD402B4122441CB00995864</string>
|
||||
<string>6B920A521225C0AC00D5B5AD</string>
|
||||
<string>6B920A541225C0AC00D5B5AD</string>
|
||||
<string>6B920A6D1225C5DD00D5B5AD</string>
|
||||
<string>6B920A6E1225C5DD00D5B5AD</string>
|
||||
<string>6B920A811225D2EC00D5B5AD</string>
|
||||
<string>6B920A8F1225D3C900D5B5AD</string>
|
||||
<string>6B920AA81225DBCB00D5B5AD</string>
|
||||
<string>6BA7F8A81226EF0400C8C47A</string>
|
||||
<string>6BA7F8AA1226EF0400C8C47A</string>
|
||||
<string>6BA7F8AC1226EF0400C8C47A</string>
|
||||
<string>6BA7F8B61226EF1100C8C47A</string>
|
||||
<string>6BA7F8D01226EF9D00C8C47A</string>
|
||||
<string>6BA7F8EB1227002300C8C47A</string>
|
||||
<string>6BA7F8EC1227002300C8C47A</string>
|
||||
<string>6BA7F8ED1227002300C8C47A</string>
|
||||
<string>6BA7F8EE1227002300C8C47A</string>
|
||||
<string>6B9EFF0B12281C6200535FF1</string>
|
||||
<string>6B847513122B9F4900ADF63D</string>
|
||||
<string>6B847515122B9F4900ADF63D</string>
|
||||
<string>6B847516122B9F4900ADF63D</string>
|
||||
<string>6B847634122CE32800ADF63D</string>
|
||||
<string>6B847635122CE32800ADF63D</string>
|
||||
<string>6B8476F9122D000800ADF63D</string>
|
||||
<string>6B8476FA122D000800ADF63D</string>
|
||||
<string>6B847779122D223D00ADF63D</string>
|
||||
@ -415,17 +405,27 @@
|
||||
<string>6BD66800123D2D230021A7A4</string>
|
||||
<string>6BD66806123D2F4E0021A7A4</string>
|
||||
<string>6BD6681612434B790021A7A4</string>
|
||||
<string>6BD6681712434B790021A7A4</string>
|
||||
<string>6BD6681812434B790021A7A4</string>
|
||||
<string>6BD6683412434D9D0021A7A4</string>
|
||||
<string>6BD6683512434D9D0021A7A4</string>
|
||||
<string>6BD6683712434D9D0021A7A4</string>
|
||||
<string>6BD6684512434DE80021A7A4</string>
|
||||
<string>6BD6684E124350B80021A7A4</string>
|
||||
<string>6BD66855124350F80021A7A4</string>
|
||||
<string>6BD6685E124351D70021A7A4</string>
|
||||
<string>6BD6685F124351D70021A7A4</string>
|
||||
<string>6BD66860124351D70021A7A4</string>
|
||||
<string>6BD6686C124356CE0021A7A4</string>
|
||||
<string>6BD6686E124356CE0021A7A4</string>
|
||||
<string>6BD668A3124361EB0021A7A4</string>
|
||||
<string>6BD668D6124367E30021A7A4</string>
|
||||
<string>6BD6691112436CEC0021A7A4</string>
|
||||
<string>6BD6691212436CEC0021A7A4</string>
|
||||
<string>6BD66930124374D60021A7A4</string>
|
||||
<string>6BD66934124375DF0021A7A4</string>
|
||||
<string>6BD66937124376780021A7A4</string>
|
||||
<string>6BD66938124376780021A7A4</string>
|
||||
<string>6BD66939124376780021A7A4</string>
|
||||
<string>6BD669501243778E0021A7A4</string>
|
||||
<string>6BD669511243778E0021A7A4</string>
|
||||
<string>6BD6695C124377D40021A7A4</string>
|
||||
<string>6BD6695D124377D40021A7A4</string>
|
||||
</array>
|
||||
</dict>
|
||||
<key>SplitCount</key>
|
||||
@ -439,18 +439,18 @@
|
||||
<key>GeometryConfiguration</key>
|
||||
<dict>
|
||||
<key>Frame</key>
|
||||
<string>{{0, 0}, {994, 518}}</string>
|
||||
<string>{{0, 0}, {994, 434}}</string>
|
||||
<key>RubberWindowFrame</key>
|
||||
<string>0 112 1280 666 0 0 1280 778 </string>
|
||||
</dict>
|
||||
<key>Module</key>
|
||||
<string>PBXNavigatorGroup</string>
|
||||
<key>Proportion</key>
|
||||
<string>518pt</string>
|
||||
<string>434pt</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>Proportion</key>
|
||||
<string>102pt</string>
|
||||
<string>186pt</string>
|
||||
<key>Tabs</key>
|
||||
<array>
|
||||
<dict>
|
||||
@ -518,7 +518,7 @@
|
||||
<key>GeometryConfiguration</key>
|
||||
<dict>
|
||||
<key>Frame</key>
|
||||
<string>{{10, 27}, {994, 75}}</string>
|
||||
<string>{{10, 27}, {994, 159}}</string>
|
||||
<key>RubberWindowFrame</key>
|
||||
<string>0 112 1280 666 0 0 1280 778 </string>
|
||||
</dict>
|
||||
@ -602,12 +602,12 @@
|
||||
<key>GeometryConfiguration</key>
|
||||
<dict>
|
||||
<key>Frame</key>
|
||||
<string>{{0, 0}, {1280, 462}}</string>
|
||||
<string>{{0, 0}, {1280, 296}}</string>
|
||||
</dict>
|
||||
<key>Module</key>
|
||||
<string>PBXDebugCLIModule</string>
|
||||
<key>Proportion</key>
|
||||
<string>462pt</string>
|
||||
<string>296pt</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>ContentConfiguration</key>
|
||||
@ -626,8 +626,8 @@
|
||||
<string>yes</string>
|
||||
<key>sizes</key>
|
||||
<array>
|
||||
<string>{{0, 0}, {576, 80}}</string>
|
||||
<string>{{576, 0}, {704, 80}}</string>
|
||||
<string>{{0, 0}, {576, 161}}</string>
|
||||
<string>{{576, 0}, {704, 161}}</string>
|
||||
</array>
|
||||
</dict>
|
||||
<key>VerticalSplitView</key>
|
||||
@ -642,8 +642,8 @@
|
||||
<string>yes</string>
|
||||
<key>sizes</key>
|
||||
<array>
|
||||
<string>{{0, 0}, {1280, 80}}</string>
|
||||
<string>{{0, 78}, {1280, 80}}</string>
|
||||
<string>{{0, 0}, {1280, 161}}</string>
|
||||
<string>{{0, 161}, {1280, 163}}</string>
|
||||
</array>
|
||||
</dict>
|
||||
</dict>
|
||||
@ -663,7 +663,7 @@
|
||||
<key>DebugSTDIOWindowFrame</key>
|
||||
<string>{{200, 200}, {500, 300}}</string>
|
||||
<key>Frame</key>
|
||||
<string>{{0, 467}, {1280, 158}}</string>
|
||||
<string>{{0, 301}, {1280, 324}}</string>
|
||||
<key>PBXDebugSessionStackFrameViewKey</key>
|
||||
<dict>
|
||||
<key>DebugVariablesTableConfiguration</key>
|
||||
@ -676,13 +676,13 @@
|
||||
<real>328</real>
|
||||
</array>
|
||||
<key>Frame</key>
|
||||
<string>{{576, 0}, {704, 80}}</string>
|
||||
<string>{{576, 0}, {704, 161}}</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<key>Module</key>
|
||||
<string>PBXDebugSessionModule</string>
|
||||
<key>Proportion</key>
|
||||
<string>158pt</string>
|
||||
<string>324pt</string>
|
||||
</dict>
|
||||
</array>
|
||||
<key>Name</key>
|
||||
@ -739,6 +739,7 @@
|
||||
<integer>5</integer>
|
||||
<key>WindowOrderList</key>
|
||||
<array>
|
||||
<string>6BD6695F124377D40021A7A4</string>
|
||||
<string>6BD667A7123D13100021A7A4</string>
|
||||
<string>6BD667A8123D13100021A7A4</string>
|
||||
<string>/Users/memon/Code/recastnavigation/RecastDemo/Build/Xcode/Recast.xcodeproj</string>
|
||||
|
@ -43,14 +43,16 @@ void BuildContext::doLog(const rcLogCategory category, const char* msg, const in
|
||||
int n = TEXT_POOL_SIZE - m_textPoolSize;
|
||||
if (n < 2)
|
||||
return;
|
||||
char* cat = dst;
|
||||
char* text = dst+1;
|
||||
const int maxtext = n-1;
|
||||
// Store category
|
||||
*dst = (char)category;
|
||||
n--;
|
||||
*cat = (char)category;
|
||||
// Store message
|
||||
const int count = rcMin(len+1, n);
|
||||
memcpy(dst+1, msg, count);
|
||||
dst[count+1] = '\0';
|
||||
m_textPoolSize += count+1;
|
||||
const int count = rcMin(len+1, maxtext);
|
||||
memcpy(text, msg, count);
|
||||
text[count-1] = '\0';
|
||||
m_textPoolSize += 1 + count;
|
||||
m_messages[m_messageCount++] = dst;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user