diff --git a/dep/recastnavigation/CMakeLists.txt b/dep/recastnavigation/CMakeLists.txt new file mode 100644 index 000000000..d97b7b062 --- /dev/null +++ b/dep/recastnavigation/CMakeLists.txt @@ -0,0 +1,19 @@ +# +# Copyright (C) 2005-2011 MaNGOS project +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +add_subdirectory(Detour) +#add_subdirectory(Recast) diff --git a/dep/recastnavigation/DebugUtils/Include/DebugDraw.h b/dep/recastnavigation/DebugUtils/Include/DebugDraw.h new file mode 100644 index 000000000..8c9541683 --- /dev/null +++ b/dep/recastnavigation/DebugUtils/Include/DebugDraw.h @@ -0,0 +1,208 @@ +// +// Copyright (c) 2009-2010 Mikko Mononen memon@inside.org +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. +// + +#ifndef DEBUGDRAW_H +#define DEBUGDRAW_H + +// Some math headers don't have PI defined. +static const float DU_PI = 3.14159265f; + +enum duDebugDrawPrimitives +{ + DU_DRAW_POINTS, + DU_DRAW_LINES, + DU_DRAW_TRIS, + DU_DRAW_QUADS, +}; + +// Abstrace debug draw interface. +struct duDebugDraw +{ + virtual ~duDebugDraw() = 0; + + virtual void depthMask(bool state) = 0; + + // Begin drawing primitives. + // Params: + // prim - (in) primitive type to draw, one of rcDebugDrawPrimitives. + // nverts - (in) number of vertices to be submitted. + // size - (in) size of a primitive, applies to point size and line width only. + virtual void begin(duDebugDrawPrimitives prim, float size = 1.0f) = 0; + + // Submit a vertex + // Params: + // pos - (in) position of the verts. + // color - (in) color of the verts. + virtual void vertex(const float* pos, unsigned int color) = 0; + + // Submit a vertex + // Params: + // x,y,z - (in) position of the verts. + // color - (in) color of the verts. + virtual void vertex(const float x, const float y, const float z, unsigned int color) = 0; + + // End drawing primitives. + virtual void end() = 0; +}; + +inline unsigned int duRGBA(int r, int g, int b, int a) +{ + return ((unsigned int)r) | ((unsigned int)g << 8) | ((unsigned int)b << 16) | ((unsigned int)a << 24); +} + +inline unsigned int duRGBAf(float fr, float fg, float fb, float fa) +{ + unsigned char r = (unsigned char)(fr*255.0f); + unsigned char g = (unsigned char)(fg*255.0f); + unsigned char b = (unsigned char)(fb*255.0f); + unsigned char a = (unsigned char)(fa*255.0f); + return duRGBA(r,g,b,a); +} + +unsigned int duIntToCol(int i, int a); +void duIntToCol(int i, float* col); + +inline unsigned int duMultCol(const unsigned int col, const unsigned int d) +{ + const unsigned int r = col & 0xff; + const unsigned int g = (col >> 8) & 0xff; + const unsigned int b = (col >> 16) & 0xff; + const unsigned int a = (col >> 24) & 0xff; + return duRGBA((r*d) >> 8, (g*d) >> 8, (b*d) >> 8, a); +} + +inline unsigned int duDarkenCol(unsigned int col) +{ + return ((col >> 1) & 0x007f7f7f) | (col & 0xff000000); +} + +inline unsigned int duLerpCol(unsigned int ca, unsigned int cb, unsigned int u) +{ + const unsigned int ra = ca & 0xff; + const unsigned int ga = (ca >> 8) & 0xff; + const unsigned int ba = (ca >> 16) & 0xff; + const unsigned int aa = (ca >> 24) & 0xff; + const unsigned int rb = cb & 0xff; + const unsigned int gb = (cb >> 8) & 0xff; + const unsigned int bb = (cb >> 16) & 0xff; + const unsigned int ab = (cb >> 24) & 0xff; + + unsigned int r = (ra*(255-u) + rb*u)/255; + unsigned int g = (ga*(255-u) + gb*u)/255; + unsigned int b = (ba*(255-u) + bb*u)/255; + unsigned int a = (aa*(255-u) + ab*u)/255; + return duRGBA(r,g,b,a); +} + +inline unsigned int duTransCol(unsigned int c, unsigned int a) +{ + return (a<<24) | (c & 0x00ffffff); +} + + +void duCalcBoxColors(unsigned int* colors, unsigned int colTop, unsigned int colSide); + +void duDebugDrawCylinderWire(struct duDebugDraw* dd, float minx, float miny, float minz, + float maxx, float maxy, float maxz, unsigned int col, const float lineWidth); + +void duDebugDrawBoxWire(struct duDebugDraw* dd, float minx, float miny, float minz, + float maxx, float maxy, float maxz, unsigned int col, const float lineWidth); + +void duDebugDrawArc(struct duDebugDraw* dd, const float x0, const float y0, const float z0, + const float x1, const float y1, const float z1, const float h, + const float as0, const float as1, unsigned int col, const float lineWidth); + +void duDebugDrawArrow(struct duDebugDraw* dd, const float x0, const float y0, const float z0, + const float x1, const float y1, const float z1, + const float as0, const float as1, unsigned int col, const float lineWidth); + +void duDebugDrawCircle(struct duDebugDraw* dd, const float x, const float y, const float z, + const float r, unsigned int col, const float lineWidth); + +void duDebugDrawCross(struct duDebugDraw* dd, const float x, const float y, const float z, + const float size, unsigned int col, const float lineWidth); + +void duDebugDrawBox(struct duDebugDraw* dd, float minx, float miny, float minz, + float maxx, float maxy, float maxz, const unsigned int* fcol); + +void duDebugDrawCylinder(struct duDebugDraw* dd, float minx, float miny, float minz, + float maxx, float maxy, float maxz, unsigned int col); + +void duDebugDrawGridXZ(struct duDebugDraw* dd, const float ox, const float oy, const float oz, + const int w, const int h, const float size, + const unsigned int col, const float lineWidth); + + +// Versions without begin/end, can be used to draw multiple primitives. +void duAppendCylinderWire(struct duDebugDraw* dd, float minx, float miny, float minz, + float maxx, float maxy, float maxz, unsigned int col); + +void duAppendBoxWire(struct duDebugDraw* dd, float minx, float miny, float minz, + float maxx, float maxy, float maxz, unsigned int col); + +void duAppendBoxPoints(struct duDebugDraw* dd, float minx, float miny, float minz, + float maxx, float maxy, float maxz, unsigned int col); + +void duAppendArc(struct duDebugDraw* dd, const float x0, const float y0, const float z0, + const float x1, const float y1, const float z1, const float h, + const float as0, const float as1, unsigned int col); + +void duAppendArrow(struct duDebugDraw* dd, const float x0, const float y0, const float z0, + const float x1, const float y1, const float z1, + const float as0, const float as1, unsigned int col); + +void duAppendCircle(struct duDebugDraw* dd, const float x, const float y, const float z, + const float r, unsigned int col); + +void duAppendCross(struct duDebugDraw* dd, const float x, const float y, const float z, + const float size, unsigned int col); + +void duAppendBox(struct duDebugDraw* dd, float minx, float miny, float minz, + float maxx, float maxy, float maxz, const unsigned int* fcol); + +void duAppendCylinder(struct duDebugDraw* dd, float minx, float miny, float minz, + float maxx, float maxy, float maxz, unsigned int col); + + +class duDisplayList : public duDebugDraw +{ + float* m_pos; + unsigned int* m_color; + int m_size; + int m_cap; + + bool m_depthMask; + duDebugDrawPrimitives m_prim; + float m_primSize; + + void resize(int cap); + +public: + duDisplayList(int cap = 512); + ~duDisplayList(); + virtual void depthMask(bool state); + virtual void begin(duDebugDrawPrimitives prim, float size = 1.0f); + virtual void vertex(const float x, const float y, const float z, unsigned int color); + virtual void vertex(const float* pos, unsigned int color); + virtual void end(); + void clear(); + void draw(struct duDebugDraw* dd); +}; + + +#endif // DEBUGDRAW_H diff --git a/dep/recastnavigation/DebugUtils/Include/DetourDebugDraw.h b/dep/recastnavigation/DebugUtils/Include/DetourDebugDraw.h new file mode 100644 index 000000000..d0d1d5d18 --- /dev/null +++ b/dep/recastnavigation/DebugUtils/Include/DetourDebugDraw.h @@ -0,0 +1,38 @@ +// +// Copyright (c) 2009-2010 Mikko Mononen memon@inside.org +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. +// + +#ifndef DETOURDEBUGDRAW_H +#define DETOURDEBUGDRAW_H + +#include "DetourNavMesh.h" +#include "DetourNavMeshQuery.h" + +enum DrawNavMeshFlags +{ + DU_DRAWNAVMESH_OFFMESHCONS = 0x01, + DU_DRAWNAVMESH_CLOSEDLIST = 0x02, +}; + +void duDebugDrawNavMesh(struct duDebugDraw* dd, const dtNavMesh& mesh, unsigned char flags); +void duDebugDrawNavMeshWithClosedList(struct duDebugDraw* dd, const dtNavMesh& mesh, const dtNavMeshQuery& query, unsigned char flags); +void duDebugDrawNavMeshNodes(struct duDebugDraw* dd, const dtNavMeshQuery& query); +void duDebugDrawNavMeshBVTree(struct duDebugDraw* dd, const dtNavMesh& mesh); +void duDebugDrawNavMeshPortals(struct duDebugDraw* dd, const dtNavMesh& mesh); +void duDebugDrawNavMeshPoly(struct duDebugDraw* dd, const dtNavMesh& mesh, dtPolyRef ref, const unsigned int col); + +#endif // DETOURDEBUGDRAW_H \ No newline at end of file diff --git a/dep/recastnavigation/DebugUtils/Include/RecastDebugDraw.h b/dep/recastnavigation/DebugUtils/Include/RecastDebugDraw.h new file mode 100644 index 000000000..3d204d27b --- /dev/null +++ b/dep/recastnavigation/DebugUtils/Include/RecastDebugDraw.h @@ -0,0 +1,38 @@ +// +// Copyright (c) 2009-2010 Mikko Mononen memon@inside.org +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. +// + +#ifndef RECAST_DEBUGDRAW_H +#define RECAST_DEBUGDRAW_H + +void duDebugDrawTriMesh(struct duDebugDraw* dd, const float* verts, int nverts, const int* tris, const float* normals, int ntris, const unsigned char* flags); +void duDebugDrawTriMeshSlope(struct duDebugDraw* dd, const float* verts, int nverts, const int* tris, const float* normals, int ntris, const float walkableSlopeAngle); + +void duDebugDrawHeightfieldSolid(struct duDebugDraw* dd, const struct rcHeightfield& hf); +void duDebugDrawHeightfieldWalkable(struct duDebugDraw* dd, const struct rcHeightfield& hf); + +void duDebugDrawCompactHeightfieldSolid(struct duDebugDraw* dd, const struct rcCompactHeightfield& chf); +void duDebugDrawCompactHeightfieldRegions(struct duDebugDraw* dd, const struct rcCompactHeightfield& chf); +void duDebugDrawCompactHeightfieldDistance(struct duDebugDraw* dd, const struct rcCompactHeightfield& chf); + +void duDebugDrawRegionConnections(struct duDebugDraw* dd, const struct rcContourSet& cset, const float alpha = 1.0f); +void duDebugDrawRawContours(struct duDebugDraw* dd, const struct rcContourSet& cset, const float alpha = 1.0f); +void duDebugDrawContours(struct duDebugDraw* dd, const struct rcContourSet& cset, const float alpha = 1.0f); +void duDebugDrawPolyMesh(struct duDebugDraw* dd, const struct rcPolyMesh& mesh); +void duDebugDrawPolyMeshDetail(struct duDebugDraw* dd, const struct rcPolyMeshDetail& dmesh); + +#endif // RECAST_DEBUGDRAW_H diff --git a/dep/recastnavigation/DebugUtils/Include/RecastDump.h b/dep/recastnavigation/DebugUtils/Include/RecastDump.h new file mode 100644 index 000000000..6a722fdae --- /dev/null +++ b/dep/recastnavigation/DebugUtils/Include/RecastDump.h @@ -0,0 +1,43 @@ +// +// Copyright (c) 2009-2010 Mikko Mononen memon@inside.org +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. +// + +#ifndef RECAST_DUMP_H +#define RECAST_DUMP_H + +struct duFileIO +{ + virtual ~duFileIO() = 0; + virtual bool isWriting() const = 0; + virtual bool isReading() const = 0; + virtual bool write(const void* ptr, const size_t size) = 0; + virtual bool read(void* ptr, const size_t size) = 0; +}; + +bool duDumpPolyMeshToObj(struct rcPolyMesh& pmesh, duFileIO* io); +bool duDumpPolyMeshDetailToObj(struct rcPolyMeshDetail& dmesh, duFileIO* io); + +bool duDumpContourSet(struct rcContourSet& cset, duFileIO* io); +bool duReadContourSet(struct rcContourSet& cset, duFileIO* io); + +bool duDumpCompactHeightfield(struct rcCompactHeightfield& chf, duFileIO* io); +bool duReadCompactHeightfield(struct rcCompactHeightfield& chf, duFileIO* io); + +void duLogBuildTimes(rcContext& ctx, const int totalTileUsec); + + +#endif // RECAST_DUMP_H diff --git a/dep/recastnavigation/DebugUtils/Source/DebugDraw.cpp b/dep/recastnavigation/DebugUtils/Source/DebugDraw.cpp new file mode 100644 index 000000000..a9c1ac12f --- /dev/null +++ b/dep/recastnavigation/DebugUtils/Source/DebugDraw.cpp @@ -0,0 +1,599 @@ +// +// Copyright (c) 2009-2010 Mikko Mononen memon@inside.org +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. +// + +#define _USE_MATH_DEFINES +#include +#include +#include "DebugDraw.h" + + +duDebugDraw::~duDebugDraw() +{ + // Empty +} + + +inline int bit(int a, int b) +{ + return (a & (1 << b)) >> b; +} + +unsigned int duIntToCol(int i, int a) +{ + int r = bit(i, 1) + bit(i, 3) * 2 + 1; + int g = bit(i, 2) + bit(i, 4) * 2 + 1; + int b = bit(i, 0) + bit(i, 5) * 2 + 1; + return duRGBA(r*63,g*63,b*63,a); +} + +void duIntToCol(int i, float* col) +{ + int r = bit(i, 0) + bit(i, 3) * 2 + 1; + int g = bit(i, 1) + bit(i, 4) * 2 + 1; + int b = bit(i, 2) + bit(i, 5) * 2 + 1; + col[0] = 1 - r*63.0f/255.0f; + col[1] = 1 - g*63.0f/255.0f; + col[2] = 1 - b*63.0f/255.0f; +} + +void duCalcBoxColors(unsigned int* colors, unsigned int colTop, unsigned int colSide) +{ + if (!colors) return; + + colors[0] = duMultCol(colTop, 250); + colors[1] = duMultCol(colSide, 140); + colors[2] = duMultCol(colSide, 165); + colors[3] = duMultCol(colSide, 217); + colors[4] = duMultCol(colSide, 165); + colors[5] = duMultCol(colSide, 217); +} + +void duDebugDrawCylinderWire(struct duDebugDraw* dd, float minx, float miny, float minz, + float maxx, float maxy, float maxz, unsigned int col, const float lineWidth) +{ + if (!dd) return; + + dd->begin(DU_DRAW_LINES, lineWidth); + duAppendCylinderWire(dd, minx,miny,minz, maxx,maxy,maxz, col); + dd->end(); +} + +void duDebugDrawBoxWire(struct duDebugDraw* dd, float minx, float miny, float minz, + float maxx, float maxy, float maxz, unsigned int col, const float lineWidth) +{ + if (!dd) return; + + dd->begin(DU_DRAW_LINES, lineWidth); + duAppendBoxWire(dd, minx,miny,minz, maxx,maxy,maxz, col); + dd->end(); +} + +void duDebugDrawArc(struct duDebugDraw* dd, const float x0, const float y0, const float z0, + const float x1, const float y1, const float z1, const float h, + const float as0, const float as1, unsigned int col, const float lineWidth) +{ + if (!dd) return; + + dd->begin(DU_DRAW_LINES, lineWidth); + duAppendArc(dd, x0,y0,z0, x1,y1,z1, h, as0, as1, col); + dd->end(); +} + +void duDebugDrawArrow(struct duDebugDraw* dd, const float x0, const float y0, const float z0, + const float x1, const float y1, const float z1, + const float as0, const float as1, unsigned int col, const float lineWidth) +{ + if (!dd) return; + + dd->begin(DU_DRAW_LINES, lineWidth); + duAppendArrow(dd, x0,y0,z0, x1,y1,z1, as0, as1, col); + dd->end(); +} + +void duDebugDrawCircle(struct duDebugDraw* dd, const float x, const float y, const float z, + const float r, unsigned int col, const float lineWidth) +{ + if (!dd) return; + + dd->begin(DU_DRAW_LINES, lineWidth); + duAppendCircle(dd, x,y,z, r, col); + dd->end(); +} + +void duDebugDrawCross(struct duDebugDraw* dd, const float x, const float y, const float z, + const float size, unsigned int col, const float lineWidth) +{ + if (!dd) return; + + dd->begin(DU_DRAW_LINES, lineWidth); + duAppendCross(dd, x,y,z, size, col); + dd->end(); +} + +void duDebugDrawBox(struct duDebugDraw* dd, float minx, float miny, float minz, + float maxx, float maxy, float maxz, const unsigned int* fcol) +{ + if (!dd) return; + + dd->begin(DU_DRAW_TRIS); + duAppendBox(dd, minx,miny,minz, maxx,maxy,maxz, fcol); + dd->end(); +} + +void duDebugDrawCylinder(struct duDebugDraw* dd, float minx, float miny, float minz, + float maxx, float maxy, float maxz, unsigned int col) +{ + if (!dd) return; + + dd->begin(DU_DRAW_TRIS); + duAppendCylinder(dd, minx,miny,minz, maxx,maxy,maxz, col); + dd->end(); +} + +void duDebugDrawGridXZ(struct duDebugDraw* dd, const float ox, const float oy, const float oz, + const int w, const int h, const float size, + const unsigned int col, const float lineWidth) +{ + if (!dd) return; + + dd->begin(DU_DRAW_LINES, lineWidth); + for (int i = 0; i <= h; ++i) + { + dd->vertex(ox,oy,oz+i*size, col); + dd->vertex(ox+w*size,oy,oz+i*size, col); + } + for (int i = 0; i <= w; ++i) + { + dd->vertex(ox+i*size,oy,oz, col); + dd->vertex(ox+i*size,oy,oz+h*size, col); + } + dd->end(); +} + + +void duAppendCylinderWire(struct duDebugDraw* dd, float minx, float miny, float minz, + float maxx, float maxy, float maxz, unsigned int col) +{ + if (!dd) return; + + static const int NUM_SEG = 16; + static float dir[NUM_SEG*2]; + static bool init = false; + if (!init) + { + init = true; + for (int i = 0; i < NUM_SEG; ++i) + { + const float a = (float)i/(float)NUM_SEG*DU_PI*2; + dir[i*2] = cosf(a); + dir[i*2+1] = sinf(a); + } + } + + const float cx = (maxx + minx)/2; + const float cz = (maxz + minz)/2; + const float rx = (maxx - minx)/2; + const float rz = (maxz - minz)/2; + + for (int i = 0, j = NUM_SEG-1; i < NUM_SEG; j = i++) + { + dd->vertex(cx+dir[j*2+0]*rx, miny, cz+dir[j*2+1]*rz, col); + dd->vertex(cx+dir[i*2+0]*rx, miny, cz+dir[i*2+1]*rz, col); + dd->vertex(cx+dir[j*2+0]*rx, maxy, cz+dir[j*2+1]*rz, col); + dd->vertex(cx+dir[i*2+0]*rx, maxy, cz+dir[i*2+1]*rz, col); + } + for (int i = 0; i < NUM_SEG; i += NUM_SEG/4) + { + dd->vertex(cx+dir[i*2+0]*rx, miny, cz+dir[i*2+1]*rz, col); + dd->vertex(cx+dir[i*2+0]*rx, maxy, cz+dir[i*2+1]*rz, col); + } +} + +void duAppendBoxWire(struct duDebugDraw* dd, float minx, float miny, float minz, + float maxx, float maxy, float maxz, unsigned int col) +{ + if (!dd) return; + // Top + dd->vertex(minx, miny, minz, col); + dd->vertex(maxx, miny, minz, col); + dd->vertex(maxx, miny, minz, col); + dd->vertex(maxx, miny, maxz, col); + dd->vertex(maxx, miny, maxz, col); + dd->vertex(minx, miny, maxz, col); + dd->vertex(minx, miny, maxz, col); + dd->vertex(minx, miny, minz, col); + + // bottom + dd->vertex(minx, maxy, minz, col); + dd->vertex(maxx, maxy, minz, col); + dd->vertex(maxx, maxy, minz, col); + dd->vertex(maxx, maxy, maxz, col); + dd->vertex(maxx, maxy, maxz, col); + dd->vertex(minx, maxy, maxz, col); + dd->vertex(minx, maxy, maxz, col); + dd->vertex(minx, maxy, minz, col); + + // Sides + dd->vertex(minx, miny, minz, col); + dd->vertex(minx, maxy, minz, col); + dd->vertex(maxx, miny, minz, col); + dd->vertex(maxx, maxy, minz, col); + dd->vertex(maxx, miny, maxz, col); + dd->vertex(maxx, maxy, maxz, col); + dd->vertex(minx, miny, maxz, col); + dd->vertex(minx, maxy, maxz, col); +} + +void duAppendBoxPoints(struct duDebugDraw* dd, float minx, float miny, float minz, + float maxx, float maxy, float maxz, unsigned int col) +{ + if (!dd) return; + // Top + dd->vertex(minx, miny, minz, col); + dd->vertex(maxx, miny, minz, col); + dd->vertex(maxx, miny, minz, col); + dd->vertex(maxx, miny, maxz, col); + dd->vertex(maxx, miny, maxz, col); + dd->vertex(minx, miny, maxz, col); + dd->vertex(minx, miny, maxz, col); + dd->vertex(minx, miny, minz, col); + + // bottom + dd->vertex(minx, maxy, minz, col); + dd->vertex(maxx, maxy, minz, col); + dd->vertex(maxx, maxy, minz, col); + dd->vertex(maxx, maxy, maxz, col); + dd->vertex(maxx, maxy, maxz, col); + dd->vertex(minx, maxy, maxz, col); + dd->vertex(minx, maxy, maxz, col); + dd->vertex(minx, maxy, minz, col); +} + +void duAppendBox(struct duDebugDraw* dd, float minx, float miny, float minz, + float maxx, float maxy, float maxz, const unsigned int* fcol) +{ + if (!dd) return; + const float verts[8*3] = + { + minx, miny, minz, + maxx, miny, minz, + maxx, miny, maxz, + minx, miny, maxz, + minx, maxy, minz, + maxx, maxy, minz, + maxx, maxy, maxz, + minx, maxy, maxz, + }; + static const unsigned char inds[6*4] = + { + 7, 6, 5, 4, + 0, 1, 2, 3, + 1, 5, 6, 2, + 3, 7, 4, 0, + 2, 6, 7, 3, + 0, 4, 5, 1, + }; + + const unsigned char* in = inds; + for (int i = 0; i < 6; ++i) + { + dd->vertex(&verts[*in*3], fcol[i]); in++; + dd->vertex(&verts[*in*3], fcol[i]); in++; + dd->vertex(&verts[*in*3], fcol[i]); in++; + dd->vertex(&verts[*in*3], fcol[i]); in++; + } +} + +void duAppendCylinder(struct duDebugDraw* dd, float minx, float miny, float minz, + float maxx, float maxy, float maxz, unsigned int col) +{ + if (!dd) return; + + static const int NUM_SEG = 16; + static float dir[NUM_SEG*2]; + static bool init = false; + if (!init) + { + init = true; + for (int i = 0; i < NUM_SEG; ++i) + { + const float a = (float)i/(float)NUM_SEG*DU_PI*2; + dir[i*2] = cosf(a); + dir[i*2+1] = sinf(a); + } + } + + unsigned int col2 = duMultCol(col, 160); + + const float cx = (maxx + minx)/2; + const float cz = (maxz + minz)/2; + const float rx = (maxx - minx)/2; + const float rz = (maxz - minz)/2; + + for (int i = 2; i < NUM_SEG; ++i) + { + const int a = 0, b = i-1, c = i; + dd->vertex(cx+dir[a*2+0]*rx, miny, cz+dir[a*2+1]*rz, col2); + dd->vertex(cx+dir[b*2+0]*rx, miny, cz+dir[b*2+1]*rz, col2); + dd->vertex(cx+dir[c*2+0]*rx, miny, cz+dir[c*2+1]*rz, col2); + } + for (int i = 2; i < NUM_SEG; ++i) + { + const int a = 0, b = i, c = i-1; + dd->vertex(cx+dir[a*2+0]*rx, maxy, cz+dir[a*2+1]*rz, col); + dd->vertex(cx+dir[b*2+0]*rx, maxy, cz+dir[b*2+1]*rz, col); + dd->vertex(cx+dir[c*2+0]*rx, maxy, cz+dir[c*2+1]*rz, col); + } + for (int i = 0, j = NUM_SEG-1; i < NUM_SEG; j = i++) + { + dd->vertex(cx+dir[i*2+0]*rx, miny, cz+dir[i*2+1]*rz, col2); + dd->vertex(cx+dir[j*2+0]*rx, miny, cz+dir[j*2+1]*rz, col2); + dd->vertex(cx+dir[j*2+0]*rx, maxy, cz+dir[j*2+1]*rz, col); + + dd->vertex(cx+dir[i*2+0]*rx, miny, cz+dir[i*2+1]*rz, col2); + dd->vertex(cx+dir[j*2+0]*rx, maxy, cz+dir[j*2+1]*rz, col); + dd->vertex(cx+dir[i*2+0]*rx, maxy, cz+dir[i*2+1]*rz, col); + } +} + + +inline void evalArc(const float x0, const float y0, const float z0, + const float dx, const float dy, const float dz, + const float h, const float u, float* res) +{ + res[0] = x0 + dx * u; + res[1] = y0 + dy * u + h * (1-(u*2-1)*(u*2-1)); + res[2] = z0 + dz * u; +} + + +inline void vcross(float* dest, const float* v1, const float* v2) +{ + dest[0] = v1[1]*v2[2] - v1[2]*v2[1]; + dest[1] = v1[2]*v2[0] - v1[0]*v2[2]; + dest[2] = v1[0]*v2[1] - v1[1]*v2[0]; +} + +inline void vnormalize(float* v) +{ + float d = 1.0f / sqrtf(v[0]*v[0] + v[1]*v[1] + v[2]*v[2]); + v[0] *= d; + v[1] *= d; + v[2] *= d; +} + +inline void vsub(float* dest, const float* v1, const float* v2) +{ + dest[0] = v1[0]-v2[0]; + dest[1] = v1[1]-v2[1]; + dest[2] = v1[2]-v2[2]; +} + +inline float vdistSqr(const float* v1, const float* v2) +{ + const float x = v1[0]-v2[0]; + const float y = v1[1]-v2[1]; + const float z = v1[2]-v2[2]; + return x*x + y*y + z*z; +} + + +void appendArrowHead(struct duDebugDraw* dd, const float* p, const float* q, + const float s, unsigned int col) +{ + const float eps = 0.001f; + if (!dd) return; + if (vdistSqr(p,q) < eps*eps) return; + float ax[3], ay[3] = {0,1,0}, az[3]; + vsub(az, q, p); + vnormalize(az); + vcross(ax, ay, az); + vcross(ay, az, ax); + vnormalize(ay); + + dd->vertex(p, col); +// dd->vertex(p[0]+az[0]*s+ay[0]*s/2, p[1]+az[1]*s+ay[1]*s/2, p[2]+az[2]*s+ay[2]*s/2, col); + dd->vertex(p[0]+az[0]*s+ax[0]*s/3, p[1]+az[1]*s+ax[1]*s/3, p[2]+az[2]*s+ax[2]*s/3, col); + + dd->vertex(p, col); +// dd->vertex(p[0]+az[0]*s-ay[0]*s/2, p[1]+az[1]*s-ay[1]*s/2, p[2]+az[2]*s-ay[2]*s/2, col); + dd->vertex(p[0]+az[0]*s-ax[0]*s/3, p[1]+az[1]*s-ax[1]*s/3, p[2]+az[2]*s-ax[2]*s/3, col); + +} + +void duAppendArc(struct duDebugDraw* dd, const float x0, const float y0, const float z0, + const float x1, const float y1, const float z1, const float h, + const float as0, const float as1, unsigned int col) +{ + if (!dd) return; + static const int NUM_ARC_PTS = 8; + static const float PAD = 0.05f; + static const float ARC_PTS_SCALE = (1.0f-PAD*2) / (float)NUM_ARC_PTS; + const float dx = x1 - x0; + const float dy = y1 - y0; + const float dz = z1 - z0; + const float len = sqrtf(dx*dx + dy*dy + dz*dz); + float prev[3]; + evalArc(x0,y0,z0, dx,dy,dz, len*h, PAD, prev); + for (int i = 1; i <= NUM_ARC_PTS; ++i) + { + const float u = PAD + i * ARC_PTS_SCALE; + float pt[3]; + evalArc(x0,y0,z0, dx,dy,dz, len*h, u, pt); + dd->vertex(prev[0],prev[1],prev[2], col); + dd->vertex(pt[0],pt[1],pt[2], col); + prev[0] = pt[0]; prev[1] = pt[1]; prev[2] = pt[2]; + } + + // End arrows + if (as0 > 0.001f) + { + float p[3], q[3]; + evalArc(x0,y0,z0, dx,dy,dz, len*h, PAD, p); + evalArc(x0,y0,z0, dx,dy,dz, len*h, PAD+0.05f, q); + appendArrowHead(dd, p, q, as0, col); + } + + if (as1 > 0.001f) + { + float p[3], q[3]; + evalArc(x0,y0,z0, dx,dy,dz, len*h, 1-PAD, p); + evalArc(x0,y0,z0, dx,dy,dz, len*h, 1-(PAD+0.05f), q); + appendArrowHead(dd, p, q, as1, col); + } +} + +void duAppendArrow(struct duDebugDraw* dd, const float x0, const float y0, const float z0, + const float x1, const float y1, const float z1, + const float as0, const float as1, unsigned int col) +{ + if (!dd) return; + + dd->vertex(x0,y0,z0, col); + dd->vertex(x1,y1,z1, col); + + // End arrows + const float p[3] = {x0,y0,z0}, q[3] = {x1,y1,z1}; + if (as0 > 0.001f) + appendArrowHead(dd, p, q, as0, col); + if (as1 > 0.001f) + appendArrowHead(dd, q, p, as1, col); +} + +void duAppendCircle(struct duDebugDraw* dd, const float x, const float y, const float z, + const float r, unsigned int col) +{ + if (!dd) return; + static const int NUM_SEG = 40; + static float dir[40*2]; + static bool init = false; + if (!init) + { + init = true; + for (int i = 0; i < NUM_SEG; ++i) + { + const float a = (float)i/(float)NUM_SEG*DU_PI*2; + dir[i*2] = cosf(a); + dir[i*2+1] = sinf(a); + } + } + + for (int i = 0, j = NUM_SEG-1; i < NUM_SEG; j = i++) + { + dd->vertex(x+dir[j*2+0]*r, y, z+dir[j*2+1]*r, col); + dd->vertex(x+dir[i*2+0]*r, y, z+dir[i*2+1]*r, col); + } +} + +void duAppendCross(struct duDebugDraw* dd, const float x, const float y, const float z, + const float s, unsigned int col) +{ + if (!dd) return; + dd->vertex(x-s,y,z, col); + dd->vertex(x+s,y,z, col); + dd->vertex(x,y-s,z, col); + dd->vertex(x,y+s,z, col); + dd->vertex(x,y,z-s, col); + dd->vertex(x,y,z+s, col); +} + +duDisplayList::duDisplayList(int cap) : + m_pos(0), + m_color(0), + m_size(0), + m_cap(0), + m_depthMask(true), + m_prim(DU_DRAW_LINES), + m_primSize(1.0f) +{ + if (cap < 8) + cap = 8; + resize(cap); +} + +duDisplayList::~duDisplayList() +{ + delete [] m_pos; + delete [] m_color; +} + +void duDisplayList::resize(int cap) +{ + float* newPos = new float[cap*3]; + if (m_size) + memcpy(newPos, m_pos, sizeof(float)*3*m_size); + delete [] m_pos; + m_pos = newPos; + + unsigned int* newColor = new unsigned int[cap]; + if (m_size) + memcpy(newColor, m_color, sizeof(unsigned int)*m_size); + delete [] m_color; + m_color = newColor; + + m_cap = cap; +} + +void duDisplayList::clear() +{ + m_size = 0; +} + +void duDisplayList::depthMask(bool state) +{ + m_depthMask = state; +} + +void duDisplayList::begin(duDebugDrawPrimitives prim, float size) +{ + clear(); + m_prim = prim; + m_primSize = size; +} + +void duDisplayList::vertex(const float x, const float y, const float z, unsigned int color) +{ + if (m_size+1 >= m_cap) + resize(m_cap*2); + float* p = &m_pos[m_size*3]; + p[0] = x; + p[1] = y; + p[2] = z; + m_color[m_size] = color; + m_size++; +} + +void duDisplayList::vertex(const float* pos, unsigned int color) +{ + vertex(pos[0],pos[1],pos[2],color); +} + +void duDisplayList::end() +{ +} + +void duDisplayList::draw(struct duDebugDraw* dd) +{ + if (!dd) return; + if (!m_size) return; + dd->depthMask(m_depthMask); + dd->begin(m_prim, m_primSize); + for (int i = 0; i < m_size; ++i) + dd->vertex(&m_pos[i*3], m_color[i]); + dd->end(); +} diff --git a/dep/recastnavigation/DebugUtils/Source/DetourDebugDraw.cpp b/dep/recastnavigation/DebugUtils/Source/DetourDebugDraw.cpp new file mode 100644 index 000000000..78e4fc677 --- /dev/null +++ b/dep/recastnavigation/DebugUtils/Source/DetourDebugDraw.cpp @@ -0,0 +1,484 @@ +// +// Copyright (c) 2009-2010 Mikko Mononen memon@inside.org +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. +// + +#include +#include "DebugDraw.h" +#include "DetourDebugDraw.h" +#include "DetourNavMesh.h" +#include "DetourCommon.h" +#include "DetourNode.h" + +#include "../../RecastDemo/Include/Debug.h" + +static float distancePtLine2d(const float* pt, const float* p, const float* q) +{ + float pqx = q[0] - p[0]; + float pqz = q[2] - p[2]; + float dx = pt[0] - p[0]; + float dz = pt[2] - p[2]; + float d = pqx*pqx + pqz*pqz; + float t = pqx*dx + pqz*dz; + if (d != 0) t /= d; + dx = p[0] + t*pqx - pt[0]; + dz = p[2] + t*pqz - pt[2]; + return dx*dx + dz*dz; +} + +static void drawPolyBoundaries(duDebugDraw* dd, const dtMeshTile* tile, + const unsigned int col, const float linew, + bool inner) +{ + static const float thr = 0.01f*0.01f; + + dd->begin(DU_DRAW_LINES, linew); + + for (int i = 0; i < tile->header->polyCount; ++i) + { + const dtPoly* p = &tile->polys[i]; + + if (p->getType() == DT_POLYTYPE_OFFMESH_CONNECTION) continue; + + const dtPolyDetail* pd = &tile->detailMeshes[i]; + + for (int j = 0, nj = (int)p->vertCount; j < nj; ++j) + { + unsigned int c = col; + if (inner) + { + if (p->neis[j] == 0) continue; + if (p->neis[j] & DT_EXT_LINK) + { + bool con = false; + for (unsigned int k = p->firstLink; k != DT_NULL_LINK; k = tile->links[k].next) + { + if (tile->links[k].edge == j) + { + con = true; + break; + } + } + if (con) + c = duRGBA(255,255,255,24); + else + c = duRGBA(0,0,0,48); + } + else + c = duRGBA(0,48,64,32); + } + else + { + if (p->neis[j] != 0) continue; + } + + const float* v0 = &tile->verts[p->verts[j]*3]; + const float* v1 = &tile->verts[p->verts[(j+1) % nj]*3]; + + // Draw detail mesh edges which align with the actual poly edge. + // This is really slow. + for (int k = 0; k < pd->triCount; ++k) + { + const unsigned char* t = &tile->detailTris[(pd->triBase+k)*4]; + const float* tv[3]; + for (int m = 0; m < 3; ++m) + { + if (t[m] < p->vertCount) + tv[m] = &tile->verts[p->verts[t[m]]*3]; + else + tv[m] = &tile->detailVerts[(pd->vertBase+(t[m]-p->vertCount))*3]; + } + for (int m = 0, n = 2; m < 3; n=m++) + { + if (((t[3] >> (n*2)) & 0x3) == 0) continue; // Skip inner detail edges. + if (distancePtLine2d(tv[n],v0,v1) < thr && + distancePtLine2d(tv[m],v0,v1) < thr) + { + dd->vertex(tv[n], c); + dd->vertex(tv[m], c); + } + } + } + } + } + dd->end(); +} + +static void drawMeshTile(duDebugDraw* dd, const dtNavMesh& mesh, const dtNavMeshQuery* query, + const dtMeshTile* tile, unsigned char flags) +{ + dtPolyRef base = mesh.getPolyRefBase(tile); + + dd->depthMask(false); + + dd->begin(DU_DRAW_TRIS); + for (int i = 0; i < tile->header->polyCount; ++i) + { + const dtPoly* p = &tile->polys[i]; + if (p->getType() == DT_POLYTYPE_OFFMESH_CONNECTION) // Skip off-mesh links. + continue; + + const dtPolyDetail* pd = &tile->detailMeshes[i]; + + unsigned int col; + if (query && query->isInClosedList(base | (dtPolyRef)i)) + col = duRGBA(255,196,0,64); + else + { + if (p->getArea() == 0) // Treat zero area type as default. + col = duRGBA(0,192,255,64); + else + switch(p->getArea()) + { + case NAV_GROUND: + col = duRGBA(160,128,40,64); + break; + case NAV_MAGMA: + col = duRGBA(240,95,50,64); + break; + case NAV_SLIME: + col = duRGBA(85,225,85,64); + break; + case NAV_WATER: + col = duRGBA(160,160,245,64); + break; + default: + col = duRGBA(0,192,255,64); + break; + } + } + + for (int j = 0; j < pd->triCount; ++j) + { + const unsigned char* t = &tile->detailTris[(pd->triBase+j)*4]; + for (int k = 0; k < 3; ++k) + { + if (t[k] < p->vertCount) + dd->vertex(&tile->verts[p->verts[t[k]]*3], col); + else + dd->vertex(&tile->detailVerts[(pd->vertBase+t[k]-p->vertCount)*3], col); + } + } + } + dd->end(); + + // Draw inter poly boundaries + drawPolyBoundaries(dd, tile, duRGBA(0,48,64,32), 1.5f, true); + + // Draw outer poly boundaries + drawPolyBoundaries(dd, tile, duRGBA(0,48,64,220), 2.5f, false); + + if (flags & DU_DRAWNAVMESH_OFFMESHCONS) + { + dd->begin(DU_DRAW_LINES, 2.0f); + for (int i = 0; i < tile->header->polyCount; ++i) + { + const dtPoly* p = &tile->polys[i]; + if (p->getType() != DT_POLYTYPE_OFFMESH_CONNECTION) // Skip regular polys. + continue; + + unsigned int col; + if (query && query->isInClosedList(base | (dtPolyRef)i)) + col = duRGBA(255,196,0,220); + else + col = duDarkenCol(duIntToCol(p->getArea(), 220)); + + const dtOffMeshConnection* con = &tile->offMeshCons[i - tile->header->offMeshBase]; + const float* va = &tile->verts[p->verts[0]*3]; + const float* vb = &tile->verts[p->verts[1]*3]; + + // Check to see if start and end end-points have links. + bool startSet = false; + bool endSet = false; + for (unsigned int k = p->firstLink; k != DT_NULL_LINK; k = tile->links[k].next) + { + if (tile->links[k].edge == 0) + startSet = true; + if (tile->links[k].edge == 1) + endSet = true; + } + + // End points and their on-mesh locations. + if (startSet) + { + dd->vertex(va[0],va[1],va[2], col); + dd->vertex(con->pos[0],con->pos[1],con->pos[2], col); + duAppendCircle(dd, con->pos[0],con->pos[1]+0.1f,con->pos[2], con->rad, duRGBA(0,48,64,196)); + } + if (endSet) + { + dd->vertex(vb[0],vb[1],vb[2], col); + dd->vertex(con->pos[3],con->pos[4],con->pos[5], col); + duAppendCircle(dd, con->pos[3],con->pos[4]+0.1f,con->pos[5], con->rad, duRGBA(0,48,64,196)); + } + + // End point vertices. + dd->vertex(con->pos[0],con->pos[1],con->pos[2], duRGBA(0,48,64,196)); + dd->vertex(con->pos[0],con->pos[1]+0.2f,con->pos[2], duRGBA(0,48,64,196)); + + dd->vertex(con->pos[3],con->pos[4],con->pos[5], duRGBA(0,48,64,196)); + dd->vertex(con->pos[3],con->pos[4]+0.2f,con->pos[5], duRGBA(0,48,64,196)); + + // Connection arc. + duAppendArc(dd, con->pos[0],con->pos[1],con->pos[2], con->pos[3],con->pos[4],con->pos[5], 0.25f, + (con->flags & 1) ? 0.6f : 0, 0.6f, col); + } + dd->end(); + } + + const unsigned int vcol = duRGBA(0,0,0,196); + dd->begin(DU_DRAW_POINTS, 3.0f); + for (int i = 0; i < tile->header->vertCount; ++i) + { + const float* v = &tile->verts[i*3]; + dd->vertex(v[0], v[1], v[2], vcol); + } + dd->end(); + + dd->depthMask(true); +} + +void duDebugDrawNavMesh(duDebugDraw* dd, const dtNavMesh& mesh, unsigned char flags) +{ + if (!dd) return; + + for (int i = 0; i < mesh.getMaxTiles(); ++i) + { + const dtMeshTile* tile = mesh.getTile(i); + if (!tile->header) continue; + drawMeshTile(dd, mesh, 0, tile, flags); + } +} + +void duDebugDrawNavMeshWithClosedList(struct duDebugDraw* dd, const dtNavMesh& mesh, const dtNavMeshQuery& query, unsigned char flags) +{ + if (!dd) return; + + const dtNavMeshQuery* q = (flags & DU_DRAWNAVMESH_CLOSEDLIST) ? &query : 0; + + for (int i = 0; i < mesh.getMaxTiles(); ++i) + { + const dtMeshTile* tile = mesh.getTile(i); + if (!tile->header) continue; + drawMeshTile(dd, mesh, q, tile, flags); + } +} + +void duDebugDrawNavMeshNodes(struct duDebugDraw* dd, const dtNavMeshQuery& query) +{ + if (!dd) return; + + const dtNodePool* pool = query.getNodePool(); + if (pool) + { + const float off = 0.5f; + dd->begin(DU_DRAW_POINTS, 4.0f); + for (int i = 0; i < pool->getHashSize(); ++i) + { + for (unsigned short j = pool->getFirst(i); j != DT_NULL_IDX; j = pool->getNext(j)) + { + const dtNode* node = pool->getNodeAtIdx(j+1); + if (!node) continue; + dd->vertex(node->pos[0],node->pos[1]+off,node->pos[2], duRGBA(255,192,0,255)); + } + } + dd->end(); + + dd->begin(DU_DRAW_LINES, 2.0f); + for (int i = 0; i < pool->getHashSize(); ++i) + { + for (unsigned short j = pool->getFirst(i); j != DT_NULL_IDX; j = pool->getNext(j)) + { + const dtNode* node = pool->getNodeAtIdx(j+1); + if (!node) continue; + if (!node->pidx) continue; + const dtNode* parent = pool->getNodeAtIdx(node->pidx); + if (!parent) continue; + dd->vertex(node->pos[0],node->pos[1]+off,node->pos[2], duRGBA(255,192,0,128)); + dd->vertex(parent->pos[0],parent->pos[1]+off,parent->pos[2], duRGBA(255,192,0,128)); + } + } + dd->end(); + } +} + + +static void drawMeshTileBVTree(duDebugDraw* dd, const dtMeshTile* tile) +{ + // Draw BV nodes. + const float cs = 1.0f / tile->header->bvQuantFactor; + dd->begin(DU_DRAW_LINES, 1.0f); + for (int i = 0; i < tile->header->bvNodeCount; ++i) + { + const dtBVNode* n = &tile->bvTree[i]; + if (n->i < 0) // Leaf indices are positive. + continue; + duAppendBoxWire(dd, tile->header->bmin[0] + n->bmin[0]*cs, + tile->header->bmin[1] + n->bmin[1]*cs, + tile->header->bmin[2] + n->bmin[2]*cs, + tile->header->bmin[0] + n->bmax[0]*cs, + tile->header->bmin[1] + n->bmax[1]*cs, + tile->header->bmin[2] + n->bmax[2]*cs, + duRGBA(255,255,255,128)); + } + dd->end(); +} + +void duDebugDrawNavMeshBVTree(duDebugDraw* dd, const dtNavMesh& mesh) +{ + if (!dd) return; + + for (int i = 0; i < mesh.getMaxTiles(); ++i) + { + const dtMeshTile* tile = mesh.getTile(i); + if (!tile->header) continue; + drawMeshTileBVTree(dd, tile); + } +} + +static void drawMeshTilePortal(duDebugDraw* dd, const dtMeshTile* tile) +{ + // Draw portals + const float padx = 0.02f; + const float pady = tile->header->walkableClimb; + + dd->begin(DU_DRAW_LINES, 2.0f); + + for (int side = 0; side < 8; ++side) + { + unsigned short m = DT_EXT_LINK | (unsigned short)side; + + for (int i = 0; i < tile->header->polyCount; ++i) + { + dtPoly* poly = &tile->polys[i]; + + // Create new links. + const int nv = poly->vertCount; + for (int j = 0; j < nv; ++j) + { + // Skip edges which do not point to the right side. + if (poly->neis[j] != m) + continue; + + // Create new links + const float* va = &tile->verts[poly->verts[j]*3]; + const float* vb = &tile->verts[poly->verts[(j+1) % nv]*3]; + + if (side == 0 || side == 4) + { + unsigned int col = side == 0 ? duRGBA(128,0,0,128) : duRGBA(128,0,128,128); + + const float x = va[0] + ((side == 0) ? -padx : padx); + + dd->vertex(x,va[1]-pady,va[2], col); + dd->vertex(x,va[1]+pady,va[2], col); + + dd->vertex(x,va[1]+pady,va[2], col); + dd->vertex(x,vb[1]+pady,vb[2], col); + + dd->vertex(x,vb[1]+pady,vb[2], col); + dd->vertex(x,vb[1]-pady,vb[2], col); + + dd->vertex(x,vb[1]-pady,vb[2], col); + dd->vertex(x,va[1]-pady,va[2], col); + } + else if (side == 2 || side == 6) + { + unsigned int col = side == 2 ? duRGBA(0,128,0,128) : duRGBA(0,128,128,128); + + const float z = va[2] + ((side == 2) ? -padx : padx); + + dd->vertex(va[0],va[1]-pady,z, col); + dd->vertex(va[0],va[1]+pady,z, col); + + dd->vertex(va[0],va[1]+pady,z, col); + dd->vertex(vb[0],vb[1]+pady,z, col); + + dd->vertex(vb[0],vb[1]+pady,z, col); + dd->vertex(vb[0],vb[1]-pady,z, col); + + dd->vertex(vb[0],vb[1]-pady,z, col); + dd->vertex(va[0],va[1]-pady,z, col); + } + + } + } + } + + dd->end(); +} + +void duDebugDrawNavMeshPortals(duDebugDraw* dd, const dtNavMesh& mesh) +{ + if (!dd) return; + + for (int i = 0; i < mesh.getMaxTiles(); ++i) + { + const dtMeshTile* tile = mesh.getTile(i); + if (!tile->header) continue; + drawMeshTilePortal(dd, tile); + } +} + +void duDebugDrawNavMeshPoly(duDebugDraw* dd, const dtNavMesh& mesh, dtPolyRef ref, const unsigned int col) +{ + if (!dd) return; + + const dtMeshTile* tile = 0; + const dtPoly* poly = 0; + if (mesh.getTileAndPolyByRef(ref, &tile, &poly) != DT_SUCCESS) + return; + + dd->depthMask(false); + + const unsigned int c = (col & 0x00ffffff) | (64 << 24); + const unsigned int ip = (unsigned int)(poly - tile->polys); + + if (poly->getType() == DT_POLYTYPE_OFFMESH_CONNECTION) + { + dtOffMeshConnection* con = &tile->offMeshCons[ip - tile->header->offMeshBase]; + + dd->begin(DU_DRAW_LINES, 2.0f); + + // Connection arc. + duAppendArc(dd, con->pos[0],con->pos[1],con->pos[2], con->pos[3],con->pos[4],con->pos[5], 0.25f, + (con->flags & 1) ? 0.6f : 0, 0.6f, c); + + dd->end(); + } + else + { + const dtPolyDetail* pd = &tile->detailMeshes[ip]; + + dd->begin(DU_DRAW_TRIS); + for (int i = 0; i < pd->triCount; ++i) + { + const unsigned char* t = &tile->detailTris[(pd->triBase+i)*4]; + for (int j = 0; j < 3; ++j) + { + if (t[j] < poly->vertCount) + dd->vertex(&tile->verts[poly->verts[t[j]]*3], c); + else + dd->vertex(&tile->detailVerts[(pd->vertBase+t[j]-poly->vertCount)*3], c); + } + } + dd->end(); + } + + dd->depthMask(true); + +} + diff --git a/dep/recastnavigation/DebugUtils/Source/RecastDebugDraw.cpp b/dep/recastnavigation/DebugUtils/Source/RecastDebugDraw.cpp new file mode 100644 index 000000000..52861e197 --- /dev/null +++ b/dep/recastnavigation/DebugUtils/Source/RecastDebugDraw.cpp @@ -0,0 +1,689 @@ +// +// Copyright (c) 2009-2010 Mikko Mononen memon@inside.org +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. +// + +#define _USE_MATH_DEFINES +#include +#include "DebugDraw.h" +#include "RecastDebugDraw.h" +#include "Recast.h" + +void duDebugDrawTriMesh(duDebugDraw* dd, const float* verts, int /*nverts*/, + const int* tris, const float* normals, int ntris, + const unsigned char* flags) +{ + if (!dd) return; + if (!verts) return; + if (!tris) return; + if (!normals) return; + + dd->begin(DU_DRAW_TRIS); + for (int i = 0; i < ntris*3; i += 3) + { + unsigned int color; + unsigned char a = (unsigned char)(150*(2+normals[i+0]+normals[i+1])/4); + if (flags && !flags[i/3]) + color = duRGBA(a,a/4,a/16,255); + else + color = duRGBA(a,a,a,255); + + dd->vertex(&verts[tris[i+0]*3], color); + dd->vertex(&verts[tris[i+1]*3], color); + dd->vertex(&verts[tris[i+2]*3], color); + } + dd->end(); +} + +void duDebugDrawTriMeshSlope(duDebugDraw* dd, const float* verts, int /*nverts*/, + const int* tris, const float* normals, int ntris, + const float walkableSlopeAngle) +{ + if (!dd) return; + if (!verts) return; + if (!tris) return; + if (!normals) return; + + const float walkableThr = cosf(walkableSlopeAngle/180.0f*DU_PI); + + dd->begin(DU_DRAW_TRIS); + for (int i = 0; i < ntris*3; i += 3) + { + const float* norm = &normals[i]; + unsigned int color; + unsigned char a = (unsigned char)(255*(2+normals[i+0]+normals[i+1])/4); + if (norm[1] < walkableThr) + color = duRGBA(a,a/4,a/16,255); + else + color = duRGBA(a,a,a,255); + + dd->vertex(&verts[tris[i+0]*3], color); + dd->vertex(&verts[tris[i+1]*3], color); + dd->vertex(&verts[tris[i+2]*3], color); + } + dd->end(); +} + +void duDebugDrawHeightfieldSolid(duDebugDraw* dd, const rcHeightfield& hf) +{ + if (!dd) return; + + const float* orig = hf.bmin; + const float cs = hf.cs; + const float ch = hf.ch; + + const int w = hf.width; + const int h = hf.height; + + unsigned int fcol[6]; + duCalcBoxColors(fcol, duRGBA(255,255,255,255), duRGBA(255,255,255,255)); + + dd->begin(DU_DRAW_QUADS); + + for (int y = 0; y < h; ++y) + { + for (int x = 0; x < w; ++x) + { + float fx = orig[0] + x*cs; + float fz = orig[2] + y*cs; + const rcSpan* s = hf.spans[x + y*w]; + while (s) + { + duAppendBox(dd, fx, orig[1]+s->smin*ch, fz, fx+cs, orig[1] + s->smax*ch, fz+cs, fcol); + s = s->next; + } + } + } + dd->end(); +} + +void duDebugDrawHeightfieldWalkable(duDebugDraw* dd, const rcHeightfield& hf) +{ + if (!dd) return; + + const float* orig = hf.bmin; + const float cs = hf.cs; + const float ch = hf.ch; + + const int w = hf.width; + const int h = hf.height; + + unsigned int fcol[6]; + duCalcBoxColors(fcol, duRGBA(255,255,255,255), duRGBA(217,217,217,255)); + + dd->begin(DU_DRAW_QUADS); + + for (int y = 0; y < h; ++y) + { + for (int x = 0; x < w; ++x) + { + float fx = orig[0] + x*cs; + float fz = orig[2] + y*cs; + const rcSpan* s = hf.spans[x + y*w]; + while (s) + { + if (s->area == RC_WALKABLE_AREA) + fcol[0] = duRGBA(64,128,160,255); + else if (s->area == RC_NULL_AREA) + fcol[0] = duRGBA(64,64,64,255); + else + fcol[0] = duMultCol(duIntToCol(s->area, 255), 200); + + duAppendBox(dd, fx, orig[1]+s->smin*ch, fz, fx+cs, orig[1] + s->smax*ch, fz+cs, fcol); + s = s->next; + } + } + } + + dd->end(); +} + +void duDebugDrawCompactHeightfieldSolid(duDebugDraw* dd, const rcCompactHeightfield& chf) +{ + if (!dd) return; + + const float cs = chf.cs; + const float ch = chf.ch; + + dd->begin(DU_DRAW_QUADS); + + for (int y = 0; y < chf.height; ++y) + { + for (int x = 0; x < chf.width; ++x) + { + const float fx = chf.bmin[0] + x*cs; + const float fz = chf.bmin[2] + y*cs; + const rcCompactCell& c = chf.cells[x+y*chf.width]; + + for (unsigned i = c.index, ni = c.index+c.count; i < ni; ++i) + { + const rcCompactSpan& s = chf.spans[i]; + + unsigned int color; + if (chf.areas[i] == RC_WALKABLE_AREA) + color = duRGBA(0,192,255,64); + else if (chf.areas[i] == RC_NULL_AREA) + color = duRGBA(0,0,0,64); + else + color = duIntToCol(chf.areas[i], 255); + + const float fy = chf.bmin[1] + (s.y+1)*ch; + dd->vertex(fx, fy, fz, color); + dd->vertex(fx, fy, fz+cs, color); + dd->vertex(fx+cs, fy, fz+cs, color); + dd->vertex(fx+cs, fy, fz, color); + } + } + } + dd->end(); +} + +void duDebugDrawCompactHeightfieldRegions(duDebugDraw* dd, const rcCompactHeightfield& chf) +{ + if (!dd) return; + + const float cs = chf.cs; + const float ch = chf.ch; + + dd->begin(DU_DRAW_QUADS); + + for (int y = 0; y < chf.height; ++y) + { + for (int x = 0; x < chf.width; ++x) + { + const float fx = chf.bmin[0] + x*cs; + const float fz = chf.bmin[2] + y*cs; + const rcCompactCell& c = chf.cells[x+y*chf.width]; + + for (unsigned i = c.index, ni = c.index+c.count; i < ni; ++i) + { + const rcCompactSpan& s = chf.spans[i]; + const float fy = chf.bmin[1] + (s.y)*ch; + unsigned int color; + if (s.reg) + color = duIntToCol(s.reg, 192); + else + color = duRGBA(0,0,0,64); + + dd->vertex(fx, fy, fz, color); + dd->vertex(fx, fy, fz+cs, color); + dd->vertex(fx+cs, fy, fz+cs, color); + dd->vertex(fx+cs, fy, fz, color); + } + } + } + + dd->end(); +} + + +void duDebugDrawCompactHeightfieldDistance(duDebugDraw* dd, const rcCompactHeightfield& chf) +{ + if (!dd) return; + if (!chf.dist) return; + + const float cs = chf.cs; + const float ch = chf.ch; + + float maxd = chf.maxDistance; + if (maxd < 1.0f) maxd = 1; + const float dscale = 255.0f / maxd; + + dd->begin(DU_DRAW_QUADS); + + for (int y = 0; y < chf.height; ++y) + { + for (int x = 0; x < chf.width; ++x) + { + const float fx = chf.bmin[0] + x*cs; + const float fz = chf.bmin[2] + y*cs; + const rcCompactCell& c = chf.cells[x+y*chf.width]; + + for (unsigned i = c.index, ni = c.index+c.count; i < ni; ++i) + { + const rcCompactSpan& s = chf.spans[i]; + const float fy = chf.bmin[1] + (s.y+1)*ch; + const unsigned char cd = (unsigned char)(chf.dist[i] * dscale); + const unsigned int color = duRGBA(cd,cd,cd,255); + dd->vertex(fx, fy, fz, color); + dd->vertex(fx, fy, fz+cs, color); + dd->vertex(fx+cs, fy, fz+cs, color); + dd->vertex(fx+cs, fy, fz, color); + } + } + } + dd->end(); +} + +static void getContourCenter(const rcContour* cont, const float* orig, float cs, float ch, float* center) +{ + center[0] = 0; + center[1] = 0; + center[2] = 0; + if (!cont->nverts) + return; + for (int i = 0; i < cont->nverts; ++i) + { + const int* v = &cont->verts[i*4]; + center[0] += (float)v[0]; + center[1] += (float)v[1]; + center[2] += (float)v[2]; + } + const float s = 1.0f / cont->nverts; + center[0] *= s * cs; + center[1] *= s * ch; + center[2] *= s * cs; + center[0] += orig[0]; + center[1] += orig[1] + 4*ch; + center[2] += orig[2]; +} + +static const rcContour* findContourFromSet(const rcContourSet& cset, unsigned short reg) +{ + for (int i = 0; i < cset.nconts; ++i) + { + if (cset.conts[i].reg == reg) + return &cset.conts[i]; + } + return 0; +} + +void duDebugDrawRegionConnections(duDebugDraw* dd, const rcContourSet& cset, const float alpha) +{ + if (!dd) return; + + const float* orig = cset.bmin; + const float cs = cset.cs; + const float ch = cset.ch; + + // Draw centers + float pos[3], pos2[3]; + + unsigned int color = duRGBA(0,0,0,196); + + dd->begin(DU_DRAW_LINES, 2.0f); + + for (int i = 0; i < cset.nconts; ++i) + { + const rcContour* cont = &cset.conts[i]; + getContourCenter(cont, orig, cs, ch, pos); + for (int j = 0; j < cont->nverts; ++j) + { + const int* v = &cont->verts[j*4]; + if (v[3] == 0 || (unsigned short)v[3] < cont->reg) continue; + const rcContour* cont2 = findContourFromSet(cset, (unsigned short)v[3]); + if (cont2) + { + getContourCenter(cont2, orig, cs, ch, pos2); + duAppendArc(dd, pos[0],pos[1],pos[2], pos2[0],pos2[1],pos2[2], 0.25f, 0.6f, 0.6f, color); + } + } + } + + dd->end(); + + unsigned char a = (unsigned char)(alpha * 255.0f); + + dd->begin(DU_DRAW_POINTS, 7.0f); + + for (int i = 0; i < cset.nconts; ++i) + { + const rcContour* cont = &cset.conts[i]; + unsigned int color = duDarkenCol(duIntToCol(cont->reg,a)); + getContourCenter(cont, orig, cs, ch, pos); + dd->vertex(pos, color); + } + dd->end(); +} + +void duDebugDrawRawContours(duDebugDraw* dd, const rcContourSet& cset, const float alpha) +{ + if (!dd) return; + + const float* orig = cset.bmin; + const float cs = cset.cs; + const float ch = cset.ch; + + const unsigned char a = (unsigned char)(alpha*255.0f); + + dd->begin(DU_DRAW_LINES, 2.0f); + + for (int i = 0; i < cset.nconts; ++i) + { + const rcContour& c = cset.conts[i]; + unsigned int color = duIntToCol(c.reg, a); + + for (int j = 0; j < c.nrverts; ++j) + { + const int* v = &c.rverts[j*4]; + float fx = orig[0] + v[0]*cs; + float fy = orig[1] + (v[1]+1+(i&1))*ch; + float fz = orig[2] + v[2]*cs; + dd->vertex(fx,fy,fz,color); + if (j > 0) + dd->vertex(fx,fy,fz,color); + } + // Loop last segment. + const int* v = &c.rverts[0]; + float fx = orig[0] + v[0]*cs; + float fy = orig[1] + (v[1]+1+(i&1))*ch; + float fz = orig[2] + v[2]*cs; + dd->vertex(fx,fy,fz,color); + } + dd->end(); + + dd->begin(DU_DRAW_POINTS, 2.0f); + + for (int i = 0; i < cset.nconts; ++i) + { + const rcContour& c = cset.conts[i]; + unsigned int color = duDarkenCol(duIntToCol(c.reg, a)); + + for (int j = 0; j < c.nrverts; ++j) + { + const int* v = &c.rverts[j*4]; + float off = 0; + unsigned int colv = color; + if (v[3] & RC_BORDER_VERTEX) + { + colv = duRGBA(255,255,255,a); + off = ch*2; + } + + float fx = orig[0] + v[0]*cs; + float fy = orig[1] + (v[1]+1+(i&1))*ch + off; + float fz = orig[2] + v[2]*cs; + dd->vertex(fx,fy,fz, colv); + } + } + dd->end(); +} + +void duDebugDrawContours(duDebugDraw* dd, const rcContourSet& cset, const float alpha) +{ + if (!dd) return; + + const float* orig = cset.bmin; + const float cs = cset.cs; + const float ch = cset.ch; + + const unsigned char a = (unsigned char)(alpha*255.0f); + + dd->begin(DU_DRAW_LINES, 2.5f); + + for (int i = 0; i < cset.nconts; ++i) + { + const rcContour& c = cset.conts[i]; + if (!c.nverts) + continue; + unsigned int color = duIntToCol(c.reg, a); + + for (int j = 0; j < c.nverts; ++j) + { + const int* v = &c.verts[j*4]; + float fx = orig[0] + v[0]*cs; + float fy = orig[1] + (v[1]+1+(i&1))*ch; + float fz = orig[2] + v[2]*cs; + dd->vertex(fx,fy,fz, color); + if (j > 0) + dd->vertex(fx,fy,fz, color); + } + // Loop last segment + const int* v = &c.verts[0]; + float fx = orig[0] + v[0]*cs; + float fy = orig[1] + (v[1]+1+(i&1))*ch; + float fz = orig[2] + v[2]*cs; + dd->vertex(fx,fy,fz, color); + } + dd->end(); + + dd->begin(DU_DRAW_POINTS, 3.0f); + + for (int i = 0; i < cset.nconts; ++i) + { + const rcContour& c = cset.conts[i]; + unsigned int color = duDarkenCol(duIntToCol(c.reg, a)); + for (int j = 0; j < c.nverts; ++j) + { + const int* v = &c.verts[j*4]; + float off = 0; + unsigned int colv = color; + if (v[3] & RC_BORDER_VERTEX) + { + colv = duRGBA(255,255,255,a); + off = ch*2; + } + + float fx = orig[0] + v[0]*cs; + float fy = orig[1] + (v[1]+1+(i&1))*ch + off; + float fz = orig[2] + v[2]*cs; + dd->vertex(fx,fy,fz, colv); + } + } + dd->end(); +} + +void duDebugDrawPolyMesh(duDebugDraw* dd, const struct rcPolyMesh& mesh) +{ + if (!dd) return; + + const int nvp = mesh.nvp; + const float cs = mesh.cs; + const float ch = mesh.ch; + const float* orig = mesh.bmin; + + dd->begin(DU_DRAW_TRIS); + + for (int i = 0; i < mesh.npolys; ++i) + { + const unsigned short* p = &mesh.polys[i*nvp*2]; + + unsigned int color; + if (mesh.areas[i] == RC_WALKABLE_AREA) + color = duRGBA(0,192,255,64); + else if (mesh.areas[i] == RC_NULL_AREA) + color = duRGBA(0,0,0,64); + else + color = duIntToCol(mesh.areas[i], 255); + + unsigned short vi[3]; + for (int j = 2; j < nvp; ++j) + { + if (p[j] == RC_MESH_NULL_IDX) break; + vi[0] = p[0]; + vi[1] = p[j-1]; + vi[2] = p[j]; + for (int k = 0; k < 3; ++k) + { + const unsigned short* v = &mesh.verts[vi[k]*3]; + const float x = orig[0] + v[0]*cs; + const float y = orig[1] + (v[1]+1)*ch; + const float z = orig[2] + v[2]*cs; + dd->vertex(x,y,z, color); + } + } + } + dd->end(); + + // Draw neighbours edges + const unsigned int coln = duRGBA(0,48,64,32); + dd->begin(DU_DRAW_LINES, 1.5f); + for (int i = 0; i < mesh.npolys; ++i) + { + const unsigned short* p = &mesh.polys[i*nvp*2]; + for (int j = 0; j < nvp; ++j) + { + if (p[j] == RC_MESH_NULL_IDX) break; + if (p[nvp+j] == RC_MESH_NULL_IDX) continue; + int vi[2]; + vi[0] = p[j]; + if (j+1 >= nvp || p[j+1] == RC_MESH_NULL_IDX) + vi[1] = p[0]; + else + vi[1] = p[j+1]; + for (int k = 0; k < 2; ++k) + { + const unsigned short* v = &mesh.verts[vi[k]*3]; + const float x = orig[0] + v[0]*cs; + const float y = orig[1] + (v[1]+1)*ch + 0.1f; + const float z = orig[2] + v[2]*cs; + dd->vertex(x, y, z, coln); + } + } + } + dd->end(); + + // Draw boundary edges + const unsigned int colb = duRGBA(0,48,64,220); + dd->begin(DU_DRAW_LINES, 2.5f); + for (int i = 0; i < mesh.npolys; ++i) + { + const unsigned short* p = &mesh.polys[i*nvp*2]; + for (int j = 0; j < nvp; ++j) + { + if (p[j] == RC_MESH_NULL_IDX) break; + if (p[nvp+j] != RC_MESH_NULL_IDX) continue; + int vi[2]; + vi[0] = p[j]; + if (j+1 >= nvp || p[j+1] == RC_MESH_NULL_IDX) + vi[1] = p[0]; + else + vi[1] = p[j+1]; + for (int k = 0; k < 2; ++k) + { + const unsigned short* v = &mesh.verts[vi[k]*3]; + const float x = orig[0] + v[0]*cs; + const float y = orig[1] + (v[1]+1)*ch + 0.1f; + const float z = orig[2] + v[2]*cs; + dd->vertex(x, y, z, colb); + } + } + } + dd->end(); + + dd->begin(DU_DRAW_POINTS, 3.0f); + const unsigned int colv = duRGBA(0,0,0,220); + for (int i = 0; i < mesh.nverts; ++i) + { + const unsigned short* v = &mesh.verts[i*3]; + const float x = orig[0] + v[0]*cs; + const float y = orig[1] + (v[1]+1)*ch + 0.1f; + const float z = orig[2] + v[2]*cs; + dd->vertex(x,y,z, colv); + } + dd->end(); +} + +void duDebugDrawPolyMeshDetail(duDebugDraw* dd, const struct rcPolyMeshDetail& dmesh) +{ + if (!dd) return; + + dd->begin(DU_DRAW_TRIS); + + for (int i = 0; i < dmesh.nmeshes; ++i) + { + 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]; + + unsigned int color = duIntToCol(i, 192); + + for (int j = 0; j < ntris; ++j) + { + dd->vertex(&verts[tris[j*4+0]*3], color); + dd->vertex(&verts[tris[j*4+1]*3], color); + dd->vertex(&verts[tris[j*4+2]*3], color); + } + } + dd->end(); + + // Internal edges. + dd->begin(DU_DRAW_LINES, 1.0f); + const unsigned int coli = duRGBA(0,0,0,64); + for (int i = 0; i < dmesh.nmeshes; ++i) + { + 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]; + + for (int j = 0; j < ntris; ++j) + { + const unsigned char* t = &tris[j*4]; + for (int k = 0, kp = 2; k < 3; kp=k++) + { + unsigned char ef = (t[3] >> (kp*2)) & 0x3; + if (ef == 0) + { + // Internal edge + if (t[kp] < t[k]) + { + dd->vertex(&verts[t[kp]*3], coli); + dd->vertex(&verts[t[k]*3], coli); + } + } + } + } + } + dd->end(); + + // External edges. + dd->begin(DU_DRAW_LINES, 2.0f); + const unsigned int cole = duRGBA(0,0,0,64); + for (int i = 0; i < dmesh.nmeshes; ++i) + { + 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]; + + for (int j = 0; j < ntris; ++j) + { + const unsigned char* t = &tris[j*4]; + for (int k = 0, kp = 2; k < 3; kp=k++) + { + unsigned char ef = (t[3] >> (kp*2)) & 0x3; + if (ef != 0) + { + // Ext edge + dd->vertex(&verts[t[kp]*3], cole); + dd->vertex(&verts[t[k]*3], cole); + } + } + } + } + dd->end(); + + dd->begin(DU_DRAW_POINTS, 3.0f); + const unsigned int colv = duRGBA(0,0,0,64); + for (int i = 0; i < dmesh.nmeshes; ++i) + { + 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); + } + dd->end(); +} diff --git a/dep/recastnavigation/DebugUtils/Source/RecastDump.cpp b/dep/recastnavigation/DebugUtils/Source/RecastDump.cpp new file mode 100644 index 000000000..4def9a06f --- /dev/null +++ b/dep/recastnavigation/DebugUtils/Source/RecastDump.cpp @@ -0,0 +1,439 @@ +// +// Copyright (c) 2009-2010 Mikko Mononen memon@inside.org +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. +// + +#define _USE_MATH_DEFINES +#include +#include +#include +#include +#include "Recast.h" +#include "RecastAlloc.h" +#include "RecastDump.h" + + +duFileIO::~duFileIO() +{ + // Empty +} + +static void ioprintf(duFileIO* io, const char* format, ...) +{ + char line[256]; + va_list ap; + va_start(ap, format); + const int n = vsnprintf(line, sizeof(line), format, ap); + va_end(ap); + if (n > 0) + io->write(line, sizeof(char)*n); +} + +bool duDumpPolyMeshToObj(rcPolyMesh& pmesh, duFileIO* io) +{ + if (!io) + { + printf("duDumpPolyMeshToObj: input IO is null.\n"); + return false; + } + if (!io->isWriting()) + { + printf("duDumpPolyMeshToObj: input IO not writing.\n"); + return false; + } + + const int nvp = pmesh.nvp; + const float cs = pmesh.cs; + const float ch = pmesh.ch; + const float* orig = pmesh.bmin; + + ioprintf(io, "# Recast Navmesh\n"); + ioprintf(io, "o NavMesh\n"); + + ioprintf(io, "\n"); + + for (int i = 0; i < pmesh.nverts; ++i) + { + const unsigned short* v = &pmesh.verts[i*3]; + const float x = orig[0] + v[0]*cs; + const float y = orig[1] + (v[1]+1)*ch + 0.1f; + const float z = orig[2] + v[2]*cs; + ioprintf(io, "v %f %f %f\n", x,y,z); + } + + ioprintf(io, "\n"); + + for (int i = 0; i < pmesh.npolys; ++i) + { + const unsigned short* p = &pmesh.polys[i*nvp*2]; + for (int j = 2; j < nvp; ++j) + { + if (p[j] == RC_MESH_NULL_IDX) break; + ioprintf(io, "f %d %d %d\n", p[0]+1, p[j-1]+1, p[j]+1); + } + } + + return true; +} + +bool duDumpPolyMeshDetailToObj(rcPolyMeshDetail& dmesh, duFileIO* io) +{ + if (!io) + { + printf("duDumpPolyMeshDetailToObj: input IO is null.\n"); + return false; + } + if (!io->isWriting()) + { + printf("duDumpPolyMeshDetailToObj: input IO not writing.\n"); + return false; + } + + ioprintf(io, "# Recast Navmesh\n"); + ioprintf(io, "o NavMesh\n"); + + ioprintf(io, "\n"); + + for (int i = 0; i < dmesh.nverts; ++i) + { + const float* v = &dmesh.verts[i*3]; + ioprintf(io, "v %f %f %f\n", v[0],v[1],v[2]); + } + + ioprintf(io, "\n"); + + for (int i = 0; i < dmesh.nmeshes; ++i) + { + 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 (unsigned int j = 0; j < ntris; ++j) + { + ioprintf(io, "f %d %d %d\n", + (int)(bverts+tris[j*4+0])+1, + (int)(bverts+tris[j*4+1])+1, + (int)(bverts+tris[j*4+2])+1); + } + } + + return true; +} + +static const int CSET_MAGIC = ('c' << 24) | ('s' << 16) | ('e' << 8) | 't'; +static const int CSET_VERSION = 1; + +bool duDumpContourSet(struct rcContourSet& cset, duFileIO* io) +{ + if (!io) + { + printf("duDumpContourSet: input IO is null.\n"); + return false; + } + if (!io->isWriting()) + { + printf("duDumpContourSet: input IO not writing.\n"); + return false; + } + + io->write(&CSET_MAGIC, sizeof(CSET_MAGIC)); + io->write(&CSET_VERSION, sizeof(CSET_VERSION)); + + io->write(&cset.nconts, sizeof(cset.nconts)); + + io->write(cset.bmin, sizeof(cset.bmin)); + io->write(cset.bmax, sizeof(cset.bmax)); + + io->write(&cset.cs, sizeof(cset.cs)); + io->write(&cset.ch, sizeof(cset.ch)); + + for (int i = 0; i < cset.nconts; ++i) + { + const rcContour& cont = cset.conts[i]; + io->write(&cont.nverts, sizeof(cont.nverts)); + io->write(&cont.nrverts, sizeof(cont.nrverts)); + io->write(&cont.reg, sizeof(cont.reg)); + io->write(&cont.area, sizeof(cont.area)); + io->write(cont.verts, sizeof(int)*4*cont.nverts); + io->write(cont.rverts, sizeof(int)*4*cont.nrverts); + } + + return true; +} + +bool duReadContourSet(struct rcContourSet& cset, duFileIO* io) +{ + if (!io) + { + printf("duReadContourSet: input IO is null.\n"); + return false; + } + if (!io->isReading()) + { + printf("duReadContourSet: input IO not reading.\n"); + return false; + } + + int magic = 0; + int version = 0; + + io->read(&magic, sizeof(magic)); + io->read(&version, sizeof(version)); + + if (magic != CSET_MAGIC) + { + printf("duReadContourSet: Bad voodoo.\n"); + return false; + } + if (version != CSET_VERSION) + { + printf("duReadContourSet: Bad version.\n"); + return false; + } + + io->read(&cset.nconts, sizeof(cset.nconts)); + + cset.conts = (rcContour*)rcAlloc(sizeof(rcContour)*cset.nconts, RC_ALLOC_PERM); + if (!cset.conts) + { + printf("duReadContourSet: Could not alloc contours (%d)\n", cset.nconts); + return false; + } + memset(cset.conts, 0, sizeof(rcContour)*cset.nconts); + + io->read(cset.bmin, sizeof(cset.bmin)); + io->read(cset.bmax, sizeof(cset.bmax)); + + io->read(&cset.cs, sizeof(cset.cs)); + io->read(&cset.ch, sizeof(cset.ch)); + + for (int i = 0; i < cset.nconts; ++i) + { + rcContour& cont = cset.conts[i]; + io->read(&cont.nverts, sizeof(cont.nverts)); + io->read(&cont.nrverts, sizeof(cont.nrverts)); + io->read(&cont.reg, sizeof(cont.reg)); + io->read(&cont.area, sizeof(cont.area)); + + cont.verts = (int*)rcAlloc(sizeof(int)*4*cont.nverts, RC_ALLOC_PERM); + if (!cont.verts) + { + printf("duReadContourSet: Could not alloc contour verts (%d)\n", cont.nverts); + return false; + } + cont.rverts = (int*)rcAlloc(sizeof(int)*4*cont.nrverts, RC_ALLOC_PERM); + if (!cont.rverts) + { + printf("duReadContourSet: Could not alloc contour rverts (%d)\n", cont.nrverts); + return false; + } + + io->read(cont.verts, sizeof(int)*4*cont.nverts); + io->read(cont.rverts, sizeof(int)*4*cont.nrverts); + } + + return true; +} + + +static const int CHF_MAGIC = ('r' << 24) | ('c' << 16) | ('h' << 8) | 'f'; +static const int CHF_VERSION = 2; + +bool duDumpCompactHeightfield(struct rcCompactHeightfield& chf, duFileIO* io) +{ + if (!io) + { + printf("duDumpCompactHeightfield: input IO is null.\n"); + return false; + } + if (!io->isWriting()) + { + printf("duDumpCompactHeightfield: input IO not writing.\n"); + return false; + } + + io->write(&CHF_MAGIC, sizeof(CHF_MAGIC)); + io->write(&CHF_VERSION, sizeof(CHF_VERSION)); + + io->write(&chf.width, sizeof(chf.width)); + io->write(&chf.height, sizeof(chf.height)); + io->write(&chf.spanCount, sizeof(chf.spanCount)); + + io->write(&chf.walkableHeight, sizeof(chf.walkableHeight)); + io->write(&chf.walkableClimb, sizeof(chf.walkableClimb)); + + io->write(&chf.maxDistance, sizeof(chf.maxDistance)); + io->write(&chf.maxRegions, sizeof(chf.maxRegions)); + + io->write(chf.bmin, sizeof(chf.bmin)); + io->write(chf.bmax, sizeof(chf.bmax)); + + io->write(&chf.cs, sizeof(chf.cs)); + io->write(&chf.ch, sizeof(chf.ch)); + + int tmp = 0; + if (chf.cells) tmp |= 1; + if (chf.spans) tmp |= 2; + if (chf.dist) tmp |= 4; + if (chf.areas) tmp |= 8; + + io->write(&tmp, sizeof(tmp)); + + if (chf.cells) + io->write(chf.cells, sizeof(rcCompactCell)*chf.width*chf.height); + if (chf.spans) + io->write(chf.spans, sizeof(rcCompactSpan)*chf.spanCount); + if (chf.dist) + io->write(chf.dist, sizeof(unsigned short)*chf.spanCount); + if (chf.areas) + io->write(chf.areas, sizeof(unsigned char)*chf.spanCount); + + return true; +} + +bool duReadCompactHeightfield(struct rcCompactHeightfield& chf, duFileIO* io) +{ + if (!io) + { + printf("duReadCompactHeightfield: input IO is null.\n"); + return false; + } + if (!io->isReading()) + { + printf("duReadCompactHeightfield: input IO not reading.\n"); + return false; + } + + int magic = 0; + int version = 0; + + io->read(&magic, sizeof(magic)); + io->read(&version, sizeof(version)); + + if (magic != CHF_MAGIC) + { + printf("duReadCompactHeightfield: Bad voodoo.\n"); + return false; + } + if (version != CHF_VERSION) + { + printf("duReadCompactHeightfield: Bad version.\n"); + return false; + } + + io->read(&chf.width, sizeof(chf.width)); + io->read(&chf.height, sizeof(chf.height)); + io->read(&chf.spanCount, sizeof(chf.spanCount)); + + io->read(&chf.walkableHeight, sizeof(chf.walkableHeight)); + io->read(&chf.walkableClimb, sizeof(chf.walkableClimb)); + + io->read(&chf.maxDistance, sizeof(chf.maxDistance)); + io->read(&chf.maxRegions, sizeof(chf.maxRegions)); + + io->read(chf.bmin, sizeof(chf.bmin)); + io->read(chf.bmax, sizeof(chf.bmax)); + + io->read(&chf.cs, sizeof(chf.cs)); + io->read(&chf.ch, sizeof(chf.ch)); + + int tmp = 0; + io->read(&tmp, sizeof(tmp)); + + if (tmp & 1) + { + chf.cells = (rcCompactCell*)rcAlloc(sizeof(rcCompactCell)*chf.width*chf.height, RC_ALLOC_PERM); + if (!chf.cells) + { + printf("duReadCompactHeightfield: Could not alloc cells (%d)\n", chf.width*chf.height); + return false; + } + io->read(chf.cells, sizeof(rcCompactCell)*chf.width*chf.height); + } + if (tmp & 2) + { + chf.spans = (rcCompactSpan*)rcAlloc(sizeof(rcCompactSpan)*chf.spanCount, RC_ALLOC_PERM); + if (!chf.spans) + { + printf("duReadCompactHeightfield: Could not alloc spans (%d)\n", chf.spanCount); + return false; + } + io->read(chf.spans, sizeof(rcCompactSpan)*chf.spanCount); + } + if (tmp & 4) + { + chf.dist = (unsigned short*)rcAlloc(sizeof(unsigned short)*chf.spanCount, RC_ALLOC_PERM); + if (!chf.dist) + { + printf("duReadCompactHeightfield: Could not alloc dist (%d)\n", chf.spanCount); + return false; + } + io->read(chf.dist, sizeof(unsigned short)*chf.spanCount); + } + if (tmp & 8) + { + chf.areas = (unsigned char*)rcAlloc(sizeof(unsigned char)*chf.spanCount, RC_ALLOC_PERM); + if (!chf.areas) + { + printf("duReadCompactHeightfield: Could not alloc areas (%d)\n", chf.spanCount); + return false; + } + io->read(chf.areas, sizeof(unsigned char)*chf.spanCount); + } + + return true; +} + + +static void logLine(rcContext& ctx, rcTimerLabel label, const char* name, const float pc) +{ + const int t = ctx.getAccumulatedTime(label); + if (t < 0) return; + ctx.log(RC_LOG_PROGRESS, "%s:\t%.2fms\t(%.1f%%)", name, t/1000.0f, t*pc); +} + +void duLogBuildTimes(rcContext& ctx, const int totalTimeUsec) +{ + const float pc = 100.0f / totalTimeUsec; + + ctx.log(RC_LOG_PROGRESS, "Build Times"); + logLine(ctx, RC_TIMER_RASTERIZE_TRIANGLES, "- Rasterize", pc); + logLine(ctx, RC_TIMER_BUILD_COMPACTHEIGHTFIELD, "- Build Compact", pc); + logLine(ctx, RC_TIMER_FILTER_BORDER, "- Filter Border", pc); + logLine(ctx, RC_TIMER_FILTER_WALKABLE, "- Filter Walkable", pc); + logLine(ctx, RC_TIMER_ERODE_AREA, "- Erode Area", pc); + logLine(ctx, RC_TIMER_MEDIAN_AREA, "- Median Area", pc); + logLine(ctx, RC_TIMER_MARK_BOX_AREA, "- Mark Box Area", pc); + logLine(ctx, RC_TIMER_MARK_CONVEXPOLY_AREA, "- Mark Convex Area", pc); + logLine(ctx, RC_TIMER_BUILD_DISTANCEFIELD, "- Build Disntace Field", pc); + logLine(ctx, RC_TIMER_BUILD_DISTANCEFIELD_DIST, " - Distance", pc); + logLine(ctx, RC_TIMER_BUILD_DISTANCEFIELD_BLUR, " - Blur", pc); + logLine(ctx, RC_TIMER_BUILD_REGIONS, "- Build Regions", pc); + logLine(ctx, RC_TIMER_BUILD_REGIONS_WATERSHED, " - Watershed", pc); + logLine(ctx, RC_TIMER_BUILD_REGIONS_EXPAND, " - Expand", pc); + logLine(ctx, RC_TIMER_BUILD_REGIONS_FLOOD, " - Find Basins", pc); + logLine(ctx, RC_TIMER_BUILD_REGIONS_FILTER, " - Filter", pc); + logLine(ctx, RC_TIMER_BUILD_CONTOURS, "- Build Contours", pc); + logLine(ctx, RC_TIMER_BUILD_CONTOURS_TRACE, " - Trace", pc); + logLine(ctx, RC_TIMER_BUILD_CONTOURS_SIMPLIFY, " - Simplify", pc); + logLine(ctx, RC_TIMER_BUILD_POLYMESH, "- Build Polymesh", pc); + logLine(ctx, RC_TIMER_BUILD_POLYMESHDETAIL, "- Build Polymesh Detail", pc); + logLine(ctx, RC_TIMER_MERGE_POLYMESH, "- Merge Polymeshes", pc); + logLine(ctx, RC_TIMER_MERGE_POLYMESHDETAIL, "- Merge Polymesh Details", pc); + ctx.log(RC_LOG_PROGRESS, "=== TOTAL:\t%.2fms", totalTimeUsec/1000.0f); +} + diff --git a/dep/recastnavigation/Detour/CMakeLists.txt b/dep/recastnavigation/Detour/CMakeLists.txt new file mode 100644 index 000000000..eec47ef0a --- /dev/null +++ b/dep/recastnavigation/Detour/CMakeLists.txt @@ -0,0 +1,18 @@ +# +# Copyright (C) 2005-2011 MaNGOS project +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +add_subdirectory(Source) diff --git a/dep/recastnavigation/Detour/Include/DetourAlloc.h b/dep/recastnavigation/Detour/Include/DetourAlloc.h new file mode 100644 index 000000000..869347541 --- /dev/null +++ b/dep/recastnavigation/Detour/Include/DetourAlloc.h @@ -0,0 +1,36 @@ +// +// Copyright (c) 2009-2010 Mikko Mononen memon@inside.org +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. +// + +#ifndef DETOURALLOCATOR_H +#define DETOURALLOCATOR_H + +enum dtAllocHint +{ + DT_ALLOC_PERM, // Memory persist after a function call. + DT_ALLOC_TEMP // Memory used temporarily within a function. +}; + +typedef void* (dtAllocFunc)(int size, dtAllocHint hint); +typedef void (dtFreeFunc)(void* ptr); + +void dtAllocSetCustom(dtAllocFunc *allocFunc, dtFreeFunc *freeFunc); + +void* dtAlloc(int size, dtAllocHint hint); +void dtFree(void* ptr); + +#endif diff --git a/dep/recastnavigation/Detour/Include/DetourAssert.h b/dep/recastnavigation/Detour/Include/DetourAssert.h new file mode 100644 index 000000000..709ebd9f5 --- /dev/null +++ b/dep/recastnavigation/Detour/Include/DetourAssert.h @@ -0,0 +1,33 @@ +// +// Copyright (c) 2009-2010 Mikko Mononen memon@inside.org +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. +// + +#ifndef DETOURASSERT_H +#define DETOURASSERT_H + +// Note: This header file's only purpose is to include define assert. +// Feel free to change the file and include your own implementation instead. + +#ifdef NDEBUG +// From http://cnicholson.net/2009/02/stupid-c-tricks-adventures-in-assert/ +# define dtAssert(x) do { (void)sizeof(x); } while(__LINE__==-1,false) +#else +# include +# define dtAssert assert +#endif + +#endif // DETOURASSERT_H diff --git a/dep/recastnavigation/Detour/Include/DetourCommon.h b/dep/recastnavigation/Detour/Include/DetourCommon.h new file mode 100644 index 000000000..3cee3f635 --- /dev/null +++ b/dep/recastnavigation/Detour/Include/DetourCommon.h @@ -0,0 +1,248 @@ +// +// Copyright (c) 2009-2010 Mikko Mononen memon@inside.org +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. +// + +#ifndef DETOURCOMMON_H +#define DETOURCOMMON_H + +template inline void dtSwap(T& a, T& b) { T t = a; a = b; b = t; } +template inline T dtMin(T a, T b) { return a < b ? a : b; } +template inline T dtMax(T a, T b) { return a > b ? a : b; } +template inline T dtAbs(T a) { return a < 0 ? -a : a; } +template inline T dtSqr(T a) { return a*a; } +template inline T dtClamp(T v, T mn, T mx) { return v < mn ? mn : (v > mx ? mx : v); } + +float dtSqrt(float x); + +inline void dtVcross(float* dest, const float* v1, const float* v2) +{ + dest[0] = v1[1]*v2[2] - v1[2]*v2[1]; + dest[1] = v1[2]*v2[0] - v1[0]*v2[2]; + dest[2] = v1[0]*v2[1] - v1[1]*v2[0]; +} + +inline float dtVdot(const float* v1, const float* v2) +{ + return v1[0]*v2[0] + v1[1]*v2[1] + v1[2]*v2[2]; +} + +inline void dtVmad(float* dest, const float* v1, const float* v2, const float s) +{ + dest[0] = v1[0]+v2[0]*s; + dest[1] = v1[1]+v2[1]*s; + dest[2] = v1[2]+v2[2]*s; +} + +inline void dtVlerp(float* dest, const float* v1, const float* v2, const float t) +{ + dest[0] = v1[0]+(v2[0]-v1[0])*t; + dest[1] = v1[1]+(v2[1]-v1[1])*t; + dest[2] = v1[2]+(v2[2]-v1[2])*t; +} + +inline void dtVadd(float* dest, const float* v1, const float* v2) +{ + dest[0] = v1[0]+v2[0]; + dest[1] = v1[1]+v2[1]; + dest[2] = v1[2]+v2[2]; +} + +inline void dtVsub(float* dest, const float* v1, const float* v2) +{ + dest[0] = v1[0]-v2[0]; + dest[1] = v1[1]-v2[1]; + dest[2] = v1[2]-v2[2]; +} + +inline void dtVscale(float* dest, const float* v, const float t) +{ + dest[0] = v[0]*t; + dest[1] = v[1]*t; + dest[2] = v[2]*t; +} + +inline void dtVmin(float* mn, const float* v) +{ + mn[0] = dtMin(mn[0], v[0]); + mn[1] = dtMin(mn[1], v[1]); + mn[2] = dtMin(mn[2], v[2]); +} + +inline void dtVmax(float* mx, const float* v) +{ + mx[0] = dtMax(mx[0], v[0]); + mx[1] = dtMax(mx[1], v[1]); + mx[2] = dtMax(mx[2], v[2]); +} + +inline void dtVset(float* dest, const float x, const float y, const float z) +{ + dest[0] = x; dest[1] = y; dest[2] = z; +} + +inline void dtVcopy(float* dest, const float* a) +{ + dest[0] = a[0]; + dest[1] = a[1]; + dest[2] = a[2]; +} + +inline float dtVlen(const float* v) +{ + return dtSqrt(v[0]*v[0] + v[1]*v[1] + v[2]*v[2]); +} + +inline float dtVlenSqr(const float* v) +{ + return v[0]*v[0] + v[1]*v[1] + v[2]*v[2]; +} + +inline float dtVdist(const float* v1, const float* v2) +{ + const float dx = v2[0] - v1[0]; + const float dy = v2[1] - v1[1]; + const float dz = v2[2] - v1[2]; + return dtSqrt(dx*dx + dy*dy + dz*dz); +} + +inline float dtVdistSqr(const float* v1, const float* v2) +{ + const float dx = v2[0] - v1[0]; + const float dy = v2[1] - v1[1]; + const float dz = v2[2] - v1[2]; + return dx*dx + dy*dy + dz*dz; +} + +inline float dtVdist2D(const float* v1, const float* v2) +{ + const float dx = v2[0] - v1[0]; + const float dz = v2[2] - v1[2]; + return dtSqrt(dx*dx + dz*dz); +} + +inline float dtVdist2DSqr(const float* v1, const float* v2) +{ + const float dx = v2[0] - v1[0]; + const float dz = v2[2] - v1[2]; + return dx*dx + dz*dz; +} + +inline void dtVnormalize(float* v) +{ + float d = 1.0f / dtSqrt(dtSqr(v[0]) + dtSqr(v[1]) + dtSqr(v[2])); + v[0] *= d; + v[1] *= d; + v[2] *= d; +} + +inline bool dtVequal(const float* p0, const float* p1) +{ + static const float thr = dtSqr(1.0f/16384.0f); + const float d = dtVdistSqr(p0, p1); + return d < thr; +} + +inline unsigned int dtNextPow2(unsigned int v) +{ + v--; + v |= v >> 1; + v |= v >> 2; + v |= v >> 4; + v |= v >> 8; + v |= v >> 16; + v++; + return v; +} + +inline unsigned int dtIlog2(unsigned int v) +{ + unsigned int r; + unsigned int shift; + r = (v > 0xffff) << 4; v >>= r; + shift = (v > 0xff) << 3; v >>= shift; r |= shift; + shift = (v > 0xf) << 2; v >>= shift; r |= shift; + shift = (v > 0x3) << 1; v >>= shift; r |= shift; + r |= (v >> 1); + return r; +} + +inline int dtAlign4(int x) { return (x+3) & ~3; } + +inline int dtOppositeTile(int side) { return (side+4) & 0x7; } + +inline float dtVdot2D(const float* u, const float* v) +{ + return u[0]*v[0] + u[2]*v[2]; +} + +inline float dtVperp2D(const float* u, const float* v) +{ + return u[2]*v[0] - u[0]*v[2]; +} + +inline float dtTriArea2D(const float* a, const float* b, const float* c) +{ + const float abx = b[0] - a[0]; + const float abz = b[2] - a[2]; + const float acx = c[0] - a[0]; + const float acz = c[2] - a[2]; + return acx*abz - abx*acz; +} + +inline bool dtOverlapQuantBounds(const unsigned short amin[3], const unsigned short amax[3], + const unsigned short bmin[3], const unsigned short bmax[3]) +{ + bool overlap = true; + overlap = (amin[0] > bmax[0] || amax[0] < bmin[0]) ? false : overlap; + overlap = (amin[1] > bmax[1] || amax[1] < bmin[1]) ? false : overlap; + overlap = (amin[2] > bmax[2] || amax[2] < bmin[2]) ? false : overlap; + return overlap; +} + +inline bool dtOverlapBounds(const float* amin, const float* amax, + const float* bmin, const float* bmax) +{ + bool overlap = true; + overlap = (amin[0] > bmax[0] || amax[0] < bmin[0]) ? false : overlap; + overlap = (amin[1] > bmax[1] || amax[1] < bmin[1]) ? false : overlap; + overlap = (amin[2] > bmax[2] || amax[2] < bmin[2]) ? false : overlap; + return overlap; +} + +void dtClosestPtPointTriangle(float* closest, const float* p, + const float* a, const float* b, const float* c); + +bool dtClosestHeightPointTriangle(const float* p, const float* a, const float* b, const float* c, float& h); + +bool dtIntersectSegmentPoly2D(const float* p0, const float* p1, + const float* verts, int nverts, + float& tmin, float& tmax, + int& segMin, int& segMax); + +bool dtPointInPolygon(const float* pt, const float* verts, const int nverts); + +bool dtDistancePtPolyEdgesSqr(const float* pt, const float* verts, const int nverts, + float* ed, float* et); + +float dtDistancePtSegSqr2D(const float* pt, const float* p, const float* q, float& t); + +void dtCalcPolyCenter(float* tc, const unsigned short* idx, int nidx, const float* verts); + +bool dtOverlapPolyPoly2D(const float* polya, const int npolya, + const float* polyb, const int npolyb); + +#endif // DETOURCOMMON_H diff --git a/dep/recastnavigation/Detour/Include/DetourNavMesh.h b/dep/recastnavigation/Detour/Include/DetourNavMesh.h new file mode 100644 index 000000000..52d2c505e --- /dev/null +++ b/dep/recastnavigation/Detour/Include/DetourNavMesh.h @@ -0,0 +1,428 @@ +// +// Copyright (c) 2009-2010 Mikko Mononen memon@inside.org +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. +// + +#ifndef DETOURNAVMESH_H +#define DETOURNAVMESH_H + +#include "DetourAlloc.h" + +#ifdef WIN32 + typedef unsigned __int64 uint64; +#else +#include +#ifndef uint64_t +#ifdef __linux__ +#include +#endif +#endif + typedef uint64_t uint64; +#endif + +// Note: If you want to use 64-bit refs, change the types of both dtPolyRef & dtTileRef. +// It is also recommended to change dtHashRef() to proper 64-bit hash too. + +// Reference to navigation polygon. +typedef uint64 dtPolyRef; + +// Reference to navigation mesh tile. +typedef uint64 dtTileRef; + +// Maximum number of vertices per navigation polygon. +static const int DT_VERTS_PER_POLYGON = 6; + +static const int DT_NAVMESH_MAGIC = 'D'<<24 | 'N'<<16 | 'A'<<8 | 'V'; //'DNAV'; +static const int DT_NAVMESH_VERSION = 6; + +static const int DT_NAVMESH_STATE_MAGIC = 'D'<<24 | 'N'<<16 | 'M'<<8 | 'S'; //'DNMS'; +static const int DT_NAVMESH_STATE_VERSION = 1; + +static const unsigned short DT_EXT_LINK = 0x8000; +static const unsigned int DT_NULL_LINK = 0xffffffff; +static const unsigned int DT_OFFMESH_CON_BIDIR = 1; + +static const int DT_MAX_AREAS = 64; + +static const int STATIC_SALT_BITS = 12; +static const int STATIC_TILE_BITS = 21; +static const int STATIC_POLY_BITS = 31; +// we cannot have over 31 bits for either tile nor poly +// without changing polyCount to use 64bits too. + +// Flags for addTile +enum dtTileFlags +{ + DT_TILE_FREE_DATA = 0x01, // Navmesh owns the tile memory and should free it. +}; + +// Flags returned by findStraightPath(). +enum dtStraightPathFlags +{ + DT_STRAIGHTPATH_START = 0x01, // The vertex is the start position. + DT_STRAIGHTPATH_END = 0x02, // The vertex is the end position. + DT_STRAIGHTPATH_OFFMESH_CONNECTION = 0x04, // The vertex is start of an off-mesh link. +}; + +// Flags describing polygon properties. +enum dtPolyTypes +{ + DT_POLYTYPE_GROUND = 0, // Regular ground polygons. + DT_POLYTYPE_OFFMESH_CONNECTION = 1, // Off-mesh connections. +}; + +enum dtStatus +{ + DT_FAILURE = 0, // Operation failed. + DT_FAILURE_DATA_MAGIC, + DT_FAILURE_DATA_VERSION, + DT_FAILURE_OUT_OF_MEMORY, + DT_SUCCESS, // Operation succeed. + DT_IN_PROGRESS, // Operation still in progress. +}; + + +// Structure describing the navigation polygon data. +struct dtPoly +{ + unsigned int firstLink; // Index to first link in linked list. + unsigned short verts[DT_VERTS_PER_POLYGON]; // Indices to vertices of the poly. + unsigned short neis[DT_VERTS_PER_POLYGON]; // Refs to neighbours of the poly. + unsigned short flags; // Flags (see dtPolyFlags). + unsigned char vertCount; // Number of vertices. + unsigned char areaAndtype; // Bit packed: Area ID of the polygon, and Polygon type, see dtPolyTypes.. + inline void setArea(unsigned char a) { areaAndtype = (areaAndtype & 0xc0) | (a & 0x3f); } + inline void setType(unsigned char t) { areaAndtype = (areaAndtype & 0x3f) | (t << 6); } + inline unsigned char getArea() const { return areaAndtype & 0x3f; } + inline unsigned char getType() const { return areaAndtype >> 6; } +}; + +// Stucture describing polygon detail triangles. +struct dtPolyDetail +{ + 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. +struct dtLink +{ + dtPolyRef ref; // Neighbour reference. + unsigned int next; // Index to next link. + unsigned char edge; // Index to polygon edge which owns this link. + unsigned char side; // If boundary link, defines on which side the link is. + unsigned char bmin, bmax; // If boundary link, defines the sub edge area. +}; + +struct dtBVNode +{ + unsigned short bmin[3], bmax[3]; // BVnode bounds + int i; // Index to item or if negative, escape index. +}; + +struct dtOffMeshConnection +{ + float pos[6]; // Both end point locations. + float rad; // Link connection radius. + unsigned short poly; // Poly Id + unsigned char flags; // Link flags + unsigned char side; // End point side. + unsigned int userId; // User ID to identify this connection. +}; + +struct dtMeshHeader +{ + int magic; // Magic number, used to identify the data. + int version; // Data version number. + int x, y; // Location of the time on the grid. + unsigned int userId; // User ID of the tile. + int polyCount; // Number of polygons in the tile. + int vertCount; // Number of vertices in the tile. + int maxLinkCount; // Number of allocated links. + int detailMeshCount; // Number of detail meshes. + int detailVertCount; // Number of detail vertices. + int detailTriCount; // Number of detail triangles. + int bvNodeCount; // Number of BVtree nodes. + int offMeshConCount; // Number of Off-Mesh links. + int offMeshBase; // Index to first polygon which is Off-Mesh link. + float walkableHeight; // Height of the agent. + float walkableRadius; // Radius of the agent + float walkableClimb; // Max climb height of the agent. + float bmin[3], bmax[3]; // Bounding box of the tile. + float bvQuantFactor; // BVtree quantization factor (world to bvnode coords) +}; + +struct dtMeshTile +{ + unsigned int salt; // Counter describing modifications to the tile. + + unsigned int linksFreeList; // Index to next free link. + dtMeshHeader* header; // Pointer to tile header. + dtPoly* polys; // Pointer to the polygons (will be updated when tile is added). + float* verts; // Pointer to the vertices (will be updated when tile added). + dtLink* links; // Pointer to the links (will be updated when tile added). + dtPolyDetail* detailMeshes; // Pointer to detail meshes (will be updated when tile added). + float* detailVerts; // Pointer to detail vertices (will be updated when tile added). + unsigned char* detailTris; // Pointer to detail triangles (will be updated when tile added). + dtBVNode* bvTree; // Pointer to BVtree nodes (will be updated when tile added). + dtOffMeshConnection* offMeshCons; // Pointer to Off-Mesh links. (will be updated when tile added). + + unsigned char* data; // Pointer to tile data. + int dataSize; // Size of the tile data. + int flags; // Tile flags, see dtTileFlags. + dtMeshTile* next; // Next free tile or, next tile in spatial grid. +}; + +struct dtNavMeshParams +{ + float orig[3]; // Origin of the nav mesh tile space. + float tileWidth, tileHeight; // Width and height of each tile. + int maxTiles; // Maximum number of tiles the navmesh can contain. + int maxPolys; // Maximum number of polygons each tile can contain. +}; + + +class dtNavMesh +{ +public: + dtNavMesh(); + ~dtNavMesh(); + + // Initializes the nav mesh for tiled use. + // Params: + // params - (in) navmesh initialization params, see dtNavMeshParams. + // Returns: True if succeed, else false. + dtStatus init(const dtNavMeshParams* params); + + // Initializes the nav mesh for single tile use. + // Params: + // data - (in) Data of the new tile mesh. + // dataSize - (in) Data size of the new tile mesh. + // flags - (in) Tile flags, see dtTileFlags. + // Returns: True if succeed, else false. + dtStatus init(unsigned char* data, const int dataSize, const int flags); + + // Returns pointer to navmesh initialization params. + const dtNavMeshParams* getParams() const; + + // Adds new tile into the navmesh. + // The add will fail if the data is in wrong format, + // there is not enough tiles left, or if there is a tile already at the location. + // Params: + // data - (in) Data of the new tile mesh. + // dataSize - (in) Data size of the new tile mesh. + // flags - (in) Tile flags, see dtTileFlags. + // lastRef - (in,optional) Last tile ref, the tile will be restored so that + // the reference (as well as poly references) will be the same. Default: 0. + // result - (out,optional) tile ref if the tile was succesfully added. + dtStatus addTile(unsigned char* data, int dataSize, int flags, dtTileRef lastRef, dtTileRef* result); + + // Removes specified tile. + // Params: + // ref - (in) Reference to the tile to remove. + // data - (out) Data associated with deleted tile. + // dataSize - (out) Size of the data associated with deleted tile. + dtStatus removeTile(dtTileRef ref, unsigned char** data, int* dataSize); + + // Calculates tile location based in input world position. + // Params: + // pos - (in) world position of the query. + // tx - (out) tile x location. + // ty - (out) tile y location. + void calcTileLoc(const float* pos, int* tx, int* ty) const; + + // Returns pointer to tile at specified location. + // Params: + // x,y - (in) Location of the tile to get. + // Returns: pointer to tile if tile exists or 0 tile does not exists. + const dtMeshTile* getTileAt(int x, int y) const; + + // Returns reference to tile at specified location. + // Params: + // x,y - (in) Location of the tile to get. + // Returns: reference to tile if tile exists or 0 tile does not exists. + dtTileRef getTileRefAt(int x, int y) const; + + // Returns tile references of a tile based on tile pointer. + dtTileRef getTileRef(const dtMeshTile* tile) const; + + // Returns tile based on references. + const dtMeshTile* getTileByRef(dtTileRef ref) const; + + // Returns max number of tiles. + int getMaxTiles() const; + + // Returns pointer to tile in the tile array. + // Params: + // i - (in) Index to the tile to retrieve, max index is getMaxTiles()-1. + // Returns: Pointer to specified tile. + const dtMeshTile* getTile(int i) const; + + // Returns pointer to tile and polygon pointed by the polygon reference. + // Params: + // ref - (in) reference to a polygon. + // tile - (out) pointer to the tile containing the polygon. + // poly - (out) pointer to the polygon. + dtStatus getTileAndPolyByRef(const dtPolyRef ref, const dtMeshTile** tile, const dtPoly** poly) const; + + // Returns pointer to tile and polygon pointed by the polygon reference. + // Note: this function does not check if 'ref' s valid, and is thus faster. Use only with valid refs! + // Params: + // ref - (in) reference to a polygon. + // tile - (out) pointer to the tile containing the polygon. + // poly - (out) pointer to the polygon. + void getTileAndPolyByRefUnsafe(const dtPolyRef ref, const dtMeshTile** tile, const dtPoly** poly) const; + + // Returns true if polygon reference points to valid data. + bool isValidPolyRef(dtPolyRef ref) const; + + // Returns base poly id for specified tile, polygon refs can be deducted from this. + dtPolyRef getPolyRefBase(const dtMeshTile* tile) const; + + // Returns start and end location of an off-mesh link polygon. + // Params: + // prevRef - (in) ref to the polygon before the link (used to select direction). + // polyRef - (in) ref to the off-mesh link polygon. + // startPos[3] - (out) start point of the link. + // endPos[3] - (out) end point of the link. + // Returns: true if link is found. + dtStatus getOffMeshConnectionPolyEndPoints(dtPolyRef prevRef, dtPolyRef polyRef, float* startPos, float* endPos) const; + + // Returns pointer to off-mesh connection based on polyref, or null if ref not valid. + const dtOffMeshConnection* getOffMeshConnectionByRef(dtPolyRef ref) const; + + // Sets polygon flags. + dtStatus setPolyFlags(dtPolyRef ref, unsigned short flags); + + // Return polygon flags. + dtStatus getPolyFlags(dtPolyRef ref, unsigned short* resultFlags) const; + + // Set polygon type. + dtStatus setPolyArea(dtPolyRef ref, unsigned char area); + + // Return polygon area type. + dtStatus getPolyArea(dtPolyRef ref, unsigned char* resultArea) const; + + + // Returns number of bytes required to store tile state. + int getTileStateSize(const dtMeshTile* tile) const; + + // Stores tile state to buffer. + dtStatus storeTileState(const dtMeshTile* tile, unsigned char* data, const int maxDataSize) const; + + // Restores tile state. + dtStatus restoreTileState(dtMeshTile* tile, const unsigned char* data, const int maxDataSize); + + + // Encodes a tile id. + inline dtPolyRef encodePolyId(unsigned int salt, unsigned int it, unsigned int ip) const + { + return ((dtPolyRef)salt << (m_polyBits+m_tileBits)) | ((dtPolyRef)it << m_polyBits) | (dtPolyRef)ip; + } + + // Decodes a tile id. + inline void decodePolyId(dtPolyRef ref, unsigned int& salt, unsigned int& it, unsigned int& ip) const + { + const dtPolyRef saltMask = ((dtPolyRef)1<> (m_polyBits+m_tileBits)) & saltMask); + it = (unsigned int)((ref >> m_polyBits) & tileMask); + ip = (unsigned int)(ref & polyMask); + } + + // Decodes a tile salt. + inline unsigned int decodePolyIdSalt(dtPolyRef ref) const + { + const dtPolyRef saltMask = ((dtPolyRef)1<> (m_polyBits+m_tileBits)) & saltMask); + } + + // Decodes a tile id. + inline unsigned int decodePolyIdTile(dtPolyRef ref) const + { + const dtPolyRef tileMask = ((dtPolyRef)1<> m_polyBits) & tileMask); + } + + // Decodes a poly id. + inline unsigned int decodePolyIdPoly(dtPolyRef ref) const + { + const dtPolyRef polyMask = ((dtPolyRef)1< +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +set(detour_SRCS + DetourAlloc.cpp + DetourCommon.cpp + DetourNavMeshBuilder.cpp + DetourNavMesh.cpp + DetourNavMeshQuery.cpp + DetourNode.cpp + DetourObstacleAvoidance.cpp +) + +include_directories( + ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_SOURCE_DIR}/dep/recastnavigation + ${CMAKE_SOURCE_DIR}/dep/recastnavigation/Detour + ${CMAKE_SOURCE_DIR}/dep/recastnavigation/Detour/Include +) + +add_library(detour STATIC + ${detour_SRCS} +) diff --git a/dep/recastnavigation/Detour/Source/DetourAlloc.cpp b/dep/recastnavigation/Detour/Source/DetourAlloc.cpp new file mode 100644 index 000000000..5f671df5b --- /dev/null +++ b/dep/recastnavigation/Detour/Source/DetourAlloc.cpp @@ -0,0 +1,50 @@ +// +// Copyright (c) 2009-2010 Mikko Mononen memon@inside.org +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. +// + +#include +#include "DetourAlloc.h" + +static void *dtAllocDefault(int size, dtAllocHint) +{ + return malloc(size); +} + +static void dtFreeDefault(void *ptr) +{ + free(ptr); +} + +static dtAllocFunc* sAllocFunc = dtAllocDefault; +static dtFreeFunc* sFreeFunc = dtFreeDefault; + +void dtAllocSetCustom(dtAllocFunc *allocFunc, dtFreeFunc *freeFunc) +{ + sAllocFunc = allocFunc ? allocFunc : dtAllocDefault; + sFreeFunc = freeFunc ? freeFunc : dtFreeDefault; +} + +void* dtAlloc(int size, dtAllocHint hint) +{ + return sAllocFunc(size, hint); +} + +void dtFree(void* ptr) +{ + if (ptr) + sFreeFunc(ptr); +} diff --git a/dep/recastnavigation/Detour/Source/DetourCommon.cpp b/dep/recastnavigation/Detour/Source/DetourCommon.cpp new file mode 100644 index 000000000..c0b973e4a --- /dev/null +++ b/dep/recastnavigation/Detour/Source/DetourCommon.cpp @@ -0,0 +1,329 @@ +// +// Copyright (c) 2009-2010 Mikko Mononen memon@inside.org +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. +// + +#include +#include "DetourCommon.h" + +////////////////////////////////////////////////////////////////////////////////////////// + +float dtSqrt(float x) +{ + return sqrtf(x); +} + +void dtClosestPtPointTriangle(float* closest, const float* p, + const float* a, const float* b, const float* c) +{ + // Check if P in vertex region outside A + float ab[3], ac[3], ap[3]; + dtVsub(ab, b, a); + dtVsub(ac, c, a); + dtVsub(ap, p, a); + float d1 = dtVdot(ab, ap); + float d2 = dtVdot(ac, ap); + if (d1 <= 0.0f && d2 <= 0.0f) + { + // barycentric coordinates (1,0,0) + dtVcopy(closest, a); + return; + } + + // Check if P in vertex region outside B + float bp[3]; + dtVsub(bp, p, b); + float d3 = dtVdot(ab, bp); + float d4 = dtVdot(ac, bp); + if (d3 >= 0.0f && d4 <= d3) + { + // barycentric coordinates (0,1,0) + dtVcopy(closest, b); + return; + } + + // Check if P in edge region of AB, if so return projection of P onto AB + float vc = d1*d4 - d3*d2; + if (vc <= 0.0f && d1 >= 0.0f && d3 <= 0.0f) + { + // barycentric coordinates (1-v,v,0) + float v = d1 / (d1 - d3); + closest[0] = a[0] + v * ab[0]; + closest[1] = a[1] + v * ab[1]; + closest[2] = a[2] + v * ab[2]; + return; + } + + // Check if P in vertex region outside C + float cp[3]; + dtVsub(cp, p, c); + float d5 = dtVdot(ab, cp); + float d6 = dtVdot(ac, cp); + if (d6 >= 0.0f && d5 <= d6) + { + // barycentric coordinates (0,0,1) + dtVcopy(closest, c); + return; + } + + // Check if P in edge region of AC, if so return projection of P onto AC + float vb = d5*d2 - d1*d6; + if (vb <= 0.0f && d2 >= 0.0f && d6 <= 0.0f) + { + // barycentric coordinates (1-w,0,w) + float w = d2 / (d2 - d6); + closest[0] = a[0] + w * ac[0]; + closest[1] = a[1] + w * ac[1]; + closest[2] = a[2] + w * ac[2]; + return; + } + + // Check if P in edge region of BC, if so return projection of P onto BC + float va = d3*d6 - d5*d4; + if (va <= 0.0f && (d4 - d3) >= 0.0f && (d5 - d6) >= 0.0f) + { + // barycentric coordinates (0,1-w,w) + float w = (d4 - d3) / ((d4 - d3) + (d5 - d6)); + closest[0] = b[0] + w * (c[0] - b[0]); + closest[1] = b[1] + w * (c[1] - b[1]); + closest[2] = b[2] + w * (c[2] - b[2]); + return; + } + + // P inside face region. Compute Q through its barycentric coordinates (u,v,w) + float denom = 1.0f / (va + vb + vc); + float v = vb * denom; + float w = vc * denom; + closest[0] = a[0] + ab[0] * v + ac[0] * w; + closest[1] = a[1] + ab[1] * v + ac[1] * w; + closest[2] = a[2] + ab[2] * v + ac[2] * w; +} + +bool dtIntersectSegmentPoly2D(const float* p0, const float* p1, + const float* verts, int nverts, + float& tmin, float& tmax, + int& segMin, int& segMax) +{ + static const float EPS = 0.00000001f; + + tmin = 0; + tmax = 1; + segMin = -1; + segMax = -1; + + float dir[3]; + dtVsub(dir, p1, p0); + + for (int i = 0, j = nverts-1; i < nverts; j=i++) + { + float edge[3], diff[3]; + dtVsub(edge, &verts[i*3], &verts[j*3]); + dtVsub(diff, p0, &verts[j*3]); + const float n = dtVperp2D(edge, diff); + const float d = dtVperp2D(dir, edge); + if (fabsf(d) < EPS) + { + // S is nearly parallel to this edge + if (n < 0) + return false; + else + continue; + } + const float t = n / d; + if (d < 0) + { + // segment S is entering across this edge + if (t > tmin) + { + tmin = t; + segMin = j; + // S enters after leaving polygon + if (tmin > tmax) + return false; + } + } + else + { + // segment S is leaving across this edge + if (t < tmax) + { + tmax = t; + segMax = j; + // S leaves before entering polygon + if (tmax < tmin) + return false; + } + } + } + + return true; +} + +float dtDistancePtSegSqr2D(const float* pt, const float* p, const float* q, float& t) +{ + float pqx = q[0] - p[0]; + float pqz = q[2] - p[2]; + float dx = pt[0] - p[0]; + float dz = pt[2] - p[2]; + float d = pqx*pqx + pqz*pqz; + t = pqx*dx + pqz*dz; + if (d > 0) t /= d; + if (t < 0) t = 0; + else if (t > 1) t = 1; + dx = p[0] + t*pqx - pt[0]; + dz = p[2] + t*pqz - pt[2]; + return dx*dx + dz*dz; +} + +void dtCalcPolyCenter(float* tc, const unsigned short* idx, int nidx, const float* verts) +{ + tc[0] = 0.0f; + tc[1] = 0.0f; + tc[2] = 0.0f; + for (int j = 0; j < nidx; ++j) + { + const float* v = &verts[idx[j]*3]; + tc[0] += v[0]; + tc[1] += v[1]; + tc[2] += v[2]; + } + const float s = 1.0f / nidx; + tc[0] *= s; + tc[1] *= s; + tc[2] *= s; +} + +bool dtClosestHeightPointTriangle(const float* p, const float* a, const float* b, const float* c, float& h) +{ + float v0[3], v1[3], v2[3]; + dtVsub(v0, c,a); + dtVsub(v1, b,a); + dtVsub(v2, p,a); + + const float dot00 = dtVdot2D(v0, v0); + const float dot01 = dtVdot2D(v0, v1); + const float dot02 = dtVdot2D(v0, v2); + const float dot11 = dtVdot2D(v1, v1); + const float dot12 = dtVdot2D(v1, v2); + + // Compute barycentric coordinates + const float invDenom = 1.0f / (dot00 * dot11 - dot01 * dot01); + const float u = (dot11 * dot02 - dot01 * dot12) * invDenom; + const float v = (dot00 * dot12 - dot01 * dot02) * invDenom; + + // The (sloppy) epsilon is needed to allow to get height of points which + // are interpolated along the edges of the triangles. + static const float EPS = 1e-4f; + + // If point lies inside the triangle, return interpolated ycoord. + if (u >= -EPS && v >= -EPS && (u+v) <= 1+EPS) + { + h = a[1] + v0[1]*u + v1[1]*v; + return true; + } + + return false; +} + +bool dtPointInPolygon(const float* pt, const float* verts, const int nverts) +{ + // TODO: Replace pnpoly with triArea2D tests? + int i, j; + bool c = false; + for (i = 0, j = nverts-1; i < nverts; j = i++) + { + const float* vi = &verts[i*3]; + const float* vj = &verts[j*3]; + if (((vi[2] > pt[2]) != (vj[2] > pt[2])) && + (pt[0] < (vj[0]-vi[0]) * (pt[2]-vi[2]) / (vj[2]-vi[2]) + vi[0]) ) + c = !c; + } + return c; +} + +bool dtDistancePtPolyEdgesSqr(const float* pt, const float* verts, const int nverts, + float* ed, float* et) +{ + // TODO: Replace pnpoly with triArea2D tests? + int i, j; + bool c = false; + for (i = 0, j = nverts-1; i < nverts; j = i++) + { + const float* vi = &verts[i*3]; + const float* vj = &verts[j*3]; + if (((vi[2] > pt[2]) != (vj[2] > pt[2])) && + (pt[0] < (vj[0]-vi[0]) * (pt[2]-vi[2]) / (vj[2]-vi[2]) + vi[0]) ) + c = !c; + ed[j] = dtDistancePtSegSqr2D(pt, vj, vi, et[j]); + } + return c; +} + +static void projectPoly(const float* axis, const float* poly, const int npoly, + float& rmin, float& rmax) +{ + rmin = rmax = dtVdot2D(axis, &poly[0]); + for (int i = 1; i < npoly; ++i) + { + const float d = dtVdot2D(axis, &poly[i*3]); + rmin = dtMin(rmin, d); + rmax = dtMax(rmax, d); + } +} + +inline bool overlapRange(const float amin, const float amax, + const float bmin, const float bmax, + const float eps) +{ + return ((amin+eps) > bmax || (amax-eps) < bmin) ? false : true; +} + +bool dtOverlapPolyPoly2D(const float* polya, const int npolya, + const float* polyb, const int npolyb) +{ + const float eps = 1e-4f; + + for (int i = 0, j = npolya-1; i < npolya; j=i++) + { + const float* va = &polya[j*3]; + const float* vb = &polya[i*3]; + const float n[3] = { vb[2]-va[2], 0, -(vb[0]-va[0]) }; + float amin,amax,bmin,bmax; + projectPoly(n, polya, npolya, amin,amax); + projectPoly(n, polyb, npolyb, bmin,bmax); + if (!overlapRange(amin,amax, bmin,bmax, eps)) + { + // Found separating axis + return false; + } + } + for (int i = 0, j = npolyb-1; i < npolyb; j=i++) + { + const float* va = &polyb[j*3]; + const float* vb = &polyb[i*3]; + const float n[3] = { vb[2]-va[2], 0, -(vb[0]-va[0]) }; + float amin,amax,bmin,bmax; + projectPoly(n, polya, npolya, amin,amax); + projectPoly(n, polyb, npolyb, bmin,bmax); + if (!overlapRange(amin,amax, bmin,bmax, eps)) + { + // Found separating axis + return false; + } + } + return true; +} + diff --git a/dep/recastnavigation/Detour/Source/DetourNavMesh.cpp b/dep/recastnavigation/Detour/Source/DetourNavMesh.cpp new file mode 100644 index 000000000..e139e3f5c --- /dev/null +++ b/dep/recastnavigation/Detour/Source/DetourNavMesh.cpp @@ -0,0 +1,1235 @@ +// +// Copyright (c) 2009-2010 Mikko Mononen memon@inside.org +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. +// + +#include +#include +#include +#include +#include "DetourNavMesh.h" +#include "DetourNode.h" +#include "DetourCommon.h" +#include "DetourAlloc.h" +#include "DetourAssert.h" +#include + + +inline bool overlapSlabs(const float* amin, const float* amax, + const float* bmin, const float* bmax, + const float px, const float py) +{ + // Check for horizontal overlap. + // The segment is shrunken a little so that slabs which touch + // at end points are not connected. + const float minx = dtMax(amin[0]+px,bmin[0]+px); + const float maxx = dtMin(amax[0]-px,bmax[0]-px); + if (minx > maxx) + return false; + + // Check vertical overlap. + const float ad = (amax[1]-amin[1]) / (amax[0]-amin[0]); + const float ak = amin[1] - ad*amin[0]; + const float bd = (bmax[1]-bmin[1]) / (bmax[0]-bmin[0]); + const float bk = bmin[1] - bd*bmin[0]; + const float aminy = ad*minx + ak; + const float amaxy = ad*maxx + ak; + const float bminy = bd*minx + bk; + const float bmaxy = bd*maxx + bk; + const float dmin = bminy - aminy; + const float dmax = bmaxy - amaxy; + + // Crossing segments always overlap. + if (dmin*dmax < 0) + return true; + + // Check for overlap at endpoints. + const float thr = dtSqr(py*2); + if (dmin*dmin <= thr || dmax*dmax <= thr) + return true; + + return false; +} + +static void calcSlabEndPoints(const float* va, const float* vb, float* bmin, float* bmax, const int side) +{ + if (side == 0 || side == 4) + { + if (va[2] < vb[2]) + { + bmin[0] = va[2]; + bmin[1] = va[1]; + bmax[0] = vb[2]; + bmax[1] = vb[1]; + } + else + { + bmin[0] = vb[2]; + bmin[1] = vb[1]; + bmax[0] = va[2]; + bmax[1] = va[1]; + } + } + else if (side == 2 || side == 6) + { + if (va[0] < vb[0]) + { + bmin[0] = va[0]; + bmin[1] = va[1]; + bmax[0] = vb[0]; + bmax[1] = vb[1]; + } + else + { + bmin[0] = vb[0]; + bmin[1] = vb[1]; + bmax[0] = va[0]; + bmax[1] = va[1]; + } + } +} + +inline int computeTileHash(int x, int y, const int mask) +{ + const unsigned int h1 = 0x8da6b343; // Large multiplicative constants; + const unsigned int h2 = 0xd8163841; // here arbitrarily chosen primes + unsigned int n = h1 * x + h2 * y; + return (int)(n & mask); +} + +inline unsigned int allocLink(dtMeshTile* tile) +{ + if (tile->linksFreeList == DT_NULL_LINK) + return DT_NULL_LINK; + unsigned int link = tile->linksFreeList; + tile->linksFreeList = tile->links[link].next; + return link; +} + +inline void freeLink(dtMeshTile* tile, unsigned int link) +{ + tile->links[link].next = tile->linksFreeList; + tile->linksFreeList = link; +} + + +dtNavMesh* dtAllocNavMesh() +{ + void* mem = dtAlloc(sizeof(dtNavMesh), DT_ALLOC_PERM); + if (!mem) return 0; + return new(mem) dtNavMesh; +} + +void dtFreeNavMesh(dtNavMesh* navmesh) +{ + if (!navmesh) return; + navmesh->~dtNavMesh(); + dtFree(navmesh); +} + +////////////////////////////////////////////////////////////////////////////////////////// +dtNavMesh::dtNavMesh() : + m_tileWidth(0), + m_tileHeight(0), + m_maxTiles(0), + m_tileLutSize(0), + m_tileLutMask(0), + m_posLookup(0), + m_nextFree(0), + m_tiles(0), + m_saltBits(0), + m_tileBits(0), + m_polyBits(0) +{ + m_orig[0] = 0; + m_orig[1] = 0; + m_orig[2] = 0; +} + +dtNavMesh::~dtNavMesh() +{ + for (int i = 0; i < m_maxTiles; ++i) + { + if (m_tiles[i].flags & DT_TILE_FREE_DATA) + { + dtFree(m_tiles[i].data); + m_tiles[i].data = 0; + m_tiles[i].dataSize = 0; + } + } + dtFree(m_posLookup); + dtFree(m_tiles); +} + +dtStatus dtNavMesh::init(const dtNavMeshParams* params) +{ + memcpy(&m_params, params, sizeof(dtNavMeshParams)); + dtVcopy(m_orig, params->orig); + m_tileWidth = params->tileWidth; + m_tileHeight = params->tileHeight; + + // Init tiles + m_maxTiles = params->maxTiles; + m_tileLutSize = dtNextPow2(params->maxTiles/4); + if (!m_tileLutSize) m_tileLutSize = 1; + m_tileLutMask = m_tileLutSize-1; + + m_tiles = (dtMeshTile*)dtAlloc(sizeof(dtMeshTile)*m_maxTiles, DT_ALLOC_PERM); + if (!m_tiles) + return DT_FAILURE; + m_posLookup = (dtMeshTile**)dtAlloc(sizeof(dtMeshTile*)*m_tileLutSize, DT_ALLOC_PERM); + if (!m_posLookup) + return DT_FAILURE; + memset(m_tiles, 0, sizeof(dtMeshTile)*m_maxTiles); + memset(m_posLookup, 0, sizeof(dtMeshTile*)*m_tileLutSize); + m_nextFree = 0; + for (int i = m_maxTiles-1; i >= 0; --i) + { + m_tiles[i].salt = 1; + m_tiles[i].next = m_nextFree; + m_nextFree = &m_tiles[i]; + } + + // Init ID generator values. + m_tileBits = STATIC_TILE_BITS; //dtIlog2(dtNextPow2((unsigned int)params->maxTiles)); + m_polyBits = STATIC_POLY_BITS; //dtIlog2(dtNextPow2((unsigned int)params->maxPolys)); + m_saltBits = STATIC_SALT_BITS; //sizeof(dtPolyRef)*8 - m_tileBits - m_polyBits; + //if (m_saltBits < SALT_MIN_BITS) + //return DT_FAILURE; + + return DT_SUCCESS; +} + +dtStatus dtNavMesh::init(unsigned char* data, const int dataSize, const int flags) +{ + // Make sure the data is in right format. + dtMeshHeader* header = (dtMeshHeader*)data; + if (header->magic != DT_NAVMESH_MAGIC) + return DT_FAILURE; + if (header->version != DT_NAVMESH_VERSION) + return DT_FAILURE; + + dtNavMeshParams params; + dtVcopy(params.orig, header->bmin); + params.tileWidth = header->bmax[0] - header->bmin[0]; + params.tileHeight = header->bmax[2] - header->bmin[2]; + params.maxTiles = 1; + params.maxPolys = header->polyCount; + + dtStatus res = init(¶ms); + if (res != DT_SUCCESS) + return res; + + return addTile(data, dataSize, flags, 0, 0); +} + +const dtNavMeshParams* dtNavMesh::getParams() const +{ + return &m_params; +} + +////////////////////////////////////////////////////////////////////////////////////////// +int dtNavMesh::findConnectingPolys(const float* va, const float* vb, + const dtMeshTile* tile, int side, + dtPolyRef* con, float* conarea, int maxcon) const +{ + if (!tile) return 0; + + float amin[2], amax[2]; + calcSlabEndPoints(va,vb, amin,amax, side); + + // Remove links pointing to 'side' and compact the links array. + float bmin[2], bmax[2]; + unsigned short m = DT_EXT_LINK | (unsigned short)side; + int n = 0; + + dtPolyRef base = getPolyRefBase(tile); + + for (int i = 0; i < tile->header->polyCount; ++i) + { + dtPoly* poly = &tile->polys[i]; + const int nv = poly->vertCount; + for (int j = 0; j < nv; ++j) + { + // Skip edges which do not point to the right side. + if (poly->neis[j] != m) continue; + // Check if the segments touch. + const float* vc = &tile->verts[poly->verts[j]*3]; + const float* vd = &tile->verts[poly->verts[(j+1) % nv]*3]; + calcSlabEndPoints(vc,vd, bmin,bmax, side); + + if (!overlapSlabs(amin,amax, bmin,bmax, 0.01f, tile->header->walkableClimb)) continue; + + // Add return value. + if (n < maxcon) + { + conarea[n*2+0] = dtMax(amin[0], bmin[0]); + conarea[n*2+1] = dtMin(amax[0], bmax[0]); + con[n] = base | (dtPolyRef)i; + n++; + } + break; + } + } + return n; +} + +void dtNavMesh::unconnectExtLinks(dtMeshTile* tile, int side) +{ + if (!tile) return; + + for (int i = 0; i < tile->header->polyCount; ++i) + { + dtPoly* poly = &tile->polys[i]; + unsigned int j = poly->firstLink; + unsigned int pj = DT_NULL_LINK; + while (j != DT_NULL_LINK) + { + if (tile->links[j].side == side) + { + // Revove link. + unsigned int nj = tile->links[j].next; + if (pj == DT_NULL_LINK) + poly->firstLink = nj; + else + tile->links[pj].next = nj; + freeLink(tile, j); + j = nj; + } + else + { + // Advance + pj = j; + j = tile->links[j].next; + } + } + } +} + +void dtNavMesh::connectExtLinks(dtMeshTile* tile, dtMeshTile* target, int side) +{ + if (!tile) return; + + // Connect border links. + for (int i = 0; i < tile->header->polyCount; ++i) + { + dtPoly* poly = &tile->polys[i]; + + // Create new links. + unsigned short m = DT_EXT_LINK | (unsigned short)side; + const int nv = poly->vertCount; + for (int j = 0; j < nv; ++j) + { + // Skip edges which do not point to the right side. + if (poly->neis[j] != m) continue; + + // Create new links + const float* va = &tile->verts[poly->verts[j]*3]; + const float* vb = &tile->verts[poly->verts[(j+1) % nv]*3]; + dtPolyRef nei[4]; + float neia[4*2]; + int nnei = findConnectingPolys(va,vb, target, dtOppositeTile(side), nei,neia,4); + for (int k = 0; k < nnei; ++k) + { + unsigned int idx = allocLink(tile); + if (idx != DT_NULL_LINK) + { + dtLink* link = &tile->links[idx]; + link->ref = nei[k]; + link->edge = (unsigned char)j; + link->side = (unsigned char)side; + + link->next = poly->firstLink; + poly->firstLink = idx; + + // Compress portal limits to a byte value. + if (side == 0 || side == 4) + { + float tmin = (neia[k*2+0]-va[2]) / (vb[2]-va[2]); + float tmax = (neia[k*2+1]-va[2]) / (vb[2]-va[2]); + if (tmin > tmax) + dtSwap(tmin,tmax); + link->bmin = (unsigned char)(dtClamp(tmin, 0.0f, 1.0f)*255.0f); + link->bmax = (unsigned char)(dtClamp(tmax, 0.0f, 1.0f)*255.0f); + } + else if (side == 2 || side == 6) + { + float tmin = (neia[k*2+0]-va[0]) / (vb[0]-va[0]); + float tmax = (neia[k*2+1]-va[0]) / (vb[0]-va[0]); + if (tmin > tmax) + dtSwap(tmin,tmax); + link->bmin = (unsigned char)(dtClamp(tmin, 0.0f, 1.0f)*255.0f); + link->bmax = (unsigned char)(dtClamp(tmax, 0.0f, 1.0f)*255.0f); + } + } + } + } + } +} + +void dtNavMesh::connectExtOffMeshLinks(dtMeshTile* tile, dtMeshTile* target, int side) +{ + if (!tile) return; + + // Connect off-mesh links. + // We are interested on links which land from target tile to this tile. + const unsigned char oppositeSide = (unsigned char)dtOppositeTile(side); + + for (int i = 0; i < target->header->offMeshConCount; ++i) + { + dtOffMeshConnection* targetCon = &target->offMeshCons[i]; + if (targetCon->side != oppositeSide) + continue; + + dtPoly* targetPoly = &target->polys[targetCon->poly]; + + const float ext[3] = { targetCon->rad, target->header->walkableClimb, targetCon->rad }; + + // Find polygon to connect to. + const float* p = &targetCon->pos[3]; + float nearestPt[3]; + dtPolyRef ref = findNearestPolyInTile(tile, p, ext, nearestPt); + if (!ref) continue; + // findNearestPoly may return too optimistic results, further check to make sure. + if (dtSqr(nearestPt[0]-p[0])+dtSqr(nearestPt[2]-p[2]) > dtSqr(targetCon->rad)) + continue; + // Make sure the location is on current mesh. + float* v = &target->verts[targetPoly->verts[1]*3]; + dtVcopy(v, nearestPt); + + // Link off-mesh connection to target poly. + unsigned int idx = allocLink(target); + if (idx != DT_NULL_LINK) + { + dtLink* link = &target->links[idx]; + link->ref = ref; + link->edge = (unsigned char)1; + link->side = oppositeSide; + link->bmin = link->bmax = 0; + // Add to linked list. + link->next = targetPoly->firstLink; + targetPoly->firstLink = idx; + } + + // Link target poly to off-mesh connection. + if (targetCon->flags & DT_OFFMESH_CON_BIDIR) + { + unsigned int idx = allocLink(tile); + if (idx != DT_NULL_LINK) + { + const unsigned short landPolyIdx = (unsigned short)decodePolyIdPoly(ref); + dtPoly* landPoly = &tile->polys[landPolyIdx]; + dtLink* link = &tile->links[idx]; + link->ref = getPolyRefBase(target) | (dtPolyRef)(targetCon->poly); + link->edge = 0xff; + link->side = (unsigned char)side; + link->bmin = link->bmax = 0; + // Add to linked list. + link->next = landPoly->firstLink; + landPoly->firstLink = idx; + } + } + } + +} + +void dtNavMesh::connectIntLinks(dtMeshTile* tile) +{ + if (!tile) return; + + dtPolyRef base = getPolyRefBase(tile); + + for (int i = 0; i < tile->header->polyCount; ++i) + { + dtPoly* poly = &tile->polys[i]; + poly->firstLink = DT_NULL_LINK; + + if (poly->getType() == DT_POLYTYPE_OFFMESH_CONNECTION) + continue; + + // Build edge links backwards so that the links will be + // in the linked list from lowest index to highest. + for (int j = poly->vertCount-1; j >= 0; --j) + { + // Skip hard and non-internal edges. + if (poly->neis[j] == 0 || (poly->neis[j] & DT_EXT_LINK)) continue; + + unsigned int idx = allocLink(tile); + if (idx != DT_NULL_LINK) + { + dtLink* link = &tile->links[idx]; + link->ref = base | (dtPolyRef)(poly->neis[j]-1); + link->edge = (unsigned char)j; + link->side = 0xff; + link->bmin = link->bmax = 0; + // Add to linked list. + link->next = poly->firstLink; + poly->firstLink = idx; + } + } + } +} + +void dtNavMesh::connectIntOffMeshLinks(dtMeshTile* tile) +{ + if (!tile) return; + + dtPolyRef base = getPolyRefBase(tile); + + // Find Off-mesh connection end points. + for (int i = 0; i < tile->header->offMeshConCount; ++i) + { + dtOffMeshConnection* con = &tile->offMeshCons[i]; + dtPoly* poly = &tile->polys[con->poly]; + + const float ext[3] = { con->rad, tile->header->walkableClimb, con->rad }; + + for (int j = 0; j < 2; ++j) + { + unsigned char side = j == 0 ? 0xff : con->side; + + if (side == 0xff) + { + // Find polygon to connect to. + const float* p = &con->pos[j*3]; + float nearestPt[3]; + dtPolyRef ref = findNearestPolyInTile(tile, p, ext, nearestPt); + if (!ref) continue; + // findNearestPoly may return too optimistic results, further check to make sure. + if (dtSqr(nearestPt[0]-p[0])+dtSqr(nearestPt[2]-p[2]) > dtSqr(con->rad)) + continue; + // Make sure the location is on current mesh. + float* v = &tile->verts[poly->verts[j]*3]; + dtVcopy(v, nearestPt); + + // Link off-mesh connection to target poly. + unsigned int idx = allocLink(tile); + if (idx != DT_NULL_LINK) + { + dtLink* link = &tile->links[idx]; + link->ref = ref; + link->edge = (unsigned char)j; + link->side = 0xff; + link->bmin = link->bmax = 0; + // Add to linked list. + link->next = poly->firstLink; + poly->firstLink = idx; + } + + // Start end-point is always connect back to off-mesh connection, + // Destination end-point only if it is bidirectional link. + if (j == 0 || (j == 1 && (con->flags & DT_OFFMESH_CON_BIDIR))) + { + // Link target poly to off-mesh connection. + unsigned int idx = allocLink(tile); + if (idx != DT_NULL_LINK) + { + const unsigned short landPolyIdx = (unsigned short)decodePolyIdPoly(ref); + dtPoly* landPoly = &tile->polys[landPolyIdx]; + dtLink* link = &tile->links[idx]; + link->ref = base | (dtPolyRef)(con->poly); + link->edge = 0xff; + link->side = 0xff; + link->bmin = link->bmax = 0; + // Add to linked list. + link->next = landPoly->firstLink; + landPoly->firstLink = idx; + } + } + + } + } + } +} + +dtStatus dtNavMesh::closestPointOnPolyInTile(const dtMeshTile* tile, unsigned int ip, + const float* pos, float* closest) const +{ + const dtPoly* poly = &tile->polys[ip]; + + float closestDistSqr = FLT_MAX; + const dtPolyDetail* pd = &tile->detailMeshes[ip]; + + for (int j = 0; j < pd->triCount; ++j) + { + const unsigned char* t = &tile->detailTris[(pd->triBase+j)*4]; + const float* v[3]; + for (int k = 0; k < 3; ++k) + { + if (t[k] < poly->vertCount) + v[k] = &tile->verts[poly->verts[t[k]]*3]; + else + v[k] = &tile->detailVerts[(pd->vertBase+(t[k]-poly->vertCount))*3]; + } + float pt[3]; + dtClosestPtPointTriangle(pt, pos, v[0], v[1], v[2]); + float d = dtVdistSqr(pos, pt); + if (d < closestDistSqr) + { + dtVcopy(closest, pt); + closestDistSqr = d; + } + } + + return DT_SUCCESS; +} + +dtPolyRef dtNavMesh::findNearestPolyInTile(const dtMeshTile* tile, + const float* center, const float* extents, + float* nearestPt) const +{ + float bmin[3], bmax[3]; + dtVsub(bmin, center, extents); + dtVadd(bmax, center, extents); + + // Get nearby polygons from proximity grid. + dtPolyRef polys[128]; + int polyCount = queryPolygonsInTile(tile, bmin, bmax, polys, 128); + + // Find nearest polygon amongst the nearby polygons. + dtPolyRef nearest = 0; + float nearestDistanceSqr = FLT_MAX; + for (int i = 0; i < polyCount; ++i) + { + dtPolyRef ref = polys[i]; + float closestPtPoly[3]; + if (closestPointOnPolyInTile(tile, decodePolyIdPoly(ref), center, closestPtPoly) != DT_SUCCESS) + continue; + float d = dtVdistSqr(center, closestPtPoly); + if (d < nearestDistanceSqr) + { + if (nearestPt) + dtVcopy(nearestPt, closestPtPoly); + nearestDistanceSqr = d; + nearest = ref; + } + } + + return nearest; +} + +int dtNavMesh::queryPolygonsInTile(const dtMeshTile* tile, const float* qmin, const float* qmax, + dtPolyRef* polys, const int maxPolys) const +{ + if (tile->bvTree) + { + const dtBVNode* node = &tile->bvTree[0]; + const dtBVNode* end = &tile->bvTree[tile->header->bvNodeCount]; + const float* tbmin = tile->header->bmin; + const float* tbmax = tile->header->bmax; + const float qfac = tile->header->bvQuantFactor; + + // Calculate quantized box + unsigned short bmin[3], bmax[3]; + // dtClamp query box to world box. + float minx = dtClamp(qmin[0], tbmin[0], tbmax[0]) - tbmin[0]; + float miny = dtClamp(qmin[1], tbmin[1], tbmax[1]) - tbmin[1]; + float minz = dtClamp(qmin[2], tbmin[2], tbmax[2]) - tbmin[2]; + float maxx = dtClamp(qmax[0], tbmin[0], tbmax[0]) - tbmin[0]; + float maxy = dtClamp(qmax[1], tbmin[1], tbmax[1]) - tbmin[1]; + float maxz = dtClamp(qmax[2], tbmin[2], tbmax[2]) - tbmin[2]; + // Quantize + bmin[0] = (unsigned short)(qfac * minx) & 0xfffe; + bmin[1] = (unsigned short)(qfac * miny) & 0xfffe; + bmin[2] = (unsigned short)(qfac * minz) & 0xfffe; + bmax[0] = (unsigned short)(qfac * maxx + 1) | 1; + bmax[1] = (unsigned short)(qfac * maxy + 1) | 1; + bmax[2] = (unsigned short)(qfac * maxz + 1) | 1; + + // Traverse tree + dtPolyRef base = getPolyRefBase(tile); + int n = 0; + while (node < end) + { + const bool overlap = dtOverlapQuantBounds(bmin, bmax, node->bmin, node->bmax); + const bool isLeafNode = node->i >= 0; + + if (isLeafNode && overlap) + { + if (n < maxPolys) + polys[n++] = base | (dtPolyRef)node->i; + } + + if (overlap || isLeafNode) + node++; + else + { + const int escapeIndex = -node->i; + node += escapeIndex; + } + } + + return n; + } + else + { + float bmin[3], bmax[3]; + int n = 0; + dtPolyRef base = getPolyRefBase(tile); + for (int i = 0; i < tile->header->polyCount; ++i) + { + // Calc polygon bounds. + dtPoly* p = &tile->polys[i]; + const float* v = &tile->verts[p->verts[0]*3]; + dtVcopy(bmin, v); + dtVcopy(bmax, v); + for (int j = 1; j < p->vertCount; ++j) + { + v = &tile->verts[p->verts[j]*3]; + dtVmin(bmin, v); + dtVmax(bmax, v); + } + if (dtOverlapBounds(qmin,qmax, bmin,bmax)) + { + if (n < maxPolys) + polys[n++] = base | (dtPolyRef)i; + } + } + return n; + } +} + +dtStatus dtNavMesh::addTile(unsigned char* data, int dataSize, int flags, + dtTileRef lastRef, dtTileRef* result) +{ + // Make sure the data is in right format. + dtMeshHeader* header = (dtMeshHeader*)data; + if (header->magic != DT_NAVMESH_MAGIC) + return DT_FAILURE_DATA_MAGIC; + if (header->version != DT_NAVMESH_VERSION) + return DT_FAILURE_DATA_VERSION; + + // Make sure the location is free. + if (getTileAt(header->x, header->y)) + return DT_FAILURE; + + // Allocate a tile. + dtMeshTile* tile = 0; + if (!lastRef) + { + if (m_nextFree) + { + tile = m_nextFree; + m_nextFree = tile->next; + tile->next = 0; + } + } + else + { + // Try to relocate the tile to specific index with same salt. + int tileIndex = (int)decodePolyIdTile((dtPolyRef)lastRef); + if (tileIndex >= m_maxTiles) + return DT_FAILURE_OUT_OF_MEMORY; + // Try to find the specific tile id from the free list. + dtMeshTile* target = &m_tiles[tileIndex]; + dtMeshTile* prev = 0; + tile = m_nextFree; + while (tile && tile != target) + { + prev = tile; + tile = tile->next; + } + // Could not find the correct location. + if (tile != target) + return DT_FAILURE_OUT_OF_MEMORY; + // Remove from freelist + if (!prev) + m_nextFree = tile->next; + else + prev->next = tile->next; + + // Restore salt. + tile->salt = decodePolyIdSalt((dtPolyRef)lastRef); + } + + // Make sure we could allocate a tile. + if (!tile) + return DT_FAILURE_OUT_OF_MEMORY; + + // Insert tile into the position lut. + int h = computeTileHash(header->x, header->y, m_tileLutMask); + tile->next = m_posLookup[h]; + m_posLookup[h] = tile; + + // Patch header pointers. + const int headerSize = dtAlign4(sizeof(dtMeshHeader)); + const int vertsSize = dtAlign4(sizeof(float)*3*header->vertCount); + const int polysSize = dtAlign4(sizeof(dtPoly)*header->polyCount); + const int linksSize = dtAlign4(sizeof(dtLink)*(header->maxLinkCount)); + const int detailMeshesSize = dtAlign4(sizeof(dtPolyDetail)*header->detailMeshCount); + const int detailVertsSize = dtAlign4(sizeof(float)*3*header->detailVertCount); + const int detailTrisSize = dtAlign4(sizeof(unsigned char)*4*header->detailTriCount); + const int bvtreeSize = dtAlign4(sizeof(dtBVNode)*header->bvNodeCount); + const int offMeshLinksSize = dtAlign4(sizeof(dtOffMeshConnection)*header->offMeshConCount); + + unsigned char* d = data + headerSize; + tile->verts = (float*)d; d += vertsSize; + tile->polys = (dtPoly*)d; d += polysSize; + tile->links = (dtLink*)d; d += linksSize; + tile->detailMeshes = (dtPolyDetail*)d; d += detailMeshesSize; + tile->detailVerts = (float*)d; d += detailVertsSize; + tile->detailTris = (unsigned char*)d; d += detailTrisSize; + tile->bvTree = (dtBVNode*)d; d += bvtreeSize; + tile->offMeshCons = (dtOffMeshConnection*)d; d += offMeshLinksSize; + + // Build links freelist + tile->linksFreeList = 0; + tile->links[header->maxLinkCount-1].next = DT_NULL_LINK; + for (int i = 0; i < header->maxLinkCount-1; ++i) + tile->links[i].next = i+1; + + // Init tile. + tile->header = header; + tile->data = data; + tile->dataSize = dataSize; + tile->flags = flags; + + connectIntLinks(tile); + connectIntOffMeshLinks(tile); + + // Create connections connections. + for (int i = 0; i < 8; ++i) + { + dtMeshTile* nei = getNeighbourTileAt(header->x, header->y, i); + if (nei) + { + connectExtLinks(tile, nei, i); + connectExtLinks(nei, tile, dtOppositeTile(i)); + connectExtOffMeshLinks(tile, nei, i); + connectExtOffMeshLinks(nei, tile, dtOppositeTile(i)); + } + } + + if (result) + *result = getTileRef(tile); + + return DT_SUCCESS; +} + +const dtMeshTile* dtNavMesh::getTileAt(int x, int y) const +{ + // Find tile based on hash. + int h = computeTileHash(x,y,m_tileLutMask); + dtMeshTile* tile = m_posLookup[h]; + while (tile) + { + if (tile->header && tile->header->x == x && tile->header->y == y) + return tile; + tile = tile->next; + } + return 0; +} + +dtMeshTile* dtNavMesh::getNeighbourTileAt(int x, int y, int side) const +{ + switch (side) + { + case 0: x++; break; + case 1: x++; y++; break; + case 2: y++; break; + case 3: x--; y++; break; + case 4: x--; break; + case 5: x--; y--; break; + case 6: y--; break; + case 7: x++; y--; break; + }; + + // Find tile based on hash. + int h = computeTileHash(x,y,m_tileLutMask); + dtMeshTile* tile = m_posLookup[h]; + while (tile) + { + if (tile->header && tile->header->x == x && tile->header->y == y) + return tile; + tile = tile->next; + } + return 0; +} + +dtTileRef dtNavMesh::getTileRefAt(int x, int y) const +{ + // Find tile based on hash. + int h = computeTileHash(x,y,m_tileLutMask); + dtMeshTile* tile = m_posLookup[h]; + while (tile) + { + if (tile->header && tile->header->x == x && tile->header->y == y) + return getTileRef(tile); + tile = tile->next; + } + return 0; +} + +const dtMeshTile* dtNavMesh::getTileByRef(dtTileRef ref) const +{ + if (!ref) + return 0; + unsigned int tileIndex = decodePolyIdTile((dtPolyRef)ref); + unsigned int tileSalt = decodePolyIdSalt((dtPolyRef)ref); + if ((int)tileIndex >= m_maxTiles) + return 0; + const dtMeshTile* tile = &m_tiles[tileIndex]; + if (tile->salt != tileSalt) + return 0; + return tile; +} + +int dtNavMesh::getMaxTiles() const +{ + return m_maxTiles; +} + +dtMeshTile* dtNavMesh::getTile(int i) +{ + return &m_tiles[i]; +} + +const dtMeshTile* dtNavMesh::getTile(int i) const +{ + return &m_tiles[i]; +} + +void dtNavMesh::calcTileLoc(const float* pos, int* tx, int* ty) const +{ + *tx = (int)floorf((pos[0]-m_orig[0]) / m_tileWidth); + *ty = (int)floorf((pos[2]-m_orig[2]) / m_tileHeight); +} + +dtStatus dtNavMesh::getTileAndPolyByRef(const dtPolyRef ref, const dtMeshTile** tile, const dtPoly** poly) const +{ + unsigned int salt, it, ip; + decodePolyId(ref, salt, it, ip); + if (it >= (unsigned int)m_maxTiles) return DT_FAILURE; + if (m_tiles[it].salt != salt || m_tiles[it].header == 0) return DT_FAILURE; + if (ip >= (unsigned int)m_tiles[it].header->polyCount) return DT_FAILURE; + *tile = &m_tiles[it]; + *poly = &m_tiles[it].polys[ip]; + return DT_SUCCESS; +} + +void dtNavMesh::getTileAndPolyByRefUnsafe(const dtPolyRef ref, const dtMeshTile** tile, const dtPoly** poly) const +{ + unsigned int salt, it, ip; + decodePolyId(ref, salt, it, ip); + *tile = &m_tiles[it]; + *poly = &m_tiles[it].polys[ip]; +} + +bool dtNavMesh::isValidPolyRef(dtPolyRef ref) const +{ + unsigned int salt, it, ip; + decodePolyId(ref, salt, it, ip); + if (it >= (unsigned int)m_maxTiles) return false; + if (m_tiles[it].salt != salt || m_tiles[it].header == 0) return false; + if (ip >= (unsigned int)m_tiles[it].header->polyCount) return false; + return true; +} + +dtStatus dtNavMesh::removeTile(dtTileRef ref, unsigned char** data, int* dataSize) +{ + if (!ref) + return DT_FAILURE; + unsigned int tileIndex = decodePolyIdTile((dtPolyRef)ref); + unsigned int tileSalt = decodePolyIdSalt((dtPolyRef)ref); + if ((int)tileIndex >= m_maxTiles) + return DT_FAILURE; + dtMeshTile* tile = &m_tiles[tileIndex]; + if (tile->salt != tileSalt) + return DT_FAILURE; + + // Remove tile from hash lookup. + int h = computeTileHash(tile->header->x,tile->header->y,m_tileLutMask); + dtMeshTile* prev = 0; + dtMeshTile* cur = m_posLookup[h]; + while (cur) + { + if (cur == tile) + { + if (prev) + prev->next = cur->next; + else + m_posLookup[h] = cur->next; + break; + } + prev = cur; + cur = cur->next; + } + + // Remove connections to neighbour tiles. + for (int i = 0; i < 8; ++i) + { + dtMeshTile* nei = getNeighbourTileAt(tile->header->x,tile->header->y,i); + if (!nei) continue; + unconnectExtLinks(nei, dtOppositeTile(i)); + } + + + // Reset tile. + if (tile->flags & DT_TILE_FREE_DATA) + { + // Owns data + dtFree(tile->data); + tile->data = 0; + tile->dataSize = 0; + if (data) *data = 0; + if (dataSize) *dataSize = 0; + } + else + { + if (data) *data = tile->data; + if (dataSize) *dataSize = tile->dataSize; + } + + tile->header = 0; + tile->flags = 0; + tile->linksFreeList = 0; + tile->polys = 0; + tile->verts = 0; + tile->links = 0; + tile->detailMeshes = 0; + tile->detailVerts = 0; + tile->detailTris = 0; + tile->bvTree = 0; + tile->offMeshCons = 0; + + // Update salt, salt should never be zero. + tile->salt = (tile->salt+1) & ((1<salt == 0) + tile->salt++; + + // Add to free list. + tile->next = m_nextFree; + m_nextFree = tile; + + return DT_SUCCESS; +} + +dtTileRef dtNavMesh::getTileRef(const dtMeshTile* tile) const +{ + if (!tile) return 0; + const unsigned int it = tile - m_tiles; + return (dtTileRef)encodePolyId(tile->salt, it, 0); +} + +dtPolyRef dtNavMesh::getPolyRefBase(const dtMeshTile* tile) const +{ + if (!tile) return 0; + const unsigned int it = tile - m_tiles; + return encodePolyId(tile->salt, it, 0); +} + +struct dtTileState +{ + int magic; // Magic number, used to identify the data. + int version; // Data version number. + dtTileRef ref; // Tile ref at the time of storing the data. +}; + +struct dtPolyState +{ + unsigned short flags; // Flags (see dtPolyFlags). + unsigned char area; // Area ID of the polygon. +}; + +int dtNavMesh::getTileStateSize(const dtMeshTile* tile) const +{ + if (!tile) return 0; + const int headerSize = dtAlign4(sizeof(dtTileState)); + const int polyStateSize = dtAlign4(sizeof(dtPolyState) * tile->header->polyCount); + return headerSize + polyStateSize; +} + +dtStatus dtNavMesh::storeTileState(const dtMeshTile* tile, unsigned char* data, const int maxDataSize) const +{ + // Make sure there is enough space to store the state. + const int sizeReq = getTileStateSize(tile); + if (maxDataSize < sizeReq) + return DT_FAILURE; + + dtTileState* tileState = (dtTileState*)data; data += dtAlign4(sizeof(dtTileState)); + dtPolyState* polyStates = (dtPolyState*)data; data += dtAlign4(sizeof(dtPolyState) * tile->header->polyCount); + + // Store tile state. + tileState->magic = DT_NAVMESH_STATE_MAGIC; + tileState->version = DT_NAVMESH_STATE_VERSION; + tileState->ref = getTileRef(tile); + + // Store per poly state. + for (int i = 0; i < tile->header->polyCount; ++i) + { + const dtPoly* p = &tile->polys[i]; + dtPolyState* s = &polyStates[i]; + s->flags = p->flags; + s->area = p->getArea(); + } + + return DT_SUCCESS; +} + +dtStatus dtNavMesh::restoreTileState(dtMeshTile* tile, const unsigned char* data, const int maxDataSize) +{ + // Make sure there is enough space to store the state. + const int sizeReq = getTileStateSize(tile); + if (maxDataSize < sizeReq) + return DT_FAILURE; + + const dtTileState* tileState = (const dtTileState*)data; data += dtAlign4(sizeof(dtTileState)); + const dtPolyState* polyStates = (const dtPolyState*)data; data += dtAlign4(sizeof(dtPolyState) * tile->header->polyCount); + + // Check that the restore is possible. + if (tileState->magic != DT_NAVMESH_STATE_MAGIC) + return DT_FAILURE_DATA_MAGIC; + if (tileState->version != DT_NAVMESH_STATE_VERSION) + return DT_FAILURE_DATA_VERSION; + if (tileState->ref != getTileRef(tile)) + return DT_FAILURE; + + // Restore per poly state. + for (int i = 0; i < tile->header->polyCount; ++i) + { + dtPoly* p = &tile->polys[i]; + const dtPolyState* s = &polyStates[i]; + p->flags = s->flags; + p->setArea(s->area); + } + + return DT_SUCCESS; +} + +// Returns start and end location of an off-mesh link polygon. +dtStatus dtNavMesh::getOffMeshConnectionPolyEndPoints(dtPolyRef prevRef, dtPolyRef polyRef, float* startPos, float* endPos) const +{ + unsigned int salt, it, ip; + + // Get current polygon + decodePolyId(polyRef, salt, it, ip); + if (it >= (unsigned int)m_maxTiles) return DT_FAILURE; + if (m_tiles[it].salt != salt || m_tiles[it].header == 0) return DT_FAILURE; + const dtMeshTile* tile = &m_tiles[it]; + if (ip >= (unsigned int)tile->header->polyCount) return DT_FAILURE; + const dtPoly* poly = &tile->polys[ip]; + + // Make sure that the current poly is indeed off-mesh link. + if (poly->getType() != DT_POLYTYPE_OFFMESH_CONNECTION) + return DT_FAILURE; + + // Figure out which way to hand out the vertices. + int idx0 = 0, idx1 = 1; + + // Find link that points to first vertex. + for (unsigned int i = poly->firstLink; i != DT_NULL_LINK; i = tile->links[i].next) + { + if (tile->links[i].edge == 0) + { + if (tile->links[i].ref != prevRef) + { + idx0 = 1; + idx1 = 0; + } + break; + } + } + + dtVcopy(startPos, &tile->verts[poly->verts[idx0]*3]); + dtVcopy(endPos, &tile->verts[poly->verts[idx1]*3]); + + return DT_SUCCESS; +} + + +const dtOffMeshConnection* dtNavMesh::getOffMeshConnectionByRef(dtPolyRef ref) const +{ + unsigned int salt, it, ip; + + // Get current polygon + decodePolyId(ref, salt, it, ip); + if (it >= (unsigned int)m_maxTiles) return 0; + if (m_tiles[it].salt != salt || m_tiles[it].header == 0) return 0; + const dtMeshTile* tile = &m_tiles[it]; + if (ip >= (unsigned int)tile->header->polyCount) return 0; + const dtPoly* poly = &tile->polys[ip]; + + // Make sure that the current poly is indeed off-mesh link. + if (poly->getType() != DT_POLYTYPE_OFFMESH_CONNECTION) + return 0; + + const unsigned int idx = ip - tile->header->offMeshBase; + dtAssert(idx < (unsigned int)tile->header->offMeshConCount); + return &tile->offMeshCons[idx]; +} + + +dtStatus dtNavMesh::setPolyFlags(dtPolyRef ref, unsigned short flags) +{ + unsigned int salt, it, ip; + decodePolyId(ref, salt, it, ip); + if (it >= (unsigned int)m_maxTiles) return DT_FAILURE; + if (m_tiles[it].salt != salt || m_tiles[it].header == 0) return DT_FAILURE; + dtMeshTile* tile = &m_tiles[it]; + if (ip >= (unsigned int)tile->header->polyCount) return DT_FAILURE; + dtPoly* poly = &tile->polys[ip]; + + // Change flags. + poly->flags = flags; + + return DT_SUCCESS; +} + +dtStatus dtNavMesh::getPolyFlags(dtPolyRef ref, unsigned short* resultFlags) const +{ + unsigned int salt, it, ip; + decodePolyId(ref, salt, it, ip); + if (it >= (unsigned int)m_maxTiles) return DT_FAILURE; + if (m_tiles[it].salt != salt || m_tiles[it].header == 0) return DT_FAILURE; + const dtMeshTile* tile = &m_tiles[it]; + if (ip >= (unsigned int)tile->header->polyCount) return DT_FAILURE; + const dtPoly* poly = &tile->polys[ip]; + + *resultFlags = poly->flags; + + return DT_SUCCESS; +} + +dtStatus dtNavMesh::setPolyArea(dtPolyRef ref, unsigned char area) +{ + unsigned int salt, it, ip; + decodePolyId(ref, salt, it, ip); + if (it >= (unsigned int)m_maxTiles) return DT_FAILURE; + if (m_tiles[it].salt != salt || m_tiles[it].header == 0) return DT_FAILURE; + dtMeshTile* tile = &m_tiles[it]; + if (ip >= (unsigned int)tile->header->polyCount) return DT_FAILURE; + dtPoly* poly = &tile->polys[ip]; + + poly->setArea(area); + + return DT_SUCCESS; +} + +dtStatus dtNavMesh::getPolyArea(dtPolyRef ref, unsigned char* resultArea) const +{ + unsigned int salt, it, ip; + decodePolyId(ref, salt, it, ip); + if (it >= (unsigned int)m_maxTiles) return DT_FAILURE; + if (m_tiles[it].salt != salt || m_tiles[it].header == 0) return DT_FAILURE; + const dtMeshTile* tile = &m_tiles[it]; + if (ip >= (unsigned int)tile->header->polyCount) return DT_FAILURE; + const dtPoly* poly = &tile->polys[ip]; + + *resultArea = poly->getArea(); + + return DT_SUCCESS; +} + diff --git a/dep/recastnavigation/Detour/Source/DetourNavMeshBuilder.cpp b/dep/recastnavigation/Detour/Source/DetourNavMeshBuilder.cpp new file mode 100644 index 000000000..f64857160 --- /dev/null +++ b/dep/recastnavigation/Detour/Source/DetourNavMeshBuilder.cpp @@ -0,0 +1,717 @@ +// +// Copyright (c) 2009-2010 Mikko Mononen memon@inside.org +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. +// + +#include +#include +#include +#include +#include "DetourNavMesh.h" +#include "DetourCommon.h" +#include "DetourNavMeshBuilder.h" +#include "DetourAlloc.h" +#include "DetourAssert.h" + +static unsigned short MESH_NULL_IDX = 0xffff; + + +struct BVItem +{ + unsigned short bmin[3]; + unsigned short bmax[3]; + int i; +}; + +static int compareItemX(const void* va, const void* vb) +{ + const BVItem* a = (const BVItem*)va; + const BVItem* b = (const BVItem*)vb; + if (a->bmin[0] < b->bmin[0]) + return -1; + if (a->bmin[0] > b->bmin[0]) + return 1; + return 0; +} + +static int compareItemY(const void* va, const void* vb) +{ + const BVItem* a = (const BVItem*)va; + const BVItem* b = (const BVItem*)vb; + if (a->bmin[1] < b->bmin[1]) + return -1; + if (a->bmin[1] > b->bmin[1]) + return 1; + return 0; +} + +static int compareItemZ(const void* va, const void* vb) +{ + const BVItem* a = (const BVItem*)va; + const BVItem* b = (const BVItem*)vb; + if (a->bmin[2] < b->bmin[2]) + return -1; + if (a->bmin[2] > b->bmin[2]) + return 1; + return 0; +} + +static void calcExtends(BVItem* items, const int /*nitems*/, const int imin, const int imax, + unsigned short* bmin, unsigned short* bmax) +{ + bmin[0] = items[imin].bmin[0]; + bmin[1] = items[imin].bmin[1]; + bmin[2] = items[imin].bmin[2]; + + bmax[0] = items[imin].bmax[0]; + bmax[1] = items[imin].bmax[1]; + bmax[2] = items[imin].bmax[2]; + + for (int i = imin+1; i < imax; ++i) + { + const BVItem& it = items[i]; + if (it.bmin[0] < bmin[0]) bmin[0] = it.bmin[0]; + if (it.bmin[1] < bmin[1]) bmin[1] = it.bmin[1]; + if (it.bmin[2] < bmin[2]) bmin[2] = it.bmin[2]; + + if (it.bmax[0] > bmax[0]) bmax[0] = it.bmax[0]; + if (it.bmax[1] > bmax[1]) bmax[1] = it.bmax[1]; + if (it.bmax[2] > bmax[2]) bmax[2] = it.bmax[2]; + } +} + +inline int longestAxis(unsigned short x, unsigned short y, unsigned short z) +{ + int axis = 0; + unsigned short maxVal = x; + if (y > maxVal) + { + axis = 1; + maxVal = y; + } + if (z > maxVal) + { + axis = 2; + maxVal = z; + } + return axis; +} + +static void subdivide(BVItem* items, int nitems, int imin, int imax, int& curNode, dtBVNode* nodes) +{ + int inum = imax - imin; + int icur = curNode; + + dtBVNode& node = nodes[curNode++]; + + if (inum == 1) + { + // Leaf + node.bmin[0] = items[imin].bmin[0]; + node.bmin[1] = items[imin].bmin[1]; + node.bmin[2] = items[imin].bmin[2]; + + node.bmax[0] = items[imin].bmax[0]; + node.bmax[1] = items[imin].bmax[1]; + node.bmax[2] = items[imin].bmax[2]; + + node.i = items[imin].i; + } + else + { + // Split + calcExtends(items, nitems, imin, imax, node.bmin, node.bmax); + + int axis = longestAxis(node.bmax[0] - node.bmin[0], + node.bmax[1] - node.bmin[1], + node.bmax[2] - node.bmin[2]); + + if (axis == 0) + { + // Sort along x-axis + qsort(items+imin, inum, sizeof(BVItem), compareItemX); + } + else if (axis == 1) + { + // Sort along y-axis + qsort(items+imin, inum, sizeof(BVItem), compareItemY); + } + else + { + // Sort along z-axis + qsort(items+imin, inum, sizeof(BVItem), compareItemZ); + } + + int isplit = imin+inum/2; + + // Left + subdivide(items, nitems, imin, isplit, curNode, nodes); + // Right + subdivide(items, nitems, isplit, imax, curNode, nodes); + + int iescape = curNode - icur; + // Negative index means escape. + node.i = -iescape; + } +} + +static int createBVTree(const unsigned short* verts, const int /*nverts*/, + const unsigned short* polys, const int npolys, const int nvp, + const float cs, const float ch, + const int /*nnodes*/, dtBVNode* nodes) +{ + // Build tree + BVItem* items = (BVItem*)dtAlloc(sizeof(BVItem)*npolys, DT_ALLOC_TEMP); + for (int i = 0; i < npolys; i++) + { + BVItem& it = items[i]; + it.i = i; + // Calc polygon bounds. + const unsigned short* p = &polys[i*nvp*2]; + it.bmin[0] = it.bmax[0] = verts[p[0]*3+0]; + it.bmin[1] = it.bmax[1] = verts[p[0]*3+1]; + it.bmin[2] = it.bmax[2] = verts[p[0]*3+2]; + + for (int j = 1; j < nvp; ++j) + { + if (p[j] == MESH_NULL_IDX) break; + unsigned short x = verts[p[j]*3+0]; + unsigned short y = verts[p[j]*3+1]; + unsigned short z = verts[p[j]*3+2]; + + if (x < it.bmin[0]) it.bmin[0] = x; + if (y < it.bmin[1]) it.bmin[1] = y; + if (z < it.bmin[2]) it.bmin[2] = z; + + if (x > it.bmax[0]) it.bmax[0] = x; + if (y > it.bmax[1]) it.bmax[1] = y; + if (z > it.bmax[2]) it.bmax[2] = z; + } + // Remap y + it.bmin[1] = (unsigned short)floorf((float)it.bmin[1]*ch/cs); + it.bmax[1] = (unsigned short)ceilf((float)it.bmax[1]*ch/cs); + } + + int curNode = 0; + subdivide(items, npolys, 0, npolys, curNode, nodes); + + dtFree(items); + + return curNode; +} + +static unsigned char classifyOffMeshPoint(const float* pt, const float* bmin, const float* bmax) +{ + static const unsigned char XP = 1<<0; + static const unsigned char ZP = 1<<1; + static const unsigned char XM = 1<<2; + static const unsigned char ZM = 1<<3; + + unsigned char outcode = 0; + outcode |= (pt[0] >= bmax[0]) ? XP : 0; + outcode |= (pt[2] >= bmax[2]) ? ZP : 0; + outcode |= (pt[0] < bmin[0]) ? XM : 0; + outcode |= (pt[2] < bmin[2]) ? ZM : 0; + + switch (outcode) + { + case XP: return 0; + case XP|ZP: return 1; + case ZP: return 2; + case XM|ZP: return 3; + case XM: return 4; + case XM|ZM: return 5; + case ZM: return 6; + case XP|ZM: return 7; + }; + return 0xff; +} + +// TODO: Better error handling. + +bool dtCreateNavMeshData(dtNavMeshCreateParams* params, unsigned char** outData, int* outDataSize) +{ + if (params->nvp > DT_VERTS_PER_POLYGON) + return false; + if (params->vertCount >= 0xffff) + return false; + if (!params->vertCount || !params->verts) + return false; + if (!params->polyCount || !params->polys) + return false; + if (!params->detailMeshes || !params->detailVerts || !params->detailTris) + return false; + + const int nvp = params->nvp; + + // Classify off-mesh connection points. We store only the connections + // whose start point is inside the tile. + unsigned char* offMeshConClass = 0; + int storedOffMeshConCount = 0; + int offMeshConLinkCount = 0; + + if (params->offMeshConCount > 0) + { + offMeshConClass = (unsigned char*)dtAlloc(sizeof(unsigned char)*params->offMeshConCount*2, DT_ALLOC_TEMP); + if (!offMeshConClass) + return false; + + for (int i = 0; i < params->offMeshConCount; ++i) + { + offMeshConClass[i*2+0] = classifyOffMeshPoint(¶ms->offMeshConVerts[(i*2+0)*3], params->bmin, params->bmax); + offMeshConClass[i*2+1] = classifyOffMeshPoint(¶ms->offMeshConVerts[(i*2+1)*3], params->bmin, params->bmax); + + // Cound how many links should be allocated for off-mesh connections. + if (offMeshConClass[i*2+0] == 0xff) + offMeshConLinkCount++; + if (offMeshConClass[i*2+1] == 0xff) + offMeshConLinkCount++; + + if (offMeshConClass[i*2+0] == 0xff) + storedOffMeshConCount++; + } + } + + // Off-mesh connectionss are stored as polygons, adjust values. + const int totPolyCount = params->polyCount + storedOffMeshConCount; + const int totVertCount = params->vertCount + storedOffMeshConCount*2; + + // Find portal edges which are at tile borders. + int edgeCount = 0; + int portalCount = 0; + for (int i = 0; i < params->polyCount; ++i) + { + const unsigned short* p = ¶ms->polys[i*2*nvp]; + for (int j = 0; j < nvp; ++j) + { + if (p[j] == MESH_NULL_IDX) break; + int nj = j+1; + if (nj >= nvp || p[nj] == MESH_NULL_IDX) nj = 0; + const unsigned short* va = ¶ms->verts[p[j]*3]; + const unsigned short* vb = ¶ms->verts[p[nj]*3]; + + edgeCount++; + + if (params->tileSize > 0) + { + if (va[0] == params->tileSize && vb[0] == params->tileSize) + portalCount++; // x+ + else if (va[2] == params->tileSize && vb[2] == params->tileSize) + portalCount++; // z+ + else if (va[0] == 0 && vb[0] == 0) + portalCount++; // x- + else if (va[2] == 0 && vb[2] == 0) + portalCount++; // z- + } + } + } + + const int maxLinkCount = edgeCount + portalCount*2 + offMeshConLinkCount*2; + + // Find unique detail vertices. + int uniqueDetailVertCount = 0; + for (int i = 0; i < params->polyCount; ++i) + { + const unsigned short* p = ¶ms->polys[i*nvp*2]; + int ndv = params->detailMeshes[i*4+1]; + int nv = 0; + for (int j = 0; j < nvp; ++j) + { + if (p[j] == MESH_NULL_IDX) break; + nv++; + } + ndv -= nv; + uniqueDetailVertCount += ndv; + } + + // Calculate data size + const int headerSize = dtAlign4(sizeof(dtMeshHeader)); + const int vertsSize = dtAlign4(sizeof(float)*3*totVertCount); + const int polysSize = dtAlign4(sizeof(dtPoly)*totPolyCount); + const int linksSize = dtAlign4(sizeof(dtLink)*maxLinkCount); + const int detailMeshesSize = dtAlign4(sizeof(dtPolyDetail)*params->polyCount); + const int detailVertsSize = dtAlign4(sizeof(float)*3*uniqueDetailVertCount); + const int detailTrisSize = dtAlign4(sizeof(unsigned char)*4*params->detailTriCount); + const int bvTreeSize = dtAlign4(sizeof(dtBVNode)*params->polyCount*2); + const int offMeshConsSize = dtAlign4(sizeof(dtOffMeshConnection)*storedOffMeshConCount); + + const int dataSize = headerSize + vertsSize + polysSize + linksSize + + detailMeshesSize + detailVertsSize + detailTrisSize + + bvTreeSize + offMeshConsSize; + + unsigned char* data = (unsigned char*)dtAlloc(sizeof(unsigned char)*dataSize, DT_ALLOC_PERM); + if (!data) + { + dtFree(offMeshConClass); + return false; + } + memset(data, 0, dataSize); + + unsigned char* d = data; + dtMeshHeader* header = (dtMeshHeader*)d; d += headerSize; + float* navVerts = (float*)d; d += vertsSize; + dtPoly* navPolys = (dtPoly*)d; d += polysSize; + d += linksSize; + dtPolyDetail* navDMeshes = (dtPolyDetail*)d; d += detailMeshesSize; + float* navDVerts = (float*)d; d += detailVertsSize; + unsigned char* navDTris = (unsigned char*)d; d += detailTrisSize; + dtBVNode* navBvtree = (dtBVNode*)d; d += bvTreeSize; + dtOffMeshConnection* offMeshCons = (dtOffMeshConnection*)d; d += offMeshConsSize; + + + // Store header + header->magic = DT_NAVMESH_MAGIC; + header->version = DT_NAVMESH_VERSION; + header->x = params->tileX; + header->y = params->tileY; + header->userId = params->userId; + header->polyCount = totPolyCount; + header->vertCount = totVertCount; + header->maxLinkCount = maxLinkCount; + dtVcopy(header->bmin, params->bmin); + dtVcopy(header->bmax, params->bmax); + header->detailMeshCount = params->polyCount; + header->detailVertCount = uniqueDetailVertCount; + header->detailTriCount = params->detailTriCount; + header->bvQuantFactor = 1.0f / params->cs; + header->offMeshBase = params->polyCount; + header->walkableHeight = params->walkableHeight; + header->walkableRadius = params->walkableRadius; + header->walkableClimb = params->walkableClimb; + header->offMeshConCount = storedOffMeshConCount; + header->bvNodeCount = params->polyCount*2; + + const int offMeshVertsBase = params->vertCount; + const int offMeshPolyBase = params->polyCount; + + // Store vertices + // Mesh vertices + for (int i = 0; i < params->vertCount; ++i) + { + const unsigned short* iv = ¶ms->verts[i*3]; + float* v = &navVerts[i*3]; + v[0] = params->bmin[0] + iv[0] * params->cs; + v[1] = params->bmin[1] + iv[1] * params->ch; + v[2] = params->bmin[2] + iv[2] * params->cs; + } + // Off-mesh link vertices. + int n = 0; + for (int i = 0; i < params->offMeshConCount; ++i) + { + // Only store connections which start from this tile. + if (offMeshConClass[i*2+0] == 0xff) + { + const float* linkv = ¶ms->offMeshConVerts[i*2*3]; + float* v = &navVerts[(offMeshVertsBase + n*2)*3]; + dtVcopy(&v[0], &linkv[0]); + dtVcopy(&v[3], &linkv[3]); + n++; + } + } + + // Store polygons + // Mesh polys + const unsigned short* src = params->polys; + for (int i = 0; i < params->polyCount; ++i) + { + dtPoly* p = &navPolys[i]; + p->vertCount = 0; + p->flags = params->polyFlags[i]; + p->setArea(params->polyAreas[i]); + p->setType(DT_POLYTYPE_GROUND); + for (int j = 0; j < nvp; ++j) + { + if (src[j] == MESH_NULL_IDX) break; + p->verts[j] = src[j]; + p->neis[j] = (src[nvp+j]+1) & 0xffff; + p->vertCount++; + } + src += nvp*2; + } + // Off-mesh connection vertices. + n = 0; + for (int i = 0; i < params->offMeshConCount; ++i) + { + // Only store connections which start from this tile. + if (offMeshConClass[i*2+0] == 0xff) + { + dtPoly* p = &navPolys[offMeshPolyBase+n]; + p->vertCount = 2; + p->verts[0] = (unsigned short)(offMeshVertsBase + n*2+0); + p->verts[1] = (unsigned short)(offMeshVertsBase + n*2+1); + p->flags = params->offMeshConFlags[i]; + p->setArea(params->offMeshConAreas[i]); + p->setType(DT_POLYTYPE_OFFMESH_CONNECTION); + n++; + } + } + + // Store portal edges. + if (params->tileSize > 0) + { + for (int i = 0; i < params->polyCount; ++i) + { + dtPoly* poly = &navPolys[i]; + for (int j = 0; j < poly->vertCount; ++j) + { + int nj = j+1; + if (nj >= poly->vertCount) nj = 0; + + const unsigned short* va = ¶ms->verts[poly->verts[j]*3]; + const unsigned short* vb = ¶ms->verts[poly->verts[nj]*3]; + + if (va[0] == params->tileSize && vb[0] == params->tileSize) // x+ + poly->neis[j] = DT_EXT_LINK | 0; + else if (va[2] == params->tileSize && vb[2] == params->tileSize) // z+ + poly->neis[j] = DT_EXT_LINK | 2; + else if (va[0] == 0 && vb[0] == 0) // x- + poly->neis[j] = DT_EXT_LINK | 4; + else if (va[2] == 0 && vb[2] == 0) // z- + poly->neis[j] = DT_EXT_LINK | 6; + } + } + } + + // Store detail meshes and vertices. + // The nav polygon vertices are stored as the first vertices on each mesh. + // We compress the mesh data by skipping them and using the navmesh coordinates. + unsigned short vbase = 0; + for (int i = 0; i < params->polyCount; ++i) + { + dtPolyDetail& dtl = navDMeshes[i]; + 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 = (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) + { + memcpy(&navDVerts[vbase*3], ¶ms->detailVerts[(vb+nv)*3], sizeof(float)*3*(ndv-nv)); + vbase += (unsigned short)(ndv-nv); + } + } + // Store triangles. + memcpy(navDTris, params->detailTris, sizeof(unsigned char)*4*params->detailTriCount); + + // Store and create BVtree. + // TODO: take detail mesh into account! use byte per bbox extent? + createBVTree(params->verts, params->vertCount, params->polys, params->polyCount, + nvp, params->cs, params->ch, params->polyCount*2, navBvtree); + + // Store Off-Mesh connections. + n = 0; + for (int i = 0; i < params->offMeshConCount; ++i) + { + // Only store connections which start from this tile. + if (offMeshConClass[i*2+0] == 0xff) + { + dtOffMeshConnection* con = &offMeshCons[n]; + con->poly = (unsigned short)(offMeshPolyBase + n); + // Copy connection end-points. + const float* endPts = ¶ms->offMeshConVerts[i*2*3]; + dtVcopy(&con->pos[0], &endPts[0]); + dtVcopy(&con->pos[3], &endPts[3]); + con->rad = params->offMeshConRad[i]; + con->flags = params->offMeshConDir[i] ? DT_OFFMESH_CON_BIDIR : 0; + con->side = offMeshConClass[i*2+1]; + if (params->offMeshConUserID) + con->userId = params->offMeshConUserID[i]; + n++; + } + } + + dtFree(offMeshConClass); + + *outData = data; + *outDataSize = dataSize; + + return true; +} + +inline void swapByte(unsigned char* a, unsigned char* b) +{ + unsigned char tmp = *a; + *a = *b; + *b = tmp; +} + +inline void swapEndian(unsigned short* v) +{ + unsigned char* x = (unsigned char*)v; + swapByte(x+0, x+1); +} + +inline void swapEndian(short* v) +{ + unsigned char* x = (unsigned char*)v; + swapByte(x+0, x+1); +} + +inline void swapEndian(unsigned int* v) +{ + unsigned char* x = (unsigned char*)v; + swapByte(x+0, x+3); swapByte(x+1, x+2); +} + +inline void swapEndian(int* v) +{ + unsigned char* x = (unsigned char*)v; + swapByte(x+0, x+3); swapByte(x+1, x+2); +} + +inline void swapEndian(float* v) +{ + unsigned char* x = (unsigned char*)v; + swapByte(x+0, x+3); swapByte(x+1, x+2); +} + +bool dtNavMeshHeaderSwapEndian(unsigned char* data, const int /*dataSize*/) +{ + dtMeshHeader* header = (dtMeshHeader*)data; + + int swappedMagic = DT_NAVMESH_MAGIC; + int swappedVersion = DT_NAVMESH_VERSION; + swapEndian(&swappedMagic); + swapEndian(&swappedVersion); + + if ((header->magic != DT_NAVMESH_MAGIC || header->version != DT_NAVMESH_VERSION) && + (header->magic != swappedMagic || header->version != swappedVersion)) + { + return false; + } + + swapEndian(&header->magic); + swapEndian(&header->version); + swapEndian(&header->x); + swapEndian(&header->y); + swapEndian(&header->userId); + swapEndian(&header->polyCount); + swapEndian(&header->vertCount); + swapEndian(&header->maxLinkCount); + swapEndian(&header->detailMeshCount); + swapEndian(&header->detailVertCount); + swapEndian(&header->detailTriCount); + swapEndian(&header->bvNodeCount); + swapEndian(&header->offMeshConCount); + swapEndian(&header->offMeshBase); + swapEndian(&header->walkableHeight); + swapEndian(&header->walkableRadius); + swapEndian(&header->walkableClimb); + swapEndian(&header->bmin[0]); + swapEndian(&header->bmin[1]); + swapEndian(&header->bmin[2]); + swapEndian(&header->bmax[0]); + swapEndian(&header->bmax[1]); + swapEndian(&header->bmax[2]); + swapEndian(&header->bvQuantFactor); + + // Freelist index and pointers are updated when tile is added, no need to swap. + + return true; +} + +bool dtNavMeshDataSwapEndian(unsigned char* data, const int /*dataSize*/) +{ + // Make sure the data is in right format. + dtMeshHeader* header = (dtMeshHeader*)data; + if (header->magic != DT_NAVMESH_MAGIC) + return false; + if (header->version != DT_NAVMESH_VERSION) + return false; + + // Patch header pointers. + const int headerSize = dtAlign4(sizeof(dtMeshHeader)); + const int vertsSize = dtAlign4(sizeof(float)*3*header->vertCount); + const int polysSize = dtAlign4(sizeof(dtPoly)*header->polyCount); + const int linksSize = dtAlign4(sizeof(dtLink)*(header->maxLinkCount)); + const int detailMeshesSize = dtAlign4(sizeof(dtPolyDetail)*header->detailMeshCount); + const int detailVertsSize = dtAlign4(sizeof(float)*3*header->detailVertCount); + const int detailTrisSize = dtAlign4(sizeof(unsigned char)*4*header->detailTriCount); + const int bvtreeSize = dtAlign4(sizeof(dtBVNode)*header->bvNodeCount); + const int offMeshLinksSize = dtAlign4(sizeof(dtOffMeshConnection)*header->offMeshConCount); + + unsigned char* d = data + headerSize; + float* verts = (float*)d; d += vertsSize; + dtPoly* polys = (dtPoly*)d; d += polysSize; + /*dtLink* links = (dtLink*)d;*/ d += linksSize; + dtPolyDetail* detailMeshes = (dtPolyDetail*)d; d += detailMeshesSize; + float* detailVerts = (float*)d; d += detailVertsSize; + /*unsigned char* detailTris = (unsigned char*)d;*/ d += detailTrisSize; + dtBVNode* bvTree = (dtBVNode*)d; d += bvtreeSize; + dtOffMeshConnection* offMeshCons = (dtOffMeshConnection*)d; d += offMeshLinksSize; + + // Vertices + for (int i = 0; i < header->vertCount*3; ++i) + { + swapEndian(&verts[i]); + } + + // Polys + for (int i = 0; i < header->polyCount; ++i) + { + dtPoly* p = &polys[i]; + // poly->firstLink is update when tile is added, no need to swap. + for (int j = 0; j < DT_VERTS_PER_POLYGON; ++j) + { + swapEndian(&p->verts[j]); + swapEndian(&p->neis[j]); + } + swapEndian(&p->flags); + } + + // Links are rebuild when tile is added, no need to swap. + + // Detail meshes + for (int i = 0; i < header->detailMeshCount; ++i) + { + dtPolyDetail* pd = &detailMeshes[i]; + swapEndian(&pd->vertBase); + swapEndian(&pd->triBase); + } + + // Detail verts + for (int i = 0; i < header->detailVertCount*3; ++i) + { + swapEndian(&detailVerts[i]); + } + + // BV-tree + for (int i = 0; i < header->bvNodeCount; ++i) + { + dtBVNode* node = &bvTree[i]; + for (int j = 0; j < 3; ++j) + { + swapEndian(&node->bmin[j]); + swapEndian(&node->bmax[j]); + } + swapEndian(&node->i); + } + + // Off-mesh Connections. + for (int i = 0; i < header->offMeshConCount; ++i) + { + dtOffMeshConnection* con = &offMeshCons[i]; + for (int j = 0; j < 6; ++j) + swapEndian(&con->pos[j]); + swapEndian(&con->rad); + swapEndian(&con->poly); + } + + return true; +} diff --git a/dep/recastnavigation/Detour/Source/DetourNavMeshQuery.cpp b/dep/recastnavigation/Detour/Source/DetourNavMeshQuery.cpp new file mode 100644 index 000000000..6a6eb94b6 --- /dev/null +++ b/dep/recastnavigation/Detour/Source/DetourNavMeshQuery.cpp @@ -0,0 +1,2564 @@ +// +// Copyright (c) 2009-2010 Mikko Mononen memon@inside.org +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. +// + +#include +#include +#include +#include "DetourNavMeshQuery.h" +#include "DetourNavMesh.h" +#include "DetourNode.h" +#include "DetourCommon.h" +#include "DetourAlloc.h" +#include "DetourAssert.h" +#include + + +dtQueryFilter::dtQueryFilter() : + m_includeFlags(0xffff), + m_excludeFlags(0) +{ + for (int i = 0; i < DT_MAX_AREAS; ++i) + m_areaCost[i] = 1.0f; +} + +#ifdef DT_VIRTUAL_QUERYFILTER +bool dtQueryFilter::passFilter(const dtPolyRef /*ref*/, + const dtMeshTile* /*tile*/, + const dtPoly* poly) const +{ + return (poly->flags & m_includeFlags) != 0 && (poly->flags & m_excludeFlags) == 0; +} + +float dtQueryFilter::getCost(const float* pa, const float* pb, + const dtPolyRef /*prevRef*/, const dtMeshTile* /*prevTile*/, const dtPoly* /*prevPoly*/, + const dtPolyRef /*curRef*/, const dtMeshTile* /*curTile*/, const dtPoly* curPoly, + const dtPolyRef /*nextRef*/, const dtMeshTile* /*nextTile*/, const dtPoly* /*nextPoly*/) const +{ + return dtVdist(pa, pb) * m_areaCost[curPoly->area]; +} +#else +inline bool dtQueryFilter::passFilter(const dtPolyRef /*ref*/, + const dtMeshTile* /*tile*/, + const dtPoly* poly) const +{ + return (poly->flags & m_includeFlags) != 0 && (poly->flags & m_excludeFlags) == 0; +} + +inline float dtQueryFilter::getCost(const float* pa, const float* pb, + const dtPolyRef /*prevRef*/, const dtMeshTile* /*prevTile*/, const dtPoly* /*prevPoly*/, + const dtPolyRef /*curRef*/, const dtMeshTile* /*curTile*/, const dtPoly* curPoly, + const dtPolyRef /*nextRef*/, const dtMeshTile* /*nextTile*/, const dtPoly* /*nextPoly*/) const +{ + return dtVdist(pa, pb) * m_areaCost[curPoly->getArea()]; +} +#endif + +static const float H_SCALE = 2.0f; // Search heuristic scale. + + +dtNavMeshQuery* dtAllocNavMeshQuery() +{ + void* mem = dtAlloc(sizeof(dtNavMeshQuery), DT_ALLOC_PERM); + if (!mem) return 0; + return new(mem) dtNavMeshQuery; +} + +void dtFreeNavMeshQuery(dtNavMeshQuery* navmesh) +{ + if (!navmesh) return; + navmesh->~dtNavMeshQuery(); + dtFree(navmesh); +} + +////////////////////////////////////////////////////////////////////////////////////////// +dtNavMeshQuery::dtNavMeshQuery() : + m_tinyNodePool(0), + m_nodePool(0), + m_openList(0) +{ + memset(&m_query, 0, sizeof(dtQueryData)); +} + +dtNavMeshQuery::~dtNavMeshQuery() +{ + if (m_tinyNodePool) + m_tinyNodePool->~dtNodePool(); + if (m_nodePool) + m_nodePool->~dtNodePool(); + if (m_openList) + m_openList->~dtNodeQueue(); + dtFree(m_tinyNodePool); + dtFree(m_nodePool); + dtFree(m_openList); +} + +dtStatus dtNavMeshQuery::init(const dtNavMesh* nav, const int maxNodes) +{ + m_nav = nav; + + if (!m_nodePool || m_nodePool->getMaxNodes() < maxNodes) + { + if (m_nodePool) + { + m_nodePool->~dtNodePool(); + dtFree(m_nodePool); + m_nodePool = 0; + } + m_nodePool = new (dtAlloc(sizeof(dtNodePool), DT_ALLOC_PERM)) dtNodePool(maxNodes, dtNextPow2(maxNodes/4)); + if (!m_nodePool) + return DT_FAILURE_OUT_OF_MEMORY; + } + else + { + m_nodePool->clear(); + } + + if (!m_tinyNodePool) + { + m_tinyNodePool = new (dtAlloc(sizeof(dtNodePool), DT_ALLOC_PERM)) dtNodePool(64, 32); + if (!m_tinyNodePool) + return DT_FAILURE_OUT_OF_MEMORY; + } + else + { + m_tinyNodePool->clear(); + } + + // TODO: check the open list size too. + if (!m_openList || m_openList->getCapacity() < maxNodes) + { + if (m_openList) + { + m_openList->~dtNodeQueue(); + dtFree(m_openList); + m_openList = 0; + } + m_openList = new (dtAlloc(sizeof(dtNodeQueue), DT_ALLOC_PERM)) dtNodeQueue(maxNodes); + if (!m_openList) + return DT_FAILURE_OUT_OF_MEMORY; + } + else + { + m_openList->clear(); + } + + return DT_SUCCESS; +} + +////////////////////////////////////////////////////////////////////////////////////////// +dtStatus dtNavMeshQuery::closestPointOnPoly(dtPolyRef ref, const float* pos, float* closest) const +{ + dtAssert(m_nav); + const dtMeshTile* tile = 0; + const dtPoly* poly = 0; + if (m_nav->getTileAndPolyByRef(ref, &tile, &poly) != DT_SUCCESS) + return DT_FAILURE; + if (!tile) return DT_FAILURE; + + if (poly->getType() == DT_POLYTYPE_OFFMESH_CONNECTION) + return DT_FAILURE; + + if (closestPointOnPolyInTile(tile, poly, pos, closest) != DT_SUCCESS) + return DT_FAILURE; + return DT_SUCCESS; +} + +dtStatus dtNavMeshQuery::closestPointOnPolyInTile(const dtMeshTile* tile, const dtPoly* poly, + const float* pos, float* closest) const +{ + const unsigned int ip = (unsigned int)(poly - tile->polys); + const dtPolyDetail* pd = &tile->detailMeshes[ip]; + + // TODO: The commented out version finds 'cylinder distance' instead of 'sphere distance' to the navmesh. + // Test and enable. +/* + // Clamp point to be inside the polygon. + float verts[DT_VERTS_PER_POLYGON*3]; + float edged[DT_VERTS_PER_POLYGON]; + float edget[DT_VERTS_PER_POLYGON]; + const int nv = poly->vertCount; + for (int i = 0; i < nv; ++i) + dtVcopy(&verts[i*3], &tile->verts[poly->verts[i]*3]); + + dtVcopy(closest, pos); + if (!dtDistancePtPolyEdgesSqr(pos, verts, nv, edged, edget)) + { + // Point is outside the polygon, dtClamp to nearest edge. + float dmin = FLT_MAX; + int imin = -1; + for (int i = 0; i < nv; ++i) + { + if (edged[i] < dmin) + { + dmin = edged[i]; + imin = i; + } + } + const float* va = &verts[imin*3]; + const float* vb = &verts[((imin+1)%nv)*3]; + dtVlerp(closest, va, vb, edget[imin]); + } + + // Find height at the location. + for (int j = 0; j < pd->triCount; ++j) + { + const unsigned char* t = &tile->detailTris[(pd->triBase+j)*4]; + const float* v[3]; + for (int k = 0; k < 3; ++k) + { + if (t[k] < poly->vertCount) + v[k] = &tile->verts[poly->verts[t[k]]*3]; + else + v[k] = &tile->detailVerts[(pd->vertBase+(t[k]-poly->vertCount))*3]; + } + float h; + if (dtClosestHeightPointTriangle(pos, v[0], v[1], v[2], h)) + { + closest[1] = h; + break; + } + } +*/ + float closestDistSqr = FLT_MAX; + for (int j = 0; j < pd->triCount; ++j) + { + const unsigned char* t = &tile->detailTris[(pd->triBase+j)*4]; + const float* v[3]; + for (int k = 0; k < 3; ++k) + { + if (t[k] < poly->vertCount) + v[k] = &tile->verts[poly->verts[t[k]]*3]; + else + v[k] = &tile->detailVerts[(pd->vertBase+(t[k]-poly->vertCount))*3]; + } + + float pt[3]; + dtClosestPtPointTriangle(pt, pos, v[0], v[1], v[2]); + float d = dtVdistSqr(pos, pt); + + if (d < closestDistSqr) + { + dtVcopy(closest, pt); + closestDistSqr = d; + } + } + + return DT_SUCCESS; +} + +dtStatus dtNavMeshQuery::closestPointOnPolyBoundary(dtPolyRef ref, const float* pos, float* closest) const +{ + dtAssert(m_nav); + + const dtMeshTile* tile = 0; + const dtPoly* poly = 0; + if (m_nav->getTileAndPolyByRef(ref, &tile, &poly) != DT_SUCCESS) + return DT_FAILURE; + + // Collect vertices. + float verts[DT_VERTS_PER_POLYGON*3]; + float edged[DT_VERTS_PER_POLYGON]; + float edget[DT_VERTS_PER_POLYGON]; + int nv = 0; + for (int i = 0; i < (int)poly->vertCount; ++i) + { + dtVcopy(&verts[nv*3], &tile->verts[poly->verts[i]*3]); + nv++; + } + + bool inside = dtDistancePtPolyEdgesSqr(pos, verts, nv, edged, edget); + if (inside) + { + // Point is inside the polygon, return the point. + dtVcopy(closest, pos); + } + else + { + // Point is outside the polygon, dtClamp to nearest edge. + float dmin = FLT_MAX; + int imin = -1; + for (int i = 0; i < nv; ++i) + { + if (edged[i] < dmin) + { + dmin = edged[i]; + imin = i; + } + } + const float* va = &verts[imin*3]; + const float* vb = &verts[((imin+1)%nv)*3]; + dtVlerp(closest, va, vb, edget[imin]); + } + + return DT_SUCCESS; +} + + +dtStatus dtNavMeshQuery::getPolyHeight(dtPolyRef ref, const float* pos, float* height) const +{ + dtAssert(m_nav); + + const dtMeshTile* tile = 0; + const dtPoly* poly = 0; + if (m_nav->getTileAndPolyByRef(ref, &tile, &poly) != DT_SUCCESS) + return DT_FAILURE; + + if (poly->getType() == DT_POLYTYPE_OFFMESH_CONNECTION) + { + const float* v0 = &tile->verts[poly->verts[0]*3]; + const float* v1 = &tile->verts[poly->verts[1]*3]; + const float d0 = dtVdist(pos, v0); + const float d1 = dtVdist(pos, v1); + const float u = d0 / (d0+d1); + if (height) + *height = v0[1] + (v1[1] - v0[1]) * u; + return DT_SUCCESS; + } + else + { + const unsigned int ip = (unsigned int)(poly - tile->polys); + const dtPolyDetail* pd = &tile->detailMeshes[ip]; + for (int j = 0; j < pd->triCount; ++j) + { + const unsigned char* t = &tile->detailTris[(pd->triBase+j)*4]; + const float* v[3]; + for (int k = 0; k < 3; ++k) + { + if (t[k] < poly->vertCount) + v[k] = &tile->verts[poly->verts[t[k]]*3]; + else + v[k] = &tile->detailVerts[(pd->vertBase+(t[k]-poly->vertCount))*3]; + } + float h; + if (dtClosestHeightPointTriangle(pos, v[0], v[1], v[2], h)) + { + if (height) + *height = h; + return DT_SUCCESS; + } + } + } + + return DT_FAILURE; +} + +dtStatus dtNavMeshQuery::findNearestPoly(const float* center, const float* extents, + const dtQueryFilter* filter, + dtPolyRef* nearestRef, float* nearestPt) const +{ + dtAssert(m_nav); + + *nearestRef = 0; + + // Get nearby polygons from proximity grid. + dtPolyRef polys[128]; + int polyCount = 0; + if (queryPolygons(center, extents, filter, polys, &polyCount, 128) != DT_SUCCESS) + return DT_FAILURE; + + // Find nearest polygon amongst the nearby polygons. + dtPolyRef nearest = 0; + float nearestDistanceSqr = FLT_MAX; + for (int i = 0; i < polyCount; ++i) + { + dtPolyRef ref = polys[i]; + float closestPtPoly[3]; + if (closestPointOnPoly(ref, center, closestPtPoly) != DT_SUCCESS) + continue; + float d = dtVdistSqr(center, closestPtPoly); + if (d < nearestDistanceSqr) + { + if (nearestPt) + dtVcopy(nearestPt, closestPtPoly); + nearestDistanceSqr = d; + nearest = ref; + } + } + + if (nearestRef) + *nearestRef = nearest; + + return DT_SUCCESS; +} + +dtPolyRef dtNavMeshQuery::findNearestPolyInTile(const dtMeshTile* tile, const float* center, const float* extents, + const dtQueryFilter* filter, float* nearestPt) const +{ + dtAssert(m_nav); + + float bmin[3], bmax[3]; + dtVsub(bmin, center, extents); + dtVadd(bmax, center, extents); + + // Get nearby polygons from proximity grid. + dtPolyRef polys[128]; + int polyCount = queryPolygonsInTile(tile, bmin, bmax, filter, polys, 128); + + // Find nearest polygon amongst the nearby polygons. + dtPolyRef nearest = 0; + float nearestDistanceSqr = FLT_MAX; + for (int i = 0; i < polyCount; ++i) + { + dtPolyRef ref = polys[i]; + const dtPoly* poly = &tile->polys[m_nav->decodePolyIdPoly(ref)]; + float closestPtPoly[3]; + if (closestPointOnPolyInTile(tile, poly, center, closestPtPoly) != DT_SUCCESS) + continue; + + float d = dtVdistSqr(center, closestPtPoly); + if (d < nearestDistanceSqr) + { + if (nearestPt) + dtVcopy(nearestPt, closestPtPoly); + nearestDistanceSqr = d; + nearest = ref; + } + } + + return nearest; +} + +int dtNavMeshQuery::queryPolygonsInTile(const dtMeshTile* tile, const float* qmin, const float* qmax, + const dtQueryFilter* filter, + dtPolyRef* polys, const int maxPolys) const +{ + dtAssert(m_nav); + + if (tile->bvTree) + { + const dtBVNode* node = &tile->bvTree[0]; + const dtBVNode* end = &tile->bvTree[tile->header->bvNodeCount]; + const float* tbmin = tile->header->bmin; + const float* tbmax = tile->header->bmax; + const float qfac = tile->header->bvQuantFactor; + + // Calculate quantized box + unsigned short bmin[3], bmax[3]; + // dtClamp query box to world box. + float minx = dtClamp(qmin[0], tbmin[0], tbmax[0]) - tbmin[0]; + float miny = dtClamp(qmin[1], tbmin[1], tbmax[1]) - tbmin[1]; + float minz = dtClamp(qmin[2], tbmin[2], tbmax[2]) - tbmin[2]; + float maxx = dtClamp(qmax[0], tbmin[0], tbmax[0]) - tbmin[0]; + float maxy = dtClamp(qmax[1], tbmin[1], tbmax[1]) - tbmin[1]; + float maxz = dtClamp(qmax[2], tbmin[2], tbmax[2]) - tbmin[2]; + // Quantize + bmin[0] = (unsigned short)(qfac * minx) & 0xfffe; + bmin[1] = (unsigned short)(qfac * miny) & 0xfffe; + bmin[2] = (unsigned short)(qfac * minz) & 0xfffe; + bmax[0] = (unsigned short)(qfac * maxx + 1) | 1; + bmax[1] = (unsigned short)(qfac * maxy + 1) | 1; + bmax[2] = (unsigned short)(qfac * maxz + 1) | 1; + + // Traverse tree + const dtPolyRef base = m_nav->getPolyRefBase(tile); + int n = 0; + while (node < end) + { + const bool overlap = dtOverlapQuantBounds(bmin, bmax, node->bmin, node->bmax); + const bool isLeafNode = node->i >= 0; + + if (isLeafNode && overlap) + { + dtPolyRef ref = base | (dtPolyRef)node->i; + if (filter->passFilter(ref, tile, &tile->polys[node->i])) + { + if (n < maxPolys) + polys[n++] = ref; + } + } + + if (overlap || isLeafNode) + node++; + else + { + const int escapeIndex = -node->i; + node += escapeIndex; + } + } + + return n; + } + else + { + float bmin[3], bmax[3]; + int n = 0; + const dtPolyRef base = m_nav->getPolyRefBase(tile); + for (int i = 0; i < tile->header->polyCount; ++i) + { + // Calc polygon bounds. + dtPoly* p = &tile->polys[i]; + const float* v = &tile->verts[p->verts[0]*3]; + dtVcopy(bmin, v); + dtVcopy(bmax, v); + for (int j = 1; j < p->vertCount; ++j) + { + v = &tile->verts[p->verts[j]*3]; + dtVmin(bmin, v); + dtVmax(bmax, v); + } + if (dtOverlapBounds(qmin,qmax, bmin,bmax)) + { + const dtPolyRef ref = base | (dtPolyRef)i; + if (filter->passFilter(ref, tile, p)) + { + if (n < maxPolys) + polys[n++] = ref; + } + } + } + return n; + } +} + +dtStatus dtNavMeshQuery::queryPolygons(const float* center, const float* extents, + const dtQueryFilter* filter, + dtPolyRef* polys, int* polyCount, const int maxPolys) const +{ + dtAssert(m_nav); + + float bmin[3], bmax[3]; + dtVsub(bmin, center, extents); + dtVadd(bmax, center, extents); + + // Find tiles the query touches. + int minx, miny, maxx, maxy; + m_nav->calcTileLoc(bmin, &minx, &miny); + m_nav->calcTileLoc(bmax, &maxx, &maxy); + + int n = 0; + for (int y = miny; y <= maxy; ++y) + { + for (int x = minx; x <= maxx; ++x) + { + const dtMeshTile* tile = m_nav->getTileAt(x,y); + if (!tile) continue; + n += queryPolygonsInTile(tile, bmin, bmax, filter, polys+n, maxPolys-n); + if (n >= maxPolys) + { + *polyCount = n; + return DT_SUCCESS; + } + } + } + *polyCount = n; + + return DT_SUCCESS; +} + +dtStatus dtNavMeshQuery::findPath(dtPolyRef startRef, dtPolyRef endRef, + const float* startPos, const float* endPos, + const dtQueryFilter* filter, + dtPolyRef* path, int* pathCount, const int maxPath) const +{ + dtAssert(m_nav); + dtAssert(m_nodePool); + dtAssert(m_openList); + + *pathCount = 0; + + if (!startRef || !endRef) + return DT_FAILURE; + + if (!maxPath) + return DT_FAILURE; + + // Validate input + if (!m_nav->isValidPolyRef(startRef) || !m_nav->isValidPolyRef(endRef)) + return DT_FAILURE; + + if (startRef == endRef) + { + path[0] = startRef; + *pathCount = 1; + return DT_SUCCESS; + } + + m_nodePool->clear(); + m_openList->clear(); + + dtNode* startNode = m_nodePool->getNode(startRef); + dtVcopy(startNode->pos, startPos); + startNode->pidx = 0; + startNode->cost = 0; + startNode->total = dtVdist(startPos, endPos) * H_SCALE; + startNode->id = startRef; + startNode->flags = DT_NODE_OPEN; + m_openList->push(startNode); + + dtNode* lastBestNode = startNode; + float lastBestNodeCost = startNode->total; + + while (!m_openList->empty()) + { + // Remove node from open list and put it in closed list. + dtNode* bestNode = m_openList->pop(); + bestNode->flags &= ~DT_NODE_OPEN; + bestNode->flags |= DT_NODE_CLOSED; + + // Reached the goal, stop searching. + if (bestNode->id == endRef) + { + lastBestNode = bestNode; + break; + } + + // Get current poly and tile. + // The API input has been cheked already, skip checking internal data. + const dtPolyRef bestRef = bestNode->id; + const dtMeshTile* bestTile = 0; + const dtPoly* bestPoly = 0; + m_nav->getTileAndPolyByRefUnsafe(bestRef, &bestTile, &bestPoly); + + // Get parent poly and tile. + dtPolyRef parentRef = 0; + const dtMeshTile* parentTile = 0; + const dtPoly* parentPoly = 0; + if (bestNode->pidx) + parentRef = m_nodePool->getNodeAtIdx(bestNode->pidx)->id; + if (parentRef) + m_nav->getTileAndPolyByRefUnsafe(parentRef, &parentTile, &parentPoly); + + for (unsigned int i = bestPoly->firstLink; i != DT_NULL_LINK; i = bestTile->links[i].next) + { + dtPolyRef neighbourRef = bestTile->links[i].ref; + + // Skip invalid ids and do not expand back to where we came from. + if (!neighbourRef || neighbourRef == parentRef) + continue; + + // Get neighbour poly and tile. + // The API input has been cheked already, skip checking internal data. + const dtMeshTile* neighbourTile = 0; + const dtPoly* neighbourPoly = 0; + m_nav->getTileAndPolyByRefUnsafe(neighbourRef, &neighbourTile, &neighbourPoly); + + if (!filter->passFilter(neighbourRef, neighbourTile, neighbourPoly)) + continue; + + dtNode* neighbourNode = m_nodePool->getNode(neighbourRef); + if (!neighbourNode) + continue; + + // If the node is visited the first time, calculate node position. + if (neighbourNode->flags == 0) + { + getEdgeMidPoint(bestRef, bestPoly, bestTile, + neighbourRef, neighbourPoly, neighbourTile, + neighbourNode->pos); + } + + // Calculate cost and heuristic. + float cost = 0; + float heuristic = 0; + + // Special case for last node. + if (neighbourRef == endRef) + { + // Cost + const float curCost = filter->getCost(bestNode->pos, neighbourNode->pos, + parentRef, parentTile, parentPoly, + bestRef, bestTile, bestPoly, + neighbourRef, neighbourTile, neighbourPoly); + const float endCost = filter->getCost(neighbourNode->pos, endPos, + bestRef, bestTile, bestPoly, + neighbourRef, neighbourTile, neighbourPoly, + 0, 0, 0); + + cost = bestNode->cost + curCost + endCost; + heuristic = 0; + } + else + { + // Cost + const float curCost = filter->getCost(bestNode->pos, neighbourNode->pos, + parentRef, parentTile, parentPoly, + bestRef, bestTile, bestPoly, + neighbourRef, neighbourTile, neighbourPoly); + cost = bestNode->cost + curCost; + heuristic = dtVdist(neighbourNode->pos, endPos)*H_SCALE; + } + + const float total = cost + heuristic; + + // The node is already in open list and the new result is worse, skip. + if ((neighbourNode->flags & DT_NODE_OPEN) && total >= neighbourNode->total) + continue; + // The node is already visited and process, and the new result is worse, skip. + if ((neighbourNode->flags & DT_NODE_CLOSED) && total >= neighbourNode->total) + continue; + + // Add or update the node. + neighbourNode->pidx = m_nodePool->getNodeIdx(bestNode); + neighbourNode->id = neighbourRef; + neighbourNode->flags &= ~DT_NODE_CLOSED; + neighbourNode->cost = cost; + neighbourNode->total = total; + + if (neighbourNode->flags & DT_NODE_OPEN) + { + // Already in open, update node location. + m_openList->modify(neighbourNode); + } + else + { + // Put the node in open list. + neighbourNode->flags |= DT_NODE_OPEN; + m_openList->push(neighbourNode); + } + + // Update nearest node to target so far. + if (heuristic < lastBestNodeCost) + { + lastBestNodeCost = heuristic; + lastBestNode = neighbourNode; + } + } + } + + // Reverse the path. + dtNode* prev = 0; + dtNode* node = lastBestNode; + do + { + dtNode* next = m_nodePool->getNodeAtIdx(node->pidx); + node->pidx = m_nodePool->getNodeIdx(prev); + prev = node; + node = next; + } + while (node); + + // Store path + node = prev; + int n = 0; + do + { + path[n++] = node->id; + node = m_nodePool->getNodeAtIdx(node->pidx); + } + while (node && n < maxPath); + + *pathCount = n; + + return DT_SUCCESS; +} + +dtStatus dtNavMeshQuery::initSlicedFindPath(dtPolyRef startRef, dtPolyRef endRef, + const float* startPos, const float* endPos, + const dtQueryFilter* filter) +{ + dtAssert(m_nav); + dtAssert(m_nodePool); + dtAssert(m_openList); + + // Init path state. + memset(&m_query, 0, sizeof(dtQueryData)); + m_query.status = DT_FAILURE; + m_query.startRef = startRef; + m_query.endRef = endRef; + dtVcopy(m_query.startPos, startPos); + dtVcopy(m_query.endPos, endPos); + m_query.filter = filter; + + if (!startRef || !endRef) + return DT_FAILURE; + + // Validate input + if (!m_nav->isValidPolyRef(startRef) || !m_nav->isValidPolyRef(endRef)) + return DT_FAILURE; + + if (startRef == endRef) + { + m_query.status = DT_SUCCESS; + return DT_SUCCESS; + } + + m_nodePool->clear(); + m_openList->clear(); + + dtNode* startNode = m_nodePool->getNode(startRef); + dtVcopy(startNode->pos, startPos); + startNode->pidx = 0; + startNode->cost = 0; + startNode->total = dtVdist(startPos, endPos) * H_SCALE; + startNode->id = startRef; + startNode->flags = DT_NODE_OPEN; + m_openList->push(startNode); + + m_query.status = DT_IN_PROGRESS; + m_query.lastBestNode = startNode; + m_query.lastBestNodeCost = startNode->total; + + return m_query.status; +} + +dtStatus dtNavMeshQuery::updateSlicedFindPath(const int maxIter) +{ + if (m_query.status!= DT_IN_PROGRESS) + return m_query.status; + + // Make sure the request is still valid. + if (!m_nav->isValidPolyRef(m_query.startRef) || !m_nav->isValidPolyRef(m_query.endRef)) + { + m_query.status = DT_FAILURE; + return DT_FAILURE; + } + + int iter = 0; + while (iter < maxIter && !m_openList->empty()) + { + iter++; + + // Remove node from open list and put it in closed list. + dtNode* bestNode = m_openList->pop(); + bestNode->flags &= ~DT_NODE_OPEN; + bestNode->flags |= DT_NODE_CLOSED; + + // Reached the goal, stop searching. + if (bestNode->id == m_query.endRef) + { + m_query.lastBestNode = bestNode; + m_query.status = DT_SUCCESS; + return m_query.status; + } + + // Get current poly and tile. + // The API input has been cheked already, skip checking internal data. + const dtPolyRef bestRef = bestNode->id; + const dtMeshTile* bestTile = 0; + const dtPoly* bestPoly = 0; + if (m_nav->getTileAndPolyByRef(bestRef, &bestTile, &bestPoly) != DT_SUCCESS) + { + // The polygon has disappeared during the sliced query, fail. + m_query.status = DT_FAILURE; + return m_query.status; + } + + // Get parent poly and tile. + dtPolyRef parentRef = 0; + const dtMeshTile* parentTile = 0; + const dtPoly* parentPoly = 0; + if (bestNode->pidx) + parentRef = m_nodePool->getNodeAtIdx(bestNode->pidx)->id; + if (parentRef) + { + if (m_nav->getTileAndPolyByRef(parentRef, &parentTile, &parentPoly) != DT_SUCCESS) + { + // The polygon has disappeared during the sliced query, fail. + m_query.status = DT_FAILURE; + return m_query.status; + } + } + + for (unsigned int i = bestPoly->firstLink; i != DT_NULL_LINK; i = bestTile->links[i].next) + { + dtPolyRef neighbourRef = bestTile->links[i].ref; + + // Skip invalid ids and do not expand back to where we came from. + if (!neighbourRef || neighbourRef == parentRef) + continue; + + // Get neighbour poly and tile. + // The API input has been cheked already, skip checking internal data. + const dtMeshTile* neighbourTile = 0; + const dtPoly* neighbourPoly = 0; + m_nav->getTileAndPolyByRefUnsafe(neighbourRef, &neighbourTile, &neighbourPoly); + + if (!m_query.filter->passFilter(neighbourRef, neighbourTile, neighbourPoly)) + continue; + + dtNode* neighbourNode = m_nodePool->getNode(neighbourRef); + if (!neighbourNode) + continue; + + // If the node is visited the first time, calculate node position. + if (neighbourNode->flags == 0) + { + getEdgeMidPoint(bestRef, bestPoly, bestTile, + neighbourRef, neighbourPoly, neighbourTile, + neighbourNode->pos); + } + + // Calculate cost and heuristic. + float cost = 0; + float heuristic = 0; + + // Special case for last node. + if (neighbourRef == m_query.endRef) + { + // Cost + const float curCost = m_query.filter->getCost(bestNode->pos, neighbourNode->pos, + parentRef, parentTile, parentPoly, + bestRef, bestTile, bestPoly, + neighbourRef, neighbourTile, neighbourPoly); + const float endCost = m_query.filter->getCost(neighbourNode->pos, m_query.endPos, + bestRef, bestTile, bestPoly, + neighbourRef, neighbourTile, neighbourPoly, + 0, 0, 0); + + cost = bestNode->cost + curCost + endCost; + heuristic = 0; + } + else + { + // Cost + const float curCost = m_query.filter->getCost(bestNode->pos, neighbourNode->pos, + parentRef, parentTile, parentPoly, + bestRef, bestTile, bestPoly, + neighbourRef, neighbourTile, neighbourPoly); + cost = bestNode->cost + curCost; + heuristic = dtVdist(neighbourNode->pos, m_query.endPos)*H_SCALE; + } + + const float total = cost + heuristic; + + // The node is already in open list and the new result is worse, skip. + if ((neighbourNode->flags & DT_NODE_OPEN) && total >= neighbourNode->total) + continue; + // The node is already visited and process, and the new result is worse, skip. + if ((neighbourNode->flags & DT_NODE_CLOSED) && total >= neighbourNode->total) + continue; + + // Add or update the node. + neighbourNode->pidx = m_nodePool->getNodeIdx(bestNode); + neighbourNode->id = neighbourRef; + neighbourNode->flags &= ~DT_NODE_CLOSED; + neighbourNode->cost = cost; + neighbourNode->total = total; + + if (neighbourNode->flags & DT_NODE_OPEN) + { + // Already in open, update node location. + m_openList->modify(neighbourNode); + } + else + { + // Put the node in open list. + neighbourNode->flags |= DT_NODE_OPEN; + m_openList->push(neighbourNode); + } + + // Update nearest node to target so far. + if (heuristic < m_query.lastBestNodeCost) + { + m_query.lastBestNodeCost = heuristic; + m_query.lastBestNode = neighbourNode; + } + } + } + + // Exhausted all nodes, but could not find path. + if (m_openList->empty()) + m_query.status = DT_SUCCESS; + + return m_query.status; +} + +dtStatus dtNavMeshQuery::finalizeSlicedFindPath(dtPolyRef* path, int* pathCount, const int maxPath) +{ + *pathCount = 0; + + if (m_query.status != DT_SUCCESS) + { + // Reset query. + memset(&m_query, 0, sizeof(dtQueryData)); + return DT_FAILURE; + } + + int n = 0; + + if (m_query.startRef == m_query.endRef) + { + // Special case: the search starts and ends at same poly. + path[n++] = m_query.startRef; + } + else + { + // Reverse the path. + dtAssert(m_query.lastBestNode); + dtNode* prev = 0; + dtNode* node = m_query.lastBestNode; + do + { + dtNode* next = m_nodePool->getNodeAtIdx(node->pidx); + node->pidx = m_nodePool->getNodeIdx(prev); + prev = node; + node = next; + } + while (node); + + // Store path + node = prev; + do + { + path[n++] = node->id; + node = m_nodePool->getNodeAtIdx(node->pidx); + } + while (node && n < maxPath); + } + + // Reset query. + memset(&m_query, 0, sizeof(dtQueryData)); + + *pathCount = n; + + return DT_SUCCESS; +} + +dtStatus dtNavMeshQuery::finalizeSlicedFindPathPartial(const dtPolyRef* existing, const int existingSize, + dtPolyRef* path, int* pathCount, const int maxPath) +{ + *pathCount = 0; + + if (existingSize == 0) + { + return DT_FAILURE; + } + + if (m_query.status != DT_SUCCESS && m_query.status != DT_IN_PROGRESS) + { + // Reset query. + memset(&m_query, 0, sizeof(dtQueryData)); + return DT_FAILURE; + } + + int n = 0; + + if (m_query.startRef == m_query.endRef) + { + // Special case: the search starts and ends at same poly. + path[n++] = m_query.startRef; + } + else + { + // Find furthest existing node that was visited. + dtNode* prev = 0; + dtNode* node = 0; + for (int i = existingSize-1; i >= 0; --i) + { + node = m_nodePool->findNode(existing[i]); + if (node) + break; + } + + if (!node) + { + return DT_FAILURE; + } + + // Reverse the path. + do + { + dtNode* next = m_nodePool->getNodeAtIdx(node->pidx); + node->pidx = m_nodePool->getNodeIdx(prev); + prev = node; + node = next; + } + while (node); + + // Store path + node = prev; + do + { + path[n++] = node->id; + node = m_nodePool->getNodeAtIdx(node->pidx); + } + while (node && n < maxPath); + } + + // Reset query. + memset(&m_query, 0, sizeof(dtQueryData)); + + *pathCount = n; + + return DT_SUCCESS; +} + + +dtStatus dtNavMeshQuery::findStraightPath(const float* startPos, const float* endPos, + const dtPolyRef* path, const int pathSize, + float* straightPath, unsigned char* straightPathFlags, dtPolyRef* straightPathRefs, + int* straightPathCount, const int maxStraightPath) const +{ + dtAssert(m_nav); + + *straightPathCount = 0; + + if (!maxStraightPath) + return DT_FAILURE; + + if (!path[0]) + return DT_FAILURE; + + int n = 0; + + // TODO: Should this be callers responsibility? + float closestStartPos[3]; + if (closestPointOnPolyBoundary(path[0], startPos, closestStartPos) != DT_SUCCESS) + return DT_FAILURE; + + // Add start point. + dtVcopy(&straightPath[n*3], closestStartPos); + if (straightPathFlags) + straightPathFlags[n] = DT_STRAIGHTPATH_START; + if (straightPathRefs) + straightPathRefs[n] = path[0]; + n++; + if (n >= maxStraightPath) + { + *straightPathCount = n; + return DT_SUCCESS; + } + + float closestEndPos[3]; + if (closestPointOnPolyBoundary(path[pathSize-1], endPos, closestEndPos) != DT_SUCCESS) + return DT_FAILURE; + + if (pathSize > 1) + { + float portalApex[3], portalLeft[3], portalRight[3]; + dtVcopy(portalApex, closestStartPos); + dtVcopy(portalLeft, portalApex); + dtVcopy(portalRight, portalApex); + int apexIndex = 0; + int leftIndex = 0; + int rightIndex = 0; + + unsigned char leftPolyType = 0; + unsigned char rightPolyType = 0; + + dtPolyRef leftPolyRef = path[0]; + dtPolyRef rightPolyRef = path[0]; + + for (int i = 0; i < pathSize; ++i) + { + float left[3], right[3]; + unsigned char fromType, toType; + + if (i+1 < pathSize) + { + // Next portal. + if (getPortalPoints(path[i], path[i+1], left, right, fromType, toType) != DT_SUCCESS) + { + if (closestPointOnPolyBoundary(path[i], endPos, closestEndPos) != DT_SUCCESS) + return DT_FAILURE; + + dtVcopy(&straightPath[n*3], closestEndPos); + if (straightPathFlags) + straightPathFlags[n] = 0; + if (straightPathRefs) + straightPathRefs[n] = path[i]; + n++; + + return DT_SUCCESS; + } + + // If starting really close the portal, advance. + if (i == 0) + { + float t; + if (dtDistancePtSegSqr2D(portalApex, left, right, t) < dtSqr(0.001f)) + continue; + } + } + else + { + // End of the path. + dtVcopy(left, closestEndPos); + dtVcopy(right, closestEndPos); + + fromType = toType = DT_POLYTYPE_GROUND; + } + + // Right vertex. + if (dtTriArea2D(portalApex, portalRight, right) <= 0.0f) + { + if (dtVequal(portalApex, portalRight) || dtTriArea2D(portalApex, portalLeft, right) > 0.0f) + { + dtVcopy(portalRight, right); + rightPolyRef = (i+1 < pathSize) ? path[i+1] : 0; + rightPolyType = toType; + rightIndex = i; + } + else + { + dtVcopy(portalApex, portalLeft); + apexIndex = leftIndex; + + unsigned char flags = 0; + if (!leftPolyRef) + flags = DT_STRAIGHTPATH_END; + else if (leftPolyType == DT_POLYTYPE_OFFMESH_CONNECTION) + flags = DT_STRAIGHTPATH_OFFMESH_CONNECTION; + dtPolyRef ref = leftPolyRef; + + if (!dtVequal(&straightPath[(n-1)*3], portalApex)) + { + // Append new vertex. + dtVcopy(&straightPath[n*3], portalApex); + if (straightPathFlags) + straightPathFlags[n] = flags; + if (straightPathRefs) + straightPathRefs[n] = ref; + n++; + // If reached end of path or there is no space to append more vertices, return. + if (flags == DT_STRAIGHTPATH_END || n >= maxStraightPath) + { + *straightPathCount = n; + return DT_SUCCESS; + } + } + else + { + // The vertices are equal, update flags and poly. + if (straightPathFlags) + straightPathFlags[n-1] = flags; + if (straightPathRefs) + straightPathRefs[n-1] = ref; + } + + dtVcopy(portalLeft, portalApex); + dtVcopy(portalRight, portalApex); + leftIndex = apexIndex; + rightIndex = apexIndex; + + // Restart + i = apexIndex; + + continue; + } + } + + // Left vertex. + if (dtTriArea2D(portalApex, portalLeft, left) >= 0.0f) + { + if (dtVequal(portalApex, portalLeft) || dtTriArea2D(portalApex, portalRight, left) < 0.0f) + { + dtVcopy(portalLeft, left); + leftPolyRef = (i+1 < pathSize) ? path[i+1] : 0; + leftPolyType = toType; + leftIndex = i; + } + else + { + dtVcopy(portalApex, portalRight); + apexIndex = rightIndex; + + unsigned char flags = 0; + if (!rightPolyRef) + flags = DT_STRAIGHTPATH_END; + else if (rightPolyType == DT_POLYTYPE_OFFMESH_CONNECTION) + flags = DT_STRAIGHTPATH_OFFMESH_CONNECTION; + dtPolyRef ref = rightPolyRef; + + if (!dtVequal(&straightPath[(n-1)*3], portalApex)) + { + // Append new vertex. + dtVcopy(&straightPath[n*3], portalApex); + if (straightPathFlags) + straightPathFlags[n] = flags; + if (straightPathRefs) + straightPathRefs[n] = ref; + n++; + // If reached end of path or there is no space to append more vertices, return. + if (flags == DT_STRAIGHTPATH_END || n >= maxStraightPath) + { + *straightPathCount = n; + return DT_SUCCESS; + } + } + else + { + // The vertices are equal, update flags and poly. + if (straightPathFlags) + straightPathFlags[n-1] = flags; + if (straightPathRefs) + straightPathRefs[n-1] = ref; + } + + dtVcopy(portalLeft, portalApex); + dtVcopy(portalRight, portalApex); + leftIndex = apexIndex; + rightIndex = apexIndex; + + // Restart + i = apexIndex; + + continue; + } + } + } + } + + // If the point already exists, remove it and add reappend the actual end location. + if (n > 0 && dtVequal(&straightPath[(n-1)*3], closestEndPos)) + n--; + + // Add end point. + if (n < maxStraightPath) + { + dtVcopy(&straightPath[n*3], closestEndPos); + if (straightPathFlags) + straightPathFlags[n] = DT_STRAIGHTPATH_END; + if (straightPathRefs) + straightPathRefs[n] = 0; + n++; + } + + *straightPathCount = n; + return DT_SUCCESS; +} + +dtStatus dtNavMeshQuery::moveAlongSurface(dtPolyRef startRef, const float* startPos, const float* endPos, + const dtQueryFilter* filter, + float* resultPos, dtPolyRef* visited, int* visitedCount, const int maxVisitedSize) const +{ + dtAssert(m_nav); + dtAssert(m_tinyNodePool); + + *visitedCount = 0; + + // Validate input + if (!startRef) return DT_FAILURE; + if (!m_nav->isValidPolyRef(startRef)) return DT_FAILURE; + + static const int MAX_STACK = 48; + dtNode* stack[MAX_STACK]; + int nstack = 0; + + m_tinyNodePool->clear(); + + dtNode* startNode = m_tinyNodePool->getNode(startRef); + startNode->pidx = 0; + startNode->cost = 0; + startNode->total = 0; + startNode->id = startRef; + startNode->flags = DT_NODE_CLOSED; + stack[nstack++] = startNode; + + float bestPos[3]; + float bestDist = FLT_MAX; + dtNode* bestNode = 0; + dtVcopy(bestPos, startPos); + + // Search constraints + float searchPos[3], searchRadSqr; + dtVlerp(searchPos, startPos, endPos, 0.5f); + searchRadSqr = dtSqr(dtVdist(startPos, endPos)/2.0f + 0.001f); + + float verts[DT_VERTS_PER_POLYGON*3]; + + while (nstack) + { + // Pop front. + dtNode* curNode = stack[0]; + for (int i = 0; i < nstack-1; ++i) + stack[i] = stack[i+1]; + nstack--; + + // Get poly and tile. + // The API input has been cheked already, skip checking internal data. + const dtPolyRef curRef = curNode->id; + const dtMeshTile* curTile = 0; + const dtPoly* curPoly = 0; + m_nav->getTileAndPolyByRefUnsafe(curRef, &curTile, &curPoly); + + // Collect vertices. + const int nverts = curPoly->vertCount; + for (int i = 0; i < nverts; ++i) + dtVcopy(&verts[i*3], &curTile->verts[curPoly->verts[i]*3]); + + // If target is inside the poly, stop search. + if (dtPointInPolygon(endPos, verts, nverts)) + { + bestNode = curNode; + dtVcopy(bestPos, endPos); + break; + } + + // Find wall edges and find nearest point inside the walls. + for (int i = 0, j = (int)curPoly->vertCount-1; i < (int)curPoly->vertCount; j = i++) + { + // Find links to neighbours. + static const int MAX_NEIS = 8; + int nneis = 0; + dtPolyRef neis[MAX_NEIS]; + + if (curPoly->neis[j] & DT_EXT_LINK) + { + // Tile border. + for (unsigned int k = curPoly->firstLink; k != DT_NULL_LINK; k = curTile->links[k].next) + { + const dtLink* link = &curTile->links[k]; + if (link->edge == j) + { + if (link->ref != 0) + { + const dtMeshTile* neiTile = 0; + const dtPoly* neiPoly = 0; + m_nav->getTileAndPolyByRefUnsafe(link->ref, &neiTile, &neiPoly); + if (filter->passFilter(link->ref, neiTile, neiPoly)) + { + if (nneis < MAX_NEIS) + neis[nneis++] = link->ref; + } + } + } + } + } + else if (curPoly->neis[j]) + { + const unsigned int idx = (unsigned int)(curPoly->neis[j]-1); + const dtPolyRef ref = m_nav->getPolyRefBase(curTile) | idx; + if (filter->passFilter(ref, curTile, &curTile->polys[idx])) + { + // Internal edge, encode id. + neis[nneis++] = ref; + } + } + + if (!nneis) + { + // Wall edge, calc distance. + const float* vj = &verts[j*3]; + const float* vi = &verts[i*3]; + float tseg; + const float distSqr = dtDistancePtSegSqr2D(endPos, vj, vi, tseg); + if (distSqr < bestDist) + { + // Update nearest distance. + dtVlerp(bestPos, vj,vi, tseg); + bestDist = distSqr; + bestNode = curNode; + } + } + else + { + for (int k = 0; k < nneis; ++k) + { + // Skip if no node can be allocated. + dtNode* neighbourNode = m_tinyNodePool->getNode(neis[k]); + if (!neighbourNode) + continue; + // Skip if already visited. + if (neighbourNode->flags & DT_NODE_CLOSED) + continue; + + // Skip the link if it is too far from search constraint. + // TODO: Maybe should use getPortalPoints(), but this one is way faster. + const float* vj = &verts[j*3]; + const float* vi = &verts[i*3]; + float tseg; + float distSqr = dtDistancePtSegSqr2D(searchPos, vj, vi, tseg); + if (distSqr > searchRadSqr) + continue; + + // Mark as the node as visited and push to queue. + if (nstack < MAX_STACK) + { + neighbourNode->pidx = m_tinyNodePool->getNodeIdx(curNode); + neighbourNode->flags |= DT_NODE_CLOSED; + stack[nstack++] = neighbourNode; + } + } + } + } + } + + int n = 0; + if (bestNode) + { + // Reverse the path. + dtNode* prev = 0; + dtNode* node = bestNode; + do + { + dtNode* next = m_tinyNodePool->getNodeAtIdx(node->pidx); + node->pidx = m_tinyNodePool->getNodeIdx(prev); + prev = node; + node = next; + } + while (node); + + // Store result + node = prev; + do + { + visited[n++] = node->id; + node = m_tinyNodePool->getNodeAtIdx(node->pidx); + } + while (node && n < maxVisitedSize); + } + + dtVcopy(resultPos, bestPos); + + *visitedCount = n; + + return DT_SUCCESS; +} + + +dtStatus dtNavMeshQuery::getPortalPoints(dtPolyRef from, dtPolyRef to, float* left, float* right, + unsigned char& fromType, unsigned char& toType) const +{ + dtAssert(m_nav); + + const dtMeshTile* fromTile = 0; + const dtPoly* fromPoly = 0; + if (m_nav->getTileAndPolyByRef(from, &fromTile, &fromPoly) != DT_SUCCESS) + return DT_FAILURE; + fromType = fromPoly->getType(); + + const dtMeshTile* toTile = 0; + const dtPoly* toPoly = 0; + if (m_nav->getTileAndPolyByRef(to, &toTile, &toPoly) != DT_SUCCESS) + return DT_FAILURE; + toType = toPoly->getType(); + + return getPortalPoints(from, fromPoly, fromTile, to, toPoly, toTile, left, right); +} + +// Returns portal points between two polygons. +dtStatus dtNavMeshQuery::getPortalPoints(dtPolyRef from, const dtPoly* fromPoly, const dtMeshTile* fromTile, + dtPolyRef to, const dtPoly* toPoly, const dtMeshTile* toTile, + float* left, float* right) const +{ + // Find the link that points to the 'to' polygon. + const dtLink* link = 0; + for (unsigned int i = fromPoly->firstLink; i != DT_NULL_LINK; i = fromTile->links[i].next) + { + if (fromTile->links[i].ref == to) + { + link = &fromTile->links[i]; + break; + } + } + if (!link) + return DT_FAILURE; + + // Handle off-mesh connections. + if (fromPoly->getType() == DT_POLYTYPE_OFFMESH_CONNECTION) + { + // Find link that points to first vertex. + for (unsigned int i = fromPoly->firstLink; i != DT_NULL_LINK; i = fromTile->links[i].next) + { + if (fromTile->links[i].ref == to) + { + const int v = fromTile->links[i].edge; + dtVcopy(left, &fromTile->verts[fromPoly->verts[v]*3]); + dtVcopy(right, &fromTile->verts[fromPoly->verts[v]*3]); + return DT_SUCCESS; + } + } + return DT_FAILURE; + } + + if (toPoly->getType() == DT_POLYTYPE_OFFMESH_CONNECTION) + { + for (unsigned int i = toPoly->firstLink; i != DT_NULL_LINK; i = toTile->links[i].next) + { + if (toTile->links[i].ref == from) + { + const int v = toTile->links[i].edge; + dtVcopy(left, &toTile->verts[toPoly->verts[v]*3]); + dtVcopy(right, &toTile->verts[toPoly->verts[v]*3]); + return DT_SUCCESS; + } + } + return DT_FAILURE; + } + + // Find portal vertices. + const int v0 = fromPoly->verts[link->edge]; + const int v1 = fromPoly->verts[(link->edge+1) % (int)fromPoly->vertCount]; + dtVcopy(left, &fromTile->verts[v0*3]); + dtVcopy(right, &fromTile->verts[v1*3]); + + // If the link is at tile boundary, dtClamp the vertices to + // the link width. + if (link->side != 0xff) + { + // Unpack portal limits. + if (link->bmin != 0 || link->bmax != 255) + { + const float s = 1.0f/255.0f; + const float tmin = link->bmin*s; + const float tmax = link->bmax*s; + dtVlerp(left, &fromTile->verts[v0*3], &fromTile->verts[v1*3], tmin); + dtVlerp(right, &fromTile->verts[v0*3], &fromTile->verts[v1*3], tmax); + } + } + + return DT_SUCCESS; +} + +// Returns edge mid point between two polygons. +dtStatus dtNavMeshQuery::getEdgeMidPoint(dtPolyRef from, dtPolyRef to, float* mid) const +{ + float left[3], right[3]; + unsigned char fromType, toType; + if (!getPortalPoints(from, to, left,right, fromType, toType)) return DT_FAILURE; + mid[0] = (left[0]+right[0])*0.5f; + mid[1] = (left[1]+right[1])*0.5f; + mid[2] = (left[2]+right[2])*0.5f; + return DT_SUCCESS; +} + +dtStatus dtNavMeshQuery::getEdgeMidPoint(dtPolyRef from, const dtPoly* fromPoly, const dtMeshTile* fromTile, + dtPolyRef to, const dtPoly* toPoly, const dtMeshTile* toTile, + float* mid) const +{ + float left[3], right[3]; + if (getPortalPoints(from, fromPoly, fromTile, to, toPoly, toTile, left, right) != DT_SUCCESS) + return DT_FAILURE; + mid[0] = (left[0]+right[0])*0.5f; + mid[1] = (left[1]+right[1])*0.5f; + mid[2] = (left[2]+right[2])*0.5f; + return DT_SUCCESS; +} + +dtStatus dtNavMeshQuery::raycast(dtPolyRef startRef, const float* startPos, const float* endPos, + const dtQueryFilter* filter, + float* t, float* hitNormal, dtPolyRef* path, int* pathCount, const int maxPath) const +{ + dtAssert(m_nav); + + *t = 0; + if (pathCount) + *pathCount = 0; + + // Validate input + if (!startRef || !m_nav->isValidPolyRef(startRef)) + return DT_FAILURE; + + dtPolyRef curRef = startRef; + float verts[DT_VERTS_PER_POLYGON*3]; + int n = 0; + + hitNormal[0] = 0; + hitNormal[1] = 0; + hitNormal[2] = 0; + + while (curRef) + { + // Cast ray against current polygon. + + // The API input has been cheked already, skip checking internal data. + const dtMeshTile* tile = 0; + const dtPoly* poly = 0; + m_nav->getTileAndPolyByRefUnsafe(curRef, &tile, &poly); + + // Collect vertices. + int nv = 0; + for (int i = 0; i < (int)poly->vertCount; ++i) + { + dtVcopy(&verts[nv*3], &tile->verts[poly->verts[i]*3]); + nv++; + } + + float tmin, tmax; + int segMin, segMax; + if (!dtIntersectSegmentPoly2D(startPos, endPos, verts, nv, tmin, tmax, segMin, segMax)) + { + // Could not hit the polygon, keep the old t and report hit. + if (pathCount) + *pathCount = n; + return DT_SUCCESS; + } + // Keep track of furthest t so far. + if (tmax > *t) + *t = tmax; + + // Store visited polygons. + if (n < maxPath) + path[n++] = curRef; + + // Ray end is completely inside the polygon. + if (segMax == -1) + { + *t = FLT_MAX; + if (pathCount) + *pathCount = n; + return DT_SUCCESS; + } + + // Follow neighbours. + dtPolyRef nextRef = 0; + + for (unsigned int i = poly->firstLink; i != DT_NULL_LINK; i = tile->links[i].next) + { + const dtLink* link = &tile->links[i]; + + // Find link which contains this edge. + if ((int)link->edge != segMax) + continue; + + // Get pointer to the next polygon. + const dtMeshTile* nextTile = 0; + const dtPoly* nextPoly = 0; + m_nav->getTileAndPolyByRefUnsafe(link->ref, &nextTile, &nextPoly); + + // Skip off-mesh connections. + if (nextPoly->getType() == DT_POLYTYPE_OFFMESH_CONNECTION) + continue; + + // Skip links based on filter. + if (!filter->passFilter(link->ref, nextTile, nextPoly)) + continue; + + // If the link is internal, just return the ref. + if (link->side == 0xff) + { + nextRef = link->ref; + break; + } + + // If the link is at tile boundary, + + // Check if the link spans the whole edge, and accept. + if (link->bmin == 0 && link->bmax == 255) + { + nextRef = link->ref; + break; + } + + // Check for partial edge links. + const int v0 = poly->verts[link->edge]; + const int v1 = poly->verts[(link->edge+1) % poly->vertCount]; + const float* left = &tile->verts[v0*3]; + const float* right = &tile->verts[v1*3]; + + // Check that the intersection lies inside the link portal. + if (link->side == 0 || link->side == 4) + { + // Calculate link size. + const float s = 1.0f/255.0f; + float lmin = left[2] + (right[2] - left[2])*(link->bmin*s); + float lmax = left[2] + (right[2] - left[2])*(link->bmax*s); + if (lmin > lmax) dtSwap(lmin, lmax); + + // Find Z intersection. + float z = startPos[2] + (endPos[2]-startPos[2])*tmax; + if (z >= lmin && z <= lmax) + { + nextRef = link->ref; + break; + } + } + else if (link->side == 2 || link->side == 6) + { + // Calculate link size. + const float s = 1.0f/255.0f; + float lmin = left[0] + (right[0] - left[0])*(link->bmin*s); + float lmax = left[0] + (right[0] - left[0])*(link->bmax*s); + if (lmin > lmax) dtSwap(lmin, lmax); + + // Find X intersection. + float x = startPos[0] + (endPos[0]-startPos[0])*tmax; + if (x >= lmin && x <= lmax) + { + nextRef = link->ref; + break; + } + } + } + + if (!nextRef) + { + // No neighbour, we hit a wall. + + // Calculate hit normal. + const int a = segMax; + const int b = segMax+1 < nv ? segMax+1 : 0; + const float* va = &verts[a*3]; + const float* vb = &verts[b*3]; + const float dx = vb[0] - va[0]; + const float dz = vb[2] - va[2]; + hitNormal[0] = dz; + hitNormal[1] = 0; + hitNormal[2] = -dx; + dtVnormalize(hitNormal); + + if (pathCount) + *pathCount = n; + return DT_SUCCESS; + } + + // No hit, advance to neighbour polygon. + curRef = nextRef; + } + + if (pathCount) + *pathCount = n; + + return DT_SUCCESS; +} + +dtStatus dtNavMeshQuery::findPolysAroundCircle(dtPolyRef startRef, const float* centerPos, const float radius, + const dtQueryFilter* filter, + dtPolyRef* resultRef, dtPolyRef* resultParent, float* resultCost, + int* resultCount, const int maxResult) const +{ + dtAssert(m_nav); + dtAssert(m_nodePool); + dtAssert(m_openList); + + *resultCount = 0; + + // Validate input + if (!startRef) return DT_FAILURE; + if (!m_nav->isValidPolyRef(startRef)) return DT_FAILURE; + + m_nodePool->clear(); + m_openList->clear(); + + dtNode* startNode = m_nodePool->getNode(startRef); + dtVcopy(startNode->pos, centerPos); + startNode->pidx = 0; + startNode->cost = 0; + startNode->total = 0; + startNode->id = startRef; + startNode->flags = DT_NODE_OPEN; + m_openList->push(startNode); + + int n = 0; + if (n < maxResult) + { + if (resultRef) + resultRef[n] = startNode->id; + if (resultParent) + resultParent[n] = 0; + if (resultCost) + resultCost[n] = 0; + ++n; + } + + const float radiusSqr = dtSqr(radius); + + while (!m_openList->empty()) + { + dtNode* bestNode = m_openList->pop(); + bestNode->flags &= ~DT_NODE_OPEN; + bestNode->flags |= DT_NODE_CLOSED; + + // Get poly and tile. + // The API input has been cheked already, skip checking internal data. + const dtPolyRef bestRef = bestNode->id; + const dtMeshTile* bestTile = 0; + const dtPoly* bestPoly = 0; + m_nav->getTileAndPolyByRefUnsafe(bestRef, &bestTile, &bestPoly); + + // Get parent poly and tile. + dtPolyRef parentRef = 0; + const dtMeshTile* parentTile = 0; + const dtPoly* parentPoly = 0; + if (bestNode->pidx) + parentRef = m_nodePool->getNodeAtIdx(bestNode->pidx)->id; + if (parentRef) + m_nav->getTileAndPolyByRefUnsafe(parentRef, &parentTile, &parentPoly); + + for (unsigned int i = bestPoly->firstLink; i != DT_NULL_LINK; i = bestTile->links[i].next) + { + const dtLink* link = &bestTile->links[i]; + dtPolyRef neighbourRef = link->ref; + // Skip invalid neighbours and do not follow back to parent. + if (!neighbourRef || neighbourRef == parentRef) + continue; + + // Expand to neighbour + const dtMeshTile* neighbourTile = 0; + const dtPoly* neighbourPoly = 0; + m_nav->getTileAndPolyByRefUnsafe(neighbourRef, &neighbourTile, &neighbourPoly); + + // Do not advance if the polygon is excluded by the filter. + if (!filter->passFilter(neighbourRef, neighbourTile, neighbourPoly)) + continue; + + // Find edge and calc distance to the edge. + float va[3], vb[3]; + if (!getPortalPoints(bestRef, bestPoly, bestTile, neighbourRef, neighbourPoly, neighbourTile, va, vb)) + continue; + + // If the circle is not touching the next polygon, skip it. + float tseg; + float distSqr = dtDistancePtSegSqr2D(centerPos, va, vb, tseg); + if (distSqr > radiusSqr) + continue; + + dtNode* neighbourNode = m_nodePool->getNode(neighbourRef); + if (!neighbourNode) + continue; + + if (neighbourNode->flags & DT_NODE_CLOSED) + continue; + + // Cost + if (neighbourNode->flags == 0) + dtVlerp(neighbourNode->pos, va, vb, 0.5f); + + const float total = bestNode->total + dtVdist(bestNode->pos, neighbourNode->pos); + + // The node is already in open list and the new result is worse, skip. + if ((neighbourNode->flags & DT_NODE_OPEN) && total >= neighbourNode->total) + continue; + + neighbourNode->id = neighbourRef; + neighbourNode->flags &= ~DT_NODE_CLOSED; + neighbourNode->pidx = m_nodePool->getNodeIdx(bestNode); + neighbourNode->total = total; + + if (neighbourNode->flags & DT_NODE_OPEN) + { + m_openList->modify(neighbourNode); + } + else + { + if (n < maxResult) + { + if (resultRef) + resultRef[n] = neighbourNode->id; + if (resultParent) + resultParent[n] = m_nodePool->getNodeAtIdx(neighbourNode->pidx)->id; + if (resultCost) + resultCost[n] = neighbourNode->total; + ++n; + } + neighbourNode->flags = DT_NODE_OPEN; + m_openList->push(neighbourNode); + } + } + } + + *resultCount = n; + + return DT_SUCCESS; +} + +dtStatus dtNavMeshQuery::findPolysAroundShape(dtPolyRef startRef, const float* verts, const int nverts, + const dtQueryFilter* filter, + dtPolyRef* resultRef, dtPolyRef* resultParent, float* resultCost, + int* resultCount, const int maxResult) const +{ + dtAssert(m_nav); + dtAssert(m_nodePool); + dtAssert(m_openList); + + *resultCount = 0; + + // Validate input + if (!startRef) return DT_FAILURE; + if (!m_nav->isValidPolyRef(startRef)) return DT_FAILURE; + + m_nodePool->clear(); + m_openList->clear(); + + float centerPos[3] = {0,0,0}; + for (int i = 0; i < nverts; ++i) + dtVadd(centerPos,centerPos,&verts[i*3]); + dtVscale(centerPos,centerPos,1.0f/nverts); + + dtNode* startNode = m_nodePool->getNode(startRef); + dtVcopy(startNode->pos, centerPos); + startNode->pidx = 0; + startNode->cost = 0; + startNode->total = 0; + startNode->id = startRef; + startNode->flags = DT_NODE_OPEN; + m_openList->push(startNode); + + int n = 0; + if (n < maxResult) + { + if (resultRef) + resultRef[n] = startNode->id; + if (resultParent) + resultParent[n] = 0; + if (resultCost) + resultCost[n] = 0; + ++n; + } + + while (!m_openList->empty()) + { + dtNode* bestNode = m_openList->pop(); + bestNode->flags &= ~DT_NODE_OPEN; + bestNode->flags |= DT_NODE_CLOSED; + + // Get poly and tile. + // The API input has been cheked already, skip checking internal data. + const dtPolyRef bestRef = bestNode->id; + const dtMeshTile* bestTile = 0; + const dtPoly* bestPoly = 0; + m_nav->getTileAndPolyByRefUnsafe(bestRef, &bestTile, &bestPoly); + + // Get parent poly and tile. + dtPolyRef parentRef = 0; + const dtMeshTile* parentTile = 0; + const dtPoly* parentPoly = 0; + if (bestNode->pidx) + parentRef = m_nodePool->getNodeAtIdx(bestNode->pidx)->id; + if (parentRef) + m_nav->getTileAndPolyByRefUnsafe(parentRef, &parentTile, &parentPoly); + + for (unsigned int i = bestPoly->firstLink; i != DT_NULL_LINK; i = bestTile->links[i].next) + { + const dtLink* link = &bestTile->links[i]; + dtPolyRef neighbourRef = link->ref; + // Skip invalid neighbours and do not follow back to parent. + if (!neighbourRef || neighbourRef == parentRef) + continue; + + // Expand to neighbour + const dtMeshTile* neighbourTile = 0; + const dtPoly* neighbourPoly = 0; + m_nav->getTileAndPolyByRefUnsafe(neighbourRef, &neighbourTile, &neighbourPoly); + + // Do not advance if the polygon is excluded by the filter. + if (!filter->passFilter(neighbourRef, neighbourTile, neighbourPoly)) + continue; + + // Find edge and calc distance to the edge. + float va[3], vb[3]; + if (!getPortalPoints(bestRef, bestPoly, bestTile, neighbourRef, neighbourPoly, neighbourTile, va, vb)) + continue; + + // If the poly is not touching the edge to the next polygon, skip the connection it. + float tmin, tmax; + int segMin, segMax; + if (!dtIntersectSegmentPoly2D(va, vb, verts, nverts, tmin, tmax, segMin, segMax)) + continue; + if (tmin > 1.0f || tmax < 0.0f) + continue; + + dtNode* neighbourNode = m_nodePool->getNode(neighbourRef); + if (!neighbourNode) + continue; + + if (neighbourNode->flags & DT_NODE_CLOSED) + continue; + + // Cost + if (neighbourNode->flags == 0) + dtVlerp(neighbourNode->pos, va, vb, 0.5f); + + const float total = bestNode->total + dtVdist(bestNode->pos, neighbourNode->pos); + + // The node is already in open list and the new result is worse, skip. + if ((neighbourNode->flags & DT_NODE_OPEN) && total >= neighbourNode->total) + continue; + + neighbourNode->id = neighbourRef; + neighbourNode->flags &= ~DT_NODE_CLOSED; + neighbourNode->pidx = m_nodePool->getNodeIdx(bestNode); + neighbourNode->total = total; + + if (neighbourNode->flags & DT_NODE_OPEN) + { + m_openList->modify(neighbourNode); + } + else + { + if (n < maxResult) + { + if (resultRef) + resultRef[n] = neighbourNode->id; + if (resultParent) + resultParent[n] = m_nodePool->getNodeAtIdx(neighbourNode->pidx)->id; + if (resultCost) + resultCost[n] = neighbourNode->total; + ++n; + } + neighbourNode->flags = DT_NODE_OPEN; + m_openList->push(neighbourNode); + } + } + } + + *resultCount = n; + + return DT_SUCCESS; +} + +dtStatus dtNavMeshQuery::findLocalNeighbourhood(dtPolyRef startRef, const float* centerPos, const float radius, + const dtQueryFilter* filter, + dtPolyRef* resultRef, dtPolyRef* resultParent, + int* resultCount, const int maxResult) const +{ + dtAssert(m_nav); + dtAssert(m_tinyNodePool); + + *resultCount = 0; + + // Validate input + if (!startRef) return DT_FAILURE; + if (!m_nav->isValidPolyRef(startRef)) return DT_FAILURE; + + static const int MAX_STACK = 48; + dtNode* stack[MAX_STACK]; + int nstack = 0; + + m_tinyNodePool->clear(); + + dtNode* startNode = m_tinyNodePool->getNode(startRef); + startNode->pidx = 0; + startNode->id = startRef; + startNode->flags = DT_NODE_CLOSED; + stack[nstack++] = startNode; + + const float radiusSqr = dtSqr(radius); + + float pa[DT_VERTS_PER_POLYGON*3]; + float pb[DT_VERTS_PER_POLYGON*3]; + + int n = 0; + if (n < maxResult) + { + resultRef[n] = startNode->id; + if (resultParent) + resultParent[n] = 0; + ++n; + } + + while (nstack) + { + // Pop front. + dtNode* curNode = stack[0]; + for (int i = 0; i < nstack-1; ++i) + stack[i] = stack[i+1]; + nstack--; + + // Get poly and tile. + // The API input has been cheked already, skip checking internal data. + const dtPolyRef curRef = curNode->id; + const dtMeshTile* curTile = 0; + const dtPoly* curPoly = 0; + m_nav->getTileAndPolyByRefUnsafe(curRef, &curTile, &curPoly); + + for (unsigned int i = curPoly->firstLink; i != DT_NULL_LINK; i = curTile->links[i].next) + { + const dtLink* link = &curTile->links[i]; + dtPolyRef neighbourRef = link->ref; + // Skip invalid neighbours. + if (!neighbourRef) + continue; + + // Skip if cannot alloca more nodes. + dtNode* neighbourNode = m_tinyNodePool->getNode(neighbourRef); + if (!neighbourNode) + continue; + // Skip visited. + if (neighbourNode->flags & DT_NODE_CLOSED) + continue; + + // Expand to neighbour + const dtMeshTile* neighbourTile = 0; + const dtPoly* neighbourPoly = 0; + m_nav->getTileAndPolyByRefUnsafe(neighbourRef, &neighbourTile, &neighbourPoly); + + // Skip off-mesh connections. + if (neighbourPoly->getType() == DT_POLYTYPE_OFFMESH_CONNECTION) + continue; + + // Do not advance if the polygon is excluded by the filter. + if (!filter->passFilter(neighbourRef, neighbourTile, neighbourPoly)) + continue; + + // Find edge and calc distance to the edge. + float va[3], vb[3]; + if (!getPortalPoints(curRef, curPoly, curTile, neighbourRef, neighbourPoly, neighbourTile, va, vb)) + continue; + + // If the circle is not touching the next polygon, skip it. + float tseg; + float distSqr = dtDistancePtSegSqr2D(centerPos, va, vb, tseg); + if (distSqr > radiusSqr) + continue; + + // Mark node visited, this is done before the overlap test so that + // we will not visit the poly again if the test fails. + neighbourNode->flags |= DT_NODE_CLOSED; + neighbourNode->pidx = m_tinyNodePool->getNodeIdx(curNode); + + // Check that the polygon does not collide with existing polygons. + + // Collect vertices of the neighbour poly. + const int npa = neighbourPoly->vertCount; + for (int k = 0; k < npa; ++k) + dtVcopy(&pa[k*3], &neighbourTile->verts[neighbourPoly->verts[k]*3]); + + bool overlap = false; + for (int j = 0; j < n; ++j) + { + dtPolyRef pastRef = resultRef[j]; + + // Connected polys do not overlap. + bool connected = false; + for (unsigned int k = curPoly->firstLink; k != DT_NULL_LINK; k = curTile->links[k].next) + { + if (curTile->links[k].ref == pastRef) + { + connected = true; + break; + } + } + if (connected) + continue; + + // Potentially overlapping. + const dtMeshTile* pastTile = 0; + const dtPoly* pastPoly = 0; + m_nav->getTileAndPolyByRefUnsafe(pastRef, &pastTile, &pastPoly); + + // Get vertices and test overlap + const int npb = pastPoly->vertCount; + for (int k = 0; k < npb; ++k) + dtVcopy(&pb[k*3], &pastTile->verts[pastPoly->verts[k]*3]); + + if (dtOverlapPolyPoly2D(pa,npa, pb,npb)) + { + overlap = true; + break; + } + } + if (overlap) + continue; + + // This poly is fine, store and advance to the poly. + if (n < maxResult) + { + resultRef[n] = neighbourRef; + if (resultParent) + resultParent[n] = curRef; + ++n; + } + + if (nstack < MAX_STACK) + { + stack[nstack++] = neighbourNode; + } + } + } + + *resultCount = n; + + return DT_SUCCESS; +} + + +struct dtSegInterval +{ + short tmin, tmax; +}; + +static void insertInterval(dtSegInterval* ints, int& nints, const int maxInts, + const short tmin, const short tmax) +{ + if (nints+1 > maxInts) return; + // Find insertion point. + int idx = 0; + while (idx < nints) + { + if (tmax <= ints[idx].tmin) + break; + idx++; + } + // Move current results. + if (nints-idx) + memmove(ints+idx+1, ints+idx, sizeof(dtSegInterval)*(nints-idx)); + // Store + ints[idx].tmin = tmin; + ints[idx].tmax = tmax; + nints++; +} + +dtStatus dtNavMeshQuery::getPolyWallSegments(dtPolyRef ref, const dtQueryFilter* filter, + float* segments, int* segmentCount, const int maxSegments) const +{ + dtAssert(m_nav); + + *segmentCount = 0; + + const dtMeshTile* tile = 0; + const dtPoly* poly = 0; + if (m_nav->getTileAndPolyByRef(ref, &tile, &poly) != DT_SUCCESS) + return DT_FAILURE; + + int n = 0; + static const int MAX_INTERVAL = 16; + dtSegInterval ints[MAX_INTERVAL]; + int nints; + + for (int i = 0, j = (int)poly->vertCount-1; i < (int)poly->vertCount; j = i++) + { + // Skip non-solid edges. + nints = 0; + if (poly->neis[j] & DT_EXT_LINK) + { + // Tile border. + for (unsigned int k = poly->firstLink; k != DT_NULL_LINK; k = tile->links[k].next) + { + const dtLink* link = &tile->links[k]; + if (link->edge == j) + { + if (link->ref != 0) + { + const dtMeshTile* neiTile = 0; + const dtPoly* neiPoly = 0; + m_nav->getTileAndPolyByRefUnsafe(link->ref, &neiTile, &neiPoly); + if (filter->passFilter(link->ref, neiTile, neiPoly)) + { + insertInterval(ints, nints, MAX_INTERVAL, link->bmin, link->bmax); + } + } + } + } + } + else if (poly->neis[j]) + { + // Internal edge + const unsigned int idx = (unsigned int)(poly->neis[j]-1); + const dtPolyRef ref = m_nav->getPolyRefBase(tile) | idx; + if (filter->passFilter(ref, tile, &tile->polys[idx])) + continue; + } + + // Add sentinels + insertInterval(ints, nints, MAX_INTERVAL, -1, 0); + insertInterval(ints, nints, MAX_INTERVAL, 255, 256); + + // Store segment. + const float* vj = &tile->verts[poly->verts[j]*3]; + const float* vi = &tile->verts[poly->verts[i]*3]; + for (int k = 1; k < nints; ++k) + { + // Find the space inbetween the opening areas. + const int imin = ints[k-1].tmax; + const int imax = ints[k].tmin; + if (imin == imax) continue; + if (imin == 0 && imax == 255) + { + if (n < maxSegments) + { + float* seg = &segments[n*6]; + n++; + dtVcopy(seg+0, vj); + dtVcopy(seg+3, vi); + } + } + else + { + const float tmin = imin/255.0f; + const float tmax = imax/255.0f; + if (n < maxSegments) + { + float* seg = &segments[n*6]; + n++; + dtVlerp(seg+0, vj,vi, tmin); + dtVlerp(seg+3, vj,vi, tmax); + } + } + } + } + + *segmentCount = n; + + return DT_SUCCESS; +} + +dtStatus dtNavMeshQuery::findDistanceToWall(dtPolyRef startRef, const float* centerPos, const float maxRadius, + const dtQueryFilter* filter, + float* hitDist, float* hitPos, float* hitNormal) const +{ + dtAssert(m_nav); + dtAssert(m_nodePool); + dtAssert(m_openList); + + // Validate input + if (!startRef) return DT_FAILURE; + if (!m_nav->isValidPolyRef(startRef)) return DT_FAILURE; + + m_nodePool->clear(); + m_openList->clear(); + + dtNode* startNode = m_nodePool->getNode(startRef); + dtVcopy(startNode->pos, centerPos); + startNode->pidx = 0; + startNode->cost = 0; + startNode->total = 0; + startNode->id = startRef; + startNode->flags = DT_NODE_OPEN; + m_openList->push(startNode); + + float radiusSqr = dtSqr(maxRadius); + + while (!m_openList->empty()) + { + dtNode* bestNode = m_openList->pop(); + bestNode->flags &= ~DT_NODE_OPEN; + bestNode->flags |= DT_NODE_CLOSED; + + // Get poly and tile. + // The API input has been cheked already, skip checking internal data. + const dtPolyRef bestRef = bestNode->id; + const dtMeshTile* bestTile = 0; + const dtPoly* bestPoly = 0; + m_nav->getTileAndPolyByRefUnsafe(bestRef, &bestTile, &bestPoly); + + // Get parent poly and tile. + dtPolyRef parentRef = 0; + const dtMeshTile* parentTile = 0; + const dtPoly* parentPoly = 0; + if (bestNode->pidx) + parentRef = m_nodePool->getNodeAtIdx(bestNode->pidx)->id; + if (parentRef) + m_nav->getTileAndPolyByRefUnsafe(parentRef, &parentTile, &parentPoly); + + // Hit test walls. + for (int i = 0, j = (int)bestPoly->vertCount-1; i < (int)bestPoly->vertCount; j = i++) + { + // Skip non-solid edges. + if (bestPoly->neis[j] & DT_EXT_LINK) + { + // Tile border. + bool solid = true; + for (unsigned int k = bestPoly->firstLink; k != DT_NULL_LINK; k = bestTile->links[k].next) + { + const dtLink* link = &bestTile->links[k]; + if (link->edge == j) + { + if (link->ref != 0) + { + const dtMeshTile* neiTile = 0; + const dtPoly* neiPoly = 0; + m_nav->getTileAndPolyByRefUnsafe(link->ref, &neiTile, &neiPoly); + if (filter->passFilter(link->ref, neiTile, neiPoly)) + solid = false; + } + break; + } + } + if (!solid) continue; + } + else if (bestPoly->neis[j]) + { + // Internal edge + const unsigned int idx = (unsigned int)(bestPoly->neis[j]-1); + const dtPolyRef ref = m_nav->getPolyRefBase(bestTile) | idx; + if (filter->passFilter(ref, bestTile, &bestTile->polys[idx])) + continue; + } + + // Calc distance to the edge. + const float* vj = &bestTile->verts[bestPoly->verts[j]*3]; + const float* vi = &bestTile->verts[bestPoly->verts[i]*3]; + float tseg; + float distSqr = dtDistancePtSegSqr2D(centerPos, vj, vi, tseg); + + // Edge is too far, skip. + if (distSqr > radiusSqr) + continue; + + // Hit wall, update radius. + radiusSqr = distSqr; + // Calculate hit pos. + hitPos[0] = vj[0] + (vi[0] - vj[0])*tseg; + hitPos[1] = vj[1] + (vi[1] - vj[1])*tseg; + hitPos[2] = vj[2] + (vi[2] - vj[2])*tseg; + } + + for (unsigned int i = bestPoly->firstLink; i != DT_NULL_LINK; i = bestTile->links[i].next) + { + const dtLink* link = &bestTile->links[i]; + dtPolyRef neighbourRef = link->ref; + // Skip invalid neighbours and do not follow back to parent. + if (!neighbourRef || neighbourRef == parentRef) + continue; + + // Expand to neighbour. + const dtMeshTile* neighbourTile = 0; + const dtPoly* neighbourPoly = 0; + m_nav->getTileAndPolyByRefUnsafe(neighbourRef, &neighbourTile, &neighbourPoly); + + // Skip off-mesh connections. + if (neighbourPoly->getType() == DT_POLYTYPE_OFFMESH_CONNECTION) + continue; + + // Calc distance to the edge. + const float* va = &bestTile->verts[bestPoly->verts[link->edge]*3]; + const float* vb = &bestTile->verts[bestPoly->verts[(link->edge+1) % bestPoly->vertCount]*3]; + float tseg; + float distSqr = dtDistancePtSegSqr2D(centerPos, va, vb, tseg); + + // If the circle is not touching the next polygon, skip it. + if (distSqr > radiusSqr) + continue; + + if (!filter->passFilter(neighbourRef, neighbourTile, neighbourPoly)) + continue; + + dtNode* neighbourNode = m_nodePool->getNode(neighbourRef); + if (!neighbourNode) + continue; + + if (neighbourNode->flags & DT_NODE_CLOSED) + continue; + + // Cost + if (neighbourNode->flags == 0) + { + getEdgeMidPoint(bestRef, bestPoly, bestTile, + neighbourRef, neighbourPoly, neighbourTile, neighbourNode->pos); + } + + const float total = bestNode->total + dtVdist(bestNode->pos, neighbourNode->pos); + + // The node is already in open list and the new result is worse, skip. + if ((neighbourNode->flags & DT_NODE_OPEN) && total >= neighbourNode->total) + continue; + + neighbourNode->id = neighbourRef; + neighbourNode->flags &= ~DT_NODE_CLOSED; + neighbourNode->pidx = m_nodePool->getNodeIdx(bestNode); + neighbourNode->total = total; + + if (neighbourNode->flags & DT_NODE_OPEN) + { + m_openList->modify(neighbourNode); + } + else + { + neighbourNode->flags |= DT_NODE_OPEN; + m_openList->push(neighbourNode); + } + } + } + + // Calc hit normal. + dtVsub(hitNormal, centerPos, hitPos); + dtVnormalize(hitNormal); + + *hitDist = sqrtf(radiusSqr); + + return DT_SUCCESS; +} + +bool dtNavMeshQuery::isInClosedList(dtPolyRef ref) const +{ + if (!m_nodePool) return false; + const dtNode* node = m_nodePool->findNode(ref); + return node && node->flags & DT_NODE_CLOSED; +} diff --git a/dep/recastnavigation/Detour/Source/DetourNode.cpp b/dep/recastnavigation/Detour/Source/DetourNode.cpp new file mode 100644 index 000000000..0d1af8378 --- /dev/null +++ b/dep/recastnavigation/Detour/Source/DetourNode.cpp @@ -0,0 +1,164 @@ +// +// Copyright (c) 2009-2010 Mikko Mononen memon@inside.org +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. +// + +#include "DetourNode.h" +#include "DetourAlloc.h" +#include "DetourAssert.h" +#include "DetourCommon.h" +#include + +inline unsigned int dtHashRef(dtPolyRef a) +{ + a = (~a) + (a << 18); + a = a ^ (a >> 31); + a = a * 21; + a = a ^ (a >> 11); + a = a + (a << 6); + a = a ^ (a >> 22); + return (unsigned int)a; +} + +////////////////////////////////////////////////////////////////////////////////////////// +dtNodePool::dtNodePool(int maxNodes, int hashSize) : + m_nodes(0), + m_first(0), + m_next(0), + m_maxNodes(maxNodes), + m_hashSize(hashSize), + m_nodeCount(0) +{ + dtAssert(dtNextPow2(m_hashSize) == (unsigned int)m_hashSize); + dtAssert(m_maxNodes > 0); + + m_nodes = (dtNode*)dtAlloc(sizeof(dtNode)*m_maxNodes, DT_ALLOC_PERM); + m_next = (unsigned short*)dtAlloc(sizeof(unsigned short)*m_maxNodes, DT_ALLOC_PERM); + m_first = (unsigned short*)dtAlloc(sizeof(unsigned short)*hashSize, DT_ALLOC_PERM); + + dtAssert(m_nodes); + dtAssert(m_next); + dtAssert(m_first); + + memset(m_first, 0xff, sizeof(unsigned short)*m_hashSize); + memset(m_next, 0xff, sizeof(unsigned short)*m_maxNodes); +} + +dtNodePool::~dtNodePool() +{ + dtFree(m_nodes); + dtFree(m_next); + dtFree(m_first); +} + +void dtNodePool::clear() +{ + memset(m_first, 0xff, sizeof(unsigned short)*m_hashSize); + m_nodeCount = 0; +} + +dtNode* dtNodePool::findNode(dtPolyRef id) +{ + unsigned int bucket = dtHashRef(id) & (m_hashSize-1); + unsigned short i = m_first[bucket]; + while (i != DT_NULL_IDX) + { + if (m_nodes[i].id == id) + return &m_nodes[i]; + i = m_next[i]; + } + return 0; +} + +dtNode* dtNodePool::getNode(dtPolyRef id) +{ + unsigned int bucket = dtHashRef(id) & (m_hashSize-1); + unsigned short i = m_first[bucket]; + dtNode* node = 0; + while (i != DT_NULL_IDX) + { + if (m_nodes[i].id == id) + return &m_nodes[i]; + i = m_next[i]; + } + + if (m_nodeCount >= m_maxNodes) + return 0; + + i = (unsigned short)m_nodeCount; + m_nodeCount++; + + // Init node + node = &m_nodes[i]; + node->pidx = 0; + node->cost = 0; + node->total = 0; + node->id = id; + node->flags = 0; + + m_next[i] = m_first[bucket]; + m_first[bucket] = i; + + return node; +} + + +////////////////////////////////////////////////////////////////////////////////////////// +dtNodeQueue::dtNodeQueue(int n) : + m_heap(0), + m_capacity(n), + m_size(0) +{ + dtAssert(m_capacity > 0); + + m_heap = (dtNode**)dtAlloc(sizeof(dtNode*)*(m_capacity+1), DT_ALLOC_PERM); + dtAssert(m_heap); +} + +dtNodeQueue::~dtNodeQueue() +{ + dtFree(m_heap); +} + +void dtNodeQueue::bubbleUp(int i, dtNode* node) +{ + int parent = (i-1)/2; + // note: (index > 0) means there is a parent + while ((i > 0) && (m_heap[parent]->total > node->total)) + { + m_heap[i] = m_heap[parent]; + i = parent; + parent = (i-1)/2; + } + m_heap[i] = node; +} + +void dtNodeQueue::trickleDown(int i, dtNode* node) +{ + int child = (i*2)+1; + while (child < m_size) + { + if (((child+1) < m_size) && + (m_heap[child]->total > m_heap[child+1]->total)) + { + child++; + } + m_heap[i] = m_heap[child]; + i = child; + child = (i*2)+1; + } + bubbleUp(i, node); +} diff --git a/dep/recastnavigation/Detour/Source/DetourObstacleAvoidance.cpp b/dep/recastnavigation/Detour/Source/DetourObstacleAvoidance.cpp new file mode 100644 index 000000000..a255c9b3f --- /dev/null +++ b/dep/recastnavigation/Detour/Source/DetourObstacleAvoidance.cpp @@ -0,0 +1,532 @@ +// +// Copyright (c) 2009-2010 Mikko Mononen memon@inside.org +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. +// + +#include "DetourObstacleAvoidance.h" +#include "DetourCommon.h" +#include "DetourAlloc.h" +#include "DetourAssert.h" +#include +#include +#include +#include + + +static int sweepCircleCircle(const float* c0, const float r0, const float* v, + const float* c1, const float r1, + float& tmin, float& tmax) +{ + static const float EPS = 0.0001f; + float s[3]; + dtVsub(s,c1,c0); + float r = r0+r1; + float c = dtVdot2D(s,s) - r*r; + float a = dtVdot2D(v,v); + if (a < EPS) return 0; // not moving + + // Overlap, calc time to exit. + float b = dtVdot2D(v,s); + float d = b*b - a*c; + if (d < 0.0f) return 0; // no intersection. + a = 1.0f / a; + const float rd = dtSqrt(d); + tmin = (b - rd) * a; + tmax = (b + rd) * a; + return 1; +} + +static int isectRaySeg(const float* ap, const float* u, + const float* bp, const float* bq, + float& t) +{ + float v[3], w[3]; + dtVsub(v,bq,bp); + dtVsub(w,ap,bp); + float d = dtVperp2D(u,v); + if (fabsf(d) < 1e-6f) return 0; + d = 1.0f/d; + t = dtVperp2D(v,w) * d; + if (t < 0 || t > 1) return 0; + float s = dtVperp2D(u,w) * d; + if (s < 0 || s > 1) return 0; + return 1; +} + + + +dtObstacleAvoidanceDebugData* dtAllocObstacleAvoidanceDebugData() +{ + void* mem = dtAlloc(sizeof(dtObstacleAvoidanceDebugData), DT_ALLOC_PERM); + if (!mem) return 0; + return new(mem) dtObstacleAvoidanceDebugData; +} + +void dtFreeObstacleAvoidanceDebugData(dtObstacleAvoidanceDebugData* ptr) +{ + if (!ptr) return; + ptr->~dtObstacleAvoidanceDebugData(); + dtFree(ptr); +} + + +dtObstacleAvoidanceDebugData::dtObstacleAvoidanceDebugData() : + m_nsamples(0), + m_maxSamples(0), + m_vel(0), + m_ssize(0), + m_pen(0), + m_vpen(0), + m_vcpen(0), + m_spen(0), + m_tpen(0) +{ +} + +dtObstacleAvoidanceDebugData::~dtObstacleAvoidanceDebugData() +{ + dtFree(m_vel); + dtFree(m_ssize); + dtFree(m_pen); + dtFree(m_vpen); + dtFree(m_vcpen); + dtFree(m_spen); + dtFree(m_tpen); +} + +bool dtObstacleAvoidanceDebugData::init(const int maxSamples) +{ + dtAssert(maxSamples); + m_maxSamples = maxSamples; + + m_vel = (float*)dtAlloc(sizeof(float)*3*m_maxSamples, DT_ALLOC_PERM); + if (!m_vel) + return false; + m_pen = (float*)dtAlloc(sizeof(float)*m_maxSamples, DT_ALLOC_PERM); + if (!m_pen) + return false; + m_ssize = (float*)dtAlloc(sizeof(float)*m_maxSamples, DT_ALLOC_PERM); + if (!m_ssize) + return false; + m_vpen = (float*)dtAlloc(sizeof(float)*m_maxSamples, DT_ALLOC_PERM); + if (!m_vpen) + return false; + m_vcpen = (float*)dtAlloc(sizeof(float)*m_maxSamples, DT_ALLOC_PERM); + if (!m_vcpen) + return false; + m_spen = (float*)dtAlloc(sizeof(float)*m_maxSamples, DT_ALLOC_PERM); + if (!m_spen) + return false; + m_tpen = (float*)dtAlloc(sizeof(float)*m_maxSamples, DT_ALLOC_PERM); + if (!m_tpen) + return false; + + return true; +} + +void dtObstacleAvoidanceDebugData::reset() +{ + m_nsamples = 0; +} + +void dtObstacleAvoidanceDebugData::addSample(const float* vel, const float ssize, const float pen, + const float vpen, const float vcpen, const float spen, const float tpen) +{ + if (m_nsamples >= m_maxSamples) + return; + dtAssert(m_vel); + dtAssert(m_ssize); + dtAssert(m_pen); + dtAssert(m_vpen); + dtAssert(m_vcpen); + dtAssert(m_spen); + dtAssert(m_tpen); + dtVcopy(&m_vel[m_nsamples*3], vel); + m_ssize[m_nsamples] = ssize; + m_pen[m_nsamples] = pen; + m_vpen[m_nsamples] = vpen; + m_vcpen[m_nsamples] = vcpen; + m_spen[m_nsamples] = spen; + m_tpen[m_nsamples] = tpen; + m_nsamples++; +} + +static void normalizeArray(float* arr, const int n) +{ + // Normalize penaly range. + float minPen = FLT_MAX; + float maxPen = -FLT_MAX; + for (int i = 0; i < n; ++i) + { + minPen = dtMin(minPen, arr[i]); + maxPen = dtMax(maxPen, arr[i]); + } + const float penRange = maxPen-minPen; + const float s = penRange > 0.001f ? (1.0f / penRange) : 1; + for (int i = 0; i < n; ++i) + arr[i] = dtClamp((arr[i]-minPen)*s, 0.0f, 1.0f); +} + +void dtObstacleAvoidanceDebugData::normalizeSamples() +{ + normalizeArray(m_pen, m_nsamples); + normalizeArray(m_vpen, m_nsamples); + normalizeArray(m_vcpen, m_nsamples); + normalizeArray(m_spen, m_nsamples); + normalizeArray(m_tpen, m_nsamples); +} + + +dtObstacleAvoidanceQuery* dtAllocObstacleAvoidanceQuery() +{ + void* mem = dtAlloc(sizeof(dtObstacleAvoidanceQuery), DT_ALLOC_PERM); + if (!mem) return 0; + return new(mem) dtObstacleAvoidanceQuery; +} + +void dtFreeObstacleAvoidanceQuery(dtObstacleAvoidanceQuery* ptr) +{ + if (!ptr) return; + ptr->~dtObstacleAvoidanceQuery(); + dtFree(ptr); +} + + +dtObstacleAvoidanceQuery::dtObstacleAvoidanceQuery() : + m_velBias(0.0f), + m_weightDesVel(0.0f), + m_weightCurVel(0.0f), + m_weightSide(0.0f), + m_weightToi(0.0f), + m_horizTime(0.0f), + m_maxCircles(0), + m_circles(0), + m_ncircles(0), + m_maxSegments(0), + m_segments(0), + m_nsegments(0) +{ +} + +dtObstacleAvoidanceQuery::~dtObstacleAvoidanceQuery() +{ + dtFree(m_circles); + dtFree(m_segments); +} + +bool dtObstacleAvoidanceQuery::init(const int maxCircles, const int maxSegments) +{ + m_maxCircles = maxCircles; + m_ncircles = 0; + m_circles = (dtObstacleCircle*)dtAlloc(sizeof(dtObstacleCircle)*m_maxCircles, DT_ALLOC_PERM); + if (!m_circles) + return false; + memset(m_circles, 0, sizeof(dtObstacleCircle)*m_maxCircles); + + m_maxSegments = maxSegments; + m_nsegments = 0; + m_segments = (dtObstacleSegment*)dtAlloc(sizeof(dtObstacleSegment)*m_maxSegments, DT_ALLOC_PERM); + if (!m_segments) + return false; + memset(m_segments, 0, sizeof(dtObstacleSegment)*m_maxSegments); + + return true; +} + +void dtObstacleAvoidanceQuery::reset() +{ + m_ncircles = 0; + m_nsegments = 0; +} + +void dtObstacleAvoidanceQuery::addCircle(const float* pos, const float rad, + const float* vel, const float* dvel) +{ + if (m_ncircles >= m_maxCircles) + return; + + dtObstacleCircle* cir = &m_circles[m_ncircles++]; + dtVcopy(cir->p, pos); + cir->rad = rad; + dtVcopy(cir->vel, vel); + dtVcopy(cir->dvel, dvel); +} + +void dtObstacleAvoidanceQuery::addSegment(const float* p, const float* q) +{ + if (m_nsegments > m_maxSegments) + return; + + dtObstacleSegment* seg = &m_segments[m_nsegments++]; + dtVcopy(seg->p, p); + dtVcopy(seg->q, q); +} + +void dtObstacleAvoidanceQuery::prepare(const float* pos, const float* dvel) +{ + // Prepare obstacles + for (int i = 0; i < m_ncircles; ++i) + { + dtObstacleCircle* cir = &m_circles[i]; + + // Side + const float* pa = pos; + const float* pb = cir->p; + + const float orig[3] = {0,0}; + float dv[3]; + dtVsub(cir->dp,pb,pa); + dtVnormalize(cir->dp); + dtVsub(dv, cir->dvel, dvel); + + const float a = dtTriArea2D(orig, cir->dp,dv); + if (a < 0.01f) + { + cir->np[0] = -cir->dp[2]; + cir->np[2] = cir->dp[0]; + } + else + { + cir->np[0] = cir->dp[2]; + cir->np[2] = -cir->dp[0]; + } + } + + for (int i = 0; i < m_nsegments; ++i) + { + dtObstacleSegment* seg = &m_segments[i]; + + // Precalc if the agent is really close to the segment. + const float r = 0.01f; + float t; + seg->touch = dtDistancePtSegSqr2D(pos, seg->p, seg->q, t) < dtSqr(r); + } +} + +float dtObstacleAvoidanceQuery::processSample(const float* vcand, const float cs, + const float* pos, const float rad, + const float vmax, const float* vel, const float* dvel, + dtObstacleAvoidanceDebugData* debug) +{ + // Find min time of impact and exit amongst all obstacles. + float tmin = m_horizTime; + float side = 0; + int nside = 0; + + for (int i = 0; i < m_ncircles; ++i) + { + const dtObstacleCircle* cir = &m_circles[i]; + + // RVO + float vab[3]; + dtVscale(vab, vcand, 2); + dtVsub(vab, vab, vel); + dtVsub(vab, vab, cir->vel); + + // Side + side += dtClamp(dtMin(dtVdot2D(cir->dp,vab)*0.5f+0.5f, dtVdot2D(cir->np,vab)*2), 0.0f, 1.0f); + nside++; + + float htmin = 0, htmax = 0; + if (!sweepCircleCircle(pos,rad, vab, cir->p,cir->rad, htmin, htmax)) + continue; + + // Handle overlapping obstacles. + if (htmin < 0.0f && htmax > 0.0f) + { + // Avoid more when overlapped. + htmin = -htmin * 0.5f; + } + + if (htmin >= 0.0f) + { + // The closest obstacle is somewhere ahead of us, keep track of nearest obstacle. + if (htmin < tmin) + tmin = htmin; + } + } + + for (int i = 0; i < m_nsegments; ++i) + { + const dtObstacleSegment* seg = &m_segments[i]; + float htmin = 0; + + if (seg->touch) + { + // Special case when the agent is very close to the segment. + float sdir[3], snorm[3]; + dtVsub(sdir, seg->q, seg->p); + snorm[0] = -sdir[2]; + snorm[2] = sdir[0]; + // If the velocity is pointing towards the segment, no collision. + if (dtVdot2D(snorm, vcand) < 0.0f) + continue; + // Else immediate collision. + htmin = 0.0f; + } + else + { + if (!isectRaySeg(pos, vcand, seg->p, seg->q, htmin)) + continue; + } + + // Avoid less when facing walls. + htmin *= 2.0f; + + // The closest obstacle is somewhere ahead of us, keep track of nearest obstacle. + if (htmin < tmin) + tmin = htmin; + } + + // Normalize side bias, to prevent it dominating too much. + if (nside) + side /= nside; + + const float ivmax = 1.0f / vmax; + const float vpen = m_weightDesVel * (dtVdist2D(vcand, dvel) * ivmax); + const float vcpen = m_weightCurVel * (dtVdist2D(vcand, vel) * ivmax); + const float spen = m_weightSide * side; + const float tpen = m_weightToi * (1.0f/(0.1f+tmin / m_horizTime)); + + const float penalty = vpen + vcpen + spen + tpen; + + // Store different penalties for debug viewing + if (debug) + debug->addSample(vcand, cs, penalty, vpen, vcpen, spen, tpen); + + return penalty; +} + +void dtObstacleAvoidanceQuery::sampleVelocityGrid(const float* pos, const float rad, const float vmax, + const float* vel, const float* dvel, + float* nvel, const int gsize, + dtObstacleAvoidanceDebugData* debug) +{ + prepare(pos, dvel); + + dtVset(nvel, 0,0,0); + + if (debug) + debug->reset(); + + const float cvx = dvel[0] * m_velBias; + const float cvz = dvel[2] * m_velBias; + const float cs = vmax * 2 * (1 - m_velBias) / (float)(gsize-1); + const float half = (gsize-1)*cs*0.5f; + + float minPenalty = FLT_MAX; + + for (int y = 0; y < gsize; ++y) + { + for (int x = 0; x < gsize; ++x) + { + float vcand[3]; + vcand[0] = cvx + x*cs - half; + vcand[1] = 0; + vcand[2] = cvz + y*cs - half; + + if (dtSqr(vcand[0])+dtSqr(vcand[2]) > dtSqr(vmax+cs/2)) continue; + + const float penalty = processSample(vcand, cs, pos,rad,vmax,vel,dvel, debug); + if (penalty < minPenalty) + { + minPenalty = penalty; + dtVcopy(nvel, vcand); + } + } + } +} + + +static const float DT_PI = 3.14159265f; + +void dtObstacleAvoidanceQuery::sampleVelocityAdaptive(const float* pos, const float rad, const float vmax, + const float* vel, const float* dvel, float* nvel, + const int ndivs, const int nrings, const int depth, + dtObstacleAvoidanceDebugData* debug) +{ + prepare(pos, dvel); + + dtVset(nvel, 0,0,0); + + if (debug) + debug->reset(); + + // Build sampling pattern aligned to desired velocity. + static const int MAX_PATTERN_DIVS = 32; + static const int MAX_PATTERN_RINGS = 4; + float pat[(MAX_PATTERN_DIVS*MAX_PATTERN_RINGS+1)*2]; + int npat = 0; + + const int nd = dtClamp(ndivs, 1, MAX_PATTERN_DIVS); + const int nr = dtClamp(nrings, 1, MAX_PATTERN_RINGS); + const float da = (1.0f/nd) * DT_PI*2; + const float dang = atan2f(dvel[2], dvel[0]); + + // Always add sample at zero + pat[npat*2+0] = 0; + pat[npat*2+1] = 0; + npat++; + + for (int j = 0; j < nr; ++j) + { + const float rad = (float)(nr-j)/(float)nr; + float a = dang + (j&1)*0.5f*da; + for (int i = 0; i < nd; ++i) + { + pat[npat*2+0] = cosf(a)*rad; + pat[npat*2+1] = sinf(a)*rad; + npat++; + a += da; + } + } + + // Start sampling. + float cr = vmax * (1.0f-m_velBias); + float res[3]; + dtVset(res, dvel[0] * m_velBias, 0, dvel[2] * m_velBias); + + for (int k = 0; k < depth; ++k) + { + float minPenalty = FLT_MAX; + float bvel[3]; + dtVset(bvel, 0,0,0); + + for (int i = 0; i < npat; ++i) + { + float vcand[3]; + vcand[0] = res[0] + pat[i*2+0]*cr; + vcand[1] = 0; + vcand[2] = res[2] + pat[i*2+1]*cr; + + if (dtSqr(vcand[0])+dtSqr(vcand[2]) > dtSqr(vmax+0.001f)) continue; + + const float penalty = processSample(vcand,cr/10, pos,rad,vmax,vel,dvel, debug); + if (penalty < minPenalty) + { + minPenalty = penalty; + dtVcopy(bvel, vcand); + } + } + + dtVcopy(res, bvel); + + cr *= 0.5f; + } + + dtVcopy(nvel, res); +} + diff --git a/dep/recastnavigation/Detour/win/Detour_VC100.sln b/dep/recastnavigation/Detour/win/Detour_VC100.sln new file mode 100644 index 000000000..08d10b198 --- /dev/null +++ b/dep/recastnavigation/Detour/win/Detour_VC100.sln @@ -0,0 +1,20 @@ + +Microsoft Visual Studio Solution File, Format Version 11.00 +# Visual Studio 2010 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Detour", "VC100\Detour.vcxproj", "{72BDF975-4D4A-42C7-B2C4-F9ED90A2ABB6}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Win32 = Debug|Win32 + Release|Win32 = Release|Win32 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {72BDF975-4D4A-42C7-B2C4-F9ED90A2ABB6}.Debug|Win32.ActiveCfg = Debug|Win32 + {72BDF975-4D4A-42C7-B2C4-F9ED90A2ABB6}.Debug|Win32.Build.0 = Debug|Win32 + {72BDF975-4D4A-42C7-B2C4-F9ED90A2ABB6}.Release|Win32.ActiveCfg = Release|Win32 + {72BDF975-4D4A-42C7-B2C4-F9ED90A2ABB6}.Release|Win32.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/dep/recastnavigation/Detour/win/Detour_VC90.sln b/dep/recastnavigation/Detour/win/Detour_VC90.sln new file mode 100644 index 000000000..644e7079f --- /dev/null +++ b/dep/recastnavigation/Detour/win/Detour_VC90.sln @@ -0,0 +1,20 @@ + +Microsoft Visual Studio Solution File, Format Version 10.00 +# Visual Studio 2008 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Detour", "VC90\Detour.vcproj", "{5FDC0EBC-3F80-4518-A5DF-1CD5BBEB64F7}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Win32 = Debug|Win32 + Release|Win32 = Release|Win32 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {5FDC0EBC-3F80-4518-A5DF-1CD5BBEB64F7}.Debug|Win32.ActiveCfg = Debug|Win32 + {5FDC0EBC-3F80-4518-A5DF-1CD5BBEB64F7}.Debug|Win32.Build.0 = Debug|Win32 + {5FDC0EBC-3F80-4518-A5DF-1CD5BBEB64F7}.Release|Win32.ActiveCfg = Release|Win32 + {5FDC0EBC-3F80-4518-A5DF-1CD5BBEB64F7}.Release|Win32.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/dep/recastnavigation/Detour/win/VC100/.gitignore b/dep/recastnavigation/Detour/win/VC100/.gitignore new file mode 100644 index 000000000..d82e4915b --- /dev/null +++ b/dep/recastnavigation/Detour/win/VC100/.gitignore @@ -0,0 +1,6 @@ + +*__Win32_Release +*__Win32_Debug +*__x64_Release +*__x64_Debug +*.user \ No newline at end of file diff --git a/dep/recastnavigation/Detour/win/VC100/Detour.vcxproj b/dep/recastnavigation/Detour/win/VC100/Detour.vcxproj new file mode 100644 index 000000000..cb12cebb3 --- /dev/null +++ b/dep/recastnavigation/Detour/win/VC100/Detour.vcxproj @@ -0,0 +1,162 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {72BDF975-4D4A-42C7-B2C4-F9ED90A2ABB6} + Detour + + + + StaticLibrary + true + MultiByte + + + StaticLibrary + true + MultiByte + + + StaticLibrary + false + false + MultiByte + + + StaticLibrary + false + false + MultiByte + + + + + + + + + + + + + + + + + + + $(ProjectDir)\..\..\..\..\lib\$(Platform)_$(Configuration)\ + + + $(ProjectDir)\..\..\..\..\lib\$(Platform)_$(Configuration)\ + + + .\$(ProjectName)__$(Platform)_$(Configuration)\ + + + .\$(ProjectName)__$(Platform)_$(Configuration)\ + + + $(ProjectDir)\..\..\..\..\lib\$(Platform)_$(Configuration)\ + + + $(ProjectDir)\..\..\..\..\lib\$(Platform)_$(Configuration)\ + + + .\$(ProjectName)__$(Platform)_$(Configuration)\ + + + .\$(ProjectName)__$(Platform)_$(Configuration)\ + + + + Level3 + Disabled + ..\..\include + WIN32;DEBUG;_MBCS;%(PreprocessorDefinitions) + + + true + + + + + Level3 + Disabled + ..\..\include + WIN32;DEBUG;_MBCS;%(PreprocessorDefinitions) + + + true + + + + + Level3 + MaxSpeed + true + true + ..\..\include + WIN32;NDEBUG;_MBCS;%(PreprocessorDefinitions) + Speed + + + true + true + true + + + + + Level3 + MaxSpeed + true + true + ..\..\include + WIN32;NDEBUG;_MBCS;%(PreprocessorDefinitions) + Speed + + + true + true + true + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/dep/recastnavigation/Detour/win/VC100/Detour.vcxproj.filters b/dep/recastnavigation/Detour/win/VC100/Detour.vcxproj.filters new file mode 100644 index 000000000..663af065b --- /dev/null +++ b/dep/recastnavigation/Detour/win/VC100/Detour.vcxproj.filters @@ -0,0 +1,54 @@ + + + + + {93bb99d1-034f-421d-abf2-856b22079565} + + + {661147bd-4839-4f24-8697-6ce5cb9b61a2} + + + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + + + src + + + src + + + src + + + src + + + src + + + src + + + \ No newline at end of file diff --git a/dep/recastnavigation/Detour/win/VC90/.gitignore b/dep/recastnavigation/Detour/win/VC90/.gitignore new file mode 100644 index 000000000..d82e4915b --- /dev/null +++ b/dep/recastnavigation/Detour/win/VC90/.gitignore @@ -0,0 +1,6 @@ + +*__Win32_Release +*__Win32_Debug +*__x64_Release +*__x64_Debug +*.user \ No newline at end of file diff --git a/dep/recastnavigation/Detour/win/VC90/Detour.vcproj b/dep/recastnavigation/Detour/win/VC90/Detour.vcproj new file mode 100644 index 000000000..d48b9145b --- /dev/null +++ b/dep/recastnavigation/Detour/win/VC90/Detour.vcproj @@ -0,0 +1,336 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/dep/recastnavigation/License.txt b/dep/recastnavigation/License.txt new file mode 100644 index 000000000..95f4bfc96 --- /dev/null +++ b/dep/recastnavigation/License.txt @@ -0,0 +1,18 @@ +Copyright (c) 2009 Mikko Mononen memon@inside.org + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not +claim that you wrote the original software. If you use this software +in a product, an acknowledgment in the product documentation would be +appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be +misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. + diff --git a/dep/recastnavigation/Readme.txt b/dep/recastnavigation/Readme.txt new file mode 100644 index 000000000..0c2f7b167 --- /dev/null +++ b/dep/recastnavigation/Readme.txt @@ -0,0 +1,120 @@ + +Recast & Detour Version 1.4 + + +Recast + +Recast is state of the art navigation mesh construction toolset for games. + + * It is automatic, which means that you can throw any level geometry + at it and you will get robust mesh out + * It is fast which means swift turnaround times for level designers + * It is open source so it comes with full source and you can + customize it to your hearts content. + +The Recast process starts with constructing a voxel mold from a level geometry +and then casting a navigation mesh over it. The process consists of three steps, +building the voxel mold, partitioning the mold into simple regions, peeling off +the regions as simple polygons. + + 1. The voxel mold is build from the input triangle mesh by rasterizing + the triangles into a multi-layer heightfield. Some simple filters are + then applied to the mold to prune out locations where the character + would not be able to move. + 2. The walkable areas described by the mold are divided into simple + overlayed 2D regions. The resulting regions have only one non-overlapping + contour, which simplifies the final step of the process tremendously. + 3. The navigation polygons are peeled off from the regions by first tracing + the boundaries and then simplifying them. The resulting polygons are + finally converted to convex polygons which makes them perfect for + pathfinding and spatial reasoning about the level. + +The toolset code is located in the Recast folder and demo application using the Recast +toolset is located in the RecastDemo folder. + +The project files with this distribution can be compiled with Microsoft Visual C++ 2008 +(you can download it for free) and XCode 3.1. + + +Detour + +Recast is accompanied with Detour, path-finding and spatial reasoning toolkit. You can use any navigation mesh with Detour, but of course the data generated with Recast fits perfectly. + +Detour offers simple static navigation mesh which is suitable for many simple cases, as well as tiled navigation mesh which allows you to plug in and out pieces of the mesh. The tiled mesh allows to create systems where you stream new navigation data in and out as the player progresses the level, or you may regenerate tiles as the world changes. + + +Latest code available at http://code.google.com/p/recastnavigation/ + + +-- + +Release Notes + +---------------- +* Recast 1.4 + Released August 24th, 2009 + +- Added detail height mesh generation (RecastDetailMesh.cpp) for single, + tiled statmeshes as well as tilemesh. +- Added feature to contour tracing which detects extra vertices along + tile edges which should be removed later. +- Changed the tiled stat mesh preprocess, so that it first generated + polymeshes per tile and finally combines them. +- Fixed bug in the GUI code where invisible buttons could be pressed. + +---------------- +* Recast 1.31 + Released July 24th, 2009 + +- Better cost and heuristic functions. +- Fixed tile navmesh raycast on tile borders. + +---------------- +* Recast 1.3 + Released July 14th, 2009 + +- Added dtTileNavMesh which allows to dynamically add and remove navmesh pieces at runtime. +- Renamed stat navmesh types to dtStat* (i.e. dtPoly is now dtStatPoly). +- Moved common code used by tile and stat navmesh to DetourNode.h/cpp and DetourCommon.h/cpp. +- Refactores the demo code. + +---------------- +* Recast 1.2 + Released June 17th, 2009 + +- Added tiled mesh generation. The tiled generation allows to generate navigation for + much larger worlds, it removes some of the artifacts that comes from distance fields + in open areas, and allows later streaming and dynamic runtime generation +- Improved and added some debug draw modes +- API change: The helper function rcBuildNavMesh does not exists anymore, + had to change few internal things to cope with the tiled processing, + similar API functionality will be added later once the tiled process matures +- The demo is getting way too complicated, need to split demos +- Fixed several filtering functions so that the mesh is tighter to the geometry, + sometimes there could be up error up to tow voxel units close to walls, + now it should be just one. + +---------------- +* Recast 1.1 + Released April 11th, 2009 + +This is the first release of Detour. + +---------------- +* Recast 1.0 + Released March 29th, 2009 + +This is the first release of Recast. + +The process is not always as robust as I would wish. The watershed phase sometimes swallows tiny islands +which are close to edges. These droppings are handled in rcBuildContours, but the code is not +particularly robust either. + +Another non-robust case is when portal contours (contours shared between two regions) are always +assumed to be straight. That can lead to overlapping contours specially when the level has +large open areas. + + + +Mikko Mononen +memon@inside.org diff --git a/dep/recastnavigation/Recast/Include/Recast.h b/dep/recastnavigation/Recast/Include/Recast.h new file mode 100644 index 000000000..0e5f07424 --- /dev/null +++ b/dep/recastnavigation/Recast/Include/Recast.h @@ -0,0 +1,688 @@ +// +// Copyright (c) 2009-2010 Mikko Mononen memon@inside.org +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. +// + +#ifndef RECAST_H +#define RECAST_H + +// Some math headers don't have PI defined. +static const float RC_PI = 3.14159265f; + +enum rcLogCategory +{ + RC_LOG_PROGRESS = 1, + RC_LOG_WARNING, + RC_LOG_ERROR, +}; + +enum rcTimerLabel +{ + RC_TIMER_TOTAL, + RC_TIMER_TEMP, + RC_TIMER_RASTERIZE_TRIANGLES, + RC_TIMER_BUILD_COMPACTHEIGHTFIELD, + RC_TIMER_BUILD_CONTOURS, + RC_TIMER_BUILD_CONTOURS_TRACE, + RC_TIMER_BUILD_CONTOURS_SIMPLIFY, + RC_TIMER_FILTER_BORDER, + RC_TIMER_FILTER_WALKABLE, + RC_TIMER_MEDIAN_AREA, + RC_TIMER_FILTER_LOW_OBSTACLES, + RC_TIMER_BUILD_POLYMESH, + RC_TIMER_MERGE_POLYMESH, + RC_TIMER_ERODE_AREA, + RC_TIMER_MARK_BOX_AREA, + RC_TIMER_MARK_CONVEXPOLY_AREA, + RC_TIMER_BUILD_DISTANCEFIELD, + RC_TIMER_BUILD_DISTANCEFIELD_DIST, + RC_TIMER_BUILD_DISTANCEFIELD_BLUR, + RC_TIMER_BUILD_REGIONS, + RC_TIMER_BUILD_REGIONS_WATERSHED, + RC_TIMER_BUILD_REGIONS_EXPAND, + RC_TIMER_BUILD_REGIONS_FLOOD, + RC_TIMER_BUILD_REGIONS_FILTER, + RC_TIMER_BUILD_POLYMESHDETAIL, + RC_TIMER_MERGE_POLYMESHDETAIL, + RC_MAX_TIMERS +}; + +// Build context provides several optional utilities needed for the build process, +// such as timing, logging, and build time collecting. +class rcContext +{ +public: + inline rcContext(bool state = true) : m_logEnabled(state), m_timerEnabled(state) {} + virtual ~rcContext() {} + + // Enables or disables logging. + inline void enableLog(bool state) { m_logEnabled = state; } + // Resets log. + inline void resetLog() { if (m_logEnabled) doResetLog(); } + // Logs a message. + void log(const rcLogCategory category, const char* format, ...); + + // Enables or disables timer. + inline void enableTimer(bool state) { m_timerEnabled = state; } + // Resets all timers. + inline void resetTimers() { if (m_timerEnabled) doResetTimers(); } + // Starts timer, used for performance timing. + inline void startTimer(const rcTimerLabel label) { if (m_timerEnabled) doStartTimer(label); } + // Stops timer, used for performance timing. + inline void stopTimer(const rcTimerLabel label) { if (m_timerEnabled) doStopTimer(label); } + // Returns time accumulated between timer start/stop. + inline int getAccumulatedTime(const rcTimerLabel label) const { return m_timerEnabled ? doGetAccumulatedTime(label) : -1; } + +protected: + // Virtual functions to override for custom implementations. + virtual void doResetLog() {} + virtual void doLog(const rcLogCategory /*category*/, const char* /*msg*/, const int /*len*/) {} + virtual void doResetTimers() {} + virtual void doStartTimer(const rcTimerLabel /*label*/) {} + virtual void doStopTimer(const rcTimerLabel /*label*/) {} + virtual int doGetAccumulatedTime(const rcTimerLabel /*label*/) const { return -1; } + + bool m_logEnabled; + bool m_timerEnabled; +}; + + +// The units of the parameters are specified in parenthesis as follows: +// (vx) voxels, (wu) world units +struct rcConfig +{ + int width, height; // Dimensions of the rasterized heightfield (vx) + int tileSize; // Width and Height of a tile (vx) + int borderSize; // Non-navigable Border around the heightfield (vx) + float cs, ch; // Grid cell size and height (wu) + float bmin[3], bmax[3]; // Grid bounds (wu) + float walkableSlopeAngle; // Maximum walkable slope angle in degrees. + int walkableHeight; // Minimum height where the agent can still walk (vx) + int walkableClimb; // Maximum height between grid cells the agent can climb (vx) + int walkableRadius; // Radius of the agent in cells (vx) + int maxEdgeLen; // Maximum contour edge length (vx) + float maxSimplificationError; // Maximum distance error from contour to cells (vx) + int minRegionArea; // Regions whose area is smaller than this threshold will be removed. (vx) + int mergeRegionArea; // Regions whose area is smaller than this threshold will be merged (vx) + int maxVertsPerPoly; // Max number of vertices per polygon + float detailSampleDist; // Detail mesh sample spacing. + float detailSampleMaxError; // Detail mesh simplification max sample error. +}; + +// Define number of bits in the above structure for smin/smax. +// The max height is used for clamping rasterized values. +static const int RC_SPAN_HEIGHT_BITS = 16; +static const int RC_SPAN_MAX_HEIGHT = (1<> shift) & 0x3f; +} + +inline int rcGetDirOffsetX(int dir) +{ + const int offset[4] = { -1, 0, 1, 0, }; + return offset[dir&0x03]; +} + +inline int rcGetDirOffsetY(int dir) +{ + const int offset[4] = { 0, 1, 0, -1 }; + return offset[dir&0x03]; +} + +// Common helper functions +template inline void rcSwap(T& a, T& b) { T t = a; a = b; b = t; } +template inline T rcMin(T a, T b) { return a < b ? a : b; } +template inline T rcMax(T a, T b) { return a > b ? a : b; } +template inline T rcAbs(T a) { return a < 0 ? -a : a; } +template inline T rcSqr(T a) { return a*a; } +template inline T rcClamp(T v, T mn, T mx) { return v < mn ? mn : (v > mx ? mx : v); } +float rcSqrt(float x); + +// Common vector helper functions. +inline void rcVcross(float* dest, const float* v1, const float* v2) +{ + dest[0] = v1[1]*v2[2] - v1[2]*v2[1]; + dest[1] = v1[2]*v2[0] - v1[0]*v2[2]; + dest[2] = v1[0]*v2[1] - v1[1]*v2[0]; +} + +inline float rcVdot(const float* v1, const float* v2) +{ + return v1[0]*v2[0] + v1[1]*v2[1] + v1[2]*v2[2]; +} + +inline void rcVmad(float* dest, const float* v1, const float* v2, const float s) +{ + dest[0] = v1[0]+v2[0]*s; + dest[1] = v1[1]+v2[1]*s; + dest[2] = v1[2]+v2[2]*s; +} + +inline void rcVadd(float* dest, const float* v1, const float* v2) +{ + dest[0] = v1[0]+v2[0]; + dest[1] = v1[1]+v2[1]; + dest[2] = v1[2]+v2[2]; +} + +inline void rcVsub(float* dest, const float* v1, const float* v2) +{ + dest[0] = v1[0]-v2[0]; + dest[1] = v1[1]-v2[1]; + dest[2] = v1[2]-v2[2]; +} + +inline void rcVmin(float* mn, const float* v) +{ + mn[0] = rcMin(mn[0], v[0]); + mn[1] = rcMin(mn[1], v[1]); + mn[2] = rcMin(mn[2], v[2]); +} + +inline void rcVmax(float* mx, const float* v) +{ + mx[0] = rcMax(mx[0], v[0]); + mx[1] = rcMax(mx[1], v[1]); + mx[2] = rcMax(mx[2], v[2]); +} + +inline void rcVcopy(float* dest, const float* v) +{ + dest[0] = v[0]; + dest[1] = v[1]; + dest[2] = v[2]; +} + +inline float rcVdist(const float* v1, const float* v2) +{ + float dx = v2[0] - v1[0]; + float dy = v2[1] - v1[1]; + float dz = v2[2] - v1[2]; + return rcSqrt(dx*dx + dy*dy + dz*dz); +} + +inline float rcVdistSqr(const float* v1, const float* v2) +{ + float dx = v2[0] - v1[0]; + float dy = v2[1] - v1[1]; + float dz = v2[2] - v1[2]; + return dx*dx + dy*dy + dz*dz; +} + +inline void rcVnormalize(float* v) +{ + float d = 1.0f / rcSqrt(rcSqr(v[0]) + rcSqr(v[1]) + rcSqr(v[2])); + v[0] *= d; + v[1] *= d; + v[2] *= d; +} + +inline bool rcVequal(const float* p0, const float* p1) +{ + static const float thr = rcSqr(1.0f/16384.0f); + const float d = rcVdistSqr(p0, p1); + return d < thr; +} + +// Calculated bounding box of array of vertices. +// Params: +// verts - (in) array of vertices +// nv - (in) vertex count +// bmin, bmax - (out) bounding box +void rcCalcBounds(const float* verts, int nv, float* bmin, float* bmax); + +// Calculates grid size based on bounding box and grid cell size. +// Params: +// bmin, bmax - (in) bounding box +// cs - (in) grid cell size +// w - (out) grid width +// h - (out) grid height +void rcCalcGridSize(const float* bmin, const float* bmax, float cs, int* w, int* h); + +// Creates and initializes new heightfield. +// Params: +// hf - (in/out) heightfield to initialize. +// width - (in) width of the heightfield. +// height - (in) height of the heightfield. +// bmin, bmax - (in) bounding box of the heightfield +// cs - (in) grid cell size +// ch - (in) grid cell height +bool rcCreateHeightfield(rcContext* ctx, rcHeightfield& hf, int width, int height, + const float* bmin, const float* bmax, + float cs, float ch); + +// Sets the RC_WALKABLE_AREA for every triangle whose slope is below +// the maximum walkable slope angle. +// Params: +// walkableSlopeAngle - (in) maximum slope angle in degrees. +// verts - (in) array of vertices +// nv - (in) vertex count +// tris - (in) array of triangle vertex indices +// nt - (in) triangle count +// areas - (out) array of triangle area types +void rcMarkWalkableTriangles(rcContext* ctx, const float walkableSlopeAngle, const float* verts, int nv, + const int* tris, int nt, unsigned char* areas); + +// Sets the RC_NULL_AREA for every triangle whose slope is steeper than +// the maximum walkable slope angle. +// Params: +// walkableSlopeAngle - (in) maximum slope angle in degrees. +// verts - (in) array of vertices +// nv - (in) vertex count +// tris - (in) array of triangle vertex indices +// nt - (in) triangle count +// areas - (out) array of triangle are types +void rcClearUnwalkableTriangles(rcContext* ctx, const float walkableSlopeAngle, const float* verts, int nv, + const int* tris, int nt, unsigned char* areas); + +// Adds span to heightfield. +// The span addition can set to favor flags. If the span is merged to +// another span and the new smax is within 'flagMergeThr' units away +// from the existing span the span flags are merged and stored. +// Params: +// solid - (in) heightfield where the spans is added to +// x,y - (in) location on the heightfield where the span is added +// smin,smax - (in) spans min/max height +// flags - (in) span flags (zero or WALKABLE) +// flagMergeThr - (in) merge threshold. +void rcAddSpan(rcContext* ctx, rcHeightfield& solid, const int x, const int y, + const unsigned short smin, const unsigned short smax, + const unsigned short area, const int flagMergeThr); + +// Rasterizes a triangle into heightfield spans. +// Params: +// v0,v1,v2 - (in) the vertices of the triangle. +// area - (in) area type of the triangle. +// solid - (in) heightfield where the triangle is rasterized +// flagMergeThr - (in) distance in voxel where walkable flag is favored over non-walkable. +void rcRasterizeTriangle(rcContext* ctx, const float* v0, const float* v1, const float* v2, + const unsigned char area, rcHeightfield& solid, + const int flagMergeThr = 1); + +// Rasterizes indexed triangle mesh into heightfield spans. +// Params: +// verts - (in) array of vertices +// nv - (in) vertex count +// tris - (in) array of triangle vertex indices +// area - (in) array of triangle area types. +// nt - (in) triangle count +// solid - (in) heightfield where the triangles are rasterized +// flagMergeThr - (in) distance in voxel where walkable flag is favored over non-walkable. +void rcRasterizeTriangles(rcContext* ctx, const float* verts, const int nv, + const int* tris, const unsigned char* areas, const int nt, + rcHeightfield& solid, const int flagMergeThr = 1); + +// Rasterizes indexed triangle mesh into heightfield spans. +// Params: +// verts - (in) array of vertices +// nv - (in) vertex count +// tris - (in) array of triangle vertex indices +// area - (in) array of triangle area types. +// nt - (in) triangle count +// solid - (in) heightfield where the triangles are rasterized +// flagMergeThr - (in) distance in voxel where walkable flag is favored over non-walkable. +void rcRasterizeTriangles(rcContext* ctx, const float* verts, const int nv, + const unsigned short* tris, const unsigned char* areas, const int nt, + rcHeightfield& solid, const int flagMergeThr = 1); + +// Rasterizes the triangles into heightfield spans. +// Params: +// verts - (in) array of vertices +// area - (in) array of triangle area types. +// nt - (in) triangle count +// solid - (in) heightfield where the triangles are rasterized +void rcRasterizeTriangles(rcContext* ctx, const float* verts, const unsigned char* areas, const int nt, + rcHeightfield& solid, const int flagMergeThr = 1); + +// Marks non-walkable low obstacles as walkable if they are closer than walkableClimb +// from a walkable surface. Applying this filter allows to step over low hanging +// low obstacles. +// Params: +// walkableHeight - (in) minimum height where the agent can still walk +// solid - (in/out) heightfield describing the solid space +// TODO: Missuses ledge flag, must be called before rcFilterLedgeSpans! +void rcFilterLowHangingWalkableObstacles(rcContext* ctx, const int walkableClimb, rcHeightfield& solid); + +// Removes WALKABLE flag from all spans that are at ledges. This filtering +// removes possible overestimation of the conservative voxelization so that +// the resulting mesh will not have regions hanging in air over ledges. +// Params: +// walkableHeight - (in) minimum height where the agent can still walk +// walkableClimb - (in) maximum height between grid cells the agent can climb +// solid - (in/out) heightfield describing the solid space +void rcFilterLedgeSpans(rcContext* ctx, const int walkableHeight, + const int walkableClimb, rcHeightfield& solid); + +// Removes WALKABLE flag from all spans which have smaller than +// 'walkableHeight' clearance above them. +// Params: +// walkableHeight - (in) minimum height where the agent can still walk +// solid - (in/out) heightfield describing the solid space +void rcFilterWalkableLowHeightSpans(rcContext* ctx, int walkableHeight, rcHeightfield& solid); + +// Returns number of spans contained in a heightfield. +// Params: +// hf - (in) heightfield to be compacted +// Returns number of spans. +int rcGetHeightFieldSpanCount(rcContext* ctx, rcHeightfield& hf); + +// Builds compact representation of the heightfield. +// Params: +// walkableHeight - (in) minimum height where the agent can still walk +// walkableClimb - (in) maximum height between grid cells the agent can climb +// flags - (in) require flags for a cell to be included in the compact heightfield. +// hf - (in) heightfield to be compacted +// chf - (out) compact heightfield representing the open space. +// Returns false if operation ran out of memory. +bool rcBuildCompactHeightfield(rcContext* ctx, const int walkableHeight, const int walkableClimb, + rcHeightfield& hf, rcCompactHeightfield& chf); + +// Erodes walkable area. +// Params: +// radius - (in) radius of erosion (max 255). +// chf - (in/out) compact heightfield to erode. +// Returns false if operation ran out of memory. +bool rcErodeWalkableArea(rcContext* ctx, int radius, rcCompactHeightfield& chf); + +// Applies median filter to walkable area types, removing noise. +// Params: +// chf - (in/out) compact heightfield to erode. +// Returns false if operation ran out of memory. +bool rcMedianFilterWalkableArea(rcContext* ctx, rcCompactHeightfield& chf); + +// Marks the area of the convex polygon into the area type of the compact heightfield. +// Params: +// bmin/bmax - (in) bounds of the axis aligned box. +// areaId - (in) area ID to mark. +// chf - (in/out) compact heightfield to mark. +void rcMarkBoxArea(rcContext* ctx, const float* bmin, const float* bmax, unsigned char areaId, + rcCompactHeightfield& chf); + +// Marks the area of the convex polygon into the area type of the compact heightfield. +// Params: +// verts - (in) vertices of the convex polygon. +// nverts - (in) number of vertices in the polygon. +// hmin/hmax - (in) min and max height of the polygon. +// areaId - (in) area ID to mark. +// chf - (in/out) compact heightfield to mark. +void rcMarkConvexPolyArea(rcContext* ctx, const float* verts, const int nverts, + const float hmin, const float hmax, unsigned char areaId, + rcCompactHeightfield& chf); + +// Builds distance field and stores it into the combat heightfield. +// Params: +// chf - (in/out) compact heightfield representing the open space. +// Returns false if operation ran out of memory. +bool rcBuildDistanceField(rcContext* ctx, rcCompactHeightfield& chf); + +// Divides the walkable heighfied into simple regions using watershed partitioning. +// Each region has only one contour and no overlaps. +// The regions are stored in the compact heightfield 'reg' field. +// The process sometimes creates small regions. If the area of a regions is +// smaller than 'mergeRegionArea' then the region will be merged with a neighbour +// region if possible. If multiple regions form an area which is smaller than +// 'minRegionArea' all the regions belonging to that area will be removed. +// Here area means the count of spans in an area. +// Params: +// chf - (in/out) compact heightfield representing the open space. +// minRegionArea - (in) the smallest allowed region area. +// maxMergeRegionArea - (in) the largest allowed region area which can be merged. +// Returns false if operation ran out of memory. +bool rcBuildRegions(rcContext* ctx, rcCompactHeightfield& chf, + const int borderSize, const int minRegionArea, const int mergeRegionArea); + +// Divides the walkable heighfied into simple regions using simple monotone partitioning. +// Each region has only one contour and no overlaps. +// The regions are stored in the compact heightfield 'reg' field. +// The process sometimes creates small regions. If the area of a regions is +// smaller than 'mergeRegionArea' then the region will be merged with a neighbour +// region if possible. If multiple regions form an area which is smaller than +// 'minRegionArea' all the regions belonging to that area will be removed. +// Here area means the count of spans in an area. +// Params: +// chf - (in/out) compact heightfield representing the open space. +// minRegionArea - (in) the smallest allowed regions size. +// maxMergeRegionArea - (in) the largest allowed regions size which can be merged. +// Returns false if operation ran out of memory. +bool rcBuildRegionsMonotone(rcContext* ctx, rcCompactHeightfield& chf, + const int borderSize, const int minRegionArea, const int mergeRegionArea); + +// Builds simplified contours from the regions outlines. +// Params: +// chf - (in) compact heightfield which has regions set. +// maxError - (in) maximum allowed distance between simplified contour and cells. +// maxEdgeLen - (in) maximum allowed contour edge length in cells. +// cset - (out) Resulting contour set. +// flags - (in) build flags, see rcBuildContoursFlags. +// Returns false if operation ran out of memory. +bool rcBuildContours(rcContext* ctx, rcCompactHeightfield& chf, + const float maxError, const int maxEdgeLen, + rcContourSet& cset, const int flags = RC_CONTOUR_TESS_WALL_EDGES); + +// Builds connected convex polygon mesh from contour polygons. +// Params: +// cset - (in) contour set. +// nvp - (in) maximum number of vertices per polygon. +// mesh - (out) poly mesh. +// Returns false if operation ran out of memory. +bool rcBuildPolyMesh(rcContext* ctx, rcContourSet& cset, int nvp, rcPolyMesh& mesh); + +bool rcMergePolyMeshes(rcContext* ctx, rcPolyMesh** meshes, const int nmeshes, rcPolyMesh& mesh); + +// Builds detail triangle mesh for each polygon in the poly mesh. +// Params: +// mesh - (in) poly mesh to detail. +// chf - (in) compact height field, used to query height for new vertices. +// sampleDist - (in) spacing between height samples used to generate more detail into mesh. +// sampleMaxError - (in) maximum allowed distance between simplified detail mesh and height sample. +// pmdtl - (out) detail mesh. +// Returns false if operation ran out of memory. +bool rcBuildPolyMeshDetail(rcContext* ctx, const rcPolyMesh& mesh, const rcCompactHeightfield& chf, + const float sampleDist, const float sampleMaxError, + rcPolyMeshDetail& dmesh); + +bool rcMergePolyMeshDetails(rcContext* ctx, rcPolyMeshDetail** meshes, const int nmeshes, rcPolyMeshDetail& mesh); + + +#endif // RECAST_H diff --git a/dep/recastnavigation/Recast/Include/RecastAlloc.h b/dep/recastnavigation/Recast/Include/RecastAlloc.h new file mode 100644 index 000000000..9a316374a --- /dev/null +++ b/dep/recastnavigation/Recast/Include/RecastAlloc.h @@ -0,0 +1,69 @@ +// +// Copyright (c) 2009-2010 Mikko Mononen memon@inside.org +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. +// + +#ifndef RECASTALLOC_H +#define RECASTALLOC_H + +enum rcAllocHint +{ + RC_ALLOC_PERM, // Memory persist after a function call. + RC_ALLOC_TEMP // Memory used temporarily within a function. +}; + +typedef void* (rcAllocFunc)(int size, rcAllocHint hint); +typedef void (rcFreeFunc)(void* ptr); + +void rcAllocSetCustom(rcAllocFunc *allocFunc, rcFreeFunc *freeFunc); + +void* rcAlloc(int size, rcAllocHint hint); +void rcFree(void* ptr); + + + +// Simple dynamic array ints. +class rcIntArray +{ + int* m_data; + int m_size, m_cap; + inline rcIntArray(const rcIntArray&); + inline rcIntArray& operator=(const rcIntArray&); +public: + inline rcIntArray() : m_data(0), m_size(0), m_cap(0) {} + inline rcIntArray(int n) : m_data(0), m_size(0), m_cap(0) { resize(n); } + inline ~rcIntArray() { rcFree(m_data); } + void resize(int n); + inline void push(int item) { resize(m_size+1); m_data[m_size-1] = item; } + inline int pop() { if (m_size > 0) m_size--; return m_data[m_size]; } + inline const int& operator[](int i) const { return m_data[i]; } + inline int& operator[](int i) { return m_data[i]; } + inline int size() const { return m_size; } +}; + +// Simple internal helper class to delete array in scope +template class rcScopedDelete +{ + T* ptr; + inline T* operator=(T* p); +public: + inline rcScopedDelete() : ptr(0) {} + inline rcScopedDelete(T* p) : ptr(p) {} + inline ~rcScopedDelete() { rcFree(ptr); } + inline operator T*() { return ptr; } +}; + +#endif diff --git a/dep/recastnavigation/Recast/Include/RecastAssert.h b/dep/recastnavigation/Recast/Include/RecastAssert.h new file mode 100644 index 000000000..b58b8fcd2 --- /dev/null +++ b/dep/recastnavigation/Recast/Include/RecastAssert.h @@ -0,0 +1,33 @@ +// +// Copyright (c) 2009-2010 Mikko Mononen memon@inside.org +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. +// + +#ifndef RECASTASSERT_H +#define RECASTASSERT_H + +// Note: This header file's only purpose is to include define assert. +// Feel free to change the file and include your own implementation instead. + +#ifdef NDEBUG +// From http://cnicholson.net/2009/02/stupid-c-tricks-adventures-in-assert/ +# define rcAssert(x) do { (void)sizeof(x); } while(__LINE__==-1,false) +#else +# include +# define rcAssert assert +#endif + +#endif // RECASTASSERT_H diff --git a/dep/recastnavigation/Recast/Source/Recast.cpp b/dep/recastnavigation/Recast/Source/Recast.cpp new file mode 100644 index 000000000..d051418e8 --- /dev/null +++ b/dep/recastnavigation/Recast/Source/Recast.cpp @@ -0,0 +1,423 @@ +// +// Copyright (c) 2009-2010 Mikko Mononen memon@inside.org +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. +// + +#include +#define _USE_MATH_DEFINES +#include +#include +#include +#include +#include +#include "Recast.h" +#include "RecastAlloc.h" +#include "RecastAssert.h" + +float rcSqrt(float x) +{ + return sqrtf(x); +} + + +void rcContext::log(const rcLogCategory category, const char* format, ...) +{ + if (!m_logEnabled) + return; + static const int MSG_SIZE = 512; + char msg[MSG_SIZE]; + va_list ap; + va_start(ap, format); + int len = vsnprintf(msg, MSG_SIZE, format, ap); + if (len >= MSG_SIZE) + { + len = MSG_SIZE-1; + msg[MSG_SIZE-1] = '\0'; + } + va_end(ap); + doLog(category, msg, len); +} + +rcHeightfield* rcAllocHeightfield() +{ + rcHeightfield* hf = (rcHeightfield*)rcAlloc(sizeof(rcHeightfield), RC_ALLOC_PERM); + memset(hf, 0, sizeof(rcHeightfield)); + return hf; +} + +void rcFreeHeightField(rcHeightfield* hf) +{ + if (!hf) return; + // Delete span array. + rcFree(hf->spans); + // Delete span pools. + while (hf->pools) + { + rcSpanPool* next = hf->pools->next; + rcFree(hf->pools); + hf->pools = next; + } + rcFree(hf); +} + +rcCompactHeightfield* rcAllocCompactHeightfield() +{ + rcCompactHeightfield* chf = (rcCompactHeightfield*)rcAlloc(sizeof(rcCompactHeightfield), RC_ALLOC_PERM); + memset(chf, 0, sizeof(rcCompactHeightfield)); + return chf; +} + +void rcFreeCompactHeightfield(rcCompactHeightfield* chf) +{ + if (!chf) return; + rcFree(chf->cells); + rcFree(chf->spans); + rcFree(chf->dist); + rcFree(chf->areas); + rcFree(chf); +} + +rcContourSet* rcAllocContourSet() +{ + rcContourSet* cset = (rcContourSet*)rcAlloc(sizeof(rcContourSet), RC_ALLOC_PERM); + memset(cset, 0, sizeof(rcContourSet)); + return cset; +} + +void rcFreeContourSet(rcContourSet* cset) +{ + if (!cset) return; + for (int i = 0; i < cset->nconts; ++i) + { + rcFree(cset->conts[i].verts); + rcFree(cset->conts[i].rverts); + } + rcFree(cset->conts); + rcFree(cset); +} + +rcPolyMesh* rcAllocPolyMesh() +{ + rcPolyMesh* pmesh = (rcPolyMesh*)rcAlloc(sizeof(rcPolyMesh), RC_ALLOC_PERM); + memset(pmesh, 0, sizeof(rcPolyMesh)); + return pmesh; +} + +void rcFreePolyMesh(rcPolyMesh* pmesh) +{ + if (!pmesh) return; + rcFree(pmesh->verts); + rcFree(pmesh->polys); + rcFree(pmesh->regs); + rcFree(pmesh->flags); + rcFree(pmesh->areas); + rcFree(pmesh); +} + +rcPolyMeshDetail* rcAllocPolyMeshDetail() +{ + rcPolyMeshDetail* dmesh = (rcPolyMeshDetail*)rcAlloc(sizeof(rcPolyMeshDetail), RC_ALLOC_PERM); + memset(dmesh, 0, sizeof(rcPolyMeshDetail)); + return dmesh; +} + +void rcFreePolyMeshDetail(rcPolyMeshDetail* dmesh) +{ + if (!dmesh) return; + rcFree(dmesh->meshes); + rcFree(dmesh->verts); + rcFree(dmesh->tris); + rcFree(dmesh); +} + + +void rcCalcBounds(const float* verts, int nv, float* bmin, float* bmax) +{ + // Calculate bounding box. + rcVcopy(bmin, verts); + rcVcopy(bmax, verts); + for (int i = 1; i < nv; ++i) + { + const float* v = &verts[i*3]; + rcVmin(bmin, v); + rcVmax(bmax, v); + } +} + +void rcCalcGridSize(const float* bmin, const float* bmax, float cs, int* w, int* h) +{ + *w = (int)((bmax[0] - bmin[0])/cs+0.5f); + *h = (int)((bmax[2] - bmin[2])/cs+0.5f); +} + +bool rcCreateHeightfield(rcContext* /*ctx*/, rcHeightfield& hf, int width, int height, + const float* bmin, const float* bmax, + float cs, float ch) +{ + // TODO: VC complains about unref formal variable, figure out a way to handle this better. +// rcAssert(ctx); + + hf.width = width; + hf.height = height; + rcVcopy(hf.bmin, bmin); + rcVcopy(hf.bmax, bmax); + hf.cs = cs; + hf.ch = ch; + hf.spans = (rcSpan**)rcAlloc(sizeof(rcSpan*)*hf.width*hf.height, RC_ALLOC_PERM); + if (!hf.spans) + return false; + memset(hf.spans, 0, sizeof(rcSpan*)*hf.width*hf.height); + return true; +} + +static void calcTriNormal(const float* v0, const float* v1, const float* v2, float* norm) +{ + float e0[3], e1[3]; + rcVsub(e0, v1, v0); + rcVsub(e1, v2, v0); + rcVcross(norm, e0, e1); + rcVnormalize(norm); +} + +void rcMarkWalkableTriangles(rcContext* /*ctx*/, const float walkableSlopeAngle, + const float* verts, int /*nv*/, + const int* tris, int nt, + unsigned char* areas) +{ + // TODO: VC complains about unref formal variable, figure out a way to handle this better. +// rcAssert(ctx); + + const float walkableThr = cosf(walkableSlopeAngle/180.0f*RC_PI); + + float norm[3]; + + for (int i = 0; i < nt; ++i) + { + const int* tri = &tris[i*3]; + calcTriNormal(&verts[tri[0]*3], &verts[tri[1]*3], &verts[tri[2]*3], norm); + // Check if the face is walkable. + if (norm[1] > walkableThr) + areas[i] = RC_WALKABLE_AREA; + } +} + +void rcClearUnwalkableTriangles(rcContext* /*ctx*/, const float walkableSlopeAngle, + const float* verts, int /*nv*/, + const int* tris, int nt, + unsigned char* areas) +{ + // TODO: VC complains about unref formal variable, figure out a way to handle this better. +// rcAssert(ctx); + + const float walkableThr = cosf(walkableSlopeAngle/180.0f*RC_PI); + + float norm[3]; + + for (int i = 0; i < nt; ++i) + { + const int* tri = &tris[i*3]; + calcTriNormal(&verts[tri[0]*3], &verts[tri[1]*3], &verts[tri[2]*3], norm); + // Check if the face is walkable. + if (norm[1] <= walkableThr) + areas[i] = RC_NULL_AREA; + } +} + +int rcGetHeightFieldSpanCount(rcContext* /*ctx*/, rcHeightfield& hf) +{ + // TODO: VC complains about unref formal variable, figure out a way to handle this better. +// rcAssert(ctx); + + const int w = hf.width; + const int h = hf.height; + int spanCount = 0; + for (int y = 0; y < h; ++y) + { + for (int x = 0; x < w; ++x) + { + for (rcSpan* s = hf.spans[x + y*w]; s; s = s->next) + { + if (s->area != RC_NULL_AREA) + spanCount++; + } + } + } + return spanCount; +} + +bool rcBuildCompactHeightfield(rcContext* ctx, const int walkableHeight, const int walkableClimb, + rcHeightfield& hf, rcCompactHeightfield& chf) +{ + rcAssert(ctx); + + ctx->startTimer(RC_TIMER_BUILD_COMPACTHEIGHTFIELD); + + const int w = hf.width; + const int h = hf.height; + const int spanCount = rcGetHeightFieldSpanCount(ctx, hf); + + // Fill in header. + chf.width = w; + chf.height = h; + chf.spanCount = spanCount; + chf.walkableHeight = walkableHeight; + chf.walkableClimb = walkableClimb; + chf.maxRegions = 0; + rcVcopy(chf.bmin, hf.bmin); + rcVcopy(chf.bmax, hf.bmax); + chf.bmax[1] += walkableHeight*hf.ch; + chf.cs = hf.cs; + chf.ch = hf.ch; + chf.cells = (rcCompactCell*)rcAlloc(sizeof(rcCompactCell)*w*h, RC_ALLOC_PERM); + if (!chf.cells) + { + ctx->log(RC_LOG_ERROR, "rcBuildCompactHeightfield: Out of memory 'chf.cells' (%d)", w*h); + return false; + } + memset(chf.cells, 0, sizeof(rcCompactCell)*w*h); + chf.spans = (rcCompactSpan*)rcAlloc(sizeof(rcCompactSpan)*spanCount, RC_ALLOC_PERM); + if (!chf.spans) + { + ctx->log(RC_LOG_ERROR, "rcBuildCompactHeightfield: Out of memory 'chf.spans' (%d)", spanCount); + return false; + } + memset(chf.spans, 0, sizeof(rcCompactSpan)*spanCount); + chf.areas = (unsigned char*)rcAlloc(sizeof(unsigned char)*spanCount, RC_ALLOC_PERM); + if (!chf.areas) + { + ctx->log(RC_LOG_ERROR, "rcBuildCompactHeightfield: Out of memory 'chf.areas' (%d)", spanCount); + return false; + } + memset(chf.areas, RC_NULL_AREA, sizeof(unsigned char)*spanCount); + + const int MAX_HEIGHT = 0xffff; + + // Fill in cells and spans. + int idx = 0; + for (int y = 0; y < h; ++y) + { + for (int x = 0; x < w; ++x) + { + const rcSpan* s = hf.spans[x + y*w]; + // If there are no spans at this cell, just leave the data to index=0, count=0. + if (!s) continue; + rcCompactCell& c = chf.cells[x+y*w]; + c.index = idx; + c.count = 0; + while (s) + { + if (s->area != RC_NULL_AREA) + { + const int bot = (int)s->smax; + const int top = s->next ? (int)s->next->smin : MAX_HEIGHT; + chf.spans[idx].y = (unsigned short)rcClamp(bot, 0, 0xffff); + chf.spans[idx].h = (unsigned char)rcClamp(top - bot, 0, 0xff); + chf.areas[idx] = s->area; + idx++; + c.count++; + } + s = s->next; + } + } + } + + // Find neighbour connections. + const int MAX_LAYERS = RC_NOT_CONNECTED-1; + int tooHighNeighbour = 0; + for (int y = 0; y < h; ++y) + { + for (int x = 0; x < w; ++x) + { + const rcCompactCell& c = chf.cells[x+y*w]; + for (int i = (int)c.index, ni = (int)(c.index+c.count); i < ni; ++i) + { + rcCompactSpan& s = chf.spans[i]; + + for (int dir = 0; dir < 4; ++dir) + { + rcSetCon(s, dir, RC_NOT_CONNECTED); + const int nx = x + rcGetDirOffsetX(dir); + const int ny = y + rcGetDirOffsetY(dir); + // First check that the neighbour cell is in bounds. + if (nx < 0 || ny < 0 || nx >= w || ny >= h) + continue; + + // Iterate over all neighbour spans and check if any of the is + // accessible from current cell. + const rcCompactCell& nc = chf.cells[nx+ny*w]; + for (int k = (int)nc.index, nk = (int)(nc.index+nc.count); k < nk; ++k) + { + const rcCompactSpan& ns = chf.spans[k]; + const int bot = rcMax(s.y, ns.y); + const int top = rcMin(s.y+s.h, ns.y+ns.h); + + // Check that the gap between the spans is walkable, + // and that the climb height between the gaps is not too high. + if ((top - bot) >= walkableHeight && rcAbs((int)ns.y - (int)s.y) <= walkableClimb) + { + // Mark direction as walkable. + const int idx = k - (int)nc.index; + if (idx < 0 || idx > MAX_LAYERS) + { + tooHighNeighbour = rcMax(tooHighNeighbour, idx); + continue; + } + rcSetCon(s, dir, idx); + break; + } + } + + } + } + } + } + + if (tooHighNeighbour > MAX_LAYERS) + { + ctx->log(RC_LOG_ERROR, "rcBuildCompactHeightfield: Heightfield has too many layers %d (max: %d)", + tooHighNeighbour, MAX_LAYERS); + } + + ctx->stopTimer(RC_TIMER_BUILD_COMPACTHEIGHTFIELD); + + return true; +} + +/* +static int getHeightfieldMemoryUsage(const rcHeightfield& hf) +{ + int size = 0; + size += sizeof(hf); + size += hf.width * hf.height * sizeof(rcSpan*); + + rcSpanPool* pool = hf.pools; + while (pool) + { + size += (sizeof(rcSpanPool) - sizeof(rcSpan)) + sizeof(rcSpan)*RC_SPANS_PER_POOL; + pool = pool->next; + } + return size; +} + +static int getCompactHeightFieldMemoryusage(const rcCompactHeightfield& chf) +{ + int size = 0; + size += sizeof(rcCompactHeightfield); + size += sizeof(rcCompactSpan) * chf.spanCount; + size += sizeof(rcCompactCell) * chf.width * chf.height; + return size; +} +*/ \ No newline at end of file diff --git a/dep/recastnavigation/Recast/Source/RecastAlloc.cpp b/dep/recastnavigation/Recast/Source/RecastAlloc.cpp new file mode 100644 index 000000000..2c7396a1b --- /dev/null +++ b/dep/recastnavigation/Recast/Source/RecastAlloc.cpp @@ -0,0 +1,67 @@ +// +// Copyright (c) 2009-2010 Mikko Mononen memon@inside.org +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. +// + +#include +#include +#include "RecastAlloc.h" + +static void *rcAllocDefault(int size, rcAllocHint) +{ + return malloc(size); +} + +static void rcFreeDefault(void *ptr) +{ + free(ptr); +} + +static rcAllocFunc* sRecastAllocFunc = rcAllocDefault; +static rcFreeFunc* sRecastFreeFunc = rcFreeDefault; + +void rcAllocSetCustom(rcAllocFunc *allocFunc, rcFreeFunc *freeFunc) +{ + sRecastAllocFunc = allocFunc ? allocFunc : rcAllocDefault; + sRecastFreeFunc = freeFunc ? freeFunc : rcFreeDefault; +} + +void* rcAlloc(int size, rcAllocHint hint) +{ + return sRecastAllocFunc(size, hint); +} + +void rcFree(void* ptr) +{ + if (ptr) + sRecastFreeFunc(ptr); +} + + +void rcIntArray::resize(int n) +{ + if (n > m_cap) + { + if (!m_cap) m_cap = n; + while (m_cap < n) m_cap *= 2; + int* newData = (int*)rcAlloc(m_cap*sizeof(int), RC_ALLOC_TEMP); + if (m_size && newData) memcpy(newData, m_data, m_size*sizeof(int)); + rcFree(m_data); + m_data = newData; + } + m_size = n; +} + diff --git a/dep/recastnavigation/Recast/Source/RecastArea.cpp b/dep/recastnavigation/Recast/Source/RecastArea.cpp new file mode 100644 index 000000000..e89caee2a --- /dev/null +++ b/dep/recastnavigation/Recast/Source/RecastArea.cpp @@ -0,0 +1,413 @@ +// +// Copyright (c) 2009-2010 Mikko Mononen memon@inside.org +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. +// + +#include +#define _USE_MATH_DEFINES +#include +#include +#include +#include +#include "Recast.h" +#include "RecastAlloc.h" +#include "RecastAssert.h" + + +bool rcErodeWalkableArea(rcContext* ctx, int radius, rcCompactHeightfield& chf) +{ + rcAssert(ctx); + + const int w = chf.width; + const int h = chf.height; + + ctx->startTimer(RC_TIMER_ERODE_AREA); + + unsigned char* dist = (unsigned char*)rcAlloc(sizeof(unsigned char)*chf.spanCount, RC_ALLOC_TEMP); + if (!dist) + { + ctx->log(RC_LOG_ERROR, "erodeWalkableArea: Out of memory 'dist' (%d).", chf.spanCount); + return false; + } + + // Init distance. + memset(dist, 0xff, sizeof(unsigned char)*chf.spanCount); + + // Mark boundary cells. + for (int y = 0; y < h; ++y) + { + for (int x = 0; x < w; ++x) + { + const rcCompactCell& c = chf.cells[x+y*w]; + for (int i = (int)c.index, ni = (int)(c.index+c.count); i < ni; ++i) + { + if (chf.areas[i] != RC_NULL_AREA) + { + const rcCompactSpan& s = chf.spans[i]; + int nc = 0; + for (int dir = 0; dir < 4; ++dir) + { + if (rcGetCon(s, dir) != RC_NOT_CONNECTED) + nc++; + } + // At least one missing neighbour. + if (nc != 4) + dist[i] = 0; + } + } + } + } + + unsigned char nd; + + // Pass 1 + for (int y = 0; y < h; ++y) + { + for (int x = 0; x < w; ++x) + { + const rcCompactCell& c = chf.cells[x+y*w]; + for (int i = (int)c.index, ni = (int)(c.index+c.count); i < ni; ++i) + { + const rcCompactSpan& s = chf.spans[i]; + + if (rcGetCon(s, 0) != RC_NOT_CONNECTED) + { + // (-1,0) + const int ax = x + rcGetDirOffsetX(0); + const int ay = y + rcGetDirOffsetY(0); + const int ai = (int)chf.cells[ax+ay*w].index + rcGetCon(s, 0); + const rcCompactSpan& as = chf.spans[ai]; + nd = (unsigned char)rcMin((int)dist[ai]+2, 255); + if (nd < dist[i]) + dist[i] = nd; + + // (-1,-1) + if (rcGetCon(as, 3) != RC_NOT_CONNECTED) + { + const int aax = ax + rcGetDirOffsetX(3); + const int aay = ay + rcGetDirOffsetY(3); + const int aai = (int)chf.cells[aax+aay*w].index + rcGetCon(as, 3); + nd = (unsigned char)rcMin((int)dist[aai]+3, 255); + if (nd < dist[i]) + dist[i] = nd; + } + } + if (rcGetCon(s, 3) != RC_NOT_CONNECTED) + { + // (0,-1) + const int ax = x + rcGetDirOffsetX(3); + const int ay = y + rcGetDirOffsetY(3); + const int ai = (int)chf.cells[ax+ay*w].index + rcGetCon(s, 3); + const rcCompactSpan& as = chf.spans[ai]; + nd = (unsigned char)rcMin((int)dist[ai]+2, 255); + if (nd < dist[i]) + dist[i] = nd; + + // (1,-1) + if (rcGetCon(as, 2) != RC_NOT_CONNECTED) + { + const int aax = ax + rcGetDirOffsetX(2); + const int aay = ay + rcGetDirOffsetY(2); + const int aai = (int)chf.cells[aax+aay*w].index + rcGetCon(as, 2); + nd = (unsigned char)rcMin((int)dist[aai]+3, 255); + if (nd < dist[i]) + dist[i] = nd; + } + } + } + } + } + + // Pass 2 + for (int y = h-1; y >= 0; --y) + { + for (int x = w-1; x >= 0; --x) + { + const rcCompactCell& c = chf.cells[x+y*w]; + for (int i = (int)c.index, ni = (int)(c.index+c.count); i < ni; ++i) + { + const rcCompactSpan& s = chf.spans[i]; + + if (rcGetCon(s, 2) != RC_NOT_CONNECTED) + { + // (1,0) + const int ax = x + rcGetDirOffsetX(2); + const int ay = y + rcGetDirOffsetY(2); + const int ai = (int)chf.cells[ax+ay*w].index + rcGetCon(s, 2); + const rcCompactSpan& as = chf.spans[ai]; + nd = (unsigned char)rcMin((int)dist[ai]+2, 255); + if (nd < dist[i]) + dist[i] = nd; + + // (1,1) + if (rcGetCon(as, 1) != RC_NOT_CONNECTED) + { + const int aax = ax + rcGetDirOffsetX(1); + const int aay = ay + rcGetDirOffsetY(1); + const int aai = (int)chf.cells[aax+aay*w].index + rcGetCon(as, 1); + nd = (unsigned char)rcMin((int)dist[aai]+3, 255); + if (nd < dist[i]) + dist[i] = nd; + } + } + if (rcGetCon(s, 1) != RC_NOT_CONNECTED) + { + // (0,1) + const int ax = x + rcGetDirOffsetX(1); + const int ay = y + rcGetDirOffsetY(1); + const int ai = (int)chf.cells[ax+ay*w].index + rcGetCon(s, 1); + const rcCompactSpan& as = chf.spans[ai]; + nd = (unsigned char)rcMin((int)dist[ai]+2, 255); + if (nd < dist[i]) + dist[i] = nd; + + // (-1,1) + if (rcGetCon(as, 0) != RC_NOT_CONNECTED) + { + const int aax = ax + rcGetDirOffsetX(0); + const int aay = ay + rcGetDirOffsetY(0); + const int aai = (int)chf.cells[aax+aay*w].index + rcGetCon(as, 0); + nd = (unsigned char)rcMin((int)dist[aai]+3, 255); + if (nd < dist[i]) + dist[i] = nd; + } + } + } + } + } + + const unsigned char thr = (unsigned char)(radius*2); + for (int i = 0; i < chf.spanCount; ++i) + if (dist[i] < thr) + chf.areas[i] = RC_NULL_AREA; + + rcFree(dist); + + ctx->stopTimer(RC_TIMER_ERODE_AREA); + + return true; +} + +static void insertSort(unsigned char* a, const int n) +{ + int i, j; + for (i = 1; i < n; i++) + { + const unsigned char value = a[i]; + for (j = i - 1; j >= 0 && a[j] > value; j--) + a[j+1] = a[j]; + a[j+1] = value; + } +} + + +bool rcMedianFilterWalkableArea(rcContext* ctx, rcCompactHeightfield& chf) +{ + rcAssert(ctx); + + const int w = chf.width; + const int h = chf.height; + + ctx->startTimer(RC_TIMER_MEDIAN_AREA); + + unsigned char* areas = (unsigned char*)rcAlloc(sizeof(unsigned char)*chf.spanCount, RC_ALLOC_TEMP); + if (!areas) + { + ctx->log(RC_LOG_ERROR, "medianFilterWalkableArea: Out of memory 'areas' (%d).", chf.spanCount); + return false; + } + + // Init distance. + memset(areas, 0xff, sizeof(unsigned char)*chf.spanCount); + + for (int y = 0; y < h; ++y) + { + for (int x = 0; x < w; ++x) + { + const rcCompactCell& c = chf.cells[x+y*w]; + for (int i = (int)c.index, ni = (int)(c.index+c.count); i < ni; ++i) + { + const rcCompactSpan& s = chf.spans[i]; + if (chf.areas[i] == RC_NULL_AREA) + { + areas[i] = chf.areas[i]; + continue; + } + + unsigned char nei[9]; + for (int j = 0; j < 9; ++j) + nei[j] = chf.areas[i]; + + for (int dir = 0; dir < 4; ++dir) + { + if (rcGetCon(s, dir) != RC_NOT_CONNECTED) + { + const int ax = x + rcGetDirOffsetX(dir); + const int ay = y + rcGetDirOffsetY(dir); + const int ai = (int)chf.cells[ax+ay*w].index + rcGetCon(s, dir); + if (chf.areas[ai] != RC_NULL_AREA) + nei[dir*2+0] = chf.areas[ai]; + + const rcCompactSpan& as = chf.spans[ai]; + const int dir2 = (dir+1) & 0x3; + if (rcGetCon(as, dir2) != RC_NOT_CONNECTED) + { + const int ax2 = ax + rcGetDirOffsetX(dir2); + const int ay2 = ay + rcGetDirOffsetY(dir2); + const int ai2 = (int)chf.cells[ax2+ay2*w].index + rcGetCon(as, dir2); + if (chf.areas[ai2] != RC_NULL_AREA) + nei[dir*2+1] = chf.areas[ai2]; + } + } + } + insertSort(nei, 9); + areas[i] = nei[4]; + } + } + } + + memcpy(chf.areas, areas, sizeof(unsigned char)*chf.spanCount); + + rcFree(areas); + + ctx->stopTimer(RC_TIMER_MEDIAN_AREA); + + return true; +} + +void rcMarkBoxArea(rcContext* ctx, const float* bmin, const float* bmax, unsigned char areaId, + rcCompactHeightfield& chf) +{ + rcAssert(ctx); + + ctx->startTimer(RC_TIMER_MARK_BOX_AREA); + + int minx = (int)((bmin[0]-chf.bmin[0])/chf.cs); + int miny = (int)((bmin[1]-chf.bmin[1])/chf.ch); + int minz = (int)((bmin[2]-chf.bmin[2])/chf.cs); + int maxx = (int)((bmax[0]-chf.bmin[0])/chf.cs); + int maxy = (int)((bmax[1]-chf.bmin[1])/chf.ch); + int maxz = (int)((bmax[2]-chf.bmin[2])/chf.cs); + + if (maxx < 0) return; + if (minx >= chf.width) return; + if (maxz < 0) return; + if (minz >= chf.height) return; + + if (minx < 0) minx = 0; + if (maxx >= chf.width) maxx = chf.width-1; + if (minz < 0) minz = 0; + if (maxz >= chf.height) maxz = chf.height-1; + + for (int z = minz; z <= maxz; ++z) + { + for (int x = minx; x <= maxx; ++x) + { + const rcCompactCell& c = chf.cells[x+z*chf.width]; + for (int i = (int)c.index, ni = (int)(c.index+c.count); i < ni; ++i) + { + rcCompactSpan& s = chf.spans[i]; + if ((int)s.y >= miny && (int)s.y <= maxy) + { + chf.areas[i] = areaId; + } + } + } + } + + ctx->stopTimer(RC_TIMER_MARK_BOX_AREA); + +} + + +static int pointInPoly(int nvert, const float* verts, const float* p) +{ + int i, j, c = 0; + for (i = 0, j = nvert-1; i < nvert; j = i++) + { + const float* vi = &verts[i*3]; + const float* vj = &verts[j*3]; + if (((vi[2] > p[2]) != (vj[2] > p[2])) && + (p[0] < (vj[0]-vi[0]) * (p[2]-vi[2]) / (vj[2]-vi[2]) + vi[0]) ) + c = !c; + } + return c; +} + +void rcMarkConvexPolyArea(rcContext* ctx, const float* verts, const int nverts, + const float hmin, const float hmax, unsigned char areaId, + rcCompactHeightfield& chf) +{ + rcAssert(ctx); + + ctx->startTimer(RC_TIMER_MARK_CONVEXPOLY_AREA); + + float bmin[3], bmax[3]; + rcVcopy(bmin, verts); + rcVcopy(bmax, verts); + for (int i = 1; i < nverts; ++i) + { + rcVmin(bmin, &verts[i*3]); + rcVmax(bmax, &verts[i*3]); + } + bmin[1] = hmin; + bmax[1] = hmax; + + int minx = (int)((bmin[0]-chf.bmin[0])/chf.cs); + int miny = (int)((bmin[1]-chf.bmin[1])/chf.ch); + int minz = (int)((bmin[2]-chf.bmin[2])/chf.cs); + int maxx = (int)((bmax[0]-chf.bmin[0])/chf.cs); + int maxy = (int)((bmax[1]-chf.bmin[1])/chf.ch); + int maxz = (int)((bmax[2]-chf.bmin[2])/chf.cs); + + if (maxx < 0) return; + if (minx >= chf.width) return; + if (maxz < 0) return; + if (minz >= chf.height) return; + + if (minx < 0) minx = 0; + if (maxx >= chf.width) maxx = chf.width-1; + if (minz < 0) minz = 0; + if (maxz >= chf.height) maxz = chf.height-1; + + + // TODO: Optimize. + for (int z = minz; z <= maxz; ++z) + { + for (int x = minx; x <= maxx; ++x) + { + const rcCompactCell& c = chf.cells[x+z*chf.width]; + for (int i = (int)c.index, ni = (int)(c.index+c.count); i < ni; ++i) + { + rcCompactSpan& s = chf.spans[i]; + if ((int)s.y >= miny && (int)s.y <= maxy) + { + float p[3]; + p[0] = chf.bmin[0] + (x+0.5f)*chf.cs; + p[1] = 0; + p[2] = chf.bmin[2] + (z+0.5f)*chf.cs; + + if (pointInPoly(nverts, verts, p)) + { + chf.areas[i] = areaId; + } + } + } + } + } + + ctx->stopTimer(RC_TIMER_MARK_CONVEXPOLY_AREA); +} diff --git a/dep/recastnavigation/Recast/Source/RecastContour.cpp b/dep/recastnavigation/Recast/Source/RecastContour.cpp new file mode 100644 index 000000000..1906b6e6f --- /dev/null +++ b/dep/recastnavigation/Recast/Source/RecastContour.cpp @@ -0,0 +1,804 @@ +// +// Copyright (c) 2009-2010 Mikko Mononen memon@inside.org +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. +// + +#define _USE_MATH_DEFINES +#include +#include +#include +#include "Recast.h" +#include "RecastAlloc.h" +#include "RecastAssert.h" + + +static int getCornerHeight(int x, int y, int i, int dir, + const rcCompactHeightfield& chf, + bool& isBorderVertex) +{ + const rcCompactSpan& s = chf.spans[i]; + int ch = (int)s.y; + int dirp = (dir+1) & 0x3; + + unsigned int regs[4] = {0,0,0,0}; + + // Combine region and area codes in order to prevent + // border vertices which are in between two areas to be removed. + regs[0] = chf.spans[i].reg | (chf.areas[i] << 16); + + if (rcGetCon(s, dir) != RC_NOT_CONNECTED) + { + const int ax = x + rcGetDirOffsetX(dir); + const int ay = y + rcGetDirOffsetY(dir); + const int ai = (int)chf.cells[ax+ay*chf.width].index + rcGetCon(s, dir); + const rcCompactSpan& as = chf.spans[ai]; + ch = rcMax(ch, (int)as.y); + regs[1] = chf.spans[ai].reg | (chf.areas[ai] << 16); + if (rcGetCon(as, dirp) != RC_NOT_CONNECTED) + { + const int ax2 = ax + rcGetDirOffsetX(dirp); + const int ay2 = ay + rcGetDirOffsetY(dirp); + const int ai2 = (int)chf.cells[ax2+ay2*chf.width].index + rcGetCon(as, dirp); + const rcCompactSpan& as2 = chf.spans[ai2]; + ch = rcMax(ch, (int)as2.y); + regs[2] = chf.spans[ai2].reg | (chf.areas[ai2] << 16); + } + } + if (rcGetCon(s, dirp) != RC_NOT_CONNECTED) + { + const int ax = x + rcGetDirOffsetX(dirp); + const int ay = y + rcGetDirOffsetY(dirp); + const int ai = (int)chf.cells[ax+ay*chf.width].index + rcGetCon(s, dirp); + const rcCompactSpan& as = chf.spans[ai]; + ch = rcMax(ch, (int)as.y); + regs[3] = chf.spans[ai].reg | (chf.areas[ai] << 16); + if (rcGetCon(as, dir) != RC_NOT_CONNECTED) + { + const int ax2 = ax + rcGetDirOffsetX(dir); + const int ay2 = ay + rcGetDirOffsetY(dir); + const int ai2 = (int)chf.cells[ax2+ay2*chf.width].index + rcGetCon(as, dir); + const rcCompactSpan& as2 = chf.spans[ai2]; + ch = rcMax(ch, (int)as2.y); + regs[2] = chf.spans[ai2].reg | (chf.areas[ai2] << 16); + } + } + + // Check if the vertex is special edge vertex, these vertices will be removed later. + for (int j = 0; j < 4; ++j) + { + const int a = j; + const int b = (j+1) & 0x3; + const int c = (j+2) & 0x3; + const int d = (j+3) & 0x3; + + // The vertex is a border vertex there are two same exterior cells in a row, + // followed by two interior cells and none of the regions are out of bounds. + const bool twoSameExts = (regs[a] & regs[b] & RC_BORDER_REG) != 0 && regs[a] == regs[b]; + const bool twoInts = ((regs[c] | regs[d]) & RC_BORDER_REG) == 0; + const bool intsSameArea = (regs[c]>>16) == (regs[d]>>16); + const bool noZeros = regs[a] != 0 && regs[b] != 0 && regs[c] != 0 && regs[d] != 0; + if (twoSameExts && twoInts && intsSameArea && noZeros) + { + isBorderVertex = true; + break; + } + } + + return ch; +} + +static void walkContour(int x, int y, int i, + rcCompactHeightfield& chf, + unsigned char* flags, rcIntArray& points) +{ + // Choose the first non-connected edge + unsigned char dir = 0; + while ((flags[i] & (1 << dir)) == 0) + dir++; + + unsigned char startDir = dir; + int starti = i; + + const unsigned char area = chf.areas[i]; + + int iter = 0; + while (++iter < 40000) + { + if (flags[i] & (1 << dir)) + { + // Choose the edge corner + bool isBorderVertex = false; + bool isAreaBorder = false; + int px = x; + int py = getCornerHeight(x, y, i, dir, chf, isBorderVertex); + int pz = y; + switch(dir) + { + case 0: pz++; break; + case 1: px++; pz++; break; + case 2: px++; break; + } + int r = 0; + const rcCompactSpan& s = chf.spans[i]; + if (rcGetCon(s, dir) != RC_NOT_CONNECTED) + { + const int ax = x + rcGetDirOffsetX(dir); + const int ay = y + rcGetDirOffsetY(dir); + const int ai = (int)chf.cells[ax+ay*chf.width].index + rcGetCon(s, dir); + r = (int)chf.spans[ai].reg; + if (area != chf.areas[ai]) + isAreaBorder = true; + } + if (isBorderVertex) + r |= RC_BORDER_VERTEX; + if (isAreaBorder) + r |= RC_AREA_BORDER; + points.push(px); + points.push(py); + points.push(pz); + points.push(r); + + flags[i] &= ~(1 << dir); // Remove visited edges + dir = (dir+1) & 0x3; // Rotate CW + } + else + { + int ni = -1; + const int nx = x + rcGetDirOffsetX(dir); + const int ny = y + rcGetDirOffsetY(dir); + const rcCompactSpan& s = chf.spans[i]; + if (rcGetCon(s, dir) != RC_NOT_CONNECTED) + { + const rcCompactCell& nc = chf.cells[nx+ny*chf.width]; + ni = (int)nc.index + rcGetCon(s, dir); + } + if (ni == -1) + { + // Should not happen. + return; + } + x = nx; + y = ny; + i = ni; + dir = (dir+3) & 0x3; // Rotate CCW + } + + if (starti == i && startDir == dir) + { + break; + } + } +} + +static float distancePtSeg(const int x, const int z, + const int px, const int pz, + const int qx, const int qz) +{ +/* float pqx = (float)(qx - px); + float pqy = (float)(qy - py); + float pqz = (float)(qz - pz); + float dx = (float)(x - px); + float dy = (float)(y - py); + float dz = (float)(z - pz); + float d = pqx*pqx + pqy*pqy + pqz*pqz; + float t = pqx*dx + pqy*dy + pqz*dz; + if (d > 0) + t /= d; + if (t < 0) + t = 0; + else if (t > 1) + t = 1; + + dx = px + t*pqx - x; + dy = py + t*pqy - y; + dz = pz + t*pqz - z; + + return dx*dx + dy*dy + dz*dz;*/ + + float pqx = (float)(qx - px); + float pqz = (float)(qz - pz); + float dx = (float)(x - px); + float dz = (float)(z - pz); + float d = pqx*pqx + pqz*pqz; + float t = pqx*dx + pqz*dz; + if (d > 0) + t /= d; + if (t < 0) + t = 0; + else if (t > 1) + t = 1; + + dx = px + t*pqx - x; + dz = pz + t*pqz - z; + + return dx*dx + dz*dz; +} + +static void simplifyContour(rcIntArray& points, rcIntArray& simplified, + const float maxError, const int maxEdgeLen, const int buildFlags) +{ + // Add initial points. + bool hasConnections = false; + for (int i = 0; i < points.size(); i += 4) + { + if ((points[i+3] & RC_CONTOUR_REG_MASK) != 0) + { + hasConnections = true; + break; + } + } + + if (hasConnections) + { + // The contour has some portals to other regions. + // Add a new point to every location where the region changes. + for (int i = 0, ni = points.size()/4; i < ni; ++i) + { + int ii = (i+1) % ni; + const bool differentRegs = (points[i*4+3] & RC_CONTOUR_REG_MASK) != (points[ii*4+3] & RC_CONTOUR_REG_MASK); + const bool areaBorders = (points[i*4+3] & RC_AREA_BORDER) != (points[ii*4+3] & RC_AREA_BORDER); + if (differentRegs || areaBorders) + { + simplified.push(points[i*4+0]); + simplified.push(points[i*4+1]); + simplified.push(points[i*4+2]); + simplified.push(i); + } + } + } + + if (simplified.size() == 0) + { + // If there is no connections at all, + // create some initial points for the simplification process. + // Find lower-left and upper-right vertices of the contour. + int llx = points[0]; + int lly = points[1]; + int llz = points[2]; + int lli = 0; + int urx = points[0]; + int ury = points[1]; + int urz = points[2]; + int uri = 0; + for (int i = 0; i < points.size(); i += 4) + { + int x = points[i+0]; + int y = points[i+1]; + int z = points[i+2]; + if (x < llx || (x == llx && z < llz)) + { + llx = x; + lly = y; + llz = z; + lli = i/4; + } + if (x > urx || (x == urx && z > urz)) + { + urx = x; + ury = y; + urz = z; + uri = i/4; + } + } + simplified.push(llx); + simplified.push(lly); + simplified.push(llz); + simplified.push(lli); + + simplified.push(urx); + simplified.push(ury); + simplified.push(urz); + simplified.push(uri); + } + + // Add points until all raw points are within + // error tolerance to the simplified shape. + const int pn = points.size()/4; + for (int i = 0; i < simplified.size()/4; ) + { + int ii = (i+1) % (simplified.size()/4); + + const int ax = simplified[i*4+0]; + const int az = simplified[i*4+2]; + const int ai = simplified[i*4+3]; + + const int bx = simplified[ii*4+0]; + const int bz = simplified[ii*4+2]; + const int bi = simplified[ii*4+3]; + + // Find maximum deviation from the segment. + float maxd = 0; + int maxi = -1; + int ci, cinc, endi; + + // Traverse the segment in lexilogical order so that the + // max deviation is calculated similarly when traversing + // opposite segments. + if (bx > ax || (bx == ax && bz > az)) + { + cinc = 1; + ci = (ai+cinc) % pn; + endi = bi; + } + else + { + cinc = pn-1; + ci = (bi+cinc) % pn; + endi = ai; + } + + // Tessellate only outer edges oredges between areas. + if ((points[ci*4+3] & RC_CONTOUR_REG_MASK) == 0 || + (points[ci*4+3] & RC_AREA_BORDER)) + { + while (ci != endi) + { + float d = distancePtSeg(points[ci*4+0], points[ci*4+2], ax, az, bx, bz); + if (d > maxd) + { + maxd = d; + maxi = ci; + } + ci = (ci+cinc) % pn; + } + } + + + // If the max deviation is larger than accepted error, + // add new point, else continue to next segment. + if (maxi != -1 && maxd > (maxError*maxError)) + { + // Add space for the new point. + simplified.resize(simplified.size()+4); + const int n = simplified.size()/4; + for (int j = n-1; j > i; --j) + { + simplified[j*4+0] = simplified[(j-1)*4+0]; + simplified[j*4+1] = simplified[(j-1)*4+1]; + simplified[j*4+2] = simplified[(j-1)*4+2]; + simplified[j*4+3] = simplified[(j-1)*4+3]; + } + // Add the point. + simplified[(i+1)*4+0] = points[maxi*4+0]; + simplified[(i+1)*4+1] = points[maxi*4+1]; + simplified[(i+1)*4+2] = points[maxi*4+2]; + simplified[(i+1)*4+3] = maxi; + } + else + { + ++i; + } + } + + // Split too long edges. + if (maxEdgeLen > 0 && (buildFlags & (RC_CONTOUR_TESS_WALL_EDGES|RC_CONTOUR_TESS_AREA_EDGES)) != 0) + { + for (int i = 0; i < simplified.size()/4; ) + { + const int ii = (i+1) % (simplified.size()/4); + + const int ax = simplified[i*4+0]; + const int az = simplified[i*4+2]; + const int ai = simplified[i*4+3]; + + const int bx = simplified[ii*4+0]; + const int bz = simplified[ii*4+2]; + const int bi = simplified[ii*4+3]; + + // Find maximum deviation from the segment. + int maxi = -1; + int ci = (ai+1) % pn; + + // Tessellate only outer edges or edges between areas. + bool tess = false; + // Wall edges. + if ((buildFlags & RC_CONTOUR_TESS_WALL_EDGES) && (points[ci*4+3] & RC_CONTOUR_REG_MASK) == 0) + tess = true; + // Edges between areas. + if ((buildFlags & RC_CONTOUR_TESS_AREA_EDGES) && (points[ci*4+3] & RC_AREA_BORDER)) + tess = true; + + if (tess) + { + int dx = bx - ax; + int dz = bz - az; + if (dx*dx + dz*dz > maxEdgeLen*maxEdgeLen) + { + // Round based on the segments in lexilogical order so that the + // max tesselation is consistent regardles in which direction + // segments are traversed. + if (bx > ax || (bx == ax && bz > az)) + { + const int n = bi < ai ? (bi+pn - ai) : (bi - ai); + maxi = (ai + n/2) % pn; + } + else + { + const int n = bi < ai ? (bi+pn - ai) : (bi - ai); + maxi = (ai + (n+1)/2) % pn; + } + } + } + + // If the max deviation is larger than accepted error, + // add new point, else continue to next segment. + if (maxi != -1) + { + // Add space for the new point. + simplified.resize(simplified.size()+4); + const int n = simplified.size()/4; + for (int j = n-1; j > i; --j) + { + simplified[j*4+0] = simplified[(j-1)*4+0]; + simplified[j*4+1] = simplified[(j-1)*4+1]; + simplified[j*4+2] = simplified[(j-1)*4+2]; + simplified[j*4+3] = simplified[(j-1)*4+3]; + } + // Add the point. + simplified[(i+1)*4+0] = points[maxi*4+0]; + simplified[(i+1)*4+1] = points[maxi*4+1]; + simplified[(i+1)*4+2] = points[maxi*4+2]; + simplified[(i+1)*4+3] = maxi; + } + else + { + ++i; + } + } + } + + for (int i = 0; i < simplified.size()/4; ++i) + { + // The edge vertex flag is take from the current raw point, + // and the neighbour region is take from the next raw point. + const int ai = (simplified[i*4+3]+1) % pn; + const int bi = simplified[i*4+3]; + simplified[i*4+3] = (points[ai*4+3] & RC_CONTOUR_REG_MASK) | (points[bi*4+3] & RC_BORDER_VERTEX); + } + +} + +static void removeDegenerateSegments(rcIntArray& simplified) +{ + // Remove adjacent vertices which are equal on xz-plane, + // or else the triangulator will get confused. + for (int i = 0; i < simplified.size()/4; ++i) + { + int ni = i+1; + if (ni >= (simplified.size()/4)) + ni = 0; + + if (simplified[i*4+0] == simplified[ni*4+0] && + simplified[i*4+2] == simplified[ni*4+2]) + { + // Degenerate segment, remove. + for (int j = i; j < simplified.size()/4-1; ++j) + { + simplified[j*4+0] = simplified[(j+1)*4+0]; + simplified[j*4+1] = simplified[(j+1)*4+1]; + simplified[j*4+2] = simplified[(j+1)*4+2]; + simplified[j*4+3] = simplified[(j+1)*4+3]; + } + simplified.resize(simplified.size()-4); + } + } +} + +static int calcAreaOfPolygon2D(const int* verts, const int nverts) +{ + int area = 0; + for (int i = 0, j = nverts-1; i < nverts; j=i++) + { + const int* vi = &verts[i*4]; + const int* vj = &verts[j*4]; + area += vi[0] * vj[2] - vj[0] * vi[2]; + } + return (area+1) / 2; +} + +inline bool ileft(const int* a, const int* b, const int* c) +{ + return (b[0] - a[0]) * (c[2] - a[2]) - (c[0] - a[0]) * (b[2] - a[2]) <= 0; +} + +static void getClosestIndices(const int* vertsa, const int nvertsa, + const int* vertsb, const int nvertsb, + int& ia, int& ib) +{ + int closestDist = 0xfffffff; + ia = -1, ib = -1; + for (int i = 0; i < nvertsa; ++i) + { + const int in = (i+1) % nvertsa; + const int ip = (i+nvertsa-1) % nvertsa; + const int* va = &vertsa[i*4]; + const int* van = &vertsa[in*4]; + const int* vap = &vertsa[ip*4]; + + for (int j = 0; j < nvertsb; ++j) + { + const int* vb = &vertsb[j*4]; + // vb must be "infront" of va. + if (ileft(vap,va,vb) && ileft(va,van,vb)) + { + const int dx = vb[0] - va[0]; + const int dz = vb[2] - va[2]; + const int d = dx*dx + dz*dz; + if (d < closestDist) + { + ia = i; + ib = j; + closestDist = d; + } + } + } + } +} + +static bool mergeContours(rcContour& ca, rcContour& cb, int ia, int ib) +{ + const int maxVerts = ca.nverts + cb.nverts + 2; + int* verts = (int*)rcAlloc(sizeof(int)*maxVerts*4, RC_ALLOC_PERM); + if (!verts) + return false; + + int nv = 0; + + // Copy contour A. + for (int i = 0; i <= ca.nverts; ++i) + { + int* dst = &verts[nv*4]; + const int* src = &ca.verts[((ia+i)%ca.nverts)*4]; + dst[0] = src[0]; + dst[1] = src[1]; + dst[2] = src[2]; + dst[3] = src[3]; + nv++; + } + + // Copy contour B + for (int i = 0; i <= cb.nverts; ++i) + { + int* dst = &verts[nv*4]; + const int* src = &cb.verts[((ib+i)%cb.nverts)*4]; + dst[0] = src[0]; + dst[1] = src[1]; + dst[2] = src[2]; + dst[3] = src[3]; + nv++; + } + + rcFree(ca.verts); + ca.verts = verts; + ca.nverts = nv; + + rcFree(cb.verts); + cb.verts = 0; + cb.nverts = 0; + + return true; +} + +bool rcBuildContours(rcContext* ctx, rcCompactHeightfield& chf, + const float maxError, const int maxEdgeLen, + rcContourSet& cset, const int buildFlags) +{ + rcAssert(ctx); + + const int w = chf.width; + const int h = chf.height; + + ctx->startTimer(RC_TIMER_BUILD_CONTOURS); + + rcVcopy(cset.bmin, chf.bmin); + rcVcopy(cset.bmax, chf.bmax); + cset.cs = chf.cs; + cset.ch = chf.ch; + + int maxContours = rcMax((int)chf.maxRegions, 8); + cset.conts = (rcContour*)rcAlloc(sizeof(rcContour)*maxContours, RC_ALLOC_PERM); + if (!cset.conts) + return false; + cset.nconts = 0; + + rcScopedDelete flags = (unsigned char*)rcAlloc(sizeof(unsigned char)*chf.spanCount, RC_ALLOC_TEMP); + if (!flags) + { + ctx->log(RC_LOG_ERROR, "rcBuildContours: Out of memory 'flags' (%d).", chf.spanCount); + return false; + } + + ctx->startTimer(RC_TIMER_BUILD_CONTOURS_TRACE); + + // Mark boundaries. + for (int y = 0; y < h; ++y) + { + for (int x = 0; x < w; ++x) + { + const rcCompactCell& c = chf.cells[x+y*w]; + for (int i = (int)c.index, ni = (int)(c.index+c.count); i < ni; ++i) + { + unsigned char res = 0; + const rcCompactSpan& s = chf.spans[i]; + if (!chf.spans[i].reg || (chf.spans[i].reg & RC_BORDER_REG)) + { + flags[i] = 0; + continue; + } + for (int dir = 0; dir < 4; ++dir) + { + unsigned short r = 0; + if (rcGetCon(s, dir) != RC_NOT_CONNECTED) + { + const int ax = x + rcGetDirOffsetX(dir); + const int ay = y + rcGetDirOffsetY(dir); + const int ai = (int)chf.cells[ax+ay*w].index + rcGetCon(s, dir); + r = chf.spans[ai].reg; + } + if (r == chf.spans[i].reg) + res |= (1 << dir); + } + flags[i] = res ^ 0xf; // Inverse, mark non connected edges. + } + } + } + + ctx->stopTimer(RC_TIMER_BUILD_CONTOURS_TRACE); + + ctx->startTimer(RC_TIMER_BUILD_CONTOURS_SIMPLIFY); + + rcIntArray verts(256); + rcIntArray simplified(64); + + for (int y = 0; y < h; ++y) + { + for (int x = 0; x < w; ++x) + { + const rcCompactCell& c = chf.cells[x+y*w]; + for (int i = (int)c.index, ni = (int)(c.index+c.count); i < ni; ++i) + { + if (flags[i] == 0 || flags[i] == 0xf) + { + flags[i] = 0; + continue; + } + const unsigned short reg = chf.spans[i].reg; + if (!reg || (reg & RC_BORDER_REG)) + continue; + const unsigned char area = chf.areas[i]; + + verts.resize(0); + simplified.resize(0); + walkContour(x, y, i, chf, flags, verts); + simplifyContour(verts, simplified, maxError, maxEdgeLen, buildFlags); + removeDegenerateSegments(simplified); + + // Store region->contour remap info. + // Create contour. + if (simplified.size()/4 >= 3) + { + if (cset.nconts >= maxContours) + { + // Allocate more contours. + // This can happen when there are tiny holes in the heightfield. + const int oldMax = maxContours; + maxContours *= 2; + rcContour* newConts = (rcContour*)rcAlloc(sizeof(rcContour)*maxContours, RC_ALLOC_PERM); + for (int j = 0; j < cset.nconts; ++j) + { + newConts[j] = cset.conts[j]; + // Reset source pointers to prevent data deletion. + cset.conts[j].verts = 0; + cset.conts[j].rverts = 0; + } + rcFree(cset.conts); + cset.conts = newConts; + + ctx->log(RC_LOG_WARNING, "rcBuildContours: Expanding max contours from %d to %d.", oldMax, maxContours); + } + + rcContour* cont = &cset.conts[cset.nconts++]; + + cont->nverts = simplified.size()/4; + cont->verts = (int*)rcAlloc(sizeof(int)*cont->nverts*4, RC_ALLOC_PERM); + if (!cont->verts) + { + ctx->log(RC_LOG_ERROR, "rcBuildContours: Out of memory 'verts' (%d).", cont->nverts); + return false; + } + memcpy(cont->verts, &simplified[0], sizeof(int)*cont->nverts*4); + + cont->nrverts = verts.size()/4; + cont->rverts = (int*)rcAlloc(sizeof(int)*cont->nrverts*4, RC_ALLOC_PERM); + if (!cont->rverts) + { + ctx->log(RC_LOG_ERROR, "rcBuildContours: Out of memory 'rverts' (%d).", cont->nrverts); + return false; + } + memcpy(cont->rverts, &verts[0], sizeof(int)*cont->nrverts*4); + +/* cont->cx = cont->cy = cont->cz = 0; + for (int i = 0; i < cont->nverts; ++i) + { + cont->cx += cont->verts[i*4+0]; + cont->cy += cont->verts[i*4+1]; + cont->cz += cont->verts[i*4+2]; + } + cont->cx /= cont->nverts; + cont->cy /= cont->nverts; + cont->cz /= cont->nverts;*/ + + cont->reg = reg; + cont->area = area; + } + } + } + } + + // Check and merge droppings. + // Sometimes the previous algorithms can fail and create several contours + // per area. This pass will try to merge the holes into the main region. + for (int i = 0; i < cset.nconts; ++i) + { + rcContour& cont = cset.conts[i]; + // Check if the contour is would backwards. + if (calcAreaOfPolygon2D(cont.verts, cont.nverts) < 0) + { + // Find another contour which has the same region ID. + int mergeIdx = -1; + for (int j = 0; j < cset.nconts; ++j) + { + if (i == j) continue; + if (cset.conts[j].nverts && cset.conts[j].reg == cont.reg) + { + // Make sure the polygon is correctly oriented. + if (calcAreaOfPolygon2D(cset.conts[j].verts, cset.conts[j].nverts)) + { + mergeIdx = j; + break; + } + } + } + if (mergeIdx == -1) + { + ctx->log(RC_LOG_WARNING, "rcBuildContours: Could not find merge target for bad contour %d.", i); + } + else + { + rcContour& mcont = cset.conts[mergeIdx]; + // Merge by closest points. + int ia = 0, ib = 0; + getClosestIndices(mcont.verts, mcont.nverts, cont.verts, cont.nverts, ia, ib); + if (ia == -1 || ib == -1) + { + ctx->log(RC_LOG_WARNING, "rcBuildContours: Failed to find merge points for %d and %d.", i, mergeIdx); + continue; + } + if (!mergeContours(mcont, cont, ia, ib)) + { + ctx->log(RC_LOG_WARNING, "rcBuildContours: Failed to merge contours %d and %d.", i, mergeIdx); + continue; + } + } + } + } + + ctx->stopTimer(RC_TIMER_BUILD_CONTOURS_SIMPLIFY); + + ctx->stopTimer(RC_TIMER_BUILD_CONTOURS); + + return true; +} diff --git a/dep/recastnavigation/Recast/Source/RecastFilter.cpp b/dep/recastnavigation/Recast/Source/RecastFilter.cpp new file mode 100644 index 000000000..d01808a79 --- /dev/null +++ b/dep/recastnavigation/Recast/Source/RecastFilter.cpp @@ -0,0 +1,179 @@ +// +// Copyright (c) 2009-2010 Mikko Mononen memon@inside.org +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. +// + +#define _USE_MATH_DEFINES +#include +#include +#include "Recast.h" +#include "RecastAssert.h" + + +void rcFilterLowHangingWalkableObstacles(rcContext* ctx, const int walkableClimb, rcHeightfield& solid) +{ + rcAssert(ctx); + + ctx->startTimer(RC_TIMER_FILTER_LOW_OBSTACLES); + + const int w = solid.width; + const int h = solid.height; + + for (int y = 0; y < h; ++y) + { + for (int x = 0; x < w; ++x) + { + rcSpan* ps = 0; + bool previousWalkable = false; + + for (rcSpan* s = solid.spans[x + y*w]; s; ps = s, s = s->next) + { + const bool walkable = s->area != RC_NULL_AREA; + // If current span is not walkable, but there is walkable + // span just below it, mark the span above it walkable too. + if (!walkable && previousWalkable) + { + if (rcAbs((int)s->smax - (int)ps->smax) <= walkableClimb) + s->area = RC_NULL_AREA; + } + // Copy walkable flag so that it cannot propagate + // past multiple non-walkable objects. + previousWalkable = walkable; + } + } + } + + ctx->stopTimer(RC_TIMER_FILTER_LOW_OBSTACLES); +} + +void rcFilterLedgeSpans(rcContext* ctx, const int walkableHeight, const int walkableClimb, + rcHeightfield& solid) +{ + rcAssert(ctx); + + ctx->startTimer(RC_TIMER_FILTER_BORDER); + + const int w = solid.width; + const int h = solid.height; + const int MAX_HEIGHT = 0xffff; + + // Mark border spans. + for (int y = 0; y < h; ++y) + { + for (int x = 0; x < w; ++x) + { + for (rcSpan* s = solid.spans[x + y*w]; s; s = s->next) + { + // Skip non walkable spans. + if (s->area == RC_NULL_AREA) + continue; + + const int bot = (int)(s->smax); + const int top = s->next ? (int)(s->next->smin) : MAX_HEIGHT; + + // Find neighbours minimum height. + int minh = MAX_HEIGHT; + + // Min and max height of accessible neighbours. + int asmin = s->smax; + int asmax = s->smax; + + for (int dir = 0; dir < 4; ++dir) + { + int dx = x + rcGetDirOffsetX(dir); + int dy = y + rcGetDirOffsetY(dir); + // Skip neighbours which are out of bounds. + if (dx < 0 || dy < 0 || dx >= w || dy >= h) + { + minh = rcMin(minh, -walkableClimb - bot); + continue; + } + + // From minus infinity to the first span. + rcSpan* ns = solid.spans[dx + dy*w]; + int nbot = -walkableClimb; + int ntop = ns ? (int)ns->smin : MAX_HEIGHT; + // Skip neightbour if the gap between the spans is too small. + if (rcMin(top,ntop) - rcMax(bot,nbot) > walkableHeight) + minh = rcMin(minh, nbot - bot); + + // Rest of the spans. + for (ns = solid.spans[dx + dy*w]; ns; ns = ns->next) + { + nbot = (int)ns->smax; + ntop = ns->next ? (int)ns->next->smin : MAX_HEIGHT; + // Skip neightbour if the gap between the spans is too small. + if (rcMin(top,ntop) - rcMax(bot,nbot) > walkableHeight) + { + minh = rcMin(minh, nbot - bot); + + // Find min/max accessible neighbour height. + if (rcAbs(nbot - bot) <= walkableClimb) + { + if (nbot < asmin) asmin = nbot; + if (nbot > asmax) asmax = nbot; + } + + } + } + } + + // The current span is close to a ledge if the drop to any + // neighbour span is less than the walkableClimb. + if (minh < -walkableClimb) + s->area = RC_NULL_AREA; + + // If the difference between all neighbours is too large, + // we are at steep slope, mark the span as ledge. + if ((asmax - asmin) > walkableClimb) + { + s->area = RC_NULL_AREA; + } + } + } + } + + ctx->stopTimer(RC_TIMER_FILTER_BORDER); +} + +void rcFilterWalkableLowHeightSpans(rcContext* ctx, int walkableHeight, rcHeightfield& solid) +{ + rcAssert(ctx); + + ctx->startTimer(RC_TIMER_FILTER_WALKABLE); + + const int w = solid.width; + const int h = solid.height; + const int MAX_HEIGHT = 0xffff; + + // Remove walkable flag from spans which do not have enough + // space above them for the agent to stand there. + for (int y = 0; y < h; ++y) + { + for (int x = 0; x < w; ++x) + { + for (rcSpan* s = solid.spans[x + y*w]; s; s = s->next) + { + const int bot = (int)(s->smax); + const int top = s->next ? (int)(s->next->smin) : MAX_HEIGHT; + if ((top - bot) <= walkableHeight) + s->area = RC_NULL_AREA; + } + } + } + + ctx->stopTimer(RC_TIMER_FILTER_WALKABLE); +} diff --git a/dep/recastnavigation/Recast/Source/RecastMesh.cpp b/dep/recastnavigation/Recast/Source/RecastMesh.cpp new file mode 100644 index 000000000..4b33c106d --- /dev/null +++ b/dep/recastnavigation/Recast/Source/RecastMesh.cpp @@ -0,0 +1,1322 @@ +// +// Copyright (c) 2009-2010 Mikko Mononen memon@inside.org +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. +// + +#define _USE_MATH_DEFINES +#include +#include +#include +#include "Recast.h" +#include "RecastAlloc.h" +#include "RecastAssert.h" + +struct rcEdge +{ + unsigned short vert[2]; + unsigned short polyEdge[2]; + unsigned short poly[2]; +}; + +static bool buildMeshAdjacency(unsigned short* polys, const int npolys, + const int nverts, const int vertsPerPoly) +{ + // Based on code by Eric Lengyel from: + // http://www.terathon.com/code/edges.php + + int maxEdgeCount = npolys*vertsPerPoly; + unsigned short* firstEdge = (unsigned short*)rcAlloc(sizeof(unsigned short)*(nverts + maxEdgeCount), RC_ALLOC_TEMP); + if (!firstEdge) + return false; + unsigned short* nextEdge = firstEdge + nverts; + int edgeCount = 0; + + rcEdge* edges = (rcEdge*)rcAlloc(sizeof(rcEdge)*maxEdgeCount, RC_ALLOC_TEMP); + if (!edges) + { + rcFree(firstEdge); + return false; + } + + for (int i = 0; i < nverts; i++) + firstEdge[i] = RC_MESH_NULL_IDX; + + for (int i = 0; i < npolys; ++i) + { + unsigned short* t = &polys[i*vertsPerPoly*2]; + for (int j = 0; j < vertsPerPoly; ++j) + { + unsigned short v0 = t[j]; + unsigned short v1 = (j+1 >= vertsPerPoly || t[j+1] == RC_MESH_NULL_IDX) ? t[0] : t[j+1]; + if (v0 < v1) + { + rcEdge& edge = edges[edgeCount]; + edge.vert[0] = v0; + edge.vert[1] = v1; + edge.poly[0] = (unsigned short)i; + edge.polyEdge[0] = (unsigned short)j; + edge.poly[1] = (unsigned short)i; + edge.polyEdge[1] = 0; + // Insert edge + nextEdge[edgeCount] = firstEdge[v0]; + firstEdge[v0] = (unsigned short)edgeCount; + edgeCount++; + } + } + } + + for (int i = 0; i < npolys; ++i) + { + unsigned short* t = &polys[i*vertsPerPoly*2]; + for (int j = 0; j < vertsPerPoly; ++j) + { + unsigned short v0 = t[j]; + unsigned short v1 = (j+1 >= vertsPerPoly || t[j+1] == RC_MESH_NULL_IDX) ? t[0] : t[j+1]; + if (v0 > v1) + { + for (unsigned short e = firstEdge[v1]; e != RC_MESH_NULL_IDX; e = nextEdge[e]) + { + rcEdge& edge = edges[e]; + if (edge.vert[1] == v0 && edge.poly[0] == edge.poly[1]) + { + edge.poly[1] = (unsigned short)i; + edge.polyEdge[1] = (unsigned short)j; + break; + } + } + } + } + } + + // Store adjacency + for (int i = 0; i < edgeCount; ++i) + { + const rcEdge& e = edges[i]; + if (e.poly[0] != e.poly[1]) + { + unsigned short* p0 = &polys[e.poly[0]*vertsPerPoly*2]; + unsigned short* p1 = &polys[e.poly[1]*vertsPerPoly*2]; + p0[vertsPerPoly + e.polyEdge[0]] = e.poly[1]; + p1[vertsPerPoly + e.polyEdge[1]] = e.poly[0]; + } + } + + rcFree(firstEdge); + rcFree(edges); + + return true; +} + + +static const int VERTEX_BUCKET_COUNT = (1<<12); + +inline int computeVertexHash(int x, int y, int z) +{ + const unsigned int h1 = 0x8da6b343; // Large multiplicative constants; + const unsigned int h2 = 0xd8163841; // here arbitrarily chosen primes + const unsigned int h3 = 0xcb1ab31f; + unsigned int n = h1 * x + h2 * y + h3 * z; + return (int)(n & (VERTEX_BUCKET_COUNT-1)); +} + +static unsigned short addVertex(unsigned short x, unsigned short y, unsigned short z, + unsigned short* verts, int* firstVert, int* nextVert, int& nv) +{ + int bucket = computeVertexHash(x, 0, z); + int i = firstVert[bucket]; + + while (i != -1) + { + const unsigned short* v = &verts[i*3]; + if (v[0] == x && (rcAbs(v[1] - y) <= 2) && v[2] == z) + return (unsigned short)i; + i = nextVert[i]; // next + } + + // Could not find, create new. + i = nv; nv++; + unsigned short* v = &verts[i*3]; + v[0] = x; + v[1] = y; + v[2] = z; + nextVert[i] = firstVert[bucket]; + firstVert[bucket] = i; + + return (unsigned short)i; +} + +inline int prev(int i, int n) { return i-1 >= 0 ? i-1 : n-1; } +inline int next(int i, int n) { return i+1 < n ? i+1 : 0; } + +inline int area2(const int* a, const int* b, const int* c) +{ + return (b[0] - a[0]) * (c[2] - a[2]) - (c[0] - a[0]) * (b[2] - a[2]); +} + +// Exclusive or: true iff exactly one argument is true. +// The arguments are negated to ensure that they are 0/1 +// values. Then the bitwise Xor operator may apply. +// (This idea is due to Michael Baldwin.) +inline bool xorb(bool x, bool y) +{ + return !x ^ !y; +} + +// Returns true iff c is strictly to the left of the directed +// line through a to b. +inline bool left(const int* a, const int* b, const int* c) +{ + return area2(a, b, c) < 0; +} + +inline bool leftOn(const int* a, const int* b, const int* c) +{ + return area2(a, b, c) <= 0; +} + +inline bool collinear(const int* a, const int* b, const int* c) +{ + return area2(a, b, c) == 0; +} + +// Returns true iff ab properly intersects cd: they share +// a point interior to both segments. The properness of the +// intersection is ensured by using strict leftness. +bool intersectProp(const int* a, const int* b, const int* c, const int* d) +{ + // Eliminate improper cases. + if (collinear(a,b,c) || collinear(a,b,d) || + collinear(c,d,a) || collinear(c,d,b)) + return false; + + return xorb(left(a,b,c), left(a,b,d)) && xorb(left(c,d,a), left(c,d,b)); +} + +// Returns T iff (a,b,c) are collinear and point c lies +// on the closed segement ab. +static bool between(const int* a, const int* b, const int* c) +{ + if (!collinear(a, b, c)) + return false; + // If ab not vertical, check betweenness on x; else on y. + if (a[0] != b[0]) + return ((a[0] <= c[0]) && (c[0] <= b[0])) || ((a[0] >= c[0]) && (c[0] >= b[0])); + else + return ((a[2] <= c[2]) && (c[2] <= b[2])) || ((a[2] >= c[2]) && (c[2] >= b[2])); +} + +// Returns true iff segments ab and cd intersect, properly or improperly. +static bool intersect(const int* a, const int* b, const int* c, const int* d) +{ + if (intersectProp(a, b, c, d)) + return true; + else if (between(a, b, c) || between(a, b, d) || + between(c, d, a) || between(c, d, b)) + return true; + else + return false; +} + +static bool vequal(const int* a, const int* b) +{ + return a[0] == b[0] && a[2] == b[2]; +} + +// Returns T iff (v_i, v_j) is a proper internal *or* external +// diagonal of P, *ignoring edges incident to v_i and v_j*. +static bool diagonalie(int i, int j, int n, const int* verts, int* indices) +{ + const int* d0 = &verts[(indices[i] & 0x0fffffff) * 4]; + const int* d1 = &verts[(indices[j] & 0x0fffffff) * 4]; + + // For each edge (k,k+1) of P + for (int k = 0; k < n; k++) + { + int k1 = next(k, n); + // Skip edges incident to i or j + if (!((k == i) || (k1 == i) || (k == j) || (k1 == j))) + { + const int* p0 = &verts[(indices[k] & 0x0fffffff) * 4]; + const int* p1 = &verts[(indices[k1] & 0x0fffffff) * 4]; + + if (vequal(d0, p0) || vequal(d1, p0) || vequal(d0, p1) || vequal(d1, p1)) + continue; + + if (intersect(d0, d1, p0, p1)) + return false; + } + } + return true; +} + +// Returns true iff the diagonal (i,j) is strictly internal to the +// polygon P in the neighborhood of the i endpoint. +static bool inCone(int i, int j, int n, const int* verts, int* indices) +{ + const int* pi = &verts[(indices[i] & 0x0fffffff) * 4]; + const int* pj = &verts[(indices[j] & 0x0fffffff) * 4]; + const int* pi1 = &verts[(indices[next(i, n)] & 0x0fffffff) * 4]; + const int* pin1 = &verts[(indices[prev(i, n)] & 0x0fffffff) * 4]; + + // If P[i] is a convex vertex [ i+1 left or on (i-1,i) ]. + if (leftOn(pin1, pi, pi1)) + return left(pi, pj, pin1) && left(pj, pi, pi1); + // Assume (i-1,i,i+1) not collinear. + // else P[i] is reflex. + return !(leftOn(pi, pj, pi1) && leftOn(pj, pi, pin1)); +} + +// Returns T iff (v_i, v_j) is a proper internal +// diagonal of P. +static bool diagonal(int i, int j, int n, const int* verts, int* indices) +{ + return inCone(i, j, n, verts, indices) && diagonalie(i, j, n, verts, indices); +} + +static int triangulate(int n, const int* verts, int* indices, int* tris) +{ + int ntris = 0; + int* dst = tris; + + // The last bit of the index is used to indicate if the vertex can be removed. + for (int i = 0; i < n; i++) + { + int i1 = next(i, n); + int i2 = next(i1, n); + if (diagonal(i, i2, n, verts, indices)) + indices[i1] |= 0x80000000; + } + + while (n > 3) + { + int minLen = -1; + int mini = -1; + for (int i = 0; i < n; i++) + { + int i1 = next(i, n); + if (indices[i1] & 0x80000000) + { + const int* p0 = &verts[(indices[i] & 0x0fffffff) * 4]; + const int* p2 = &verts[(indices[next(i1, n)] & 0x0fffffff) * 4]; + + int dx = p2[0] - p0[0]; + int dy = p2[2] - p0[2]; + int len = dx*dx + dy*dy; + + if (minLen < 0 || len < minLen) + { + minLen = len; + mini = i; + } + } + } + + if (mini == -1) + { + // Should not happen. +/* printf("mini == -1 ntris=%d n=%d\n", ntris, n); + for (int i = 0; i < n; i++) + { + printf("%d ", indices[i] & 0x0fffffff); + } + printf("\n");*/ + return -ntris; + } + + int i = mini; + int i1 = next(i, n); + int i2 = next(i1, n); + + *dst++ = indices[i] & 0x0fffffff; + *dst++ = indices[i1] & 0x0fffffff; + *dst++ = indices[i2] & 0x0fffffff; + ntris++; + + // Removes P[i1] by copying P[i+1]...P[n-1] left one index. + n--; + for (int k = i1; k < n; k++) + indices[k] = indices[k+1]; + + if (i1 >= n) i1 = 0; + i = prev(i1,n); + // Update diagonal flags. + if (diagonal(prev(i, n), i1, n, verts, indices)) + indices[i] |= 0x80000000; + else + indices[i] &= 0x0fffffff; + + if (diagonal(i, next(i1, n), n, verts, indices)) + indices[i1] |= 0x80000000; + else + indices[i1] &= 0x0fffffff; + } + + // Append the remaining triangle. + *dst++ = indices[0] & 0x0fffffff; + *dst++ = indices[1] & 0x0fffffff; + *dst++ = indices[2] & 0x0fffffff; + ntris++; + + return ntris; +} + +static int countPolyVerts(const unsigned short* p, const int nvp) +{ + for (int i = 0; i < nvp; ++i) + if (p[i] == RC_MESH_NULL_IDX) + return i; + return nvp; +} + +inline bool uleft(const unsigned short* a, const unsigned short* b, const unsigned short* c) +{ + return ((int)b[0] - (int)a[0]) * ((int)c[2] - (int)a[2]) - + ((int)c[0] - (int)a[0]) * ((int)b[2] - (int)a[2]) < 0; +} + +static int getPolyMergeValue(unsigned short* pa, unsigned short* pb, + const unsigned short* verts, int& ea, int& eb, + const int nvp) +{ + const int na = countPolyVerts(pa, nvp); + const int nb = countPolyVerts(pb, nvp); + + // If the merged polygon would be too big, do not merge. + if (na+nb-2 > nvp) + return -1; + + // Check if the polygons share an edge. + ea = -1; + eb = -1; + + for (int i = 0; i < na; ++i) + { + unsigned short va0 = pa[i]; + unsigned short va1 = pa[(i+1) % na]; + if (va0 > va1) + rcSwap(va0, va1); + for (int j = 0; j < nb; ++j) + { + unsigned short vb0 = pb[j]; + unsigned short vb1 = pb[(j+1) % nb]; + if (vb0 > vb1) + rcSwap(vb0, vb1); + if (va0 == vb0 && va1 == vb1) + { + ea = i; + eb = j; + break; + } + } + } + + // No common edge, cannot merge. + if (ea == -1 || eb == -1) + return -1; + + // Check to see if the merged polygon would be convex. + unsigned short va, vb, vc; + + va = pa[(ea+na-1) % na]; + vb = pa[ea]; + vc = pb[(eb+2) % nb]; + if (!uleft(&verts[va*3], &verts[vb*3], &verts[vc*3])) + return -1; + + va = pb[(eb+nb-1) % nb]; + vb = pb[eb]; + vc = pa[(ea+2) % na]; + if (!uleft(&verts[va*3], &verts[vb*3], &verts[vc*3])) + return -1; + + va = pa[ea]; + vb = pa[(ea+1)%na]; + + int dx = (int)verts[va*3+0] - (int)verts[vb*3+0]; + int dy = (int)verts[va*3+2] - (int)verts[vb*3+2]; + + return dx*dx + dy*dy; +} + +static void mergePolys(unsigned short* pa, unsigned short* pb, int ea, int eb, + unsigned short* tmp, const int nvp) +{ + const int na = countPolyVerts(pa, nvp); + const int nb = countPolyVerts(pb, nvp); + + // Merge polygons. + memset(tmp, 0xff, sizeof(unsigned short)*nvp); + int n = 0; + // Add pa + for (int i = 0; i < na-1; ++i) + tmp[n++] = pa[(ea+1+i) % na]; + // Add pb + for (int i = 0; i < nb-1; ++i) + tmp[n++] = pb[(eb+1+i) % nb]; + + memcpy(pa, tmp, sizeof(unsigned short)*nvp); +} + +static void pushFront(int v, int* arr, int& an) +{ + an++; + for (int i = an-1; i > 0; --i) arr[i] = arr[i-1]; + arr[0] = v; +} + +static void pushBack(int v, int* arr, int& an) +{ + arr[an] = v; + an++; +} + +static bool canRemoveVertex(rcContext* ctx, rcPolyMesh& mesh, const unsigned short rem) +{ + const int nvp = mesh.nvp; + + // Count number of polygons to remove. + int numRemovedVerts = 0; + int numTouchedVerts = 0; + int numRemainingEdges = 0; + for (int i = 0; i < mesh.npolys; ++i) + { + unsigned short* p = &mesh.polys[i*nvp*2]; + const int nv = countPolyVerts(p, nvp); + int numRemoved = 0; + int numVerts = 0; + for (int j = 0; j < nv; ++j) + { + if (p[j] == rem) + { + numTouchedVerts++; + numRemoved++; + } + numVerts++; + } + if (numRemoved) + { + numRemovedVerts += numRemoved; + numRemainingEdges += numVerts-(numRemoved+1); + } + } + + // There would be too few edges remaining to create a polygon. + // This can happen for example when a tip of a triangle is marked + // as deletion, but there are no other polys that share the vertex. + // In this case, the vertex should not be removed. + if (numRemainingEdges <= 2) + return false; + + // Find edges which share the removed vertex. + const int maxEdges = numTouchedVerts*2; + int nedges = 0; + rcScopedDelete edges = (int*)rcAlloc(sizeof(int)*maxEdges*3, RC_ALLOC_TEMP); + if (!edges) + { + ctx->log(RC_LOG_WARNING, "canRemoveVertex: Out of memory 'edges' (%d).", maxEdges*3); + return false; + } + + for (int i = 0; i < mesh.npolys; ++i) + { + unsigned short* p = &mesh.polys[i*nvp*2]; + const int nv = countPolyVerts(p, nvp); + + // Collect edges which touches the removed vertex. + for (int j = 0, k = nv-1; j < nv; k = j++) + { + if (p[j] == rem || p[k] == rem) + { + // Arrange edge so that a=rem. + int a = p[j], b = p[k]; + if (b == rem) + rcSwap(a,b); + + // Check if the edge exists + bool exists = false; + for (int k = 0; k < nedges; ++k) + { + int* e = &edges[k*3]; + if (e[1] == b) + { + // Exists, increment vertex share count. + e[2]++; + exists = true; + } + } + // Add new edge. + if (!exists) + { + int* e = &edges[nedges*3]; + e[0] = a; + e[1] = b; + e[2] = 1; + nedges++; + } + } + } + } + + // There should be no more than 2 open edges. + // This catches the case that two non-adjacent polygons + // share the removed vertex. In that case, do not remove the vertex. + int numOpenEdges = 0; + for (int i = 0; i < nedges; ++i) + { + if (edges[i*3+2] < 2) + numOpenEdges++; + } + if (numOpenEdges > 2) + return false; + + return true; +} + +static bool removeVertex(rcContext* ctx, rcPolyMesh& mesh, const unsigned short rem, const int maxTris) +{ + const int nvp = mesh.nvp; + + // Count number of polygons to remove. + int numRemovedVerts = 0; + for (int i = 0; i < mesh.npolys; ++i) + { + unsigned short* p = &mesh.polys[i*nvp*2]; + const int nv = countPolyVerts(p, nvp); + for (int j = 0; j < nv; ++j) + { + if (p[j] == rem) + numRemovedVerts++; + } + } + + int nedges = 0; + rcScopedDelete edges = (int*)rcAlloc(sizeof(int)*numRemovedVerts*nvp*4, RC_ALLOC_TEMP); + if (!edges) + { + ctx->log(RC_LOG_WARNING, "removeVertex: Out of memory 'edges' (%d).", numRemovedVerts*nvp*4); + return false; + } + + int nhole = 0; + rcScopedDelete hole = (int*)rcAlloc(sizeof(int)*numRemovedVerts*nvp, RC_ALLOC_TEMP); + if (!hole) + { + ctx->log(RC_LOG_WARNING, "removeVertex: Out of memory 'hole' (%d).", numRemovedVerts*nvp); + return false; + } + + int nhreg = 0; + rcScopedDelete hreg = (int*)rcAlloc(sizeof(int)*numRemovedVerts*nvp, RC_ALLOC_TEMP); + if (!hreg) + { + ctx->log(RC_LOG_WARNING, "removeVertex: Out of memory 'hreg' (%d).", numRemovedVerts*nvp); + return false; + } + + int nharea = 0; + rcScopedDelete harea = (int*)rcAlloc(sizeof(int)*numRemovedVerts*nvp, RC_ALLOC_TEMP); + if (!harea) + { + ctx->log(RC_LOG_WARNING, "removeVertex: Out of memory 'harea' (%d).", numRemovedVerts*nvp); + return false; + } + + for (int i = 0; i < mesh.npolys; ++i) + { + unsigned short* p = &mesh.polys[i*nvp*2]; + const int nv = countPolyVerts(p, nvp); + bool hasRem = false; + for (int j = 0; j < nv; ++j) + if (p[j] == rem) hasRem = true; + if (hasRem) + { + // Collect edges which does not touch the removed vertex. + for (int j = 0, k = nv-1; j < nv; k = j++) + { + if (p[j] != rem && p[k] != rem) + { + int* e = &edges[nedges*4]; + e[0] = p[k]; + e[1] = p[j]; + e[2] = mesh.regs[i]; + e[3] = mesh.areas[i]; + nedges++; + } + } + // Remove the polygon. + unsigned short* p2 = &mesh.polys[(mesh.npolys-1)*nvp*2]; + memcpy(p,p2,sizeof(unsigned short)*nvp); + memset(p+nvp,0xff,sizeof(unsigned short)*nvp); + mesh.regs[i] = mesh.regs[mesh.npolys-1]; + mesh.areas[i] = mesh.areas[mesh.npolys-1]; + mesh.npolys--; + --i; + } + } + + // Remove vertex. + for (int i = (int)rem; i < mesh.nverts; ++i) + { + mesh.verts[i*3+0] = mesh.verts[(i+1)*3+0]; + mesh.verts[i*3+1] = mesh.verts[(i+1)*3+1]; + mesh.verts[i*3+2] = mesh.verts[(i+1)*3+2]; + } + mesh.nverts--; + + // Adjust indices to match the removed vertex layout. + for (int i = 0; i < mesh.npolys; ++i) + { + unsigned short* p = &mesh.polys[i*nvp*2]; + const int nv = countPolyVerts(p, nvp); + for (int j = 0; j < nv; ++j) + if (p[j] > rem) p[j]--; + } + for (int i = 0; i < nedges; ++i) + { + if (edges[i*4+0] > rem) edges[i*4+0]--; + if (edges[i*4+1] > rem) edges[i*4+1]--; + } + + if (nedges == 0) + return true; + + // Start with one vertex, keep appending connected + // segments to the start and end of the hole. + pushBack(edges[0], hole, nhole); + pushBack(edges[2], hreg, nhreg); + pushBack(edges[3], harea, nharea); + + while (nedges) + { + bool match = false; + + for (int i = 0; i < nedges; ++i) + { + const int ea = edges[i*4+0]; + const int eb = edges[i*4+1]; + const int r = edges[i*4+2]; + const int a = edges[i*4+3]; + bool add = false; + if (hole[0] == eb) + { + // The segment matches the beginning of the hole boundary. + pushFront(ea, hole, nhole); + pushFront(r, hreg, nhreg); + pushFront(a, harea, nharea); + add = true; + } + else if (hole[nhole-1] == ea) + { + // The segment matches the end of the hole boundary. + pushBack(eb, hole, nhole); + pushBack(r, hreg, nhreg); + pushBack(a, harea, nharea); + add = true; + } + if (add) + { + // The edge segment was added, remove it. + edges[i*4+0] = edges[(nedges-1)*4+0]; + edges[i*4+1] = edges[(nedges-1)*4+1]; + edges[i*4+2] = edges[(nedges-1)*4+2]; + edges[i*4+3] = edges[(nedges-1)*4+3]; + --nedges; + match = true; + --i; + } + } + + if (!match) + break; + } + + rcScopedDelete tris = (int*)rcAlloc(sizeof(int)*nhole*3, RC_ALLOC_TEMP); + if (!tris) + { + ctx->log(RC_LOG_WARNING, "removeVertex: Out of memory 'tris' (%d).", nhole*3); + return false; + } + + rcScopedDelete tverts = (int*)rcAlloc(sizeof(int)*nhole*4, RC_ALLOC_TEMP); + if (!tverts) + { + ctx->log(RC_LOG_WARNING, "removeVertex: Out of memory 'tverts' (%d).", nhole*4); + return false; + } + + rcScopedDelete thole = (int*)rcAlloc(sizeof(int)*nhole, RC_ALLOC_TEMP); + if (!tverts) + { + ctx->log(RC_LOG_WARNING, "removeVertex: Out of memory 'thole' (%d).", nhole); + return false; + } + + // Generate temp vertex array for triangulation. + for (int i = 0; i < nhole; ++i) + { + const int pi = hole[i]; + tverts[i*4+0] = mesh.verts[pi*3+0]; + tverts[i*4+1] = mesh.verts[pi*3+1]; + tverts[i*4+2] = mesh.verts[pi*3+2]; + tverts[i*4+3] = 0; + thole[i] = i; + } + + // Triangulate the hole. + int ntris = triangulate(nhole, &tverts[0], &thole[0], tris); + if (ntris < 0) + { + ntris = -ntris; + ctx->log(RC_LOG_WARNING, "removeVertex: triangulate() returned bad results."); + } + + // Merge the hole triangles back to polygons. + rcScopedDelete polys = (unsigned short*)rcAlloc(sizeof(unsigned short)*(ntris+1)*nvp, RC_ALLOC_TEMP); + if (!polys) + { + ctx->log(RC_LOG_ERROR, "removeVertex: Out of memory 'polys' (%d).", (ntris+1)*nvp); + return false; + } + rcScopedDelete pregs = (unsigned short*)rcAlloc(sizeof(unsigned short)*ntris, RC_ALLOC_TEMP); + if (!pregs) + { + ctx->log(RC_LOG_ERROR, "removeVertex: Out of memory 'pregs' (%d).", ntris); + return false; + } + rcScopedDelete pareas = (unsigned char*)rcAlloc(sizeof(unsigned char)*ntris, RC_ALLOC_TEMP); + if (!pregs) + { + ctx->log(RC_LOG_ERROR, "removeVertex: Out of memory 'pareas' (%d).", ntris); + return false; + } + + unsigned short* tmpPoly = &polys[ntris*nvp]; + + // Build initial polygons. + int npolys = 0; + memset(polys, 0xff, ntris*nvp*sizeof(unsigned short)); + for (int j = 0; j < ntris; ++j) + { + int* t = &tris[j*3]; + if (t[0] != t[1] && t[0] != t[2] && t[1] != t[2]) + { + polys[npolys*nvp+0] = (unsigned short)hole[t[0]]; + polys[npolys*nvp+1] = (unsigned short)hole[t[1]]; + polys[npolys*nvp+2] = (unsigned short)hole[t[2]]; + pregs[npolys] = (unsigned short)hreg[t[0]]; + pareas[npolys] = (unsigned char)harea[t[0]]; + npolys++; + } + } + if (!npolys) + return true; + + // Merge polygons. + if (nvp > 3) + { + for (;;) + { + // Find best polygons to merge. + int bestMergeVal = 0; + int bestPa = 0, bestPb = 0, bestEa = 0, bestEb = 0; + + for (int j = 0; j < npolys-1; ++j) + { + unsigned short* pj = &polys[j*nvp]; + for (int k = j+1; k < npolys; ++k) + { + unsigned short* pk = &polys[k*nvp]; + int ea, eb; + int v = getPolyMergeValue(pj, pk, mesh.verts, ea, eb, nvp); + if (v > bestMergeVal) + { + bestMergeVal = v; + bestPa = j; + bestPb = k; + bestEa = ea; + bestEb = eb; + } + } + } + + if (bestMergeVal > 0) + { + // Found best, merge. + unsigned short* pa = &polys[bestPa*nvp]; + unsigned short* pb = &polys[bestPb*nvp]; + mergePolys(pa, pb, bestEa, bestEb, tmpPoly, nvp); + memcpy(pb, &polys[(npolys-1)*nvp], sizeof(unsigned short)*nvp); + pregs[bestPb] = pregs[npolys-1]; + pareas[bestPb] = pareas[npolys-1]; + npolys--; + } + else + { + // Could not merge any polygons, stop. + break; + } + } + } + + // Store polygons. + for (int i = 0; i < npolys; ++i) + { + if (mesh.npolys >= maxTris) break; + unsigned short* p = &mesh.polys[mesh.npolys*nvp*2]; + memset(p,0xff,sizeof(unsigned short)*nvp*2); + for (int j = 0; j < nvp; ++j) + p[j] = polys[i*nvp+j]; + mesh.regs[mesh.npolys] = pregs[i]; + mesh.areas[mesh.npolys] = pareas[i]; + mesh.npolys++; + if (mesh.npolys > maxTris) + { + ctx->log(RC_LOG_ERROR, "removeVertex: Too many polygons %d (max:%d).", mesh.npolys, maxTris); + return false; + } + } + + return true; +} + + +bool rcBuildPolyMesh(rcContext* ctx, rcContourSet& cset, int nvp, rcPolyMesh& mesh) +{ + rcAssert(ctx); + + ctx->startTimer(RC_TIMER_BUILD_POLYMESH); + + rcVcopy(mesh.bmin, cset.bmin); + rcVcopy(mesh.bmax, cset.bmax); + mesh.cs = cset.cs; + mesh.ch = cset.ch; + + int maxVertices = 0; + int maxTris = 0; + int maxVertsPerCont = 0; + for (int i = 0; i < cset.nconts; ++i) + { + // Skip null contours. + if (cset.conts[i].nverts < 3) continue; + maxVertices += cset.conts[i].nverts; + maxTris += cset.conts[i].nverts - 2; + maxVertsPerCont = rcMax(maxVertsPerCont, cset.conts[i].nverts); + } + + if (maxVertices >= 0xfffe) + { + ctx->log(RC_LOG_ERROR, "rcBuildPolyMesh: Too many vertices %d.", maxVertices); + return false; + } + + rcScopedDelete vflags = (unsigned char*)rcAlloc(sizeof(unsigned char)*maxVertices, RC_ALLOC_TEMP); + if (!vflags) + { + ctx->log(RC_LOG_ERROR, "rcBuildPolyMesh: Out of memory 'mesh.verts' (%d).", maxVertices); + return false; + } + memset(vflags, 0, maxVertices); + + mesh.verts = (unsigned short*)rcAlloc(sizeof(unsigned short)*maxVertices*3, RC_ALLOC_PERM); + if (!mesh.verts) + { + ctx->log(RC_LOG_ERROR, "rcBuildPolyMesh: Out of memory 'mesh.verts' (%d).", maxVertices); + return false; + } + mesh.polys = (unsigned short*)rcAlloc(sizeof(unsigned short)*maxTris*nvp*2*2, RC_ALLOC_PERM); + if (!mesh.polys) + { + ctx->log(RC_LOG_ERROR, "rcBuildPolyMesh: Out of memory 'mesh.polys' (%d).", maxTris*nvp*2); + return false; + } + mesh.regs = (unsigned short*)rcAlloc(sizeof(unsigned short)*maxTris, RC_ALLOC_PERM); + if (!mesh.regs) + { + ctx->log(RC_LOG_ERROR, "rcBuildPolyMesh: Out of memory 'mesh.regs' (%d).", maxTris); + return false; + } + mesh.areas = (unsigned char*)rcAlloc(sizeof(unsigned char)*maxTris, RC_ALLOC_PERM); + if (!mesh.areas) + { + ctx->log(RC_LOG_ERROR, "rcBuildPolyMesh: Out of memory 'mesh.areas' (%d).", maxTris); + return false; + } + + mesh.nverts = 0; + mesh.npolys = 0; + mesh.nvp = nvp; + mesh.maxpolys = maxTris; + + memset(mesh.verts, 0, sizeof(unsigned short)*maxVertices*3); + memset(mesh.polys, 0xff, sizeof(unsigned short)*maxTris*nvp*2); + memset(mesh.regs, 0, sizeof(unsigned short)*maxTris); + memset(mesh.areas, 0, sizeof(unsigned char)*maxTris); + + rcScopedDelete nextVert = (int*)rcAlloc(sizeof(int)*maxVertices, RC_ALLOC_TEMP); + if (!nextVert) + { + ctx->log(RC_LOG_ERROR, "rcBuildPolyMesh: Out of memory 'nextVert' (%d).", maxVertices); + return false; + } + memset(nextVert, 0, sizeof(int)*maxVertices); + + rcScopedDelete firstVert = (int*)rcAlloc(sizeof(int)*VERTEX_BUCKET_COUNT, RC_ALLOC_TEMP); + if (!firstVert) + { + ctx->log(RC_LOG_ERROR, "rcBuildPolyMesh: Out of memory 'firstVert' (%d).", VERTEX_BUCKET_COUNT); + return false; + } + for (int i = 0; i < VERTEX_BUCKET_COUNT; ++i) + firstVert[i] = -1; + + rcScopedDelete indices = (int*)rcAlloc(sizeof(int)*maxVertsPerCont, RC_ALLOC_TEMP); + if (!indices) + { + ctx->log(RC_LOG_ERROR, "rcBuildPolyMesh: Out of memory 'indices' (%d).", maxVertsPerCont); + return false; + } + rcScopedDelete tris = (int*)rcAlloc(sizeof(int)*maxVertsPerCont*3, RC_ALLOC_TEMP); + if (!tris) + { + ctx->log(RC_LOG_ERROR, "rcBuildPolyMesh: Out of memory 'tris' (%d).", maxVertsPerCont*3); + return false; + } + rcScopedDelete polys = (unsigned short*)rcAlloc(sizeof(unsigned short)*(maxVertsPerCont+1)*nvp, RC_ALLOC_TEMP); + if (!polys) + { + ctx->log(RC_LOG_ERROR, "rcBuildPolyMesh: Out of memory 'polys' (%d).", maxVertsPerCont*nvp); + return false; + } + unsigned short* tmpPoly = &polys[maxVertsPerCont*nvp]; + + for (int i = 0; i < cset.nconts; ++i) + { + rcContour& cont = cset.conts[i]; + + // Skip null contours. + if (cont.nverts < 3) + continue; + + // Triangulate contour + for (int j = 0; j < cont.nverts; ++j) + indices[j] = j; + + int ntris = triangulate(cont.nverts, cont.verts, &indices[0], &tris[0]); + if (ntris <= 0) + { + // Bad triangulation, should not happen. +/* printf("\tconst float bmin[3] = {%ff,%ff,%ff};\n", cset.bmin[0], cset.bmin[1], cset.bmin[2]); + printf("\tconst float cs = %ff;\n", cset.cs); + printf("\tconst float ch = %ff;\n", cset.ch); + printf("\tconst int verts[] = {\n"); + for (int k = 0; k < cont.nverts; ++k) + { + const int* v = &cont.verts[k*4]; + printf("\t\t%d,%d,%d,%d,\n", v[0], v[1], v[2], v[3]); + } + printf("\t};\n\tconst int nverts = sizeof(verts)/(sizeof(int)*4);\n");*/ + ctx->log(RC_LOG_WARNING, "rcBuildPolyMesh: Bad triangulation Contour %d.", i); + ntris = -ntris; + } + + // Add and merge vertices. + for (int j = 0; j < cont.nverts; ++j) + { + const int* v = &cont.verts[j*4]; + indices[j] = addVertex((unsigned short)v[0], (unsigned short)v[1], (unsigned short)v[2], + mesh.verts, firstVert, nextVert, mesh.nverts); + if (v[3] & RC_BORDER_VERTEX) + { + // This vertex should be removed. + vflags[indices[j]] = 1; + } + } + + // Build initial polygons. + int npolys = 0; + memset(polys, 0xff, maxVertsPerCont*nvp*sizeof(unsigned short)); + for (int j = 0; j < ntris; ++j) + { + int* t = &tris[j*3]; + if (t[0] != t[1] && t[0] != t[2] && t[1] != t[2]) + { + polys[npolys*nvp+0] = (unsigned short)indices[t[0]]; + polys[npolys*nvp+1] = (unsigned short)indices[t[1]]; + polys[npolys*nvp+2] = (unsigned short)indices[t[2]]; + npolys++; + } + } + if (!npolys) + continue; + + // Merge polygons. + if (nvp > 3) + { + for(;;) + { + // Find best polygons to merge. + int bestMergeVal = 0; + int bestPa = 0, bestPb = 0, bestEa = 0, bestEb = 0; + + for (int j = 0; j < npolys-1; ++j) + { + unsigned short* pj = &polys[j*nvp]; + for (int k = j+1; k < npolys; ++k) + { + unsigned short* pk = &polys[k*nvp]; + int ea, eb; + int v = getPolyMergeValue(pj, pk, mesh.verts, ea, eb, nvp); + if (v > bestMergeVal) + { + bestMergeVal = v; + bestPa = j; + bestPb = k; + bestEa = ea; + bestEb = eb; + } + } + } + + if (bestMergeVal > 0) + { + // Found best, merge. + unsigned short* pa = &polys[bestPa*nvp]; + unsigned short* pb = &polys[bestPb*nvp]; + mergePolys(pa, pb, bestEa, bestEb, tmpPoly, nvp); + memcpy(pb, &polys[(npolys-1)*nvp], sizeof(unsigned short)*nvp); + npolys--; + } + else + { + // Could not merge any polygons, stop. + break; + } + } + } + + // Store polygons. + for (int j = 0; j < npolys; ++j) + { + unsigned short* p = &mesh.polys[mesh.npolys*nvp*2]; + unsigned short* q = &polys[j*nvp]; + for (int k = 0; k < nvp; ++k) + p[k] = q[k]; + mesh.regs[mesh.npolys] = cont.reg; + mesh.areas[mesh.npolys] = cont.area; + mesh.npolys++; + if (mesh.npolys > maxTris) + { + ctx->log(RC_LOG_ERROR, "rcBuildPolyMesh: Too many polygons %d (max:%d).", mesh.npolys, maxTris); + return false; + } + } + } + + + // Remove edge vertices. + for (int i = 0; i < mesh.nverts; ++i) + { + if (vflags[i]) + { + if (!canRemoveVertex(ctx, mesh, (unsigned short)i)) + continue; + if (!removeVertex(ctx, mesh, (unsigned short)i, maxTris)) + { + // Failed to remove vertex + ctx->log(RC_LOG_ERROR, "rcBuildPolyMesh: Failed to remove edge vertex %d.", i); + return false; + } + // Remove vertex + // Note: mesh.nverts is already decremented inside removeVertex()! + for (int j = i; j < mesh.nverts; ++j) + vflags[j] = vflags[j+1]; + --i; + } + } + + // Calculate adjacency. + if (!buildMeshAdjacency(mesh.polys, mesh.npolys, mesh.nverts, nvp)) + { + ctx->log(RC_LOG_ERROR, "rcBuildPolyMesh: Adjacency failed."); + return false; + } + + // Just allocate the mesh flags array. The user is resposible to fill it. + mesh.flags = (unsigned short*)rcAlloc(sizeof(unsigned short)*mesh.npolys, RC_ALLOC_PERM); + if (!mesh.flags) + { + ctx->log(RC_LOG_ERROR, "rcBuildPolyMesh: Out of memory 'mesh.flags' (%d).", mesh.npolys); + return false; + } + 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; +} + +bool rcMergePolyMeshes(rcContext* ctx, rcPolyMesh** meshes, const int nmeshes, rcPolyMesh& mesh) +{ + rcAssert(ctx); + + if (!nmeshes || !meshes) + return true; + + ctx->startTimer(RC_TIMER_MERGE_POLYMESH); + + mesh.nvp = meshes[0]->nvp; + mesh.cs = meshes[0]->cs; + mesh.ch = meshes[0]->ch; + rcVcopy(mesh.bmin, meshes[0]->bmin); + rcVcopy(mesh.bmax, meshes[0]->bmax); + + int maxVerts = 0; + int maxPolys = 0; + int maxVertsPerMesh = 0; + for (int i = 0; i < nmeshes; ++i) + { + rcVmin(mesh.bmin, meshes[i]->bmin); + rcVmax(mesh.bmax, meshes[i]->bmax); + maxVertsPerMesh = rcMax(maxVertsPerMesh, meshes[i]->nverts); + maxVerts += meshes[i]->nverts; + maxPolys += meshes[i]->npolys; + } + + mesh.nverts = 0; + mesh.verts = (unsigned short*)rcAlloc(sizeof(unsigned short)*maxVerts*3, RC_ALLOC_PERM); + if (!mesh.verts) + { + ctx->log(RC_LOG_ERROR, "rcMergePolyMeshes: Out of memory 'mesh.verts' (%d).", maxVerts*3); + return false; + } + + mesh.npolys = 0; + mesh.polys = (unsigned short*)rcAlloc(sizeof(unsigned short)*maxPolys*2*mesh.nvp, RC_ALLOC_PERM); + if (!mesh.polys) + { + ctx->log(RC_LOG_ERROR, "rcMergePolyMeshes: Out of memory 'mesh.polys' (%d).", maxPolys*2*mesh.nvp); + return false; + } + memset(mesh.polys, 0xff, sizeof(unsigned short)*maxPolys*2*mesh.nvp); + + mesh.regs = (unsigned short*)rcAlloc(sizeof(unsigned short)*maxPolys, RC_ALLOC_PERM); + if (!mesh.regs) + { + ctx->log(RC_LOG_ERROR, "rcMergePolyMeshes: Out of memory 'mesh.regs' (%d).", maxPolys); + return false; + } + memset(mesh.regs, 0, sizeof(unsigned short)*maxPolys); + + mesh.areas = (unsigned char*)rcAlloc(sizeof(unsigned char)*maxPolys, RC_ALLOC_PERM); + if (!mesh.areas) + { + ctx->log(RC_LOG_ERROR, "rcMergePolyMeshes: Out of memory 'mesh.areas' (%d).", maxPolys); + return false; + } + memset(mesh.areas, 0, sizeof(unsigned char)*maxPolys); + + mesh.flags = (unsigned short*)rcAlloc(sizeof(unsigned short)*maxPolys, RC_ALLOC_PERM); + if (!mesh.flags) + { + ctx->log(RC_LOG_ERROR, "rcMergePolyMeshes: Out of memory 'mesh.flags' (%d).", maxPolys); + return false; + } + memset(mesh.flags, 0, sizeof(unsigned short)*maxPolys); + + rcScopedDelete nextVert = (int*)rcAlloc(sizeof(int)*maxVerts, RC_ALLOC_TEMP); + if (!nextVert) + { + ctx->log(RC_LOG_ERROR, "rcMergePolyMeshes: Out of memory 'nextVert' (%d).", maxVerts); + return false; + } + memset(nextVert, 0, sizeof(int)*maxVerts); + + rcScopedDelete firstVert = (int*)rcAlloc(sizeof(int)*VERTEX_BUCKET_COUNT, RC_ALLOC_TEMP); + if (!firstVert) + { + ctx->log(RC_LOG_ERROR, "rcMergePolyMeshes: Out of memory 'firstVert' (%d).", VERTEX_BUCKET_COUNT); + return false; + } + for (int i = 0; i < VERTEX_BUCKET_COUNT; ++i) + firstVert[i] = -1; + + rcScopedDelete vremap = (unsigned short*)rcAlloc(sizeof(unsigned short)*maxVertsPerMesh, RC_ALLOC_PERM); + if (!vremap) + { + ctx->log(RC_LOG_ERROR, "rcMergePolyMeshes: Out of memory 'vremap' (%d).", maxVertsPerMesh); + return false; + } + memset(nextVert, 0, sizeof(int)*maxVerts); + + for (int i = 0; i < nmeshes; ++i) + { + const rcPolyMesh* pmesh = meshes[i]; + + const unsigned short ox = (unsigned short)floorf((pmesh->bmin[0]-mesh.bmin[0])/mesh.cs+0.5f); + const unsigned short oz = (unsigned short)floorf((pmesh->bmin[2]-mesh.bmin[2])/mesh.cs+0.5f); + + for (int j = 0; j < pmesh->nverts; ++j) + { + unsigned short* v = &pmesh->verts[j*3]; + vremap[j] = addVertex(v[0]+ox, v[1], v[2]+oz, + mesh.verts, firstVert, nextVert, mesh.nverts); + } + + for (int j = 0; j < pmesh->npolys; ++j) + { + unsigned short* tgt = &mesh.polys[mesh.npolys*2*mesh.nvp]; + unsigned short* src = &pmesh->polys[j*2*mesh.nvp]; + mesh.regs[mesh.npolys] = pmesh->regs[j]; + mesh.areas[mesh.npolys] = pmesh->areas[j]; + mesh.flags[mesh.npolys] = pmesh->flags[j]; + mesh.npolys++; + for (int k = 0; k < mesh.nvp; ++k) + { + if (src[k] == RC_MESH_NULL_IDX) break; + tgt[k] = vremap[src[k]]; + } + } + } + + // Calculate adjacency. + if (!buildMeshAdjacency(mesh.polys, mesh.npolys, mesh.nverts, mesh.nvp)) + { + ctx->log(RC_LOG_ERROR, "rcMergePolyMeshes: Adjacency failed."); + 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; +} diff --git a/dep/recastnavigation/Recast/Source/RecastMeshDetail.cpp b/dep/recastnavigation/Recast/Source/RecastMeshDetail.cpp new file mode 100644 index 000000000..ffb4b58ee --- /dev/null +++ b/dep/recastnavigation/Recast/Source/RecastMeshDetail.cpp @@ -0,0 +1,1237 @@ +// +// Copyright (c) 2009-2010 Mikko Mononen memon@inside.org +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. +// + +#include +#define _USE_MATH_DEFINES +#include +#include +#include +#include +#include "Recast.h" +#include "RecastAlloc.h" +#include "RecastAssert.h" + + +static const unsigned RC_UNSET_HEIGHT = 0xffff; + +struct rcHeightPatch +{ + inline rcHeightPatch() : data(0), xmin(0), ymin(0), width(0), height(0) {} + inline ~rcHeightPatch() { rcFree(data); } + unsigned short* data; + int xmin, ymin, width, height; +}; + + +inline float vdot2(const float* a, const float* b) +{ + return a[0]*b[0] + a[2]*b[2]; +} + +inline float vdistSq2(const float* p, const float* q) +{ + const float dx = q[0] - p[0]; + const float dy = q[2] - p[2]; + return dx*dx + dy*dy; +} + +inline float vdist2(const float* p, const float* q) +{ + return sqrtf(vdistSq2(p,q)); +} + +inline float vcross2(const float* p1, const float* p2, const float* p3) +{ + const float u1 = p2[0] - p1[0]; + const float v1 = p2[2] - p1[2]; + const float u2 = p3[0] - p1[0]; + const float v2 = p3[2] - p1[2]; + return u1 * v2 - v1 * u2; +} + +static bool circumCircle(const float* p1, const float* p2, const float* p3, + float* c, float& r) +{ + static const float EPS = 1e-6f; + + const float cp = vcross2(p1, p2, p3); + if (fabsf(cp) > EPS) + { + const float p1Sq = vdot2(p1,p1); + const float p2Sq = vdot2(p2,p2); + const float p3Sq = vdot2(p3,p3); + c[0] = (p1Sq*(p2[2]-p3[2]) + p2Sq*(p3[2]-p1[2]) + p3Sq*(p1[2]-p2[2])) / (2*cp); + c[2] = (p1Sq*(p3[0]-p2[0]) + p2Sq*(p1[0]-p3[0]) + p3Sq*(p2[0]-p1[0])) / (2*cp); + r = vdist2(c, p1); + return true; + } + + c[0] = p1[0]; + c[2] = p1[2]; + r = 0; + return false; +} + +static float distPtTri(const float* p, const float* a, const float* b, const float* c) +{ + float v0[3], v1[3], v2[3]; + rcVsub(v0, c,a); + rcVsub(v1, b,a); + rcVsub(v2, p,a); + + const float dot00 = vdot2(v0, v0); + const float dot01 = vdot2(v0, v1); + const float dot02 = vdot2(v0, v2); + const float dot11 = vdot2(v1, v1); + const float dot12 = vdot2(v1, v2); + + // Compute barycentric coordinates + const float invDenom = 1.0f / (dot00 * dot11 - dot01 * dot01); + const float u = (dot11 * dot02 - dot01 * dot12) * invDenom; + float v = (dot00 * dot12 - dot01 * dot02) * invDenom; + + // If point lies inside the triangle, return interpolated y-coord. + static const float EPS = 1e-4f; + if (u >= -EPS && v >= -EPS && (u+v) <= 1+EPS) + { + const float y = a[1] + v0[1]*u + v1[1]*v; + return fabsf(y-p[1]); + } + return FLT_MAX; +} + +static float distancePtSeg(const float* pt, const float* p, const float* q) +{ + float pqx = q[0] - p[0]; + float pqy = q[1] - p[1]; + float pqz = q[2] - p[2]; + float dx = pt[0] - p[0]; + float dy = pt[1] - p[1]; + float dz = pt[2] - p[2]; + float d = pqx*pqx + pqy*pqy + pqz*pqz; + float t = pqx*dx + pqy*dy + pqz*dz; + if (d > 0) + t /= d; + if (t < 0) + t = 0; + else if (t > 1) + t = 1; + + dx = p[0] + t*pqx - pt[0]; + dy = p[1] + t*pqy - pt[1]; + dz = p[2] + t*pqz - pt[2]; + + return dx*dx + dy*dy + dz*dz; +} + +static float distancePtSeg2d(const float* pt, const float* p, const float* q) +{ + float pqx = q[0] - p[0]; + float pqz = q[2] - p[2]; + float dx = pt[0] - p[0]; + float dz = pt[2] - p[2]; + float d = pqx*pqx + pqz*pqz; + float t = pqx*dx + pqz*dz; + if (d > 0) + t /= d; + if (t < 0) + t = 0; + else if (t > 1) + t = 1; + + dx = p[0] + t*pqx - pt[0]; + dz = p[2] + t*pqz - pt[2]; + + return dx*dx + dz*dz; +} + +static float distToTriMesh(const float* p, const float* verts, const int /*nverts*/, const int* tris, const int ntris) +{ + float dmin = FLT_MAX; + for (int i = 0; i < ntris; ++i) + { + const float* va = &verts[tris[i*4+0]*3]; + const float* vb = &verts[tris[i*4+1]*3]; + const float* vc = &verts[tris[i*4+2]*3]; + float d = distPtTri(p, va,vb,vc); + if (d < dmin) + dmin = d; + } + if (dmin == FLT_MAX) return -1; + return dmin; +} + +static float distToPoly(int nvert, const float* verts, const float* p) +{ + + float dmin = FLT_MAX; + int i, j, c = 0; + for (i = 0, j = nvert-1; i < nvert; j = i++) + { + const float* vi = &verts[i*3]; + const float* vj = &verts[j*3]; + if (((vi[2] > p[2]) != (vj[2] > p[2])) && + (p[0] < (vj[0]-vi[0]) * (p[2]-vi[2]) / (vj[2]-vi[2]) + vi[0]) ) + c = !c; + dmin = rcMin(dmin, distancePtSeg2d(p, vj, vi)); + } + return c ? -dmin : dmin; +} + + +static unsigned short getHeight(const float fx, const float fy, const float fz, + const float /*cs*/, const float ics, const float ch, + const rcHeightPatch& hp) +{ + int ix = (int)floorf(fx*ics + 0.01f); + int iz = (int)floorf(fz*ics + 0.01f); + ix = rcClamp(ix-hp.xmin, 0, hp.width); + iz = rcClamp(iz-hp.ymin, 0, hp.height); + unsigned short h = hp.data[ix+iz*hp.width]; + if (h == RC_UNSET_HEIGHT) + { + // Special case when data might be bad. + // Find nearest neighbour pixel which has valid height. + const int off[8*2] = { -1,0, -1,-1, 0,-1, 1,-1, 1,0, 1,1, 0,1, -1,1}; + float dmin = FLT_MAX; + for (int i = 0; i < 8; ++i) + { + const int nx = ix+off[i*2+0]; + const int nz = iz+off[i*2+1]; + if (nx < 0 || nz < 0 || nx >= hp.width || nz >= hp.height) continue; + const unsigned short nh = hp.data[nx+nz*hp.width]; + if (nh == RC_UNSET_HEIGHT) continue; + + const float d = fabsf(nh*ch - fy); + if (d < dmin) + { + h = nh; + dmin = d; + } + +/* const float dx = (nx+0.5f)*cs - fx; + const float dz = (nz+0.5f)*cs - fz; + const float d = dx*dx+dz*dz; + if (d < dmin) + { + h = nh; + dmin = d; + } */ + } + } + return h; +} + + +enum EdgeValues +{ + UNDEF = -1, + HULL = -2, +}; + +static int findEdge(const int* edges, int nedges, int s, int t) +{ + for (int i = 0; i < nedges; i++) + { + const int* e = &edges[i*4]; + if ((e[0] == s && e[1] == t) || (e[0] == t && e[1] == s)) + return i; + } + return UNDEF; +} + +static int addEdge(rcContext* ctx, int* edges, int& nedges, const int maxEdges, int s, int t, int l, int r) +{ + if (nedges >= maxEdges) + { + ctx->log(RC_LOG_ERROR, "addEdge: Too many edges (%d/%d).", nedges, maxEdges); + return UNDEF; + } + + // Add edge if not already in the triangulation. + int e = findEdge(edges, nedges, s, t); + if (e == UNDEF) + { + int* e = &edges[nedges*4]; + e[0] = s; + e[1] = t; + e[2] = l; + e[3] = r; + return nedges++; + } + else + { + return UNDEF; + } +} + +static void updateLeftFace(int* e, int s, int t, int f) +{ + if (e[0] == s && e[1] == t && e[2] == UNDEF) + e[2] = f; + else if (e[1] == s && e[0] == t && e[3] == UNDEF) + e[3] = f; +} + +static int overlapSegSeg2d(const float* a, const float* b, const float* c, const float* d) +{ + const float a1 = vcross2(a, b, d); + const float a2 = vcross2(a, b, c); + if (a1*a2 < 0.0f) + { + float a3 = vcross2(c, d, a); + float a4 = a3 + a2 - a1; + if (a3 * a4 < 0.0f) + return 1; + } + return 0; +} + +static bool overlapEdges(const float* pts, const int* edges, int nedges, int s1, int t1) +{ + for (int i = 0; i < nedges; ++i) + { + const int s0 = edges[i*4+0]; + const int t0 = edges[i*4+1]; + // Same or connected edges do not overlap. + if (s0 == s1 || s0 == t1 || t0 == s1 || t0 == t1) + continue; + if (overlapSegSeg2d(&pts[s0*3],&pts[t0*3], &pts[s1*3],&pts[t1*3])) + return true; + } + return false; +} + +static void completeFacet(rcContext* ctx, const float* pts, int npts, int* edges, int& nedges, const int maxEdges, int& nfaces, int e) +{ + static const float EPS = 1e-5f; + + int* edge = &edges[e*4]; + + // Cache s and t. + int s,t; + if (edge[2] == UNDEF) + { + s = edge[0]; + t = edge[1]; + } + else if (edge[3] == UNDEF) + { + s = edge[1]; + t = edge[0]; + } + else + { + // Edge already completed. + return; + } + + // Find best point on left of edge. + int pt = npts; + float c[3] = {0,0,0}; + float r = -1; + for (int u = 0; u < npts; ++u) + { + if (u == s || u == t) continue; + if (vcross2(&pts[s*3], &pts[t*3], &pts[u*3]) > EPS) + { + if (r < 0) + { + // The circle is not updated yet, do it now. + pt = u; + circumCircle(&pts[s*3], &pts[t*3], &pts[u*3], c, r); + continue; + } + const float d = vdist2(c, &pts[u*3]); + const float tol = 0.001f; + if (d > r*(1+tol)) + { + // Outside current circumcircle, skip. + continue; + } + else if (d < r*(1-tol)) + { + // Inside safe circumcircle, update circle. + pt = u; + circumCircle(&pts[s*3], &pts[t*3], &pts[u*3], c, r); + } + else + { + // Inside epsilon circum circle, do extra tests to make sure the edge is valid. + // s-u and t-u cannot overlap with s-pt nor t-pt if they exists. + if (overlapEdges(pts, edges, nedges, s,u)) + continue; + if (overlapEdges(pts, edges, nedges, t,u)) + continue; + // Edge is valid. + pt = u; + circumCircle(&pts[s*3], &pts[t*3], &pts[u*3], c, r); + } + } + } + + // Add new triangle or update edge info if s-t is on hull. + if (pt < npts) + { + // Update face information of edge being completed. + updateLeftFace(&edges[e*4], s, t, nfaces); + + // Add new edge or update face info of old edge. + e = findEdge(edges, nedges, pt, s); + if (e == UNDEF) + addEdge(ctx, edges, nedges, maxEdges, pt, s, nfaces, UNDEF); + else + updateLeftFace(&edges[e*4], pt, s, nfaces); + + // Add new edge or update face info of old edge. + e = findEdge(edges, nedges, t, pt); + if (e == UNDEF) + addEdge(ctx, edges, nedges, maxEdges, t, pt, nfaces, UNDEF); + else + updateLeftFace(&edges[e*4], t, pt, nfaces); + + nfaces++; + } + else + { + updateLeftFace(&edges[e*4], s, t, HULL); + } +} + +static void delaunayHull(rcContext* ctx, const int npts, const float* pts, + const int nhull, const int* hull, + rcIntArray& tris, rcIntArray& edges) +{ + int nfaces = 0; + int nedges = 0; + const int maxEdges = npts*10; + edges.resize(maxEdges*4); + + for (int i = 0, j = nhull-1; i < nhull; j=i++) + addEdge(ctx, &edges[0], nedges, maxEdges, hull[j],hull[i], HULL, UNDEF); + + int currentEdge = 0; + while (currentEdge < nedges) + { + if (edges[currentEdge*4+2] == UNDEF) + completeFacet(ctx, pts, npts, &edges[0], nedges, maxEdges, nfaces, currentEdge); + if (edges[currentEdge*4+3] == UNDEF) + completeFacet(ctx, pts, npts, &edges[0], nedges, maxEdges, nfaces, currentEdge); + currentEdge++; + } + + // Create tris + tris.resize(nfaces*4); + for (int i = 0; i < nfaces*4; ++i) + tris[i] = -1; + + for (int i = 0; i < nedges; ++i) + { + const int* e = &edges[i*4]; + if (e[3] >= 0) + { + // Left face + int* t = &tris[e[3]*4]; + if (t[0] == -1) + { + t[0] = e[0]; + t[1] = e[1]; + } + else if (t[0] == e[1]) + t[2] = e[0]; + else if (t[1] == e[0]) + t[2] = e[1]; + } + if (e[2] >= 0) + { + // Right + int* t = &tris[e[2]*4]; + if (t[0] == -1) + { + t[0] = e[1]; + t[1] = e[0]; + } + else if (t[0] == e[0]) + t[2] = e[1]; + else if (t[1] == e[1]) + t[2] = e[0]; + } + } + + for (int i = 0; i < tris.size()/4; ++i) + { + int* t = &tris[i*4]; + if (t[0] == -1 || t[1] == -1 || t[2] == -1) + { + ctx->log(RC_LOG_WARNING, "delaunayHull: Removing dangling face %d [%d,%d,%d].", i, t[0],t[1],t[2]); + t[0] = tris[tris.size()-4]; + t[1] = tris[tris.size()-3]; + 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, + const rcCompactHeightfield& chf, const rcHeightPatch& hp, + float* verts, int& nverts, rcIntArray& tris, + rcIntArray& edges, rcIntArray& samples) +{ + 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; + + nverts = 0; + + for (int i = 0; i < nin; ++i) + rcVcopy(&verts[i*3], &in[i*3]); + nverts = nin; + + const float cs = chf.cs; + const float ics = 1.0f/cs; + + // Tessellate outlines. + // This is done in separate pass in order to ensure + // seamless height values across the ply boundaries. + if (sampleDist > 0) + { + for (int i = 0, j = nin-1; i < nin; j=i++) + { + const float* vj = &in[j*3]; + const float* vi = &in[i*3]; + bool swapped = false; + // Make sure the segments are always handled in same order + // using lexological sort or else there will be seams. + if (fabsf(vj[0]-vi[0]) < 1e-6f) + { + if (vj[2] > vi[2]) + { + rcSwap(vj,vi); + swapped = true; + } + } + else + { + if (vj[0] > vi[0]) + { + rcSwap(vj,vi); + swapped = true; + } + } + // Create samples along the edge. + float dx = vi[0] - vj[0]; + float dy = vi[1] - vj[1]; + float dz = vi[2] - vj[2]; + float d = sqrtf(dx*dx + dz*dz); + int nn = 1 + (int)floorf(d/sampleDist); + 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; + float* pos = &edge[k*3]; + pos[0] = vj[0] + dx*u; + pos[1] = vj[1] + dy*u; + pos[2] = vj[2] + dz*u; + pos[1] = getHeight(pos[0],pos[1],pos[2], cs, ics, chf.ch, hp)*chf.ch; + } + // Simplify samples. + int idx[MAX_VERTS_PER_EDGE] = {0,nn}; + int nidx = 2; + for (int k = 0; k < nidx-1; ) + { + const int a = idx[k]; + const int b = idx[k+1]; + const float* va = &edge[a*3]; + const float* vb = &edge[b*3]; + // Find maximum deviation along the segment. + float maxd = 0; + int maxi = -1; + for (int m = a+1; m < b; ++m) + { + float d = distancePtSeg(&edge[m*3],va,vb); + if (d > maxd) + { + maxd = d; + maxi = m; + } + } + // If the max deviation is larger than accepted error, + // add new point, else continue to next segment. + if (maxi != -1 && maxd > rcSqr(sampleMaxError)) + { + for (int m = nidx; m > k; --m) + idx[m] = idx[m-1]; + idx[k+1] = maxi; + nidx++; + } + else + { + ++k; + } + } + + hull[nhull++] = j; + // Add new vertices. + if (swapped) + { + for (int k = nidx-2; k > 0; --k) + { + rcVcopy(&verts[nverts*3], &edge[idx[k]*3]); + hull[nhull++] = nverts; + nverts++; + } + } + else + { + for (int k = 1; k < nidx-1; ++k) + { + rcVcopy(&verts[nverts*3], &edge[idx[k]*3]); + hull[nhull++] = nverts; + nverts++; + } + } + } + } + + + // Tessellate the base mesh. + edges.resize(0); + tris.resize(0); + + delaunayHull(ctx, nverts, verts, nhull, hull, tris, edges); + + if (tris.size() == 0) + { + // Could not triangulate the poly, make sure there is some valid data there. + ctx->log(RC_LOG_WARNING, "buildPolyDetail: Could not triangulate polygon, adding default data."); + for (int i = 2; i < nverts; ++i) + { + tris.push(0); + tris.push(i-1); + tris.push(i); + tris.push(0); + } + return true; + } + + if (sampleDist > 0) + { + // Create sample locations in a grid. + float bmin[3], bmax[3]; + rcVcopy(bmin, in); + rcVcopy(bmax, in); + for (int i = 1; i < nin; ++i) + { + rcVmin(bmin, &in[i*3]); + rcVmax(bmax, &in[i*3]); + } + int x0 = (int)floorf(bmin[0]/sampleDist); + int x1 = (int)ceilf(bmax[0]/sampleDist); + int z0 = (int)floorf(bmin[2]/sampleDist); + int z1 = (int)ceilf(bmax[2]/sampleDist); + samples.resize(0); + for (int z = z0; z < z1; ++z) + { + for (int x = x0; x < x1; ++x) + { + float pt[3]; + pt[0] = x*sampleDist; + pt[1] = (bmax[1]+bmin[1])*0.5f; + pt[2] = z*sampleDist; + // Make sure the samples are not too close to the edges. + if (distToPoly(nin,in,pt) > -sampleDist/2) continue; + 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()/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]; + // 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 || besti == -1) + break; + // Mark sample as added. + samples[besti*4+3] = 1; + // Add the new sample point. + rcVcopy(&verts[nverts*3],bestpt); + nverts++; + + // Create new triangulation. + // TODO: Incremental add instead of full rebuild. + edges.resize(0); + tris.resize(0); + delaunayHull(ctx, nverts, verts, nhull, hull, tris, edges); + } + } + + 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; +} + +static void getHeightData(const rcCompactHeightfield& chf, + const unsigned short* poly, const int npoly, + const unsigned short* verts, + rcHeightPatch& hp, rcIntArray& stack) +{ + // Floodfill the heightfield to get 2D height data, + // starting at vertex locations as seeds. + + memset(hp.data, 0, sizeof(unsigned short)*hp.width*hp.height); + + stack.resize(0); + + static const int offset[9*2] = + { + 0,0, -1,-1, 0,-1, 1,-1, 1,0, 1,1, 0,1, -1,1, -1,0, + }; + + // Use poly vertices as seed points for the flood fill. + for (int j = 0; j < npoly; ++j) + { + int cx = 0, cz = 0, ci =-1; + int dmin = RC_UNSET_HEIGHT; + for (int k = 0; k < 9; ++k) + { + const int ax = (int)verts[poly[j]*3+0] + offset[k*2+0]; + const int ay = (int)verts[poly[j]*3+1]; + const int az = (int)verts[poly[j]*3+2] + offset[k*2+1]; + if (ax < hp.xmin || ax >= hp.xmin+hp.width || + az < hp.ymin || az >= hp.ymin+hp.height) + continue; + + const rcCompactCell& c = chf.cells[ax+az*chf.width]; + for (int i = (int)c.index, ni = (int)(c.index+c.count); i < ni; ++i) + { + const rcCompactSpan& s = chf.spans[i]; + int d = rcAbs(ay - (int)s.y); + if (d < dmin) + { + cx = ax; + cz = az; + ci = i; + dmin = d; + } + } + } + if (ci != -1) + { + stack.push(cx); + stack.push(cz); + stack.push(ci); + } + } + + // Find center of the polygon using flood fill. + int pcx = 0, pcz = 0; + for (int j = 0; j < npoly; ++j) + { + pcx += (int)verts[poly[j]*3+0]; + pcz += (int)verts[poly[j]*3+2]; + } + pcx /= npoly; + pcz /= npoly; + + for (int i = 0; i < stack.size(); i += 3) + { + int cx = stack[i+0]; + int cy = stack[i+1]; + int idx = cx-hp.xmin+(cy-hp.ymin)*hp.width; + hp.data[idx] = 1; + } + + while (stack.size() > 0) + { + int ci = stack.pop(); + int cy = stack.pop(); + int cx = stack.pop(); + + // Check if close to center of the polygon. + if (rcAbs(cx-pcx) <= 1 && rcAbs(cy-pcz) <= 1) + { + stack.resize(0); + stack.push(cx); + stack.push(cy); + stack.push(ci); + break; + } + + const rcCompactSpan& cs = chf.spans[ci]; + + for (int dir = 0; dir < 4; ++dir) + { + if (rcGetCon(cs, dir) == RC_NOT_CONNECTED) continue; + + const int ax = cx + rcGetDirOffsetX(dir); + const int ay = cy + rcGetDirOffsetY(dir); + + if (ax < hp.xmin || ax >= (hp.xmin+hp.width) || + ay < hp.ymin || ay >= (hp.ymin+hp.height)) + continue; + + if (hp.data[ax-hp.xmin+(ay-hp.ymin)*hp.width] != 0) + continue; + + const int ai = (int)chf.cells[ax+ay*chf.width].index + rcGetCon(cs, dir); + + int idx = ax-hp.xmin+(ay-hp.ymin)*hp.width; + hp.data[idx] = 1; + + stack.push(ax); + stack.push(ay); + stack.push(ai); + } + } + + memset(hp.data, 0xff, sizeof(unsigned short)*hp.width*hp.height); + + // Mark start locations. + for (int i = 0; i < stack.size(); i += 3) + { + int cx = stack[i+0]; + int cy = stack[i+1]; + int ci = stack[i+2]; + int idx = cx-hp.xmin+(cy-hp.ymin)*hp.width; + const rcCompactSpan& cs = chf.spans[ci]; + hp.data[idx] = cs.y; + } + + static const int RETRACT_SIZE = 256; + int head = 0; + + while (head*3 < stack.size()) + { + int cx = stack[head*3+0]; + int cy = stack[head*3+1]; + int ci = stack[head*3+2]; + head++; + if (head >= RETRACT_SIZE) + { + head = 0; + if (stack.size() > RETRACT_SIZE*3) + memmove(&stack[0], &stack[RETRACT_SIZE*3], sizeof(int)*(stack.size()-RETRACT_SIZE*3)); + stack.resize(stack.size()-RETRACT_SIZE*3); + } + + const rcCompactSpan& cs = chf.spans[ci]; + for (int dir = 0; dir < 4; ++dir) + { + if (rcGetCon(cs, dir) == RC_NOT_CONNECTED) continue; + + const int ax = cx + rcGetDirOffsetX(dir); + const int ay = cy + rcGetDirOffsetY(dir); + + if (ax < hp.xmin || ax >= (hp.xmin+hp.width) || + ay < hp.ymin || ay >= (hp.ymin+hp.height)) + continue; + + if (hp.data[ax-hp.xmin+(ay-hp.ymin)*hp.width] != RC_UNSET_HEIGHT) + continue; + + const int ai = (int)chf.cells[ax+ay*chf.width].index + rcGetCon(cs, dir); + + const rcCompactSpan& as = chf.spans[ai]; + int idx = ax-hp.xmin+(ay-hp.ymin)*hp.width; + hp.data[idx] = as.y; + + stack.push(ax); + stack.push(ay); + stack.push(ai); + } + } + +} + +static unsigned char getEdgeFlags(const float* va, const float* vb, + const float* vpoly, const int npoly) +{ + // Return true if edge (va,vb) is part of the polygon. + static const float thrSqr = rcSqr(0.001f); + for (int i = 0, j = npoly-1; i < npoly; j=i++) + { + if (distancePtSeg2d(va, &vpoly[j*3], &vpoly[i*3]) < thrSqr && + distancePtSeg2d(vb, &vpoly[j*3], &vpoly[i*3]) < thrSqr) + return 1; + } + return 0; +} + +static unsigned char getTriFlags(const float* va, const float* vb, const float* vc, + const float* vpoly, const int npoly) +{ + unsigned char flags = 0; + flags |= getEdgeFlags(va,vb,vpoly,npoly) << 0; + flags |= getEdgeFlags(vb,vc,vpoly,npoly) << 2; + flags |= getEdgeFlags(vc,va,vpoly,npoly) << 4; + return flags; +} + + + +bool rcBuildPolyMeshDetail(rcContext* ctx, const rcPolyMesh& mesh, const rcCompactHeightfield& chf, + const float sampleDist, const float sampleMaxError, + rcPolyMeshDetail& dmesh) +{ + rcAssert(ctx); + + ctx->startTimer(RC_TIMER_BUILD_POLYMESHDETAIL); + + if (mesh.nverts == 0 || mesh.npolys == 0) + return true; + + const int nvp = mesh.nvp; + const float cs = mesh.cs; + const float ch = mesh.ch; + const float* orig = mesh.bmin; + + rcIntArray edges(64); + rcIntArray tris(512); + rcIntArray stack(512); + rcIntArray samples(512); + float verts[256*3]; + rcHeightPatch hp; + int nPolyVerts = 0; + int maxhw = 0, maxhh = 0; + + rcScopedDelete bounds = (int*)rcAlloc(sizeof(int)*mesh.npolys*4, RC_ALLOC_TEMP); + if (!bounds) + { + ctx->log(RC_LOG_ERROR, "rcBuildPolyMeshDetail: Out of memory 'bounds' (%d).", mesh.npolys*4); + return false; + } + rcScopedDelete poly = (float*)rcAlloc(sizeof(float)*nvp*3, RC_ALLOC_TEMP); + if (!poly) + { + ctx->log(RC_LOG_ERROR, "rcBuildPolyMeshDetail: Out of memory 'poly' (%d).", nvp*3); + return false; + } + + // Find max size for a polygon area. + for (int i = 0; i < mesh.npolys; ++i) + { + const unsigned short* p = &mesh.polys[i*nvp*2]; + int& xmin = bounds[i*4+0]; + int& xmax = bounds[i*4+1]; + int& ymin = bounds[i*4+2]; + int& ymax = bounds[i*4+3]; + xmin = chf.width; + xmax = 0; + ymin = chf.height; + ymax = 0; + for (int j = 0; j < nvp; ++j) + { + if(p[j] == RC_MESH_NULL_IDX) break; + const unsigned short* v = &mesh.verts[p[j]*3]; + xmin = rcMin(xmin, (int)v[0]); + xmax = rcMax(xmax, (int)v[0]); + ymin = rcMin(ymin, (int)v[2]); + ymax = rcMax(ymax, (int)v[2]); + nPolyVerts++; + } + xmin = rcMax(0,xmin-1); + xmax = rcMin(chf.width,xmax+1); + ymin = rcMax(0,ymin-1); + ymax = rcMin(chf.height,ymax+1); + if (xmin >= xmax || ymin >= ymax) continue; + maxhw = rcMax(maxhw, xmax-xmin); + maxhh = rcMax(maxhh, ymax-ymin); + } + + hp.data = (unsigned short*)rcAlloc(sizeof(unsigned short)*maxhw*maxhh, RC_ALLOC_TEMP); + if (!hp.data) + { + ctx->log(RC_LOG_ERROR, "rcBuildPolyMeshDetail: Out of memory 'hp.data' (%d).", maxhw*maxhh); + return false; + } + + dmesh.nmeshes = mesh.npolys; + dmesh.nverts = 0; + dmesh.ntris = 0; + 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); + return false; + } + + int vcap = nPolyVerts+nPolyVerts/2; + int tcap = vcap*2; + + dmesh.nverts = 0; + dmesh.verts = (float*)rcAlloc(sizeof(float)*vcap*3, RC_ALLOC_PERM); + if (!dmesh.verts) + { + ctx->log(RC_LOG_ERROR, "rcBuildPolyMeshDetail: Out of memory 'dmesh.verts' (%d).", vcap*3); + return false; + } + dmesh.ntris = 0; + dmesh.tris = (unsigned char*)rcAlloc(sizeof(unsigned char*)*tcap*4, RC_ALLOC_PERM); + if (!dmesh.tris) + { + ctx->log(RC_LOG_ERROR, "rcBuildPolyMeshDetail: Out of memory 'dmesh.tris' (%d).", tcap*4); + return false; + } + + for (int i = 0; i < mesh.npolys; ++i) + { + const unsigned short* p = &mesh.polys[i*nvp*2]; + + // Store polygon vertices for processing. + int npoly = 0; + for (int j = 0; j < nvp; ++j) + { + if(p[j] == RC_MESH_NULL_IDX) break; + const unsigned short* v = &mesh.verts[p[j]*3]; + poly[j*3+0] = v[0]*cs; + poly[j*3+1] = v[1]*ch; + poly[j*3+2] = v[2]*cs; + npoly++; + } + + // Get the height data from the area of the polygon. + hp.xmin = bounds[i*4+0]; + hp.ymin = bounds[i*4+2]; + hp.width = bounds[i*4+1]-bounds[i*4+0]; + hp.height = bounds[i*4+3]-bounds[i*4+2]; + getHeightData(chf, p, npoly, mesh.verts, hp, stack); + + // Build detail mesh. + int nverts = 0; + if (!buildPolyDetail(ctx, poly, npoly, + sampleDist, sampleMaxError, + chf, hp, verts, nverts, tris, + edges, samples)) + { + return false; + } + + // Move detail verts to world space. + for (int j = 0; j < nverts; ++j) + { + verts[j*3+0] += orig[0]; + verts[j*3+1] += orig[1] + chf.ch; // Is this offset necessary? + verts[j*3+2] += orig[2]; + } + // Offset poly too, will be used to flag checking. + for (int j = 0; j < npoly; ++j) + { + poly[j*3+0] += orig[0]; + poly[j*3+1] += orig[1]; + poly[j*3+2] += orig[2]; + } + + // Store detail submesh. + const int ntris = tris.size()/4; + + 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) + { + while (dmesh.nverts+nverts > vcap) + vcap += 256; + + float* newv = (float*)rcAlloc(sizeof(float)*vcap*3, RC_ALLOC_PERM); + if (!newv) + { + ctx->log(RC_LOG_ERROR, "rcBuildPolyMeshDetail: Out of memory 'newv' (%d).", vcap*3); + return false; + } + if (dmesh.nverts) + memcpy(newv, dmesh.verts, sizeof(float)*3*dmesh.nverts); + rcFree(dmesh.verts); + dmesh.verts = newv; + } + for (int j = 0; j < nverts; ++j) + { + dmesh.verts[dmesh.nverts*3+0] = verts[j*3+0]; + dmesh.verts[dmesh.nverts*3+1] = verts[j*3+1]; + dmesh.verts[dmesh.nverts*3+2] = verts[j*3+2]; + dmesh.nverts++; + } + + // Store triangles, allocate more memory if necessary. + if (dmesh.ntris+ntris > tcap) + { + while (dmesh.ntris+ntris > tcap) + tcap += 256; + unsigned char* newt = (unsigned char*)rcAlloc(sizeof(unsigned char)*tcap*4, RC_ALLOC_PERM); + if (!newt) + { + ctx->log(RC_LOG_ERROR, "rcBuildPolyMeshDetail: Out of memory 'newt' (%d).", tcap*4); + return false; + } + if (dmesh.ntris) + memcpy(newt, dmesh.tris, sizeof(unsigned char)*4*dmesh.ntris); + rcFree(dmesh.tris); + dmesh.tris = newt; + } + for (int j = 0; j < ntris; ++j) + { + const int* t = &tris[j*4]; + dmesh.tris[dmesh.ntris*4+0] = (unsigned char)t[0]; + dmesh.tris[dmesh.ntris*4+1] = (unsigned char)t[1]; + dmesh.tris[dmesh.ntris*4+2] = (unsigned char)t[2]; + dmesh.tris[dmesh.ntris*4+3] = getTriFlags(&verts[t[0]*3], &verts[t[1]*3], &verts[t[2]*3], poly, npoly); + dmesh.ntris++; + } + } + + ctx->stopTimer(RC_TIMER_BUILD_POLYMESHDETAIL); + + return true; +} + +bool rcMergePolyMeshDetails(rcContext* ctx, rcPolyMeshDetail** meshes, const int nmeshes, rcPolyMeshDetail& mesh) +{ + rcAssert(ctx); + + ctx->startTimer(RC_TIMER_MERGE_POLYMESHDETAIL); + + int maxVerts = 0; + int maxTris = 0; + int maxMeshes = 0; + + for (int i = 0; i < nmeshes; ++i) + { + if (!meshes[i]) continue; + maxVerts += meshes[i]->nverts; + maxTris += meshes[i]->ntris; + maxMeshes += meshes[i]->nmeshes; + } + + mesh.nmeshes = 0; + 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); + return false; + } + + mesh.ntris = 0; + mesh.tris = (unsigned char*)rcAlloc(sizeof(unsigned char)*maxTris*4, RC_ALLOC_PERM); + if (!mesh.tris) + { + ctx->log(RC_LOG_ERROR, "rcBuildPolyMeshDetail: Out of memory 'dmesh.tris' (%d).", maxTris*4); + return false; + } + + mesh.nverts = 0; + mesh.verts = (float*)rcAlloc(sizeof(float)*maxVerts*3, RC_ALLOC_PERM); + if (!mesh.verts) + { + ctx->log(RC_LOG_ERROR, "rcBuildPolyMeshDetail: Out of memory 'dmesh.verts' (%d).", maxVerts*3); + return false; + } + + // Merge datas. + for (int i = 0; i < nmeshes; ++i) + { + rcPolyMeshDetail* dm = meshes[i]; + if (!dm) continue; + for (int j = 0; j < dm->nmeshes; ++j) + { + 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 int)mesh.ntris+src[2]; + dst[3] = src[3]; + mesh.nmeshes++; + } + + for (int k = 0; k < dm->nverts; ++k) + { + rcVcopy(&mesh.verts[mesh.nverts*3], &dm->verts[k*3]); + mesh.nverts++; + } + for (int k = 0; k < dm->ntris; ++k) + { + mesh.tris[mesh.ntris*4+0] = dm->tris[k*4+0]; + mesh.tris[mesh.ntris*4+1] = dm->tris[k*4+1]; + mesh.tris[mesh.ntris*4+2] = dm->tris[k*4+2]; + mesh.tris[mesh.ntris*4+3] = dm->tris[k*4+3]; + mesh.ntris++; + } + } + + ctx->stopTimer(RC_TIMER_MERGE_POLYMESHDETAIL); + + return true; +} + diff --git a/dep/recastnavigation/Recast/Source/RecastRasterization.cpp b/dep/recastnavigation/Recast/Source/RecastRasterization.cpp new file mode 100644 index 000000000..71adfb673 --- /dev/null +++ b/dep/recastnavigation/Recast/Source/RecastRasterization.cpp @@ -0,0 +1,360 @@ +// +// Copyright (c) 2009-2010 Mikko Mononen memon@inside.org +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. +// + +#define _USE_MATH_DEFINES +#include +#include +#include "Recast.h" +#include "RecastAlloc.h" +#include "RecastAssert.h" + +inline bool overlapBounds(const float* amin, const float* amax, const float* bmin, const float* bmax) +{ + bool overlap = true; + overlap = (amin[0] > bmax[0] || amax[0] < bmin[0]) ? false : overlap; + overlap = (amin[1] > bmax[1] || amax[1] < bmin[1]) ? false : overlap; + overlap = (amin[2] > bmax[2] || amax[2] < bmin[2]) ? false : overlap; + return overlap; +} + +inline bool overlapInterval(unsigned short amin, unsigned short amax, + unsigned short bmin, unsigned short bmax) +{ + if (amax < bmin) return false; + if (amin > bmax) return false; + return true; +} + + +static rcSpan* allocSpan(rcHeightfield& hf) +{ + // If running out of memory, allocate new page and update the freelist. + if (!hf.freelist || !hf.freelist->next) + { + // Create new page. + // Allocate memory for the new pool. + rcSpanPool* pool = (rcSpanPool*)rcAlloc(sizeof(rcSpanPool), RC_ALLOC_PERM); + if (!pool) return 0; + pool->next = 0; + // Add the pool into the list of pools. + pool->next = hf.pools; + hf.pools = pool; + // Add new items to the free list. + rcSpan* freelist = hf.freelist; + rcSpan* head = &pool->items[0]; + rcSpan* it = &pool->items[RC_SPANS_PER_POOL]; + do + { + --it; + it->next = freelist; + freelist = it; + } + while (it != head); + hf.freelist = it; + } + + // Pop item from in front of the free list. + rcSpan* it = hf.freelist; + hf.freelist = hf.freelist->next; + return it; +} + +static void freeSpan(rcHeightfield& hf, rcSpan* ptr) +{ + if (!ptr) return; + // Add the node in front of the free list. + ptr->next = hf.freelist; + hf.freelist = ptr; +} + +static void addSpan(rcHeightfield& hf, const int x, const int y, + const unsigned short smin, const unsigned short smax, + const unsigned char area, const int flagMergeThr) +{ + + int idx = x + y*hf.width; + + rcSpan* s = allocSpan(hf); + s->smin = smin; + s->smax = smax; + s->area = area; + s->next = 0; + + // Empty cell, add he first span. + if (!hf.spans[idx]) + { + hf.spans[idx] = s; + return; + } + rcSpan* prev = 0; + rcSpan* cur = hf.spans[idx]; + + // Insert and merge spans. + while (cur) + { + if (cur->smin > s->smax) + { + // Current span is further than the new span, break. + break; + } + else if (cur->smax < s->smin) + { + // Current span is before the new span advance. + prev = cur; + cur = cur->next; + } + else + { + // Merge spans. + if (cur->smin < s->smin) + s->smin = cur->smin; + if (cur->smax > s->smax) + s->smax = cur->smax; + + // Merge flags. + if (rcAbs((int)s->smax - (int)cur->smax) <= flagMergeThr) + s->area = rcMax(s->area, cur->area); + + // Remove current span. + rcSpan* next = cur->next; + freeSpan(hf, cur); + if (prev) + prev->next = next; + else + hf.spans[idx] = next; + cur = next; + } + } + + // Insert new span. + if (prev) + { + s->next = prev->next; + prev->next = s; + } + else + { + s->next = hf.spans[idx]; + hf.spans[idx] = s; + } +} + +void rcAddSpan(rcContext* /*ctx*/, rcHeightfield& hf, const int x, const int y, + const unsigned short smin, const unsigned short smax, + const unsigned char area, const int flagMergeThr) +{ +// rcAssert(ctx); + addSpan(hf, x,y, smin, smax, area, flagMergeThr); +} + +static int clipPoly(const float* in, int n, float* out, float pnx, float pnz, float pd) +{ + float d[12]; + for (int i = 0; i < n; ++i) + d[i] = pnx*in[i*3+0] + pnz*in[i*3+2] + pd; + + int m = 0; + for (int i = 0, j = n-1; i < n; j=i, ++i) + { + bool ina = d[j] >= 0; + bool inb = d[i] >= 0; + if (ina != inb) + { + float s = d[j] / (d[j] - d[i]); + out[m*3+0] = in[j*3+0] + (in[i*3+0] - in[j*3+0])*s; + out[m*3+1] = in[j*3+1] + (in[i*3+1] - in[j*3+1])*s; + out[m*3+2] = in[j*3+2] + (in[i*3+2] - in[j*3+2])*s; + m++; + } + if (inb) + { + out[m*3+0] = in[i*3+0]; + out[m*3+1] = in[i*3+1]; + out[m*3+2] = in[i*3+2]; + m++; + } + } + return m; +} + +static void rasterizeTri(const float* v0, const float* v1, const float* v2, + const unsigned char area, rcHeightfield& hf, + const float* bmin, const float* bmax, + const float cs, const float ics, const float ich, + const int flagMergeThr) +{ + const int w = hf.width; + const int h = hf.height; + float tmin[3], tmax[3]; + const float by = bmax[1] - bmin[1]; + + // Calculate the bounding box of the triangle. + rcVcopy(tmin, v0); + rcVcopy(tmax, v0); + rcVmin(tmin, v1); + rcVmin(tmin, v2); + rcVmax(tmax, v1); + rcVmax(tmax, v2); + + // If the triangle does not touch the bbox of the heightfield, skip the triagle. + if (!overlapBounds(bmin, bmax, tmin, tmax)) + return; + + // Calculate the footpring of the triangle on the grid. + int x0 = (int)((tmin[0] - bmin[0])*ics); + int y0 = (int)((tmin[2] - bmin[2])*ics); + int x1 = (int)((tmax[0] - bmin[0])*ics); + int y1 = (int)((tmax[2] - bmin[2])*ics); + x0 = rcClamp(x0, 0, w-1); + y0 = rcClamp(y0, 0, h-1); + x1 = rcClamp(x1, 0, w-1); + y1 = rcClamp(y1, 0, h-1); + + // Clip the triangle into all grid cells it touches. + float in[7*3], out[7*3], inrow[7*3]; + + for (int y = y0; y <= y1; ++y) + { + // Clip polygon to row. + rcVcopy(&in[0], v0); + rcVcopy(&in[1*3], v1); + rcVcopy(&in[2*3], v2); + int nvrow = 3; + const float cz = bmin[2] + y*cs; + nvrow = clipPoly(in, nvrow, out, 0, 1, -cz); + if (nvrow < 3) continue; + nvrow = clipPoly(out, nvrow, inrow, 0, -1, cz+cs); + if (nvrow < 3) continue; + + for (int x = x0; x <= x1; ++x) + { + // Clip polygon to column. + int nv = nvrow; + const float cx = bmin[0] + x*cs; + nv = clipPoly(inrow, nv, out, 1, 0, -cx); + if (nv < 3) continue; + nv = clipPoly(out, nv, in, -1, 0, cx+cs); + if (nv < 3) continue; + + // Calculate min and max of the span. + float smin = in[1], smax = in[1]; + for (int i = 1; i < nv; ++i) + { + smin = rcMin(smin, in[i*3+1]); + smax = rcMax(smax, in[i*3+1]); + } + smin -= bmin[1]; + smax -= bmin[1]; + // Skip the span if it is outside the heightfield bbox + if (smax < 0.0f) continue; + if (smin > by) continue; + // Clamp the span to the heightfield bbox. + if (smin < 0.0f) smin = 0; + if (smax > by) smax = by; + + // Snap the span to the heightfield height grid. + unsigned short ismin = (unsigned short)rcClamp((int)floorf(smin * ich), 0, RC_SPAN_MAX_HEIGHT); + unsigned short ismax = (unsigned short)rcClamp((int)ceilf(smax * ich), (int)ismin+1, RC_SPAN_MAX_HEIGHT); + + addSpan(hf, x, y, ismin, ismax, area, flagMergeThr); + } + } +} + +void rcRasterizeTriangle(rcContext* ctx, const float* v0, const float* v1, const float* v2, + const unsigned char area, rcHeightfield& solid, + const int flagMergeThr) +{ + rcAssert(ctx); + + ctx->startTimer(RC_TIMER_RASTERIZE_TRIANGLES); + + const float ics = 1.0f/solid.cs; + const float ich = 1.0f/solid.ch; + rasterizeTri(v0, v1, v2, area, solid, solid.bmin, solid.bmax, solid.cs, ics, ich, flagMergeThr); + + ctx->stopTimer(RC_TIMER_RASTERIZE_TRIANGLES); +} + +void rcRasterizeTriangles(rcContext* ctx, const float* verts, const int /*nv*/, + const int* tris, const unsigned char* areas, const int nt, + rcHeightfield& solid, const int flagMergeThr) +{ + rcAssert(ctx); + + ctx->startTimer(RC_TIMER_RASTERIZE_TRIANGLES); + + const float ics = 1.0f/solid.cs; + const float ich = 1.0f/solid.ch; + // Rasterize triangles. + for (int i = 0; i < nt; ++i) + { + const float* v0 = &verts[tris[i*3+0]*3]; + const float* v1 = &verts[tris[i*3+1]*3]; + const float* v2 = &verts[tris[i*3+2]*3]; + // Rasterize. + rasterizeTri(v0, v1, v2, areas[i], solid, solid.bmin, solid.bmax, solid.cs, ics, ich, flagMergeThr); + } + + ctx->stopTimer(RC_TIMER_RASTERIZE_TRIANGLES); +} + +void rcRasterizeTriangles(rcContext* ctx, const float* verts, const int /*nv*/, + const unsigned short* tris, const unsigned char* areas, const int nt, + rcHeightfield& solid, const int flagMergeThr) +{ + rcAssert(ctx); + + ctx->startTimer(RC_TIMER_RASTERIZE_TRIANGLES); + + const float ics = 1.0f/solid.cs; + const float ich = 1.0f/solid.ch; + // Rasterize triangles. + for (int i = 0; i < nt; ++i) + { + const float* v0 = &verts[tris[i*3+0]*3]; + const float* v1 = &verts[tris[i*3+1]*3]; + const float* v2 = &verts[tris[i*3+2]*3]; + // Rasterize. + rasterizeTri(v0, v1, v2, areas[i], solid, solid.bmin, solid.bmax, solid.cs, ics, ich, flagMergeThr); + } + + ctx->stopTimer(RC_TIMER_RASTERIZE_TRIANGLES); +} + +void rcRasterizeTriangles(rcContext* ctx, const float* verts, const unsigned char* areas, const int nt, + rcHeightfield& solid, const int flagMergeThr) +{ + rcAssert(ctx); + + ctx->startTimer(RC_TIMER_RASTERIZE_TRIANGLES); + + const float ics = 1.0f/solid.cs; + const float ich = 1.0f/solid.ch; + // Rasterize triangles. + for (int i = 0; i < nt; ++i) + { + const float* v0 = &verts[(i*3+0)*3]; + const float* v1 = &verts[(i*3+1)*3]; + const float* v2 = &verts[(i*3+2)*3]; + // Rasterize. + rasterizeTri(v0, v1, v2, areas[i], solid, solid.bmin, solid.bmax, solid.cs, ics, ich, flagMergeThr); + } + + ctx->stopTimer(RC_TIMER_RASTERIZE_TRIANGLES); +} diff --git a/dep/recastnavigation/Recast/Source/RecastRegion.cpp b/dep/recastnavigation/Recast/Source/RecastRegion.cpp new file mode 100644 index 000000000..6ad9fa531 --- /dev/null +++ b/dep/recastnavigation/Recast/Source/RecastRegion.cpp @@ -0,0 +1,1283 @@ +// +// Copyright (c) 2009-2010 Mikko Mononen memon@inside.org +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. +// + +#include +#define _USE_MATH_DEFINES +#include +#include +#include +#include +#include "Recast.h" +#include "RecastAlloc.h" +#include "RecastAssert.h" +#include + + +static void calculateDistanceField(rcCompactHeightfield& chf, unsigned short* src, unsigned short& maxDist) +{ + const int w = chf.width; + const int h = chf.height; + + // Init distance and points. + for (int i = 0; i < chf.spanCount; ++i) + src[i] = 0xffff; + + // Mark boundary cells. + for (int y = 0; y < h; ++y) + { + for (int x = 0; x < w; ++x) + { + const rcCompactCell& c = chf.cells[x+y*w]; + for (int i = (int)c.index, ni = (int)(c.index+c.count); i < ni; ++i) + { + const rcCompactSpan& s = chf.spans[i]; + const unsigned char area = chf.areas[i]; + + int nc = 0; + for (int dir = 0; dir < 4; ++dir) + { + if (rcGetCon(s, dir) != RC_NOT_CONNECTED) + { + const int ax = x + rcGetDirOffsetX(dir); + const int ay = y + rcGetDirOffsetY(dir); + const int ai = (int)chf.cells[ax+ay*w].index + rcGetCon(s, dir); + if (area == chf.areas[ai]) + nc++; + } + } + if (nc != 4) + src[i] = 0; + } + } + } + + + // Pass 1 + for (int y = 0; y < h; ++y) + { + for (int x = 0; x < w; ++x) + { + const rcCompactCell& c = chf.cells[x+y*w]; + for (int i = (int)c.index, ni = (int)(c.index+c.count); i < ni; ++i) + { + const rcCompactSpan& s = chf.spans[i]; + + if (rcGetCon(s, 0) != RC_NOT_CONNECTED) + { + // (-1,0) + const int ax = x + rcGetDirOffsetX(0); + const int ay = y + rcGetDirOffsetY(0); + const int ai = (int)chf.cells[ax+ay*w].index + rcGetCon(s, 0); + const rcCompactSpan& as = chf.spans[ai]; + if (src[ai]+2 < src[i]) + src[i] = src[ai]+2; + + // (-1,-1) + if (rcGetCon(as, 3) != RC_NOT_CONNECTED) + { + const int aax = ax + rcGetDirOffsetX(3); + const int aay = ay + rcGetDirOffsetY(3); + const int aai = (int)chf.cells[aax+aay*w].index + rcGetCon(as, 3); + if (src[aai]+3 < src[i]) + src[i] = src[aai]+3; + } + } + if (rcGetCon(s, 3) != RC_NOT_CONNECTED) + { + // (0,-1) + const int ax = x + rcGetDirOffsetX(3); + const int ay = y + rcGetDirOffsetY(3); + const int ai = (int)chf.cells[ax+ay*w].index + rcGetCon(s, 3); + const rcCompactSpan& as = chf.spans[ai]; + if (src[ai]+2 < src[i]) + src[i] = src[ai]+2; + + // (1,-1) + if (rcGetCon(as, 2) != RC_NOT_CONNECTED) + { + const int aax = ax + rcGetDirOffsetX(2); + const int aay = ay + rcGetDirOffsetY(2); + const int aai = (int)chf.cells[aax+aay*w].index + rcGetCon(as, 2); + if (src[aai]+3 < src[i]) + src[i] = src[aai]+3; + } + } + } + } + } + + // Pass 2 + for (int y = h-1; y >= 0; --y) + { + for (int x = w-1; x >= 0; --x) + { + const rcCompactCell& c = chf.cells[x+y*w]; + for (int i = (int)c.index, ni = (int)(c.index+c.count); i < ni; ++i) + { + const rcCompactSpan& s = chf.spans[i]; + + if (rcGetCon(s, 2) != RC_NOT_CONNECTED) + { + // (1,0) + const int ax = x + rcGetDirOffsetX(2); + const int ay = y + rcGetDirOffsetY(2); + const int ai = (int)chf.cells[ax+ay*w].index + rcGetCon(s, 2); + const rcCompactSpan& as = chf.spans[ai]; + if (src[ai]+2 < src[i]) + src[i] = src[ai]+2; + + // (1,1) + if (rcGetCon(as, 1) != RC_NOT_CONNECTED) + { + const int aax = ax + rcGetDirOffsetX(1); + const int aay = ay + rcGetDirOffsetY(1); + const int aai = (int)chf.cells[aax+aay*w].index + rcGetCon(as, 1); + if (src[aai]+3 < src[i]) + src[i] = src[aai]+3; + } + } + if (rcGetCon(s, 1) != RC_NOT_CONNECTED) + { + // (0,1) + const int ax = x + rcGetDirOffsetX(1); + const int ay = y + rcGetDirOffsetY(1); + const int ai = (int)chf.cells[ax+ay*w].index + rcGetCon(s, 1); + const rcCompactSpan& as = chf.spans[ai]; + if (src[ai]+2 < src[i]) + src[i] = src[ai]+2; + + // (-1,1) + if (rcGetCon(as, 0) != RC_NOT_CONNECTED) + { + const int aax = ax + rcGetDirOffsetX(0); + const int aay = ay + rcGetDirOffsetY(0); + const int aai = (int)chf.cells[aax+aay*w].index + rcGetCon(as, 0); + if (src[aai]+3 < src[i]) + src[i] = src[aai]+3; + } + } + } + } + } + + maxDist = 0; + for (int i = 0; i < chf.spanCount; ++i) + maxDist = rcMax(src[i], maxDist); + +} + +static unsigned short* boxBlur(rcCompactHeightfield& chf, int thr, + unsigned short* src, unsigned short* dst) +{ + const int w = chf.width; + const int h = chf.height; + + thr *= 2; + + for (int y = 0; y < h; ++y) + { + for (int x = 0; x < w; ++x) + { + const rcCompactCell& c = chf.cells[x+y*w]; + for (int i = (int)c.index, ni = (int)(c.index+c.count); i < ni; ++i) + { + const rcCompactSpan& s = chf.spans[i]; + const unsigned short cd = src[i]; + if (cd <= thr) + { + dst[i] = cd; + continue; + } + + int d = (int)cd; + for (int dir = 0; dir < 4; ++dir) + { + if (rcGetCon(s, dir) != RC_NOT_CONNECTED) + { + const int ax = x + rcGetDirOffsetX(dir); + const int ay = y + rcGetDirOffsetY(dir); + const int ai = (int)chf.cells[ax+ay*w].index + rcGetCon(s, dir); + d += (int)src[ai]; + + const rcCompactSpan& as = chf.spans[ai]; + const int dir2 = (dir+1) & 0x3; + if (rcGetCon(as, dir2) != RC_NOT_CONNECTED) + { + const int ax2 = ax + rcGetDirOffsetX(dir2); + const int ay2 = ay + rcGetDirOffsetY(dir2); + const int ai2 = (int)chf.cells[ax2+ay2*w].index + rcGetCon(as, dir2); + d += (int)src[ai2]; + } + else + { + d += cd; + } + } + else + { + d += cd*2; + } + } + dst[i] = (unsigned short)((d+5)/9); + } + } + } + return dst; +} + + +static bool floodRegion(int x, int y, int i, + unsigned short level, unsigned short r, + rcCompactHeightfield& chf, + unsigned short* srcReg, unsigned short* srcDist, + rcIntArray& stack) +{ + const int w = chf.width; + + const unsigned char area = chf.areas[i]; + + // Flood fill mark region. + stack.resize(0); + stack.push((int)x); + stack.push((int)y); + stack.push((int)i); + srcReg[i] = r; + srcDist[i] = 0; + + unsigned short lev = level >= 2 ? level-2 : 0; + int count = 0; + + while (stack.size() > 0) + { + int ci = stack.pop(); + int cy = stack.pop(); + int cx = stack.pop(); + + const rcCompactSpan& cs = chf.spans[ci]; + + // Check if any of the neighbours already have a valid region set. + unsigned short ar = 0; + for (int dir = 0; dir < 4; ++dir) + { + // 8 connected + if (rcGetCon(cs, dir) != RC_NOT_CONNECTED) + { + const int ax = cx + rcGetDirOffsetX(dir); + const int ay = cy + rcGetDirOffsetY(dir); + const int ai = (int)chf.cells[ax+ay*w].index + rcGetCon(cs, dir); + if (chf.areas[ai] != area) + continue; + unsigned short nr = srcReg[ai]; + if (nr != 0 && nr != r) + ar = nr; + + const rcCompactSpan& as = chf.spans[ai]; + + const int dir2 = (dir+1) & 0x3; + if (rcGetCon(as, dir2) != RC_NOT_CONNECTED) + { + const int ax2 = ax + rcGetDirOffsetX(dir2); + const int ay2 = ay + rcGetDirOffsetY(dir2); + const int ai2 = (int)chf.cells[ax2+ay2*w].index + rcGetCon(as, dir2); + if (chf.areas[ai2] != area) + continue; + unsigned short nr = srcReg[ai2]; + if (nr != 0 && nr != r) + ar = nr; + } + } + } + if (ar != 0) + { + srcReg[ci] = 0; + continue; + } + count++; + + // Expand neighbours. + for (int dir = 0; dir < 4; ++dir) + { + if (rcGetCon(cs, dir) != RC_NOT_CONNECTED) + { + const int ax = cx + rcGetDirOffsetX(dir); + const int ay = cy + rcGetDirOffsetY(dir); + const int ai = (int)chf.cells[ax+ay*w].index + rcGetCon(cs, dir); + if (chf.areas[ai] != area) + continue; + if (chf.dist[ai] >= lev) + { + if (srcReg[ai] == 0) + { + srcReg[ai] = r; + srcDist[ai] = 0; + stack.push(ax); + stack.push(ay); + stack.push(ai); + } + } + } + } + } + + return count > 0; +} + +static unsigned short* expandRegions(int maxIter, unsigned short level, + rcCompactHeightfield& chf, + unsigned short* srcReg, unsigned short* srcDist, + unsigned short* dstReg, unsigned short* dstDist, + rcIntArray& stack) +{ + const int w = chf.width; + const int h = chf.height; + + // Find cells revealed by the raised level. + stack.resize(0); + for (int y = 0; y < h; ++y) + { + for (int x = 0; x < w; ++x) + { + const rcCompactCell& c = chf.cells[x+y*w]; + for (int i = (int)c.index, ni = (int)(c.index+c.count); i < ni; ++i) + { + if (chf.dist[i] >= level && srcReg[i] == 0 && chf.areas[i] != RC_NULL_AREA) + { + stack.push(x); + stack.push(y); + stack.push(i); + } + } + } + } + + int iter = 0; + while (stack.size() > 0) + { + int failed = 0; + + memcpy(dstReg, srcReg, sizeof(unsigned short)*chf.spanCount); + memcpy(dstDist, srcDist, sizeof(unsigned short)*chf.spanCount); + + for (int j = 0; j < stack.size(); j += 3) + { + int x = stack[j+0]; + int y = stack[j+1]; + int i = stack[j+2]; + if (i < 0) + { + failed++; + continue; + } + + unsigned short r = srcReg[i]; + unsigned short d2 = 0xffff; + const unsigned char area = chf.areas[i]; + const rcCompactSpan& s = chf.spans[i]; + for (int dir = 0; dir < 4; ++dir) + { + if (rcGetCon(s, dir) == RC_NOT_CONNECTED) continue; + const int ax = x + rcGetDirOffsetX(dir); + const int ay = y + rcGetDirOffsetY(dir); + const int ai = (int)chf.cells[ax+ay*w].index + rcGetCon(s, dir); + if (chf.areas[ai] != area) continue; + if (srcReg[ai] > 0 && (srcReg[ai] & RC_BORDER_REG) == 0) + { + if ((int)srcDist[ai]+2 < (int)d2) + { + r = srcReg[ai]; + d2 = srcDist[ai]+2; + } + } + } + if (r) + { + stack[j+2] = -1; // mark as used + dstReg[i] = r; + dstDist[i] = d2; + } + else + { + failed++; + } + } + + // rcSwap source and dest. + rcSwap(srcReg, dstReg); + rcSwap(srcDist, dstDist); + + if (failed*3 == stack.size()) + break; + + if (level > 0) + { + ++iter; + if (iter >= maxIter) + break; + } + } + + return srcReg; +} + + +struct rcRegion +{ + inline rcRegion(unsigned short i) : + spanCount(0), + id(i), + areaType(0), + remap(false), + visited(false) + {} + + int spanCount; // Number of spans belonging to this region + unsigned short id; // ID of the region + unsigned char areaType; // Are type. + bool remap; + bool visited; + rcIntArray connections; + rcIntArray floors; +}; + +static void removeAdjacentNeighbours(rcRegion& reg) +{ + // Remove adjacent duplicates. + for (int i = 0; i < reg.connections.size() && reg.connections.size() > 1; ) + { + int ni = (i+1) % reg.connections.size(); + if (reg.connections[i] == reg.connections[ni]) + { + // Remove duplicate + for (int j = i; j < reg.connections.size()-1; ++j) + reg.connections[j] = reg.connections[j+1]; + reg.connections.pop(); + } + else + ++i; + } +} + +static void replaceNeighbour(rcRegion& reg, unsigned short oldId, unsigned short newId) +{ + bool neiChanged = false; + for (int i = 0; i < reg.connections.size(); ++i) + { + if (reg.connections[i] == oldId) + { + reg.connections[i] = newId; + neiChanged = true; + } + } + for (int i = 0; i < reg.floors.size(); ++i) + { + if (reg.floors[i] == oldId) + reg.floors[i] = newId; + } + if (neiChanged) + removeAdjacentNeighbours(reg); +} + +static bool canMergeWithRegion(const rcRegion& rega, const rcRegion& regb) +{ + if (rega.areaType != regb.areaType) + return false; + int n = 0; + for (int i = 0; i < rega.connections.size(); ++i) + { + if (rega.connections[i] == regb.id) + n++; + } + if (n > 1) + return false; + for (int i = 0; i < rega.floors.size(); ++i) + { + if (rega.floors[i] == regb.id) + return false; + } + return true; +} + +static void addUniqueFloorRegion(rcRegion& reg, int n) +{ + for (int i = 0; i < reg.floors.size(); ++i) + if (reg.floors[i] == n) + return; + reg.floors.push(n); +} + +static bool mergeRegions(rcRegion& rega, rcRegion& regb) +{ + unsigned short aid = rega.id; + unsigned short bid = regb.id; + + // Duplicate current neighbourhood. + rcIntArray acon; + acon.resize(rega.connections.size()); + for (int i = 0; i < rega.connections.size(); ++i) + acon[i] = rega.connections[i]; + rcIntArray& bcon = regb.connections; + + // Find insertion point on A. + int insa = -1; + for (int i = 0; i < acon.size(); ++i) + { + if (acon[i] == bid) + { + insa = i; + break; + } + } + if (insa == -1) + return false; + + // Find insertion point on B. + int insb = -1; + for (int i = 0; i < bcon.size(); ++i) + { + if (bcon[i] == aid) + { + insb = i; + break; + } + } + if (insb == -1) + return false; + + // Merge neighbours. + rega.connections.resize(0); + for (int i = 0, ni = acon.size(); i < ni-1; ++i) + rega.connections.push(acon[(insa+1+i) % ni]); + + for (int i = 0, ni = bcon.size(); i < ni-1; ++i) + rega.connections.push(bcon[(insb+1+i) % ni]); + + removeAdjacentNeighbours(rega); + + for (int j = 0; j < regb.floors.size(); ++j) + addUniqueFloorRegion(rega, regb.floors[j]); + rega.spanCount += regb.spanCount; + regb.spanCount = 0; + regb.connections.resize(0); + + return true; +} + +static bool isRegionConnectedToBorder(const rcRegion& reg) +{ + // Region is connected to border if + // one of the neighbours is null id. + for (int i = 0; i < reg.connections.size(); ++i) + { + if (reg.connections[i] == 0) + return true; + } + return false; +} + +static bool isSolidEdge(rcCompactHeightfield& chf, unsigned short* srcReg, + int x, int y, int i, int dir) +{ + const rcCompactSpan& s = chf.spans[i]; + unsigned short r = 0; + if (rcGetCon(s, dir) != RC_NOT_CONNECTED) + { + const int ax = x + rcGetDirOffsetX(dir); + const int ay = y + rcGetDirOffsetY(dir); + const int ai = (int)chf.cells[ax+ay*chf.width].index + rcGetCon(s, dir); + r = srcReg[ai]; + } + if (r == srcReg[i]) + return false; + return true; +} + +static void walkContour(int x, int y, int i, int dir, + rcCompactHeightfield& chf, + unsigned short* srcReg, + rcIntArray& cont) +{ + int startDir = dir; + int starti = i; + + const rcCompactSpan& ss = chf.spans[i]; + unsigned short curReg = 0; + if (rcGetCon(ss, dir) != RC_NOT_CONNECTED) + { + const int ax = x + rcGetDirOffsetX(dir); + const int ay = y + rcGetDirOffsetY(dir); + const int ai = (int)chf.cells[ax+ay*chf.width].index + rcGetCon(ss, dir); + curReg = srcReg[ai]; + } + cont.push(curReg); + + int iter = 0; + while (++iter < 40000) + { + const rcCompactSpan& s = chf.spans[i]; + + if (isSolidEdge(chf, srcReg, x, y, i, dir)) + { + // Choose the edge corner + unsigned short r = 0; + if (rcGetCon(s, dir) != RC_NOT_CONNECTED) + { + const int ax = x + rcGetDirOffsetX(dir); + const int ay = y + rcGetDirOffsetY(dir); + const int ai = (int)chf.cells[ax+ay*chf.width].index + rcGetCon(s, dir); + r = srcReg[ai]; + } + if (r != curReg) + { + curReg = r; + cont.push(curReg); + } + + dir = (dir+1) & 0x3; // Rotate CW + } + else + { + int ni = -1; + const int nx = x + rcGetDirOffsetX(dir); + const int ny = y + rcGetDirOffsetY(dir); + if (rcGetCon(s, dir) != RC_NOT_CONNECTED) + { + const rcCompactCell& nc = chf.cells[nx+ny*chf.width]; + ni = (int)nc.index + rcGetCon(s, dir); + } + if (ni == -1) + { + // Should not happen. + return; + } + x = nx; + y = ny; + i = ni; + dir = (dir+3) & 0x3; // Rotate CCW + } + + if (starti == i && startDir == dir) + { + break; + } + } + + // Remove adjacent duplicates. + if (cont.size() > 1) + { + for (int i = 0; i < cont.size(); ) + { + int ni = (i+1) % cont.size(); + if (cont[i] == cont[ni]) + { + for (int j = i; j < cont.size()-1; ++j) + cont[j] = cont[j+1]; + cont.pop(); + } + else + ++i; + } + } +} + +static bool filterSmallRegions(rcContext* ctx, int minRegionArea, int mergeRegionSize, + unsigned short& maxRegionId, + rcCompactHeightfield& chf, + unsigned short* srcReg) +{ + const int w = chf.width; + const int h = chf.height; + + const int nreg = maxRegionId+1; + rcRegion* regions = (rcRegion*)rcAlloc(sizeof(rcRegion)*nreg, RC_ALLOC_TEMP); + if (!regions) + { + ctx->log(RC_LOG_ERROR, "filterSmallRegions: Out of memory 'regions' (%d).", nreg); + return false; + } + + // Construct regions + for (int i = 0; i < nreg; ++i) + new(®ions[i]) rcRegion((unsigned short)i); + + // Find edge of a region and find connections around the contour. + for (int y = 0; y < h; ++y) + { + for (int x = 0; x < w; ++x) + { + const rcCompactCell& c = chf.cells[x+y*w]; + for (int i = (int)c.index, ni = (int)(c.index+c.count); i < ni; ++i) + { + unsigned short r = srcReg[i]; + if (r == 0 || r >= nreg) + continue; + + rcRegion& reg = regions[r]; + reg.spanCount++; + + + // Update floors. + for (int j = (int)c.index; j < ni; ++j) + { + if (i == j) continue; + unsigned short floorId = srcReg[j]; + if (floorId == 0 || floorId >= nreg) + continue; + addUniqueFloorRegion(reg, floorId); + } + + // Have found contour + if (reg.connections.size() > 0) + continue; + + reg.areaType = chf.areas[i]; + + // Check if this cell is next to a border. + int ndir = -1; + for (int dir = 0; dir < 4; ++dir) + { + if (isSolidEdge(chf, srcReg, x, y, i, dir)) + { + ndir = dir; + break; + } + } + + if (ndir != -1) + { + // The cell is at border. + // Walk around the contour to find all the neighbours. + walkContour(x, y, i, ndir, chf, srcReg, reg.connections); + } + } + } + } + + // Remove too small regions. + rcIntArray stack(32); + rcIntArray trace(32); + for (int i = 0; i < nreg; ++i) + { + rcRegion& reg = regions[i]; + if (reg.id == 0 || (reg.id & RC_BORDER_REG)) + continue; + if (reg.spanCount == 0) + continue; + if (reg.visited) + continue; + + // Count the total size of all the connected regions. + // Also keep track of the regions connects to a tile border. + bool connectsToBorder = false; + int spanCount = 0; + stack.resize(0); + trace.resize(0); + + reg.visited = true; + stack.push(i); + + while (stack.size()) + { + // Pop + int ri = stack.pop(); + + rcRegion& creg = regions[ri]; + + spanCount += creg.spanCount; + trace.push(ri); + + for (int j = 0; j < creg.connections.size(); ++j) + { + if (creg.connections[j] & RC_BORDER_REG) + { + connectsToBorder = true; + continue; + } + rcRegion& nreg = regions[creg.connections[j]]; + if (nreg.visited) + continue; + if (nreg.id == 0 || (nreg.id & RC_BORDER_REG)) + continue; + // Visit + stack.push(nreg.id); + nreg.visited = true; + } + } + + // If the accumulated regions size is too small, remove it. + // Do not remove areas which connect to tile borders + // as their size cannot be estimated correctly and removing them + // can potentially remove necessary areas. + if (spanCount < minRegionArea && !connectsToBorder) + { + // Kill all visited regions. + for (int j = 0; j < trace.size(); ++j) + { + regions[trace[j]].spanCount = 0; + regions[trace[j]].id = 0; + } + } + } + + // Merge too small regions to neighbour regions. + int mergeCount = 0 ; + do + { + mergeCount = 0; + for (int i = 0; i < nreg; ++i) + { + rcRegion& reg = regions[i]; + if (reg.id == 0 || (reg.id & RC_BORDER_REG)) + continue; + if (reg.spanCount == 0) + continue; + + // Check to see if the region should be merged. + if (reg.spanCount > mergeRegionSize && isRegionConnectedToBorder(reg)) + continue; + + // Small region with more than 1 connection. + // Or region which is not connected to a border at all. + // Find smallest neighbour region that connects to this one. + int smallest = 0xfffffff; + unsigned short mergeId = reg.id; + for (int j = 0; j < reg.connections.size(); ++j) + { + if (reg.connections[j] & RC_BORDER_REG) continue; + rcRegion& mreg = regions[reg.connections[j]]; + if (mreg.id == 0 || (mreg.id & RC_BORDER_REG)) continue; + if (mreg.spanCount < smallest && + canMergeWithRegion(reg, mreg) && + canMergeWithRegion(mreg, reg)) + { + smallest = mreg.spanCount; + mergeId = mreg.id; + } + } + // Found new id. + if (mergeId != reg.id) + { + unsigned short oldId = reg.id; + rcRegion& target = regions[mergeId]; + + // Merge neighbours. + if (mergeRegions(target, reg)) + { + // Fixup regions pointing to current region. + for (int j = 0; j < nreg; ++j) + { + if (regions[j].id == 0 || (regions[j].id & RC_BORDER_REG)) continue; + // If another region was already merged into current region + // change the nid of the previous region too. + if (regions[j].id == oldId) + regions[j].id = mergeId; + // Replace the current region with the new one if the + // current regions is neighbour. + replaceNeighbour(regions[j], oldId, mergeId); + } + mergeCount++; + } + } + } + } + while (mergeCount > 0); + + // Compress region Ids. + for (int i = 0; i < nreg; ++i) + { + regions[i].remap = false; + if (regions[i].id == 0) continue; // Skip nil regions. + if (regions[i].id & RC_BORDER_REG) continue; // Skip external regions. + regions[i].remap = true; + } + + unsigned short regIdGen = 0; + for (int i = 0; i < nreg; ++i) + { + if (!regions[i].remap) + continue; + unsigned short oldId = regions[i].id; + unsigned short newId = ++regIdGen; + for (int j = i; j < nreg; ++j) + { + if (regions[j].id == oldId) + { + regions[j].id = newId; + regions[j].remap = false; + } + } + } + maxRegionId = regIdGen; + + // Remap regions. + for (int i = 0; i < chf.spanCount; ++i) + { + if ((srcReg[i] & RC_BORDER_REG) == 0) + srcReg[i] = regions[srcReg[i]].id; + } + + for (int i = 0; i < nreg; ++i) + regions[i].~rcRegion(); + rcFree(regions); + + return true; +} + + +bool rcBuildDistanceField(rcContext* ctx, rcCompactHeightfield& chf) +{ + rcAssert(ctx); + + ctx->startTimer(RC_TIMER_BUILD_DISTANCEFIELD); + + if (chf.dist) + { + rcFree(chf.dist); + chf.dist = 0; + } + + unsigned short* src = (unsigned short*)rcAlloc(sizeof(unsigned short)*chf.spanCount, RC_ALLOC_TEMP); + if (!src) + { + ctx->log(RC_LOG_ERROR, "rcBuildDistanceField: Out of memory 'src' (%d).", chf.spanCount); + return false; + } + unsigned short* dst = (unsigned short*)rcAlloc(sizeof(unsigned short)*chf.spanCount, RC_ALLOC_TEMP); + if (!dst) + { + ctx->log(RC_LOG_ERROR, "rcBuildDistanceField: Out of memory 'dst' (%d).", chf.spanCount); + rcFree(src); + return false; + } + + unsigned short maxDist = 0; + + ctx->startTimer(RC_TIMER_BUILD_DISTANCEFIELD_DIST); + + calculateDistanceField(chf, src, maxDist); + chf.maxDistance = maxDist; + + ctx->stopTimer(RC_TIMER_BUILD_DISTANCEFIELD_DIST); + + ctx->startTimer(RC_TIMER_BUILD_DISTANCEFIELD_BLUR); + + // Blur + if (boxBlur(chf, 1, src, dst) != src) + rcSwap(src, dst); + + // Store distance. + chf.dist = src; + + ctx->stopTimer(RC_TIMER_BUILD_DISTANCEFIELD_BLUR); + + ctx->stopTimer(RC_TIMER_BUILD_DISTANCEFIELD); + + rcFree(dst); + + return true; +} + +static void paintRectRegion(int minx, int maxx, int miny, int maxy, unsigned short regId, + rcCompactHeightfield& chf, unsigned short* srcReg) +{ + const int w = chf.width; + for (int y = miny; y < maxy; ++y) + { + for (int x = minx; x < maxx; ++x) + { + const rcCompactCell& c = chf.cells[x+y*w]; + for (int i = (int)c.index, ni = (int)(c.index+c.count); i < ni; ++i) + { + if (chf.areas[i] != RC_NULL_AREA) + srcReg[i] = regId; + } + } + } +} + + +static const unsigned short RC_NULL_NEI = 0xffff; + +struct rcSweepSpan +{ + unsigned short rid; // row id + unsigned short id; // region id + unsigned short ns; // number samples + unsigned short nei; // neighbour id +}; + +bool rcBuildRegionsMonotone(rcContext* ctx, rcCompactHeightfield& chf, + const int borderSize, const int minRegionArea, const int mergeRegionArea) +{ + rcAssert(ctx); + + ctx->startTimer(RC_TIMER_BUILD_REGIONS); + + const int w = chf.width; + const int h = chf.height; + unsigned short id = 1; + + rcScopedDelete srcReg = (unsigned short*)rcAlloc(sizeof(unsigned short)*chf.spanCount, RC_ALLOC_TEMP); + if (!srcReg) + { + ctx->log(RC_LOG_ERROR, "rcBuildRegionsMonotone: Out of memory 'src' (%d).", chf.spanCount); + return false; + } + memset(srcReg,0,sizeof(unsigned short)*chf.spanCount); + + const int nsweeps = rcMax(chf.width,chf.height); + rcScopedDelete sweeps = (rcSweepSpan*)rcAlloc(sizeof(rcSweepSpan)*nsweeps, RC_ALLOC_TEMP); + if (!sweeps) + { + ctx->log(RC_LOG_ERROR, "rcBuildRegionsMonotone: Out of memory 'sweeps' (%d).", nsweeps); + return false; + } + + + // Mark border regions. + if (borderSize > 0) + { + // Make sure border will not overflow. + const int bw = rcMin(w, borderSize); + const int bh = rcMin(h, borderSize); + // Paint regions + paintRectRegion(0, bw, 0, h, id|RC_BORDER_REG, chf, srcReg); id++; + paintRectRegion(w-bw, w, 0, h, id|RC_BORDER_REG, chf, srcReg); id++; + paintRectRegion(0, w, 0, bh, id|RC_BORDER_REG, chf, srcReg); id++; + paintRectRegion(0, w, h-bh, h, id|RC_BORDER_REG, chf, srcReg); id++; + } + + rcIntArray prev(256); + + // Sweep one line at a time. + for (int y = borderSize; y < h-borderSize; ++y) + { + // Collect spans from this row. + prev.resize(id+1); + memset(&prev[0],0,sizeof(int)*id); + unsigned short rid = 1; + + for (int x = borderSize; x < w-borderSize; ++x) + { + const rcCompactCell& c = chf.cells[x+y*w]; + + for (int i = (int)c.index, ni = (int)(c.index+c.count); i < ni; ++i) + { + const rcCompactSpan& s = chf.spans[i]; + if (chf.areas[i] == RC_NULL_AREA) continue; + + // -x + unsigned short previd = 0; + if (rcGetCon(s, 0) != RC_NOT_CONNECTED) + { + const int ax = x + rcGetDirOffsetX(0); + const int ay = y + rcGetDirOffsetY(0); + const int ai = (int)chf.cells[ax+ay*w].index + rcGetCon(s, 0); + if ((srcReg[ai] & RC_BORDER_REG) == 0 && chf.areas[i] == chf.areas[ai]) + previd = srcReg[ai]; + } + + if (!previd) + { + previd = rid++; + sweeps[previd].rid = previd; + sweeps[previd].ns = 0; + sweeps[previd].nei = 0; + } + + // -y + if (rcGetCon(s,3) != RC_NOT_CONNECTED) + { + const int ax = x + rcGetDirOffsetX(3); + const int ay = y + rcGetDirOffsetY(3); + const int ai = (int)chf.cells[ax+ay*w].index + rcGetCon(s, 3); + if (srcReg[ai] && (srcReg[ai] & RC_BORDER_REG) == 0 && chf.areas[i] == chf.areas[ai]) + { + unsigned short nr = srcReg[ai]; + if (!sweeps[previd].nei || sweeps[previd].nei == nr) + { + sweeps[previd].nei = nr; + sweeps[previd].ns++; + prev[nr]++; + } + else + { + sweeps[previd].nei = RC_NULL_NEI; + } + } + } + + srcReg[i] = previd; + } + } + + // Create unique ID. + for (int i = 1; i < rid; ++i) + { + if (sweeps[i].nei != RC_NULL_NEI && sweeps[i].nei != 0 && + prev[sweeps[i].nei] == (int)sweeps[i].ns) + { + sweeps[i].id = sweeps[i].nei; + } + else + { + sweeps[i].id = id++; + } + } + + // Remap IDs + for (int x = borderSize; x < w-borderSize; ++x) + { + const rcCompactCell& c = chf.cells[x+y*w]; + + for (int i = (int)c.index, ni = (int)(c.index+c.count); i < ni; ++i) + { + if (srcReg[i] > 0 && srcReg[i] < rid) + srcReg[i] = sweeps[srcReg[i]].id; + } + } + } + + ctx->startTimer(RC_TIMER_BUILD_REGIONS_FILTER); + + // Filter out small regions. + chf.maxRegions = id; + if (!filterSmallRegions(ctx, minRegionArea, mergeRegionArea, chf.maxRegions, chf, srcReg)) + return false; + + ctx->stopTimer(RC_TIMER_BUILD_REGIONS_FILTER); + + // Store the result out. + for (int i = 0; i < chf.spanCount; ++i) + chf.spans[i].reg = srcReg[i]; + + ctx->stopTimer(RC_TIMER_BUILD_REGIONS); + + return true; +} + +bool rcBuildRegions(rcContext* ctx, rcCompactHeightfield& chf, + const int borderSize, const int minRegionArea, const int mergeRegionArea) +{ + rcAssert(ctx); + + ctx->startTimer(RC_TIMER_BUILD_REGIONS); + + const int w = chf.width; + const int h = chf.height; + + rcScopedDelete buf = (unsigned short*)rcAlloc(sizeof(unsigned short)*chf.spanCount*4, RC_ALLOC_TEMP); + if (!buf) + { + ctx->log(RC_LOG_ERROR, "rcBuildRegions: Out of memory 'tmp' (%d).", chf.spanCount*4); + return false; + } + + ctx->startTimer(RC_TIMER_BUILD_REGIONS_WATERSHED); + + rcIntArray stack(1024); + rcIntArray visited(1024); + + unsigned short* srcReg = buf; + unsigned short* srcDist = buf+chf.spanCount; + unsigned short* dstReg = buf+chf.spanCount*2; + unsigned short* dstDist = buf+chf.spanCount*3; + + memset(srcReg, 0, sizeof(unsigned short)*chf.spanCount); + memset(srcDist, 0, sizeof(unsigned short)*chf.spanCount); + + unsigned short regionId = 1; + unsigned short level = (chf.maxDistance+1) & ~1; + + // TODO: Figure better formula, expandIters defines how much the + // watershed "overflows" and simplifies the regions. Tying it to + // agent radius was usually good indication how greedy it could be. +// const int expandIters = 4 + walkableRadius * 2; + const int expandIters = 8; + + // Mark border regions. + paintRectRegion(0, borderSize, 0, h, regionId|RC_BORDER_REG, chf, srcReg); regionId++; + paintRectRegion(w-borderSize, w, 0, h, regionId|RC_BORDER_REG, chf, srcReg); regionId++; + paintRectRegion(0, w, 0, borderSize, regionId|RC_BORDER_REG, chf, srcReg); regionId++; + paintRectRegion(0, w, h-borderSize, h, regionId|RC_BORDER_REG, chf, srcReg); regionId++; + + while (level > 0) + { + level = level >= 2 ? level-2 : 0; + + ctx->startTimer(RC_TIMER_BUILD_REGIONS_EXPAND); + + // Expand current regions until no empty connected cells found. + if (expandRegions(expandIters, level, chf, srcReg, srcDist, dstReg, dstDist, stack) != srcReg) + { + rcSwap(srcReg, dstReg); + rcSwap(srcDist, dstDist); + } + + ctx->stopTimer(RC_TIMER_BUILD_REGIONS_EXPAND); + + ctx->startTimer(RC_TIMER_BUILD_REGIONS_FLOOD); + + // Mark new regions with IDs. + for (int y = 0; y < h; ++y) + { + for (int x = 0; x < w; ++x) + { + const rcCompactCell& c = chf.cells[x+y*w]; + for (int i = (int)c.index, ni = (int)(c.index+c.count); i < ni; ++i) + { + if (chf.dist[i] < level || srcReg[i] != 0 || chf.areas[i] == RC_NULL_AREA) + continue; + + if (floodRegion(x, y, i, level, regionId, chf, srcReg, srcDist, stack)) + regionId++; + } + } + } + + ctx->stopTimer(RC_TIMER_BUILD_REGIONS_FLOOD); + + } + + // Expand current regions until no empty connected cells found. + if (expandRegions(expandIters*8, 0, chf, srcReg, srcDist, dstReg, dstDist, stack) != srcReg) + { + rcSwap(srcReg, dstReg); + rcSwap(srcDist, dstDist); + } + + ctx->stopTimer(RC_TIMER_BUILD_REGIONS_WATERSHED); + + ctx->startTimer(RC_TIMER_BUILD_REGIONS_FILTER); + + // Filter out small regions. + chf.maxRegions = regionId; + if (!filterSmallRegions(ctx, minRegionArea, mergeRegionArea, chf.maxRegions, chf, srcReg)) + return false; + + ctx->stopTimer(RC_TIMER_BUILD_REGIONS_FILTER); + + // Write the result out. + for (int i = 0; i < chf.spanCount; ++i) + chf.spans[i].reg = srcReg[i]; + + ctx->stopTimer(RC_TIMER_BUILD_REGIONS); + + return true; +} + + diff --git a/dep/recastnavigation/Recast/win/Recast_VC100.sln b/dep/recastnavigation/Recast/win/Recast_VC100.sln new file mode 100644 index 000000000..4b4019914 --- /dev/null +++ b/dep/recastnavigation/Recast/win/Recast_VC100.sln @@ -0,0 +1,20 @@ + +Microsoft Visual Studio Solution File, Format Version 11.00 +# Visual Studio 2010 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Recast", "VC100\Recast.vcxproj", "{00B9DC66-96A6-465D-A6C1-5DFF94E48A64}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Win32 = Debug|Win32 + Release|Win32 = Release|Win32 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {00B9DC66-96A6-465D-A6C1-5DFF94E48A64}.Debug|Win32.ActiveCfg = Debug|Win32 + {00B9DC66-96A6-465D-A6C1-5DFF94E48A64}.Debug|Win32.Build.0 = Debug|Win32 + {00B9DC66-96A6-465D-A6C1-5DFF94E48A64}.Release|Win32.ActiveCfg = Release|Win32 + {00B9DC66-96A6-465D-A6C1-5DFF94E48A64}.Release|Win32.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/dep/recastnavigation/Recast/win/Recast_VC90.sln b/dep/recastnavigation/Recast/win/Recast_VC90.sln new file mode 100644 index 000000000..320653199 --- /dev/null +++ b/dep/recastnavigation/Recast/win/Recast_VC90.sln @@ -0,0 +1,20 @@ + +Microsoft Visual Studio Solution File, Format Version 10.00 +# Visual Studio 2008 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Recast", "VC90\Recast.vcproj", "{B6137343-A2F6-4AE7-BA47-484EC0EF369C}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Win32 = Debug|Win32 + Release|Win32 = Release|Win32 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {B6137343-A2F6-4AE7-BA47-484EC0EF369C}.Debug|Win32.ActiveCfg = Debug|Win32 + {B6137343-A2F6-4AE7-BA47-484EC0EF369C}.Debug|Win32.Build.0 = Debug|Win32 + {B6137343-A2F6-4AE7-BA47-484EC0EF369C}.Release|Win32.ActiveCfg = Release|Win32 + {B6137343-A2F6-4AE7-BA47-484EC0EF369C}.Release|Win32.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/dep/recastnavigation/Recast/win/VC100/.gitignore b/dep/recastnavigation/Recast/win/VC100/.gitignore new file mode 100644 index 000000000..d82e4915b --- /dev/null +++ b/dep/recastnavigation/Recast/win/VC100/.gitignore @@ -0,0 +1,6 @@ + +*__Win32_Release +*__Win32_Debug +*__x64_Release +*__x64_Debug +*.user \ No newline at end of file diff --git a/dep/recastnavigation/Recast/win/VC100/Recast.vcxproj b/dep/recastnavigation/Recast/win/VC100/Recast.vcxproj new file mode 100644 index 000000000..3f711e377 --- /dev/null +++ b/dep/recastnavigation/Recast/win/VC100/Recast.vcxproj @@ -0,0 +1,95 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + + {00B9DC66-96A6-465D-A6C1-5DFF94E48A64} + Recast + + + + StaticLibrary + true + MultiByte + + + StaticLibrary + false + true + MultiByte + + + + + + + + + + + + + $(ProjectDir)\..\..\..\..\lib\$(Platform)_$(Configuration)\ + + + .\$(ProjectName)__$(Platform)_$(Configuration)\ + + + $(ProjectDir)\..\..\..\..\lib\$(Platform)_$(Configuration)\ + .\$(ProjectName)__$(Platform)_$(Configuration)\ + + + + Level3 + Disabled + ..\..\include + WIN32;DEBUG;_MBCS;%(PreprocessorDefinitions) + + + true + + + + + Level3 + MaxSpeed + true + true + Speed + WIN32;NDEBUG;_MBCS;%(PreprocessorDefinitions) + ..\..\include + + + true + true + true + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/dep/recastnavigation/Recast/win/VC100/Recast.vcxproj.filters b/dep/recastnavigation/Recast/win/VC100/Recast.vcxproj.filters new file mode 100644 index 000000000..6134e65a1 --- /dev/null +++ b/dep/recastnavigation/Recast/win/VC100/Recast.vcxproj.filters @@ -0,0 +1,51 @@ + + + + + {ef95c759-27da-462b-9f5e-d599017cb842} + + + {4ea80bc1-958b-4d16-b708-675bc74de83d} + + + + + include + + + include + + + include + + + + + src + + + src + + + src + + + src + + + src + + + src + + + src + + + src + + + src + + + \ No newline at end of file diff --git a/dep/recastnavigation/Recast/win/VC90/.gitignore b/dep/recastnavigation/Recast/win/VC90/.gitignore new file mode 100644 index 000000000..d82e4915b --- /dev/null +++ b/dep/recastnavigation/Recast/win/VC90/.gitignore @@ -0,0 +1,6 @@ + +*__Win32_Release +*__Win32_Debug +*__x64_Release +*__x64_Debug +*.user \ No newline at end of file diff --git a/dep/recastnavigation/Recast/win/VC90/Recast.vcproj b/dep/recastnavigation/Recast/win/VC90/Recast.vcproj new file mode 100644 index 000000000..41a45e181 --- /dev/null +++ b/dep/recastnavigation/Recast/win/VC90/Recast.vcproj @@ -0,0 +1,204 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/dep/recastnavigation/RecastDemo/Bin/.gitignore b/dep/recastnavigation/RecastDemo/Bin/.gitignore new file mode 100644 index 000000000..64ed58794 --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Bin/.gitignore @@ -0,0 +1,3 @@ + +!.gitignore +* \ No newline at end of file diff --git a/dep/recastnavigation/RecastDemo/Bin/DroidSans.ttf b/dep/recastnavigation/RecastDemo/Bin/DroidSans.ttf new file mode 100644 index 000000000..15c274d82 Binary files /dev/null and b/dep/recastnavigation/RecastDemo/Bin/DroidSans.ttf differ diff --git a/dep/recastnavigation/RecastDemo/Bin/Meshes/dungeon.obj b/dep/recastnavigation/RecastDemo/Bin/Meshes/dungeon.obj new file mode 100644 index 000000000..490554275 --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Bin/Meshes/dungeon.obj @@ -0,0 +1,15234 @@ +v 32.471557617 31.175949097 3.788104773 +v 31.950048447 31.175949097 2.338263273 +v 31.688222885 31.175949097 0.819886208 +v 34.222843170 31.175949097 6.309397697 +v 33.236907959 31.175949097 5.125359535 +v 45.539302826 31.175949097 7.342514992 +v 39.693061829 31.175949097 8.885383606 +v 36.730842590 31.175949097 8.079663277 +v 35.399402618 31.175949097 7.304241180 +v 38.176704407 31.175949097 8.612103462 +v 48.521808624 31.175949097 -3.622624636 +v 49.026046753 31.175949097 2.402715683 +v 47.718185425 31.175949097 5.180017471 +v 46.723342896 31.175949097 6.356580257 +v 48.493606567 31.175949097 3.848578453 +v 49.305145264 31.175949097 -0.654410124 +v 49.299327850 31.175949097 0.886361718 +v 42.752204895 31.175949097 8.629374504 +v 41.233833313 31.175949097 8.891200066 +v 44.202045441 31.175949097 8.107864380 +v 49.043319702 31.175949097 -2.172783852 +v 38.241161346 31.175949097 -8.463897705 +v 44.262527466 31.175949097 -7.914186001 +v 46.770526886 31.175949097 -6.143918514 +v 47.756462097 31.175949097 -4.959880829 +v 45.593963623 31.175949097 -7.138762951 +v 41.300308228 31.175949097 -8.719906807 +v 42.816661835 31.175949097 -8.446626663 +v 31.694038391 31.175949097 -0.720889091 +v 31.967319489 31.175949097 -2.237243176 +v 33.275184631 31.175949097 -5.014545441 +v 32.499759674 31.175949097 -3.683105707 +v 35.454067230 31.175949097 -7.177039623 +v 36.791320801 31.175949097 -7.942388058 +v 34.270027161 31.175949097 -6.191106319 +v 39.759536743 31.175949097 -8.725723267 +v 31.788227081 9.998181343 3.466857910 +v 31.788227081 13.729361534 3.467402458 +v 32.028339386 13.729361534 3.467821598 +v 32.028339386 9.998181343 3.467277050 +v 32.028583527 13.729488373 3.327821970 +v 32.028583527 9.998181343 3.327277660 +v 31.788471222 9.998181343 3.326858521 +v 31.788471222 13.729488373 3.327402830 +v 31.788461685 16.147314072 3.332412243 +v 32.028575897 16.147314072 3.332831383 +v 32.028331757 16.147188187 3.472831011 +v 31.788217545 16.147188187 3.472411871 +v 31.736412048 16.147670746 2.534013748 +v 31.496299744 16.147670746 2.533594608 +v 31.496307373 14.267010689 2.528585196 +v 31.345476151 14.589399338 1.754027605 +v 31.345466614 16.147884369 1.759037018 +v 31.585578918 16.147884369 1.759456158 +v 31.585588455 14.589399338 1.754446745 +v 31.736419678 14.267010689 2.529004335 +v 31.213439941 14.785192490 0.919718027 +v 31.213432312 16.148014069 0.924727559 +v 31.453556061 14.785192490 0.920137167 +v 31.453544617 16.148014069 0.925146699 +v 31.166309357 16.148063660 0.074689411 +v 31.406433105 14.858482361 0.070098996 +v 31.406423569 16.148063660 0.075108476 +v 31.166316986 14.858482361 0.069679931 +v 31.800228119 9.998181343 -3.409051180 +v 31.800226212 13.749429703 -3.408686399 +v 31.799911499 13.749273300 -3.228687048 +v 31.799911499 9.998181343 -3.229051828 +v 32.040023804 9.998181343 -3.228632689 +v 32.040023804 13.749273300 -3.228267908 +v 32.040340424 13.749429703 -3.408267260 +v 32.040340424 9.998181343 -3.408632040 +v 31.216400146 14.795266151 -0.776435494 +v 31.216392517 16.148019791 -0.771425962 +v 31.456514359 14.795266151 -0.776016355 +v 31.456504822 16.148019791 -0.771006942 +v 31.591457367 14.590011597 -1.608003974 +v 31.591447830 16.147884369 -1.602994561 +v 31.351343155 14.590011597 -1.608423114 +v 31.351333618 16.147884369 -1.603413701 +v 32.040016174 16.147327423 -3.223258734 +v 31.799903870 16.147327423 -3.223677874 +v 31.800216675 16.147483826 -3.403676987 +v 32.040328979 16.147483826 -3.403257847 +v 31.745027542 16.147678375 -2.403040648 +v 31.504913330 16.147678375 -2.403459787 +v 31.745037079 14.277850151 -2.408050060 +v 31.504922867 14.277850151 -2.408469200 +v 46.721595764 24.693101883 6.354872704 +v 45.537879944 24.693101883 7.340530396 +v 47.716171265 24.693101883 5.178639412 +v 48.491386414 24.693101883 3.847570896 +v 46.722469330 23.774042130 6.355726242 +v 45.538589478 23.774042130 7.341522694 +v 47.717178345 23.774042130 5.179327965 +v 48.492496490 23.774042130 3.848074436 +v 42.751548767 24.693101883 8.627023697 +v 41.233592987 24.693101883 8.888769150 +v 44.200992584 24.693101883 8.105663300 +v 39.693244934 24.693101883 8.882948875 +v 44.201519012 23.774042130 8.106764793 +v 41.233711243 23.774042130 8.889985085 +v 39.693153381 23.774042130 8.884165764 +v 42.751876831 23.774042130 8.628198624 +v 49.023681641 24.693101883 2.402109146 +v 49.296894073 24.693101883 0.886175275 +v 49.302715302 24.693101883 -0.654170871 +v 49.024864197 23.774042130 2.402412415 +v 49.298110962 23.774042130 0.886268497 +v 49.303928375 23.774042130 -0.654290438 +v 49.040969849 24.693101883 -2.172126293 +v 48.519607544 24.693101883 -3.621569395 +v 49.042144775 23.774042130 -2.172455311 +v 48.520709991 23.774042130 -3.622097015 +v 47.754474640 24.693101883 -4.958458900 +v 46.768821716 24.693101883 -6.142173767 +v 45.592586517 24.693101883 -7.136748314 +v 44.261516571 24.693101883 -7.911962032 +v 42.816055298 24.693101883 -8.444260597 +v 45.593276978 23.774042130 -7.137755394 +v 46.769672394 23.774042130 -6.143045902 +v 47.755466461 23.774042130 -4.959169388 +v 42.816360474 23.774042130 -8.445443153 +v 44.262020111 23.774042130 -7.913074017 +v 41.300121307 24.693101883 -8.717472076 +v 39.759777069 24.693101883 -8.723292351 +v 38.241821289 24.693101883 -8.461545944 +v 39.759654999 23.774042130 -8.724507332 +v 41.300216675 23.774042130 -8.718688965 +v 38.241493225 23.774042130 -8.462721825 +v 49.023681641 17.277132034 2.402109146 +v 48.491386414 17.277132034 3.847570896 +v 49.296894073 17.277132034 0.886175275 +v 49.302715302 17.277132034 -0.654170871 +v 46.721595764 17.277132034 6.354872704 +v 45.537879944 17.277132034 7.340530396 +v 47.716171265 17.277132034 5.178639412 +v 42.751548767 17.277132034 8.627023697 +v 41.233592987 17.277132034 8.888769150 +v 44.200992584 17.277132034 8.105663300 +v 39.693244934 17.277132034 8.882948875 +v 46.721595764 16.372127533 6.354872704 +v 45.537879944 16.372127533 7.340530396 +v 47.716171265 16.372127533 5.178639412 +v 48.491386414 16.372127533 3.847570896 +v 46.721595764 10.354028702 6.354872704 +v 45.537879944 10.354028702 7.340530396 +v 47.716171265 10.354028702 5.178639412 +v 48.491386414 10.354028702 3.847570896 +v 42.751548767 16.372127533 8.627023697 +v 44.200992584 16.372127533 8.105663300 +v 44.200992584 10.354028702 8.105663300 +v 42.751548767 10.354028702 8.627023697 +v 45.442817688 10.109920502 7.175106049 +v 46.599250793 10.109920502 6.208469391 +v 46.599605560 9.998180389 6.208224297 +v 45.443206787 9.998180389 7.174926758 +v 45.872833252 9.998180389 5.478765011 +v 47.570262909 10.109920502 5.055705547 +v 47.570568085 9.998180389 5.055403233 +v 44.854145050 9.998181343 6.330346107 +v 46.728168488 9.998180389 4.463228226 +v 44.136096954 10.109920502 7.926244736 +v 42.718795776 10.109920502 8.439061165 +v 42.454551697 9.998181343 7.443909645 +v 43.703060150 9.998181343 6.992096901 +v 44.136512756 9.998181343 7.926135540 +v 42.719226837 9.998181343 8.439026833 +v 49.023681641 16.372127533 2.402109146 +v 49.296894073 16.372127533 0.886175275 +v 49.302715302 16.372127533 -0.654170871 +v 49.023681641 10.354028702 2.402109146 +v 49.296894073 10.354028702 0.886175275 +v 49.302715302 10.354028702 -0.654170871 +v 48.326347351 10.109920502 3.751841307 +v 48.326595306 9.998180389 3.751490116 +v 47.394161224 9.998180389 3.314592838 +v 48.086002350 9.998180389 -0.567131877 +v 48.844528198 10.109920502 2.336492777 +v 47.850578308 9.998180389 2.067759991 +v 48.844711304 9.998180389 2.336104155 +v 49.109176636 9.998180389 0.852250695 +v 49.109066010 10.109920502 0.852665544 +v 48.083549500 9.998180389 0.760612607 +v 49.111961365 9.998180389 -0.654983759 +v 49.111923218 10.109920502 -0.654555559 +v 41.233592987 16.372127533 8.888769150 +v 39.693244934 16.372127533 8.882948875 +v 41.233592987 10.354028702 8.888769150 +v 39.693244934 10.354028702 8.882948875 +v 38.242927551 10.109920502 8.430583000 +v 39.726757050 10.109920502 8.695119858 +v 39.727172852 9.998181343 8.695234299 +v 38.243316650 9.998181343 8.430766106 +v 39.818809509 9.998181343 7.669605255 +v 37.264827728 9.998181343 6.980216503 +v 41.146553040 9.998181343 7.672055721 +v 41.234405518 9.998181343 8.698015213 +v 41.233978271 10.109920502 8.697976112 +v 41.300121307 17.277132034 -8.717472076 +v 42.816055298 17.277132034 -8.444260597 +v 39.759777069 17.277132034 -8.723292351 +v 38.241821289 17.277132034 -8.461545944 +v 49.040969849 17.277132034 -2.172126293 +v 48.519607544 17.277132034 -3.621569395 +v 47.754474640 17.277132034 -4.958458900 +v 46.768821716 17.277132034 -6.142173767 +v 45.592586517 17.277132034 -7.136748314 +v 44.261516571 17.277132034 -7.911962032 +v 49.040969849 16.372127533 -2.172126293 +v 48.519607544 16.372127533 -3.621569395 +v 45.592586517 16.372127533 -7.136748314 +v 46.768821716 16.372127533 -6.142173767 +v 47.754474640 16.372127533 -4.958458900 +v 44.261516571 16.372127533 -7.911962032 +v 42.816055298 16.372127533 -8.444260597 +v 43.728538513 9.998181343 -6.814738750 +v 44.877174377 9.998181343 -6.148745060 +v 45.469352722 9.998180389 -6.991144657 +v 41.174560547 9.998181343 -7.504128933 +v 45.892707825 9.998180389 -5.293409824 +v 49.040969849 10.354028702 -2.172126293 +v 48.519607544 10.354028702 -3.621569395 +v 48.852970123 9.998180389 -2.139802933 +v 47.857856750 9.998180389 -1.875129580 +v 48.853004456 10.109920502 -2.139374256 +v 48.340190887 10.109920502 -3.556675434 +v 47.406040192 9.998180389 -3.123638630 +v 48.340080261 9.998180389 -3.557091475 +v 47.754474640 10.354028702 -4.958458900 +v 46.768821716 10.354028702 -6.142173767 +v 45.592586517 10.354028702 -7.136748314 +v 44.261516571 10.354028702 -7.911962032 +v 42.816055298 10.354028702 -8.444260597 +v 47.588871002 9.998180389 -4.863785744 +v 46.744293213 9.998180389 -4.274724007 +v 47.589050293 10.109920502 -4.863395691 +v 46.622417450 10.109920502 -6.019829273 +v 46.622169495 9.998180389 -6.020182610 +v 45.469654083 10.109920502 -6.990839005 +v 44.165786743 10.109920502 -7.746923447 +v 44.165435791 9.998181343 -7.747171879 +v 41.300121307 16.372127533 -8.717472076 +v 39.759777069 16.372127533 -8.723292351 +v 38.241821289 16.372127533 -8.461545944 +v 41.300121307 10.354028702 -8.717472076 +v 39.759777069 10.354028702 -8.723292351 +v 38.241821289 10.354028702 -8.461545944 +v 42.750438690 10.109920502 -8.265105247 +v 42.750049591 9.998181343 -8.265288353 +v 42.481704712 9.998181343 -7.271155834 +v 41.266613007 10.109920502 -8.529643059 +v 41.266197205 9.998181343 -8.529757500 +v 39.759391785 10.109920502 -8.532499313 +v 39.758964539 9.998181343 -8.532538414 +v 39.846813202 9.998181343 -7.506579876 +v 38.538818359 9.998181343 -7.278433323 +v 38.274574280 10.109920502 -8.273585320 +v 38.274143219 9.998181343 -8.273550034 +v 36.731849670 24.693101883 8.077439308 +v 38.177310944 24.693101883 8.609737396 +v 35.400783539 24.693101883 7.302225113 +v 34.224548340 24.693101883 6.307652473 +v 33.238891602 24.693101883 5.123937607 +v 36.731346130 23.774042130 8.078551292 +v 38.177009583 23.774042130 8.610920906 +v 35.400093079 23.774042130 7.303232670 +v 34.223693848 23.774042130 6.308525085 +v 33.237899780 23.774042130 5.124648571 +v 31.952400208 24.693101883 2.337605953 +v 31.690650940 24.693101883 0.819646955 +v 32.473762512 24.693101883 3.787048340 +v 32.472660065 23.774042130 3.787576437 +v 31.951225281 23.774042130 2.337934732 +v 31.696472168 24.693101883 -0.720702767 +v 31.689437866 23.774042130 0.819766641 +v 32.501983643 24.693101883 -3.682098389 +v 33.277198792 24.693101883 -5.013166428 +v 31.969684601 24.693101883 -2.236636877 +v 32.500873566 23.774042130 -3.682601929 +v 33.276191711 23.774042130 -5.013856411 +v 31.968502045 23.774042130 -2.236939907 +v 31.695255280 23.774042130 -0.720795989 +v 35.455490112 24.693101883 -7.175054550 +v 36.792377472 24.693101883 -7.940186977 +v 34.271774292 24.693101883 -6.189398766 +v 36.791851044 23.774042130 -7.941287518 +v 35.454776764 23.774042130 -7.176047325 +v 34.270900726 23.774042130 -6.190252781 +v 32.473762512 17.277132034 3.787048340 +v 31.952400208 17.277132034 2.337605953 +v 33.238891602 17.277132034 5.123937607 +v 31.690650940 17.277132034 0.819646955 +v 31.693531036 17.277132034 0.057565335 +v 36.731849670 17.277132034 8.077439308 +v 38.177310944 17.277132034 8.609737396 +v 35.400783539 17.277132034 7.302225113 +v 34.224548340 17.277132034 6.307652473 +v 36.731849670 16.372127533 8.077439308 +v 38.177310944 16.372127533 8.609737396 +v 35.400783539 16.372127533 7.302225113 +v 34.224548340 16.372127533 6.307652473 +v 33.238891602 16.372127533 5.123937607 +v 32.473762512 16.372127533 3.787048340 +v 32.217067719 15.177541733 3.073410511 +v 31.952400208 16.372127533 2.337605953 +v 36.731849670 10.354028702 8.077439308 +v 35.400783539 10.354028702 7.302225113 +v 38.177310944 10.354028702 8.609737396 +v 38.511661530 9.998181343 7.436633110 +v 36.827930450 9.998181343 7.912648678 +v 33.586009979 9.998181343 3.286829948 +v 36.827579498 10.109920502 7.912400246 +v 35.523715973 10.109920502 7.156316757 +v 35.524017334 9.998181343 7.156622887 +v 36.116191864 9.998181343 6.314222813 +v 35.100658417 9.998181343 5.458888531 +v 32.473762512 10.354028702 3.787048340 +v 33.238891602 10.354028702 5.123937607 +v 34.224548340 10.354028702 6.307652473 +v 34.371196747 9.998181343 6.185661316 +v 33.404495239 9.998181343 5.029264927 +v 33.404315948 10.109920502 5.028873920 +v 34.370952606 10.109920502 6.185307503 +v 34.249076843 9.998181343 4.440203190 +v 32.653285980 9.998181343 3.722570896 +v 32.653179169 10.109920502 3.722154856 +v 32.390846252 9.998181343 3.008769512 +v 32.390743256 10.109920502 3.009335756 +v 32.215225220 10.354028702 3.068289518 +v 33.416843414 9.998181343 2.826718807 +v 32.210395813 9.998181343 3.071496487 +v 32.216464996 13.597610474 3.071733236 +v 30.841369629 9.998181343 3.065892220 +v 30.841371536 13.593065262 3.065892696 +v 29.847984314 9.998181343 3.064158440 +v 29.847984314 13.593065262 3.064158440 +v 32.101707458 13.597610474 3.071532965 +v 32.095634460 9.998181343 3.071296215 +v 31.952400208 14.024101257 2.337605953 +v 31.824810028 14.315032005 1.630335212 +v 31.710052490 14.315032005 1.630134821 +v 29.849193573 14.013492584 2.370918036 +v 30.842580795 14.013491631 2.372651577 +v 30.843887329 14.319043159 1.625072956 +v 29.850498199 14.319043159 1.623339295 +v 30.845237732 14.504489899 0.850766778 +v 30.846607208 14.566659927 0.065888450 +v 29.853219986 14.566660881 0.064154625 +v 29.851850510 14.504489899 0.849032998 +v 31.575893402 14.506861687 0.819446802 +v 31.690650940 14.506861687 0.819646955 +v 31.690650940 16.372127533 0.819646955 +v 31.693531036 16.372127533 0.057565335 +v 31.578773499 14.563559532 0.057368152 +v 31.693531036 14.563559532 0.057568435 +v 31.837966919 14.025511742 2.338305235 +v 32.397361755 9.998181343 -2.868865728 +v 32.501983643 17.277132034 -3.682098389 +v 33.277198792 17.277132034 -5.013166428 +v 31.969684601 17.277132034 -2.236636877 +v 31.696472168 17.277132034 -0.720702767 +v 36.792377472 17.277132034 -7.940186977 +v 35.455490112 17.277132034 -7.175054550 +v 34.271774292 17.277132034 -6.189398766 +v 33.422950745 9.998181343 -2.681992054 +v 31.696472168 14.500898361 -0.720702767 +v 31.696472168 16.372127533 -0.720702767 +v 31.581714630 14.500898361 -0.720903039 +v 32.221408844 9.998181343 -2.947216749 +v 32.106651306 9.998181343 -2.947417021 +v 29.858455658 9.998181343 -2.935833454 +v 33.597019196 9.998181343 -3.145344257 +v 32.666774750 9.998181343 -3.586017847 +v 32.397502899 10.109920502 -2.868808270 +v 32.667022705 10.109920502 -3.586368561 +v 32.501983643 10.354028702 -3.682098389 +v 32.230220795 10.354028702 -2.944126129 +v 32.501983643 16.372127533 -3.682098389 +v 30.851840973 9.998181343 -2.934099674 +v 31.969684601 16.372127533 -2.236636877 +v 30.850643158 14.013491631 -2.246689558 +v 30.849338531 14.319043159 -1.499111056 +v 29.857255936 14.013492584 -2.248423100 +v 29.858455658 13.593065262 -2.935833454 +v 30.851842880 13.593065262 -2.934099674 +v 29.855951309 14.319043159 -1.500844717 +v 31.832874298 14.318614006 -1.495679021 +v 31.718116760 14.318614006 -1.495879292 +v 30.847988129 14.504489899 -0.724804401 +v 29.854598999 14.504489899 -0.726538181 +v 33.277198792 16.372127533 -5.013166428 +v 32.223587036 15.128337860 -2.926110983 +v 31.969684601 14.016605377 -2.236636877 +v 32.227390289 13.587356567 -2.936434984 +v 36.792377472 16.372127533 -7.940186977 +v 35.455490112 16.372127533 -7.175054550 +v 34.271774292 16.372127533 -6.189398766 +v 34.265201569 9.998181343 -4.297754765 +v 36.139221191 9.998181343 -6.164871693 +v 36.792377472 10.354028702 -7.940186977 +v 35.455490112 10.354028702 -7.175054550 +v 36.857269287 10.109920502 -7.760769367 +v 36.856853485 9.998181343 -7.760660172 +v 37.290306091 9.998181343 -6.826621532 +v 35.550552368 10.109920502 -7.009631634 +v 35.550159454 9.998181343 -7.009452343 +v 34.271774292 10.354028702 -6.189398766 +v 33.277198792 10.354028702 -5.013166428 +v 33.422801971 9.998181343 -4.889929771 +v 34.394119263 10.109920502 -6.042995930 +v 33.423107147 10.109920502 -4.890232563 +v 35.120536804 9.998181343 -5.313291073 +v 34.393764496 9.998181343 -6.042750835 +v 31.854927063 14.016605377 -2.236837149 +v 32.112632751 13.587356567 -2.936635256 +v 10.356585503 15.374712944 5.018982410 +v 29.294418335 16.423784256 3.660708904 +v 29.291988373 15.376764297 5.051695347 +v 10.358929634 16.423786163 3.627655268 +v 29.296293259 16.884586334 2.586380243 +v 10.360805511 16.884588242 2.553326368 +v 29.298488617 17.185401917 1.329080343 +v 10.362999916 17.185403824 1.296026111 +v 29.300714493 17.272243500 0.053253978 +v 10.365226746 17.272245407 0.020199960 +v 29.302951813 17.185401917 -1.229294538 +v 10.367465019 17.185403824 -1.262348533 +v 29.305149078 16.884586334 -2.486595154 +v 10.369660378 16.884588242 -2.519649506 +v 29.307025909 16.422849655 -3.563069105 +v 10.371539116 16.422851563 -3.596122742 +v 29.309436798 15.374711037 -4.943069458 +v 10.373947144 15.381685257 -4.975730896 +v 29.304344177 15.435887337 -2.026943684 +v 28.841117859 14.941126823 -2.793433666 +v 28.839639664 15.304441452 -1.946416855 +v 29.305885315 15.072572708 -2.908475876 +v 28.638072968 14.662881851 -2.633832216 +v 28.636623383 14.979496956 -1.803709745 +v 29.309436798 15.026430130 -4.943069458 +v 29.138191223 15.381684303 -4.729002476 +v 29.138191223 15.242951393 -4.729002476 +v 28.639835358 13.952214241 -3.643826246 +v 28.843130112 14.116405487 -3.946170568 +v 29.308036804 14.219081879 -4.141609192 +v 28.840187073 14.013489723 -2.260160208 +v 28.841386795 13.593063354 -2.947570324 +v 28.636323929 14.589397430 -1.631963611 +v 28.637676239 14.267008781 -2.406255484 +v 28.639068604 13.729486465 -3.204560280 +v 28.837913513 15.541136742 -0.957117617 +v 29.302547455 15.672581673 -0.997330248 +v 28.635015488 15.184299469 -0.882141113 +v 28.836151123 15.609466553 0.052426800 +v 29.300714493 15.740912437 0.053353190 +v 28.633384705 15.245204926 0.052069638 +v 28.634868622 14.785190582 -0.797887027 +v 28.838882446 14.319040298 -1.512581468 +v 28.837530136 14.504487991 -0.738275290 +v 28.633384705 14.858480453 0.052066229 +v 28.836151123 14.566658020 0.052417602 +v 28.639068604 9.998180389 -3.204016447 +v 28.841384888 9.998180389 -2.947570324 +v 28.830911636 9.998180389 3.052421331 +v 29.116922379 10.109930038 -4.061254501 +v 29.118087769 10.109925270 -4.728369236 +v 29.118087769 9.998066902 -4.728369236 +v 28.843128204 9.998180389 -3.945131063 +v 29.308036804 10.354040146 -4.141703129 +v 29.116922379 9.998066902 -4.061254501 +v 29.309436798 10.354034424 -4.943069458 +v 28.639841080 9.998180389 -3.646778345 +v 29.298891068 15.672581673 1.097742677 +v 28.834398270 15.541136742 1.055923820 +v 28.631757736 15.202935219 0.984243691 +v 29.297094345 15.435887337 2.127355576 +v 28.832672119 15.304441452 2.045222759 +v 28.630126953 15.017164230 1.918454051 +v 28.631908417 14.795264244 0.898266375 +v 28.834779739 14.504487991 0.837295890 +v 28.630455017 14.590009689 1.730486751 +v 28.833427429 14.319040298 1.611602187 +v 28.629058838 14.277847290 2.530798197 +v 28.831195831 14.941862106 2.890551567 +v 28.628692627 14.678530693 2.739474773 +v 29.295558929 15.073307991 3.007130861 +v 28.832122803 14.013489723 2.359180450 +v 28.627624512 13.749271393 3.351529121 +v 28.626873016 13.975434303 3.781867743 +v 29.293388367 14.220697403 4.250654221 +v 28.829160690 14.118021011 4.056437016 +v 29.291988373 15.028306961 5.051695347 +v 29.121498108 15.383560181 4.835417271 +v 29.121498108 15.244828224 4.835417271 +v 28.627624512 9.998180389 3.351893425 +v 28.830913544 13.593063354 3.052421331 +v 28.626873016 9.998180389 3.781398773 +v 28.829162598 9.998180389 4.055243969 +v 29.291988373 10.354028702 5.051671505 +v 29.293388367 10.354027748 4.250892162 +v 29.101392746 9.998066902 4.835268974 +v 29.102554321 9.998066902 4.170360088 +v 29.101392746 10.109920502 4.835268974 +v 29.102554321 10.109919548 4.170360088 +v 10.544443130 15.381685257 -4.761458397 +v 10.544443130 15.242953300 -4.761458397 +v 10.373948097 15.026432037 -4.976121902 +v 10.373948097 10.354028702 -4.976121902 +v 11.038537025 9.998181343 -3.275253773 +v 10.836583138 9.998181343 -3.976563454 +v 10.564364433 10.109919548 -4.760755062 +v 11.039286613 9.998181343 -3.704759359 +v 10.834840775 9.998181343 -2.979003191 +v 10.564364433 9.998067856 -4.760755062 +v 10.824367523 9.998181343 3.020988703 +v 10.822616577 9.998181343 4.023811817 +v 10.356501579 10.354034424 5.018618584 +v 10.547670364 9.998067856 4.802883148 +v 11.026322365 9.998181343 3.723418236 +v 11.027094841 9.998181343 3.280656099 +v 10.547670364 10.109925270 4.802883148 +v 10.527830124 15.381774902 4.802964687 +v 10.356585503 15.026519775 5.018982410 +v 10.527830124 15.243041992 4.802964687 +v 10.372631073 14.220699310 -4.174578667 +v 10.370459557 15.073310852 -2.930491924 +v 10.834573746 14.941128731 -2.824866056 +v 10.836585999 14.116407394 -3.977602959 +v 11.037467957 14.678532600 -2.662835360 +v 11.039287567 13.975436211 -3.705228567 +v 11.037103653 14.277850151 -2.454159260 +v 11.038536072 13.749273300 -3.274889231 +v 11.036034584 15.017166138 -1.841814637 +v 10.833095551 15.304443359 -1.977849364 +v 10.368923187 15.435888290 -2.050716639 +v 9.840255737 14.013492584 -2.293326378 +v 10.833642960 14.013491631 -2.291592836 +v 10.832337379 14.319043159 -1.544014096 +v 11.035706520 14.590011597 -1.653847337 +v 11.034403801 15.202938080 -0.907604218 +v 10.831368446 15.541138649 -0.988549888 +v 10.367126465 15.672584534 -1.021103144 +v 11.032777786 15.245207787 0.024569876 +v 10.830013275 15.609468460 0.024212779 +v 10.365303040 15.740915298 0.023286272 +v 11.034254074 14.795266151 -0.821626842 +v 9.838950157 14.319043159 -1.545748115 +v 10.830985069 14.504489899 -0.769707739 +v 9.837597847 14.504489899 -0.771441817 +v 9.836218834 14.566660881 0.019251090 +v 10.829605103 14.566659927 0.020985158 +v 11.032777786 14.858482361 0.024573289 +v 10.834841728 13.593065262 -2.979002953 +v 9.841454506 9.998181343 -2.980736971 +v 9.841455460 13.593065262 -2.980736732 +v 10.372630119 10.354027748 -4.174252510 +v 10.563604355 9.998067856 -4.093901634 +v 10.563604355 10.109919548 -4.093901634 +v 11.031147003 15.184301376 0.958780825 +v 10.827854156 15.541138649 1.024491310 +v 10.363469124 15.672584534 1.073969722 +v 10.361672401 15.435888290 2.103582621 +v 11.029538155 14.979497910 1.880349159 +v 10.826127052 15.304443359 2.013790369 +v 10.828235626 14.504489899 0.805863440 +v 9.834848404 14.504489899 0.804129362 +v 11.031293869 14.785192490 0.874526620 +v 10.826883316 14.319043159 1.580169678 +v 9.833496094 14.319043159 1.578435779 +v 10.825578690 14.013491631 2.327747822 +v 11.029838562 14.589399338 1.708603024 +v 11.028089523 14.662883759 2.710471869 +v 10.824651718 14.941864014 2.859119177 +v 10.360135078 15.072574615 2.985115051 +v 11.028487206 14.267010689 2.482894659 +v 11.026327133 13.952216148 3.720466137 +v 9.832191467 14.013492584 2.326014042 +v 11.027093887 13.729488373 3.281200171 +v 10.824368477 13.593065262 3.020988941 +v 10.822615623 14.118022919 4.025004864 +v 10.357982635 14.219083786 4.218248844 +v 9.830981255 9.998181343 3.019254923 +v 10.357981682 10.354040146 4.217919350 +v 9.830982208 13.593065262 3.019254923 +v 10.549234390 9.998067856 4.138958454 +v 10.549234390 10.109930038 4.138958454 +v 5.309868813 16.884586334 -4.066629410 +v 5.965365887 16.423784256 -4.917809963 +v 7.409113407 16.423784256 -4.080895424 +v 4.787422657 16.423784256 -6.099878311 +v 5.892444134 15.376764297 -6.944730759 +v 6.814069748 15.376764297 -6.019875526 +v 3.933958769 16.884586334 -5.447355747 +v 3.955558538 16.423784256 -7.546542645 +v 5.241590500 15.376764297 -8.076605797 +v 9.319129944 16.422849655 -3.599782944 +v 9.020275116 16.423784256 -3.646166325 +v 9.321538925 15.374711037 -4.979783535 +v 7.943663597 15.376764297 -5.365069389 +v 6.996253967 16.884586334 -3.089062452 +v 8.878190041 16.884586334 -2.581273079 +v 9.317251205 16.884586334 -2.523308992 +v 2.935139656 17.185401917 -4.683700562 +v 1.799856663 17.185401917 -6.658026218 +v 1.921602488 17.272243500 -3.908794165 +v 4.542731285 17.185401917 -3.070481777 +v 2.962290764 16.884586334 -7.137146473 +v 3.472298384 16.423784256 -9.458216667 +v 3.526463032 16.423784256 -9.159214973 +v 2.461080551 16.884586334 -9.020846367 +v 4.863285065 15.376764297 -9.455788612 +v 2.397970200 16.884586334 -9.460092545 +v 1.214250684 17.185401917 -8.858910561 +v -0.135156274 17.272243500 -9.464513779 +v -0.050951496 17.272243500 -8.694589615 +v -1.322819948 17.185401917 -8.529404640 +v 1.140670061 17.185401917 -9.462286949 +v -1.417704940 17.185401917 -9.466752052 +v 0.620294213 17.272243500 -6.171846390 +v -1.727916718 16.884586334 -5.203984261 +v -0.565482378 17.185401917 -5.683104515 +v 0.902725697 17.185401917 -3.129805088 +v -2.569650412 16.884586334 -8.367468834 +v -2.675005198 16.884586334 -9.468947411 +v -3.751479387 16.422849655 -9.470826149 +v -5.005669594 15.374711037 -8.051085472 +v -5.131479740 15.374711037 -9.473235130 +v -3.637160063 16.422849655 -8.228823662 +v -2.723167658 16.422849655 -4.793770790 +v -0.096093923 16.884586334 -2.366149664 +v -3.999043703 15.374711037 -4.267893314 +v 3.764290810 17.272243500 -2.059657097 +v 2.981748581 17.185401917 -1.043506265 +v 6.513077736 17.185401917 -1.928307772 +v 6.022782326 17.272243500 -0.750450432 +v 5.529903412 17.185401917 0.433612496 +v 8.711903572 17.185401917 -1.335014701 +v 9.315055847 17.185401917 -1.266008496 +v 8.543165207 17.272243500 -0.070394248 +v 9.312817574 17.272243500 0.016540131 +v 0.715803146 15.374711037 1.898883700 +v 1.557805777 16.422849655 0.805522621 +v 4.633044720 16.422849655 2.588180780 +v 4.102715492 15.374711037 3.862213135 +v 5.046727657 16.884586334 1.594367266 +v 2.214611053 16.884586334 -0.047358394 +v 9.310590744 17.185401917 1.292366385 +v 9.308396339 16.884586334 2.549666405 +v 8.207252502 16.884586334 2.447146654 +v 8.373538017 17.185401917 1.200888276 +v 9.306520462 16.423784256 3.623995066 +v 8.064883232 16.422849655 3.514165878 +v 7.882367134 15.374711037 4.882045746 +v 9.304092407 15.376764297 5.014981270 +v -2.047555685 15.374711037 -0.874144256 +v -0.951261282 16.422849655 -1.712323785 +v 5.892444134 15.028306961 -6.944730759 +v 5.671233654 15.244828224 -6.775876999 +v 4.984215736 15.244828224 -7.970758915 +v 6.644100189 15.383560181 -5.799521923 +v 5.671233654 15.383560181 -6.775876999 +v 6.644100189 15.244828224 -5.799521923 +v 6.814069748 15.028306961 -6.019875526 +v 8.853220940 14.941126823 -2.830147266 +v 8.651939392 13.952214241 -3.680540323 +v 8.650176048 14.662881851 -2.670546055 +v 9.317987442 15.072572708 -2.945189476 +v 8.855233192 14.116405487 -3.982884407 +v 9.320139885 14.219081879 -4.178322792 +v 7.836515903 15.383560181 -5.108233452 +v 7.836515903 15.244828224 -5.108233452 +v 7.943663597 15.028306961 -5.365069389 +v 9.321538925 15.026430130 -4.979783535 +v 9.150295258 15.242951393 -4.765716553 +v 9.150295258 15.381684303 -4.765716553 +v 7.943655014 10.354028702 -5.365047932 +v 6.814056873 10.354028702 -6.019856930 +v 5.892426014 10.354028702 -6.944716454 +v 5.241590500 15.028306961 -8.076605797 +v 5.671510220 10.109920502 -6.777579784 +v 5.241569042 10.354028702 -8.076597214 +v 5.671510220 9.998180389 -6.777579784 +v 6.643928051 9.998180389 -5.801239014 +v 6.643928051 10.109920502 -5.801239014 +v 9.321538925 10.354034424 -4.979783535 +v 9.320139885 10.354040146 -4.178416729 +v 8.651944160 9.998180389 -3.683492422 +v 7.835906506 9.998180389 -5.109846592 +v 7.835906506 10.109920502 -5.109846592 +v 9.130189896 10.109925270 -4.765082836 +v 9.129025459 10.109930038 -4.097968102 +v 9.130189896 9.998180389 -4.765082836 +v 9.129025459 9.998180389 -4.097968102 +v 8.855231285 9.998180389 -3.981844902 +v 8.651171684 9.998180389 -3.240730286 +v 8.651172638 13.729486465 -3.241274357 +v 8.853487968 9.998180389 -2.984283924 +v 8.853489876 13.593063354 -2.984283924 +v 8.649779320 14.267008781 -2.442969084 +v 4.647006512 15.383560181 -9.285297394 +v 4.984215736 15.383560181 -7.970758915 +v 4.647006512 15.244828224 -9.285297394 +v 4.863285065 15.028306961 -9.455788612 +v 2.818720818 15.073307991 -9.459357262 +v 1.730043888 15.017164230 -8.793926239 +v 2.702141523 14.941862106 -8.994995117 +v 1.856812716 15.304441452 -8.996471405 +v 1.542076707 14.590009689 -8.794254303 +v 2.551064491 14.678530693 -8.792492867 +v 1.938945532 15.435887337 -9.460893631 +v 4.062243938 14.220697403 -9.457186699 +v 2.865756989 13.593063354 -9.994748116 +v 2.864011288 13.593063354 -8.994712830 +v 2.170770407 14.013489723 -8.995923042 +v 2.342388153 14.277847290 -8.792857170 +v 3.593457460 13.975434303 -8.790673256 +v 3.163118601 13.749271393 -8.791424751 +v 3.868026495 14.118021011 -8.992959976 +v 4.863260746 10.354028702 -9.455788612 +v 4.984924793 9.998180389 -7.972333431 +v 3.866833925 9.998180389 -8.992960930 +v 3.592988729 9.998180389 -8.790673256 +v 3.981950045 10.109919548 -9.266352654 +v 4.062481880 10.354027748 -9.457186699 +v 3.981950045 9.998180389 -9.266352654 +v 4.646858215 10.109920502 -9.265192032 +v 4.646858215 9.998180389 -9.265192032 +v 4.984924793 10.109920502 -7.972333431 +v 3.163483381 9.998180389 -8.791422844 +v 2.864011049 9.998180389 -8.994710922 +v 2.865756750 9.998180389 -9.994747162 +v 0.909332395 15.672581673 -9.462690353 +v 0.867513537 15.541136742 -8.998197556 +v 0.795833468 15.202935219 -8.795557022 +v 2.172516346 14.013488770 -9.995958328 +v 1.423191905 14.319040298 -8.997227669 +v 1.424937487 14.319040298 -9.997262955 +v 0.709856033 14.795264244 -8.795706749 +v 0.648885727 14.504487991 -8.998579025 +v 0.650631309 14.504487991 -9.998614311 +v -1.905951262 9.998180389 -0.982230663 +v -3.834289074 9.998181343 -4.335646629 +v -1.905951262 10.109925270 -0.982230663 +v -3.834289312 10.109925270 -4.335646629 +v -2.047555685 10.354034424 -0.874144256 +v -2.047555685 15.026430130 -0.874144256 +v -3.999043703 10.354034424 -4.267893314 +v -0.135983437 15.609466553 -8.999949455 +v -0.136340588 15.245204926 -8.797183990 +v -0.135057062 15.740912437 -9.464513779 +v -0.135992631 14.566658020 -8.999949455 +v -0.134247005 14.566658020 -9.999984741 +v -0.136344001 14.858480453 -8.797183990 +v -1.185740471 15.672581673 -9.466347694 +v -2.215353489 15.435887337 -9.468144417 +v -0.926685452 14.504487991 -9.001329422 +v -0.986297250 14.785190582 -8.798667908 +v -0.924939871 14.504487991 -10.001364708 +v -1.070551395 15.184299469 -8.798814774 +v -1.145527720 15.541136742 -9.001711845 +v -2.134827137 15.304441452 -9.003438950 +v -1.992120028 14.979496956 -8.800423622 +v -1.820373774 14.589397430 -8.800123215 +v -1.700991750 14.319040298 -9.002680779 +v -1.699246168 14.319040298 -10.002716064 +v -3.096885920 15.072572708 -9.469683647 +v -2.981843472 14.941126823 -9.004917145 +v -2.822242498 14.662881851 -8.801872253 +v -2.448570251 14.013489723 -9.003986359 +v -2.594665527 14.267008781 -8.801475525 +v -2.446824312 14.013488770 -10.004021645 +v -4.828895092 15.242951393 -8.073754311 +v -4.828895092 15.381684303 -8.073754311 +v -3.834159613 15.381684303 -4.335542679 +v -5.005669594 15.026430130 -8.051085472 +v -3.834159613 15.242951393 -4.335542679 +v -3.999043703 15.026430130 -4.267893314 +v -3.135980606 13.593063354 -9.005186081 +v -3.832236767 13.952214241 -8.803635597 +v -4.134581089 14.116405487 -9.006929398 +v -3.392970800 13.729486465 -8.802868843 +v -4.330019474 14.219081879 -9.471836090 +v -5.131479740 15.026430130 -9.473235130 +v -4.917412758 15.381684303 -9.301991463 +v -4.917412758 15.242951393 -9.301991463 +v -1.905799270 15.242951393 -0.982163668 +v -1.905799270 15.381684303 -0.982163668 +v -3.134235144 9.998181343 -10.005220413 +v -3.135980844 9.998181343 -9.005184174 +v -3.392427206 9.998181343 -8.802867889 +v -4.828992844 9.998181343 -8.073887825 +v -4.828992844 10.109925270 -8.073887825 +v -5.005669594 10.354034424 -8.051085472 +v -4.133541584 9.998181343 -9.006927490 +v -3.835189104 9.998181343 -8.803640366 +v -4.916779518 10.109925270 -9.281886101 +v -5.131479740 10.354034424 -9.473235130 +v -4.916779518 9.998181343 -9.281886101 +v -3.134234905 13.593063354 -10.005221367 +v -4.330113411 10.354040146 -9.471836090 +v -4.249664783 9.998181343 -9.280721664 +v -4.249664783 10.109930038 -9.280721664 +v 9.316448212 15.435887337 -2.063657284 +v 8.851742744 15.304441452 -1.983130693 +v 8.648727417 14.979496956 -1.840423584 +v 8.850015640 15.541136742 -0.993831396 +v 9.314651489 15.672581673 -1.034044147 +v 8.647118568 15.184299469 -0.918855011 +v 8.852290154 14.013489723 -2.296873808 +v 8.648427010 14.589397430 -1.668677330 +v 8.850984573 14.319040298 -1.549295425 +v 8.646971703 14.785190582 -0.834600866 +v 8.849633217 14.504487991 -0.774989128 +v 8.848253250 15.609466553 0.015712952 +v 8.645487785 15.245204926 0.015355791 +v 9.312817574 15.740912437 0.016639344 +v 9.310994148 15.672581673 1.061028719 +v 8.846501350 15.541136742 1.019209862 +v 8.643860817 15.202935219 0.947529793 +v 8.848253250 14.566658020 0.015703756 +v 8.645487785 14.858480453 0.015352380 +v 8.644010544 14.795264244 0.861552477 +v 8.846882820 14.504487991 0.800582051 +v 8.639726639 9.998180389 3.315179348 +v 8.843014717 9.998180389 3.015707970 +v 4.171304703 9.998180389 3.697805405 +v 8.638977051 9.998180389 3.744684696 +v 9.309197426 15.435887337 2.090641737 +v 8.844775200 15.304441452 2.008509159 +v 8.642230034 15.017164230 1.881740332 +v 9.307661057 15.073307991 2.970417023 +v 8.843298912 14.941862106 2.853837729 +v 8.640796661 14.678530693 2.702761173 +v 8.642558098 14.590009689 1.693773031 +v 8.845531464 14.319040298 1.574888349 +v 8.641160965 14.277847290 2.494084597 +v 8.844226837 14.013489723 2.322466850 +v 8.639728546 13.749271393 3.314815044 +v 8.843016624 13.593063354 3.015707731 +v 9.305490494 14.220697403 4.213940144 +v 8.841263771 14.118021011 4.019722939 +v 8.638977051 13.975434303 3.745153666 +v 9.304092407 15.028306961 5.014981270 +v 9.133601189 15.244828224 4.798703671 +v 9.133601189 15.383560181 4.798703671 +v 7.906223297 15.381684303 4.705427647 +v 7.906223297 15.242951393 4.705427647 +v 7.882367134 15.026430130 4.882045746 +v 7.882367134 10.354034424 4.882045746 +v 9.113495827 10.109920502 4.798554897 +v 9.114656448 10.109919548 4.133646488 +v 9.114656448 9.998180389 4.133646488 +v 9.113495827 9.998180389 4.798554897 +v 9.304092407 10.354028702 5.014957428 +v 9.305490494 10.354027748 4.214178562 +v 8.841264725 9.998180389 4.018530369 +v 7.906068802 9.998180389 4.705486774 +v 7.906068802 10.109925270 4.705486774 +v 4.102715492 15.026430130 3.862213135 +v 4.171470165 15.242951393 3.697786808 +v 4.171470165 15.381684303 3.697786808 +v 4.102715492 10.354034424 3.862213135 +v 4.171304703 10.109925270 3.697804928 +v 0.824607968 9.998180389 1.757830381 +v 0.824607849 10.109925270 1.757830381 +v 0.715803146 10.354034424 1.898883700 +v 0.824772000 15.381684303 1.757855892 +v 0.715803146 15.026430130 1.898883700 +v 0.824772000 15.242951393 1.757855892 +v -8.753063202 5.376532555 4.954570293 +v 0.230767518 6.425604343 3.563241482 +v 0.230767518 5.378584385 4.954230309 +v -8.753147125 6.425606728 3.563240767 +v 0.230766773 6.886405945 2.488911390 +v -8.753147125 6.886408329 2.488910437 +v 0.230766773 7.187221527 1.231609106 +v -8.753147125 7.187223434 1.231608272 +v 0.230766773 7.274062157 -0.044219129 +v -8.753147125 7.274064541 -0.044219974 +v 0.230766773 7.187221527 -1.326769710 +v -8.753147125 7.187223434 -1.326770663 +v 0.230766773 6.886405945 -2.584072113 +v -8.753147125 6.886408329 -2.584073305 +v 0.230766773 6.424669266 -3.660547972 +v -8.753147125 6.424670696 -3.660548687 +v 0.230766773 5.376530647 -5.040550232 +v -8.753147125 5.383505344 -5.040158749 +v -8.085589409 4.268830299 2.417313814 +v -8.299681664 3.594884872 3.000001907 +v -8.299681664 4.015311241 2.306759596 +v -8.292544365 4.320862770 1.559179902 +v -9.000000000 4.015311241 2.306759596 +v -8.085588455 3.731307507 3.215620279 +v -9.000000000 3.594884872 3.000001907 +v -8.085589409 4.664703846 2.644890785 +v -8.085588455 3.954035997 3.654886723 +v -8.753063202 5.028339386 4.954570293 +v -8.582195282 5.383594036 4.738254070 +v -8.598057747 5.244861126 4.782492161 +v -8.753063202 4.220902920 4.153835297 +v -9.000000000 7.255914688 2.405723095 +v -9.000000000 7.254602909 3.184659481 +v -9.500000000 7.254602909 3.184647322 +v -9.500000000 7.255914688 2.405723095 +v -9.500000000 3.594884872 3.000001907 +v -8.753063202 5.074394226 2.920700073 +v -9.500000000 7.256734848 1.625433087 +v -9.000000000 7.256734848 1.625224113 +v -9.000000000 4.320862770 1.559179902 +v -8.753064156 5.437708378 2.039165974 +v -9.500000000 4.015311241 2.306759596 +v -8.085589409 4.591218948 1.643020630 +v -8.085589409 4.981317997 1.814767003 +v -8.292540550 4.943684101 2.793893814 +v -8.292540550 5.306262970 1.948563099 +v -9.999998093 4.320862770 1.559180021 +v -9.500000000 4.320862770 1.559179902 +v -9.000000000 7.257231712 0.773615956 +v -9.500000000 7.257231712 0.773804307 +v -9.000000000 7.257397652 -0.044181678 +v -9.500000000 7.257397652 -0.044181675 +v -8.753064156 5.674404144 1.009551167 +v -9.000000000 4.568480015 -0.044245362 +v -8.753064156 5.742734909 -0.041133784 +v -8.292540550 5.542958260 0.959262550 +v -8.292540550 5.611288548 -0.041018460 +v -9.500000000 4.506309509 0.740634203 +v -8.085589409 5.186120987 0.893197119 +v -8.085589409 4.787011623 0.808942795 +v -8.292540550 4.506309509 0.740634203 +v -8.085589409 5.247027397 -0.041015293 +v -8.085589409 4.860301971 -0.041011877 +v -8.292540550 4.568480015 -0.044245362 +v -9.000000000 4.506309509 0.740634203 +v -9.500000000 4.568480015 -0.044245347 +v -9.999997139 4.568480492 -0.000007104 +v -9.999997139 4.506309986 0.784872413 +v 0.230767518 5.030126095 4.954230309 +v 0.044036582 5.246647835 4.782487869 +v 0.059897333 5.385379791 4.738249779 +v -8.753147125 0.355853915 4.954206467 +v -8.085588455 0.000001048 3.657839060 +v -8.292540550 0.000001429 3.958587885 +v 0.039793111 -0.000113393 4.738136292 +v -8.085588455 0.000001048 3.215075970 +v -8.299681664 0.000001429 3.003443718 +v -8.562355995 -0.000112630 4.738137245 +v -8.562355995 0.111745358 4.738137245 +v 0.039793111 0.111739635 4.738136292 +v -8.292540550 4.119843006 3.959781170 +v -8.753064156 0.355859280 4.153505802 +v -9.000000000 0.000001429 3.003443718 +v -9.500000000 -0.002705861 3.183461428 +v -9.000000000 -0.002705861 3.183461428 +v -9.500000000 0.000001429 3.003443718 +v -9.999998093 4.015311718 2.306759834 +v -9.999997139 3.594885111 3.000001431 +v -9.999998093 0.000001292 3.000001431 +v -8.561950684 -0.000112630 4.074211597 +v -8.561950684 0.111749932 4.074211597 +v -9.000000000 0.000001429 -3.000231981 +v -9.999998093 0.000001292 -2.999999762 +v -9.500000000 0.000001429 -3.000231981 +v -8.299681664 0.000001429 -3.000231981 +v -8.562355042 -0.000112630 -4.825516224 +v 0.039793123 -0.000113393 -4.825516224 +v 0.039793123 0.111745358 -4.825516224 +v 0.230766773 0.355853915 -5.040550232 +v 0.230766773 5.028249741 -5.040550232 +v 0.230767518 0.355848223 4.954206467 +v -8.562355042 0.111739255 -4.825516224 +v 0.059897345 5.383503914 -4.826185226 +v 0.059897345 5.244771004 -4.826185226 +v -8.582277298 5.383505344 -4.826184273 +v -8.582277298 5.244772911 -4.826184273 +v -8.753147125 5.028251648 -5.040549755 +v -8.292540550 0.000001429 -4.041800499 +v -8.085590363 0.000001048 -3.770350456 +v -8.085590363 0.000001048 -3.340844154 +v -8.753147125 0.355848223 -5.040549755 +v -9.000000000 7.255914688 -2.456159115 +v -9.000000000 7.256734371 -1.676682115 +v -9.500000000 7.256734371 -1.676682115 +v -9.500000000 7.255914688 -2.456159115 +v -9.500000000 7.254604816 -3.248138905 +v -9.000000000 7.254604816 -3.248138905 +v -8.753064156 5.674404144 -1.085524917 +v -8.292540550 5.542958260 -1.053782225 +v -8.753064156 5.437708378 -2.115139723 +v -9.000000000 7.257230759 -0.869287789 +v -9.500000000 7.257230759 -0.869287610 +v -9.000000000 4.506309509 -0.834939539 +v -9.000000000 4.320862770 -1.609247208 +v -9.500000000 4.506309509 -0.834939539 +v -9.500000000 4.320862770 -1.609247208 +v -8.299681664 4.506309509 -0.834939539 +v -8.085590363 4.591831207 -1.719435334 +v -8.085590363 4.797085762 -0.887213409 +v -8.292540550 4.320862770 -1.609247208 +v -8.292540550 5.306262970 -2.043083191 +v -8.085590363 5.018985748 -1.907402754 +v -8.085590363 5.204757690 -0.973190904 +v -9.999998093 4.506309986 -0.790701210 +v -9.999997139 4.320862770 -1.565008759 +v -9.500000000 4.015311241 -2.356827021 +v -9.500000000 3.594884872 -3.000231743 +v -9.999997139 4.015311718 -2.312588453 +v -9.000000000 3.594884872 -3.000231743 +v -9.000000000 4.015311241 -2.356827021 +v -8.753064156 5.075129986 -2.994916439 +v -8.292544365 4.942948341 -2.845862865 +v -8.085590363 4.680352211 -2.728424549 +v -8.085590363 4.279669762 -2.519748211 +v -8.292540550 4.015311241 -2.356827021 +v -8.753064156 4.222518921 -4.239005566 +v -8.299681664 3.594884872 -3.000231743 +v -8.085590363 3.751092434 -3.340479851 +v -8.085590363 3.977255583 -3.770819902 +v -9.500000000 0.000001429 -3.252239466 +v -9.999997139 3.594885111 -2.999999762 +v -9.000000000 0.000001429 -3.252239466 +v -8.292544365 4.118226528 -3.998601675 +v -8.753064156 0.355847448 -4.238679409 +v -8.561952591 0.111738876 -4.158661842 +v -8.561952591 -0.000113012 -4.158661842 +v 11.438048363 13.578246117 -18.801122665 +v 11.792361259 13.578246117 -19.005466461 +v 12.150432587 13.368027687 -18.578733444 +v 12.462369919 13.078775406 -18.214624405 +v 11.797165871 13.078775406 -17.828817368 +v 11.628574371 13.368027687 -18.277658463 +v 12.537845612 13.368027687 -19.040140152 +v 12.955503464 13.078775406 -18.804676056 +v 11.035212517 13.578246117 -18.730283737 +v 11.040124893 13.705832481 -19.307260513 +v 11.035212517 13.368027687 -18.173225403 +v 11.040124893 13.078775406 -17.693790436 +v 11.245326996 13.705832481 -19.344982147 +v 13.217087746 13.078775406 -19.527807236 +v 12.744085312 13.368027687 -19.606222153 +v 12.744275093 13.368027687 -20.208702087 +v 12.195487976 13.578246117 -19.702953339 +v 13.215572357 13.078775406 -20.296792984 +v 12.055417061 13.578246117 -19.318668365 +v 11.558197975 13.705832481 -19.611412048 +v 12.195678711 13.578246117 -20.111970901 +v 11.628130913 13.705832481 -19.807983398 +v 11.425251007 13.705832481 -19.450613022 +v 11.042902946 13.748605728 -19.906599045 +v 11.626614571 13.705832481 -20.016616821 +v 12.055965424 13.578246117 -20.496385574 +v 12.538393021 13.368027687 -20.774915695 +v 12.951137543 13.078775406 -21.018886566 +v 12.151271820 13.368027687 -21.236564636 +v 11.793200493 13.578246117 -20.809831619 +v 12.455681801 13.078775406 -21.606990814 +v 11.629601479 13.368027687 -21.537969589 +v 11.788961411 13.078775406 -21.990169525 +v 11.439075470 13.578246117 -21.014505386 +v 11.418563843 13.705832481 -20.371000290 +v 11.032533646 13.578246117 -21.085718155 +v 11.237122536 13.705832481 -20.474004745 +v 11.032533646 13.368027687 -21.642776489 +v 11.031394005 13.078775406 -22.122211456 +v 11.553833008 13.705832481 -20.212152481 +v 11.027621269 13.705832481 -20.508741379 +v 10.765499115 13.325869560 -17.371828079 +v 10.589583397 13.486545563 -17.125236511 +v 10.589580536 14.006744385 -17.938571930 +v 10.765499115 13.814806938 -18.067226410 +v 10.912987709 13.542448044 -18.201259613 +v 10.912987709 13.172634125 -17.547973633 +v 10.765499115 14.032635689 -18.638780594 +v 10.912987709 13.764249802 -18.741415024 +v 10.403736115 13.592807770 -16.911849976 +v 10.403735161 14.096672058 -17.795053482 +v 9.857499123 14.013492584 -17.601242065 +v 9.857499123 14.319044113 -18.348821640 +v 9.857499123 13.593065262 -16.907999039 +v 10.403735161 14.346630096 -18.426431656 +v 10.589580536 14.256196976 -18.528282166 +v 10.765499115 14.173540115 -19.273298264 +v 10.912987709 13.898954391 -19.323276520 +v 10.589580536 14.419042587 -19.218427658 +v 10.403735161 14.509475708 -19.163867950 +v 9.857499123 14.504489899 -19.123128891 +v 10.589580536 14.466053009 -19.916234970 +v 10.776260376 14.215442657 -19.916215897 +v 10.912987709 13.949377060 -19.916213989 +v 9.857499123 14.566660881 -19.908008575 +v 10.403735161 14.556488037 -19.916397095 +v 12.951138496 9.993399620 -21.018886566 +v 12.955503464 9.993399620 -18.804676056 +v 13.217088699 9.993399620 -19.527805328 +v 12.462368965 9.993399620 -18.214622498 +v 11.797164917 9.993399620 -17.828817368 +v 12.455682755 9.993399620 -21.606988907 +v 11.788962364 9.993399620 -21.990169525 +v 11.040123940 9.993399620 -17.693790436 +v 13.215572357 9.993399620 -20.296792984 +v 10.912989616 9.993399620 -17.548355103 +v 10.765501022 9.993399620 -17.369794846 +v 10.589581490 9.993399620 -17.126068115 +v 9.857499123 9.998181343 -16.907999039 +v 10.403736115 9.994852066 -16.912084579 +v 10.765499115 14.186361313 -20.558336258 +v 10.912986755 13.905885696 -20.506532669 +v 10.589581490 14.419042587 -20.622749329 +v 9.857499123 14.504489899 -20.698701859 +v 10.403736115 14.509475708 -20.664417267 +v 10.765499115 14.058550835 -21.201557159 +v 10.912986755 13.764671326 -21.087100983 +v 10.589581490 14.256196976 -21.312894821 +v 9.857499123 14.319044113 -21.473009109 +v 10.403736115 14.346630096 -21.401855469 +v 10.912986755 13.549904823 -21.645406723 +v 10.912986755 13.186244965 -22.217958450 +v 10.765499115 13.825572968 -21.766845703 +v 10.765499115 13.341844559 -22.484550476 +v 10.589578629 14.006237984 -21.872920990 +v 10.589580536 13.485433578 -22.677083969 +v 9.857499123 14.013492584 -22.220588684 +v 10.403736115 14.097177505 -22.031974792 +v 10.403737068 13.593919754 -22.905027390 +v 9.857499123 13.593065262 -22.908000946 +v 10.765499115 9.993399620 -22.484228134 +v 10.912987709 9.993399620 -22.218212128 +v 11.031394958 9.993399620 -22.122211456 +v 9.857499123 9.998181343 -22.908000946 +v 10.589583397 9.993399620 -22.707220078 +v 10.403737068 9.994852066 -22.904792786 +v 4.858413219 15.381685257 -14.934789658 +v 9.327021599 16.423784256 -16.325420380 +v 9.327021599 15.376764297 -14.934431076 +v 3.478802681 16.422851563 -16.327211380 +v 9.327021599 16.884586334 -17.399749756 +v 2.402328014 16.884588242 -17.392444611 +v 9.327021599 17.185401917 -18.657051086 +v 1.145025015 17.185403824 -18.650850296 +v 9.327021599 17.272243500 -19.932880402 +v 4.858804226 15.374711037 -10.468370438 +v -0.137525633 17.272245407 -19.933252335 +v 1.145023227 17.185401917 -10.468370438 +v -0.137527332 17.272243500 -10.468370438 +v 2.402325630 16.884586334 -10.468370438 +v 3.478801250 16.422849655 -10.468370438 +v -0.137525663 17.272245407 -29.403888702 +v 1.138338208 17.185403824 -21.214948654 +v 9.327021599 17.185401917 -21.215431213 +v 9.327021599 16.884586334 -22.472732544 +v 2.395640373 16.884588242 -22.473354340 +v 9.327021599 16.422849655 -23.549209595 +v 3.469970226 16.423786163 -23.538587570 +v 9.327021599 15.374711037 -24.929210663 +v 3.478802681 16.422851563 -29.403888702 +v 4.860601902 15.381685257 -24.928821564 +v 2.402328014 16.884588242 -29.403888702 +v 1.145024896 17.185403824 -29.403888702 +v 4.858413219 15.381685257 -29.403888702 +v -5.136315823 15.374712944 -14.934705734 +v -3.744987965 16.423784256 -10.468370438 +v -5.135976791 15.376764297 -10.468370438 +v -3.744986534 16.423786163 -16.327211380 +v -2.670657635 16.884586334 -10.468370438 +v -2.670656204 16.884588242 -17.392444611 +v -1.413355708 17.185401917 -10.468370438 +v -1.413353801 17.185403824 -18.650850296 +v -9.608413696 15.374712944 -14.934091568 +v -9.608496666 17.185403824 -18.657052994 +v -9.608496666 17.272245407 -19.932880402 +v -9.608496666 16.884588242 -17.399749756 +v -9.608496666 16.423786163 -16.325420380 +v -1.420040607 17.185403824 -21.214948654 +v -1.413353801 17.185403824 -29.403888702 +v -2.670656204 16.884588242 -29.403888702 +v -2.677342892 16.884588242 -22.473354340 +v -3.744986534 16.423786163 -29.403888702 +v -3.743196487 16.423786163 -23.540378571 +v -5.136315823 15.374712944 -29.403804779 +v -9.608496666 16.422851563 -23.549209595 +v -5.133429050 15.381685257 -24.931009293 +v -9.608496666 16.884588242 -22.472734451 +v -9.608496666 17.185403824 -21.215431213 +v -9.608496666 15.381685257 -24.928819656 +v 9.327021599 15.028306961 -14.934431076 +v 9.156151772 15.383560181 -15.150411606 +v 9.156151772 15.244828224 -15.150411606 +v 8.862455368 14.118021011 -15.928879738 +v 8.659689903 14.678530693 -17.245491028 +v 8.659689903 13.975434303 -16.203096390 +v 9.327021599 14.220697403 -15.735473633 +v 8.862455368 14.941862106 -17.094766617 +v 9.327021599 15.073307991 -16.978998184 +v 4.644438744 15.242953300 -15.150722504 +v 4.644438744 15.381685257 -15.150722504 +v 4.858804226 15.026432037 -14.934789658 +v 4.858804226 10.354028702 -14.934789658 +v 4.643770218 10.109919548 -15.154069901 +v 9.136047363 10.109920502 -15.150524139 +v 9.136047363 9.998181343 -15.150524139 +v 4.643770218 9.998181343 -15.154069901 +v 9.327021599 10.354028702 -14.934454918 +v 3.860055447 9.998181343 -15.931425095 +v 8.862454414 9.998181343 -15.930072784 +v 8.659689903 13.749271393 -16.633434296 +v 8.659689903 9.998181343 -16.203563690 +v 8.862455368 13.593063354 -16.932897568 +v 8.659689903 9.998181343 -16.633069992 +v 8.862454414 9.998181343 -16.932897568 +v 9.327021599 10.354027748 -15.735235214 +v 9.136047363 10.109919548 -15.815433502 +v 9.136047363 9.998181343 -15.815433502 +v 3.558393955 13.952214241 -11.135701180 +v 2.708353996 14.941126823 -10.932935715 +v 3.861092567 14.116405487 -10.932935715 +v 4.057342529 14.219081879 -10.468370438 +v 2.824207306 15.072572708 -10.468370438 +v 4.858804226 15.026430130 -10.468370438 +v 4.644438744 15.381684303 -10.639239311 +v 4.644438744 15.242951393 -10.639239311 +v 4.643770218 10.109925270 -10.659343719 +v 4.858804226 10.354034424 -10.468370438 +v 4.643770218 9.998181343 -10.659343719 +v 3.860053062 9.998181343 -10.932935715 +v 3.118583202 9.998181343 -11.135701180 +v 3.119127274 13.729486465 -11.135701180 +v 2.862490654 9.998181343 -9.932899475 +v 2.862490654 13.593063354 -9.932898521 +v 2.862490654 13.593063354 -10.932935715 +v 2.862490654 9.998181343 -10.932937622 +v 4.057436466 10.354040146 -10.468370438 +v 3.561346054 9.998181343 -11.135701180 +v 3.976654530 10.109930038 -10.659343719 +v 3.976654530 9.998181343 -10.659343719 +v 1.942673564 15.435887337 -10.468370438 +v 2.548398018 14.662881851 -11.135701180 +v 1.861335874 15.304441452 -10.932935715 +v 2.175079346 14.013488770 -9.932898521 +v 2.175079823 14.013489723 -10.932935715 +v 2.320821285 14.267008781 -11.135701180 +v 0.913058519 15.672581673 -10.468370438 +v 0.872035027 15.541136742 -10.932935715 +v 1.718274593 14.979496956 -11.135701180 +v 0.796704412 15.184299469 -11.135701180 +v -0.137626544 15.740912437 -10.468370438 +v -0.137511060 15.609466553 -10.932935715 +v -0.137507826 15.245204926 -11.135701180 +v 1.427499771 14.319040298 -9.932898521 +v 0.653192222 14.504487991 -9.932898521 +v 1.427499771 14.319040298 -10.932935715 +v 1.546528220 14.589397430 -11.135701180 +v 0.712450206 14.785190582 -11.135701180 +v 0.653192282 14.504487991 -10.932935715 +v -0.137504414 14.858480453 -11.135701180 +v -0.137501866 14.566658020 -10.932935715 +v -0.137501940 14.566658020 -9.932898521 +v -3.137510300 9.998181343 -10.932937622 +v 3.159098625 9.998181343 -16.652217865 +v 2.862492561 9.998181343 -16.934700012 +v 3.588604927 9.998181343 -16.220819473 +v 8.659689903 15.017164230 -18.066513062 +v 8.862455368 15.304441452 -17.940097809 +v 9.327021599 15.435887337 -17.858776093 +v 8.659689903 14.277847290 -17.454166412 +v 8.862455368 14.013489723 -17.626138687 +v 8.862455368 14.319040298 -18.373718262 +v 8.659689903 14.590009689 -18.254480362 +v 8.862455368 15.541136742 -18.929397583 +v 9.327021599 15.672581673 -18.888389587 +v 8.659689903 15.202935219 -19.000724792 +v 8.659689903 14.858480453 -19.932903290 +v 8.659689903 15.245204926 -19.932899475 +v 8.862455368 15.609466553 -19.932895660 +v 9.327021599 15.740912437 -19.932781219 +v 8.862455368 14.504487991 -19.148025513 +v 8.659689903 14.795264244 -19.086702347 +v 8.862455368 14.566658020 -19.932905197 +v -3.135706425 9.998181343 -16.932899475 +v 2.862493038 9.998181343 -22.931098938 +v 8.862454414 9.998181343 -22.932899475 +v 8.659689903 15.184299469 -20.867111206 +v 8.862455368 15.541136742 -20.942441940 +v 9.327021599 15.672581673 -20.983467102 +v 8.659689903 14.979496956 -21.788682938 +v 8.862456322 15.304441452 -21.931743622 +v 8.659689903 14.662881851 -22.618804932 +v 9.327021599 15.435887337 -22.013080597 +v 8.862456322 14.941126823 -22.778760910 +v 8.659689903 14.785190582 -20.782857895 +v 8.862455368 14.504487991 -20.723600388 +v 8.862455368 14.319040298 -21.497907639 +v 8.659689903 14.589397430 -21.616935730 +v 8.862455368 14.013489723 -22.245487213 +v 8.659689903 14.267008781 -22.391227722 +v 9.327021599 15.072572708 -22.894615173 +v 8.862455368 14.116405487 -23.931501389 +v 8.659689903 13.729486465 -23.189535141 +v 8.862455368 13.593063354 -22.932899475 +v 8.659689903 13.952214241 -23.628801346 +v 9.136047363 10.109930038 -24.047061920 +v 9.136047363 9.998181343 -24.047061920 +v 8.862455368 9.998181343 -23.930461884 +v 9.327021599 10.354040146 -24.127843857 +v 3.574571609 9.998181343 -23.659011841 +v 3.143173695 9.998181343 -23.229505539 +v 8.659689903 9.998181343 -23.631753922 +v 3.865317822 9.998181343 -23.934371948 +v 3.588604927 9.998181343 -28.736331940 +v 3.159098625 9.998181343 -28.736331940 +v 8.659689903 9.998181343 -23.188991547 +v 2.862492561 9.998181343 -28.939510345 +v 9.327021599 14.219081879 -24.127750397 +v 9.327021599 15.026430130 -24.929210663 +v 9.156151772 15.381684303 -24.714845657 +v 9.156151772 15.242951393 -24.714845657 +v 9.327021599 10.354034424 -24.929210663 +v 4.860936642 10.354034424 -24.931011200 +v 4.644866943 10.109925270 -24.711727142 +v 4.644866943 9.998181343 -24.711727142 +v 9.136047363 9.998181343 -24.714178085 +v 9.136047363 10.109925270 -24.714178085 +v 4.861299992 15.026519775 -24.931093216 +v 4.644983768 15.381774902 -24.715158463 +v 4.644983768 15.243041992 -24.715158463 +v 4.644979954 15.383560181 -29.226558685 +v 4.644438744 15.242953300 -29.233018875 +v 4.858804226 15.026432037 -29.403888702 +v 4.057260036 14.220699310 -29.403806686 +v 2.708355427 14.941128731 -28.939508438 +v 3.861094475 14.116407394 -28.939508438 +v 2.813170910 15.073310852 -29.403806686 +v 2.546679020 14.678532600 -28.736331940 +v 3.589074135 13.975436211 -28.736331940 +v 4.858804226 10.354028702 -29.403888702 +v 4.644866943 10.109920502 -29.206455231 +v 4.644866943 9.998181343 -29.206455231 +v 3.865318775 9.998181343 -28.932861328 +v 3.158733845 13.749273300 -28.736331940 +v 4.056933880 10.354027748 -29.403806686 +v 2.862492561 13.593065262 -29.932897568 +v 2.862492561 9.998182297 -29.932899475 +v 2.862492561 13.593065262 -28.939510345 +v 1.861337543 15.304443359 -28.939508438 +v 1.933394313 15.435888290 -29.403806686 +v 1.725657225 15.017166138 -28.736331940 +v 2.338002682 14.277850151 -28.736331940 +v 2.175081253 14.013491631 -28.939508438 +v 2.175081253 14.013492584 -29.932897568 +v 1.537689686 14.590011597 -28.736331940 +v 1.427501559 14.319043159 -28.939508438 +v 0.872036457 15.541138649 -28.939508438 +v 0.903779268 15.672584534 -29.403806686 +v 0.791445196 15.202938080 -28.736331940 +v -0.140611842 15.740915298 -29.403806686 +v -0.140727192 15.609468460 -28.939094543 +v -0.140733764 14.858482361 -28.736331940 +v -0.140730351 15.245207787 -28.736331940 +v 1.427501559 14.319043159 -29.932897568 +v 0.653193831 14.504489899 -28.939510345 +v 0.705467701 14.795266151 -28.736331940 +v 0.653193951 14.504489899 -29.932899475 +v -0.137500286 14.566659927 -28.939510345 +v -0.137500197 14.566660881 -29.932897568 +v -3.137508869 9.998181343 -28.939510345 +v 3.976916313 10.109919548 -29.212692261 +v 3.976916313 9.998181343 -29.212692261 +v -1.141009688 15.541136742 -10.932935715 +v -1.069683313 15.202935219 -11.135701180 +v -1.182017684 15.672581673 -10.468370438 +v -2.211632252 15.435887337 -10.468370438 +v -2.003895283 15.017164230 -11.135701180 +v -2.975640297 14.941862106 -10.932935715 +v -2.130310535 15.304441452 -10.932935715 +v -0.922381461 14.504487991 -9.932898521 +v -1.696689010 14.319040298 -9.932898521 +v -0.922381401 14.504487991 -10.932935715 +v -0.983705938 14.795264244 -11.135701180 +v -1.815927625 14.590009689 -11.135701180 +v -1.696688890 14.319040298 -10.932935715 +v -2.444268703 14.013488770 -9.932898521 +v -3.091409206 15.073307991 -10.468370438 +v -2.824917316 14.678530693 -11.135701180 +v -2.616240501 14.277847290 -11.135701180 +v -2.444268703 14.013489723 -10.932935715 +v -3.867311954 13.975434303 -11.135701180 +v -3.436972618 13.749271393 -11.135701180 +v -3.137510300 13.593063354 -9.932898521 +v -3.137510300 13.593063354 -10.932935715 +v -4.141528130 14.118021011 -10.932935715 +v -3.437336922 9.998181343 -11.135702133 +v -3.866843224 9.998181343 -11.135702133 +v -3.137510300 9.998181343 -9.932899475 +v -3.418189049 9.998181343 -16.636293411 +v -4.140335083 9.998181343 -10.932937622 +v -4.138982296 9.998181343 -15.935336113 +v -3.849586487 9.998181343 -16.206787109 +v -4.334934235 14.220697403 -10.468370438 +v -5.135976791 15.028306961 -10.468370438 +v -4.919996262 15.383560181 -10.639239311 +v -4.919996262 15.244828224 -10.639239311 +v -4.919999599 15.243041992 -15.150640488 +v -4.919999599 15.381774902 -15.150640488 +v -5.136315823 15.026519775 -14.934705734 +v -4.919883251 10.109925270 -15.154071808 +v -4.919883251 10.109920502 -10.659344673 +v -4.919883251 9.998181343 -10.659344673 +v -4.916337013 9.998181343 -15.151620865 +v -5.135952473 10.354034424 -14.934789658 +v -5.135952950 10.354028702 -10.468370438 +v -4.254973412 10.109919548 -10.659344673 +v -4.254973412 9.998181343 -10.659344673 +v -4.335172176 10.354027748 -10.468370438 +v -8.940937996 13.952216148 -16.233774185 +v -9.144116402 14.941864014 -17.094768524 +v -9.144117355 14.118022919 -15.928879738 +v -9.608413696 15.026519775 -14.934091568 +v -9.437545776 15.381774902 -15.150407791 +v -9.437545776 15.243041992 -15.150407791 +v -9.608413696 14.219083786 -15.734826088 +v -9.608413696 15.072574615 -16.967962265 +v -9.144118309 9.998181343 -16.932897568 +v -8.934705734 9.998181343 -16.676807404 +v -9.144119263 9.998181343 -15.930072784 +v -9.411063194 9.998181343 -15.151620865 +v -8.940937996 9.998181343 -16.230821609 +v -9.411063194 10.109925270 -15.151620865 +v -9.608496666 10.354034424 -14.934453964 +v -9.417300224 10.109930038 -15.814449310 +v -9.608414650 10.354040146 -15.735155106 +v -9.417300224 9.998181343 -15.814449310 +v -8.940937996 13.729488373 -16.673040390 +v -9.144117355 13.593065262 -16.932897568 +v -10.137507439 9.998181343 -16.932897568 +v -10.137506485 13.593065262 -16.932897568 +v -9.608414650 15.435888290 -17.849494934 +v -8.940939903 14.662883759 -17.243770599 +v -9.144117355 15.304443359 -17.940097809 +v -8.940939903 14.267010689 -17.471347809 +v -10.137507439 14.013492584 -17.626140594 +v -9.144117355 14.013491631 -17.626140594 +v -8.940939903 14.979497910 -18.073894501 +v -9.608414650 15.672584534 -18.879110336 +v -9.144116402 15.541138649 -18.929399490 +v -8.940939903 15.184301376 -18.995464325 +v -9.608414650 15.740915298 -19.929794312 +v -9.143704414 15.609468460 -19.929679871 +v -8.940939903 15.245207787 -19.929676056 +v -8.940939903 14.589399338 -18.245639801 +v -9.144117355 14.319043159 -18.373720169 +v -8.940939903 14.785192490 -19.079717636 +v -10.137507439 14.319043159 -18.373720169 +v -10.137506485 14.504489899 -19.148027420 +v -9.144116402 14.504489899 -19.148027420 +v -8.940939903 14.858482361 -19.929672241 +v -9.144117355 14.566659927 -19.932907104 +v -10.137506485 14.566660881 -19.932907104 +v -3.137508392 9.998181343 -22.931098938 +v -10.137507439 9.998181343 -22.932899475 +v -9.608414650 15.672584534 -20.974185944 +v -9.144116402 15.541138649 -20.942443848 +v -8.940939903 15.202938080 -20.861852646 +v -9.144116402 15.304443359 -21.931743622 +v -8.940939903 15.017166138 -21.796064377 +v -9.608414650 15.435888290 -22.003801346 +v -9.144116402 14.941128731 -22.778762817 +v -10.137507439 14.504489899 -20.723600388 +v -8.940939903 14.795266151 -20.775875092 +v -10.137506485 14.319043159 -21.497907639 +v -9.144117355 14.504489899 -20.723600388 +v -8.940939903 14.590011597 -21.608097076 +v -10.137506485 14.013492584 -22.245487213 +v -9.144116402 14.319043159 -21.497907639 +v -8.940939903 14.678532600 -22.617086411 +v -9.608414650 15.073310852 -22.883577347 +v -8.940939903 14.277850151 -22.408409119 +v -9.144116402 14.013491631 -22.245487213 +v -10.137506485 13.593065262 -22.932899475 +v -9.144117355 13.593065262 -22.932899475 +v -8.940939903 13.749273300 -23.229141235 +v -8.940939903 13.975436211 -23.659481049 +v -9.144116402 14.116407394 -23.931501389 +v -3.863620758 9.998181343 -23.644977570 +v -4.135071278 9.998181343 -23.934373856 +v -8.940939903 9.998181343 -23.659011841 +v -3.434114456 9.998181343 -23.213581085 +v -8.940939903 9.998181343 -23.229505539 +v -9.144118309 9.998181343 -22.932899475 +v -3.393599987 9.998181343 -28.730098724 +v -3.839584827 9.998181343 -28.736330032 +v -9.137470245 9.998181343 -23.935726166 +v -9.417302132 9.998181343 -24.047323227 +v -9.417302132 10.109919548 -24.047323227 +v -9.608496666 10.354028702 -24.929210663 +v -9.608414650 10.354027748 -24.127340317 +v -9.411063194 10.109920502 -24.715274811 +v -9.411063194 9.998181343 -24.715274811 +v -3.137508869 9.998182297 -29.932899475 +v -4.140333652 9.998181343 -28.939510345 +v -4.255957127 10.109930038 -29.212692261 +v -4.255957127 9.998181343 -29.212692261 +v -1.141008139 15.541138649 -28.939508438 +v -1.191296935 15.672584534 -29.403806686 +v -1.074942827 15.184301376 -28.736331940 +v -2.130308628 15.304443359 -28.939510345 +v -2.220911503 15.435888290 -29.403806686 +v -1.996512532 14.979497910 -28.736331940 +v -2.975638866 14.941864014 -28.939508438 +v -2.826636791 14.662883759 -28.736331940 +v -0.922379851 14.504489899 -28.939508438 +v -0.990688443 14.785192490 -28.736331940 +v -0.922379732 14.504489899 -29.932897568 +v -1.696687222 14.319043159 -28.939510345 +v -1.824766159 14.589399338 -28.736331940 +v -2.444266796 14.013491631 -28.939510345 +v -2.599059105 14.267010689 -28.736331940 +v -1.696687341 14.319043159 -29.932899475 +v -2.444266796 14.013492584 -29.932899475 +v -3.102445602 15.072574615 -29.403804779 +v -4.141526699 14.118022919 -28.939510345 +v -3.137508869 13.593065262 -28.939510345 +v -3.137508869 13.593065262 -29.932897568 +v -3.836632729 13.952216148 -28.736330032 +v -3.397366047 13.729488373 -28.736330032 +v -4.335580826 14.219083786 -29.403804779 +v -5.136315823 15.026519775 -29.403804779 +v -4.919999599 15.381774902 -29.232936859 +v -4.919455051 15.242951393 -29.226558685 +v -4.918786526 10.109925270 -29.206455231 +v -4.918786526 10.109919548 -24.711729050 +v -4.918786526 9.998181343 -24.711729050 +v -4.918786526 9.998181343 -29.206455231 +v -5.135952473 10.354034424 -29.403888702 +v -5.133820057 15.026432037 -24.931009293 +v -5.133820057 10.354028702 -24.931009293 +v -4.919454575 15.381685257 -24.715076447 +v -4.919454575 15.242953300 -24.715076447 +v -4.335251331 10.354040146 -29.403806686 +v -9.431168556 15.244828224 -24.715387344 +v -9.608496666 15.026432037 -24.929210663 +v -9.431168556 15.383560181 -24.715387344 +v -9.608414650 14.220699310 -24.127666473 +v -9.194107056 2.851734638 2.761604309 +v -9.184239388 4.903903484 2.737780094 +v -9.217930794 4.903903484 2.771472692 +v -9.260048866 2.851734638 2.737920523 +v -9.251623154 4.903903484 2.737780094 +v -9.194107056 2.851734638 2.999632597 +v -9.184238434 4.903903484 2.975809097 +v -9.217930794 4.903903484 3.009500980 +v -9.260048866 2.851734638 2.975808382 +v -9.251622200 4.903903484 2.975809097 +v -9.194107056 2.851734638 2.951984406 +v -9.217930794 4.903903484 2.942117214 +v -9.174771309 2.851734638 2.975808382 +v -9.241754532 2.851734638 2.951984406 +v -9.174771309 2.851734638 2.738004923 +v -9.241754532 2.851734638 2.999632597 +v -9.241754532 2.851734638 2.523857117 +v -9.194107056 2.851734638 2.523857117 +v -9.217930794 4.903903484 2.533725500 +v -9.260048866 2.851734638 2.500032902 +v -9.241754532 2.851734638 2.714097023 +v -9.241754532 2.851734638 2.476208925 +v -9.251622200 4.903903484 2.500033379 +v -9.194107056 2.851734638 2.476208925 +v -9.174771309 2.851734638 2.500032902 +v -9.184238434 4.903903484 2.500033379 +v -9.194107056 2.851734638 2.714097023 +v -9.217930794 4.903903484 2.704088449 +v -9.217930794 4.903903484 2.466341496 +v -9.241754532 2.851734638 2.047632456 +v -9.194107056 2.851734638 2.047632456 +v -9.217930794 4.903903484 2.057500839 +v -9.260048866 2.851734638 2.023808241 +v -9.241754532 2.851734638 1.999984503 +v -9.251622200 4.903903484 2.023808718 +v -9.194107056 2.851734638 1.999984503 +v -9.174771309 2.851734638 2.023808241 +v -9.184238434 4.903903484 2.023808718 +v -9.260048866 2.851734638 2.261920691 +v -9.241754532 2.851734638 2.285828829 +v -9.217930794 4.903903484 2.295696974 +v -9.174771309 2.851734638 2.262004614 +v -9.194107056 2.851734638 2.238096952 +v -9.217930794 4.903903484 2.228312969 +v -9.194107056 2.851734638 2.285828829 +v -9.184239388 4.903903484 2.262005091 +v -9.241754532 2.851734638 2.238096952 +v -9.251623154 4.903903484 2.262005091 +v -9.241754532 2.851734638 1.761872530 +v -9.251623154 4.903903484 1.785780668 +v -9.217930794 4.903903484 1.752088666 +v -9.174771309 2.851734638 1.785780668 +v -9.184239388 4.903903484 1.785780668 +v -9.194107056 2.851734638 1.809604406 +v -9.217930794 4.903903484 1.819472432 +v -9.260048866 2.851734638 1.785696149 +v -9.217930794 4.903903484 1.990117311 +v -9.194107056 2.851734638 1.761872530 +v -9.241754532 2.851734638 1.809604406 +v -9.241754532 2.851734638 1.571408272 +v -9.194107056 2.851734638 1.571408272 +v -9.217930794 4.903903484 1.581276536 +v -9.260048866 2.851734638 3.202257156 +v -9.174771309 2.851734638 3.202257156 +v -9.251623154 2.764342785 2.975809097 +v -9.174771309 2.764550686 3.202257156 +v -9.174771309 2.764550686 2.975808382 +v -9.194107056 2.764285803 2.999632597 +v -9.251623154 2.764400005 3.202257156 +v -9.217930794 2.764285803 2.975809097 +v -9.217930794 2.764400005 3.202223778 +v -9.217930794 2.851734638 3.202223778 +v -9.217930794 2.764285564 2.737780094 +v -9.217930794 2.764285564 2.771472692 +v -9.184239388 2.764371395 2.737920523 +v -9.260048866 2.764551163 2.737920523 +v -9.241754532 2.764342785 2.714097023 +v -9.194107056 2.764285803 2.951984882 +v -9.217930794 2.764285564 2.500033379 +v -9.194107056 2.764285564 2.523857117 +v -9.174771309 2.764551163 2.500032902 +v -9.251623154 2.764342785 2.500032902 +v -9.194107056 2.764285564 2.476209641 +v -9.217930794 2.764285564 2.295696497 +v -9.184239388 2.764370918 2.261920691 +v -9.260048866 2.764551163 2.261920691 +v -9.217930794 2.764285564 2.262004614 +v -9.241754532 2.764342785 2.238096952 +v -9.217930794 2.764285803 2.023808718 +v -9.251623154 2.764342785 2.023808718 +v -9.194107056 2.764285803 2.047632456 +v -9.194107056 2.764285803 1.999985099 +v -9.174771309 2.764550686 2.023808241 +v -9.260048866 2.764551163 1.785696149 +v -9.184239388 2.764371395 1.785696149 +v -9.217930794 2.764285564 1.819471836 +v -9.217930794 2.764285564 1.785780668 +v -9.251623154 2.764342785 1.547584295 +v -9.241754532 2.764342785 1.761872530 +v -9.194107056 2.764285564 1.571408272 +v -9.174771309 2.851734638 1.547583818 +v -9.174771309 2.764551163 1.547583818 +v -9.260048866 2.851734638 1.547583818 +v -9.194107056 2.851734638 1.523760080 +v -9.241754532 2.851734638 1.523760080 +v -9.217930794 4.903903484 1.513892889 +v -9.184238434 4.903903484 1.547584534 +v -9.251622200 4.903903484 1.547584534 +v -9.194107056 2.851734638 1.333379865 +v -9.184239388 4.903903484 1.309556246 +v -9.217930794 4.903903484 1.343248129 +v -9.260048866 2.851734638 1.309471726 +v -9.251623154 4.903903484 1.309556246 +v -9.241754532 2.851734638 1.285648108 +v -9.217930794 4.903903484 1.275864244 +v -9.174771309 2.851734638 1.309556246 +v -9.241754532 2.851734638 1.333379865 +v -9.194107056 2.851734638 1.285648108 +v -9.174771309 2.851734638 0.833331823 +v -9.194107056 2.851734638 0.809423327 +v -9.184239388 4.903903484 0.833331823 +v -9.194107056 2.851734638 0.857155442 +v -9.241754532 2.851734638 0.857155442 +v -9.217930794 4.903903484 0.867023766 +v -9.260048866 2.851734638 0.833247066 +v -9.241754532 2.851734638 0.809423327 +v -9.251623154 4.903903484 0.833331823 +v -9.194107056 2.851734638 1.095183849 +v -9.174771309 2.851734638 1.071359396 +v -9.184238434 4.903903484 1.071360111 +v -9.241754532 2.851734638 1.095183849 +v -9.217930794 4.903903484 1.105052114 +v -9.260048866 2.851734638 1.071359396 +v -9.241754532 2.851734638 1.047535658 +v -9.251622200 4.903903484 1.071360111 +v -9.194107056 2.851734638 1.047535658 +v -9.217930794 4.903903484 1.037668347 +v -9.217930794 4.903903484 0.799639761 +v -9.194107056 2.851734638 0.618959129 +v -9.184238434 4.903903484 0.595135331 +v -9.217930794 4.903903484 0.628827274 +v -9.260048866 2.851734638 0.595134735 +v -9.251622200 4.903903484 0.595135331 +v -9.194107056 2.851734638 0.571310997 +v -9.217930794 4.903903484 0.561443686 +v -9.174771309 2.851734638 0.595134735 +v -9.241754532 2.851734638 0.618959129 +v -9.241754532 2.851734638 0.571310997 +v -9.241754532 2.851734638 0.380930841 +v -9.194107056 2.851734638 0.380930841 +v -9.217930794 4.903903484 0.390799046 +v -9.174771309 2.851734638 0.357107073 +v -9.184239388 4.903903484 0.357107073 +v -9.260048866 2.851734638 0.357022703 +v -9.251623154 4.903903484 0.357107073 +v -9.241754532 2.851734638 0.333198935 +v -9.217930794 4.903903484 0.323415101 +v -9.194107056 2.851734638 0.333198935 +v -9.194107056 2.851734638 0.142734706 +v -9.184238434 4.903903484 0.118910953 +v -9.217930794 4.903903484 0.152602926 +v -9.260048866 2.851734638 0.118910357 +v -9.251622200 4.903903484 0.118910953 +v -9.194107056 2.851734638 0.095086604 +v -9.217930794 4.903903484 0.085219286 +v -9.174771309 2.851734638 0.118910357 +v -9.241754532 2.851734638 0.142734706 +v -9.241754532 2.851734638 0.095086604 +v -9.217930794 2.764285564 1.547584534 +v -9.194107056 2.764285564 1.523760676 +v -9.260048866 2.764551163 1.309471726 +v -9.184239388 2.764371395 1.309471726 +v -9.217930794 2.764285564 1.343247890 +v -9.217930794 2.764285564 1.309556246 +v -9.241754532 2.764342785 1.285648108 +v -9.194107056 2.764285803 1.095183849 +v -9.251623154 2.764342785 1.071359873 +v -9.174771309 2.764551163 1.071359396 +v -9.217930794 2.764285803 1.071360111 +v -9.194107056 2.764285803 1.047536373 +v -9.217930794 2.764285564 0.833331823 +v -9.241754532 2.764342785 0.809423327 +v -9.260048866 2.764550686 0.833247066 +v -9.217930794 2.764285564 0.867023468 +v -9.184239388 2.764371395 0.833247066 +v -9.251623154 2.764342785 0.595135033 +v -9.194107056 2.764285803 0.618959129 +v -9.217930794 2.764285803 0.595135331 +v -9.174771309 2.764551163 0.595134735 +v -9.194107056 2.764285803 0.571311593 +v -9.184239388 2.764371395 0.357022703 +v -9.217930794 2.764285564 0.390798748 +v -9.260048866 2.764551163 0.357022703 +v -9.217930794 2.764285564 0.357107073 +v -9.241754532 2.764342785 0.333198935 +v -9.217930794 2.764285803 0.118910953 +v -9.194107056 2.764285803 0.142734706 +v -9.174771309 2.764551163 0.118910357 +v -9.251623154 2.764342785 0.118910655 +v -9.194107056 2.764285803 0.095087208 +v -9.241754532 0.663206697 2.999632597 +v -9.194107056 0.663206935 2.951984406 +v -9.194107056 0.663206697 2.761604309 +v -9.260048866 0.663206697 2.737920523 +v -9.174771309 0.663206935 2.975808382 +v -9.194107056 0.663206697 2.999632597 +v -9.174771309 0.663206697 2.738004923 +v -9.260048866 0.663206935 2.975808382 +v -9.241754532 0.663206935 2.951984406 +v -9.194107056 0.663206697 2.714097023 +v -9.241754532 0.663206816 2.523857117 +v -9.194107056 0.663206816 2.476208925 +v -9.174771309 0.663206816 2.500032902 +v -9.194107056 0.663206816 2.523857117 +v -9.241754532 0.663206697 2.714097023 +v -9.260048866 0.663206816 2.500032902 +v -9.241754532 0.663206816 2.476208925 +v -9.174771309 0.663206816 2.023808241 +v -9.194107056 0.663206816 1.999984503 +v -9.194107056 0.663206816 2.047632217 +v -9.241754532 0.663206816 2.047632217 +v -9.260048866 0.663206816 2.023808241 +v -9.241754532 0.663206816 1.999984503 +v -9.194107056 0.663206816 2.285828829 +v -9.174771309 0.663206816 2.262005091 +v -9.241754532 0.663206816 2.285828829 +v -9.260048866 0.663206816 2.261920691 +v -9.241754532 0.663206816 2.238096952 +v -9.194107056 0.663206816 2.238096952 +v -9.194107056 0.663206816 1.761872530 +v -9.194107056 0.663206816 1.809604406 +v -9.260048866 0.663206816 1.785696149 +v -9.241754532 0.663206816 1.761872530 +v -9.241754532 0.663206816 1.571408272 +v -9.194107056 0.663206816 1.571408272 +v -9.174771309 0.663206816 1.785780311 +v -9.241754532 0.663206816 1.809604406 +v -9.174771309 0.663206697 3.202257156 +v -9.174771309 0.585616350 3.202257156 +v -9.251623154 0.585465491 2.975808382 +v -9.251623154 0.585465491 3.202257156 +v -9.260048866 0.663206697 3.202257156 +v -9.217930794 0.663206697 3.202223778 +v -9.174771309 0.585616350 2.975808382 +v -9.260048866 0.585616350 2.737920523 +v -9.184239388 0.585465550 2.737920523 +v -9.194107056 0.585465491 2.999632597 +v -9.217930794 0.585465491 3.202223778 +v -9.224709511 0.001949469 2.975809097 +v -9.217930794 0.585465550 2.771472692 +v -9.194107056 0.585465491 2.951984406 +v -9.224709511 0.001949608 2.737780094 +v -9.241754532 0.585465550 2.714097023 +v -9.251623154 0.585465550 2.500032902 +v -9.224709511 0.001949469 2.500033379 +v -9.194107056 0.585465550 2.523857117 +v -9.174771309 0.585616410 2.500032902 +v -9.194107056 0.585465550 2.476208925 +v -9.260048866 0.585616410 2.261920691 +v -9.184239388 0.585465550 2.261920691 +v -9.217930794 0.585465550 2.295696497 +v -9.251623154 0.585465550 2.023808241 +v -9.224709511 0.001949469 2.023808718 +v -9.194107056 0.585465550 2.047632217 +v -9.194107056 0.585465550 1.999984503 +v -9.174771309 0.585616410 2.023808241 +v -9.224709511 0.001949678 2.262005091 +v -9.241754532 0.585465550 2.238096952 +v -9.260048866 0.585616410 1.785696149 +v -9.184239388 0.585465372 1.785696149 +v -9.174771309 0.663206816 1.547583818 +v -9.251623154 0.585465431 1.547583818 +v -9.260048866 0.663206816 1.547583818 +v -9.174771309 0.585616469 1.547583818 +v -9.217930794 0.585465372 1.819472313 +v -9.224709511 0.001949678 1.785780668 +v -9.194107056 0.585465431 1.571408272 +v -9.241754532 0.585465372 1.761872530 +v -9.241754532 0.663206816 1.523760080 +v -9.194107056 0.663206816 1.523760080 +v -9.241754532 0.663206875 1.285648108 +v -9.194107056 0.663206875 1.285648108 +v -9.194107056 0.663206875 1.333379865 +v -9.260048866 0.663206875 1.309471726 +v -9.241754532 0.663206875 1.333379865 +v -9.174771309 0.663206875 1.309556246 +v -9.260048866 0.663206875 1.071359396 +v -9.241754532 0.663206875 1.095183849 +v -9.241754532 0.663206875 1.047535658 +v -9.194107056 0.663206875 1.047535658 +v -9.174771309 0.663206875 1.071359396 +v -9.194107056 0.663206875 1.095183849 +v -9.241754532 0.663206875 0.809423327 +v -9.194107056 0.663206875 0.809423327 +v -9.194107056 0.663206875 0.857155442 +v -9.260048866 0.663206875 0.833247066 +v -9.174771309 0.663206875 0.833331823 +v -9.241754532 0.663206875 0.857155442 +v -9.241754532 0.663206875 0.618959129 +v -9.194107056 0.663206875 0.618959129 +v -9.260048866 0.663206875 0.595134735 +v -9.241754532 0.663206875 0.571310997 +v -9.194107056 0.663206875 0.571310997 +v -9.174771309 0.663206875 0.595134735 +v -9.194107056 0.663206875 0.380930841 +v -9.260048866 0.663206875 0.357022703 +v -9.241754532 0.663206875 0.380930841 +v -9.174771309 0.663206875 0.357107073 +v -9.194107056 0.663206875 0.333198935 +v -9.241754532 0.663206875 0.333198935 +v -9.194107056 0.663206875 0.142734706 +v -9.241754532 0.663206875 0.142734706 +v -9.194107056 0.663206875 0.095086604 +v -9.174771309 0.663206875 0.118910357 +v -9.260048866 0.663206875 0.118910357 +v -9.241754532 0.663206875 0.095086604 +v -9.224709511 0.001949469 1.547584534 +v -9.194107056 0.585465431 1.523760080 +v -9.260048866 0.585616469 1.309471726 +v -9.224709511 0.001949678 1.309556246 +v -9.217930794 0.585465431 1.343247890 +v -9.241754532 0.585465431 1.285648108 +v -9.184239388 0.585465431 1.309471726 +v -9.194107056 0.585465431 1.095183849 +v -9.251623154 0.585465431 1.071359396 +v -9.224709511 0.001949330 1.071360111 +v -9.174771309 0.585616469 1.071359396 +v -9.194107056 0.585465431 1.047535658 +v -9.184239388 0.585465431 0.833247066 +v -9.224709511 0.001949748 0.833331823 +v -9.241754532 0.585465491 0.809423327 +v -9.260048866 0.585616469 0.833247066 +v -9.217930794 0.585465431 0.867023468 +v -9.251623154 0.585465491 0.595134735 +v -9.174771309 0.585616529 0.595134735 +v -9.260048866 0.585616529 0.357022703 +v -9.184239388 0.585465491 0.357022703 +v -9.224709511 0.001949330 0.595135331 +v -9.194107056 0.585465491 0.618959129 +v -9.194107056 0.585465491 0.571310997 +v -9.217930794 0.585465491 0.390798748 +v -9.224709511 0.001949748 0.357107073 +v -9.241754532 0.585465491 0.333198935 +v -9.194107056 0.585465491 0.142734706 +v -9.224709511 0.001949399 0.118910953 +v -9.174771309 0.585616529 0.118910357 +v -9.251623154 0.585465491 0.118910357 +v -9.194107056 0.585465491 0.095086604 +v -9.241754532 2.851734638 -0.095293581 +v -9.194107056 2.851734638 -0.095293581 +v -9.217930794 4.903903484 -0.085425362 +v -9.260048866 2.851734638 -0.119201690 +v -9.174771309 2.851734638 -0.119117334 +v -9.194107056 2.851734638 -0.143025458 +v -9.184239388 4.903903484 -0.119117334 +v -9.241754532 2.851734638 -0.143025458 +v -9.251623154 4.903903484 -0.119117334 +v -9.217930794 4.903903484 -0.152809307 +v -9.194107056 2.851734638 -0.333489835 +v -9.184238434 4.903903484 -0.357313603 +v -9.217930794 4.903903484 -0.323621780 +v -9.260048866 2.851734638 -0.357314199 +v -9.251622200 4.903903484 -0.357313603 +v -9.194107056 2.851734638 -0.381137967 +v -9.217930794 4.903903484 -0.391005576 +v -9.241754532 2.851734638 -0.333489835 +v -9.241754532 2.851734638 -0.381137967 +v -9.174771309 2.851734638 -0.357314199 +v -9.194107056 2.851734638 -0.571518302 +v -9.184239388 4.903903484 -0.595342040 +v -9.217930794 4.903903484 -0.561650217 +v -9.260048866 2.851734638 -0.595426559 +v -9.251623154 4.903903484 -0.595342040 +v -9.241754532 2.851734638 -0.619250298 +v -9.217930794 4.903903484 -0.629034042 +v -9.194107056 2.851734638 -0.619250298 +v -9.194107056 2.851734638 -0.809714198 +v -9.184238434 4.903903484 -0.833538115 +v -9.217930794 4.903903484 -0.799846351 +v -9.260048866 2.851734638 -0.833538711 +v -9.251622200 4.903903484 -0.833538115 +v -9.174771309 2.851734638 -0.595342159 +v -9.241754532 2.851734638 -0.571518302 +v -9.174771309 2.851734638 -0.833538711 +v -9.241754532 2.851734638 -0.809714198 +v -9.241754532 2.851734638 -1.095474720 +v -9.251623154 4.903903484 -1.071566582 +v -9.217930794 4.903903484 -1.105258584 +v -9.174771309 2.851734638 -1.071566582 +v -9.184239388 4.903903484 -1.071566582 +v -9.194107056 2.851734638 -1.047742844 +v -9.217930794 4.903903484 -1.037874579 +v -9.260048866 2.851734638 -1.071650743 +v -9.194107056 2.851734638 -0.857362509 +v -9.217930794 4.903903484 -0.867230058 +v -9.241754532 2.851734638 -1.047742844 +v -9.241754532 2.851734638 -0.857362509 +v -9.194107056 2.851734638 -1.095474720 +v -9.194107056 2.851734638 -1.285938621 +v -9.174771309 2.851734638 -1.309763074 +v -9.184238434 4.903903484 -1.309762597 +v -9.241754532 2.851734638 -1.285938621 +v -9.217930794 4.903903484 -1.276070833 +v -9.260048866 2.851734638 -1.309763074 +v -9.241754532 2.851734638 -1.333587050 +v -9.251622200 4.903903484 -1.309762597 +v -9.194107056 2.851734638 -1.333587050 +v -9.194107056 2.851734638 -1.523967266 +v -9.184239388 4.903903484 -1.547790885 +v -9.217930794 4.903903484 -1.514099121 +v -9.260048866 2.851734638 -1.547875404 +v -9.251623154 4.903903484 -1.547790885 +v -9.241754532 2.851734638 -1.571699142 +v -9.217930794 4.903903484 -1.581482887 +v -9.174771309 2.851734638 -1.547790885 +v -9.217930794 4.903903484 -1.343454361 +v -9.217930794 2.764285564 -0.119117334 +v -9.241754532 2.764342785 -0.143025458 +v -9.260048866 2.764550686 -0.119201690 +v -9.184239388 2.764370918 -0.119201690 +v -9.217930794 2.764285564 -0.085425660 +v -9.217930794 2.764285803 -0.357313752 +v -9.194107056 2.764285803 -0.333490014 +v -9.174771309 2.764550686 -0.357314199 +v -9.194107056 2.764285803 -0.381137490 +v -9.251623154 2.764342785 -0.357313901 +v -9.260048866 2.764551163 -0.595426559 +v -9.184239388 2.764371395 -0.595426559 +v -9.217930794 2.764285564 -0.561650217 +v -9.217930794 2.764285564 -0.595342159 +v -9.251623154 2.764342785 -0.833538413 +v -9.241754532 2.764342785 -0.619250298 +v -9.194107056 2.764285564 -0.809714556 +v -9.174771309 2.764551163 -0.833538711 +v -9.217930794 2.764285564 -0.833538294 +v -9.194107056 2.764285803 -0.857361853 +v -9.217930794 2.764285564 -1.071566582 +v -9.217930794 2.764285564 -1.037874579 +v -9.184239388 2.764370918 -1.071650743 +v -9.260048866 2.764551163 -1.071650743 +v -9.241754532 2.764342785 -1.095474720 +v -9.251623154 2.764342785 -1.309763074 +v -9.194107056 2.764285803 -1.285939097 +v -9.174771309 2.764550686 -1.309763074 +v -9.217930794 2.764285803 -1.309762716 +v -9.194107056 2.764285803 -1.333586216 +v -9.241754532 2.851734638 -1.523967266 +v -9.217930794 2.764285564 -1.514099121 +v -9.184239388 2.764371395 -1.547875404 +v -9.260048866 2.764551163 -1.547875404 +v -9.194107056 2.851734638 -1.571699262 +v -9.260048866 2.851734638 -1.785987616 +v -9.241754532 2.851734638 -1.762163401 +v -9.217930794 4.903903484 -1.752295256 +v -9.241754532 2.851734638 -1.809811354 +v -9.251622200 4.903903484 -1.785987139 +v -9.194107056 2.851734638 -1.809811354 +v -9.174771309 2.851734638 -1.785987616 +v -9.217930794 4.903903484 -1.819678783 +v -9.194107056 2.851734638 -1.762163401 +v -9.184238434 4.903903484 -1.785987139 +v -9.194107056 2.851734638 -2.000191689 +v -9.184239388 4.903903484 -2.024015427 +v -9.217930794 4.903903484 -1.990323782 +v -9.260048866 2.851734638 -2.024100065 +v -9.251623154 4.903903484 -2.024015427 +v -9.241754532 2.851734638 -2.000191689 +v -9.174771309 2.851734638 -2.024015665 +v -9.241754532 2.851734638 -2.238387823 +v -9.194107056 2.851734638 -2.238387823 +v -9.217930794 4.903903484 -2.228519678 +v -9.260048866 2.851734638 -2.262212276 +v -9.194107056 2.851734638 -2.047923565 +v -9.217930794 4.903903484 -2.057707310 +v -9.241754532 2.851734638 -2.286036015 +v -9.251622200 4.903903484 -2.262211800 +v -9.194107056 2.851734638 -2.286036015 +v -9.174771309 2.851734638 -2.262212276 +v -9.184238434 4.903903484 -2.262211800 +v -9.241754532 2.851734638 -2.047923565 +v -9.217930794 4.903903484 -2.295903683 +v -9.241754532 2.851734638 -2.524148226 +v -9.260048866 2.851734638 -2.500324249 +v -9.251623154 4.903903484 -2.500240326 +v -9.241754532 2.851734638 -2.476416349 +v -9.194107056 2.851734638 -2.476416349 +v -9.217930794 4.903903484 -2.466548204 +v -9.194107056 2.851734638 -2.524148226 +v -9.217930794 4.903903484 -2.533931971 +v -9.174771309 2.851734638 -2.500240326 +v -9.184239388 4.903903484 -2.500240326 +v -9.241754532 2.851734638 -2.714612246 +v -9.184238434 4.903903484 -2.738436222 +v -9.217930794 4.903903484 -2.704744339 +v -9.260048866 2.851734638 -2.738436699 +v -9.251622200 4.903903484 -2.738436222 +v -9.194107056 2.851734638 -2.714612246 +v -9.174770355 2.851734638 -2.738436699 +v -9.241754532 2.851734638 -2.762260437 +v -9.194107056 2.851734638 -2.762260437 +v -9.217930794 4.903903484 -2.772128105 +v -9.241754532 2.851734638 -3.000288248 +v -9.251622200 4.903903484 -2.976464748 +v -9.217930794 4.903903484 -3.010156393 +v -9.194107056 2.851734638 -3.000288248 +v -9.184238434 4.903903484 -2.976464748 +v -9.194107056 2.851734638 -2.952640533 +v -9.217930794 4.903903484 -2.942772388 +v -9.260048866 2.851734638 -2.976464748 +v -9.174771309 2.851734638 -2.976464272 +v -9.241754532 2.851734638 -2.952640533 +v -9.217930794 2.764285564 -1.547791004 +v -9.241754532 2.764342785 -1.571699262 +v -9.251623154 2.764342785 -1.785987496 +v -9.194107056 2.764285564 -1.762163520 +v -9.217930794 2.764285564 -1.785987139 +v -9.174771309 2.764551163 -1.785987616 +v -9.217930794 2.764285564 -2.024015665 +v -9.217930794 2.764285564 -1.990323663 +v -9.184239388 2.764371395 -2.024100065 +v -9.260048866 2.764551163 -2.024099827 +v -9.241754532 2.764342785 -2.047923803 +v -9.194107056 2.764285564 -1.809810996 +v -9.217930794 2.764285803 -2.262211800 +v -9.194107056 2.764285803 -2.238388062 +v -9.174771309 2.764550686 -2.262212276 +v -9.251623154 2.764342785 -2.262211800 +v -9.194107056 2.764285803 -2.286035538 +v -9.217930794 2.764285564 -2.500240326 +v -9.260048866 2.764550686 -2.500324249 +v -9.217930794 2.764285564 -2.466548204 +v -9.241754532 2.764342785 -2.524148226 +v -9.184239388 2.764371395 -2.500324249 +v -9.251622200 2.764342785 -2.738436460 +v -9.194107056 2.764285803 -2.714612246 +v -9.174770355 2.764551163 -2.738436699 +v -9.217930794 2.764285803 -2.738436222 +v -9.194107056 2.764285803 -2.762260199 +v -9.251623154 2.764342785 -2.976464748 +v -9.217930794 2.764285564 -2.976464748 +v -9.194107056 2.764285564 -2.952641010 +v -9.174771309 2.764551163 -2.976464272 +v -9.174771309 2.851734400 -3.202257156 +v -9.217930794 2.764285088 -3.201863527 +v -9.194107056 2.764399529 -2.999536991 +v -9.260048866 2.764550447 -3.202257156 +v -9.260048866 2.851734400 -3.202257156 +v -9.184239388 2.764342308 -3.202257156 +v -9.217930794 2.851734400 -3.201863527 +v -9.194107056 0.663206875 -0.333490014 +v -9.241754532 0.663206875 -0.333490014 +v -9.194107056 0.663206875 -0.095293581 +v -9.260048866 0.663206875 -0.119201690 +v -9.241754532 0.663206875 -0.143025458 +v -9.194107056 0.663206875 -0.143025458 +v -9.174771309 0.663206875 -0.119117633 +v -9.241754532 0.663206875 -0.095293581 +v -9.174771309 0.663206875 -0.357314348 +v -9.260048866 0.663206875 -0.357314348 +v -9.241754532 0.663206875 -0.619250298 +v -9.194107056 0.663206875 -0.619250298 +v -9.194107056 0.663206875 -0.381138086 +v -9.194107056 0.663206875 -0.571518421 +v -9.260048866 0.663206875 -0.595426559 +v -9.241754532 0.663206875 -0.571518421 +v -9.241754532 0.663206875 -0.381138086 +v -9.174771309 0.663206875 -0.595342159 +v -9.241754532 0.663206935 -0.809714556 +v -9.194107056 0.663206935 -0.809714556 +v -9.260048866 0.663206935 -0.833538890 +v -9.241754532 0.663206935 -0.857362628 +v -9.194107056 0.663206935 -0.857362628 +v -9.174771309 0.663206935 -0.833538890 +v -9.241754532 0.663206697 -1.095474839 +v -9.194107056 0.663206697 -1.095474839 +v -9.260048866 0.663206697 -1.071651101 +v -9.194107056 0.663206697 -1.047743082 +v -9.241754532 0.663206697 -1.047743082 +v -9.174771309 0.663206697 -1.071566582 +v -9.194107056 0.663206697 -1.285939097 +v -9.174771309 0.663206935 -1.309763074 +v -9.241754532 0.663206697 -1.285939097 +v -9.260048866 0.663206935 -1.309763074 +v -9.241754532 0.663206935 -1.333587050 +v -9.194107056 0.663206935 -1.333587050 +v -9.194107056 0.663206697 -1.523967385 +v -9.260048866 0.663206697 -1.547875524 +v -9.241754532 0.663206697 -1.571699262 +v -9.194107056 0.663206697 -1.571699262 +v -9.260048866 0.585616529 -0.119201690 +v -9.224709511 0.001949748 -0.119117334 +v -9.217930794 0.585465491 -0.085425660 +v -9.184239388 0.585465491 -0.119201690 +v -9.241754532 0.585465491 -0.143025458 +v -9.194107056 0.585465491 -0.333490014 +v -9.224709511 0.001949399 -0.357313752 +v -9.174771309 0.585616529 -0.357314348 +v -9.251623154 0.585465491 -0.357314348 +v -9.194107056 0.585465491 -0.381138086 +v -9.260048866 0.585616350 -0.595426559 +v -9.184239388 0.585465491 -0.595426559 +v -9.251623154 0.585465491 -0.833538711 +v -9.174771309 0.585616350 -0.833538711 +v -9.217930794 0.585465491 -0.561650217 +v -9.224709511 0.001949748 -0.595342159 +v -9.194107056 0.585465491 -0.809714556 +v -9.241754532 0.585465491 -0.619250298 +v -9.224709511 0.001949399 -0.833538294 +v -9.194107056 0.585465491 -0.857362628 +v -9.184239388 0.585465491 -1.071651101 +v -9.224709511 0.001949608 -1.071566701 +v -9.241754532 0.585465491 -1.095474839 +v -9.217930794 0.585465491 -1.037874579 +v -9.260048866 0.585616350 -1.071651101 +v -9.251623154 0.585465491 -1.309763074 +v -9.194107056 0.585465491 -1.285939097 +v -9.194107056 0.585465491 -1.333587050 +v -9.224709511 0.001949399 -1.309762716 +v -9.174771309 0.585616350 -1.309763074 +v -9.184239388 0.585465491 -1.547875524 +v -9.224709511 0.001949608 -1.547790885 +v -9.241754532 0.585465491 -1.571699262 +v -9.260048866 0.585616350 -1.547875524 +v -9.217930794 0.585465491 -1.514099121 +v -9.241754532 0.663206697 -1.523967385 +v -9.174771309 0.663206697 -1.547791004 +v -9.194107056 0.663206816 -1.762163520 +v -9.174771309 0.663206816 -1.785987616 +v -9.241754532 0.663206816 -1.762163520 +v -9.260048866 0.663206816 -1.785987616 +v -9.241754532 0.663206816 -1.809811592 +v -9.194107056 0.663206816 -1.809811592 +v -9.260048866 0.663206816 -2.024100065 +v -9.194107056 0.663206816 -2.000191927 +v -9.174771309 0.663206816 -2.024015903 +v -9.241754532 0.663206816 -2.000191927 +v -9.194107056 0.663206816 -2.047923803 +v -9.194107056 0.663206816 -2.238387823 +v -9.241754532 0.663206816 -2.238387823 +v -9.194107056 0.663206816 -2.286036253 +v -9.174771309 0.663206816 -2.262212276 +v -9.241754532 0.663206816 -2.047923803 +v -9.241754532 0.663206816 -2.286036253 +v -9.260048866 0.663206816 -2.262212276 +v -9.194107056 0.663206816 -2.476416588 +v -9.174771309 0.663206816 -2.500240326 +v -9.194107056 0.663206816 -2.524148226 +v -9.241754532 0.663206816 -2.476416588 +v -9.260048866 0.663206816 -2.500324488 +v -9.241754532 0.663206816 -2.524148226 +v -9.194107056 0.663206816 -2.714612484 +v -9.241754532 0.663206816 -2.714612484 +v -9.260048866 0.663206816 -2.738436699 +v -9.241754532 0.663206816 -2.762260437 +v -9.174770355 0.663206816 -2.738436699 +v -9.241754532 0.663206875 -3.000288486 +v -9.174771309 0.663206875 -2.976464748 +v -9.194107056 0.663206875 -2.952641010 +v -9.241754532 0.663206875 -2.952641010 +v -9.194107056 0.663206816 -2.762260437 +v -9.260048866 0.663206875 -2.976464748 +v -9.194107056 0.663206875 -3.000288486 +v -9.251623154 0.585465550 -1.785987616 +v -9.174771309 0.585616410 -1.785987616 +v -9.260048866 0.585616410 -2.024100065 +v -9.184239388 0.585465550 -2.024100065 +v -9.194107056 0.585465550 -1.762163520 +v -9.224709511 0.001949469 -1.785987139 +v -9.194107056 0.585465550 -1.809811711 +v -9.217930794 0.585465550 -1.990323782 +v -9.224709511 0.001949678 -2.024015665 +v -9.194107056 0.585465550 -2.238387823 +v -9.224709511 0.001949469 -2.262211800 +v -9.174771309 0.585616410 -2.262212276 +v -9.251623154 0.585465550 -2.262212276 +v -9.194107056 0.585465550 -2.286036253 +v -9.241754532 0.585465550 -2.047923803 +v -9.260048866 0.585616410 -2.500324488 +v -9.224709511 0.001949678 -2.500240326 +v -9.217930794 0.585465550 -2.466548204 +v -9.241754532 0.585465550 -2.524148226 +v -9.184239388 0.585465550 -2.500324488 +v -9.194107056 0.585465550 -2.714612484 +v -9.224708557 0.001949469 -2.738436222 +v -9.174770355 0.585616469 -2.738436699 +v -9.251622200 0.585465372 -2.738436699 +v -9.194107056 0.585465431 -2.762260437 +v -9.217930794 0.663206875 -3.201863527 +v -9.260048866 0.663206875 -3.202257156 +v -9.174771309 0.663206875 -3.202257156 +v -9.174771309 0.585616469 -2.975544691 +v -9.260048866 0.585616469 -3.202257156 +v -9.251623154 0.585465431 -2.976464748 +v -9.184239388 0.585465431 -3.202257156 +v -9.224709511 0.001949678 -2.976464748 +v -9.217930794 0.585465431 -2.942772865 +v -9.194107056 0.585465431 -3.000288486 +v -9.217930794 0.585465431 -3.201863527 +v -9.342898369 -0.000000013 -3.231861830 +v -9.342898369 -0.000000013 3.241882324 +v -9.342898369 4.903903484 3.241882324 +v -9.124868393 4.903903484 -3.231861830 +v -9.124868393 4.903903484 3.241882324 +v -9.124868393 -0.000000013 3.241882324 +v -9.124868393 -0.000000013 -3.231861830 +v -9.342898369 4.903903484 -3.231861830 +v -10.522571564 5.376530647 4.996312141 +v -11.944499016 5.376530647 4.868019581 +v -10.522571564 6.424669266 3.616309643 +v -11.764372826 6.424669266 3.499822855 +v -10.522571564 6.886405945 2.539833784 +v -13.171661377 6.430963993 3.262741804 +v -12.903519630 6.891765594 2.222413063 +v -11.623864174 6.886405945 2.432556391 +v -11.459753036 7.187221527 1.186010599 +v -10.522571564 7.187221527 1.282531500 +v -12.589709282 7.192582607 1.004901886 +v -14.142993927 5.574815273 4.435072899 +v -16.842653275 6.576874256 3.338032007 +v -13.740724564 6.623157978 3.103520393 +v -13.518838882 5.382621288 4.609709740 +v -16.202087402 7.625217438 2.103313446 +v -13.430030823 7.083959579 2.075096607 +v -13.066421509 7.384777069 0.871518970 +v -15.707345963 8.086019516 1.149680018 +v -18.450126648 8.610714912 0.656888247 +v -19.308334351 7.562372684 1.751571774 +v -17.787288666 9.071516991 -0.188589811 +v -17.011562347 9.372335434 -1.178062677 +v -15.128343582 8.386837006 0.033630669 +v -14.540811539 8.473677635 -1.098863363 +v -12.697456360 7.471618652 -0.349792302 +v -12.271274567 7.279423714 -0.230548218 +v -12.326546669 7.384777546 -1.577539444 +v -10.522571564 7.274062157 -0.000019173 +v -11.292346954 7.274062157 -0.085567750 +v -11.951164246 7.192582607 -1.472508669 +v -11.125818253 7.187221527 -1.350481272 +v -10.522571564 7.187221527 -1.275847554 +v -11.637353897 6.891765594 -2.690018654 +v -11.962936401 7.083960533 -2.781116486 +v -10.522571564 6.886405945 -2.533149719 +v -10.961707115 6.886405945 -2.597026825 +v -16.224405289 9.459175110 -2.182115555 +v -18.626115799 10.376508713 -2.704424858 +v -19.570501328 10.075691223 -1.874399185 +v -20.377454758 9.614888191 -1.165164828 +v -21.422256470 8.566545486 -0.246882081 +v -23.146909714 9.572109222 -2.623607874 +v -14.657373428 9.071517944 -4.180932045 +v -15.760075569 10.075691223 -5.223401070 +v -13.993212700 8.609780312 -5.028099060 +v -14.951511383 9.613953590 -5.934051991 +v -13.141783714 7.560319424 -6.114133835 +v -12.875452042 7.624282837 -4.308912277 +v -13.371181488 8.086019516 -3.353374243 +v -12.239946365 6.574821472 -5.533876419 +v -11.651623726 6.622223377 -3.811594248 +v -11.252530098 5.572762966 -5.132627487 +v -11.024242401 5.380568027 -5.068752766 +v -10.522571564 6.425604343 -3.607479572 +v -10.821478844 6.425604343 -3.662166119 +v -10.522571564 5.378584385 -4.998468876 +v -11.368676186 6.430028915 -3.732426405 +v -13.950182915 8.386837006 -2.237324953 +v -15.433100700 9.372335434 -3.191458941 +v -17.667814255 10.463348389 -3.546681166 +v -18.845424652 11.468912125 -5.169534683 +v -16.704462051 10.376508713 -4.393375397 +v -16.659719467 11.081255913 -6.463191032 +v -17.741708755 11.382072449 -5.822793007 +v -15.733344078 10.619517326 -7.011487007 +v -16.207056046 11.416520119 -7.968554020 +v -17.204814911 11.878255844 -7.564476013 +v -16.370790482 11.411161423 -9.472515106 +v -14.545764923 9.570056915 -7.714380741 +v -14.991180420 10.369996071 -9.472515106 +v -14.927967072 10.367058754 -8.486566544 +v -13.914962769 8.564492226 -6.845079422 +v -19.943355560 11.382072449 -4.519700527 +v -18.370176315 12.179073334 -7.092521667 +v -19.558938980 12.265913010 -6.611088753 +v -17.447265625 11.887731552 -9.463213921 +v -18.704566956 12.188549042 -9.463213921 +v -20.741472244 12.179073334 -6.132178783 +v -21.906833649 11.878255844 -5.660224438 +v -21.262947083 12.188549042 -9.463213921 +v -19.987119675 12.275389671 -9.463213921 +v -21.025344849 11.081254959 -3.879302502 +v -21.949874878 10.620451927 -3.332099915 +v -22.902603149 11.417453766 -5.256952286 +v -24.191875458 10.369110107 -4.734813690 +v -22.520248413 11.887731552 -9.463213921 +v -24.985912323 10.363021851 -9.472431183 +v -23.594579697 11.426930428 -9.463213921 +v -11.921522141 5.244771004 4.691285133 +v -13.464874268 5.250683784 4.400579453 +v -13.464874268 5.389416695 4.400579453 +v -11.921522141 5.383503914 4.691285133 +v -11.944499016 5.028249741 4.868019581 +v -13.518838882 5.034162521 4.609709740 +v -10.522571564 5.028249741 4.996312141 +v -10.693440437 5.244771004 4.781946659 +v -10.693440437 5.383503914 4.781946659 +v -10.522571564 4.220901012 4.194850445 +v -10.522571564 5.074391842 2.961715221 +v -10.987136841 5.306261063 1.998843908 +v -10.987136841 4.942946434 2.845861673 +v -10.522571564 5.437706947 2.080181360 +v -11.189902306 4.981316566 1.855782747 +v -11.189902306 4.664701939 2.685906410 +v -10.987136841 4.118224621 3.998601198 +v -10.987136841 3.594882727 2.999999046 +v -10.987136841 4.015309334 2.312587738 +v -11.189902306 3.954033852 3.695902348 +v -11.189902306 4.268828392 2.458329201 +v -11.189902306 3.731305599 3.256635666 +v -10.522571564 5.674401283 1.050566673 +v -11.189902306 5.186119080 0.934212565 +v -11.189902306 4.591217518 1.684036255 +v -10.987136841 5.542956352 1.009543061 +v -10.987136841 5.611286163 -0.000002925 +v -10.522571564 5.742732048 -0.000118388 +v -11.189902306 5.247025013 0.000000297 +v -10.987136841 4.320860386 1.565007925 +v -11.189902306 4.787009716 0.849958301 +v -10.987136841 4.506307602 0.790700376 +v -11.189902306 4.860300064 0.000003708 +v -10.987136841 4.568477631 0.000006273 +v -14.080591202 5.442877769 4.228303909 +v -14.080591202 5.581610680 4.228303909 +v -14.142993927 5.226356506 4.435072899 +v -16.743244171 6.583669662 3.146288157 +v -16.743244171 6.444936752 3.146288395 +v -16.842651367 6.228415489 3.338032246 +v -16.842641830 1.554137230 3.338010311 +v -11.944499016 0.355853915 4.868019581 +v -10.522571564 0.355859280 4.194944382 +v -13.518832207 0.359884471 4.609686375 +v -13.464838028 0.115775906 4.400473118 +v -11.921388626 0.111744970 4.691383362 +v -11.921388626 0.000000567 4.691383362 +v -13.462984085 0.004034261 4.393279076 +v -10.987136841 0.000000545 3.997561693 +v -10.713544846 0.000000571 4.781278133 +v -10.713544846 0.111745164 4.781278133 +v -10.713544846 0.111750051 4.114162445 +v -10.713544846 0.000000542 4.114162445 +v -10.522571564 0.355853915 4.996312141 +v -11.189902306 0.000000532 3.698854685 +v -11.189902306 0.000000513 3.256092072 +v -10.987138748 0.000000502 2.999999285 +v -10.987138748 0.000000239 -3.000002146 +v -11.189903259 0.000000226 -3.299829006 +v -11.189903259 0.000000207 -3.729335070 +v -14.073675156 -0.000450481 4.214264393 +v -17.247392654 1.200104237 2.855069160 +v -17.247392654 1.400104165 2.855069160 +v -16.737829208 1.200104237 3.131706238 +v -17.743127823 1.600104690 2.561540604 +v -16.743198395 1.310028553 3.146185875 +v -16.221801758 1.000105262 3.387467623 +v -16.737829208 1.000105023 3.131706238 +v -16.221801758 0.800105274 3.387467623 +v -15.696773529 0.800104618 3.623860836 +v -14.142986298 0.552077711 4.435049057 +v -14.073494911 0.200105667 4.214318752 +v -14.619277954 0.400105536 4.038478851 +v -14.080564499 0.307969123 4.228194237 +v -15.696773529 0.600105345 3.623860836 +v -15.159379005 0.600104690 3.842149973 +v -15.159379005 0.400105536 3.842149973 +v -14.619277954 0.200104803 4.038478851 +v -11.522525787 0.199350193 -4.998117447 +v -11.522524834 0.399350166 -4.998117447 +v -11.312547684 -0.000552034 -4.930464745 +v -11.313628197 0.197789952 -4.928623199 +v -11.077886581 0.004034458 -4.860519409 +v -11.730351448 0.599349976 -5.073661804 +v -11.730351448 0.399350077 -5.073661804 +v -10.522571564 5.674401283 -1.044509530 +v -11.189902306 5.204754829 -0.932175219 +v -10.987136841 5.542956352 -1.003501534 +v -11.189902306 5.018983364 -1.866387129 +v -11.189902306 4.797083855 -0.846197724 +v -11.189902306 4.591829300 -1.678419709 +v -10.522571564 5.437706947 -2.074124336 +v -10.987136841 5.306261063 -1.992802382 +v -10.987136841 4.506307602 -0.784873307 +v -10.987136841 4.015309334 -2.306760550 +v -10.987136841 4.320860386 -1.559180737 +v -11.189902306 4.279667377 -2.478732586 +v -11.189902306 4.680350304 -2.687409163 +v -12.338356018 1.198818803 -5.345024109 +v -12.533795357 1.199349403 -5.453479290 +v -12.139158249 0.999349713 -5.248617649 +v -12.337719917 0.999349594 -5.347032547 +v -12.724548340 1.399349451 -5.566424370 +v -12.724548340 1.599349260 -5.566424370 +v -12.533795357 1.399349451 -5.453479290 +v -17.743127823 1.400104165 2.561540604 +v -11.937133789 0.599349856 -5.157656670 +v -11.937134743 0.799349844 -5.157656193 +v -12.139158249 0.799349785 -5.248617649 +v -19.160146713 2.200103760 1.573689103 +v -19.160099030 2.000426531 1.573725939 +v -13.269801140 1.999348879 -5.946537971 +v -19.592878342 2.200426340 1.222027302 +v -13.269801140 2.199348927 -5.946537971 +v -18.688013077 2.000103712 1.929206133 +v -18.688011169 1.800426364 1.929207444 +v -13.088128090 1.799349070 -5.809739113 +v -19.592884064 2.400103569 1.222023010 +v -13.436311722 2.199348927 -6.081855297 +v -18.234491348 1.800103784 2.245227337 +v -18.234491348 1.600103617 2.245227337 +v -12.913619041 1.599349260 -5.688138008 +v -12.913618088 1.799349189 -5.688138008 +v -13.088128090 1.999348998 -5.809739113 +v -20.024847031 2.600103378 0.844038010 +v -23.146888733 4.549372673 -2.623620272 +v -24.191854477 5.346374035 -4.734823227 +v -23.146909714 9.223649979 -2.623607874 +v -21.422256470 8.218087196 -0.246882007 +v -21.260068893 8.573341370 -0.389510125 +v -19.175127029 7.569168091 1.581561685 +v -21.260068893 8.434608459 -0.389510125 +v -19.175127029 7.430434704 1.581561685 +v -19.308334351 7.213913918 1.751571774 +v -21.422237396 3.543808699 -0.246898398 +v -19.308319092 2.539635181 1.751552343 +v -19.175062180 2.295526981 1.581469178 +v -20.024841309 2.400426388 0.844043970 +v -21.259988785 3.299700022 -0.389589429 +v -20.442436218 2.800103426 0.450453132 +v -20.870805740 2.800103188 0.014673174 +v -20.870805740 3.000103235 0.014673110 +v -20.442432404 2.600426197 0.450456142 +v -21.249750137 3.200103283 -0.401151925 +v -21.631483078 3.400102854 -0.852646232 +v -21.631483078 3.200103283 -0.852646172 +v -21.249750137 3.000103235 -0.401151925 +v -21.983184814 3.600101948 -1.301658869 +v -22.960983276 4.305263996 -2.733731031 +v -22.318733215 3.805263281 -1.764104128 +v -22.639333725 3.805263281 -2.242145777 +v -22.639333725 4.005263329 -2.242145777 +v -22.318899155 3.600747585 -1.764345169 +v -21.983184814 3.400102139 -1.301658869 +v -14.730253220 9.577030182 -7.605214596 +v -15.126667023 10.235299110 -8.406121254 +v -14.730253220 9.438297272 -7.605214596 +v -15.126667023 10.374031067 -8.406121254 +v -14.545764923 9.171813011 -7.714380741 +v -14.075992584 8.571465492 -6.703580856 +v -14.075993538 8.432733536 -6.703579426 +v -13.914962769 8.166248322 -6.845079422 +v -17.301195145 9.664704323 -8.797198296 +v -16.291198730 8.954035759 -8.797198296 +v -17.141239166 9.942949295 -8.999963760 +v -15.988500595 9.118226051 -8.999963760 +v -17.025384903 10.074394226 -9.464529037 +v -15.792250633 9.220903397 -9.464529037 +v -14.927967072 9.968814850 -8.486566544 +v -15.205154419 10.369996071 -9.301646233 +v -15.205154419 10.231264114 -9.301646233 +v -14.990788460 9.978288651 -9.464529037 +v -12.338684082 6.581794739 -5.343604088 +v -13.274061203 7.567292213 -5.945445061 +v -12.338685989 6.443062305 -5.343603611 +v -13.141783714 7.162075520 -6.114133835 +v -12.239946365 6.176578522 -5.533876419 +v -13.274061203 7.428560257 -5.945445061 +v -11.314546585 5.579736233 -4.927428246 +v -14.545763016 4.500739098 -7.714381695 +v -14.990787506 5.307215691 -9.463213921 +v -15.792155266 5.357183456 -9.463213921 +v -13.914960861 3.495175600 -6.845081329 +v -14.927965164 5.297739983 -8.486567497 +v -16.730466843 8.731307983 -8.797198296 +v -16.987102509 8.594884872 -8.999963760 +v -16.987100601 4.999999523 -8.998647690 +v -15.989538193 4.999999523 -8.998647690 +v -16.731008530 4.999999523 -8.795883179 +v -16.288244247 4.999999523 -8.795883179 +v -10.522571564 5.075127602 -2.953901052 +v -10.987136841 4.943681717 -2.838132381 +v -10.522571564 4.222517490 -4.197426319 +v -11.189902306 3.977253675 -3.729803801 +v -10.987136841 4.119840622 -4.004019737 +v -10.522571564 5.030126095 -4.998468876 +v -11.077722549 5.387540817 -4.861165047 +v -10.693440437 5.385379791 -4.782487869 +v -11.077723503 5.248808861 -4.861164570 +v -10.693440437 5.246647835 -4.782487869 +v -11.024242401 5.032286644 -5.068752766 +v -11.252530098 5.174519539 -5.132627487 +v -11.314546585 5.441003799 -4.927427292 +v -12.239945412 1.505504131 -5.533878326 +v -13.141781807 2.491002083 -6.114135265 +v -15.032476425 4.604507923 -8.194774628 +v -14.938087463 4.604507923 -7.995305538 +v -15.032476425 4.804508209 -8.194774628 +v -14.730827332 4.306592941 -7.604877949 +v -15.120501518 4.804507256 -8.400219917 +v -15.120501518 5.004507065 -8.400219917 +v -15.127285004 5.103593826 -8.405874252 +v -15.205821991 5.113069534 -9.272240639 +v -15.205821991 4.999999523 -9.272240639 +v -15.872937202 5.113074780 -9.272240639 +v -11.189902306 3.751090527 -3.299464226 +v -10.987136841 3.594882727 -3.000002384 +v -11.252530098 0.503444910 -5.132629395 +v -13.274473190 2.296855927 -5.944923878 +v -12.338994026 1.311358094 -5.343014717 +v -14.076495171 3.301029444 -6.703143120 +v -14.485184669 3.804508448 -7.230883598 +v -14.608549118 3.804508448 -7.414827347 +v -14.608549118 4.004508495 -7.414827347 +v -14.485260963 3.599347115 -7.230987549 +v -14.356073380 3.599347115 -7.052937508 +v -14.356073380 3.399347782 -7.052937508 +v -14.220742226 3.399347782 -6.880163670 +v -14.725962639 4.204507828 -7.604827881 +v -14.835721016 4.404508591 -7.798212051 +v -14.938087463 4.404508591 -7.995305538 +v -14.835721970 4.204507828 -7.798211575 +v -14.725962639 4.004508495 -7.604827881 +v -10.987138748 0.000000195 -4.002827168 +v -11.024241447 0.361212969 -5.068754196 +v -10.522571564 0.355848223 -4.998444557 +v -10.522571564 0.355847448 -4.197664261 +v -10.713545799 0.000000153 -4.782374859 +v -10.713545799 0.111738972 -4.117465496 +v -10.713545799 0.000000182 -4.117465496 +v -10.713545799 0.111739635 -4.782374859 +v -11.077886581 0.117104389 -4.860519409 +v -11.314742088 0.309298813 -4.926791668 +v -13.436311722 2.399348736 -6.081855297 +v -13.602527618 2.599348783 -6.227298737 +v -13.763211250 2.599348783 -6.378746033 +v -13.763211250 2.799348593 -6.378746033 +v -13.602527618 2.399348736 -6.227298737 +v -14.220742226 3.199348211 -6.880163670 +v -14.073856354 3.199347496 -6.706433773 +v -14.073856354 2.999348164 -6.706433773 +v -13.928043365 2.999348402 -6.546429634 +v -13.928043365 2.799348593 -6.546429634 +v -15.872937202 4.999999523 -9.272240639 +v -18.131317139 9.981318474 -8.797198296 +v -17.988256454 10.306262970 -8.999963760 +v -17.906917572 10.437708855 -9.464529037 +v -19.052888870 10.186120033 -8.797198296 +v -18.977558136 10.542957306 -8.999963760 +v -18.303064346 9.591218948 -8.797198296 +v -19.137142181 9.787012100 -8.797198296 +v -18.936534882 10.674402237 -9.464529037 +v -17.528772354 9.268830299 -8.797198296 +v -17.674510956 9.016634941 -8.998647690 +v -17.674514771 9.015310287 -10.000000954 +v -16.987102509 8.594883919 -10.000000954 +v -18.422090530 9.322186470 -8.998647690 +v -19.196399689 9.506309509 -8.999963760 +v -19.196399689 9.506309509 -10.000000954 +v -18.422092438 9.320861816 -10.000000954 +v -19.987100601 10.247028351 -8.797198296 +v -19.987104416 10.611288071 -8.999963760 +v -19.987218857 10.742734909 -9.464529991 +v -20.919277191 10.204757690 -8.797198296 +v -20.990602493 10.542957306 -8.999963760 +v -21.031610489 10.674402237 -9.464529991 +v -19.987096786 9.860301971 -8.797198296 +v -19.987094879 9.568479538 -8.999963760 +v -19.987094879 9.568479538 -10.000000954 +v -20.833299637 9.797085762 -8.797198296 +v -20.771974564 9.506309509 -8.999963760 +v -20.771974564 9.506309509 -10.000000954 +v -22.961076736 9.440172195 -2.733668089 +v -22.961076736 9.578904152 -2.733668089 +v -23.991712570 10.375905991 -4.815942287 +v -23.991712570 10.237173080 -4.815942287 +v -24.191875458 10.020651817 -4.734813690 +v -22.061225891 10.437708855 -9.464529037 +v -22.825233459 9.943684578 -8.999963760 +v -21.979904175 10.306262970 -8.999963760 +v -22.941001892 10.075129509 -9.464529037 +v -24.184528351 9.222518921 -9.464529037 +v -23.716903687 8.977254868 -8.797198296 +v -22.674510956 9.680353165 -8.797198296 +v -23.991121292 9.119842529 -8.999963760 +v -22.465831757 9.279668808 -8.797198296 +v -23.286565781 8.751092911 -8.797198296 +v -22.293861389 9.015311241 -8.999963760 +v -22.987102509 8.594884872 -8.999963760 +v -22.987102509 8.594883919 -10.000000954 +v -21.665519714 9.591831207 -8.797198296 +v -21.546281815 9.320861816 -8.999963760 +v -21.546281815 9.320861816 -10.000000954 +v -21.853488922 10.018985748 -8.797198296 +v -22.293861389 9.015310287 -10.000000954 +v -24.985912323 10.014828682 -9.472431183 +v -24.769596100 10.370082855 -9.301564217 +v -24.769596100 10.231350899 -9.301564217 +v -24.985546112 5.355849743 -9.464529037 +v -22.944475174 4.205263615 -2.735925198 +v -22.944475174 4.005263329 -2.735925198 +v -23.230068207 4.204940796 -3.239145756 +v -23.229717255 4.405263901 -3.238497257 +v -23.969812393 5.005263329 -4.803016186 +v -23.741117477 4.604940891 -4.269253254 +v -23.969812393 4.805263042 -4.803016186 +v -23.741048813 4.805263042 -4.269100666 +v -23.495750427 4.605263710 -3.750710487 +v -23.496076584 4.404941082 -3.751371861 +v -23.991611481 5.102264881 -4.815990448 +v -23.286930084 4.999999523 -8.797198296 +v -23.716436386 4.999999523 -8.797197342 +v -23.989929199 4.999999523 -8.999961853 +v -24.769477844 4.986489296 -9.281723022 +v -22.987102509 4.999999523 -8.999961853 +v -16.987102509 4.999999523 -10.000000000 +v -22.987102509 4.999999523 -10.000000000 +v -24.184766769 5.355849266 -9.464529037 +v -24.769477844 5.111741543 -9.273554802 +v -24.104564667 5.111741066 -9.273554802 +v -24.104564667 4.999999523 -9.273554802 +v -25.015216827 10.370100975 -10.486470222 +v -24.881961823 10.370100975 -11.907939911 +v -23.635223389 11.418239594 -10.481653214 +v -23.514402390 11.418239594 -11.723038673 +v -22.558753967 11.879976273 -10.477895737 +v -23.272411346 11.424533844 -13.129491806 +v -22.233024597 11.885335922 -12.857720375 +v -22.447633743 11.879976273 -11.578805923 +v -21.201667786 12.180791855 -11.410345078 +v -21.301460266 12.180791855 -10.473506927 +v -21.016616821 12.186153412 -12.539662361 +v -24.441345215 10.568386078 -14.104910851 +v -23.334888458 11.570444107 -16.800724030 +v -23.111204147 11.616727829 -13.697996140 +v -24.618160248 10.376192093 -13.481369019 +v -22.102413177 12.618787766 -16.155851364 +v -22.083871841 12.077529907 -13.383714676 +v -20.881570816 12.378347397 -13.015907288 +v -21.150512695 13.079589844 -15.657785416 +v -20.648149490 13.604285240 -18.398828506 +v -21.739830017 12.555942535 -19.260852814 +v -19.804990768 14.065087318 -17.733043671 +v -18.818231583 14.365905762 -16.953866959 +v -20.036491394 13.380407333 -15.074891090 +v -18.906053543 13.467247963 -14.483409882 +v -19.661554337 12.465188980 -12.642681122 +v -19.782285690 12.272994041 -12.216917038 +v -18.435110092 12.378347397 -12.267487526 +v -20.018917084 12.267632484 -10.469030380 +v -19.930683136 12.267632484 -11.238502502 +v -18.541450500 12.186153412 -11.892474174 +v -18.666357040 12.180791855 -11.067559242 +v -18.743097305 12.180791855 -10.464576721 +v -17.325042725 11.885335922 -11.574416161 +v -17.232809067 12.077530861 -11.899678230 +v -17.485801697 11.879976273 -10.460188866 +v -17.420392990 11.879976273 -10.899098396 +v -17.816932678 14.452745438 -16.163211823 +v -17.286243439 15.370079041 -18.563083649 +v -18.112966537 15.069261551 -19.510362625 +v -18.819381714 14.608458519 -20.319784164 +v -19.734010696 13.560115814 -21.367786407 +v -17.351280212 14.565679550 -23.084133148 +v -15.823597908 14.065088272 -14.589212418 +v -14.777286530 15.069261551 -15.688269615 +v -14.978754044 13.603350639 -13.922099113 +v -14.069461823 14.607523918 -14.877229691 +v -13.895698547 12.553890228 -13.066884995 +v -15.701837540 12.617853165 -12.806856155 +v -16.655639648 13.079589844 -13.305916786 +v -14.479099274 11.568391800 -12.167078018 +v -16.203424454 11.615793228 -11.584771156 +v -14.883792877 10.566333771 -11.181069374 +v -14.948463440 10.374137878 -10.953004837 +v -16.411479950 11.419174194 -10.456439018 +v -16.355749130 11.419174194 -10.755152702 +v -15.020498276 10.372154236 -10.451583862 +v -16.283580780 11.423599243 -11.302101135 +v -17.769660950 13.380407333 -13.888811111 +v -16.810358047 14.365905762 -15.368389130 +v -16.447336197 15.456918716 -17.601848602 +v -14.820383072 16.462482452 -18.773788452 +v -15.604010582 15.370079041 -16.635547638 +v -13.534363747 16.074825287 -16.583580017 +v -14.170981407 16.375642776 -17.667797089 +v -12.989304543 15.613087654 -15.655296326 +v -12.030590057 16.410091400 -16.125663757 +v -12.431182861 16.871826172 -17.124828339 +v -10.526067734 16.404731750 -16.284149170 +v -12.290560722 14.563627243 -14.465271950 +v -10.530882835 15.363566399 -14.904547691 +v -11.517045021 15.360629082 -14.844776154 +v -13.162057877 13.558062553 -13.837507248 +v -15.466381073 16.375642776 -19.873981476 +v -12.899066925 17.172643661 -18.291830063 +v -13.376347542 17.259483337 -19.482267380 +v -10.531611443 16.881301880 -17.360651016 +v -10.527222633 17.182119370 -18.617944717 +v -13.851127625 17.172643661 -20.666463852 +v -14.319011688 16.871826172 -21.833465576 +v -10.518292427 17.182119370 -21.176307678 +v -10.522746086 17.268959045 -19.900487900 +v -16.102998734 16.074825287 -20.958198547 +v -16.646970749 15.614022255 -21.884632111 +v -14.718805313 16.411024094 -22.830635071 +v -15.236440659 15.362680435 -24.121723175 +v -10.513904572 16.881301880 -22.433601379 +v -10.496080399 15.356592178 -24.899217606 +v -10.510154724 16.420501709 -23.507926941 +v -24.705308914 10.238341331 -11.884346008 +v -24.409217834 10.244254112 -13.426673889 +v -24.409217834 10.382987022 -13.426673889 +v -24.705308914 10.377074242 -11.884346008 +v -24.881961823 10.021820068 -11.907939911 +v -24.618160248 10.027732849 -13.481369019 +v -25.015216827 10.021820068 -10.486470222 +v -24.800256729 10.238341331 -10.656588554 +v -24.800256729 10.377074242 -10.656588554 +v -24.213760376 9.214471817 -10.483672142 +v -22.980632782 10.067962646 -10.479368210 +v -22.016145706 10.299831390 -10.940568924 +v -22.863159180 9.936516762 -10.943525314 +v -22.099105835 10.431277275 -10.476290703 +v -21.872377396 9.974886894 -11.142833710 +v -22.702497482 9.658271790 -11.145730972 +v -24.015892029 9.111795425 -10.947548866 +v -23.017295837 8.588453293 -10.944063187 +v -22.329887390 9.008879662 -10.941663742 +v -22.333377838 9.008878708 -9.941633224 +v -23.712486267 8.947604179 -11.149256706 +v -23.020786285 8.588453293 -9.944032669 +v -22.474920273 9.262398720 -11.144936562 +v -23.273221970 8.724876404 -11.147723198 +v -21.069496155 10.667971611 -10.472697258 +v -20.950813293 10.179689407 -11.139616966 +v -21.700632095 9.584787369 -11.142234802 +v -21.026851654 10.536526680 -10.937115669 +v -20.017311096 10.604856491 -10.933591843 +v -20.018817902 10.736302376 -10.469030380 +v -20.016607285 10.240594864 -11.136356354 +v -21.582313538 9.314430237 -10.939054489 +v -21.585803986 9.314430237 -9.939023972 +v -20.866559982 9.780580521 -11.139323235 +v -20.811500549 9.499877930 -9.936321259 +v -20.808010101 9.499877930 -10.936351776 +v -20.016611099 9.853870392 -11.136356354 +v -20.017320633 9.562047958 -10.933591843 +v -20.020811081 9.562047958 -9.933561325 +v -24.234794617 10.436448097 -14.041786194 +v -24.234794617 10.575181007 -14.041786194 +v -24.441345215 10.219926834 -14.104910851 +v -23.143491745 11.577239990 -16.700647354 +v -23.143491745 11.438507080 -16.700645447 +v -23.334888458 11.221985817 -16.800722122 +v -23.334865570 6.547707558 -16.800710678 +v -24.881961823 5.349424362 -11.907939911 +v -24.213853836 5.349429607 -10.483672142 +v -24.618135452 5.353454590 -13.481361389 +v -24.409112930 5.109346390 -13.426637650 +v -24.705408096 5.105315208 -11.884212494 +v -24.705408096 4.993570805 -11.884212494 +v -24.401924133 4.997604370 -13.424758911 +v -24.014850616 4.993570805 -10.947545052 +v -24.799518585 4.993570805 -10.676690102 +v -24.799518585 5.105315685 -10.676690102 +v -24.132406235 5.105320454 -10.674362183 +v -24.132406235 4.993570805 -10.674362183 +v -25.015216827 5.349424362 -10.486470222 +v -23.715438843 4.993570805 -11.149267197 +v -23.272678375 4.993570805 -11.147721291 +v -23.017295837 4.993570805 -10.944065094 +v -23.020786285 4.993570805 -9.944033623 +v -17.017330170 4.993570805 -10.923122406 +v -16.716798782 4.993570328 -11.124839783 +v -17.020822525 4.993570805 -9.923090935 +v -16.287294388 4.993570328 -11.123340607 +v -24.220779419 4.993119717 -14.034821510 +v -22.850515366 6.193674564 -17.203773499 +v -22.850515366 6.393674374 -17.203773499 +v -23.128929138 6.193674564 -16.695180893 +v -22.555257797 6.593675137 -17.698482513 +v -23.143390656 6.303598881 -16.700599670 +v -23.386489868 5.993675709 -16.180047989 +v -23.128929138 5.993675232 -16.695180893 +v -23.386489868 5.793675423 -16.180047989 +v -23.624713898 5.793674946 -15.655849457 +v -24.441320419 5.545648098 -14.104903221 +v -24.220834732 5.193675995 -14.034641266 +v -24.043090820 5.393675804 -14.579807281 +v -24.234685898 5.301539421 -14.041759491 +v -23.624713898 5.593675613 -15.655849457 +v -23.844877243 5.593675137 -15.119219780 +v -23.844877243 5.393675804 -15.119219780 +v -24.043090820 5.193675041 -14.579807281 +v -15.017359734 5.192920685 -11.451532364 +v -15.017359734 5.392920494 -11.451531410 +v -15.085744858 4.993018150 -11.241790771 +v -15.087582588 5.191360474 -11.242877960 +v -15.156508446 4.997604847 -11.007375717 +v -14.941089630 5.592920303 -11.659092903 +v -14.941089630 5.392920494 -11.659092903 +v -18.974433899 10.667971611 -10.465384483 +v -19.084438324 10.198325157 -11.133102417 +v -19.013818741 10.536526680 -10.930088997 +v -18.150232315 10.012554169 -11.129841805 +v -19.170413971 9.790654182 -11.133402824 +v -18.338197708 9.585399628 -11.130497932 +v -17.944824219 10.431277275 -10.461791039 +v -18.024524689 10.299831390 -10.926635742 +v -19.235937119 9.499877930 -9.930821419 +v -19.232446671 9.499877930 -10.930851936 +v -18.461633682 9.314430237 -9.928118706 +v -17.710567474 9.008879662 -10.925539970 +v -18.458143234 9.314430237 -10.928149223 +v -17.537889481 9.273237228 -11.127704620 +v -17.329214096 9.673920631 -11.126976013 +v -17.714057922 9.008878708 -9.925509453 +v -14.667607307 6.192389011 -12.266146660 +v -14.558470726 6.192919731 -12.461206436 +v -14.764708519 5.992919922 -12.067286491 +v -14.665601730 5.992919922 -12.265502930 +v -14.444860458 6.392919540 -12.651563644 +v -14.444860458 6.592919350 -12.651563644 +v -14.558470726 6.392919540 -12.461206436 +v -22.555257797 6.393674374 -17.698482513 +v -14.856374741 5.592920303 -11.865580559 +v -14.856374741 5.792920113 -11.865581512 +v -14.764708519 5.792920113 -12.067286491 +v -21.562465668 7.193674088 -19.112043381 +v -21.562503815 6.993996620 -19.111997604 +v -14.062846184 6.992918968 -13.195486069 +v -21.209297180 7.193996429 -19.543546677 +v -14.062846184 7.192919254 -13.195486069 +v -21.919630051 6.993674278 -18.641155243 +v -21.919630051 6.793996811 -18.641153336 +v -14.200278282 6.792919159 -13.014291763 +v -21.209291458 7.393673897 -19.543550491 +v -13.926948547 7.192919254 -13.361523628 +v -22.237232208 6.793673992 -18.188739777 +v -22.237232208 6.593673706 -18.188739777 +v -14.322487831 6.592919350 -12.840208054 +v -14.322487831 6.792919636 -12.840208054 +v -14.200278282 6.992919445 -13.014291763 +v -20.829801559 7.593673706 -19.974193573 +v -17.351268768 9.542943001 -23.084110260 +v -15.236431122 10.339944839 -24.121700287 +v -17.351280212 14.217220306 -23.084133148 +v -19.734010696 13.211657524 -21.367786407 +v -19.591949463 13.566911697 -21.205101013 +v -21.570287704 12.562738419 -19.127052307 +v -19.591949463 13.428178787 -21.205101013 +v -21.570287704 12.424005508 -19.127052307 +v -21.739830017 12.207484245 -19.260852814 +v -19.733995438 8.537379265 -21.367767334 +v -21.739810944 7.533205509 -19.260837555 +v -21.570194244 7.289097309 -19.126987457 +v -20.829807281 7.393996716 -19.974185944 +v -19.591871262 8.293270111 -21.205020905 +v -20.434761047 7.793673515 -20.390405655 +v -19.997489929 7.793673515 -20.817251205 +v -19.997489929 7.993673325 -20.817251205 +v -20.434764862 7.593996525 -20.390401840 +v -19.580345154 8.193674088 -21.194742203 +v -19.127519608 8.393672943 -21.574895859 +v -19.127519608 8.193674088 -21.574895859 +v -19.580345154 7.993673325 -21.194742203 +v -18.677282333 8.593671799 -21.925027847 +v -17.241806030 9.298833847 -22.897821426 +v -18.213668823 8.798833847 -22.258960724 +v -17.734512329 8.798833847 -22.577890396 +v -17.734512329 8.998833656 -22.577890396 +v -18.213428497 8.594318390 -22.259124756 +v -18.677282333 8.393672943 -21.925027847 +v -12.399082184 14.570600510 -14.650138855 +v -11.596796989 15.228869438 -15.043756485 +v -12.399082184 14.431867599 -14.650139809 +v -11.596796989 15.367601395 -15.043754578 +v -12.290560722 14.165383339 -14.465271950 +v -13.302993774 13.565035820 -13.999031067 +v -13.302995682 13.426303864 -13.999031067 +v -13.162057877 13.159818649 -13.837507248 +v -11.198131561 14.658274651 -17.216905594 +v -11.201657295 13.947606087 -16.206914902 +v -10.995925903 14.936519623 -17.056241989 +v -10.999949455 14.111796379 -15.903511047 +v -10.531768799 15.067964554 -16.938766479 +v -10.536072731 14.214473724 -15.705640793 +v -11.517045021 14.962385178 -14.844776154 +v -10.701003075 15.363566399 -15.119117737 +v -10.701003075 15.224834442 -15.119117737 +v -10.538870811 14.971858978 -14.904184341 +v -14.669025421 11.575365067 -12.266479492 +v -14.063923836 12.560862541 -13.199748993 +v -14.669026375 11.436632156 -12.266481400 +v -13.895698547 12.155645370 -13.066884995 +v -14.479099274 11.170148849 -12.167078018 +v -14.063923836 12.422130585 -13.199749947 +v -15.088773727 10.573307037 -11.243801117 +v -12.290559769 9.494309425 -14.465270042 +v -10.540185928 10.300786018 -14.904186249 +v -10.537387848 10.350753784 -15.705550194 +v -13.162055969 8.488745689 -13.837506294 +v -11.517044067 10.291310310 -14.844774246 +v -11.200123787 13.724878311 -16.646181107 +v -10.996463776 13.588455200 -16.902107239 +v -10.997779846 9.993570328 -16.902109146 +v -11.001261711 9.993570328 -15.904552460 +v -11.201436996 9.993570328 -16.646726608 +v -11.202982903 9.993570328 -16.203966141 +v -17.065053940 10.068697929 -10.458720207 +v -17.179199219 9.937252045 -10.923685074 +v -15.821536064 9.216087341 -10.454379082 +v -16.286827087 8.970824242 -11.123337746 +v -16.013319016 9.113410950 -10.919615746 +v -15.020498276 10.023696899 -10.451583862 +v -15.155863762 10.381111145 -11.007209778 +v -15.235881805 10.378950119 -10.623204231 +v -15.155864716 10.242379189 -11.007210732 +v -15.235881805 10.240218163 -10.623204231 +v -14.948463440 10.025856972 -10.953004837 +v -14.883792877 10.168089867 -11.181069374 +v -15.088775635 10.434574127 -11.243801117 +v -14.479097366 6.499074459 -12.167078018 +v -13.895696640 7.484572411 -13.066883087 +v -11.808470726 9.598077774 -14.950302124 +v -12.008268356 9.598077774 -14.856611252 +v -11.808470726 9.798078537 -14.950302124 +v -12.399416924 9.300163269 -14.650714874 +v -11.602720261 9.798077583 -15.037611008 +v -11.602720261 9.998077393 -15.037611008 +v -11.597042084 10.097164154 -15.044374466 +v -10.730405807 10.106639862 -15.119886398 +v -10.730405807 9.993570328 -15.119886398 +v -10.728077888 10.106645584 -15.786997795 +v -16.717163086 8.744661331 -11.124839783 +v -17.017330170 8.588453293 -10.923120499 +v -17.020820618 8.588453293 -9.923089981 +v -14.883790970 5.497014999 -11.181069374 +v -14.064443588 7.290426254 -13.200163841 +v -14.669614792 6.304928303 -12.266791344 +v -13.303430557 8.294599533 -13.999534607 +v -12.774266243 8.798078537 -14.406379700 +v -12.589893341 8.798078537 -14.529100418 +v -12.589893341 8.998079300 -14.529100418 +v -12.774162292 8.592917442 -14.406455994 +v -12.952661514 8.592917442 -14.277889252 +v -12.952661514 8.392917633 -14.277889252 +v -13.125906944 8.392917633 -14.143162727 +v -12.399484634 9.198078156 -14.645851135 +v -12.205717087 9.398078918 -14.754933357 +v -12.008268356 9.398078918 -14.856611252 +v -12.205718040 9.198078156 -14.754934311 +v -12.399484634 8.998079300 -14.645851135 +v -16.014513016 4.993570328 -10.919622421 +v -14.948462486 5.354783058 -10.953003883 +v -15.020523071 5.349418640 -10.451583862 +v -15.821298599 5.349417686 -10.454379082 +v -15.235923767 4.993570328 -10.643310547 +v -15.900829315 5.105309486 -10.645630836 +v -15.900829315 4.993570328 -10.645630836 +v -15.235923767 5.105309963 -10.643310547 +v -15.156508446 5.110674858 -11.007375717 +v -15.089410782 5.302869320 -11.243998528 +v -13.926948547 7.392919064 -13.361523628 +v -13.780925751 7.592919350 -13.527230263 +v -13.628918648 7.592919350 -13.687385559 +v -13.628918648 7.792919159 -13.687385559 +v -13.780925751 7.392919064 -13.527230263 +v -13.125906944 8.192918777 -14.143162727 +v -13.300148010 8.192917824 -13.996884346 +v -13.300148010 7.992918491 -13.996884346 +v -13.460660934 7.992918968 -13.851630211 +v -13.460660934 7.792919159 -13.851630211 +v -10.728077888 9.993570328 -15.786997795 +v -11.195234299 14.974888802 -18.047021866 +v -10.992969513 15.299833298 -17.903255463 +v -10.528691292 15.431279182 -17.820295334 +v -11.192017555 15.179690361 -18.968587875 +v -10.989516258 15.536527634 -18.892549515 +v -11.194635391 14.584789276 -18.218769073 +v -11.191723824 14.780582428 -19.052841187 +v -10.525097847 15.667972565 -18.849905014 +v -11.197337151 14.262400627 -17.444480896 +v -10.995380402 14.010205269 -17.589515686 +v -9.994033813 14.008880615 -17.586023331 +v -9.996433258 13.588454247 -16.898616791 +v -10.992771149 14.315756798 -18.337091446 +v -10.988752365 14.499879837 -19.111391068 +v -9.988721848 14.499879837 -19.107900620 +v -9.991424561 14.314432144 -18.333597183 +v -11.188756943 15.240598679 -19.902793884 +v -10.985992432 15.604858398 -19.902090073 +v -10.521430016 15.736305237 -19.900583267 +v -11.185503006 15.198328018 -20.834964752 +v -10.982489586 15.536527634 -20.905582428 +v -10.517784119 15.667972565 -20.944969177 +v -11.188756943 14.853872299 -19.902790070 +v -10.985992432 14.562049866 -19.902080536 +v -9.985961914 14.562049866 -19.898590088 +v -11.185803413 14.790656090 -20.748987198 +v -10.983252525 14.499879837 -20.686954498 +v -9.983222008 14.499879837 -20.683464050 +v -17.241868973 14.433742523 -22.897914886 +v -17.241868973 14.572474480 -22.897914886 +v -15.156010628 15.369476318 -23.921278000 +v -15.156010628 15.230743408 -23.921278000 +v -15.236440659 15.014222145 -24.121723175 +v -10.514191628 15.431279182 -21.974576950 +v -10.976085663 14.937254906 -22.740201950 +v -10.979036331 15.299833298 -21.894876480 +v -10.511120796 15.068699837 -22.854347229 +v -10.506779671 14.216089249 -24.097867966 +v -11.175738335 13.970825195 -23.632574081 +v -11.179376602 14.673923492 -22.590187073 +v -10.972016335 14.113412857 -23.906082153 +v -11.180105209 14.273239136 -22.381509781 +v -11.177240372 13.744663239 -23.202238083 +v -10.977940559 14.008881569 -22.208833694 +v -10.975521088 13.588455200 -22.902070999 +v -9.975490570 13.588454247 -22.898580551 +v -11.182898521 14.585401535 -21.581203461 +v -10.980549812 14.314432144 -21.461257935 +v -9.980519295 14.314432144 -21.457767487 +v -11.182242393 15.012556076 -21.769170761 +v -9.977910042 14.008880615 -22.205343246 +v -10.496080399 15.008399010 -24.899217606 +v -10.667700768 15.363653183 -24.683498383 +v -10.667700768 15.224921227 -24.683498383 +v -10.503984451 10.349420547 -24.898880005 +v -17.239669800 9.198833466 -22.881307602 +v -17.239669800 8.998833656 -22.881307602 +v -16.735456467 9.198511124 -23.165142059 +v -16.736104965 9.398834229 -23.164793015 +v -15.169013023 9.998833656 -23.899423599 +v -15.703571320 9.598510742 -23.672592163 +v -15.169013023 9.798833847 -23.899423599 +v -15.703723907 9.798833847 -23.672523499 +v -16.222967148 9.598834038 -23.429035187 +v -16.222305298 9.398511887 -23.429361343 +v -15.155962944 10.095834732 -23.921176910 +v -11.177239418 9.993570328 -23.202602386 +v -11.175741196 9.993570328 -23.632106781 +v -10.972023010 9.993570328 -23.904890060 +v -10.687541962 9.980059624 -24.683450699 +v -10.975522995 9.993570328 -22.902070999 +v -9.996434212 9.993570328 -16.898616791 +v -9.975491524 9.993570328 -22.898578644 +v -10.506779671 10.349419594 -24.098104477 +v -10.695711136 10.105312347 -24.683479309 +v -10.698031425 10.105311394 -24.018569946 +v -10.698031425 9.993570328 -24.018569946 +v 18.151639938 16.422849655 -39.982330322 +v 20.731946945 15.374711037 -40.315002441 +v 18.820676804 15.374711037 -38.775352478 +v 19.747991562 16.422849655 -41.182910919 +v 17.629753113 16.884586334 -40.923835754 +v 18.982986450 16.884586334 -41.973312378 +v 17.020200729 17.185401917 -42.023498535 +v 18.176250458 17.185401917 -42.818588257 +v 22.158515930 16.422847748 -44.359470367 +v 19.015058517 17.272243500 -45.918804169 +v 20.193902969 17.185401917 -45.329006195 +v 21.180492401 16.884586334 -44.811431885 +v 23.330167770 15.374711037 -43.793838501 +v 22.288990021 16.884586334 -48.230606079 +v 23.356256485 16.422849655 -48.090103149 +v 24.724452972 15.374711037 -47.909973145 +v 21.132287979 17.185401917 -49.331924438 +v 22.389589310 16.884586334 -49.331924438 +v 23.463920593 16.423784256 -49.331924438 +v 24.854907990 15.376764297 -49.331924438 +v 21.042442322 17.185401917 -48.394718170 +v 18.505952835 17.185401917 -48.728652954 +v 19.770866394 17.272243500 -48.562126160 +v 19.856460571 17.272243500 -49.331924438 +v 18.573909760 17.185401917 -49.331924438 +v 17.286430359 17.272243500 -43.806549072 +v 16.426416397 17.185401917 -44.773418427 +v 17.777982712 17.185401917 -46.515922546 +v 16.398406982 17.272243500 -43.145240784 +v 16.772066116 16.884586334 -47.060039520 +v 17.259407043 16.884586334 -48.892765045 +v 15.817419052 16.423784256 -47.575325012 +v 15.601982117 16.884586334 -45.628391266 +v 16.194267273 16.423784256 -49.032993317 +v 16.240131378 16.422849655 -49.331924438 +v 17.316606522 16.884586334 -49.331924438 +v 14.912005424 16.423784256 -46.542243958 +v 13.975111961 15.376764297 -47.516983032 +v 14.464689255 15.376764297 -48.408912659 +v 14.649476051 16.423784256 -46.300395966 +v 15.170322418 16.884586334 -45.360763550 +v 14.860130310 15.374711037 -49.331924438 +v 6.673092842 15.374712944 -32.725341797 +v 17.220638275 16.422851563 -39.476814270 +v 17.890140533 15.381685257 -38.270545959 +v 5.997828484 16.423786163 -33.941822052 +v 16.689041138 16.884586334 -40.382247925 +v 5.476475239 16.884588242 -34.881168365 +v 16.078891754 17.185401917 -41.481575012 +v 4.866324902 17.185403824 -35.980499268 +v 15.465692520 17.272245407 -42.638774872 +v 4.247186661 17.272245407 -37.096027374 +v 14.837350845 17.185401917 -43.718509674 +v 15.779872894 17.185401917 -44.261104584 +v 3.624784470 17.185403824 -38.217433929 +v 14.227202415 16.884586334 -44.817840576 +v 3.014636040 16.884588242 -39.316761017 +v 13.715051651 16.423786163 -45.792980194 +v 3.933006287 17.185401917 -35.473697662 +v 3.317041874 17.185401917 -35.048015594 +v 2.558747768 17.272243500 -35.967140198 +v 4.542557240 16.884586334 -34.374034882 +v 4.134359837 16.884586334 -33.951190948 +v 3.314471245 17.272243500 -36.589561462 +v 2.492240429 16.422851563 -40.257987976 +v 13.039787292 15.374712944 -47.009456635 +v 1.822737694 15.381685257 -41.464256287 +v 1.726429939 17.185401917 -36.979194641 +v 0.669525146 17.272243500 -33.767730713 +v -0.472972870 17.185401917 -34.307502747 +v 0.819322586 16.884586334 -37.894798279 +v 2.692678452 17.185401917 -37.711303711 +v 1.841757774 17.185401917 -33.227012634 +v 3.769361496 16.423784256 -32.242866516 +v 5.248190880 15.376764297 -31.325889587 +v 4.852749825 15.374711037 -30.402873993 +v 3.518613338 16.423784256 -30.701808929 +v 2.890336990 16.884586334 -32.690055847 +v 3.472748280 16.422849655 -30.402873993 +v 2.453473568 16.884586334 -30.842037201 +v 4.828486443 16.423784256 -33.241661072 +v 5.737767696 15.376764297 -32.217819214 +v 5.063403130 16.423784256 -33.434406281 +v 2.396272659 16.884586334 -30.402873993 +v 1.206927299 17.185401917 -31.006147385 +v 1.138970375 17.185401917 -30.402873993 +v -0.057985306 17.272243500 -31.172676086 +v -0.143579483 17.272243500 -30.402873993 +v -1.329563141 17.185401917 -31.340084076 +v -1.419406891 17.185401917 -30.402873993 +v -2.576108932 16.884586334 -31.504192352 +v -1.386344910 16.884586334 -34.814693451 +v -2.676710129 16.884586334 -30.402873993 +v -3.751039505 16.423784256 -30.402873993 +v -3.643377304 16.422849655 -31.644699097 +v -5.011572838 15.374711037 -31.824825287 +v -5.142028809 15.376764297 -30.402873993 +v -2.529266357 16.422849655 -35.398258209 +v -3.617288589 15.374711037 -35.940959930 +v -1.115442276 15.374711037 -39.509117126 +v -0.062291145 16.422849655 -38.602146149 +v 1.561239243 16.422849655 -39.752471924 +v 0.892202377 15.374711037 -40.959449768 +v 2.083126068 16.884586334 -38.810966492 +v 18.820676804 15.026430130 -38.775352478 +v 18.866195679 15.242951393 -39.045677185 +v 20.609476089 15.242951393 -40.444480896 +v 18.866195679 15.381684303 -39.045677185 +v 20.609476089 15.381684303 -40.444480896 +v 18.432121277 14.219081879 -39.476325989 +v 18.284229279 14.662881851 -41.119606018 +v 18.560924530 13.729486465 -40.620433807 +v 18.173898697 14.267008781 -41.318649292 +v 17.834285736 15.072572708 -40.554851532 +v 18.743295670 14.116405487 -39.873195648 +v 18.184436798 14.941126823 -40.881404877 +v 18.773887634 13.952214241 -40.236244202 +v 18.259162903 13.593063354 -40.746593475 +v 17.406908035 15.435887337 -41.325855255 +v 17.773792267 15.304441452 -41.622222900 +v 16.470603943 15.435888290 -40.828010559 +v 15.970950127 15.672584534 -41.728263855 +v 15.549583435 15.541138649 -41.530700684 +v 16.083345413 14.277850151 -40.150325775 +v 16.690469742 13.975436211 -39.056442261 +v 16.184612274 14.678532600 -39.967868805 +v 15.694966316 14.590011597 -40.850086212 +v 15.786183357 15.017166138 -40.685733795 +v 17.000125885 14.116407394 -38.917198181 +v 16.440719604 14.941128731 -39.925106049 +v 17.890331268 15.026432037 -38.270202637 +v 17.636901855 15.381685257 -38.374713898 +v 17.636901855 15.242953300 -38.374713898 +v 17.501281738 14.220699310 -38.970996857 +v 16.897548676 15.073310852 -40.058773041 +v 17.384096146 13.593065262 -40.272407532 +v 16.515522003 13.593065262 -39.790332794 +v 16.181930542 14.013491631 -40.391376495 +v 17.881778717 14.979496956 -41.845649719 +v 17.050506592 14.013492584 -40.873451233 +v 17.925899506 14.013489723 -41.347816467 +v 16.688812256 14.319040298 -41.516834259 +v 16.481632233 13.749273300 -39.432716370 +v 15.819142342 14.319043159 -41.045024872 +v 16.029674530 15.304443359 -40.665699005 +v 15.332825661 15.202938080 -41.502567291 +v 15.443385124 14.504489899 -41.722049713 +v 15.291101456 14.795266151 -41.577743530 +v 20.731946945 15.026430130 -40.315002441 +v 20.731946945 10.354034424 -40.315002441 +v 18.775318146 9.998181343 -40.233661652 +v 18.742792130 9.998181343 -39.874103546 +v 18.820676804 10.354034424 -38.775352478 +v 16.999622345 9.998181343 -38.918109894 +v 16.690242767 9.998181343 -39.056854248 +v 18.432167053 10.354040146 -39.476242065 +v 17.501123428 10.354027748 -38.971282959 +v 17.890331268 10.354028702 -38.270202637 +v 20.609426498 9.998181343 -40.444320679 +v 18.883455276 9.998181343 -39.056011200 +v 18.560031891 9.998181343 -39.639484406 +v 18.883455276 10.109926224 -39.056011200 +v 20.609426498 10.109925270 -40.444320679 +v 18.560031891 10.109930038 -39.639484406 +v 18.259164810 9.998181343 -40.746593475 +v 18.560661316 9.998181343 -40.620910645 +v 16.515522003 9.998181343 -39.790332794 +v 17.384096146 9.998181343 -40.272407532 +v 17.295192719 10.109919548 -38.948501587 +v 17.295192719 9.998066902 -38.948501587 +v 17.619159698 10.109919548 -38.365627289 +v 17.619159698 9.998067856 -38.365627289 +v 16.481809616 9.998181343 -39.432395935 +v 13.603816986 9.998181343 -45.036472321 +v 6.109062672 9.998181343 -34.698329926 +v 6.673092842 15.026519775 -32.725341797 +v 6.717516899 15.243041992 -32.997402191 +v 6.717516899 15.381774902 -32.997402191 +v 6.672841549 10.354034424 -32.725624084 +v 6.734807014 10.109926224 -33.007129669 +v 6.627419472 9.998181343 -34.183063507 +v 6.595716476 9.998181343 -33.821502686 +v 6.734807014 9.998067856 -33.007129669 +v 6.412554264 9.998181343 -34.570194244 +v 23.172214508 15.242951393 -43.876388550 +v 23.330167770 15.026430130 -43.793838501 +v 23.172214508 15.381684303 -43.876388550 +v 23.330167770 10.354034424 -43.793838501 +v 23.172218323 10.109925270 -43.876220703 +v 23.172218323 9.998180389 -43.876220703 +v 15.382289886 9.998180389 -46.354846954 +v 24.547792435 15.242951393 -47.933521271 +v 24.724452972 15.026430130 -47.909973145 +v 24.547792435 15.381684303 -47.933521271 +v 23.586244583 13.975434303 -48.664596558 +v 22.335172653 14.277847290 -48.664596558 +v 23.155904770 13.749271393 -48.664596558 +v 24.053865433 14.220697403 -49.331924438 +v 22.694572449 14.941862106 -48.867359161 +v 23.860460281 14.118021011 -48.867359161 +v 22.543849945 14.678530693 -48.664596558 +v 22.810340881 15.073307991 -49.331924438 +v 24.638927460 15.383560181 -49.161056519 +v 24.638927460 15.244828224 -49.161056519 +v 24.854907990 15.028306961 -49.331924438 +v 21.930564880 15.435887337 -49.331924438 +v 20.900951385 15.672581673 -49.331924438 +v 22.856441498 13.593063354 -49.867401123 +v 22.856443405 13.593063354 -48.867359161 +v 22.163200378 14.013489723 -48.867359161 +v 22.163200378 14.013488770 -49.867397308 +v 21.415620804 14.319040298 -48.867359161 +v 21.415620804 14.319040298 -49.867397308 +v 21.534858704 14.590009689 -48.664596558 +v 21.722827911 15.017164230 -48.664596558 +v 20.788616180 15.202935219 -48.664596558 +v 21.849243164 15.304441452 -48.867359161 +v 20.859943390 15.541136742 -48.867359161 +v 19.856441498 15.245204926 -48.664596558 +v 19.856443405 15.609466553 -48.867359161 +v 19.856559753 15.740912437 -49.331924438 +v 20.641313553 14.504487991 -49.867401123 +v 20.641313553 14.504487991 -48.867359161 +v 20.702638626 14.795264244 -48.664596558 +v 19.856433868 14.566658020 -48.867359161 +v 19.856433868 14.566658020 -49.867397308 +v 19.856437683 14.858480453 -48.664596558 +v 19.065740585 14.504487991 -49.867397308 +v 19.065740585 14.504487991 -48.867359161 +v 19.006483078 14.785190582 -48.664596558 +v 18.922229767 15.184299469 -48.664596558 +v 23.156269073 9.998180389 -48.664596558 +v 22.856441498 9.998180389 -48.867359161 +v 16.856441498 9.998180389 -48.867359161 +v 16.600349426 9.998180389 -48.664596558 +v 16.856441498 9.998178482 -49.867397308 +v 22.856449127 9.998178482 -49.867393494 +v 24.547851563 10.109925270 -47.933364868 +v 24.547851563 9.998180389 -47.933364868 +v 24.724452972 10.354034424 -47.909973145 +v 23.585773468 9.998180389 -48.664596558 +v 23.859268188 9.998180389 -48.867359161 +v 24.854885101 10.354028702 -49.331924438 +v 24.054103851 10.354027748 -49.331924438 +v 24.638816833 10.109920502 -49.140953064 +v 24.638816833 9.998180389 -49.140953064 +v 23.973905563 10.109919548 -49.140953064 +v 23.973905563 9.998180389 -49.140953064 +v 15.350305557 9.998180389 -45.994308472 +v 15.059673309 14.566659927 -42.413398743 +v 16.311960220 14.504489899 -42.204124451 +v 15.930086136 14.566658020 -42.885616302 +v 15.549570084 14.504487991 -43.572086334 +v 14.678782463 14.504489899 -43.099658966 +v 16.804738998 14.566658020 -43.370445251 +v 17.188076019 14.504487991 -42.678886414 +v 16.907741547 15.672581673 -42.226379395 +v 17.294172287 15.541136742 -42.487483978 +v 17.434993744 15.184299469 -42.651672363 +v 16.398359299 15.740912437 -43.145328522 +v 16.804733276 15.609466553 -43.370452881 +v 16.982080460 14.858480453 -43.468750000 +v 17.394145966 14.785190582 -42.725360870 +v 16.982078552 15.245204926 -43.468750000 +v 17.798515320 14.589397430 -41.995861053 +v 17.563465118 14.319040298 -42.001663208 +v 16.571832657 14.795264244 -44.208854675 +v 16.318229675 15.541136742 -44.248130798 +v 16.530149460 15.202935219 -44.284049988 +v 15.892028809 15.672581673 -44.058773041 +v 15.392861366 15.435887337 -44.959293365 +v 16.077236176 15.017164230 -45.101131439 +v 15.838605881 15.304441452 -45.113391876 +v 15.057744980 15.609468460 -42.416015625 +v 15.464122772 15.740915298 -42.641433716 +v 14.572686195 15.541138649 -43.290817261 +v 14.954242706 15.672584534 -43.560108185 +v 14.092594147 15.304443359 -44.155822754 +v 14.454587936 15.435888290 -44.460357666 +v 14.880453110 14.858482361 -42.317623138 +v 14.880453110 15.245207787 -42.317619324 +v 14.427095413 15.184301376 -43.134456635 +v 14.467983246 14.785192490 -43.060787201 +v 14.303024292 14.319043159 -43.776679993 +v 14.063219070 14.589399338 -43.790069580 +v 15.171600342 14.319043159 -44.258758545 +v 16.424221039 14.504487991 -44.056915283 +v 14.808811188 14.013492584 -44.912406921 +v 16.048828125 14.319040298 -44.734138489 +v 16.168361664 14.590009689 -44.936729431 +v 13.682369232 14.941864014 -44.894939423 +v 13.979873657 14.979497910 -43.940235138 +v 13.577028275 14.662883759 -44.666057587 +v 13.687467575 14.267010689 -44.467075348 +v 13.940235138 14.013491631 -44.430332184 +v 13.603816032 13.593065262 -45.036472321 +v 14.966337204 15.073307991 -45.728763580 +v 15.173831940 13.975434303 -46.730911255 +v 15.780364990 14.277847290 -45.636699677 +v 15.382465363 13.749271393 -46.354526520 +v 15.686395645 14.013489723 -45.387985229 +v 15.350305557 13.593063354 -45.994308472 +v 14.863548279 14.118021011 -46.872444153 +v 15.679196358 14.678530693 -45.819213867 +v 14.363464355 14.220697403 -46.816375732 +v 15.428781509 14.941862106 -45.852733612 +v 14.475652695 13.593063354 -45.509483337 +v 17.776258469 15.435887337 -49.331924438 +v 16.894725800 15.072572708 -49.331924438 +v 18.846897125 15.541136742 -48.867359161 +v 18.805873871 15.672581673 -49.331924438 +v 17.857597351 15.304441452 -48.867359161 +v 18.000658035 14.979496956 -48.664596558 +v 18.172405243 14.589397430 -48.664596558 +v 18.291433334 14.319040298 -48.867359161 +v 18.291431427 14.319040298 -49.867397308 +v 17.398113251 14.267008781 -48.664596558 +v 16.856441498 13.593063354 -48.867359161 +v 17.543853760 14.013489723 -48.867359161 +v 17.170534134 14.662881851 -48.664596558 +v 17.543853760 14.013488770 -49.867397308 +v 15.661590576 14.219081879 -49.331924438 +v 17.010580063 14.941126823 -48.867359161 +v 15.857839584 14.116405487 -48.867359161 +v 16.160539627 13.952214241 -48.664596558 +v 16.599805832 13.729486465 -48.664596558 +v 16.856441498 13.593063354 -49.867397308 +v 13.975111961 15.028306961 -47.516983032 +v 14.229267120 15.383560181 -47.410919189 +v 14.229267120 15.244828224 -47.410919189 +v 14.711436272 15.244828224 -48.280220032 +v 14.711436272 15.383560181 -48.280220032 +v 14.464689255 15.028306961 -48.408912659 +v 14.860130310 15.026430130 -49.331924438 +v 15.074495316 15.242951393 -49.161056519 +v 15.074495316 15.381684303 -49.161056519 +v 15.661497116 10.354040146 -49.331924438 +v 14.464710236 10.354028702 -48.408901215 +v 14.860130310 10.354034424 -49.331924438 +v 13.975122452 10.354028702 -47.516960144 +v 14.472393036 9.998181343 -45.518547058 +v 14.864127159 9.998180389 -46.871398926 +v 15.174060822 9.998180389 -46.730503082 +v 14.363349915 10.354027748 -46.816581726 +v 14.569259644 10.109919548 -46.839023590 +v 14.246905327 10.109920502 -47.420566559 +v 14.569259644 9.998180389 -46.839023590 +v 14.246905327 9.998180389 -47.420566559 +v 15.858880043 9.998180389 -48.867359161 +v 16.157585144 9.998180389 -48.664596558 +v 14.709774971 10.109920502 -48.279747009 +v 14.709774971 9.998180389 -48.279747009 +v 15.742279053 10.109930038 -49.140953064 +v 15.742279053 9.998180389 -49.140953064 +v 15.075164795 10.109925270 -49.140953064 +v 15.075164795 9.998180389 -49.140953064 +v 13.039787292 15.026519775 -47.009456635 +v 12.995363235 15.381774902 -46.737400055 +v 12.995363235 15.243041992 -46.737400055 +v 13.428371429 14.219083786 -46.309329987 +v 14.026791573 15.072574615 -45.231132507 +v 13.116581917 14.118022919 -45.914340973 +v 13.086893082 13.952216148 -45.549156189 +v 13.300060272 13.729488373 -45.165081024 +v 13.300325394 9.998181343 -45.164604187 +v 3.197357178 9.998181343 -39.944465637 +v 13.085459709 9.998181343 -45.551734924 +v 3.231069088 9.998181343 -40.302406311 +v 13.428532600 10.354040146 -46.309043884 +v 13.117163658 9.998181343 -45.913299561 +v 13.040038109 10.354034424 -47.009178162 +v 13.299910545 10.109930038 -46.146965027 +v 13.299910545 9.998067856 -46.146965027 +v 12.978073120 9.998067856 -46.727668762 +v 12.978073120 10.109926224 -46.727668762 +v 4.746542931 15.073307991 -34.006038666 +v 6.284508705 14.219083786 -33.425472260 +v 5.686088085 15.072574615 -34.503669739 +v 6.030510902 14.941864014 -34.839862823 +v 5.258291245 15.435888290 -35.274444580 +v 6.596298218 14.118022919 -33.820461273 +v 5.237226486 13.593063354 -34.225318909 +v 4.904067993 14.013492584 -34.822391510 +v 6.109063148 13.593065262 -34.698329926 +v 6.625987053 13.952216148 -34.185646057 +v 6.135851860 14.662883759 -35.068740845 +v 6.025412083 14.267010689 -35.267723083 +v 6.412818909 13.729488373 -34.569721222 +v 5.772644043 14.013491631 -35.304470062 +v 2.328782558 9.998181343 -39.462390900 +v 1.152217865 9.998181343 -39.113891602 +v 4.330589294 9.998180389 -33.379955292 +v 4.362574100 9.998180389 -33.740489960 +v 5.237226486 9.998180389 -34.225318909 +v 6.284347057 10.354040146 -33.425758362 +v 5.349416256 14.220697403 -32.918426514 +v 6.412969112 9.998067856 -33.587833405 +v 6.412969112 10.109930038 -33.587833405 +v 5.001443863 15.244828224 -31.454582214 +v 5.001443863 15.383560181 -31.454582214 +v 5.483613491 15.383560181 -32.323879242 +v 5.483613491 15.244828224 -32.323879242 +v 5.737767696 15.028306961 -32.217819214 +v 5.248190880 15.028306961 -31.325889587 +v 4.852749825 15.026430130 -30.402873993 +v 4.638384819 15.242951393 -30.573743820 +v 4.638384819 15.381684303 -30.573743820 +v 4.051288605 14.219081879 -30.402873993 +v 2.818153858 15.072572708 -30.402875900 +v 2.702300072 14.941126823 -30.867439270 +v 1.936620712 15.435887337 -30.402873993 +v 1.855282784 15.304441452 -30.867439270 +v 2.542345047 14.662881851 -31.070205688 +v 1.712222099 14.979496956 -31.070205688 +v 3.855039597 14.116405487 -30.867441177 +v 3.552340508 13.952214241 -31.070205688 +v 2.856437206 13.593063354 -30.867441177 +v 2.314766884 14.267008781 -31.070205688 +v 3.113073349 13.729486465 -31.070205688 +v 2.856437206 13.593063354 -29.867403030 +v 2.169026375 14.013488770 -29.867403030 +v 0.907005310 15.672581673 -30.402873993 +v 0.865982056 15.541136742 -30.867441177 +v 0.790650368 15.184299469 -31.070205688 +v -0.143679619 15.740912437 -30.402873993 +v -0.143562317 15.609466553 -30.867441177 +v -0.143560410 15.245204926 -31.070205688 +v 1.540474892 14.589397430 -31.070205688 +v 2.169026375 14.013489723 -30.867439270 +v 1.421446800 14.319040298 -30.867441177 +v 1.421447754 14.319040298 -29.867403030 +v 0.706397057 14.785190582 -31.070205688 +v 0.647138596 14.504487991 -30.867441177 +v 0.647139549 14.504487991 -29.867403030 +v 4.320018768 15.435887337 -34.775508881 +v 3.820850372 15.672581673 -35.676029205 +v 3.874273777 15.304441452 -34.621406555 +v 3.394650459 15.541136742 -35.486671448 +v 4.284097672 14.941862106 -33.882064819 +v 4.849331856 14.118021011 -32.862358093 +v 4.033683300 14.678530693 -33.915588379 +v 4.026483536 14.013489723 -34.346813202 +v 4.330414295 13.749271393 -33.380271912 +v 3.932514668 14.277847290 -34.098102570 +v 4.362574577 13.593063354 -33.740489960 +v 4.539047241 13.975434303 -33.003890991 +v 3.182729244 15.202935219 -35.450752258 +v 3.635644913 15.017164230 -34.633670807 +v 3.141046047 14.795264244 -35.525947571 +v 3.544517040 14.590009689 -34.798072815 +v 3.664050102 14.319040298 -35.000663757 +v 4.051383018 10.354040146 -30.402873993 +v 4.852749825 10.354034424 -30.402873993 +v 5.248169422 10.354028702 -31.325901031 +v 5.737757683 10.354028702 -32.217842102 +v 3.112530708 9.998180389 -31.070205688 +v 2.856438637 9.998180389 -30.867443085 +v 2.856437206 9.998180389 -29.867403030 +v 3.853999615 9.998180389 -30.867441177 +v 3.555293560 9.998180389 -31.070205688 +v 4.623218060 9.998180389 -30.557798386 +v 5.003104687 9.998180389 -31.455053329 +v 5.003104687 10.109920502 -31.455053329 +v 4.623218060 10.109920502 -30.557798386 +v 4.848752975 9.998180389 -32.863403320 +v 4.538818359 9.998180389 -33.004299164 +v 3.970601082 10.109930038 -30.593849182 +v 3.970601082 9.998180389 -30.593849182 +v 5.465974808 10.109920502 -32.314231873 +v 5.465974808 9.998180389 -32.314231873 +v 5.143620014 10.109919548 -32.895774841 +v 5.349530697 10.354027748 -32.918220520 +v 5.143620014 9.998180389 -32.895774841 +v 1.152847290 10.109930038 -40.095317841 +v 1.152847290 9.998181343 -40.095317841 +v 0.970087051 9.998181343 -39.860694885 +v 1.280713081 10.354040146 -40.258556366 +v 2.328783035 13.593065262 -39.462390900 +v 1.453714371 9.998181343 -38.988208771 +v 1.453716278 13.593063354 -38.988208771 +v 4.248755932 15.740915298 -37.093368530 +v 4.655133724 15.609468460 -37.318782806 +v 3.741929054 15.672584534 -38.006538391 +v 5.140193939 15.541138649 -36.443981171 +v 4.758635998 15.672584534 -36.174694061 +v 2.805136681 15.672581673 -37.508422852 +v 3.314519405 15.740912437 -36.589473724 +v 4.163295269 15.541138649 -38.204101563 +v 5.620284557 15.304443359 -35.578979492 +v 2.908140182 14.566658020 -36.364356995 +v 3.288658142 14.504487991 -35.677886963 +v 4.541278839 14.319043159 -35.476043701 +v 4.165520668 14.504489899 -36.153064728 +v 5.733006477 14.979497910 -35.794563293 +v 5.285783291 15.184301376 -36.600345612 +v 5.649660110 14.589399338 -35.944732666 +v 5.244895458 14.785192490 -36.674011230 +v 5.409854889 14.319043159 -35.958118439 +v 4.380053520 15.202938080 -38.232234955 +v 4.832426071 14.858482361 -37.417175293 +v 4.421778202 14.795266151 -38.157058716 +v 4.653206348 14.566659927 -37.321403503 +v 4.832426071 15.245207787 -37.417179108 +v 5.034096718 14.504489899 -36.635139465 +v 3.788245678 14.566660881 -36.817073822 +v 2.908144951 15.609466553 -36.364349365 +v 2.730801582 15.245204926 -36.266048431 +v 2.730799198 14.858480453 -36.266052246 +v 2.524804115 14.504487991 -37.055912018 +v 3.399456501 14.504487991 -37.540740967 +v 4.269494057 14.504489899 -38.012752533 +v 3.025161266 14.319043159 -38.207698822 +v 2.305970669 15.435887337 -38.408943176 +v 1.939085960 15.304441452 -38.112579346 +v 2.418706894 15.541136742 -37.247318268 +v 1.831100464 14.979496956 -37.889152527 +v 2.277885914 15.184299469 -37.083129883 +v 1.428648949 14.662881851 -38.615196228 +v 2.318733692 14.785190582 -37.009437561 +v 2.149413109 14.319040298 -37.733139038 +v 1.786979675 14.013489723 -38.386985779 +v 1.914364815 14.589397430 -37.738937378 +v 1.538980484 14.267008781 -38.416152954 +v -0.143557549 14.858480453 -31.070205688 +v -0.143554688 14.566658020 -30.867439270 +v -0.143553734 14.566658020 -29.867403030 +v -0.928434372 14.504487991 -29.867401123 +v -0.928434372 14.504487991 -30.867439270 +v -1.075737000 15.202935219 -31.070205688 +v -0.989757538 14.795264244 -31.070205688 +v -1.147062302 15.541136742 -30.867441177 +v -1.188070297 15.672581673 -30.402873993 +v -2.217683792 15.435887337 -30.402873993 +v -2.136363029 15.304441452 -30.867439270 +v -2.009947777 15.017164230 -31.070205688 +v -1.821979523 14.590009689 -31.070205688 +v -1.702740669 14.319040298 -29.867401123 +v -1.702741623 14.319040298 -30.867439270 +v -2.981693268 14.941862106 -30.867439270 +v -2.830970764 14.678530693 -31.070205688 +v -3.097460747 15.073307991 -30.402873993 +v -3.459335327 15.242951393 -35.858413696 +v -3.459335327 15.381684303 -35.858413696 +v -4.834913254 15.381684303 -31.801279068 +v -4.834913254 15.242951393 -31.801279068 +v -5.011572838 15.026430130 -31.824825287 +v -3.617288589 15.026430130 -35.940959930 +v -2.622293472 14.277847290 -31.070205688 +v -2.450321198 14.013489723 -30.867439270 +v -2.450321198 14.013488770 -29.867401123 +v -3.443025589 13.749271393 -31.070205688 +v -3.143564224 13.593063354 -30.867439270 +v -3.143561363 13.593063354 -29.867401123 +v -3.873365402 13.975434303 -31.070205688 +v -4.340984344 14.220697403 -30.402873993 +v -4.147581100 14.118021011 -30.867439270 +v -4.926047325 15.244828224 -30.573741913 +v -4.926047325 15.383560181 -30.573741913 +v -5.142028809 15.028306961 -30.402873993 +v -3.143563271 9.998180389 -30.867441177 +v -3.459339142 9.998180389 -35.858577728 +v -3.443388939 9.998180389 -31.070205688 +v -3.143561363 9.998180389 -29.867403030 +v -3.459339142 10.109925270 -35.858577728 +v -4.834972382 10.109925270 -31.801433563 +v -5.011572838 10.354034424 -31.824825287 +v -3.617288589 10.354034424 -35.940959930 +v -4.834972382 9.998180389 -31.801433563 +v -3.872895241 9.998180389 -31.070205688 +v -4.146388054 9.998180389 -30.867439270 +v -5.142004013 10.354028702 -30.402873993 +v -4.341223717 10.354027748 -30.402873993 +v -4.925933838 10.109920502 -30.593847275 +v -4.261025429 10.109919548 -30.593847275 +v -4.261025429 9.998180389 -30.593847275 +v -4.925933838 9.998180389 -30.593847275 +v 0.937560081 9.998181343 -39.501136780 +v -0.992921829 9.998181343 -39.379798889 +v -0.992971420 15.242951393 -39.379638672 +v -0.992971420 15.381684303 -39.379638672 +v -1.115442276 15.026430130 -39.509117126 +v -1.115442276 10.354034424 -39.509117126 +v -0.992921829 10.109925270 -39.379798889 +v 3.231245995 13.749273300 -40.302085876 +v 3.022637367 9.998181343 -40.677947998 +v 3.022408962 13.975436211 -40.678356171 +v 3.197357178 13.593065262 -39.944465637 +v 1.822546959 15.026432037 -41.464599609 +v 2.075977325 15.242953300 -41.360088348 +v 2.075977325 15.381685257 -41.360088348 +v 2.713257313 9.998181343 -40.816692352 +v 2.093720436 9.998067856 -41.369171143 +v 2.093720436 10.109919548 -41.369171143 +v 1.822546959 10.354028702 -41.464599609 +v 3.242274284 15.435888290 -38.906787872 +v 1.528442383 14.941126823 -38.853397369 +v 1.878594398 15.072572708 -39.179950714 +v 2.662373066 14.013492584 -38.861351013 +v 3.530948639 14.013491631 -39.343425751 +v 3.893736839 14.319043159 -38.689773560 +v 3.629533768 14.277850151 -39.584476471 +v 2.712753773 14.116407394 -40.817600250 +v 3.528266907 14.678532600 -39.766933441 +v 3.683204651 15.304443359 -39.069103241 +v 2.815331459 15.073310852 -39.676025391 +v 3.926695824 15.017166138 -39.049068451 +v 3.272159576 14.941128731 -39.809696198 +v 4.017912865 14.590011597 -38.884716034 +v 1.280758858 14.219081879 -40.258476257 +v 2.211596489 14.220699310 -40.763801575 +v 0.938992500 13.952214241 -39.498558044 +v 0.969583511 14.116405487 -39.861606598 +v 1.151953697 13.729486465 -39.114364624 +v 0.846682549 15.381684303 -40.689121246 +v 0.846682549 15.242951393 -40.689121246 +v 0.892202377 15.026430130 -40.959449768 +v 0.892202377 10.354034424 -40.959449768 +v 2.211755276 10.354027748 -40.763519287 +v 0.829423904 9.998181343 -40.678791046 +v 0.829423904 10.109926224 -40.678791046 +v 2.417686462 10.109919548 -40.786300659 +v 2.417686462 9.998066902 -40.786300659 +v 19.847118378 22.273571014 -69.295516968 +v 19.847118378 22.264093399 -64.533531189 +v 18.564567566 22.177253723 -64.533531189 +v 18.564567566 22.186729431 -69.295516968 +v 17.307264328 21.876436234 -64.533531189 +v 17.307264328 21.885911942 -69.295516968 +v 16.230789185 21.414699554 -64.533531189 +v 16.230791092 21.409341812 -69.304817200 +v 14.850788116 20.365238190 -64.533531189 +v 14.851180077 20.368175507 -69.304817200 +v 18.564567566 21.380252838 -62.923557281 +v 19.847118378 21.467092514 -62.923557281 +v 17.307264328 21.079437256 -62.923561096 +v 16.230789185 20.617698669 -62.923561096 +v 14.850788116 19.568237305 -62.923557281 +v 17.307264328 20.073871613 -60.915550232 +v 16.230789185 18.607959747 -58.926403046 +v 16.230789185 19.612133026 -60.915550232 +v 17.307264328 19.069698334 -58.926403046 +v 14.850787163 17.558500290 -58.926403046 +v 14.850787163 18.562671661 -60.915550232 +v 18.564567566 20.374689102 -60.915550232 +v 19.847118378 20.461528778 -60.915550232 +v 18.564565659 19.370515823 -58.926403046 +v 19.847118378 19.457355499 -58.926403046 +v 24.845911026 20.361202240 -69.304733276 +v 24.845569611 20.367290497 -64.533531189 +v 23.454578400 21.415634155 -64.533531189 +v 23.454578400 21.425109863 -69.295516968 +v 22.380249023 21.876436234 -64.533531189 +v 22.380249023 21.885911942 -69.295516968 +v 21.122945786 22.177253723 -64.533531189 +v 21.122945786 22.186729431 -69.295516968 +v 23.454578400 20.618633270 -62.923557281 +v 24.845569611 19.570289612 -62.923557281 +v 22.380249023 21.079435349 -62.923557281 +v 21.122945786 21.380252838 -62.923557281 +v 21.122945786 20.374689102 -60.915550232 +v 22.380249023 20.073871613 -60.915550232 +v 21.122945786 19.370515823 -58.926403046 +v 22.380249023 19.069698334 -58.926403046 +v 24.845569611 18.564725876 -60.915550232 +v 23.454578400 18.608894348 -58.926403046 +v 23.454578400 19.613067627 -60.915550232 +v 24.845569611 17.560552597 -58.926403046 +v 17.307264328 18.084199905 -56.921527863 +v 16.230787277 16.620403290 -54.928943634 +v 16.230789185 17.622463226 -56.921527863 +v 17.307264328 17.082141876 -54.928943634 +v 14.850786209 15.570942879 -54.928943634 +v 14.850786209 16.573001862 -56.921527863 +v 18.564565659 18.385017395 -56.921527863 +v 19.847116470 18.471858978 -56.921527863 +v 18.564565659 17.382957458 -54.928943634 +v 19.847116470 17.469799042 -54.928943634 +v 16.230787277 16.428209305 -54.486366272 +v 17.307262421 16.889945984 -54.486366272 +v 14.850786209 15.378747940 -54.486366272 +v 17.307262421 16.884588242 -50.361312866 +v 16.230787277 16.422851563 -50.361312866 +v 14.851177216 15.381685257 -50.361312866 +v 19.847116470 17.272245407 -50.361312866 +v 18.564565659 17.190763474 -54.486366272 +v 19.847116470 17.277603149 -54.486366272 +v 18.564565659 17.185403824 -50.361312866 +v 22.380247116 18.084199905 -56.921527863 +v 21.122945786 17.382957458 -54.928943634 +v 21.122945786 18.385017395 -56.921527863 +v 22.380247116 17.082139969 -54.928943634 +v 23.454578400 17.623397827 -56.921527863 +v 24.845567703 16.575054169 -56.921527863 +v 23.454578400 16.621337891 -54.928943634 +v 24.845569611 15.572996140 -54.928943634 +v 22.380247116 16.884588242 -50.361312866 +v 21.122943878 17.190763474 -54.486366272 +v 22.380247116 16.889945984 -54.486366272 +v 21.122943878 17.185403824 -50.361312866 +v 23.454576492 16.429143906 -54.486366272 +v 24.845567703 15.380802155 -54.486366272 +v 24.845907211 15.374712944 -50.361396790 +v 23.454576492 16.423786163 -50.361312866 +v 15.065155029 20.229444504 -69.133949280 +v 15.065154076 20.372211456 -64.533569336 +v 15.065155029 20.233478546 -64.533569336 +v 15.065155029 20.368175507 -69.133949280 +v 14.850788116 20.026432037 -69.296829224 +v 14.850788116 20.016956329 -64.533531189 +v 17.388771057 19.267009735 -68.629501343 +v 17.991315842 19.979499817 -68.629501343 +v 17.161193848 19.662883759 -68.629501343 +v 16.885383606 20.072574615 -69.296829224 +v 17.001237869 19.941129684 -68.832267761 +v 17.766918182 20.435890198 -69.296829224 +v 15.848499298 19.116405487 -68.832267761 +v 17.848257065 20.304443359 -68.832267761 +v 16.151197433 18.952217102 -68.629501343 +v 15.652250290 19.219083786 -69.296829224 +v 17.534513474 19.013490677 -69.832305908 +v 17.534511566 19.014816284 -68.830947876 +v 16.847101212 18.593065262 -68.832267761 +v 16.847101212 18.593063354 -69.832305908 +v 16.590465546 18.729488373 -68.629501343 +v 18.837556839 20.541137695 -68.832267761 +v 18.912887573 20.184299469 -68.629501343 +v 18.796533585 20.672582626 -69.296829224 +v 19.847219467 20.740915298 -69.296829224 +v 19.847103119 20.609468460 -68.832267761 +v 19.847099304 20.245208740 -68.629501343 +v 18.997142792 19.785192490 -68.629501343 +v 19.056400299 19.504489899 -69.832305908 +v 19.056400299 19.504489899 -68.832267761 +v 18.282091141 19.320365906 -68.830947876 +v 18.163064957 19.589399338 -68.629501343 +v 19.847097397 19.858482361 -68.629501343 +v 19.847093582 19.566659927 -69.832305908 +v 19.847093582 19.566659927 -68.832267761 +v 18.282093048 19.319042206 -69.832305908 +v 23.146928787 14.998180389 -68.629501343 +v 24.614154816 15.003443718 -64.519569397 +v 23.576435089 14.998180389 -68.629501343 +v 22.847103119 14.998180389 -68.832260132 +v 15.061660767 15.002688408 -64.519554138 +v 15.652154922 15.355363846 -69.295516968 +v 16.847101212 14.998180389 -69.832305908 +v 16.847099304 14.998180389 -68.830947876 +v 15.849536896 14.998180389 -68.830947876 +v 16.591007233 14.998180389 -68.628189087 +v 16.148244858 14.998180389 -68.628189087 +v 14.850786209 15.355358124 -69.295516968 +v 14.850786209 15.345883369 -64.533531189 +v 15.065820694 14.998180389 -69.104545593 +v 15.065818787 15.101775169 -64.533576965 +v 15.065820694 15.111249924 -69.104545593 +v 15.732936859 14.998180389 -69.104545593 +v 15.732936859 15.111255646 -69.104545593 +v 15.065154076 19.575210571 -62.923599243 +v 15.065155029 19.436477661 -62.923599243 +v 14.850788116 19.219955444 -62.923557281 +v 15.065153122 18.569644928 -60.915592194 +v 15.065154076 18.430913925 -60.915592194 +v 14.850787163 18.214391708 -60.915550232 +v 14.850784302 13.543317795 -60.915550232 +v 14.850785255 14.548881531 -62.923561096 +v 15.061659813 14.802688599 -64.116996765 +v 15.065818787 14.304773331 -62.923606873 +v 15.061660767 14.602687836 -63.719551086 +v 15.061660767 14.802688599 -64.519554138 +v 15.061659813 14.602687836 -64.116996765 +v 15.061660767 14.402688980 -63.319549561 +v 15.061660767 14.402688980 -63.719551086 +v 15.061659813 14.202688217 -62.919067383 +v 15.061660767 14.202688217 -63.319549561 +v 15.061660767 14.002689362 -62.516796112 +v 15.061660767 14.002689362 -62.919067383 +v 15.061660767 13.802688599 -62.117893219 +v 15.061660767 13.802688599 -62.516796112 +v 15.065818787 13.299209595 -60.915596008 +v 15.061663628 13.597527504 -61.721931458 +v 15.061662674 13.597527504 -62.118125916 +v 15.061663628 13.397527695 -61.326660156 +v 15.061663628 13.397527695 -61.721931458 +v 15.061664581 13.197527885 -60.916912079 +v 15.061663628 13.197528839 -61.326660156 +v 14.850784302 12.539145470 -58.926403046 +v 14.850787163 17.210218430 -58.926403046 +v 15.065153122 17.565471649 -58.926445007 +v 15.065154076 17.426740646 -58.926445007 +v 15.061664581 12.997529030 -60.527023315 +v 15.065818787 12.295036316 -58.926448822 +v 15.061664581 12.597529411 -59.705848694 +v 15.061664581 12.797529221 -60.103534698 +v 15.061664581 12.997528076 -60.916912079 +v 15.061664581 12.797529221 -60.527023315 +v 15.061664581 12.597529411 -60.103534698 +v 24.614154816 14.203443527 -62.919086456 +v 24.614154816 14.203121185 -63.320079803 +v 24.614154816 13.803443909 -62.117912292 +v 24.614154816 13.803443909 -62.516815186 +v 24.614154816 14.003443718 -62.919086456 +v 24.614154816 14.003443718 -62.516815186 +v 24.614152908 13.598928452 -62.118114471 +v 24.614154816 14.803442955 -64.117019653 +v 24.614154816 14.603444099 -63.719570160 +v 24.614154816 14.403120995 -63.720081329 +v 24.614154816 14.603120804 -64.117134094 +v 24.614154816 14.803443909 -64.519569397 +v 24.614154816 14.403444290 -63.319568634 +v 24.614152908 12.998283386 -60.916931152 +v 24.614152908 13.198284149 -60.916931152 +v 24.614152908 13.198284149 -61.326679230 +v 24.614152908 13.398283005 -61.326679230 +v 24.614152908 13.398283005 -61.721950531 +v 24.614152908 13.598281860 -61.721950531 +v 24.614151001 12.798283577 -60.103549957 +v 24.614151001 12.598283768 -59.705867767 +v 15.061664581 12.397529602 -59.705848694 +v 24.614151001 12.598606110 -60.103549957 +v 24.614151001 12.798283577 -60.527042389 +v 15.061666489 12.197528839 -58.921619415 +v 24.614151001 12.998283386 -60.527042389 +v 24.614151001 12.198284149 -58.921638489 +v 24.614151001 12.398607254 -59.705860138 +v 20.779275894 20.202938080 -68.629501343 +v 20.891609192 20.672582626 -69.296829224 +v 20.850601196 20.541137695 -68.832267761 +v 21.839902878 20.304443359 -68.832267761 +v 21.921224594 20.435890198 -69.296829224 +v 21.713487625 20.017166138 -68.629501343 +v 22.685232162 19.941864014 -68.832267761 +v 20.693298340 19.795265198 -68.629501343 +v 20.631973267 19.504489899 -69.832305908 +v 21.406280518 19.319042206 -69.832305908 +v 20.631973267 19.504489899 -68.832267761 +v 21.525520325 19.590011597 -68.629501343 +v 22.153862000 19.013490677 -69.832305908 +v 21.406280518 19.319042206 -68.832267761 +v 22.534509659 19.678533554 -68.629501343 +v 22.325832367 19.277849197 -68.629501343 +v 22.153862000 19.013492584 -68.832267761 +v 24.629589081 20.235353470 -64.533569336 +v 24.629594803 20.368263245 -69.133865356 +v 24.629594803 20.229530334 -69.133865356 +v 24.629589081 20.374086380 -64.533569336 +v 24.845569611 20.018833160 -64.533531189 +v 24.845909119 20.013008118 -69.304733276 +v 22.801000595 20.073310852 -69.296829224 +v 23.851119995 19.118022919 -68.832267761 +v 23.576902390 18.975435257 -68.629501343 +v 24.044528961 19.220699310 -69.296829224 +v 23.146564484 18.749273300 -68.629501343 +v 22.847103119 18.593063354 -69.832305908 +v 22.847103119 18.593065262 -68.832267761 +v 23.849927902 14.998180389 -68.832260132 +v 24.629476547 14.984669685 -69.114028931 +v 23.964565277 14.998180389 -69.105857849 +v 22.847103119 14.998180389 -69.832305908 +v 23.964565277 15.109921455 -69.105857849 +v 24.044765472 15.354029655 -69.296829224 +v 24.629476547 15.109922409 -69.105857849 +v 24.845544815 15.354030609 -69.296829224 +v 24.845544815 15.344554901 -64.533531189 +v 24.629476547 15.100444794 -64.533576965 +v 24.845569611 19.221830368 -62.923557281 +v 24.845544815 14.547553062 -62.923557281 +v 24.845569611 18.216266632 -60.915550232 +v 24.629589081 18.432788849 -60.915592194 +v 24.629589081 19.438352585 -62.923599243 +v 24.629589081 19.577083588 -62.923599243 +v 24.629589081 18.571521759 -60.915592194 +v 24.629589081 17.428615570 -58.926445007 +v 24.629589081 17.567348480 -58.926445007 +v 24.629476547 14.303443909 -62.923603058 +v 24.845544815 13.541989326 -60.915550232 +v 24.629476547 13.297880173 -60.915596008 +v 24.845569611 17.212093353 -58.926403046 +v 24.845544815 12.537815094 -58.926403046 +v 24.629476547 12.293706894 -58.926448822 +v 15.065153122 16.441242218 -56.921569824 +v 14.850786209 15.222661972 -54.928943634 +v 14.850786209 16.224720001 -56.921527863 +v 15.065153122 15.439184189 -54.928985596 +v 15.065153122 15.577916145 -54.928985596 +v 15.065152168 16.579975128 -56.921569824 +v 15.061664581 12.397529602 -59.308055878 +v 14.850784302 11.553647041 -56.921527863 +v 15.061666489 10.997529984 -56.523735046 +v 15.063741684 11.196999550 -56.922222137 +v 15.065818787 11.309538841 -56.921573639 +v 15.061666489 11.397529602 -57.324699402 +v 15.061666489 11.597529411 -57.723960876 +v 15.061666489 11.397529602 -57.723960876 +v 15.061666489 11.197529793 -57.324699402 +v 15.061665535 10.997529984 -56.922870636 +v 15.061666489 11.997529030 -58.512027740 +v 15.061664581 12.197528839 -59.308055878 +v 15.061666489 11.997529030 -58.921619415 +v 15.061666489 11.797529221 -58.128948212 +v 15.061666489 11.797529221 -58.512027740 +v 15.061666489 11.597529411 -58.128948212 +v 14.850784302 10.551588058 -54.928943634 +v 15.065153122 15.246988297 -54.486324310 +v 14.850786209 15.030466080 -54.486366272 +v 14.850784302 10.359393120 -54.486366272 +v 15.065818787 10.307478905 -54.928993225 +v 15.061666489 10.797530174 -56.124694824 +v 15.061666489 10.597530365 -55.722717285 +v 15.061666489 10.797530174 -56.523735046 +v 15.061666489 10.597530365 -56.124694824 +v 15.061666489 10.397530556 -55.324447632 +v 15.061666489 10.397530556 -55.722717285 +v 15.063743591 10.195970535 -54.928028107 +v 15.061666489 10.197530746 -55.324447632 +v 15.061666489 9.997628212 -54.927124023 +v 15.065818787 10.002214432 -54.486320496 +v 15.065818787 10.115284920 -54.486320496 +v 24.614151001 11.798606873 -58.512046814 +v 24.614151001 11.998606682 -58.921596527 +v 24.614151001 12.398283958 -59.308078766 +v 24.614151001 12.198606491 -59.308071136 +v 24.614151001 11.998284340 -58.512046814 +v 24.614151001 11.798284531 -58.128967285 +v 24.614151001 11.398284912 -57.723983765 +v 24.614151001 11.598284721 -58.128967285 +v 24.614151001 11.598285675 -57.723983765 +v 24.614151001 11.398284912 -57.324714661 +v 24.614151001 11.198284149 -57.324714661 +v 24.614149094 11.198285103 -56.922889709 +v 24.614149094 10.798285484 -56.523754120 +v 24.614149094 10.998285294 -56.523754120 +v 24.614149094 10.798284531 -56.124717712 +v 24.614151001 10.998285294 -56.922889709 +v 24.614149094 10.598284721 -55.722736359 +v 24.614149094 10.598285675 -56.124717712 +v 24.614149094 9.997730255 -54.927211761 +v 24.614149094 10.398285866 -55.324470520 +v 24.614149094 10.198285103 -55.324470520 +v 24.622045517 10.002214432 -54.486320496 +v 24.614149094 10.398285866 -55.722736359 +v 24.614149094 10.198286057 -54.927082062 +v 15.065152168 15.385721207 -54.486324310 +v 15.065151215 15.242953300 -50.532180786 +v 15.065151215 15.381685257 -50.532180786 +v 14.850786209 15.026432037 -50.361312866 +v 16.120515823 13.975436211 -51.028869629 +v 17.371587753 14.277850151 -51.028869629 +v 16.550857544 13.749273300 -51.028869629 +v 15.848496437 14.116407394 -50.825691223 +v 17.162912369 14.678532600 -51.028869629 +v 17.001235962 14.941128731 -50.825691223 +v 17.534509659 14.013491631 -50.825691223 +v 16.847099304 13.593065262 -50.825691223 +v 16.847099304 13.593065262 -49.832305908 +v 17.534509659 14.013492584 -49.832305908 +v 15.652330399 14.220699310 -50.361396790 +v 16.896419525 15.073310852 -50.361396790 +v 17.983934402 15.017166138 -51.028869629 +v 17.848253250 15.304443359 -50.825691223 +v 17.776197433 15.435888290 -50.361396790 +v 18.837554932 15.541138649 -50.825691223 +v 18.805810928 15.672584534 -50.361396790 +v 18.918146133 15.202938080 -51.028869629 +v 19.850324631 14.858482361 -51.028869629 +v 19.850320816 15.245207787 -51.028869629 +v 19.850202560 15.740915298 -50.361396790 +v 19.850318909 15.609468460 -50.826107025 +v 19.004123688 14.795266151 -51.028869629 +v 19.847091675 14.566659927 -50.825691223 +v 19.056396484 14.504489899 -50.825691223 +v 18.171901703 14.590011597 -51.028869629 +v 19.056396484 14.504489899 -49.832302094 +v 18.282089233 14.319043159 -49.832305908 +v 19.847091675 14.566660881 -49.832305908 +v 18.282089233 14.319043159 -50.825691223 +v 23.106412888 9.998181343 -51.028869629 +v 23.549175262 9.998181343 -51.028869629 +v 22.847099304 9.998181343 -50.825691223 +v 16.847097397 9.998181343 -50.825691223 +v 16.847097397 9.998181343 -49.832302094 +v 16.550491333 9.998181343 -51.028869629 +v 16.120986938 9.998181343 -51.028869629 +v 15.849535942 9.998181343 -50.825691223 +v 15.065820694 9.998181343 -50.552104950 +v 14.850786209 10.354028702 -50.361312866 +v 15.065820694 10.109919548 -50.552104950 +v 15.652656555 10.354027748 -50.361396790 +v 15.732674599 10.109919548 -50.552509308 +v 15.732674599 9.998181343 -50.552509308 +v 24.845567703 16.226596832 -56.921527863 +v 24.845542908 11.552317619 -56.921527863 +v 24.629587173 16.581850052 -56.921569824 +v 24.629587173 16.443117142 -56.921569824 +v 24.629589081 15.441058159 -54.928985596 +v 24.845569611 15.224536896 -54.928943634 +v 24.629589081 15.579791069 -54.928985596 +v 24.629474640 11.308209419 -56.921573639 +v 24.845542908 10.358064651 -54.486366272 +v 24.845567703 15.032342911 -54.486366272 +v 24.845542908 10.550258636 -54.928943634 +v 24.629474640 10.306149483 -54.928989410 +v 24.629474640 10.113956451 -54.486320496 +v 20.850599289 15.541138649 -50.825691223 +v 20.900888443 15.672584534 -50.361396790 +v 20.700279236 14.785192490 -51.028869629 +v 20.784534454 15.184301376 -51.028869629 +v 21.930501938 15.435888290 -50.361396790 +v 21.839899063 15.304443359 -50.825691223 +v 22.685230255 14.941864014 -50.825691223 +v 21.706104279 14.979497910 -51.028869629 +v 21.406278610 14.319043159 -50.825691223 +v 20.631971359 14.504489899 -50.825691223 +v 21.534357071 14.589399338 -51.028869629 +v 20.631971359 14.504489899 -49.832305908 +v 22.153858185 14.013491631 -50.825691223 +v 22.308650970 14.267010689 -51.028869629 +v 22.536228180 14.662883759 -51.028869629 +v 21.406278610 14.319043159 -49.832302094 +v 22.153858185 14.013492584 -49.832302094 +v 24.629587173 15.248864174 -54.486324310 +v 24.629587173 15.387597084 -54.486324310 +v 24.845907211 15.026519775 -50.361396790 +v 24.629589081 15.243041992 -50.532264709 +v 24.629589081 15.381774902 -50.532264709 +v 23.546222687 13.952216148 -51.028869629 +v 23.851118088 14.118022919 -50.825691223 +v 23.106956482 13.729488373 -51.028869629 +v 22.847099304 13.593065262 -50.825691223 +v 22.847099304 13.593065262 -49.832305908 +v 22.812036514 15.072574615 -50.361396790 +v 24.045171738 14.219083786 -50.361396790 +v 24.629474640 9.998181343 -50.552104950 +v 24.629474640 10.109925270 -50.552104950 +v 24.845542908 10.354034424 -50.361312866 +v 23.849924088 9.998181343 -50.825691223 +v 23.965547562 10.109930038 -50.552509308 +v 23.965547562 9.998181343 -50.552509308 +v 24.044841766 10.354040146 -50.361396790 +v 22.847099304 9.998181343 -49.832302094 +v 29.770776749 14.983057976 -79.765068054 +v 29.990617752 14.983057976 -79.764480591 +v 29.770776749 14.983057976 -76.728233337 +v 29.990617752 19.614944458 -79.764816284 +v 29.990617752 14.983057976 -76.724792480 +v 29.770776749 19.614944458 -79.764595032 +v 29.990617752 18.641347885 -76.728233337 +v 29.990617752 19.552772522 -78.981636047 +v 29.770776749 19.552772522 -78.978973389 +v 29.990617752 19.367326736 -78.206016541 +v 29.770776749 19.367326736 -78.206016541 +v 29.770776749 18.641349792 -76.728233337 +v 29.990617752 19.061775208 -77.458442688 +v 29.770776749 19.061775208 -77.458442688 +v 29.990617752 19.367326736 -81.333724976 +v 29.770776749 19.367326736 -81.331604004 +v 29.990617752 19.552772522 -80.557205200 +v 29.770776749 19.552772522 -80.555305481 +v 29.990617752 14.983057976 -82.789794922 +v 29.770776749 14.983057976 -82.789558411 +v 29.990617752 19.061775208 -82.081695557 +v 29.770776749 19.061775208 -82.079597473 +v 29.990617752 18.641347885 -82.789794922 +v 29.770776749 18.641349792 -82.789558411 +v 25.150344849 36.803638458 -78.226249695 +v 23.507511139 36.803638458 -76.151039124 +v 22.379907608 37.816291809 -77.288597107 +v 25.149658203 37.588485718 -78.859718323 +v 23.760309219 38.146606445 -79.075546265 +v 26.582733154 37.451553345 -80.917556763 +v 26.741977692 36.803638458 -80.926628113 +v 23.620162964 40.143218994 -80.539779663 +v 23.214408875 38.849967957 -80.607490540 +v 22.805299759 38.849967957 -79.122245789 +v 23.983345032 38.146606445 -80.741073608 +v 22.286933899 40.141529083 -79.104644775 +v 21.626663208 38.849967957 -77.977058411 +v 21.465209961 40.042587280 -77.248382568 +v 21.989391327 38.146606445 -77.923149109 +v 18.922386169 38.849967957 -77.383468628 +v 18.781166077 39.983886719 -75.779251099 +v 19.296573639 37.549797058 -77.759208679 +v 19.071321487 38.146606445 -77.910560608 +v 26.055217743 35.033866882 -80.746879578 +v 24.823348999 35.031005859 -76.757247925 +v 25.464570999 32.528594971 -77.825080872 +v 21.454284668 32.629238129 -76.140113831 +v 24.596004486 35.184875488 -75.502090454 +v 25.541439056 32.444717407 -80.763412476 +v 18.820507050 35.188179016 -77.004943848 +v 19.020227432 36.803642273 -77.550704956 +v 18.437503815 32.598598480 -74.781242371 +v 15.987350464 38.849967957 -75.045997620 +v 15.820146561 40.176586151 -73.660858154 +v 16.128425598 38.146606445 -75.713554382 +v 16.336780548 37.600803375 -75.754692078 +v 16.051029205 36.803642273 -74.879219055 +v 15.816267014 35.004508972 -73.347824097 +v 15.454005241 32.571670532 -72.626029968 +v 12.481450081 32.488109589 -72.487487793 +v 12.481454849 36.824386597 -71.998634338 +v 12.481455803 34.988109589 -72.289489746 +v 9.841464043 32.488113403 -72.487487793 +v 9.841464043 36.824386597 -71.998641968 +v 9.841464043 37.488113403 -72.269149780 +v 12.481452942 37.488109589 -72.269142151 +v 9.841464043 34.988113403 -72.289505005 +v 9.841464043 38.150741577 -73.263992310 +v 12.481452942 38.150741577 -73.263984680 +v 9.841464043 38.831653595 -73.557495117 +v 9.841464043 39.987960815 -72.482528687 +v 12.481452942 39.987960815 -72.482521057 +v 12.481452942 38.831653595 -73.557495117 +v 24.103481293 34.949363708 -83.712203979 +v 25.275901794 32.545532227 -84.405128479 +v 23.822326660 36.803642273 -83.586334229 +v 21.669319153 36.803638458 -86.960464478 +v 20.021114349 32.419254303 -86.266639709 +v 24.059520721 37.374099731 -83.686401367 +v 23.201112747 39.767883301 -83.417564392 +v 23.296180725 38.849967957 -82.913650513 +v 23.527416229 38.146606445 -82.990409851 +v 21.588678360 37.490589142 -86.695175171 +v 21.198863983 38.146606445 -86.152320862 +v 21.211910248 38.849967957 -86.241333008 +v 20.951198578 34.872016907 -86.784126282 +v 18.210243225 34.756584167 -89.659729004 +v 18.384002686 32.098144531 -89.750251770 +v 18.141355515 36.803638458 -88.407386780 +v 21.635330200 40.005462646 -87.013442993 +v 18.081920624 37.317695618 -88.053428650 +v 17.714733124 38.146606445 -87.833557129 +v 17.707719803 38.849967957 -88.143836975 +v 18.099239349 39.993171692 -89.274894714 +v 15.259215355 39.788761139 -87.509864807 +v 14.867755890 38.849967957 -86.730918884 +v 14.875638962 38.146606445 -86.616233826 +v 15.287878036 37.231719971 -87.092933655 +v 15.288704872 36.803642273 -87.207962036 +v 15.292680740 34.746036530 -87.760856628 +v 15.425393105 32.172321320 -87.813186646 +v 12.481456757 34.988113403 -87.337501526 +v 12.481456757 32.488113403 -87.139503479 +v 9.841465950 34.988113403 -87.337501526 +v 9.841465950 32.488113403 -87.139511108 +v 12.481451988 36.803638458 -87.625076294 +v 9.841465950 36.824386597 -87.628364563 +v 12.481458664 37.488113403 -87.354400635 +v 12.481458664 38.831653595 -86.051231384 +v 9.841455460 38.831653595 -86.069503784 +v 9.841456413 38.150741577 -86.363006592 +v 12.452425003 39.987964630 -87.164901733 +v 9.841456413 39.987960815 -87.144470215 +v 9.841456413 37.488113403 -87.357849121 +v 12.481458664 38.150741577 -86.348823547 +v 29.305988312 21.413707733 -76.206016541 +v 29.305988312 20.366687775 -74.815032959 +v 24.837379456 20.371608734 -74.815391541 +v 23.466409683 21.406253815 -76.199089050 +v 25.255584717 14.946889877 -76.231483459 +v 26.604797363 14.982656479 -76.265853882 +v 27.231506348 14.950581551 -76.265853882 +v 23.980312347 21.871791840 -77.274734497 +v 24.203563690 21.958866119 -77.837463379 +v 24.520853043 21.999008179 -78.534027100 +v 23.593200684 21.483489990 -76.369125366 +v 29.305988312 21.874507904 -77.280349731 +v 29.305988312 22.175323486 -78.537651062 +v 24.800132751 22.060703278 -79.218650818 +v 29.305988312 22.262165070 -79.813476563 +v 24.956825256 22.130088806 -79.813652039 +v 23.457771301 21.412771225 -70.348968506 +v 23.082004547 21.573951721 -75.407218933 +v 22.381294250 21.874509811 -74.702331543 +v 22.381294250 21.874507904 -70.348968506 +v 24.837772369 20.364633560 -70.348968506 +v 18.565612793 22.107646942 -72.990287781 +v 19.841440201 22.250955582 -73.242851257 +v 19.841440201 22.262165070 -70.348968506 +v 21.123991013 22.175323486 -70.348968506 +v 21.123991013 22.175325394 -74.250564575 +v 25.056758881 22.139398575 -80.535820007 +v 24.705877304 22.122812271 -81.095756531 +v 29.305988312 22.175323486 -81.096031189 +v 29.305988312 21.874507904 -82.353332520 +v 23.299259186 21.874511719 -82.353866577 +v 23.448938370 21.413709641 -83.419189453 +v 29.305988312 21.412771225 -83.429809570 +v 29.305988312 20.364633560 -84.809814453 +v 24.839569092 20.371608734 -84.809417725 +v 23.457771301 21.412773132 -89.284484863 +v 24.837379456 20.371608734 -89.284484863 +v 22.797550201 21.693103790 -82.773315430 +v 22.375690460 21.873327255 -83.476203918 +v 22.381294250 21.874511719 -89.284484863 +v 21.123992920 22.175325394 -89.284484863 +v 22.168815613 21.903715134 -83.783325195 +v 21.120126724 22.067075729 -84.549667358 +v 19.841442108 22.176996231 -84.137710571 +v 19.841442108 22.262166977 -89.284484863 +v 18.565612793 22.175325394 -89.284484863 +v 18.565612793 22.175323486 -70.348968506 +v 18.272354126 21.979415894 -73.085937500 +v 17.308311462 21.518264771 -73.613197327 +v 17.308309555 21.874507904 -70.348968506 +v 16.233982086 20.961898804 -74.645462036 +v 16.233980179 21.413707733 -70.348968506 +v 14.842990875 20.366687775 -70.348968506 +v 16.933029175 21.336425781 -73.846252441 +v 14.842651367 20.219360352 -74.815307617 +v 15.540415764 20.409646988 -75.513656616 +v 15.635255814 20.520387650 -75.291046143 +v 15.281488419 20.586505890 -75.753463745 +v 14.728040695 20.909824371 -76.207351685 +v 15.799945831 20.644830704 -75.183647156 +v 10.370471001 21.413709641 -76.206024170 +v 13.212484360 21.168054581 -77.276458740 +v 14.610939026 20.942386627 -76.341934204 +v 10.370471001 21.874511719 -77.280349731 +v 10.370553970 20.364635468 -74.814689636 +v 13.357571602 21.493791580 -79.813629150 +v 12.988756180 21.191238403 -78.535026550 +v 10.370471001 22.175325394 -78.537651062 +v 13.057863235 21.173599243 -77.588134766 +v 10.370471001 22.262166977 -79.813484192 +v 13.967662811 21.837032318 -81.095771790 +v 10.370471001 22.175325394 -81.096031189 +v 13.763244629 21.696022034 -80.502403259 +v 14.216711998 21.863300323 -81.803222656 +v 14.747447968 21.848104477 -82.353805542 +v 10.370471001 21.874511719 -82.353332520 +v 14.845539093 20.371608734 -84.811607361 +v 10.370471001 21.412773132 -83.429809570 +v 10.982007980 20.373481750 -84.595985413 +v 10.370471001 20.371608734 -84.809417725 +v 15.094427109 21.729990005 -82.688247681 +v 16.235771179 21.413709641 -83.420799255 +v 16.762920380 21.712316513 -82.950569153 +v 18.560976028 22.168703079 -83.647201538 +v 17.301679611 21.976741791 -83.235755920 +v 17.308311462 21.874511719 -89.284484863 +v 14.842651367 20.364635468 -89.284408569 +v 16.233982086 21.413709641 -89.284484863 +v 24.488052368 30.094154358 -75.618225098 +v 25.518449783 28.812402725 -75.841156006 +v 24.347496033 28.985239029 -75.019706726 +v 23.141761780 30.100467682 -74.650505066 +v 24.634094238 26.688255310 -75.590003967 +v 23.490127563 27.013437271 -73.939460754 +v 23.440853119 28.999212265 -74.159996033 +v 22.817611694 27.110204697 -72.569808960 +v 21.266868591 26.662124634 -71.392883301 +v 19.449996948 28.567934036 -72.402175903 +v 19.529581070 29.983152390 -73.100250244 +v 19.787189484 26.169006348 -71.135566711 +v 22.061599731 24.255449295 -74.742469788 +v 20.893354416 24.193212509 -74.051712036 +v 21.115722656 24.546749115 -72.695671082 +v 22.511524200 24.635454178 -73.533271790 +v 22.808015823 25.561082840 -72.700889587 +v 23.368392944 25.587879181 -74.153945923 +v 21.280704498 25.101297379 -71.769996643 +v 19.866724014 24.839723587 -71.833221436 +v 19.801246643 24.161594391 -72.210723877 +v 23.329086304 24.272464752 -74.836639404 +v 23.955390930 25.325462341 -75.683670044 +v 23.781864166 23.778326035 -75.961318970 +v 22.722534180 23.988742828 -75.623329163 +v 23.200160980 23.616571426 -76.630523682 +v 23.091220856 23.616294861 -76.484764099 +v 22.626701355 22.961791992 -76.785835266 +v 22.330196381 23.193660736 -76.181762695 +v 26.550949097 29.874471664 -77.890174866 +v 26.447105408 28.526062012 -76.735382080 +v 26.842082977 28.425216675 -77.812469482 +v 26.544471741 28.660789490 -80.678894043 +v 26.738830566 28.452816010 -79.091911316 +v 25.884006500 26.118581772 -77.365158081 +v 25.705062866 26.361009598 -76.578338623 +v 25.819625854 26.084964752 -78.917701721 +v 25.796188354 26.212837219 -79.443344116 +v 25.092411041 24.798793793 -77.526428223 +v 25.752429962 26.067216873 -78.103294373 +v 24.865108490 24.997421265 -76.733055115 +v 24.665222168 23.828989029 -77.714935303 +v 25.286739349 24.730936050 -78.227584839 +v 25.378070831 24.778564453 -79.131469727 +v 23.948272705 23.776203156 -76.147186279 +v 24.426811218 23.831975937 -77.107467651 +v 23.688209534 23.579959869 -77.967208862 +v 23.549936295 23.637470245 -77.448776245 +v 25.604660034 24.897699356 -79.702133179 +v 25.027832031 24.062568665 -78.296684265 +v 25.358690262 24.106132507 -79.120513916 +v 25.383094788 24.321857452 -79.871215820 +v 24.432258606 23.809860229 -79.742805481 +v 24.290679932 23.616666794 -79.205200195 +v 29.305988312 20.063230515 -76.859596252 +v 29.135120392 20.373481750 -75.031013489 +v 24.623407364 20.371608734 -75.031326294 +v 29.135120392 20.234748840 -75.031013489 +v 24.623407364 20.232875824 -75.031326294 +v 29.305988312 20.018226624 -74.815032959 +v 19.794349670 23.879894257 -73.666061401 +v 19.805347443 22.543739319 -73.894897461 +v 20.892026901 20.662504196 -70.348968506 +v 19.841341019 20.730834961 -70.348968506 +v 20.851001740 20.531059265 -70.813537598 +v 21.840303421 20.294363022 -70.813537598 +v 19.841457367 20.599388123 -70.813537598 +v 21.921642303 20.425807953 -70.348968506 +v 22.803176880 20.062494278 -70.348968506 +v 23.537363052 18.942136765 -71.016304016 +v 22.527366638 19.652805328 -71.016304016 +v 22.687320709 19.931049347 -70.813537598 +v 23.840061188 19.106327057 -70.813537598 +v 24.036310196 19.209003448 -70.348968506 +v 21.767883301 23.401014328 -75.542915344 +v 20.757532120 23.470703125 -75.025962830 +v 19.773284912 23.212747574 -74.474105835 +v 20.944026947 22.566518784 -74.784950256 +v 22.061439514 22.344963074 -75.191322327 +v 22.683864594 22.077983856 -75.817459106 +v 23.025321960 21.929023743 -76.520858765 +v 24.623407364 20.371606827 -70.519836426 +v 24.623407364 20.232873917 -70.519836426 +v 24.837772369 20.016351700 -70.348968506 +v 24.036403656 15.343961716 -70.348968506 +v 24.837772369 20.016353607 -74.815391541 +v 24.837772369 15.343955994 -70.348968506 +v 23.098094940 18.719408035 -71.016304016 +v 23.097551346 14.950710297 -71.016304016 +v 22.841457367 14.950710297 -70.813537598 +v 23.839019775 14.950710297 -70.813537598 +v 23.540313721 14.950710297 -71.016304016 +v 22.841457367 18.582984924 -70.813537598 +v 24.622737885 14.950710297 -70.539947510 +v 23.955623627 14.950710297 -70.539947510 +v 23.955623627 15.099852562 -70.539947510 +v 24.622737885 15.099847794 -70.539947510 +v 24.837770462 15.343947411 -74.815391541 +v 24.606698990 14.947907448 -75.034667969 +v 21.894195557 14.901648521 -72.612403870 +v 24.612802505 15.079806328 -75.034667969 +v 23.336404800 14.936596870 -74.047241211 +v 23.298706055 15.231988907 -75.839904785 +v 23.259780884 14.938171387 -75.032234192 +v 25.088092804 15.331356049 -76.757781982 +v 22.979141235 15.738905907 -77.437652588 +v 29.305988312 19.210618973 -75.616073608 +v 29.305988312 15.343950272 -74.815055847 +v 28.841423035 19.931785583 -76.975364685 +v 28.841423035 19.107944489 -75.809478760 +v 29.305988312 15.343950272 -75.615837097 +v 28.638660431 14.950710297 -76.084167480 +v 28.638660431 18.965354919 -76.083694458 +v 28.638660431 18.739192963 -76.514038086 +v 28.638660431 14.950710297 -76.513671875 +v 28.841423035 14.950710297 -75.810668945 +v 29.115013123 14.950710297 -75.031127930 +v 24.735479355 15.422969818 -77.767738342 +v 26.498107910 14.949935913 -76.926391602 +v 29.115013123 15.099842072 -75.031127930 +v 29.115013123 15.099841118 -75.696037292 +v 29.115013123 14.950710297 -75.696037292 +v 22.299789429 19.256931305 -71.016304016 +v 22.154045105 19.003412247 -70.813537598 +v 21.406467438 19.308963776 -70.813537598 +v 21.525495529 19.579319000 -71.016304016 +v 20.775671005 20.174221039 -71.016304016 +v 21.697242737 19.969417572 -71.016304016 +v 20.691417694 19.775112152 -71.016304016 +v 20.632160187 19.494409561 -70.813537598 +v 19.841459274 20.235126495 -71.016304016 +v 19.841461182 19.848402023 -71.016304016 +v 19.841464996 19.556579590 -70.813537598 +v 16.841457367 14.950710297 -70.813537598 +v 20.586040497 14.937191010 -71.819656372 +v 18.894596100 14.938294411 -72.220695496 +v 20.435432434 15.061697960 -72.449722290 +v 18.696746826 15.379846573 -73.383460999 +v 18.772079468 15.265413284 -72.659072876 +v 17.032363892 15.983451843 -73.813018799 +v 21.754692078 14.977915764 -73.410140991 +v 20.325994492 15.450225830 -73.102951050 +v 21.950759888 15.306118011 -73.966735840 +v 21.694307327 15.916619301 -75.330863953 +v 20.282855988 16.405143738 -74.777481079 +v 21.458448410 16.824398041 -78.550865173 +v 21.431514740 16.321739197 -76.831939697 +v 18.578311920 15.797663689 -74.144912720 +v 20.631263733 15.616428375 -73.627922058 +v 18.694887161 16.794986725 -75.507049561 +v 23.809509277 23.007034302 -79.658699036 +v 23.685874939 22.939796448 -79.189224243 +v 24.038337708 23.547147751 -78.586608887 +v 23.465511322 22.890916824 -78.649032593 +v 29.305988312 20.425807953 -77.739372253 +v 29.305988312 20.662504196 -78.768989563 +v 28.841423035 20.531059265 -78.809997559 +v 28.638660431 20.007085800 -77.947113037 +v 28.638660431 19.668453217 -77.126091003 +v 28.841423035 20.294363022 -77.820693970 +v 28.638660431 19.267768860 -77.334770203 +v 28.638660431 20.192857742 -78.881324768 +v 28.638660431 19.579931259 -78.135078430 +v 28.638660431 19.785186768 -78.967300415 +v 28.841423035 20.599388123 -79.813499451 +v 29.305988312 20.730834961 -79.813377380 +v 28.638660431 20.235126495 -79.813499451 +v 28.841423035 19.494409561 -79.028625488 +v 29.841461182 19.308961868 -78.254318237 +v 28.841423035 19.308963776 -78.254318237 +v 29.841461182 19.494409561 -79.028625488 +v 28.841423035 19.556579590 -79.813507080 +v 29.841461182 19.556579590 -79.813507080 +v 28.638660431 19.848402023 -79.813499451 +v 28.841423035 19.003412247 -77.506736755 +v 28.841423035 18.582984924 -76.813499451 +v 29.841461182 18.582984924 -76.813499451 +v 29.841461182 19.003410339 -77.506736755 +v 28.841423035 14.950710297 -76.813499451 +v 29.841461182 14.988102913 -76.813499451 +v 26.069618225 14.947598457 -77.688873291 +v 27.280761719 14.949302673 -81.662971497 +v 26.861991882 14.947669029 -81.228546143 +v 28.196334839 14.950796127 -82.088394165 +v 28.841423035 14.950710297 -82.813499451 +v 28.196334839 14.950674057 -82.655242920 +v 26.867954254 15.440361977 -82.661079407 +v 26.867954254 15.730962753 -82.088844299 +v 29.841461182 14.988102913 -82.813499451 +v 26.535839081 14.949819565 -80.187927246 +v 26.665481567 14.947300911 -80.670341492 +v 25.893093109 14.945127487 -78.708297729 +v 25.875171661 14.947607040 -79.065750122 +v 26.184097290 14.950408936 -79.661888123 +v 24.564708710 15.443685532 -78.836112976 +v 22.942348480 16.209550858 -78.833389282 +v 24.546791077 15.496338844 -79.185707092 +v 24.855716705 15.576368332 -79.749267578 +v 22.946269989 16.330913544 -79.273895264 +v 23.259548187 16.457134247 -79.899765015 +v 22.733558655 22.972330093 -76.940849304 +v 23.201393127 22.975053787 -78.108131409 +v 23.039005280 23.035600662 -77.655403137 +v 23.137948990 21.997629166 -76.671897888 +v 23.481811523 22.259363174 -77.476325989 +v 23.680122375 22.266258240 -77.976188660 +v 23.961961746 22.227539063 -78.594932556 +v 24.210037231 22.282510757 -79.203063965 +v 24.349227905 22.352766037 -79.731590271 +v 21.507698059 17.028732300 -79.056488037 +v 21.912975311 17.337978363 -79.802665710 +v 20.085742950 17.311626434 -76.427032471 +v 20.119037628 17.919717789 -78.256080627 +v 18.678516388 17.549781799 -76.917640686 +v 20.157531738 18.068082809 -78.809753418 +v 20.502685547 18.281394958 -79.627601624 +v 18.786527634 19.179737091 -79.585365295 +v 26.305461884 29.938735962 -80.742683411 +v 25.685838699 30.050054550 -84.391563416 +v 25.666475296 28.903474808 -84.421432495 +v 25.907665253 26.450117111 -80.232681274 +v 26.151550293 26.630941391 -80.783760071 +v 25.638500214 27.246767044 -84.464599609 +v 25.065311432 26.102489471 -84.893760681 +v 25.663249969 24.491418839 -80.759208679 +v 25.920974731 25.083208084 -80.329757690 +v 26.520496368 25.468971252 -81.519325256 +v 26.707901001 24.878492355 -81.515037537 +v 25.468273163 24.755270004 -81.602767944 +v 24.205516815 24.160057068 -80.901245117 +v 24.522552490 23.985321045 -80.395317078 +v 25.201683044 24.895957947 -82.327247620 +v 25.152015686 24.942050934 -84.862052917 +v 24.254001617 24.662267685 -83.632957458 +v 22.481258392 23.758296967 -82.416992188 +v 22.934574127 24.070884705 -82.038009644 +v 23.021926880 24.178052902 -84.502494812 +v 22.100090027 23.673082352 -83.052085876 +v 22.501628876 23.353986740 -81.663024902 +v 21.430339813 29.881513596 -87.753814697 +v 23.237037659 27.381513596 -89.024147034 +v 23.450878143 26.034505844 -87.742164612 +v 22.340473175 28.903474808 -88.446884155 +v 18.217596054 29.553066254 -89.729858398 +v 18.321304321 27.053068161 -90.041275024 +v 18.924333572 25.752410889 -88.468887329 +v 18.244543076 28.903474808 -89.810775757 +v 18.851167679 24.901309967 -88.307090759 +v 21.652906418 23.939552307 -84.968963623 +v 19.944507599 24.132301331 -84.900215149 +v 23.233039856 25.185806274 -87.248916626 +v 21.900707245 23.957534790 -84.885879517 +v 21.899944305 23.594797134 -83.399215698 +v 19.810281754 23.811729431 -83.664077759 +v 20.965631485 23.643945694 -84.022010803 +v 28.841423035 20.531059265 -80.823043823 +v 29.305988312 20.662504196 -80.864067078 +v 29.305988312 20.425807953 -81.893684387 +v 28.638660431 20.174221039 -80.747711182 +v 28.638660431 19.969417572 -81.669281006 +v 28.638660431 19.579319000 -81.497535706 +v 28.638660431 19.775112152 -80.663459778 +v 28.841423035 20.294363022 -81.812339783 +v 28.841423035 19.931049347 -82.659362793 +v 28.638660431 19.652805328 -82.499404907 +v 29.305988312 19.209003448 -84.008346558 +v 29.305988312 20.062494278 -82.775215149 +v 29.305988312 20.016351700 -84.809814453 +v 29.135120392 20.371606827 -84.595443726 +v 29.135120392 20.232873917 -84.595443726 +v 24.623950958 20.371696472 -84.595756531 +v 24.623950958 20.232963562 -84.595756531 +v 24.840267181 20.016441345 -84.811691284 +v 24.126316071 22.467172623 -80.870460510 +v 22.876848221 22.344964981 -81.988014221 +v 23.611503601 23.333345413 -80.670333862 +v 22.431190491 22.181167603 -82.360595703 +v 23.953485489 23.180593491 -80.251121521 +v 24.437995911 22.389266968 -80.373077393 +v 28.841423035 19.308963776 -81.378509521 +v 28.841423035 19.494409561 -80.604202271 +v 29.841461182 19.494409561 -80.604202271 +v 28.841423035 19.003412247 -82.126083374 +v 29.841461182 19.308961868 -81.378509521 +v 29.841461182 19.003410339 -82.126083374 +v 28.638660431 19.256931305 -82.271827698 +v 28.841423035 18.582984924 -82.813499451 +v 29.841461182 18.582984924 -82.813499451 +v 28.638660431 18.719408035 -83.070137024 +v 28.638660431 18.942136765 -83.509399414 +v 28.841423035 19.106327057 -83.812103271 +v 28.638660431 14.950710297 -83.069587708 +v 28.841423035 14.950710297 -83.811058044 +v 29.305988312 15.343961716 -84.008445740 +v 28.638660431 14.950710297 -83.512351990 +v 28.196334839 14.950065613 -83.009132385 +v 26.867954254 14.944667816 -83.010108948 +v 29.115013123 14.950710297 -83.927658081 +v 29.115013123 14.950710297 -84.594779968 +v 29.115013123 15.099852562 -83.927658081 +v 29.115013123 15.099847794 -84.594779968 +v 25.952377319 15.555994034 -81.667083740 +v 25.533611298 15.441658974 -81.235389709 +v 25.271785736 16.370138168 -82.129051208 +v 24.623832703 15.084804535 -84.639930725 +v 29.305988312 15.343955994 -84.809814453 +v 24.623832703 14.946317673 -84.659896851 +v 25.271785736 14.928886414 -83.643524170 +v 25.207458496 15.607461929 -80.229797363 +v 25.337100983 15.596984863 -80.685585022 +v 23.611289978 16.304542542 -80.392143250 +v 23.740932465 16.228935242 -80.838890076 +v 24.356212616 15.971117020 -81.711555481 +v 23.937442780 16.058343887 -81.356719971 +v 22.438049316 17.129186630 -80.770584106 +v 22.308406830 17.217609406 -80.322029114 +v 23.053329468 16.767339706 -81.716812134 +v 22.634559631 16.920852661 -81.308265686 +v 23.968902588 16.563045502 -82.157836914 +v 25.271785736 15.919914246 -82.709167480 +v 25.271785736 15.354865074 -83.046897888 +v 23.967103958 15.168118477 -83.748222351 +v 23.968902588 15.525764465 -83.178428650 +v 23.968902588 14.925689697 -84.537361145 +v 23.968902588 16.310291290 -82.731681824 +v 24.623405457 20.232875824 -89.113616943 +v 24.623947144 20.373481750 -89.107162476 +v 24.837772369 20.016353607 -89.284484863 +v 24.036228180 19.210620880 -89.284408569 +v 22.792137146 20.063232422 -89.284408569 +v 24.839904785 15.343955994 -84.818161011 +v 24.623832703 14.950710297 -89.087051392 +v 24.623832703 15.099842072 -89.087051392 +v 23.567571640 14.950710297 -88.617889404 +v 23.568038940 18.965358734 -88.616928101 +v 23.137702942 18.739194870 -88.616928101 +v 24.035900116 15.343950272 -89.284408569 +v 24.837772369 15.343950272 -89.284484863 +v 23.844284058 14.950710297 -88.813461304 +v 23.138065338 14.950710297 -88.648902893 +v 23.955883026 14.950710297 -89.093292236 +v 23.955883026 15.099841118 -89.093292236 +v 23.840061188 19.106328964 -88.820106506 +v 22.687324524 19.931051254 -88.820106506 +v 22.525646210 19.668455124 -88.616928101 +v 20.873836517 19.212495804 -83.716064453 +v 19.406978607 19.888927460 -84.077728271 +v 19.414176941 21.462732315 -82.990173340 +v 19.958477020 19.926210403 -82.459869385 +v 20.875013351 19.308794022 -82.895057678 +v 21.772899628 23.068262100 -82.548583984 +v 21.598121643 22.997964859 -82.851722717 +v 21.872701645 22.243719101 -83.257759094 +v 22.105762482 23.112348557 -81.993980408 +v 22.056463242 22.266183853 -82.984947205 +v 20.782215118 22.993917465 -83.395591736 +v 19.773288727 23.212579727 -83.083015442 +v 19.805349350 22.443315506 -83.586601257 +v 20.941175461 22.310987473 -83.938491821 +v 20.991313934 18.459091187 -80.719329834 +v 20.861671448 18.407154083 -80.239631653 +v 21.606594086 17.911363602 -81.903717041 +v 21.187824249 18.329421997 -81.446632385 +v 19.342899323 19.541238785 -80.956283569 +v 19.187976837 19.356319427 -80.242729187 +v 19.540824890 19.720926285 -81.783370972 +v 22.522163391 17.274503708 -82.934059143 +v 22.522163391 17.592578888 -82.239845276 +v 22.484359741 16.313440323 -84.120674133 +v 22.518768311 16.689754486 -83.503875732 +v 20.859477997 18.254144669 -84.122451782 +v 20.770414352 20.192859650 -88.616928101 +v 19.838237762 20.235130310 -88.616928101 +v 19.838233948 19.848403931 -88.616928101 +v 21.704624176 20.007087708 -88.616928101 +v 20.684436798 19.785186768 -88.616928101 +v 21.840305328 20.294364929 -88.820106506 +v 20.851005554 20.531061172 -88.820106506 +v 21.912361145 20.425811768 -89.284408569 +v 20.882747650 20.662506104 -89.284408569 +v 22.316970825 19.267770767 -88.616928101 +v 22.154048920 19.003414154 -88.820106506 +v 22.841461182 18.582986832 -88.820106506 +v 22.841461182 18.582986832 -89.813499451 +v 21.406469345 19.308963776 -88.820106506 +v 21.516656876 19.579933167 -88.616928101 +v 22.137996674 19.003410339 -89.813499451 +v 19.838356018 20.730836868 -89.284408569 +v 19.838241577 20.599390030 -88.819694519 +v 20.632162094 19.494411469 -88.820106506 +v 21.390419006 19.308961868 -89.813499451 +v 20.632162094 19.494411469 -89.813499451 +v 19.841468811 19.556581497 -88.820106506 +v 19.841468811 19.556581497 -89.813499451 +v 20.751476288 17.103826523 -84.706436157 +v 19.339275360 18.912166595 -84.394371033 +v 21.049032211 15.863847733 -85.412651062 +v 19.170335770 17.632045746 -84.910621643 +v 20.875701904 14.949906349 -86.055358887 +v 22.390251160 15.629423141 -84.830459595 +v 18.301856995 14.937114716 -86.137916565 +v 22.807044983 14.988101959 -89.813499451 +v 22.841461182 14.950710297 -88.823219299 +v 16.841459274 14.950710297 -88.820114136 +v 16.831239700 14.988101959 -89.813499451 +v 15.818071365 27.487817764 -72.805198669 +v 15.743446350 28.903474808 -73.059967041 +v 16.720575333 28.934715271 -73.143966675 +v 18.047039032 28.909187317 -73.017089844 +v 15.684791565 30.003684998 -73.260215759 +v 18.525236130 26.654150009 -71.953231812 +v 18.162685394 26.808786392 -72.181945801 +v 17.223571777 27.178163528 -72.633407593 +v 17.245525360 25.270286560 -72.983283997 +v 16.740139008 25.390344620 -73.098541260 +v 16.748601913 27.326850891 -72.748352051 +v 18.209056854 25.080087662 -72.513275146 +v 18.169246674 24.404680252 -72.365806580 +v 18.578323364 24.984479904 -72.266166687 +v 18.462497711 24.405164719 -72.263618469 +v 18.657451630 23.969886780 -73.577072144 +v 17.135082245 24.324024200 -73.184768677 +v 18.401916504 23.923854828 -73.576492310 +v 15.684789658 25.591835022 -73.260215759 +v 16.730388641 24.162227631 -73.436096191 +v 15.793661118 24.871000290 -74.105880737 +v 17.519702911 23.677232742 -74.143333435 +v 17.169528961 23.476366043 -74.372077942 +v 15.101604462 24.741426468 -74.480918884 +v 16.451955795 22.982490540 -75.175552368 +v 12.481462479 29.988111496 -72.297737122 +v 12.481460571 28.858713150 -72.394294739 +v 12.481462479 26.238111496 -73.774490356 +v 12.481455803 27.488111496 -72.685501099 +v 9.841464043 28.858713150 -72.394302368 +v 9.841464043 29.988111496 -72.297760010 +v 9.841464043 27.488111496 -72.685501099 +v 9.841464043 26.238111496 -73.774505615 +v 12.481455803 25.478315353 -73.873489380 +v 14.326726913 24.516502380 -75.883964539 +v 9.841368675 24.988111496 -77.254035950 +v 9.841463089 25.488111496 -73.873512268 +v 13.640657425 23.942804337 -77.135154724 +v 12.481455803 24.591220856 -77.239486694 +v 13.473918915 23.923679352 -77.471260071 +v 12.481456757 23.876964569 -79.813499451 +v 13.399394989 23.645229340 -78.492370605 +v 9.841464996 24.988111496 -79.813499451 +v 17.767335892 20.425807953 -70.348968506 +v 18.796949387 20.662504196 -70.348968506 +v 18.837957382 20.531059265 -70.813537598 +v 17.848655701 20.294363022 -70.813537598 +v 18.909282684 20.192857742 -71.016304016 +v 17.003326416 19.931785583 -70.813537598 +v 17.975070953 20.007085800 -71.016304016 +v 17.154048920 19.668453217 -71.016304016 +v 18.163040161 19.579931259 -71.016304016 +v 18.995262146 19.785186768 -71.016304016 +v 16.887557983 20.063230515 -70.348968506 +v 19.056587219 19.494409561 -70.813537598 +v 15.837439537 19.107944489 -70.813537598 +v 16.111656189 18.965354919 -71.016304016 +v 17.362728119 19.267768860 -71.016304016 +v 15.644033432 19.210618973 -70.348968506 +v 18.765943527 23.200260162 -74.275917053 +v 18.538703918 23.132932663 -74.281570435 +v 18.655975342 22.460165024 -73.696899414 +v 18.379405975 22.330810547 -73.808197021 +v 17.710544586 22.778474808 -74.852195740 +v 17.357477188 22.535253525 -75.078155518 +v 17.420154572 21.845836639 -74.421234131 +v 18.282279968 19.308963776 -70.813537598 +v 17.534698486 19.003412247 -70.813537598 +v 16.541996002 18.739192963 -71.016304016 +v 16.841457367 18.582984924 -70.813537598 +v 15.058970451 20.373481750 -70.519836426 +v 14.842990875 20.018226624 -70.348968506 +v 15.058971405 20.234748840 -70.519836426 +v 14.843014717 15.343950272 -70.348968506 +v 15.838632584 14.950710297 -70.813537598 +v 15.643795013 15.343950272 -70.348968506 +v 14.843015671 15.343955994 -74.815391541 +v 16.541629791 14.950710297 -71.016304016 +v 16.112125397 14.950710297 -71.016304016 +v 17.295028687 14.950681686 -73.240432739 +v 16.225315094 14.950619698 -74.404861450 +v 15.059083939 14.950710297 -70.539947510 +v 15.723994255 14.950710297 -70.539947510 +v 15.723994255 15.099841118 -70.539947510 +v 15.059083939 15.099842072 -70.539947510 +v 15.059083939 15.099847794 -75.034667969 +v 15.062631607 14.950710297 -75.032218933 +v 15.993486404 16.043682098 -74.891418457 +v 17.580718994 18.601600647 -76.582916260 +v 17.608123779 18.033020020 -75.992507935 +v 18.956254959 16.238872528 -74.623527527 +v 16.658613205 17.280139923 -75.766830444 +v 16.858667374 16.648092270 -75.071937561 +v 14.842651367 19.999349594 -74.815307617 +v 15.058968544 20.170953751 -75.031242371 +v 15.689005852 16.945304871 -75.395370483 +v 14.469780922 17.697820663 -75.849273682 +v 14.633446693 16.660942078 -75.592468262 +v 15.504920006 18.060466766 -76.458518982 +v 15.058967590 20.286876678 -75.031242371 +v 15.580442429 22.254665375 -76.067657471 +v 16.570756912 21.943433762 -75.816146851 +v 16.149850845 21.184806824 -75.519653320 +v 15.663236618 21.165817261 -76.608116150 +v 15.639649391 20.889797211 -76.033630371 +v 15.230363846 20.653139114 -76.445938110 +v 17.006267548 21.571250916 -74.693077087 +v 16.605232239 21.943433762 -75.816146851 +v 14.933979988 22.035934448 -78.985809326 +v 14.907885551 21.989849091 -78.614784241 +v 15.965945244 20.967689514 -78.567970276 +v 15.890275955 21.048503876 -78.917999268 +v 15.283826828 22.158493042 -79.612579346 +v 17.397212982 19.778511047 -78.448715210 +v 16.154167175 21.231525421 -79.520309448 +v 17.266906738 19.912086487 -78.838211060 +v 14.990085602 21.806129456 -77.740325928 +v 15.364355087 21.519338608 -77.042915344 +v 16.191160202 20.680904388 -77.723434448 +v 14.957674980 22.561777115 -76.607536316 +v 15.367637634 22.353986740 -76.263748169 +v 14.490463257 22.840423584 -77.478836060 +v 16.308990479 19.685749054 -76.490653992 +v 16.175315857 20.300151825 -76.929840088 +v 18.414966583 18.401939392 -78.381942749 +v 17.587017059 19.222574234 -77.421653748 +v 18.426315308 18.667060852 -78.873901367 +v 17.356460571 20.098489761 -79.467292786 +v 15.592473984 19.060592651 -76.803924561 +v 14.817337990 18.983997345 -76.982727051 +v 10.541421890 20.371696472 -75.031005859 +v 10.541421890 20.232963562 -75.031005859 +v 10.370553970 20.016441345 -74.814689636 +v 13.694046021 19.710155487 -76.971282959 +v 13.428596497 20.853733063 -79.356292725 +v 13.365878105 20.853733063 -78.175544739 +v 13.549103737 20.215240479 -77.503173828 +v 14.390188217 22.835433960 -77.743637085 +v 14.358359337 22.587871552 -79.014625549 +v 14.372740746 22.729833603 -78.576995850 +v 14.723241806 22.743982315 -79.741401672 +v 13.407335281 23.436180115 -79.013099670 +v 13.797117233 23.424091339 -79.871200562 +v 10.370553970 20.062496185 -76.848564148 +v 10.370553970 19.209005356 -75.615425110 +v 10.834850311 19.107944489 -75.809478760 +v 11.038029671 18.942138672 -76.114372253 +v 11.038028717 19.652805328 -77.124366760 +v 10.834851265 19.931785583 -76.975364685 +v 10.370553017 20.662506104 -78.759712219 +v 10.370553017 20.425811768 -77.730094910 +v 10.370553017 20.730836868 -79.810394287 +v 10.834851265 20.531061172 -78.809997559 +v 10.834850311 20.294364929 -77.820701599 +v 11.038028717 19.969421387 -77.954490662 +v 11.038028717 19.256933212 -77.351943970 +v 11.038028717 19.579320908 -78.126243591 +v 10.834850311 19.308963776 -78.254318237 +v 9.841461182 19.308965683 -78.254318237 +v 9.841462135 19.494411469 -79.028625488 +v 11.038028717 19.775114059 -78.960319519 +v 11.038028717 20.174222946 -78.876060486 +v 10.834851265 19.494411469 -79.028625488 +v 10.835263252 20.599390030 -79.810279846 +v 11.038028717 19.848403931 -79.810272217 +v 9.841462135 19.556581497 -79.813507080 +v 11.038028717 20.235130310 -79.810279846 +v 10.834850311 19.556581497 -79.813507080 +v 12.184720993 16.376655579 -78.849044800 +v 12.877394676 19.252302170 -79.155899048 +v 13.270064354 19.252302170 -79.928024292 +v 13.095947266 18.804010391 -77.196586609 +v 12.300619125 17.382823944 -77.248023987 +v 12.916456223 19.252302170 -77.798713684 +v 12.728396416 17.382823944 -76.634635925 +v 13.275438309 18.355716705 -76.594451904 +v 13.140472412 17.382823944 -76.043762207 +v 10.370553017 15.343961716 -75.615753174 +v 10.370471001 15.343955994 -74.815055847 +v 10.834850311 18.582986832 -76.813499451 +v 9.841462135 18.582986832 -76.813499451 +v 9.841461182 19.003414154 -77.506736755 +v 11.038029671 18.719409943 -76.553642273 +v 10.834850311 19.003414154 -77.506736755 +v 10.834848404 14.951487541 -75.810676575 +v 11.038029671 14.951487541 -76.111419678 +v 11.044261932 14.951487541 -76.557403564 +v 12.175566673 14.938457489 -75.595718384 +v 10.567905426 14.951487541 -75.032218933 +v 10.567905426 15.099847794 -75.032218933 +v 10.561667442 15.099852562 -75.695053101 +v 10.561667442 14.951487541 -75.695053101 +v 11.428196907 14.924728394 -78.595741272 +v 12.577390671 16.376655579 -79.621170044 +v 11.820867538 14.924728394 -79.367866516 +v 10.834849358 14.937757492 -76.813499451 +v 9.841461182 14.988102913 -76.813499451 +v 9.797045708 18.615947723 -76.733764648 +v 9.841461182 14.988102913 -82.813499451 +v 9.841462135 19.003414154 -82.126091003 +v 9.841462135 18.582986832 -82.813499451 +v 9.841462135 19.308965683 -81.378509521 +v 9.841461182 19.494411469 -80.604202271 +v 12.481460571 28.903474808 -86.941497803 +v 15.313100815 28.903474808 -87.490287781 +v 15.296688080 29.545209885 -87.612686157 +v 12.481462479 29.988113403 -86.941497803 +v 12.481456757 27.488113403 -86.941490173 +v 9.841465950 29.988111496 -87.329231262 +v 9.841465950 28.858713150 -87.232696533 +v 9.841465950 27.488111496 -86.941505432 +v 14.277844429 23.393224716 -80.594512939 +v 14.455027580 23.561286926 -81.253829956 +v 12.481463432 24.737924576 -82.387504578 +v 14.723598480 23.582912445 -82.016731262 +v 15.364147186 23.638420105 -83.156723022 +v 9.841465950 26.238111496 -85.852500916 +v 12.481462479 26.238113403 -85.852493286 +v 15.360628128 27.045209885 -87.135848999 +v 15.797599792 25.972791672 -86.195816040 +v 12.481456757 25.488113403 -85.753501892 +v 9.841465950 25.488111496 -85.753494263 +v 15.738739014 25.267404556 -86.186729431 +v 17.516098022 23.335683823 -82.759796143 +v 18.653358459 23.667816162 -83.212455750 +v 18.540206909 24.219396591 -84.522186279 +v 17.128713608 23.555570602 -83.480865479 +v 18.667587280 22.528354645 -83.149971008 +v 18.762870789 23.123046875 -82.676109314 +v 17.769180298 22.723236084 -82.368392944 +v 17.548355103 22.285589218 -82.930236816 +v 18.299018860 21.698566437 -83.135536194 +v 18.299633026 22.112844467 -82.534400940 +v 17.343858719 22.503286362 -82.168144226 +v 17.795085907 20.623046875 -80.934585571 +v 18.047508240 20.899999619 -81.670639038 +v 16.956222534 21.655448914 -81.338508606 +v 18.500097275 21.186233521 -82.271835327 +v 16.428874969 22.516170502 -81.662994385 +v 17.385707855 21.768718719 -81.907676697 +v 18.294757843 20.863731384 -83.381980896 +v 18.220481873 19.797840118 -83.738861084 +v 17.601169586 20.357986450 -80.238296509 +v 15.655702591 22.447345734 -80.161003113 +v 16.550643921 21.352880478 -80.101470947 +v 16.722076416 21.495004654 -80.637100220 +v 15.806715012 22.605678558 -80.663780212 +v 17.070299149 22.044887543 -82.607398987 +v 16.659742355 20.853733063 -82.871192932 +v 15.355899811 20.853733063 -82.468498230 +v 17.451713562 20.503826141 -83.742225647 +v 15.295934677 23.441549301 -82.610466003 +v 15.500967979 23.194305420 -81.540473938 +v 15.980512619 22.986270905 -82.037948608 +v 15.275939941 23.389579773 -80.901260376 +v 15.670108795 23.259626389 -82.971130371 +v 16.010105133 22.582714081 -81.228546143 +v 16.294021606 22.860517502 -82.340133667 +v 17.028942108 23.000946045 -82.523216248 +v 16.547252655 23.328453064 -83.191894531 +v 15.091239929 23.186864853 -80.365119934 +v 13.821267128 20.853733063 -80.128417969 +v 14.063079834 20.853733063 -80.807723999 +v 14.746932030 20.853733063 -82.280418396 +v 14.285540581 20.853733063 -81.432670593 +v 13.734337807 19.252302170 -81.232284546 +v 9.841464996 24.988111496 -82.387512207 +v 10.834851265 20.531061172 -80.823043823 +v 10.370553017 20.662506104 -80.854789734 +v 10.834850311 19.494411469 -80.604202271 +v 11.038027763 19.785186768 -80.656471252 +v 11.038027763 20.192859650 -80.742454529 +v 10.370553017 20.425811768 -81.884399414 +v 10.370553017 20.063232422 -82.764175415 +v 10.834851265 20.294364929 -81.812347412 +v 11.038027763 19.579933167 -81.488693237 +v 11.038027763 20.007087708 -81.676666260 +v 11.038027763 19.668455124 -82.497688293 +v 10.547799110 20.234748840 -84.595985413 +v 15.059513092 20.232875824 -84.595672607 +v 15.059513092 20.371608734 -84.595672607 +v 10.370471001 20.016353607 -84.809814453 +v 14.845148087 20.016353607 -84.811607361 +v 14.552314758 19.252302170 -82.628776550 +v 14.338544846 16.376655579 -82.885971069 +v 16.162754059 19.252302170 -83.525245667 +v 10.834851265 19.003414154 -82.126091003 +v 10.834851265 19.308963776 -81.378509521 +v 11.038027763 19.267770767 -82.289009094 +v 10.834851265 19.106328964 -83.812103271 +v 10.834851265 19.931051254 -82.659362793 +v 10.370553017 19.210620880 -84.008270264 +v 11.038027763 18.965358734 -83.540084839 +v 11.038027763 18.739194870 -83.109741211 +v 10.834850311 18.582986832 -82.813499451 +v 13.707309723 19.186428070 -81.221466064 +v 13.041664124 16.376655579 -80.925430298 +v 13.527381897 14.924728394 -83.489402771 +v 11.570766449 14.924728394 -80.672126770 +v 10.834849358 14.937757492 -82.813499451 +v 17.518198013 19.252302170 -84.293426514 +v 18.020149231 18.335988998 -84.308212280 +v 18.102117538 15.832498550 -85.543647766 +v 18.853557587 15.782326698 -85.912292480 +v 16.129116058 16.376655579 -83.949760437 +v 15.060180664 14.937757492 -84.592330933 +v 17.285715103 16.376655579 -85.060470581 +v 18.787670135 20.662506104 -89.284408569 +v 17.758056641 20.425811768 -89.284408569 +v 16.876522064 20.062496185 -89.284408569 +v 17.848659515 20.294364929 -88.820106506 +v 18.837959290 20.531061172 -88.820106506 +v 18.904026031 20.174222946 -88.616928101 +v 16.581602097 18.719409943 -88.616928101 +v 17.379907608 19.256933212 -88.616928101 +v 17.152332306 19.652805328 -88.616928101 +v 17.003330231 19.931785583 -88.820106506 +v 15.837440491 19.107944489 -88.820106506 +v 16.142333984 18.942138672 -88.616928101 +v 16.841457367 18.582986832 -88.820106506 +v 16.831239700 18.582984924 -89.813499451 +v 17.534702301 19.003414154 -89.813499451 +v 19.056587219 19.494411469 -88.820106506 +v 17.982456207 19.969421387 -88.616928101 +v 18.988279343 19.775114059 -88.616928101 +v 18.154201508 19.579320908 -88.616928101 +v 17.769893646 14.937680244 -86.186363220 +v 16.585369110 14.950710297 -88.610694885 +v 17.534702301 19.003414154 -88.820106506 +v 18.282279968 19.308965683 -89.813499451 +v 19.056587219 19.494411469 -89.813499451 +v 18.282279968 19.308963776 -88.820106506 +v 16.139383316 14.950710297 -88.616928101 +v 10.370471001 15.343950272 -84.809814453 +v 11.038027763 14.937757492 -83.539611816 +v 10.567904472 15.099842072 -84.595870972 +v 15.060180664 15.099842072 -84.592330933 +v 14.845148087 15.343950272 -84.811607361 +v 10.567904472 14.937757492 -84.595870972 +v 10.841497421 14.937757492 -83.816322327 +v 11.038027763 14.937757492 -83.110107422 +v 10.370553017 15.343950272 -84.007942200 +v 10.561665535 15.099841118 -83.927925110 +v 10.561665535 14.937757492 -83.927925110 +v 15.643386841 19.209005356 -89.284408569 +v 14.842651367 20.016441345 -89.284408569 +v 15.058968544 20.371696472 -89.113540649 +v 15.059513092 20.232873917 -89.107162476 +v 15.643715858 15.343961716 -89.284408569 +v 15.838634491 14.950710297 -88.820114136 +v 14.843015671 15.343955994 -89.284484863 +v 15.060181618 14.950710297 -89.087051392 +v 15.060180664 15.099847794 -89.087051392 +v 15.723011017 14.950710297 -89.093292236 +v 15.723011017 15.099852562 -89.093292236 +f 1 2 3 +f 4 5 1 +f 6 7 4 +f 7 8 4 +f 8 9 4 +f 7 10 8 +f 4 1 3 +f 11 12 6 +f 12 13 6 +f 13 14 6 +f 12 15 13 +f 16 17 12 +f 6 18 7 +f 18 19 7 +f 6 20 18 +f 11 6 4 +f 11 16 12 +f 11 21 16 +f 22 23 11 +f 23 24 11 +f 24 25 11 +f 23 26 24 +f 22 27 23 +f 27 28 23 +f 29 30 3 +f 30 31 3 +f 31 22 3 +f 22 4 3 +f 22 11 4 +f 30 32 31 +f 31 33 22 +f 33 34 22 +f 31 35 33 +f 22 36 27 +f 37 38 39 +f 40 39 41 +f 41 42 40 +f 39 40 37 +f 43 44 38 +f 38 37 43 +f 45 46 47 +f 47 48 45 +f 49 46 45 +f 45 50 49 +f 51 52 53 +f 53 50 51 +f 49 54 55 +f 55 56 49 +f 54 49 50 +f 50 53 54 +f 48 47 39 +f 46 49 56 +f 50 45 44 +f 39 47 46 +f 44 45 48 +f 39 38 48 +f 44 51 50 +f 56 41 46 +f 46 41 39 +f 48 38 44 +f 52 57 58 +f 58 53 52 +f 59 55 54 +f 54 60 59 +f 60 54 53 +f 53 58 60 +f 61 58 57 +f 62 59 60 +f 60 63 62 +f 57 64 61 +f 63 60 58 +f 58 61 63 +f 65 66 67 +f 67 68 65 +f 69 70 71 +f 71 72 69 +f 72 71 66 +f 66 65 72 +f 64 73 74 +f 74 61 64 +f 75 62 63 +f 63 76 75 +f 76 63 61 +f 61 74 76 +f 77 75 76 +f 76 78 77 +f 73 79 80 +f 80 74 73 +f 78 76 74 +f 74 80 78 +f 81 82 83 +f 83 84 81 +f 81 85 86 +f 86 82 81 +f 87 77 78 +f 78 85 87 +f 79 88 86 +f 86 80 79 +f 85 78 80 +f 80 86 85 +f 82 86 88 +f 85 81 70 +f 84 83 66 +f 70 81 84 +f 66 83 82 +f 82 67 66 +f 66 71 84 +f 88 67 82 +f 84 71 70 +f 70 87 85 +f 6 14 89 +f 89 90 6 +f 14 13 91 +f 91 89 14 +f 13 15 92 +f 92 91 13 +f 90 89 93 +f 93 94 90 +f 89 91 95 +f 95 93 89 +f 91 92 96 +f 96 95 91 +f 97 98 19 +f 18 20 99 +f 99 97 18 +f 20 6 90 +f 90 99 20 +f 7 19 98 +f 98 100 7 +f 19 18 97 +f 99 90 94 +f 94 101 99 +f 100 98 102 +f 102 103 100 +f 98 97 104 +f 104 102 98 +f 97 99 101 +f 101 104 97 +f 15 12 105 +f 105 92 15 +f 12 17 106 +f 106 105 12 +f 107 106 17 +f 108 96 92 +f 105 106 109 +f 109 108 105 +f 110 109 106 +f 92 105 108 +f 17 16 107 +f 16 21 111 +f 111 107 16 +f 21 11 112 +f 112 111 21 +f 106 107 110 +f 107 111 113 +f 113 110 107 +f 111 112 114 +f 114 113 111 +f 11 25 115 +f 115 112 11 +f 25 24 116 +f 116 115 25 +f 24 26 117 +f 117 116 24 +f 26 23 118 +f 118 117 26 +f 23 28 119 +f 119 118 23 +f 120 121 116 +f 112 115 122 +f 122 114 112 +f 115 116 121 +f 121 122 115 +f 116 117 120 +f 123 124 118 +f 117 118 124 +f 124 120 117 +f 118 119 123 +f 28 27 125 +f 125 119 28 +f 27 36 126 +f 126 125 27 +f 127 126 36 +f 125 126 128 +f 119 125 129 +f 129 123 119 +f 130 128 126 +f 128 129 125 +f 96 108 131 +f 131 132 96 +f 108 109 133 +f 133 131 108 +f 134 133 109 +f 94 93 135 +f 135 136 94 +f 93 95 137 +f 137 135 93 +f 95 96 132 +f 132 137 95 +f 138 139 102 +f 104 101 140 +f 140 138 104 +f 101 94 136 +f 136 140 101 +f 103 102 139 +f 139 141 103 +f 102 104 138 +f 136 135 142 +f 142 143 136 +f 135 137 144 +f 144 142 135 +f 137 132 145 +f 145 144 137 +f 143 142 146 +f 146 147 143 +f 142 144 148 +f 148 146 142 +f 144 145 149 +f 149 148 144 +f 150 151 152 +f 152 153 150 +f 151 143 147 +f 147 152 151 +f 154 155 156 +f 156 157 154 +f 147 146 155 +f 155 154 147 +f 157 156 158 +f 155 159 160 +f 160 156 155 +f 146 148 159 +f 159 155 146 +f 161 158 162 +f 162 158 156 +f 163 164 153 +f 165 166 161 +f 164 163 167 +f 167 168 164 +f 153 152 163 +f 166 165 168 +f 168 167 166 +f 161 166 167 +f 167 157 161 +f 158 161 157 +f 165 161 162 +f 163 154 157 +f 157 167 163 +f 152 147 154 +f 154 163 152 +f 169 145 132 +f 131 133 170 +f 170 169 131 +f 171 170 133 +f 132 131 169 +f 145 169 172 +f 172 149 145 +f 169 170 173 +f 173 172 169 +f 174 173 170 +f 148 149 175 +f 175 159 148 +f 159 175 176 +f 176 160 159 +f 156 160 162 +f 177 162 160 +f 160 176 177 +f 165 162 178 +f 179 175 149 +f 162 180 178 +f 162 177 180 +f 176 181 180 +f 180 177 176 +f 175 179 181 +f 181 176 175 +f 149 172 179 +f 182 181 179 +f 172 173 183 +f 184 180 181 +f 181 182 184 +f 183 179 172 +f 179 183 182 +f 180 184 178 +f 185 182 183 +f 186 183 173 +f 178 184 182 +f 182 185 178 +f 183 186 185 +f 173 174 186 +f 140 136 143 +f 143 151 140 +f 141 139 187 +f 187 188 141 +f 139 138 150 +f 150 187 139 +f 138 140 151 +f 151 150 138 +f 188 187 189 +f 189 190 188 +f 187 150 153 +f 153 189 187 +f 191 192 193 +f 194 193 195 +f 196 195 165 +f 189 153 164 +f 165 197 198 +f 198 168 165 +f 164 199 189 +f 195 197 165 +f 199 164 168 +f 168 198 199 +f 193 198 197 +f 192 199 198 +f 198 193 192 +f 190 189 199 +f 199 192 190 +f 197 195 193 +f 123 129 200 +f 200 201 123 +f 129 128 202 +f 202 200 129 +f 203 202 128 +f 109 110 134 +f 110 113 204 +f 204 134 110 +f 113 114 205 +f 205 204 113 +f 114 122 206 +f 206 205 114 +f 122 121 207 +f 207 206 122 +f 121 120 208 +f 208 207 121 +f 120 124 209 +f 209 208 120 +f 124 123 201 +f 201 209 124 +f 133 134 171 +f 134 204 210 +f 210 171 134 +f 204 205 211 +f 211 210 204 +f 212 213 207 +f 205 206 214 +f 214 211 205 +f 206 207 213 +f 213 214 206 +f 207 208 212 +f 208 209 215 +f 215 212 208 +f 209 201 216 +f 216 215 209 +f 217 218 219 +f 165 178 220 +f 178 221 220 +f 221 217 220 +f 221 218 217 +f 170 171 174 +f 171 210 222 +f 222 174 171 +f 210 211 223 +f 223 222 210 +f 185 224 225 +f 226 186 174 +f 225 178 185 +f 186 226 224 +f 224 185 186 +f 174 222 226 +f 222 223 227 +f 228 225 224 +f 224 229 228 +f 227 226 222 +f 178 228 221 +f 178 225 228 +f 226 227 229 +f 229 224 226 +f 211 214 230 +f 230 223 211 +f 214 213 231 +f 231 230 214 +f 213 212 232 +f 232 231 213 +f 212 215 233 +f 233 232 212 +f 215 216 234 +f 234 233 215 +f 229 235 236 +f 227 237 235 +f 235 229 227 +f 236 228 229 +f 228 236 221 +f 221 236 235 +f 223 230 237 +f 237 227 223 +f 238 237 230 +f 235 239 221 +f 237 238 239 +f 239 235 237 +f 230 231 238 +f 219 239 238 +f 240 238 231 +f 238 240 219 +f 218 221 239 +f 239 219 218 +f 231 232 240 +f 240 241 242 +f 242 219 240 +f 219 242 217 +f 232 233 241 +f 241 240 232 +f 201 200 243 +f 243 216 201 +f 244 243 200 +f 200 202 244 +f 245 244 202 +f 216 243 246 +f 246 234 216 +f 243 244 247 +f 247 246 243 +f 248 247 244 +f 249 241 233 +f 242 250 251 +f 251 217 242 +f 217 251 220 +f 241 249 250 +f 250 242 241 +f 233 234 249 +f 234 246 252 +f 252 249 234 +f 220 251 250 +f 250 253 220 +f 249 252 253 +f 253 250 249 +f 252 254 255 +f 255 253 252 +f 246 247 254 +f 254 252 246 +f 256 220 253 +f 253 255 256 +f 220 256 257 +f 258 254 247 +f 259 255 254 +f 257 256 255 +f 9 8 260 +f 8 10 261 +f 261 260 8 +f 10 7 100 +f 100 261 10 +f 260 262 9 +f 263 264 5 +f 4 9 262 +f 262 263 4 +f 5 4 263 +f 262 260 265 +f 260 261 266 +f 266 265 260 +f 261 100 103 +f 103 266 261 +f 263 262 267 +f 267 268 263 +f 268 269 264 +f 265 267 262 +f 264 263 268 +f 3 2 270 +f 270 271 3 +f 2 1 272 +f 272 270 2 +f 5 264 1 +f 264 272 1 +f 3 271 29 +f 270 272 273 +f 273 274 270 +f 272 264 269 +f 269 273 272 +f 271 270 274 +f 275 271 276 +f 274 276 271 +f 31 32 277 +f 277 278 31 +f 32 30 279 +f 279 277 32 +f 30 29 275 +f 275 279 30 +f 271 275 29 +f 278 277 280 +f 280 281 278 +f 277 279 282 +f 282 280 277 +f 279 275 283 +f 283 282 279 +f 276 283 275 +f 284 285 34 +f 36 22 127 +f 22 34 285 +f 285 127 22 +f 33 35 286 +f 35 31 278 +f 278 286 35 +f 286 284 33 +f 34 33 284 +f 287 130 127 +f 288 287 285 +f 126 127 130 +f 127 285 287 +f 289 288 284 +f 286 278 281 +f 285 284 288 +f 281 289 286 +f 284 286 289 +f 290 291 274 +f 269 292 273 +f 292 290 273 +f 276 274 291 +f 291 293 276 +f 274 273 290 +f 293 294 276 +f 267 265 295 +f 265 266 296 +f 296 295 265 +f 266 103 141 +f 141 296 266 +f 295 297 267 +f 298 292 269 +f 268 267 297 +f 297 298 268 +f 269 268 298 +f 297 295 299 +f 295 296 300 +f 300 299 295 +f 296 141 188 +f 188 300 296 +f 299 301 297 +f 292 298 302 +f 302 303 292 +f 298 297 301 +f 301 302 298 +f 303 304 290 +f 305 306 304 +f 291 290 304 +f 304 306 291 +f 290 292 303 +f 301 299 307 +f 307 308 301 +f 299 300 309 +f 309 307 299 +f 300 188 190 +f 190 309 300 +f 310 196 311 +f 195 310 194 +f 312 196 165 +f 196 310 195 +f 313 191 194 +f 307 309 191 +f 193 194 191 +f 309 190 192 +f 192 191 309 +f 311 194 310 +f 308 307 313 +f 191 313 307 +f 313 314 308 +f 314 313 311 +f 194 311 313 +f 315 311 196 +f 311 315 314 +f 196 316 315 +f 317 316 196 +f 318 304 319 +f 304 303 319 +f 303 302 320 +f 320 319 303 +f 302 301 308 +f 308 320 302 +f 321 322 323 +f 312 317 196 +f 324 323 319 +f 312 325 317 +f 317 325 322 +f 320 308 314 +f 324 314 315 +f 315 321 324 +f 316 317 321 +f 321 315 316 +f 319 320 324 +f 322 321 317 +f 314 324 320 +f 323 324 321 +f 326 322 325 +f 322 326 327 +f 318 319 323 +f 323 327 318 +f 327 323 322 +f 326 328 329 +f 330 318 327 +f 312 331 328 +f 328 326 312 +f 329 328 332 +f 327 329 330 +f 318 330 333 +f 329 327 326 +f 334 335 44 +f 335 334 336 +f 336 337 335 +f 44 43 334 +f 42 41 338 +f 339 338 333 +f 333 330 339 +f 338 339 42 +f 42 339 334 +f 330 332 339 +f 332 330 329 +f 42 43 37 +f 37 40 42 +f 334 43 42 +f 340 305 333 +f 340 306 305 +f 341 306 340 +f 56 55 342 +f 333 305 304 +f 343 344 335 +f 335 344 51 +f 51 44 335 +f 344 345 52 +f 52 51 344 +f 346 345 344 +f 344 343 346 +f 335 337 343 +f 347 348 64 +f 64 57 347 +f 349 348 347 +f 345 346 350 +f 347 350 349 +f 350 347 345 +f 345 347 57 +f 57 52 345 +f 342 351 352 +f 352 341 342 +f 353 306 341 +f 341 352 353 +f 342 55 59 +f 59 351 342 +f 306 353 293 +f 294 293 353 +f 353 354 294 +f 293 291 306 +f 354 353 352 +f 62 355 351 +f 351 355 356 +f 356 352 351 +f 351 59 62 +f 352 356 354 +f 342 357 56 +f 41 56 357 +f 357 338 41 +f 338 357 340 +f 340 333 338 +f 357 342 341 +f 341 340 357 +f 333 304 318 +f 358 328 331 +f 332 328 358 +f 281 280 359 +f 359 360 281 +f 280 282 361 +f 361 359 280 +f 282 283 362 +f 362 361 282 +f 276 294 283 +f 294 362 283 +f 363 203 130 +f 364 363 287 +f 128 130 203 +f 130 287 363 +f 365 364 288 +f 289 281 360 +f 360 365 289 +f 287 288 364 +f 288 289 365 +f 325 312 326 +f 312 165 220 +f 366 331 312 +f 356 367 368 +f 355 62 75 +f 75 369 355 +f 355 369 367 +f 367 356 355 +f 339 332 370 +f 334 339 371 +f 372 336 334 +f 331 366 358 +f 366 373 374 +f 374 358 366 +f 375 376 377 +f 377 378 375 +f 376 375 358 +f 378 377 379 +f 358 374 376 +f 334 380 372 +f 370 371 339 +f 371 380 334 +f 358 370 332 +f 361 362 368 +f 368 381 361 +f 381 368 367 +f 362 294 354 +f 368 354 356 +f 354 368 362 +f 67 88 382 +f 383 382 88 +f 382 384 385 +f 385 386 382 +f 88 79 383 +f 383 387 384 +f 384 382 383 +f 382 386 67 +f 388 367 369 +f 369 389 388 +f 367 388 381 +f 369 75 77 +f 77 389 369 +f 79 73 390 +f 390 391 387 +f 387 383 390 +f 348 390 73 +f 348 349 391 +f 73 64 348 +f 390 383 79 +f 391 390 348 +f 359 361 381 +f 381 379 359 +f 360 359 379 +f 379 392 360 +f 381 393 379 +f 389 77 87 +f 394 381 388 +f 393 395 379 +f 394 395 393 +f 381 394 393 +f 203 363 396 +f 202 203 245 +f 396 245 203 +f 397 396 363 +f 398 397 364 +f 392 398 365 +f 365 360 392 +f 363 364 397 +f 364 365 398 +f 373 366 399 +f 366 312 399 +f 312 400 399 +f 312 220 400 +f 244 245 248 +f 245 396 401 +f 401 248 245 +f 396 397 402 +f 402 401 396 +f 403 258 248 +f 247 248 258 +f 404 259 258 +f 220 257 400 +f 255 259 257 +f 405 257 259 +f 259 404 405 +f 254 258 259 +f 248 401 403 +f 257 405 400 +f 258 403 404 +f 400 405 404 +f 406 403 401 +f 403 406 407 +f 404 407 400 +f 401 402 406 +f 407 404 403 +f 397 398 408 +f 408 402 397 +f 398 392 409 +f 409 408 398 +f 392 379 377 +f 377 409 392 +f 373 399 410 +f 411 412 410 +f 399 413 414 +f 414 410 399 +f 400 413 399 +f 411 406 402 +f 406 411 414 +f 414 407 406 +f 407 414 413 +f 402 408 411 +f 413 400 407 +f 376 412 409 +f 374 410 412 +f 409 377 376 +f 410 374 373 +f 412 376 374 +f 408 409 412 +f 412 411 408 +f 410 414 411 +f 389 415 394 +f 394 388 389 +f 415 416 395 +f 379 395 378 +f 87 415 389 +f 395 394 415 +f 415 87 70 +f 70 416 415 +f 68 67 386 +f 385 372 380 +f 380 386 385 +f 416 371 378 +f 416 70 69 +f 69 371 416 +f 378 395 416 +f 386 380 68 +f 378 370 358 +f 68 69 72 +f 72 65 68 +f 370 378 371 +f 358 375 378 +f 69 68 380 +f 380 371 69 +f 417 418 419 +f 420 421 418 +f 422 423 421 +f 424 425 423 +f 426 427 425 +f 428 429 427 +f 430 431 429 +f 432 433 431 +f 418 417 420 +f 427 426 428 +f 423 422 424 +f 429 428 430 +f 421 420 422 +f 431 430 432 +f 425 424 426 +f 433 432 434 +f 435 436 437 +f 438 436 435 +f 439 437 436 +f 437 439 440 +f 429 438 435 +f 438 429 431 +f 441 442 443 +f 441 433 442 +f 444 436 445 +f 438 445 436 +f 446 445 438 +f 446 433 441 +f 431 446 438 +f 446 431 433 +f 384 447 448 +f 436 444 439 +f 385 384 448 +f 447 449 450 +f 384 387 447 +f 448 450 451 +f 450 448 447 +f 440 452 437 +f 453 437 452 +f 435 437 453 +f 452 440 454 +f 427 435 453 +f 435 427 429 +f 454 455 452 +f 456 452 455 +f 425 453 456 +f 453 425 427 +f 453 452 456 +f 455 454 457 +f 458 459 460 +f 387 391 459 +f 387 459 447 +f 449 447 459 +f 459 458 449 +f 391 460 459 +f 461 460 462 +f 349 462 460 +f 391 349 460 +f 460 461 458 +f 457 458 461 +f 449 454 440 +f 454 449 458 +f 450 440 439 +f 440 450 449 +f 451 439 444 +f 439 451 450 +f 458 457 454 +f 463 464 451 +f 465 372 464 +f 448 464 372 +f 466 467 468 +f 469 470 466 +f 468 471 466 +f 470 472 467 +f 467 466 470 +f 466 471 469 +f 469 471 468 +f 451 464 448 +f 444 445 469 +f 444 463 451 +f 372 385 448 +f 470 445 446 +f 441 470 446 +f 445 470 469 +f 473 444 469 +f 473 463 444 +f 470 441 472 +f 474 455 475 +f 456 455 474 +f 475 457 476 +f 457 475 455 +f 423 456 474 +f 456 423 425 +f 477 475 478 +f 474 475 477 +f 421 474 477 +f 474 421 423 +f 478 476 479 +f 476 478 475 +f 480 462 481 +f 476 461 480 +f 461 476 457 +f 462 480 461 +f 350 481 462 +f 349 350 462 +f 479 480 482 +f 482 481 483 +f 483 484 482 +f 346 343 483 +f 346 483 481 +f 350 346 481 +f 481 482 480 +f 480 479 476 +f 485 479 486 +f 479 485 478 +f 487 478 485 +f 418 477 487 +f 477 418 421 +f 477 478 487 +f 484 483 488 +f 488 489 484 +f 482 486 479 +f 486 482 484 +f 343 488 483 +f 484 490 486 +f 491 485 492 +f 487 419 418 +f 487 485 491 +f 490 484 489 +f 492 486 490 +f 486 492 485 +f 493 419 491 +f 493 494 419 +f 419 487 491 +f 493 495 494 +f 372 465 336 +f 337 336 465 +f 496 497 465 +f 498 489 496 +f 499 491 492 +f 489 498 490 +f 490 499 492 +f 500 491 501 +f 491 500 493 +f 491 499 501 +f 499 490 498 +f 337 497 488 +f 343 337 488 +f 489 488 497 +f 497 496 489 +f 465 497 337 +f 499 502 503 +f 503 502 504 +f 505 504 500 +f 504 505 503 +f 503 505 499 +f 499 505 501 +f 500 501 505 +f 506 442 433 +f 507 443 442 +f 508 441 443 +f 433 434 506 +f 442 506 507 +f 443 507 508 +f 472 508 509 +f 463 473 510 +f 469 468 511 +f 512 467 472 +f 508 472 441 +f 473 469 513 +f 464 463 514 +f 515 468 467 +f 511 513 469 +f 510 514 463 +f 513 510 473 +f 515 511 468 +f 514 516 464 +f 467 512 515 +f 472 509 512 +f 499 498 517 +f 518 500 504 +f 502 499 519 +f 498 496 520 +f 465 464 516 +f 496 465 521 +f 522 504 502 +f 516 521 465 +f 520 517 498 +f 502 519 522 +f 517 519 499 +f 521 520 496 +f 504 522 518 +f 494 523 417 +f 493 524 525 +f 495 525 523 +f 493 518 524 +f 518 493 500 +f 525 495 493 +f 417 419 494 +f 523 494 495 +f 508 506 434 +f 508 507 506 +f 508 434 526 +f 434 527 526 +f 526 528 529 +f 527 528 526 +f 530 529 528 +f 531 532 533 +f 527 434 432 +f 529 530 531 +f 534 528 535 +f 527 535 528 +f 536 535 527 +f 528 534 530 +f 432 536 527 +f 536 432 430 +f 532 531 530 +f 537 538 539 +f 540 530 534 +f 532 539 538 +f 538 533 532 +f 530 540 532 +f 535 541 534 +f 541 535 542 +f 536 542 535 +f 430 543 536 +f 543 430 428 +f 543 542 536 +f 544 542 545 +f 428 546 543 +f 546 428 426 +f 542 544 541 +f 543 545 542 +f 546 545 543 +f 534 547 540 +f 548 539 549 +f 550 548 549 +f 540 549 539 +f 539 532 540 +f 549 540 547 +f 547 534 541 +f 548 537 539 +f 551 550 552 +f 547 552 549 +f 553 541 544 +f 541 553 547 +f 550 549 552 +f 552 547 553 +f 510 554 514 +f 514 555 516 +f 556 555 514 +f 513 533 510 +f 533 513 531 +f 511 526 529 +f 509 526 557 +f 526 509 508 +f 531 511 529 +f 526 511 557 +f 511 531 513 +f 514 554 556 +f 556 554 538 +f 533 538 554 +f 537 556 538 +f 554 510 533 +f 558 515 512 +f 512 559 558 +f 509 557 559 +f 559 512 509 +f 515 558 511 +f 559 557 511 +f 511 558 559 +f 545 560 544 +f 560 545 561 +f 426 562 546 +f 562 426 424 +f 546 561 545 +f 562 561 546 +f 424 563 562 +f 563 424 422 +f 561 564 560 +f 564 561 565 +f 562 565 561 +f 563 565 562 +f 551 552 566 +f 567 551 566 +f 566 553 568 +f 553 566 552 +f 544 568 553 +f 568 544 560 +f 567 566 569 +f 570 567 569 +f 570 569 571 +f 568 569 566 +f 572 560 564 +f 560 572 568 +f 572 571 569 +f 569 568 572 +f 573 565 574 +f 422 575 563 +f 575 422 420 +f 565 573 564 +f 563 574 565 +f 575 574 563 +f 576 564 573 +f 574 577 573 +f 578 570 571 +f 564 576 572 +f 573 579 576 +f 576 580 571 +f 571 572 576 +f 577 574 581 +f 575 581 574 +f 582 581 575 +f 579 573 577 +f 420 582 575 +f 582 420 417 +f 524 417 523 +f 524 523 525 +f 582 417 524 +f 521 516 579 +f 580 516 583 +f 583 516 555 +f 520 521 577 +f 584 581 582 +f 577 581 517 +f 524 584 582 +f 584 524 518 +f 583 585 580 +f 578 571 580 +f 585 578 580 +f 579 516 580 +f 577 521 579 +f 580 576 579 +f 520 577 517 +f 581 584 517 +f 519 586 587 +f 517 586 519 +f 517 587 586 +f 584 518 522 +f 517 584 587 +f 522 587 584 +f 587 522 519 +f 588 589 590 +f 591 592 593 +f 593 589 591 +f 594 591 589 +f 589 588 594 +f 595 596 592 +f 592 591 595 +f 597 598 599 +f 590 600 599 +f 599 598 590 +f 589 593 600 +f 600 590 589 +f 590 601 588 +f 602 597 603 +f 602 598 597 +f 601 590 598 +f 598 602 601 +f 594 604 605 +f 606 604 607 +f 604 594 588 +f 588 607 604 +f 608 595 591 +f 591 594 608 +f 605 608 594 +f 609 610 611 +f 612 610 609 +f 610 612 596 +f 596 595 610 +f 611 610 595 +f 609 611 613 +f 613 611 614 +f 595 608 611 +f 614 611 608 +f 608 605 614 +f 615 616 617 +f 618 616 615 +f 618 614 616 +f 613 614 618 +f 615 617 619 +f 616 614 605 +f 605 620 616 +f 617 616 620 +f 621 622 623 +f 620 605 604 +f 604 606 620 +f 622 620 606 +f 606 623 622 +f 620 622 617 +f 619 624 625 +f 619 617 624 +f 626 627 628 +f 626 629 627 +f 625 629 626 +f 625 624 629 +f 624 617 622 +f 630 621 631 +f 622 621 624 +f 629 624 621 +f 621 630 629 +f 627 629 630 +f 630 632 627 +f 607 633 606 +f 623 606 633 +f 633 634 623 +f 633 607 635 +f 634 633 636 +f 636 637 634 +f 638 603 639 +f 602 638 635 +f 638 602 603 +f 640 639 641 +f 640 638 639 +f 637 636 640 +f 635 601 602 +f 636 635 638 +f 638 640 636 +f 607 588 601 +f 601 635 607 +f 635 636 633 +f 642 643 644 +f 644 645 642 +f 637 646 647 +f 643 647 646 +f 646 644 643 +f 647 634 637 +f 648 649 650 +f 640 651 637 +f 646 637 651 +f 651 650 646 +f 644 646 650 +f 651 641 648 +f 651 640 641 +f 648 650 651 +f 652 650 649 +f 652 653 650 +f 654 652 655 +f 650 653 644 +f 654 653 652 +f 645 644 653 +f 653 654 645 +f 643 642 656 +f 631 623 634 +f 657 631 647 +f 634 647 631 +f 647 643 657 +f 656 657 643 +f 632 630 657 +f 623 631 621 +f 657 656 632 +f 631 657 630 +f 658 659 660 +f 661 593 592 +f 662 659 663 +f 663 661 662 +f 659 658 664 +f 664 663 659 +f 662 592 596 +f 592 662 661 +f 665 666 667 +f 668 669 665 +f 670 669 668 +f 668 603 597 +f 597 670 668 +f 593 661 671 +f 671 600 593 +f 661 663 672 +f 672 671 661 +f 663 664 673 +f 673 672 663 +f 672 673 674 +f 674 675 672 +f 600 671 676 +f 676 599 600 +f 671 672 675 +f 675 676 671 +f 674 676 675 +f 674 599 676 +f 670 599 674 +f 670 597 599 +f 677 673 664 +f 678 664 658 +f 679 658 680 +f 681 679 682 +f 681 683 684 +f 684 685 681 +f 679 681 685 +f 685 678 679 +f 658 679 678 +f 673 677 686 +f 687 674 686 +f 687 669 670 +f 686 674 673 +f 674 687 670 +f 688 689 684 +f 678 685 690 +f 664 678 677 +f 685 684 689 +f 689 690 685 +f 690 677 678 +f 691 686 677 +f 692 691 693 +f 693 694 692 +f 687 686 691 +f 691 692 687 +f 695 694 693 +f 695 687 692 +f 695 689 688 +f 695 693 689 +f 690 689 693 +f 688 684 696 +f 693 691 690 +f 677 690 691 +f 692 694 695 +f 666 696 697 +f 688 666 695 +f 688 696 666 +f 696 698 697 +f 697 698 699 +f 669 687 695 +f 667 697 700 +f 666 665 669 +f 556 537 699 +f 666 669 695 +f 699 700 697 +f 697 667 666 +f 612 701 702 +f 701 703 660 +f 703 704 680 +f 704 701 612 +f 704 703 701 +f 705 612 609 +f 706 707 708 +f 709 710 706 +f 705 708 707 +f 711 708 705 +f 707 706 710 +f 705 707 712 +f 713 714 715 +f 716 717 710 +f 717 716 718 +f 710 719 707 +f 719 710 717 +f 715 718 716 +f 718 715 714 +f 680 660 703 +f 702 660 659 +f 659 662 702 +f 682 680 704 +f 702 596 612 +f 660 680 658 +f 660 702 701 +f 596 702 662 +f 704 612 712 +f 612 705 712 +f 712 707 719 +f 712 720 704 +f 721 722 723 +f 722 724 725 +f 726 724 722 +f 727 724 726 +f 722 728 726 +f 720 725 724 +f 683 681 729 +f 682 729 681 +f 680 682 679 +f 721 729 727 +f 729 682 720 +f 723 683 721 +f 729 721 683 +f 722 712 719 +f 712 722 725 +f 722 717 723 +f 704 720 682 +f 717 722 719 +f 720 712 725 +f 714 730 718 +f 730 714 731 +f 731 714 713 +f 713 732 731 +f 718 723 717 +f 723 718 730 +f 727 728 721 +f 720 727 729 +f 728 722 721 +f 724 727 720 +f 726 728 727 +f 609 711 705 +f 711 609 613 +f 613 733 711 +f 711 734 708 +f 733 734 711 +f 735 708 734 +f 733 613 618 +f 710 709 716 +f 736 713 715 +f 737 716 709 +f 716 737 715 +f 736 715 737 +f 738 736 737 +f 708 735 706 +f 739 706 735 +f 706 739 709 +f 740 709 739 +f 709 740 737 +f 738 737 740 +f 741 738 740 +f 723 730 683 +f 684 683 742 +f 683 730 743 +f 744 742 743 +f 743 745 744 +f 746 744 745 +f 747 746 748 +f 743 742 683 +f 745 748 746 +f 733 749 734 +f 734 750 735 +f 750 734 749 +f 751 749 733 +f 618 751 733 +f 751 618 615 +f 739 752 740 +f 753 741 752 +f 741 740 752 +f 735 754 739 +f 754 735 750 +f 752 739 754 +f 615 755 751 +f 755 615 619 +f 619 756 755 +f 757 754 758 +f 754 757 752 +f 753 752 757 +f 759 753 757 +f 758 750 760 +f 750 758 754 +f 751 761 749 +f 755 761 751 +f 755 762 761 +f 749 760 750 +f 760 749 761 +f 761 763 760 +f 760 764 758 +f 759 757 765 +f 766 759 765 +f 764 760 763 +f 765 758 764 +f 758 765 757 +f 756 619 625 +f 625 767 756 +f 767 625 626 +f 756 762 755 +f 756 768 762 +f 767 768 756 +f 763 761 762 +f 762 769 763 +f 769 762 768 +f 770 764 771 +f 764 770 765 +f 766 765 770 +f 772 766 770 +f 763 771 764 +f 771 763 769 +f 773 774 775 +f 776 773 777 +f 774 627 632 +f 632 775 774 +f 775 777 773 +f 777 778 776 +f 771 779 770 +f 768 780 769 +f 767 781 768 +f 772 770 779 +f 779 771 782 +f 782 769 780 +f 769 782 771 +f 783 628 784 +f 784 785 786 +f 784 628 785 +f 784 773 776 +f 784 786 773 +f 786 774 773 +f 786 785 774 +f 628 774 785 +f 628 627 774 +f 780 768 781 +f 783 781 767 +f 626 783 767 +f 783 626 628 +f 748 778 747 +f 778 777 787 +f 787 747 778 +f 777 775 788 +f 788 787 777 +f 775 632 656 +f 656 788 775 +f 731 789 790 +f 789 731 732 +f 730 791 743 +f 791 731 790 +f 791 730 731 +f 792 793 745 +f 745 743 792 +f 793 794 748 +f 748 745 793 +f 778 748 794 +f 795 743 796 +f 795 792 743 +f 794 776 778 +f 793 797 798 +f 792 795 799 +f 793 798 794 +f 792 797 793 +f 792 799 797 +f 789 800 779 +f 780 791 782 +f 782 790 779 +f 800 772 779 +f 796 743 791 +f 779 790 789 +f 796 791 780 +f 791 790 782 +f 780 781 795 +f 794 784 776 +f 794 798 784 +f 801 781 783 +f 781 801 795 +f 796 780 795 +f 784 801 783 +f 801 784 798 +f 799 802 803 +f 801 798 797 +f 797 803 801 +f 803 802 795 +f 803 797 799 +f 795 801 803 +f 795 802 799 +f 668 665 804 +f 667 805 665 +f 805 667 806 +f 603 668 804 +f 700 806 667 +f 804 665 805 +f 806 807 805 +f 808 805 807 +f 804 805 808 +f 807 806 809 +f 639 804 808 +f 804 639 603 +f 537 548 810 +f 537 810 699 +f 810 811 700 +f 811 810 812 +f 700 699 810 +f 548 812 810 +f 813 812 814 +f 550 814 812 +f 806 700 811 +f 812 813 811 +f 548 550 812 +f 811 809 806 +f 809 811 813 +f 815 809 816 +f 817 807 815 +f 808 807 817 +f 641 808 817 +f 808 641 639 +f 809 815 807 +f 648 817 818 +f 817 648 641 +f 817 815 818 +f 816 819 815 +f 818 815 819 +f 819 816 820 +f 551 821 814 +f 550 551 814 +f 814 822 813 +f 822 814 821 +f 816 813 822 +f 813 816 809 +f 821 823 822 +f 823 821 824 +f 567 824 821 +f 822 820 816 +f 820 822 823 +f 551 567 821 +f 825 698 696 +f 555 556 699 +f 699 698 555 +f 826 555 698 +f 825 826 698 +f 827 828 825 +f 555 826 583 +f 827 825 696 +f 829 819 830 +f 818 819 829 +f 649 818 829 +f 818 649 648 +f 823 831 820 +f 830 820 831 +f 820 830 819 +f 829 830 832 +f 833 831 834 +f 832 830 833 +f 831 833 830 +f 829 652 649 +f 835 824 836 +f 570 578 836 +f 570 836 824 +f 567 570 824 +f 831 823 835 +f 824 835 823 +f 837 836 838 +f 835 834 831 +f 834 835 837 +f 838 839 837 +f 578 838 836 +f 578 585 838 +f 836 837 835 +f 585 840 838 +f 841 833 842 +f 839 838 840 +f 837 843 834 +f 843 837 839 +f 842 834 843 +f 834 842 833 +f 655 832 841 +f 832 655 652 +f 652 829 832 +f 832 833 841 +f 844 845 846 +f 847 655 846 +f 847 654 655 +f 848 846 845 +f 848 847 846 +f 849 845 844 +f 849 848 845 +f 844 846 655 +f 844 655 841 +f 850 849 844 +f 851 852 853 +f 853 854 851 +f 855 856 852 +f 852 851 855 +f 853 852 857 +f 857 854 853 +f 857 852 856 +f 857 858 854 +f 851 850 855 +f 858 857 828 +f 858 851 854 +f 851 859 850 +f 858 859 851 +f 826 840 585 +f 585 583 826 +f 840 825 839 +f 825 840 826 +f 839 828 843 +f 828 839 825 +f 850 844 855 +f 857 841 842 +f 841 857 856 +f 843 857 842 +f 857 843 828 +f 855 841 856 +f 841 855 844 +f 860 861 848 +f 848 849 860 +f 861 862 847 +f 847 848 861 +f 862 645 654 +f 654 847 862 +f 863 860 849 +f 827 864 859 +f 859 858 827 +f 864 863 850 +f 858 828 827 +f 849 850 863 +f 850 859 864 +f 696 684 865 +f 742 865 684 +f 865 827 696 +f 865 866 864 +f 866 867 863 +f 868 642 645 +f 645 862 868 +f 869 870 861 +f 861 860 869 +f 870 868 862 +f 862 861 870 +f 867 869 860 +f 863 864 866 +f 864 827 865 +f 860 863 867 +f 747 787 870 +f 787 788 868 +f 868 870 787 +f 870 869 747 +f 788 656 642 +f 642 868 788 +f 746 747 869 +f 744 746 867 +f 867 866 744 +f 866 865 742 +f 869 867 746 +f 742 744 866 +f 871 872 873 +f 872 871 874 +f 874 875 872 +f 875 874 876 +f 876 877 875 +f 877 876 878 +f 878 879 877 +f 879 878 880 +f 880 881 879 +f 881 880 882 +f 882 883 881 +f 883 882 884 +f 884 885 883 +f 885 884 886 +f 886 887 885 +f 887 886 888 +f 889 890 891 +f 892 891 893 +f 890 889 894 +f 895 893 891 +f 891 890 895 +f 894 896 897 +f 898 899 900 +f 901 871 898 +f 898 871 899 +f 902 903 904 +f 904 905 902 +f 905 904 906 +f 903 902 893 +f 907 876 874 +f 901 874 871 +f 905 908 909 +f 902 909 910 +f 911 878 876 +f 876 907 911 +f 909 902 905 +f 908 905 912 +f 896 894 889 +f 891 913 889 +f 913 891 892 +f 914 889 913 +f 889 914 896 +f 907 915 911 +f 911 915 916 +f 916 896 914 +f 896 916 915 +f 893 910 892 +f 910 893 902 +f 906 912 905 +f 917 918 912 +f 912 918 908 +f 919 909 908 +f 908 920 919 +f 921 919 920 +f 920 922 921 +f 923 880 878 +f 919 921 924 +f 925 926 927 +f 923 926 925 +f 880 923 925 +f 922 920 928 +f 913 929 914 +f 929 913 930 +f 926 914 929 +f 914 926 916 +f 892 930 913 +f 930 892 931 +f 931 892 910 +f 930 932 929 +f 932 930 933 +f 927 929 932 +f 929 927 926 +f 934 931 935 +f 931 933 930 +f 933 931 934 +f 935 910 909 +f 924 935 919 +f 928 936 922 +f 918 928 920 +f 937 936 928 +f 938 937 928 +f 917 938 918 +f 938 928 918 +f 910 935 931 +f 935 924 934 +f 909 919 935 +f 920 908 918 +f 878 911 923 +f 923 916 926 +f 911 916 923 +f 939 898 900 +f 900 940 939 +f 941 899 871 +f 871 873 941 +f 940 900 899 +f 899 941 940 +f 939 942 898 +f 943 944 945 +f 946 943 945 +f 947 946 945 +f 945 948 949 +f 944 948 945 +f 950 949 942 +f 897 951 944 +f 897 946 894 +f 894 947 890 +f 952 951 901 +f 898 952 901 +f 953 895 890 +f 893 895 903 +f 897 915 951 +f 954 904 903 +f 907 951 915 +f 901 951 907 +f 874 901 907 +f 915 897 896 +f 955 903 895 +f 956 906 904 +f 957 912 906 +f 958 957 906 +f 957 917 912 +f 959 958 906 +f 904 954 956 +f 903 955 954 +f 943 897 944 +f 943 946 897 +f 952 898 942 +f 951 952 944 +f 944 960 948 +f 948 960 961 +f 952 942 949 +f 944 952 961 +f 949 961 952 +f 961 949 948 +f 944 961 960 +f 890 947 953 +f 895 953 955 +f 906 956 959 +f 946 947 894 +f 954 955 953 +f 953 956 954 +f 962 953 947 +f 959 956 963 +f 964 956 953 +f 953 962 964 +f 947 965 962 +f 964 963 956 +f 966 967 968 +f 968 967 945 +f 969 968 950 +f 970 969 971 +f 972 968 969 +f 887 970 939 +f 970 973 974 +f 970 887 973 +f 877 879 881 +f 881 883 875 +f 883 885 872 +f 885 887 873 +f 939 873 887 +f 939 941 873 +f 939 940 941 +f 875 877 881 +f 872 875 883 +f 873 872 885 +f 971 939 970 +f 887 888 975 +f 975 973 887 +f 976 974 973 +f 973 975 976 +f 977 970 974 +f 974 976 977 +f 977 969 970 +f 968 972 966 +f 978 979 967 +f 980 965 967 +f 966 978 967 +f 969 981 972 +f 965 947 967 +f 979 980 967 +f 969 977 981 +f 945 967 947 +f 945 950 968 +f 950 971 969 +f 949 950 945 +f 942 939 971 +f 942 971 950 +f 982 983 984 +f 985 986 987 +f 984 985 982 +f 987 982 985 +f 988 927 989 +f 925 927 988 +f 932 989 927 +f 882 925 988 +f 988 989 990 +f 991 921 922 +f 922 992 991 +f 983 991 992 +f 992 984 983 +f 988 884 882 +f 925 882 880 +f 993 924 921 +f 994 993 991 +f 936 995 992 +f 995 996 984 +f 991 983 994 +f 992 922 936 +f 984 992 995 +f 921 991 993 +f 997 998 999 +f 998 997 1000 +f 990 989 1001 +f 1000 997 993 +f 999 1002 1003 +f 1002 999 998 +f 1001 1003 1002 +f 1003 1001 989 +f 989 932 1003 +f 997 934 924 +f 934 999 933 +f 999 934 997 +f 933 1003 932 +f 1003 933 999 +f 1004 995 936 +f 937 1004 936 +f 1005 996 995 +f 1004 1005 995 +f 924 993 997 +f 993 994 1000 +f 996 1006 985 +f 1006 1007 986 +f 1005 1008 996 +f 1009 1010 982 +f 1010 994 983 +f 1011 1001 1012 +f 1012 1002 1013 +f 1002 1012 1001 +f 998 1013 1002 +f 990 1001 1011 +f 1014 1000 1015 +f 1013 998 1014 +f 1015 1000 994 +f 1000 1014 998 +f 977 975 888 +f 977 976 975 +f 888 1011 1016 +f 977 888 1016 +f 1010 1009 1017 +f 1017 1015 1010 +f 1015 1018 1014 +f 1018 1015 1017 +f 1019 1014 1018 +f 994 1010 1015 +f 886 990 1011 +f 990 886 884 +f 884 988 990 +f 985 984 996 +f 986 985 1006 +f 982 987 1009 +f 983 982 1010 +f 1011 888 886 +f 962 1009 987 +f 1008 1006 996 +f 1020 986 1007 +f 1021 1007 1006 +f 1008 1021 1006 +f 1022 987 986 +f 1011 1012 1016 +f 1023 1013 1019 +f 1013 1023 1012 +f 1014 1019 1013 +f 1016 1012 1023 +f 964 1007 1021 +f 986 1020 1022 +f 1017 980 1018 +f 965 1017 1009 +f 987 1022 962 +f 1018 979 1019 +f 1019 978 1023 +f 978 1016 1023 +f 1016 981 977 +f 1016 978 1024 +f 979 1018 980 +f 978 1019 979 +f 981 1016 1024 +f 1021 963 964 +f 1009 962 965 +f 1022 1020 964 +f 1007 964 1020 +f 980 1017 965 +f 964 962 1022 +f 1025 972 981 +f 981 1024 1025 +f 1025 1024 978 +f 978 1026 1025 +f 1026 966 972 +f 966 1026 978 +f 972 1025 1026 +f 1027 1028 1029 +f 1030 1031 1032 +f 1032 1029 1030 +f 1033 1029 1028 +f 1034 1030 1029 +f 1029 1033 1034 +f 1029 1032 1027 +f 1027 1035 1036 +f 1032 1037 1035 +f 1035 1027 1032 +f 1031 1038 1037 +f 1037 1032 1031 +f 1028 1027 1039 +f 1040 1034 1033 +f 1033 1041 1040 +f 1042 1041 1043 +f 1044 1040 1041 +f 1028 1045 1033 +f 1043 1045 1046 +f 1047 1043 1048 +f 1041 1033 1045 +f 1045 1043 1041 +f 1045 1028 1049 +f 1049 1046 1045 +f 1036 1039 1027 +f 1039 1049 1028 +f 1039 1036 1050 +f 1046 1048 1043 +f 1051 1048 1050 +f 1049 1039 1050 +f 1046 1049 1050 +f 1048 1046 1050 +f 1043 1047 1042 +f 1041 1042 1044 +f 1052 1047 1051 +f 1053 1042 1047 +f 1047 1052 1053 +f 1054 1044 1042 +f 1042 1053 1054 +f 1055 1053 1052 +f 1052 1056 1055 +f 1057 1054 1053 +f 1053 1055 1057 +f 1058 1055 1056 +f 1059 1057 1055 +f 1055 1058 1059 +f 1060 1056 1061 +f 1062 1060 1063 +f 1056 1060 1058 +f 1064 1058 1060 +f 1060 1062 1064 +f 1065 1059 1058 +f 1058 1064 1065 +f 1051 1066 1052 +f 1056 1052 1066 +f 1066 1061 1056 +f 1048 1051 1047 +f 1061 1063 1060 +f 1066 1051 1050 +f 1061 1066 1050 +f 1063 1061 1050 +f 1067 1063 1050 +f 1063 1067 1062 +f 1068 1069 1070 +f 1070 1071 1068 +f 1071 1072 1073 +f 1073 1068 1071 +f 1038 1073 1072 +f 1072 1037 1038 +f 1072 1071 1074 +f 1074 1075 1072 +f 1075 1035 1037 +f 1037 1072 1075 +f 1069 1076 1077 +f 1077 1070 1069 +f 1077 1078 1079 +f 1076 1080 1078 +f 1078 1077 1076 +f 1070 1077 1081 +f 1081 1082 1070 +f 1082 1074 1071 +f 1071 1070 1082 +f 1079 1081 1077 +f 1083 1084 1075 +f 1075 1074 1083 +f 1074 1082 1085 +f 1085 1083 1074 +f 1084 1036 1035 +f 1035 1075 1084 +f 1082 1081 1086 +f 1086 1085 1082 +f 1081 1079 1087 +f 1087 1086 1081 +f 1083 1085 1088 +f 1088 1089 1083 +f 1090 1050 1036 +f 1036 1084 1090 +f 1089 1090 1084 +f 1084 1083 1089 +f 1086 1087 1091 +f 1091 1092 1086 +f 1085 1086 1092 +f 1092 1088 1085 +f 1093 1094 1095 +f 1096 1097 1031 +f 1098 1096 1094 +f 1094 1096 1030 +f 1099 1097 1096 +f 1095 1094 1034 +f 1100 1097 1099 +f 1101 1095 1040 +f 1038 1031 1097 +f 1031 1030 1096 +f 1030 1034 1094 +f 1034 1040 1095 +f 1097 1100 1038 +f 1100 1102 1073 +f 1068 1103 1104 +f 1102 1103 1068 +f 1105 1080 1076 +f 1073 1038 1100 +f 1104 1069 1068 +f 1068 1073 1102 +f 1069 1104 1106 +f 1106 1076 1069 +f 1076 1106 1105 +f 1107 1108 1090 +f 1090 1089 1107 +f 1089 1088 1109 +f 1109 1107 1089 +f 1108 1067 1050 +f 1050 1090 1108 +f 1092 1091 1110 +f 1110 1111 1092 +f 1088 1092 1111 +f 1111 1109 1088 +f 1112 1113 1108 +f 1108 1107 1112 +f 1113 1062 1067 +f 1067 1108 1113 +f 1107 1109 1114 +f 1114 1112 1107 +f 1111 1110 1115 +f 1115 1116 1111 +f 1109 1111 1116 +f 1116 1114 1109 +f 1062 1113 1117 +f 1064 1117 1118 +f 1119 1117 1113 +f 1117 1064 1062 +f 1120 1118 1117 +f 1118 1065 1064 +f 1119 1121 1122 +f 1122 1120 1119 +f 1117 1119 1120 +f 1113 1112 1119 +f 1116 1115 1123 +f 1112 1114 1121 +f 1121 1119 1112 +f 1114 1116 1124 +f 1124 1121 1114 +f 1123 1124 1116 +f 1121 1124 1125 +f 1125 1122 1121 +f 1126 1125 1124 +f 1124 1123 1126 +f 1104 1103 1127 +f 1103 1102 1128 +f 1102 1100 1129 +f 1130 1105 1106 +f 1106 1104 1131 +f 1040 1044 1101 +f 1044 1054 1093 +f 1054 1057 1098 +f 1057 1059 1099 +f 1093 1101 1044 +f 1098 1094 1093 +f 1098 1093 1054 +f 1099 1096 1098 +f 1099 1098 1057 +f 1093 1095 1101 +f 1129 1099 1059 +f 1125 1132 1131 +f 1131 1122 1125 +f 1126 1130 1132 +f 1132 1125 1126 +f 1118 1120 1127 +f 1065 1118 1128 +f 1120 1122 1131 +f 1059 1065 1129 +f 1128 1127 1103 +f 1129 1128 1102 +f 1100 1099 1129 +f 1131 1132 1106 +f 1127 1131 1104 +f 1106 1132 1130 +f 1128 1129 1065 +f 1127 1128 1118 +f 1131 1127 1120 +f 1133 1134 1135 +f 1134 1133 1136 +f 1136 1137 1134 +f 1137 1136 1138 +f 1138 1139 1137 +f 1139 1138 1140 +f 1140 1141 1139 +f 1142 1136 1133 +f 1143 1144 1145 +f 1144 1143 1140 +f 1140 1146 1144 +f 1146 1140 1138 +f 1138 1147 1146 +f 1147 1138 1136 +f 1136 1142 1147 +f 1141 1140 1143 +f 1148 1149 1143 +f 1143 1150 1141 +f 1150 1143 1149 +f 1149 1151 1150 +f 1151 1149 1152 +f 1152 1153 1151 +f 1153 1152 1154 +f 1154 1155 1153 +f 1156 1157 1154 +f 1154 1158 1156 +f 1158 1154 1152 +f 1152 1159 1158 +f 1159 1152 1149 +f 1149 1148 1159 +f 1157 1156 1160 +f 1155 1154 1157 +f 1161 1162 1163 +f 1162 1161 1164 +f 1164 1165 1162 +f 1165 1164 1166 +f 1166 1167 1165 +f 1167 1166 1168 +f 1168 1145 1167 +f 1169 1164 1161 +f 1143 1170 1171 +f 1170 1143 1168 +f 1168 1172 1170 +f 1172 1168 1166 +f 1166 1173 1172 +f 1173 1166 1164 +f 1164 1169 1173 +f 1145 1168 1143 +f 1171 1174 1143 +f 1143 1175 1148 +f 1175 1143 1174 +f 1174 1176 1175 +f 1176 1174 1177 +f 1177 1178 1176 +f 1178 1177 1179 +f 1179 1180 1178 +f 1181 1182 1179 +f 1179 1183 1181 +f 1183 1179 1177 +f 1177 1184 1183 +f 1184 1177 1174 +f 1174 1171 1184 +f 1182 1181 1185 +f 1180 1179 1182 +f 1186 1187 1135 +f 1186 1188 1187 +f 1189 1190 1191 +f 1192 1193 1189 +f 1194 1193 1192 +f 1186 1135 1192 +f 1135 1194 1192 +f 1194 1135 1134 +f 1188 1195 1196 +f 1196 1187 1188 +f 1186 1197 1195 +f 1195 1188 1186 +f 1187 1196 1133 +f 1133 1135 1187 +f 1186 1198 1197 +f 1199 1200 1201 +f 1201 1202 1199 +f 1198 1203 1200 +f 1200 1199 1198 +f 1204 1202 1205 +f 1201 1205 1202 +f 1198 1186 1203 +f 1205 1192 1189 +f 1191 1205 1189 +f 1206 1207 1191 +f 1208 1209 1206 +f 1210 1208 1080 +f 1192 1203 1186 +f 1205 1191 1207 +f 1203 1192 1211 +f 1192 1205 1211 +f 1205 1212 1211 +f 1205 1201 1213 +f 1213 1212 1205 +f 1200 1212 1213 +f 1213 1201 1200 +f 1203 1211 1212 +f 1212 1200 1203 +f 1214 1215 1216 +f 1217 1216 1218 +f 1219 1220 1221 +f 1219 1142 1220 +f 1217 1142 1219 +f 1147 1217 1218 +f 1217 1147 1142 +f 1222 1199 1202 +f 1223 1197 1198 +f 1223 1198 1199 +f 1202 1204 1224 +f 1225 1224 1204 +f 1214 1216 1225 +f 1214 1226 1227 +f 1228 1229 1230 +f 1227 1231 1230 +f 1232 1216 1217 +f 1219 1232 1217 +f 1226 1231 1227 +f 1233 1226 1214 +f 1233 1214 1225 +f 1216 1232 1225 +f 1230 1231 1228 +f 1232 1219 1223 +f 1142 1133 1196 +f 1197 1223 1219 +f 1195 1221 1220 +f 1220 1196 1195 +f 1197 1219 1221 +f 1221 1195 1197 +f 1196 1220 1142 +f 1222 1234 1232 +f 1225 1235 1224 +f 1202 1224 1222 +f 1199 1222 1223 +f 1234 1222 1224 +f 1224 1235 1234 +f 1232 1223 1222 +f 1218 1215 1236 +f 1218 1216 1215 +f 1237 1238 1215 +f 1146 1218 1236 +f 1218 1146 1147 +f 1239 1240 1230 +f 1230 1241 1227 +f 1227 1237 1214 +f 1229 1239 1230 +f 1215 1214 1237 +f 1237 1227 1241 +f 1241 1230 1240 +f 1242 1238 1243 +f 1236 1238 1242 +f 1236 1215 1238 +f 1243 1244 1245 +f 1238 1237 1244 +f 1144 1236 1242 +f 1236 1144 1146 +f 1244 1243 1238 +f 1246 1243 1247 +f 1247 1245 1248 +f 1245 1247 1243 +f 1242 1243 1246 +f 1145 1242 1246 +f 1242 1145 1144 +f 1249 1250 1251 +f 1249 1251 1240 +f 1239 1249 1240 +f 1244 1241 1252 +f 1241 1244 1237 +f 1240 1252 1241 +f 1252 1240 1251 +f 1251 1253 1252 +f 1252 1245 1244 +f 1245 1252 1253 +f 1253 1251 1254 +f 1250 1254 1251 +f 1255 1254 1256 +f 1257 1256 1254 +f 1250 1257 1254 +f 1253 1248 1245 +f 1248 1253 1255 +f 1254 1255 1253 +f 1225 1232 1234 +f 1258 1228 1231 +f 1234 1235 1225 +f 1226 1233 1259 +f 1231 1226 1260 +f 1204 1261 1225 +f 1233 1225 1261 +f 1193 1262 1190 +f 1194 1263 1193 +f 1264 1263 1194 +f 1134 1264 1194 +f 1264 1134 1137 +f 1265 1191 1190 +f 1191 1265 1206 +f 1266 1206 1265 +f 1206 1266 1208 +f 1080 1208 1266 +f 1190 1189 1193 +f 1078 1080 1266 +f 1267 1265 1268 +f 1265 1267 1266 +f 1078 1266 1267 +f 1268 1190 1262 +f 1190 1268 1265 +f 1264 1269 1263 +f 1270 1269 1264 +f 1262 1193 1263 +f 1263 1271 1262 +f 1271 1263 1269 +f 1137 1270 1264 +f 1270 1137 1139 +f 1272 1271 1273 +f 1270 1274 1269 +f 1269 1273 1271 +f 1275 1274 1270 +f 1273 1269 1274 +f 1139 1275 1270 +f 1275 1139 1141 +f 1268 1276 1267 +f 1079 1267 1276 +f 1262 1277 1268 +f 1079 1078 1267 +f 1277 1278 1276 +f 1278 1277 1272 +f 1087 1079 1276 +f 1087 1276 1278 +f 1277 1262 1271 +f 1091 1087 1278 +f 1276 1268 1277 +f 1271 1272 1277 +f 1259 1260 1226 +f 1260 1259 1210 +f 1279 1260 1280 +f 1261 1204 1207 +f 1260 1279 1231 +f 1261 1259 1233 +f 1259 1261 1209 +f 1209 1208 1210 +f 1130 1210 1105 +f 1207 1206 1209 +f 1080 1105 1210 +f 1209 1210 1259 +f 1210 1281 1260 +f 1205 1207 1204 +f 1207 1209 1261 +f 1274 1282 1273 +f 1282 1274 1283 +f 1275 1283 1274 +f 1284 1283 1275 +f 1141 1284 1275 +f 1284 1141 1150 +f 1283 1285 1282 +f 1285 1283 1286 +f 1286 1287 1285 +f 1284 1286 1283 +f 1288 1286 1284 +f 1288 1289 1286 +f 1150 1288 1284 +f 1288 1150 1151 +f 1273 1290 1272 +f 1291 1272 1290 +f 1272 1291 1278 +f 1091 1278 1291 +f 1110 1091 1291 +f 1290 1273 1282 +f 1290 1292 1291 +f 1110 1291 1292 +f 1282 1293 1290 +f 1115 1110 1292 +f 1115 1292 1294 +f 1123 1115 1294 +f 1292 1290 1293 +f 1295 1285 1287 +f 1293 1282 1285 +f 1293 1294 1292 +f 1285 1295 1293 +f 1294 1293 1295 +f 1287 1286 1289 +f 1296 1289 1288 +f 1296 1297 1289 +f 1151 1296 1288 +f 1296 1151 1153 +f 1287 1298 1295 +f 1295 1299 1294 +f 1123 1294 1299 +f 1289 1300 1287 +f 1126 1123 1299 +f 1299 1295 1298 +f 1298 1287 1300 +f 1210 1130 1281 +f 1301 1302 1303 +f 1303 1304 1301 +f 1305 1306 1307 +f 1305 1308 1309 +f 1280 1260 1281 +f 1308 1305 1303 +f 1306 1305 1310 +f 1306 1280 1311 +f 1280 1306 1312 +f 1313 1297 1296 +f 1314 1315 1316 +f 1314 1155 1315 +f 1313 1155 1314 +f 1300 1289 1297 +f 1153 1313 1296 +f 1313 1153 1155 +f 1317 1318 1319 +f 1307 1303 1305 +f 1281 1311 1280 +f 1311 1307 1306 +f 1320 1308 1321 +f 1322 1319 1320 +f 1317 1323 1318 +f 1303 1321 1308 +f 1299 1281 1130 +f 1307 1300 1303 +f 1307 1311 1300 +f 1297 1304 1303 +f 1311 1281 1298 +f 1304 1314 1317 +f 1298 1281 1299 +f 1130 1126 1299 +f 1300 1297 1303 +f 1300 1311 1298 +f 1304 1297 1313 +f 1314 1304 1313 +f 1324 1315 1155 +f 1155 1157 1324 +f 1323 1317 1314 +f 1323 1314 1316 +f 1325 1316 1315 +f 1315 1324 1325 +f 1316 1325 1323 +f 1319 1322 1317 +f 1303 1302 1321 +f 1301 1322 1321 +f 1322 1301 1304 +f 1321 1302 1301 +f 1320 1321 1322 +f 1304 1317 1322 +f 1326 1324 1157 +f 1157 1160 1326 +f 1327 1325 1324 +f 1324 1326 1327 +f 1328 1323 1325 +f 1325 1327 1328 +f 1329 1330 1331 +f 1332 1330 1329 +f 1328 1326 1160 +f 1328 1327 1326 +f 1331 1333 1334 +f 1328 1160 1329 +f 1160 1332 1329 +f 1332 1160 1156 +f 1318 1335 1336 +f 1336 1319 1318 +f 1337 1320 1319 +f 1308 1320 1338 +f 1337 1338 1320 +f 1319 1336 1337 +f 1318 1328 1335 +f 1328 1318 1323 +f 1339 1309 1334 +f 1309 1339 1310 +f 1335 1329 1340 +f 1338 1334 1309 +f 1329 1338 1340 +f 1341 1342 1312 +f 1310 1343 1312 +f 1338 1329 1331 +f 1343 1310 1339 +f 1329 1335 1328 +f 1312 1343 1341 +f 1334 1338 1331 +f 1332 1344 1330 +f 1345 1344 1332 +f 1156 1345 1332 +f 1345 1156 1158 +f 1330 1346 1333 +f 1334 1347 1339 +f 1348 1339 1347 +f 1339 1348 1343 +f 1341 1343 1348 +f 1349 1341 1348 +f 1333 1331 1330 +f 1347 1334 1333 +f 1350 1333 1346 +f 1333 1350 1347 +f 1349 1348 1351 +f 1351 1347 1350 +f 1347 1351 1348 +f 1345 1352 1344 +f 1353 1352 1345 +f 1158 1353 1345 +f 1353 1158 1159 +f 1346 1330 1344 +f 1344 1354 1346 +f 1354 1344 1352 +f 1159 1355 1353 +f 1355 1159 1148 +f 1355 1356 1353 +f 1357 1354 1358 +f 1353 1356 1352 +f 1352 1358 1354 +f 1358 1352 1356 +f 1359 1351 1360 +f 1350 1360 1351 +f 1359 1349 1351 +f 1346 1361 1350 +f 1362 1359 1360 +f 1362 1360 1363 +f 1361 1346 1354 +f 1364 1362 1363 +f 1354 1357 1361 +f 1363 1361 1357 +f 1361 1363 1360 +f 1360 1350 1361 +f 1310 1312 1306 +f 1312 1365 1280 +f 1309 1310 1305 +f 1338 1309 1308 +f 1335 1340 1366 +f 1366 1336 1335 +f 1336 1366 1367 +f 1367 1337 1336 +f 1312 1342 1365 +f 1337 1367 1338 +f 1366 1340 1338 +f 1338 1367 1366 +f 1368 1248 1369 +f 1248 1368 1247 +f 1255 1369 1248 +f 1370 1247 1368 +f 1246 1247 1370 +f 1167 1246 1370 +f 1246 1167 1145 +f 1370 1368 1371 +f 1372 1373 1374 +f 1374 1369 1372 +f 1165 1370 1371 +f 1370 1165 1167 +f 1369 1374 1368 +f 1371 1368 1374 +f 1375 1376 1377 +f 1375 1377 1256 +f 1257 1375 1256 +f 1378 1372 1369 +f 1256 1378 1255 +f 1369 1255 1378 +f 1378 1256 1377 +f 1377 1379 1378 +f 1372 1378 1379 +f 1379 1377 1380 +f 1376 1381 1380 +f 1376 1380 1377 +f 1382 1374 1373 +f 1371 1374 1382 +f 1162 1371 1382 +f 1371 1162 1165 +f 1373 1372 1383 +f 1380 1384 1379 +f 1384 1380 1385 +f 1381 1385 1380 +f 1383 1379 1384 +f 1379 1383 1372 +f 1386 1384 1387 +f 1381 1388 1385 +f 1387 1385 1389 +f 1388 1389 1385 +f 1384 1386 1383 +f 1383 1390 1373 +f 1385 1387 1384 +f 1391 1389 1258 +f 1392 1387 1391 +f 1228 1258 1393 +f 1388 1393 1258 +f 1391 1258 1394 +f 1395 1392 1396 +f 1392 1391 1397 +f 1258 1231 1279 +f 1163 1382 1398 +f 1382 1163 1162 +f 1398 1373 1390 +f 1382 1373 1398 +f 1399 1400 1163 +f 1390 1383 1386 +f 1399 1401 1400 +f 1399 1163 1398 +f 1402 1401 1399 +f 1400 1403 1161 +f 1161 1163 1400 +f 1401 1402 1403 +f 1403 1400 1401 +f 1399 1404 1402 +f 1405 1406 1407 +f 1407 1408 1405 +f 1409 1410 1406 +f 1406 1405 1409 +f 1396 1408 1395 +f 1407 1395 1408 +f 1399 1409 1404 +f 1409 1399 1410 +f 1389 1391 1387 +f 1258 1389 1388 +f 1386 1395 1390 +f 1387 1392 1386 +f 1395 1398 1390 +f 1398 1410 1399 +f 1406 1411 1412 +f 1412 1407 1406 +f 1410 1413 1411 +f 1411 1406 1410 +f 1395 1411 1413 +f 1395 1407 1412 +f 1412 1411 1395 +f 1398 1395 1413 +f 1410 1398 1413 +f 1395 1386 1392 +f 1414 1415 1416 +f 1417 1418 1419 +f 1420 1169 1417 +f 1173 1420 1421 +f 1420 1173 1169 +f 1420 1416 1421 +f 1417 1169 1418 +f 1422 1423 1279 +f 1424 1425 1396 +f 1423 1426 1394 +f 1427 1405 1408 +f 1428 1409 1405 +f 1428 1404 1409 +f 1408 1396 1425 +f 1426 1424 1397 +f 1403 1418 1169 +f 1169 1161 1403 +f 1404 1428 1417 +f 1404 1417 1419 +f 1419 1402 1404 +f 1402 1419 1418 +f 1418 1403 1402 +f 1427 1429 1430 +f 1408 1425 1427 +f 1430 1428 1427 +f 1425 1431 1429 +f 1424 1431 1425 +f 1405 1427 1428 +f 1424 1430 1429 +f 1429 1427 1425 +f 1423 1422 1432 +f 1430 1417 1428 +f 1416 1430 1424 +f 1433 1422 1434 +f 1426 1414 1424 +f 1426 1423 1414 +f 1414 1416 1424 +f 1434 1435 1433 +f 1432 1422 1433 +f 1414 1423 1432 +f 1417 1430 1420 +f 1430 1416 1420 +f 1421 1172 1173 +f 1421 1415 1436 +f 1421 1416 1415 +f 1172 1421 1436 +f 1437 1438 1415 +f 1432 1437 1414 +f 1415 1414 1437 +f 1433 1439 1432 +f 1437 1432 1439 +f 1440 1441 1433 +f 1435 1440 1433 +f 1439 1433 1441 +f 1436 1170 1172 +f 1438 1437 1442 +f 1443 1438 1444 +f 1436 1438 1443 +f 1436 1415 1438 +f 1170 1436 1443 +f 1444 1442 1445 +f 1442 1444 1438 +f 1446 1444 1447 +f 1171 1443 1446 +f 1443 1171 1170 +f 1447 1445 1448 +f 1445 1447 1444 +f 1443 1444 1446 +f 1449 1445 1442 +f 1439 1442 1437 +f 1441 1449 1439 +f 1449 1441 1450 +f 1442 1439 1449 +f 1450 1451 1449 +f 1452 1450 1441 +f 1452 1453 1450 +f 1440 1452 1441 +f 1445 1449 1451 +f 1451 1450 1454 +f 1453 1454 1450 +f 1448 1451 1455 +f 1455 1454 1456 +f 1457 1456 1454 +f 1453 1457 1454 +f 1451 1448 1445 +f 1454 1455 1451 +f 1394 1279 1423 +f 1397 1394 1426 +f 1397 1396 1392 +f 1394 1397 1391 +f 1279 1394 1258 +f 1279 1458 1422 +f 1396 1397 1424 +f 1434 1422 1459 +f 1424 1429 1431 +f 1184 1446 1460 +f 1446 1184 1171 +f 1460 1447 1461 +f 1446 1447 1460 +f 1461 1448 1462 +f 1448 1461 1447 +f 1455 1462 1448 +f 1463 1462 1464 +f 1462 1463 1461 +f 1183 1460 1465 +f 1460 1183 1184 +f 1464 1466 1463 +f 1465 1461 1463 +f 1460 1461 1465 +f 1457 1467 1456 +f 1468 1464 1462 +f 1456 1468 1455 +f 1467 1469 1470 +f 1468 1456 1470 +f 1462 1455 1468 +f 1470 1471 1468 +f 1467 1470 1456 +f 1469 1472 1473 +f 1469 1473 1470 +f 1471 1470 1473 +f 1464 1468 1471 +f 1466 1464 1474 +f 1465 1181 1183 +f 1475 1463 1466 +f 1465 1463 1475 +f 1181 1465 1475 +f 1473 1476 1471 +f 1471 1474 1464 +f 1476 1473 1477 +f 1474 1471 1476 +f 1472 1477 1473 +f 1478 1479 1477 +f 1472 1478 1477 +f 1480 1477 1479 +f 1477 1480 1476 +f 1481 1476 1480 +f 1474 1482 1466 +f 1476 1481 1474 +f 1483 1484 1485 +f 1486 1483 1487 +f 1458 1486 1488 +f 1486 1458 1489 +f 1483 1486 1490 +f 1458 1280 1365 +f 1279 1280 1458 +f 1491 1485 1484 +f 1487 1488 1486 +f 1485 1487 1483 +f 1488 1422 1458 +f 1491 1492 1493 +f 1494 1495 1493 +f 1493 1496 1494 +f 1488 1459 1422 +f 1493 1495 1491 +f 1497 1492 1491 +f 1496 1493 1492 +f 1492 1497 1496 +f 1498 1365 1342 +f 1499 1500 1501 +f 1355 1502 1356 +f 1503 1502 1355 +f 1356 1504 1358 +f 1504 1356 1502 +f 1148 1503 1355 +f 1503 1148 1175 +f 1503 1505 1502 +f 1506 1505 1503 +f 1502 1507 1504 +f 1506 1508 1505 +f 1175 1506 1503 +f 1506 1175 1176 +f 1507 1502 1505 +f 1505 1509 1507 +f 1510 1357 1511 +f 1357 1510 1363 +f 1364 1363 1510 +f 1512 1364 1510 +f 1511 1358 1504 +f 1358 1511 1357 +f 1512 1510 1513 +f 1504 1514 1511 +f 1511 1513 1510 +f 1515 1514 1516 +f 1514 1515 1513 +f 1513 1511 1514 +f 1514 1504 1507 +f 1507 1516 1514 +f 1516 1507 1509 +f 1517 1512 1513 +f 1517 1513 1515 +f 1518 1517 1515 +f 1519 1508 1506 +f 1519 1520 1508 +f 1176 1519 1506 +f 1519 1176 1178 +f 1509 1505 1508 +f 1518 1515 1521 +f 1522 1518 1521 +f 1516 1521 1515 +f 1508 1523 1509 +f 1521 1516 1524 +f 1524 1509 1523 +f 1509 1524 1516 +f 1525 1180 1526 +f 1178 1525 1519 +f 1525 1178 1180 +f 1523 1508 1520 +f 1525 1520 1519 +f 1526 1527 1528 +f 1526 1180 1527 +f 1365 1489 1458 +f 1484 1483 1499 +f 1489 1490 1486 +f 1490 1499 1483 +f 1529 1530 1531 +f 1499 1532 1484 +f 1531 1484 1532 +f 1533 1534 1535 +f 1533 1535 1530 +f 1527 1536 1537 +f 1534 1526 1528 +f 1528 1537 1534 +f 1536 1527 1180 +f 1180 1182 1536 +f 1534 1533 1526 +f 1537 1528 1527 +f 1531 1532 1529 +f 1500 1529 1532 +f 1532 1501 1500 +f 1499 1501 1532 +f 1538 1533 1529 +f 1530 1529 1533 +f 1529 1500 1538 +f 1499 1538 1500 +f 1526 1538 1525 +f 1523 1520 1499 +f 1523 1489 1524 +f 1498 1522 1521 +f 1524 1365 1521 +f 1538 1520 1525 +f 1490 1523 1499 +f 1490 1489 1523 +f 1489 1365 1524 +f 1538 1526 1533 +f 1520 1538 1499 +f 1521 1365 1498 +f 1537 1539 1540 +f 1541 1536 1182 +f 1539 1537 1536 +f 1182 1185 1541 +f 1540 1534 1537 +f 1536 1541 1539 +f 1540 1539 1541 +f 1475 1466 1542 +f 1482 1474 1481 +f 1540 1185 1542 +f 1542 1466 1482 +f 1185 1475 1542 +f 1475 1185 1181 +f 1540 1541 1185 +f 1530 1496 1497 +f 1497 1531 1530 +f 1535 1494 1496 +f 1496 1530 1535 +f 1497 1491 1531 +f 1484 1531 1491 +f 1485 1480 1487 +f 1535 1540 1494 +f 1540 1535 1534 +f 1480 1485 1481 +f 1487 1479 1488 +f 1542 1491 1495 +f 1494 1542 1495 +f 1478 1459 1488 +f 1491 1481 1485 +f 1479 1487 1480 +f 1481 1491 1482 +f 1488 1479 1478 +f 1491 1542 1482 +f 1542 1494 1540 +f 1543 1544 1545 +f 1546 1545 1547 +f 1548 1549 1550 +f 1551 1550 1552 +f 1553 1552 1554 +f 1555 1554 1549 +f 1546 1543 1545 +f 1556 1551 1552 +f 1553 1556 1552 +f 1543 1557 1544 +f 1555 1553 1554 +f 1548 1555 1549 +f 1558 1548 1550 +f 1551 1558 1550 +f 1559 1560 1561 +f 1562 1559 1561 +f 1563 1546 1547 +f 1564 1562 1565 +f 1566 1564 1565 +f 1560 1567 1568 +f 1557 1569 1544 +f 1567 1566 1568 +f 1563 1547 1570 +f 1569 1570 1544 +f 1560 1568 1561 +f 1562 1561 1565 +f 1566 1565 1571 +f 1566 1571 1568 +f 1572 1573 1574 +f 1575 1572 1574 +f 1576 1575 1577 +f 1578 1576 1577 +f 1573 1579 1580 +f 1579 1578 1580 +f 1581 1582 1583 +f 1584 1585 1586 +f 1582 1587 1583 +f 1587 1584 1588 +f 1589 1581 1590 +f 1587 1588 1583 +f 1581 1583 1590 +f 1589 1590 1586 +f 1584 1586 1588 +f 1573 1580 1574 +f 1575 1574 1577 +f 1591 1592 1593 +f 1594 1593 1595 +f 1596 1595 1597 +f 1598 1597 1592 +f 1578 1577 1599 +f 1578 1599 1580 +f 1594 1600 1593 +f 1591 1598 1592 +f 1598 1601 1597 +f 1601 1596 1597 +f 1596 1594 1595 +f 1602 1603 1604 +f 1548 1558 1605 +f 1558 1551 1605 +f 1555 1548 1606 +f 1605 1551 1607 +f 1608 1609 1555 +f 1609 1608 1610 +f 1610 1611 1607 +f 1612 1610 1609 +f 1612 1607 1610 +f 1613 1610 1608 +f 1611 1610 1613 +f 1614 1606 1548 +f 1605 1614 1548 +f 1555 1606 1608 +f 1607 1611 1605 +f 1615 1616 1617 +f 1615 1618 1616 +f 1615 1619 1618 +f 1615 1617 1619 +f 1556 1553 1543 +f 1557 1555 1609 +f 1551 1556 1546 +f 1553 1555 1557 +f 1620 1617 1609 +f 1607 1616 1620 +f 1618 1607 1551 +f 1612 1620 1607 +f 1612 1609 1620 +f 1557 1543 1553 +f 1609 1617 1557 +f 1616 1607 1618 +f 1543 1546 1556 +f 1617 1620 1616 +f 1551 1546 1618 +f 1621 1622 1623 +f 1621 1624 1622 +f 1621 1625 1624 +f 1621 1623 1625 +f 1569 1557 1567 +f 1624 1618 1546 +f 1619 1622 1617 +f 1618 1624 1619 +f 1567 1557 1617 +f 1563 1569 1560 +f 1546 1563 1559 +f 1617 1623 1567 +f 1623 1617 1622 +f 1567 1560 1569 +f 1560 1559 1563 +f 1546 1562 1624 +f 1559 1562 1546 +f 1622 1619 1624 +f 1566 1567 1584 +f 1564 1566 1587 +f 1624 1626 1625 +f 1562 1564 1582 +f 1625 1627 1623 +f 1584 1567 1623 +f 1628 1624 1562 +f 1623 1627 1584 +f 1582 1581 1562 +f 1562 1581 1628 +f 1626 1624 1628 +f 1584 1587 1566 +f 1627 1625 1626 +f 1587 1582 1564 +f 1629 1630 1628 +f 1629 1627 1630 +f 1629 1628 1626 +f 1629 1626 1627 +f 1631 1632 1633 +f 1631 1634 1632 +f 1631 1635 1634 +f 1631 1633 1635 +f 1585 1584 1579 +f 1589 1585 1573 +f 1581 1589 1572 +f 1632 1628 1581 +f 1630 1633 1627 +f 1628 1632 1630 +f 1579 1584 1627 +f 1581 1575 1632 +f 1573 1572 1589 +f 1579 1573 1585 +f 1633 1630 1632 +f 1572 1575 1581 +f 1627 1635 1579 +f 1635 1627 1633 +f 1575 1598 1636 +f 1596 1601 1576 +f 1601 1598 1575 +f 1594 1596 1578 +f 1636 1632 1575 +f 1578 1579 1594 +f 1634 1637 1635 +f 1632 1638 1634 +f 1576 1578 1596 +f 1575 1576 1601 +f 1594 1579 1635 +f 1638 1632 1636 +f 1639 1638 1637 +f 1639 1636 1638 +f 1637 1634 1638 +f 1635 1637 1594 +f 1640 1636 1598 +f 1641 1642 1637 +f 1636 1640 1641 +f 1639 1637 1641 +f 1639 1641 1636 +f 1643 1594 1637 +f 1600 1594 1643 +f 1591 1600 1603 +f 1598 1591 1602 +f 1643 1603 1600 +f 1642 1641 1640 +f 1603 1602 1591 +f 1637 1644 1643 +f 1602 1645 1598 +f 1598 1645 1640 +f 1644 1637 1642 +f 1646 1647 1648 +f 1643 1646 1648 +f 1603 1643 1649 +f 1645 1602 1604 +f 1647 1645 1650 +f 1651 1652 1653 +f 1654 1653 1655 +f 1656 1655 1657 +f 1658 1657 1652 +f 1603 1649 1604 +f 1645 1604 1650 +f 1647 1650 1648 +f 1643 1648 1649 +f 1659 1651 1653 +f 1651 1658 1652 +f 1658 1660 1657 +f 1656 1654 1655 +f 1654 1659 1653 +f 1661 1662 1663 +f 1664 1661 1663 +f 1665 1664 1666 +f 1667 1665 1666 +f 1668 1667 1669 +f 1670 1671 1672 +f 1673 1670 1674 +f 1675 1673 1674 +f 1676 1675 1677 +f 1678 1676 1679 +f 1671 1678 1679 +f 1664 1663 1666 +f 1667 1666 1669 +f 1670 1672 1674 +f 1675 1674 1677 +f 1676 1677 1679 +f 1671 1679 1672 +f 1662 1680 1663 +f 1668 1669 1680 +f 1681 1682 1683 +f 1684 1683 1685 +f 1686 1685 1687 +f 1688 1687 1682 +f 1684 1689 1683 +f 1690 1684 1685 +f 1686 1690 1685 +f 1688 1686 1687 +f 1681 1688 1682 +f 1689 1681 1683 +f 1691 1692 1693 +f 1692 1694 1695 +f 1696 1691 1693 +f 1692 1695 1693 +f 1696 1693 1697 +f 1698 1697 1699 +f 1700 1699 1695 +f 1701 1702 1703 +f 1704 1703 1705 +f 1706 1705 1707 +f 1708 1707 1702 +f 1709 1701 1703 +f 1704 1709 1703 +f 1698 1696 1697 +f 1710 1704 1705 +f 1706 1710 1705 +f 1701 1708 1702 +f 1708 1706 1707 +f 1694 1700 1695 +f 1711 1642 1644 +f 1711 1640 1642 +f 1711 1712 1640 +f 1711 1644 1712 +f 1646 1643 1658 +f 1658 1643 1644 +f 1713 1640 1645 +f 1712 1714 1644 +f 1640 1715 1712 +f 1645 1647 1659 +f 1714 1712 1715 +f 1644 1714 1658 +f 1645 1654 1713 +f 1651 1659 1647 +f 1715 1640 1713 +f 1658 1651 1646 +f 1659 1654 1645 +f 1716 1713 1715 +f 1716 1717 1713 +f 1716 1714 1717 +f 1716 1715 1714 +f 1654 1656 1673 +f 1660 1658 1671 +f 1656 1660 1670 +f 1717 1718 1714 +f 1713 1719 1717 +f 1671 1658 1714 +f 1719 1713 1654 +f 1673 1675 1654 +f 1671 1670 1660 +f 1670 1673 1656 +f 1720 1714 1718 +f 1718 1717 1719 +f 1714 1720 1671 +f 1654 1675 1719 +f 1721 1720 1722 +f 1721 1718 1720 +f 1721 1719 1718 +f 1721 1722 1719 +f 1723 1724 1725 +f 1723 1725 1726 +f 1723 1726 1727 +f 1723 1727 1724 +f 1719 1726 1722 +f 1726 1719 1725 +f 1675 1676 1665 +f 1661 1671 1720 +f 1725 1719 1675 +f 1722 1727 1720 +f 1678 1671 1661 +f 1720 1727 1661 +f 1675 1667 1725 +f 1727 1722 1726 +f 1661 1664 1678 +f 1665 1667 1675 +f 1664 1665 1676 +f 1725 1728 1724 +f 1662 1661 1688 +f 1668 1662 1681 +f 1667 1668 1689 +f 1688 1661 1727 +f 1728 1725 1667 +f 1724 1729 1727 +f 1730 1729 1731 +f 1730 1728 1729 +f 1731 1727 1729 +f 1727 1731 1688 +f 1729 1724 1728 +f 1688 1681 1662 +f 1667 1684 1728 +f 1689 1684 1667 +f 1681 1689 1668 +f 1686 1688 1694 +f 1694 1688 1731 +f 1690 1686 1692 +f 1684 1690 1691 +f 1730 1732 1728 +f 1730 1731 1732 +f 1732 1733 1731 +f 1728 1734 1732 +f 1735 1728 1684 +f 1692 1691 1690 +f 1733 1732 1734 +f 1691 1696 1684 +f 1734 1728 1735 +f 1684 1696 1735 +f 1731 1733 1694 +f 1694 1692 1686 +f 1736 1734 1733 +f 1736 1735 1734 +f 1736 1737 1735 +f 1736 1733 1737 +f 1738 1739 1740 +f 1738 1741 1739 +f 1738 1742 1741 +f 1738 1740 1742 +f 1696 1698 1709 +f 1708 1694 1733 +f 1741 1735 1696 +f 1700 1694 1708 +f 1698 1700 1701 +f 1737 1739 1733 +f 1735 1741 1737 +f 1701 1709 1698 +f 1733 1740 1708 +f 1709 1704 1696 +f 1740 1733 1739 +f 1708 1701 1700 +f 1739 1737 1741 +f 1696 1704 1741 +f 1743 1610 1607 +f 1744 1607 1620 +f 1745 1617 1616 +f 1746 1616 1618 +f 1747 1620 1609 +f 1748 1609 1610 +f 1745 1749 1617 +f 1746 1745 1616 +f 1748 1747 1609 +f 1743 1748 1610 +f 1750 1743 1607 +f 1751 1750 1607 +f 1744 1751 1607 +f 1747 1744 1620 +f 1752 1619 1617 +f 1753 1622 1624 +f 1754 1624 1625 +f 1755 1625 1623 +f 1756 1623 1622 +f 1757 1618 1619 +f 1757 1746 1618 +f 1749 1752 1617 +f 1758 1753 1624 +f 1759 1758 1624 +f 1754 1759 1624 +f 1756 1755 1623 +f 1755 1754 1625 +f 1753 1756 1622 +f 1760 1761 1634 +f 1762 1760 1635 +f 1763 1762 1633 +f 1764 1763 1632 +f 1765 1764 1632 +f 1761 1765 1632 +f 1766 1767 1627 +f 1768 1766 1626 +f 1769 1768 1626 +f 1770 1769 1628 +f 1767 1771 1627 +f 1770 1628 1630 +f 1771 1630 1627 +f 1766 1627 1626 +f 1769 1626 1628 +f 1762 1635 1633 +f 1763 1633 1632 +f 1772 1641 1637 +f 1761 1632 1634 +f 1760 1634 1635 +f 1773 1637 1638 +f 1774 1638 1636 +f 1775 1636 1641 +f 1776 1777 1642 +f 1773 1778 1637 +f 1779 1773 1638 +f 1774 1779 1638 +f 1775 1774 1636 +f 1778 1772 1637 +f 1747 1780 1781 +f 1782 1783 1784 +f 1785 1780 1748 +f 1784 1785 1748 +f 1747 1748 1780 +f 1784 1750 1782 +f 1748 1743 1784 +f 1781 1786 1747 +f 1743 1750 1784 +f 1787 1782 1750 +f 1744 1747 1749 +f 1751 1744 1745 +f 1750 1751 1746 +f 1749 1747 1786 +f 1745 1746 1751 +f 1786 1788 1749 +f 1750 1746 1787 +f 1749 1745 1744 +f 1786 1781 1789 +f 1790 1789 1781 +f 1789 1783 1782 +f 1783 1789 1790 +f 1789 1791 1786 +f 1782 1791 1789 +f 1792 1782 1787 +f 1782 1792 1793 +f 1793 1788 1786 +f 1793 1791 1782 +f 1786 1791 1793 +f 1788 1793 1792 +f 1788 1794 1795 +f 1796 1797 1798 +f 1792 1794 1788 +f 1787 1794 1792 +f 1798 1797 1799 +f 1800 1797 1796 +f 1795 1794 1787 +f 1799 1797 1800 +f 1795 1798 1788 +f 1787 1796 1795 +f 1757 1752 1756 +f 1746 1757 1753 +f 1796 1787 1746 +f 1752 1749 1755 +f 1755 1749 1788 +f 1753 1758 1746 +f 1755 1756 1752 +f 1798 1795 1796 +f 1756 1753 1757 +f 1746 1758 1796 +f 1788 1799 1755 +f 1799 1788 1798 +f 1767 1755 1799 +f 1801 1796 1758 +f 1759 1754 1766 +f 1800 1802 1799 +f 1758 1759 1768 +f 1796 1803 1800 +f 1754 1755 1767 +f 1799 1802 1767 +f 1758 1769 1801 +f 1768 1769 1758 +f 1767 1766 1754 +f 1802 1800 1803 +f 1766 1768 1759 +f 1803 1796 1801 +f 1804 1805 1806 +f 1807 1805 1804 +f 1808 1805 1807 +f 1803 1809 1802 +f 1801 1809 1803 +f 1810 1809 1801 +f 1802 1809 1810 +f 1806 1805 1808 +f 1801 1804 1810 +f 1760 1767 1802 +f 1804 1801 1769 +f 1769 1770 1763 +f 1810 1806 1802 +f 1771 1767 1760 +f 1770 1771 1762 +f 1808 1802 1806 +f 1802 1808 1760 +f 1806 1810 1804 +f 1760 1762 1771 +f 1763 1764 1769 +f 1762 1763 1770 +f 1769 1764 1804 +f 1761 1760 1778 +f 1765 1761 1773 +f 1764 1765 1779 +f 1778 1760 1808 +f 1811 1804 1764 +f 1773 1779 1765 +f 1778 1773 1761 +f 1808 1812 1778 +f 1764 1774 1811 +f 1779 1774 1764 +f 1813 1778 1812 +f 1814 1811 1774 +f 1774 1775 1776 +f 1772 1778 1813 +f 1775 1772 1777 +f 1774 1815 1814 +f 1777 1776 1775 +f 1813 1777 1772 +f 1812 1816 1813 +f 1776 1815 1774 +f 1817 1818 1812 +f 1811 1818 1817 +f 1807 1812 1808 +f 1812 1807 1817 +f 1804 1817 1807 +f 1817 1804 1811 +f 1819 1820 1814 +f 1811 1814 1820 +f 1816 1812 1819 +f 1820 1818 1811 +f 1812 1818 1820 +f 1820 1819 1812 +f 1821 1815 1640 +f 1822 1821 1640 +f 1777 1813 1644 +f 1813 1822 1712 +f 1815 1776 1640 +f 1823 1713 1717 +f 1824 1717 1714 +f 1825 1714 1715 +f 1826 1715 1713 +f 1777 1644 1642 +f 1776 1642 1640 +f 1822 1640 1712 +f 1813 1712 1644 +f 1826 1827 1715 +f 1825 1828 1714 +f 1823 1826 1713 +f 1828 1824 1714 +f 1827 1825 1715 +f 1829 1830 1719 +f 1831 1829 1719 +f 1832 1831 1719 +f 1833 1832 1722 +f 1834 1833 1720 +f 1830 1834 1718 +f 1830 1718 1719 +f 1832 1719 1722 +f 1835 1725 1724 +f 1836 1724 1727 +f 1833 1722 1720 +f 1837 1727 1726 +f 1838 1726 1725 +f 1834 1720 1718 +f 1837 1839 1727 +f 1835 1838 1725 +f 1839 1836 1727 +f 1840 1837 1726 +f 1838 1840 1726 +f 1841 1842 1729 +f 1843 1841 1728 +f 1844 1843 1728 +f 1845 1844 1728 +f 1846 1845 1732 +f 1842 1846 1731 +f 1842 1731 1729 +f 1841 1729 1728 +f 1845 1728 1732 +f 1846 1732 1731 +f 1847 1733 1734 +f 1848 1734 1735 +f 1849 1847 1734 +f 1848 1849 1734 +f 1847 1850 1733 +f 1851 1737 1733 +f 1852 1735 1737 +f 1853 1740 1739 +f 1854 1739 1741 +f 1855 1741 1742 +f 1856 1742 1740 +f 1850 1851 1733 +f 1853 1856 1740 +f 1854 1853 1739 +f 1857 1854 1741 +f 1858 1857 1741 +f 1855 1858 1741 +f 1852 1848 1735 +f 1856 1855 1742 +f 1819 1859 1816 +f 1814 1859 1819 +f 1860 1859 1814 +f 1816 1859 1860 +f 1861 1862 1863 +f 1864 1862 1861 +f 1865 1862 1864 +f 1863 1862 1865 +f 1833 1828 1865 +f 1824 1828 1833 +f 1823 1824 1834 +f 1864 1866 1865 +f 1861 1867 1864 +f 1867 1861 1826 +f 1826 1823 1830 +f 1860 1865 1816 +f 1814 1863 1860 +f 1828 1813 1816 +f 1861 1814 1815 +f 1822 1813 1828 +f 1821 1822 1825 +f 1815 1821 1827 +f 1863 1814 1861 +f 1828 1825 1822 +f 1865 1860 1863 +f 1825 1827 1821 +f 1816 1865 1828 +f 1827 1826 1815 +f 1815 1826 1861 +f 1867 1868 1866 +f 1866 1868 1869 +f 1870 1868 1867 +f 1871 1872 1873 +f 1873 1872 1874 +f 1875 1872 1871 +f 1874 1872 1875 +f 1869 1868 1870 +f 1834 1830 1823 +f 1869 1865 1866 +f 1865 1869 1833 +f 1826 1829 1867 +f 1866 1864 1867 +f 1833 1834 1824 +f 1830 1829 1826 +f 1870 1871 1869 +f 1874 1867 1829 +f 1832 1833 1839 +f 1831 1832 1837 +f 1839 1833 1869 +f 1829 1831 1840 +f 1867 1875 1870 +f 1829 1838 1874 +f 1840 1838 1829 +f 1839 1837 1832 +f 1869 1871 1839 +f 1837 1840 1831 +f 1875 1867 1874 +f 1871 1870 1875 +f 1836 1839 1846 +f 1835 1836 1842 +f 1838 1835 1841 +f 1846 1839 1871 +f 1876 1874 1838 +f 1842 1841 1835 +f 1846 1842 1836 +f 1871 1877 1846 +f 1838 1843 1876 +f 1841 1843 1838 +f 1843 1844 1849 +f 1878 1876 1843 +f 1845 1846 1850 +f 1850 1846 1877 +f 1844 1845 1847 +f 1849 1848 1843 +f 1877 1879 1850 +f 1847 1849 1844 +f 1850 1847 1845 +f 1843 1848 1878 +f 1874 1876 1873 +f 1876 1880 1881 +f 1877 1871 1881 +f 1873 1881 1871 +f 1881 1873 1876 +f 1881 1880 1877 +f 1877 1880 1882 +f 1883 1876 1878 +f 1882 1879 1877 +f 1882 1880 1876 +f 1879 1882 1883 +f 1876 1883 1882 +f 1879 1884 1885 +f 1878 1884 1883 +f 1883 1884 1879 +f 1885 1884 1878 +f 1886 1887 1888 +f 1889 1887 1886 +f 1890 1887 1889 +f 1888 1887 1890 +f 1856 1850 1879 +f 1889 1878 1848 +f 1851 1850 1856 +f 1852 1851 1853 +f 1848 1852 1854 +f 1885 1886 1879 +f 1878 1889 1885 +f 1879 1888 1856 +f 1854 1857 1848 +f 1856 1853 1851 +f 1888 1879 1886 +f 1848 1857 1889 +f 1886 1885 1889 +f 1853 1854 1852 +f 1891 1892 1893 +f 1894 1891 1893 +f 1895 1896 1897 +f 1892 1895 1897 +f 1898 1894 1899 +f 1892 1897 1893 +f 1894 1893 1899 +f 1898 1899 1900 +f 1896 1900 1897 +f 1901 1902 1903 +f 1904 1903 1905 +f 1906 1905 1907 +f 1906 1907 1902 +f 1904 1908 1903 +f 1909 1904 1905 +f 1906 1909 1905 +f 1901 1910 1902 +f 1910 1906 1902 +f 1908 1901 1903 +f 1911 1912 1913 +f 1914 1913 1915 +f 1916 1915 1917 +f 1918 1917 1912 +f 1919 1920 1921 +f 1922 1921 1923 +f 1911 1924 1912 +f 1925 1911 1913 +f 1916 1914 1915 +f 1919 1926 1920 +f 1914 1925 1913 +f 1927 1919 1921 +f 1922 1927 1921 +f 1924 1918 1912 +f 1928 1929 1930 +f 1931 1930 1932 +f 1933 1932 1934 +f 1935 1934 1929 +f 1936 1923 1937 +f 1936 1937 1920 +f 1938 1933 1934 +f 1935 1938 1934 +f 1928 1935 1929 +f 1939 1922 1923 +f 1936 1939 1923 +f 1933 1931 1932 +f 1931 1940 1930 +f 1926 1936 1920 +f 1941 1942 1943 +f 1944 1941 1945 +f 1946 1944 1945 +f 1947 1946 1948 +f 1949 1947 1948 +f 1942 1949 1943 +f 1950 1951 1952 +f 1953 1952 1954 +f 1955 1954 1956 +f 1957 1956 1951 +f 1941 1943 1945 +f 1946 1945 1948 +f 1949 1948 1958 +f 1949 1958 1943 +f 1959 1960 1961 +f 1959 1962 1960 +f 1959 1963 1962 +f 1959 1961 1963 +f 1961 1741 1704 +f 1706 1708 1895 +f 1710 1706 1892 +f 1704 1710 1891 +f 1742 1962 1740 +f 1741 1963 1742 +f 1895 1708 1740 +f 1963 1741 1961 +f 1891 1894 1704 +f 1740 1962 1895 +f 1704 1894 1961 +f 1895 1892 1706 +f 1892 1891 1710 +f 1962 1742 1963 +f 1964 1965 1966 +f 1964 1966 1967 +f 1964 1968 1965 +f 1964 1967 1968 +f 1968 1961 1894 +f 1896 1895 1910 +f 1898 1896 1901 +f 1894 1898 1908 +f 1960 1965 1962 +f 1961 1968 1960 +f 1910 1895 1962 +f 1910 1901 1896 +f 1894 1904 1968 +f 1901 1908 1898 +f 1908 1904 1894 +f 1965 1960 1968 +f 1966 1962 1965 +f 1962 1966 1910 +f 1925 1914 1904 +f 1924 1911 1906 +f 1904 1914 1969 +f 1911 1925 1909 +f 1967 1970 1966 +f 1968 1971 1967 +f 1906 1910 1924 +f 1909 1906 1911 +f 1904 1909 1925 +f 1924 1910 1966 +f 1969 1968 1904 +f 1972 1969 1971 +f 1970 1967 1971 +f 1966 1970 1924 +f 1971 1968 1969 +f 1972 1971 1970 +f 1926 1924 1970 +f 1916 1918 1919 +f 1914 1916 1927 +f 1918 1924 1926 +f 1969 1973 1974 +f 1972 1974 1969 +f 1972 1970 1974 +f 1974 1975 1970 +f 1973 1969 1914 +f 1927 1922 1914 +f 1970 1976 1926 +f 1914 1922 1973 +f 1976 1970 1975 +f 1926 1919 1918 +f 1975 1974 1973 +f 1919 1927 1916 +f 1977 1975 1976 +f 1977 1973 1975 +f 1977 1978 1973 +f 1977 1976 1978 +f 1979 1980 1981 +f 1979 1982 1980 +f 1979 1983 1982 +f 1979 1981 1983 +f 1939 1936 1933 +f 1922 1939 1938 +f 1931 1926 1976 +f 1982 1973 1922 +f 1978 1981 1976 +f 1973 1980 1978 +f 1936 1926 1931 +f 1976 1981 1931 +f 1981 1978 1980 +f 1922 1935 1982 +f 1980 1973 1982 +f 1931 1933 1936 +f 1938 1935 1922 +f 1933 1938 1939 +f 1984 1982 1935 +f 1983 1985 1981 +f 1940 1931 1942 +f 1928 1940 1941 +f 1935 1928 1944 +f 1982 1984 1983 +f 1942 1931 1981 +f 1942 1941 1940 +f 1981 1986 1942 +f 1941 1944 1928 +f 1935 1946 1984 +f 1944 1946 1935 +f 1986 1981 1985 +f 1985 1983 1984 +f 1987 1985 1986 +f 1987 1984 1985 +f 1987 1988 1984 +f 1987 1986 1988 +f 1949 1942 1957 +f 1947 1949 1950 +f 1946 1947 1989 +f 1984 1990 1988 +f 1988 1991 1986 +f 1957 1942 1986 +f 1992 1984 1946 +f 1950 1989 1947 +f 1957 1950 1949 +f 1991 1988 1990 +f 1989 1953 1946 +f 1986 1991 1957 +f 1946 1953 1992 +f 1990 1984 1992 +f 1953 1989 1952 +f 1950 1957 1951 +f 1989 1950 1952 +f 1957 1993 1956 +f 1955 1953 1954 +f 1994 1995 1996 +f 1997 1994 1998 +f 1999 1997 1998 +f 2000 1999 2001 +f 2002 2000 2003 +f 1995 2002 1996 +f 2004 2005 2006 +f 2007 2006 2008 +f 2002 2003 1996 +f 1994 1996 1998 +f 1999 1998 2001 +f 2000 2001 2003 +f 2009 2004 2006 +f 2004 2010 2005 +f 2007 2009 2006 +f 2011 2012 2013 +f 2014 2011 2013 +f 2010 2015 2016 +f 2017 2014 2018 +f 2019 2017 2018 +f 2012 2020 2021 +f 2022 2007 2008 +f 2020 2019 2021 +f 2022 2008 2016 +f 2010 2016 2005 +f 2012 2021 2013 +f 2014 2013 2018 +f 2019 2018 2023 +f 2019 2023 2021 +f 2024 2025 2026 +f 2027 2028 2029 +f 2030 2024 2031 +f 2025 2027 2029 +f 2032 2030 2033 +f 2028 2032 2033 +f 2028 2033 2029 +f 2025 2029 2026 +f 2024 2026 2031 +f 2030 2031 2033 +f 2034 2035 2036 +f 2037 2036 2038 +f 2037 2034 2036 +f 2034 2039 2035 +f 2039 2040 2035 +f 2041 2037 2038 +f 2042 2041 2043 +f 2040 2042 2043 +f 2044 2045 2046 +f 2047 2046 2048 +f 2049 2048 2050 +f 2051 2050 2045 +f 2041 2038 2043 +f 2040 2043 2035 +f 2052 2047 2048 +f 2051 2053 2050 +f 2049 2052 2048 +f 2047 2044 2046 +f 2053 2049 2050 +f 2044 2051 2045 +f 2054 1990 1991 +f 2054 1992 1990 +f 2054 2055 1992 +f 2054 1991 2055 +f 1992 2056 2055 +f 2000 1957 1991 +f 2056 1992 1953 +f 1993 1957 2000 +f 1955 1993 2002 +f 1953 1955 1995 +f 2055 2057 1991 +f 2058 2056 2057 +f 1991 2059 2000 +f 2059 1991 2057 +f 2058 2057 2059 +f 2057 2055 2056 +f 2000 2002 1993 +f 2002 1995 1955 +f 1995 1994 1953 +f 1953 1994 2056 +f 2060 2061 2062 +f 2060 2063 2061 +f 2060 2064 2063 +f 2060 2062 2064 +f 1997 1999 2004 +f 1994 1997 2009 +f 2010 2000 2059 +f 1999 2000 2010 +f 2058 2065 2056 +f 2063 2056 1994 +f 2065 2062 2059 +f 2056 2061 2065 +f 2058 2059 2065 +f 2009 2007 1994 +f 2062 2065 2061 +f 1994 2007 2063 +f 2061 2056 2063 +f 2010 2004 1999 +f 2059 2062 2010 +f 2004 2009 1997 +f 2066 2067 2068 +f 2066 2069 2067 +f 2066 2070 2069 +f 2066 2068 2070 +f 2020 2010 2062 +f 2069 2063 2007 +f 2063 2069 2064 +f 2015 2010 2020 +f 2022 2015 2012 +f 2007 2022 2011 +f 2064 2067 2062 +f 2012 2011 2022 +f 2020 2012 2015 +f 2062 2068 2020 +f 2007 2014 2069 +f 2068 2062 2067 +f 2011 2014 2007 +f 2067 2064 2069 +f 2071 2072 2073 +f 2071 2074 2072 +f 2071 2075 2074 +f 2071 2073 2075 +f 2014 2017 2027 +f 2032 2020 2068 +f 2070 2075 2068 +f 2069 2073 2070 +f 2017 2019 2028 +f 2072 2069 2014 +f 2019 2020 2032 +f 2032 2028 2019 +f 2075 2070 2073 +f 2028 2027 2017 +f 2068 2075 2032 +f 2027 2025 2014 +f 2014 2025 2072 +f 2073 2069 2072 +f 2076 2072 2025 +f 2074 2077 2075 +f 2030 2032 2040 +f 2024 2030 2039 +f 2025 2024 2034 +f 2072 2076 2074 +f 2040 2032 2075 +f 2078 2075 2077 +f 2039 2034 2024 +f 2034 2037 2025 +f 2025 2037 2076 +f 2077 2074 2076 +f 2040 2039 2030 +f 2075 2078 2040 +f 2079 2077 2078 +f 2079 2076 2077 +f 2079 2080 2076 +f 2079 2078 2080 +f 2037 2051 2081 +f 2052 2049 2042 +f 2049 2053 2041 +f 2053 2051 2037 +f 2082 2083 2084 +f 2082 2081 2083 +f 2084 2080 2083 +f 2083 2076 2081 +f 2078 2084 2052 +f 2052 2040 2078 +f 2081 2076 2037 +f 2076 2083 2080 +f 2080 2084 2078 +f 2042 2040 2052 +f 2037 2041 2053 +f 2085 2052 2084 +f 2081 2086 2087 +f 2088 2081 2051 +f 2082 2087 2081 +f 2082 2084 2087 +f 2047 2052 2085 +f 2051 2044 2089 +f 2087 2090 2084 +f 2090 2087 2086 +f 2086 2081 2088 +f 2085 2091 2047 +f 2091 2089 2044 +f 2051 2089 2088 +f 2084 2090 2085 +f 2092 1966 1965 +f 2093 1965 1968 +f 2094 1962 1963 +f 2095 1963 1961 +f 2096 1961 1960 +f 2097 1960 1962 +f 2094 2098 1962 +f 2099 2094 1963 +f 2095 2099 1963 +f 2092 2100 1966 +f 2093 2092 1965 +f 2096 2095 1961 +f 2101 2093 1968 +f 2098 2097 1962 +f 2102 1969 1974 +f 2103 1974 1970 +f 2104 1968 1967 +f 2100 1967 1966 +f 2105 1970 1971 +f 2106 1971 1969 +f 2107 2105 1971 +f 2106 2107 1971 +f 2102 2106 1969 +f 2108 2101 1968 +f 2104 2108 1968 +f 2100 2104 1967 +f 2109 2103 1970 +f 2105 2109 1970 +f 2110 2111 1975 +f 2112 2110 1973 +f 2113 2112 1973 +f 2114 2113 1973 +f 2115 2114 1978 +f 2111 2115 1976 +f 2110 1975 1973 +f 2114 1973 1978 +f 2115 1978 1976 +f 2116 1982 1983 +f 2117 1983 1981 +f 2118 1980 1982 +f 2111 1976 1975 +f 2119 1981 1980 +f 2120 2119 1980 +f 2118 2120 1980 +f 2116 2118 1982 +f 2121 2117 1981 +f 2119 2121 1981 +f 2122 2123 1986 +f 2124 2122 1985 +f 2125 2124 1984 +f 2126 2125 1984 +f 2127 2126 1984 +f 2123 2127 1988 +f 2128 1991 1990 +f 2129 1990 1992 +f 2130 1992 2055 +f 2131 2055 1991 +f 2122 1986 1985 +f 2124 1985 1984 +f 2127 1984 1988 +f 2123 1988 1986 +f 2132 2133 2134 +f 2135 2133 2136 +f 2136 2133 2132 +f 2137 2138 2139 +f 2140 2138 2137 +f 2134 2133 2135 +f 2141 2138 2140 +f 2139 2138 2141 +f 2098 1856 1888 +f 1890 2135 1888 +f 1889 2134 1890 +f 2132 1889 1857 +f 1855 1856 2098 +f 1858 1855 2094 +f 1857 1858 2099 +f 1888 2135 2098 +f 1857 2095 2132 +f 2135 1890 2134 +f 2098 2094 1855 +f 2134 1889 2132 +f 2094 2099 1858 +f 2099 2095 1857 +f 2100 2092 2097 +f 2135 2139 2100 +f 2095 2101 2140 +f 2137 2136 2140 +f 2092 2093 2096 +f 2139 2135 2137 +f 2093 2101 2095 +f 2097 2098 2100 +f 2095 2096 2093 +f 2136 2137 2135 +f 2132 2140 2136 +f 2100 2098 2135 +f 2140 2132 2095 +f 2096 2097 2092 +f 2109 2100 2139 +f 2142 2140 2101 +f 2104 2100 2109 +f 2108 2104 2105 +f 2101 2108 2107 +f 2101 2106 2142 +f 2105 2107 2108 +f 2139 2143 2109 +f 2107 2106 2101 +f 2109 2105 2104 +f 2103 2109 2115 +f 2102 2103 2111 +f 2106 2102 2110 +f 2115 2109 2143 +f 2144 2142 2106 +f 2115 2111 2103 +f 2111 2110 2102 +f 2143 2145 2115 +f 2106 2112 2144 +f 2110 2112 2106 +f 2141 2143 2139 +f 2143 2141 2146 +f 2140 2146 2141 +f 2146 2140 2142 +f 2146 2147 2143 +f 2142 2147 2146 +f 2148 2149 2144 +f 2142 2144 2149 +f 2149 2147 2142 +f 2143 2147 2149 +f 2145 2143 2148 +f 2149 2148 2143 +f 2144 2150 2148 +f 2151 2150 2144 +f 2145 2150 2151 +f 2152 2153 2154 +f 2155 2153 2152 +f 2156 2153 2155 +f 2154 2153 2156 +f 2148 2150 2145 +f 2156 2157 2154 +f 2157 2156 2118 +f 2117 2121 2123 +f 2123 2121 2152 +f 2116 2117 2122 +f 2118 2116 2124 +f 2154 2158 2152 +f 2114 2115 2121 +f 2113 2114 2119 +f 2151 2152 2145 +f 2144 2155 2151 +f 2112 2113 2120 +f 2121 2115 2145 +f 2156 2144 2112 +f 2120 2118 2112 +f 2152 2151 2155 +f 2119 2120 2113 +f 2145 2152 2121 +f 2112 2118 2156 +f 2155 2144 2156 +f 2121 2119 2114 +f 2159 2160 2157 +f 2161 2160 2159 +f 2158 2160 2161 +f 2162 2163 2164 +f 2157 2160 2158 +f 2165 2163 2166 +f 2164 2163 2165 +f 2166 2163 2162 +f 2152 2161 2123 +f 2161 2152 2158 +f 2158 2154 2157 +f 2118 2125 2157 +f 2123 2122 2117 +f 2122 2124 2116 +f 2124 2125 2118 +f 2125 2126 2167 +f 2126 2127 2128 +f 2127 2123 2168 +f 2165 2157 2125 +f 2168 2123 2161 +f 2159 2162 2161 +f 2157 2166 2159 +f 2166 2157 2165 +f 2128 2167 2126 +f 2161 2162 2168 +f 2168 2128 2127 +f 2125 2129 2165 +f 2162 2159 2166 +f 2167 2129 2125 +f 2128 2168 1991 +f 2130 2129 1992 +f 2167 2128 1990 +f 2129 2167 1990 +f 2168 2131 1991 +f 2169 2170 2059 +f 2171 2169 2057 +f 2172 2171 2056 +f 2173 2172 2056 +f 2174 2173 2056 +f 2170 2174 2065 +f 2175 2061 2063 +f 2169 2059 2057 +f 2171 2057 2056 +f 2174 2056 2065 +f 2170 2065 2059 +f 2176 2062 2061 +f 2176 2177 2062 +f 2178 2176 2061 +f 2175 2178 2061 +f 2179 2064 2062 +f 2180 2068 2067 +f 2181 2067 2069 +f 2182 2069 2070 +f 2183 2070 2068 +f 2184 2063 2064 +f 2185 2186 2069 +f 2182 2185 2069 +f 2183 2182 2070 +f 2180 2183 2068 +f 2181 2180 2067 +f 2186 2181 2069 +f 2184 2175 2063 +f 2177 2179 2062 +f 2187 2188 2075 +f 2188 2189 2075 +f 2190 2187 2073 +f 2191 2190 2073 +f 2192 2191 2072 +f 2191 2073 2072 +f 2192 2072 2074 +f 2189 2074 2075 +f 2187 2075 2073 +f 2193 2078 2077 +f 2194 2077 2076 +f 2194 2193 2077 +f 2195 2194 2076 +f 2196 2195 2076 +f 2193 2197 2078 +f 2198 2081 2087 +f 2199 2087 2084 +f 2200 2084 2083 +f 2201 2083 2081 +f 2202 2076 2080 +f 2197 2080 2078 +f 2200 2199 2084 +f 2201 2200 2083 +f 2203 2201 2081 +f 2198 2203 2081 +f 2204 2198 2087 +f 2202 2196 2076 +f 2197 2202 2080 +f 2199 2204 2087 +f 2170 2168 2162 +f 2205 2165 2129 +f 2131 2168 2170 +f 2130 2131 2169 +f 2129 2130 2171 +f 2129 2172 2205 +f 2169 2171 2130 +f 2162 2206 2170 +f 2171 2172 2129 +f 2170 2169 2131 +f 2174 2170 2177 +f 2173 2174 2176 +f 2172 2173 2178 +f 2207 2205 2172 +f 2177 2170 2206 +f 2172 2175 2207 +f 2178 2175 2172 +f 2176 2178 2173 +f 2206 2208 2177 +f 2177 2176 2174 +f 2164 2209 2162 +f 2165 2205 2164 +f 2209 2210 2206 +f 2205 2210 2209 +f 2206 2162 2209 +f 2209 2164 2205 +f 2208 2211 2212 +f 2211 2210 2205 +f 2206 2210 2211 +f 2211 2208 2206 +f 2205 2212 2211 +f 2212 2205 2207 +f 2212 2213 2208 +f 2207 2213 2212 +f 2214 2215 2216 +f 2217 2215 2214 +f 2218 2215 2217 +f 2216 2215 2218 +f 2219 2213 2207 +f 2208 2213 2219 +f 2184 2179 2180 +f 2179 2177 2183 +f 2175 2184 2181 +f 2183 2177 2208 +f 2217 2207 2175 +f 2219 2214 2208 +f 2207 2217 2219 +f 2183 2180 2179 +f 2180 2181 2184 +f 2175 2186 2217 +f 2216 2208 2214 +f 2208 2216 2183 +f 2214 2219 2217 +f 2181 2186 2175 +f 2220 2221 2222 +f 2223 2221 2220 +f 2224 2221 2223 +f 2225 2226 2227 +f 2228 2226 2225 +f 2229 2226 2228 +f 2227 2226 2229 +f 2222 2221 2224 +f 2217 2222 2218 +f 2185 2182 2187 +f 2182 2183 2188 +f 2186 2185 2190 +f 2218 2224 2216 +f 2188 2183 2216 +f 2220 2217 2186 +f 2188 2187 2182 +f 2224 2218 2222 +f 2190 2191 2186 +f 2187 2190 2185 +f 2222 2217 2220 +f 2216 2224 2188 +f 2186 2191 2220 +f 2228 2220 2191 +f 2189 2188 2197 +f 2192 2189 2193 +f 2191 2192 2194 +f 2223 2225 2224 +f 2220 2228 2223 +f 2197 2188 2224 +f 2227 2224 2225 +f 2193 2194 2192 +f 2225 2223 2228 +f 2197 2193 2189 +f 2194 2195 2191 +f 2224 2227 2197 +f 2191 2195 2228 +f 2230 2231 2198 +f 2203 2198 2231 +f 2204 2199 2232 +f 2232 2199 2233 +f 2203 2231 2234 +f 2232 2230 2204 +f 2234 2235 2203 +f 2233 2236 2232 +f 2199 2197 2227 +f 2202 2197 2199 +f 2196 2202 2200 +f 2195 2196 2201 +f 2235 2228 2195 +f 2201 2203 2195 +f 2200 2201 2196 +f 2227 2233 2199 +f 2195 2203 2235 +f 2199 2200 2202 +f 2235 2237 2238 +f 2229 2233 2227 +f 2233 2229 2238 +f 2238 2228 2235 +f 2228 2238 2229 +f 2238 2237 2233 +f 2236 2239 2240 +f 2240 2235 2234 +f 2239 2236 2233 +f 2233 2237 2239 +f 2235 2240 2239 +f 2239 2237 2235 +f 2241 2242 2243 +f 2244 2245 2246 +f 2245 2243 2242 +f 2242 2246 2245 +f 2243 2245 2244 +f 2247 2246 2242 +f 2248 2244 2247 +f 2247 2241 2248 +f 2244 2248 2243 +f 2243 2248 2241 +f 2246 2247 2244 +f 2242 2241 2247 +f 2249 2250 2251 +f 2250 2252 2251 +f 2251 2252 2253 +f 2252 2254 2255 +f 2254 2252 2250 +f 2256 2257 2258 +f 2259 2257 2256 +f 2256 2255 2259 +f 2255 2256 2252 +f 2252 2256 2253 +f 2253 2256 2258 +f 2260 2261 2262 +f 2262 2254 2260 +f 2254 2263 2260 +f 2250 2263 2254 +f 2262 2264 2265 +f 2255 2265 2266 +f 2255 2254 2262 +f 2265 2255 2262 +f 2267 2265 2264 +f 2268 2264 2269 +f 2261 2269 2264 +f 2270 2267 2268 +f 2264 2268 2267 +f 2271 2272 2270 +f 2267 2270 2272 +f 2272 2271 2273 +f 2264 2262 2261 +f 2266 2274 2275 +f 2272 2266 2267 +f 2265 2267 2266 +f 2273 2274 2272 +f 2266 2272 2274 +f 2274 2273 2276 +f 2259 2255 2266 +f 2259 2266 2275 +f 2258 2257 2277 +f 2257 2278 2277 +f 2275 2278 2257 +f 2257 2259 2275 +f 2279 2280 2278 +f 2278 2275 2279 +f 2277 2278 2281 +f 2278 2280 2281 +f 2275 2274 2279 +f 2274 2276 2279 +f 2282 2279 2283 +f 2279 2276 2283 +f 2281 2280 2284 +f 2280 2285 2284 +f 2282 2285 2280 +f 2280 2279 2282 +f 2286 2273 2271 +f 2287 2271 2288 +f 2270 2288 2271 +f 2271 2287 2286 +f 2289 2268 2290 +f 2269 2290 2268 +f 2288 2270 2289 +f 2268 2289 2270 +f 2290 2291 2289 +f 2292 2293 2294 +f 2294 2295 2296 +f 2295 2294 2293 +f 2294 2297 2292 +f 2298 2292 2297 +f 2296 2299 2294 +f 2300 2301 2302 +f 2303 2304 2305 +f 2302 2305 2304 +f 2304 2306 2302 +f 2299 2301 2297 +f 2300 2297 2301 +f 2297 2294 2299 +f 2306 2300 2302 +f 2284 2285 2303 +f 2285 2304 2303 +f 2306 2304 2285 +f 2285 2282 2306 +f 2282 2283 2306 +f 2283 2300 2306 +f 2307 2276 2273 +f 2298 2283 2307 +f 2276 2307 2283 +f 2297 2300 2298 +f 2283 2298 2300 +f 2308 2307 2286 +f 2273 2286 2307 +f 2292 2298 2308 +f 2307 2308 2298 +f 2309 2286 2287 +f 2309 2310 2311 +f 2311 2308 2309 +f 2286 2309 2308 +f 2308 2311 2292 +f 2312 2293 2313 +f 2311 2313 2293 +f 2314 2295 2312 +f 2293 2312 2295 +f 2293 2292 2311 +f 2315 2316 2317 +f 2314 2315 2318 +f 2317 2319 2320 +f 2315 2317 2320 +f 2315 2314 2316 +f 2312 2316 2314 +f 2318 2321 2314 +f 2320 2318 2315 +f 2295 2314 2321 +f 2321 2296 2295 +f 2313 2311 2310 +f 2310 2309 2322 +f 2323 2313 2324 +f 2310 2324 2313 +f 2313 2323 2312 +f 2316 2323 2325 +f 2316 2325 2317 +f 2323 2324 2326 +f 2323 2326 2325 +f 2316 2312 2323 +f 2327 2328 2329 +f 2324 2330 2326 +f 2327 2329 2330 +f 2327 2322 2328 +f 2331 2328 2322 +f 2324 2310 2327 +f 2322 2327 2310 +f 2324 2327 2330 +f 2332 2333 2331 +f 2291 2334 2332 +f 2331 2288 2332 +f 2289 2332 2288 +f 2322 2287 2331 +f 2288 2331 2287 +f 2287 2322 2309 +f 2332 2289 2291 +f 2333 2332 2334 +f 2328 2335 2329 +f 2336 2337 2334 +f 2337 2333 2334 +f 2328 2333 2335 +f 2333 2337 2335 +f 2328 2331 2333 +f 2338 2339 2340 +f 2263 2250 2341 +f 2341 2340 2263 +f 2339 2338 2342 +f 2342 2343 2339 +f 2340 2341 2338 +f 2341 2250 2249 +f 2342 2338 2344 +f 2338 2345 2344 +f 2338 2341 2345 +f 2341 2346 2345 +f 2346 2341 2249 +f 2345 2346 2344 +f 2346 2249 2344 +f 2344 2249 2347 +f 2348 2347 2251 +f 2249 2251 2347 +f 2349 2350 2351 +f 2351 2350 2348 +f 2352 2353 2349 +f 2350 2349 2353 +f 2351 2348 2253 +f 2251 2253 2348 +f 2350 2354 2348 +f 2355 2356 957 +f 2353 2357 2350 +f 2355 957 958 +f 2356 2355 2358 +f 2359 2358 2355 +f 2357 2353 2359 +f 2358 2359 2353 +f 2360 2349 2351 +f 2352 2361 2362 +f 2361 2352 2363 +f 2360 2351 2258 +f 2253 2258 2351 +f 2363 2349 2360 +f 2349 2363 2352 +f 2364 2363 2365 +f 2365 2363 2360 +f 2366 2361 2364 +f 2365 2360 2277 +f 2258 2277 2360 +f 2363 2364 2361 +f 2367 2356 2362 +f 2356 2367 917 +f 2353 2352 2358 +f 2362 2358 2352 +f 2358 2362 2356 +f 2356 917 957 +f 2362 2368 2367 +f 2367 938 917 +f 2368 2362 2361 +f 2369 2367 2368 +f 2367 2369 938 +f 2368 2370 2369 +f 2371 2369 2370 +f 2369 2371 937 +f 2369 937 938 +f 2370 2368 2366 +f 2361 2366 2368 +f 2339 2372 2373 +f 2373 2260 2340 +f 2260 2263 2340 +f 2374 2372 2343 +f 2372 2339 2343 +f 2340 2339 2373 +f 2261 2260 2375 +f 2373 2375 2260 +f 2375 2373 2376 +f 2372 2376 2373 +f 2376 2372 2377 +f 2374 2377 2372 +f 2377 2374 2378 +f 2354 2350 2357 +f 2348 2354 2347 +f 2342 2344 2379 +f 2347 2380 2344 +f 2374 2343 2381 +f 2343 2342 2379 +f 2379 2381 2343 +f 2382 2383 2384 +f 2384 2385 2382 +f 2381 2379 2383 +f 2383 2382 2381 +f 2385 2384 2386 +f 2387 2388 2389 +f 2387 2390 2386 +f 2388 2391 2380 +f 2380 2389 2388 +f 2389 2390 2387 +f 2389 2380 2386 +f 2386 2390 2389 +f 2391 2388 2383 +f 2379 2391 2383 +f 2387 2386 2384 +f 2383 2388 2384 +f 2388 2387 2384 +f 2386 2354 2357 +f 2347 2354 2380 +f 2386 2380 2354 +f 2386 2357 2392 +f 2344 2391 2379 +f 2391 2344 2380 +f 2357 2393 2392 +f 2359 2394 2393 +f 2359 2393 2357 +f 2355 2394 2359 +f 2355 958 959 +f 959 2394 2355 +f 2394 2395 2393 +f 2395 2396 2393 +f 2394 959 2395 +f 963 2395 959 +f 2385 2396 2397 +f 2398 2385 2397 +f 2393 2385 2392 +f 2392 2385 2386 +f 2385 2393 2396 +f 2399 2400 2401 +f 2400 2402 2403 +f 2400 2403 2401 +f 2401 2403 2404 +f 2405 2401 2404 +f 2406 2404 2407 +f 2378 2408 2403 +f 2408 2378 2374 +f 2404 2403 2407 +f 2409 2410 2411 +f 2411 2382 2409 +f 2398 2409 2385 +f 2408 2374 2381 +f 2382 2411 2408 +f 2381 2382 2408 +f 2382 2385 2409 +f 2412 2407 2413 +f 2411 2403 2408 +f 2414 2413 2410 +f 2410 2409 2415 +f 2413 2407 2411 +f 2407 2403 2411 +f 2410 2413 2411 +f 2416 2417 2410 +f 2397 2418 2398 +f 2398 2418 2419 +f 2419 2416 2415 +f 2420 2417 2410 +f 2414 2410 2417 +f 2412 2413 2421 +f 2419 2409 2398 +f 2413 2414 2422 +f 2410 2415 2416 +f 2415 2409 2419 +f 2385 2420 2410 +f 2410 2417 2404 +f 2423 2364 2365 +f 2423 2365 2281 +f 2277 2281 2365 +f 2424 2366 2425 +f 2425 2364 2423 +f 2364 2425 2366 +f 2424 2426 2427 +f 2428 2427 2426 +f 2429 2423 2284 +f 2281 2284 2423 +f 2430 2425 2429 +f 2429 2425 2423 +f 2426 2424 2430 +f 2425 2430 2424 +f 2366 2424 2370 +f 2370 2427 2371 +f 2427 2370 2424 +f 2371 1004 937 +f 2431 2371 2427 +f 2431 1005 1004 +f 2371 2431 1004 +f 2427 2428 2431 +f 2432 2433 2434 +f 2434 2428 2435 +f 2433 2431 2428 +f 2433 2432 1008 +f 2433 1008 1005 +f 2431 2433 1005 +f 2426 2435 2428 +f 2428 2434 2433 +f 2436 2437 2399 +f 2438 2439 2405 +f 2440 2441 2402 +f 2442 2440 2443 +f 2437 2442 2400 +f 2439 2436 2401 +f 2421 2444 2412 +f 2444 2445 2407 +f 2446 2438 2404 +f 2445 2446 2406 +f 2417 2422 2414 +f 2422 2421 2413 +f 2417 2438 2404 +f 2401 2405 2439 +f 2407 2412 2444 +f 2404 2406 2446 +f 2406 2407 2445 +f 2405 2404 2438 +f 2447 2448 2449 +f 2450 2447 2451 +f 2452 2453 2454 +f 2455 2450 2456 +f 2457 2458 2459 +f 2453 2457 2460 +f 2448 2452 2461 +f 2457 2460 2462 +f 2400 2399 2437 +f 2443 2400 2442 +f 2458 2402 2441 +f 2402 2443 2440 +f 2399 2401 2436 +f 2404 2438 2457 +f 2449 2451 2447 +f 2459 2460 2457 +f 2461 2449 2448 +f 2454 2461 2452 +f 2460 2454 2453 +f 2441 2459 2458 +f 2438 2460 2457 +f 2463 2464 2465 +f 2465 2466 2463 +f 2290 2269 2467 +f 2468 2467 2269 +f 2467 2468 2469 +f 2470 2469 2468 +f 2469 2470 2466 +f 2471 2466 2470 +f 2466 2465 2469 +f 2472 2463 2466 +f 2466 2471 2472 +f 2375 2468 2261 +f 2468 2375 2470 +f 2376 2470 2375 +f 2470 2376 2471 +f 2377 2471 2376 +f 2269 2261 2468 +f 2471 2377 2473 +f 2378 2473 2377 +f 2443 2402 2400 +f 2403 2474 2378 +f 2402 2457 2403 +f 2457 2474 2403 +f 2473 2378 2474 +f 2453 2452 2457 +f 2458 2457 2402 +f 2448 2447 2452 +f 2475 2462 2455 +f 2462 2474 2455 +f 2455 2474 2447 +f 2447 2474 2452 +f 2452 2474 2457 +f 2450 2455 2447 +f 2474 2476 2473 +f 2473 2472 2471 +f 2462 2477 2474 +f 2478 2479 2477 +f 2472 2473 2476 +f 2480 2477 2462 +f 2479 2476 2477 +f 2477 2476 2474 +f 2479 2481 2476 +f 2476 2481 2482 +f 2483 2482 2481 +f 2484 2481 2479 +f 2482 2485 2476 +f 2463 2472 2486 +f 2476 2486 2472 +f 2485 2487 2476 +f 2487 2486 2476 +f 2488 2489 2487 +f 2490 2487 2485 +f 2491 2485 2482 +f 2318 2320 2492 +f 2493 2494 2495 +f 2492 2495 2494 +f 2494 2493 2496 +f 2492 2497 2318 +f 2321 2318 2497 +f 2494 2498 2492 +f 2497 2492 2498 +f 2496 2499 2494 +f 2498 2494 2499 +f 2500 2501 2502 +f 2502 2503 2504 +f 2317 2325 2504 +f 2504 2505 2317 +f 2319 2317 2505 +f 2506 2496 2493 +f 2495 2492 2320 +f 2320 2319 2495 +f 2495 2507 2493 +f 2493 2508 2506 +f 2509 2319 2505 +f 2507 2508 2493 +f 2319 2507 2495 +f 2508 2509 2506 +f 2508 2507 2509 +f 2507 2319 2509 +f 2510 2511 2512 +f 2513 2514 2515 +f 2512 2515 2514 +f 2299 2296 2510 +f 2510 2516 2299 +f 2511 2497 2515 +f 2515 2498 2513 +f 2511 2510 2296 +f 2515 2512 2511 +f 2296 2321 2511 +f 2496 2506 2517 +f 2497 2511 2321 +f 2499 2513 2498 +f 2498 2515 2497 +f 2518 2509 2519 +f 2517 2520 2496 +f 2499 2496 2520 +f 2521 2517 2506 +f 2509 2518 2521 +f 2504 2503 2505 +f 2503 2502 2501 +f 2506 2509 2521 +f 2501 2500 2522 +f 2523 2524 2522 +f 2525 2503 2501 +f 2522 2526 2501 +f 2505 2503 2519 +f 2505 2519 2509 +f 2525 2501 2527 +f 2525 2519 2503 +f 2501 2526 2527 +f 2522 2524 2526 +f 2528 2430 2429 +f 2284 2303 2429 +f 2430 2529 2426 +f 2528 2429 2303 +f 2529 2430 2528 +f 2435 2426 2529 +f 2530 2529 2528 +f 2435 2531 2434 +f 2531 2435 2532 +f 2529 2532 2435 +f 2530 2305 2533 +f 2530 2528 2305 +f 2303 2305 2528 +f 2534 2535 2305 +f 2305 2302 2534 +f 2536 2537 2535 +f 2535 2534 2536 +f 2538 2533 2537 +f 2537 2536 2538 +f 2305 2535 2533 +f 2535 2537 2533 +f 2538 2536 2539 +f 2301 2516 2534 +f 2534 2516 2536 +f 2516 2540 2536 +f 2536 2540 2539 +f 2302 2301 2534 +f 2540 2512 2539 +f 2514 2539 2512 +f 2514 2513 2541 +f 2513 2499 2542 +f 2301 2299 2516 +f 2512 2540 2510 +f 2516 2510 2540 +f 2543 2544 2545 +f 2517 2521 2546 +f 2544 2546 2545 +f 2547 2545 2548 +f 2545 2549 2548 +f 2520 2542 2499 +f 2549 2546 2521 +f 2546 2549 2545 +f 2549 2550 2548 +f 2550 2551 2548 +f 2548 2551 2525 +f 2521 2518 2549 +f 2551 2550 2552 +f 2550 2518 2519 +f 2518 2550 2549 +f 2553 2434 2531 +f 2432 2554 1021 +f 2434 2553 2432 +f 2554 2432 2553 +f 2432 1021 1008 +f 2541 2555 2514 +f 2542 2541 2513 +f 2556 2557 2542 +f 2520 2517 2558 +f 2558 2546 2559 +f 2560 2559 2561 +f 2562 2563 2559 +f 2564 2565 2563 +f 2565 2558 2563 +f 2563 2558 2559 +f 2561 2546 2566 +f 2566 2546 2567 +f 2544 2567 2546 +f 2559 2546 2561 +f 2546 2558 2517 +f 2568 2567 2544 +f 2569 2566 2567 +f 2570 2561 2566 +f 2532 2571 2531 +f 2532 2530 2571 +f 2538 2539 2572 +f 2539 2514 2555 +f 2532 2529 2530 +f 2533 2538 2572 +f 2533 2573 2530 +f 2397 2531 2571 +f 2574 2571 2530 +f 2572 2573 2533 +f 2531 2397 2553 +f 2574 2530 2573 +f 2539 2555 2572 +f 2553 2396 2554 +f 2395 2554 2396 +f 1021 2554 2395 +f 2395 963 1021 +f 2396 2553 2397 +f 2397 2571 2420 +f 2420 2571 2575 +f 2420 2418 2397 +f 2574 2576 2571 +f 2571 2576 2577 +f 2577 2575 2571 +f 2577 2576 2578 +f 2578 2575 2577 +f 2576 2574 2573 +f 2579 2578 2573 +f 2573 2578 2576 +f 2573 2572 2579 +f 2420 2575 2578 +f 2578 2579 2420 +f 2580 2419 2420 +f 2420 2419 2418 +f 2572 2555 2579 +f 2555 2580 2579 +f 2579 2580 2420 +f 2555 2541 2580 +f 2421 2422 2417 +f 2417 2416 2419 +f 2580 2445 2421 +f 2421 2417 2580 +f 2580 2417 2419 +f 2438 2445 2557 +f 2557 2445 2580 +f 2438 2446 2445 +f 2439 2438 2436 +f 2557 2436 2438 +f 2557 2580 2541 +f 2445 2444 2421 +f 2451 2556 2581 +f 2456 2451 2581 +f 2556 2558 2582 +f 2583 2582 2584 +f 2542 2520 2556 +f 2585 2581 2582 +f 2582 2581 2556 +f 2586 2587 2565 +f 2558 2556 2520 +f 2582 2558 2584 +f 2588 2589 2587 +f 2589 2558 2587 +f 2584 2558 2589 +f 2587 2558 2565 +f 2590 2584 2589 +f 2454 2460 2461 +f 2459 2441 2460 +f 2541 2542 2557 +f 2557 2556 2441 +f 2441 2556 2460 +f 2440 2442 2441 +f 2441 2442 2557 +f 2436 2557 2442 +f 2437 2436 2442 +f 2525 2527 2548 +f 2548 2527 2526 +f 2551 2591 2525 +f 2552 2591 2551 +f 2525 2591 2552 +f 2519 2552 2550 +f 2552 2519 2525 +f 2460 2556 2461 +f 2461 2556 2451 +f 2449 2461 2451 +f 2585 2582 2462 +f 2456 2581 2455 +f 2451 2456 2450 +f 2581 2585 2475 +f 2460 2582 2462 +f 2480 2462 2582 +f 2478 2477 2584 +f 2479 2478 2590 +f 2462 2475 2585 +f 2477 2480 2583 +f 2475 2455 2581 +f 2481 2462 2587 +f 2583 2584 2477 +f 2588 2587 2481 +f 2582 2583 2480 +f 2584 2590 2478 +f 2589 2588 2484 +f 2590 2589 2479 +f 2462 2582 2587 +f 2592 2500 2593 +f 2502 2593 2500 +f 2593 2502 2594 +f 2594 2502 2504 +f 2325 2326 2594 +f 2594 2504 2325 +f 2595 2592 2596 +f 2593 2596 2592 +f 2592 2595 2597 +f 2598 2597 2595 +f 2599 2594 2326 +f 2596 2593 2599 +f 2599 2593 2594 +f 2522 2600 2523 +f 2600 2522 2500 +f 2523 2601 2602 +f 2523 2602 2603 +f 2601 2523 2600 +f 2600 2597 2601 +f 2500 2592 2600 +f 2597 2598 2604 +f 2605 2604 2598 +f 2604 2606 2607 +f 2601 2604 2607 +f 2604 2601 2597 +f 2601 2607 2602 +f 2597 2600 2592 +f 2608 2595 2609 +f 2609 2596 2610 +f 2610 2596 2599 +f 2610 2599 2330 +f 2326 2330 2599 +f 2596 2609 2595 +f 2611 2608 2612 +f 2613 2610 2329 +f 2330 2329 2610 +f 2612 2609 2613 +f 2613 2609 2610 +f 2609 2612 2608 +f 2598 2614 2605 +f 2615 2605 2614 +f 2605 2616 2606 +f 2595 2608 2598 +f 2614 2598 2608 +f 2604 2605 2606 +f 2605 2615 2616 +f 2608 2611 2614 +f 2617 2614 2611 +f 2614 2617 2615 +f 2618 2615 2617 +f 2615 2619 2616 +f 2615 2618 2619 +f 2469 2620 2467 +f 2291 2290 2621 +f 2467 2621 2290 +f 2620 2469 2465 +f 2621 2467 2620 +f 2621 2622 2291 +f 2620 2623 2621 +f 2465 2624 2620 +f 2622 2621 2623 +f 2334 2291 2622 +f 2624 2465 2464 +f 2623 2620 2624 +f 2625 2613 2335 +f 2329 2335 2613 +f 2625 2612 2613 +f 2626 2627 2628 +f 2628 2625 2337 +f 2629 2626 2628 +f 2335 2337 2625 +f 2630 2631 2632 +f 2626 2632 2631 +f 2631 2630 2633 +f 2633 2634 2635 +f 2634 2633 2630 +f 2636 2635 2634 +f 2635 2636 2637 +f 2617 2638 2618 +f 2639 2618 2638 +f 2618 2639 2640 +f 2618 2640 2619 +f 2638 2617 2641 +f 2631 2641 2626 +f 2627 2626 2641 +f 2641 2611 2627 +f 2612 2627 2611 +f 2628 2627 2625 +f 2611 2641 2617 +f 2627 2612 2625 +f 2635 2639 2633 +f 2635 2637 2642 +f 2639 2635 2642 +f 2639 2642 2640 +f 2633 2638 2631 +f 2641 2631 2638 +f 2638 2633 2639 +f 2623 2624 2643 +f 2644 2622 2645 +f 2643 2624 2464 +f 2622 2623 2645 +f 2336 2334 2644 +f 2334 2622 2644 +f 2645 2623 2643 +f 2629 2336 2643 +f 2643 2646 2629 +f 2629 2628 2336 +f 2644 2645 2643 +f 2632 2626 2629 +f 2337 2336 2628 +f 2336 2644 2643 +f 2586 2565 2482 +f 2485 2563 2562 +f 2565 2564 2491 +f 2587 2586 2483 +f 2564 2563 2485 +f 2587 2559 2481 +f 2483 2481 2587 +f 2485 2491 2564 +f 2482 2483 2586 +f 2481 2484 2588 +f 2562 2490 2485 +f 2491 2482 2565 +f 2484 2479 2589 +f 2559 2487 2481 +f 2570 2566 2647 +f 2560 2561 2489 +f 2561 2570 2648 +f 2562 2559 2487 +f 2559 2560 2488 +f 2487 2559 2567 +f 2489 2488 2560 +f 2648 2489 2561 +f 2649 2647 2566 +f 2487 2490 2562 +f 2650 2649 2569 +f 2488 2487 2559 +f 2647 2648 2570 +f 2650 2487 2567 +f 2651 2548 2526 +f 2544 2543 2652 +f 2547 2548 2651 +f 2545 2547 2653 +f 2543 2545 2654 +f 2568 2544 2655 +f 2569 2567 2650 +f 2566 2569 2649 +f 2567 2548 2650 +f 2567 2568 2656 +f 2655 2656 2568 +f 2654 2652 2543 +f 2656 2650 2567 +f 2652 2655 2544 +f 2653 2654 2545 +f 2651 2653 2547 +f 2548 2651 2650 +f 2649 2650 2647 +f 2655 2486 2650 +f 2648 2647 2489 +f 2650 2486 2647 +f 2647 2486 2489 +f 2489 2486 2487 +f 2486 2657 2463 +f 2464 2463 2657 +f 2653 2651 2654 +f 2656 2655 2650 +f 2651 2657 2654 +f 2654 2657 2655 +f 2657 2486 2655 +f 2652 2654 2655 +f 2526 2658 2651 +f 2658 2659 2651 +f 2651 2659 2660 +f 2464 2657 2646 +f 2651 2661 2657 +f 2662 2658 2526 +f 2523 2603 2663 +f 2663 2524 2523 +f 2664 2662 2663 +f 2524 2662 2526 +f 2524 2663 2662 +f 2662 2636 2658 +f 2662 2664 2637 +f 2665 2660 2629 +f 2658 2634 2659 +f 2646 2643 2464 +f 2659 2630 2660 +f 2665 2629 2646 +f 2661 2666 2657 +f 2657 2666 2646 +f 2660 2661 2651 +f 2632 2660 2630 +f 2637 2636 2662 +f 2634 2658 2636 +f 2630 2659 2634 +f 2632 2629 2660 +f 2660 2667 2668 +f 2667 2665 2646 +f 2646 2666 2667 +f 2666 2661 2668 +f 2668 2661 2660 +f 2665 2667 2660 +f 2668 2667 2666 +f 2669 2670 2671 +f 2670 2672 2671 +f 2671 2672 2673 +f 2672 2674 2675 +f 2674 2672 2670 +f 2676 2677 2678 +f 2679 2677 2676 +f 2676 2675 2679 +f 2675 2676 2672 +f 2672 2676 2673 +f 2673 2676 2678 +f 2680 2681 2682 +f 2682 2674 2680 +f 2674 2683 2680 +f 2670 2683 2674 +f 2682 2684 2685 +f 2675 2685 2686 +f 2675 2674 2682 +f 2685 2675 2682 +f 2687 2685 2684 +f 2688 2684 2689 +f 2681 2689 2684 +f 2690 2687 2688 +f 2684 2688 2687 +f 2691 2692 2690 +f 2687 2690 2692 +f 2692 2691 2693 +f 2684 2682 2681 +f 2686 2694 2695 +f 2692 2686 2687 +f 2685 2687 2686 +f 2693 2694 2692 +f 2686 2692 2694 +f 2694 2693 2696 +f 2679 2675 2686 +f 2679 2686 2695 +f 2678 2677 2697 +f 2677 2698 2697 +f 2695 2698 2677 +f 2677 2679 2695 +f 2699 2700 2698 +f 2698 2695 2699 +f 2697 2698 2701 +f 2698 2700 2701 +f 2695 2694 2699 +f 2694 2696 2699 +f 2702 2699 2703 +f 2699 2696 2703 +f 2701 2700 2704 +f 2700 2705 2704 +f 2702 2705 2700 +f 2700 2699 2702 +f 2706 2693 2691 +f 2707 2691 2708 +f 2690 2708 2691 +f 2691 2707 2706 +f 2709 2688 2710 +f 2689 2710 2688 +f 2708 2690 2709 +f 2688 2709 2690 +f 2710 2711 2709 +f 2712 2713 2714 +f 2714 2715 2716 +f 2715 2714 2713 +f 2714 2717 2712 +f 2718 2712 2717 +f 2716 2719 2714 +f 2720 2721 2722 +f 2723 2724 2725 +f 2722 2725 2724 +f 2724 2726 2722 +f 2719 2721 2717 +f 2720 2717 2721 +f 2717 2714 2719 +f 2726 2720 2722 +f 2704 2705 2723 +f 2705 2724 2723 +f 2726 2724 2705 +f 2705 2702 2726 +f 2702 2703 2726 +f 2703 2720 2726 +f 2727 2696 2693 +f 2718 2703 2727 +f 2696 2727 2703 +f 2717 2720 2718 +f 2703 2718 2720 +f 2728 2727 2706 +f 2693 2706 2727 +f 2712 2718 2728 +f 2727 2728 2718 +f 2729 2706 2707 +f 2729 2730 2731 +f 2731 2728 2729 +f 2706 2729 2728 +f 2728 2731 2712 +f 2732 2713 2733 +f 2731 2733 2713 +f 2734 2715 2732 +f 2713 2732 2715 +f 2713 2712 2731 +f 2735 2736 2737 +f 2734 2735 2738 +f 2737 2739 2740 +f 2735 2737 2740 +f 2735 2734 2736 +f 2732 2736 2734 +f 2738 2741 2734 +f 2740 2738 2735 +f 2715 2734 2741 +f 2741 2716 2715 +f 2733 2731 2730 +f 2730 2729 2742 +f 2743 2733 2744 +f 2730 2744 2733 +f 2733 2743 2732 +f 2736 2743 2745 +f 2736 2745 2737 +f 2743 2744 2746 +f 2743 2746 2745 +f 2736 2732 2743 +f 2747 2748 2749 +f 2744 2750 2746 +f 2747 2749 2750 +f 2747 2742 2748 +f 2751 2748 2742 +f 2744 2730 2747 +f 2742 2747 2730 +f 2744 2747 2750 +f 2752 2753 2751 +f 2711 2754 2752 +f 2751 2708 2752 +f 2709 2752 2708 +f 2742 2707 2751 +f 2708 2751 2707 +f 2707 2742 2729 +f 2752 2709 2711 +f 2753 2752 2754 +f 2748 2755 2749 +f 2756 2757 2754 +f 2757 2753 2754 +f 2748 2753 2755 +f 2753 2757 2755 +f 2748 2751 2753 +f 2758 2759 2760 +f 2683 2670 2761 +f 2761 2760 2683 +f 2759 2758 2762 +f 2762 2763 2759 +f 2760 2761 2758 +f 2761 2670 2669 +f 2762 2758 2764 +f 2758 2765 2764 +f 2758 2761 2765 +f 2761 2766 2765 +f 2766 2761 2669 +f 2765 2766 2764 +f 2766 2669 2764 +f 2764 2669 2767 +f 2768 2767 2671 +f 2669 2671 2767 +f 2769 2770 2771 +f 2771 2770 2768 +f 2772 2773 2769 +f 2770 2769 2773 +f 2771 2768 2673 +f 2671 2673 2768 +f 2770 2774 2768 +f 2775 2776 2777 +f 2773 2778 2770 +f 2775 2777 2779 +f 2776 2775 2780 +f 2781 2780 2775 +f 2778 2773 2781 +f 2780 2781 2773 +f 2782 2769 2771 +f 2772 2783 2784 +f 2783 2772 2785 +f 2782 2771 2678 +f 2673 2678 2771 +f 2785 2769 2782 +f 2769 2785 2772 +f 2786 2785 2787 +f 2787 2785 2782 +f 2788 2783 2786 +f 2787 2782 2697 +f 2678 2697 2782 +f 2785 2786 2783 +f 2789 2776 2784 +f 2776 2789 2790 +f 2773 2772 2780 +f 2784 2780 2772 +f 2780 2784 2776 +f 2776 2790 2777 +f 2784 2791 2789 +f 2789 2792 2790 +f 2791 2784 2783 +f 2793 2789 2791 +f 2789 2793 2792 +f 2791 2794 2793 +f 2795 2793 2794 +f 2793 2795 2796 +f 2793 2796 2792 +f 2794 2791 2788 +f 2783 2788 2791 +f 2759 2797 2798 +f 2798 2680 2760 +f 2680 2683 2760 +f 2799 2797 2763 +f 2797 2759 2763 +f 2760 2759 2798 +f 2681 2680 2800 +f 2798 2800 2680 +f 2800 2798 2801 +f 2797 2801 2798 +f 2801 2797 2802 +f 2799 2802 2797 +f 2802 2799 2803 +f 2774 2770 2778 +f 2768 2774 2767 +f 2762 2764 2804 +f 2767 2805 2764 +f 2799 2763 2806 +f 2763 2762 2804 +f 2804 2806 2763 +f 2807 2808 2809 +f 2809 2810 2807 +f 2806 2804 2808 +f 2808 2807 2806 +f 2810 2809 2811 +f 2812 2813 2814 +f 2812 2815 2811 +f 2813 2816 2805 +f 2805 2814 2813 +f 2814 2815 2812 +f 2814 2805 2811 +f 2811 2815 2814 +f 2816 2813 2808 +f 2804 2816 2808 +f 2812 2811 2809 +f 2808 2813 2809 +f 2813 2812 2809 +f 2811 2774 2778 +f 2767 2774 2805 +f 2811 2805 2774 +f 2811 2778 2817 +f 2764 2816 2804 +f 2816 2764 2805 +f 2778 2818 2817 +f 2781 2819 2818 +f 2781 2818 2778 +f 2775 2819 2781 +f 2775 2779 2820 +f 2820 2819 2775 +f 2819 2821 2818 +f 2821 2822 2818 +f 2819 2820 2821 +f 2823 2821 2820 +f 2810 2822 2824 +f 2825 2810 2824 +f 2818 2810 2817 +f 2817 2810 2811 +f 2810 2818 2822 +f 2826 2827 2828 +f 2827 2829 2830 +f 2827 2830 2828 +f 2828 2830 2831 +f 2832 2828 2831 +f 2833 2831 2834 +f 2803 2835 2830 +f 2835 2803 2799 +f 2831 2830 2834 +f 2836 2837 2838 +f 2838 2807 2836 +f 2825 2836 2810 +f 2835 2799 2806 +f 2807 2838 2835 +f 2806 2807 2835 +f 2807 2810 2836 +f 2839 2834 2840 +f 2838 2830 2835 +f 2841 2840 2837 +f 2837 2836 2842 +f 2840 2834 2838 +f 2834 2830 2838 +f 2837 2840 2838 +f 2843 2844 2837 +f 2824 2845 2825 +f 2825 2845 2846 +f 2846 2843 2842 +f 2847 2844 2837 +f 2841 2837 2844 +f 2839 2840 2848 +f 2846 2836 2825 +f 2840 2841 2849 +f 2837 2842 2843 +f 2842 2836 2846 +f 2810 2847 2837 +f 2837 2844 2831 +f 2850 2786 2787 +f 2850 2787 2701 +f 2697 2701 2787 +f 2851 2788 2852 +f 2852 2786 2850 +f 2786 2852 2788 +f 2851 2853 2854 +f 2855 2854 2853 +f 2856 2850 2704 +f 2701 2704 2850 +f 2857 2852 2856 +f 2856 2852 2850 +f 2853 2851 2857 +f 2852 2857 2851 +f 2788 2851 2794 +f 2794 2854 2795 +f 2854 2794 2851 +f 2795 2858 2796 +f 2859 2795 2854 +f 2859 2860 2858 +f 2795 2859 2858 +f 2854 2855 2859 +f 2861 2862 2863 +f 2863 2855 2864 +f 2862 2859 2855 +f 2862 2861 2865 +f 2862 2865 2860 +f 2859 2862 2860 +f 2853 2864 2855 +f 2855 2863 2862 +f 2866 2867 2826 +f 2868 2869 2832 +f 2870 2871 2829 +f 2872 2870 2873 +f 2867 2872 2827 +f 2869 2866 2828 +f 2848 2874 2839 +f 2874 2875 2834 +f 2876 2868 2831 +f 2875 2876 2833 +f 2844 2849 2841 +f 2849 2848 2840 +f 2844 2868 2831 +f 2828 2832 2869 +f 2834 2839 2874 +f 2831 2833 2876 +f 2833 2834 2875 +f 2832 2831 2868 +f 2877 2878 2879 +f 2880 2877 2881 +f 2882 2883 2884 +f 2885 2880 2886 +f 2887 2888 2889 +f 2883 2887 2890 +f 2878 2882 2891 +f 2887 2890 2892 +f 2827 2826 2867 +f 2873 2827 2872 +f 2888 2829 2871 +f 2829 2873 2870 +f 2826 2828 2866 +f 2831 2868 2887 +f 2879 2881 2877 +f 2889 2890 2887 +f 2891 2879 2878 +f 2884 2891 2882 +f 2890 2884 2883 +f 2871 2889 2888 +f 2868 2890 2887 +f 2893 2894 2895 +f 2895 2896 2893 +f 2710 2689 2897 +f 2898 2897 2689 +f 2897 2898 2899 +f 2900 2899 2898 +f 2899 2900 2896 +f 2901 2896 2900 +f 2896 2895 2899 +f 2902 2893 2896 +f 2896 2901 2902 +f 2800 2898 2681 +f 2898 2800 2900 +f 2801 2900 2800 +f 2900 2801 2901 +f 2802 2901 2801 +f 2689 2681 2898 +f 2901 2802 2903 +f 2803 2903 2802 +f 2873 2829 2827 +f 2830 2904 2803 +f 2829 2887 2830 +f 2887 2904 2830 +f 2903 2803 2904 +f 2883 2882 2887 +f 2888 2887 2829 +f 2878 2877 2882 +f 2905 2892 2885 +f 2892 2904 2885 +f 2885 2904 2877 +f 2877 2904 2882 +f 2882 2904 2887 +f 2880 2885 2877 +f 2904 2906 2903 +f 2903 2902 2901 +f 2892 2907 2904 +f 2908 2909 2907 +f 2902 2903 2906 +f 2910 2907 2892 +f 2909 2906 2907 +f 2907 2906 2904 +f 2909 2911 2906 +f 2906 2911 2912 +f 2913 2912 2911 +f 2914 2911 2909 +f 2912 2915 2906 +f 2893 2902 2916 +f 2906 2916 2902 +f 2915 2917 2906 +f 2917 2916 2906 +f 2918 2919 2917 +f 2920 2917 2915 +f 2921 2915 2912 +f 2738 2740 2922 +f 2923 2924 2925 +f 2922 2925 2924 +f 2924 2923 2926 +f 2922 2927 2738 +f 2741 2738 2927 +f 2924 2928 2922 +f 2927 2922 2928 +f 2926 2929 2924 +f 2928 2924 2929 +f 2930 2931 2932 +f 2932 2933 2934 +f 2737 2745 2934 +f 2934 2935 2737 +f 2739 2737 2935 +f 2936 2926 2923 +f 2925 2922 2740 +f 2740 2739 2925 +f 2925 2937 2923 +f 2923 2938 2936 +f 2939 2739 2935 +f 2937 2938 2923 +f 2739 2937 2925 +f 2938 2939 2936 +f 2938 2937 2939 +f 2937 2739 2939 +f 2940 2941 2942 +f 2943 2944 2945 +f 2942 2945 2944 +f 2719 2716 2940 +f 2940 2946 2719 +f 2941 2927 2945 +f 2945 2928 2943 +f 2941 2940 2716 +f 2945 2942 2941 +f 2716 2741 2941 +f 2926 2936 2947 +f 2927 2941 2741 +f 2929 2943 2928 +f 2928 2945 2927 +f 2948 2939 2949 +f 2947 2950 2926 +f 2929 2926 2950 +f 2951 2947 2936 +f 2939 2948 2951 +f 2934 2933 2935 +f 2933 2932 2931 +f 2936 2939 2951 +f 2931 2930 2952 +f 2953 2954 2952 +f 2955 2933 2931 +f 2952 2956 2931 +f 2935 2933 2949 +f 2935 2949 2939 +f 2955 2931 2957 +f 2955 2949 2933 +f 2931 2956 2957 +f 2952 2954 2956 +f 2958 2857 2856 +f 2704 2723 2856 +f 2857 2959 2853 +f 2958 2856 2723 +f 2959 2857 2958 +f 2864 2853 2959 +f 2960 2959 2958 +f 2864 2961 2863 +f 2961 2864 2962 +f 2959 2962 2864 +f 2960 2725 2963 +f 2960 2958 2725 +f 2723 2725 2958 +f 2964 2965 2725 +f 2725 2722 2964 +f 2966 2967 2965 +f 2965 2964 2966 +f 2968 2963 2967 +f 2967 2966 2968 +f 2725 2965 2963 +f 2965 2967 2963 +f 2968 2966 2969 +f 2721 2946 2964 +f 2964 2946 2966 +f 2946 2970 2966 +f 2966 2970 2969 +f 2722 2721 2964 +f 2970 2942 2969 +f 2944 2969 2942 +f 2944 2943 2971 +f 2943 2929 2972 +f 2721 2719 2946 +f 2942 2970 2940 +f 2946 2940 2970 +f 2973 2974 2975 +f 2947 2951 2976 +f 2974 2976 2975 +f 2977 2975 2978 +f 2975 2979 2978 +f 2950 2972 2929 +f 2979 2976 2951 +f 2976 2979 2975 +f 2979 2980 2978 +f 2980 2981 2978 +f 2978 2981 2955 +f 2951 2948 2979 +f 2981 2980 2982 +f 2980 2948 2949 +f 2948 2980 2979 +f 2983 2863 2961 +f 2861 2984 2985 +f 2863 2983 2861 +f 2984 2861 2983 +f 2861 2985 2865 +f 2971 2986 2944 +f 2972 2971 2943 +f 2987 2988 2972 +f 2950 2947 2989 +f 2989 2976 2990 +f 2991 2990 2992 +f 2993 2994 2990 +f 2995 2996 2994 +f 2996 2989 2994 +f 2994 2989 2990 +f 2992 2976 2997 +f 2997 2976 2998 +f 2974 2998 2976 +f 2990 2976 2992 +f 2976 2989 2947 +f 2999 2998 2974 +f 3000 2997 2998 +f 3001 2992 2997 +f 2962 3002 2961 +f 2962 2960 3002 +f 2968 2969 3003 +f 2969 2944 2986 +f 2962 2959 2960 +f 2963 2968 3003 +f 2963 3004 2960 +f 2824 2961 3002 +f 3005 3002 2960 +f 3003 3004 2963 +f 2961 2824 2983 +f 3005 2960 3004 +f 2969 2986 3003 +f 2983 2822 2984 +f 2821 2984 2822 +f 2985 2984 2821 +f 2821 2823 2985 +f 2822 2983 2824 +f 2824 3002 2847 +f 2847 3002 3006 +f 2847 2845 2824 +f 3005 3007 3002 +f 3002 3007 3008 +f 3008 3006 3002 +f 3008 3007 3009 +f 3009 3006 3008 +f 3007 3005 3004 +f 3010 3009 3004 +f 3004 3009 3007 +f 3004 3003 3010 +f 2847 3006 3009 +f 3009 3010 2847 +f 3011 2846 2847 +f 2847 2846 2845 +f 3003 2986 3010 +f 2986 3011 3010 +f 3010 3011 2847 +f 2986 2971 3011 +f 2848 2849 2844 +f 2844 2843 2846 +f 3011 2875 2848 +f 2848 2844 3011 +f 3011 2844 2846 +f 2868 2875 2988 +f 2988 2875 3011 +f 2868 2876 2875 +f 2869 2868 2866 +f 2988 2866 2868 +f 2988 3011 2971 +f 2875 2874 2848 +f 2881 2987 3012 +f 2886 2881 3012 +f 2987 2989 3013 +f 3014 3013 3015 +f 2972 2950 2987 +f 3016 3012 3013 +f 3013 3012 2987 +f 3017 3018 2996 +f 2989 2987 2950 +f 3013 2989 3015 +f 3019 3020 3018 +f 3020 2989 3018 +f 3015 2989 3020 +f 3018 2989 2996 +f 3021 3015 3020 +f 2884 2890 2891 +f 2889 2871 2890 +f 2971 2972 2988 +f 2988 2987 2871 +f 2871 2987 2890 +f 2870 2872 2871 +f 2871 2872 2988 +f 2866 2988 2872 +f 2867 2866 2872 +f 2955 2957 2978 +f 2978 2957 2956 +f 2981 3022 2955 +f 2982 3022 2981 +f 2955 3022 2982 +f 2949 2982 2980 +f 2982 2949 2955 +f 2890 2987 2891 +f 2891 2987 2881 +f 2879 2891 2881 +f 3016 3013 2892 +f 2886 3012 2885 +f 2881 2886 2880 +f 3012 3016 2905 +f 2890 3013 2892 +f 2910 2892 3013 +f 2908 2907 3015 +f 2909 2908 3021 +f 2892 2905 3016 +f 2907 2910 3014 +f 2905 2885 3012 +f 2911 2892 3018 +f 3014 3015 2907 +f 3019 3018 2911 +f 3013 3014 2910 +f 3015 3021 2908 +f 3020 3019 2914 +f 3021 3020 2909 +f 2892 3013 3018 +f 3023 2930 3024 +f 2932 3024 2930 +f 3024 2932 3025 +f 3025 2932 2934 +f 2745 2746 3025 +f 3025 2934 2745 +f 3026 3023 3027 +f 3024 3027 3023 +f 3023 3026 3028 +f 3029 3028 3026 +f 3030 3025 2746 +f 3027 3024 3030 +f 3030 3024 3025 +f 2952 3031 2953 +f 3031 2952 2930 +f 2953 3032 3033 +f 2953 3033 3034 +f 3032 2953 3031 +f 3031 3028 3032 +f 2930 3023 3031 +f 3028 3029 3035 +f 3036 3035 3029 +f 3035 3037 3038 +f 3032 3035 3038 +f 3035 3032 3028 +f 3032 3038 3033 +f 3028 3031 3023 +f 3039 3026 3040 +f 3040 3027 3041 +f 3041 3027 3030 +f 3041 3030 2750 +f 2746 2750 3030 +f 3027 3040 3026 +f 3042 3039 3043 +f 3044 3041 2749 +f 2750 2749 3041 +f 3043 3040 3044 +f 3044 3040 3041 +f 3040 3043 3039 +f 3029 3045 3036 +f 3046 3036 3045 +f 3036 3047 3037 +f 3026 3039 3029 +f 3045 3029 3039 +f 3035 3036 3037 +f 3036 3046 3047 +f 3039 3042 3045 +f 3048 3045 3042 +f 3045 3048 3046 +f 3049 3046 3048 +f 3046 3050 3047 +f 3046 3049 3050 +f 2899 3051 2897 +f 2711 2710 3052 +f 2897 3052 2710 +f 3051 2899 2895 +f 3052 2897 3051 +f 3052 3053 2711 +f 3051 3054 3052 +f 2895 3055 3051 +f 3053 3052 3054 +f 2754 2711 3053 +f 3055 2895 2894 +f 3054 3051 3055 +f 3056 3044 2755 +f 2749 2755 3044 +f 3056 3043 3044 +f 3057 3058 3059 +f 3059 3056 2757 +f 3060 3057 3059 +f 2755 2757 3056 +f 3061 3062 3063 +f 3057 3063 3062 +f 3062 3061 3064 +f 3064 3065 3066 +f 3065 3064 3061 +f 3067 3066 3065 +f 3066 3067 3068 +f 3048 3069 3049 +f 3070 3049 3069 +f 3049 3070 3071 +f 3049 3071 3050 +f 3069 3048 3072 +f 3062 3072 3057 +f 3058 3057 3072 +f 3072 3042 3058 +f 3043 3058 3042 +f 3059 3058 3056 +f 3042 3072 3048 +f 3058 3043 3056 +f 3066 3070 3064 +f 3066 3068 3073 +f 3070 3066 3073 +f 3070 3073 3071 +f 3064 3069 3062 +f 3072 3062 3069 +f 3069 3064 3070 +f 3054 3055 3074 +f 3075 3053 3076 +f 3074 3055 2894 +f 3053 3054 3076 +f 2756 2754 3075 +f 2754 3053 3075 +f 3076 3054 3074 +f 3060 2756 3074 +f 3074 3077 3060 +f 3060 3059 2756 +f 3075 3076 3074 +f 3063 3057 3060 +f 2757 2756 3059 +f 2756 3075 3074 +f 3017 2996 2912 +f 2915 2994 2993 +f 2996 2995 2921 +f 3018 3017 2913 +f 2995 2994 2915 +f 3018 2990 2911 +f 2913 2911 3018 +f 2915 2921 2995 +f 2912 2913 3017 +f 2911 2914 3019 +f 2993 2920 2915 +f 2921 2912 2996 +f 2914 2909 3020 +f 2990 2917 2911 +f 3001 2997 3078 +f 2991 2992 2919 +f 2992 3001 3079 +f 2993 2990 2917 +f 2990 2991 2918 +f 2917 2990 2998 +f 2919 2918 2991 +f 3079 2919 2992 +f 3080 3078 2997 +f 2917 2920 2993 +f 3081 3080 3000 +f 2918 2917 2990 +f 3078 3079 3001 +f 3081 2917 2998 +f 3082 2978 2956 +f 2974 2973 3083 +f 2977 2978 3082 +f 2975 2977 3084 +f 2973 2975 3085 +f 2999 2974 3086 +f 3000 2998 3081 +f 2997 3000 3080 +f 2998 2978 3081 +f 2998 2999 3087 +f 3086 3087 2999 +f 3085 3083 2973 +f 3087 3081 2998 +f 3083 3086 2974 +f 3084 3085 2975 +f 3082 3084 2977 +f 2978 3082 3081 +f 3080 3081 3078 +f 3086 2916 3081 +f 3079 3078 2919 +f 3081 2916 3078 +f 3078 2916 2919 +f 2919 2916 2917 +f 2916 3088 2893 +f 2894 2893 3088 +f 3084 3082 3085 +f 3087 3086 3081 +f 3082 3088 3085 +f 3085 3088 3086 +f 3088 2916 3086 +f 3083 3085 3086 +f 2956 3089 3082 +f 3089 3090 3082 +f 3082 3090 3091 +f 2894 3088 3077 +f 3082 3092 3088 +f 3093 3089 2956 +f 2953 3034 3094 +f 3094 2954 2953 +f 3095 3093 3094 +f 2954 3093 2956 +f 2954 3094 3093 +f 3093 3067 3089 +f 3093 3095 3068 +f 3096 3091 3060 +f 3089 3065 3090 +f 3077 3074 2894 +f 3090 3061 3091 +f 3096 3060 3077 +f 3092 3097 3088 +f 3088 3097 3077 +f 3091 3092 3082 +f 3063 3091 3061 +f 3068 3067 3093 +f 3065 3089 3067 +f 3061 3090 3065 +f 3063 3060 3091 +f 3091 3098 3099 +f 3098 3096 3077 +f 3077 3097 3098 +f 3097 3092 3099 +f 3099 3092 3091 +f 3096 3098 3091 +f 3099 3098 3097 +f 3100 3101 3102 +f 3100 3103 3101 +f 3104 3103 3100 +f 3104 3105 3103 +f 3106 3105 3104 +f 3106 3107 3105 +f 3101 3103 3108 +f 3109 3110 3107 +f 3110 3111 3105 +f 3103 3105 3111 +f 3111 3108 3103 +f 3108 3112 3101 +f 3108 3111 3113 +f 3113 3114 3108 +f 3112 3108 3114 +f 3114 3115 3112 +f 3116 3117 3113 +f 3118 3113 3117 +f 3118 3114 3113 +f 3115 3118 3119 +f 3115 3114 3118 +f 3111 3110 3120 +f 3120 3113 3111 +f 3121 3122 3109 +f 3110 3109 3122 +f 3122 3120 3110 +f 3120 3123 3116 +f 3120 3122 3123 +f 3116 3113 3120 +f 3122 3121 3124 +f 3122 3124 3123 +f 3125 3126 3127 +f 3107 3125 3109 +f 3128 3125 3107 +f 3128 3107 3106 +f 3105 3107 3110 +f 3127 3129 3130 +f 3131 3129 3132 +f 3126 3132 3129 +f 3129 3127 3126 +f 3109 3127 3121 +f 3127 3109 3125 +f 3133 3130 3129 +f 3130 3121 3127 +f 3130 3134 3135 +f 3121 3135 3124 +f 3121 3130 3135 +f 3132 3136 3131 +f 3136 3137 3138 +f 3138 3131 3136 +f 3139 3132 3140 +f 3139 3136 3132 +f 3137 3136 3139 +f 3131 3138 3141 +f 3130 3133 3134 +f 3129 3131 3133 +f 3134 3133 3141 +f 3141 3133 3131 +f 3142 3143 3144 +f 3143 3142 3145 +f 3145 3146 3143 +f 3147 3148 3146 +f 3149 3150 3148 +f 3151 3152 3150 +f 3153 3126 3125 +f 3140 3126 3153 +f 3140 3132 3126 +f 3154 3155 3152 +f 3156 3157 3155 +f 3153 3125 3128 +f 3158 3159 3160 +f 3161 3159 3158 +f 3161 3162 3159 +f 3146 3145 3147 +f 3148 3147 3149 +f 3158 3160 3163 +f 3150 3149 3151 +f 3152 3151 3154 +f 3157 3156 3164 +f 3164 3165 3157 +f 3165 3164 3166 +f 3155 3154 3156 +f 3167 3160 3168 +f 3168 3169 3167 +f 3170 3167 3169 +f 3163 3167 3171 +f 3163 3160 3167 +f 3160 3159 3172 +f 3173 3174 3175 +f 3175 3176 3173 +f 3177 3173 3176 +f 3178 3176 3175 +f 3179 3176 3178 +f 3180 3181 3174 +f 3174 3173 3180 +f 3162 3180 3173 +f 3181 3180 3182 +f 3182 3162 3161 +f 3182 3180 3162 +f 3176 3179 3177 +f 3179 3178 3183 +f 3179 3184 3172 +f 3184 3183 3185 +f 3184 3179 3183 +f 3172 3168 3160 +f 3173 3177 3162 +f 3159 3162 3177 +f 3172 3177 3179 +f 3177 3172 3159 +f 3168 3172 3184 +f 3186 3185 3187 +f 3186 3184 3185 +f 3188 3187 3189 +f 3188 3186 3187 +f 3189 3190 3188 +f 3188 3190 3191 +f 3186 3188 3169 +f 3191 3169 3188 +f 3184 3186 3168 +f 3169 3168 3186 +f 3189 3192 3190 +f 3193 3190 3192 +f 3193 3194 3190 +f 3195 3193 3196 +f 3195 3194 3193 +f 3197 3191 3190 +f 3194 3195 3198 +f 3190 3194 3197 +f 3198 3197 3194 +f 3171 3167 3170 +f 3199 3200 3197 +f 3201 3199 3202 +f 3203 3170 3200 +f 3201 3200 3199 +f 3203 3200 3201 +f 3171 3170 3203 +f 3197 3198 3199 +f 3169 3191 3170 +f 3200 3170 3191 +f 3191 3197 3200 +f 3204 3205 3206 +f 3204 3207 3205 +f 3204 3102 3207 +f 3205 3207 3208 +f 3102 3208 3207 +f 3209 3102 3204 +f 3209 3100 3102 +f 3210 3211 3212 +f 3213 3214 3215 +f 3209 3214 3213 +f 3215 3216 3210 +f 3216 3215 3214 +f 3217 3212 3211 +f 3211 3210 3216 +f 3218 3106 3104 +f 3104 3213 3218 +f 3213 3104 3100 +f 3218 3215 3219 +f 3213 3215 3218 +f 3210 3219 3215 +f 3220 3143 3146 +f 3221 3222 3220 +f 3146 3221 3220 +f 3221 3146 3148 +f 3223 3224 3225 +f 3226 3225 3227 +f 3225 3228 3229 +f 3229 3227 3225 +f 3225 3226 3223 +f 3230 3231 3144 +f 3230 3232 3231 +f 3233 3229 3228 +f 3230 3144 3233 +f 3144 3234 3233 +f 3234 3144 3143 +f 3235 3236 3237 +f 3234 3229 3233 +f 3100 3209 3213 +f 3143 3220 3234 +f 3212 3238 3210 +f 3239 3240 3217 +f 3239 3235 3237 +f 3212 3217 3240 +f 3239 3241 3240 +f 3235 3239 3217 +f 3224 3223 3242 +f 3228 3225 3224 +f 3223 3243 3237 +f 3237 3242 3223 +f 3239 3237 3243 +f 3241 3239 3243 +f 3242 3237 3236 +f 3234 3244 3229 +f 3227 3229 3244 +f 3244 3245 3227 +f 3245 3244 3222 +f 3220 3244 3234 +f 3220 3222 3244 +f 3241 3243 3246 +f 3247 3227 3245 +f 3227 3247 3226 +f 3226 3246 3243 +f 3243 3223 3226 +f 3246 3226 3247 +f 3204 3206 3248 +f 3205 3208 3206 +f 3102 3101 3208 +f 3249 3204 3248 +f 3250 3216 3251 +f 3216 3214 3251 +f 3249 3252 3204 +f 3253 3224 3254 +f 3224 3253 3228 +f 3204 3255 3209 +f 3255 3204 3252 +f 3253 3233 3228 +f 3233 3253 3256 +f 3257 3233 3256 +f 3233 3257 3230 +f 3258 3251 3259 +f 3251 3260 3259 +f 3258 3261 3262 +f 3258 3259 3261 +f 3263 3261 3259 +f 3262 3252 3249 +f 3262 3261 3252 +f 3259 3260 3263 +f 3255 3252 3261 +f 3261 3263 3255 +f 3211 3264 3217 +f 3250 3265 3216 +f 3265 3264 3211 +f 3266 3236 3235 +f 3255 3214 3209 +f 3267 3235 3217 +f 3214 3255 3251 +f 3216 3265 3211 +f 3268 3256 3253 +f 3253 3269 3268 +f 3270 3268 3269 +f 3269 3271 3270 +f 3271 3269 3253 +f 3257 3256 3268 +f 3268 3270 3257 +f 3272 3236 3266 +f 3236 3272 3242 +f 3266 3273 3274 +f 3254 3242 3272 +f 3242 3254 3224 +f 3230 3275 3276 +f 3276 3232 3230 +f 3231 3277 3142 +f 3230 3278 3275 +f 3142 3144 3231 +f 3232 3276 3277 +f 3277 3231 3232 +f 3270 3279 3278 +f 3280 3281 3254 +f 3271 3282 3279 +f 3281 3282 3253 +f 3271 3253 3282 +f 3279 3270 3271 +f 3278 3257 3270 +f 3278 3230 3257 +f 3253 3254 3281 +f 3254 3272 3280 +f 3272 3266 3283 +f 3284 3285 3248 +f 3206 3208 3286 +f 3286 3284 3206 +f 3208 3101 3112 +f 3112 3286 3208 +f 3248 3206 3284 +f 3249 3248 3285 +f 3285 3287 3249 +f 3258 3262 3288 +f 3288 3289 3258 +f 3262 3249 3287 +f 3287 3288 3262 +f 3251 3258 3289 +f 3290 3265 3289 +f 3250 3289 3265 +f 3251 3289 3250 +f 3285 3284 3291 +f 3291 3292 3285 +f 3284 3286 3293 +f 3293 3291 3284 +f 3286 3112 3115 +f 3115 3293 3286 +f 3294 3295 3296 +f 3297 3298 3299 +f 3299 3300 3294 +f 3300 3299 3298 +f 3301 3298 3297 +f 3119 3301 3297 +f 3301 3119 3118 +f 3293 3115 3119 +f 3291 3293 3302 +f 3292 3291 3303 +f 3293 3119 3302 +f 3291 3302 3303 +f 3292 3303 3304 +f 3304 3302 3119 +f 3304 3303 3302 +f 3304 3119 3297 +f 3118 3305 3301 +f 3305 3118 3117 +f 3117 3306 3305 +f 3306 3117 3116 +f 3307 3308 3309 +f 3310 3307 3309 +f 3295 3294 3300 +f 3309 3296 3295 +f 3296 3309 3308 +f 3295 3311 3309 +f 3312 3310 3311 +f 3311 3295 3313 +f 3310 3309 3311 +f 3300 3313 3295 +f 3313 3300 3314 +f 3315 3316 3317 +f 3317 3318 3315 +f 3318 3317 3319 +f 3306 3317 3305 +f 3306 3319 3317 +f 3320 3319 3306 +f 3116 3320 3306 +f 3320 3116 3123 +f 3316 3315 3314 +f 3301 3316 3298 +f 3305 3316 3301 +f 3305 3317 3316 +f 3298 3314 3300 +f 3314 3298 3316 +f 3321 3312 3322 +f 3313 3322 3311 +f 3322 3313 3323 +f 3312 3311 3322 +f 3323 3314 3315 +f 3314 3323 3313 +f 3321 3322 3324 +f 3323 3324 3322 +f 3325 3321 3324 +f 3326 3315 3318 +f 3315 3326 3323 +f 3324 3323 3326 +f 3327 3325 3328 +f 3329 3318 3330 +f 3325 3324 3328 +f 3328 3326 3329 +f 3326 3328 3324 +f 3318 3329 3326 +f 3331 3332 3333 +f 3331 3333 3334 +f 3334 3289 3331 +f 3334 3290 3289 +f 3335 3332 3336 +f 3332 3335 3333 +f 3289 3288 3337 +f 3337 3338 3289 +f 3288 3287 3339 +f 3339 3337 3288 +f 3287 3285 3292 +f 3292 3339 3287 +f 3289 3338 3340 +f 3341 3294 3340 +f 3339 3304 3342 +f 3342 3297 3343 +f 3297 3341 3343 +f 3296 3340 3294 +f 3341 3297 3299 +f 3339 3292 3304 +f 3294 3341 3299 +f 3297 3342 3304 +f 3338 3337 3344 +f 3341 3338 3345 +f 3344 3339 3342 +f 3344 3337 3339 +f 3338 3344 3345 +f 3338 3341 3340 +f 3341 3346 3343 +f 3342 3343 3346 +f 3347 3346 3341 +f 3344 3346 3347 +f 3346 3344 3342 +f 3347 3345 3344 +f 3341 3345 3347 +f 3307 3336 3332 +f 3308 3331 3296 +f 3331 3308 3332 +f 3340 3296 3331 +f 3340 3331 3289 +f 3332 3308 3307 +f 3235 3267 3266 +f 3251 3255 3263 +f 3263 3260 3251 +f 3265 3348 3264 +f 3348 3267 3264 +f 3217 3264 3267 +f 3247 3349 3246 +f 3350 3241 3246 +f 3350 3246 3349 +f 3351 3350 3349 +f 3352 3351 3353 +f 3351 3352 3354 +f 3351 3354 3355 +f 3350 3351 3355 +f 3356 3219 3357 +f 3218 3219 3356 +f 3219 3210 3238 +f 3238 3357 3219 +f 3356 3128 3106 +f 3106 3218 3356 +f 3357 3238 3358 +f 3359 3357 3360 +f 3355 3361 3362 +f 3356 3357 3359 +f 3362 3363 3358 +f 3361 3355 3354 +f 3363 3362 3361 +f 3360 3358 3363 +f 3358 3360 3357 +f 3240 3364 3212 +f 3364 3240 3365 +f 3364 3358 3238 +f 3358 3364 3362 +f 3365 3362 3364 +f 3238 3212 3364 +f 3350 3355 3365 +f 3241 3350 3365 +f 3362 3365 3355 +f 3241 3365 3240 +f 3354 3366 3361 +f 3363 3367 3360 +f 3368 3361 3366 +f 3361 3368 3363 +f 3369 3367 3370 +f 3366 3371 3368 +f 3368 3372 3367 +f 3369 3360 3367 +f 3367 3363 3368 +f 3359 3360 3369 +f 3221 3373 3222 +f 3374 3373 3221 +f 3374 3375 3373 +f 3376 3375 3374 +f 3128 3356 3359 +f 3148 3374 3221 +f 3374 3148 3150 +f 3150 3376 3374 +f 3369 3140 3153 +f 3153 3359 3369 +f 3359 3153 3128 +f 3376 3377 3375 +f 3376 3150 3152 +f 3152 3378 3376 +f 3378 3152 3155 +f 3245 3379 3247 +f 3222 3380 3245 +f 3380 3222 3373 +f 3349 3247 3379 +f 3379 3245 3380 +f 3373 3381 3380 +f 3381 3373 3375 +f 3353 3379 3382 +f 3382 3380 3381 +f 3380 3382 3379 +f 3351 3349 3353 +f 3379 3353 3349 +f 3352 3353 3383 +f 3382 3383 3353 +f 3383 3382 3384 +f 3352 3385 3386 +f 3385 3387 3388 +f 3352 3386 3354 +f 3366 3354 3386 +f 3386 3389 3366 +f 3389 3386 3388 +f 3385 3388 3386 +f 3378 3390 3377 +f 3384 3381 3391 +f 3392 3377 3390 +f 3377 3392 3391 +f 3378 3377 3376 +f 3381 3384 3382 +f 3375 3391 3381 +f 3391 3375 3377 +f 3393 3391 3392 +f 3391 3393 3384 +f 3385 3352 3383 +f 3385 3383 3394 +f 3387 3385 3394 +f 3393 3395 3394 +f 3394 3384 3393 +f 3384 3394 3383 +f 3370 3372 3396 +f 3370 3367 3372 +f 3139 3370 3396 +f 3370 3139 3140 +f 3140 3369 3370 +f 3397 3398 3399 +f 3400 3399 3398 +f 3399 3400 3401 +f 3402 3403 3397 +f 3398 3397 3403 +f 3404 3405 3402 +f 3403 3402 3405 +f 3389 3403 3371 +f 3371 3366 3389 +f 3396 3405 3404 +f 3405 3371 3403 +f 3371 3405 3372 +f 3372 3368 3371 +f 3396 3372 3405 +f 3403 3389 3398 +f 3388 3398 3389 +f 3398 3388 3400 +f 3406 3401 3400 +f 3387 3406 3400 +f 3387 3400 3388 +f 3407 3124 3135 +f 3135 3408 3407 +f 3408 3135 3134 +f 3319 3330 3318 +f 3320 3409 3319 +f 3410 3409 3320 +f 3123 3410 3320 +f 3410 3123 3124 +f 3330 3319 3409 +f 3407 3411 3410 +f 3124 3407 3410 +f 3410 3411 3409 +f 3409 3412 3330 +f 3412 3409 3411 +f 3330 3413 3329 +f 3414 3329 3413 +f 3329 3414 3328 +f 3413 3330 3412 +f 3327 3328 3414 +f 3415 3327 3414 +f 3416 3417 3418 +f 3418 3413 3416 +f 3413 3418 3414 +f 3416 3412 3419 +f 3412 3416 3413 +f 3420 3415 3418 +f 3415 3414 3418 +f 3420 3418 3417 +f 3134 3421 3408 +f 3411 3419 3412 +f 3419 3411 3422 +f 3407 3422 3411 +f 3408 3422 3407 +f 3408 3423 3422 +f 3424 3422 3423 +f 3417 3416 3425 +f 3425 3419 3424 +f 3419 3425 3416 +f 3426 3420 3417 +f 3422 3424 3419 +f 3421 3423 3408 +f 3427 3428 3137 +f 3427 3429 3428 +f 3428 3429 3430 +f 3430 3431 3428 +f 3431 3138 3137 +f 3429 3427 3432 +f 3432 3430 3429 +f 3137 3428 3431 +f 3430 3432 3433 +f 3433 3434 3430 +f 3138 3431 3435 +f 3431 3430 3434 +f 3434 3435 3431 +f 3433 3141 3435 +f 3435 3141 3138 +f 3433 3435 3434 +f 3421 3134 3141 +f 3433 3436 3421 +f 3421 3141 3433 +f 3437 3432 3427 +f 3438 3433 3432 +f 3427 3137 3404 +f 3404 3439 3427 +f 3440 3406 3395 +f 3397 3441 3402 +f 3401 3290 3399 +f 3348 3401 3406 +f 3399 3442 3397 +f 3441 3404 3402 +f 3439 3404 3443 +f 3406 3440 3348 +f 3441 3397 3442 +f 3442 3399 3290 +f 3290 3401 3348 +f 3404 3441 3443 +f 3439 3443 3444 +f 3444 3445 3439 +f 3446 3447 3445 +f 3441 3447 3446 +f 3445 3444 3446 +f 3441 3444 3443 +f 3446 3444 3441 +f 3423 3436 3448 +f 3432 3437 3438 +f 3436 3423 3421 +f 3427 3439 3437 +f 3436 3433 3438 +f 3334 3333 3425 +f 3425 3333 3417 +f 3335 3426 3417 +f 3417 3333 3335 +f 3424 3423 3448 +f 3424 3334 3425 +f 3449 3424 3448 +f 3449 3334 3424 +f 3449 3442 3290 +f 3441 3442 3449 +f 3439 3445 3450 +f 3450 3437 3439 +f 3449 3290 3334 +f 3441 3448 3451 +f 3441 3449 3448 +f 3451 3447 3441 +f 3445 3447 3451 +f 3451 3450 3445 +f 3452 3453 3448 +f 3454 3452 3436 +f 3448 3436 3452 +f 3448 3453 3455 +f 3452 3454 3455 +f 3455 3453 3452 +f 3455 3454 3450 +f 3437 3450 3454 +f 3448 3455 3451 +f 3450 3451 3455 +f 3454 3438 3437 +f 3436 3438 3454 +f 3456 3457 3458 +f 3456 3165 3457 +f 3396 3137 3139 +f 3157 3459 3460 +f 3459 3157 3165 +f 3155 3460 3378 +f 3460 3155 3157 +f 3460 3390 3378 +f 3460 3461 3390 +f 3390 3462 3392 +f 3462 3390 3461 +f 3406 3387 3395 +f 3395 3393 3463 +f 3463 3392 3462 +f 3392 3463 3393 +f 3387 3394 3395 +f 3267 3348 3440 +f 3273 3464 3465 +f 3464 3466 3467 +f 3266 3267 3273 +f 3265 3290 3348 +f 3440 3273 3267 +f 3137 3396 3404 +f 3456 3468 3459 +f 3459 3461 3460 +f 3459 3165 3456 +f 3462 3464 3463 +f 3462 3461 3469 +f 3463 3273 3395 +f 3468 3456 3470 +f 3468 3461 3459 +f 3466 3462 3469 +f 3461 3468 3469 +f 3466 3464 3462 +f 3464 3273 3463 +f 3395 3273 3440 +f 3469 3471 3472 +f 3469 3468 3471 +f 3469 3472 3473 +f 3468 3470 3474 +f 3473 3472 3471 +f 3474 3471 3468 +f 3471 3474 3473 +f 3475 3181 3182 +f 3145 3476 3477 +f 3476 3145 3142 +f 3275 3277 3276 +f 3275 3142 3277 +f 3477 3478 3479 +f 3477 3480 3478 +f 3147 3477 3479 +f 3477 3147 3145 +f 3481 3482 3483 +f 3478 3484 3485 +f 3484 3478 3480 +f 3483 3486 3487 +f 3487 3485 3484 +f 3485 3487 3486 +f 3482 3488 3483 +f 3465 3489 3274 +f 3490 3491 3492 +f 3283 3280 3272 +f 3489 3492 3493 +f 3274 3283 3266 +f 3493 3274 3489 +f 3476 3480 3477 +f 3275 3494 3476 +f 3476 3142 3275 +f 3181 3475 3495 +f 3487 3274 3483 +f 3494 3275 3278 +f 3484 3480 3281 +f 3484 3283 3487 +f 3494 3480 3476 +f 3483 3274 3493 +f 3283 3274 3487 +f 3280 3484 3281 +f 3280 3283 3484 +f 3480 3494 3281 +f 3494 3278 3279 +f 3281 3496 3282 +f 3279 3497 3494 +f 3281 3494 3497 +f 3497 3279 3282 +f 3282 3496 3497 +f 3281 3497 3496 +f 3498 3499 3500 +f 3501 3502 3503 +f 3503 3498 3501 +f 3502 3500 3181 +f 3502 3501 3500 +f 3181 3500 3499 +f 3499 3174 3181 +f 3500 3501 3498 +f 3498 3503 3504 +f 3504 3505 3498 +f 3174 3499 3506 +f 3499 3498 3505 +f 3505 3506 3499 +f 3506 3175 3174 +f 3504 3506 3505 +f 3504 3175 3506 +f 3507 3178 3175 +f 3178 3507 3508 +f 3508 3509 3510 +f 3511 3512 3513 +f 3512 3511 3509 +f 3508 3514 3509 +f 3510 3509 3511 +f 3507 3514 3508 +f 3515 3509 3514 +f 3516 3517 3518 +f 3518 3512 3515 +f 3512 3518 3517 +f 3519 3520 3516 +f 3509 3515 3512 +f 3510 3185 3183 +f 3183 3508 3510 +f 3508 3183 3178 +f 3185 3510 3521 +f 3522 3513 3523 +f 3513 3522 3511 +f 3521 3511 3522 +f 3510 3511 3521 +f 3521 3187 3185 +f 3187 3521 3524 +f 3524 3522 3525 +f 3521 3522 3524 +f 3525 3523 3526 +f 3523 3525 3522 +f 3527 3528 3529 +f 3530 3529 3528 +f 3520 3530 3528 +f 3520 3528 3516 +f 3517 3516 3528 +f 3517 3513 3512 +f 3513 3517 3527 +f 3528 3527 3517 +f 3527 3523 3513 +f 3523 3527 3531 +f 3529 3531 3527 +f 3531 3529 3532 +f 3533 3532 3529 +f 3530 3533 3529 +f 3182 3534 3475 +f 3534 3182 3161 +f 3161 3535 3534 +f 3534 3536 3475 +f 3534 3537 3536 +f 3495 3538 3539 +f 3540 3539 3538 +f 3541 3542 3543 +f 3542 3541 3544 +f 3543 3545 3540 +f 3545 3543 3542 +f 3539 3540 3545 +f 3536 3546 3547 +f 3547 3548 3549 +f 3475 3538 3495 +f 3475 3536 3538 +f 3538 3547 3540 +f 3547 3538 3536 +f 3549 3540 3547 +f 3482 3481 3541 +f 3482 3541 3550 +f 3550 3543 3549 +f 3543 3550 3541 +f 3540 3549 3543 +f 3481 3544 3541 +f 3507 3175 3504 +f 3504 3551 3507 +f 3552 3504 3503 +f 3553 3503 3502 +f 3502 3181 3495 +f 3495 3554 3502 +f 3555 3556 3518 +f 3518 3556 3516 +f 3557 3519 3516 +f 3516 3556 3557 +f 3515 3514 3558 +f 3515 3555 3518 +f 3559 3515 3558 +f 3559 3555 3515 +f 3558 3560 3561 +f 3553 3562 3563 +f 3563 3552 3553 +f 3551 3552 3563 +f 3562 3561 3560 +f 3560 3563 3562 +f 3564 3565 3559 +f 3559 3565 3491 +f 3566 3563 3560 +f 3560 3567 3566 +f 3566 3567 3558 +f 3563 3566 3551 +f 3558 3551 3566 +f 3558 3567 3560 +f 3554 3568 3562 +f 3559 3491 3555 +f 3562 3553 3554 +f 3561 3569 3564 +f 3558 3561 3564 +f 3568 3569 3561 +f 3561 3562 3568 +f 3564 3559 3558 +f 3551 3504 3552 +f 3503 3553 3552 +f 3502 3554 3553 +f 3551 3514 3507 +f 3514 3551 3558 +f 3564 3570 3571 +f 3572 3569 3568 +f 3554 3571 3570 +f 3572 3570 3564 +f 3568 3570 3572 +f 3570 3568 3554 +f 3564 3569 3572 +f 3565 3542 3491 +f 3554 3495 3571 +f 3495 3564 3571 +f 3481 3493 3492 +f 3564 3545 3565 +f 3491 3544 3492 +f 3542 3565 3545 +f 3493 3481 3483 +f 3544 3491 3542 +f 3492 3544 3481 +f 3564 3495 3539 +f 3545 3564 3539 +f 3573 3574 3575 +f 3575 3576 3573 +f 3577 3489 3465 +f 3490 3492 3578 +f 3492 3489 3578 +f 3579 3578 3489 +f 3580 3581 3582 +f 3580 3583 3581 +f 3584 3583 3580 +f 3163 3585 3586 +f 3154 3580 3582 +f 3580 3154 3151 +f 3151 3584 3580 +f 3582 3581 3587 +f 3584 3588 3583 +f 3584 3151 3149 +f 3149 3479 3584 +f 3479 3149 3147 +f 3535 3161 3158 +f 3158 3586 3535 +f 3586 3158 3163 +f 3548 3589 3590 +f 3590 3549 3548 +f 3549 3590 3550 +f 3591 3482 3550 +f 3591 3550 3590 +f 3592 3591 3590 +f 3592 3590 3589 +f 3479 3478 3588 +f 3479 3588 3584 +f 3583 3593 3594 +f 3593 3583 3588 +f 3588 3485 3593 +f 3485 3588 3478 +f 3595 3594 3593 +f 3594 3595 3596 +f 3486 3483 3488 +f 3488 3595 3486 +f 3595 3488 3597 +f 3591 3592 3597 +f 3591 3597 3488 +f 3482 3591 3488 +f 3486 3593 3485 +f 3593 3486 3595 +f 3598 3599 3600 +f 3601 3600 3599 +f 3599 3598 3602 +f 3587 3602 3598 +f 3602 3587 3581 +f 3581 3594 3602 +f 3594 3581 3583 +f 3603 3599 3596 +f 3596 3602 3594 +f 3602 3596 3599 +f 3597 3596 3595 +f 3596 3597 3603 +f 3599 3603 3601 +f 3604 3601 3603 +f 3592 3603 3597 +f 3586 3605 3535 +f 3546 3536 3537 +f 3537 3606 3546 +f 3548 3547 3546 +f 3535 3537 3534 +f 3535 3605 3537 +f 3607 3546 3606 +f 3546 3607 3548 +f 3589 3548 3607 +f 3606 3537 3605 +f 3592 3604 3603 +f 3604 3589 3608 +f 3609 3604 3608 +f 3600 3601 3610 +f 3609 3611 3610 +f 3604 3592 3589 +f 3609 3610 3601 +f 3604 3609 3601 +f 3585 3163 3171 +f 3171 3612 3585 +f 3585 3613 3614 +f 3612 3613 3585 +f 3614 3615 3616 +f 3615 3614 3613 +f 3613 3617 3615 +f 3608 3607 3618 +f 3586 3614 3605 +f 3585 3614 3586 +f 3607 3608 3589 +f 3618 3606 3616 +f 3606 3618 3607 +f 3605 3616 3606 +f 3616 3605 3614 +f 3611 3609 3619 +f 3611 3619 3620 +f 3618 3619 3608 +f 3609 3608 3619 +f 3620 3621 3622 +f 3621 3620 3619 +f 3619 3618 3621 +f 3615 3622 3621 +f 3621 3616 3615 +f 3616 3621 3618 +f 3532 3623 3531 +f 3623 3532 3624 +f 3625 3624 3532 +f 3533 3625 3532 +f 3531 3526 3523 +f 3526 3531 3623 +f 3626 3627 3624 +f 3625 3626 3624 +f 3623 3628 3526 +f 3628 3623 3629 +f 3624 3629 3623 +f 3629 3624 3627 +f 3526 3630 3525 +f 3524 3189 3187 +f 3189 3524 3631 +f 3631 3630 3632 +f 3631 3525 3630 +f 3524 3525 3631 +f 3628 3633 3630 +f 3630 3526 3628 +f 3629 3634 3628 +f 3627 3635 3629 +f 3634 3629 3635 +f 3626 3636 3627 +f 3635 3627 3637 +f 3636 3637 3627 +f 3634 3638 3633 +f 3633 3628 3634 +f 3638 3634 3639 +f 3640 3633 3638 +f 3632 3633 3640 +f 3632 3630 3633 +f 3641 3642 3643 +f 3642 3198 3195 +f 3644 3645 3646 +f 3643 3644 3641 +f 3195 3643 3642 +f 3646 3641 3644 +f 3192 3631 3632 +f 3631 3192 3189 +f 3193 3632 3640 +f 3632 3193 3192 +f 3639 3635 3647 +f 3637 3647 3635 +f 3647 3637 3648 +f 3636 3649 3637 +f 3635 3639 3634 +f 3649 3648 3637 +f 3648 3650 3647 +f 3650 3648 3651 +f 3652 3651 3648 +f 3649 3652 3648 +f 3647 3653 3639 +f 3654 3638 3655 +f 3640 3638 3654 +f 3196 3640 3654 +f 3640 3196 3193 +f 3655 3639 3653 +f 3639 3655 3638 +f 3653 3647 3650 +f 3643 3195 3196 +f 3645 3644 3656 +f 3644 3643 3657 +f 3644 3657 3656 +f 3658 3657 3196 +f 3658 3196 3654 +f 3645 3656 3658 +f 3658 3656 3657 +f 3643 3196 3657 +f 3659 3557 3556 +f 3660 3555 3491 +f 3660 3661 3555 +f 3661 3556 3555 +f 3661 3659 3556 +f 3557 3659 3662 +f 3660 3663 3664 +f 3665 3664 3663 +f 3663 3666 3665 +f 3664 3667 3660 +f 3666 3646 3645 +f 3668 3660 3667 +f 3645 3665 3666 +f 3650 3668 3653 +f 3669 3654 3655 +f 3653 3669 3655 +f 3665 3645 3658 +f 3654 3670 3658 +f 3661 3651 3659 +f 3659 3651 3652 +f 3652 3662 3659 +f 3668 3650 3661 +f 3660 3668 3661 +f 3651 3661 3650 +f 3665 3658 3670 +f 3669 3653 3668 +f 3670 3654 3671 +f 3654 3669 3671 +f 3672 3673 3674 +f 3670 3671 3673 +f 3674 3675 3672 +f 3669 3673 3671 +f 3669 3675 3674 +f 3674 3673 3669 +f 3673 3672 3670 +f 3669 3667 3675 +f 3667 3672 3675 +f 3667 3664 3672 +f 3672 3664 3665 +f 3667 3669 3668 +f 3672 3665 3670 +f 3491 3490 3660 +f 3676 3660 3490 +f 3575 3660 3676 +f 3575 3677 3660 +f 3678 3679 3642 +f 3642 3641 3678 +f 3679 3199 3198 +f 3198 3642 3679 +f 3680 3678 3641 +f 3681 3680 3646 +f 3641 3646 3680 +f 3677 3682 3663 +f 3663 3660 3677 +f 3646 3666 3681 +f 3682 3681 3666 +f 3666 3663 3682 +f 3683 3684 3685 +f 3684 3683 3467 +f 3465 3274 3273 +f 3686 3467 3683 +f 3467 3686 3465 +f 3687 3456 3458 +f 3458 3688 3687 +f 3688 3458 3457 +f 3457 3689 3688 +f 3165 3166 3689 +f 3687 3470 3456 +f 3689 3457 3165 +f 3466 3469 3684 +f 3469 3473 3690 +f 3691 3473 3474 +f 3692 3474 3470 +f 3691 3690 3473 +f 3470 3687 3693 +f 3474 3692 3691 +f 3684 3467 3466 +f 3470 3693 3692 +f 3690 3684 3469 +f 3467 3465 3464 +f 3156 3582 3694 +f 3582 3156 3154 +f 3582 3587 3694 +f 3612 3695 3613 +f 3696 3695 3612 +f 3694 3164 3156 +f 3612 3171 3203 +f 3203 3696 3612 +f 3696 3203 3201 +f 3617 3613 3695 +f 3697 3577 3698 +f 3697 3620 3579 +f 3577 3697 3579 +f 3622 3615 3617 +f 3622 3579 3620 +f 3697 3611 3620 +f 3697 3698 3699 +f 3611 3697 3699 +f 3685 3700 3683 +f 3700 3699 3698 +f 3698 3683 3700 +f 3683 3698 3686 +f 3701 3702 3685 +f 3694 3703 3704 +f 3694 3587 3703 +f 3705 3706 3703 +f 3703 3598 3705 +f 3598 3703 3587 +f 3704 3703 3706 +f 3699 3700 3707 +f 3600 3705 3598 +f 3705 3600 3707 +f 3611 3699 3610 +f 3610 3707 3600 +f 3707 3610 3699 +f 3706 3705 3702 +f 3702 3701 3706 +f 3700 3685 3702 +f 3707 3702 3705 +f 3702 3707 3700 +f 3164 3694 3704 +f 3201 3708 3696 +f 3704 3706 3709 +f 3577 3686 3698 +f 3166 3704 3709 +f 3704 3166 3164 +f 3687 3689 3166 +f 3687 3166 3709 +f 3687 3688 3689 +f 3709 3706 3701 +f 3710 3695 3711 +f 3696 3711 3695 +f 3708 3711 3696 +f 3579 3622 3712 +f 3712 3617 3710 +f 3617 3712 3622 +f 3695 3710 3617 +f 3202 3679 3713 +f 3714 3713 3679 +f 3715 3713 3714 +f 3715 3202 3713 +f 3715 3714 3678 +f 3708 3202 3715 +f 3708 3201 3202 +f 3681 3715 3680 +f 3715 3678 3680 +f 3714 3679 3678 +f 3202 3199 3679 +f 3715 3576 3708 +f 3576 3715 3716 +f 3693 3709 3717 +f 3690 3685 3684 +f 3685 3690 3701 +f 3690 3709 3701 +f 3709 3690 3717 +f 3709 3693 3687 +f 3710 3711 3575 +f 3676 3710 3575 +f 3681 3716 3715 +f 3677 3718 3719 +f 3682 3716 3681 +f 3677 3575 3718 +f 3575 3574 3718 +f 3677 3719 3682 +f 3573 3719 3718 +f 3682 3719 3716 +f 3489 3577 3579 +f 3710 3490 3712 +f 3465 3686 3577 +f 3490 3578 3712 +f 3576 3711 3708 +f 3711 3576 3575 +f 3712 3578 3579 +f 3676 3490 3710 +f 3720 3692 3693 +f 3721 3691 3692 +f 3691 3721 3690 +f 3693 3717 3720 +f 3720 3717 3690 +f 3690 3721 3720 +f 3692 3720 3721 +f 3719 3573 3576 +f 3718 3574 3573 +f 3576 3716 3719 +f 3722 3723 3724 +f 3724 3725 3722 +f 3725 3724 3726 +f 3726 3727 3725 +f 3727 3726 3728 +f 3728 3729 3727 +f 3729 3728 3730 +f 3730 3731 3729 +f 3723 3732 3724 +f 3732 3723 3733 +f 3724 3734 3726 +f 3734 3724 3732 +f 3726 3735 3728 +f 3735 3726 3734 +f 3728 3736 3730 +f 3736 3728 3735 +f 3737 3738 3739 +f 3738 3737 3740 +f 3739 3741 3742 +f 3741 3739 3738 +f 3734 3739 3735 +f 3739 3734 3737 +f 3735 3742 3736 +f 3742 3735 3739 +f 3733 3743 3732 +f 3743 3733 3744 +f 3732 3737 3734 +f 3737 3732 3743 +f 3744 3745 3743 +f 3745 3744 3746 +f 3743 3740 3737 +f 3740 3743 3745 +f 3747 3748 3749 +f 3749 3750 3747 +f 3750 3749 3751 +f 3751 3752 3750 +f 3752 3751 3753 +f 3753 3754 3752 +f 3754 3753 3723 +f 3723 3722 3754 +f 3748 3755 3749 +f 3755 3748 3756 +f 3749 3757 3751 +f 3757 3749 3755 +f 3751 3758 3753 +f 3758 3751 3757 +f 3753 3733 3723 +f 3733 3753 3758 +f 3757 3759 3758 +f 3759 3757 3760 +f 3758 3744 3733 +f 3744 3758 3759 +f 3760 3761 3759 +f 3761 3760 3762 +f 3759 3746 3744 +f 3746 3759 3761 +f 3763 3764 3765 +f 3764 3763 3766 +f 3765 3762 3760 +f 3762 3765 3764 +f 3756 3765 3755 +f 3765 3756 3763 +f 3755 3760 3757 +f 3760 3755 3765 +f 3767 3768 3769 +f 3768 3767 3770 +f 3769 3771 3772 +f 3771 3769 3768 +f 3740 3769 3738 +f 3769 3740 3767 +f 3738 3772 3741 +f 3772 3738 3769 +f 3746 3773 3745 +f 3773 3746 3774 +f 3745 3767 3740 +f 3767 3745 3773 +f 3774 3775 3773 +f 3775 3774 3776 +f 3773 3770 3767 +f 3770 3773 3775 +f 3777 3770 3778 +f 3777 3768 3770 +f 3779 3768 3777 +f 3779 3771 3768 +f 3780 3777 3778 +f 3777 3780 3781 +f 3781 3779 3777 +f 3779 3781 3782 +f 3783 3784 3785 +f 3784 3783 3786 +f 3786 3778 3784 +f 3778 3786 3780 +f 3784 3776 3785 +f 3784 3775 3776 +f 3770 3784 3778 +f 3770 3775 3784 +f 3787 3788 3789 +f 3788 3787 3790 +f 3789 3776 3774 +f 3776 3789 3788 +f 3762 3789 3761 +f 3789 3762 3787 +f 3761 3774 3746 +f 3774 3761 3789 +f 3766 3791 3764 +f 3791 3766 3792 +f 3764 3787 3762 +f 3787 3764 3791 +f 3792 3793 3791 +f 3793 3792 3794 +f 3791 3790 3787 +f 3790 3791 3793 +f 3795 3796 3797 +f 3796 3795 3798 +f 3798 3785 3796 +f 3785 3798 3783 +f 3788 3797 3796 +f 3788 3790 3797 +f 3785 3788 3796 +f 3785 3776 3788 +f 3794 3799 3793 +f 3794 3800 3799 +f 3793 3797 3790 +f 3793 3799 3797 +f 3801 3799 3800 +f 3799 3801 3802 +f 3802 3797 3799 +f 3797 3802 3795 +f 3803 3804 3805 +f 3804 3803 3806 +f 3807 3805 3808 +f 3805 3807 3803 +f 3806 3730 3804 +f 3730 3806 3731 +f 3809 3810 3811 +f 3812 3813 3814 +f 3812 3815 3813 +f 3811 3816 3813 +f 3727 3812 3814 +f 3812 3727 3729 +f 3807 3806 3803 +f 3807 3731 3806 +f 3817 3813 3815 +f 3818 3815 3812 +f 3818 3731 3807 +f 3729 3818 3812 +f 3818 3729 3731 +f 3819 3820 3821 +f 3813 3817 3811 +f 3822 3819 3821 +f 3811 3823 3809 +f 3809 3821 3820 +f 3821 3809 3823 +f 3823 3811 3817 +f 3824 3810 3825 +f 3810 3824 3816 +f 3826 3816 3824 +f 3814 3816 3826 +f 3814 3813 3816 +f 3725 3814 3826 +f 3814 3725 3727 +f 3826 3824 3827 +f 3828 3825 3829 +f 3825 3828 3824 +f 3722 3826 3827 +f 3826 3722 3725 +f 3830 3829 3825 +f 3827 3824 3828 +f 3831 3832 3833 +f 3825 3834 3830 +f 3829 3830 3835 +f 3836 3837 3832 +f 3831 3836 3832 +f 3830 3833 3832 +f 3832 3835 3830 +f 3835 3832 3837 +f 3838 3831 3833 +f 3838 3833 3820 +f 3819 3838 3820 +f 3820 3834 3809 +f 3834 3820 3833 +f 3834 3825 3810 +f 3816 3811 3810 +f 3810 3809 3834 +f 3833 3830 3834 +f 3839 3840 3841 +f 3842 3840 3839 +f 3840 3842 3843 +f 3844 3815 3818 +f 3845 3822 3821 +f 3823 3846 3821 +f 3817 3815 3847 +f 3807 3844 3818 +f 3848 3846 3823 +f 3815 3844 3847 +f 3821 3846 3845 +f 3849 3817 3847 +f 3844 3807 3850 +f 3849 3848 3817 +f 3817 3848 3823 +f 3807 3808 3851 +f 3851 3850 3807 +f 3852 3843 3847 +f 3853 3852 3854 +f 3851 3854 3850 +f 3854 3851 3853 +f 3852 3853 3843 +f 3847 3843 3849 +f 3847 3855 3852 +f 3852 3855 3856 +f 3844 3850 3854 +f 3854 3856 3844 +f 3842 3845 3846 +f 3856 3855 3847 +f 3847 3844 3856 +f 3856 3854 3852 +f 3846 3843 3842 +f 3849 3843 3848 +f 3848 3843 3846 +f 3730 3857 3804 +f 3857 3730 3736 +f 3804 3858 3805 +f 3858 3804 3857 +f 3805 3859 3808 +f 3859 3805 3858 +f 3736 3860 3857 +f 3857 3861 3858 +f 3858 3862 3859 +f 3861 3857 3860 +f 3863 3859 3862 +f 3860 3736 3742 +f 3862 3858 3861 +f 3859 3863 3864 +f 3808 3864 3851 +f 3864 3808 3859 +f 3865 3853 3866 +f 3865 3866 3867 +f 3843 3853 3865 +f 3843 3865 3868 +f 3865 3867 3869 +f 3867 3870 3871 +f 3851 3866 3853 +f 3866 3851 3864 +f 3866 3870 3867 +f 3870 3872 3873 +f 3872 3874 3875 +f 3874 3876 3877 +f 3872 3866 3874 +f 3870 3866 3872 +f 3874 3866 3876 +f 3864 3878 3866 +f 3876 3879 3880 +f 3879 3881 3882 +f 3881 3878 3883 +f 3879 3878 3881 +f 3876 3878 3879 +f 3876 3866 3878 +f 3881 3883 3884 +f 3878 3864 3863 +f 3885 3862 3886 +f 3742 3887 3860 +f 3887 3742 3741 +f 3860 3888 3861 +f 3888 3860 3887 +f 3861 3886 3862 +f 3886 3861 3888 +f 3883 3878 3889 +f 3862 3885 3863 +f 3863 3890 3878 +f 3891 3878 3890 +f 3892 3878 3891 +f 3889 3878 3892 +f 3883 3889 3893 +f 3889 3892 3894 +f 3890 3863 3885 +f 3892 3891 3895 +f 3872 3896 3897 +f 3876 3898 3899 +f 3875 3900 3896 +f 3877 3899 3901 +f 3880 3902 3898 +f 3874 3901 3900 +f 3903 3865 3869 +f 3904 3867 3871 +f 3905 3871 3870 +f 3906 3869 3867 +f 3907 3868 3865 +f 3840 3843 3868 +f 3843 3872 3840 +f 3868 3907 3840 +f 3869 3906 3903 +f 3871 3905 3904 +f 3873 3897 3908 +f 3870 3908 3905 +f 3867 3904 3906 +f 3865 3903 3907 +f 3896 3840 3872 +f 3908 3870 3873 +f 3896 3872 3875 +f 3901 3874 3877 +f 3899 3877 3876 +f 3900 3875 3874 +f 3872 3883 3896 +f 3897 3873 3872 +f 3893 3909 3910 +f 3883 3910 3911 +f 3881 3912 3913 +f 3884 3911 3912 +f 3882 3913 3914 +f 3910 3896 3883 +f 3914 3902 3880 +f 3911 3884 3883 +f 3913 3882 3881 +f 3880 3879 3914 +f 3898 3876 3880 +f 3914 3879 3882 +f 3912 3881 3884 +f 3910 3883 3893 +f 3915 3892 3895 +f 3916 3891 3917 +f 3918 3895 3891 +f 3919 3894 3892 +f 3883 3920 3910 +f 3909 3893 3889 +f 3921 3889 3894 +f 3891 3916 3918 +f 3895 3918 3915 +f 3922 3910 3920 +f 3917 3923 3916 +f 3894 3919 3921 +f 3892 3915 3919 +f 3889 3921 3909 +f 3835 3924 3829 +f 3925 3828 3926 +f 3827 3828 3925 +f 3926 3829 3924 +f 3829 3926 3828 +f 3754 3827 3925 +f 3827 3754 3722 +f 3924 3927 3926 +f 3928 3926 3927 +f 3925 3926 3928 +f 3752 3925 3928 +f 3925 3752 3754 +f 3929 3930 3927 +f 3927 3924 3929 +f 3924 3835 3931 +f 3932 3933 3934 +f 3932 3934 3837 +f 3836 3932 3837 +f 3931 3929 3924 +f 3837 3931 3835 +f 3931 3837 3934 +f 3934 3935 3931 +f 3933 3936 3937 +f 3929 3931 3935 +f 3935 3934 3937 +f 3933 3937 3934 +f 3935 3938 3929 +f 3938 3935 3939 +f 3936 3940 3937 +f 3937 3939 3935 +f 3939 3937 3940 +f 3941 3942 3943 +f 3942 3941 3944 +f 3945 3943 3946 +f 3943 3945 3941 +f 3944 3747 3942 +f 3747 3944 3748 +f 3930 3929 3938 +f 3947 3927 3930 +f 3750 3928 3947 +f 3928 3750 3752 +f 3928 3927 3947 +f 3947 3747 3750 +f 3948 3938 3949 +f 3946 3942 3747 +f 3950 3930 3948 +f 3947 3930 3950 +f 3946 3943 3942 +f 3946 3747 3950 +f 3747 3947 3950 +f 3939 3949 3938 +f 3949 3939 3951 +f 3938 3948 3930 +f 3952 3953 3940 +f 3936 3952 3940 +f 3940 3951 3939 +f 3951 3940 3953 +f 3954 3955 3956 +f 3845 3842 3957 +f 3954 3958 3959 +f 3956 3958 3954 +f 3960 3958 3956 +f 3956 3955 3960 +f 3961 3959 3958 +f 3958 3960 3961 +f 3952 3957 3842 +f 3961 3950 3959 +f 3950 3954 3959 +f 3954 3949 3841 +f 3839 3953 3842 +f 3953 3839 3951 +f 3954 3950 3948 +f 3842 3953 3952 +f 3950 3961 3946 +f 3949 3954 3948 +f 3961 3962 3945 +f 3945 3946 3961 +f 3951 3841 3949 +f 3841 3951 3839 +f 3841 3840 3954 +f 3840 3960 3955 +f 3963 3961 3960 +f 3961 3963 3962 +f 3954 3840 3955 +f 3960 3840 3963 +f 3964 3962 3965 +f 3965 3966 3964 +f 3962 3964 3945 +f 3964 3967 3968 +f 3969 3941 3968 +f 3945 3968 3941 +f 3944 3756 3748 +f 3968 3945 3964 +f 3756 3944 3969 +f 3969 3763 3756 +f 3968 3970 3969 +f 3941 3969 3944 +f 3970 3766 3763 +f 3763 3969 3970 +f 3966 3971 3967 +f 3972 3967 3971 +f 3766 3970 3972 +f 3970 3968 3967 +f 3967 3964 3966 +f 3967 3972 3970 +f 3903 3963 3840 +f 3904 3963 3903 +f 3903 3840 3907 +f 3904 3903 3906 +f 3908 3904 3905 +f 3963 3965 3962 +f 3965 3963 3973 +f 3904 3973 3963 +f 3896 3973 3908 +f 3898 3901 3899 +f 3898 3973 3901 +f 3901 3896 3900 +f 3973 3974 3965 +f 3896 3908 3897 +f 3901 3973 3896 +f 3908 3973 3904 +f 3974 3973 3975 +f 3914 3898 3902 +f 3975 3898 3914 +f 3975 3973 3898 +f 3912 3914 3913 +f 3966 3965 3974 +f 3974 3976 3966 +f 3971 3966 3976 +f 3921 3910 3909 +f 3912 3910 3975 +f 3975 3914 3912 +f 3975 3910 3921 +f 3910 3912 3911 +f 3976 3974 3977 +f 3978 3915 3916 +f 3975 3977 3974 +f 3977 3975 3978 +f 3915 3921 3919 +f 3915 3975 3921 +f 3916 3915 3918 +f 3978 3975 3915 +f 3979 3980 3981 +f 3980 3979 3982 +f 3772 3983 3984 +f 3983 3772 3771 +f 3984 3982 3979 +f 3982 3984 3983 +f 3741 3984 3887 +f 3984 3741 3772 +f 3887 3979 3888 +f 3979 3887 3984 +f 3888 3981 3886 +f 3981 3888 3979 +f 3890 3985 3891 +f 3891 3985 3917 +f 3886 3986 3885 +f 3986 3886 3981 +f 3987 3988 3989 +f 3990 3989 3988 +f 3989 3990 3991 +f 3991 3990 3992 +f 3990 3988 3993 +f 3988 3987 3994 +f 3991 3890 3989 +f 3989 3885 3986 +f 3985 3890 3920 +f 3920 3890 3995 +f 3985 3920 3996 +f 3920 3995 3997 +f 3995 3890 3998 +f 3998 3890 3991 +f 3995 3998 3999 +f 3998 3991 4000 +f 3885 3989 3890 +f 3981 4001 3986 +f 4001 3981 3980 +f 3980 4002 4003 +f 4004 3980 4003 +f 3986 4005 3989 +f 3989 4006 3987 +f 4005 4006 3989 +f 4007 4006 4005 +f 4006 4008 3987 +f 4007 4009 4006 +f 4010 4011 4007 +f 4005 3986 4001 +f 4005 4010 4007 +f 4012 4013 4010 +f 4012 4010 4005 +f 4014 4012 4015 +f 4015 4012 4005 +f 4016 4001 4004 +f 4016 4005 4001 +f 4015 4005 4016 +f 4017 3999 3998 +f 4018 3997 3995 +f 4019 3985 3996 +f 4020 3996 3920 +f 3923 3917 3985 +f 3922 3920 3997 +f 4021 3995 3999 +f 3997 4018 3922 +f 3999 4017 4021 +f 3920 3922 4020 +f 3998 4022 4017 +f 3995 4021 4018 +f 3996 4020 4019 +f 4023 3992 3990 +f 4024 4000 3991 +f 4022 3998 4000 +f 4025 3991 3992 +f 4026 3990 3993 +f 4027 3993 3988 +f 3920 3988 3922 +f 3992 4023 4025 +f 4000 4024 4022 +f 3988 4028 4027 +f 3993 4027 4026 +f 3990 4026 4023 +f 3991 4025 4024 +f 4028 3922 3988 +f 4008 4029 4030 +f 4006 4031 4029 +f 3987 4030 4032 +f 4007 4033 4034 +f 3994 4032 4028 +f 4009 4034 4031 +f 4034 4009 4007 +f 4031 4006 4009 +f 4028 3988 3994 +f 4030 3987 4008 +f 4029 4008 4006 +f 4032 3994 3987 +f 3988 4012 4028 +f 4012 4014 4035 +f 4036 4010 4013 +f 4037 4013 4012 +f 4033 4007 4011 +f 4012 4015 4038 +f 4039 4011 4010 +f 4012 4040 4037 +f 4011 4039 4033 +f 4013 4037 4036 +f 4010 4036 4039 +f 4035 4040 4012 +f 4038 4040 4012 +f 4040 4028 4012 +f 3980 3982 4002 +f 4041 3771 3779 +f 4041 3983 3771 +f 4002 3983 4041 +f 4002 3982 3983 +f 4042 4002 4041 +f 4041 4043 4042 +f 4044 4003 4002 +f 4002 4042 4044 +f 4043 4041 3779 +f 3779 3782 4043 +f 4045 4046 4047 +f 4048 4049 4045 +f 4049 4048 4050 +f 4051 4047 4046 +f 4047 4051 4052 +f 4053 4052 4051 +f 4054 4053 4051 +f 4046 4045 4049 +f 4044 4042 4043 +f 4055 4050 4048 +f 4044 3782 4055 +f 3782 4056 4055 +f 4056 3782 3781 +f 4044 4043 3782 +f 4050 4057 4049 +f 4056 4050 4055 +f 4056 4058 4050 +f 4059 4058 4056 +f 3781 4059 4056 +f 4059 3781 3780 +f 4059 4060 4058 +f 4061 4060 4059 +f 4057 4050 4058 +f 4058 4062 4057 +f 4062 4058 4060 +f 3780 4061 4059 +f 4061 3780 3786 +f 4063 4062 4064 +f 4065 4066 4061 +f 4061 4066 4060 +f 3786 4065 4061 +f 4065 3786 3783 +f 4060 4064 4062 +f 4064 4060 4066 +f 4067 4068 4069 +f 4069 4070 4067 +f 4068 4067 4063 +f 4067 4057 4062 +f 4071 4072 4069 +f 4071 4069 4068 +f 4073 4071 4068 +f 4062 4063 4067 +f 4070 4049 4057 +f 4074 4046 4070 +f 4046 4074 4051 +f 4049 4070 4046 +f 4054 4051 4074 +f 4057 4067 4070 +f 4070 4069 4074 +f 4072 4054 4074 +f 4072 4074 4069 +f 4075 4076 4035 +f 4077 4075 4035 +f 4035 4014 4077 +f 4078 4077 4014 +f 4078 4079 4077 +f 4080 4078 4014 +f 4081 4080 4014 +f 4004 4001 3980 +f 4082 4081 4014 +f 4083 4082 4015 +f 4014 4015 4082 +f 4004 4084 4085 +f 4085 4016 4004 +f 4016 4085 4083 +f 4083 4015 4016 +f 4044 4004 4003 +f 4055 4084 4044 +f 4052 4080 4047 +f 4078 4052 4053 +f 4045 4082 4048 +f 4082 4055 4048 +f 4047 4081 4045 +f 4053 4079 4078 +f 4004 4044 4084 +f 4084 4055 4086 +f 4080 4052 4078 +f 4055 4082 4086 +f 4082 4045 4081 +f 4081 4047 4080 +f 4087 4086 4082 +f 4085 4087 4088 +f 4087 4085 4084 +f 4083 4088 4082 +f 4082 4088 4087 +f 4088 4083 4085 +f 4084 4086 4087 +f 4019 3978 3916 +f 3985 4019 3923 +f 4089 3977 4090 +f 4019 3916 3923 +f 3972 3792 3766 +f 3792 3972 4091 +f 3971 4091 3972 +f 4091 3971 4092 +f 3976 4092 3971 +f 4092 3976 4089 +f 3977 4089 3976 +f 4093 4089 4094 +f 4091 3794 3792 +f 3794 4091 4095 +f 4092 4095 4091 +f 4095 4092 4093 +f 4089 4093 4092 +f 4028 4096 4026 +f 4030 4096 4028 +f 4026 4025 4023 +f 4028 4026 4027 +f 4030 4028 4032 +f 4090 3978 4096 +f 4096 4022 4025 +f 4096 4025 4026 +f 4021 3978 3922 +f 3922 4019 4020 +f 4021 3922 4018 +f 3922 3978 4019 +f 3978 4090 3977 +f 4022 4021 4017 +f 4025 4022 4024 +f 4022 3978 4021 +f 4096 3978 4022 +f 4097 4098 4094 +f 4090 4094 4089 +f 4094 4090 4099 +f 4096 4099 4090 +f 4031 4096 4030 +f 4100 4031 4033 +f 4100 4096 4031 +f 4031 4030 4029 +f 4033 4031 4034 +f 4036 4033 4039 +f 4099 4096 4100 +f 4099 4100 4101 +f 4099 4101 4097 +f 4037 4040 4036 +f 4100 4033 4036 +f 4100 4036 4040 +f 4040 4101 4100 +f 4038 4040 4035 +f 4040 4038 4101 +f 4065 4102 4066 +f 4103 4102 4065 +f 4104 4064 4105 +f 3783 4103 4065 +f 4103 3783 3798 +f 4066 4105 4064 +f 4105 4066 4102 +f 4106 4107 4103 +f 3798 4106 4103 +f 4106 3798 3795 +f 4106 4108 4107 +f 4103 4107 4102 +f 4102 4109 4105 +f 4109 4102 4107 +f 4104 4110 4111 +f 4111 4063 4104 +f 4063 4111 4068 +f 4064 4104 4063 +f 4105 4112 4104 +f 4073 4068 4111 +f 4113 4073 4111 +f 4113 4111 4110 +f 4112 4114 4110 +f 4114 4112 4115 +f 4107 4116 4109 +f 4110 4104 4112 +f 4109 4115 4112 +f 4112 4105 4109 +f 4117 4113 4110 +f 4117 4110 4114 +f 4118 4117 4114 +f 4098 4119 4093 +f 4095 4119 4120 +f 4095 4093 4119 +f 4098 4093 4094 +f 4120 3794 4095 +f 4120 3800 3794 +f 4098 4121 4122 +f 4122 4119 4098 +f 4120 4123 3801 +f 3801 3800 4120 +f 4119 4122 4123 +f 4123 4120 4119 +f 4108 4124 4116 +f 4124 4108 4125 +f 4116 4126 4115 +f 4115 4127 4114 +f 4127 4115 4126 +f 4118 4114 4127 +f 4128 4118 4127 +f 4126 4116 4124 +f 3795 4129 4106 +f 4129 3795 3802 +f 3802 4130 4129 +f 4116 4107 4108 +f 4129 4108 4106 +f 4129 4125 4108 +f 4115 4109 4116 +f 4121 4123 4122 +f 4130 4125 4129 +f 4130 3802 3801 +f 4121 3801 4123 +f 4130 3801 4121 +f 4097 4094 4099 +f 4038 4035 4131 +f 4038 4131 4132 +f 4101 4132 4133 +f 4076 4134 4035 +f 4132 4101 4038 +f 4133 4097 4101 +f 4134 4131 4035 +f 4135 4132 4131 +f 4134 4135 4136 +f 4131 4136 4135 +f 4137 4133 4132 +f 4134 4137 4135 +f 4132 4135 4137 +f 4138 4077 4079 +f 4134 4136 4131 +f 4133 4098 4097 +f 4075 4077 4126 +f 4125 4137 4134 +f 4137 4121 4133 +f 4076 4124 4134 +f 4076 4075 4124 +f 4127 4077 4138 +f 4098 4133 4121 +f 4138 4128 4127 +f 4137 4125 4130 +f 4121 4137 4130 +f 4124 4125 4134 +f 4124 4075 4126 +f 4126 4077 4127 +f 4139 4140 4141 +f 4140 4142 4143 +f 4141 4144 4139 +f 4143 4145 4141 +f 4143 4141 4140 +f 4146 4147 4148 +f 4147 4149 4148 +f 4147 4144 4141 +f 4142 4146 4143 +f 4142 4144 4146 +f 4144 4147 4146 +f 4150 4141 4145 +f 4148 4151 4143 +f 4145 4143 4151 +f 4152 4149 4141 +f 4141 4150 4152 +f 4148 4143 4146 +f 4141 4149 4147 +f 4148 4149 4151 +f 4149 4152 4151 +f 4151 4152 4145 +f 4152 4150 4145 +f 4153 4154 4155 +f 4154 4156 4155 +f 4155 4156 4142 +f 4156 4144 4142 +f 4155 4142 4157 +f 4144 4156 4158 +f 4159 4160 4153 +f 4160 4154 4153 +f 4155 4157 4153 +f 4161 4162 4159 +f 4158 4156 4154 +f 4162 4160 4159 +f 4159 4157 4161 +f 4159 4153 4157 +f 4161 4157 4162 +f 4158 4160 4162 +f 4154 4160 4158 +f 4158 4162 4157 +f 4139 4157 4140 +f 4139 4158 4157 +f 4139 4144 4158 +f 4157 4142 4140 +f 4163 4164 4165 +f 4165 4166 4163 +f 4167 4166 4165 +f 4166 4168 4169 +f 4170 4171 4172 +f 4171 4173 4167 +f 4167 4172 4171 +f 4169 4163 4166 +f 4173 4168 4166 +f 4166 4167 4173 +f 4174 4172 4175 +f 4175 4176 4174 +f 4172 4174 4170 +f 4172 4167 4177 +f 4177 4175 4172 +f 4165 4177 4167 +f 4178 4175 4177 +f 4179 4176 4175 +f 4175 4178 4179 +f 4165 4180 4181 +f 4181 4177 4165 +f 4177 4181 4178 +f 4182 4183 4163 +f 4163 4169 4182 +f 4183 4184 4185 +f 4185 4186 4183 +f 4182 4187 4184 +f 4184 4183 4182 +f 4183 4186 4164 +f 4164 4163 4183 +f 4164 4186 4188 +f 4188 4189 4164 +f 4190 4188 4186 +f 4186 4185 4190 +f 4165 4164 4189 +f 4189 4180 4165 +f 4179 4178 4191 +f 4191 4192 4179 +f 4178 4181 4193 +f 4193 4191 4178 +f 4181 4180 4194 +f 4194 4193 4181 +f 4194 4180 4189 +f 4195 4189 4188 +f 4196 4197 4198 +f 4188 4190 4197 +f 4197 4196 4188 +f 4199 4195 4196 +f 4189 4195 4194 +f 4188 4196 4195 +f 4196 4200 4199 +f 4200 4198 4201 +f 4199 4202 4203 +f 4198 4200 4196 +f 4195 4199 4204 +f 4200 4205 4202 +f 4201 4205 4200 +f 4202 4199 4200 +f 4206 4207 4204 +f 4207 4206 4208 +f 4209 4210 4211 +f 4208 4211 4207 +f 4203 4204 4199 +f 4211 4208 4209 +f 4204 4203 4206 +f 4204 4207 4193 +f 4207 4211 4191 +f 4211 4210 4192 +f 4192 4191 4211 +f 4191 4193 4207 +f 4204 4194 4195 +f 4193 4194 4204 +f 4182 4212 4213 +f 4212 4214 4215 +f 4216 4213 4212 +f 4212 4182 4169 +f 4169 4214 4212 +f 4214 4169 4168 +f 4213 4187 4182 +f 4168 4217 4214 +f 4218 4219 4171 +f 4171 4170 4218 +f 4219 4220 4173 +f 4173 4171 4219 +f 4220 4217 4168 +f 4168 4173 4220 +f 4214 4217 4221 +f 4221 4217 4220 +f 4222 4220 4219 +f 4223 4219 4218 +f 4224 4225 4226 +f 4221 4215 4214 +f 4226 4216 4224 +f 4227 4225 4224 +f 4224 4215 4227 +f 4227 4215 4221 +f 4215 4224 4212 +f 4212 4224 4216 +f 4219 4223 4222 +f 4218 4228 4223 +f 4229 4221 4222 +f 4220 4222 4221 +f 4222 4230 4229 +f 4231 4223 4228 +f 4221 4229 4227 +f 4228 4232 4231 +f 4230 4222 4223 +f 4223 4231 4230 +f 4233 4234 4231 +f 4231 4232 4233 +f 4235 4236 4229 +f 4229 4230 4235 +f 4237 4227 4229 +f 4229 4236 4237 +f 4234 4235 4230 +f 4230 4231 4234 +f 4227 4237 4238 +f 4225 4238 4239 +f 4240 4238 4237 +f 4241 4239 4238 +f 4239 4226 4225 +f 4238 4225 4227 +f 4240 4242 4243 +f 4243 4241 4240 +f 4242 4240 4244 +f 4245 4244 4246 +f 4244 4245 4242 +f 4237 4244 4240 +f 4238 4240 4241 +f 4247 4248 4249 +f 4250 4251 4248 +f 4252 4246 4253 +f 4253 4249 4252 +f 4249 4253 4247 +f 4246 4252 4245 +f 4248 4247 4250 +f 4247 4234 4233 +f 4253 4235 4234 +f 4244 4237 4236 +f 4246 4236 4235 +f 4235 4253 4246 +f 4233 4250 4247 +f 4236 4246 4244 +f 4234 4247 4253 +f 4254 4255 4256 +f 4256 4257 4254 +f 4258 4259 4260 +f 4261 4262 4263 +f 4254 4257 4264 +f 4261 4263 4265 +f 4266 4263 4267 +f 4254 4264 4261 +f 4263 4266 4265 +f 4266 4267 4268 +f 4267 4269 4268 +f 4254 4261 4265 +f 4270 4271 4257 +f 4270 4272 4271 +f 4270 4273 4272 +f 4270 4257 4256 +f 4256 4274 4270 +f 4275 4276 4277 +f 4273 4278 4279 +f 4279 4272 4273 +f 4278 4277 4276 +f 4276 4279 4278 +f 4280 4281 4282 +f 4268 4269 4280 +f 4283 4282 4281 +f 4281 4284 4283 +f 4268 4280 4282 +f 4285 4286 4283 +f 4287 4286 4285 +f 4285 4288 4287 +f 4289 4290 4288 +f 4285 4283 4284 +f 4285 4284 4291 +f 4288 4285 4289 +f 4285 4292 4293 +f 4285 4291 4292 +f 4294 4292 4295 +f 4294 4295 4296 +f 4296 4297 4298 +f 4299 4298 4297 +f 4285 4293 4289 +f 4294 4293 4292 +f 4298 4294 4296 +f 4277 4300 4275 +f 4300 4301 4275 +f 4300 4302 4301 +f 4300 4303 4302 +f 4304 4305 4306 +f 4305 4307 4303 +f 4307 4302 4303 +f 4305 4304 4307 +f 4308 4309 4310 +f 4304 4306 4308 +f 4308 4311 4309 +f 4308 4312 4311 +f 4304 4308 4313 +f 4308 4310 4313 +f 4314 4315 4316 +f 4314 4317 4315 +f 4308 4314 4312 +f 4308 4318 4314 +f 4314 4316 4312 +f 4319 4320 4321 +f 4322 4321 4320 +f 4322 4317 4321 +f 4322 4315 4317 +f 4323 4319 4321 +f 4324 4319 4325 +f 4319 4323 4325 +f 4324 4326 4319 +f 4325 4327 4324 +f 4325 4328 4327 +f 4325 4329 4328 +f 4330 4331 4332 +f 4331 4333 4332 +f 4334 4328 4329 +f 4334 4329 4331 +f 4330 4335 4331 +f 4335 4334 4331 +f 4335 4336 4334 +f 4337 4338 4339 +f 4335 4339 4338 +f 4335 4338 4336 +f 4339 4299 4337 +f 4340 4341 4335 +f 4335 4330 4340 +f 4297 4337 4299 +f 4335 4341 4339 +f 4342 4343 4344 +f 4344 4345 4342 +f 4344 4343 4346 +f 4346 4347 4344 +f 4344 4348 4345 +f 4348 4344 4347 +f 4347 4349 4348 +f 4342 4345 4185 +f 4349 4350 4351 +f 4351 4348 4349 +f 4348 4351 4352 +f 4352 4345 4348 +f 4350 4353 4351 +f 4185 4345 4352 +f 4352 4190 4185 +f 4354 4355 4356 +f 4356 4357 4354 +f 4357 4358 4359 +f 4358 4349 4347 +f 4356 4360 4358 +f 4358 4357 4356 +f 4358 4360 4350 +f 4350 4349 4358 +f 4360 4361 4353 +f 4362 4361 4360 +f 4356 4357 4362 +f 4353 4350 4360 +f 4356 4362 4360 +f 4359 4363 4357 +f 4364 4365 4363 +f 4363 4359 4364 +f 4346 4364 4359 +f 4359 4347 4346 +f 4347 4359 4358 +f 4357 4363 4366 +f 4366 4354 4357 +f 4367 4368 4365 +f 4363 4365 4368 +f 4368 4366 4363 +f 4366 4368 4369 +f 4369 4370 4366 +f 4371 4372 4343 +f 4343 4342 4371 +f 4373 4372 4371 +f 4374 4375 4371 +f 4184 4342 4185 +f 4184 4371 4342 +f 4371 4184 4187 +f 4372 4373 4376 +f 4376 4377 4372 +f 4378 4373 4375 +f 4379 4375 4374 +f 4375 4373 4371 +f 4343 4372 4377 +f 4377 4346 4343 +f 4377 4376 4380 +f 4381 4376 4373 +f 4382 4380 4383 +f 4376 4381 4384 +f 4384 4380 4376 +f 4375 4379 4378 +f 4378 4381 4373 +f 4384 4381 4378 +f 4385 4378 4379 +f 4346 4377 4382 +f 4382 4364 4346 +f 4386 4364 4382 +f 4380 4382 4377 +f 4387 4383 4388 +f 4382 4387 4386 +f 4388 4389 4387 +f 4386 4387 4389 +f 4383 4387 4382 +f 4379 4390 4385 +f 4391 4384 4385 +f 4392 4385 4390 +f 4378 4385 4384 +f 4380 4384 4391 +f 4390 4393 4392 +f 4385 4392 4391 +f 4391 4383 4380 +f 4392 4393 4394 +f 4391 4392 4395 +f 4386 4365 4364 +f 4255 4254 4396 +f 4365 4386 4367 +f 4256 4255 4397 +f 4398 4397 4399 +f 4400 4399 4401 +f 4355 4402 4362 +f 4279 4276 4403 +f 4362 4356 4355 +f 4277 4278 4404 +f 4405 4404 4406 +f 4407 4406 4404 +f 4406 4408 4405 +f 4404 4405 4277 +f 4404 4409 4407 +f 4409 4404 4278 +f 4278 4273 4409 +f 4410 4409 4273 +f 4273 4270 4410 +f 4411 4412 4413 +f 4409 4410 4413 +f 4414 4413 4410 +f 4415 4410 4270 +f 4416 4417 4355 +f 4418 4417 4419 +f 4419 4403 4418 +f 4403 4419 4279 +f 4420 4419 4417 +f 4402 4355 4417 +f 4417 4418 4402 +f 4421 4422 4257 +f 4271 4272 4420 +f 4257 4271 4421 +f 4420 4421 4271 +f 4264 4257 4422 +f 4422 4421 4370 +f 4354 4366 4370 +f 4355 4354 4416 +f 4272 4279 4419 +f 4370 4416 4354 +f 4416 4370 4421 +f 4419 4420 4272 +f 4421 4420 4416 +f 4417 4416 4420 +f 4423 4424 4425 +f 4425 4274 4423 +f 4414 4415 4426 +f 4410 4415 4414 +f 4415 4274 4425 +f 4270 4274 4415 +f 4426 4415 4425 +f 4427 4425 4424 +f 4424 4400 4427 +f 4428 4425 4427 +f 4398 4423 4274 +f 4274 4256 4398 +f 4400 4424 4423 +f 4423 4398 4400 +f 4429 4430 4431 +f 4426 4432 4414 +f 4411 4433 4430 +f 4434 4431 3957 +f 4432 4433 4411 +f 4435 4436 4437 +f 4426 4428 4438 +f 4438 4437 4426 +f 4432 4436 4435 +f 4432 4426 4437 +f 4437 4438 4435 +f 4437 4436 4432 +f 4411 4414 4432 +f 4430 4429 4411 +f 4431 4434 4429 +f 3957 3952 4434 +f 4425 4428 4426 +f 4427 4439 4428 +f 4440 4441 4430 +f 4428 4439 4442 +f 4438 4442 4440 +f 4441 4440 4443 +f 4440 4433 4432 +f 4432 4435 4440 +f 4440 4435 4438 +f 4442 4438 4428 +f 4430 4433 4440 +f 4440 4258 4443 +f 4444 4445 4258 +f 4258 4445 4443 +f 4258 4446 4444 +f 4447 4444 4446 +f 4397 4255 4401 +f 4401 4399 4397 +f 4401 4255 4448 +f 4396 4448 4255 +f 4449 4401 4448 +f 4450 4451 4448 +f 4399 4400 4398 +f 4401 4427 4400 +f 4439 4427 4401 +f 4397 4398 4256 +f 4401 4449 4439 +f 4448 4452 4449 +f 4453 4454 4455 +f 4455 4456 4453 +f 4454 4453 4457 +f 4448 4451 4457 +f 4457 4452 4448 +f 4457 4451 4454 +f 4258 4440 4458 +f 4459 4446 4460 +f 4260 4460 4446 +f 4458 4440 4442 +f 4461 4442 4439 +f 4446 4258 4260 +f 4457 4462 4452 +f 4463 4462 4457 +f 4461 4462 4463 +f 4463 4458 4461 +f 4449 4452 4462 +f 4462 4461 4449 +f 4457 4458 4463 +f 4260 4458 4457 +f 4260 4457 4453 +f 4260 4453 4456 +f 4258 4458 4260 +f 4442 4461 4458 +f 4439 4449 4461 +f 4413 4414 4411 +f 4412 4411 4429 +f 4434 3952 3936 +f 4429 4464 4412 +f 4464 4429 4434 +f 4465 3936 3933 +f 3936 4465 4434 +f 3933 4466 4465 +f 4434 4465 4464 +f 4467 4464 4465 +f 4465 4466 4467 +f 4407 4413 4412 +f 4468 4469 4467 +f 4469 4412 4464 +f 4464 4467 4469 +f 4413 4407 4409 +f 4406 4407 4469 +f 4412 4469 4407 +f 4467 4470 4468 +f 3932 4471 4466 +f 4466 3933 3932 +f 4466 4471 4470 +f 4469 4468 4406 +f 4470 4467 4466 +f 4408 4406 4468 +f 4468 4472 4408 +f 4473 4470 4471 +f 4471 4474 4473 +f 3836 4474 4471 +f 4472 4468 4470 +f 4470 4473 4472 +f 4471 3932 3836 +f 3957 4431 4475 +f 4431 4476 4477 +f 4430 4476 4431 +f 4441 4476 4430 +f 4475 3845 3957 +f 4477 4475 4431 +f 4478 4479 4480 +f 4476 4480 4477 +f 4481 4477 4480 +f 4443 4482 4441 +f 4483 4482 4484 +f 4484 4485 4486 +f 4482 4443 4445 +f 4445 4484 4482 +f 4480 4476 4478 +f 4482 4483 4478 +f 4478 4441 4482 +f 4479 4478 4483 +f 4441 4478 4476 +f 4485 4484 4445 +f 4445 4444 4485 +f 4487 4488 4447 +f 4444 4447 4488 +f 4488 4485 4444 +f 4489 4483 4490 +f 4484 4490 4483 +f 4490 4486 4491 +f 4486 4490 4484 +f 4395 4394 4492 +f 4394 4395 4392 +f 4492 4493 4395 +f 4494 4395 4493 +f 4493 4495 4494 +f 4496 4497 4498 +f 4496 4396 4254 +f 4254 4265 4496 +f 4497 4496 4265 +f 4265 4266 4497 +f 4499 4500 4450 +f 4501 4450 4396 +f 4448 4396 4450 +f 4454 4500 4502 +f 4451 4450 4500 +f 4396 4496 4501 +f 4498 4501 4496 +f 4450 4501 4499 +f 4503 4499 4501 +f 4500 4499 4504 +f 4505 4504 4499 +f 4506 4498 4497 +f 4497 4507 4506 +f 4498 4506 4508 +f 4507 4497 4266 +f 4266 4268 4507 +f 4504 4505 4509 +f 4510 4511 4509 +f 4509 4512 4510 +f 4499 4503 4505 +f 4501 4498 4503 +f 4513 4514 4512 +f 4505 4515 4513 +f 4513 4509 4505 +f 4512 4509 4513 +f 4503 4508 4515 +f 4515 4505 4503 +f 4508 4503 4498 +f 4455 4502 4516 +f 4516 4517 4455 +f 4500 4454 4451 +f 4518 4517 4516 +f 4502 4455 4454 +f 4516 4519 4518 +f 4519 4516 4511 +f 4511 4510 4519 +f 4502 4504 4511 +f 4504 4502 4500 +f 4511 4516 4502 +f 4509 4511 4504 +f 4456 4455 4517 +f 4517 4520 4456 +f 4520 4517 4518 +f 4518 4521 4520 +f 4260 4456 4520 +f 4520 4460 4260 +f 4522 4460 4520 +f 4523 4524 4520 +f 4520 4525 4523 +f 4526 4525 4520 +f 4527 4528 4529 +f 4529 4525 4527 +f 4523 4525 4529 +f 4530 4526 4520 +f 4531 4520 4532 +f 4520 4524 4532 +f 4520 4521 4530 +f 4520 4533 4522 +f 4534 4533 4520 +f 4520 4535 4534 +f 4531 4535 4520 +f 4459 4536 4537 +f 4446 4459 4447 +f 4536 4459 4522 +f 4460 4522 4459 +f 4522 4533 4536 +f 4538 4536 4533 +f 4539 4538 4534 +f 4534 4535 4539 +f 4536 4538 4540 +f 4538 4539 4541 +f 4533 4534 4538 +f 4542 4369 4368 +f 4389 4388 4543 +f 4543 4544 4389 +f 4389 4367 4386 +f 4367 4389 4544 +f 4544 4542 4367 +f 4368 4367 4542 +f 4422 4545 4264 +f 4261 4264 4545 +f 4370 4369 4422 +f 4546 4545 4542 +f 4369 4542 4545 +f 4545 4422 4369 +f 4547 4546 4544 +f 4546 4547 4262 +f 4262 4261 4546 +f 4545 4546 4261 +f 4544 4543 4547 +f 4542 4544 4546 +f 4495 4543 4388 +f 4494 4388 4383 +f 4388 4494 4495 +f 4383 4391 4494 +f 4395 4494 4391 +f 4548 4547 4543 +f 4263 4262 4547 +f 4267 4263 4548 +f 4549 4548 4495 +f 4543 4495 4548 +f 4547 4548 4263 +f 4493 4492 4550 +f 4495 4493 4549 +f 4549 4550 4269 +f 4550 4549 4493 +f 4269 4267 4549 +f 4548 4549 4267 +f 4447 4537 4487 +f 4551 4487 4537 +f 4537 4540 4551 +f 4552 4551 4540 +f 4540 4541 4552 +f 4537 4447 4459 +f 4541 4540 4538 +f 4540 4537 4536 +f 4485 4488 4553 +f 4554 4553 4488 +f 4553 4486 4485 +f 4486 4553 4555 +f 4556 4554 4487 +f 4551 4552 4557 +f 4487 4551 4556 +f 4556 4557 4558 +f 4488 4487 4554 +f 4557 4556 4551 +f 4187 4559 4371 +f 4560 4559 4187 +f 4187 4213 4560 +f 4371 4559 4374 +f 4561 4374 4559 +f 4559 4560 4561 +f 4374 4562 4379 +f 4563 4562 4374 +f 4374 4561 4564 +f 4564 4563 4374 +f 4563 4564 4565 +f 4566 4567 4568 +f 4563 4568 4567 +f 4567 4562 4563 +f 4562 4567 4390 +f 4390 4379 4562 +f 4568 4569 4566 +f 4567 4566 4393 +f 4393 4390 4567 +f 4566 4570 4571 +f 4566 4569 4570 +f 4571 4572 4566 +f 4393 4566 4572 +f 4565 4568 4563 +f 4570 4569 4573 +f 4573 4569 4574 +f 4574 4575 4573 +f 4571 4570 4573 +f 4574 4569 4568 +f 4568 4565 4574 +f 4573 4575 4576 +f 4576 4577 4573 +f 4571 4573 4577 +f 4575 4578 4579 +f 4579 4576 4575 +f 4571 4577 4580 +f 4581 4560 4213 +f 4582 4564 4561 +f 4564 4582 4583 +f 4561 4584 4582 +f 4584 4561 4560 +f 4560 4581 4584 +f 4585 4581 4216 +f 4584 4581 4585 +f 4213 4216 4581 +f 4582 4586 4587 +f 4588 4586 4582 +f 4582 4584 4588 +f 4583 4587 4589 +f 4587 4583 4582 +f 4590 4589 4591 +f 4574 4589 4590 +f 4589 4592 4583 +f 4578 4593 4594 +f 4595 4596 4590 +f 4596 4594 4593 +f 4593 4590 4596 +f 4590 4591 4595 +f 4583 4565 4564 +f 4574 4590 4593 +f 4574 4592 4589 +f 4578 4575 4574 +f 4578 4574 4593 +f 4592 4574 4565 +f 4565 4583 4592 +f 4597 4506 4507 +f 4507 4598 4597 +f 4598 4507 4268 +f 4268 4282 4598 +f 4599 4598 4282 +f 4506 4597 4600 +f 4601 4600 4597 +f 4602 4603 4600 +f 4604 4597 4598 +f 4600 4508 4506 +f 4508 4600 4603 +f 4603 4515 4508 +f 4600 4601 4602 +f 4605 4604 4599 +f 4282 4283 4599 +f 4597 4604 4601 +f 4606 4601 4604 +f 4598 4599 4604 +f 4607 4608 4286 +f 4604 4605 4606 +f 4599 4608 4605 +f 4608 4599 4283 +f 4283 4286 4608 +f 4607 4287 4609 +f 4610 4611 4609 +f 4609 4287 4610 +f 4286 4287 4607 +f 4612 4610 4287 +f 4613 4611 4610 +f 4614 4609 4611 +f 4615 4616 4284 +f 4284 4281 4615 +f 4617 4580 4616 +f 4618 4616 4580 +f 4616 4618 4291 +f 4291 4284 4616 +f 4572 4394 4393 +f 4580 4617 4571 +f 4572 4571 4617 +f 4617 4619 4572 +f 4394 4572 4619 +f 4619 4492 4394 +f 4619 4617 4615 +f 4281 4280 4620 +f 4550 4620 4280 +f 4280 4269 4550 +f 4620 4550 4492 +f 4492 4619 4620 +f 4616 4615 4617 +f 4620 4615 4281 +f 4615 4620 4619 +f 4621 4622 4603 +f 4515 4603 4622 +f 4622 4513 4515 +f 4514 4513 4622 +f 4622 4623 4514 +f 4623 4622 4621 +f 4624 4621 4602 +f 4603 4602 4621 +f 4621 4625 4623 +f 4625 4621 4624 +f 4624 4626 4625 +f 4627 4602 4601 +f 4602 4627 4624 +f 4628 4629 4626 +f 4601 4606 4627 +f 4630 4627 4606 +f 4627 4630 4628 +f 4628 4624 4627 +f 4626 4624 4628 +f 4606 4631 4630 +f 4632 4605 4608 +f 4608 4607 4632 +f 4631 4606 4605 +f 4605 4632 4631 +f 4633 4630 4631 +f 4631 4632 4634 +f 4530 4629 4628 +f 4632 4607 4635 +f 4526 4628 4630 +f 4628 4526 4530 +f 4634 4636 4631 +f 4631 4636 4633 +f 4630 4633 4526 +f 4635 4634 4632 +f 4637 4526 4633 +f 4633 4636 4637 +f 4527 4525 4526 +f 4526 4637 4527 +f 4638 4636 4634 +f 4634 4639 4640 +f 4640 4639 4641 +f 4641 4639 4634 +f 4634 4635 4641 +f 4642 4641 4635 +f 4643 4644 4524 +f 4524 4523 4643 +f 4529 4643 4523 +f 4645 4529 4528 +f 4643 4529 4645 +f 4641 4642 4640 +f 4646 4642 4647 +f 4647 4609 4614 +f 4648 4640 4642 +f 4635 4647 4642 +f 4635 4607 4609 +f 4609 4647 4635 +f 4649 4634 4640 +f 4638 4634 4649 +f 4528 4527 4637 +f 4637 4638 4528 +f 4636 4638 4637 +f 4535 4531 4650 +f 4531 4532 4651 +f 4644 4651 4532 +f 4532 4524 4644 +f 4651 4650 4531 +f 4539 4650 4652 +f 4650 4651 4653 +f 4650 4539 4535 +f 4654 4655 4644 +f 4645 4654 4643 +f 4644 4643 4654 +f 4655 4653 4651 +f 4651 4644 4655 +f 4652 4541 4539 +f 4652 4653 4656 +f 4653 4652 4650 +f 4541 4652 4657 +f 4658 4659 4655 +f 4659 4656 4653 +f 4653 4655 4659 +f 4660 4658 4654 +f 4655 4654 4658 +f 4528 4661 4645 +f 4638 4649 4662 +f 4661 4528 4638 +f 4638 4662 4661 +f 4649 4663 4664 +f 4649 4665 4663 +f 4662 4664 4666 +f 4660 4645 4661 +f 4661 4666 4660 +f 4654 4645 4660 +f 4666 4661 4662 +f 4664 4662 4649 +f 4667 4613 4612 +f 4668 4612 4288 +f 4287 4288 4612 +f 4669 4614 4613 +f 4610 4612 4613 +f 4611 4613 4614 +f 4613 4667 4669 +f 4612 4668 4667 +f 4669 4290 4670 +f 4671 4670 4290 +f 4290 4289 4671 +f 4288 4290 4668 +f 4668 4290 4669 +f 4669 4667 4668 +f 4614 4672 4647 +f 4672 4614 4669 +f 4673 4648 4646 +f 4642 4646 4648 +f 4674 4646 4672 +f 4665 4648 4673 +f 4649 4640 4648 +f 4647 4672 4646 +f 4665 4649 4648 +f 4675 4676 4677 +f 4670 4678 4679 +f 4669 4679 4672 +f 4676 4675 4680 +f 4680 4678 4670 +f 4675 4681 4665 +f 4665 4680 4675 +f 4665 4673 4680 +f 4672 4679 4674 +f 4646 4674 4673 +f 4673 4682 4680 +f 4677 4681 4675 +f 4683 4674 4679 +f 4682 4673 4674 +f 4679 4678 4683 +f 4683 4678 4680 +f 4680 4682 4683 +f 4674 4683 4682 +f 4670 4684 4680 +f 4685 4684 4670 +f 4686 4676 4684 +f 4679 4669 4670 +f 4680 4684 4676 +f 4687 4688 4689 +f 4690 4691 4689 +f 4689 4691 4687 +f 4576 4579 4692 +f 4594 4579 4578 +f 4579 4594 4693 +f 4692 4693 4694 +f 4693 4692 4579 +f 4695 4692 4696 +f 4577 4576 4695 +f 4695 4580 4577 +f 4692 4695 4576 +f 4580 4695 4618 +f 4696 4694 4295 +f 4696 4618 4695 +f 4292 4291 4618 +f 4295 4292 4696 +f 4694 4696 4692 +f 4618 4696 4292 +f 4697 4698 4699 +f 4699 4700 4697 +f 4594 4596 4697 +f 4596 4595 4698 +f 4693 4697 4700 +f 4698 4697 4596 +f 4697 4693 4594 +f 4700 4699 4297 +f 4700 4694 4693 +f 4296 4295 4694 +f 4694 4700 4296 +f 4657 4656 4701 +f 4656 4657 4652 +f 4552 4657 4702 +f 4703 4704 4659 +f 4704 4701 4656 +f 4656 4659 4704 +f 4657 4552 4541 +f 4701 4702 4657 +f 4705 4706 4702 +f 4707 4705 4701 +f 4702 4701 4705 +f 4702 4557 4552 +f 4701 4704 4707 +f 4557 4702 4706 +f 4666 4708 4709 +f 4708 4666 4664 +f 4663 4710 4711 +f 4709 4660 4666 +f 4711 4664 4663 +f 4658 4660 4709 +f 4664 4711 4708 +f 4710 4663 4665 +f 4704 4703 4690 +f 4691 4709 4708 +f 4659 4658 4703 +f 4709 4703 4658 +f 4703 4709 4691 +f 4691 4690 4703 +f 4690 4707 4704 +f 4708 4687 4691 +f 4712 4711 4710 +f 4711 4712 4687 +f 4687 4708 4711 +f 4688 4687 4712 +f 4297 4296 4700 +f 4713 4714 4715 +f 4716 4713 4717 +f 4715 4717 4713 +f 4716 4686 4685 +f 4713 4716 4718 +f 4714 4713 4719 +f 4720 4671 4289 +f 4289 4293 4720 +f 4721 4720 4293 +f 4293 4294 4721 +f 4718 4685 4671 +f 4685 4718 4716 +f 4671 4720 4718 +f 4719 4718 4720 +f 4677 4722 4723 +f 4722 4677 4676 +f 4670 4671 4685 +f 4723 4724 4677 +f 4676 4686 4722 +f 4725 4724 4723 +f 4684 4685 4686 +f 4726 4723 4722 +f 4686 4716 4727 +f 4728 4723 4726 +f 4722 4727 4726 +f 4723 4728 4725 +f 4727 4722 4686 +f 4720 4721 4719 +f 4729 4721 4294 +f 4730 4719 4721 +f 4294 4298 4729 +f 4719 4730 4714 +f 4718 4719 4713 +f 4721 4729 4730 +f 4727 4717 4731 +f 4731 4726 4727 +f 4732 4726 4731 +f 4717 4727 4716 +f 4726 4732 4728 +f 4731 4733 4732 +f 4734 4735 4733 +f 4733 4731 4734 +f 4734 4731 4717 +f 4717 4715 4734 +f 4710 4736 4712 +f 4688 4712 4736 +f 4736 4737 4688 +f 4737 4736 4738 +f 4738 4739 4737 +f 4665 4740 4738 +f 4738 4741 4665 +f 4665 4741 4710 +f 4681 4740 4665 +f 4739 4738 4740 +f 4736 4710 4741 +f 4741 4738 4736 +f 4681 4742 4740 +f 4733 4735 4743 +f 4728 4743 4725 +f 4744 4724 4725 +f 4728 4732 4743 +f 4681 4677 4724 +f 4733 4743 4732 +f 4745 4744 4743 +f 4743 4735 4746 +f 4681 4744 4745 +f 4724 4744 4681 +f 4725 4743 4744 +f 4747 4748 4749 +f 4351 4750 4352 +f 4190 4352 4751 +f 4751 4197 4190 +f 4750 4751 4352 +f 4750 4749 4751 +f 4749 4748 4751 +f 4351 4752 4753 +f 4753 4750 4351 +f 4353 4752 4351 +f 4750 4753 4754 +f 4755 4754 4753 +f 4756 4757 4754 +f 4747 4757 4756 +f 4754 4749 4750 +f 4754 4757 4749 +f 4749 4757 4747 +f 4753 4758 4755 +f 4755 4758 4759 +f 4353 4361 4760 +f 4760 4752 4353 +f 4752 4760 4758 +f 4758 4753 4752 +f 4362 4761 4760 +f 4761 4362 4402 +f 4402 4762 4761 +f 4760 4361 4362 +f 4763 4759 4764 +f 4761 4759 4758 +f 4759 4761 4762 +f 4762 4764 4759 +f 4758 4760 4761 +f 4756 4755 4763 +f 4756 4765 4747 +f 4765 4756 4766 +f 4766 4767 4765 +f 4754 4755 4756 +f 4759 4763 4755 +f 4766 4763 4768 +f 4767 4766 4769 +f 4770 4767 4771 +f 4763 4766 4756 +f 4764 4768 4763 +f 4197 4751 4772 +f 4772 4198 4197 +f 4751 4748 4773 +f 4773 4772 4751 +f 4774 4775 4747 +f 4748 4747 4775 +f 4775 4773 4748 +f 4773 4776 4777 +f 4776 4773 4775 +f 4775 4778 4776 +f 4779 4778 4775 +f 4777 4772 4773 +f 4198 4772 4777 +f 4777 4201 4198 +f 4765 4767 4780 +f 4780 4774 4765 +f 4747 4765 4774 +f 4770 4781 4780 +f 4770 4780 4767 +f 4775 4774 4779 +f 4782 4783 4780 +f 4774 4780 4783 +f 4783 4779 4774 +f 4784 4785 4780 +f 4785 4784 4786 +f 4780 4781 4784 +f 4787 4785 4788 +f 4788 4785 4786 +f 4780 4785 4782 +f 4785 4787 4789 +f 4789 4782 4785 +f 4790 4791 4792 +f 4408 4792 4791 +f 4791 4405 4408 +f 4303 4300 4791 +f 4405 4791 4300 +f 4300 4277 4405 +f 4793 4792 4794 +f 4795 4793 4796 +f 4794 4796 4793 +f 4797 4796 4798 +f 4799 4798 4796 +f 4800 4790 4793 +f 4792 4793 4790 +f 4792 4408 4472 +f 4799 4473 4474 +f 4474 4801 4799 +f 3831 4801 4474 +f 4474 3836 3831 +f 4794 4472 4473 +f 4473 4799 4794 +f 4798 4799 4801 +f 4796 4794 4799 +f 4801 3831 3838 +f 4472 4794 4792 +f 4791 4790 4303 +f 4306 4305 4800 +f 4790 4800 4305 +f 4305 4303 4790 +f 4802 4795 4797 +f 4796 4797 4795 +f 4803 4797 4804 +f 4805 4800 4795 +f 4793 4795 4800 +f 4762 4402 4418 +f 4418 4806 4762 +f 4764 4762 4806 +f 4806 4807 4764 +f 4806 4418 4403 +f 4403 4808 4806 +f 4807 4806 4808 +f 4808 4809 4807 +f 4809 4808 4275 +f 4275 4301 4809 +f 4808 4403 4276 +f 4276 4275 4808 +f 4810 4811 4769 +f 4768 4764 4807 +f 4807 4810 4768 +f 4810 4807 4809 +f 4769 4768 4810 +f 4811 4810 4812 +f 4809 4812 4810 +f 4301 4302 4812 +f 4812 4809 4301 +f 4798 4804 4797 +f 4801 4813 4798 +f 4813 3838 3819 +f 4804 4798 4813 +f 4813 4814 4804 +f 3838 4813 4801 +f 3819 4814 4813 +f 4815 4804 4814 +f 4814 4816 4815 +f 3822 4816 4814 +f 4814 3819 3822 +f 4797 4803 4802 +f 4804 4815 4803 +f 4795 4802 4805 +f 4817 4306 4818 +f 4818 4819 4817 +f 4818 4306 4805 +f 4800 4805 4306 +f 4820 4818 4805 +f 4805 4802 4821 +f 4821 4822 4805 +f 4818 4820 4823 +f 4815 4824 4825 +f 4803 4825 4821 +f 4821 4802 4803 +f 4805 4822 4820 +f 4825 4803 4815 +f 4477 4826 4475 +f 3822 3845 4475 +f 4477 4481 4826 +f 4475 4816 3822 +f 4824 4826 4827 +f 4824 4815 4816 +f 4826 4824 4475 +f 4816 4475 4824 +f 4821 4828 4829 +f 4830 4831 4820 +f 4821 4830 4822 +f 4831 4830 4829 +f 4829 4828 4831 +f 4820 4822 4830 +f 4829 4830 4821 +f 4827 4825 4824 +f 4832 4831 4828 +f 4823 4820 4831 +f 4833 4828 4821 +f 4821 4825 4833 +f 4827 4833 4825 +f 4826 4834 4827 +f 4828 4833 4832 +f 4831 4832 4823 +f 4835 4836 4837 +f 4837 4836 4838 +f 4838 4489 4837 +f 4479 4839 4481 +f 4481 4480 4479 +f 4834 4826 4481 +f 4489 4838 4839 +f 4839 4479 4489 +f 4818 4840 4841 +f 4842 4843 4844 +f 4843 4842 4845 +f 4839 4845 4842 +f 4823 4840 4818 +f 4845 4839 4838 +f 4817 4846 4308 +f 4819 4841 4846 +f 4834 4844 4833 +f 4833 4827 4834 +f 4844 4834 4842 +f 4481 4842 4834 +f 4842 4481 4839 +f 4781 4770 4847 +f 4768 4769 4766 +f 4771 4847 4770 +f 4769 4771 4767 +f 4771 4769 4811 +f 4811 4848 4771 +f 4847 4771 4848 +f 4848 4849 4850 +f 4849 4851 4850 +f 4851 4852 4850 +f 4852 4851 4309 +f 4309 4311 4852 +f 4311 4312 4852 +f 4312 4316 4852 +f 4853 4812 4302 +f 4853 4849 4848 +f 4853 4854 4848 +f 4302 4307 4853 +f 4849 4853 4307 +f 4812 4853 4811 +f 4848 4811 4853 +f 4307 4313 4849 +f 4313 4310 4849 +f 4851 4849 4310 +f 4310 4309 4851 +f 4855 4856 4857 +f 4857 4858 4855 +f 4859 4855 4858 +f 4858 4857 4860 +f 4861 4858 4862 +f 4863 4864 4865 +f 4856 4863 4865 +f 4865 4857 4856 +f 4866 4867 4850 +f 4848 4850 4847 +f 4868 4866 4864 +f 4850 4864 4866 +f 4867 4847 4850 +f 4850 4848 4854 +f 4869 4870 4864 +f 4869 4850 4852 +f 4870 4865 4864 +f 4864 4850 4869 +f 4491 4837 4490 +f 4837 4491 4835 +f 4555 4491 4486 +f 4490 4837 4489 +f 4483 4489 4479 +f 4871 4555 4553 +f 4860 4872 4555 +f 4553 4554 4871 +f 4872 4835 4491 +f 4555 4871 4860 +f 4491 4555 4872 +f 4554 4556 4873 +f 4558 4873 4556 +f 4862 4860 4871 +f 4873 4871 4554 +f 4871 4873 4862 +f 4874 4862 4873 +f 4873 4558 4874 +f 4865 4870 4835 +f 4857 4865 4872 +f 4860 4862 4858 +f 4862 4874 4861 +f 4835 4872 4865 +f 4872 4860 4857 +f 4869 4852 4316 +f 4875 4316 4876 +f 4870 4869 4836 +f 4316 4875 4869 +f 4875 4838 4836 +f 4836 4835 4870 +f 4838 4875 4845 +f 4836 4869 4875 +f 4845 4876 4843 +f 4876 4845 4875 +f 4846 4817 4819 +f 4841 4819 4818 +f 4308 4306 4817 +f 4846 4877 4318 +f 4318 4308 4846 +f 4841 4878 4877 +f 4877 4846 4841 +f 4840 4879 4878 +f 4878 4841 4840 +f 4880 4315 4322 +f 4319 4881 4882 +f 4882 4320 4319 +f 4320 4882 4883 +f 4883 4322 4320 +f 4866 4868 4784 +f 4867 4866 4781 +f 4847 4867 4781 +f 4784 4781 4866 +f 4788 4786 4884 +f 4786 4784 4868 +f 4868 4884 4786 +f 4884 4868 4863 +f 4885 4886 4856 +f 4856 4855 4885 +f 4887 4885 4855 +f 4864 4863 4868 +f 4886 4884 4863 +f 4863 4856 4886 +f 4888 4788 4886 +f 4886 4885 4888 +f 4889 4888 4885 +f 4884 4886 4788 +f 4788 4888 4787 +f 4890 4891 4892 +f 4893 4894 4895 +f 4892 4895 4890 +f 4891 4890 4314 +f 4323 4321 4896 +f 4897 4896 4321 +f 4321 4317 4897 +f 4890 4897 4317 +f 4317 4314 4890 +f 4898 4896 4899 +f 4900 4899 4896 +f 4894 4901 4900 +f 4900 4895 4894 +f 4896 4897 4900 +f 4895 4900 4897 +f 4897 4890 4895 +f 4902 4903 4901 +f 4901 4894 4902 +f 4904 4905 4906 +f 4899 4900 4901 +f 4907 4903 4904 +f 4901 4908 4899 +f 4908 4901 4903 +f 4903 4907 4908 +f 4904 4909 4907 +f 4910 4899 4908 +f 4911 4907 4909 +f 4906 4909 4904 +f 4909 4906 4912 +f 4913 4908 4907 +f 4908 4913 4910 +f 4912 4914 4909 +f 4907 4911 4913 +f 4909 4914 4911 +f 4915 4916 4917 +f 4918 4883 4882 +f 4919 4920 4916 +f 4880 4322 4883 +f 4881 4916 4920 +f 4882 4920 4918 +f 4921 4918 4920 +f 4920 4882 4881 +f 4880 4922 4843 +f 4922 4883 4918 +f 4922 4880 4883 +f 4843 4876 4880 +f 4315 4880 4876 +f 4876 4316 4315 +f 4923 4922 4918 +f 4891 4318 4879 +f 4314 4318 4891 +f 4924 4891 4879 +f 4925 4879 4840 +f 4877 4878 4879 +f 4879 4318 4877 +f 4895 4892 4893 +f 4926 4927 4928 +f 4894 4893 4929 +f 4929 4902 4894 +f 4902 4929 4926 +f 4928 4930 4926 +f 4905 4904 4930 +f 4930 4928 4905 +f 4926 4930 4902 +f 4903 4902 4930 +f 4930 4904 4903 +f 4924 4931 4892 +f 4879 4925 4924 +f 4931 4932 4893 +f 4893 4892 4931 +f 4893 4932 4933 +f 4933 4929 4893 +f 4892 4891 4924 +f 4934 4921 4933 +f 4833 4935 4936 +f 4923 4934 4833 +f 4936 4832 4833 +f 4935 4833 4934 +f 4925 4823 4832 +f 4832 4936 4925 +f 4932 4931 4934 +f 4934 4931 4935 +f 4934 4933 4932 +f 4931 4937 4938 +f 4931 4924 4937 +f 4937 4936 4935 +f 4935 4938 4937 +f 4924 4925 4936 +f 4936 4937 4924 +f 4931 4938 4935 +f 4922 4923 4844 +f 4844 4843 4922 +f 4934 4923 4921 +f 4840 4823 4925 +f 4833 4844 4923 +f 4923 4918 4921 +f 4939 4915 4940 +f 4920 4919 4921 +f 4933 4921 4919 +f 4940 4941 4939 +f 4942 4919 4915 +f 4916 4915 4919 +f 4912 4906 4943 +f 4905 4943 4906 +f 4942 4926 4929 +f 4944 4943 4928 +f 4905 4928 4943 +f 4943 4927 4926 +f 4915 4939 4942 +f 4929 4933 4942 +f 4945 4943 4942 +f 4919 4942 4933 +f 4926 4942 4943 +f 4945 4912 4943 +f 4946 4945 4947 +f 4946 4948 4945 +f 4949 4945 4948 +f 4949 4912 4945 +f 4950 4951 4952 +f 4952 4585 4226 +f 4226 4239 4952 +f 4953 4952 4239 +f 4951 4588 4585 +f 4585 4588 4584 +f 4585 4952 4951 +f 4216 4226 4585 +f 4951 4950 4954 +f 4952 4953 4950 +f 4955 4953 4241 +f 4241 4243 4955 +f 4950 4956 4957 +f 4956 4950 4953 +f 4953 4955 4956 +f 4239 4241 4953 +f 4958 4959 4960 +f 4961 4962 4960 +f 4960 4959 4961 +f 4957 4954 4950 +f 4963 4964 4954 +f 4965 4954 4964 +f 4954 4957 4963 +f 4966 4964 4967 +f 4968 4967 4964 +f 4964 4963 4968 +f 4588 4951 4965 +f 4965 4586 4588 +f 4966 4587 4586 +f 4586 4965 4966 +f 4964 4966 4965 +f 4587 4966 4969 +f 4954 4965 4951 +f 4970 4971 4972 +f 4591 4972 4971 +f 4971 4595 4591 +f 4972 4973 4970 +f 4589 4972 4591 +f 4962 4972 4589 +f 4699 4974 4337 +f 4698 4975 4974 +f 4974 4699 4698 +f 4595 4971 4975 +f 4975 4698 4595 +f 4975 4976 4977 +f 4977 4974 4975 +f 4971 4970 4976 +f 4976 4975 4971 +f 4978 4977 4976 +f 4979 4976 4980 +f 4974 4977 4338 +f 4981 4982 4983 +f 4984 4982 4707 +f 4980 4985 4986 +f 4986 4983 4982 +f 4982 4984 4986 +f 4979 4986 4984 +f 4986 4979 4980 +f 4976 4979 4978 +f 4338 4337 4974 +f 4338 4987 4988 +f 4977 4978 4987 +f 4987 4338 4977 +f 4707 4690 4984 +f 4982 4981 4705 +f 4705 4707 4982 +f 4981 4989 4706 +f 4706 4705 4981 +f 4706 4558 4557 +f 4989 4874 4558 +f 4558 4706 4989 +f 4689 4688 4978 +f 4978 4979 4689 +f 4984 4689 4979 +f 4689 4984 4690 +f 4858 4861 4859 +f 4990 4859 4861 +f 4861 4991 4990 +f 4992 4983 4993 +f 4993 4990 4992 +f 4991 4992 4990 +f 4991 4861 4874 +f 4874 4989 4991 +f 4983 4992 4981 +f 4992 4991 4989 +f 4989 4981 4992 +f 4976 4980 4994 +f 4336 4995 4996 +f 4338 4997 4995 +f 4336 4338 4977 +f 4995 4336 4338 +f 4994 4977 4976 +f 4977 4994 4336 +f 4996 4334 4336 +f 4998 4962 4961 +f 4998 4961 4999 +f 4999 5000 4998 +f 4961 4959 5001 +f 5001 4999 4961 +f 4962 4998 5002 +f 5000 4999 5003 +f 5003 4985 5000 +f 4985 5003 4986 +f 4983 4986 5003 +f 5003 4993 4983 +f 5004 5000 4985 +f 4985 4980 5004 +f 4993 5003 4999 +f 5005 4970 4973 +f 5004 5005 5006 +f 4970 5005 4980 +f 4980 4976 4970 +f 5005 5004 4980 +f 4973 5006 5005 +f 4973 4962 5006 +f 5002 4998 5000 +f 5002 5006 4962 +f 5000 5004 5002 +f 5006 5002 5004 +f 4855 4859 4887 +f 4859 4990 5007 +f 4319 5008 4881 +f 5008 4324 5009 +f 5008 4319 4324 +f 5007 4887 4859 +f 5001 5007 4990 +f 4990 4993 5001 +f 4999 5001 4993 +f 5007 5001 4959 +f 4887 5007 4958 +f 4959 4958 5007 +f 4958 4960 4889 +f 4885 4887 4889 +f 4958 4889 4887 +f 4328 5010 5011 +f 5011 4327 4328 +f 5009 4324 4327 +f 5010 4334 4996 +f 4327 5011 5009 +f 5010 4328 4334 +f 5012 5009 5011 +f 4917 5009 5012 +f 5008 4917 4916 +f 4916 4881 5008 +f 5012 5011 5010 +f 4917 5008 5009 +f 4787 4888 4889 +f 4889 4960 4787 +f 4325 4323 4898 +f 4789 4787 4960 +f 4960 5013 4789 +f 4896 4898 4323 +f 4910 5014 5015 +f 5015 4898 4910 +f 4899 4910 4898 +f 4898 5015 4325 +f 5014 4910 4913 +f 4949 5016 4914 +f 4914 4912 4949 +f 4911 5017 5018 +f 4913 5018 5014 +f 5018 4913 4911 +f 5017 4911 4914 +f 4914 5016 5017 +f 5019 5020 4331 +f 4331 4329 5019 +f 5015 5019 4329 +f 5014 5021 5019 +f 4329 4325 5015 +f 5019 5015 5014 +f 5017 5022 5023 +f 5023 5018 5017 +f 5022 5017 5016 +f 5018 5023 5021 +f 5021 5014 5018 +f 5024 5023 5022 +f 5025 5026 5027 +f 5028 5029 5026 +f 5010 5030 5012 +f 5030 5010 4996 +f 5030 4996 4995 +f 5031 5030 5032 +f 4332 5027 4330 +f 4946 5033 5034 +f 5034 5033 5035 +f 5034 4948 4946 +f 4948 5034 5016 +f 5016 4949 4948 +f 5016 5034 5022 +f 5035 5022 5034 +f 5036 5037 5024 +f 5023 5024 5037 +f 5037 5021 5023 +f 5038 5020 5037 +f 5021 5037 5020 +f 5020 5019 5021 +f 5022 5035 5024 +f 5039 5024 5035 +f 5035 5040 5039 +f 5040 5035 5033 +f 5033 4946 4947 +f 5033 5041 5040 +f 4947 5041 5033 +f 5042 5012 5030 +f 4940 4917 5012 +f 5043 5042 5030 +f 4940 5012 5042 +f 5031 5044 5045 +f 5045 5043 5031 +f 5042 5043 4940 +f 4917 4940 4915 +f 5030 5031 5043 +f 5046 5045 5044 +f 5045 5046 4939 +f 5043 5045 4941 +f 4941 4940 5043 +f 4942 5046 4945 +f 4942 4939 5046 +f 4939 4941 5045 +f 4988 4997 4338 +f 4688 4987 4978 +f 4337 4297 4699 +f 4997 5047 5032 +f 5032 4995 4997 +f 4997 4988 5048 +f 5048 5047 4997 +f 4995 5032 5030 +f 4987 4688 4737 +f 4737 4988 4987 +f 4740 4742 5049 +f 5049 5050 4740 +f 4740 5050 4739 +f 5048 4739 5050 +f 5050 5049 5048 +f 4988 4737 4739 +f 4739 5048 4988 +f 5047 5048 5049 +f 5051 5032 5047 +f 5052 5051 5053 +f 5047 5053 5051 +f 4298 4299 5054 +f 4299 4339 5055 +f 4969 4589 4587 +f 5054 4729 4298 +f 5056 5055 4339 +f 5055 5054 4299 +f 5057 5058 5054 +f 5058 4730 4729 +f 4729 5054 5058 +f 5054 5055 5057 +f 4730 5058 5059 +f 5060 5061 5062 +f 5063 5064 5065 +f 5061 5060 5066 +f 5066 5067 5068 +f 5062 5065 5060 +f 5069 4734 4715 +f 5070 5059 5058 +f 4714 5059 5071 +f 5071 4715 4714 +f 5072 5071 5059 +f 4715 5071 5069 +f 5059 4714 4730 +f 5059 5070 5072 +f 5070 5062 5061 +f 5061 5072 5070 +f 5063 5057 5055 +f 5055 5056 5063 +f 5058 5057 5070 +f 5062 5070 5057 +f 5057 5063 5062 +f 5053 5049 4742 +f 4742 5073 5053 +f 5049 5053 5047 +f 5053 5073 5052 +f 5074 5073 4742 +f 5066 5075 5061 +f 5072 5061 5075 +f 5075 5068 5076 +f 5068 5075 5066 +f 5076 4746 5077 +f 5076 5078 5075 +f 5075 5078 5072 +f 4735 5077 4746 +f 4735 4734 5069 +f 5069 5077 4735 +f 5077 5069 5078 +f 5078 5069 5071 +f 5078 5076 5077 +f 5071 5072 5078 +f 5076 5068 4746 +f 4745 5066 5060 +f 4746 5067 5066 +f 5067 4746 5068 +f 5060 5074 4745 +f 5066 4745 4746 +f 4743 4746 4745 +f 5074 4742 4681 +f 5079 5073 5074 +f 4681 4745 5074 +f 4973 4972 4962 +f 4960 4962 4969 +f 4589 4969 4962 +f 4339 4341 5056 +f 4967 4969 4966 +f 5013 4960 4967 +f 4333 4331 5020 +f 4967 4968 5013 +f 4969 4967 4960 +f 5080 5028 5038 +f 5037 5036 5038 +f 5020 5038 4333 +f 5028 5025 4332 +f 4332 4333 5028 +f 5028 4333 5038 +f 5026 5025 5028 +f 5027 4332 5025 +f 5024 5039 5036 +f 5052 5081 5044 +f 5051 5052 5044 +f 5032 5051 5031 +f 5082 5083 5084 +f 5085 5052 5083 +f 5044 5031 5051 +f 5081 5039 5040 +f 5038 5036 5086 +f 5086 5036 5039 +f 5087 5040 5041 +f 5046 5041 4947 +f 5039 5081 5086 +f 5038 5088 5080 +f 5041 5046 5087 +f 5040 5087 5081 +f 4947 4945 5046 +f 5086 5088 5038 +f 5052 5085 5086 +f 5083 5082 5085 +f 5052 5086 5081 +f 5084 5080 5082 +f 5044 5087 5046 +f 5044 5081 5087 +f 5089 5088 5086 +f 5080 5088 5089 +f 5090 5085 5082 +f 5082 5089 5090 +f 5089 5082 5080 +f 5086 5090 5089 +f 5085 5090 5086 +f 5091 5056 4341 +f 5064 5063 5056 +f 5065 5062 5063 +f 5056 5091 5064 +f 5091 4340 5092 +f 4341 4340 5091 +f 5092 4340 5093 +f 5093 5094 5092 +f 5095 5091 5092 +f 5065 5079 5074 +f 5074 5060 5065 +f 5065 5064 5096 +f 5092 5097 5095 +f 5064 5091 5095 +f 5095 5096 5064 +f 5096 5079 5065 +f 5052 5098 5099 +f 5097 5084 5083 +f 5083 5099 5097 +f 5099 5083 5052 +f 5096 5098 5052 +f 5079 5052 5073 +f 5052 5079 5096 +f 5095 5097 5099 +f 5096 5100 5098 +f 5099 5101 5095 +f 5101 5099 5098 +f 5096 5095 5101 +f 5098 5100 5101 +f 5096 5101 5100 +f 5093 5027 5026 +f 5027 5093 4340 +f 5029 5092 5094 +f 5097 5092 5029 +f 5094 5026 5029 +f 4340 4330 5027 +f 5084 5029 5028 +f 5026 5094 5093 +f 5028 5080 5084 +f 5029 5084 5097 diff --git a/dep/recastnavigation/RecastDemo/Bin/Meshes/nav_test.obj b/dep/recastnavigation/RecastDemo/Bin/Meshes/nav_test.obj new file mode 100644 index 000000000..1d4c595cd --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Bin/Meshes/nav_test.obj @@ -0,0 +1,3506 @@ +mtllib nav_test.mtl +o nav_test.obj +v -21.847065 -2.492895 19.569759 +v -15.847676 -2.492895 18.838863 +v -21.847065 -0.895197 19.569759 +v -15.847676 -0.895197 18.838863 +v -21.585381 -2.492895 21.717730 +v -15.585992 -2.492895 20.986834 +v -21.585381 -0.895197 21.717730 +v -15.585992 -0.895197 20.986834 +v -22.078766 -1.169756 17.667891 +v -16.079414 -1.169756 16.936998 +v -22.078766 0.427928 17.667891 +v -16.079414 0.427928 16.936998 +v -21.817081 -1.169756 19.815861 +v -15.817731 -1.169756 19.084969 +v -21.817081 0.427928 19.815861 +v -15.817731 0.427928 19.084969 +v -22.310509 0.142680 15.765698 +v -16.311157 0.142680 15.034807 +v -22.310509 1.740365 15.765698 +v -16.311157 1.740365 15.034807 +v -22.048828 0.142680 17.913649 +v -16.049477 0.142680 17.182758 +v -22.048828 1.740365 17.913649 +v -16.049477 1.740365 17.182758 +v -22.541557 1.588395 13.869190 +v -16.542206 1.588395 13.138299 +v -22.541557 3.186100 13.869190 +v -16.542206 3.186100 13.138299 +v -22.279873 1.588395 16.017160 +v -16.280521 1.588395 15.286268 +v -22.279873 3.186100 16.017160 +v -16.280521 3.186100 15.286268 +v -22.775589 2.892463 11.948195 +v -16.776237 2.892463 11.217304 +v -22.775589 4.490149 11.948195 +v -16.776237 4.490149 11.217304 +v -22.513905 2.892463 14.096166 +v -16.514553 2.892463 13.365274 +v -22.513905 4.490149 14.096166 +v -16.514553 4.490149 13.365274 +v -23.008904 4.280072 10.033092 +v -17.009552 4.280072 9.302201 +v -23.008904 5.877757 10.033092 +v -17.009552 5.877757 9.302201 +v -22.747219 4.280072 12.181063 +v -16.747868 4.280072 11.450171 +v -22.747219 5.877757 12.181063 +v -16.747868 5.877757 11.450171 +v -23.234169 5.535265 8.184037 +v -17.234818 5.535265 7.453146 +v -23.234169 7.132950 8.184037 +v -17.234818 7.132950 7.453146 +v -22.972485 5.535265 10.332007 +v -16.973133 5.535265 9.601116 +v -22.972485 7.132950 10.332007 +v -16.973133 7.132950 9.601116 +vn -0.642934 -0.577350 -0.503291 +vn 0.503291 -0.577350 -0.642934 +vn -0.642934 0.577350 -0.503291 +vn 0.503291 0.577350 -0.642934 +vn -0.503291 -0.577350 0.642934 +vn 0.642934 -0.577350 0.503291 +vn -0.503291 0.577350 0.642934 +vn 0.642934 0.577350 0.503291 +vn -0.642934 -0.577350 -0.503291 +vn 0.503291 -0.577350 -0.642934 +vn -0.642934 0.577350 -0.503291 +vn 0.503291 0.577350 -0.642934 +vn -0.503291 -0.577350 0.642934 +vn 0.642934 -0.577350 0.503291 +vn -0.503291 0.577350 0.642934 +vn 0.642934 0.577350 0.503291 +vn -0.642934 -0.577350 -0.503292 +vn 0.503291 -0.577350 -0.642934 +vn -0.642934 0.577350 -0.503292 +vn 0.503291 0.577350 -0.642934 +vn -0.503292 -0.577350 0.642934 +vn 0.642934 -0.577350 0.503292 +vn -0.503292 0.577350 0.642934 +vn 0.642934 0.577350 0.503292 +vn -0.642934 -0.577350 -0.503291 +vn 0.503291 -0.577350 -0.642934 +vn -0.642934 0.577350 -0.503291 +vn 0.503291 0.577350 -0.642934 +vn -0.503291 -0.577350 0.642934 +vn 0.642934 -0.577350 0.503291 +vn -0.503291 0.577350 0.642934 +vn 0.642934 0.577350 0.503291 +vn -0.642934 -0.577350 -0.503291 +vn 0.503291 -0.577350 -0.642934 +vn -0.642934 0.577350 -0.503291 +vn 0.503291 0.577350 -0.642934 +vn -0.503291 -0.577350 0.642934 +vn 0.642934 -0.577350 0.503291 +vn -0.503291 0.577350 0.642934 +vn 0.642934 0.577350 0.503291 +vn -0.642934 -0.577350 -0.503291 +vn 0.503291 -0.577350 -0.642934 +vn -0.642934 0.577350 -0.503291 +vn 0.503291 0.577350 -0.642934 +vn -0.503291 -0.577350 0.642934 +vn 0.642934 -0.577350 0.503291 +vn -0.503291 0.577350 0.642934 +vn 0.642934 0.577350 0.503291 +vn -0.642934 -0.577350 -0.503291 +vn 0.503291 -0.577350 -0.642934 +vn -0.642934 0.577350 -0.503291 +vn 0.503291 0.577350 -0.642934 +vn -0.503291 -0.577350 0.642934 +vn 0.642934 -0.577350 0.503291 +vn -0.503291 0.577350 0.642934 +vn 0.642934 0.577350 0.503291 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +g Generic +usemtl Default +f 4/1/4 2/2/2 1/3/1 3/4/3 +f 6/5/6 8/6/8 7/7/7 5/8/5 +f 6/5/6 5/8/5 1/3/1 2/2/2 +f 8/6/8 6/5/6 2/2/2 4/1/4 +f 7/7/7 8/6/8 4/1/4 3/4/3 +f 5/8/5 7/7/7 3/4/3 1/3/1 +f 12/9/12 10/10/10 9/11/9 11/12/11 +f 14/13/14 16/14/16 15/15/15 13/16/13 +f 14/13/14 13/16/13 9/11/9 10/10/10 +f 16/14/16 14/13/14 10/10/10 12/9/12 +f 15/15/15 16/14/16 12/9/12 11/12/11 +f 13/16/13 15/15/15 11/12/11 9/11/9 +f 20/17/20 18/18/18 17/19/17 19/20/19 +f 22/21/22 24/22/24 23/23/23 21/24/21 +f 22/21/22 21/24/21 17/19/17 18/18/18 +f 24/22/24 22/21/22 18/18/18 20/17/20 +f 23/23/23 24/22/24 20/17/20 19/20/19 +f 21/24/21 23/23/23 19/20/19 17/19/17 +f 28/25/28 26/26/26 25/27/25 27/28/27 +f 30/29/30 32/30/32 31/31/31 29/32/29 +f 30/29/30 29/32/29 25/27/25 26/26/26 +f 32/30/32 30/29/30 26/26/26 28/25/28 +f 31/31/31 32/30/32 28/25/28 27/28/27 +f 29/32/29 31/31/31 27/28/27 25/27/25 +f 36/33/36 34/34/34 33/35/33 35/36/35 +f 38/37/38 40/38/40 39/39/39 37/40/37 +f 38/37/38 37/40/37 33/35/33 34/34/34 +f 40/38/40 38/37/38 34/34/34 36/33/36 +f 39/39/39 40/38/40 36/33/36 35/36/35 +f 37/40/37 39/39/39 35/36/35 33/35/33 +f 44/41/44 42/42/42 41/43/41 43/44/43 +f 46/45/46 48/46/48 47/47/47 45/48/45 +f 46/45/46 45/48/45 41/43/41 42/42/42 +f 48/46/48 46/45/46 42/42/42 44/41/44 +f 47/47/47 48/46/48 44/41/44 43/44/43 +f 45/48/45 47/47/47 43/44/43 41/43/41 +f 52/49/52 50/50/50 49/51/49 51/52/51 +f 54/53/54 56/54/56 55/55/55 53/56/53 +f 54/53/54 53/56/53 49/51/49 50/50/50 +f 56/54/56 54/53/54 50/50/50 52/49/52 +f 55/55/55 56/54/56 52/49/52 51/52/51 +f 53/56/53 55/55/55 51/52/51 49/51/49 +v -28.889317 -3.557970 -20.236633 +v 21.065487 -3.557970 -26.322546 +v -28.889317 -2.370904 -20.236633 +v 21.065487 -2.370904 -26.322546 +v -22.640766 -3.557970 31.053141 +v 27.314037 -3.557970 24.967228 +v -22.640766 -2.370904 31.053141 +v 27.314037 -2.370904 24.967228 +v -11.345862 -3.554139 -0.603272 +v -1.840215 -3.554139 -1.761330 +v -2.998272 -3.554139 -11.266972 +v -12.503919 -3.554139 -10.108913 +v -11.345862 -2.367074 -0.603272 +v -1.840215 -2.367074 -1.761330 +v -2.998272 -2.367074 -11.266972 +v -12.503919 -2.367074 -10.108913 +v 14.880527 -2.365568 6.393913 +v 16.038584 -2.365752 15.899554 +v 6.532944 -2.365750 17.057611 +v 5.374887 -2.364530 7.551970 +v 6.532944 -3.552818 17.057611 +v 16.038584 -3.552819 15.899554 +v 14.880527 -3.552633 6.393913 +v 5.374887 -3.551598 7.551970 +v 1.032586 -2.363936 21.819389 +v -8.473061 -2.364388 22.977446 +v -9.631113 -2.364505 13.471843 +v -9.631113 -3.550801 13.471843 +v -8.473061 -3.551456 22.977446 +v 1.032586 -3.551004 21.819389 +v -0.125466 -2.361971 12.313786 +v -0.125466 -3.549039 12.313786 +vn -0.262337 -0.942870 -0.205369 +vn 0.205367 -0.942875 -0.262320 +vn -0.262635 0.942746 -0.205554 +vn 0.205639 0.942742 -0.262583 +vn -0.355815 -0.816687 0.454332 +vn 0.335634 -0.904611 0.262733 +vn -0.355909 0.816255 0.455034 +vn 0.335918 0.904340 0.263302 +vn 0.262962 -0.904544 -0.335637 +vn -0.335745 -0.904605 -0.262612 +vn -0.355807 -0.816428 0.454804 +vn 0.454699 -0.816419 0.355963 +vn 0.262672 0.904546 -0.335856 +vn -0.335747 0.904495 -0.262988 +vn -0.355864 0.816560 0.454522 +vn 0.454548 0.816575 0.355798 +vn -0.355652 0.816607 0.454604 +vn -0.454443 0.816647 -0.355766 +vn 0.356082 0.816529 -0.454407 +vn 0.262653 0.942785 0.205353 +vn 0.355755 -0.816589 -0.454555 +vn -0.454803 -0.816488 -0.355671 +vn -0.356080 -0.816394 0.454651 +vn 0.262333 -0.942818 0.205610 +vn -0.335659 0.904720 -0.262326 +vn 0.355853 0.816737 -0.454212 +vn 0.335572 0.904622 0.262774 +vn 0.335908 -0.904451 0.262933 +vn 0.355947 -0.816306 -0.454914 +vn -0.335871 -0.904446 -0.262999 +vn -0.262777 0.904593 0.335648 +vn -0.262932 -0.904466 0.335869 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +g Generic +usemtl Default +f 60/57/60 58/58/58 57/59/57 59/60/59 +f 62/61/62 64/62/64 63/63/63 61/64/61 +f 64/62/64 62/61/62 58/58/58 60/57/60 +f 61/64/61 63/63/63 59/60/59 57/59/57 +f 67/65/67 71/66/71 72/67/72 68/68/68 +f 70/69/70 66/70/66 65/71/65 69/72/69 +f 66/70/66 70/69/70 71/66/71 67/65/67 +f 69/72/69 65/71/65 68/68/68 72/67/72 +f 79/73/79 73/74/73 76/75/76 80/76/80 +f 74/77/74 78/78/78 77/79/77 75/80/75 +f 78/78/78 74/77/74 73/74/73 79/73/79 +f 75/80/75 77/79/77 80/76/80 76/75/76 +f 88/81/88 87/82/87 83/83/83 84/84/84 +f 81/85/81 86/86/86 85/87/85 82/88/82 +f 86/86/86 81/85/81 87/82/87 88/81/88 +f 82/88/82 85/87/85 84/84/84 83/83/83 +f 60/57/60 73/74/73 74/77/74 64/62/64 +f 64/62/64 74/77/74 75/80/75 81/85/81 +f 64/62/64 81/85/81 82/88/82 63/63/63 +f 81/85/81 75/80/75 76/75/76 87/82/87 +f 63/63/63 82/88/82 83/83/83 59/60/59 +f 83/83/83 69/72/69 59/60/59 +f 72/67/72 59/60/59 69/72/69 +f 59/60/59 72/67/72 71/66/71 60/57/60 +f 69/72/69 83/83/83 87/82/87 70/69/70 +f 87/82/87 76/75/76 70/69/70 +f 73/74/73 60/57/60 76/75/76 +f 60/57/60 71/66/71 70/69/70 76/75/76 +f 58/58/58 67/65/67 68/68/68 57/59/57 +f 58/58/58 80/76/80 66/70/66 67/65/67 +f 79/73/79 80/76/80 58/58/58 +f 58/58/58 62/61/62 78/78/78 79/73/79 +f 86/86/86 77/79/77 78/78/78 62/61/62 +f 61/64/61 85/87/85 86/86/86 62/61/62 +f 77/79/77 86/86/86 88/81/88 80/76/80 +f 88/81/88 84/84/84 65/71/65 66/70/66 +f 88/81/88 66/70/66 80/76/80 +f 65/71/65 57/59/57 68/68/68 +f 85/87/85 61/64/61 57/59/57 84/84/84 +f 84/84/84 57/59/57 65/71/65 +v -14.690150 -2.438636 -3.546326 +v -10.279407 -2.438636 0.585510 +v -14.690150 -0.840940 -3.546326 +v -10.279407 -0.840940 0.585510 +v -16.169479 -2.438636 -1.967133 +v -11.758737 -2.438636 2.164704 +v -16.169479 -0.840940 -1.967133 +v -11.758737 -0.840940 2.164704 +v -13.380321 -1.115499 -4.944578 +v -8.969601 -1.115499 -0.812760 +v -13.380321 0.482185 -4.944578 +v -8.969601 0.482185 -0.812760 +v -14.859653 -1.115499 -3.365405 +v -10.448930 -1.115499 0.766433 +v -14.859653 0.482185 -3.365405 +v -10.448930 0.482185 0.766433 +v -12.070254 0.196937 -6.343090 +v -7.659532 0.196937 -2.211254 +v -12.070254 1.794623 -6.343090 +v -7.659532 1.794623 -2.211254 +v -13.549586 0.196937 -4.763898 +v -9.138861 0.196937 -0.632061 +v -13.549586 1.794623 -4.763898 +v -9.138861 1.794623 -0.632061 +v -10.764113 1.642653 -7.737381 +v -6.353393 1.642653 -3.605563 +v -10.764113 3.240357 -7.737381 +v -6.353393 3.240357 -3.605563 +v -12.243443 1.642653 -6.158208 +v -7.832721 1.642653 -2.026372 +v -12.243443 3.240357 -6.158208 +v -7.832721 3.240357 -2.026372 +v -9.441105 2.946721 -9.149704 +v -5.030383 2.946721 -5.017866 +v -9.441105 4.544406 -9.149704 +v -5.030383 4.544406 -5.017866 +v -10.920434 2.946721 -7.570510 +v -6.509713 2.946721 -3.438693 +v -10.920434 4.544406 -7.570510 +v -6.509713 4.544406 -3.438693 +v -8.122141 4.334330 -10.557693 +v -3.711419 4.334330 -6.425856 +v -8.122141 5.932015 -10.557693 +v -3.711419 5.932015 -6.425856 +v -9.601472 4.334330 -8.978500 +v -5.190750 4.334330 -4.846683 +v -9.601472 5.932015 -8.978500 +v -5.190750 5.932015 -4.846683 +v -6.848679 5.589522 -11.917114 +v -2.437950 5.589522 -7.785277 +v -6.848679 7.187207 -11.917114 +v -2.437950 7.187207 -7.785277 +v -8.328009 5.589522 -10.337922 +v -3.917289 5.589522 -6.206105 +v -8.328009 7.187207 -10.337922 +v -3.917289 7.187207 -6.206105 +vn -0.026644 -0.577351 -0.816061 +vn 0.816062 -0.577350 -0.026645 +vn -0.026644 0.577351 -0.816061 +vn 0.816062 0.577350 -0.026645 +vn -0.816062 -0.577350 0.026644 +vn 0.026644 -0.577351 0.816061 +vn -0.816062 0.577350 0.026644 +vn 0.026644 0.577351 0.816061 +vn -0.026641 -0.577349 -0.816063 +vn 0.816062 -0.577350 -0.026644 +vn -0.026641 0.577349 -0.816063 +vn 0.816062 0.577350 -0.026644 +vn -0.816061 -0.577351 0.026640 +vn 0.026643 -0.577351 0.816061 +vn -0.816061 0.577351 0.026640 +vn 0.026643 0.577351 0.816061 +vn -0.026643 -0.577351 -0.816061 +vn 0.816062 -0.577349 -0.026644 +vn -0.026643 0.577351 -0.816061 +vn 0.816062 0.577349 -0.026644 +vn -0.816062 -0.577350 0.026643 +vn 0.026644 -0.577351 0.816061 +vn -0.816062 0.577350 0.026643 +vn 0.026644 0.577351 0.816061 +vn -0.026642 -0.577349 -0.816062 +vn 0.816062 -0.577350 -0.026644 +vn -0.026642 0.577349 -0.816062 +vn 0.816062 0.577350 -0.026644 +vn -0.816062 -0.577351 0.026641 +vn 0.026643 -0.577351 0.816061 +vn -0.816062 0.577351 0.026641 +vn 0.026643 0.577351 0.816061 +vn -0.026643 -0.577351 -0.816061 +vn 0.816062 -0.577351 -0.026641 +vn -0.026643 0.577351 -0.816061 +vn 0.816062 0.577351 -0.026641 +vn -0.816062 -0.577350 0.026645 +vn 0.026642 -0.577349 0.816062 +vn -0.816062 0.577350 0.026645 +vn 0.026642 0.577349 0.816062 +vn -0.026643 -0.577351 -0.816061 +vn 0.816062 -0.577351 -0.026641 +vn -0.026643 0.577351 -0.816061 +vn 0.816062 0.577351 -0.026641 +vn -0.816062 -0.577350 0.026644 +vn 0.026642 -0.577349 0.816063 +vn -0.816062 0.577350 0.026644 +vn 0.026642 0.577349 0.816063 +vn -0.026644 -0.577351 -0.816061 +vn 0.816061 -0.577352 -0.026640 +vn -0.026644 0.577351 -0.816061 +vn 0.816061 0.577352 -0.026640 +vn -0.816062 -0.577350 0.026644 +vn 0.026640 -0.577349 0.816063 +vn -0.816062 0.577350 0.026644 +vn 0.026640 0.577349 0.816063 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +g Generic +usemtl Default +f 92/89/92 90/90/90 89/91/89 91/92/91 +f 94/93/94 96/94/96 95/95/95 93/96/93 +f 94/93/94 93/96/93 89/91/89 90/90/90 +f 96/94/96 94/93/94 90/90/90 92/89/92 +f 95/95/95 96/94/96 92/89/92 91/92/91 +f 93/96/93 95/95/95 91/92/91 89/91/89 +f 100/97/100 98/98/98 97/99/97 99/100/99 +f 102/101/102 104/102/104 103/103/103 101/104/101 +f 102/101/102 101/104/101 97/99/97 98/98/98 +f 104/102/104 102/101/102 98/98/98 100/97/100 +f 103/103/103 104/102/104 100/97/100 99/100/99 +f 101/104/101 103/103/103 99/100/99 97/99/97 +f 108/105/108 106/106/106 105/107/105 107/108/107 +f 110/109/110 112/110/112 111/111/111 109/112/109 +f 110/109/110 109/112/109 105/107/105 106/106/106 +f 112/110/112 110/109/110 106/106/106 108/105/108 +f 111/111/111 112/110/112 108/105/108 107/108/107 +f 109/112/109 111/111/111 107/108/107 105/107/105 +f 116/113/116 114/114/114 113/115/113 115/116/115 +f 118/117/118 120/118/120 119/119/119 117/120/117 +f 118/117/118 117/120/117 113/115/113 114/114/114 +f 120/118/120 118/117/118 114/114/114 116/113/116 +f 119/119/119 120/118/120 116/113/116 115/116/115 +f 117/120/117 119/119/119 115/116/115 113/115/113 +f 124/121/124 122/122/122 121/123/121 123/124/123 +f 126/125/126 128/126/128 127/127/127 125/128/125 +f 126/125/126 125/128/125 121/123/121 122/122/122 +f 128/126/128 126/125/126 122/122/122 124/121/124 +f 127/127/127 128/126/128 124/121/124 123/124/123 +f 125/128/125 127/127/127 123/124/123 121/123/121 +f 132/129/132 130/130/130 129/131/129 131/132/131 +f 134/133/134 136/134/136 135/135/135 133/136/133 +f 134/133/134 133/136/133 129/131/129 130/130/130 +f 136/134/136 134/133/134 130/130/130 132/129/132 +f 135/135/135 136/134/136 132/129/132 131/132/131 +f 133/136/133 135/135/135 131/132/131 129/131/129 +f 140/137/140 138/138/138 137/139/137 139/140/139 +f 142/141/142 144/142/144 143/143/143 141/144/141 +f 142/141/142 141/144/141 137/139/137 138/138/138 +f 144/142/144 142/141/142 138/138/138 140/137/140 +f 143/143/143 144/142/144 140/137/140 139/140/139 +f 141/144/141 143/143/143 139/140/139 137/139/137 +v -3.133902 -2.799647 -1.494773 +v 1.464393 -2.799647 -2.054976 +v -3.133902 10.274025 -1.494773 +v 1.464393 10.274025 -2.054976 +v -2.673638 -2.799647 2.283187 +v 1.924656 -2.799647 1.722984 +v -2.673638 10.274025 2.283187 +v 1.924656 10.274025 1.722984 +vn -0.642934 -0.577350 -0.503291 +vn 0.503291 -0.577350 -0.642934 +vn -0.642934 0.577350 -0.503291 +vn 0.503291 0.577350 -0.642934 +vn -0.503291 -0.577350 0.642934 +vn 0.642934 -0.577350 0.503291 +vn -0.503291 0.577350 0.642934 +vn 0.642934 0.577350 0.503291 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +g Generic +usemtl Default +f 148/145/148 146/146/146 145/147/145 147/148/147 +f 150/149/150 152/150/152 151/151/151 149/152/149 +f 150/149/150 149/152/149 145/147/145 146/146/146 +f 152/150/152 150/149/150 146/146/146 148/145/148 +f 151/151/151 152/150/152 148/145/148 147/148/147 +f 149/152/149 151/151/151 147/148/147 145/147/145 +v 7.996987 -2.799647 3.106367 +v 10.805010 -2.799647 2.764270 +v 7.996987 10.274025 3.106367 +v 10.805010 10.274025 2.764270 +v 8.308006 -2.799647 5.659298 +v 11.116030 -2.799647 5.317201 +v 8.308006 10.274025 5.659298 +v 11.116030 10.274025 5.317201 +vn -0.642934 -0.577350 -0.503291 +vn 0.503291 -0.577350 -0.642934 +vn -0.642934 0.577350 -0.503291 +vn 0.503291 0.577350 -0.642934 +vn -0.503291 -0.577350 0.642934 +vn 0.642934 -0.577350 0.503291 +vn -0.503291 0.577350 0.642934 +vn 0.642934 0.577350 0.503291 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +g Generic +usemtl Default +f 156/153/156 154/154/154 153/155/153 155/156/155 +f 158/157/158 160/158/160 159/159/159 157/160/157 +f 158/157/158 157/160/157 153/155/153 154/154/154 +f 160/158/160 158/157/158 154/154/154 156/153/156 +f 159/159/159 160/158/160 156/153/156 155/156/155 +f 157/160/157 159/159/159 155/156/155 153/155/153 +v -10.347970 -2.799647 6.769098 +v -7.539968 -2.799647 6.427003 +v -10.347970 10.274025 6.769098 +v -7.539968 10.274025 6.427003 +v -10.036951 -2.799647 9.322028 +v -7.228948 -2.799647 8.979934 +v -10.036951 10.274025 9.322028 +v -7.228948 10.274025 8.979934 +vn -0.642934 -0.577350 -0.503291 +vn 0.503291 -0.577350 -0.642934 +vn -0.642934 0.577350 -0.503291 +vn 0.503291 0.577350 -0.642934 +vn -0.503291 -0.577350 0.642934 +vn 0.642934 -0.577350 0.503291 +vn -0.503291 0.577350 0.642934 +vn 0.642934 0.577350 0.503291 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +g Generic +usemtl Default +f 164/161/164 162/162/162 161/163/161 163/164/163 +f 166/165/166 168/166/168 167/167/167 165/168/165 +f 166/165/166 165/168/165 161/163/161 162/162/162 +f 168/166/168 166/165/166 162/162/162 164/161/164 +f 167/167/167 168/166/168 164/161/164 163/164/163 +f 165/168/165 167/167/167 163/164/163 161/163/161 +v 7.004179 -2.799647 -5.042874 +v 9.812201 -2.799647 -5.384971 +v 7.004179 10.274025 -5.042874 +v 9.812201 10.274025 -5.384971 +v 7.315200 -2.799647 -2.489926 +v 10.123222 -2.799647 -2.832022 +v 7.315200 10.274025 -2.489926 +v 10.123222 10.274025 -2.832022 +vn -0.642934 -0.577350 -0.503291 +vn 0.503291 -0.577350 -0.642934 +vn -0.642934 0.577350 -0.503291 +vn 0.503291 0.577350 -0.642934 +vn -0.503292 -0.577350 0.642934 +vn 0.642934 -0.577350 0.503291 +vn -0.503292 0.577350 0.642934 +vn 0.642934 0.577350 0.503291 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +g Generic +usemtl Default +f 172/169/172 170/170/170 169/171/169 171/172/171 +f 174/173/174 176/174/176 175/175/175 173/176/173 +f 174/173/174 173/176/173 169/171/169 170/170/170 +f 176/174/176 174/173/174 170/170/170 172/169/172 +f 175/175/175 176/174/176 172/169/172 171/172/171 +f 173/176/173 175/175/175 171/172/171 169/171/169 +v 5.762568 -2.799647 -15.234345 +v 8.570591 -2.799647 -15.576443 +v 5.762568 10.274025 -15.234345 +v 8.570591 10.274025 -15.576443 +v 6.073587 -2.799647 -12.681417 +v 8.881610 -2.799647 -13.023514 +v 6.073587 10.274025 -12.681417 +v 8.881610 10.274025 -13.023514 +vn -0.642934 -0.577350 -0.503291 +vn 0.503291 -0.577350 -0.642934 +vn -0.642934 0.577350 -0.503291 +vn 0.503291 0.577350 -0.642934 +vn -0.503291 -0.577350 0.642934 +vn 0.642934 -0.577350 0.503292 +vn -0.503291 0.577350 0.642934 +vn 0.642934 0.577350 0.503292 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +g Generic +usemtl Default +f 180/177/180 178/178/178 177/179/177 179/180/179 +f 182/181/182 184/182/184 183/183/183 181/184/181 +f 182/181/182 181/184/181 177/179/177 178/178/178 +f 184/182/184 182/181/182 178/178/178 180/177/180 +f 183/183/183 184/182/184 180/177/180 179/180/179 +f 181/184/181 183/183/183 179/180/179 177/179/177 +v 14.876493 -2.799647 -3.645519 +v 17.684513 -2.799647 -3.987616 +v 14.876493 10.274025 -3.645519 +v 17.684513 10.274025 -3.987616 +v 15.187513 -2.799647 -1.092582 +v 17.995535 -2.799647 -1.434679 +v 15.187513 10.274025 -1.092582 +v 17.995535 10.274025 -1.434679 +vn -0.642934 -0.577350 -0.503291 +vn 0.503291 -0.577350 -0.642935 +vn -0.642934 0.577350 -0.503291 +vn 0.503291 0.577350 -0.642935 +vn -0.503291 -0.577350 0.642934 +vn 0.642934 -0.577350 0.503291 +vn -0.503291 0.577350 0.642934 +vn 0.642934 0.577350 0.503291 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +g Generic +usemtl Default +f 188/185/188 186/186/186 185/187/185 187/188/187 +f 190/189/190 192/190/192 191/191/191 189/192/189 +f 190/189/190 189/192/189 185/187/185 186/186/186 +f 192/190/192 190/189/190 186/186/186 188/185/188 +f 191/191/191 192/190/192 188/185/188 187/188/187 +f 189/192/189 191/191/191 187/188/187 185/187/185 +v 12.915435 -2.799647 -13.547013 +v 15.723457 -2.799647 -13.889110 +v 12.915435 10.274025 -13.547013 +v 15.723457 10.274025 -13.889110 +v 13.226457 -2.799647 -10.994064 +v 16.034479 -2.799647 -11.336161 +v 13.226457 10.274025 -10.994064 +v 16.034479 10.274025 -11.336161 +vn -0.642934 -0.577350 -0.503291 +vn 0.503291 -0.577350 -0.642934 +vn -0.642934 0.577350 -0.503291 +vn 0.503291 0.577350 -0.642934 +vn -0.503291 -0.577350 0.642934 +vn 0.642934 -0.577350 0.503291 +vn -0.503291 0.577350 0.642934 +vn 0.642934 0.577350 0.503291 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +g Generic +usemtl Default +f 196/193/196 194/194/194 193/195/193 195/196/195 +f 198/197/198 200/198/200 199/199/199 197/200/197 +f 198/197/198 197/200/197 193/195/193 194/194/194 +f 200/198/200 198/197/198 194/194/194 196/193/196 +f 199/199/199 200/198/200 196/193/196 195/196/195 +f 197/200/197 199/199/199 195/196/195 193/195/193 +v -22.922894 -2.556200 -16.330383 +v -18.324535 -2.556200 -16.890593 +v -22.922894 0.984404 -16.330383 +v -18.324535 0.984404 -16.890593 +v -22.462635 -2.556200 -12.552464 +v -17.864281 -2.556200 -13.112674 +v -22.462635 0.984404 -12.552464 +v -17.864281 0.984404 -13.112674 +vn -0.642934 -0.577350 -0.503291 +vn 0.503292 -0.577350 -0.642934 +vn -0.642934 0.577350 -0.503291 +vn 0.503292 0.577350 -0.642934 +vn -0.503291 -0.577350 0.642934 +vn 0.642934 -0.577350 0.503292 +vn -0.503291 0.577350 0.642934 +vn 0.642934 0.577350 0.503292 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +g Generic +usemtl Default +f 204/201/204 202/202/202 201/203/201 203/204/203 +f 206/205/206 208/206/208 207/207/207 205/208/205 +f 206/205/206 205/208/205 201/203/201 202/202/202 +f 208/206/208 206/205/206 202/202/202 204/201/204 +f 207/207/207 208/206/208 204/201/204 203/204/203 +f 205/208/205 207/207/207 203/204/203 201/203/201 +v -19.387363 -2.556200 -12.904255 +v -15.430549 -2.556200 -10.495531 +v -19.387363 0.984404 -12.904255 +v -15.430549 0.984404 -10.495531 +v -21.366352 -2.556200 -9.653341 +v -17.409561 -2.556200 -7.244633 +v -21.366352 0.984404 -9.653341 +v -17.409561 0.984404 -7.244633 +vn -0.192948 -0.577351 -0.793371 +vn 0.793371 -0.577351 -0.192945 +vn -0.192948 0.577351 -0.793371 +vn 0.793371 0.577351 -0.192945 +vn -0.793371 -0.577350 0.192949 +vn 0.192946 -0.577349 0.793372 +vn -0.793371 0.577350 0.192949 +vn 0.192946 0.577349 0.793372 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +g Generic +usemtl Default +f 212/209/212 210/210/210 209/211/209 211/212/211 +f 214/213/214 216/214/216 215/215/215 213/216/213 +f 214/213/214 213/216/213 209/211/209 210/210/210 +f 216/214/216 214/213/214 210/210/210 212/209/212 +f 215/215/215 216/214/216 212/209/212 211/212/211 +f 213/216/213 215/215/215 211/212/211 209/211/209 +v -21.119835 0.947249 -14.128448 +v -16.834282 0.947249 -15.886953 +v -21.119835 4.487851 -14.128448 +v -16.834282 4.487851 -15.886953 +v -19.675140 0.947249 -10.607425 +v -15.389552 0.947249 -12.365835 +v -19.675140 4.487851 -10.607425 +v -15.389552 4.487851 -12.365835 +vn -0.753303 -0.577346 -0.314970 +vn 0.314968 -0.577355 -0.753297 +vn -0.753303 0.577346 -0.314970 +vn 0.314968 0.577355 -0.753297 +vn -0.314977 -0.577351 0.753297 +vn 0.753297 -0.577350 0.314978 +vn -0.314977 0.577351 0.753297 +vn 0.753297 0.577350 0.314978 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +g Generic +usemtl Default +f 220/217/220 218/218/218 217/219/217 219/220/219 +f 222/221/222 224/222/224 223/223/223 221/224/221 +f 222/221/222 221/224/221 217/219/217 218/218/218 +f 224/222/224 222/221/222 218/218/218 220/217/220 +f 223/223/223 224/222/224 220/217/220 219/220/219 +f 221/224/221 223/223/223 219/220/219 217/219/217 +v 2.391826 -2.556200 -19.414434 +v 6.990122 -2.556200 -19.974638 +v 2.391826 0.984404 -19.414434 +v 6.990122 0.984404 -19.974638 +v 2.852083 -2.556200 -15.636515 +v 7.450379 -2.556200 -16.196718 +v 2.852083 0.984404 -15.636515 +v 7.450379 0.984404 -16.196718 +vn -0.642934 -0.577350 -0.503291 +vn 0.503291 -0.577350 -0.642934 +vn -0.642934 0.577350 -0.503291 +vn 0.503291 0.577350 -0.642934 +vn -0.503291 -0.577350 0.642934 +vn 0.642934 -0.577350 0.503291 +vn -0.503291 0.577350 0.642934 +vn 0.642934 0.577350 0.503291 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +g Generic +usemtl Default +f 228/225/228 226/226/226 225/227/225 227/228/227 +f 230/229/230 232/230/232 231/231/231 229/232/229 +f 230/229/230 229/232/229 225/227/225 226/226/226 +f 232/230/232 230/229/230 226/226/226 228/225/228 +f 231/231/231 232/230/232 228/225/228 227/228/227 +f 229/232/229 231/231/231 227/228/227 225/227/225 +v 13.906441 -2.556200 -15.886549 +v 18.504681 -2.556200 -16.446747 +v 13.906441 0.984404 -15.886549 +v 18.504681 0.984404 -16.446747 +v 14.366704 -2.556200 -12.108590 +v 18.964945 -2.556200 -12.668786 +v 14.366704 0.984404 -12.108590 +v 18.964945 0.984404 -12.668786 +vn -0.642934 -0.577350 -0.503291 +vn 0.503291 -0.577350 -0.642934 +vn -0.642934 0.577350 -0.503291 +vn 0.503291 0.577350 -0.642934 +vn -0.503291 -0.577350 0.642934 +vn 0.642934 -0.577350 0.503291 +vn -0.503291 0.577350 0.642934 +vn 0.642934 0.577350 0.503291 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +g Generic +usemtl Default +f 236/233/236 234/234/234 233/235/233 235/236/235 +f 238/237/238 240/238/240 239/239/239 237/240/237 +f 238/237/238 237/240/237 233/235/233 234/234/234 +f 240/238/240 238/237/238 234/234/234 236/233/236 +f 239/239/239 240/238/240 236/233/236 235/236/235 +f 237/240/237 239/239/239 235/236/235 233/235/233 +v -5.576640 7.173705 -12.009265 +v 13.232948 7.173705 -14.300806 +v -5.576640 8.236020 -12.009265 +v 13.232948 8.236020 -14.300806 +v -4.784395 7.173705 -5.506305 +v 14.025193 7.173705 -7.797847 +v -4.784395 8.236020 -5.506305 +v 14.025193 8.236020 -7.797847 +vn -0.642934 -0.577350 -0.503291 +vn 0.503291 -0.577350 -0.642934 +vn -0.642934 0.577350 -0.503291 +vn 0.503291 0.577350 -0.642934 +vn -0.503291 -0.577350 0.642934 +vn 0.642934 -0.577350 0.503291 +vn -0.503291 0.577350 0.642934 +vn 0.642934 0.577350 0.503291 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +g Generic +usemtl Default +f 244/241/244 242/242/242 241/243/241 243/244/243 +f 246/245/246 248/246/248 247/247/247 245/248/245 +f 246/245/246 245/248/245 241/243/241 242/242/242 +f 248/246/248 246/245/246 242/242/242 244/241/244 +f 247/247/247 248/246/248 244/241/244 243/244/243 +f 245/248/245 247/247/247 243/244/243 241/243/241 +v -24.029739 6.868023 2.073466 +v -5.220205 6.868023 -0.218069 +v -24.029739 7.930318 2.073466 +v -5.220205 7.930318 -0.218069 +v -23.237495 6.868023 8.576427 +v -4.427960 6.868023 6.284892 +v -23.237495 7.930318 8.576427 +v -4.427960 7.930318 6.284892 +vn -0.642934 -0.577350 -0.503291 +vn 0.503291 -0.577350 -0.642934 +vn -0.642934 0.577350 -0.503291 +vn 0.503291 0.577350 -0.642934 +vn -0.503291 -0.577350 0.642934 +vn 0.642934 -0.577350 0.503291 +vn -0.503291 0.577350 0.642934 +vn 0.642934 0.577350 0.503291 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +g Generic +usemtl Default +f 252/249/252 250/250/250 249/251/249 251/252/251 +f 254/253/254 256/254/256 255/255/255 253/256/253 +f 254/253/254 253/256/253 249/251/249 250/250/250 +f 256/254/256 254/253/254 250/250/250 252/249/252 +f 255/255/255 256/254/256 252/249/252 251/252/251 +f 253/256/253 255/255/255 251/252/251 249/251/249 +v -3.066964 14.079152 8.374180 +v 1.850904 7.163459 -8.568049 +v -2.958884 15.068172 8.001846 +v 1.959003 8.152479 -8.940387 +v 3.224372 14.079152 10.200409 +v 8.142260 7.163459 -6.741843 +v 3.332469 15.068172 9.828053 +v 8.250336 8.152479 -7.114196 +vn -0.763055 -0.326793 0.557632 +vn -0.463362 -0.748238 -0.474802 +vn -0.645557 0.748250 0.152899 +vn -0.345879 0.326811 -0.879524 +vn 0.345884 -0.326798 0.879527 +vn 0.645565 -0.748241 -0.152908 +vn 0.463358 0.748247 0.474790 +vn 0.763048 0.326807 -0.557634 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +g Generic +usemtl Default +f 260/257/260 258/258/258 257/259/257 259/260/259 +f 262/261/262 264/262/264 263/263/263 261/264/261 +f 262/261/262 261/264/261 257/259/257 258/258/258 +f 264/262/264 262/261/262 258/258/258 260/257/260 +f 263/263/263 264/262/264 260/257/260 259/260/259 +f 261/264/261 263/263/263 259/260/259 257/259/257 +v -6.644157 5.489818 -0.528142 +v -2.045856 5.489818 -1.088346 +v -6.644157 9.030419 -0.528142 +v -2.045856 9.030419 -1.088346 +v -6.183894 5.489818 3.249823 +v -1.585592 5.489818 2.689619 +v -6.183894 9.030419 3.249823 +v -1.585592 9.030419 2.689619 +vn -0.642934 -0.577350 -0.503291 +vn 0.503291 -0.577350 -0.642934 +vn -0.642934 0.577350 -0.503291 +vn 0.503291 0.577350 -0.642934 +vn -0.503291 -0.577350 0.642934 +vn 0.642934 -0.577350 0.503291 +vn -0.503291 0.577350 0.642934 +vn 0.642934 0.577350 0.503291 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +g Generic +usemtl Default +f 268/265/268 266/266/266 265/267/265 267/268/267 +f 270/269/270 272/270/272 271/271/271 269/272/269 +f 270/269/270 269/272/269 265/267/265 266/266/266 +f 272/270/272 270/269/270 266/266/266 268/265/268 +f 271/271/271 272/270/272 268/265/268 267/268/267 +f 269/272/269 271/271/271 267/268/267 265/267/265 +v -6.385265 -2.556200 11.803425 +v -3.546856 -2.556200 8.142606 +v -6.385265 0.984404 11.803425 +v -3.546856 0.984404 8.142606 +v -3.377541 -2.556200 14.135456 +v -0.539135 -2.556200 10.474639 +v -3.377541 0.984404 14.135456 +v -0.539135 0.984404 10.474639 +vn -0.810037 -0.577350 0.102502 +vn -0.102502 -0.577350 -0.810037 +vn -0.810037 0.577350 0.102502 +vn -0.102502 0.577350 -0.810037 +vn 0.102502 -0.577350 0.810037 +vn 0.810037 -0.577350 -0.102502 +vn 0.102502 0.577350 0.810037 +vn 0.810037 0.577350 -0.102502 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +g Generic +usemtl Default +f 276/273/276 274/274/274 273/275/273 275/276/275 +f 278/277/278 280/278/280 279/279/279 277/280/277 +f 278/277/278 277/280/277 273/275/273 274/274/274 +f 280/278/280 278/277/278 274/274/274 276/273/276 +f 279/279/279 280/278/280 276/273/276 275/276/275 +f 277/280/277 279/279/279 275/276/275 273/275/273 +v 13.473137 2.100612 23.352911 +v 13.473137 4.463260 23.352911 +v 13.949500 2.100612 25.847401 +v 13.949500 4.463260 25.847401 +v 16.029657 2.104442 22.870707 +v 16.032919 4.467090 22.869925 +v 16.441402 4.467090 25.377504 +v 16.438084 2.104442 25.378296 +v 15.876395 -1.229438 21.959049 +v 20.448454 -1.235113 21.214510 +v 15.828266 11.838176 21.563995 +v 20.400303 11.832507 20.819263 +v 16.488071 -1.113641 25.713701 +v 21.060127 -1.119316 24.969160 +v 16.439941 11.953967 25.318645 +v 21.011976 11.948298 24.573915 +v 15.842556 8.721443 21.663544 +v 15.838550 9.811758 21.630657 +v 16.452887 9.204490 25.407169 +v 16.456894 8.114195 25.440060 +v 20.010408 9.286901 20.967091 +v 19.868492 10.358484 20.957176 +v 20.482813 9.751219 24.733696 +v 20.624725 8.679634 24.743608 +v 4.861748 -1.215768 23.753183 +v 9.433783 -1.221443 23.008457 +v 4.813596 11.851851 23.357937 +v 9.385630 11.846182 22.613211 +v 5.473380 -1.099970 27.507647 +v 10.045456 -1.105645 26.763109 +v 5.425251 11.967642 27.112595 +v 9.997305 11.961973 26.367865 +v 9.399155 8.938145 22.706486 +v 9.403185 7.847831 22.739567 +v 10.017523 7.240564 26.516081 +v 10.013493 8.330879 26.483002 +v 5.075011 8.351486 23.429117 +v 5.216946 7.279902 23.439030 +v 5.831264 6.672635 27.215549 +v 5.689349 7.744239 27.205633 +v 3.801822 8.678734 14.739783 +v 18.655296 10.626419 12.636736 +v 3.691645 9.718966 14.924976 +v 18.545118 11.666653 12.821929 +v 6.285872 6.223238 30.010189 +v 21.139345 8.170923 27.907164 +v 6.175710 7.263470 30.195515 +v 21.029186 9.211155 28.092489 +vn -0.674105 -0.578078 -0.459792 +vn -0.675137 0.577488 -0.459019 +vn -0.459175 -0.577157 0.675313 +vn -0.460414 0.576637 0.674915 +vn -0.874537 -0.404130 -0.268073 +vn -0.874058 0.405652 -0.267335 +vn -0.736228 0.412457 0.536514 +vn -0.736489 -0.410874 0.537370 +vn -0.869849 -0.419786 -0.259117 +vn 0.479020 -0.595811 -0.644631 +vn -0.665152 0.559481 -0.494525 +vn 0.475166 0.558302 -0.680086 +vn -0.738901 -0.394194 0.546477 +vn 0.664916 -0.559911 0.494354 +vn -0.479184 0.595394 0.644895 +vn 0.660295 0.594271 0.459187 +vn -0.653723 -0.674107 -0.343839 +vn -0.446641 0.889899 -0.092693 +vn -0.383476 0.738255 0.554911 +vn -0.598376 -0.717022 0.357528 +vn 0.507392 -0.483889 -0.713025 +vn 0.446897 0.670317 -0.592417 +vn 0.561639 0.615923 0.552450 +vn 0.761640 -0.500653 0.411401 +vn -0.660367 -0.594167 -0.459217 +vn 0.479057 -0.595661 -0.644742 +vn -0.664879 0.559997 -0.494307 +vn 0.474968 0.558803 -0.679812 +vn -0.474997 -0.558661 0.679909 +vn 0.664777 -0.560175 0.494242 +vn -0.479133 0.595490 0.644844 +vn 0.660283 0.594268 0.459208 +vn 0.284472 0.885635 -0.367052 +vn 0.383391 -0.738379 -0.554805 +vn 0.563394 -0.802022 0.198364 +vn 0.248563 0.881811 0.400782 +vn -0.761595 0.500754 -0.411362 +vn -0.561702 -0.615829 -0.552491 +vn -0.446695 -0.670632 0.592213 +vn -0.507480 0.483523 0.713210 +vn -0.598564 -0.549179 -0.583201 +vn 0.535219 -0.400513 -0.743727 +vn -0.550276 0.810953 -0.198876 +vn 0.415456 0.730181 -0.542431 +vn -0.415433 -0.730223 0.542392 +vn 0.718303 -0.581562 0.381871 +vn -0.535235 0.400459 0.743745 +vn 0.380927 0.788075 0.483563 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +g Generic +usemtl Default +f 283/281/283 284/282/284 282/283/282 281/284/281 +f 285/285/285 281/284/281 282/283/282 286/286/286 +f 288/287/288 283/281/283 281/284/281 285/285/285 +f 284/282/284 287/288/287 286/286/286 282/283/282 +f 294/289/294 293/290/293 289/291/289 290/292/290 +f 296/293/296 294/289/294 290/292/290 292/294/292 +f 295/295/295 296/293/296 292/294/292 291/296/291 +f 292/294/292 290/292/290 289/291/289 297/297/297 301/298/301 302/299/302 298/300/298 291/296/291 +f 294/289/294 296/293/296 295/295/295 299/301/299 303/302/303 304/303/304 300/304/300 293/290/293 +f 299/301/299 295/295/295 291/296/291 298/300/298 +f 310/305/310 309/306/309 305/307/305 306/308/306 +f 311/309/311 312/310/312 308/311/308 307/312/307 +f 309/306/309 311/309/311 307/312/307 305/307/305 +f 306/308/306 305/307/305 307/312/307 308/311/308 313/313/313 317/314/317 318/315/318 314/316/314 +f 319/317/319 320/318/320 316/319/316 312/310/312 311/309/311 309/306/309 310/305/310 315/320/315 +f 312/310/312 316/319/316 313/313/313 308/311/308 +f 315/320/315 310/305/310 306/308/306 314/316/314 +f 324/321/324 322/322/322 321/323/321 323/324/323 +f 326/325/326 328/326/328 327/327/327 325/328/325 +f 325/328/325 327/327/327 320/318/320 319/317/319 +f 317/314/317 323/324/323 321/323/321 318/315/318 +f 328/326/328 326/325/326 304/303/304 303/302/303 +f 301/298/301 322/322/322 324/321/324 302/299/302 +f 320/318/320 327/327/327 328/326/328 316/319/316 +f 316/319/316 328/326/328 303/302/303 299/301/299 +f 298/300/298 313/313/313 316/319/316 299/301/299 +f 324/321/324 323/324/323 298/300/298 302/299/302 +f 298/300/298 323/324/323 317/314/317 313/313/313 +f 297/297/297 314/316/314 318/315/318 321/323/321 322/322/322 301/298/301 +f 314/316/314 297/297/297 300/304/300 315/320/315 +f 319/317/319 315/320/315 300/304/300 304/303/304 326/325/326 325/328/325 +f 288/287/288 293/290/293 300/304/300 287/288/287 +f 293/290/293 288/287/288 285/285/285 289/291/289 +f 289/291/289 285/285/285 286/286/286 297/297/297 +f 297/297/297 286/286/286 287/288/287 300/304/300 +f 283/281/283 288/287/288 287/288/287 284/282/284 +v 4.061719 12.278974 11.206284 +v 4.061719 15.240368 11.206284 +v 3.714470 12.278974 13.660270 +v 3.714470 15.240368 13.660270 +v 2.186756 12.278974 15.611854 +v 2.186756 15.240368 15.611854 +v -0.112078 12.278974 16.538113 +v -0.112078 15.240368 16.538113 +v -2.566060 12.278974 16.190882 +v -2.566060 15.240368 16.190882 +v -4.517662 12.278974 14.663177 +v -4.517662 15.240368 14.663177 +v -5.443921 12.278974 12.364341 +v -5.443921 15.240368 12.364341 +v -5.096690 12.278974 9.910357 +v -5.096690 15.240368 9.910357 +v -3.568967 12.278974 7.958751 +v -3.568967 15.240368 7.958751 +v -1.270133 12.278974 7.032493 +v -1.270133 15.240368 7.032493 +v 1.183848 12.278974 7.379724 +v 1.183848 15.240368 7.379724 +v 3.135441 12.278974 8.907449 +v 3.135441 15.240368 8.907449 +vn 0.881556 -0.459701 -0.107399 +vn 0.881556 0.459701 -0.107399 +vn 0.817148 -0.459701 0.347770 +vn 0.817148 0.459701 0.347770 +vn 0.533785 -0.459701 0.709752 +vn 0.533785 0.459701 0.709752 +vn 0.107399 -0.459700 0.881556 +vn 0.107399 0.459700 0.881556 +vn -0.347764 -0.459701 0.817151 +vn -0.347764 0.459701 0.817151 +vn -0.709750 -0.459701 0.533788 +vn -0.709750 0.459701 0.533788 +vn -0.881556 -0.459700 0.107399 +vn -0.881556 0.459700 0.107399 +vn -0.817150 -0.459701 -0.347766 +vn -0.817150 0.459701 -0.347766 +vn -0.533786 -0.459701 -0.709751 +vn -0.533786 0.459701 -0.709751 +vn -0.107398 -0.459700 -0.881556 +vn -0.107398 0.459700 -0.881556 +vn 0.347767 -0.459701 -0.817149 +vn 0.347767 0.459701 -0.817149 +vn 0.709751 -0.459701 -0.533788 +vn 0.709751 0.459701 -0.533788 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +g Generic +usemtl Default +f 331/329/331 329/330/329 330/331/330 332/332/332 +f 333/333/333 331/329/331 332/332/332 334/334/334 +f 335/335/335 333/333/333 334/334/334 336/336/336 +f 337/337/337 335/335/335 336/336/336 338/338/338 +f 339/339/339 337/337/337 338/338/338 340/340/340 +f 341/341/341 339/339/339 340/340/340 342/342/342 +f 343/343/343 341/341/341 342/342/342 344/344/344 +f 345/345/345 343/343/343 344/344/344 346/346/346 +f 347/347/347 345/345/345 346/346/346 348/348/348 +f 349/349/349 347/347/347 348/348/348 350/350/350 +f 351/351/351 349/349/349 350/350/350 352/352/352 +f 329/330/329 351/351/351 352/352/352 330/331/330 +f 352/352/352 350/350/350 348/348/348 346/346/346 344/344/344 342/342/342 340/340/340 338/338/338 336/336/336 334/334/334 332/332/332 330/331/330 +f 329/330/329 331/329/331 333/333/333 335/335/335 337/337/337 339/339/339 341/341/341 343/343/343 345/345/345 347/347/347 349/349/349 351/351/351 +v 28.405697 -3.409447 -5.443012 +v 31.444405 -3.297550 -5.813213 +v 34.483120 -2.968940 -6.183414 +v 37.521828 -2.565424 -6.553616 +v 40.560539 -2.398096 -6.923816 +v 43.599251 -2.565424 -7.294018 +v 46.637955 -3.060902 -7.664218 +v 49.676670 -3.737523 -8.034420 +v 52.715378 -4.412263 -8.404621 +v 55.754086 -4.771656 -8.774822 +v 58.792797 -4.869517 -9.145023 +v 28.405697 -2.438035 -5.443012 +v 31.444405 -2.320616 -5.813213 +v 34.483120 -1.985266 -6.183414 +v 37.521828 -1.576197 -6.553616 +v 40.560539 -1.407172 -6.923816 +v 43.599251 -1.576197 -7.294018 +v 46.637955 -2.077228 -7.664218 +v 49.676670 -2.769071 -8.034420 +v 52.715378 -3.449503 -8.404621 +v 55.754086 -3.811076 -8.774822 +v 58.792797 -3.906463 -9.145023 +v 28.775898 -3.356195 -2.404303 +v 31.814606 -2.968940 -2.774504 +v 34.853321 -2.195561 -3.144706 +v 37.892029 -1.397891 -3.514907 +v 40.930740 -1.104276 -3.885108 +v 43.969452 -1.397891 -4.255310 +v 47.008156 -2.265358 -4.625510 +v 50.046871 -3.336131 -4.995712 +v 53.085579 -4.231285 -5.365912 +v 56.124287 -4.658715 -5.736114 +v 59.162998 -4.771657 -6.106315 +v 59.162998 -3.811076 -6.106315 +v 56.124287 -3.698599 -5.736114 +v 53.085579 -3.269352 -5.365912 +v 50.046871 -2.352459 -4.995712 +v 47.008156 -1.248837 -4.625510 +v 43.969452 -0.404662 -4.255310 +v 40.930740 -0.112976 -3.885108 +v 37.892029 -0.404662 -3.514907 +v 34.853321 -1.181921 -3.144706 +v 31.814606 -1.985266 -2.774504 +v 28.775898 -2.384776 -2.404303 +v 29.146099 -3.255616 0.634407 +v 32.184807 -2.565424 0.264205 +v 35.223522 -1.397891 -0.105996 +v 38.262230 -0.537756 -0.476197 +v 41.300941 -0.278140 -0.846398 +v 44.339653 -0.537756 -1.216600 +v 47.378357 -1.421056 -1.586800 +v 50.417072 -2.762392 -1.957002 +v 53.455780 -3.792841 -2.327203 +v 56.494488 -4.284532 -2.697404 +v 59.533199 -4.412263 -3.067605 +v 59.533199 -3.449503 -3.067605 +v 56.494488 -3.322612 -2.697404 +v 53.455780 -2.824036 -2.327203 +v 50.417072 -1.767833 -1.957002 +v 47.378357 -0.423386 -1.586800 +v 44.339653 0.459619 -1.216600 +v 41.300941 0.718170 -0.846398 +v 38.262230 0.459619 -0.476197 +v 35.223522 -0.404662 -0.105996 +v 32.184807 -1.576197 0.264205 +v 29.146099 -2.277591 0.634407 +v 29.516300 -3.198068 3.673115 +v 32.555008 -2.398096 3.302914 +v 35.593723 -1.104276 2.932712 +v 38.632431 -0.278140 2.562511 +v 41.671143 -0.053185 2.192311 +v 44.709854 -0.278140 1.822109 +v 47.748558 -1.104276 1.451908 +v 50.787273 -2.449177 1.081707 +v 53.825981 -3.395026 0.711506 +v 56.864689 -3.776620 0.341305 +v 59.903400 -3.849413 -0.028896 +v 59.903400 -2.886490 -0.028896 +v 56.864689 -2.812960 0.341305 +v 53.825981 -2.415678 0.711506 +v 50.787273 -1.455851 1.081707 +v 47.748558 -0.112976 1.451908 +v 44.709854 0.718170 1.822109 +v 41.671143 0.937435 2.192311 +v 38.632431 0.718170 2.562511 +v 35.593723 -0.112976 2.932712 +v 32.555008 -1.407172 3.302914 +v 29.516300 -2.218710 3.673115 +v 29.886501 -3.255616 6.711825 +v 32.925209 -2.565424 6.341624 +v 35.963924 -1.397891 5.971423 +v 39.002632 -0.537756 5.601222 +v 42.041344 -0.278140 5.231021 +v 45.080055 -0.537756 4.860819 +v 48.118759 -1.397891 4.490619 +v 51.157475 -2.565424 4.120417 +v 54.196182 -3.278783 3.750216 +v 57.234890 -3.476367 3.380015 +v 60.273602 -3.501402 3.009814 +v 60.273602 -2.533448 3.009814 +v 57.234890 -2.507833 3.380015 +v 54.196182 -2.300760 3.750216 +v 51.157475 -1.576197 4.120417 +v 48.118759 -0.404662 4.490619 +v 45.080055 0.459619 4.860819 +v 42.041344 0.718170 5.231021 +v 39.002632 0.459619 5.601222 +v 35.963924 -0.404662 5.971423 +v 32.925209 -1.576197 6.341624 +v 29.886501 -2.277591 6.711825 +v 30.256702 -3.356195 9.750534 +v 33.295410 -2.968940 9.380333 +v 36.334126 -2.195561 9.010131 +v 39.372833 -1.397891 8.639931 +v 42.411545 -1.104277 8.269730 +v 45.450256 -1.397891 7.899528 +v 48.488960 -2.195561 7.529327 +v 51.527676 -2.968940 7.159126 +v 54.566383 -3.356195 6.788925 +v 57.605091 -3.409447 6.418724 +v 60.643803 -3.409447 6.048523 +v 60.643803 -2.438035 6.048523 +v 57.605091 -2.438035 6.418724 +v 54.566383 -2.384776 6.788925 +v 51.527676 -1.985266 7.159126 +v 48.488960 -1.181921 7.529327 +v 45.450256 -0.404662 7.899528 +v 42.411545 -0.112976 8.269730 +v 39.372833 -0.404662 8.639931 +v 36.334126 -1.181921 9.010131 +v 33.295410 -1.985266 9.380333 +v 30.256702 -2.384776 9.750534 +v 30.626904 -3.409447 12.789245 +v 33.665611 -3.293368 12.419044 +v 36.704327 -2.968940 12.048842 +v 39.743034 -2.565424 11.678641 +v 42.781746 -2.398096 11.308440 +v 45.820457 -2.565424 10.938239 +v 48.859161 -2.968940 10.568038 +v 51.897877 -3.297550 10.197837 +v 54.936584 -3.350677 9.827636 +v 57.975292 -3.239676 9.457435 +v 61.014004 -3.176165 9.087234 +v 61.014004 -2.195984 9.087234 +v 57.975292 -2.260967 9.457435 +v 54.936584 -2.379257 9.827636 +v 51.897877 -2.320616 10.197837 +v 48.859161 -1.985266 10.568038 +v 45.820457 -1.576197 10.938239 +v 42.781746 -1.407172 11.308440 +v 39.743034 -1.576197 11.678641 +v 36.704327 -1.985266 12.048842 +v 33.665611 -2.314560 12.419044 +v 30.626904 -2.438035 12.789245 +v 30.997105 -3.044981 15.827954 +v 34.035812 -2.785754 15.457753 +v 37.074528 -2.991724 15.087551 +v 40.113235 -3.219331 14.717350 +v 43.151947 -3.198068 14.347149 +v 46.190659 -3.255616 13.976948 +v 49.229362 -3.356195 13.606747 +v 52.268078 -3.285955 13.236546 +v 55.306786 -2.923296 12.866344 +v 58.345493 -2.477970 12.496143 +v 61.384205 -2.293303 12.125942 +v 61.384205 -1.300357 12.125942 +v 58.345493 -1.486896 12.496143 +v 55.306786 -1.938351 12.866344 +v 52.268078 -2.308449 13.236546 +v 49.229362 -2.384776 13.606747 +v 46.190659 -2.277591 13.976948 +v 43.151947 -2.218710 14.347149 +v 40.113235 -2.242946 14.717350 +v 37.074528 -2.000064 15.087551 +v 34.035812 -1.786767 15.457753 +v 30.997105 -2.053322 15.827954 +v 31.367306 -1.861028 18.866663 +v 34.406013 -1.262635 18.496462 +v 37.444729 -1.861028 18.126261 +v 40.483437 -3.044981 17.756060 +v 43.522148 -3.409447 17.385859 +v 46.560860 -3.409447 17.015657 +v 49.599564 -3.350677 16.645456 +v 52.638279 -2.923296 16.275255 +v 55.676987 -2.069782 15.905054 +v 58.715694 -1.189459 15.534853 +v 61.754406 -0.865421 15.164652 +v 61.754406 0.127940 15.164652 +v 58.715694 -0.193970 15.534853 +v 55.676987 -1.051766 15.905054 +v 52.638279 -1.938351 16.275255 +v 49.599564 -2.379257 16.645456 +v 46.560860 -2.438035 17.015657 +v 43.522148 -2.438035 17.385859 +v 40.483437 -2.053322 17.756060 +v 37.444729 -0.836300 18.126261 +v 34.406013 -0.228566 18.496462 +v 31.367306 -0.836300 18.866663 +v 31.737507 -1.262635 21.905371 +v 34.776215 -0.734991 21.535170 +v 37.814930 -1.262635 21.164968 +v 40.853638 -2.785754 20.794767 +v 43.892349 -3.405265 20.424566 +v 46.931061 -3.409447 20.054365 +v 49.969765 -3.239676 19.684164 +v 53.008480 -2.477970 19.313963 +v 56.047188 -1.189459 18.943762 +v 59.085896 -0.240200 18.573561 +v 62.124607 0.046317 18.203360 +v 62.124607 1.045207 18.203360 +v 59.085896 0.759866 18.573561 +v 56.047188 -0.193970 18.943762 +v 53.008480 -1.486896 19.313963 +v 49.969765 -2.260967 19.684164 +v 46.931061 -2.438035 20.054365 +v 43.892349 -2.431980 20.424566 +v 40.853638 -1.786767 20.794767 +v 37.814930 -0.228566 21.164968 +v 34.776215 0.279237 21.535170 +v 31.737507 -0.228566 21.905371 +v 32.107708 -1.861028 24.944080 +v 35.146416 -1.262635 24.573879 +v 38.185131 -1.861028 24.203678 +v 41.223839 -3.044981 23.833477 +v 44.262550 -3.409447 23.463276 +v 47.301262 -3.409447 23.093075 +v 50.339966 -3.176165 22.722874 +v 53.378681 -2.293303 22.352673 +v 56.417389 -0.865421 21.982471 +v 59.456097 0.046317 21.612270 +v 62.494808 0.294580 21.242069 +v 32.107708 -0.836300 24.944080 +v 35.146416 -0.228566 24.573879 +v 38.185131 -0.836300 24.203678 +v 41.223839 -2.053322 23.833477 +v 44.262550 -2.438035 23.463276 +v 47.301262 -2.438035 23.093075 +v 50.339966 -2.195984 22.722874 +v 53.378681 -1.300357 22.352673 +v 56.417389 0.127940 21.982471 +v 59.456097 1.045207 21.612270 +v 62.494808 1.287191 21.242069 +vn -0.599026 -0.602062 -0.527910 +vn 0.050826 -0.714581 -0.697704 +vn 0.110539 -0.740282 -0.663147 +vn 0.068305 -0.791033 -0.607948 +vn -0.067464 -0.826818 -0.558408 +vn -0.220364 -0.810985 -0.541980 +vn -0.312818 -0.765434 -0.562366 +vn -0.310167 -0.731317 -0.607431 +vn -0.235293 -0.721301 -0.651431 +vn -0.146453 -0.720505 -0.677808 +vn 0.497112 -0.591272 -0.635041 +vn -0.673059 0.528950 -0.516918 +vn -0.214383 0.627951 -0.748143 +vn -0.244448 0.573497 -0.781886 +vn -0.195686 0.552643 -0.810119 +vn -0.099946 0.558569 -0.823415 +vn 0.008650 0.577861 -0.816090 +vn 0.097853 0.605520 -0.789792 +vn 0.119938 0.639695 -0.759213 +vn 0.058512 0.673582 -0.736793 +vn -0.026391 0.691911 -0.721500 +vn 0.510733 0.564070 -0.648828 +vn -0.636587 -0.765097 0.096869 +vn 0.243364 -0.969112 0.039942 +vn 0.296439 -0.944376 0.142401 +vn 0.202625 -0.945466 0.255022 +vn 0.038919 -0.947516 0.317330 +vn -0.134932 -0.932967 0.333716 +vn -0.273840 -0.911088 0.308108 +vn -0.300219 -0.924670 0.234209 +vn -0.206048 -0.966808 0.151086 +vn -0.082062 -0.991596 0.100012 +vn 0.695273 -0.718229 -0.027242 +vn 0.709541 0.690960 -0.138295 +vn 0.084344 0.992606 -0.087289 +vn 0.215679 0.969716 -0.114603 +vn 0.318789 0.933719 -0.162917 +vn 0.288834 0.927346 -0.237916 +vn 0.139049 0.942800 -0.302974 +vn -0.038532 0.947194 -0.318338 +vn -0.203287 0.933954 -0.293945 +vn -0.303199 0.922896 -0.237346 +vn -0.257204 0.954734 -0.149428 +vn -0.770621 0.637095 0.015922 +vn -0.611009 -0.785914 0.094909 +vn 0.309377 -0.950758 0.018605 +vn 0.330547 -0.939656 0.088237 +vn 0.190193 -0.969929 0.151870 +vn 0.020844 -0.984928 0.171703 +vn -0.150180 -0.970266 0.189817 +vn -0.308041 -0.927864 0.210190 +vn -0.329400 -0.923913 0.194626 +vn -0.204784 -0.965387 0.161530 +vn -0.068907 -0.986607 0.147847 +vn 0.702926 -0.711047 0.017523 +vn 0.700835 0.687586 -0.189883 +vn 0.069750 0.985420 -0.155188 +vn 0.209274 0.964095 -0.163481 +vn 0.335981 0.925650 -0.174037 +vn 0.311741 0.930325 -0.193166 +vn 0.149069 0.969065 -0.196701 +vn -0.021008 0.984904 -0.171823 +vn -0.189856 0.970498 -0.148620 +vn -0.334154 0.933955 -0.126767 +vn -0.317712 0.944096 -0.087989 +vn -0.788491 0.613893 0.037649 +vn -0.613516 -0.786143 0.074682 +vn 0.303138 -0.952222 -0.037151 +vn 0.317442 -0.947484 -0.038790 +vn 0.171703 -0.984929 -0.020833 +vn -0.000031 -1.000000 0.000039 +vn -0.171685 -0.984928 0.020991 +vn -0.320490 -0.946391 0.040385 +vn -0.316495 -0.946991 0.055123 +vn -0.169818 -0.982385 0.077982 +vn -0.041434 -0.992752 0.112813 +vn 0.707821 -0.706351 0.007588 +vn 0.695169 0.693527 -0.189104 +vn 0.039320 0.988596 -0.145367 +vn 0.166981 0.977636 -0.127844 +vn 0.313375 0.945008 -0.093569 +vn 0.319572 0.945981 -0.054709 +vn 0.171636 0.984904 -0.022475 +vn -0.000043 1.000000 -0.000034 +vn -0.171841 0.984904 0.020860 +vn -0.318278 0.947194 0.039025 +vn -0.305022 0.951604 0.037580 +vn -0.781929 0.616023 0.095404 +vn -0.641295 -0.765086 0.058177 +vn 0.228429 -0.969783 -0.085684 +vn 0.261573 -0.951515 -0.161862 +vn 0.151503 -0.969324 -0.193539 +vn -0.021001 -0.984929 -0.171682 +vn -0.193092 -0.969929 -0.148167 +vn -0.296212 -0.945466 -0.135469 +vn -0.250966 -0.963185 -0.096388 +vn -0.112666 -0.993312 -0.025260 +vn -0.018339 -0.999200 0.035536 +vn 0.705864 -0.707020 -0.043341 +vn 0.697463 0.703445 -0.136786 +vn 0.014976 0.997486 -0.069265 +vn 0.106696 0.993220 -0.046145 +vn 0.246332 0.969140 0.009378 +vn 0.293675 0.951714 0.089414 +vn 0.192035 0.969807 0.150325 +vn 0.020851 0.984903 0.171847 +vn -0.150426 0.970143 0.190246 +vn -0.256521 0.945340 0.201317 +vn -0.222547 0.962215 0.156895 +vn -0.754377 0.638420 0.152757 +vn -0.675241 -0.734843 0.063685 +vn 0.118792 -0.989218 -0.085657 +vn 0.157385 -0.966855 -0.201053 +vn 0.094325 -0.951515 -0.292784 +vn -0.038560 -0.947484 -0.317470 +vn -0.165018 -0.939656 -0.299694 +vn -0.209409 -0.944376 -0.253579 +vn -0.142467 -0.975746 -0.166202 +vn -0.038468 -0.997398 -0.060972 +vn 0.011450 -0.999861 0.012149 +vn 0.708895 -0.702842 -0.059000 +vn 0.693587 0.709641 -0.123879 +vn -0.016267 0.998809 -0.046007 +vn 0.030011 0.999395 -0.017564 +vn 0.134792 0.989619 0.049859 +vn 0.203306 0.966094 0.159148 +vn 0.160941 0.951269 0.263029 +vn 0.038904 0.947163 0.318386 +vn -0.086977 0.939483 0.331370 +vn -0.143412 0.943787 0.297824 +vn -0.107136 0.974403 0.197637 +vn -0.721435 0.671438 0.169419 +vn -0.676722 -0.726492 0.119404 +vn 0.044928 -0.998382 0.034851 +vn 0.017094 -0.998543 -0.051192 +vn 0.002788 -0.978146 -0.207902 +vn -0.039266 -0.953079 -0.300165 +vn -0.092341 -0.950757 -0.295861 +vn -0.087286 -0.969736 -0.228021 +vn -0.009467 -0.992899 -0.118585 +vn 0.070787 -0.997491 0.000420 +vn 0.077588 -0.991887 0.100702 +vn 0.729717 -0.683588 0.014874 +vn 0.674057 0.707296 -0.213024 +vn -0.084884 0.983981 -0.156769 +vn -0.083368 0.991253 -0.102311 +vn -0.005273 0.999943 -0.009270 +vn 0.076243 0.990585 0.113699 +vn 0.087305 0.968659 0.232545 +vn 0.040110 0.951586 0.304755 +vn 0.010646 0.952089 0.305636 +vn 0.004997 0.977760 0.209667 +vn -0.034190 0.997958 0.053954 +vn -0.729579 0.680585 0.067219 +vn -0.635657 -0.727218 0.259024 +vn 0.039333 -0.961732 0.271154 +vn -0.137465 -0.957450 0.253757 +vn -0.129258 -0.989870 0.058725 +vn -0.046866 -0.992288 -0.114753 +vn -0.025705 -0.988873 -0.146527 +vn 0.025003 -0.994393 -0.102744 +vn 0.136203 -0.990513 -0.018254 +vn 0.214018 -0.971281 0.103967 +vn 0.172436 -0.955708 0.238511 +vn 0.755635 -0.643259 0.123425 +vn 0.644344 0.685570 -0.338843 +vn -0.176109 0.933268 -0.313044 +vn -0.225667 0.945862 -0.233280 +vn -0.154735 0.981077 -0.116383 +vn -0.037547 0.999278 0.005775 +vn 0.020768 0.994831 0.099400 +vn 0.052134 0.987864 0.146311 +vn 0.157049 0.982054 0.104429 +vn 0.172396 0.982522 -0.070214 +vn -0.031789 0.969133 -0.244480 +vn -0.774993 0.621770 -0.113085 +vn -0.614110 -0.734644 0.288386 +vn 0.037162 -0.955783 0.291717 +vn -0.247938 -0.917069 0.312269 +vn -0.256380 -0.946881 0.194126 +vn -0.076923 -0.996657 0.027514 +vn 0.014613 -0.999399 -0.031445 +vn 0.112773 -0.993474 -0.017085 +vn 0.265926 -0.963190 0.039342 +vn 0.323267 -0.933484 0.155265 +vn 0.220989 -0.934749 0.278224 +vn 0.762125 -0.632263 0.139315 +vn 0.638094 0.689687 -0.342297 +vn -0.221099 0.921316 -0.319831 +vn -0.329283 0.908367 -0.257764 +vn -0.280638 0.945862 -0.163057 +vn -0.124206 0.990379 -0.061016 +vn -0.018246 0.999820 0.005245 +vn 0.086584 0.996041 0.020138 +vn 0.286958 0.956545 -0.051730 +vn 0.272502 0.939816 -0.206126 +vn -0.033691 0.955810 -0.292048 +vn -0.786435 0.608575 -0.105618 +vn -0.643540 -0.761356 0.078699 +vn -0.000319 -1.000000 0.000408 +vn -0.292106 -0.955783 0.033964 +vn -0.280714 -0.959253 0.032134 +vn -0.079081 -0.996824 0.009362 +vn 0.032279 -0.999471 -0.003932 +vn 0.163733 -0.986486 -0.006001 +vn 0.337538 -0.941095 0.020224 +vn 0.360082 -0.927949 0.096185 +vn 0.208215 -0.963843 0.166293 +vn 0.748825 -0.661451 0.041746 +vn 0.657610 0.721687 -0.216142 +vn -0.207816 0.964545 -0.162679 +vn -0.363560 0.921316 -0.137843 +vn -0.346170 0.933268 -0.095798 +vn -0.172563 0.983981 -0.044762 +vn -0.035218 0.999322 -0.010758 +vn 0.082937 0.996504 -0.010097 +vn 0.288978 0.956719 -0.034363 +vn 0.296553 0.954354 -0.035559 +vn -0.000565 1.000000 -0.000442 +vn -0.765765 0.636361 0.092994 +vn -0.472038 -0.643086 0.603009 +vn 0.078113 -0.761356 0.643611 +vn -0.132507 -0.734644 0.665387 +vn -0.098830 -0.727218 0.679254 +vn 0.041474 -0.719840 0.692900 +vn 0.112202 -0.706581 0.698680 +vn 0.209777 -0.690552 0.692194 +vn 0.328519 -0.648610 0.686572 +vn 0.327924 -0.633767 0.700575 +vn 0.212216 -0.658508 0.722033 +vn 0.658530 -0.542480 0.521588 +vn -0.541870 0.502924 0.673383 +vn 0.093119 0.634566 0.767239 +vn 0.276022 0.628194 0.727451 +vn 0.257877 0.667479 0.698549 +vn 0.129422 0.704689 0.697613 +vn 0.057278 0.709991 0.701878 +vn -0.044956 0.707296 0.705487 +vn -0.174229 0.685570 0.706851 +vn -0.179082 0.689687 0.701613 +vn -0.051932 0.721687 0.690268 +vn 0.626124 0.606414 0.490133 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +g Cube +usemtl Default +f 365/353/365 354/354/354 353/355/353 364/356/364 +f 366/357/366 355/358/355 354/354/354 365/353/365 +f 367/359/367 356/360/356 355/358/355 366/357/366 +f 368/361/368 357/362/357 356/360/356 367/359/367 +f 369/363/369 358/364/358 357/362/357 368/361/368 +f 370/365/370 359/366/359 358/364/358 369/363/369 +f 371/367/371 360/368/360 359/366/359 370/365/370 +f 372/369/372 361/370/361 360/368/360 371/367/371 +f 373/371/373 362/372/362 361/370/361 372/369/372 +f 374/373/374 363/374/363 362/372/362 373/371/373 +f 376/375/376 375/376/375 353/355/353 354/354/354 +f 377/377/377 376/375/376 354/354/354 355/358/355 +f 378/378/378 377/377/377 355/358/355 356/360/356 +f 379/379/379 378/378/378 356/360/356 357/362/357 +f 380/380/380 379/379/379 357/362/357 358/364/358 +f 381/381/381 380/380/380 358/364/358 359/366/359 +f 382/382/382 381/381/381 359/366/359 360/368/360 +f 383/383/383 382/382/382 360/368/360 361/370/361 +f 384/384/384 383/383/383 361/370/361 362/372/362 +f 385/385/385 384/384/384 362/372/362 363/374/363 +f 386/386/386 385/385/385 363/374/363 374/373/374 +f 387/387/387 386/386/386 374/373/374 373/371/373 +f 388/388/388 387/387/387 373/371/373 372/369/372 +f 389/389/389 388/388/388 372/369/372 371/367/371 +f 390/390/390 389/389/389 371/367/371 370/365/370 +f 391/391/391 390/390/390 370/365/370 369/363/369 +f 392/392/392 391/391/391 369/363/369 368/361/368 +f 393/393/393 392/392/392 368/361/368 367/359/367 +f 394/394/394 393/393/393 367/359/367 366/357/366 +f 395/395/395 394/394/394 366/357/366 365/353/365 +f 396/396/396 395/395/395 365/353/365 364/356/364 +f 375/376/375 396/396/396 364/356/364 353/355/353 +f 398/397/398 397/398/397 375/376/375 376/375/376 +f 399/399/399 398/397/398 376/375/376 377/377/377 +f 400/400/400 399/399/399 377/377/377 378/378/378 +f 401/401/401 400/400/400 378/378/378 379/379/379 +f 402/402/402 401/401/401 379/379/379 380/380/380 +f 403/403/403 402/402/402 380/380/380 381/381/381 +f 404/404/404 403/403/403 381/381/381 382/382/382 +f 405/405/405 404/404/404 382/382/382 383/383/383 +f 406/406/406 405/405/405 383/383/383 384/384/384 +f 407/407/407 406/406/406 384/384/384 385/385/385 +f 408/408/408 407/407/407 385/385/385 386/386/386 +f 409/409/409 408/408/408 386/386/386 387/387/387 +f 410/410/410 409/409/409 387/387/387 388/388/388 +f 411/411/411 410/410/410 388/388/388 389/389/389 +f 412/412/412 411/411/411 389/389/389 390/390/390 +f 413/413/413 412/412/412 390/390/390 391/391/391 +f 414/414/414 413/413/413 391/391/391 392/392/392 +f 415/415/415 414/414/414 392/392/392 393/393/393 +f 416/416/416 415/415/415 393/393/393 394/394/394 +f 417/417/417 416/416/416 394/394/394 395/395/395 +f 418/418/418 417/417/417 395/395/395 396/396/396 +f 397/398/397 418/418/418 396/396/396 375/376/375 +f 420/419/420 419/420/419 397/398/397 398/397/398 +f 421/421/421 420/419/420 398/397/398 399/399/399 +f 422/422/422 421/421/421 399/399/399 400/400/400 +f 423/423/423 422/422/422 400/400/400 401/401/401 +f 424/424/424 423/423/423 401/401/401 402/402/402 +f 425/425/425 424/424/424 402/402/402 403/403/403 +f 426/426/426 425/425/425 403/403/403 404/404/404 +f 427/427/427 426/426/426 404/404/404 405/405/405 +f 428/428/428 427/427/427 405/405/405 406/406/406 +f 429/429/429 428/428/428 406/406/406 407/407/407 +f 430/430/430 429/429/429 407/407/407 408/408/408 +f 431/431/431 430/430/430 408/408/408 409/409/409 +f 432/432/432 431/431/431 409/409/409 410/410/410 +f 433/433/433 432/432/432 410/410/410 411/411/411 +f 434/434/434 433/433/433 411/411/411 412/412/412 +f 435/435/435 434/434/434 412/412/412 413/413/413 +f 436/436/436 435/435/435 413/413/413 414/414/414 +f 437/437/437 436/436/436 414/414/414 415/415/415 +f 438/438/438 437/437/437 415/415/415 416/416/416 +f 439/439/439 438/438/438 416/416/416 417/417/417 +f 440/440/440 439/439/439 417/417/417 418/418/418 +f 419/420/419 440/440/440 418/418/418 397/398/397 +f 442/441/442 441/442/441 419/420/419 420/419/420 +f 443/443/443 442/441/442 420/419/420 421/421/421 +f 444/444/444 443/443/443 421/421/421 422/422/422 +f 445/445/445 444/444/444 422/422/422 423/423/423 +f 446/446/446 445/445/445 423/423/423 424/424/424 +f 447/447/447 446/446/446 424/424/424 425/425/425 +f 448/448/448 447/447/447 425/425/425 426/426/426 +f 449/449/449 448/448/448 426/426/426 427/427/427 +f 450/450/450 449/449/449 427/427/427 428/428/428 +f 451/451/451 450/450/450 428/428/428 429/429/429 +f 452/452/452 451/451/451 429/429/429 430/430/430 +f 453/453/453 452/452/452 430/430/430 431/431/431 +f 454/454/454 453/453/453 431/431/431 432/432/432 +f 455/455/455 454/454/454 432/432/432 433/433/433 +f 456/456/456 455/455/455 433/433/433 434/434/434 +f 457/457/457 456/456/456 434/434/434 435/435/435 +f 458/458/458 457/457/457 435/435/435 436/436/436 +f 459/459/459 458/458/458 436/436/436 437/437/437 +f 460/460/460 459/459/459 437/437/437 438/438/438 +f 461/461/461 460/460/460 438/438/438 439/439/439 +f 462/462/462 461/461/461 439/439/439 440/440/440 +f 441/442/441 462/462/462 440/440/440 419/420/419 +f 464/463/464 463/464/463 441/442/441 442/441/442 +f 465/465/465 464/463/464 442/441/442 443/443/443 +f 466/466/466 465/465/465 443/443/443 444/444/444 +f 467/467/467 466/466/466 444/444/444 445/445/445 +f 468/468/468 467/467/467 445/445/445 446/446/446 +f 469/469/469 468/468/468 446/446/446 447/447/447 +f 470/470/470 469/469/469 447/447/447 448/448/448 +f 471/471/471 470/470/470 448/448/448 449/449/449 +f 472/472/472 471/471/471 449/449/449 450/450/450 +f 473/473/473 472/472/472 450/450/450 451/451/451 +f 474/474/474 473/473/473 451/451/451 452/452/452 +f 475/475/475 474/474/474 452/452/452 453/453/453 +f 476/476/476 475/475/475 453/453/453 454/454/454 +f 477/477/477 476/476/476 454/454/454 455/455/455 +f 478/478/478 477/477/477 455/455/455 456/456/456 +f 479/479/479 478/478/478 456/456/456 457/457/457 +f 480/480/480 479/479/479 457/457/457 458/458/458 +f 481/481/481 480/480/480 458/458/458 459/459/459 +f 482/482/482 481/481/481 459/459/459 460/460/460 +f 483/483/483 482/482/482 460/460/460 461/461/461 +f 484/484/484 483/483/483 461/461/461 462/462/462 +f 463/464/463 484/484/484 462/462/462 441/442/441 +f 486/485/486 485/486/485 463/464/463 464/463/464 +f 487/487/487 486/485/486 464/463/464 465/465/465 +f 488/488/488 487/487/487 465/465/465 466/466/466 +f 489/489/489 488/488/488 466/466/466 467/467/467 +f 490/490/490 489/489/489 467/467/467 468/468/468 +f 491/491/491 490/490/490 468/468/468 469/469/469 +f 492/492/492 491/491/491 469/469/469 470/470/470 +f 493/493/493 492/492/492 470/470/470 471/471/471 +f 494/494/494 493/493/493 471/471/471 472/472/472 +f 495/495/495 494/494/494 472/472/472 473/473/473 +f 496/496/496 495/495/495 473/473/473 474/474/474 +f 497/497/497 496/496/496 474/474/474 475/475/475 +f 498/498/498 497/497/497 475/475/475 476/476/476 +f 499/499/499 498/498/498 476/476/476 477/477/477 +f 500/500/500 499/499/499 477/477/477 478/478/478 +f 501/501/501 500/500/500 478/478/478 479/479/479 +f 502/502/502 501/501/501 479/479/479 480/480/480 +f 503/503/503 502/502/502 480/480/480 481/481/481 +f 504/504/504 503/503/503 481/481/481 482/482/482 +f 505/505/505 504/504/504 482/482/482 483/483/483 +f 506/506/506 505/505/505 483/483/483 484/484/484 +f 485/486/485 506/506/506 484/484/484 463/464/463 +f 508/507/508 507/508/507 485/486/485 486/485/486 +f 509/509/509 508/507/508 486/485/486 487/487/487 +f 510/510/510 509/509/509 487/487/487 488/488/488 +f 511/511/511 510/510/510 488/488/488 489/489/489 +f 512/512/512 511/511/511 489/489/489 490/490/490 +f 513/513/513 512/512/512 490/490/490 491/491/491 +f 514/514/514 513/513/513 491/491/491 492/492/492 +f 515/515/515 514/514/514 492/492/492 493/493/493 +f 516/516/516 515/515/515 493/493/493 494/494/494 +f 517/517/517 516/516/516 494/494/494 495/495/495 +f 518/518/518 517/517/517 495/495/495 496/496/496 +f 519/519/519 518/518/518 496/496/496 497/497/497 +f 520/520/520 519/519/519 497/497/497 498/498/498 +f 521/521/521 520/520/520 498/498/498 499/499/499 +f 522/522/522 521/521/521 499/499/499 500/500/500 +f 523/523/523 522/522/522 500/500/500 501/501/501 +f 524/524/524 523/523/523 501/501/501 502/502/502 +f 525/525/525 524/524/524 502/502/502 503/503/503 +f 526/526/526 525/525/525 503/503/503 504/504/504 +f 527/527/527 526/526/526 504/504/504 505/505/505 +f 528/528/528 527/527/527 505/505/505 506/506/506 +f 507/508/507 528/528/528 506/506/506 485/486/485 +f 530/529/530 529/530/529 507/508/507 508/507/508 +f 531/531/531 530/529/530 508/507/508 509/509/509 +f 532/532/532 531/531/531 509/509/509 510/510/510 +f 533/533/533 532/532/532 510/510/510 511/511/511 +f 534/534/534 533/533/533 511/511/511 512/512/512 +f 535/535/535 534/534/534 512/512/512 513/513/513 +f 536/536/536 535/535/535 513/513/513 514/514/514 +f 537/537/537 536/536/536 514/514/514 515/515/515 +f 538/538/538 537/537/537 515/515/515 516/516/516 +f 539/539/539 538/538/538 516/516/516 517/517/517 +f 540/540/540 539/539/539 517/517/517 518/518/518 +f 541/541/541 540/540/540 518/518/518 519/519/519 +f 542/542/542 541/541/541 519/519/519 520/520/520 +f 543/543/543 542/542/542 520/520/520 521/521/521 +f 544/544/544 543/543/543 521/521/521 522/522/522 +f 545/545/545 544/544/544 522/522/522 523/523/523 +f 546/546/546 545/545/545 523/523/523 524/524/524 +f 547/547/547 546/546/546 524/524/524 525/525/525 +f 548/548/548 547/547/547 525/525/525 526/526/526 +f 549/549/549 548/548/548 526/526/526 527/527/527 +f 550/550/550 549/549/549 527/527/527 528/528/528 +f 529/530/529 550/550/550 528/528/528 507/508/507 +f 552/551/552 551/552/551 529/530/529 530/529/530 +f 553/553/553 552/551/552 530/529/530 531/531/531 +f 554/554/554 553/553/553 531/531/531 532/532/532 +f 555/555/555 554/554/554 532/532/532 533/533/533 +f 556/556/556 555/555/555 533/533/533 534/534/534 +f 557/557/557 556/556/556 534/534/534 535/535/535 +f 558/558/558 557/557/557 535/535/535 536/536/536 +f 559/559/559 558/558/558 536/536/536 537/537/537 +f 560/560/560 559/559/559 537/537/537 538/538/538 +f 561/561/561 560/560/560 538/538/538 539/539/539 +f 562/562/562 561/561/561 539/539/539 540/540/540 +f 563/563/563 562/562/562 540/540/540 541/541/541 +f 564/564/564 563/563/563 541/541/541 542/542/542 +f 565/565/565 564/564/564 542/542/542 543/543/543 +f 566/566/566 565/565/565 543/543/543 544/544/544 +f 567/567/567 566/566/566 544/544/544 545/545/545 +f 568/568/568 567/567/567 545/545/545 546/546/546 +f 569/569/569 568/568/568 546/546/546 547/547/547 +f 570/570/570 569/569/569 547/547/547 548/548/548 +f 571/571/571 570/570/570 548/548/548 549/549/549 +f 572/572/572 571/571/571 549/549/549 550/550/550 +f 551/552/551 572/572/572 550/550/550 529/530/529 +f 574/573/574 585/574/585 584/575/584 573/576/573 +f 575/577/575 586/578/586 585/574/585 574/573/574 +f 576/579/576 587/580/587 586/578/586 575/577/575 +f 577/581/577 588/582/588 587/580/587 576/579/576 +f 578/583/578 589/584/589 588/582/588 577/581/577 +f 579/585/579 590/586/590 589/584/589 578/583/578 +f 580/587/580 591/588/591 590/586/590 579/585/579 +f 581/589/581 592/590/592 591/588/591 580/587/580 +f 582/591/582 593/592/593 592/590/592 581/589/581 +f 583/593/583 594/594/594 593/592/593 582/591/582 +f 574/573/574 573/576/573 551/552/551 552/551/552 +f 575/577/575 574/573/574 552/551/552 553/553/553 +f 576/579/576 575/577/575 553/553/553 554/554/554 +f 577/581/577 576/579/576 554/554/554 555/555/555 +f 578/583/578 577/581/577 555/555/555 556/556/556 +f 579/585/579 578/583/578 556/556/556 557/557/557 +f 580/587/580 579/585/579 557/557/557 558/558/558 +f 581/589/581 580/587/580 558/558/558 559/559/559 +f 582/591/582 581/589/581 559/559/559 560/560/560 +f 583/593/583 582/591/582 560/560/560 561/561/561 +f 594/594/594 583/593/583 561/561/561 562/562/562 +f 593/592/593 594/594/594 562/562/562 563/563/563 +f 592/590/592 593/592/593 563/563/563 564/564/564 +f 591/588/591 592/590/592 564/564/564 565/565/565 +f 590/586/590 591/588/591 565/565/565 566/566/566 +f 589/584/589 590/586/590 566/566/566 567/567/567 +f 588/582/588 589/584/589 567/567/567 568/568/568 +f 587/580/587 588/582/588 568/568/568 569/569/569 +f 586/578/586 587/580/587 569/569/569 570/570/570 +f 585/574/585 586/578/586 570/570/570 571/571/571 +f 584/575/584 585/574/585 571/571/571 572/572/572 +f 573/576/573 584/575/584 572/572/572 551/552/551 +v 37.072704 6.798801 14.612655 +v 35.399620 -1.684892 -2.247932 +v 37.025742 7.748693 14.139361 +v 35.352657 -0.734998 -2.721227 +v 49.019722 6.798801 13.427149 +v 47.346642 -1.684892 -3.433439 +v 48.972759 7.748693 12.953856 +v 47.299675 -0.734998 -3.906734 +vn -0.498026 -0.257760 0.827967 +vn -0.599982 -0.774742 -0.199491 +vn -0.549076 0.774743 0.313511 +vn -0.651030 0.257761 -0.713946 +vn 0.651031 -0.257760 0.713946 +vn 0.549076 -0.774742 -0.313512 +vn 0.599981 0.774743 0.199490 +vn 0.498026 0.257761 -0.827967 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +g Generic +usemtl Default +f 598/595/598 596/596/596 595/597/595 597/598/597 +f 600/599/600 602/600/602 601/601/601 599/602/599 +f 600/599/600 599/602/599 595/597/595 596/596/596 +f 602/600/602 600/599/600 596/596/596 598/595/598 +f 601/601/601 602/600/602 598/595/598 597/598/597 +f 599/602/599 601/601/601 597/598/597 595/597/595 +v 41.590405 7.735011 14.423697 +v 40.583054 2.824299 4.272040 +v 41.588688 13.509675 14.406421 +v 40.583054 13.509675 4.272040 +v 44.149647 7.735011 14.169743 +v 43.142300 2.824299 4.018085 +v 44.147934 13.509675 14.152468 +v 43.142300 13.509675 4.018085 +vn -0.434325 -0.456966 0.776237 +vn -0.719726 -0.617016 -0.318254 +vn -0.517001 0.578506 0.630905 +vn -0.631539 0.577350 -0.517518 +vn 0.578405 -0.456966 0.675744 +vn 0.643145 -0.617016 -0.453492 +vn 0.630907 0.578506 0.516998 +vn 0.517518 0.577350 -0.631539 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +g Generic +usemtl Default +f 606/603/606 604/604/604 603/605/603 605/606/605 +f 608/607/608 610/608/610 609/609/609 607/610/607 +f 608/607/608 607/610/607 603/605/603 604/604/604 +f 610/608/610 608/607/608 604/604/604 606/603/606 +f 609/609/609 610/608/610 606/603/606 605/606/605 +f 607/610/607 609/609/609 605/606/605 603/605/603 +v 38.265141 6.735311 26.120773 +v 37.069580 6.735311 14.072419 +v 38.265141 7.797606 26.120773 +v 37.069580 7.797606 14.072419 +v 49.417778 6.735311 25.014093 +v 48.222221 6.735311 12.965740 +v 49.417778 7.797606 25.014093 +v 48.222221 7.797606 12.965740 +vn -0.517518 -0.577350 0.631539 +vn -0.631539 -0.577350 -0.517518 +vn -0.517518 0.577350 0.631539 +vn -0.631539 0.577350 -0.517518 +vn 0.631539 -0.577350 0.517518 +vn 0.517518 -0.577350 -0.631539 +vn 0.631539 0.577350 0.517518 +vn 0.517518 0.577350 -0.631539 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +g Generic +usemtl Default +f 614/611/614 612/612/612 611/613/611 613/614/613 +f 616/615/616 618/616/618 617/617/617 615/618/615 +f 616/615/616 615/618/615 611/613/611 612/612/612 +f 618/616/618 616/615/616 612/612/612 614/611/614 +f 617/617/617 618/616/618 614/611/614 613/614/613 +f 615/618/615 617/617/617 613/614/613 611/613/611 +v -4.999391 -2.723562 -20.058920 +v -4.799391 -2.723562 -20.058920 +v -4.999391 7.276438 -20.058920 +v -4.799391 7.276438 -20.058920 +v -4.999391 -2.723562 -19.858919 +v -4.799391 -2.723562 -19.858919 +v -4.999391 7.276438 -19.858919 +v -4.799391 7.276438 -19.858919 +vn -0.577350 -0.577350 -0.577350 +vn 0.577350 -0.577350 -0.577350 +vn -0.577350 0.577350 -0.577350 +vn 0.577350 0.577350 -0.577350 +vn -0.577350 -0.577350 0.577350 +vn 0.577350 -0.577350 0.577350 +vn -0.577350 0.577350 0.577350 +vn 0.577350 0.577350 0.577350 +vt 0.995049 0.995049 +vt 0.995049 0.995049 +vt 0.004950 0.995049 +vt 0.004950 0.995049 +vt 0.995049 0.004950 +vt 0.995049 0.004950 +vt 0.004950 0.004950 +vt 0.004950 0.004950 +g Cube +usemtl Default +f 622/619/622 620/620/620 619/621/619 621/622/621 +f 624/623/624 626/624/626 625/625/625 623/626/623 +f 624/623/624 623/626/623 619/621/619 620/620/620 +f 626/624/626 624/623/624 620/620/620 622/619/622 +f 625/625/625 626/624/626 622/619/622 621/622/621 +f 623/626/623 625/625/625 621/622/621 619/621/619 +v -1.781751 7.010753 -9.378036 +v -1.581751 7.010753 -9.378036 +v -1.781751 17.010754 -9.378036 +v -1.581751 17.010754 -9.378036 +v -1.781751 7.010753 -9.178036 +v -1.581751 7.010753 -9.178036 +v -1.781751 17.010754 -9.178036 +v -1.581751 17.010754 -9.178036 +vn -0.577350 -0.577350 -0.577350 +vn 0.577350 -0.577350 -0.577350 +vn -0.577350 0.577350 -0.577350 +vn 0.577350 0.577350 -0.577350 +vn -0.577350 -0.577350 0.577350 +vn 0.577350 -0.577350 0.577350 +vn -0.577350 0.577350 0.577350 +vn 0.577350 0.577350 0.577350 +vt 0.995049 0.995049 +vt 0.995049 0.995049 +vt 0.004950 0.995049 +vt 0.004950 0.995049 +vt 0.995049 0.004950 +vt 0.995049 0.004950 +vt 0.004950 0.004950 +vt 0.004950 0.004950 +g Cube +usemtl Default +f 630/627/630 628/628/628 627/629/627 629/630/629 +f 632/631/632 634/632/634 633/633/633 631/634/631 +f 632/631/632 631/634/631 627/629/627 628/628/628 +f 634/632/634 632/631/632 628/628/628 630/627/630 +f 633/633/633 634/632/634 630/627/630 629/630/629 +f 631/634/631 633/633/633 629/630/629 627/629/627 +v 23.601257 -3.409447 -42.598141 +v 26.639965 -3.297550 -42.968342 +v 29.678680 -2.968940 -43.338543 +v 32.717388 -2.565424 -43.708744 +v 35.756100 -2.398096 -44.078945 +v 38.794811 -2.565424 -44.449146 +v 41.833515 -3.060902 -44.819347 +v 44.872231 -3.737523 -45.189548 +v 47.910938 -4.412263 -45.559750 +v 50.949646 -4.771656 -45.929951 +v 53.988358 -4.869517 -46.300152 +v 23.601257 -2.438035 -42.598141 +v 26.639965 -2.320616 -42.968342 +v 29.678680 -1.985266 -43.338543 +v 32.717388 -1.576197 -43.708744 +v 35.756100 -1.407172 -44.078945 +v 38.794811 -1.576197 -44.449146 +v 41.833515 -2.077228 -44.819347 +v 44.872231 -2.769071 -45.189548 +v 47.910938 -3.449503 -45.559750 +v 50.949646 -3.811076 -45.929951 +v 53.988358 -3.906463 -46.300152 +v 23.971458 -3.356195 -39.559433 +v 27.010166 -2.968940 -39.929634 +v 30.048882 -2.195561 -40.299835 +v 33.087589 -1.397891 -40.670036 +v 36.126301 -1.104276 -41.040237 +v 39.165012 -1.397891 -41.410439 +v 42.203716 -2.265358 -41.780640 +v 45.242432 -3.336131 -42.150841 +v 48.281139 -4.231285 -42.521042 +v 51.319847 -4.658715 -42.891243 +v 54.358559 -4.771657 -43.261444 +v 54.358559 -3.811076 -43.261444 +v 51.319847 -3.698599 -42.891243 +v 48.281139 -3.269352 -42.521042 +v 45.242432 -2.352459 -42.150841 +v 42.203716 -1.248837 -41.780640 +v 39.165012 -0.404662 -41.410439 +v 36.126301 -0.112976 -41.040237 +v 33.087589 -0.404662 -40.670036 +v 30.048882 -1.181921 -40.299835 +v 27.010166 -1.985266 -39.929634 +v 23.971458 -2.384776 -39.559433 +v 24.341660 -3.255616 -36.520721 +v 27.380367 -2.565424 -36.890923 +v 30.419083 -1.397891 -37.261124 +v 33.457790 -0.537756 -37.631325 +v 36.496502 -0.278140 -38.001526 +v 39.535213 -0.537756 -38.371727 +v 42.573917 -1.421056 -38.741928 +v 45.612633 -2.762392 -39.112129 +v 48.651340 -3.792841 -39.482330 +v 51.690048 -4.284532 -39.852531 +v 54.728760 -4.412263 -40.222733 +v 54.728760 -3.449503 -40.222733 +v 51.690048 -3.322612 -39.852531 +v 48.651340 -2.824036 -39.482330 +v 45.612633 -1.767833 -39.112129 +v 42.573917 -0.423386 -38.741928 +v 39.535213 0.459619 -38.371727 +v 36.496502 0.718170 -38.001526 +v 33.457790 0.459619 -37.631325 +v 30.419083 -0.404662 -37.261124 +v 27.380367 -1.576197 -36.890923 +v 24.341660 -2.277591 -36.520721 +v 24.711861 -3.198068 -33.482014 +v 27.750568 -2.398096 -33.852215 +v 30.789284 -1.104276 -34.222416 +v 33.827991 -0.278140 -34.592617 +v 36.866703 -0.053185 -34.962818 +v 39.905415 -0.278140 -35.333019 +v 42.944118 -1.104276 -35.703220 +v 45.982834 -2.449177 -36.073421 +v 49.021542 -3.395026 -36.443623 +v 52.060249 -3.776620 -36.813824 +v 55.098961 -3.849413 -37.184025 +v 55.098961 -2.886490 -37.184025 +v 52.060249 -2.812960 -36.813824 +v 49.021542 -2.415678 -36.443623 +v 45.982834 -1.455851 -36.073421 +v 42.944118 -0.112976 -35.703220 +v 39.905415 0.718170 -35.333019 +v 36.866703 0.937435 -34.962818 +v 33.827991 0.718170 -34.592617 +v 30.789284 -0.112976 -34.222416 +v 27.750568 -1.407172 -33.852215 +v 24.711861 -2.218710 -33.482014 +v 25.082062 -3.255616 -30.443304 +v 28.120770 -2.565424 -30.813505 +v 31.159485 -1.397891 -31.183704 +v 34.198193 -0.537756 -31.553905 +v 37.236904 -0.278140 -31.924107 +v 40.275616 -0.537756 -32.294312 +v 43.314320 -1.397891 -32.664509 +v 46.353035 -2.565424 -33.034710 +v 49.391743 -3.278783 -33.404911 +v 52.430450 -3.476367 -33.775112 +v 55.469162 -3.501402 -34.145313 +v 55.469162 -2.533448 -34.145313 +v 52.430450 -2.507833 -33.775112 +v 49.391743 -2.300760 -33.404911 +v 46.353035 -1.576197 -33.034710 +v 43.314320 -0.404662 -32.664509 +v 40.275616 0.459619 -32.294312 +v 37.236904 0.718170 -31.924107 +v 34.198193 0.459619 -31.553905 +v 31.159485 -0.404662 -31.183704 +v 28.120770 -1.576197 -30.813505 +v 25.082062 -2.277591 -30.443304 +v 25.452263 -3.356195 -27.404594 +v 28.490971 -2.968940 -27.774796 +v 31.529686 -2.195561 -28.144997 +v 34.568394 -1.397891 -28.515198 +v 37.607105 -1.104277 -28.885399 +v 40.645817 -1.397891 -29.255600 +v 43.684521 -2.195561 -29.625801 +v 46.723236 -2.968940 -29.996002 +v 49.761944 -3.356195 -30.366203 +v 52.800652 -3.409447 -30.736404 +v 55.839363 -3.409447 -31.106606 +v 55.839363 -2.438035 -31.106606 +v 52.800652 -2.438035 -30.736404 +v 49.761944 -2.384776 -30.366203 +v 46.723236 -1.985266 -29.996002 +v 43.684521 -1.181921 -29.625801 +v 40.645817 -0.404662 -29.255600 +v 37.607105 -0.112976 -28.885399 +v 34.568394 -0.404662 -28.515198 +v 31.529686 -1.181921 -28.144997 +v 28.490971 -1.985266 -27.774796 +v 25.452263 -2.384776 -27.404594 +v 25.822464 -3.409447 -24.365883 +v 28.861172 -3.293368 -24.736084 +v 31.899887 -2.968940 -25.106285 +v 34.938595 -2.565424 -25.476486 +v 37.977306 -2.398096 -25.846687 +v 41.016018 -2.565424 -26.216888 +v 44.054722 -2.968940 -26.587090 +v 47.093437 -3.297550 -26.957291 +v 50.132145 -3.350677 -27.327492 +v 53.170853 -3.239676 -27.697693 +v 56.209564 -3.176165 -28.067894 +v 56.209564 -2.195984 -28.067894 +v 53.170853 -2.260967 -27.697693 +v 50.132145 -2.379257 -27.327492 +v 47.093437 -2.320616 -26.957291 +v 44.054722 -1.985266 -26.587090 +v 41.016018 -1.576197 -26.216888 +v 37.977306 -1.407172 -25.846687 +v 34.938595 -1.576197 -25.476486 +v 31.899887 -1.985266 -25.106285 +v 28.861172 -2.314560 -24.736084 +v 25.822464 -2.438035 -24.365883 +v 26.192665 -3.044981 -21.327175 +v 29.231373 -2.785754 -21.697376 +v 32.270088 -2.991724 -22.067577 +v 35.308796 -3.219331 -22.437778 +v 38.347507 -3.198068 -22.807980 +v 41.386219 -3.255616 -23.178181 +v 44.424923 -3.356195 -23.548382 +v 47.463638 -3.285955 -23.918583 +v 50.502346 -2.923296 -24.288784 +v 53.541054 -2.477970 -24.658985 +v 56.579765 -2.293303 -25.029186 +v 56.579765 -1.300357 -25.029186 +v 53.541054 -1.486896 -24.658985 +v 50.502346 -1.938351 -24.288784 +v 47.463638 -2.308449 -23.918583 +v 44.424923 -2.384776 -23.548382 +v 41.386219 -2.277591 -23.178181 +v 38.347507 -2.218710 -22.807980 +v 35.308796 -2.242946 -22.437778 +v 32.270088 -2.000064 -22.067577 +v 29.231373 -1.786767 -21.697376 +v 26.192665 -2.053322 -21.327175 +v 26.562866 -1.861028 -18.288465 +v 29.601574 -1.262635 -18.658667 +v 32.640289 -1.861028 -19.028868 +v 35.678997 -3.044981 -19.399069 +v 38.717709 -3.409447 -19.769270 +v 41.756420 -3.409447 -20.139471 +v 44.795124 -3.350677 -20.509672 +v 47.833839 -2.923296 -20.879873 +v 50.872547 -2.069782 -21.250074 +v 53.911255 -1.189459 -21.620275 +v 56.949966 -0.865421 -21.990477 +v 56.949966 0.127940 -21.990477 +v 53.911255 -0.193970 -21.620275 +v 50.872547 -1.051766 -21.250074 +v 47.833839 -1.938351 -20.879873 +v 44.795124 -2.379257 -20.509672 +v 41.756420 -2.438035 -20.139471 +v 38.717709 -2.438035 -19.769270 +v 35.678997 -2.053322 -19.399069 +v 32.640289 -0.836300 -19.028868 +v 29.601574 -0.228566 -18.658667 +v 26.562866 -0.836300 -18.288465 +v 26.933067 -1.262635 -15.249758 +v 29.971775 -0.734991 -15.619959 +v 33.010490 -1.262635 -15.990160 +v 36.049198 -2.785754 -16.360361 +v 39.087910 -3.405265 -16.730562 +v 42.126621 -3.409447 -17.100763 +v 45.165325 -3.239676 -17.470964 +v 48.204041 -2.477970 -17.841166 +v 51.242748 -1.189459 -18.211367 +v 54.281456 -0.240200 -18.581568 +v 57.320168 0.046317 -18.951769 +v 57.320168 1.045207 -18.951769 +v 54.281456 0.759866 -18.581568 +v 51.242748 -0.193970 -18.211367 +v 48.204041 -1.486896 -17.841166 +v 45.165325 -2.260967 -17.470964 +v 42.126621 -2.438035 -17.100763 +v 39.087910 -2.431980 -16.730562 +v 36.049198 -1.786767 -16.360361 +v 33.010490 -0.228566 -15.990160 +v 29.971775 0.279237 -15.619959 +v 26.933067 -0.228566 -15.249758 +v 27.303268 -1.861028 -12.211048 +v 30.341976 -1.262635 -12.581249 +v 33.380692 -1.861028 -12.951450 +v 36.419399 -3.044981 -13.321651 +v 39.458111 -3.409447 -13.691853 +v 42.496822 -3.409447 -14.062054 +v 45.535526 -3.176165 -14.432255 +v 48.574242 -2.293303 -14.802456 +v 51.612949 -0.865421 -15.172657 +v 54.651657 0.046317 -15.542858 +v 57.690369 0.294580 -15.913059 +v 27.303268 -0.836300 -12.211048 +v 30.341976 -0.228566 -12.581249 +v 33.380692 -0.836300 -12.951450 +v 36.419399 -2.053322 -13.321651 +v 39.458111 -2.438035 -13.691853 +v 42.496822 -2.438035 -14.062054 +v 45.535526 -2.195984 -14.432255 +v 48.574242 -1.300357 -14.802456 +v 51.612949 0.127940 -15.172657 +v 54.651657 1.045207 -15.542858 +v 57.690369 1.287191 -15.913059 +vn -0.599026 -0.602062 -0.527910 +vn 0.050826 -0.714581 -0.697704 +vn 0.110539 -0.740282 -0.663147 +vn 0.068305 -0.791033 -0.607948 +vn -0.067464 -0.826818 -0.558408 +vn -0.220365 -0.810985 -0.541980 +vn -0.312818 -0.765434 -0.562366 +vn -0.310167 -0.731317 -0.607431 +vn -0.235293 -0.721301 -0.651431 +vn -0.146453 -0.720505 -0.677808 +vn 0.497112 -0.591272 -0.635041 +vn -0.673059 0.528950 -0.516918 +vn -0.214383 0.627951 -0.748143 +vn -0.244448 0.573498 -0.781886 +vn -0.195686 0.552643 -0.810119 +vn -0.099946 0.558569 -0.823415 +vn 0.008650 0.577861 -0.816090 +vn 0.097853 0.605520 -0.789792 +vn 0.119938 0.639695 -0.759213 +vn 0.058512 0.673582 -0.736793 +vn -0.026391 0.691911 -0.721500 +vn 0.510733 0.564070 -0.648828 +vn -0.636587 -0.765097 0.096869 +vn 0.243364 -0.969112 0.039942 +vn 0.296439 -0.944376 0.142401 +vn 0.202625 -0.945466 0.255022 +vn 0.038919 -0.947516 0.317330 +vn -0.134932 -0.932967 0.333716 +vn -0.273840 -0.911088 0.308108 +vn -0.300219 -0.924670 0.234208 +vn -0.206048 -0.966808 0.151086 +vn -0.082062 -0.991596 0.100012 +vn 0.695273 -0.718229 -0.027242 +vn 0.709541 0.690960 -0.138295 +vn 0.084344 0.992606 -0.087289 +vn 0.215679 0.969716 -0.114603 +vn 0.318789 0.933719 -0.162917 +vn 0.288834 0.927346 -0.237915 +vn 0.139049 0.942800 -0.302974 +vn -0.038532 0.947194 -0.318338 +vn -0.203287 0.933954 -0.293945 +vn -0.303199 0.922896 -0.237346 +vn -0.257204 0.954734 -0.149428 +vn -0.770621 0.637095 0.015922 +vn -0.611009 -0.785914 0.094909 +vn 0.309377 -0.950758 0.018605 +vn 0.330547 -0.939656 0.088237 +vn 0.190193 -0.969929 0.151870 +vn 0.020843 -0.984928 0.171703 +vn -0.150180 -0.970266 0.189817 +vn -0.308041 -0.927864 0.210190 +vn -0.329400 -0.923914 0.194626 +vn -0.204784 -0.965387 0.161530 +vn -0.068907 -0.986607 0.147847 +vn 0.702926 -0.711047 0.017523 +vn 0.700835 0.687586 -0.189883 +vn 0.069750 0.985420 -0.155188 +vn 0.209274 0.964095 -0.163481 +vn 0.335981 0.925650 -0.174037 +vn 0.311741 0.930325 -0.193166 +vn 0.149069 0.969065 -0.196701 +vn -0.021008 0.984904 -0.171823 +vn -0.189856 0.970498 -0.148620 +vn -0.334154 0.933955 -0.126767 +vn -0.317712 0.944096 -0.087989 +vn -0.788491 0.613893 0.037649 +vn -0.613516 -0.786143 0.074682 +vn 0.303138 -0.952222 -0.037151 +vn 0.317442 -0.947484 -0.038790 +vn 0.171703 -0.984929 -0.020833 +vn -0.000031 -1.000000 0.000039 +vn -0.171685 -0.984928 0.020991 +vn -0.320490 -0.946391 0.040385 +vn -0.316495 -0.946991 0.055123 +vn -0.169818 -0.982385 0.077982 +vn -0.041434 -0.992752 0.112813 +vn 0.707821 -0.706351 0.007588 +vn 0.695169 0.693527 -0.189104 +vn 0.039320 0.988596 -0.145367 +vn 0.166981 0.977636 -0.127844 +vn 0.313375 0.945008 -0.093569 +vn 0.319572 0.945981 -0.054709 +vn 0.171636 0.984904 -0.022475 +vn -0.000043 1.000000 -0.000034 +vn -0.171841 0.984904 0.020860 +vn -0.318278 0.947194 0.039025 +vn -0.305022 0.951604 0.037580 +vn -0.781929 0.616023 0.095404 +vn -0.641295 -0.765086 0.058177 +vn 0.228429 -0.969783 -0.085684 +vn 0.261573 -0.951515 -0.161862 +vn 0.151503 -0.969324 -0.193538 +vn -0.021001 -0.984929 -0.171682 +vn -0.193092 -0.969929 -0.148167 +vn -0.296212 -0.945466 -0.135469 +vn -0.250966 -0.963185 -0.096388 +vn -0.112666 -0.993312 -0.025260 +vn -0.018339 -0.999200 0.035536 +vn 0.705864 -0.707020 -0.043341 +vn 0.697463 0.703445 -0.136786 +vn 0.014976 0.997486 -0.069265 +vn 0.106696 0.993220 -0.046144 +vn 0.246332 0.969140 0.009378 +vn 0.293675 0.951714 0.089414 +vn 0.192035 0.969807 0.150325 +vn 0.020851 0.984903 0.171847 +vn -0.150426 0.970143 0.190246 +vn -0.256521 0.945340 0.201317 +vn -0.222547 0.962215 0.156895 +vn -0.754377 0.638420 0.152757 +vn -0.675241 -0.734843 0.063685 +vn 0.118792 -0.989218 -0.085657 +vn 0.157385 -0.966855 -0.201053 +vn 0.094325 -0.951515 -0.292784 +vn -0.038560 -0.947484 -0.317470 +vn -0.165018 -0.939656 -0.299693 +vn -0.209409 -0.944376 -0.253579 +vn -0.142467 -0.975746 -0.166202 +vn -0.038468 -0.997398 -0.060972 +vn 0.011450 -0.999861 0.012149 +vn 0.708895 -0.702842 -0.059000 +vn 0.693587 0.709641 -0.123879 +vn -0.016267 0.998809 -0.046007 +vn 0.030011 0.999395 -0.017564 +vn 0.134792 0.989619 0.049859 +vn 0.203306 0.966094 0.159148 +vn 0.160941 0.951269 0.263029 +vn 0.038904 0.947163 0.318386 +vn -0.086977 0.939483 0.331370 +vn -0.143412 0.943787 0.297824 +vn -0.107136 0.974403 0.197637 +vn -0.721435 0.671438 0.169419 +vn -0.676722 -0.726492 0.119404 +vn 0.044928 -0.998382 0.034851 +vn 0.017094 -0.998543 -0.051192 +vn 0.002788 -0.978146 -0.207902 +vn -0.039266 -0.953079 -0.300165 +vn -0.092341 -0.950757 -0.295861 +vn -0.087286 -0.969736 -0.228021 +vn -0.009467 -0.992899 -0.118585 +vn 0.070787 -0.997491 0.000420 +vn 0.077588 -0.991887 0.100702 +vn 0.729717 -0.683588 0.014874 +vn 0.674057 0.707296 -0.213024 +vn -0.084884 0.983981 -0.156769 +vn -0.083368 0.991253 -0.102311 +vn -0.005273 0.999943 -0.009270 +vn 0.076243 0.990585 0.113699 +vn 0.087305 0.968659 0.232545 +vn 0.040110 0.951586 0.304755 +vn 0.010646 0.952089 0.305636 +vn 0.004997 0.977760 0.209667 +vn -0.034190 0.997958 0.053954 +vn -0.729579 0.680585 0.067219 +vn -0.635657 -0.727218 0.259024 +vn 0.039333 -0.961732 0.271154 +vn -0.137465 -0.957450 0.253757 +vn -0.129258 -0.989870 0.058725 +vn -0.046866 -0.992288 -0.114753 +vn -0.025705 -0.988873 -0.146527 +vn 0.025003 -0.994393 -0.102745 +vn 0.136203 -0.990513 -0.018254 +vn 0.214018 -0.971281 0.103967 +vn 0.172436 -0.955708 0.238511 +vn 0.755635 -0.643259 0.123425 +vn 0.644344 0.685570 -0.338843 +vn -0.176109 0.933268 -0.313044 +vn -0.225667 0.945862 -0.233280 +vn -0.154735 0.981077 -0.116383 +vn -0.037547 0.999278 0.005775 +vn 0.020768 0.994831 0.099400 +vn 0.052134 0.987864 0.146311 +vn 0.157049 0.982054 0.104429 +vn 0.172396 0.982522 -0.070214 +vn -0.031789 0.969133 -0.244480 +vn -0.774993 0.621770 -0.113085 +vn -0.614110 -0.734644 0.288386 +vn 0.037162 -0.955783 0.291717 +vn -0.247938 -0.917069 0.312268 +vn -0.256380 -0.946881 0.194126 +vn -0.076923 -0.996657 0.027514 +vn 0.014613 -0.999399 -0.031445 +vn 0.112773 -0.993474 -0.017085 +vn 0.265926 -0.963190 0.039342 +vn 0.323267 -0.933484 0.155265 +vn 0.220989 -0.934749 0.278224 +vn 0.762125 -0.632263 0.139315 +vn 0.638094 0.689687 -0.342297 +vn -0.221099 0.921316 -0.319831 +vn -0.329283 0.908367 -0.257764 +vn -0.280638 0.945862 -0.163057 +vn -0.124206 0.990379 -0.061016 +vn -0.018246 0.999820 0.005245 +vn 0.086584 0.996041 0.020138 +vn 0.286958 0.956545 -0.051730 +vn 0.272502 0.939816 -0.206126 +vn -0.033691 0.955810 -0.292048 +vn -0.786435 0.608576 -0.105618 +vn -0.643540 -0.761356 0.078699 +vn -0.000319 -1.000000 0.000408 +vn -0.292106 -0.955783 0.033964 +vn -0.280714 -0.959253 0.032134 +vn -0.079081 -0.996824 0.009362 +vn 0.032279 -0.999471 -0.003932 +vn 0.163733 -0.986486 -0.006001 +vn 0.337538 -0.941095 0.020224 +vn 0.360082 -0.927949 0.096185 +vn 0.208215 -0.963843 0.166293 +vn 0.748825 -0.661451 0.041746 +vn 0.657610 0.721687 -0.216142 +vn -0.207816 0.964545 -0.162679 +vn -0.363560 0.921316 -0.137843 +vn -0.346170 0.933268 -0.095798 +vn -0.172563 0.983981 -0.044762 +vn -0.035218 0.999322 -0.010758 +vn 0.082937 0.996504 -0.010097 +vn 0.288978 0.956719 -0.034363 +vn 0.296553 0.954354 -0.035559 +vn -0.000565 1.000000 -0.000442 +vn -0.765765 0.636361 0.092994 +vn -0.472038 -0.643086 0.603009 +vn 0.078113 -0.761356 0.643611 +vn -0.132507 -0.734644 0.665387 +vn -0.098830 -0.727218 0.679254 +vn 0.041474 -0.719840 0.692900 +vn 0.112202 -0.706581 0.698680 +vn 0.209777 -0.690552 0.692194 +vn 0.328519 -0.648610 0.686572 +vn 0.327924 -0.633767 0.700575 +vn 0.212216 -0.658508 0.722033 +vn 0.658530 -0.542480 0.521588 +vn -0.541870 0.502924 0.673383 +vn 0.093119 0.634566 0.767239 +vn 0.276022 0.628194 0.727451 +vn 0.257877 0.667479 0.698549 +vn 0.129422 0.704689 0.697613 +vn 0.057278 0.709991 0.701878 +vn -0.044956 0.707296 0.705487 +vn -0.174229 0.685570 0.706851 +vn -0.179082 0.689687 0.701613 +vn -0.051932 0.721687 0.690268 +vn 0.626124 0.606414 0.490133 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +vt 0.000000 0.000000 +g Cube +usemtl Default +f 647/635/647 636/636/636 635/637/635 646/638/646 +f 648/639/648 637/640/637 636/636/636 647/635/647 +f 649/641/649 638/642/638 637/640/637 648/639/648 +f 650/643/650 639/644/639 638/642/638 649/641/649 +f 651/645/651 640/646/640 639/644/639 650/643/650 +f 652/647/652 641/648/641 640/646/640 651/645/651 +f 653/649/653 642/650/642 641/648/641 652/647/652 +f 654/651/654 643/652/643 642/650/642 653/649/653 +f 655/653/655 644/654/644 643/652/643 654/651/654 +f 656/655/656 645/656/645 644/654/644 655/653/655 +f 658/657/658 657/658/657 635/637/635 636/636/636 +f 659/659/659 658/657/658 636/636/636 637/640/637 +f 660/660/660 659/659/659 637/640/637 638/642/638 +f 661/661/661 660/660/660 638/642/638 639/644/639 +f 662/662/662 661/661/661 639/644/639 640/646/640 +f 663/663/663 662/662/662 640/646/640 641/648/641 +f 664/664/664 663/663/663 641/648/641 642/650/642 +f 665/665/665 664/664/664 642/650/642 643/652/643 +f 666/666/666 665/665/665 643/652/643 644/654/644 +f 667/667/667 666/666/666 644/654/644 645/656/645 +f 668/668/668 667/667/667 645/656/645 656/655/656 +f 669/669/669 668/668/668 656/655/656 655/653/655 +f 670/670/670 669/669/669 655/653/655 654/651/654 +f 671/671/671 670/670/670 654/651/654 653/649/653 +f 672/672/672 671/671/671 653/649/653 652/647/652 +f 673/673/673 672/672/672 652/647/652 651/645/651 +f 674/674/674 673/673/673 651/645/651 650/643/650 +f 675/675/675 674/674/674 650/643/650 649/641/649 +f 676/676/676 675/675/675 649/641/649 648/639/648 +f 677/677/677 676/676/676 648/639/648 647/635/647 +f 678/678/678 677/677/677 647/635/647 646/638/646 +f 657/658/657 678/678/678 646/638/646 635/637/635 +f 680/679/680 679/680/679 657/658/657 658/657/658 +f 681/681/681 680/679/680 658/657/658 659/659/659 +f 682/682/682 681/681/681 659/659/659 660/660/660 +f 683/683/683 682/682/682 660/660/660 661/661/661 +f 684/684/684 683/683/683 661/661/661 662/662/662 +f 685/685/685 684/684/684 662/662/662 663/663/663 +f 686/686/686 685/685/685 663/663/663 664/664/664 +f 687/687/687 686/686/686 664/664/664 665/665/665 +f 688/688/688 687/687/687 665/665/665 666/666/666 +f 689/689/689 688/688/688 666/666/666 667/667/667 +f 690/690/690 689/689/689 667/667/667 668/668/668 +f 691/691/691 690/690/690 668/668/668 669/669/669 +f 692/692/692 691/691/691 669/669/669 670/670/670 +f 693/693/693 692/692/692 670/670/670 671/671/671 +f 694/694/694 693/693/693 671/671/671 672/672/672 +f 695/695/695 694/694/694 672/672/672 673/673/673 +f 696/696/696 695/695/695 673/673/673 674/674/674 +f 697/697/697 696/696/696 674/674/674 675/675/675 +f 698/698/698 697/697/697 675/675/675 676/676/676 +f 699/699/699 698/698/698 676/676/676 677/677/677 +f 700/700/700 699/699/699 677/677/677 678/678/678 +f 679/680/679 700/700/700 678/678/678 657/658/657 +f 702/701/702 701/702/701 679/680/679 680/679/680 +f 703/703/703 702/701/702 680/679/680 681/681/681 +f 704/704/704 703/703/703 681/681/681 682/682/682 +f 705/705/705 704/704/704 682/682/682 683/683/683 +f 706/706/706 705/705/705 683/683/683 684/684/684 +f 707/707/707 706/706/706 684/684/684 685/685/685 +f 708/708/708 707/707/707 685/685/685 686/686/686 +f 709/709/709 708/708/708 686/686/686 687/687/687 +f 710/710/710 709/709/709 687/687/687 688/688/688 +f 711/711/711 710/710/710 688/688/688 689/689/689 +f 712/712/712 711/711/711 689/689/689 690/690/690 +f 713/713/713 712/712/712 690/690/690 691/691/691 +f 714/714/714 713/713/713 691/691/691 692/692/692 +f 715/715/715 714/714/714 692/692/692 693/693/693 +f 716/716/716 715/715/715 693/693/693 694/694/694 +f 717/717/717 716/716/716 694/694/694 695/695/695 +f 718/718/718 717/717/717 695/695/695 696/696/696 +f 719/719/719 718/718/718 696/696/696 697/697/697 +f 720/720/720 719/719/719 697/697/697 698/698/698 +f 721/721/721 720/720/720 698/698/698 699/699/699 +f 722/722/722 721/721/721 699/699/699 700/700/700 +f 701/702/701 722/722/722 700/700/700 679/680/679 +f 724/723/724 723/724/723 701/702/701 702/701/702 +f 725/725/725 724/723/724 702/701/702 703/703/703 +f 726/726/726 725/725/725 703/703/703 704/704/704 +f 727/727/727 726/726/726 704/704/704 705/705/705 +f 728/728/728 727/727/727 705/705/705 706/706/706 +f 729/729/729 728/728/728 706/706/706 707/707/707 +f 730/730/730 729/729/729 707/707/707 708/708/708 +f 731/731/731 730/730/730 708/708/708 709/709/709 +f 732/732/732 731/731/731 709/709/709 710/710/710 +f 733/733/733 732/732/732 710/710/710 711/711/711 +f 734/734/734 733/733/733 711/711/711 712/712/712 +f 735/735/735 734/734/734 712/712/712 713/713/713 +f 736/736/736 735/735/735 713/713/713 714/714/714 +f 737/737/737 736/736/736 714/714/714 715/715/715 +f 738/738/738 737/737/737 715/715/715 716/716/716 +f 739/739/739 738/738/738 716/716/716 717/717/717 +f 740/740/740 739/739/739 717/717/717 718/718/718 +f 741/741/741 740/740/740 718/718/718 719/719/719 +f 742/742/742 741/741/741 719/719/719 720/720/720 +f 743/743/743 742/742/742 720/720/720 721/721/721 +f 744/744/744 743/743/743 721/721/721 722/722/722 +f 723/724/723 744/744/744 722/722/722 701/702/701 +f 746/745/746 745/746/745 723/724/723 724/723/724 +f 747/747/747 746/745/746 724/723/724 725/725/725 +f 748/748/748 747/747/747 725/725/725 726/726/726 +f 749/749/749 748/748/748 726/726/726 727/727/727 +f 750/750/750 749/749/749 727/727/727 728/728/728 +f 751/751/751 750/750/750 728/728/728 729/729/729 +f 752/752/752 751/751/751 729/729/729 730/730/730 +f 753/753/753 752/752/752 730/730/730 731/731/731 +f 754/754/754 753/753/753 731/731/731 732/732/732 +f 755/755/755 754/754/754 732/732/732 733/733/733 +f 756/756/756 755/755/755 733/733/733 734/734/734 +f 757/757/757 756/756/756 734/734/734 735/735/735 +f 758/758/758 757/757/757 735/735/735 736/736/736 +f 759/759/759 758/758/758 736/736/736 737/737/737 +f 760/760/760 759/759/759 737/737/737 738/738/738 +f 761/761/761 760/760/760 738/738/738 739/739/739 +f 762/762/762 761/761/761 739/739/739 740/740/740 +f 763/763/763 762/762/762 740/740/740 741/741/741 +f 764/764/764 763/763/763 741/741/741 742/742/742 +f 765/765/765 764/764/764 742/742/742 743/743/743 +f 766/766/766 765/765/765 743/743/743 744/744/744 +f 745/746/745 766/766/766 744/744/744 723/724/723 +f 768/767/768 767/768/767 745/746/745 746/745/746 +f 769/769/769 768/767/768 746/745/746 747/747/747 +f 770/770/770 769/769/769 747/747/747 748/748/748 +f 771/771/771 770/770/770 748/748/748 749/749/749 +f 772/772/772 771/771/771 749/749/749 750/750/750 +f 773/773/773 772/772/772 750/750/750 751/751/751 +f 774/774/774 773/773/773 751/751/751 752/752/752 +f 775/775/775 774/774/774 752/752/752 753/753/753 +f 776/776/776 775/775/775 753/753/753 754/754/754 +f 777/777/777 776/776/776 754/754/754 755/755/755 +f 778/778/778 777/777/777 755/755/755 756/756/756 +f 779/779/779 778/778/778 756/756/756 757/757/757 +f 780/780/780 779/779/779 757/757/757 758/758/758 +f 781/781/781 780/780/780 758/758/758 759/759/759 +f 782/782/782 781/781/781 759/759/759 760/760/760 +f 783/783/783 782/782/782 760/760/760 761/761/761 +f 784/784/784 783/783/783 761/761/761 762/762/762 +f 785/785/785 784/784/784 762/762/762 763/763/763 +f 786/786/786 785/785/785 763/763/763 764/764/764 +f 787/787/787 786/786/786 764/764/764 765/765/765 +f 788/788/788 787/787/787 765/765/765 766/766/766 +f 767/768/767 788/788/788 766/766/766 745/746/745 +f 790/789/790 789/790/789 767/768/767 768/767/768 +f 791/791/791 790/789/790 768/767/768 769/769/769 +f 792/792/792 791/791/791 769/769/769 770/770/770 +f 793/793/793 792/792/792 770/770/770 771/771/771 +f 794/794/794 793/793/793 771/771/771 772/772/772 +f 795/795/795 794/794/794 772/772/772 773/773/773 +f 796/796/796 795/795/795 773/773/773 774/774/774 +f 797/797/797 796/796/796 774/774/774 775/775/775 +f 798/798/798 797/797/797 775/775/775 776/776/776 +f 799/799/799 798/798/798 776/776/776 777/777/777 +f 800/800/800 799/799/799 777/777/777 778/778/778 +f 801/801/801 800/800/800 778/778/778 779/779/779 +f 802/802/802 801/801/801 779/779/779 780/780/780 +f 803/803/803 802/802/802 780/780/780 781/781/781 +f 804/804/804 803/803/803 781/781/781 782/782/782 +f 805/805/805 804/804/804 782/782/782 783/783/783 +f 806/806/806 805/805/805 783/783/783 784/784/784 +f 807/807/807 806/806/806 784/784/784 785/785/785 +f 808/808/808 807/807/807 785/785/785 786/786/786 +f 809/809/809 808/808/808 786/786/786 787/787/787 +f 810/810/810 809/809/809 787/787/787 788/788/788 +f 789/790/789 810/810/810 788/788/788 767/768/767 +f 812/811/812 811/812/811 789/790/789 790/789/790 +f 813/813/813 812/811/812 790/789/790 791/791/791 +f 814/814/814 813/813/813 791/791/791 792/792/792 +f 815/815/815 814/814/814 792/792/792 793/793/793 +f 816/816/816 815/815/815 793/793/793 794/794/794 +f 817/817/817 816/816/816 794/794/794 795/795/795 +f 818/818/818 817/817/817 795/795/795 796/796/796 +f 819/819/819 818/818/818 796/796/796 797/797/797 +f 820/820/820 819/819/819 797/797/797 798/798/798 +f 821/821/821 820/820/820 798/798/798 799/799/799 +f 822/822/822 821/821/821 799/799/799 800/800/800 +f 823/823/823 822/822/822 800/800/800 801/801/801 +f 824/824/824 823/823/823 801/801/801 802/802/802 +f 825/825/825 824/824/824 802/802/802 803/803/803 +f 826/826/826 825/825/825 803/803/803 804/804/804 +f 827/827/827 826/826/826 804/804/804 805/805/805 +f 828/828/828 827/827/827 805/805/805 806/806/806 +f 829/829/829 828/828/828 806/806/806 807/807/807 +f 830/830/830 829/829/829 807/807/807 808/808/808 +f 831/831/831 830/830/830 808/808/808 809/809/809 +f 832/832/832 831/831/831 809/809/809 810/810/810 +f 811/812/811 832/832/832 810/810/810 789/790/789 +f 834/833/834 833/834/833 811/812/811 812/811/812 +f 835/835/835 834/833/834 812/811/812 813/813/813 +f 836/836/836 835/835/835 813/813/813 814/814/814 +f 837/837/837 836/836/836 814/814/814 815/815/815 +f 838/838/838 837/837/837 815/815/815 816/816/816 +f 839/839/839 838/838/838 816/816/816 817/817/817 +f 840/840/840 839/839/839 817/817/817 818/818/818 +f 841/841/841 840/840/840 818/818/818 819/819/819 +f 842/842/842 841/841/841 819/819/819 820/820/820 +f 843/843/843 842/842/842 820/820/820 821/821/821 +f 844/844/844 843/843/843 821/821/821 822/822/822 +f 845/845/845 844/844/844 822/822/822 823/823/823 +f 846/846/846 845/845/845 823/823/823 824/824/824 +f 847/847/847 846/846/846 824/824/824 825/825/825 +f 848/848/848 847/847/847 825/825/825 826/826/826 +f 849/849/849 848/848/848 826/826/826 827/827/827 +f 850/850/850 849/849/849 827/827/827 828/828/828 +f 851/851/851 850/850/850 828/828/828 829/829/829 +f 852/852/852 851/851/851 829/829/829 830/830/830 +f 853/853/853 852/852/852 830/830/830 831/831/831 +f 854/854/854 853/853/853 831/831/831 832/832/832 +f 833/834/833 854/854/854 832/832/832 811/812/811 +f 856/855/856 867/856/867 866/857/866 855/858/855 +f 857/859/857 868/860/868 867/856/867 856/855/856 +f 858/861/858 869/862/869 868/860/868 857/859/857 +f 859/863/859 870/864/870 869/862/869 858/861/858 +f 860/865/860 871/866/871 870/864/870 859/863/859 +f 861/867/861 872/868/872 871/866/871 860/865/860 +f 862/869/862 873/870/873 872/868/872 861/867/861 +f 863/871/863 874/872/874 873/870/873 862/869/862 +f 864/873/864 875/874/875 874/872/874 863/871/863 +f 865/875/865 876/876/876 875/874/875 864/873/864 +f 856/855/856 855/858/855 833/834/833 834/833/834 +f 857/859/857 856/855/856 834/833/834 835/835/835 +f 858/861/858 857/859/857 835/835/835 836/836/836 +f 859/863/859 858/861/858 836/836/836 837/837/837 +f 860/865/860 859/863/859 837/837/837 838/838/838 +f 861/867/861 860/865/860 838/838/838 839/839/839 +f 862/869/862 861/867/861 839/839/839 840/840/840 +f 863/871/863 862/869/862 840/840/840 841/841/841 +f 864/873/864 863/871/863 841/841/841 842/842/842 +f 865/875/865 864/873/864 842/842/842 843/843/843 +f 876/876/876 865/875/865 843/843/843 844/844/844 +f 875/874/875 876/876/876 844/844/844 845/845/845 +f 874/872/874 875/874/875 845/845/845 846/846/846 +f 873/870/873 874/872/874 846/846/846 847/847/847 +f 872/868/872 873/870/873 847/847/847 848/848/848 +f 871/866/871 872/868/872 848/848/848 849/849/849 +f 870/864/870 871/866/871 849/849/849 850/850/850 +f 869/862/869 870/864/870 850/850/850 851/851/851 +f 868/860/868 869/862/869 851/851/851 852/852/852 +f 867/856/867 868/860/868 852/852/852 853/853/853 +f 866/857/866 867/856/867 853/853/853 854/854/854 +f 855/858/855 866/857/866 854/854/854 833/834/833 +v 38.838924 -2.723562 -29.694302 +v 39.038925 -2.723562 -29.694302 +v 38.838924 7.276438 -29.694302 +v 39.038925 7.276438 -29.694302 +v 38.838924 -2.723562 -29.494301 +v 39.038925 -2.723562 -29.494301 +v 38.838924 7.276438 -29.494301 +v 39.038925 7.276438 -29.494301 +vn -0.577350 -0.577350 -0.577350 +vn 0.577350 -0.577350 -0.577350 +vn -0.577350 0.577350 -0.577350 +vn 0.577350 0.577350 -0.577350 +vn -0.577350 -0.577350 0.577350 +vn 0.577350 -0.577350 0.577350 +vn -0.577350 0.577350 0.577350 +vn 0.577350 0.577350 0.577350 +vt 0.995049 0.995049 +vt 0.995049 0.995049 +vt 0.004950 0.995049 +vt 0.004950 0.995049 +vt 0.995049 0.004950 +vt 0.995049 0.004950 +vt 0.004950 0.004950 +vt 0.004950 0.004950 +g Cube +usemtl Default +f 880/877/880 878/878/878 877/879/877 879/880/879 +f 882/881/882 884/882/884 883/883/883 881/884/881 +f 882/881/882 881/884/881 877/879/877 878/878/878 +f 884/882/884 882/881/882 878/878/878 880/877/880 +f 883/883/883 884/882/884 880/877/880 879/880/879 +f 881/884/881 883/883/883 879/880/879 877/879/877 diff --git a/dep/recastnavigation/RecastDemo/Bin/Recast.app/Contents/Info.plist b/dep/recastnavigation/RecastDemo/Bin/Recast.app/Contents/Info.plist new file mode 100644 index 000000000..a29bbdcae --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Bin/Recast.app/Contents/Info.plist @@ -0,0 +1,28 @@ + + + + + CFBundleDevelopmentRegion + English + CFBundleExecutable + Recast + CFBundleIconFile + Icon.icns + CFBundleIdentifier + com.yourcompany.Recast + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + Recast + CFBundlePackageType + APPL + CFBundleSignature + ???? + CFBundleVersion + 1.0 + NSMainNibFile + MainMenu + NSPrincipalClass + NSApplication + + diff --git a/dep/recastnavigation/RecastDemo/Bin/Recast.app/Contents/MacOS/Recast b/dep/recastnavigation/RecastDemo/Bin/Recast.app/Contents/MacOS/Recast new file mode 100644 index 000000000..69914d308 Binary files /dev/null and b/dep/recastnavigation/RecastDemo/Bin/Recast.app/Contents/MacOS/Recast differ diff --git a/dep/recastnavigation/RecastDemo/Bin/Recast.app/Contents/PkgInfo b/dep/recastnavigation/RecastDemo/Bin/Recast.app/Contents/PkgInfo new file mode 100644 index 000000000..bd04210fb --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Bin/Recast.app/Contents/PkgInfo @@ -0,0 +1 @@ +APPL???? \ No newline at end of file diff --git a/dep/recastnavigation/RecastDemo/Bin/Recast.app/Contents/Resources/English.lproj/InfoPlist.strings b/dep/recastnavigation/RecastDemo/Bin/Recast.app/Contents/Resources/English.lproj/InfoPlist.strings new file mode 100644 index 000000000..dea12de4c Binary files /dev/null and b/dep/recastnavigation/RecastDemo/Bin/Recast.app/Contents/Resources/English.lproj/InfoPlist.strings differ diff --git a/dep/recastnavigation/RecastDemo/Bin/Recast.app/Contents/Resources/English.lproj/MainMenu.nib b/dep/recastnavigation/RecastDemo/Bin/Recast.app/Contents/Resources/English.lproj/MainMenu.nib new file mode 100644 index 000000000..7518524c9 Binary files /dev/null and b/dep/recastnavigation/RecastDemo/Bin/Recast.app/Contents/Resources/English.lproj/MainMenu.nib differ diff --git a/dep/recastnavigation/RecastDemo/Bin/SDL.dll b/dep/recastnavigation/RecastDemo/Bin/SDL.dll new file mode 100644 index 000000000..3ce97a59d Binary files /dev/null and b/dep/recastnavigation/RecastDemo/Bin/SDL.dll differ diff --git a/dep/recastnavigation/RecastDemo/Bin/Tests/movement_test.txt b/dep/recastnavigation/RecastDemo/Bin/Tests/movement_test.txt new file mode 100644 index 000000000..b80a401da --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Bin/Tests/movement_test.txt @@ -0,0 +1,15 @@ +s Solo Mesh Simple +f movement.obj +pf -100.539185 -1.000000 54.028996 62.582016 15.757828 52.842243 0x3 0x0 +pf -100.539185 -1.000000 54.028996 -1.259964 -1.000000 50.116970 0x3 0x0 +pf -100.539185 -1.000000 54.028996 1.598934 -1.000000 23.528656 0x3 0x0 +pf -100.539185 -1.000000 54.028996 3.652847 -1.000000 -5.022881 0x3 0x0 +pf -100.539185 -1.000000 54.028996 -39.182816 8.999985 -24.697731 0x3 0x0 +pf -100.539185 -1.000000 54.028996 -66.847992 -1.000000 -28.908646 0x3 0x0 +pf -100.539185 -1.000000 54.028996 -90.966019 -1.000000 -3.219864 0x3 0x0 +pf -43.394421 -1.000000 13.312424 -90.966019 -1.000000 -3.219864 0x3 0x0 +pf -43.394421 -1.000000 13.312424 -36.447182 3.999992 -25.008087 0x3 0x0 +pf -43.394421 -1.000000 13.312424 26.394167 15.757812 -13.491264 0x3 0x0 +pf -43.394421 -1.000000 13.312424 -4.140746 6.944923 4.888435 0x3 0x0 +pf -43.394421 -1.000000 13.312424 -73.532791 -1.062469 23.137051 0x3 0x0 +pf -43.394421 -1.000000 13.312424 -72.902054 7.996834 15.076473 0x3 0x0 \ No newline at end of file diff --git a/dep/recastnavigation/RecastDemo/Bin/Tests/nav_mesh_test.txt b/dep/recastnavigation/RecastDemo/Bin/Tests/nav_mesh_test.txt new file mode 100644 index 000000000..aca6e1285 --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Bin/Tests/nav_mesh_test.txt @@ -0,0 +1,23 @@ +s Solo Mesh Simple +f nav_test.obj +pf 18.138550 -2.370003 -21.319118 -19.206181 -2.369133 24.802742 0x3 0x0 +pf 18.252758 -2.368240 -7.000238 -19.206181 -2.369133 24.802742 0x3 0x0 +pf 18.252758 -2.368240 -7.000238 -22.759071 -2.369453 2.003946 0x3 0x0 +pf 18.252758 -2.368240 -7.000238 -24.483898 -2.369728 -6.778278 0x3 0x0 +pf 18.252758 -2.368240 -7.000238 -24.068850 -2.370285 -18.879251 0x3 0x0 +pf 18.252758 -2.368240 -7.000238 12.124170 -2.369637 -21.222471 0x3 0x0 +pf 10.830146 -2.366791 19.002508 12.124170 -2.369637 -21.222471 0x3 0x0 +pf 10.830146 -2.366791 19.002508 -7.146484 -2.368736 -16.031403 0x3 0x0 +pf 10.830146 -2.366791 19.002508 -21.615391 -2.368706 -3.264029 0x3 0x0 +pf 10.830146 -2.366791 19.002508 -22.651268 -2.369354 1.053217 0x3 0x0 +pf 10.830146 -2.366791 19.002508 19.181122 -2.368134 3.011776 0x3 0x0 +pf 10.830146 -2.366791 19.002508 19.041592 -2.368713 -7.404587 0x3 0x0 +pf 6.054083 -2.365402 3.330421 19.041592 -2.368713 -7.404587 0x3 0x0 +pf 6.054083 -2.365402 3.330421 21.846087 -2.368568 17.918859 0x3 0x0 +pf 6.054083 -2.365402 3.330421 0.967449 -2.368439 25.767756 0x3 0x0 +pf 6.054083 -2.365402 3.330421 -17.518076 -2.368477 26.569633 0x3 0x0 +pf 6.054083 -2.365402 3.330421 -22.141787 -2.369209 2.440046 0x3 0x0 +pf 6.054083 -2.365402 3.330421 -23.296972 -2.369797 -17.411043 0x3 0x0 +pf 6.054083 -2.365402 3.330421 -1.564062 -2.369926 -20.452827 0x3 0x0 +pf 6.054083 -2.365402 3.330421 16.905643 -2.370193 -21.811655 0x3 0x0 +pf 6.054083 -2.365402 3.330421 19.289761 -2.368813 -6.954918 0x3 0x0 diff --git a/dep/recastnavigation/RecastDemo/Bin/test.chf b/dep/recastnavigation/RecastDemo/Bin/test.chf new file mode 100644 index 000000000..393d1b29d Binary files /dev/null and b/dep/recastnavigation/RecastDemo/Bin/test.chf differ diff --git a/dep/recastnavigation/RecastDemo/Build/GNUMake/Common.mk b/dep/recastnavigation/RecastDemo/Build/GNUMake/Common.mk new file mode 100644 index 000000000..85f7772b0 --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Build/GNUMake/Common.mk @@ -0,0 +1,7 @@ +OBJECTS = $(patsubst $(NAME)/Source/%.cpp,$(OBJ)/%.o,$(wildcard $(NAME)/Source/*.cpp)) +CPPFLAGS += -I$(NAME)/Include + +$(OBJ)/%.o: $(NAME)/Source/%.cpp + c++ $(CPPFLAGS) -c -o $@ $< + +.PHONY: clean \ No newline at end of file diff --git a/dep/recastnavigation/RecastDemo/Build/GNUMake/DebugUtils.mk b/dep/recastnavigation/RecastDemo/Build/GNUMake/DebugUtils.mk new file mode 100644 index 000000000..0a5d66036 --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Build/GNUMake/DebugUtils.mk @@ -0,0 +1,19 @@ +NAME = DebugUtils + +SOURCES = \ + DebugDraw.cpp \ + DetourDebugDraw.cpp \ + RecastDebugDraw.cpp \ + RecastDump.cpp + +HEADERS = \ + DebugDraw.h \ + DetourDebugDraw.h \ + RecastDebugDraw.h \ + RecastDump.h + +CPPFLAGS = \ + -I Detour/Include \ + -I Recast/Include + +include $(BUILD)/HelperLibrary.mk \ No newline at end of file diff --git a/dep/recastnavigation/RecastDemo/Build/GNUMake/Detour.mk b/dep/recastnavigation/RecastDemo/Build/GNUMake/Detour.mk new file mode 100644 index 000000000..aefd3ce72 --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Build/GNUMake/Detour.mk @@ -0,0 +1,22 @@ +NAME = Detour + +SOURCES = \ + DetourAlloc.cpp \ + DetourCommon.cpp \ + DetourNavMesh.cpp \ + DetourNavMeshBuilder.cpp \ + DetourNavMeshQuery.cpp \ + DetourNode.cpp \ + DetourObstacleAvoidance.cpp + +HEADERS = \ + DetourAlloc.h \ + DetourAssert.h \ + DetourCommon.h \ + DetourNavMesh.h \ + DetourNavMeshBuilder.h \ + DetourNavMeshQuery.h \ + DetourNode.h \ + DetourObstacleAvoidance.h + +include $(BUILD)/Library.mk \ No newline at end of file diff --git a/dep/recastnavigation/RecastDemo/Build/GNUMake/HelperLibrary.mk b/dep/recastnavigation/RecastDemo/Build/GNUMake/HelperLibrary.mk new file mode 100644 index 000000000..15042cef3 --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Build/GNUMake/HelperLibrary.mk @@ -0,0 +1,7 @@ +include $(BUILD)/Common.mk + +$(BIN)/$(NAME).a: $(OBJECTS) + ar -q $@ $(OBJECTS) + +clean: + rm -f $(BIN)/$(NAME).a $(OBJECTS) \ No newline at end of file diff --git a/dep/recastnavigation/RecastDemo/Build/GNUMake/Library.mk b/dep/recastnavigation/RecastDemo/Build/GNUMake/Library.mk new file mode 100644 index 000000000..10745fb5e --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Build/GNUMake/Library.mk @@ -0,0 +1,10 @@ +include $(BUILD)/Common.mk + +CPPFLAGS += -fPIC +LDFLAGS += -shared + +$(BIN)/lib$(NAME).so: $(OBJECTS) + c++ $(LDFLAGS) -o $@ $(OBJECTS) $(LIBS) + +clean: + rm -f $(BIN)/lib$(NAME).so $(OBJECTS) \ No newline at end of file diff --git a/dep/recastnavigation/RecastDemo/Build/GNUMake/Program.mk b/dep/recastnavigation/RecastDemo/Build/GNUMake/Program.mk new file mode 100644 index 000000000..62f600d96 --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Build/GNUMake/Program.mk @@ -0,0 +1,7 @@ +include $(BUILD)/Common.mk + +$(BIN)/$(NAME): $(OBJECTS) + c++ $(LDFLAGS) -o $@ $(OBJECTS) $(LIBS) + +clean: + rm -f $(BIN)/$(NAME).a $(OBJECTS) \ No newline at end of file diff --git a/dep/recastnavigation/RecastDemo/Build/GNUMake/Recast.mk b/dep/recastnavigation/RecastDemo/Build/GNUMake/Recast.mk new file mode 100644 index 000000000..c25ee3460 --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Build/GNUMake/Recast.mk @@ -0,0 +1,18 @@ +NAME = Recast + +OBJECTS = \ + Recast.cpp \ + RecastAlloc.cpp \ + RecastArea.cpp \ + RecastFilter.cpp \ + RecastMesh.cpp \ + RecastMeshDetail.cpp \ + RecastRasterization.cpp \ + RecastRegion.cpp + +HEADERS = \ + Recast.h \ + RecastAlloc.h \ + RecastAssert.h + +include $(BUILD)/Library.mk \ No newline at end of file diff --git a/dep/recastnavigation/RecastDemo/Build/GNUMake/RecastDemo.mk b/dep/recastnavigation/RecastDemo/Build/GNUMake/RecastDemo.mk new file mode 100644 index 000000000..42f6b5e92 --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Build/GNUMake/RecastDemo.mk @@ -0,0 +1,70 @@ +NAME = RecastDemo + +SOURCES = \ + ChunkyTriMesh.cpp \ + ConvexVolumeTool.cpp \ + CrowdManager.cpp \ + CrowdTool.cpp \ + Filelist.cpp \ + foo \ + imgui.cpp \ + imguiRenderGL.cpp \ + InputGeom.cpp \ + main.cpp \ + MeshLoaderObj.cpp \ + NavMeshTesterTool.cpp \ + OffMeshConnectionTool.cpp \ + PerfTimer.cpp \ + Sample.cpp \ + Sample_Debug.cpp \ + SampleInterfaces.cpp \ + Sample_SoloMeshSimple.cpp \ + Sample_SoloMeshTiled.cpp \ + Sample_TileMesh.cpp \ + SDLMain.m \ + SlideShow.cpp \ + TestCase.cpp \ + ValueHistory.cpp + +HEADERS = \ + ChunkyTriMesh.h \ + ConvexVolumeTool.h \ + CrowdManager.h \ + CrowdTool.h \ + Filelist.h \ + foo \ + imgui.h \ + imguiRenderGL.h \ + InputGeom.h \ + MeshLoaderObj.h \ + NavMeshTesterTool.h \ + OffMeshConnectionTool.h \ + PerfTimer.h \ + Sample_Debug.h \ + Sample.h \ + SampleInterfaces.h \ + Sample_SoloMeshSimple.h \ + Sample_SoloMeshTiled.h \ + Sample_TileMesh.h \ + SDLMain.h \ + SlideShow.h \ + TestCase.h \ + ValueHistory.h + +CPPFLAGS = \ + -I $(NAME)/Contrib \ + -I DebugUtils/Include \ + -I Detour/Include \ + -I Recast/Include \ + `pkg-config --cflags sdl` + +LDFLAGS = \ + -L $(BIN) \ + -lDetour \ + -lRecast \ + -lGL -lGLU \ + `pkg-config --libs sdl` + +LIBS = $(BIN)/DebugUtils.a + +include $(BUILD)/Program.mk \ No newline at end of file diff --git a/dep/recastnavigation/RecastDemo/Build/Icon.png b/dep/recastnavigation/RecastDemo/Build/Icon.png new file mode 100644 index 000000000..d97650264 Binary files /dev/null and b/dep/recastnavigation/RecastDemo/Build/Icon.png differ diff --git a/dep/recastnavigation/RecastDemo/Build/VC10/.gitignore b/dep/recastnavigation/RecastDemo/Build/VC10/.gitignore new file mode 100644 index 000000000..3d47d8f18 --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Build/VC10/.gitignore @@ -0,0 +1,3 @@ + +Debug +Release \ No newline at end of file diff --git a/dep/recastnavigation/RecastDemo/Build/VC10/Recast.sln b/dep/recastnavigation/RecastDemo/Build/VC10/Recast.sln new file mode 100644 index 000000000..fc82053c6 --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Build/VC10/Recast.sln @@ -0,0 +1,20 @@ + +Microsoft Visual Studio Solution File, Format Version 11.00 +# Visual Studio 2010 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Recast", "Recast.vcxproj", "{CEF242C5-E9A3-403B-BAFF-99397BDA5730}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Win32 = Debug|Win32 + Release|Win32 = Release|Win32 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {CEF242C5-E9A3-403B-BAFF-99397BDA5730}.Debug|Win32.ActiveCfg = Debug|Win32 + {CEF242C5-E9A3-403B-BAFF-99397BDA5730}.Debug|Win32.Build.0 = Debug|Win32 + {CEF242C5-E9A3-403B-BAFF-99397BDA5730}.Release|Win32.ActiveCfg = Release|Win32 + {CEF242C5-E9A3-403B-BAFF-99397BDA5730}.Release|Win32.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/dep/recastnavigation/RecastDemo/Build/VC10/Recast.vcxproj b/dep/recastnavigation/RecastDemo/Build/VC10/Recast.vcxproj new file mode 100644 index 000000000..2ed44c3cd --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Build/VC10/Recast.vcxproj @@ -0,0 +1,180 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + + {CEF242C5-E9A3-403B-BAFF-99397BDA5730} + Recast + Win32Proj + + + + Application + Unicode + true + + + Application + Unicode + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + ..\..\Bin\ + $(Configuration)\ + false + ..\..\Bin\ + $(Configuration)\ + false + + + + Disabled + ..\..\Contrib\SDL\include;..\..\Include;..\..\..\Detour\Include;..\..\..\DebugUtils\Include;..\..\..\Recast\Include;..\..\Contrib + WIN32;_DEBUG;_WINDOWS;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebugDLL + + + Level3 + EditAndContinue + + + opengl32.lib;glu32.lib;sdlmain.lib;sdl.lib;%(AdditionalDependencies) + ..\..\Contrib\SDL\lib;%(AdditionalLibraryDirectories) + true + Windows + MachineX86 + + + + + MaxSpeed + true + ..\..\..\DebugUtils\Include;..\..\Contrib\SDL\include;..\..\Include;..\..\..\Detour\Include;..\..\..\Recast\Include;..\..\Contrib;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + MultiThreadedDLL + true + + + Level4 + ProgramDatabase + + + opengl32.lib;glu32.lib;sdlmain.lib;sdl.lib;%(AdditionalDependencies) + ..\..\Contrib\SDL\lib;%(AdditionalLibraryDirectories) + true + Windows + true + true + MachineX86 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/dep/recastnavigation/RecastDemo/Build/VC10/Recast.vcxproj.filters b/dep/recastnavigation/RecastDemo/Build/VC10/Recast.vcxproj.filters new file mode 100644 index 000000000..5e369839e --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Build/VC10/Recast.vcxproj.filters @@ -0,0 +1,295 @@ + + + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav + + + {84bf8ba9-f9d0-4ed2-8f08-b34832ccfa4c} + + + {5e4b8ced-36a6-4e52-b2be-c85846cfa532} + + + {d6907ba5-317a-4288-a1cf-0987bdce1203} + + + {82977c1d-c20c-41d6-a10c-0a8d4267ac92} + + + {61aeb09b-9567-453b-bb3f-71081e070e14} + + + {daaf8ba1-489c-4311-b413-09a59326ac7a} + + + {d0925230-3864-4117-8a75-6effa47637ee} + + + {acdba4c2-12d6-4152-a648-316ce4352942} + + + {611fd29f-d10e-4838-84de-7a3cfbb50938} + + + {fe143be5-42bb-448c-89ac-64ce6b8085a7} + + + {33d54d81-b560-489c-9e6f-98eea5e392eb} + + + {397247ef-dd89-4c1f-9aa6-3530fd912461} + + + + + Recast\Include + + + Recast\Include + + + Recast\Include + + + Detour\Include + + + Detour\Include + + + Detour\Include + + + Detour\Include + + + Detour\Include + + + Detour\Include + + + Detour\Include + + + Detour\Include + + + Demo\Include + + + Demo\Include + + + Demo\Include + + + Demo\Include + + + Demo\Include + + + Demo\Include + + + Demo\Include + + + Demo\Include + + + Demo\Include + + + Demo\Include + + + Demo\Include + + + Demo\Include + + + Demo\Include + + + Demo\Include + + + Demo\Include + + + Demo\Include + + + Demo\Include + + + Demo\Include + + + Demo\Include + + + Demo\Include + + + Demo\Include + + + Demo\Include + + + Demo\Include + + + Demo\Include + + + DebugUtils\Include + + + DebugUtils\Include + + + DebugUtils\Include + + + DebugUtils\Include + + + + + Recast\Source + + + Recast\Source + + + Recast\Source + + + Recast\Source + + + Recast\Source + + + Recast\Source + + + Recast\Source + + + Recast\Source + + + Recast\Source + + + Detour\Source + + + Detour\Source + + + Detour\Source + + + Detour\Source + + + Detour\Source + + + Detour\Source + + + Detour\Source + + + Demo\Source + + + Demo\Source + + + Demo\Source + + + Demo\Source + + + Demo\Source + + + Demo\Source + + + Demo\Source + + + Demo\Source + + + Demo\Source + + + Demo\Source + + + Demo\Source + + + Demo\Source + + + Demo\Source + + + Demo\Source + + + Demo\Source + + + Demo\Source + + + Demo\Source + + + Demo\Source + + + Demo\Source + + + Demo\Source + + + Demo\Source + + + Demo\Source + + + Demo\Source + + + DebugUtils\Source + + + DebugUtils\Source + + + DebugUtils\Source + + + DebugUtils\Source + + + \ No newline at end of file diff --git a/dep/recastnavigation/RecastDemo/Build/VC9/.gitignore b/dep/recastnavigation/RecastDemo/Build/VC9/.gitignore new file mode 100644 index 000000000..3d47d8f18 --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Build/VC9/.gitignore @@ -0,0 +1,3 @@ + +Debug +Release \ No newline at end of file diff --git a/dep/recastnavigation/RecastDemo/Build/VC9/Recast.sln b/dep/recastnavigation/RecastDemo/Build/VC9/Recast.sln new file mode 100644 index 000000000..c38dcd507 --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Build/VC9/Recast.sln @@ -0,0 +1,20 @@ + +Microsoft Visual Studio Solution File, Format Version 10.00 +# Visual C++ Express 2008 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Recast", "Recast.vcproj", "{CEF242C5-E9A3-403B-BAFF-99397BDA5730}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Win32 = Debug|Win32 + Release|Win32 = Release|Win32 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {CEF242C5-E9A3-403B-BAFF-99397BDA5730}.Debug|Win32.ActiveCfg = Debug|Win32 + {CEF242C5-E9A3-403B-BAFF-99397BDA5730}.Debug|Win32.Build.0 = Debug|Win32 + {CEF242C5-E9A3-403B-BAFF-99397BDA5730}.Release|Win32.ActiveCfg = Release|Win32 + {CEF242C5-E9A3-403B-BAFF-99397BDA5730}.Release|Win32.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/dep/recastnavigation/RecastDemo/Build/VC9/Recast.vcproj b/dep/recastnavigation/RecastDemo/Build/VC9/Recast.vcproj new file mode 100644 index 000000000..c22a2262a --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Build/VC9/Recast.vcproj @@ -0,0 +1,559 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/dep/recastnavigation/RecastDemo/Build/Xcode/English.lproj/InfoPlist.strings b/dep/recastnavigation/RecastDemo/Build/Xcode/English.lproj/InfoPlist.strings new file mode 100644 index 000000000..5e45963c3 Binary files /dev/null and b/dep/recastnavigation/RecastDemo/Build/Xcode/English.lproj/InfoPlist.strings differ diff --git a/dep/recastnavigation/RecastDemo/Build/Xcode/English.lproj/MainMenu.xib b/dep/recastnavigation/RecastDemo/Build/Xcode/English.lproj/MainMenu.xib new file mode 100644 index 000000000..3a7530a73 --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Build/Xcode/English.lproj/MainMenu.xib @@ -0,0 +1,3034 @@ + + + + 1050 + 9D29 + 664 + 949.33 + 352.00 + + YES + + + + + YES + com.apple.InterfaceBuilderKit + com.apple.InterfaceBuilder.CocoaPlugin + + + YES + + NSApplication + + + FirstResponder + + + NSApplication + + + AMainMenu + + YES + + + NewApplication + + 1048576 + 2147483647 + + NSImage + NSMenuCheckmark + + + NSImage + NSMenuMixedState + + submenuAction: + + NewApplication + + YES + + + About NewApplication + + 2147483647 + + + + + + YES + YES + + + 1048576 + 2147483647 + + + + + + UHJlZmVyZW5jZXPigKY + , + 1048576 + 2147483647 + + + + + + YES + YES + + + 1048576 + 2147483647 + + + + + + Services + + 1048576 + 2147483647 + + + submenuAction: + + Services + + YES + + _NSServicesMenu + + + + + YES + YES + + + 1048576 + 2147483647 + + + + + + Hide NewApplication + h + 1048576 + 2147483647 + + + + + + Hide Others + h + 1572864 + 2147483647 + + + + + + Show All + + 1048576 + 2147483647 + + + + + + YES + YES + + + 1048576 + 2147483647 + + + + + + Quit NewApplication + q + 1048576 + 2147483647 + + + + + _NSAppleMenu + + + + + File + + 1048576 + 2147483647 + + + submenuAction: + + File + + YES + + + New + n + 1048576 + 2147483647 + + + + + + T3BlbuKApg + o + 1048576 + 2147483647 + + + + + + Open Recent + + 1048576 + 2147483647 + + + submenuAction: + + Open Recent + + YES + + + Clear Menu + + 1048576 + 2147483647 + + + + + _NSRecentDocumentsMenu + + + + + YES + YES + + + 1048576 + 2147483647 + + + + + + Close + w + 1048576 + 2147483647 + + + + + + Save + s + 1048576 + 2147483647 + + + + + + U2F2ZSBBc+KApg + S + 1179648 + 2147483647 + + + + + + Revert to Saved + + 2147483647 + + + + + + YES + YES + + + 1048576 + 2147483647 + + + + + + Page Setup... + P + 1179648 + 2147483647 + + + + + + + UHJpbnTigKY + p + 1048576 + 2147483647 + + + + + + + + + Edit + + 1048576 + 2147483647 + + + submenuAction: + + Edit + + YES + + + Undo + z + 1048576 + 2147483647 + + + + + + Redo + Z + 1179648 + 2147483647 + + + + + + YES + YES + + + 1048576 + 2147483647 + + + + + + Cut + x + 1048576 + 2147483647 + + + + + + Copy + c + 1048576 + 2147483647 + + + + + + Paste + v + 1048576 + 2147483647 + + + + + + Delete + + 1048576 + 2147483647 + + + + + + Select All + a + 1048576 + 2147483647 + + + + + + YES + YES + + + 1048576 + 2147483647 + + + + + + Find + + 1048576 + 2147483647 + + + submenuAction: + + Find + + YES + + + RmluZOKApg + f + 1048576 + 2147483647 + + + 1 + + + + Find Next + g + 1048576 + 2147483647 + + + 2 + + + + Find Previous + G + 1179648 + 2147483647 + + + 3 + + + + Use Selection for Find + e + 1048576 + 2147483647 + + + 7 + + + + Jump to Selection + j + 1048576 + 2147483647 + + + + + + + + + Spelling and Grammar + + 1048576 + 2147483647 + + + submenuAction: + + Spelling and Grammar + + YES + + + U2hvdyBTcGVsbGluZ+KApg + : + 1048576 + 2147483647 + + + + + + Check Spelling + ; + 1048576 + 2147483647 + + + + + + Check Spelling While Typing + + 1048576 + 2147483647 + + + + + + Check Grammar With Spelling + + 1048576 + 2147483647 + + + + + + + + + Substitutions + + 1048576 + 2147483647 + + + submenuAction: + + Substitutions + + YES + + + Smart Copy/Paste + f + 1048576 + 2147483647 + + + 1 + + + + Smart Quotes + g + 1048576 + 2147483647 + + + 2 + + + + Smart Links + G + 1179648 + 2147483647 + + + 3 + + + + + + + Speech + + 1048576 + 2147483647 + + + submenuAction: + + Speech + + YES + + + Start Speaking + + 1048576 + 2147483647 + + + + + + Stop Speaking + + 1048576 + 2147483647 + + + + + + + + + + + + Format + + 2147483647 + + + submenuAction: + + Format + + YES + + + Font + + 2147483647 + + + submenuAction: + + Font + + YES + + + Show Fonts + t + 1048576 + 2147483647 + + + + + + Bold + b + 1048576 + 2147483647 + + + 2 + + + + Italic + i + 1048576 + 2147483647 + + + 1 + + + + Underline + u + 1048576 + 2147483647 + + + + + + YES + YES + + + 2147483647 + + + + + + Bigger + + + 1048576 + 2147483647 + + + 3 + + + + Smaller + - + 1048576 + 2147483647 + + + 4 + + + + YES + YES + + + 2147483647 + + + + + + Kern + + 2147483647 + + + submenuAction: + + Kern + + YES + + + Use Default + + 2147483647 + + + + + + Use None + + 2147483647 + + + + + + Tighten + + 2147483647 + + + + + + Loosen + + 2147483647 + + + + + + + + + Ligature + + 2147483647 + + + submenuAction: + + Ligature + + YES + + + Use Default + + 2147483647 + + + + + + Use None + + 2147483647 + + + + + + Use All + + 2147483647 + + + + + + + + + Baseline + + 2147483647 + + + submenuAction: + + Baseline + + YES + + + Use Default + + 2147483647 + + + + + + Superscript + + 2147483647 + + + + + + Subscript + + 2147483647 + + + + + + Raise + + 2147483647 + + + + + + Lower + + 2147483647 + + + + + + + + + YES + YES + + + 2147483647 + + + + + + Show Colors + C + 1048576 + 2147483647 + + + + + + YES + YES + + + 2147483647 + + + + + + Copy Style + c + 1572864 + 2147483647 + + + + + + Paste Style + v + 1572864 + 2147483647 + + + + + _NSFontMenu + + + + + Text + + 2147483647 + + + submenuAction: + + Text + + YES + + + Align Left + { + 1048576 + 2147483647 + + + + + + Center + | + 1048576 + 2147483647 + + + + + + Justify + + 2147483647 + + + + + + Align Right + } + 1048576 + 2147483647 + + + + + + YES + YES + + + 2147483647 + + + + + + Show Ruler + + 2147483647 + + + + + + Copy Ruler + c + 1310720 + 2147483647 + + + + + + Paste Ruler + v + 1310720 + 2147483647 + + + + + + + + + + + + View + + 1048576 + 2147483647 + + + submenuAction: + + View + + YES + + + Show Toolbar + t + 1572864 + 2147483647 + + + + + + Q3VzdG9taXplIFRvb2xiYXLigKY + + 1048576 + 2147483647 + + + + + + + + + Window + + 1048576 + 2147483647 + + + submenuAction: + + Window + + YES + + + Minimize + m + 1048576 + 2147483647 + + + + + + Zoom + + 1048576 + 2147483647 + + + + + + YES + YES + + + 1048576 + 2147483647 + + + + + + Bring All to Front + + 1048576 + 2147483647 + + + + + _NSWindowsMenu + + + + + Help + + 1048576 + 2147483647 + + + submenuAction: + + Help + + YES + + + NewApplication Help + ? + 1048576 + 2147483647 + + + + + + + + _NSMainMenu + + + 15 + 2 + {{335, 390}, {480, 360}} + 1946157056 + Window + NSWindow + + {3.40282e+38, 3.40282e+38} + + + 256 + {480, 360} + + + {{0, 0}, {1440, 878}} + {3.40282e+38, 3.40282e+38} + + + NSFontManager + + + + + YES + + + performMiniaturize: + + + + 37 + + + + arrangeInFront: + + + + 39 + + + + print: + + + + 86 + + + + runPageLayout: + + + + 87 + + + + clearRecentDocuments: + + + + 127 + + + + orderFrontStandardAboutPanel: + + + + 142 + + + + performClose: + + + + 193 + + + + toggleContinuousSpellChecking: + + + + 222 + + + + undo: + + + + 223 + + + + copy: + + + + 224 + + + + checkSpelling: + + + + 225 + + + + paste: + + + + 226 + + + + stopSpeaking: + + + + 227 + + + + cut: + + + + 228 + + + + showGuessPanel: + + + + 230 + + + + redo: + + + + 231 + + + + selectAll: + + + + 232 + + + + startSpeaking: + + + + 233 + + + + delete: + + + + 235 + + + + performZoom: + + + + 240 + + + + performFindPanelAction: + + + + 241 + + + + centerSelectionInVisibleArea: + + + + 245 + + + + toggleGrammarChecking: + + + + 347 + + + + toggleSmartInsertDelete: + + + + 355 + + + + toggleAutomaticQuoteSubstitution: + + + + 356 + + + + toggleAutomaticLinkDetection: + + + + 357 + + + + showHelp: + + + + 360 + + + + saveDocument: + + + + 362 + + + + saveDocumentAs: + + + + 363 + + + + revertDocumentToSaved: + + + + 364 + + + + runToolbarCustomizationPalette: + + + + 365 + + + + toggleToolbarShown: + + + + 366 + + + + hide: + + + + 367 + + + + hideOtherApplications: + + + + 368 + + + + unhideAllApplications: + + + + 370 + + + + newDocument: + + + + 373 + + + + openDocument: + + + + 374 + + + + addFontTrait: + + + + 421 + + + + addFontTrait: + + + + 422 + + + + modifyFont: + + + + 423 + + + + orderFrontFontPanel: + + + + 424 + + + + modifyFont: + + + + 425 + + + + raiseBaseline: + + + + 426 + + + + lowerBaseline: + + + + 427 + + + + copyFont: + + + + 428 + + + + subscript: + + + + 429 + + + + superscript: + + + + 430 + + + + tightenKerning: + + + + 431 + + + + underline: + + + + 432 + + + + orderFrontColorPanel: + + + + 433 + + + + useAllLigatures: + + + + 434 + + + + loosenKerning: + + + + 435 + + + + pasteFont: + + + + 436 + + + + unscript: + + + + 437 + + + + useStandardKerning: + + + + 438 + + + + useStandardLigatures: + + + + 439 + + + + turnOffLigatures: + + + + 440 + + + + turnOffKerning: + + + + 441 + + + + alignLeft: + + + + 442 + + + + alignJustified: + + + + 443 + + + + copyRuler: + + + + 444 + + + + alignCenter: + + + + 445 + + + + toggleRuler: + + + + 446 + + + + alignRight: + + + + 447 + + + + pasteRuler: + + + + 448 + + + + terminate: + + + + 449 + + + + + YES + + 0 + + YES + + + + + + -2 + + + RmlsZSdzIE93bmVyA + + + -1 + + + First Responder + + + -3 + + + Application + + + 29 + + + YES + + + + + + + + + + MainMenu + + + 19 + + + YES + + + + + + 56 + + + YES + + + + + + 103 + + + YES + + + + 1 + + + 217 + + + YES + + + + + + 83 + + + YES + + + + + + 81 + + + YES + + + + + + + + + + + + + + + + 75 + + + 3 + + + 80 + + + 8 + + + 78 + + + 6 + + + 72 + + + + + 82 + + + 9 + + + 124 + + + YES + + + + + + 77 + + + 5 + + + 73 + + + 1 + + + 79 + + + 7 + + + 112 + + + 10 + + + 74 + + + 2 + + + 125 + + + YES + + + + + + 126 + + + + + 205 + + + YES + + + + + + + + + + + + + + + + + + 202 + + + + + 198 + + + + + 207 + + + + + 214 + + + + + 199 + + + + + 203 + + + + + 197 + + + + + 206 + + + + + 215 + + + + + 218 + + + YES + + + + + + 216 + + + YES + + + + + + 200 + + + YES + + + + + + + + + 219 + + + + + 201 + + + + + 204 + + + + + 220 + + + YES + + + + + + + + + + 213 + + + + + 210 + + + + + 221 + + + + + 208 + + + + + 209 + + + + + 106 + + + YES + + + + 2 + + + 111 + + + + + 57 + + + YES + + + + + + + + + + + + + + + + 58 + + + + + 134 + + + + + 150 + + + + + 136 + + + 1111 + + + 144 + + + + + 129 + + + 121 + + + 143 + + + + + 236 + + + + + 131 + + + YES + + + + + + 149 + + + + + 145 + + + + + 130 + + + + + 24 + + + YES + + + + + + + + + 92 + + + + + 5 + + + + + 239 + + + + + 23 + + + + + 295 + + + YES + + + + + + 296 + + + YES + + + + + + + 297 + + + + + 298 + + + + + 211 + + + YES + + + + + + 212 + + + YES + + + + + + + 195 + + + + + 196 + + + + + 346 + + + + + 348 + + + YES + + + + + + 349 + + + YES + + + + + + + + 350 + + + + + 351 + + + + + 354 + + + + + 371 + + + YES + + + + + + 372 + + + + + 375 + + + YES + + + + + + 376 + + + YES + + + + + + + 377 + + + YES + + + + + + 378 + + + YES + + + + + + 379 + + + YES + + + + + + + + + + + + + 380 + + + + + 381 + + + + + 382 + + + + + 383 + + + + + 384 + + + + + 385 + + + + + 386 + + + + + 387 + + + + + 388 + + + YES + + + + + + + + + + + + + + + + + + + + + 389 + + + + + 390 + + + + + 391 + + + + + 392 + + + + + 393 + + + + + 394 + + + + + 395 + + + + + 396 + + + + + 397 + + + YES + + + + + + 398 + + + YES + + + + + + 399 + + + YES + + + + + + 400 + + + + + 401 + + + + + 402 + + + + + 403 + + + + + 404 + + + + + 405 + + + YES + + + + + + + + + + 406 + + + + + 407 + + + + + 408 + + + + + 409 + + + + + 410 + + + + + 411 + + + YES + + + + + + + + 412 + + + + + 413 + + + + + 414 + + + + + 415 + + + YES + + + + + + + + + 416 + + + + + 417 + + + + + 418 + + + + + 419 + + + + + 420 + + + + + + + YES + + YES + -1.IBPluginDependency + -2.IBPluginDependency + -3.IBPluginDependency + 103.IBPluginDependency + 103.ImportedFromIB2 + 106.IBPluginDependency + 106.ImportedFromIB2 + 106.editorWindowContentRectSynchronizationRect + 111.IBPluginDependency + 111.ImportedFromIB2 + 112.IBPluginDependency + 112.ImportedFromIB2 + 124.IBPluginDependency + 124.ImportedFromIB2 + 125.IBPluginDependency + 125.ImportedFromIB2 + 125.editorWindowContentRectSynchronizationRect + 126.IBPluginDependency + 126.ImportedFromIB2 + 129.IBPluginDependency + 129.ImportedFromIB2 + 130.IBPluginDependency + 130.ImportedFromIB2 + 130.editorWindowContentRectSynchronizationRect + 131.IBPluginDependency + 131.ImportedFromIB2 + 134.IBPluginDependency + 134.ImportedFromIB2 + 136.IBPluginDependency + 136.ImportedFromIB2 + 143.IBPluginDependency + 143.ImportedFromIB2 + 144.IBPluginDependency + 144.ImportedFromIB2 + 145.IBPluginDependency + 145.ImportedFromIB2 + 149.IBPluginDependency + 149.ImportedFromIB2 + 150.IBPluginDependency + 150.ImportedFromIB2 + 19.IBPluginDependency + 19.ImportedFromIB2 + 195.IBPluginDependency + 195.ImportedFromIB2 + 196.IBPluginDependency + 196.ImportedFromIB2 + 197.IBPluginDependency + 197.ImportedFromIB2 + 198.IBPluginDependency + 198.ImportedFromIB2 + 199.IBPluginDependency + 199.ImportedFromIB2 + 200.IBPluginDependency + 200.ImportedFromIB2 + 200.editorWindowContentRectSynchronizationRect + 201.IBPluginDependency + 201.ImportedFromIB2 + 202.IBPluginDependency + 202.ImportedFromIB2 + 203.IBPluginDependency + 203.ImportedFromIB2 + 204.IBPluginDependency + 204.ImportedFromIB2 + 205.IBPluginDependency + 205.ImportedFromIB2 + 205.editorWindowContentRectSynchronizationRect + 206.IBPluginDependency + 206.ImportedFromIB2 + 207.IBPluginDependency + 207.ImportedFromIB2 + 208.IBPluginDependency + 208.ImportedFromIB2 + 209.IBPluginDependency + 209.ImportedFromIB2 + 210.IBPluginDependency + 210.ImportedFromIB2 + 211.IBPluginDependency + 211.ImportedFromIB2 + 212.IBPluginDependency + 212.ImportedFromIB2 + 212.editorWindowContentRectSynchronizationRect + 213.IBPluginDependency + 213.ImportedFromIB2 + 214.IBPluginDependency + 214.ImportedFromIB2 + 215.IBPluginDependency + 215.ImportedFromIB2 + 216.IBPluginDependency + 216.ImportedFromIB2 + 217.IBPluginDependency + 217.ImportedFromIB2 + 218.IBPluginDependency + 218.ImportedFromIB2 + 219.IBPluginDependency + 219.ImportedFromIB2 + 220.IBPluginDependency + 220.ImportedFromIB2 + 220.editorWindowContentRectSynchronizationRect + 221.IBPluginDependency + 221.ImportedFromIB2 + 23.IBPluginDependency + 23.ImportedFromIB2 + 236.IBPluginDependency + 236.ImportedFromIB2 + 239.IBPluginDependency + 239.ImportedFromIB2 + 24.IBPluginDependency + 24.ImportedFromIB2 + 24.editorWindowContentRectSynchronizationRect + 29.IBEditorWindowLastContentRect + 29.IBPluginDependency + 29.ImportedFromIB2 + 29.WindowOrigin + 29.editorWindowContentRectSynchronizationRect + 295.IBPluginDependency + 296.IBPluginDependency + 296.editorWindowContentRectSynchronizationRect + 297.IBPluginDependency + 298.IBPluginDependency + 346.IBPluginDependency + 346.ImportedFromIB2 + 348.IBPluginDependency + 348.ImportedFromIB2 + 349.IBPluginDependency + 349.ImportedFromIB2 + 349.editorWindowContentRectSynchronizationRect + 350.IBPluginDependency + 350.ImportedFromIB2 + 351.IBPluginDependency + 351.ImportedFromIB2 + 354.IBPluginDependency + 354.ImportedFromIB2 + 371.IBEditorWindowLastContentRect + 371.IBPluginDependency + 371.IBWindowTemplateEditedContentRect + 371.NSWindowTemplate.visibleAtLaunch + 371.editorWindowContentRectSynchronizationRect + 371.windowTemplate.maxSize + 372.IBPluginDependency + 375.IBPluginDependency + 376.IBEditorWindowLastContentRect + 376.IBPluginDependency + 377.IBPluginDependency + 378.IBPluginDependency + 379.IBPluginDependency + 380.IBPluginDependency + 381.IBPluginDependency + 382.IBPluginDependency + 383.IBPluginDependency + 384.IBPluginDependency + 385.IBPluginDependency + 386.IBPluginDependency + 387.IBPluginDependency + 388.IBEditorWindowLastContentRect + 388.IBPluginDependency + 389.IBPluginDependency + 390.IBPluginDependency + 391.IBPluginDependency + 392.IBPluginDependency + 393.IBPluginDependency + 394.IBPluginDependency + 395.IBPluginDependency + 396.IBPluginDependency + 397.IBPluginDependency + 398.IBPluginDependency + 399.IBPluginDependency + 400.IBPluginDependency + 401.IBPluginDependency + 402.IBPluginDependency + 403.IBPluginDependency + 404.IBPluginDependency + 405.IBPluginDependency + 406.IBPluginDependency + 407.IBPluginDependency + 408.IBPluginDependency + 409.IBPluginDependency + 410.IBPluginDependency + 411.IBPluginDependency + 412.IBPluginDependency + 413.IBPluginDependency + 414.IBPluginDependency + 415.IBPluginDependency + 416.IBPluginDependency + 417.IBPluginDependency + 418.IBPluginDependency + 419.IBPluginDependency + 5.IBPluginDependency + 5.ImportedFromIB2 + 56.IBPluginDependency + 56.ImportedFromIB2 + 57.IBEditorWindowLastContentRect + 57.IBPluginDependency + 57.ImportedFromIB2 + 57.editorWindowContentRectSynchronizationRect + 58.IBPluginDependency + 58.ImportedFromIB2 + 72.IBPluginDependency + 72.ImportedFromIB2 + 73.IBPluginDependency + 73.ImportedFromIB2 + 74.IBPluginDependency + 74.ImportedFromIB2 + 75.IBPluginDependency + 75.ImportedFromIB2 + 77.IBPluginDependency + 77.ImportedFromIB2 + 78.IBPluginDependency + 78.ImportedFromIB2 + 79.IBPluginDependency + 79.ImportedFromIB2 + 80.IBPluginDependency + 80.ImportedFromIB2 + 81.IBPluginDependency + 81.ImportedFromIB2 + 81.editorWindowContentRectSynchronizationRect + 82.IBPluginDependency + 82.ImportedFromIB2 + 83.IBPluginDependency + 83.ImportedFromIB2 + 92.IBPluginDependency + 92.ImportedFromIB2 + + + YES + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilderKit + com.apple.InterfaceBuilderKit + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + {{596, 852}, {216, 23}} + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + {{522, 812}, {146, 23}} + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + {{436, 809}, {64, 6}} + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + {{608, 612}, {275, 83}} + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + {{187, 434}, {243, 243}} + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + {{608, 612}, {167, 43}} + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + {{608, 612}, {241, 103}} + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + {{525, 802}, {197, 73}} + {{207, 285}, {478, 20}} + com.apple.InterfaceBuilder.CocoaPlugin + + {74, 862} + {{6, 978}, {478, 20}} + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + {{475, 832}, {234, 43}} + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + {{608, 612}, {215, 63}} + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + {{335, 390}, {480, 360}} + com.apple.InterfaceBuilder.CocoaPlugin + {{335, 390}, {480, 360}} + + {{33, 99}, {480, 360}} + {3.40282e+38, 3.40282e+38} + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + {{437, 242}, {86, 43}} + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + {{523, 2}, {178, 283}} + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + {{219, 102}, {245, 183}} + com.apple.InterfaceBuilder.CocoaPlugin + + {{23, 794}, {245, 183}} + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + {{145, 474}, {199, 203}} + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + + + + YES + + YES + + + YES + + + + + YES + + YES + + + YES + + + + 449 + + + 0 + + 3 + + diff --git a/dep/recastnavigation/RecastDemo/Build/Xcode/Icon.icns b/dep/recastnavigation/RecastDemo/Build/Xcode/Icon.icns new file mode 100644 index 000000000..8b482fd92 Binary files /dev/null and b/dep/recastnavigation/RecastDemo/Build/Xcode/Icon.icns differ diff --git a/dep/recastnavigation/RecastDemo/Build/Xcode/Info.plist b/dep/recastnavigation/RecastDemo/Build/Xcode/Info.plist new file mode 100644 index 000000000..4c6f91915 --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Build/Xcode/Info.plist @@ -0,0 +1,28 @@ + + + + + CFBundleDevelopmentRegion + English + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIconFile + Icon.icns + CFBundleIdentifier + com.yourcompany.${PRODUCT_NAME:identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + APPL + CFBundleSignature + ???? + CFBundleVersion + 1.0 + NSMainNibFile + MainMenu + NSPrincipalClass + NSApplication + + diff --git a/dep/recastnavigation/RecastDemo/Build/Xcode/Recast.xcodeproj/TemplateIcon.icns b/dep/recastnavigation/RecastDemo/Build/Xcode/Recast.xcodeproj/TemplateIcon.icns new file mode 100644 index 000000000..62cb7015e Binary files /dev/null and b/dep/recastnavigation/RecastDemo/Build/Xcode/Recast.xcodeproj/TemplateIcon.icns differ diff --git a/dep/recastnavigation/RecastDemo/Build/Xcode/Recast.xcodeproj/memon.pbxuser b/dep/recastnavigation/RecastDemo/Build/Xcode/Recast.xcodeproj/memon.pbxuser new file mode 100644 index 000000000..b71b52493 --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Build/Xcode/Recast.xcodeproj/memon.pbxuser @@ -0,0 +1,3758 @@ +// !$*UTF8*$! +{ + 089C165DFE840E0CC02AAC07 /* English */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {915, 520}}"; + sepNavSelRange = "{0, 0}"; + sepNavVisRange = "{0, 45}"; + sepNavWindowFrame = "{{15, 78}, {1011, 695}}"; + }; + }; + 29B97313FDCFA39411CA2CEA /* Project object */ = { + activeBuildConfigurationName = Release; + activeExecutable = 6B8632970F78114600E2684A /* Recast */; + activeTarget = 8D1107260486CEB800E47090 /* Recast */; + addToTargets = ( + 8D1107260486CEB800E47090 /* Recast */, + ); + breakpoints = ( + 6BBB4C4C115B7BAD00CF791D /* Sample_TileMesh.cpp:281 */, + 6B42164711806B2F006C347B /* DetourDebugDraw.cpp:362 */, + 6B10014C11AD1C1E0098A59A /* RecastMesh.cpp:1324 */, + 6BA687AC1222F7AC00730711 /* Sample_Debug.cpp:137 */, + 6BD403421224642500995864 /* NavMeshTesterTool.cpp:547 */, + 6B920A121225B1C900D5B5AD /* DetourHashLookup.cpp:78 */, + 6B920A141225B1CF00D5B5AD /* DetourHashLookup.cpp:131 */, + 6BD66851124350F50021A7A4 /* NavMeshTesterTool.cpp:486 */, + 6B8D55CD127AAA360077C699 /* CrowdManager.cpp:1197 */, + 6B74B5EA128312A900262888 /* main.cpp:211 */, + 6B74B60C128312E600262888 /* CrowdTool.cpp:296 */, + 6B74B72E1286B1B000262888 /* CrowdManager.cpp:1313 */, + ); + codeSenseManager = 6B8632AA0F78115100E2684A /* Code sense */; + executables = ( + 6B8632970F78114600E2684A /* Recast */, + ); + perUserDictionary = { + "PBXConfiguration.PBXBreakpointsDataSource.v1:1CA1AED706398EBD00589147" = { + PBXFileTableDataSourceColumnSortingDirectionKey = "-1"; + PBXFileTableDataSourceColumnSortingKey = PBXBreakpointsDataSource_BreakpointID; + PBXFileTableDataSourceColumnWidthsKey = ( + 20, + 20, + 198, + 20, + 99, + 99, + 29, + 20, + ); + PBXFileTableDataSourceColumnsKey = ( + PBXBreakpointsDataSource_ActionID, + PBXBreakpointsDataSource_TypeID, + PBXBreakpointsDataSource_BreakpointID, + PBXBreakpointsDataSource_UseID, + PBXBreakpointsDataSource_LocationID, + PBXBreakpointsDataSource_ConditionID, + PBXBreakpointsDataSource_IgnoreCountID, + PBXBreakpointsDataSource_ContinueID, + ); + }; + "PBXConfiguration.PBXBreakpointsDataSource.v1:1CA23EDF0692099D00951B8B" = { + PBXFileTableDataSourceColumnSortingDirectionKey = "-1"; + PBXFileTableDataSourceColumnSortingKey = PBXBreakpointsDataSource_BreakpointID; + PBXFileTableDataSourceColumnWidthsKey = ( + 20, + 20, + 280, + 20, + 179, + 179, + 109, + 20, + ); + PBXFileTableDataSourceColumnsKey = ( + PBXBreakpointsDataSource_ActionID, + PBXBreakpointsDataSource_TypeID, + PBXBreakpointsDataSource_BreakpointID, + PBXBreakpointsDataSource_UseID, + PBXBreakpointsDataSource_LocationID, + PBXBreakpointsDataSource_ConditionID, + PBXBreakpointsDataSource_IgnoreCountID, + PBXBreakpointsDataSource_ContinueID, + ); + }; + PBXConfiguration.PBXFileTableDataSource3.PBXBookmarksDataSource = { + PBXFileTableDataSourceColumnSortingDirectionKey = "-1"; + PBXFileTableDataSourceColumnSortingKey = PBXBookmarksDataSource_NameID; + PBXFileTableDataSourceColumnWidthsKey = ( + 200, + 200, + 435, + ); + PBXFileTableDataSourceColumnsKey = ( + PBXBookmarksDataSource_LocationID, + PBXBookmarksDataSource_NameID, + PBXBookmarksDataSource_CommentsID, + ); + }; + PBXConfiguration.PBXFileTableDataSource3.PBXFileTableDataSource = { + PBXFileTableDataSourceColumnSortingDirectionKey = "-1"; + PBXFileTableDataSourceColumnSortingKey = PBXFileDataSource_Filename_ColumnID; + PBXFileTableDataSourceColumnWidthsKey = ( + 20, + 753, + 20, + 48, + 43, + 43, + 20, + ); + PBXFileTableDataSourceColumnsKey = ( + PBXFileDataSource_FiletypeID, + PBXFileDataSource_Filename_ColumnID, + PBXFileDataSource_Built_ColumnID, + PBXFileDataSource_ObjectSize_ColumnID, + PBXFileDataSource_Errors_ColumnID, + PBXFileDataSource_Warnings_ColumnID, + PBXFileDataSource_Target_ColumnID, + ); + }; + PBXConfiguration.PBXFileTableDataSource3.PBXFindDataSource = { + PBXFileTableDataSourceColumnSortingDirectionKey = "-1"; + PBXFileTableDataSourceColumnSortingKey = PBXFindDataSource_LocationID; + PBXFileTableDataSourceColumnWidthsKey = ( + 200, + 751, + ); + PBXFileTableDataSourceColumnsKey = ( + PBXFindDataSource_MessageID, + PBXFindDataSource_LocationID, + ); + }; + PBXPerProjectTemplateStateSaveDate = 310579257; + PBXWorkspaceStateSaveDate = 310579257; + }; + perUserProjectItems = { + 6B4DE616127F2407001CFDF4 = 6B4DE616127F2407001CFDF4 /* PBXTextBookmark */; + 6B4DE62E12807542001CFDF4 = 6B4DE62E12807542001CFDF4 /* PBXTextBookmark */; + 6B4DE62F12807542001CFDF4 = 6B4DE62F12807542001CFDF4 /* PBXTextBookmark */; + 6B4DE63012807542001CFDF4 = 6B4DE63012807542001CFDF4 /* PBXTextBookmark */; + 6B4DE63112807542001CFDF4 = 6B4DE63112807542001CFDF4 /* PBXTextBookmark */; + 6B4DE63212807542001CFDF4 = 6B4DE63212807542001CFDF4 /* PBXTextBookmark */; + 6B4DE63312807542001CFDF4 = 6B4DE63312807542001CFDF4 /* PBXTextBookmark */; + 6B4DE63412807542001CFDF4 = 6B4DE63412807542001CFDF4 /* PBXTextBookmark */; + 6B4DE63512807542001CFDF4 = 6B4DE63512807542001CFDF4 /* PBXTextBookmark */; + 6B4DE63612807542001CFDF4 = 6B4DE63612807542001CFDF4 /* PBXTextBookmark */; + 6B4DE64412807587001CFDF4 = 6B4DE64412807587001CFDF4 /* PBXTextBookmark */; + 6B4DE646128079E0001CFDF4 = 6B4DE646128079E0001CFDF4 /* PBXTextBookmark */; + 6B4DE647128079E0001CFDF4 = 6B4DE647128079E0001CFDF4 /* PBXTextBookmark */; + 6B4DE648128079E0001CFDF4 = 6B4DE648128079E0001CFDF4 /* PBXTextBookmark */; + 6B4DE649128079E0001CFDF4 = 6B4DE649128079E0001CFDF4 /* PBXTextBookmark */; + 6B4DE64A128079E0001CFDF4 = 6B4DE64A128079E0001CFDF4 /* PBXTextBookmark */; + 6B4DE64B128079E0001CFDF4 = 6B4DE64B128079E0001CFDF4 /* PBXTextBookmark */; + 6B4DE64C128079E0001CFDF4 = 6B4DE64C128079E0001CFDF4 /* PBXTextBookmark */; + 6B4DE651128079F3001CFDF4 = 6B4DE651128079F3001CFDF4 /* PBXTextBookmark */; + 6B4DE65D12807AB6001CFDF4 = 6B4DE65D12807AB6001CFDF4 /* PBXTextBookmark */; + 6B4DE65E12807AB6001CFDF4 = 6B4DE65E12807AB6001CFDF4 /* PBXTextBookmark */; + 6B4DE65F12807AB6001CFDF4 = 6B4DE65F12807AB6001CFDF4 /* PBXTextBookmark */; + 6B4DE66212807AD9001CFDF4 = 6B4DE66212807AD9001CFDF4 /* PBXTextBookmark */; + 6B4DE66512807B09001CFDF4 = 6B4DE66512807B09001CFDF4 /* PBXTextBookmark */; + 6B4DE66612807B39001CFDF4 = 6B4DE66612807B39001CFDF4 /* PBXTextBookmark */; + 6B4DE66712807B39001CFDF4 = 6B4DE66712807B39001CFDF4 /* PBXTextBookmark */; + 6B4DE66812807B39001CFDF4 = 6B4DE66812807B39001CFDF4 /* PBXTextBookmark */; + 6B4DE66912807B41001CFDF4 = 6B4DE66912807B41001CFDF4 /* PBXTextBookmark */; + 6B4DE66A12807B41001CFDF4 = 6B4DE66A12807B41001CFDF4 /* PBXTextBookmark */; + 6B4DE66B12807B41001CFDF4 = 6B4DE66B12807B41001CFDF4 /* PBXTextBookmark */; + 6B4DE66C12807B41001CFDF4 = 6B4DE66C12807B41001CFDF4 /* PBXTextBookmark */; + 6B4DE67112807C71001CFDF4 = 6B4DE67112807C71001CFDF4 /* PBXTextBookmark */; + 6B4DE67312807D05001CFDF4 = 6B4DE67312807D05001CFDF4 /* PBXTextBookmark */; + 6B4DE67412807D05001CFDF4 = 6B4DE67412807D05001CFDF4 /* PBXTextBookmark */; + 6B4DE67512807D05001CFDF4 = 6B4DE67512807D05001CFDF4 /* PBXTextBookmark */; + 6B74B5DC1283104100262888 /* PBXTextBookmark */ = 6B74B5DC1283104100262888 /* PBXTextBookmark */; + 6B74B5EC128312AC00262888 /* PBXTextBookmark */ = 6B74B5EC128312AC00262888 /* PBXTextBookmark */; + 6B74B5ED128312AC00262888 /* PBXTextBookmark */ = 6B74B5ED128312AC00262888 /* PBXTextBookmark */; + 6B74B5EE128312AC00262888 /* PBXTextBookmark */ = 6B74B5EE128312AC00262888 /* PBXTextBookmark */; + 6B74B5EF128312AC00262888 /* PBXTextBookmark */ = 6B74B5EF128312AC00262888 /* PBXTextBookmark */; + 6B74B5F0128312AC00262888 /* PBXTextBookmark */ = 6B74B5F0128312AC00262888 /* PBXTextBookmark */; + 6B74B5F1128312AC00262888 /* PBXTextBookmark */ = 6B74B5F1128312AC00262888 /* PBXTextBookmark */; + 6B74B5F2128312AC00262888 /* PBXTextBookmark */ = 6B74B5F2128312AC00262888 /* PBXTextBookmark */; + 6B74B5F3128312AC00262888 /* PBXTextBookmark */ = 6B74B5F3128312AC00262888 /* PBXTextBookmark */; + 6B74B5F4128312AC00262888 /* PBXTextBookmark */ = 6B74B5F4128312AC00262888 /* PBXTextBookmark */; + 6B74B5F5128312AC00262888 /* PBXTextBookmark */ = 6B74B5F5128312AC00262888 /* PBXTextBookmark */; + 6B74B5F6128312AC00262888 /* PBXTextBookmark */ = 6B74B5F6128312AC00262888 /* PBXTextBookmark */; + 6B74B5F7128312AC00262888 /* PBXTextBookmark */ = 6B74B5F7128312AC00262888 /* PBXTextBookmark */; + 6B74B5F8128312AC00262888 /* PBXTextBookmark */ = 6B74B5F8128312AC00262888 /* PBXTextBookmark */; + 6B74B5F9128312AC00262888 /* PBXTextBookmark */ = 6B74B5F9128312AC00262888 /* PBXTextBookmark */; + 6B74B5FA128312AC00262888 /* PBXTextBookmark */ = 6B74B5FA128312AC00262888 /* PBXTextBookmark */; + 6B74B5FB128312AC00262888 /* PBXTextBookmark */ = 6B74B5FB128312AC00262888 /* PBXTextBookmark */; + 6B74B5FC128312AC00262888 /* PBXTextBookmark */ = 6B74B5FC128312AC00262888 /* PBXTextBookmark */; + 6B74B60E128312E900262888 /* PBXTextBookmark */ = 6B74B60E128312E900262888 /* PBXTextBookmark */; + 6B74B60F128312E900262888 /* PBXTextBookmark */ = 6B74B60F128312E900262888 /* PBXTextBookmark */; + 6B74B610128312E900262888 /* PBXTextBookmark */ = 6B74B610128312E900262888 /* PBXTextBookmark */; + 6B74B611128312E900262888 /* PBXTextBookmark */ = 6B74B611128312E900262888 /* PBXTextBookmark */; + 6B74B612128312E900262888 /* PBXTextBookmark */ = 6B74B612128312E900262888 /* PBXTextBookmark */; + 6B74B613128312E900262888 /* PBXTextBookmark */ = 6B74B613128312E900262888 /* PBXTextBookmark */; + 6B74B618128313D600262888 /* PBXTextBookmark */ = 6B74B618128313D600262888 /* PBXTextBookmark */; + 6B74B622128314A500262888 /* PBXTextBookmark */ = 6B74B622128314A500262888 /* PBXTextBookmark */; + 6B74B623128314A500262888 /* PBXTextBookmark */ = 6B74B623128314A500262888 /* PBXTextBookmark */; + 6B74B624128314A500262888 /* PBXTextBookmark */ = 6B74B624128314A500262888 /* PBXTextBookmark */; + 6B74B625128314A500262888 /* PBXTextBookmark */ = 6B74B625128314A500262888 /* PBXTextBookmark */; + 6B74B626128314A500262888 /* PBXTextBookmark */ = 6B74B626128314A500262888 /* PBXTextBookmark */; + 6B74B627128314A500262888 /* PBXTextBookmark */ = 6B74B627128314A500262888 /* PBXTextBookmark */; + 6B74B628128314A500262888 /* PBXTextBookmark */ = 6B74B628128314A500262888 /* PBXTextBookmark */; + 6B74B629128314A500262888 /* PBXTextBookmark */ = 6B74B629128314A500262888 /* PBXTextBookmark */; + 6B74B62A128314A500262888 /* PBXTextBookmark */ = 6B74B62A128314A500262888 /* PBXTextBookmark */; + 6B74B62B128314A500262888 /* PBXTextBookmark */ = 6B74B62B128314A500262888 /* PBXTextBookmark */; + 6B74B62C128314A500262888 /* PBXTextBookmark */ = 6B74B62C128314A500262888 /* PBXTextBookmark */; + 6B74B62D128314A500262888 /* XCBuildMessageTextBookmark */ = 6B74B62D128314A500262888 /* XCBuildMessageTextBookmark */; + 6B74B62E128314A500262888 /* PBXTextBookmark */ = 6B74B62E128314A500262888 /* PBXTextBookmark */; + 6B74B66412869CE100262888 /* PBXTextBookmark */ = 6B74B66412869CE100262888 /* PBXTextBookmark */; + 6B74B66512869CE100262888 /* PBXTextBookmark */ = 6B74B66512869CE100262888 /* PBXTextBookmark */; + 6B74B66612869CE100262888 /* PBXTextBookmark */ = 6B74B66612869CE100262888 /* PBXTextBookmark */; + 6B74B66712869CE100262888 /* PBXTextBookmark */ = 6B74B66712869CE100262888 /* PBXTextBookmark */; + 6B74B66812869CE100262888 /* PBXTextBookmark */ = 6B74B66812869CE100262888 /* PBXTextBookmark */; + 6B74B66F12869E3000262888 /* PBXTextBookmark */ = 6B74B66F12869E3000262888 /* PBXTextBookmark */; + 6B74B67012869E3000262888 /* XCBuildMessageTextBookmark */ = 6B74B67012869E3000262888 /* XCBuildMessageTextBookmark */; + 6B74B67112869E3000262888 /* PBXTextBookmark */ = 6B74B67112869E3000262888 /* PBXTextBookmark */; + 6B74B6831286A39000262888 /* PBXTextBookmark */ = 6B74B6831286A39000262888 /* PBXTextBookmark */; + 6B74B6841286A39000262888 /* PBXTextBookmark */ = 6B74B6841286A39000262888 /* PBXTextBookmark */; + 6B74B6851286A39000262888 /* XCBuildMessageTextBookmark */ = 6B74B6851286A39000262888 /* XCBuildMessageTextBookmark */; + 6B74B6861286A39000262888 /* PBXTextBookmark */ = 6B74B6861286A39000262888 /* PBXTextBookmark */; + 6B74B68A1286A47800262888 /* PBXTextBookmark */ = 6B74B68A1286A47800262888 /* PBXTextBookmark */; + 6B74B68B1286A47800262888 /* PBXTextBookmark */ = 6B74B68B1286A47800262888 /* PBXTextBookmark */; + 6B74B68C1286A47800262888 /* PBXTextBookmark */ = 6B74B68C1286A47800262888 /* PBXTextBookmark */; + 6B74B68F1286A4DD00262888 /* PBXTextBookmark */ = 6B74B68F1286A4DD00262888 /* PBXTextBookmark */; + 6B74B69C1286A52A00262888 /* PBXTextBookmark */ = 6B74B69C1286A52A00262888 /* PBXTextBookmark */; + 6B74B69D1286A52A00262888 /* PBXTextBookmark */ = 6B74B69D1286A52A00262888 /* PBXTextBookmark */; + 6B74B69E1286A52A00262888 /* PBXTextBookmark */ = 6B74B69E1286A52A00262888 /* PBXTextBookmark */; + 6B74B6A01286A67500262888 /* PBXTextBookmark */ = 6B74B6A01286A67500262888 /* PBXTextBookmark */; + 6B74B6A11286A6AE00262888 /* PBXTextBookmark */ = 6B74B6A11286A6AE00262888 /* PBXTextBookmark */; + 6B74B6A61286A6C300262888 /* PBXTextBookmark */ = 6B74B6A61286A6C300262888 /* PBXTextBookmark */; + 6B74B6AA1286A85800262888 /* PBXTextBookmark */ = 6B74B6AA1286A85800262888 /* PBXTextBookmark */; + 6B74B6AB1286A85800262888 /* PBXTextBookmark */ = 6B74B6AB1286A85800262888 /* PBXTextBookmark */; + 6B74B6AC1286A85800262888 /* PBXTextBookmark */ = 6B74B6AC1286A85800262888 /* PBXTextBookmark */; + 6B74B6B51286A9BD00262888 /* PBXTextBookmark */ = 6B74B6B51286A9BD00262888 /* PBXTextBookmark */; + 6B74B6B61286A9BD00262888 /* PBXTextBookmark */ = 6B74B6B61286A9BD00262888 /* PBXTextBookmark */; + 6B74B6B71286A9BD00262888 /* XCBuildMessageTextBookmark */ = 6B74B6B71286A9BD00262888 /* XCBuildMessageTextBookmark */; + 6B74B6B81286A9BD00262888 /* PBXTextBookmark */ = 6B74B6B81286A9BD00262888 /* PBXTextBookmark */; + 6B74B6BE1286AA0C00262888 /* PBXTextBookmark */ = 6B74B6BE1286AA0C00262888 /* PBXTextBookmark */; + 6B74B6BF1286AA0C00262888 /* PBXTextBookmark */ = 6B74B6BF1286AA0C00262888 /* PBXTextBookmark */; + 6B74B6C01286AA0C00262888 /* PBXTextBookmark */ = 6B74B6C01286AA0C00262888 /* PBXTextBookmark */; + 6B74B6C11286AA0C00262888 /* PBXTextBookmark */ = 6B74B6C11286AA0C00262888 /* PBXTextBookmark */; + 6B74B6C51286AA5900262888 /* PBXTextBookmark */ = 6B74B6C51286AA5900262888 /* PBXTextBookmark */; + 6B74B6C91286AAA200262888 /* PBXTextBookmark */ = 6B74B6C91286AAA200262888 /* PBXTextBookmark */; + 6B74B6CA1286AAA200262888 /* PBXTextBookmark */ = 6B74B6CA1286AAA200262888 /* PBXTextBookmark */; + 6B74B6CB1286AAA200262888 /* PBXTextBookmark */ = 6B74B6CB1286AAA200262888 /* PBXTextBookmark */; + 6B74B6CF1286AAF000262888 /* PBXTextBookmark */ = 6B74B6CF1286AAF000262888 /* PBXTextBookmark */; + 6B74B6D31286AB3B00262888 /* PBXTextBookmark */ = 6B74B6D31286AB3B00262888 /* PBXTextBookmark */; + 6B74B6D71286ABC000262888 /* PBXTextBookmark */ = 6B74B6D71286ABC000262888 /* PBXTextBookmark */; + 6B74B6D81286ABC000262888 /* PBXTextBookmark */ = 6B74B6D81286ABC000262888 /* PBXTextBookmark */; + 6B74B6D91286ABC000262888 /* PBXTextBookmark */ = 6B74B6D91286ABC000262888 /* PBXTextBookmark */; + 6B74B6DA1286ABC000262888 /* PBXTextBookmark */ = 6B74B6DA1286ABC000262888 /* PBXTextBookmark */; + 6B74B6DB1286ABC000262888 /* PBXTextBookmark */ = 6B74B6DB1286ABC000262888 /* PBXTextBookmark */; + 6B74B6DF1286AC2A00262888 /* PBXTextBookmark */ = 6B74B6DF1286AC2A00262888 /* PBXTextBookmark */; + 6B74B6E01286AC2A00262888 /* PBXTextBookmark */ = 6B74B6E01286AC2A00262888 /* PBXTextBookmark */; + 6B74B6E11286AC2A00262888 /* PBXTextBookmark */ = 6B74B6E11286AC2A00262888 /* PBXTextBookmark */; + 6B74B6E51286AC8200262888 /* PBXTextBookmark */ = 6B74B6E51286AC8200262888 /* PBXTextBookmark */; + 6B74B6E91286ACC200262888 /* PBXTextBookmark */ = 6B74B6E91286ACC200262888 /* PBXTextBookmark */; + 6B74B6ED1286AD3800262888 /* PBXTextBookmark */ = 6B74B6ED1286AD3800262888 /* PBXTextBookmark */; + 6B74B6EE1286AD3800262888 /* PBXTextBookmark */ = 6B74B6EE1286AD3800262888 /* PBXTextBookmark */; + 6B74B6EF1286AD3800262888 /* PBXTextBookmark */ = 6B74B6EF1286AD3800262888 /* PBXTextBookmark */; + 6B74B6F11286AD5400262888 /* PBXTextBookmark */ = 6B74B6F11286AD5400262888 /* PBXTextBookmark */; + 6B74B6F41286AD6A00262888 /* PBXTextBookmark */ = 6B74B6F41286AD6A00262888 /* PBXTextBookmark */; + 6B74B6FC1286AE0B00262888 /* PBXTextBookmark */ = 6B74B6FC1286AE0B00262888 /* PBXTextBookmark */; + 6B74B6FD1286AE0B00262888 /* PBXTextBookmark */ = 6B74B6FD1286AE0B00262888 /* PBXTextBookmark */; + 6B74B6FE1286AE0B00262888 /* PBXTextBookmark */ = 6B74B6FE1286AE0B00262888 /* PBXTextBookmark */; + 6B74B7061286AEBD00262888 /* PBXTextBookmark */ = 6B74B7061286AEBD00262888 /* PBXTextBookmark */; + 6B74B7071286AEBD00262888 /* PBXTextBookmark */ = 6B74B7071286AEBD00262888 /* PBXTextBookmark */; + 6B74B7081286AEBD00262888 /* XCBuildMessageTextBookmark */ = 6B74B7081286AEBD00262888 /* XCBuildMessageTextBookmark */; + 6B74B7091286AEBD00262888 /* PBXTextBookmark */ = 6B74B7091286AEBD00262888 /* PBXTextBookmark */; + 6B74B70D1286AEE900262888 /* PBXTextBookmark */ = 6B74B70D1286AEE900262888 /* PBXTextBookmark */; + 6B74B7111286AF1000262888 /* PBXTextBookmark */ = 6B74B7111286AF1000262888 /* PBXTextBookmark */; + 6B74B7151286AF9000262888 /* PBXTextBookmark */ = 6B74B7151286AF9000262888 /* PBXTextBookmark */; + 6B74B7191286AFD100262888 /* PBXTextBookmark */ = 6B74B7191286AFD100262888 /* PBXTextBookmark */; + 6B74B71F1286B09D00262888 /* XCBuildMessageTextBookmark */ = 6B74B71F1286B09D00262888 /* XCBuildMessageTextBookmark */; + 6B74B7201286B09D00262888 /* PBXTextBookmark */ = 6B74B7201286B09D00262888 /* PBXTextBookmark */; + 6B74B7241286B0D900262888 /* PBXTextBookmark */ = 6B74B7241286B0D900262888 /* PBXTextBookmark */; + 6B74B7281286B14600262888 /* PBXTextBookmark */ = 6B74B7281286B14600262888 /* PBXTextBookmark */; + 6B74B72C1286B16F00262888 /* PBXTextBookmark */ = 6B74B72C1286B16F00262888 /* PBXTextBookmark */; + 6B74B7301286B1B300262888 /* PBXTextBookmark */ = 6B74B7301286B1B300262888 /* PBXTextBookmark */; + 6B74B7311286B1B300262888 /* PBXTextBookmark */ = 6B74B7311286B1B300262888 /* PBXTextBookmark */; + 6B74B7321286B1B300262888 /* PBXTextBookmark */ = 6B74B7321286B1B300262888 /* PBXTextBookmark */; + 6B74B7351286B1F900262888 /* PBXTextBookmark */ = 6B74B7351286B1F900262888 /* PBXTextBookmark */; + 6B74B7361286B1F900262888 /* PBXTextBookmark */ = 6B74B7361286B1F900262888 /* PBXTextBookmark */; + 6B74B7371286B1F900262888 /* PBXTextBookmark */ = 6B74B7371286B1F900262888 /* PBXTextBookmark */; + 6B74B7381286B1F900262888 /* PBXTextBookmark */ = 6B74B7381286B1F900262888 /* PBXTextBookmark */; + 6B74B73C1286B22000262888 /* PBXTextBookmark */ = 6B74B73C1286B22000262888 /* PBXTextBookmark */; + 6B74B7401286B7C400262888 /* PBXTextBookmark */ = 6B74B7401286B7C400262888 /* PBXTextBookmark */; + 6B74B7411286B7C400262888 /* PBXTextBookmark */ = 6B74B7411286B7C400262888 /* PBXTextBookmark */; + 6B74B7421286B7C400262888 /* PBXTextBookmark */ = 6B74B7421286B7C400262888 /* PBXTextBookmark */; + 6B74B7441286B8E600262888 /* PBXTextBookmark */ = 6B74B7441286B8E600262888 /* PBXTextBookmark */; + 6B74B7451286B8E600262888 /* PBXTextBookmark */ = 6B74B7451286B8E600262888 /* PBXTextBookmark */; + 6B74B7461286B8E600262888 /* PBXTextBookmark */ = 6B74B7461286B8E600262888 /* PBXTextBookmark */; + 6B74B7471286B8E600262888 /* PBXTextBookmark */ = 6B74B7471286B8E600262888 /* PBXTextBookmark */; + 6B74B74A1286B90100262888 /* PBXTextBookmark */ = 6B74B74A1286B90100262888 /* PBXTextBookmark */; + 6B74B74B1286B90100262888 /* PBXTextBookmark */ = 6B74B74B1286B90100262888 /* PBXTextBookmark */; + 6B74B74C1286B90100262888 /* PBXTextBookmark */ = 6B74B74C1286B90100262888 /* PBXTextBookmark */; + 6B74B74D1286B90100262888 /* PBXTextBookmark */ = 6B74B74D1286B90100262888 /* PBXTextBookmark */; + 6B74B7561286B92300262888 /* PBXTextBookmark */ = 6B74B7561286B92300262888 /* PBXTextBookmark */; + 6B74B7571286B92300262888 /* XCBuildMessageTextBookmark */ = 6B74B7571286B92300262888 /* XCBuildMessageTextBookmark */; + 6B74B7581286B92300262888 /* PBXTextBookmark */ = 6B74B7581286B92300262888 /* PBXTextBookmark */; + 6B74B75F1286BB6900262888 /* PBXTextBookmark */ = 6B74B75F1286BB6900262888 /* PBXTextBookmark */; + 6B74B7601286BB6900262888 /* PBXTextBookmark */ = 6B74B7601286BB6900262888 /* PBXTextBookmark */; + 6B74B7611286BB6900262888 /* PBXTextBookmark */ = 6B74B7611286BB6900262888 /* PBXTextBookmark */; + 6B74B7621286BB6900262888 /* PBXTextBookmark */ = 6B74B7621286BB6900262888 /* PBXTextBookmark */; + 6B74B7631286BB6900262888 /* PBXTextBookmark */ = 6B74B7631286BB6900262888 /* PBXTextBookmark */; + 6B74B76A1286F56B00262888 /* PBXTextBookmark */ = 6B74B76A1286F56B00262888 /* PBXTextBookmark */; + 6B74B76B1286F56B00262888 /* PBXTextBookmark */ = 6B74B76B1286F56B00262888 /* PBXTextBookmark */; + 6B74B76C1286F56B00262888 /* PBXTextBookmark */ = 6B74B76C1286F56B00262888 /* PBXTextBookmark */; + 6B74B76D1286F56B00262888 /* PBXTextBookmark */ = 6B74B76D1286F56B00262888 /* PBXTextBookmark */; + 6B74B76E1286F56B00262888 /* PBXTextBookmark */ = 6B74B76E1286F56B00262888 /* PBXTextBookmark */; + 6B74B76F1286F56B00262888 /* PBXTextBookmark */ = 6B74B76F1286F56B00262888 /* PBXTextBookmark */; + 6B74B7701286F56B00262888 /* PBXTextBookmark */ = 6B74B7701286F56B00262888 /* PBXTextBookmark */; + 6B74B7711286F56B00262888 /* PBXTextBookmark */ = 6B74B7711286F56B00262888 /* PBXTextBookmark */; + 6B74B7761286F61200262888 /* PBXTextBookmark */ = 6B74B7761286F61200262888 /* PBXTextBookmark */; + 6B74B7771286F61200262888 /* PBXTextBookmark */ = 6B74B7771286F61200262888 /* PBXTextBookmark */; + 6B74B7781286F61200262888 /* PBXTextBookmark */ = 6B74B7781286F61200262888 /* PBXTextBookmark */; + 6B74B7791286F61200262888 /* PBXTextBookmark */ = 6B74B7791286F61200262888 /* PBXTextBookmark */; + 6B74B7801286F72D00262888 /* PBXTextBookmark */ = 6B74B7801286F72D00262888 /* PBXTextBookmark */; + 6B74B7811286F72D00262888 /* PBXTextBookmark */ = 6B74B7811286F72D00262888 /* PBXTextBookmark */; + 6B74B7821286F72D00262888 /* PBXTextBookmark */ = 6B74B7821286F72D00262888 /* PBXTextBookmark */; + 6B74B7831286F72D00262888 /* PBXTextBookmark */ = 6B74B7831286F72D00262888 /* PBXTextBookmark */; + 6B74B7841286F72D00262888 /* PBXTextBookmark */ = 6B74B7841286F72D00262888 /* PBXTextBookmark */; + 6B74B7851286F72D00262888 /* PBXTextBookmark */ = 6B74B7851286F72D00262888 /* PBXTextBookmark */; + 6B74B7861286F72D00262888 /* PBXTextBookmark */ = 6B74B7861286F72D00262888 /* PBXTextBookmark */; + 6B74B7871286F72D00262888 /* PBXTextBookmark */ = 6B74B7871286F72D00262888 /* PBXTextBookmark */; + 6B74B78B1286F76300262888 /* PBXTextBookmark */ = 6B74B78B1286F76300262888 /* PBXTextBookmark */; + 6B74B78C1286F76300262888 /* PBXTextBookmark */ = 6B74B78C1286F76300262888 /* PBXTextBookmark */; + 6B74B78D1286F76300262888 /* PBXTextBookmark */ = 6B74B78D1286F76300262888 /* PBXTextBookmark */; + 6B74B7901286F77500262888 /* PBXTextBookmark */ = 6B74B7901286F77500262888 /* PBXTextBookmark */; + 6B74B7911286F77500262888 /* PBXTextBookmark */ = 6B74B7911286F77500262888 /* PBXTextBookmark */; + 6B74B7921286F77500262888 /* PBXTextBookmark */ = 6B74B7921286F77500262888 /* PBXTextBookmark */; + 6B74B7931286F78400262888 /* PBXTextBookmark */ = 6B74B7931286F78400262888 /* PBXTextBookmark */; + 6B74B7941286F78400262888 /* PBXTextBookmark */ = 6B74B7941286F78400262888 /* PBXTextBookmark */; + 6B74B7951286F78400262888 /* PBXTextBookmark */ = 6B74B7951286F78400262888 /* PBXTextBookmark */; + 6B74B7981286F7CD00262888 /* PBXTextBookmark */ = 6B74B7981286F7CD00262888 /* PBXTextBookmark */; + 6B74B7991286F7CD00262888 /* PBXTextBookmark */ = 6B74B7991286F7CD00262888 /* PBXTextBookmark */; + 6B74B79A1286F7CD00262888 /* PBXTextBookmark */ = 6B74B79A1286F7CD00262888 /* PBXTextBookmark */; + 6B74B79B1286F7CD00262888 /* PBXTextBookmark */ = 6B74B79B1286F7CD00262888 /* PBXTextBookmark */; + 6B74B79C1286F7CD00262888 /* PBXTextBookmark */ = 6B74B79C1286F7CD00262888 /* PBXTextBookmark */; + 6B74B79D1286F7CD00262888 /* PBXTextBookmark */ = 6B74B79D1286F7CD00262888 /* PBXTextBookmark */; + 6B74B79E1286F7CD00262888 /* PBXTextBookmark */ = 6B74B79E1286F7CD00262888 /* PBXTextBookmark */; + 6B74B79F1286F7D700262888 /* PBXTextBookmark */ = 6B74B79F1286F7D700262888 /* PBXTextBookmark */; + 6B74B7A01286F7D700262888 /* PBXTextBookmark */ = 6B74B7A01286F7D700262888 /* PBXTextBookmark */; + 6B74B7A11286F7D700262888 /* PBXTextBookmark */ = 6B74B7A11286F7D700262888 /* PBXTextBookmark */; + 6B74B7A61286F8E700262888 /* PBXTextBookmark */ = 6B74B7A61286F8E700262888 /* PBXTextBookmark */; + 6B74B7A71286F8E700262888 /* PBXTextBookmark */ = 6B74B7A71286F8E700262888 /* PBXTextBookmark */; + 6B74B7A81286F8E700262888 /* PBXTextBookmark */ = 6B74B7A81286F8E700262888 /* PBXTextBookmark */; + 6B74B7AC1286F93000262888 /* PBXTextBookmark */ = 6B74B7AC1286F93000262888 /* PBXTextBookmark */; + 6B74B7AD1286F93000262888 /* PBXTextBookmark */ = 6B74B7AD1286F93000262888 /* PBXTextBookmark */; + 6B74B7AE1286F93000262888 /* PBXTextBookmark */ = 6B74B7AE1286F93000262888 /* PBXTextBookmark */; + 6B74B7AF1286F93000262888 /* PBXTextBookmark */ = 6B74B7AF1286F93000262888 /* PBXTextBookmark */; + 6B74B7B01286F93000262888 /* PBXTextBookmark */ = 6B74B7B01286F93000262888 /* PBXTextBookmark */; + 6B74B7B21286F99100262888 /* PBXTextBookmark */ = 6B74B7B21286F99100262888 /* PBXTextBookmark */; + 6B74B7B31286F99100262888 /* PBXTextBookmark */ = 6B74B7B31286F99100262888 /* PBXTextBookmark */; + 6B74B7B41286F99100262888 /* PBXTextBookmark */ = 6B74B7B41286F99100262888 /* PBXTextBookmark */; + 6B74B7B51286F9D900262888 /* PBXTextBookmark */ = 6B74B7B51286F9D900262888 /* PBXTextBookmark */; + 6B74B7B61286F9D900262888 /* PBXTextBookmark */ = 6B74B7B61286F9D900262888 /* PBXTextBookmark */; + 6B74B7B71286F9D900262888 /* PBXTextBookmark */ = 6B74B7B71286F9D900262888 /* PBXTextBookmark */; + 6B74B7BA1286F9F400262888 /* PBXTextBookmark */ = 6B74B7BA1286F9F400262888 /* PBXTextBookmark */; + 6B74B7BB1286F9F400262888 /* PBXTextBookmark */ = 6B74B7BB1286F9F400262888 /* PBXTextBookmark */; + 6B74B7BC1286F9F400262888 /* PBXTextBookmark */ = 6B74B7BC1286F9F400262888 /* PBXTextBookmark */; + 6B74B7C01286FA5200262888 /* PBXTextBookmark */ = 6B74B7C01286FA5200262888 /* PBXTextBookmark */; + 6B74B7C11286FA5200262888 /* PBXTextBookmark */ = 6B74B7C11286FA5200262888 /* PBXTextBookmark */; + 6B74B7C21286FA5200262888 /* PBXTextBookmark */ = 6B74B7C21286FA5200262888 /* PBXTextBookmark */; + 6B74B7C51286FAB500262888 /* PBXTextBookmark */ = 6B74B7C51286FAB500262888 /* PBXTextBookmark */; + 6B74B7C61286FAB500262888 /* PBXTextBookmark */ = 6B74B7C61286FAB500262888 /* PBXTextBookmark */; + 6B74B7C71286FAB500262888 /* PBXTextBookmark */ = 6B74B7C71286FAB500262888 /* PBXTextBookmark */; + 6B74B7CB1286FAD800262888 /* PBXTextBookmark */ = 6B74B7CB1286FAD800262888 /* PBXTextBookmark */; + 6B74B7CC1286FAD800262888 /* PBXTextBookmark */ = 6B74B7CC1286FAD800262888 /* PBXTextBookmark */; + 6B8D565F127ADB0D0077C699 = 6B8D565F127ADB0D0077C699 /* PBXTextBookmark */; + 6B8D566D127ADB7D0077C699 = 6B8D566D127ADB7D0077C699 /* PBXTextBookmark */; + 6B8D566F127ADB7D0077C699 = 6B8D566F127ADB7D0077C699 /* PBXTextBookmark */; + 6B8D56C7127AEC100077C699 = 6B8D56C7127AEC100077C699 /* PBXTextBookmark */; + 6B8D56C8127AEC100077C699 = 6B8D56C8127AEC100077C699 /* PBXTextBookmark */; + 6B8D56C9127AEC100077C699 = 6B8D56C9127AEC100077C699 /* PBXTextBookmark */; + 6B8D56CA127AEC100077C699 = 6B8D56CA127AEC100077C699 /* PBXTextBookmark */; + 6B8D56CB127AEC100077C699 = 6B8D56CB127AEC100077C699 /* PBXTextBookmark */; + 6B8D56CC127AEC100077C699 = 6B8D56CC127AEC100077C699 /* PBXTextBookmark */; + 6B8D56CD127AEC100077C699 = 6B8D56CD127AEC100077C699 /* PBXTextBookmark */; + 6B8D56CE127AEC100077C699 = 6B8D56CE127AEC100077C699 /* PBXTextBookmark */; + 6B8D56CF127AEC100077C699 = 6B8D56CF127AEC100077C699 /* PBXTextBookmark */; + 6B8D56D0127AEC100077C699 = 6B8D56D0127AEC100077C699 /* PBXTextBookmark */; + 6B8D56D2127AEC100077C699 = 6B8D56D2127AEC100077C699 /* PBXTextBookmark */; + 6B8D56D8127AEC580077C699 = 6B8D56D8127AEC580077C699 /* PBXTextBookmark */; + 6B8D56DB127DF2620077C699 = 6B8D56DB127DF2620077C699 /* PBXTextBookmark */; + 6B8D56DC127DF2620077C699 = 6B8D56DC127DF2620077C699 /* PBXTextBookmark */; + }; + sourceControlManager = 6B8632A90F78115100E2684A /* Source Control */; + userBookmarkGroup = 6B8DE6F010A88F0500DF20FB /* PBXBookmarkGroup */; + userBuildSettings = { + }; + }; + 32CA4F630368D1EE00C91783 /* Recast_Prefix.pch */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {931, 641}}"; + sepNavSelRange = "{143, 0}"; + sepNavVisRange = "{0, 143}"; + sepNavWindowFrame = "{{38, 57}, {1011, 695}}"; + }; + }; + 6B10014C11AD1C1E0098A59A /* RecastMesh.cpp:1324 */ = { + isa = PBXFileBreakpoint; + actions = ( + ); + breakpointStyle = 0; + continueAfterActions = 0; + countType = 0; + delayBeforeContinue = 0; + fileReference = 6B137C870F7FCC1100459200 /* RecastMesh.cpp */; + functionName = "rcMergeInternalVertices(rcPolyMesh& mesh, const int mergeThreshold)"; + hitCount = 0; + ignoreCount = 0; + lineNumber = 1324; + location = Recast; + modificationTime = 310835892.37664; + originalNumberOfMultipleMatches = 1; + state = 0; + }; + 6B1185F41006895B0018F96F /* DetourNode.cpp */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {931, 2210}}"; + sepNavSelRange = "{2206, 0}"; + sepNavVisRange = "{2084, 586}"; + }; + }; + 6B1185F61006896B0018F96F /* DetourNode.h */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {931, 1807}}"; + sepNavSelRange = "{1621, 0}"; + sepNavVisRange = "{1443, 559}"; + }; + }; + 6B1185FC10068B040018F96F /* DetourCommon.h */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {931, 3406}}"; + sepNavSelRange = "{4673, 0}"; + sepNavVisRange = "{4016, 1105}"; + }; + }; + 6B1185FD10068B150018F96F /* DetourCommon.cpp */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {931, 4095}}"; + sepNavSelRange = "{7172, 0}"; + sepNavVisRange = "{6461, 1315}"; + }; + }; + 6B137C6C0F7FCBBB00459200 /* imgui.cpp */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {931, 8567}}"; + sepNavSelRange = "{3831, 0}"; + sepNavVisRange = "{2893, 1467}"; + }; + }; + 6B137C6D0F7FCBBB00459200 /* MeshLoaderObj.cpp */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {931, 2912}}"; + sepNavSelRange = "{4217, 0}"; + sepNavVisRange = "{3666, 1197}"; + }; + }; + 6B137C6E0F7FCBBB00459200 /* SDLMain.m */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {1112, 6464}}"; + sepNavSelRange = "{11212, 0}"; + sepNavVisRange = "{11026, 190}"; + }; + }; + 6B137C7A0F7FCBE400459200 /* imgui.h */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {931, 1417}}"; + sepNavSelRange = "{2208, 20}"; + sepNavVisRange = "{1506, 1270}"; + }; + }; + 6B137C7B0F7FCBE400459200 /* MeshLoaderObj.h */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {931, 676}}"; + sepNavSelRange = "{1045, 0}"; + sepNavVisRange = "{0, 1662}"; + }; + }; + 6B137C7C0F7FCBE400459200 /* SDLMain.h */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {915, 561}}"; + sepNavSelRange = "{307, 0}"; + sepNavVisRange = "{0, 307}"; + }; + }; + 6B137C7E0F7FCBFE00459200 /* Recast.h */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {931, 9659}}"; + sepNavSelRange = "{12869, 0}"; + sepNavVisRange = "{12166, 1292}"; + sepNavWindowFrame = "{{15, 51}, {1214, 722}}"; + }; + }; + 6B137C820F7FCC1100459200 /* Recast.cpp */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {931, 5447}}"; + sepNavSelRange = "{5691, 0}"; + sepNavVisRange = "{4981, 1352}"; + }; + }; + 6B137C830F7FCC1100459200 /* RecastContour.cpp */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {931, 9932}}"; + sepNavSelRange = "{20095, 0}"; + sepNavVisRange = "{19310, 1476}"; + sepNavWindowFrame = "{{38, 30}, {1214, 722}}"; + }; + }; + 6B137C850F7FCC1100459200 /* RecastFilter.cpp */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {931, 2340}}"; + sepNavSelRange = "{4691, 1}"; + sepNavVisRange = "{3983, 1178}"; + sepNavWindowFrame = "{{15, 78}, {1011, 695}}"; + }; + }; + 6B137C870F7FCC1100459200 /* RecastMesh.cpp */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {1069, 17121}}"; + sepNavSelRange = "{30602, 0}"; + sepNavVisRange = "{29923, 1482}"; + }; + }; + 6B137C880F7FCC1100459200 /* RecastRasterization.cpp */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {931, 4290}}"; + sepNavSelRange = "{9517, 0}"; + sepNavVisRange = "{8432, 1409}"; + sepNavWindowFrame = "{{15, 51}, {1214, 722}}"; + }; + }; + 6B137C890F7FCC1100459200 /* RecastRegion.cpp */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {931, 16081}}"; + sepNavSelRange = "{25263, 0}"; + sepNavVisRange = "{24581, 1610}"; + }; + }; + 6B25B6100FFA62AD004F1BC4 /* Sample.h */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {853, 1768}}"; + sepNavSelRange = "{4017, 0}"; + sepNavVisRange = "{3169, 938}"; + }; + }; + 6B25B6140FFA62BE004F1BC4 /* Sample.cpp */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {853, 2665}}"; + sepNavSelRange = "{1359, 15}"; + sepNavVisRange = "{1462, 315}"; + }; + }; + 6B25B6180FFA62BE004F1BC4 /* main.cpp */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {931, 11999}}"; + sepNavSelRange = "{4517, 0}"; + sepNavVisRange = "{4260, 637}"; + sepNavWindowFrame = "{{15, 51}, {1214, 722}}"; + }; + }; + 6B2AEC510FFB8946005BE9CC /* Sample_TileMesh.h */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {853, 1404}}"; + sepNavSelRange = "{2493, 0}"; + sepNavVisRange = "{1971, 893}"; + sepNavWindowFrame = "{{15, 78}, {1011, 695}}"; + }; + }; + 6B2AEC520FFB8958005BE9CC /* Sample_TileMesh.cpp */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {853, 15587}}"; + sepNavSelRange = "{32666, 62}"; + sepNavVisRange = "{31865, 1382}"; + sepNavWindowFrame = "{{38, 30}, {1214, 722}}"; + }; + }; + 6B324C64111C5D9A00EBD2FD /* ConvexVolumeTool.h */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {931, 728}}"; + sepNavSelRange = "{1597, 0}"; + sepNavVisRange = "{979, 804}"; + }; + }; + 6B324C65111C5D9A00EBD2FD /* ConvexVolumeTool.cpp */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {931, 3913}}"; + sepNavSelRange = "{5654, 0}"; + sepNavVisRange = "{5394, 529}"; + }; + }; + 6B42164711806B2F006C347B /* DetourDebugDraw.cpp:362 */ = { + isa = PBXFileBreakpoint; + actions = ( + ); + breakpointStyle = 0; + continueAfterActions = 0; + countType = 0; + delayBeforeContinue = 0; + fileReference = 6BB93C7B10CFE1D500F74F2B /* DetourDebugDraw.cpp */; + functionName = "drawMeshTilePortal(duDebugDraw* dd, const dtMeshTile* tile)"; + hitCount = 0; + ignoreCount = 0; + lineNumber = 362; + location = Recast; + modificationTime = 310835896.114027; + originalNumberOfMultipleMatches = 1; + state = 1; + }; + 6B4DE616127F2407001CFDF4 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6BB7FC0A10EBB6AA006DA0A6 /* NavMeshTesterTool.cpp */; + name = "NavMeshTesterTool.cpp: 543"; + rLen = 8; + rLoc = 14441; + rType = 0; + vrLen = 1012; + vrLoc = 13908; + }; + 6B4DE62E12807542001CFDF4 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6BB7FC0A10EBB6AA006DA0A6 /* NavMeshTesterTool.cpp */; + name = "NavMeshTesterTool.cpp: 537"; + rLen = 0; + rLoc = 14234; + rType = 0; + vrLen = 1338; + vrLoc = 13908; + }; + 6B4DE62F12807542001CFDF4 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6B98470511E733B600FA177B /* RecastAlloc.h */; + name = "RecastAlloc.h: 51"; + rLen = 71; + rLoc = 1797; + rType = 0; + vrLen = 1235; + vrLoc = 1112; + }; + 6B4DE63012807542001CFDF4 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6BAF40DA12196A3D008CFCDF /* DetourNavMeshQuery.cpp */; + name = "DetourNavMeshQuery.cpp: 805"; + rLen = 0; + rLoc = 21598; + rType = 0; + vrLen = 935; + vrLoc = 21001; + }; + 6B4DE63112807542001CFDF4 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6BAF40D912196A25008CFCDF /* DetourNavMeshQuery.h */; + name = "DetourNavMeshQuery.h: 166"; + rLen = 679; + rLoc = 7509; + rType = 0; + vrLen = 1926; + vrLoc = 6655; + }; + 6B4DE63212807542001CFDF4 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6BD667D8123D27EC0021A7A4 /* CrowdManager.h */; + name = "CrowdManager.h: 313"; + rLen = 0; + rLoc = 7714; + rType = 0; + vrLen = 1485; + vrLoc = 6661; + }; + 6B4DE63312807542001CFDF4 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6BB93C7810CFE1D500F74F2B /* DetourDebugDraw.h */; + name = "DetourDebugDraw.h: 33"; + rLen = 83; + rLoc = 1365; + rType = 0; + vrLen = 1748; + vrLoc = 0; + }; + 6B4DE63412807542001CFDF4 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6BAF3C581211663A008CFCDF /* CrowdTool.cpp */; + name = "CrowdTool.cpp: 324"; + rLen = 0; + rLoc = 8773; + rType = 0; + vrLen = 1076; + vrLoc = 7627; + }; + 6B4DE63512807542001CFDF4 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6BD667D9123D28100021A7A4 /* CrowdManager.cpp */; + name = "CrowdManager.cpp: 571"; + rLen = 0; + rLoc = 12978; + rType = 0; + vrLen = 892; + vrLoc = 12474; + }; + 6B4DE63612807542001CFDF4 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6BD667D9123D28100021A7A4 /* CrowdManager.cpp */; + name = "CrowdManager.cpp: 556"; + rLen = 0; + rLoc = 12709; + rType = 0; + vrLen = 889; + vrLoc = 12477; + }; + 6B4DE64412807587001CFDF4 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6BD667D9123D28100021A7A4 /* CrowdManager.cpp */; + name = "CrowdManager.cpp: 550"; + rLen = 0; + rLoc = 12708; + rType = 0; + vrLen = 906; + vrLoc = 12567; + }; + 6B4DE646128079E0001CFDF4 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6BD667D9123D28100021A7A4 /* CrowdManager.cpp */; + name = "CrowdManager.cpp: 558"; + rLen = 29; + rLoc = 12908; + rType = 0; + vrLen = 936; + vrLoc = 12471; + }; + 6B4DE647128079E0001CFDF4 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6B8DE88B10B69E4C00DF20FB /* DetourNavMesh.h */; + name = "DetourNavMesh.h: 384"; + rLen = 0; + rLoc = 15329; + rType = 0; + vrLen = 1790; + vrLoc = 14074; + }; + 6B4DE648128079E0001CFDF4 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6BAF40D912196A25008CFCDF /* DetourNavMeshQuery.h */; + name = "DetourNavMeshQuery.h: 182"; + rLen = 50; + rLoc = 8694; + rType = 0; + vrLen = 2063; + vrLoc = 7576; + }; + 6B4DE649128079E0001CFDF4 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6B1185F41006895B0018F96F /* DetourNode.cpp */; + name = "DetourNode.cpp: 73"; + rLen = 0; + rLoc = 2206; + rType = 0; + vrLen = 586; + vrLoc = 2084; + }; + 6B4DE64A128079E0001CFDF4 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6B1185F61006896B0018F96F /* DetourNode.h */; + name = "DetourNode.h: 50"; + rLen = 0; + rLoc = 1621; + rType = 0; + vrLen = 559; + vrLoc = 1443; + }; + 6B4DE64B128079E0001CFDF4 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6BAF40DA12196A3D008CFCDF /* DetourNavMeshQuery.cpp */; + name = "DetourNavMeshQuery.cpp: 2558"; + rLen = 8; + rLoc = 68383; + rType = 0; + vrLen = 552; + vrLoc = 67890; + }; + 6B4DE64C128079E0001CFDF4 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6BAF40DA12196A3D008CFCDF /* DetourNavMeshQuery.cpp */; + name = "DetourNavMeshQuery.cpp: 1054"; + rLen = 0; + rLoc = 28267; + rType = 0; + vrLen = 495; + vrLoc = 28027; + }; + 6B4DE651128079F3001CFDF4 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6BAF40DA12196A3D008CFCDF /* DetourNavMeshQuery.cpp */; + name = "DetourNavMeshQuery.cpp: 1050"; + rLen = 0; + rLoc = 28236; + rType = 0; + vrLen = 677; + vrLoc = 28024; + }; + 6B4DE65D12807AB6001CFDF4 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6BD667D9123D28100021A7A4 /* CrowdManager.cpp */; + name = "CrowdManager.cpp: 557"; + rLen = 0; + rLoc = 12879; + rType = 0; + vrLen = 1002; + vrLoc = 12405; + }; + 6B4DE65E12807AB6001CFDF4 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6BAF40DA12196A3D008CFCDF /* DetourNavMeshQuery.cpp */; + rLen = 0; + rLoc = 1020; + rType = 1; + }; + 6B4DE65F12807AB6001CFDF4 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6BAF40DA12196A3D008CFCDF /* DetourNavMeshQuery.cpp */; + name = "DetourNavMeshQuery.cpp: 1036"; + rLen = 0; + rLoc = 27891; + rType = 0; + vrLen = 812; + vrLoc = 27359; + }; + 6B4DE66212807AD9001CFDF4 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6BAF40DA12196A3D008CFCDF /* DetourNavMeshQuery.cpp */; + name = "DetourNavMeshQuery.cpp: 1027"; + rLen = 0; + rLoc = 27715; + rType = 0; + vrLen = 812; + vrLoc = 27359; + }; + 6B4DE66512807B09001CFDF4 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6BAF40DA12196A3D008CFCDF /* DetourNavMeshQuery.cpp */; + name = "DetourNavMeshQuery.cpp: 1027"; + rLen = 0; + rLoc = 27715; + rType = 0; + vrLen = 861; + vrLoc = 27359; + }; + 6B4DE66612807B39001CFDF4 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6BAF40DA12196A3D008CFCDF /* DetourNavMeshQuery.cpp */; + name = "DetourNavMeshQuery.cpp: 1031"; + rLen = 0; + rLoc = 27843; + rType = 0; + vrLen = 461; + vrLoc = 27468; + }; + 6B4DE66712807B39001CFDF4 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6BD667D9123D28100021A7A4 /* CrowdManager.cpp */; + rLen = 0; + rLoc = 460; + rType = 1; + }; + 6B4DE66812807B39001CFDF4 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6BD667D9123D28100021A7A4 /* CrowdManager.cpp */; + name = "CrowdManager.cpp: 927"; + rLen = 0; + rLoc = 20986; + rType = 0; + vrLen = 384; + vrLoc = 21176; + }; + 6B4DE66912807B41001CFDF4 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6BD667D9123D28100021A7A4 /* CrowdManager.cpp */; + name = "CrowdManager.cpp: 914"; + rLen = 0; + rLoc = 20986; + rType = 0; + vrLen = 927; + vrLoc = 20847; + }; + 6B4DE66A12807B41001CFDF4 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6BAF40D912196A25008CFCDF /* DetourNavMeshQuery.h */; + name = "DetourNavMeshQuery.h: 182"; + rLen = 0; + rLoc = 8696; + rType = 0; + vrLen = 2234; + vrLoc = 7469; + }; + 6B4DE66B12807B41001CFDF4 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6BAF40DA12196A3D008CFCDF /* DetourNavMeshQuery.cpp */; + name = "DetourNavMeshQuery.cpp: 1027"; + rLen = 0; + rLoc = 27715; + rType = 0; + vrLen = 861; + vrLoc = 27359; + }; + 6B4DE66C12807B41001CFDF4 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6BAF40DA12196A3D008CFCDF /* DetourNavMeshQuery.cpp */; + name = "DetourNavMeshQuery.cpp: 1027"; + rLen = 0; + rLoc = 27715; + rType = 0; + vrLen = 861; + vrLoc = 27359; + }; + 6B4DE67112807C71001CFDF4 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6BAF40DA12196A3D008CFCDF /* DetourNavMeshQuery.cpp */; + name = "DetourNavMeshQuery.cpp: 415"; + rLen = 0; + rLoc = 11165; + rType = 0; + vrLen = 1074; + vrLoc = 10401; + }; + 6B4DE67312807D05001CFDF4 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6BD667D9123D28100021A7A4 /* CrowdManager.cpp */; + name = "CrowdManager.cpp: 546"; + rLen = 0; + rLoc = 12608; + rType = 0; + vrLen = 1014; + vrLoc = 12198; + }; + 6B4DE67412807D05001CFDF4 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6BAF40DA12196A3D008CFCDF /* DetourNavMeshQuery.cpp */; + rLen = 0; + rLoc = 831; + rType = 1; + }; + 6B4DE67512807D05001CFDF4 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6BAF40DA12196A3D008CFCDF /* DetourNavMeshQuery.cpp */; + name = "DetourNavMeshQuery.cpp: 832"; + rLen = 0; + rLoc = 22260; + rType = 0; + vrLen = 911; + vrLoc = 25853; + }; + 6B555DAE100B211D00247EA3 /* imguiRenderGL.h */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {931, 641}}"; + sepNavSelRange = "{923, 0}"; + sepNavVisRange = "{0, 1106}"; + }; + }; + 6B555DB0100B212E00247EA3 /* imguiRenderGL.cpp */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {931, 5967}}"; + sepNavSelRange = "{10776, 0}"; + sepNavVisRange = "{9660, 1512}"; + }; + }; + 6B555DF6100B273500247EA3 /* stb_truetype.h */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {931, 23270}}"; + sepNavSelRange = "{27273, 0}"; + sepNavVisRange = "{26315, 1706}"; + }; + }; + 6B624169103434880002E346 /* RecastMeshDetail.cpp */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {931, 15808}}"; + sepNavSelRange = "{29028, 0}"; + sepNavVisRange = "{28456, 1353}"; + sepNavWindowFrame = "{{61, 36}, {1011, 695}}"; + }; + }; + 6B74B5DC1283104100262888 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6BAF40DA12196A3D008CFCDF /* DetourNavMeshQuery.cpp */; + name = "DetourNavMeshQuery.cpp: 832"; + rLen = 0; + rLoc = 22260; + rType = 0; + vrLen = 996; + vrLoc = 25772; + }; + 6B74B5EA128312A900262888 /* main.cpp:211 */ = { + isa = PBXFileBreakpoint; + actions = ( + ); + breakpointStyle = 0; + continueAfterActions = 0; + countType = 0; + delayBeforeContinue = 0; + fileReference = 6B25B6180FFA62BE004F1BC4 /* main.cpp */; + functionName = "main(int /*argc*/, char** /*argv*/)"; + hitCount = 0; + ignoreCount = 0; + lineNumber = 211; + location = Recast; + modificationTime = 310835896.194667; + originalNumberOfMultipleMatches = 1; + state = 1; + }; + 6B74B5EC128312AC00262888 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6BAF40DA12196A3D008CFCDF /* DetourNavMeshQuery.cpp */; + name = "DetourNavMeshQuery.cpp: 946"; + rLen = 0; + rLoc = 26084; + rType = 0; + vrLen = 996; + vrLoc = 25772; + }; + 6B74B5ED128312AC00262888 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6BB7FC0910EBB6AA006DA0A6 /* NavMeshTesterTool.h */; + name = "NavMeshTesterTool.h: 31"; + rLen = 0; + rLoc = 1158; + rType = 0; + vrLen = 474; + vrLoc = 980; + }; + 6B74B5EE128312AC00262888 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6BB7FC0A10EBB6AA006DA0A6 /* NavMeshTesterTool.cpp */; + name = "NavMeshTesterTool.cpp: 536"; + rLen = 0; + rLoc = 14217; + rType = 0; + vrLen = 734; + vrLoc = 13910; + }; + 6B74B5EF128312AC00262888 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6BCF32351104CD05009445BF /* OffMeshConnectionTool.cpp */; + name = "OffMeshConnectionTool.cpp: 61"; + rLen = 0; + rLoc = 1752; + rType = 0; + vrLen = 513; + vrLoc = 1527; + }; + 6B74B5F0128312AC00262888 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6BCF32341104CD05009445BF /* OffMeshConnectionTool.h */; + name = "OffMeshConnectionTool.h: 27"; + rLen = 0; + rLoc = 1112; + rType = 0; + vrLen = 610; + vrLoc = 956; + }; + 6B74B5F1128312AC00262888 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6B324C65111C5D9A00EBD2FD /* ConvexVolumeTool.cpp */; + name = "ConvexVolumeTool.cpp: 232"; + rLen = 0; + rLoc = 5577; + rType = 0; + vrLen = 400; + vrLoc = 5482; + }; + 6B74B5F2128312AC00262888 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6B324C64111C5D9A00EBD2FD /* ConvexVolumeTool.h */; + name = "ConvexVolumeTool.h: 32"; + rLen = 0; + rLoc = 1172; + rType = 0; + vrLen = 598; + vrLoc = 1049; + }; + 6B74B5F3128312AC00262888 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6B8036AD113BAABE005ED67B /* Sample_Debug.cpp */; + name = "Sample_Debug.cpp: 131"; + rLen = 0; + rLoc = 3338; + rType = 0; + vrLen = 598; + vrLoc = 3021; + }; + 6B74B5F4128312AC00262888 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6B8036AC113BAABE005ED67B /* Sample_Debug.h */; + name = "Sample_Debug.h: 7"; + rLen = 0; + rLoc = 269; + rType = 0; + vrLen = 1049; + vrLoc = 0; + }; + 6B74B5F5128312AC00262888 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6B2AEC520FFB8958005BE9CC /* Sample_TileMesh.cpp */; + name = "Sample_TileMesh.cpp: 709"; + rLen = 0; + rLoc = 19162; + rType = 0; + vrLen = 633; + vrLoc = 19049; + }; + 6B74B5F6128312AC00262888 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6B98463211E6144400FA177B /* Sample_SoloMeshTiled.cpp */; + name = "Sample_SoloMeshTiled.cpp: 1081"; + rLen = 0; + rLoc = 32914; + rType = 0; + vrLen = 681; + vrLoc = 32693; + }; + 6B74B5F7128312AC00262888 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6B25B6100FFA62AD004F1BC4 /* Sample.h */; + name = "Sample.h: 111"; + rLen = 12; + rLoc = 3125; + rType = 0; + vrLen = 994; + vrLoc = 2824; + }; + 6B74B5F8128312AC00262888 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6B25B6140FFA62BE004F1BC4 /* Sample.cpp */; + name = "Sample.cpp: 187"; + rLen = 0; + rLoc = 4732; + rType = 0; + vrLen = 276; + vrLoc = 4556; + }; + 6B74B5F9128312AC00262888 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6BAF3C581211663A008CFCDF /* CrowdTool.cpp */; + name = "CrowdTool.cpp: 285"; + rLen = 0; + rLoc = 7745; + rType = 0; + vrLen = 612; + vrLoc = 6937; + }; + 6B74B5FA128312AC00262888 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6BAF3C571211663A008CFCDF /* CrowdTool.h */; + name = "CrowdTool.h: 58"; + rLen = 0; + rLoc = 1724; + rType = 0; + vrLen = 684; + vrLoc = 1550; + }; + 6B74B5FB128312AC00262888 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6B25B6180FFA62BE004F1BC4 /* main.cpp */; + name = "main.cpp: 212"; + rLen = 0; + rLoc = 5203; + rType = 0; + vrLen = 733; + vrLoc = 4772; + }; + 6B74B5FC128312AC00262888 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6B25B6180FFA62BE004F1BC4 /* main.cpp */; + name = "main.cpp: 212"; + rLen = 0; + rLoc = 5203; + rType = 0; + vrLen = 733; + vrLoc = 4772; + }; + 6B74B60C128312E600262888 /* CrowdTool.cpp:296 */ = { + isa = PBXFileBreakpoint; + actions = ( + ); + breakpointStyle = 0; + continueAfterActions = 0; + countType = 0; + delayBeforeContinue = 0; + fileReference = 6BAF3C581211663A008CFCDF /* CrowdTool.cpp */; + functionName = "CrowdTool::handleStep()"; + hitCount = 0; + ignoreCount = 0; + lineNumber = 296; + location = Recast; + modificationTime = 310835896.208616; + originalNumberOfMultipleMatches = 1; + state = 1; + }; + 6B74B60E128312E900262888 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6B25B6140FFA62BE004F1BC4 /* Sample.cpp */; + name = "Sample.cpp: 187"; + rLen = 0; + rLoc = 4732; + rType = 0; + vrLen = 382; + vrLoc = 4450; + }; + 6B74B60F128312E900262888 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6B25B6180FFA62BE004F1BC4 /* main.cpp */; + name = "main.cpp: 183"; + rLen = 0; + rLoc = 4517; + rType = 0; + vrLen = 637; + vrLoc = 4260; + }; + 6B74B610128312E900262888 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6BAF3C571211663A008CFCDF /* CrowdTool.h */; + name = "CrowdTool.h: 77"; + rLen = 0; + rLoc = 2115; + rType = 0; + vrLen = 684; + vrLoc = 1550; + }; + 6B74B611128312E900262888 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6B25B6100FFA62AD004F1BC4 /* Sample.h */; + name = "Sample.h: 112"; + rLen = 0; + rLoc = 3168; + rType = 0; + vrLen = 1232; + vrLoc = 2783; + }; + 6B74B612128312E900262888 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6BAF3C581211663A008CFCDF /* CrowdTool.cpp */; + name = "CrowdTool.cpp: 273"; + rLen = 0; + rLoc = 7564; + rType = 0; + vrLen = 612; + vrLoc = 6937; + }; + 6B74B613128312E900262888 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6BAF3C581211663A008CFCDF /* CrowdTool.cpp */; + name = "CrowdTool.cpp: 283"; + rLen = 0; + rLoc = 7744; + rType = 0; + vrLen = 612; + vrLoc = 6937; + }; + 6B74B618128313D600262888 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6BAF3C581211663A008CFCDF /* CrowdTool.cpp */; + name = "CrowdTool.cpp: 283"; + rLen = 0; + rLoc = 7744; + rType = 0; + vrLen = 570; + vrLoc = 7005; + }; + 6B74B622128314A500262888 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6BAF3C581211663A008CFCDF /* CrowdTool.cpp */; + name = "CrowdTool.cpp: 283"; + rLen = 0; + rLoc = 7744; + rType = 0; + vrLen = 609; + vrLoc = 7005; + }; + 6B74B623128314A500262888 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6B25B6140FFA62BE004F1BC4 /* Sample.cpp */; + name = "Sample.cpp: 188"; + rLen = 0; + rLoc = 4728; + rType = 0; + vrLen = 569; + vrLoc = 4269; + }; + 6B74B624128314A500262888 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6B25B6100FFA62AD004F1BC4 /* Sample.h */; + name = "Sample.h: 69"; + rLen = 1; + rLoc = 2249; + rType = 0; + vrLen = 965; + vrLoc = 1493; + }; + 6B74B625128314A500262888 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6BAF3C571211663A008CFCDF /* CrowdTool.h */; + name = "CrowdTool.h: 78"; + rLen = 0; + rLoc = 2143; + rType = 0; + vrLen = 697; + vrLoc = 1537; + }; + 6B74B626128314A500262888 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6B324C64111C5D9A00EBD2FD /* ConvexVolumeTool.h */; + name = "ConvexVolumeTool.h: 49"; + rLen = 0; + rLoc = 1597; + rType = 0; + vrLen = 804; + vrLoc = 979; + }; + 6B74B627128314A500262888 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6B324C65111C5D9A00EBD2FD /* ConvexVolumeTool.cpp */; + name = "ConvexVolumeTool.cpp: 237"; + rLen = 0; + rLoc = 5654; + rType = 0; + vrLen = 529; + vrLoc = 5394; + }; + 6B74B628128314A500262888 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6BCF32341104CD05009445BF /* OffMeshConnectionTool.h */; + name = "OffMeshConnectionTool.h: 44"; + rLen = 0; + rLoc = 1546; + rType = 0; + vrLen = 910; + vrLoc = 789; + }; + 6B74B629128314A500262888 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6BCF32351104CD05009445BF /* OffMeshConnectionTool.cpp */; + name = "OffMeshConnectionTool.cpp: 139"; + rLen = 0; + rLoc = 3345; + rType = 0; + vrLen = 569; + vrLoc = 2831; + }; + 6B74B62A128314A500262888 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6BB7FC0910EBB6AA006DA0A6 /* NavMeshTesterTool.h */; + name = "NavMeshTesterTool.h: 97"; + rLen = 0; + rLoc = 2745; + rType = 0; + vrLen = 953; + vrLoc = 2051; + }; + 6B74B62B128314A500262888 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6BB7FC0A10EBB6AA006DA0A6 /* NavMeshTesterTool.cpp */; + name = "NavMeshTesterTool.cpp: 323"; + rLen = 0; + rLoc = 8413; + rType = 0; + vrLen = 624; + vrLoc = 8249; + }; + 6B74B62C128314A500262888 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6B2AEC520FFB8958005BE9CC /* Sample_TileMesh.cpp */; + name = "Sample_TileMesh.cpp: 130"; + rLen = 0; + rLoc = 2988; + rType = 0; + vrLen = 757; + vrLoc = 2639; + }; + 6B74B62D128314A500262888 /* XCBuildMessageTextBookmark */ = { + isa = PBXTextBookmark; + comments = "Cannot allocate an object of abstract type 'TileHighlightTool'"; + fRef = 6B98463211E6144400FA177B /* Sample_SoloMeshTiled.cpp */; + fallbackIsa = XCBuildMessageTextBookmark; + rLen = 1; + rLoc = 227; + rType = 1; + }; + 6B74B62E128314A500262888 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6B98463211E6144400FA177B /* Sample_SoloMeshTiled.cpp */; + name = "Sample_SoloMeshTiled.cpp: 95"; + rLen = 0; + rLoc = 2414; + rType = 0; + vrLen = 739; + vrLoc = 1996; + }; + 6B74B66412869CE100262888 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6B98463211E6144400FA177B /* Sample_SoloMeshTiled.cpp */; + name = "Sample_SoloMeshTiled.cpp: 79"; + rLen = 0; + rLoc = 2078; + rType = 0; + vrLen = 852; + vrLoc = 1883; + }; + 6B74B66512869CE100262888 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6BD667D8123D27EC0021A7A4 /* CrowdManager.h */; + name = "CrowdManager.h: 144"; + rLen = 0; + rLoc = 3497; + rType = 0; + vrLen = 1121; + vrLoc = 2907; + }; + 6B74B66612869CE100262888 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6BD667D9123D28100021A7A4 /* CrowdManager.cpp */; + name = "CrowdManager.cpp: 542"; + rLen = 0; + rLoc = 12512; + rType = 0; + vrLen = 985; + vrLoc = 12246; + }; + 6B74B66712869CE100262888 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6BAF40D912196A25008CFCDF /* DetourNavMeshQuery.h */; + name = "DetourNavMeshQuery.h: 189"; + rLen = 29; + rLoc = 8664; + rType = 0; + vrLen = 2073; + vrLoc = 7667; + }; + 6B74B66812869CE100262888 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6BAF40DA12196A3D008CFCDF /* DetourNavMeshQuery.cpp */; + name = "DetourNavMeshQuery.cpp: 1029"; + rLen = 0; + rLoc = 27789; + rType = 0; + vrLen = 755; + vrLoc = 27424; + }; + 6B74B66F12869E3000262888 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6BAF40DA12196A3D008CFCDF /* DetourNavMeshQuery.cpp */; + name = "DetourNavMeshQuery.cpp: 1029"; + rLen = 0; + rLoc = 27789; + rType = 0; + vrLen = 755; + vrLoc = 27424; + }; + 6B74B67012869E3000262888 /* XCBuildMessageTextBookmark */ = { + isa = PBXTextBookmark; + comments = "'class PathCorridor' has no member named 'optimizePath2'"; + fRef = 6BD667D9123D28100021A7A4 /* CrowdManager.cpp */; + fallbackIsa = XCBuildMessageTextBookmark; + rLen = 0; + rLoc = 1299; + rType = 1; + }; + 6B74B67112869E3000262888 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6BD667D9123D28100021A7A4 /* CrowdManager.cpp */; + name = "CrowdManager.cpp: 1268"; + rLen = 0; + rLoc = 20986; + rType = 0; + vrLen = 659; + vrLoc = 29463; + }; + 6B74B6831286A39000262888 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6BD667D8123D27EC0021A7A4 /* CrowdManager.h */; + name = "CrowdManager.h: 221"; + rLen = 15; + rLoc = 5373; + rType = 0; + vrLen = 645; + vrLoc = 5191; + }; + 6B74B6841286A39000262888 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6BD667D9123D28100021A7A4 /* CrowdManager.cpp */; + name = "CrowdManager.cpp: 1287"; + rLen = 0; + rLoc = 20986; + rType = 0; + vrLen = 730; + vrLoc = 29522; + }; + 6B74B6851286A39000262888 /* XCBuildMessageTextBookmark */ = { + isa = PBXTextBookmark; + comments = "'class CrowdManager' has no member named 'optimizePaths'"; + fRef = 6BAF3C581211663A008CFCDF /* CrowdTool.cpp */; + fallbackIsa = XCBuildMessageTextBookmark; + rLen = 1; + rLoc = 295; + rType = 1; + }; + 6B74B6861286A39000262888 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6BAF3C581211663A008CFCDF /* CrowdTool.cpp */; + name = "CrowdTool.cpp: 288"; + rLen = 0; + rLoc = 7797; + rType = 0; + vrLen = 564; + vrLoc = 7012; + }; + 6B74B68A1286A47800262888 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6BAF3C581211663A008CFCDF /* CrowdTool.cpp */; + name = "CrowdTool.cpp: 288"; + rLen = 0; + rLoc = 7797; + rType = 0; + vrLen = 560; + vrLoc = 7016; + }; + 6B74B68B1286A47800262888 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6BD667D9123D28100021A7A4 /* CrowdManager.cpp */; + name = "CrowdManager.cpp: 1287"; + rLen = 0; + rLoc = 20986; + rType = 0; + vrLen = 643; + vrLoc = 30497; + }; + 6B74B68C1286A47800262888 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6BD667D9123D28100021A7A4 /* CrowdManager.cpp */; + name = "CrowdManager.cpp: 1287"; + rLen = 0; + rLoc = 20986; + rType = 0; + vrLen = 643; + vrLoc = 30497; + }; + 6B74B68F1286A4DD00262888 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6BD667D9123D28100021A7A4 /* CrowdManager.cpp */; + name = "CrowdManager.cpp: 1307"; + rLen = 0; + rLoc = 20986; + rType = 0; + vrLen = 646; + vrLoc = 30512; + }; + 6B74B69C1286A52A00262888 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6BD667D8123D27EC0021A7A4 /* CrowdManager.h */; + name = "CrowdManager.h: 221"; + rLen = 15; + rLoc = 5373; + rType = 0; + vrLen = 577; + vrLoc = 5191; + }; + 6B74B69D1286A52A00262888 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6BD667D9123D28100021A7A4 /* CrowdManager.cpp */; + name = "CrowdManager.cpp: 1319"; + rLen = 0; + rLoc = 20986; + rType = 0; + vrLen = 664; + vrLoc = 30512; + }; + 6B74B69E1286A52A00262888 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6BD667D9123D28100021A7A4 /* CrowdManager.cpp */; + name = "CrowdManager.cpp: 1266"; + rLen = 0; + rLoc = 29651; + rType = 0; + vrLen = 645; + vrLoc = 29509; + }; + 6B74B6A01286A67500262888 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6BD667D9123D28100021A7A4 /* CrowdManager.cpp */; + name = "CrowdManager.cpp: 1311"; + rLen = 0; + rLoc = 30586; + rType = 0; + vrLen = 712; + vrLoc = 30235; + }; + 6B74B6A11286A6AE00262888 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6BD667D9123D28100021A7A4 /* CrowdManager.cpp */; + name = "CrowdManager.cpp: 1320"; + rLen = 0; + rLoc = 30793; + rType = 0; + vrLen = 823; + vrLoc = 30235; + }; + 6B74B6A61286A6C300262888 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6BD667D9123D28100021A7A4 /* CrowdManager.cpp */; + name = "CrowdManager.cpp: 1303"; + rLen = 0; + rLoc = 30432; + rType = 0; + vrLen = 901; + vrLoc = 30193; + }; + 6B74B6AA1286A85800262888 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6BD667D9123D28100021A7A4 /* CrowdManager.cpp */; + name = "CrowdManager.cpp: 1308"; + rLen = 0; + rLoc = 30536; + rType = 0; + vrLen = 917; + vrLoc = 30193; + }; + 6B74B6AB1286A85800262888 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6BAF3C581211663A008CFCDF /* CrowdTool.cpp */; + name = "CrowdTool.cpp: 288"; + rLen = 0; + rLoc = 7797; + rType = 0; + vrLen = 864; + vrLoc = 6760; + }; + 6B74B6AC1286A85800262888 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6BAF3C581211663A008CFCDF /* CrowdTool.cpp */; + name = "CrowdTool.cpp: 499"; + rLen = 0; + rLoc = 13836; + rType = 0; + vrLen = 1470; + vrLoc = 12774; + }; + 6B74B6B51286A9BD00262888 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6BB93C7A10CFE1D500F74F2B /* DebugDraw.cpp */; + name = "DebugDraw.cpp: 329"; + rLen = 0; + rLoc = 9151; + rType = 0; + vrLen = 887; + vrLoc = 8781; + }; + 6B74B6B61286A9BD00262888 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6BB93C7710CFE1D500F74F2B /* DebugDraw.h */; + name = "DebugDraw.h: 144"; + rLen = 0; + rLoc = 5161; + rType = 0; + vrLen = 1546; + vrLoc = 4603; + }; + 6B74B6B71286A9BD00262888 /* XCBuildMessageTextBookmark */ = { + isa = PBXTextBookmark; + comments = "Unused variable 'radius'"; + fRef = 6BAF3C581211663A008CFCDF /* CrowdTool.cpp */; + fallbackIsa = XCBuildMessageTextBookmark; + rLen = 1; + rLoc = 536; + rType = 1; + }; + 6B74B6B81286A9BD00262888 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6BAF3C581211663A008CFCDF /* CrowdTool.cpp */; + name = "CrowdTool.cpp: 510"; + rLen = 0; + rLoc = 14064; + rType = 0; + vrLen = 769; + vrLoc = 12965; + }; + 6B74B6BE1286AA0C00262888 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6BAF3C581211663A008CFCDF /* CrowdTool.cpp */; + name = "CrowdTool.cpp: 510"; + rLen = 0; + rLoc = 14064; + rType = 0; + vrLen = 769; + vrLoc = 12965; + }; + 6B74B6BF1286AA0C00262888 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6B8DE88710B69E3E00DF20FB /* DetourNavMesh.cpp */; + name = "DetourNavMesh.cpp: 902"; + rLen = 0; + rLoc = 24360; + rType = 0; + vrLen = 634; + vrLoc = 24147; + }; + 6B74B6C01286AA0C00262888 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6BB93C7A10CFE1D500F74F2B /* DebugDraw.cpp */; + name = "DebugDraw.cpp: 329"; + rLen = 0; + rLoc = 9151; + rType = 0; + vrLen = 837; + vrLoc = 8781; + }; + 6B74B6C11286AA0C00262888 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6BB93C7A10CFE1D500F74F2B /* DebugDraw.cpp */; + name = "DebugDraw.cpp: 326"; + rLen = 0; + rLoc = 9079; + rType = 0; + vrLen = 831; + vrLoc = 8785; + }; + 6B74B6C51286AA5900262888 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6BB93C7A10CFE1D500F74F2B /* DebugDraw.cpp */; + name = "DebugDraw.cpp: 344"; + rLen = 0; + rLoc = 9815; + rType = 0; + vrLen = 1029; + vrLoc = 9070; + }; + 6B74B6C91286AAA200262888 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6BB93C7A10CFE1D500F74F2B /* DebugDraw.cpp */; + name = "DebugDraw.cpp: 348"; + rLen = 0; + rLoc = 10015; + rType = 0; + vrLen = 1043; + vrLoc = 9070; + }; + 6B74B6CA1286AAA200262888 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6BAF3C581211663A008CFCDF /* CrowdTool.cpp */; + name = "CrowdTool.cpp: 510"; + rLen = 0; + rLoc = 14064; + rType = 0; + vrLen = 769; + vrLoc = 12965; + }; + 6B74B6CB1286AAA200262888 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6BAF3C581211663A008CFCDF /* CrowdTool.cpp */; + name = "CrowdTool.cpp: 500"; + rLen = 0; + rLoc = 13817; + rType = 0; + vrLen = 851; + vrLoc = 12704; + }; + 6B74B6CF1286AAF000262888 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6BAF3C581211663A008CFCDF /* CrowdTool.cpp */; + name = "CrowdTool.cpp: 496"; + rLen = 0; + rLoc = 13817; + rType = 0; + vrLen = 840; + vrLoc = 12774; + }; + 6B74B6D31286AB3B00262888 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6BAF3C581211663A008CFCDF /* CrowdTool.cpp */; + name = "CrowdTool.cpp: 500"; + rLen = 0; + rLoc = 13817; + rType = 0; + vrLen = 846; + vrLoc = 12739; + }; + 6B74B6D71286ABC000262888 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6BAF3C581211663A008CFCDF /* CrowdTool.cpp */; + name = "CrowdTool.cpp: 503"; + rLen = 0; + rLoc = 13836; + rType = 0; + vrLen = 881; + vrLoc = 12739; + }; + 6B74B6D81286ABC000262888 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6BB93C7810CFE1D500F74F2B /* DetourDebugDraw.h */; + name = "DetourDebugDraw.h: 33"; + rLen = 83; + rLoc = 1365; + rType = 0; + vrLen = 1352; + vrLoc = 396; + }; + 6B74B6D91286ABC000262888 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6BB93C7710CFE1D500F74F2B /* DebugDraw.h */; + name = "DebugDraw.h: 80"; + rLen = 9; + rLoc = 2578; + rType = 0; + vrLen = 1110; + vrLoc = 2479; + }; + 6B74B6DA1286ABC000262888 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6BB93C7A10CFE1D500F74F2B /* DebugDraw.cpp */; + name = "DebugDraw.cpp: 321"; + rLen = 0; + rLoc = 8935; + rType = 0; + vrLen = 902; + vrLoc = 8458; + }; + 6B74B6DB1286ABC000262888 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6BB93C7A10CFE1D500F74F2B /* DebugDraw.cpp */; + name = "DebugDraw.cpp: 351"; + rLen = 0; + rLoc = 10027; + rType = 0; + vrLen = 1217; + vrLoc = 9152; + }; + 6B74B6DF1286AC2A00262888 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6BB93C7A10CFE1D500F74F2B /* DebugDraw.cpp */; + name = "DebugDraw.cpp: 351"; + rLen = 0; + rLoc = 10027; + rType = 0; + vrLen = 1219; + vrLoc = 9152; + }; + 6B74B6E01286AC2A00262888 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6BAF3C581211663A008CFCDF /* CrowdTool.cpp */; + name = "CrowdTool.cpp: 503"; + rLen = 0; + rLoc = 13836; + rType = 0; + vrLen = 1049; + vrLoc = 12631; + }; + 6B74B6E11286AC2A00262888 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6BAF3C581211663A008CFCDF /* CrowdTool.cpp */; + name = "CrowdTool.cpp: 500"; + rLen = 0; + rLoc = 13817; + rType = 0; + vrLen = 927; + vrLoc = 12551; + }; + 6B74B6E51286AC8200262888 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6BAF3C581211663A008CFCDF /* CrowdTool.cpp */; + name = "CrowdTool.cpp: 496"; + rLen = 0; + rLoc = 13817; + rType = 0; + vrLen = 985; + vrLoc = 12631; + }; + 6B74B6E91286ACC200262888 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6BAF3C581211663A008CFCDF /* CrowdTool.cpp */; + name = "CrowdTool.cpp: 500"; + rLen = 0; + rLoc = 13817; + rType = 0; + vrLen = 976; + vrLoc = 12672; + }; + 6B74B6ED1286AD3800262888 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6BB93C7A10CFE1D500F74F2B /* DebugDraw.cpp */; + name = "DebugDraw.cpp: 321"; + rLen = 0; + rLoc = 8933; + rType = 0; + vrLen = 993; + vrLoc = 8604; + }; + 6B74B6EE1286AD3800262888 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6BAF3C581211663A008CFCDF /* CrowdTool.cpp */; + name = "CrowdTool.cpp: 496"; + rLen = 0; + rLoc = 13817; + rType = 0; + vrLen = 1005; + vrLoc = 12672; + }; + 6B74B6EF1286AD3800262888 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6BAF3C581211663A008CFCDF /* CrowdTool.cpp */; + name = "CrowdTool.cpp: 500"; + rLen = 0; + rLoc = 13817; + rType = 0; + vrLen = 989; + vrLoc = 12701; + }; + 6B74B6F11286AD5400262888 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6BAF3C581211663A008CFCDF /* CrowdTool.cpp */; + name = "CrowdTool.cpp: 500"; + rLen = 0; + rLoc = 13817; + rType = 0; + vrLen = 989; + vrLoc = 12701; + }; + 6B74B6F41286AD6A00262888 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6BAF3C581211663A008CFCDF /* CrowdTool.cpp */; + name = "CrowdTool.cpp: 496"; + rLen = 0; + rLoc = 13817; + rType = 0; + vrLen = 1009; + vrLoc = 12739; + }; + 6B74B6FC1286AE0B00262888 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6BB93C7710CFE1D500F74F2B /* DebugDraw.h */; + name = "DebugDraw.h: 134"; + rLen = 157; + rLoc = 4603; + rType = 0; + vrLen = 1887; + vrLoc = 3693; + }; + 6B74B6FD1286AE0B00262888 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6BAF3C581211663A008CFCDF /* CrowdTool.cpp */; + name = "CrowdTool.cpp: 498"; + rLen = 0; + rLoc = 13817; + rType = 0; + vrLen = 987; + vrLoc = 12701; + }; + 6B74B6FE1286AE0B00262888 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6BAF3C581211663A008CFCDF /* CrowdTool.cpp */; + name = "CrowdTool.cpp: 498"; + rLen = 0; + rLoc = 13817; + rType = 0; + vrLen = 1054; + vrLoc = 12704; + }; + 6B74B7061286AEBD00262888 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6BB93C7C10CFE1D500F74F2B /* RecastDebugDraw.cpp */; + name = "RecastDebugDraw.cpp: 60"; + rLen = 0; + rLoc = 2030; + rType = 0; + vrLen = 956; + vrLoc = 1526; + }; + 6B74B7071286AEBD00262888 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6BB93C7A10CFE1D500F74F2B /* DebugDraw.cpp */; + name = "DebugDraw.cpp: 321"; + rLen = 0; + rLoc = 8933; + rType = 0; + vrLen = 932; + vrLoc = 8604; + }; + 6B74B7081286AEBD00262888 /* XCBuildMessageTextBookmark */ = { + isa = PBXTextBookmark; + comments = "'radius' was not declared in this scope"; + fRef = 6BAF3C581211663A008CFCDF /* CrowdTool.cpp */; + fallbackIsa = XCBuildMessageTextBookmark; + rLen = 1; + rLoc = 540; + rType = 1; + }; + 6B74B7091286AEBD00262888 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6BAF3C581211663A008CFCDF /* CrowdTool.cpp */; + name = "CrowdTool.cpp: 517"; + rLen = 0; + rLoc = 14126; + rType = 0; + vrLen = 1144; + vrLoc = 12631; + }; + 6B74B70D1286AEE900262888 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6BAF3C581211663A008CFCDF /* CrowdTool.cpp */; + name = "CrowdTool.cpp: 557"; + rLen = 0; + rLoc = 15454; + rType = 0; + vrLen = 985; + vrLoc = 14447; + }; + 6B74B7111286AF1000262888 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6BAF3C581211663A008CFCDF /* CrowdTool.cpp */; + name = "CrowdTool.cpp: 548"; + rLen = 0; + rLoc = 15454; + rType = 0; + vrLen = 1067; + vrLoc = 14345; + }; + 6B74B7151286AF9000262888 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6BAF3C581211663A008CFCDF /* CrowdTool.cpp */; + name = "CrowdTool.cpp: 536"; + rLen = 0; + rLoc = 14174; + rType = 0; + vrLen = 1225; + vrLoc = 13877; + }; + 6B74B7191286AFD100262888 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6BAF3C581211663A008CFCDF /* CrowdTool.cpp */; + name = "CrowdTool.cpp: 494"; + rLen = 0; + rLoc = 13370; + rType = 0; + vrLen = 1218; + vrLoc = 12577; + }; + 6B74B71F1286B09D00262888 /* XCBuildMessageTextBookmark */ = { + isa = PBXTextBookmark; + comments = "Unused variable 'height'"; + fRef = 6BAF3C581211663A008CFCDF /* CrowdTool.cpp */; + fallbackIsa = XCBuildMessageTextBookmark; + rLen = 1; + rLoc = 507; + rType = 1; + }; + 6B74B7201286B09D00262888 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6BAF3C581211663A008CFCDF /* CrowdTool.cpp */; + name = "CrowdTool.cpp: 343"; + rLen = 0; + rLoc = 9183; + rType = 0; + vrLen = 871; + vrLoc = 8171; + }; + 6B74B7241286B0D900262888 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6BAF3C581211663A008CFCDF /* CrowdTool.cpp */; + name = "CrowdTool.cpp: 345"; + rLen = 0; + rLoc = 9315; + rType = 0; + vrLen = 887; + vrLoc = 8007; + }; + 6B74B7281286B14600262888 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6BAF3C581211663A008CFCDF /* CrowdTool.cpp */; + name = "CrowdTool.cpp: 323"; + rLen = 0; + rLoc = 8644; + rType = 0; + vrLen = 880; + vrLoc = 7714; + }; + 6B74B72C1286B16F00262888 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6BAF3C581211663A008CFCDF /* CrowdTool.cpp */; + name = "CrowdTool.cpp: 329"; + rLen = 0; + rLoc = 8813; + rType = 0; + vrLen = 820; + vrLoc = 7780; + }; + 6B74B72E1286B1B000262888 /* CrowdManager.cpp:1313 */ = { + isa = PBXFileBreakpoint; + actions = ( + ); + breakpointStyle = 0; + continueAfterActions = 0; + countType = 0; + delayBeforeContinue = 0; + fileReference = 6BD667D9123D28100021A7A4 /* CrowdManager.cpp */; + functionName = "CrowdManager::updateTopologyOptimization(const float dt, dtNavMeshQuery* navquery, const dtQueryFilter* filter)"; + hitCount = 0; + ignoreCount = 0; + lineNumber = 1313; + location = Recast; + modificationTime = 310835896.216764; + originalNumberOfMultipleMatches = 1; + state = 1; + }; + 6B74B7301286B1B300262888 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6BAF3C581211663A008CFCDF /* CrowdTool.cpp */; + name = "CrowdTool.cpp: 319"; + rLen = 0; + rLoc = 8603; + rType = 0; + vrLen = 820; + vrLoc = 7780; + }; + 6B74B7311286B1B300262888 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6BD667D9123D28100021A7A4 /* CrowdManager.cpp */; + name = "CrowdManager.cpp: 1312"; + rLen = 0; + rLoc = 30588; + rType = 0; + vrLen = 752; + vrLoc = 30193; + }; + 6B74B7321286B1B300262888 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6BD667D9123D28100021A7A4 /* CrowdManager.cpp */; + name = "CrowdManager.cpp: 1312"; + rLen = 0; + rLoc = 30588; + rType = 0; + vrLen = 752; + vrLoc = 30193; + }; + 6B74B7351286B1F900262888 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6BD667D8123D27EC0021A7A4 /* CrowdManager.h */; + name = "CrowdManager.h: 226"; + rLen = 0; + rLoc = 5467; + rType = 0; + vrLen = 586; + vrLoc = 5189; + }; + 6B74B7361286B1F900262888 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6BD667D9123D28100021A7A4 /* CrowdManager.cpp */; + name = "CrowdManager.cpp: 1314"; + rLen = 0; + rLoc = 30626; + rType = 0; + vrLen = 755; + vrLoc = 30193; + }; + 6B74B7371286B1F900262888 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6BB93C7B10CFE1D500F74F2B /* DetourDebugDraw.cpp */; + name = "DetourDebugDraw.cpp: 411"; + rLen = 0; + rLoc = 11541; + rType = 0; + vrLen = 853; + vrLoc = 11381; + }; + 6B74B7381286B1F900262888 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6BB93C7B10CFE1D500F74F2B /* DetourDebugDraw.cpp */; + name = "DetourDebugDraw.cpp: 77"; + rLen = 0; + rLoc = 2328; + rType = 0; + vrLen = 813; + vrLoc = 2036; + }; + 6B74B73C1286B22000262888 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6BB93C7B10CFE1D500F74F2B /* DetourDebugDraw.cpp */; + name = "DetourDebugDraw.cpp: 77"; + rLen = 0; + rLoc = 2326; + rType = 0; + vrLen = 846; + vrLoc = 2059; + }; + 6B74B7401286B7C400262888 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6BB93C7B10CFE1D500F74F2B /* DetourDebugDraw.cpp */; + name = "DetourDebugDraw.cpp: 84"; + rLen = 0; + rLoc = 2425; + rType = 0; + vrLen = 912; + vrLoc = 2195; + }; + 6B74B7411286B7C400262888 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6BAF3C581211663A008CFCDF /* CrowdTool.cpp */; + name = "CrowdTool.cpp: 319"; + rLen = 0; + rLoc = 8603; + rType = 0; + vrLen = 903; + vrLoc = 7715; + }; + 6B74B7421286B7C400262888 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6BAF3C581211663A008CFCDF /* CrowdTool.cpp */; + name = "CrowdTool.cpp: 521"; + rLen = 0; + rLoc = 14202; + rType = 0; + vrLen = 934; + vrLoc = 12915; + }; + 6B74B7441286B8E600262888 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6BAF3C581211663A008CFCDF /* CrowdTool.cpp */; + name = "CrowdTool.cpp: 317"; + rLen = 0; + rLoc = 8185; + rType = 0; + vrLen = 766; + vrLoc = 7584; + }; + 6B74B7451286B8E600262888 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6BAF3C571211663A008CFCDF /* CrowdTool.h */; + name = "CrowdTool.h: 47"; + rLen = 11; + rLoc = 1457; + rType = 0; + vrLen = 1262; + vrLoc = 0; + }; + 6B74B7461286B8E600262888 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6BD667D8123D27EC0021A7A4 /* CrowdManager.h */; + name = "CrowdManager.h: 251"; + rLen = 0; + rLoc = 5925; + rType = 0; + vrLen = 610; + vrLoc = 5680; + }; + 6B74B7471286B8E600262888 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6BD667D9123D28100021A7A4 /* CrowdManager.cpp */; + name = "CrowdManager.cpp: 1388"; + rLen = 0; + rLoc = 32778; + rType = 0; + vrLen = 1296; + vrLoc = 31907; + }; + 6B74B74A1286B90100262888 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6BD667D9123D28100021A7A4 /* CrowdManager.cpp */; + name = "CrowdManager.cpp: 1386"; + rLen = 0; + rLoc = 32640; + rType = 0; + vrLen = 1296; + vrLoc = 31907; + }; + 6B74B74B1286B90100262888 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6BAF3C571211663A008CFCDF /* CrowdTool.h */; + name = "CrowdTool.h: 52"; + rLen = 0; + rLoc = 1585; + rType = 0; + vrLen = 641; + vrLoc = 1351; + }; + 6B74B74C1286B90100262888 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6BAF3C581211663A008CFCDF /* CrowdTool.cpp */; + name = "CrowdTool.cpp: 311"; + rLen = 0; + rLoc = 8059; + rType = 0; + vrLen = 765; + vrLoc = 7584; + }; + 6B74B74D1286B90100262888 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6BAF3C581211663A008CFCDF /* CrowdTool.cpp */; + name = "CrowdTool.cpp: 342"; + rLen = 0; + rLoc = 8786; + rType = 0; + vrLen = 806; + vrLoc = 8096; + }; + 6B74B7561286B92300262888 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6BAF3C581211663A008CFCDF /* CrowdTool.cpp */; + name = "CrowdTool.cpp: 342"; + rLen = 0; + rLoc = 8786; + rType = 0; + vrLen = 806; + vrLoc = 8096; + }; + 6B74B7571286B92300262888 /* XCBuildMessageTextBookmark */ = { + isa = PBXTextBookmark; + comments = "Expected `;' before '->' token"; + fRef = 6BD667D9123D28100021A7A4 /* CrowdManager.cpp */; + fallbackIsa = XCBuildMessageTextBookmark; + rLen = 1; + rLoc = 1387; + rType = 1; + }; + 6B74B7581286B92300262888 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6BD667D9123D28100021A7A4 /* CrowdManager.cpp */; + name = "CrowdManager.cpp: 1377"; + rLen = 0; + rLoc = 32369; + rType = 0; + vrLen = 1155; + vrLoc = 31987; + }; + 6B74B75F1286BB6900262888 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6BD667D9123D28100021A7A4 /* CrowdManager.cpp */; + name = "CrowdManager.cpp: 1390"; + rLen = 0; + rLoc = 32809; + rType = 0; + vrLen = 873; + vrLoc = 32331; + }; + 6B74B7601286BB6900262888 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6BD667D8123D27EC0021A7A4 /* CrowdManager.h */; + name = "CrowdManager.h: 251"; + rLen = 0; + rLoc = 5925; + rType = 0; + vrLen = 1233; + vrLoc = 7098; + }; + 6B74B7611286BB6900262888 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6BAF3C571211663A008CFCDF /* CrowdTool.h */; + name = "CrowdTool.h: 48"; + rLen = 15; + rLoc = 1476; + rType = 0; + vrLen = 517; + vrLoc = 1351; + }; + 6B74B7621286BB6900262888 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6BAF3C581211663A008CFCDF /* CrowdTool.cpp */; + name = "CrowdTool.cpp: 342"; + rLen = 0; + rLoc = 8786; + rType = 0; + vrLen = 682; + vrLoc = 8220; + }; + 6B74B7631286BB6900262888 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6BAF3C581211663A008CFCDF /* CrowdTool.cpp */; + name = "CrowdTool.cpp: 627"; + rLen = 0; + rLoc = 16737; + rType = 0; + vrLen = 917; + vrLoc = 16277; + }; + 6B74B76A1286F56B00262888 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6BAF3C581211663A008CFCDF /* CrowdTool.cpp */; + name = "CrowdTool.cpp: 625"; + rLen = 0; + rLoc = 16732; + rType = 0; + vrLen = 917; + vrLoc = 16277; + }; + 6B74B76B1286F56B00262888 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6BD667D9123D28100021A7A4 /* CrowdManager.cpp */; + name = "CrowdManager.cpp: 1327"; + rLen = 0; + rLoc = 30930; + rType = 0; + vrLen = 621; + vrLoc = 30539; + }; + 6B74B76C1286F56B00262888 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6BB93C7B10CFE1D500F74F2B /* DetourDebugDraw.cpp */; + name = "DetourDebugDraw.cpp: 181"; + rLen = 87; + rLoc = 5037; + rType = 0; + vrLen = 947; + vrLoc = 4878; + }; + 6B74B76D1286F56B00262888 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6B8DE88C10B69E4C00DF20FB /* DetourNavMeshBuilder.h */; + name = "DetourNavMeshBuilder.h: 50"; + rLen = 16; + rLoc = 2475; + rType = 0; + vrLen = 1606; + vrLoc = 1474; + }; + 6B74B76E1286F56B00262888 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6B8DE88810B69E3E00DF20FB /* DetourNavMeshBuilder.cpp */; + name = "DetourNavMeshBuilder.cpp: 533"; + rLen = 0; + rLoc = 15947; + rType = 0; + vrLen = 894; + vrLoc = 15304; + }; + 6B74B76F1286F56B00262888 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6B8DE88710B69E3E00DF20FB /* DetourNavMesh.cpp */; + name = "DetourNavMesh.cpp: 1169"; + rLen = 0; + rLoc = 31834; + rType = 0; + vrLen = 625; + vrLoc = 23739; + }; + 6B74B7701286F56B00262888 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6B8DE88B10B69E4C00DF20FB /* DetourNavMesh.h */; + name = "DetourNavMesh.h: 131"; + rLen = 0; + rLoc = 4740; + rType = 0; + vrLen = 1435; + vrLoc = 4429; + }; + 6B74B7711286F56B00262888 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6B8DE88B10B69E4C00DF20FB /* DetourNavMesh.h */; + name = "DetourNavMesh.h: 37"; + rLen = 0; + rLoc = 1521; + rType = 0; + vrLen = 1186; + vrLoc = 999; + }; + 6B74B7761286F61200262888 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6B8DE88B10B69E4C00DF20FB /* DetourNavMesh.h */; + name = "DetourNavMesh.h: 288"; + rLen = 0; + rLoc = 11642; + rType = 0; + vrLen = 1372; + vrLoc = 4398; + }; + 6B74B7771286F61200262888 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6B8DE88C10B69E4C00DF20FB /* DetourNavMeshBuilder.h */; + name = "DetourNavMeshBuilder.h: 52"; + rLen = 0; + rLoc = 2613; + rType = 0; + vrLen = 1829; + vrLoc = 1300; + }; + 6B74B7781286F61200262888 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6B8DE88810B69E3E00DF20FB /* DetourNavMeshBuilder.cpp */; + name = "DetourNavMeshBuilder.cpp: 533"; + rLen = 0; + rLoc = 15947; + rType = 0; + vrLen = 892; + vrLoc = 15306; + }; + 6B74B7791286F61200262888 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6B8DE88810B69E3E00DF20FB /* DetourNavMeshBuilder.cpp */; + name = "DetourNavMeshBuilder.cpp: 537"; + rLen = 0; + rLoc = 16009; + rType = 0; + vrLen = 892; + vrLoc = 15306; + }; + 6B74B7801286F72D00262888 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6BB7FDA310F36EFC006DA0A6 /* InputGeom.h */; + name = "InputGeom.h: 79"; + rLen = 20; + rLoc = 2996; + rType = 0; + vrLen = 1563; + vrLoc = 1774; + }; + 6B74B7811286F72D00262888 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6BB7FDA410F36F0E006DA0A6 /* InputGeom.cpp */; + name = "InputGeom.cpp: 379"; + rLen = 0; + rLoc = 9369; + rType = 0; + vrLen = 913; + vrLoc = 8553; + }; + 6B74B7821286F72D00262888 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6B2AEC510FFB8946005BE9CC /* Sample_TileMesh.h */; + name = "Sample_TileMesh.h: 92"; + rLen = 0; + rLoc = 2493; + rType = 0; + vrLen = 893; + vrLoc = 1971; + }; + 6B74B7831286F72D00262888 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6B2AEC520FFB8958005BE9CC /* Sample_TileMesh.cpp */; + name = "Sample_TileMesh.cpp: 1156"; + rLen = 62; + rLoc = 32666; + rType = 0; + vrLen = 1382; + vrLoc = 31865; + }; + 6B74B7841286F72D00262888 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6B98463211E6144400FA177B /* Sample_SoloMeshTiled.cpp */; + name = "Sample_SoloMeshTiled.cpp: 1062"; + rLen = 0; + rLoc = 32283; + rType = 0; + vrLen = 1365; + vrLoc = 31388; + }; + 6B74B7851286F72D00262888 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6BA1E88810C7BFC9008007F6 /* Sample_SoloMeshSimple.cpp */; + name = "Sample_SoloMeshSimple.cpp: 620"; + rLen = 0; + rLoc = 19411; + rType = 0; + vrLen = 1347; + vrLoc = 18510; + }; + 6B74B7861286F72D00262888 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6B8DE88810B69E3E00DF20FB /* DetourNavMeshBuilder.cpp */; + name = "DetourNavMeshBuilder.cpp: 539"; + rLen = 0; + rLoc = 16038; + rType = 0; + vrLen = 1044; + vrLoc = 15059; + }; + 6B74B7871286F72D00262888 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6B8DE88810B69E3E00DF20FB /* DetourNavMeshBuilder.cpp */; + name = "DetourNavMeshBuilder.cpp: 535"; + rLen = 0; + rLoc = 16002; + rType = 0; + vrLen = 948; + vrLoc = 15155; + }; + 6B74B78B1286F76300262888 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6B8DE88810B69E3E00DF20FB /* DetourNavMeshBuilder.cpp */; + name = "DetourNavMeshBuilder.cpp: 536"; + rLen = 0; + rLoc = 16006; + rType = 0; + vrLen = 859; + vrLoc = 15304; + }; + 6B74B78C1286F76300262888 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6BB93C7B10CFE1D500F74F2B /* DetourDebugDraw.cpp */; + name = "DetourDebugDraw.cpp: 181"; + rLen = 87; + rLoc = 5037; + rType = 0; + vrLen = 1017; + vrLoc = 4853; + }; + 6B74B78D1286F76300262888 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6BB93C7B10CFE1D500F74F2B /* DetourDebugDraw.cpp */; + name = "DetourDebugDraw.cpp: 181"; + rLen = 87; + rLoc = 5037; + rType = 0; + vrLen = 1017; + vrLoc = 4853; + }; + 6B74B7901286F77500262888 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6B8DE88810B69E3E00DF20FB /* DetourNavMeshBuilder.cpp */; + name = "DetourNavMeshBuilder.cpp: 533"; + rLen = 0; + rLoc = 15915; + rType = 0; + vrLen = 857; + vrLoc = 15306; + }; + 6B74B7911286F77500262888 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6BB93C7B10CFE1D500F74F2B /* DetourDebugDraw.cpp */; + rLen = 0; + rLoc = 165; + rType = 1; + }; + 6B74B7921286F77500262888 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6BB93C7B10CFE1D500F74F2B /* DetourDebugDraw.cpp */; + name = "DetourDebugDraw.cpp: 166"; + rLen = 0; + rLoc = 4589; + rType = 0; + vrLen = 1038; + vrLoc = 4379; + }; + 6B74B7931286F78400262888 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6BB93C7B10CFE1D500F74F2B /* DetourDebugDraw.cpp */; + name = "DetourDebugDraw.cpp: 166"; + rLen = 0; + rLoc = 4589; + rType = 0; + vrLen = 558; + vrLoc = 7092; + }; + 6B74B7941286F78400262888 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6BA1E88810C7BFC9008007F6 /* Sample_SoloMeshSimple.cpp */; + rLen = 0; + rLoc = 249; + rType = 1; + }; + 6B74B7951286F78400262888 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6BA1E88810C7BFC9008007F6 /* Sample_SoloMeshSimple.cpp */; + name = "Sample_SoloMeshSimple.cpp: 250"; + rLen = 18; + rLoc = 8071; + rType = 0; + vrLen = 681; + vrLoc = 7720; + }; + 6B74B7981286F7CD00262888 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6BB93C7B10CFE1D500F74F2B /* DetourDebugDraw.cpp */; + name = "DetourDebugDraw.cpp: 166"; + rLen = 0; + rLoc = 4589; + rType = 0; + vrLen = 1038; + vrLoc = 4379; + }; + 6B74B7991286F7CD00262888 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6BA1E88810C7BFC9008007F6 /* Sample_SoloMeshSimple.cpp */; + name = "Sample_SoloMeshSimple.cpp: 250"; + rLen = 18; + rLoc = 8071; + rType = 0; + vrLen = 889; + vrLoc = 7513; + }; + 6B74B79A1286F7CD00262888 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6B25B6140FFA62BE004F1BC4 /* Sample.cpp */; + name = "Sample.cpp: 35"; + rLen = 0; + rLoc = 1275; + rType = 0; + vrLen = 470; + vrLoc = 1050; + }; + 6B74B79B1286F7CD00262888 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6B25B6100FFA62AD004F1BC4 /* Sample.h */; + name = "Sample.h: 130"; + rLen = 19; + rLoc = 3944; + rType = 0; + vrLen = 908; + vrLoc = 3199; + }; + 6B74B79C1286F7CD00262888 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6BAF3C581211663A008CFCDF /* CrowdTool.cpp */; + name = "CrowdTool.cpp: 133"; + rLen = 0; + rLoc = 3537; + rType = 0; + vrLen = 414; + vrLoc = 3255; + }; + 6B74B79D1286F7CD00262888 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6BCF32351104CD05009445BF /* OffMeshConnectionTool.cpp */; + name = "OffMeshConnectionTool.cpp: 57"; + rLen = 0; + rLoc = 1579; + rType = 0; + vrLen = 404; + vrLoc = 1403; + }; + 6B74B79E1286F7CD00262888 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6BCF32351104CD05009445BF /* OffMeshConnectionTool.cpp */; + name = "OffMeshConnectionTool.cpp: 49"; + rLen = 0; + rLoc = 1475; + rType = 0; + vrLen = 404; + vrLoc = 1403; + }; + 6B74B79F1286F7D700262888 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6BCF32351104CD05009445BF /* OffMeshConnectionTool.cpp */; + name = "OffMeshConnectionTool.cpp: 49"; + rLen = 0; + rLoc = 1475; + rType = 0; + vrLen = 404; + vrLoc = 1403; + }; + 6B74B7A01286F7D700262888 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6BB93C7B10CFE1D500F74F2B /* DetourDebugDraw.cpp */; + rLen = 0; + rLoc = 165; + rType = 1; + }; + 6B74B7A11286F7D700262888 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6BB93C7B10CFE1D500F74F2B /* DetourDebugDraw.cpp */; + name = "DetourDebugDraw.cpp: 166"; + rLen = 0; + rLoc = 4589; + rType = 0; + vrLen = 658; + vrLoc = 4379; + }; + 6B74B7A61286F8E700262888 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6BB93C7B10CFE1D500F74F2B /* DetourDebugDraw.cpp */; + name = "DetourDebugDraw.cpp: 166"; + rLen = 0; + rLoc = 4589; + rType = 0; + vrLen = 658; + vrLoc = 4379; + }; + 6B74B7A71286F8E700262888 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6BCF32351104CD05009445BF /* OffMeshConnectionTool.cpp */; + name = "OffMeshConnectionTool.cpp: 50"; + rLen = 0; + rLoc = 1476; + rType = 0; + vrLen = 402; + vrLoc = 1403; + }; + 6B74B7A81286F8E700262888 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6BCF32351104CD05009445BF /* OffMeshConnectionTool.cpp */; + name = "OffMeshConnectionTool.cpp: 55"; + rLen = 0; + rLoc = 1579; + rType = 0; + vrLen = 440; + vrLoc = 1341; + }; + 6B74B7AC1286F93000262888 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6BB93C7B10CFE1D500F74F2B /* DetourDebugDraw.cpp */; + name = "DetourDebugDraw.cpp: 252"; + rLen = 15; + rLoc = 7284; + rType = 0; + vrLen = 683; + vrLoc = 6920; + }; + 6B74B7AD1286F93000262888 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6B25B6140FFA62BE004F1BC4 /* Sample.cpp */; + name = "Sample.cpp: 41"; + rLen = 15; + rLoc = 1359; + rType = 0; + vrLen = 315; + vrLoc = 1462; + }; + 6B74B7AE1286F93000262888 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6BAF3C581211663A008CFCDF /* CrowdTool.cpp */; + name = "CrowdTool.cpp: 133"; + rLen = 0; + rLoc = 3537; + rType = 0; + vrLen = 442; + vrLoc = 3255; + }; + 6B74B7AF1286F93000262888 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6BCF32351104CD05009445BF /* OffMeshConnectionTool.cpp */; + rLen = 15; + rLoc = 1721; + rType = 0; + }; + 6B74B7B01286F93000262888 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6BCF32351104CD05009445BF /* OffMeshConnectionTool.cpp */; + name = "OffMeshConnectionTool.cpp: 50"; + rLen = 0; + rLoc = 1520; + rType = 0; + vrLen = 441; + vrLoc = 1408; + }; + 6B74B7B21286F99100262888 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6B25B6100FFA62AD004F1BC4 /* Sample.h */; + name = "Sample.h: 131"; + rLen = 0; + rLoc = 4017; + rType = 0; + vrLen = 938; + vrLoc = 3169; + }; + 6B74B7B31286F99100262888 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6BCF32351104CD05009445BF /* OffMeshConnectionTool.cpp */; + rLen = 0; + rLoc = 51; + rType = 1; + }; + 6B74B7B41286F99100262888 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6BCF32351104CD05009445BF /* OffMeshConnectionTool.cpp */; + name = "OffMeshConnectionTool.cpp: 51"; + rLen = 0; + rLoc = 1523; + rType = 0; + vrLen = 441; + vrLoc = 1408; + }; + 6B74B7B51286F9D900262888 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6BA1E88810C7BFC9008007F6 /* Sample_SoloMeshSimple.cpp */; + name = "Sample_SoloMeshSimple.cpp: 665"; + rLen = 0; + rLoc = 20711; + rType = 0; + vrLen = 461; + vrLoc = 20290; + }; + 6B74B7B61286F9D900262888 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6BCF32351104CD05009445BF /* OffMeshConnectionTool.cpp */; + rLen = 0; + rLoc = 55; + rType = 1; + }; + 6B74B7B71286F9D900262888 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6BCF32351104CD05009445BF /* OffMeshConnectionTool.cpp */; + name = "OffMeshConnectionTool.cpp: 57"; + rLen = 0; + rLoc = 1579; + rType = 0; + vrLen = 367; + vrLoc = 1407; + }; + 6B74B7BA1286F9F400262888 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6BCF32351104CD05009445BF /* OffMeshConnectionTool.cpp */; + name = "OffMeshConnectionTool.cpp: 57"; + rLen = 0; + rLoc = 1579; + rType = 0; + vrLen = 424; + vrLoc = 1388; + }; + 6B74B7BB1286F9F400262888 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6BAF3C581211663A008CFCDF /* CrowdTool.cpp */; + rLen = 0; + rLoc = 3537; + rType = 0; + }; + 6B74B7BC1286F9F400262888 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6BAF3C581211663A008CFCDF /* CrowdTool.cpp */; + name = "CrowdTool.cpp: 127"; + rLen = 0; + rLoc = 3360; + rType = 0; + vrLen = 408; + vrLoc = 3226; + }; + 6B74B7C01286FA5200262888 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6BAF3C581211663A008CFCDF /* CrowdTool.cpp */; + name = "CrowdTool.cpp: 135"; + rLen = 0; + rLoc = 3537; + rType = 0; + vrLen = 390; + vrLoc = 3228; + }; + 6B74B7C11286FA5200262888 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6BCF32351104CD05009445BF /* OffMeshConnectionTool.cpp */; + rLen = 0; + rLoc = 1471; + rType = 0; + }; + 6B74B7C21286FA5200262888 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6BCF32351104CD05009445BF /* OffMeshConnectionTool.cpp */; + name = "OffMeshConnectionTool.cpp: 53"; + rLen = 0; + rLoc = 1526; + rType = 0; + vrLen = 444; + vrLoc = 1372; + }; + 6B74B7C51286FAB500262888 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6BCF32351104CD05009445BF /* OffMeshConnectionTool.cpp */; + name = "OffMeshConnectionTool.cpp: 48"; + rLen = 0; + rLoc = 1472; + rType = 0; + vrLen = 413; + vrLoc = 1403; + }; + 6B74B7C61286FAB500262888 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6BB93C7B10CFE1D500F74F2B /* DetourDebugDraw.cpp */; + name = "DetourDebugDraw.cpp: 252"; + rLen = 15; + rLoc = 7284; + rType = 0; + vrLen = 637; + vrLoc = 6966; + }; + 6B74B7C71286FAB500262888 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6BB93C7B10CFE1D500F74F2B /* DetourDebugDraw.cpp */; + name = "DetourDebugDraw.cpp: 247"; + rLen = 0; + rLoc = 7091; + rType = 0; + vrLen = 1185; + vrLoc = 4523; + }; + 6B74B7CB1286FAD800262888 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6BB93C7B10CFE1D500F74F2B /* DetourDebugDraw.cpp */; + name = "DetourDebugDraw.cpp: 184"; + rLen = 0; + rLoc = 5224; + rType = 0; + vrLen = 1185; + vrLoc = 4523; + }; + 6B74B7CC1286FAD800262888 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6BB93C7B10CFE1D500F74F2B /* DetourDebugDraw.cpp */; + name = "DetourDebugDraw.cpp: 185"; + rLen = 0; + rLoc = 5241; + rType = 0; + vrLen = 1185; + vrLoc = 4523; + }; + 6B8036AC113BAABE005ED67B /* Sample_Debug.h */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {931, 689}}"; + sepNavSelRange = "{269, 0}"; + sepNavVisRange = "{0, 1049}"; + }; + }; + 6B8036AD113BAABE005ED67B /* Sample_Debug.cpp */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {931, 5070}}"; + sepNavSelRange = "{3338, 0}"; + sepNavVisRange = "{3021, 598}"; + }; + }; + 6B847774122D220D00ADF63D /* ValueHistory.h */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {931, 663}}"; + sepNavSelRange = "{587, 0}"; + sepNavVisRange = "{23, 994}"; + }; + }; + 6B847776122D221C00ADF63D /* ValueHistory.cpp */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {957, 1560}}"; + sepNavSelRange = "{2028, 0}"; + sepNavVisRange = "{1337, 1555}"; + }; + }; + 6B8632970F78114600E2684A /* Recast */ = { + isa = PBXExecutable; + activeArgIndices = ( + ); + argumentStrings = ( + ); + autoAttachOnCrash = 1; + breakpointsEnabled = 1; + configStateDict = { + }; + customDataFormattersEnabled = 1; + dataTipCustomDataFormattersEnabled = 1; + dataTipShowTypeColumn = 1; + dataTipSortType = 0; + debuggerPlugin = GDBDebugging; + disassemblyDisplayState = 0; + dylibVariantSuffix = ""; + enableDebugStr = 1; + environmentEntries = ( + ); + executableSystemSymbolLevel = 0; + executableUserSymbolLevel = 0; + libgmallocEnabled = 0; + name = Recast; + savedGlobals = { + }; + showTypeColumn = 0; + sourceDirectories = ( + ); + variableFormatDictionary = { + }; + }; + 6B8632A90F78115100E2684A /* Source Control */ = { + isa = PBXSourceControlManager; + fallbackIsa = XCSourceControlManager; + isSCMEnabled = 0; + scmConfiguration = { + repositoryNamesForRoots = { + "" = ""; + }; + }; + }; + 6B8632AA0F78115100E2684A /* Code sense */ = { + isa = PBXCodeSenseManager; + indexTemplatePath = ""; + }; + 6B8D55CD127AAA360077C699 /* CrowdManager.cpp:1197 */ = { + isa = PBXFileBreakpoint; + actions = ( + ); + breakpointStyle = 0; + continueAfterActions = 0; + countType = 0; + delayBeforeContinue = 0; + fileReference = 6BD667D9123D28100021A7A4 /* CrowdManager.cpp */; + functionName = "CrowdManager::updateMoveRequest(const float dt, dtNavMeshQuery* navquery, const dtQueryFilter* filter)"; + hitCount = 0; + ignoreCount = 0; + lineNumber = 1197; + location = Recast; + modificationTime = 310835896.177066; + originalNumberOfMultipleMatches = 1; + state = 1; + }; + 6B8D565F127ADB0D0077C699 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6BA1E88E10C7BFD3008007F6 /* Sample_SoloMeshSimple.h */; + name = "Sample_SoloMeshSimple.h: 34"; + rLen = 20; + rLoc = 1232; + rType = 0; + vrLen = 715; + vrLoc = 923; + }; + 6B8D566D127ADB7D0077C699 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6BB93C7B10CFE1D500F74F2B /* DetourDebugDraw.cpp */; + name = "DetourDebugDraw.cpp: 411"; + rLen = 0; + rLoc = 11541; + rType = 0; + vrLen = 814; + vrLoc = 11386; + }; + 6B8D566F127ADB7D0077C699 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6B9846EE11E718F800FA177B /* DetourAlloc.cpp */; + name = "DetourAlloc.cpp: 49"; + rLen = 0; + rLoc = 1491; + rType = 0; + vrLen = 488; + vrLoc = 1021; + }; + 6B8D56C7127AEC100077C699 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6BA1E88810C7BFC9008007F6 /* Sample_SoloMeshSimple.cpp */; + name = "Sample_SoloMeshSimple.cpp: 649"; + rLen = 0; + rLoc = 20284; + rType = 0; + vrLen = 737; + vrLoc = 19576; + }; + 6B8D56C8127AEC100077C699 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6B98463211E6144400FA177B /* Sample_SoloMeshTiled.cpp */; + name = "Sample_SoloMeshTiled.cpp: 1089"; + rLen = 0; + rLoc = 33107; + rType = 0; + vrLen = 769; + vrLoc = 32691; + }; + 6B8D56C9127AEC100077C699 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6B2AEC520FFB8958005BE9CC /* Sample_TileMesh.cpp */; + name = "Sample_TileMesh.cpp: 719"; + rLen = 0; + rLoc = 19463; + rType = 0; + vrLen = 640; + vrLoc = 19043; + }; + 6B8D56CA127AEC100077C699 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6BAF3C581211663A008CFCDF /* CrowdTool.cpp */; + name = "CrowdTool.cpp: 257"; + rLen = 0; + rLoc = 7194; + rType = 0; + vrLen = 868; + vrLoc = 6285; + }; + 6B8D56CB127AEC100077C699 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6B8036AD113BAABE005ED67B /* Sample_Debug.cpp */; + name = "Sample_Debug.cpp: 130"; + rLen = 15; + rLoc = 3296; + rType = 0; + vrLen = 716; + vrLoc = 2962; + }; + 6B8D56CC127AEC100077C699 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6B8DE88B10B69E4C00DF20FB /* DetourNavMesh.h */; + name = "DetourNavMesh.h: 384"; + rLen = 0; + rLoc = 15329; + rType = 0; + vrLen = 1370; + vrLoc = 14287; + }; + 6B8D56CD127AEC100077C699 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6B8DE88710B69E3E00DF20FB /* DetourNavMesh.cpp */; + name = "DetourNavMesh.cpp: 587"; + rLen = 0; + rLoc = 15922; + rType = 0; + vrLen = 783; + vrLoc = 15121; + }; + 6B8D56CE127AEC100077C699 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6BAF40DA12196A3D008CFCDF /* DetourNavMeshQuery.cpp */; + name = "DetourNavMeshQuery.cpp: 1084"; + rLen = 18; + rLoc = 30464; + rType = 0; + vrLen = 736; + vrLoc = 28778; + }; + 6B8D56CF127AEC100077C699 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6BAF40D912196A25008CFCDF /* DetourNavMeshQuery.h */; + name = "DetourNavMeshQuery.h: 337"; + rLen = 0; + rLoc = 17195; + rType = 0; + vrLen = 1215; + vrLoc = 15770; + }; + 6B8D56D0127AEC100077C699 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6BB7FC0910EBB6AA006DA0A6 /* NavMeshTesterTool.h */; + name = "NavMeshTesterTool.h: 35"; + rLen = 0; + rLoc = 1207; + rType = 0; + vrLen = 539; + vrLoc = 980; + }; + 6B8D56D2127AEC100077C699 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6BF7C13F1111953A002B3F46 /* TestCase.cpp */; + name = "TestCase.cpp: 206"; + rLen = 0; + rLoc = 4694; + rType = 0; + vrLen = 905; + vrLoc = 4411; + }; + 6B8D56D8127AEC580077C699 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6BD667D9123D28100021A7A4 /* CrowdManager.cpp */; + name = "CrowdManager.cpp: 529"; + rLen = 0; + rLoc = 12206; + rType = 0; + vrLen = 710; + vrLoc = 12070; + }; + 6B8D56DB127DF2620077C699 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6BB7FC0A10EBB6AA006DA0A6 /* NavMeshTesterTool.cpp */; + name = "NavMeshTesterTool.cpp: 543"; + rLen = 8; + rLoc = 14441; + rType = 0; + vrLen = 853; + vrLoc = 13987; + }; + 6B8D56DC127DF2620077C699 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6BB7FC0A10EBB6AA006DA0A6 /* NavMeshTesterTool.cpp */; + name = "NavMeshTesterTool.cpp: 543"; + rLen = 8; + rLoc = 14441; + rType = 0; + vrLen = 853; + vrLoc = 13987; + }; + 6B8DE6F010A88F0500DF20FB /* PBXBookmarkGroup */ = { + isa = PBXBookmarkGroup; + children = ( + 6B8DE89210B6A4B900DF20FB /* PBXTextBookmark */, + ); + name = Root; + }; + 6B8DE88710B69E3E00DF20FB /* DetourNavMesh.cpp */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {915, 16172}}"; + sepNavSelRange = "{31834, 0}"; + sepNavVisRange = "{23739, 625}"; + sepNavWindowFrame = "{{15, 51}, {1214, 722}}"; + }; + }; + 6B8DE88810B69E3E00DF20FB /* DetourNavMeshBuilder.cpp */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {853, 9230}}"; + sepNavSelRange = "{15915, 0}"; + sepNavVisRange = "{15306, 857}"; + }; + }; + 6B8DE88B10B69E4C00DF20FB /* DetourNavMesh.h */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {873, 5330}}"; + sepNavSelRange = "{11642, 0}"; + sepNavVisRange = "{4398, 1372}"; + }; + }; + 6B8DE88C10B69E4C00DF20FB /* DetourNavMeshBuilder.h */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {853, 1014}}"; + sepNavSelRange = "{2613, 0}"; + sepNavVisRange = "{1300, 1829}"; + }; + }; + 6B8DE89210B6A4B900DF20FB /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6B8DE88B10B69E4C00DF20FB /* DetourNavMesh.h */; + name = detail; + rLen = 0; + rLoc = 13611; + rType = 0; + vrLen = 1182; + vrLoc = 9676; + }; + 6B920A121225B1C900D5B5AD /* DetourHashLookup.cpp:78 */ = { + isa = PBXFileBreakpoint; + actions = ( + ); + breakpointStyle = 0; + continueAfterActions = 0; + countType = 0; + delayBeforeContinue = 0; + fileReference = 6BD403B31224815A00995864 /* DetourHashLookup.cpp */; + functionName = "dtHashLookup::add(const unsigned int key, const unsigned short value)"; + hitCount = 0; + ignoreCount = 0; + lineNumber = 78; + location = Recast; + modificationTime = 310835892.37785; + originalNumberOfMultipleMatches = 0; + state = 2; + }; + 6B920A141225B1CF00D5B5AD /* DetourHashLookup.cpp:131 */ = { + isa = PBXFileBreakpoint; + actions = ( + ); + breakpointStyle = 0; + continueAfterActions = 0; + countType = 0; + delayBeforeContinue = 0; + fileReference = 6BD403B31224815A00995864 /* DetourHashLookup.cpp */; + functionName = "dtHashLookup::query(const unsigned int* keys, const int nkeys, unsigned short* values, const int maxValues)"; + hitCount = 0; + ignoreCount = 0; + lineNumber = 131; + modificationTime = 310835892.378217; + originalNumberOfMultipleMatches = 1; + state = 0; + }; + 6B98463111E6144400FA177B /* Sample_SoloMeshTiled.h */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {931, 1664}}"; + sepNavSelRange = "{2060, 25}"; + sepNavVisRange = "{1459, 1116}"; + }; + }; + 6B98463211E6144400FA177B /* Sample_SoloMeshTiled.cpp */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {853, 14820}}"; + sepNavSelRange = "{32283, 0}"; + sepNavVisRange = "{31388, 1365}"; + sepNavWindowFrame = "{{38, 30}, {1214, 722}}"; + }; + }; + 6B9846ED11E718F800FA177B /* DetourAlloc.h */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {931, 641}}"; + sepNavSelRange = "{1286, 0}"; + sepNavVisRange = "{0, 1361}"; + }; + }; + 6B9846EE11E718F800FA177B /* DetourAlloc.cpp */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {931, 663}}"; + sepNavSelRange = "{1491, 0}"; + sepNavVisRange = "{1021, 488}"; + }; + }; + 6B98470511E733B600FA177B /* RecastAlloc.h */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {931, 910}}"; + sepNavSelRange = "{1797, 71}"; + sepNavVisRange = "{1112, 1235}"; + }; + }; + 6B9847B711E7519A00FA177B /* RecastAlloc.cpp */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {931, 884}}"; + sepNavSelRange = "{1524, 0}"; + sepNavVisRange = "{920, 948}"; + }; + }; + 6B9EFF02122819E200535FF1 /* DetourObstacleAvoidance.h */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {931, 1872}}"; + sepNavSelRange = "{3711, 22}"; + sepNavVisRange = "{2866, 1894}"; + }; + }; + 6B9EFF0812281C3E00535FF1 /* DetourObstacleAvoidance.cpp */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {931, 6695}}"; + sepNavSelRange = "{11554, 0}"; + sepNavVisRange = "{10955, 1306}"; + }; + }; + 6BA1E88810C7BFC9008007F6 /* Sample_SoloMeshSimple.cpp */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {1139, 8593}}"; + sepNavSelRange = "{20711, 0}"; + sepNavVisRange = "{20290, 461}"; + }; + }; + 6BA1E88E10C7BFD3008007F6 /* Sample_SoloMeshSimple.h */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {931, 1053}}"; + sepNavSelRange = "{1232, 20}"; + sepNavVisRange = "{923, 715}"; + }; + }; + 6BA687AC1222F7AC00730711 /* Sample_Debug.cpp:137 */ = { + isa = PBXFileBreakpoint; + actions = ( + ); + breakpointStyle = 0; + continueAfterActions = 0; + countType = 0; + delayBeforeContinue = 0; + fileReference = 6B8036AD113BAABE005ED67B /* Sample_Debug.cpp */; + functionName = "Sample_Debug::Sample_Debug()"; + hitCount = 0; + ignoreCount = 0; + lineNumber = 137; + location = Recast; + modificationTime = 310835896.133154; + originalNumberOfMultipleMatches = 1; + state = 1; + }; + 6BAF3C571211663A008CFCDF /* CrowdTool.h */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {853, 1170}}"; + sepNavSelRange = "{1476, 15}"; + sepNavVisRange = "{1351, 517}"; + }; + }; + 6BAF3C581211663A008CFCDF /* CrowdTool.cpp */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {853, 8619}}"; + sepNavSelRange = "{3537, 0}"; + sepNavVisRange = "{3228, 390}"; + sepNavWindowFrame = "{{15, 51}, {1214, 722}}"; + }; + }; + 6BAF40D912196A25008CFCDF /* DetourNavMeshQuery.h */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {853, 5265}}"; + sepNavSelRange = "{8664, 29}"; + sepNavVisRange = "{7667, 2073}"; + }; + }; + 6BAF40DA12196A3D008CFCDF /* DetourNavMeshQuery.cpp */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {853, 33280}}"; + sepNavSelRange = "{27789, 0}"; + sepNavVisRange = "{27424, 755}"; + }; + }; + 6BAF427A121ADCC2008CFCDF /* DetourAssert.h */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {931, 641}}"; + sepNavSelRange = "{1209, 56}"; + sepNavVisRange = "{0, 1368}"; + }; + }; + 6BAF4440121C3D0A008CFCDF /* SampleInterfaces.h */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {931, 1196}}"; + sepNavSelRange = "{2197, 11}"; + sepNavVisRange = "{1496, 1431}"; + }; + }; + 6BAF4441121C3D26008CFCDF /* SampleInterfaces.cpp */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {931, 2977}}"; + sepNavSelRange = "{1116, 0}"; + sepNavVisRange = "{637, 1139}"; + }; + }; + 6BAF4561121D173A008CFCDF /* RecastAssert.h */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {931, 641}}"; + sepNavSelRange = "{1133, 149}"; + sepNavVisRange = "{0, 1368}"; + }; + }; + 6BB788160FC0472B003C24DB /* ChunkyTriMesh.cpp */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {931, 4056}}"; + sepNavSelRange = "{6788, 0}"; + sepNavVisRange = "{5982, 1027}"; + }; + }; + 6BB788180FC04753003C24DB /* ChunkyTriMesh.h */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {931, 689}}"; + sepNavSelRange = "{1575, 26}"; + sepNavVisRange = "{0, 1866}"; + }; + }; + 6BB7FC0910EBB6AA006DA0A6 /* NavMeshTesterTool.h */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {931, 1521}}"; + sepNavSelRange = "{2745, 0}"; + sepNavVisRange = "{2051, 953}"; + }; + }; + 6BB7FC0A10EBB6AA006DA0A6 /* NavMeshTesterTool.cpp */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {931, 15951}}"; + sepNavSelRange = "{8413, 0}"; + sepNavVisRange = "{8249, 624}"; + sepNavWindowFrame = "{{38, 30}, {1214, 722}}"; + }; + }; + 6BB7FDA310F36EFC006DA0A6 /* InputGeom.h */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {853, 1222}}"; + sepNavSelRange = "{2996, 20}"; + sepNavVisRange = "{1774, 1563}"; + }; + }; + 6BB7FDA410F36F0E006DA0A6 /* InputGeom.cpp */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {853, 6669}}"; + sepNavSelRange = "{9369, 0}"; + sepNavVisRange = "{8553, 913}"; + }; + }; + 6BB93C7710CFE1D500F74F2B /* DebugDraw.h */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {853, 2652}}"; + sepNavSelRange = "{4603, 157}"; + sepNavVisRange = "{3693, 1887}"; + }; + }; + 6BB93C7810CFE1D500F74F2B /* DetourDebugDraw.h */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {957, 494}}"; + sepNavSelRange = "{1365, 83}"; + sepNavVisRange = "{396, 1352}"; + }; + }; + 6BB93C7910CFE1D500F74F2B /* RecastDebugDraw.h */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {1181, 641}}"; + sepNavSelRange = "{1402, 30}"; + sepNavVisRange = "{0, 2356}"; + }; + }; + 6BB93C7A10CFE1D500F74F2B /* DebugDraw.cpp */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {853, 7917}}"; + sepNavSelRange = "{8933, 0}"; + sepNavVisRange = "{8604, 932}"; + }; + }; + 6BB93C7B10CFE1D500F74F2B /* DetourDebugDraw.cpp */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {950, 5876}}"; + sepNavSelRange = "{5241, 0}"; + sepNavVisRange = "{4523, 1185}"; + sepNavWindowFrame = "{{61, 9}, {1214, 722}}"; + }; + }; + 6BB93C7C10CFE1D500F74F2B /* RecastDebugDraw.cpp */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {853, 8619}}"; + sepNavSelRange = "{2030, 0}"; + sepNavVisRange = "{1526, 956}"; + }; + }; + 6BB93CF410CFEC4500F74F2B /* RecastDump.h */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {931, 641}}"; + sepNavSelRange = "{1619, 0}"; + sepNavVisRange = "{0, 1728}"; + sepNavWindowFrame = "{{38, 15}, {1174, 737}}"; + }; + }; + 6BB93CF510CFEC4500F74F2B /* RecastDump.cpp */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {931, 5902}}"; + sepNavSelRange = "{3140, 0}"; + sepNavVisRange = "{2368, 1168}"; + }; + }; + 6BBB4C4C115B7BAD00CF791D /* Sample_TileMesh.cpp:281 */ = { + isa = PBXFileBreakpoint; + actions = ( + ); + breakpointStyle = 0; + continueAfterActions = 0; + countType = 0; + delayBeforeContinue = 0; + fileReference = 6B2AEC520FFB8958005BE9CC /* Sample_TileMesh.cpp */; + functionName = "Sample_TileMesh::loadAll(const char* path)"; + hitCount = 0; + ignoreCount = 0; + lineNumber = 281; + location = Recast; + modificationTime = 310835896.105515; + originalNumberOfMultipleMatches = 1; + state = 1; + }; + 6BCF32341104CD05009445BF /* OffMeshConnectionTool.h */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {931, 663}}"; + sepNavSelRange = "{1546, 0}"; + sepNavVisRange = "{789, 910}"; + }; + }; + 6BCF32351104CD05009445BF /* OffMeshConnectionTool.cpp */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {853, 2145}}"; + sepNavSelRange = "{1472, 0}"; + sepNavVisRange = "{1403, 413}"; + }; + }; + 6BD401FF1224278800995864 /* PerfTimer.h */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {931, 641}}"; + sepNavSelRange = "{0, 923}"; + sepNavVisRange = "{0, 1176}"; + }; + }; + 6BD402001224279400995864 /* PerfTimer.cpp */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {931, 741}}"; + sepNavSelRange = "{967, 0}"; + sepNavVisRange = "{0, 1430}"; + }; + }; + 6BD403421224642500995864 /* NavMeshTesterTool.cpp:547 */ = { + isa = PBXFileBreakpoint; + actions = ( + ); + breakpointStyle = 0; + continueAfterActions = 0; + countType = 0; + delayBeforeContinue = 0; + fileReference = 6BB7FC0A10EBB6AA006DA0A6 /* NavMeshTesterTool.cpp */; + functionName = "NavMeshTesterTool::recalc()"; + hitCount = 0; + ignoreCount = 0; + lineNumber = 547; + location = Recast; + modificationTime = 310835896.141632; + originalNumberOfMultipleMatches = 1; + state = 1; + }; + 6BD403B31224815A00995864 /* DetourHashLookup.cpp */ = { + isa = PBXFileReference; + fileEncoding = 4; + lastKnownFileType = sourcecode.cpp.cpp; + name = DetourHashLookup.cpp; + path = /Users/memon/Code/recastnavigation/Detour/Source/DetourHashLookup.cpp; + sourceTree = ""; + }; + 6BD667D8123D27EC0021A7A4 /* CrowdManager.h */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {853, 4264}}"; + sepNavSelRange = "{5925, 0}"; + sepNavVisRange = "{7098, 1233}"; + }; + }; + 6BD667D9123D28100021A7A4 /* CrowdManager.cpp */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {853, 19929}}"; + sepNavSelRange = "{30930, 0}"; + sepNavVisRange = "{30539, 621}"; + sepNavWindowFrame = "{{15, 134}, {1120, 639}}"; + }; + }; + 6BD66851124350F50021A7A4 /* NavMeshTesterTool.cpp:486 */ = { + isa = PBXFileBreakpoint; + actions = ( + ); + breakpointStyle = 0; + continueAfterActions = 0; + countType = 0; + delayBeforeContinue = 0; + fileReference = 6BB7FC0A10EBB6AA006DA0A6 /* NavMeshTesterTool.cpp */; + functionName = "NavMeshTesterTool::handleUpdate(const float /*dt*/)"; + hitCount = 0; + ignoreCount = 0; + lineNumber = 486; + location = Recast; + modificationTime = 310835896.158779; + originalNumberOfMultipleMatches = 1; + state = 1; + }; + 6BF5F23911747606000502A6 /* Filelist.cpp */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {931, 1222}}"; + sepNavSelRange = "{1296, 0}"; + sepNavVisRange = "{920, 888}"; + }; + }; + 6BF5F23C11747614000502A6 /* Filelist.h */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {931, 641}}"; + sepNavSelRange = "{922, 0}"; + sepNavVisRange = "{0, 1180}"; + }; + }; + 6BF5F23E1174763B000502A6 /* SlideShow.h */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {931, 702}}"; + sepNavSelRange = "{1292, 0}"; + sepNavVisRange = "{64, 1406}"; + }; + }; + 6BF5F23F1174763B000502A6 /* SlideShow.cpp */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {931, 2054}}"; + sepNavSelRange = "{1126, 0}"; + sepNavVisRange = "{3, 1396}"; + }; + }; + 6BF5F2C511747E9F000502A6 /* stb_image.h */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {931, 50882}}"; + sepNavSelRange = "{108151, 0}"; + sepNavVisRange = "{107349, 1210}"; + }; + }; + 6BF7C13E11119520002B3F46 /* TestCase.h */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {931, 1027}}"; + sepNavSelRange = "{1776, 0}"; + sepNavVisRange = "{1047, 917}"; + }; + }; + 6BF7C13F1111953A002B3F46 /* TestCase.cpp */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {931, 4485}}"; + sepNavSelRange = "{4694, 0}"; + sepNavVisRange = "{4411, 905}"; + }; + }; + 6BF7C4531115C277002B3F46 /* RecastArea.cpp */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {931, 5174}}"; + sepNavSelRange = "{986, 0}"; + sepNavVisRange = "{0, 1674}"; + }; + }; + 8D1107260486CEB800E47090 /* Recast */ = { + activeExec = 0; + executables = ( + 6B8632970F78114600E2684A /* Recast */, + ); + }; + 8D1107310486CEB800E47090 /* Info.plist */ = { + uiCtxt = { + sepNavWindowFrame = "{{38, 57}, {1011, 695}}"; + }; + }; +} diff --git a/dep/recastnavigation/RecastDemo/Build/Xcode/Recast.xcodeproj/memon.perspectivev3 b/dep/recastnavigation/RecastDemo/Build/Xcode/Recast.xcodeproj/memon.perspectivev3 new file mode 100644 index 000000000..b3885cdb9 --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Build/Xcode/Recast.xcodeproj/memon.perspectivev3 @@ -0,0 +1,1559 @@ + + + + + ActivePerspectiveName + Project + AllowedModules + + + BundleLoadPath + + MaxInstances + n + Module + PBXSmartGroupTreeModule + Name + Groups and Files Outline View + + + BundleLoadPath + + MaxInstances + n + Module + PBXNavigatorGroup + Name + Editor + + + BundleLoadPath + + MaxInstances + n + Module + XCTaskListModule + Name + Task List + + + BundleLoadPath + + MaxInstances + n + Module + XCDetailModule + Name + File and Smart Group Detail Viewer + + + BundleLoadPath + + MaxInstances + 1 + Module + PBXBuildResultsModule + Name + Detailed Build Results Viewer + + + BundleLoadPath + + MaxInstances + 1 + Module + PBXProjectFindModule + Name + Project Batch Find Tool + + + BundleLoadPath + + MaxInstances + n + Module + XCProjectFormatConflictsModule + Name + Project Format Conflicts List + + + BundleLoadPath + + MaxInstances + n + Module + PBXBookmarksModule + Name + Bookmarks Tool + + + BundleLoadPath + + MaxInstances + n + Module + PBXClassBrowserModule + Name + Class Browser + + + BundleLoadPath + + MaxInstances + n + Module + PBXCVSModule + Name + Source Code Control Tool + + + BundleLoadPath + + MaxInstances + n + Module + PBXDebugBreakpointsModule + Name + Debug Breakpoints Tool + + + BundleLoadPath + + MaxInstances + n + Module + XCDockableInspector + Name + Inspector + + + BundleLoadPath + + MaxInstances + n + Module + PBXOpenQuicklyModule + Name + Open Quickly Tool + + + BundleLoadPath + + MaxInstances + 1 + Module + PBXDebugSessionModule + Name + Debugger + + + BundleLoadPath + + MaxInstances + 1 + Module + PBXDebugCLIModule + Name + Debug Console + + + BundleLoadPath + + MaxInstances + n + Module + XCSnapshotModule + Name + Snapshots Tool + + + BundlePath + /Developer/Library/PrivateFrameworks/DevToolsInterface.framework/Resources + Description + AIODescriptionKey + DockingSystemVisible + + Extension + perspectivev3 + FavBarConfig + + PBXProjectModuleGUID + 6B8632A80F78115100E2684A + XCBarModuleItemNames + + XCBarModuleItems + + + FirstTimeWindowDisplayed + + Identifier + com.apple.perspectives.project.defaultV3 + MajorVersion + 34 + MinorVersion + 0 + Name + All-In-One + Notifications + + OpenEditors + + PerspectiveWidths + + 1200 + 1200 + + Perspectives + + + ChosenToolbarItems + + XCToolbarPerspectiveControl + NSToolbarSeparatorItem + active-combo-popup + action + NSToolbarFlexibleSpaceItem + debugger-enable-breakpoints + build-and-go + com.apple.ide.PBXToolbarStopButton + get-info + NSToolbarFlexibleSpaceItem + com.apple.pbx.toolbar.searchfield + + ControllerClassBaseName + + IconName + WindowOfProject + Identifier + perspective.project + IsVertical + + Layout + + + ContentConfiguration + + PBXBottomSmartGroupGIDs + + 1C37FBAC04509CD000000102 + 1C37FAAC04509CD000000102 + 1C37FABC05509CD000000102 + 1C37FABC05539CD112110102 + E2644B35053B69B200211256 + 1C37FABC04509CD000100104 + 1CC0EA4004350EF90044410B + 1CC0EA4004350EF90041110B + 1C77FABC04509CD000000102 + + PBXProjectModuleGUID + 1CA23ED40692098700951B8B + PBXProjectModuleLabel + Files + PBXProjectStructureProvided + yes + PBXSmartGroupTreeModuleColumnData + + PBXSmartGroupTreeModuleColumnWidthsKey + + 264 + + PBXSmartGroupTreeModuleColumnsKey_v4 + + MainColumn + + + PBXSmartGroupTreeModuleOutlineStateKey_v7 + + PBXSmartGroupTreeModuleOutlineStateExpansionKey + + 29B97314FDCFA39411CA2CEA + 080E96DDFE201D6D7F000001 + 6BB93C7610CFE1BD00F74F2B + 6BDD9E030F91110C00904EEF + 6B137C7D0F7FCBE800459200 + 6B555DF5100B25FC00247EA3 + 6BB7FE8E10F4A175006DA0A6 + 29B97315FDCFA39411CA2CEA + 29B97317FDCFA39411CA2CEA + 29B97323FDCFA39411CA2CEA + 19C28FACFE9D520D11CA2CBB + 1C37FBAC04509CD000000102 + 1C37FABC05509CD000000102 + 1C77FABC04509CD000000102 + + PBXSmartGroupTreeModuleOutlineStateSelectionKey + + + 10 + 2 + 1 + 0 + + + PBXSmartGroupTreeModuleOutlineStateVisibleRectKey + {{0, 0}, {264, 622}} + + PBXTopSmartGroupGIDs + + XCIncludePerspectivesSwitch + + + GeometryConfiguration + + Frame + {{0, 0}, {281, 640}} + GroupTreeTableConfiguration + + MainColumn + 264 + + RubberWindowFrame + 47 97 1200 681 0 0 1280 778 + + Module + PBXSmartGroupTreeModule + Proportion + 281pt + + + Dock + + + BecomeActive + + ContentConfiguration + + PBXProjectModuleGUID + 6B8632A30F78115100E2684A + PBXProjectModuleLabel + DetourDebugDraw.cpp + PBXSplitModuleInNavigatorKey + + Split0 + + PBXProjectModuleGUID + 6B8632A40F78115100E2684A + PBXProjectModuleLabel + DetourDebugDraw.cpp + _historyCapacity + 0 + bookmark + 6B74B7CC1286FAD800262888 + history + + 6B8D565F127ADB0D0077C699 + 6B8D566F127ADB7D0077C699 + 6B8D56D2127AEC100077C699 + 6B4DE62F12807542001CFDF4 + 6B4DE649128079E0001CFDF4 + 6B4DE64A128079E0001CFDF4 + 6B74B5F3128312AC00262888 + 6B74B5F4128312AC00262888 + 6B74B60F128312E900262888 + 6B74B626128314A500262888 + 6B74B627128314A500262888 + 6B74B628128314A500262888 + 6B74B62A128314A500262888 + 6B74B62B128314A500262888 + 6B74B66712869CE100262888 + 6B74B66F12869E3000262888 + 6B74B6D81286ABC000262888 + 6B74B6FC1286AE0B00262888 + 6B74B7061286AEBD00262888 + 6B74B7071286AEBD00262888 + 6B74B7601286BB6900262888 + 6B74B7611286BB6900262888 + 6B74B76B1286F56B00262888 + 6B74B76F1286F56B00262888 + 6B74B7761286F61200262888 + 6B74B7771286F61200262888 + 6B74B7801286F72D00262888 + 6B74B7811286F72D00262888 + 6B74B7821286F72D00262888 + 6B74B7831286F72D00262888 + 6B74B7841286F72D00262888 + 6B74B7901286F77500262888 + 6B74B7991286F7CD00262888 + 6B74B7AD1286F93000262888 + 6B74B7B21286F99100262888 + 6B74B7C01286FA5200262888 + 6B74B7C51286FAB500262888 + 6B74B7CB1286FAD800262888 + + + SplitCount + 1 + + StatusBarVisibility + + XCSharingToken + com.apple.Xcode.CommonNavigatorGroupSharingToken + + GeometryConfiguration + + Frame + {{0, 0}, {914, 543}} + RubberWindowFrame + 47 97 1200 681 0 0 1280 778 + + Module + PBXNavigatorGroup + Proportion + 543pt + + + Proportion + 93pt + Tabs + + + ContentConfiguration + + PBXProjectModuleGUID + 1CA23EDF0692099D00951B8B + PBXProjectModuleLabel + Detail + + GeometryConfiguration + + Frame + {{10, 27}, {992, 49}} + + Module + XCDetailModule + + + ContentConfiguration + + PBXProjectModuleGUID + 1CA23EE00692099D00951B8B + PBXProjectModuleLabel + Project Find + + GeometryConfiguration + + Frame + {{10, 27}, {914, 66}} + RubberWindowFrame + 47 97 1200 681 0 0 1280 778 + + Module + PBXProjectFindModule + + + ContentConfiguration + + PBXCVSModuleFilterTypeKey + 1032 + PBXProjectModuleGUID + 1CA23EE10692099D00951B8B + PBXProjectModuleLabel + SCM Results + + GeometryConfiguration + + Frame + {{10, 31}, {603, 297}} + + Module + PBXCVSModule + + + ContentConfiguration + + PBXProjectModuleGUID + XCMainBuildResultsModuleGUID + PBXProjectModuleLabel + Build Results + XCBuildResultsTrigger_Collapse + 1021 + XCBuildResultsTrigger_Open + 1011 + + GeometryConfiguration + + Frame + {{10, 27}, {914, 87}} + + Module + PBXBuildResultsModule + + + + + Proportion + 914pt + + + Name + Project + ServiceClasses + + XCModuleDock + PBXSmartGroupTreeModule + XCModuleDock + PBXNavigatorGroup + XCDockableTabModule + XCDetailModule + PBXProjectFindModule + PBXCVSModule + PBXBuildResultsModule + + TableOfContents + + 6B74B5DD1283104100262888 + 1CA23ED40692098700951B8B + 6B74B5DE1283104100262888 + 6B8632A30F78115100E2684A + 6B74B5DF1283104100262888 + 1CA23EDF0692099D00951B8B + 1CA23EE00692099D00951B8B + 1CA23EE10692099D00951B8B + XCMainBuildResultsModuleGUID + + ToolbarConfigUserDefaultsMinorVersion + 2 + ToolbarConfiguration + xcode.toolbar.config.defaultV3 + + + ChosenToolbarItems + + XCToolbarPerspectiveControl + NSToolbarSeparatorItem + active-combo-popup + NSToolbarFlexibleSpaceItem + build-and-go + com.apple.ide.PBXToolbarStopButton + debugger-restart-executable + debugger-pause + debugger-step-over + debugger-step-into + debugger-step-out + debugger-enable-breakpoints + NSToolbarFlexibleSpaceItem + clear-log + + ControllerClassBaseName + PBXDebugSessionModule + IconName + DebugTabIcon + Identifier + perspective.debug + IsVertical + + Layout + + + ContentConfiguration + + PBXProjectModuleGUID + 1CCC7628064C1048000F2A68 + PBXProjectModuleLabel + Debugger Console + + GeometryConfiguration + + Frame + {{0, 0}, {1200, 260}} + + Module + PBXDebugCLIModule + Proportion + 260pt + + + ContentConfiguration + + Debugger + + HorizontalSplitView + + _collapsingFrameDimension + 0.0 + _indexOfCollapsedView + 0 + _percentageOfCollapsedView + 0.0 + isCollapsed + yes + sizes + + {{0, 0}, {545, 112}} + {{545, 0}, {655, 112}} + + + VerticalSplitView + + _collapsingFrameDimension + 0.0 + _indexOfCollapsedView + 0 + _percentageOfCollapsedView + 0.0 + isCollapsed + yes + sizes + + {{0, 0}, {1200, 112}} + {{0, 112}, {1200, 263}} + + + + LauncherConfigVersion + 8 + PBXProjectModuleGUID + 1CCC7629064C1048000F2A68 + PBXProjectModuleLabel + Debug + + GeometryConfiguration + + DebugConsoleVisible + None + DebugConsoleWindowFrame + {{200, 200}, {500, 300}} + DebugSTDIOWindowFrame + {{200, 200}, {500, 300}} + Frame + {{0, 265}, {1200, 375}} + PBXDebugSessionStackFrameViewKey + + DebugVariablesTableConfiguration + + Name + 183 + Value + 168 + Summary + 279 + + Frame + {{545, 0}, {655, 112}} + + + Module + PBXDebugSessionModule + Proportion + 375pt + + + Name + Debug + ServiceClasses + + XCModuleDock + PBXDebugCLIModule + PBXDebugSessionModule + PBXDebugProcessAndThreadModule + PBXDebugProcessViewModule + PBXDebugThreadViewModule + PBXDebugStackFrameViewModule + PBXNavigatorGroup + + TableOfContents + + 6B74B5FD128312AC00262888 + 1CCC7628064C1048000F2A68 + 1CCC7629064C1048000F2A68 + 6B74B5FE128312AC00262888 + 6B74B5FF128312AC00262888 + 6B74B600128312AC00262888 + 6B74B601128312AC00262888 + 6B74B602128312AC00262888 + + ToolbarConfigUserDefaultsMinorVersion + 2 + ToolbarConfiguration + xcode.toolbar.config.debugV3 + + + PerspectivesBarVisible + + ShelfIsVisible + + SourceDescription + file at '/Developer/Library/PrivateFrameworks/DevToolsInterface.framework/Resources/XCPerspectivesSpecification.xcperspec' + StatusbarIsVisible + + TimeStamp + 0.0 + ToolbarDisplayMode + 1 + ToolbarIsVisible + + ToolbarSizeMode + 1 + Type + Perspectives + UpdateMessage + + WindowJustification + 5 + WindowOrderList + + 6B74B7C81286FAB500262888 + 6B74B604128312AC00262888 + 6B74B605128312AC00262888 + /Users/memon/Code/recastnavigation/RecastDemo/Build/Xcode/Recast.xcodeproj + + WindowString + 47 97 1200 681 0 0 1280 778 + WindowToolsV3 + + + Identifier + windowTool.debugger + Layout + + + Dock + + + ContentConfiguration + + Debugger + + HorizontalSplitView + + _collapsingFrameDimension + 0.0 + _indexOfCollapsedView + 0 + _percentageOfCollapsedView + 0.0 + isCollapsed + yes + sizes + + {{0, 0}, {317, 164}} + {{317, 0}, {377, 164}} + + + VerticalSplitView + + _collapsingFrameDimension + 0.0 + _indexOfCollapsedView + 0 + _percentageOfCollapsedView + 0.0 + isCollapsed + yes + sizes + + {{0, 0}, {694, 164}} + {{0, 164}, {694, 216}} + + + + LauncherConfigVersion + 8 + PBXProjectModuleGUID + 1C162984064C10D400B95A72 + PBXProjectModuleLabel + Debug - GLUTExamples (Underwater) + + GeometryConfiguration + + DebugConsoleDrawerSize + {100, 120} + DebugConsoleVisible + None + DebugConsoleWindowFrame + {{200, 200}, {500, 300}} + DebugSTDIOWindowFrame + {{200, 200}, {500, 300}} + Frame + {{0, 0}, {694, 380}} + RubberWindowFrame + 321 238 694 422 0 0 1440 878 + + Module + PBXDebugSessionModule + Proportion + 100% + + + Proportion + 100% + + + Name + Debugger + ServiceClasses + + PBXDebugSessionModule + + StatusbarIsVisible + 1 + TableOfContents + + 1CD10A99069EF8BA00B06720 + 1C0AD2AB069F1E9B00FABCE6 + 1C162984064C10D400B95A72 + 1C0AD2AC069F1E9B00FABCE6 + + ToolbarConfiguration + xcode.toolbar.config.debugV3 + WindowString + 321 238 694 422 0 0 1440 878 + WindowToolGUID + 1CD10A99069EF8BA00B06720 + WindowToolIsVisible + 0 + + + Identifier + windowTool.build + Layout + + + Dock + + + ContentConfiguration + + PBXProjectModuleGUID + 1CD0528F0623707200166675 + PBXProjectModuleLabel + <No Editor> + PBXSplitModuleInNavigatorKey + + Split0 + + PBXProjectModuleGUID + 1CD052900623707200166675 + + SplitCount + 1 + + StatusBarVisibility + 1 + + GeometryConfiguration + + Frame + {{0, 0}, {500, 215}} + RubberWindowFrame + 192 257 500 500 0 0 1280 1002 + + Module + PBXNavigatorGroup + Proportion + 218pt + + + BecomeActive + 1 + ContentConfiguration + + PBXProjectModuleGUID + XCMainBuildResultsModuleGUID + PBXProjectModuleLabel + Build + + GeometryConfiguration + + Frame + {{0, 222}, {500, 236}} + RubberWindowFrame + 192 257 500 500 0 0 1280 1002 + + Module + PBXBuildResultsModule + Proportion + 236pt + + + Proportion + 458pt + + + Name + Build Results + ServiceClasses + + PBXBuildResultsModule + + StatusbarIsVisible + 1 + TableOfContents + + 1C78EAA5065D492600B07095 + 1C78EAA6065D492600B07095 + 1CD0528F0623707200166675 + XCMainBuildResultsModuleGUID + + ToolbarConfiguration + xcode.toolbar.config.buildV3 + WindowString + 192 257 500 500 0 0 1280 1002 + + + Identifier + windowTool.find + Layout + + + Dock + + + Dock + + + ContentConfiguration + + PBXProjectModuleGUID + 1CDD528C0622207200134675 + PBXProjectModuleLabel + <No Editor> + PBXSplitModuleInNavigatorKey + + Split0 + + PBXProjectModuleGUID + 1CD0528D0623707200166675 + + SplitCount + 1 + + StatusBarVisibility + 1 + + GeometryConfiguration + + Frame + {{0, 0}, {781, 167}} + RubberWindowFrame + 62 385 781 470 0 0 1440 878 + + Module + PBXNavigatorGroup + Proportion + 781pt + + + Proportion + 50% + + + BecomeActive + 1 + ContentConfiguration + + PBXProjectModuleGUID + 1CD0528E0623707200166675 + PBXProjectModuleLabel + Project Find + + GeometryConfiguration + + Frame + {{8, 0}, {773, 254}} + RubberWindowFrame + 62 385 781 470 0 0 1440 878 + + Module + PBXProjectFindModule + Proportion + 50% + + + Proportion + 428pt + + + Name + Project Find + ServiceClasses + + PBXProjectFindModule + + StatusbarIsVisible + 1 + TableOfContents + + 1C530D57069F1CE1000CFCEE + 1C530D58069F1CE1000CFCEE + 1C530D59069F1CE1000CFCEE + 1CDD528C0622207200134675 + 1C530D5A069F1CE1000CFCEE + 1CE0B1FE06471DED0097A5F4 + 1CD0528E0623707200166675 + + WindowString + 62 385 781 470 0 0 1440 878 + WindowToolGUID + 1C530D57069F1CE1000CFCEE + WindowToolIsVisible + 0 + + + Identifier + windowTool.snapshots + Layout + + + Dock + + + Module + XCSnapshotModule + Proportion + 100% + + + Proportion + 100% + + + Name + Snapshots + ServiceClasses + + XCSnapshotModule + + StatusbarIsVisible + Yes + ToolbarConfiguration + xcode.toolbar.config.snapshots + WindowString + 315 824 300 550 0 0 1440 878 + WindowToolIsVisible + Yes + + + FirstTimeWindowDisplayed + + Identifier + windowTool.debuggerConsole + IsVertical + + Layout + + + Dock + + + ContentConfiguration + + PBXProjectModuleGUID + 1C78EAAC065D492600B07095 + PBXProjectModuleLabel + Debugger Console + + GeometryConfiguration + + Frame + {{0, 0}, {440, 359}} + RubberWindowFrame + 21 355 440 400 0 0 1280 778 + + Module + PBXDebugCLIModule + Proportion + 359pt + + + Proportion + 359pt + + + Name + Debugger Console + ServiceClasses + + PBXDebugCLIModule + + StatusbarIsVisible + + TableOfContents + + 1C530D5B069F1CE1000CFCEE + 6BB9C382127A0FB400B97C1C + 1C78EAAC065D492600B07095 + + ToolbarConfiguration + xcode.toolbar.config.consoleV3 + WindowString + 21 355 440 400 0 0 1280 778 + WindowToolGUID + 1C530D5B069F1CE1000CFCEE + WindowToolIsVisible + + + + Identifier + windowTool.scm + Layout + + + Dock + + + ContentConfiguration + + PBXProjectModuleGUID + 1C78EAB2065D492600B07095 + PBXProjectModuleLabel + <No Editor> + PBXSplitModuleInNavigatorKey + + Split0 + + PBXProjectModuleGUID + 1C78EAB3065D492600B07095 + + SplitCount + 1 + + StatusBarVisibility + 1 + + GeometryConfiguration + + Frame + {{0, 0}, {452, 0}} + RubberWindowFrame + 743 379 452 308 0 0 1280 1002 + + Module + PBXNavigatorGroup + Proportion + 0pt + + + BecomeActive + 1 + ContentConfiguration + + PBXProjectModuleGUID + 1CD052920623707200166675 + PBXProjectModuleLabel + SCM + + GeometryConfiguration + + ConsoleFrame + {{0, 259}, {452, 0}} + Frame + {{0, 7}, {452, 259}} + RubberWindowFrame + 743 379 452 308 0 0 1280 1002 + TableConfiguration + + Status + 30 + FileName + 199 + Path + 197.09500122070312 + + TableFrame + {{0, 0}, {452, 250}} + + Module + PBXCVSModule + Proportion + 262pt + + + Proportion + 266pt + + + Name + SCM + ServiceClasses + + PBXCVSModule + + StatusbarIsVisible + 1 + TableOfContents + + 1C78EAB4065D492600B07095 + 1C78EAB5065D492600B07095 + 1C78EAB2065D492600B07095 + 1CD052920623707200166675 + + ToolbarConfiguration + xcode.toolbar.config.scmV3 + WindowString + 743 379 452 308 0 0 1280 1002 + + + FirstTimeWindowDisplayed + + Identifier + windowTool.breakpoints + IsVertical + + Layout + + + Dock + + + BecomeActive + + ContentConfiguration + + PBXBottomSmartGroupGIDs + + 1C77FABC04509CD000000102 + + PBXProjectModuleGUID + 1CE0B1FE06471DED0097A5F4 + PBXProjectModuleLabel + Files + PBXProjectStructureProvided + no + PBXSmartGroupTreeModuleColumnData + + PBXSmartGroupTreeModuleColumnWidthsKey + + 168 + + PBXSmartGroupTreeModuleColumnsKey_v4 + + MainColumn + + + PBXSmartGroupTreeModuleOutlineStateKey_v7 + + PBXSmartGroupTreeModuleOutlineStateExpansionKey + + 1C77FABC04509CD000000102 + 1C3E0DCC080725EA11A45113 + + PBXSmartGroupTreeModuleOutlineStateSelectionKey + + + 0 + + + PBXSmartGroupTreeModuleOutlineStateVisibleRectKey + {{0, 0}, {168, 350}} + + PBXTopSmartGroupGIDs + + XCIncludePerspectivesSwitch + + + GeometryConfiguration + + Frame + {{0, 0}, {185, 368}} + GroupTreeTableConfiguration + + MainColumn + 168 + + RubberWindowFrame + 21 346 744 409 0 0 1280 778 + + Module + PBXSmartGroupTreeModule + Proportion + 185pt + + + ContentConfiguration + + PBXProjectModuleGUID + 1CA1AED706398EBD00589147 + PBXProjectModuleLabel + Detail + + GeometryConfiguration + + Frame + {{190, 0}, {554, 368}} + RubberWindowFrame + 21 346 744 409 0 0 1280 778 + + Module + XCDetailModule + Proportion + 554pt + + + Proportion + 368pt + + + MajorVersion + 3 + MinorVersion + 0 + Name + Breakpoints + ServiceClasses + + PBXSmartGroupTreeModule + XCDetailModule + + StatusbarIsVisible + + TableOfContents + + 6B57D33F108C659D00DDD053 + 6B57D340108C659D00DDD053 + 1CE0B1FE06471DED0097A5F4 + 1CA1AED706398EBD00589147 + + ToolbarConfiguration + xcode.toolbar.config.breakpointsV3 + WindowString + 21 346 744 409 0 0 1280 778 + WindowToolGUID + 6B57D33F108C659D00DDD053 + WindowToolIsVisible + + + + Identifier + windowTool.debugAnimator + Layout + + + Dock + + + Module + PBXNavigatorGroup + Proportion + 100% + + + Proportion + 100% + + + Name + Debug Visualizer + ServiceClasses + + PBXNavigatorGroup + + StatusbarIsVisible + 1 + ToolbarConfiguration + xcode.toolbar.config.debugAnimatorV3 + WindowString + 100 100 700 500 0 0 1280 1002 + + + FirstTimeWindowDisplayed + + Identifier + windowTool.bookmarks + IsVertical + + Layout + + + Dock + + + ContentConfiguration + + PBXProjectModuleGUID + 6B8DE8DA10B6B3F800DF20FB + PBXProjectModuleLabel + Bookmarks + + GeometryConfiguration + + Frame + {{0, 0}, {401, 202}} + RubberWindowFrame + 21 533 401 222 0 0 1280 778 + + Module + PBXBookmarksModule + Proportion + 202pt + + + Proportion + 202pt + + + Name + Bookmarks + ServiceClasses + + PBXBookmarksModule + + StatusbarIsVisible + + TableOfContents + + 6B8DE8DB10B6B3F800DF20FB + 6B8DE8DC10B6B3F800DF20FB + 6B8DE8DA10B6B3F800DF20FB + + WindowString + 21 533 401 222 0 0 1280 778 + WindowToolGUID + 6B8DE8DB10B6B3F800DF20FB + WindowToolIsVisible + + + + Identifier + windowTool.projectFormatConflicts + Layout + + + Dock + + + Module + XCProjectFormatConflictsModule + Proportion + 100% + + + Proportion + 100% + + + Name + Project Format Conflicts + ServiceClasses + + XCProjectFormatConflictsModule + + StatusbarIsVisible + 0 + WindowContentMinSize + 450 300 + WindowString + 50 850 472 307 0 0 1440 877 + + + Identifier + windowTool.classBrowser + Layout + + + Dock + + + BecomeActive + 1 + ContentConfiguration + + OptionsSetName + Hierarchy, all classes + PBXProjectModuleGUID + 1CA6456E063B45B4001379D8 + PBXProjectModuleLabel + Class Browser - NSObject + + GeometryConfiguration + + ClassesFrame + {{0, 0}, {369, 96}} + ClassesTreeTableConfiguration + + PBXClassNameColumnIdentifier + 208 + PBXClassBookColumnIdentifier + 22 + + Frame + {{0, 0}, {616, 353}} + MembersFrame + {{0, 105}, {369, 395}} + MembersTreeTableConfiguration + + PBXMemberTypeIconColumnIdentifier + 22 + PBXMemberNameColumnIdentifier + 216 + PBXMemberTypeColumnIdentifier + 94 + PBXMemberBookColumnIdentifier + 22 + + PBXModuleWindowStatusBarHidden2 + 1 + RubberWindowFrame + 597 125 616 374 0 0 1280 1002 + + Module + PBXClassBrowserModule + Proportion + 354pt + + + Proportion + 354pt + + + Name + Class Browser + ServiceClasses + + PBXClassBrowserModule + + StatusbarIsVisible + 0 + TableOfContents + + 1C78EABA065D492600B07095 + 1C78EABB065D492600B07095 + 1CA6456E063B45B4001379D8 + + ToolbarConfiguration + xcode.toolbar.config.classbrowser + WindowString + 597 125 616 374 0 0 1280 1002 + + + Identifier + windowTool.refactoring + IncludeInToolsMenu + 0 + Layout + + + Dock + + + BecomeActive + 1 + GeometryConfiguration + + Frame + {0, 0}, {500, 335} + RubberWindowFrame + {0, 0}, {500, 335} + + Module + XCRefactoringModule + Proportion + 100% + + + Proportion + 100% + + + Name + Refactoring + ServiceClasses + + XCRefactoringModule + + WindowString + 200 200 500 356 0 0 1920 1200 + + + + diff --git a/dep/recastnavigation/RecastDemo/Build/Xcode/Recast.xcodeproj/project.pbxproj b/dep/recastnavigation/RecastDemo/Build/Xcode/Recast.xcodeproj/project.pbxproj new file mode 100644 index 000000000..8335b10de --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Build/Xcode/Recast.xcodeproj/project.pbxproj @@ -0,0 +1,596 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 45; + objects = { + +/* Begin PBXBuildFile section */ + 1DDD58160DA1D0A300B32029 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 1DDD58140DA1D0A300B32029 /* MainMenu.xib */; }; + 6B024C0D10060AC600CF7107 /* Icon.icns in Resources */ = {isa = PBXBuildFile; fileRef = 6B024C0C10060AC600CF7107 /* Icon.icns */; }; + 6B1185F51006895B0018F96F /* DetourNode.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6B1185F41006895B0018F96F /* DetourNode.cpp */; }; + 6B1185FE10068B150018F96F /* DetourCommon.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6B1185FD10068B150018F96F /* DetourCommon.cpp */; }; + 6B137C710F7FCBBB00459200 /* imgui.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6B137C6C0F7FCBBB00459200 /* imgui.cpp */; }; + 6B137C720F7FCBBB00459200 /* MeshLoaderObj.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6B137C6D0F7FCBBB00459200 /* MeshLoaderObj.cpp */; }; + 6B137C730F7FCBBB00459200 /* SDLMain.m in Sources */ = {isa = PBXBuildFile; fileRef = 6B137C6E0F7FCBBB00459200 /* SDLMain.m */; }; + 6B137C8B0F7FCC1100459200 /* Recast.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6B137C820F7FCC1100459200 /* Recast.cpp */; }; + 6B137C8C0F7FCC1100459200 /* RecastContour.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6B137C830F7FCC1100459200 /* RecastContour.cpp */; }; + 6B137C8E0F7FCC1100459200 /* RecastFilter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6B137C850F7FCC1100459200 /* RecastFilter.cpp */; }; + 6B137C900F7FCC1100459200 /* RecastMesh.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6B137C870F7FCC1100459200 /* RecastMesh.cpp */; }; + 6B137C910F7FCC1100459200 /* RecastRasterization.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6B137C880F7FCC1100459200 /* RecastRasterization.cpp */; }; + 6B137C920F7FCC1100459200 /* RecastRegion.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6B137C890F7FCC1100459200 /* RecastRegion.cpp */; }; + 6B25B6190FFA62BE004F1BC4 /* Sample.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6B25B6140FFA62BE004F1BC4 /* Sample.cpp */; }; + 6B25B61D0FFA62BE004F1BC4 /* main.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6B25B6180FFA62BE004F1BC4 /* main.cpp */; }; + 6B2AEC530FFB8958005BE9CC /* Sample_TileMesh.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6B2AEC520FFB8958005BE9CC /* Sample_TileMesh.cpp */; }; + 6B324C66111C5D9A00EBD2FD /* ConvexVolumeTool.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6B324C65111C5D9A00EBD2FD /* ConvexVolumeTool.cpp */; }; + 6B555DB1100B212E00247EA3 /* imguiRenderGL.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6B555DB0100B212E00247EA3 /* imguiRenderGL.cpp */; }; + 6B62416A103434880002E346 /* RecastMeshDetail.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6B624169103434880002E346 /* RecastMeshDetail.cpp */; }; + 6B8036AE113BAABE005ED67B /* Sample_Debug.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6B8036AD113BAABE005ED67B /* Sample_Debug.cpp */; }; + 6B847777122D221D00ADF63D /* ValueHistory.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6B847776122D221C00ADF63D /* ValueHistory.cpp */; }; + 6B8632DA0F78122C00E2684A /* SDL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6B8632D90F78122C00E2684A /* SDL.framework */; }; + 6B8632DC0F78123E00E2684A /* OpenGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6B8632DB0F78123E00E2684A /* OpenGL.framework */; }; + 6B8DE88910B69E3E00DF20FB /* DetourNavMesh.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6B8DE88710B69E3E00DF20FB /* DetourNavMesh.cpp */; }; + 6B8DE88A10B69E3E00DF20FB /* DetourNavMeshBuilder.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6B8DE88810B69E3E00DF20FB /* DetourNavMeshBuilder.cpp */; }; + 6B98463311E6144400FA177B /* Sample_SoloMeshTiled.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6B98463211E6144400FA177B /* Sample_SoloMeshTiled.cpp */; }; + 6B9846EF11E718F800FA177B /* DetourAlloc.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6B9846EE11E718F800FA177B /* DetourAlloc.cpp */; }; + 6B9847B811E7519A00FA177B /* RecastAlloc.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6B9847B711E7519A00FA177B /* RecastAlloc.cpp */; }; + 6B9EFF0912281C3E00535FF1 /* DetourObstacleAvoidance.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6B9EFF0812281C3E00535FF1 /* DetourObstacleAvoidance.cpp */; }; + 6BA1E88B10C7BFC9008007F6 /* Sample_SoloMeshSimple.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6BA1E88810C7BFC9008007F6 /* Sample_SoloMeshSimple.cpp */; }; + 6BAF3C591211663A008CFCDF /* CrowdTool.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6BAF3C581211663A008CFCDF /* CrowdTool.cpp */; }; + 6BAF40DB12196A3D008CFCDF /* DetourNavMeshQuery.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6BAF40DA12196A3D008CFCDF /* DetourNavMeshQuery.cpp */; }; + 6BAF4442121C3D26008CFCDF /* SampleInterfaces.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6BAF4441121C3D26008CFCDF /* SampleInterfaces.cpp */; }; + 6BB788170FC0472B003C24DB /* ChunkyTriMesh.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6BB788160FC0472B003C24DB /* ChunkyTriMesh.cpp */; }; + 6BB7FC0B10EBB6AA006DA0A6 /* NavMeshTesterTool.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6BB7FC0A10EBB6AA006DA0A6 /* NavMeshTesterTool.cpp */; }; + 6BB7FDA510F36F0E006DA0A6 /* InputGeom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6BB7FDA410F36F0E006DA0A6 /* InputGeom.cpp */; }; + 6BB93C7D10CFE1D500F74F2B /* DebugDraw.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6BB93C7A10CFE1D500F74F2B /* DebugDraw.cpp */; }; + 6BB93C7E10CFE1D500F74F2B /* DetourDebugDraw.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6BB93C7B10CFE1D500F74F2B /* DetourDebugDraw.cpp */; }; + 6BB93C7F10CFE1D500F74F2B /* RecastDebugDraw.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6BB93C7C10CFE1D500F74F2B /* RecastDebugDraw.cpp */; }; + 6BB93CF610CFEC4500F74F2B /* RecastDump.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6BB93CF510CFEC4500F74F2B /* RecastDump.cpp */; }; + 6BCF32361104CD05009445BF /* OffMeshConnectionTool.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6BCF32351104CD05009445BF /* OffMeshConnectionTool.cpp */; }; + 6BD402011224279400995864 /* PerfTimer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6BD402001224279400995864 /* PerfTimer.cpp */; }; + 6BD667DA123D28100021A7A4 /* CrowdManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6BD667D9123D28100021A7A4 /* CrowdManager.cpp */; }; + 6BF5F23A11747606000502A6 /* Filelist.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6BF5F23911747606000502A6 /* Filelist.cpp */; }; + 6BF5F2401174763B000502A6 /* SlideShow.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6BF5F23F1174763B000502A6 /* SlideShow.cpp */; }; + 6BF7C1401111953A002B3F46 /* TestCase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6BF7C13F1111953A002B3F46 /* TestCase.cpp */; }; + 6BF7C4541115C277002B3F46 /* RecastArea.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6BF7C4531115C277002B3F46 /* RecastArea.cpp */; }; + 8D11072B0486CEB800E47090 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */; }; + 8D11072F0486CEB800E47090 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */; }; +/* End PBXBuildFile section */ + +/* Begin PBXFileReference section */ + 089C165DFE840E0CC02AAC07 /* English */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = English; path = English.lproj/InfoPlist.strings; sourceTree = ""; }; + 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = ""; }; + 13E42FB307B3F0F600E4EEF1 /* CoreData.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreData.framework; path = /System/Library/Frameworks/CoreData.framework; sourceTree = ""; }; + 1DDD58150DA1D0A300B32029 /* English */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = English; path = English.lproj/MainMenu.xib; sourceTree = ""; }; + 29B97324FDCFA39411CA2CEA /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = /System/Library/Frameworks/AppKit.framework; sourceTree = ""; }; + 29B97325FDCFA39411CA2CEA /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = /System/Library/Frameworks/Foundation.framework; sourceTree = ""; }; + 32CA4F630368D1EE00C91783 /* Recast_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Recast_Prefix.pch; sourceTree = ""; }; + 6B024C0C10060AC600CF7107 /* Icon.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; path = Icon.icns; sourceTree = ""; }; + 6B1185F41006895B0018F96F /* DetourNode.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = DetourNode.cpp; path = ../../../Detour/Source/DetourNode.cpp; sourceTree = SOURCE_ROOT; }; + 6B1185F61006896B0018F96F /* DetourNode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DetourNode.h; path = ../../../Detour/Include/DetourNode.h; sourceTree = SOURCE_ROOT; }; + 6B1185FC10068B040018F96F /* DetourCommon.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DetourCommon.h; path = ../../../Detour/Include/DetourCommon.h; sourceTree = SOURCE_ROOT; }; + 6B1185FD10068B150018F96F /* DetourCommon.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = DetourCommon.cpp; path = ../../../Detour/Source/DetourCommon.cpp; sourceTree = SOURCE_ROOT; }; + 6B137C6C0F7FCBBB00459200 /* imgui.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = imgui.cpp; path = ../../Source/imgui.cpp; sourceTree = SOURCE_ROOT; }; + 6B137C6D0F7FCBBB00459200 /* MeshLoaderObj.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = MeshLoaderObj.cpp; path = ../../Source/MeshLoaderObj.cpp; sourceTree = SOURCE_ROOT; }; + 6B137C6E0F7FCBBB00459200 /* SDLMain.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = SDLMain.m; path = ../../Source/SDLMain.m; sourceTree = SOURCE_ROOT; }; + 6B137C7A0F7FCBE400459200 /* imgui.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = imgui.h; path = ../../Include/imgui.h; sourceTree = SOURCE_ROOT; }; + 6B137C7B0F7FCBE400459200 /* MeshLoaderObj.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MeshLoaderObj.h; path = ../../Include/MeshLoaderObj.h; sourceTree = SOURCE_ROOT; }; + 6B137C7C0F7FCBE400459200 /* SDLMain.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SDLMain.h; path = ../../Include/SDLMain.h; sourceTree = SOURCE_ROOT; }; + 6B137C7E0F7FCBFE00459200 /* Recast.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Recast.h; path = ../../../Recast/Include/Recast.h; sourceTree = SOURCE_ROOT; }; + 6B137C820F7FCC1100459200 /* Recast.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Recast.cpp; path = ../../../Recast/Source/Recast.cpp; sourceTree = SOURCE_ROOT; }; + 6B137C830F7FCC1100459200 /* RecastContour.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = RecastContour.cpp; path = ../../../Recast/Source/RecastContour.cpp; sourceTree = SOURCE_ROOT; }; + 6B137C850F7FCC1100459200 /* RecastFilter.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = RecastFilter.cpp; path = ../../../Recast/Source/RecastFilter.cpp; sourceTree = SOURCE_ROOT; }; + 6B137C870F7FCC1100459200 /* RecastMesh.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = RecastMesh.cpp; path = ../../../Recast/Source/RecastMesh.cpp; sourceTree = SOURCE_ROOT; }; + 6B137C880F7FCC1100459200 /* RecastRasterization.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = RecastRasterization.cpp; path = ../../../Recast/Source/RecastRasterization.cpp; sourceTree = SOURCE_ROOT; }; + 6B137C890F7FCC1100459200 /* RecastRegion.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = RecastRegion.cpp; path = ../../../Recast/Source/RecastRegion.cpp; sourceTree = SOURCE_ROOT; }; + 6B25B6100FFA62AD004F1BC4 /* Sample.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Sample.h; path = ../../Include/Sample.h; sourceTree = SOURCE_ROOT; }; + 6B25B6140FFA62BE004F1BC4 /* Sample.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Sample.cpp; path = ../../Source/Sample.cpp; sourceTree = SOURCE_ROOT; }; + 6B25B6180FFA62BE004F1BC4 /* main.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = main.cpp; path = ../../Source/main.cpp; sourceTree = SOURCE_ROOT; }; + 6B2AEC510FFB8946005BE9CC /* Sample_TileMesh.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Sample_TileMesh.h; path = ../../Include/Sample_TileMesh.h; sourceTree = SOURCE_ROOT; }; + 6B2AEC520FFB8958005BE9CC /* Sample_TileMesh.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Sample_TileMesh.cpp; path = ../../Source/Sample_TileMesh.cpp; sourceTree = SOURCE_ROOT; }; + 6B324C64111C5D9A00EBD2FD /* ConvexVolumeTool.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ConvexVolumeTool.h; path = ../../Include/ConvexVolumeTool.h; sourceTree = SOURCE_ROOT; }; + 6B324C65111C5D9A00EBD2FD /* ConvexVolumeTool.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ConvexVolumeTool.cpp; path = ../../Source/ConvexVolumeTool.cpp; sourceTree = SOURCE_ROOT; }; + 6B555DAE100B211D00247EA3 /* imguiRenderGL.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = imguiRenderGL.h; path = ../../Include/imguiRenderGL.h; sourceTree = SOURCE_ROOT; }; + 6B555DB0100B212E00247EA3 /* imguiRenderGL.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = imguiRenderGL.cpp; path = ../../Source/imguiRenderGL.cpp; sourceTree = SOURCE_ROOT; }; + 6B555DF6100B273500247EA3 /* stb_truetype.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = stb_truetype.h; path = ../../Contrib/stb_truetype.h; sourceTree = SOURCE_ROOT; }; + 6B624169103434880002E346 /* RecastMeshDetail.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = RecastMeshDetail.cpp; path = ../../../Recast/Source/RecastMeshDetail.cpp; sourceTree = SOURCE_ROOT; }; + 6B8036AC113BAABE005ED67B /* Sample_Debug.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Sample_Debug.h; path = ../../Include/Sample_Debug.h; sourceTree = SOURCE_ROOT; }; + 6B8036AD113BAABE005ED67B /* Sample_Debug.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Sample_Debug.cpp; path = ../../Source/Sample_Debug.cpp; sourceTree = SOURCE_ROOT; }; + 6B847774122D220D00ADF63D /* ValueHistory.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ValueHistory.h; path = ../../Include/ValueHistory.h; sourceTree = SOURCE_ROOT; }; + 6B847776122D221C00ADF63D /* ValueHistory.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ValueHistory.cpp; path = ../../Source/ValueHistory.cpp; sourceTree = SOURCE_ROOT; }; + 6B8632D90F78122C00E2684A /* SDL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SDL.framework; path = Library/Frameworks/SDL.framework; sourceTree = SDKROOT; }; + 6B8632DB0F78123E00E2684A /* OpenGL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGL.framework; path = System/Library/Frameworks/OpenGL.framework; sourceTree = SDKROOT; }; + 6B8DE88710B69E3E00DF20FB /* DetourNavMesh.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = DetourNavMesh.cpp; path = ../../../Detour/Source/DetourNavMesh.cpp; sourceTree = SOURCE_ROOT; }; + 6B8DE88810B69E3E00DF20FB /* DetourNavMeshBuilder.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = DetourNavMeshBuilder.cpp; path = ../../../Detour/Source/DetourNavMeshBuilder.cpp; sourceTree = SOURCE_ROOT; }; + 6B8DE88B10B69E4C00DF20FB /* DetourNavMesh.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DetourNavMesh.h; path = ../../../Detour/Include/DetourNavMesh.h; sourceTree = SOURCE_ROOT; }; + 6B8DE88C10B69E4C00DF20FB /* DetourNavMeshBuilder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DetourNavMeshBuilder.h; path = ../../../Detour/Include/DetourNavMeshBuilder.h; sourceTree = SOURCE_ROOT; }; + 6B98463111E6144400FA177B /* Sample_SoloMeshTiled.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Sample_SoloMeshTiled.h; path = ../../Include/Sample_SoloMeshTiled.h; sourceTree = SOURCE_ROOT; }; + 6B98463211E6144400FA177B /* Sample_SoloMeshTiled.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Sample_SoloMeshTiled.cpp; path = ../../Source/Sample_SoloMeshTiled.cpp; sourceTree = SOURCE_ROOT; }; + 6B9846ED11E718F800FA177B /* DetourAlloc.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DetourAlloc.h; path = ../../../Detour/Include/DetourAlloc.h; sourceTree = SOURCE_ROOT; }; + 6B9846EE11E718F800FA177B /* DetourAlloc.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = DetourAlloc.cpp; path = ../../../Detour/Source/DetourAlloc.cpp; sourceTree = SOURCE_ROOT; }; + 6B98470511E733B600FA177B /* RecastAlloc.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RecastAlloc.h; path = ../../../Recast/Include/RecastAlloc.h; sourceTree = SOURCE_ROOT; }; + 6B9847B711E7519A00FA177B /* RecastAlloc.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = RecastAlloc.cpp; path = ../../../Recast/Source/RecastAlloc.cpp; sourceTree = SOURCE_ROOT; }; + 6B9EFF02122819E200535FF1 /* DetourObstacleAvoidance.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DetourObstacleAvoidance.h; path = ../../../Detour/Include/DetourObstacleAvoidance.h; sourceTree = SOURCE_ROOT; }; + 6B9EFF0812281C3E00535FF1 /* DetourObstacleAvoidance.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = DetourObstacleAvoidance.cpp; path = ../../../Detour/Source/DetourObstacleAvoidance.cpp; sourceTree = SOURCE_ROOT; }; + 6BA1E88810C7BFC9008007F6 /* Sample_SoloMeshSimple.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Sample_SoloMeshSimple.cpp; path = ../../Source/Sample_SoloMeshSimple.cpp; sourceTree = SOURCE_ROOT; }; + 6BA1E88E10C7BFD3008007F6 /* Sample_SoloMeshSimple.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Sample_SoloMeshSimple.h; path = ../../Include/Sample_SoloMeshSimple.h; sourceTree = SOURCE_ROOT; }; + 6BAF3C571211663A008CFCDF /* CrowdTool.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CrowdTool.h; path = ../../Include/CrowdTool.h; sourceTree = SOURCE_ROOT; }; + 6BAF3C581211663A008CFCDF /* CrowdTool.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CrowdTool.cpp; path = ../../Source/CrowdTool.cpp; sourceTree = SOURCE_ROOT; }; + 6BAF40D912196A25008CFCDF /* DetourNavMeshQuery.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DetourNavMeshQuery.h; path = ../../../Detour/Include/DetourNavMeshQuery.h; sourceTree = SOURCE_ROOT; }; + 6BAF40DA12196A3D008CFCDF /* DetourNavMeshQuery.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = DetourNavMeshQuery.cpp; path = ../../../Detour/Source/DetourNavMeshQuery.cpp; sourceTree = SOURCE_ROOT; }; + 6BAF427A121ADCC2008CFCDF /* DetourAssert.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DetourAssert.h; path = ../../../Detour/Include/DetourAssert.h; sourceTree = SOURCE_ROOT; }; + 6BAF4440121C3D0A008CFCDF /* SampleInterfaces.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SampleInterfaces.h; path = ../../Include/SampleInterfaces.h; sourceTree = SOURCE_ROOT; }; + 6BAF4441121C3D26008CFCDF /* SampleInterfaces.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SampleInterfaces.cpp; path = ../../Source/SampleInterfaces.cpp; sourceTree = SOURCE_ROOT; }; + 6BAF4561121D173A008CFCDF /* RecastAssert.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RecastAssert.h; path = ../../../Recast/Include/RecastAssert.h; sourceTree = SOURCE_ROOT; }; + 6BB788160FC0472B003C24DB /* ChunkyTriMesh.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ChunkyTriMesh.cpp; path = ../../Source/ChunkyTriMesh.cpp; sourceTree = SOURCE_ROOT; }; + 6BB788180FC04753003C24DB /* ChunkyTriMesh.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ChunkyTriMesh.h; path = ../../Include/ChunkyTriMesh.h; sourceTree = SOURCE_ROOT; }; + 6BB7FC0910EBB6AA006DA0A6 /* NavMeshTesterTool.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = NavMeshTesterTool.h; path = ../../Include/NavMeshTesterTool.h; sourceTree = SOURCE_ROOT; }; + 6BB7FC0A10EBB6AA006DA0A6 /* NavMeshTesterTool.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = NavMeshTesterTool.cpp; path = ../../Source/NavMeshTesterTool.cpp; sourceTree = SOURCE_ROOT; }; + 6BB7FDA310F36EFC006DA0A6 /* InputGeom.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = InputGeom.h; path = ../../Include/InputGeom.h; sourceTree = SOURCE_ROOT; }; + 6BB7FDA410F36F0E006DA0A6 /* InputGeom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = InputGeom.cpp; path = ../../Source/InputGeom.cpp; sourceTree = SOURCE_ROOT; }; + 6BB93C7710CFE1D500F74F2B /* DebugDraw.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DebugDraw.h; path = ../../../DebugUtils/Include/DebugDraw.h; sourceTree = SOURCE_ROOT; }; + 6BB93C7810CFE1D500F74F2B /* DetourDebugDraw.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DetourDebugDraw.h; path = ../../../DebugUtils/Include/DetourDebugDraw.h; sourceTree = SOURCE_ROOT; }; + 6BB93C7910CFE1D500F74F2B /* RecastDebugDraw.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RecastDebugDraw.h; path = ../../../DebugUtils/Include/RecastDebugDraw.h; sourceTree = SOURCE_ROOT; }; + 6BB93C7A10CFE1D500F74F2B /* DebugDraw.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = DebugDraw.cpp; path = ../../../DebugUtils/Source/DebugDraw.cpp; sourceTree = SOURCE_ROOT; }; + 6BB93C7B10CFE1D500F74F2B /* DetourDebugDraw.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = DetourDebugDraw.cpp; path = ../../../DebugUtils/Source/DetourDebugDraw.cpp; sourceTree = SOURCE_ROOT; }; + 6BB93C7C10CFE1D500F74F2B /* RecastDebugDraw.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = RecastDebugDraw.cpp; path = ../../../DebugUtils/Source/RecastDebugDraw.cpp; sourceTree = SOURCE_ROOT; }; + 6BB93CF410CFEC4500F74F2B /* RecastDump.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RecastDump.h; path = ../../../DebugUtils/Include/RecastDump.h; sourceTree = SOURCE_ROOT; }; + 6BB93CF510CFEC4500F74F2B /* RecastDump.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = RecastDump.cpp; path = ../../../DebugUtils/Source/RecastDump.cpp; sourceTree = SOURCE_ROOT; }; + 6BCF32341104CD05009445BF /* OffMeshConnectionTool.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OffMeshConnectionTool.h; path = ../../Include/OffMeshConnectionTool.h; sourceTree = SOURCE_ROOT; }; + 6BCF32351104CD05009445BF /* OffMeshConnectionTool.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = OffMeshConnectionTool.cpp; path = ../../Source/OffMeshConnectionTool.cpp; sourceTree = SOURCE_ROOT; }; + 6BD401FF1224278800995864 /* PerfTimer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PerfTimer.h; path = ../../Include/PerfTimer.h; sourceTree = SOURCE_ROOT; }; + 6BD402001224279400995864 /* PerfTimer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = PerfTimer.cpp; path = ../../Source/PerfTimer.cpp; sourceTree = SOURCE_ROOT; }; + 6BD667D8123D27EC0021A7A4 /* CrowdManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CrowdManager.h; path = ../../Include/CrowdManager.h; sourceTree = SOURCE_ROOT; }; + 6BD667D9123D28100021A7A4 /* CrowdManager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CrowdManager.cpp; path = ../../Source/CrowdManager.cpp; sourceTree = SOURCE_ROOT; }; + 6BF5F23911747606000502A6 /* Filelist.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Filelist.cpp; path = ../../Source/Filelist.cpp; sourceTree = SOURCE_ROOT; }; + 6BF5F23C11747614000502A6 /* Filelist.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Filelist.h; path = ../../Include/Filelist.h; sourceTree = SOURCE_ROOT; }; + 6BF5F23E1174763B000502A6 /* SlideShow.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SlideShow.h; path = ../../Include/SlideShow.h; sourceTree = SOURCE_ROOT; }; + 6BF5F23F1174763B000502A6 /* SlideShow.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SlideShow.cpp; path = ../../Source/SlideShow.cpp; sourceTree = SOURCE_ROOT; }; + 6BF5F2C511747E9F000502A6 /* stb_image.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = stb_image.h; path = ../../Contrib/stb_image.h; sourceTree = SOURCE_ROOT; }; + 6BF7C13E11119520002B3F46 /* TestCase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = TestCase.h; path = ../../Include/TestCase.h; sourceTree = SOURCE_ROOT; }; + 6BF7C13F1111953A002B3F46 /* TestCase.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = TestCase.cpp; path = ../../Source/TestCase.cpp; sourceTree = SOURCE_ROOT; }; + 6BF7C4531115C277002B3F46 /* RecastArea.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = RecastArea.cpp; path = ../../../Recast/Source/RecastArea.cpp; sourceTree = SOURCE_ROOT; }; + 8D1107310486CEB800E47090 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 8D1107320486CEB800E47090 /* Recast.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Recast.app; sourceTree = BUILT_PRODUCTS_DIR; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 8D11072E0486CEB800E47090 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 8D11072F0486CEB800E47090 /* Cocoa.framework in Frameworks */, + 6B8632DA0F78122C00E2684A /* SDL.framework in Frameworks */, + 6B8632DC0F78123E00E2684A /* OpenGL.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 080E96DDFE201D6D7F000001 /* Classes */ = { + isa = PBXGroup; + children = ( + 6BB93C7610CFE1BD00F74F2B /* DebugUtils */, + 6BDD9E030F91110C00904EEF /* Detour */, + 6B137C7D0F7FCBE800459200 /* Recast */, + 6B555DF5100B25FC00247EA3 /* Samples */, + 6BB7FE8E10F4A175006DA0A6 /* Tools */, + 6B25B6180FFA62BE004F1BC4 /* main.cpp */, + 6BD667D8123D27EC0021A7A4 /* CrowdManager.h */, + 6BD667D9123D28100021A7A4 /* CrowdManager.cpp */, + 6BAF4440121C3D0A008CFCDF /* SampleInterfaces.h */, + 6BAF4441121C3D26008CFCDF /* SampleInterfaces.cpp */, + 6BF5F2C511747E9F000502A6 /* stb_image.h */, + 6BF5F23E1174763B000502A6 /* SlideShow.h */, + 6BF5F23F1174763B000502A6 /* SlideShow.cpp */, + 6BF5F23C11747614000502A6 /* Filelist.h */, + 6BF5F23911747606000502A6 /* Filelist.cpp */, + 6B555DF6100B273500247EA3 /* stb_truetype.h */, + 6B137C7A0F7FCBE400459200 /* imgui.h */, + 6B137C6C0F7FCBBB00459200 /* imgui.cpp */, + 6B555DAE100B211D00247EA3 /* imguiRenderGL.h */, + 6B555DB0100B212E00247EA3 /* imguiRenderGL.cpp */, + 6B137C7B0F7FCBE400459200 /* MeshLoaderObj.h */, + 6B137C6D0F7FCBBB00459200 /* MeshLoaderObj.cpp */, + 6BB788180FC04753003C24DB /* ChunkyTriMesh.h */, + 6BB788160FC0472B003C24DB /* ChunkyTriMesh.cpp */, + 6B137C7C0F7FCBE400459200 /* SDLMain.h */, + 6B137C6E0F7FCBBB00459200 /* SDLMain.m */, + 6BB7FDA310F36EFC006DA0A6 /* InputGeom.h */, + 6BB7FDA410F36F0E006DA0A6 /* InputGeom.cpp */, + 6BF7C13E11119520002B3F46 /* TestCase.h */, + 6BF7C13F1111953A002B3F46 /* TestCase.cpp */, + 6BD401FF1224278800995864 /* PerfTimer.h */, + 6BD402001224279400995864 /* PerfTimer.cpp */, + 6B847774122D220D00ADF63D /* ValueHistory.h */, + 6B847776122D221C00ADF63D /* ValueHistory.cpp */, + ); + name = Classes; + sourceTree = ""; + }; + 1058C7A0FEA54F0111CA2CBB /* Linked Frameworks */ = { + isa = PBXGroup; + children = ( + 6B8632D90F78122C00E2684A /* SDL.framework */, + 6B8632DB0F78123E00E2684A /* OpenGL.framework */, + 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */, + ); + name = "Linked Frameworks"; + sourceTree = ""; + }; + 1058C7A2FEA54F0111CA2CBB /* Other Frameworks */ = { + isa = PBXGroup; + children = ( + 29B97324FDCFA39411CA2CEA /* AppKit.framework */, + 13E42FB307B3F0F600E4EEF1 /* CoreData.framework */, + 29B97325FDCFA39411CA2CEA /* Foundation.framework */, + ); + name = "Other Frameworks"; + sourceTree = ""; + }; + 19C28FACFE9D520D11CA2CBB /* Products */ = { + isa = PBXGroup; + children = ( + 8D1107320486CEB800E47090 /* Recast.app */, + ); + name = Products; + sourceTree = ""; + }; + 29B97314FDCFA39411CA2CEA /* Recast */ = { + isa = PBXGroup; + children = ( + 080E96DDFE201D6D7F000001 /* Classes */, + 29B97315FDCFA39411CA2CEA /* Other Sources */, + 29B97317FDCFA39411CA2CEA /* Resources */, + 29B97323FDCFA39411CA2CEA /* Frameworks */, + 19C28FACFE9D520D11CA2CBB /* Products */, + ); + name = Recast; + sourceTree = ""; + }; + 29B97315FDCFA39411CA2CEA /* Other Sources */ = { + isa = PBXGroup; + children = ( + 32CA4F630368D1EE00C91783 /* Recast_Prefix.pch */, + ); + name = "Other Sources"; + sourceTree = ""; + }; + 29B97317FDCFA39411CA2CEA /* Resources */ = { + isa = PBXGroup; + children = ( + 6B024C0C10060AC600CF7107 /* Icon.icns */, + 8D1107310486CEB800E47090 /* Info.plist */, + 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */, + 1DDD58140DA1D0A300B32029 /* MainMenu.xib */, + ); + name = Resources; + sourceTree = ""; + }; + 29B97323FDCFA39411CA2CEA /* Frameworks */ = { + isa = PBXGroup; + children = ( + 1058C7A0FEA54F0111CA2CBB /* Linked Frameworks */, + 1058C7A2FEA54F0111CA2CBB /* Other Frameworks */, + ); + name = Frameworks; + sourceTree = ""; + }; + 6B137C7D0F7FCBE800459200 /* Recast */ = { + isa = PBXGroup; + children = ( + 6BAF4561121D173A008CFCDF /* RecastAssert.h */, + 6B137C7E0F7FCBFE00459200 /* Recast.h */, + 6B137C820F7FCC1100459200 /* Recast.cpp */, + 6B137C880F7FCC1100459200 /* RecastRasterization.cpp */, + 6B137C850F7FCC1100459200 /* RecastFilter.cpp */, + 6BF7C4531115C277002B3F46 /* RecastArea.cpp */, + 6B137C890F7FCC1100459200 /* RecastRegion.cpp */, + 6B137C830F7FCC1100459200 /* RecastContour.cpp */, + 6B137C870F7FCC1100459200 /* RecastMesh.cpp */, + 6B624169103434880002E346 /* RecastMeshDetail.cpp */, + 6B98470511E733B600FA177B /* RecastAlloc.h */, + 6B9847B711E7519A00FA177B /* RecastAlloc.cpp */, + ); + name = Recast; + sourceTree = ""; + }; + 6B555DF5100B25FC00247EA3 /* Samples */ = { + isa = PBXGroup; + children = ( + 6B25B6100FFA62AD004F1BC4 /* Sample.h */, + 6B25B6140FFA62BE004F1BC4 /* Sample.cpp */, + 6BA1E88E10C7BFD3008007F6 /* Sample_SoloMeshSimple.h */, + 6BA1E88810C7BFC9008007F6 /* Sample_SoloMeshSimple.cpp */, + 6B98463111E6144400FA177B /* Sample_SoloMeshTiled.h */, + 6B98463211E6144400FA177B /* Sample_SoloMeshTiled.cpp */, + 6B2AEC510FFB8946005BE9CC /* Sample_TileMesh.h */, + 6B2AEC520FFB8958005BE9CC /* Sample_TileMesh.cpp */, + 6B8036AC113BAABE005ED67B /* Sample_Debug.h */, + 6B8036AD113BAABE005ED67B /* Sample_Debug.cpp */, + ); + name = Samples; + sourceTree = ""; + }; + 6BB7FE8E10F4A175006DA0A6 /* Tools */ = { + isa = PBXGroup; + children = ( + 6BAF3C571211663A008CFCDF /* CrowdTool.h */, + 6BAF3C581211663A008CFCDF /* CrowdTool.cpp */, + 6B324C64111C5D9A00EBD2FD /* ConvexVolumeTool.h */, + 6B324C65111C5D9A00EBD2FD /* ConvexVolumeTool.cpp */, + 6BCF32341104CD05009445BF /* OffMeshConnectionTool.h */, + 6BCF32351104CD05009445BF /* OffMeshConnectionTool.cpp */, + 6BB7FC0910EBB6AA006DA0A6 /* NavMeshTesterTool.h */, + 6BB7FC0A10EBB6AA006DA0A6 /* NavMeshTesterTool.cpp */, + ); + name = Tools; + sourceTree = ""; + }; + 6BB93C7610CFE1BD00F74F2B /* DebugUtils */ = { + isa = PBXGroup; + children = ( + 6BB93CF410CFEC4500F74F2B /* RecastDump.h */, + 6BB93CF510CFEC4500F74F2B /* RecastDump.cpp */, + 6BB93C7710CFE1D500F74F2B /* DebugDraw.h */, + 6BB93C7A10CFE1D500F74F2B /* DebugDraw.cpp */, + 6BB93C7910CFE1D500F74F2B /* RecastDebugDraw.h */, + 6BB93C7C10CFE1D500F74F2B /* RecastDebugDraw.cpp */, + 6BB93C7810CFE1D500F74F2B /* DetourDebugDraw.h */, + 6BB93C7B10CFE1D500F74F2B /* DetourDebugDraw.cpp */, + ); + name = DebugUtils; + sourceTree = ""; + }; + 6BDD9E030F91110C00904EEF /* Detour */ = { + isa = PBXGroup; + children = ( + 6BAF427A121ADCC2008CFCDF /* DetourAssert.h */, + 6B9846ED11E718F800FA177B /* DetourAlloc.h */, + 6B9846EE11E718F800FA177B /* DetourAlloc.cpp */, + 6B8DE88B10B69E4C00DF20FB /* DetourNavMesh.h */, + 6B8DE88710B69E3E00DF20FB /* DetourNavMesh.cpp */, + 6BAF40D912196A25008CFCDF /* DetourNavMeshQuery.h */, + 6BAF40DA12196A3D008CFCDF /* DetourNavMeshQuery.cpp */, + 6B8DE88C10B69E4C00DF20FB /* DetourNavMeshBuilder.h */, + 6B8DE88810B69E3E00DF20FB /* DetourNavMeshBuilder.cpp */, + 6B1185F61006896B0018F96F /* DetourNode.h */, + 6B1185F41006895B0018F96F /* DetourNode.cpp */, + 6B1185FC10068B040018F96F /* DetourCommon.h */, + 6B1185FD10068B150018F96F /* DetourCommon.cpp */, + 6B9EFF02122819E200535FF1 /* DetourObstacleAvoidance.h */, + 6B9EFF0812281C3E00535FF1 /* DetourObstacleAvoidance.cpp */, + ); + name = Detour; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 8D1107260486CEB800E47090 /* Recast */ = { + isa = PBXNativeTarget; + buildConfigurationList = C01FCF4A08A954540054247B /* Build configuration list for PBXNativeTarget "Recast" */; + buildPhases = ( + 8D1107290486CEB800E47090 /* Resources */, + 8D11072C0486CEB800E47090 /* Sources */, + 8D11072E0486CEB800E47090 /* Frameworks */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = Recast; + productInstallPath = "$(HOME)/Applications"; + productName = Recast; + productReference = 8D1107320486CEB800E47090 /* Recast.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 29B97313FDCFA39411CA2CEA /* Project object */ = { + isa = PBXProject; + buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "Recast" */; + compatibilityVersion = "Xcode 3.1"; + hasScannedForEncodings = 1; + mainGroup = 29B97314FDCFA39411CA2CEA /* Recast */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 8D1107260486CEB800E47090 /* Recast */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 8D1107290486CEB800E47090 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 8D11072B0486CEB800E47090 /* InfoPlist.strings in Resources */, + 1DDD58160DA1D0A300B32029 /* MainMenu.xib in Resources */, + 6B024C0D10060AC600CF7107 /* Icon.icns in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 8D11072C0486CEB800E47090 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 6B137C710F7FCBBB00459200 /* imgui.cpp in Sources */, + 6B137C720F7FCBBB00459200 /* MeshLoaderObj.cpp in Sources */, + 6B137C730F7FCBBB00459200 /* SDLMain.m in Sources */, + 6B137C8B0F7FCC1100459200 /* Recast.cpp in Sources */, + 6B137C8C0F7FCC1100459200 /* RecastContour.cpp in Sources */, + 6B137C8E0F7FCC1100459200 /* RecastFilter.cpp in Sources */, + 6B137C900F7FCC1100459200 /* RecastMesh.cpp in Sources */, + 6B137C910F7FCC1100459200 /* RecastRasterization.cpp in Sources */, + 6B137C920F7FCC1100459200 /* RecastRegion.cpp in Sources */, + 6BB788170FC0472B003C24DB /* ChunkyTriMesh.cpp in Sources */, + 6B25B6190FFA62BE004F1BC4 /* Sample.cpp in Sources */, + 6B25B61D0FFA62BE004F1BC4 /* main.cpp in Sources */, + 6B2AEC530FFB8958005BE9CC /* Sample_TileMesh.cpp in Sources */, + 6B1185F51006895B0018F96F /* DetourNode.cpp in Sources */, + 6B1185FE10068B150018F96F /* DetourCommon.cpp in Sources */, + 6B555DB1100B212E00247EA3 /* imguiRenderGL.cpp in Sources */, + 6B62416A103434880002E346 /* RecastMeshDetail.cpp in Sources */, + 6B8DE88910B69E3E00DF20FB /* DetourNavMesh.cpp in Sources */, + 6B8DE88A10B69E3E00DF20FB /* DetourNavMeshBuilder.cpp in Sources */, + 6BA1E88B10C7BFC9008007F6 /* Sample_SoloMeshSimple.cpp in Sources */, + 6BB93C7D10CFE1D500F74F2B /* DebugDraw.cpp in Sources */, + 6BB93C7E10CFE1D500F74F2B /* DetourDebugDraw.cpp in Sources */, + 6BB93C7F10CFE1D500F74F2B /* RecastDebugDraw.cpp in Sources */, + 6BB93CF610CFEC4500F74F2B /* RecastDump.cpp in Sources */, + 6BB7FC0B10EBB6AA006DA0A6 /* NavMeshTesterTool.cpp in Sources */, + 6BB7FDA510F36F0E006DA0A6 /* InputGeom.cpp in Sources */, + 6BCF32361104CD05009445BF /* OffMeshConnectionTool.cpp in Sources */, + 6BF7C1401111953A002B3F46 /* TestCase.cpp in Sources */, + 6BF7C4541115C277002B3F46 /* RecastArea.cpp in Sources */, + 6B324C66111C5D9A00EBD2FD /* ConvexVolumeTool.cpp in Sources */, + 6B8036AE113BAABE005ED67B /* Sample_Debug.cpp in Sources */, + 6BF5F23A11747606000502A6 /* Filelist.cpp in Sources */, + 6BF5F2401174763B000502A6 /* SlideShow.cpp in Sources */, + 6B98463311E6144400FA177B /* Sample_SoloMeshTiled.cpp in Sources */, + 6B9846EF11E718F800FA177B /* DetourAlloc.cpp in Sources */, + 6B9847B811E7519A00FA177B /* RecastAlloc.cpp in Sources */, + 6BAF3C591211663A008CFCDF /* CrowdTool.cpp in Sources */, + 6BAF40DB12196A3D008CFCDF /* DetourNavMeshQuery.cpp in Sources */, + 6BAF4442121C3D26008CFCDF /* SampleInterfaces.cpp in Sources */, + 6BD402011224279400995864 /* PerfTimer.cpp in Sources */, + 6B9EFF0912281C3E00535FF1 /* DetourObstacleAvoidance.cpp in Sources */, + 6B847777122D221D00ADF63D /* ValueHistory.cpp in Sources */, + 6BD667DA123D28100021A7A4 /* CrowdManager.cpp in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXVariantGroup section */ + 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + 089C165DFE840E0CC02AAC07 /* English */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; + 1DDD58140DA1D0A300B32029 /* MainMenu.xib */ = { + isa = PBXVariantGroup; + children = ( + 1DDD58150DA1D0A300B32029 /* English */, + ); + name = MainMenu.xib; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + C01FCF4B08A954540054247B /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CONFIGURATION_BUILD_DIR = ../../Bin; + COPY_PHASE_STRIP = NO; + GCC_DYNAMIC_NO_PIC = NO; + GCC_ENABLE_FIX_AND_CONTINUE = YES; + GCC_MODEL_TUNING = G5; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = Recast_Prefix.pch; + GCC_VERSION = 4.2; + HEADER_SEARCH_PATHS = "/Library/Frameworks/SDL.framework/Headers/**"; + INFOPLIST_FILE = Info.plist; + INSTALL_PATH = "$(HOME)/Applications"; + OTHER_CPLUSPLUSFLAGS = ( + "$(OTHER_CFLAGS)", + "-Wreorder", + "-Wsign-compare", + "-Wall", + ); + PRODUCT_NAME = Recast; + USER_HEADER_SEARCH_PATHS = ""; + }; + name = Debug; + }; + C01FCF4C08A954540054247B /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ARCHS = "$(ARCHS_STANDARD_32_BIT)"; + CONFIGURATION_BUILD_DIR = ../../Bin; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + GCC_MODEL_TUNING = G5; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = Recast_Prefix.pch; + GCC_VERSION = 4.2; + HEADER_SEARCH_PATHS = "/Library/Frameworks/SDL.framework/Headers/**"; + INFOPLIST_FILE = Info.plist; + INSTALL_PATH = "$(HOME)/Applications"; + OTHER_CFLAGS = ""; + OTHER_CPLUSPLUSFLAGS = ( + "$(OTHER_CFLAGS)", + "-Wreorder", + "-Wsign-compare", + "-Wall", + ); + PRODUCT_NAME = Recast; + USER_HEADER_SEARCH_PATHS = ""; + }; + name = Release; + }; + C01FCF4F08A954540054247B /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ARCHS = "$(ARCHS_STANDARD_32_BIT)"; + GCC_C_LANGUAGE_STANDARD = c99; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + ONLY_ACTIVE_ARCH = YES; + PREBINDING = NO; + SDKROOT = macosx10.5; + }; + name = Debug; + }; + C01FCF5008A954540054247B /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ARCHS = "$(ARCHS_STANDARD_32_BIT)"; + GCC_C_LANGUAGE_STANDARD = c99; + GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + PREBINDING = NO; + SDKROOT = macosx10.5; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + C01FCF4A08A954540054247B /* Build configuration list for PBXNativeTarget "Recast" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + C01FCF4B08A954540054247B /* Debug */, + C01FCF4C08A954540054247B /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + C01FCF4E08A954540054247B /* Build configuration list for PBXProject "Recast" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + C01FCF4F08A954540054247B /* Debug */, + C01FCF5008A954540054247B /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 29B97313FDCFA39411CA2CEA /* Project object */; +} diff --git a/dep/recastnavigation/RecastDemo/Build/Xcode/Recast_Prefix.pch b/dep/recastnavigation/RecastDemo/Build/Xcode/Recast_Prefix.pch new file mode 100644 index 000000000..3b101c238 --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Build/Xcode/Recast_Prefix.pch @@ -0,0 +1,7 @@ +// +// Prefix header for all source files of the 'Recast' target in the 'Recast' project +// + +#ifdef __OBJC__ + #import +#endif diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/BUGS b/dep/recastnavigation/RecastDemo/Contrib/SDL/BUGS new file mode 100644 index 000000000..218bf3d15 --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/BUGS @@ -0,0 +1,18 @@ + +Bugs are now managed in the SDL bug tracker, here: + + http://bugzilla.libsdl.org/ + +You may report bugs there, and search to see if a given issue has already + been reported, discussed, and maybe even fixed. + + + +You may also find help at the SDL mailing list. Subscription information: + + http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org + +Bug reports are welcome here, but we really appreciate if you use Bugzilla, as + bugs discussed on the mailing list may be forgotten or missed. + + diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/COPYING b/dep/recastnavigation/RecastDemo/Contrib/SDL/COPYING new file mode 100644 index 000000000..2cba2ac74 --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/COPYING @@ -0,0 +1,458 @@ + GNU LESSER GENERAL PUBLIC LICENSE + Version 2.1, February 1999 + + Copyright (C) 1991, 1999 Free Software Foundation, Inc. + 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + +[This is the first released version of the Lesser GPL. It also counts + as the successor of the GNU Library Public License, version 2, hence + the version number 2.1.] + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +Licenses are intended to guarantee your freedom to share and change +free software--to make sure the software is free for all its users. + + This license, the Lesser General Public License, applies to some +specially designated software packages--typically libraries--of the +Free Software Foundation and other authors who decide to use it. You +can use it too, but we suggest you first think carefully about whether +this license or the ordinary General Public License is the better +strategy to use in any particular case, based on the explanations below. + + When we speak of free software, we are referring to freedom of use, +not price. Our General Public Licenses are designed to make sure that +you have the freedom to distribute copies of free software (and charge +for this service if you wish); that you receive source code or can get +it if you want it; that you can change the software and use pieces of +it in new free programs; and that you are informed that you can do +these things. + + To protect your rights, we need to make restrictions that forbid +distributors to deny you these rights or to ask you to surrender these +rights. These restrictions translate to certain responsibilities for +you if you distribute copies of the library or if you modify it. + + For example, if you distribute copies of the library, whether gratis +or for a fee, you must give the recipients all the rights that we gave +you. You must make sure that they, too, receive or can get the source +code. If you link other code with the library, you must provide +complete object files to the recipients, so that they can relink them +with the library after making changes to the library and recompiling +it. And you must show them these terms so they know their rights. + + We protect your rights with a two-step method: (1) we copyright the +library, and (2) we offer you this license, which gives you legal +permission to copy, distribute and/or modify the library. + + To protect each distributor, we want to make it very clear that +there is no warranty for the free library. Also, if the library is +modified by someone else and passed on, the recipients should know +that what they have is not the original version, so that the original +author's reputation will not be affected by problems that might be +introduced by others. + + Finally, software patents pose a constant threat to the existence of +any free program. We wish to make sure that a company cannot +effectively restrict the users of a free program by obtaining a +restrictive license from a patent holder. Therefore, we insist that +any patent license obtained for a version of the library must be +consistent with the full freedom of use specified in this license. + + Most GNU software, including some libraries, is covered by the +ordinary GNU General Public License. This license, the GNU Lesser +General Public License, applies to certain designated libraries, and +is quite different from the ordinary General Public License. We use +this license for certain libraries in order to permit linking those +libraries into non-free programs. + + When a program is linked with a library, whether statically or using +a shared library, the combination of the two is legally speaking a +combined work, a derivative of the original library. The ordinary +General Public License therefore permits such linking only if the +entire combination fits its criteria of freedom. The Lesser General +Public License permits more lax criteria for linking other code with +the library. + + We call this license the "Lesser" General Public License because it +does Less to protect the user's freedom than the ordinary General +Public License. It also provides other free software developers Less +of an advantage over competing non-free programs. These disadvantages +are the reason we use the ordinary General Public License for many +libraries. However, the Lesser license provides advantages in certain +special circumstances. + + For example, on rare occasions, there may be a special need to +encourage the widest possible use of a certain library, so that it becomes +a de-facto standard. To achieve this, non-free programs must be +allowed to use the library. A more frequent case is that a free +library does the same job as widely used non-free libraries. In this +case, there is little to gain by limiting the free library to free +software only, so we use the Lesser General Public License. + + In other cases, permission to use a particular library in non-free +programs enables a greater number of people to use a large body of +free software. For example, permission to use the GNU C Library in +non-free programs enables many more people to use the whole GNU +operating system, as well as its variant, the GNU/Linux operating +system. + + Although the Lesser General Public License is Less protective of the +users' freedom, it does ensure that the user of a program that is +linked with the Library has the freedom and the wherewithal to run +that program using a modified version of the Library. + + The precise terms and conditions for copying, distribution and +modification follow. Pay close attention to the difference between a +"work based on the library" and a "work that uses the library". The +former contains code derived from the library, whereas the latter must +be combined with the library in order to run. + + GNU LESSER GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License Agreement applies to any software library or other +program which contains a notice placed by the copyright holder or +other authorized party saying it may be distributed under the terms of +this Lesser General Public License (also called "this License"). +Each licensee is addressed as "you". + + A "library" means a collection of software functions and/or data +prepared so as to be conveniently linked with application programs +(which use some of those functions and data) to form executables. + + The "Library", below, refers to any such software library or work +which has been distributed under these terms. A "work based on the +Library" means either the Library or any derivative work under +copyright law: that is to say, a work containing the Library or a +portion of it, either verbatim or with modifications and/or translated +straightforwardly into another language. (Hereinafter, translation is +included without limitation in the term "modification".) + + "Source code" for a work means the preferred form of the work for +making modifications to it. For a library, complete source code means +all the source code for all modules it contains, plus any associated +interface definition files, plus the scripts used to control compilation +and installation of the library. + + Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running a program using the Library is not restricted, and output from +such a program is covered only if its contents constitute a work based +on the Library (independent of the use of the Library in a tool for +writing it). Whether that is true depends on what the Library does +and what the program that uses the Library does. + + 1. You may copy and distribute verbatim copies of the Library's +complete source code as you receive it, in any medium, provided that +you conspicuously and appropriately publish on each copy an +appropriate copyright notice and disclaimer of warranty; keep intact +all the notices that refer to this License and to the absence of any +warranty; and distribute a copy of this License along with the +Library. + + You may charge a fee for the physical act of transferring a copy, +and you may at your option offer warranty protection in exchange for a +fee. + + 2. You may modify your copy or copies of the Library or any portion +of it, thus forming a work based on the Library, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) The modified work must itself be a software library. + + b) You must cause the files modified to carry prominent notices + stating that you changed the files and the date of any change. + + c) You must cause the whole of the work to be licensed at no + charge to all third parties under the terms of this License. + + d) If a facility in the modified Library refers to a function or a + table of data to be supplied by an application program that uses + the facility, other than as an argument passed when the facility + is invoked, then you must make a good faith effort to ensure that, + in the event an application does not supply such function or + table, the facility still operates, and performs whatever part of + its purpose remains meaningful. + + (For example, a function in a library to compute square roots has + a purpose that is entirely well-defined independent of the + application. Therefore, Subsection 2d requires that any + application-supplied function or table used by this function must + be optional: if the application does not supply it, the square + root function must still compute square roots.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Library, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Library, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote +it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Library. + +In addition, mere aggregation of another work not based on the Library +with the Library (or with a work based on the Library) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may opt to apply the terms of the ordinary GNU General Public +License instead of this License to a given copy of the Library. To do +this, you must alter all the notices that refer to this License, so +that they refer to the ordinary GNU General Public License, version 2, +instead of to this License. (If a newer version than version 2 of the +ordinary GNU General Public License has appeared, then you can specify +that version instead if you wish.) Do not make any other change in +these notices. + + Once this change is made in a given copy, it is irreversible for +that copy, so the ordinary GNU General Public License applies to all +subsequent copies and derivative works made from that copy. + + This option is useful when you wish to copy part of the code of +the Library into a program that is not a library. + + 4. You may copy and distribute the Library (or a portion or +derivative of it, under Section 2) in object code or executable form +under the terms of Sections 1 and 2 above provided that you accompany +it with the complete corresponding machine-readable source code, which +must be distributed under the terms of Sections 1 and 2 above on a +medium customarily used for software interchange. + + If distribution of object code is made by offering access to copy +from a designated place, then offering equivalent access to copy the +source code from the same place satisfies the requirement to +distribute the source code, even though third parties are not +compelled to copy the source along with the object code. + + 5. A program that contains no derivative of any portion of the +Library, but is designed to work with the Library by being compiled or +linked with it, is called a "work that uses the Library". Such a +work, in isolation, is not a derivative work of the Library, and +therefore falls outside the scope of this License. + + However, linking a "work that uses the Library" with the Library +creates an executable that is a derivative of the Library (because it +contains portions of the Library), rather than a "work that uses the +library". The executable is therefore covered by this License. +Section 6 states terms for distribution of such executables. + + When a "work that uses the Library" uses material from a header file +that is part of the Library, the object code for the work may be a +derivative work of the Library even though the source code is not. +Whether this is true is especially significant if the work can be +linked without the Library, or if the work is itself a library. The +threshold for this to be true is not precisely defined by law. + + If such an object file uses only numerical parameters, data +structure layouts and accessors, and small macros and small inline +functions (ten lines or less in length), then the use of the object +file is unrestricted, regardless of whether it is legally a derivative +work. (Executables containing this object code plus portions of the +Library will still fall under Section 6.) + + Otherwise, if the work is a derivative of the Library, you may +distribute the object code for the work under the terms of Section 6. +Any executables containing that work also fall under Section 6, +whether or not they are linked directly with the Library itself. + + 6. As an exception to the Sections above, you may also combine or +link a "work that uses the Library" with the Library to produce a +work containing portions of the Library, and distribute that work +under terms of your choice, provided that the terms permit +modification of the work for the customer's own use and reverse +engineering for debugging such modifications. + + You must give prominent notice with each copy of the work that the +Library is used in it and that the Library and its use are covered by +this License. You must supply a copy of this License. If the work +during execution displays copyright notices, you must include the +copyright notice for the Library among them, as well as a reference +directing the user to the copy of this License. Also, you must do one +of these things: + + a) Accompany the work with the complete corresponding + machine-readable source code for the Library including whatever + changes were used in the work (which must be distributed under + Sections 1 and 2 above); and, if the work is an executable linked + with the Library, with the complete machine-readable "work that + uses the Library", as object code and/or source code, so that the + user can modify the Library and then relink to produce a modified + executable containing the modified Library. (It is understood + that the user who changes the contents of definitions files in the + Library will not necessarily be able to recompile the application + to use the modified definitions.) + + b) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (1) uses at run time a + copy of the library already present on the user's computer system, + rather than copying library functions into the executable, and (2) + will operate properly with a modified version of the library, if + the user installs one, as long as the modified version is + interface-compatible with the version that the work was made with. + + c) Accompany the work with a written offer, valid for at + least three years, to give the same user the materials + specified in Subsection 6a, above, for a charge no more + than the cost of performing this distribution. + + d) If distribution of the work is made by offering access to copy + from a designated place, offer equivalent access to copy the above + specified materials from the same place. + + e) Verify that the user has already received a copy of these + materials or that you have already sent this user a copy. + + For an executable, the required form of the "work that uses the +Library" must include any data and utility programs needed for +reproducing the executable from it. However, as a special exception, +the materials to be distributed need not include anything that is +normally distributed (in either source or binary form) with the major +components (compiler, kernel, and so on) of the operating system on +which the executable runs, unless that component itself accompanies +the executable. + + It may happen that this requirement contradicts the license +restrictions of other proprietary libraries that do not normally +accompany the operating system. Such a contradiction means you cannot +use both them and the Library together in an executable that you +distribute. + + 7. You may place library facilities that are a work based on the +Library side-by-side in a single library together with other library +facilities not covered by this License, and distribute such a combined +library, provided that the separate distribution of the work based on +the Library and of the other library facilities is otherwise +permitted, and provided that you do these two things: + + a) Accompany the combined library with a copy of the same work + based on the Library, uncombined with any other library + facilities. This must be distributed under the terms of the + Sections above. + + b) Give prominent notice with the combined library of the fact + that part of it is a work based on the Library, and explaining + where to find the accompanying uncombined form of the same work. + + 8. You may not copy, modify, sublicense, link with, or distribute +the Library except as expressly provided under this License. Any +attempt otherwise to copy, modify, sublicense, link with, or +distribute the Library is void, and will automatically terminate your +rights under this License. However, parties who have received copies, +or rights, from you under this License will not have their licenses +terminated so long as such parties remain in full compliance. + + 9. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Library or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Library (or any work based on the +Library), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Library or works based on it. + + 10. Each time you redistribute the Library (or any work based on the +Library), the recipient automatically receives a license from the +original licensor to copy, distribute, link with or modify the Library +subject to these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties with +this License. + + 11. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Library at all. For example, if a patent +license would not permit royalty-free redistribution of the Library by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Library. + +If any portion of this section is held invalid or unenforceable under any +particular circumstance, the balance of the section is intended to apply, +and the section as a whole is intended to apply in other circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 12. If the distribution and/or use of the Library is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Library under this License may add +an explicit geographical distribution limitation excluding those countries, +so that distribution is permitted only in or among countries not thus +excluded. In such case, this License incorporates the limitation as if +written in the body of this License. + + 13. The Free Software Foundation may publish revised and/or new +versions of the Lesser General Public License from time to time. +Such new versions will be similar in spirit to the present version, +but may differ in detail to address new problems or concerns. + +Each version is given a distinguishing version number. If the Library +specifies a version number of this License which applies to it and +"any later version", you have the option of following the terms and +conditions either of that version or of any later version published by +the Free Software Foundation. If the Library does not specify a +license version number, you may choose any version ever published by +the Free Software Foundation. + + 14. If you wish to incorporate parts of the Library into other free +programs whose distribution conditions are incompatible with these, +write to the author to ask for permission. For software which is +copyrighted by the Free Software Foundation, write to the Free +Software Foundation; we sometimes make exceptions for this. Our +decision will be guided by the two goals of preserving the free status +of all derivatives of our free software and of promoting the sharing +and reuse of software generally. + + NO WARRANTY + + 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO +WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. +EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR +OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY +KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE +LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME +THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN +WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY +AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU +FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR +CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE +LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING +RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A +FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF +SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGES. + + END OF TERMS AND CONDITIONS diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/README b/dep/recastnavigation/RecastDemo/Contrib/SDL/README new file mode 100644 index 000000000..7c0dd5890 --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/README @@ -0,0 +1,49 @@ + + Simple DirectMedia Layer + + (SDL) + + Version 1.2 + +--- +http://www.libsdl.org/ + +This is the Simple DirectMedia Layer, a general API that provides low +level access to audio, keyboard, mouse, joystick, 3D hardware via OpenGL, +and 2D framebuffer across multiple platforms. + +The current version supports Linux, Windows CE/95/98/ME/XP/Vista, BeOS, +MacOS Classic, Mac OS X, FreeBSD, NetBSD, OpenBSD, BSD/OS, Solaris, IRIX, +and QNX. The code contains support for Dreamcast, Atari, AIX, OSF/Tru64, +RISC OS, SymbianOS, Nintendo DS, and OS/2, but these are not officially +supported. + +SDL is written in C, but works with C++ natively, and has bindings to +several other languages, including Ada, C#, Eiffel, Erlang, Euphoria, +Guile, Haskell, Java, Lisp, Lua, ML, Objective C, Pascal, Perl, PHP, +Pike, Pliant, Python, Ruby, and Smalltalk. + +This library is distributed under GNU LGPL version 2, which can be +found in the file "COPYING". This license allows you to use SDL +freely in commercial programs as long as you link with the dynamic +library. + +The best way to learn how to use SDL is to check out the header files in +the "include" subdirectory and the programs in the "test" subdirectory. +The header files and test programs are well commented and always up to date. +More documentation is available in HTML format in "docs/index.html", and +a documentation wiki is available online at: + http://www.libsdl.org/cgi/docwiki.cgi + +The test programs in the "test" subdirectory are in the public domain. + +Frequently asked questions are answered online: + http://www.libsdl.org/faq.php + +If you need help with the library, or just want to discuss SDL related +issues, you can join the developers mailing list: + http://www.libsdl.org/mailing-list.php + +Enjoy! + Sam Lantinga (slouken@libsdl.org) + diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/README-SDL.txt b/dep/recastnavigation/RecastDemo/Contrib/SDL/README-SDL.txt new file mode 100644 index 000000000..4d36ca9dc --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/README-SDL.txt @@ -0,0 +1,13 @@ + +Please distribute this file with the SDL runtime environment: + +The Simple DirectMedia Layer (SDL for short) is a cross-platfrom library +designed to make it easy to write multi-media software, such as games and +emulators. + +The Simple DirectMedia Layer library source code is available from: +http://www.libsdl.org/ + +This library is distributed under the terms of the GNU LGPL license: +http://www.gnu.org/copyleft/lesser.html + diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/VisualC.html b/dep/recastnavigation/RecastDemo/Contrib/SDL/VisualC.html new file mode 100644 index 000000000..ad2ed97a6 --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/VisualC.html @@ -0,0 +1,171 @@ + + + Using SDL with Microsoft Visual C++ + + +

+ Using SDL with Microsoft Visual C++ 5,6 and 7 +

+

+ by Lion Kimbro and additions by + James Turk +

+

+ You can either use the precompiled libraries from + the SDL Download web site , or you can build SDL yourself. +

+

+ Building SDL +

+

+ Unzip the VisualC.zip file into the directory that contains this + file (VisualC.html). +

+

+ Be certain that you unzip the zip file for your compiler into this + directory and not any other directory. If you are using WinZip, be careful to + make sure that it extracts to this folder, because it's + convenient feature of unzipping to a folder with the name of the file currently + being unzipped will get you in trouble if you use it right now. And that's all + I have to say about that. +

+

+ Now that it's unzipped, go into the VisualC + directory that is created, and double-click on the VC++ file "SDL.dsw" + ("SDL.sln"). This should open up the IDE. +

+

+ You may be prompted at this point to upgrade the workspace, should you be using + a more recent version of Visual C++. If so, allow the workspace to be upgraded. +

+

+ Build the .dll and .lib files. +

+

+ This is done by right clicking on each project in turn (Projects are listed in + the Workspace panel in the FileView tab), and selecting "Build". +

+

+ If you get an error about SDL_config.h being missing, you should + copy include/SDL_config.h.default to include/SDL_config.h and try again. +

+

+ You may get a few warnings, but you should not get any errors. You do have to + have at least the DirectX 5 SDK installed, however. The latest + version of DirectX can be downloaded or purchased on a cheap CD (my + recommendation) from Microsoft . +

+

+ Later, we will refer to the following .lib and .dll files that have just been + generated: +

+
    +
  • SDL.dll
  • +
  • SDL.lib
  • +
  • SDLmain.lib
  • +
+

+ Search for these using the Windows Find (Windows-F) utility, if you don't + already know where they should be. For those of you with a clue, look inside + the Debug or Release directories of the subdirectories of the Project folder. + (It might be easier to just use Windows Find if this sounds confusing. And + don't worry about needing a clue; we all need visits from the clue fairy + frequently.) +

+

+ Creating a Project with SDL +

+

+ Create a project as a Win32 Application. +

+

+ Create a C++ file for your project. +

+

+ Set the C runtime to "Multi-threaded DLL" in the menu: Project|Settings|C/C++ + tab|Code Generation|Runtime Library . +

+

+ Add the SDL include directory to your list of includes in the + menu: Project|Settings|C/C++ tab|Preprocessor|Additional include directories + . +
+ VC7 Specific: Instead of doing this I find it easier to + add the include and library directories to the list that VC7 keeps. Do this by + selecting Tools|Options|Projects|VC++ Directories and under the "Show + Directories For:" dropbox select "Include Files", and click the "New Directory + Icon" and add the [SDLROOT]\include directory (ex. If you installed to + c:\SDL-1.2.5\ add c:\SDL-1.2.5\include). Proceed to change the + dropbox selection to "Library Files" and add [SDLROOT]\lib. +

+

+ The "include directory" I am referring to is the include folder + within the main SDL directory (the one that this HTML file located within). +

+

+ Now we're going to use the files that we had created earlier in the Build SDL + step. +

+

+ Copy the following files into your Project directory: +

+
    +
  • SDL.dll
  • +
+

+ Add the following files to your project (It is not necessary to copy them to + your project directory): +

+
    +
  • SDL.lib
  • +
  • SDLmain.lib
  • +
+

+ (To add them to your project, right click on your project, and select "Add + files to project") +

+

Instead of adding the files to your project it is more + desireable to add them to the linker options: Project|Properties|Linker|Command + Line and type the names of the libraries to link with in the "Additional + Options:" box.  Note: This must be done for each build + configuration (eg. Release,Debug).

+

+ SDL 101, First Day of Class +

+

+ Now create the basic body of your project. The body of your program should take + the following form: +

+#include "SDL.h"
+
+int main( int argc, char* argv[] )
+{
+  // Body of the program goes here.
+  return 0;
+}
+
+ +

+

+ That's it! +

+

+ I hope that this document has helped you get through the most difficult part of + using the SDL: installing it. Suggestions for improvements to this document + should be sent to the writers of this document. +

+

+ Thanks to Paulus Esterhazy (pesterhazy@gmx.net), for the work on VC++ port. +

+

+ This document was originally called "VisualC.txt", and was written by + Sam Lantinga. +

+

+ Later, it was converted to HTML and expanded into the document that you see + today by Lion Kimbro. +

+

Minor Fixes and Visual C++ 7 Information (In Green) was added by James Turk +

+ + diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/WhatsNew b/dep/recastnavigation/RecastDemo/Contrib/SDL/WhatsNew new file mode 100644 index 000000000..927fdd264 --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/WhatsNew @@ -0,0 +1,727 @@ + +This is a list of API changes in SDL's version history. + +Version 1.0: + +1.2.14: + Added cast macros for correct usage with C++: + SDL_reinterpret_cast(type, expression) + SDL_static_cast(type, expression) + + Added SDL_VIDEO_FULLSCREEN_DISPLAY as a preferred synonym for + SDL_VIDEO_FULLSCREEN_HEAD on X11. + + Added SDL_DISABLE_LOCK_KEYS environment variable to enable normal + up/down events for Caps-Lock and Num-Lock keys. + +1.2.13: + Added SDL_BUTTON_X1 and SDL_BUTTON_X2 constants. + +1.2.12: + Added SDL_VIDEO_ALLOW_SCREENSAVER to override SDL's disabling + of the screensaver on Mac OS X and X11. + +1.2.10: + If SDL_OpenAudio() is passed zero for the desired format + fields, the following environment variables will be used + to fill them in: + SDL_AUDIO_FREQUENCY + SDL_AUDIO_FORMAT + SDL_AUDIO_CHANNELS + SDL_AUDIO_SAMPLES + If an environment variable is not specified, it will be set + to a reasonable default value. + + Added support for the SDL_VIDEO_FULLSCREEN_HEAD environment + variable, currently supported on X11 Xinerama configurations. + + Added SDL_GL_SWAP_CONTROL to wait for vsync in OpenGL applications. + + Added SDL_GL_ACCELERATED_VISUAL to guarantee hardware acceleration. + + Added current_w and current_h to the SDL_VideoInfo structure, + which is set to the desktop resolution during video intialization, + and then set to the current resolution when a video mode is set. + + SDL_SetVideoMode() now accepts 0 for width or height and will use + the current video mode (or the desktop mode if no mode has been set.) + + Added SDL_GetKeyRepeat() + + Added SDL_config.h, with defaults for various build environments. + +1.2.7: + Added CPU feature detection functions to SDL_cpuinfo.h: + SDL_HasRDTSC(), SDL_HasMMX(), SDL_Has3DNow(), SDL_HasSSE(), + SDL_HasAltiVec() + Added function to create RWops from const memory: SDL_RWFromConstMem() + +1.2.6: + Added SDL_LoadObject(), SDL_LoadFunction(), and SDL_UnloadObject() + + Added SDL_GL_MULTISAMPLEBUFFERS and SDL_GL_MULTISAMPLESAMPLES for FSAA + +1.2.5: + Added SDL_BUTTON_WHEELUP (4) and SDL_BUTTON_WHEELDOWN (5) + + Added SDL_GL_STEREO for stereoscopic OpenGL contexts + +1.2.0: + Added SDL_VIDEOEXPOSE event to signal that the screen needs to + be redrawn. This is currently only delivered to OpenGL windows + on X11, though it may be delivered in the future when the video + memory is lost under DirectX. + +1.1.8: + You can pass SDL_NOFRAME to SDL_VideoMode() to create a window + that has no title bar or frame decoration. Fullscreen video + modes automatically have this flag set. + + Added a function to query the clipping rectangle for a surface: + void SDL_GetClipRect(SDL_Surface *surface, SDL_Rect *rect) + + Added a function to query the current event filter: + SDL_EventFilter SDL_GetEventFilter(void) + + If you pass -1 to SDL_ShowCursor(), it won't change the current + cursor visibility state, but will still return it. + + SDL_LockSurface() and SDL_UnlockSurface() are recursive, meaning + you can nest them as deep as you want, as long as each lock call + has a matching unlock call. The surface remains locked until the + last matching unlock call. + + Note that you may not blit to or from a locked surface. + +1.1.7: + The SDL_SetGammaRamp() and SDL_GetGammaRamp() functions now take + arrays of Uint16 values instead of Uint8 values. For the most part, + you can just take your old values and shift them up 8 bits to get + new correct values for your gamma ramps. + + You can pass SDL_RLEACCEL in flags passed to SDL_ConvertSurface() + and SDL will try to RLE accelerate colorkey and alpha blits in the + resulting surface. + +1.1.6: + Added a function to return the thread ID of a specific thread: + Uint32 SDL_GetThreadID(SDL_Thread *thread) + If 'thread' is NULL, this function returns the id for this thread. + +1.1.5: + The YUV overlay structure has been changed to use an array of + pitches and pixels representing the planes of a YUV image, to + better enable hardware acceleration. The YV12 and IYUV formats + each have three planes, corresponding to the Y, U, and V portions + of the image, while packed pixel YUV formats just have one plane. + + For palettized mode (8bpp), the screen colormap is now split in + a physical and a logical palette. The physical palette determines + what colours the screen pixels will get when displayed, and the + logical palette controls the mapping from blits to/from the screen. + A new function, SDL_SetPalette() has been added to change + logical and physical palettes separately. SDL_SetColors() works + just as before, and is equivalent to calling SDL_SetPalette() with + a flag argument of (SDL_LOGPAL|SDL_PHYSPAL). + + SDL_BlitSurface() no longer modifies the source rectangle, only the + destination rectangle. The width/height members of the destination + rectangle are ignored, only the position is used. + + The old source clipping function SDL_SetClipping() has been replaced + with a more useful function to set the destination clipping rectangle: + SDL_bool SDL_SetClipRect(SDL_Surface *surface, SDL_Rect *rect) + + Added a function to see what subsystems have been initialized: + Uint32 SDL_WasInit(Uint32 flags) + + The Big Alpha Flip: SDL now treats alpha as opacity like everybody + else, and not as transparency: + + A new cpp symbol: SDL_ALPHA_OPAQUE is defined as 255 + A new cpp symbol: SDL_ALPHA_TRANSPARENT is defined as 0 + Values between 0 and 255 vary from fully transparent to fully opaque. + + New functions: + SDL_DisplayFormatAlpha() + Returns a surface converted to a format with alpha-channel + that can be blit efficiently to the screen. (In other words, + like SDL_DisplayFormat() but the resulting surface has + an alpha channel.) This is useful for surfaces with alpha. + SDL_MapRGBA() + Works as SDL_MapRGB() but takes an additional alpha parameter. + SDL_GetRGBA() + Works as SDL_GetRGB() but also returns the alpha value + (SDL_ALPHA_OPAQUE for formats without an alpha channel) + + Both SDL_GetRGB() and SDL_GetRGBA() now always return values in + the [0..255] interval. Previously, SDL_GetRGB() would return + (0xf8, 0xfc, 0xf8) for a completely white pixel in RGB565 format. + (N.B.: This is broken for bit fields < 3 bits.) + + SDL_MapRGB() returns pixels in which the alpha channel is set opaque. + + SDL_SetAlpha() can now be used for both setting the per-surface + alpha, using the new way of thinking of alpha, and also to enable + and disable per-pixel alpha blending for surfaces with an alpha + channel: + To disable alpha blending: + SDL_SetAlpha(surface, 0, 0); + To re-enable alpha blending: + SDL_SetAlpha(surface, SDL_SRCALPHA, 0); + Surfaces with an alpha channel have blending enabled by default. + + SDL_SetAlpha() now accepts SDL_RLEACCEL as a flag, which requests + RLE acceleration of blits, just as like with SDL_SetColorKey(). + This flag can be set for both surfaces with an alpha channel + and surfaces with an alpha value set by SDL_SetAlpha(). + As always, RLE surfaces must be locked before pixel access is + allowed, and unlocked before any other SDL operations are done + on it. + + The blit semantics for surfaces with and without alpha and colorkey + have now been defined: + + RGBA->RGB: + SDL_SRCALPHA set: + alpha-blend (using alpha-channel). + SDL_SRCCOLORKEY ignored. + SDL_SRCALPHA not set: + copy RGB. + if SDL_SRCCOLORKEY set, only copy the pixels matching the + RGB values of the source colour key, ignoring alpha in the + comparison. + + RGB->RGBA: + SDL_SRCALPHA set: + alpha-blend (using the source per-surface alpha value); + set destination alpha to opaque. + SDL_SRCALPHA not set: + copy RGB, set destination alpha to opaque. + both: + if SDL_SRCCOLORKEY set, only copy the pixels matching the + source colour key. + + RGBA->RGBA: + SDL_SRCALPHA set: + alpha-blend (using the source alpha channel) the RGB values; + leave destination alpha untouched. [Note: is this correct?] + SDL_SRCCOLORKEY ignored. + SDL_SRCALPHA not set: + copy all of RGBA to the destination. + if SDL_SRCCOLORKEY set, only copy the pixels matching the + RGB values of the source colour key, ignoring alpha in the + comparison. + + RGB->RGB: + SDL_SRCALPHA set: + alpha-blend (using the source per-surface alpha value). + SDL_SRCALPHA not set: + copy RGB. + both: + if SDL_SRCCOLORKEY set, only copy the pixels matching the + source colour key. + + As a special case, blits from surfaces with per-surface alpha + value of 128 (50% transparency) are optimised and much faster + than other alpha values. This does not apply to surfaces with + alpha channels (per-pixel alpha). + + New functions for manipulating the gamma of the display have + been added: + int SDL_SetGamma(float red, float green, float blue); + int SDL_SetGammaRamp(Uint8 *red, Uint8 *green, Uint8 *blue); + int SDL_GetGammaRamp(Uint8 *red, Uint8 *green, Uint8 *blue); + Gamma ramps are tables with 256 entries which map the screen color + components into actually displayed colors. For an example of + implementing gamma correction and gamma fades, see test/testgamma.c + Gamma control is not supported on all hardware. + +1.1.4: + The size of the SDL_CDtrack structure changed from 8 to 12 bytes + as the size of the length member was extended to 32 bits. + + You can now use SDL for 2D blitting with a GL mode by passing the + SDL_OPENGLBLIT flag to SDL_SetVideoMode(). You can specify 16 or + 32 bpp, and the data in the framebuffer is put into the GL scene + when you call SDL_UpdateRects(), and the scene will be visible + when you call SDL_GL_SwapBuffers(). + + Run the "testgl" test program with the -logo command line option + to see an example of this blending of 2D and 3D in SDL. + +1.1.3: + Added SDL_FreeRW() to the API, to complement SDL_AllocRW() + + Added resizable window support - just add SDL_RESIZABLE to the + SDL_SetVideoMode() flags, and then wait for SDL_VIDEORESIZE events. + See SDL_events.h for details on the new SDL_ResizeEvent structure. + + Added condition variable support, based on mutexes and semaphores. + SDL_CreateCond() + SDL_DestroyCond() + SDL_CondSignal() + SDL_CondBroadcast() + SDL_CondWait() + SDL_CondTimedWait() + The new function prototypes are in SDL_mutex.h + + Added counting semaphore support, based on the mutex primitive. + SDL_CreateSemaphore() + SDL_DestroySemaphore() + SDL_SemWait() + SDL_SemTryWait() + SDL_SemWaitTimeout() + SDL_SemPost() + SDL_SemValue() + The new function prototypes are in SDL_mutex.h + + Added support for asynchronous blitting. To take advantage of this, + you must set the SDL_ASYNCBLIT flag when setting the video mode and + creating surfaces that you want accelerated in this way. You must + lock surfaces that have this flag set, and the lock will block until + any queued blits have completed. + + Added YUV video overlay support. + The supported YUV formats are: YV12, IYUV, YUY2, UYVY, and YVYU. + This function creates an overlay surface: + SDL_CreateYUVOverlay() + You must lock and unlock the overlay to get access to the data: + SDL_LockYUVOverlay() SDL_UnlockYUVOverlay() + You can then display the overlay: + SDL_DisplayYUVOverlay() + You must free the overlay when you are done using it: + SDL_FreeYUVOverlay() + See SDL_video.h for the full function prototypes. + + The joystick hat position constants have been changed: + Old constant New constant + ------------ ------------ + 0 SDL_HAT_CENTERED + 1 SDL_HAT_UP + 2 SDL_HAT_RIGHTUP + 3 SDL_HAT_RIGHT + 4 SDL_HAT_RIGHTDOWN + 5 SDL_HAT_DOWN + 6 SDL_HAT_LEFTDOWN + 7 SDL_HAT_LEFT + 8 SDL_HAT_LEFTUP + The new constants are bitmasks, so you can check for the + individual axes like this: + if ( hat_position & SDL_HAT_UP ) { + } + and you'll catch left-up, up, and right-up. + +1.1.2: + Added multiple timer support: + SDL_AddTimer() and SDL_RemoveTimer() + + SDL_WM_SetIcon() now respects the icon colorkey if mask is NULL. + +1.1.0: + Added initial OpenGL support. + First set GL attributes (such as RGB depth, alpha depth, etc.) + SDL_GL_SetAttribute() + Then call SDL_SetVideoMode() with the SDL_OPENGL flag. + Perform all of your normal GL drawing. + Finally swap the buffers with the new SDL function: + SDL_GL_SwapBuffers() + See the new 'testgl' test program for an example of using GL with SDL. + + You can load GL extension functions by using the function: + SDL_GL_LoadProcAddress() + + Added functions to initialize and cleanup specific SDL subsystems: + SDL_InitSubSystem() and SDL_QuitSubSystem() + + Added user-defined event type: + typedef struct { + Uint8 type; + int code; + void *data1; + void *data2; + } SDL_UserEvent; + This structure is in the "user" member of an SDL_Event. + + Added a function to push events into the event queue: + SDL_PushEvent() + + Example of using the new SDL user-defined events: + { + SDL_Event event; + + event.type = SDL_USEREVENT; + event.user.code = my_event_code; + event.user.data1 = significant_data; + event.user.data2 = 0; + SDL_PushEvent(&event); + } + + Added a function to get mouse deltas since last query: + SDL_GetRelativeMouseState() + + Added a boolean datatype to SDL_types.h: + SDL_bool = { SDL_TRUE, SDL_FALSE } + + Added a function to get the current audio status: + SDL_GetAudioState(); + It returns one of: + SDL_AUDIO_STOPPED, + SDL_AUDIO_PLAYING, + SDL_AUDIO_PAUSED + + Added an AAlib driver (ASCII Art) - by Stephane Peter. + +1.0.6: + The input grab state is reset after each call to SDL_SetVideoMode(). + The input is grabbed by default in fullscreen mode, and ungrabbed in + windowed mode. If you want to set input grab to a particular value, + you should set it after each call to SDL_SetVideoMode(). + +1.0.5: + Exposed SDL_AudioInit(), SDL_VideoInit() + Added SDL_AudioDriverName() and SDL_VideoDriverName() + + Added new window manager function: + SDL_WM_ToggleFullScreen() + This is currently implemented only on Linux + + The ALT-ENTER code has been removed - it's not appropriate for a + lib to bind keys when they aren't even emergency escape sequences. + + ALT-ENTER functionality can be implemented with the following code: + + int Handle_AltEnter(const SDL_Event *event) + { + if ( event->type == SDL_KEYDOWN ) { + if ( (event->key.keysym.sym == SDLK_RETURN) && + (event->key.keysym.mod & KMOD_ALT) ) { + SDL_WM_ToggleFullScreen(SDL_GetVideoSurface()); + return(0); + } + } + return(1); + } + SDL_SetEventFilter(Handle_AltEnter); + +1.0.3: + Under X11, if you grab the input and hide the mouse cursor, + the mouse will go into a "relative motion" mode where you + will always get relative motion events no matter how far in + each direction you move the mouse - relative motion is not + bounded by the edges of the window (though the absolute values + of the mouse positions are clamped by the size of the window). + The SVGAlib, framebuffer console, and DirectInput drivers all + have this behavior naturally, and the GDI and BWindow drivers + never go into "relative motion" mode. + +1.0.2: + Added a function to enable keyboard repeat: + SDL_EnableKeyRepeat() + + Added a function to grab the mouse and keyboard input + SDL_WM_GrabInput() + + Added a function to iconify the window. + SDL_WM_IconifyWindow() + If this function succeeds, the application will receive an event + signaling SDL_APPACTIVE event + +1.0.1: + Added constants to SDL_audio.h for 16-bit native byte ordering: + AUDIO_U16SYS, AUDIO_S16SYS + +1.0.0: + New public release + +Version 0.11: + +0.11.5: + A new function SDL_GetVideoSurface() has been added, and returns + a pointer to the current display surface. + + SDL_AllocSurface() has been renamed SDL_CreateRGBSurface(), and + a new function SDL_CreateRGBSurfaceFrom() has been added to allow + creating an SDL surface from an existing pixel data buffer. + + Added SDL_GetRGB() to the headers and documentation. + +0.11.4: + SDL_SetLibraryPath() is no longer meaningful, and has been removed. + +0.11.3: + A new flag for SDL_Init(), SDL_INIT_NOPARACHUTE, prevents SDL from + installing fatal signal handlers on operating systems that support + them. + +Version 0.9: + +0.9.15: + SDL_CreateColorCursor() has been removed. Color cursors should + be implemented as sprites, blitted by the application when the + cursor moves. To get smooth color cursor updates when the app + is busy, pass the SDL_INIT_EVENTTHREAD flag to SDL_Init(). This + allows you to handle the mouse motion in another thread from an + event filter function, but is currently only supported by Linux + and BeOS. Note that you'll have to protect the display surface + from multi-threaded access by using mutexes if you do this. + + Thread-safe surface support has been removed from SDL. + This makes blitting somewhat faster, by removing SDL_MiddleBlit(). + Code that used SDL_MiddleBlit() should use SDL_LowerBlit() instead. + You can make your surfaces thread-safe by allocating your own + mutex and making lock/unlock calls around accesses to your surface. + +0.9.14: + SDL_GetMouseState() now takes pointers to int rather than Uint16. + + If you set the SDL_WINDOWID environment variable under UNIX X11, + SDL will use that as the main window instead of creating it's own. + This is an unsupported extension to SDL, and not portable at all. + +0.9.13: + Added a function SDL_SetLibraryPath() which can be used to specify + the directory containing the SDL dynamic libraries. This is useful + for commercial applications which ship with particular versions + of the libraries, and for security on multi-user systems. + If this function is not used, the default system directories are + searched using the native dynamic object loading mechanism. + + In order to support C linkage under Visual C++, you must declare + main() without any return type: + main(int argc, char *argv[]) { + /* Do the program... */ + return(0); + } + C++ programs should also return a value if compiled under VC++. + + The blit_endian member of the SDL_VideoInfo struct has been removed. + + SDL_SymToASCII() has been replaced with SDL_GetKeyName(), so there + is now no longer any function to translate a keysym to a character. + + The SDL_keysym structure has been extended with a 'scancode' and + 'unicode' member. The 'scancode' is a hardware specific scancode + for the key that was pressed, and may be 0. The 'unicode' member + is a 16-bit UNICODE translation of the key that was pressed along + with any modifiers or compose keys that have been pressed. + If no UNICODE translation exists for the key, 'unicode' will be 0. + + Added a function SDL_EnableUNICODE() to enable/disable UNICODE + translation of character keypresses. Translation defaults off. + + To convert existing code to use the new API, change code which + uses SDL_SymToASCII() to get the keyname to use SDL_GetKeyName(), + and change code which uses it to get the ASCII value of a sym to + use the 'unicode' member of the event keysym. + +0.9.12: + There is partial support for 64-bit datatypes. I don't recommend + you use this if you have a choice, because 64-bit datatypes are not + supported on many platforms. On platforms for which it is supported, + the SDL_HAS_64BIT_TYPE C preprocessor define will be enabled, and + you can use the Uint64 and Sint64 datatypes. + + Added functions to SDL_endian.h to support 64-bit datatypes: + SDL_SwapLE64(), SDL_SwapBE64(), + SDL_ReadLE64(), SDL_ReadBE64(), SDL_WriteLE64(), SDL_WriteBE64() + + A new member "len_ratio" has been added to the SDL_AudioCVT structure, + and allows you to determine either the original buffer length or the + converted buffer length, given the other. + + A new function SDL_FreeWAV() has been added to the API to free data + allocated by SDL_LoadWAV_RW(). This is necessary under Win32 since + the gcc compiled DLL uses a different heap than VC++ compiled apps. + + SDL now has initial support for international keyboards using the + Latin character set. + If a particular mapping is desired, you can set the DEFAULT_KEYBOARD + compile-time variable, or you can set the environment variable + "SDL_KEYBOARD" to a string identifying the keyboard mapping you desire. + The valid values for these variables can be found in SDL_keyboard.c + + Full support for German and French keyboards under X11 is implemented. + +0.9.11: + The THREADED_EVENTS compile-time define has been replaced with the + SDL_INIT_EVENTTHREAD flag. If this flag is passed to SDL_Init(), + SDL will create a separate thread to perform input event handling. + If this flag is passed to SDL_Init(), and the OS doesn't support + event handling in a separate thread, SDL_Init() will fail. + Be sure to add calls to SDL_Delay() in your main thread to allow + the OS to schedule your event thread, or it may starve, leading + to slow event delivery and/or dropped events. + Currently MacOS and Win32 do not support this flag, while BeOS + and Linux do support it. I recommend that your application only + use this flag if absolutely necessary. + + The SDL thread function passed to SDL_CreateThread() now returns a + status. This status can be retrieved by passing a non-NULL pointer + as the 'status' argument to SDL_WaitThread(). + + The volume parameter to SDL_MixAudio() has been increased in range + from (0-8) to (0-128) + + SDL now has a data source abstraction which can encompass a file, + an area of memory, or any custom object you can envision. It uses + these abstractions, SDL_RWops, in the endian read/write functions, + and the built-in WAV and BMP file loaders. This means you can load + WAV chunks from memory mapped files, compressed archives, network + pipes, or anything else that has a data read abstraction. + + There are three built-in data source abstractions: + SDL_RWFromFile(), SDL_RWFromFP(), SDL_RWFromMem() + along with a generic data source allocation function: + SDL_AllocRW() + These data sources can be used like stdio file pointers with the + following convenience functions: + SDL_RWseek(), SDL_RWread(), SDL_RWwrite(), SDL_RWclose() + These functions are defined in the new header file "SDL_rwops.h" + + The endian swapping functions have been turned into macros for speed + and SDL_CalculateEndian() has been removed. SDL_endian.h now defines + SDL_BYTEORDER as either SDL_BIG_ENDIAN or SDL_LIL_ENDIAN depending on + the endianness of the host system. + + The endian read/write functions now take an SDL_RWops pointer + instead of a stdio FILE pointer, to support the new data source + abstraction. + + The SDL_*LoadWAV() functions have been replaced with a single + SDL_LoadWAV_RW() function that takes a SDL_RWops pointer as it's + first parameter, and a flag whether or not to automatically + free it as the second parameter. SDL_LoadWAV() is a macro for + backward compatibility and convenience: + SDL_LoadWAV_RW(SDL_RWFromFile("sample.wav", "rb"), 1, ...); + + The SDL_*LoadBMP()/SDL_*SaveBMP() functions have each been replaced + with a single function that takes a SDL_RWops pointer as it's + first parameter, and a flag whether or not to automatically + free it as the second parameter. SDL_LoadBMP() and SDL_SaveBMP() + are macros for backward compatibility and convenience: + SDL_LoadBMP_RW(SDL_RWFromFile("sample.bmp", "rb"), 1, ...); + SDL_SaveBMP_RW(SDL_RWFromFile("sample.bmp", "wb"), 1, ...); + Note that these functions use SDL_RWseek() extensively, and should + not be used on pipes or other non-seekable data sources. + +0.9.10: + The Linux SDL_SysWMInfo and SDL_SysWMMsg structures have been + extended to support multiple types of display drivers, as well as + safe access to the X11 display when THREADED_EVENTS is enabled. + The new structures are documented in the SDL_syswm.h header file. + + Thanks to John Elliott , the UK keyboard + should now work properly, as well as the "Windows" keys on US + keyboards. + + The Linux CD-ROM code now reads the CD-ROM devices from /etc/fstab + instead of trying to open each block device on the system. + The CD must be listed in /etc/fstab as using the iso9660 filesystem. + + On Linux, if you define THREADED_EVENTS at compile time, a separate + thread will be spawned to gather X events asynchronously from the + graphics updates. This hasn't been extensively tested, but it does + provide a means of handling keyboard and mouse input in a separate + thread from the graphics thread. (This is now enabled by default.) + + A special access function SDL_PeepEvents() allows you to manipulate + the event queue in a thread-safe manner, including peeking at events, + removing events of a specified type, and adding new events of arbitrary + type to the queue (use the new 'user' member of the SDL_Event type). + + If you use SDL_PeepEvents() to gather events, then the main graphics + thread needs to call SDL_PumpEvents() periodically to drive the event + loop and generate input events. This is not necessary if SDL has been + compiled with THREADED_EVENTS defined, but doesn't hurt. + + A new function SDL_ThreadID() returns the identifier associated with + the current thread. + +0.9.9: + The AUDIO_STEREO format flag has been replaced with a new 'channels' + member of the SDL_AudioSpec structure. The channels are 1 for mono + audio, and 2 for stereo audio. In the future more channels may be + supported for 3D surround sound. + + The SDL_MixAudio() function now takes an additional volume parameter, + which should be set to SDL_MIX_MAXVOLUME for compatibility with the + original function. + + The CD-ROM functions which take a 'cdrom' parameter can now be + passed NULL, and will act on the last successfully opened CD-ROM. + +0.9.8: + No changes, bugfixes only. + +0.9.7: + No changes, bugfixes only. + +0.9.6: + Added a fast rectangle fill function: SDL_FillRect() + + Addition of a useful function for getting info on the video hardware: + const SDL_VideoInfo *SDL_GetVideoInfo(void) + This function replaces SDL_GetDisplayFormat(). + + Initial support for double-buffering: + Use the SDL_DOUBLEBUF flag in SDL_SetVideoMode() + Update the screen with a new function: SDL_Flip() + + SDL_AllocSurface() takes two new flags: + SDL_SRCCOLORKEY means that the surface will be used for colorkey blits + and if the hardware supports hardware acceleration of colorkey blits + between two surfaces in video memory, to place the surface in video + memory if possible, otherwise it will be placed in system memory. + SDL_SRCALPHA means that the surface will be used for alpha blits and + if the hardware supports hardware acceleration of alpha blits between + two surfaces in video memory, to place the surface in video memory + if possible, otherwise it will be placed in system memory. + SDL_HWSURFACE now means that the surface will be created with the + same format as the display surface, since having surfaces in video + memory is only useful for fast blitting to the screen, and you can't + blit surfaces with different surface formats in video memory. + +0.9.5: + You can now pass a NULL mask to SDL_WM_SetIcon(), and it will assume + that the icon consists of the entire image. + + SDL_LowerBlit() is back -- but don't use it on the display surface. + It is exactly the same as SDL_MiddleBlit(), but doesn't check for + thread safety. + + Added SDL_FPLoadBMP(), SDL_FPSaveBMP(), SDL_FPLoadWAV(), which take + a FILE pointer instead of a file name. + + Added CD-ROM audio control API: + SDL_CDNumDrives() + SDL_CDName() + SDL_CDOpen() + SDL_CDStatus() + SDL_CDPlayTracks() + SDL_CDPlay() + SDL_CDPause() + SDL_CDResume() + SDL_CDStop() + SDL_CDEject() + SDL_CDClose() + +0.9.4: + No changes, bugfixes only. + +0.9.3: + Mouse motion event now includes relative motion information: + Sint16 event->motion.xrel, Sint16 event->motion.yrel + + X11 keyrepeat handling can be disabled by defining IGNORE_X_KEYREPEAT + (Add -DIGNORE_X_KEYREPEAT to CFLAGS line in obj/x11Makefile) + +0.9.2: + No changes, bugfixes only. + +0.9.1: + Removed SDL_MapSurface() and SDL_UnmapSurface() -- surfaces are now + automatically mapped on blit. + +0.8.0: + SDL stable release diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/docs.html b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs.html new file mode 100644 index 000000000..66ca9235a --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs.html @@ -0,0 +1,629 @@ + +SDL Stable Release + + +[separator] +

+This source is stable, and is fully tested on all supported platforms.
+Please send bug reports or questions to the SDL mailing list:
+http://www.libsdl.org/mailing-list.php
+The latest stable release may be found on the + SDL website. +

+ +

API Documentation

+ +[separator] + +

SDL 1.2.14 Release Notes

+

+SDL 1.2.14 is a significant bug fix release and a recommended update. +

+ +

General Notes

+ +
+

+ Fixed flicker when resizing the SDL window +

+

+ Fixed crash in SDL_SetGammaRamp() +

+

+ Fixed freeze in SDL_memset() with 0 length when assembly code is disabled. +

+

+ Added SDL_DISABLE_LOCK_KEYS environment variable to enable normal up/down events for Caps-Lock and Num-Lock keys. +

+

+ Fixed audio quality problem when converting between 22050 Hz and 44100 Hz. +

+

+ Fixed a threading crash when a few threads are rapidly created and complete. +

+

+ Increased accuracy of alpha blending routines. +

+

+ Fixed crash loading BMP files saved with the scanlines inverted. +

+

+ Fixed mouse coordinate clamping if SDL_SetVideoMode() isn't called in response to SDL_VIDEORESIZE event. +

+

+ Added doxygen documentation for the SDL API headers. +

+
+ +

Unix Notes

+ +
+

+ Fixed potential memory corruption due to assembly bug with SDL_revcpy() +

+

+ Fixed crashes trying to detect SSE features on x86_64 architecture. +

+

+ Fixed assembly for GCC optimized 50% alpha blending blits. +

+

+ Added configure option --enable-screensaver, to allow enabling the screensaver by default. +

+

+ Use XResetScreenSaver() instead of disabling screensaver entirely. +

+

+ Removed the maximum window size limitation on X11. +

+

+ Fixed SDL_GL_SWAP_CONTROL on X11. +

+

+ Fixed setting the X11 window input hint. +

+

+ Fixed distorted X11 window icon for some visuals. +

+

+ Fixed detecting X11 libraries for dynamic loading on 64-bit Linux. +

+

+ SDL_GL_GetAttribute(SDL_GL_SWAP_CONTROL) returns the correct value with GLX_SGI_swap_control. +

+

+ Added SDL_VIDEO_FULLSCREEN_DISPLAY as a preferred synonym for SDL_VIDEO_FULLSCREEN_HEAD on X11. +

+

+ The SDL_VIDEO_FULLSCREEN_DISPLAY environment variable can be set to 0 to place fullscreen SDL windows on the first Xinerama screen. +

+

+ Added the SDL_VIDEO_FBCON_ROTATION environment variable to control output orientation on the framebuffer console. +
+ Valid values are: +

    +
  • not set - Not rotating, no shadow. +
  • "NONE" - Not rotating, but still using shadow. +
  • "CW" - Rotating screen clockwise. +
  • "UD" - Rotating screen upside down. +
  • "CCW" - Rotating screen counter clockwise. +
+

+

+ Fixed DirectFB detection on some Linux distributions. +

+

+ Added code to use the PS3 SPE processors for YUV conversion on Linux. +

+

+ Updated ALSA support to the latest stable API +

+

+ ALSA is now preferred over OSS audio. (SDL_AUDIODRIVER=dsp will restore the previous behavior.) +

+

+ Improved support for PulseAudio +

+

+ The Network Audio System support is now dynamically loaded at runtime. +

+

+ Fixed crash with the MP-8866 Dual USB Joypad on newer Linux kernels. +

+

+ Fixed crash in SDL_Quit() when a joystick has been unplugged. +

+
+ +

Windows Notes

+ +
+

+ Verified 100% compatibility with Windows 7. +

+

+ Prevent loss of OpenGL context when setting the video mode in response to a window resize event. +

+

+ Fixed video initialization with SDL_WINDOWID on Windows XP. +

+

+ Improved mouse input responsiveness for first-person-shooter games. +

+

+ IME messages are now generated for localized input. +

+

+ SDL_RWFromFile() takes a UTF-8 filename when opening a file. +

+

+ The SDL_STDIO_REDIRECT environment variable can be used to override whether SDL redirects stdio to stdout.txt and stderr.txt. +

+

+ Fixed dynamic object loading on Windows CE. +

+
+ +

Mac OS X Notes

+ +
+

+ SDL now builds on Mac OS X 10.6 (Snow Leopard). +
+ Eric Wing posted a good rundown on the numerous changes here: http://playcontrol.net/ewing/jibberjabber/big_behind-the-scenes_chang.html +

+

+ The X11 video driver is built by default. +

+

+ Fixed SDL_VIDEO_WINDOW_POS environment variable for Quartz target. +

+

+ Fixed setting the starting working directory in release builds. +

+
+ +[separator] + +

SDL 1.2.13 Release Notes

+

+SDL 1.2.13 is a minor bug fix release. +

+ +

General Notes

+ +
+

+ Fixed link error when building with Intel Compiler 10. +

+

+ Removed stray C++ comment from public headers. +

+
+ +

Unix Notes

+ +
+

+ Fixed crash in SDL_SoftStretch() on secure operating systems. +

+

+ Fixed undefined symbol on X11 implementations without UTF-8 support. +

+

+ Worked around BadAlloc error when using XVideo on the XFree86 Intel Integrated Graphics driver. +

+

+ Scan for all joysticks on Linux instead of stopping at one that was removed. +

+

+ Fixed use of sdl-config arguments in sdl.m4 +

+
+ +

Windows Notes

+ +
+

+ Fixed crash when a video driver reports higher than 32 bpp video modes. +

+

+ Fixed restoring the desktop after setting a 24-bit OpenGL video mode. +

+

+ Fixed window titles on Windows 95/98/ME. +

+

+ Added SDL_BUTTON_X1 and SDL_BUTTON_X2 constants for extended mouse buttons. +

+

+ Added support for quoted command line arguments. +

+
+ +

Mac OS X Notes

+ +
+

+ SDL now builds on Mac OS X 10.5 (Leopard). +

+

+ Fixed high frequency crash involving text input. +

+

+ Fixed beeping when the escape key is pressed and UNICODE translation is enabled. +

+

+ Improved trackpad scrolling support. +

+

+ Fixed joystick hat reporting for certain joysticks. +

+
+ +[separator] + +

SDL 1.2.12 Release Notes

+

+SDL 1.2.12 is a minor bug fix release. +

+ +

General Notes

+ +
+

+ Added support for the PulseAudio sound server: http://www.pulseaudio.org/ +

+

+ Added SDL_VIDEO_ALLOW_SCREENSAVER to override SDL's disabling of the screensaver on Mac OS X, Windows, and X11. +

+

+ Fixed buffer overrun crash when resampling audio rates. +

+

+ Fixed audio bug where converting to mono was doubling the volume. +

+

+ Fixed off-by-one error in the C implementation of SDL_revcpy() +

+

+ Fixed compiling with Sun Studio. +

+

+ Support for AmigaOS has been removed from the main SDL code. +

+

+ Support for Nokia 9210 "EPOC" driver has been removed from the main SDL code. +

+

+ Unofficial support for the S60/SymbianOS platform has been added. +

+

+ Unofficial support for the Nintendo DS platform has been added. +

+

+ Reenabled MMX assembly for YUV overlay processing (GNU C Compiler only). +

+
+ +

Unix Notes

+ +
+

+ Fixed detection of X11 DGA mouse support. +

+

+ Improved XIM support for asian character sets. +

+

+ The GFX_Display has been added to the X11 window information in SDL_syswm.h. +

+

+ Fixed PAGE_SIZE compile error in the fbcon video driver on newer Linux kernels. +

+

+ Fixed hang or crash at startup if aRts can't access the hardware. +

+

+ Fixed relative mouse mode when the cursor starts outside the X11 window. +

+

+ Fixed accidental free of stack memory in X11 mouse acceleration code. +

+

+ Closed minor memory leak in XME code. +

+

+ Fixed TEXTRELs in the library to resolve some PIC issues. +

+
+ +

Windows Notes

+ +
+

+ The GDI video driver makes better use of the palette in 8-bit modes. +

+

+ The windib driver now supports more mouse buttons with WM_XBUTTON events. +

+

+ On Windows, SDL_SetVideoMode() will re-create the window instead of failing if the multisample settings are changed. +

+

+ Added support for UTF-8 window titles on Windows. +

+

+ Fixed joystick detection on Windows. +

+

+ Improved performance with Win32 file I/O. +

+

+ Fixed HBITMAP leak in GAPI driver. +

+
+ +

Mac OS X Notes

+ +
+

+ Added support for multi-axis controllers like 3Dconnxion's SpaceNavigator on Mac OS X. +

+

+ Fixed YUV overlay crash inside Quicktime on Intel Mac OS X. +

+

+ Fixed blitting alignment in Altivec alpha blit functions. +

+

+ Keys F13, F14, and F15 are now usable on Apple keyboards under Mac OS X. +

+

+ Fixed joystick calibration code on Mac OS X. +

+

+ Fixed mouse jitter when multiple motion events are queued up in Mac OS X. +

+

+ Fixed changing the cursor in fullscreen mode on Mac OS X. +

+
+ +

Mac OS Classic Notes

+ +
+

+ Added support for gamma ramps to both toolbox and DrawSprocket video drivers. +

+
+ +

BeOS Notes

+ +
+

+ Implemented mouse grabbing and mouse relative mode on BeOS. +

+
+ +[separator] + +

SDL 1.2.11 Release Notes

+

+SDL 1.2.11 is a minor bug fix release. +

+ +

Unix Notes

+ +
+

+ Dynamic X11 loading is only enabled with gcc 4 supporting -fvisibility=hidden. This fixes crashes related to symbol collisions, and allows building on Solaris and IRIX. +

+

+ Fixed building SDL with Xinerama disabled. +

+

+ Fixed DRI OpenGL library loading, using RTLD_GLOBAL in dlopen(). +

+

+ Added pkgconfig configuration support. +

+
+ +

Windows Notes

+ +
+

+ Setting SDL_GL_SWAP_CONTROL now works with Windows OpenGL. +

+

+ The Win32 window positioning code works properly for windows with menus. +

+

+ DirectSound audio quality has been improved on certain sound cards. +

+

+ Fixed 5.1 audio channel ordering on Windows and Mac OS X. +

+

+ Plugged a couple of minor memory leaks in the windib video driver. +

+

+ Fixed type collision with stdint.h when building with gcc on Win32. +

+

+ Fixed building with the Digital Mars Compiler on Win32. +

+
+ +

Mac OS X Notes

+ +
+

+ The Quartz video driver supports 32x32 cursors on Mac OS X 10.3 and above. +

+
+ +[separator] + +

SDL 1.2.10 Release Notes

+

+SDL 1.2.10 is a major release, featuring a revamp of the build system and many API improvements and bug fixes. +

+

API enhancements

+
    +
  • + If SDL_OpenAudio() is passed zero for the desired format + fields, the following environment variables will be used + to fill them in: +
    
    +		SDL_AUDIO_FREQUENCY
    +		SDL_AUDIO_FORMAT
    +		SDL_AUDIO_CHANNELS
    +		SDL_AUDIO_SAMPLES
    +
    + If an environment variable is not specified, it will be set + to a reasonable default value. +
  • + SDL_SetVideoMode() now accepts 0 for width or height and will use + the current video mode (or the desktop mode if no mode has been set.) +
  • + Added current_w and current_h to the SDL_VideoInfo structure, + which is set to the desktop resolution during video intialization, + and then set to the current resolution when a video mode is set. +
  • + SDL_GL_LoadLibrary() will load the system default OpenGL library + if it is passed NULL as a parameter. +
  • + Added SDL_GL_SWAP_CONTROL to wait for vsync in OpenGL applications. +
  • + Added SDL_GL_ACCELERATED_VISUAL to guarantee hardware acceleration. +
  • + SDL_WM_SetCaption() now officially takes UTF-8 title and icon strings, and displays international characters on supported platforms. +
  • + Added SDL_GetKeyRepeat() to query the key repeat settings. +
  • + Added the "dummy" audio driver, which can be used to emulate audio + output without a sound card. +
  • + Added SDL_config.h, with defaults for various build environments. +
+ +

General Notes

+ +
+

+ The SDL website now has an RSS feed! +

+ The SDL development source code is now managed with Subversion. +

+ SDL now uses the Bugzilla bug tracking system, hosted by icculus.org. +

+ SDL is licensed under version 2.1 of the GNU Lesser General Public License. +

+ The entire build system has been revamped to make it much more portable, including versions of C library functions to make it possible to run SDL on a minimal embedded environment. See README.Porting in the SDL source distribution for information on how to port SDL to a new platform. +

+ SDL_opengl.h has been updated with the latest glext.h from http://oss.sgi.com/projects/ogl-sample/registry/ +

+ Alex Volkov contributed highly optimized RGB <-> RGBA blitters. +

+ +

Unix Notes

+ +
+

+ The X11 libraries are dynamically loaded at runtime by default. This allows the distributed version of SDL to run on systems without X11 libraries installed. +

+ The XiG XME extension code is now included in the X11 video driver by default. +

+ XRandR support for video mode switching has been added to the X11 driver, but is disabled because of undesired interactions with window managers. You can enable this by setting the environment variable SDL_VIDEO_X11_XRANDR to 1. +

+ Xinerama multi-head displays are properly handled now, and the SDL_VIDEO_FULLSCREEN_HEAD environment variable can be used to select the screen used for fullscreen video modes. Note that changing the video modes only works on screen 0. +

+ XVidMode video modes are now sorted so they maintain the refresh rates specified in the X11 configuration file. +

+ SDL windows are no longer transparent in X11 compositing systems like XGL. +

+ The mouse is properly released by the X11 video driver if the fullscreen window loses focus. +

+ The X11 input driver now uses XIM to handle international input. +

+ The screensaver and DPMS monitor blanking are disabled while SDL games are running under the X11 and DGA video drivers. This behavior will be formalized and selectable in SDL 1.3. +

+ Fixed a bug preventing stereo OpenGL contexts from being selected on the X11 driver. +

+ The DGA video driver now waits for pending blits involving surfaces before they are freed. This prevents display oddities when using SDL_DisplayFormat() to convert many images. +

+ The framebuffer console video driver now has a parser for /etc/fb.modes for improved video mode handling. +

+ The framebuffer console video driver now allows asynchronous VT switching, and restores the full contents of the screen when switched back. +

+ The framebuffer console now uses CTRL-ALT-FN to switch virtual terminals, to avoid collisions with application key bindings. +

+ The framebuffer console input driver correctly sets IMPS/2 mode for wheel mice. It also properly detects when gpm is in IMPS/2 protocol mode, or passing raw protocol from an IMPS/2 mouse. +

+ The SVGAlib video driver now has support for banked (non-linear) video modes. +

+ A video driver for OpenBSD on the Sharp Zaurus has been contributed by Staffan Ulfberg. See the file README.wscons in the SDL source distribution for details. +

+ Many patches have been incorporated from *BSD ports. +

+ +

Windows Notes

+ +
+

+ The "windib" video driver is the default now, to prevent problems with certain laptops, 64-bit Windows, and Windows Vista. The DirectX driver is still available, and can be selected by setting the environment variable SDL_VIDEODRIVER to "directx". +

+ SDL has been ported to 64-bit Windows. +

+ Dmitry Yakimov contributed a GAPI video driver for Windows CE. +

+ The default fullscreen refresh rate has been increased to match the desktop refresh rate, when using equivalent resolutions. A full API for querying and selecting refresh rates is planned for SDL 1.3. +

+ Dialog boxes are now shown when SDL is in windowed OpenGL mode. +

+ The SDL window is recreated when necessary to maintain OpenGL context attributes, when switching between windowed and fullscreen modes. +

+ An SDL_VIDEORESIZE event is properly sent when the SDL window is maximized and restored. +

+ Window positions are retained when switching between fullscreen and windowed modes. +

+ ToUnicode() is used, when available, for improved handling of international keyboard input. +

+ The PrtScrn is now treated normally with both key down and key up events. +

+ Pressing ALT-F4 now delivers an SDL_QUIT event to SDL applications. +

+ Joystick names are now correct for joysticks which have been unplugged and then plugged back in since booting. +

+ An MCI error when playing the last track on a CD-ROM has been fixed. +

+ OpenWatcom projects for building SDL have been provided by Marc Peter. +

+ +

Mac OS X Notes

+ +
+

+ SDL now supports building Universal binaries, both through Xcode projects and when using configure/make. See README.MacOSX in the SDL source archive for details. +

+ The X11 video driver with GLX support can be built on Mac OS X, if the X11 development SDK is installed. +

+ Transitions between fullscreen resolutions and windowed mode now use a much faster asynchronous fade to hide desktop flicker. +

+ Icons set with SDL_WM_SetIcon() now have the proper colors on Intel Macs. +

+ +

OS/2 Notes

+ +
+

+ Projects for building SDL on OS/2 with OpenWatcom have been contributed by Doodle. See the file README.OS2 in the SDL source distribution for details. +

+ +[separator] + + + diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/audio.html b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/audio.html new file mode 100644 index 000000000..94075e2cb --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/audio.html @@ -0,0 +1,242 @@ +Audio
SDL Library Documentation
PrevNext

Chapter 10. Audio

Table of Contents
SDL_AudioSpec -- Audio Specification Structure
SDL_OpenAudio -- Opens the audio device with the desired parameters.
SDL_PauseAudio -- Pauses and unpauses the audio callback processing
SDL_GetAudioStatus -- Get the current audio state
SDL_LoadWAV -- Load a WAVE file
SDL_FreeWAV -- Frees previously opened WAV data
SDL_AudioCVT -- Audio Conversion Structure
SDL_BuildAudioCVT -- Initializes a SDL_AudioCVT structure for conversion
SDL_ConvertAudio -- Convert audio data to a desired audio format.
SDL_MixAudio -- Mix audio data
SDL_LockAudio -- Lock out the callback function
SDL_UnlockAudio -- Unlock the callback function
SDL_CloseAudio -- Shuts down audio processing and closes the audio device.

Sound on the computer is translated from waves that you hear into a series of +values, or samples, each representing the amplitude of the wave. When these +samples are sent in a stream to a sound card, an approximation of the original +wave can be recreated. The more bits used to represent the amplitude, and the +greater frequency these samples are gathered, the closer the approximated +sound is to the original, and the better the quality of sound.

This library supports both 8 and 16 bit signed and unsigned sound samples, +at frequencies ranging from 11025 Hz to 44100 Hz, depending on the +underlying hardware. If the hardware doesn't support the desired audio +format or frequency, it can be emulated if desired (See +SDL_OpenAudio())

A commonly supported audio format is 16 bits per sample at 22050 Hz.


PrevHomeNext
SDL_JoystickCloseUpSDL_AudioSpec
\ No newline at end of file diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/cdrom.html b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/cdrom.html new file mode 100644 index 000000000..bdd6bfd82 --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/cdrom.html @@ -0,0 +1,260 @@ +CD-ROM
SDL Library Documentation
PrevNext

Chapter 11. CD-ROM

Table of Contents
SDL_CDNumDrives -- Returns the number of CD-ROM drives on the system.
SDL_CDName -- Returns a human-readable, system-dependent identifier for the CD-ROM.
SDL_CDOpen -- Opens a CD-ROM drive for access.
SDL_CDStatus -- Returns the current status of the given drive.
SDL_CDPlay -- Play a CD
SDL_CDPlayTracks -- Play the given CD track(s)
SDL_CDPause -- Pauses a CDROM
SDL_CDResume -- Resumes a CDROM
SDL_CDStop -- Stops a CDROM
SDL_CDEject -- Ejects a CDROM
SDL_CDClose -- Closes a SDL_CD handle
SDL_CD -- CDROM Drive Information
SDL_CDtrack -- CD Track Information Structure

SDL supports audio control of up to 32 local CD-ROM drives at once.

You use this API to perform all the basic functions of a CD player, +including listing the tracks, playing, stopping, and ejecting the CD-ROM. +(Currently, multi-changer CD drives are not supported.)

Before you call any of the SDL CD-ROM functions, you must first call +"SDL_Init(SDL_INIT_CDROM)", which scans the system for +CD-ROM drives, and sets the program up for audio control. Check the +return code, which should be 0, to see if there +were any errors in starting up.

After you have initialized the library, you can find out how many drives +are available using the SDL_CDNumDrives() function. +The first drive listed is the system default CD-ROM drive. After you have +chosen a drive, and have opened it with SDL_CDOpen(), +you can check the status and start playing if there's a CD in the drive.

A CD-ROM is organized into one or more tracks, each consisting of a certain +number of "frames". Each frame is ~2K in size, and at normal playing speed, +a CD plays 75 frames per second. SDL works with the number of frames on a +CD, but this can easily be converted to the more familiar minutes/seconds +format by using the FRAMES_TO_MSF() macro.


PrevHomeNext
SDL_CloseAudioUpSDL_CDNumDrives
\ No newline at end of file diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/event.html b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/event.html new file mode 100644 index 000000000..f2bddb2c0 --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/event.html @@ -0,0 +1,216 @@ +Events
SDL Library Documentation
PrevNext

Chapter 8. Events

Introduction

Event handling allows your application to receive input from the user. Event handling is initalised (along with video) with a call to: +

SDL_Init(SDL_INIT_VIDEO);
+Internally, SDL stores all the events waiting to be handled in an event queue. Using functions like SDL_PollEvent and SDL_PeepEvents you can observe and handle waiting input events.

The key to event handling in SDL is the SDL_Event union. The event queue itself is composed of a series of SDL_Event unions, one for each waiting event. SDL_Event unions are read from the queue with the SDL_PollEvent function and it is then up to the application to process the information stored with them.


PrevHomeNext
SDL_WM_GrabInputUpSDL Event Structures.
\ No newline at end of file diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/eventfunctions.html b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/eventfunctions.html new file mode 100644 index 000000000..f68a29a3b --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/eventfunctions.html @@ -0,0 +1,481 @@ +Event Functions.
SDL Library Documentation
PrevChapter 8. EventsNext

Event Functions.

Table of Contents
SDL_PumpEvents -- Pumps the event loop, gathering events from the input devices.
SDL_PeepEvents -- Checks the event queue for messages and optionally returns them.
SDL_PollEvent -- Polls for currently pending events.
SDL_WaitEvent -- Waits indefinitely for the next available event.
SDL_PushEvent -- Pushes an event onto the event queue
SDL_SetEventFilter -- Sets up a filter to process all events before they are posted +to the event queue.
SDL_GetEventFilter -- Retrieves a pointer to he event filter
SDL_EventState -- This function allows you to set the state of processing certain events.
SDL_GetKeyState -- Get a snapshot of the current keyboard state
SDL_GetModState -- Get the state of modifier keys.
SDL_SetModState -- Set the current key modifier state
SDL_GetKeyName -- Get the name of an SDL virtual keysym
SDL_EnableUNICODE -- Enable UNICODE translation
SDL_EnableKeyRepeat -- Set keyboard repeat rate.
SDL_GetMouseState -- Retrieve the current state of the mouse
SDL_GetRelativeMouseState -- Retrieve the current state of the mouse
SDL_GetAppState -- Get the state of the application
SDL_JoystickEventState -- Enable/disable joystick event polling

SDL_PumpEventsPumps the event loop, gathering events from the input devices
SDL_PeepEventsChecks the event queue for messages and optionally returns them
SDL_PollEventPolls for currently pending events
SDL_WaitEventWaits indefinitely for the next available event
SDL_PushEventPushes an event onto the event queue
SDL_SetEventFilterSets up a filter to process all events
SDL_EventStateAllows you to set the state of processing certain events
SDL_GetKeyStateGet a snapshot of the current keyboard state
SDL_GetModStateGet the state of modifier keys
SDL_SetModStateSet the state of modifier keys
SDL_GetKeyNameGet the name of an SDL virtual keysym
SDL_EnableUNICODEEnable UNICODE translation
SDL_EnableKeyRepeatSet keyboard repeat rate
SDL_GetMouseStateRetrieve the current state of the mouse
SDL_GetRelativeMouseStateRetrieve the current state of the mouse
SDL_GetAppStateGet the state of the application
SDL_JoystickEventStateEnable/disable joystick event polling


PrevHomeNext
SDLKeyUpSDL_PumpEvents
\ No newline at end of file diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/eventstructures.html b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/eventstructures.html new file mode 100644 index 000000000..c95929622 --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/eventstructures.html @@ -0,0 +1,233 @@ +SDL Event Structures.
SDL Library Documentation
PrevChapter 8. EventsNext

SDL Event Structures.

Table of Contents
SDL_Event -- General event structure
SDL_ActiveEvent -- Application visibility event structure
SDL_KeyboardEvent -- Keyboard event structure
SDL_MouseMotionEvent -- Mouse motion event structure
SDL_MouseButtonEvent -- Mouse button event structure
SDL_JoyAxisEvent -- Joystick axis motion event structure
SDL_JoyButtonEvent -- Joystick button event structure
SDL_JoyHatEvent -- Joystick hat position change event structure
SDL_JoyBallEvent -- Joystick trackball motion event structure
SDL_ResizeEvent -- Window resize event structure
SDL_ExposeEvent -- Quit requested event
SDL_SysWMEvent -- Platform-dependent window manager event.
SDL_UserEvent -- A user-defined event type
SDL_QuitEvent -- Quit requested event
SDL_keysym -- Keysym structure
SDLKey -- Keysym definitions.

PrevHomeNext
EventsUpSDL_Event
\ No newline at end of file diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/general.html b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/general.html new file mode 100644 index 000000000..0beb5919f --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/general.html @@ -0,0 +1,225 @@ +General
SDL Library Documentation
PrevNext

Chapter 5. General

Table of Contents
SDL_Init -- Initializes SDL
SDL_InitSubSystem -- Initialize subsystems
SDL_QuitSubSystem -- Shut down a subsystem
SDL_Quit -- Shut down SDL
SDL_WasInit -- Check which subsystems are initialized
SDL_GetError -- Get SDL error string
SDL_envvars -- SDL environment variables

Before SDL can be used in a program it must be initialized with SDL_Init. SDL_Init initializes all the subsystems that the user requests (video, audio, joystick, timers and/or cdrom). Once SDL is initialized with SDL_Init subsystems can be shut down and initialized as needed using SDL_InitSubSystem and SDL_QuitSubSystem.

SDL must also be shut down before the program exits to make sure it cleans up correctly. Calling SDL_Quit shuts down all subsystems and frees any resources allocated to SDL.


PrevHomeNext
SDL ReferenceUpSDL_Init
\ No newline at end of file diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/guide.html b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/guide.html new file mode 100644 index 000000000..2c1297ee2 --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/guide.html @@ -0,0 +1,174 @@ +SDL Guide
SDL Library Documentation
PrevNext

I. SDL Guide


PrevHomeNext
SDL Library Documentation Preface
\ No newline at end of file diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/guideaboutsdldoc.html b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/guideaboutsdldoc.html new file mode 100644 index 000000000..cdb0d783c --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/guideaboutsdldoc.html @@ -0,0 +1,148 @@ +About SDLdoc
SDL Library Documentation
PrevPrefaceNext

About SDLdoc

SDLdoc (The SDL Documentation Project) was formed to completely rewrite the SDL documentation and to keep it continually up to date. The team consists completely of volunteers ranging from people working with SDL in their spare time to people who use SDL in their everyday working lives.

The latest version of this documentation can always be found here: http://sdldoc.csn.ul.ie Downloadable PS, man pages and html tarballs are available at http://sdldoc.csn.ul.ie/pub/


PrevHomeNext
PrefaceUpCredits
\ No newline at end of file diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/guideaudioexamples.html b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/guideaudioexamples.html new file mode 100644 index 000000000..afb7522be --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/guideaudioexamples.html @@ -0,0 +1,228 @@ +Audio Examples
SDL Library Documentation
PrevChapter 4. ExamplesNext

Audio Examples

Opening the audio device

    SDL_AudioSpec wanted;
+    extern void fill_audio(void *udata, Uint8 *stream, int len);
+
+    /* Set the audio format */
+    wanted.freq = 22050;
+    wanted.format = AUDIO_S16;
+    wanted.channels = 2;    /* 1 = mono, 2 = stereo */
+    wanted.samples = 1024;  /* Good low-latency value for callback */
+    wanted.callback = fill_audio;
+    wanted.userdata = NULL;
+
+    /* Open the audio device, forcing the desired format */
+    if ( SDL_OpenAudio(&wanted, NULL) < 0 ) {
+        fprintf(stderr, "Couldn't open audio: %s\n", SDL_GetError());
+        return(-1);
+    }
+    return(0);

Playing audio

    static Uint8 *audio_chunk;
+    static Uint32 audio_len;
+    static Uint8 *audio_pos;
+
+    /* The audio function callback takes the following parameters:
+       stream:  A pointer to the audio buffer to be filled
+       len:     The length (in bytes) of the audio buffer
+    */
+    void fill_audio(void *udata, Uint8 *stream, int len)
+    {
+        /* Only play if we have data left */
+        if ( audio_len == 0 )
+            return;
+
+        /* Mix as much data as possible */
+        len = ( len > audio_len ? audio_len : len );
+        SDL_MixAudio(stream, audio_pos, len, SDL_MIX_MAXVOLUME);
+        audio_pos += len;
+        audio_len -= len;
+    }
+
+    /* Load the audio data ... */
+
+    ;;;;;
+
+    audio_pos = audio_chunk;
+
+    /* Let the callback function play the audio chunk */
+    SDL_PauseAudio(0);
+
+    /* Do some processing */
+
+    ;;;;;
+
+    /* Wait for sound to complete */
+    while ( audio_len > 0 ) {
+        SDL_Delay(100);         /* Sleep 1/10 second */
+    }
+    SDL_CloseAudio();


PrevHomeNext
Event ExamplesUpCDROM Examples
\ No newline at end of file diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/guidebasicsinit.html b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/guidebasicsinit.html new file mode 100644 index 000000000..faafdbd92 --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/guidebasicsinit.html @@ -0,0 +1,240 @@ +Initializing SDL
SDL Library Documentation
PrevChapter 1. The BasicsNext

Initializing SDL

SDL is composed of eight subsystems - Audio, CDROM, Event Handling, File I/O, Joystick Handling, Threading, Timers and Video. Before you can use any of these subsystems they must be initialized by calling SDL_Init (or SDL_InitSubSystem). SDL_Init must be called before any other SDL function. It automatically initializes the Event Handling, File I/O and Threading subsystems and it takes a parameter specifying which other subsystems to initialize. So, to initialize the default subsystems and the Video subsystems you would call: +

    SDL_Init ( SDL_INIT_VIDEO );
+To initialize the default subsystems, the Video subsystem and the Timers subsystem you would call: +
    SDL_Init ( SDL_INIT_VIDEO | SDL_INIT_TIMER );

SDL_Init is complemented by SDL_Quit (and SDL_QuitSubSystem). SDL_Quit shuts down all subsystems, including the default ones. It should always be called before a SDL application exits.

With SDL_Init and SDL_Quit firmly embedded in your programmers toolkit you can write your first and most basic SDL application. However, we must be prepare to handle errors. Many SDL functions return a value and indicates whether the function has succeeded or failed, SDL_Init, for instance, returns -1 if it could not initialize a subsystem. SDL provides a useful facility that allows you to determine exactly what the problem was, every time an error occurs within SDL an error message is stored which can be retrieved using SDL_GetError. Use this often, you can never know too much about an error.

Example 1-1. Initializing SDL

#include "SDL.h"   /* All SDL App's need this */
+#include <stdio.h>
+
+int main(int argc, char *argv[]) {
+    
+    printf("Initializing SDL.\n");
+    
+    /* Initialize defaults, Video and Audio */
+    if((SDL_Init(SDL_INIT_VIDEO|SDL_INIT_AUDIO)==-1)) { 
+        printf("Could not initialize SDL: %s.\n", SDL_GetError());
+        exit(-1);
+    }
+
+    printf("SDL initialized.\n");
+
+    printf("Quiting SDL.\n");
+    
+    /* Shutdown all subsystems */
+    SDL_Quit();
+    
+    printf("Quiting....\n");
+
+    exit(0);
+}

PrevHomeNext
The BasicsUpGraphics and Video
\ No newline at end of file diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/guidecdromexamples.html b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/guidecdromexamples.html new file mode 100644 index 000000000..2bc5a16cb --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/guidecdromexamples.html @@ -0,0 +1,275 @@ +CDROM Examples
SDL Library Documentation
PrevChapter 4. ExamplesNext

CDROM Examples

Listing CD-ROM drives

    #include "SDL.h"
+
+    /* Initialize SDL first */
+    if ( SDL_Init(SDL_INIT_CDROM) < 0 ) {
+        fprintf(stderr, "Couldn't initialize SDL: %s\n",SDL_GetError());
+        exit(1);
+    }
+    atexit(SDL_Quit);
+
+    /* Find out how many CD-ROM drives are connected to the system */
+    printf("Drives available: %d\n", SDL_CDNumDrives());
+    for ( i=0; i<SDL_CDNumDrives(); ++i ) {
+        printf("Drive %d:  \"%s\"\n", i, SDL_CDName(i));
+    }

Opening the default drive

    SDL_CD *cdrom;
+    CDstatus status;
+    char *status_str;
+
+    cdrom = SDL_CDOpen(0);
+    if ( cdrom == NULL ) {
+        fprintf(stderr, "Couldn't open default CD-ROM drive: %s\n",
+                        SDL_GetError());
+        exit(2);
+    }
+
+    status = SDL_CDStatus(cdrom);
+    switch (status) {
+        case CD_TRAYEMPTY:
+            status_str = "tray empty";
+            break;
+        case CD_STOPPED:
+            status_str = "stopped";
+            break;
+        case CD_PLAYING:
+            status_str = "playing";
+            break;
+        case CD_PAUSED:
+            status_str = "paused";
+            break;
+        case CD_ERROR:
+            status_str = "error state";
+            break;
+    }
+    printf("Drive status: %s\n", status_str);
+    if ( status >= CD_PLAYING ) {
+        int m, s, f;
+        FRAMES_TO_MSF(cdrom->cur_frame, &m, &s, &f);
+        printf("Currently playing track %d, %d:%2.2d\n",
+        cdrom->track[cdrom->cur_track].id, m, s);
+    }

Listing the tracks on a CD

    SDL_CD *cdrom;          /* Assuming this has already been set.. */
+    int i;
+    int m, s, f;
+
+    SDL_CDStatus(cdrom);
+    printf("Drive tracks: %d\n", cdrom->numtracks);
+    for ( i=0; i<cdrom->numtracks; ++i ) {
+        FRAMES_TO_MSF(cdrom->track[i].length, &m, &s, &f);
+        if ( f > 0 )
+            ++s;
+        printf("\tTrack (index %d) %d: %d:%2.2d\n", i,
+        cdrom->track[i].id, m, s);
+    }

Play an entire CD

    SDL_CD *cdrom;          /* Assuming this has already been set.. */
+
+    // Play entire CD:
+    if ( CD_INDRIVE(SDL_CDStatus(cdrom)) )
+        SDL_CDPlayTracks(cdrom, 0, 0, 0, 0);
+
+        // Play last track:
+        if ( CD_INDRIVE(SDL_CDStatus(cdrom)) ) {
+            SDL_CDPlayTracks(cdrom, cdrom->numtracks-1, 0, 0, 0);
+        }
+
+        // Play first and second track and 10 seconds of third track:
+        if ( CD_INDRIVE(SDL_CDStatus(cdrom)) )
+            SDL_CDPlayTracks(cdrom, 0, 0, 2, CD_FPS * 10);


PrevHomeNext
Audio ExamplesUpTime Examples
\ No newline at end of file diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/guidecredits.html b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/guidecredits.html new file mode 100644 index 000000000..b66b28f54 --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/guidecredits.html @@ -0,0 +1,195 @@ +Credits
SDL Library Documentation
PrevPrefaceNext

Credits

Sam Lantinga, slouken@libsdl.org
Martin Donlon, akawaka@skynet.ie
Mattias Engdegård
Julian Peterson
Ken Jordan
Maxim Sobolev
Wesley Poole
Michael Vance
Andreas Umbach
Andreas Hofmeister


PrevHomeNext
About SDLdocUpThe Basics
\ No newline at end of file diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/guideeventexamples.html b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/guideeventexamples.html new file mode 100644 index 000000000..300136947 --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/guideeventexamples.html @@ -0,0 +1,247 @@ +Event Examples
SDL Library Documentation
PrevChapter 4. ExamplesNext

Event Examples

Filtering and Handling Events

#include <stdio.h>
+#include <stdlib.h>
+
+#include "SDL.h"
+
+/* This function may run in a separate event thread */
+int FilterEvents(const SDL_Event *event) {
+    static int boycott = 1;
+
+    /* This quit event signals the closing of the window */
+    if ( (event->type == SDL_QUIT) && boycott ) {
+        printf("Quit event filtered out -- try again.\n");
+        boycott = 0;
+        return(0);
+    }
+    if ( event->type == SDL_MOUSEMOTION ) {
+        printf("Mouse moved to (%d,%d)\n",
+                event->motion.x, event->motion.y);
+        return(0);    /* Drop it, we've handled it */
+    }
+    return(1);
+}
+
+int main(int argc, char *argv[])
+{
+    SDL_Event event;
+
+    /* Initialize the SDL library (starts the event loop) */
+    if ( SDL_Init(SDL_INIT_VIDEO) < 0 ) {
+        fprintf(stderr,
+                "Couldn't initialize SDL: %s\n", SDL_GetError());
+        exit(1);
+    }
+
+    /* Clean up on exit, exit on window close and interrupt */
+    atexit(SDL_Quit);
+
+    /* Ignore key events */
+    SDL_EventState(SDL_KEYDOWN, SDL_IGNORE);
+    SDL_EventState(SDL_KEYUP, SDL_IGNORE);
+
+    /* Filter quit and mouse motion events */
+    SDL_SetEventFilter(FilterEvents);
+
+    /* The mouse isn't much use unless we have a display for reference */
+    if ( SDL_SetVideoMode(640, 480, 8, 0) == NULL ) {
+        fprintf(stderr, "Couldn't set 640x480x8 video mode: %s\n",
+                        SDL_GetError());
+        exit(1);
+    }
+
+    /* Loop waiting for ESC+Mouse_Button */
+    while ( SDL_WaitEvent(&event) >= 0 ) {
+        switch (event.type) {
+            case SDL_ACTIVEEVENT: {
+                if ( event.active.state & SDL_APPACTIVE ) {
+                    if ( event.active.gain ) {
+                        printf("App activated\n");
+                    } else {
+                        printf("App iconified\n");
+                    }
+                }
+            }
+            break;
+                    
+            case SDL_MOUSEBUTTONDOWN: {
+                Uint8 *keys;
+
+                keys = SDL_GetKeyState(NULL);
+                if ( keys[SDLK_ESCAPE] == SDL_PRESSED ) {
+                    printf("Bye bye...\n");
+                    exit(0);
+                }
+                printf("Mouse button pressed\n");
+            }
+            break;
+
+            case SDL_QUIT: {
+                printf("Quit requested, quitting.\n");
+                exit(0);
+            }
+            break;
+        }
+    }
+    /* This should never happen */
+    printf("SDL_WaitEvent error: %s\n", SDL_GetError());
+    exit(1);
+}


PrevHomeNext
ExamplesUpAudio Examples
\ No newline at end of file diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/guideexamples.html b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/guideexamples.html new file mode 100644 index 000000000..5b9a8471d --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/guideexamples.html @@ -0,0 +1,188 @@ +Examples
SDL Library Documentation
PrevNext

Chapter 4. Examples

Introduction

For the moment these examples are taken directly from the old SDL documentation. By the 1.2 release these examples should hopefully deal with most common SDL programming problems.


PrevHomeNext
Handling the KeyboardUpEvent Examples
\ No newline at end of file diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/guideinput.html b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/guideinput.html new file mode 100644 index 000000000..4a82b6761 --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/guideinput.html @@ -0,0 +1,739 @@ +Input handling
SDL Library Documentation
PrevNext

Chapter 3. Input handling

Handling Joysticks

Initialization

The first step in using a joystick in a SDL program is to initialize the Joystick subsystems of SDL. This done by passing the SDL_INIT_JOYSTICK flag to SDL_Init. The joystick flag will usually be used in conjunction with other flags (like the video flag) because the joystick is usually used to control something.

Example 3-1. Initializing SDL with Joystick Support

    if (SDL_Init( SDL_INIT_VIDEO | SDL_INIT_JOYSTICK ) < 0)
+    {
+        fprintf(stderr, "Couldn't initialize SDL: %s\n", SDL_GetError());
+        exit(1);
+    }

This will attempt to start SDL with both the video and the joystick subsystems activated.

Querying

If we have reached this point then we can safely assume that the SDL library has been initialized and that the Joystick subsystem is active. We can now call some video and/or sound functions to get things going before we need the joystick. Eventually we have to make sure that there is actually a joystick to work with. It's wise to always check even if you know a joystick will be present on the system because it can also help detect when the joystick is unplugged. The function used to check for joysticks is SDL_NumJoysticks.

This function simply returns the number of joysticks available on the system. If it is at least one then we are in good shape. The next step is to determine which joystick the user wants to use. If the number of joysticks available is only one then it is safe to assume that one joystick is the one the user wants to use. SDL has a function to get the name of the joysticks as assigned by the operations system and that function is SDL_JoystickName. The joystick is specified by an index where 0 is the first joystick and the last joystick is the number returned by SDL_NumJoysticks - 1. In the demonstration a list of all available joysticks is printed to stdout.

Example 3-2. Querying the Number of Available Joysticks

    printf("%i joysticks were found.\n\n", SDL_NumJoysticks() );
+    printf("The names of the joysticks are:\n");
+		
+    for( i=0; i < SDL_NumJoysticks(); i++ ) 
+    {
+        printf("    %s\n", SDL_JoystickName(i));
+    }

Opening a Joystick and Receiving Joystick Events

SDL's event driven architecture makes working with joysticks a snap. Joysticks can trigger 4 different types of events: +

SDL_JoyAxisEventOccurs when an axis changes
SDL_JoyBallEventOccurs when a joystick trackball's position changes
SDL_JoyHatEventOccurs when a hat's position changes
SDL_JoyButtonEventOccurs when a button is pressed or released

Events are received from all joysticks opened. The first thing that needs to be done in order to receive joystick events is to call SDL_JoystickEventState with the SDL_ENABLE flag. Next you must open the joysticks that you want to receive envents from. This is done with the SDL_JoystickOpen function. For the example we are only interested in events from the first joystick on the system, regardless of what it may be. To receive events from it we would do this:

Example 3-3. Opening a Joystick

    SDL_Joystick *joystick;
+
+    SDL_JoystickEventState(SDL_ENABLE);
+    joystick = SDL_JoystickOpen(0);

If we wanted to receive events for other joysticks we would open them with calls to SDL_JoystickOpen just like we opened joystick 0, except we would store the SDL_Joystick structure they return in a different pointer. We only need the joystick pointer when we are querying the joysticks or when we are closing the joystick.

Up to this point all the code we have is used just to initialize the joysticks in order to read values at run time. All we need now is an event loop, which is something that all SDL programs should have anyway to receive the systems quit events. We must now add code to check the event loop for at least some of the above mentioned events. Let's assume our event loop looks like this: +

    SDL_Event event;
+    /* Other initializtion code goes here */   
+
+    /* Start main game loop here */
+
+    while(SDL_PollEvent(&event))
+    {  
+        switch(event.type)
+        {  
+            case SDL_KEYDOWN:
+            /* handle keyboard stuff here */				
+            break;
+
+            case SDL_QUIT:
+            /* Set whatever flags are necessary to */
+            /* end the main game loop here */
+            break;
+        }
+    }
+
+    /* End loop here */
+To handle Joystick events we merely add cases for them, first we'll add axis handling code. Axis checks can get kinda of tricky because alot of the joystick events received are junk. Joystick axis have a tendency to vary just a little between polling due to the way they are designed. To compensate for this you have to set a threshold for changes and ignore the events that have'nt exceeded the threshold. 10% is usually a good threshold value. This sounds a lot more complicated than it is. Here is the Axis event handler:

Example 3-4. Joystick Axis Events

    case SDL_JOYAXISMOTION:  /* Handle Joystick Motion */
+    if ( ( event.jaxis.value < -3200 ) || (event.jaxis.value > 3200 ) ) 
+    {
+      /* code goes here */
+    }
+    break;

Another trick with axis events is that up-down and left-right movement are two different sets of axes. The most important axis is axis 0 (left-right) and axis 1 (up-down). To handle them seperatly in the code we do the following:

Example 3-5. More Joystick Axis Events

    case SDL_JOYAXISMOTION:  /* Handle Joystick Motion */
+    if ( ( event.jaxis.value < -3200 ) || (event.jaxis.value > 3200 ) ) 
+    {
+        if( event.jaxis.axis == 0) 
+        {
+            /* Left-right movement code goes here */
+        }
+
+        if( event.jaxis.axis == 1) 
+        {
+            /* Up-Down movement code goes here */
+        }
+    }
+    break;

Ideally the code here should use event.jaxis.value to scale something. For example lets assume you are using the joystick to control the movement of a spaceship. If the user is using an analog joystick and they push the stick a little bit they expect to move less than if they pushed it a lot. Designing your code for this situation is preferred because it makes the experience for users of analog controls better and remains the same for users of digital controls.

If your joystick has any additional axis then they may be used for other sticks or throttle controls and those axis return values too just with different event.jaxis.axis values.

Button handling is simple compared to the axis checking.

Example 3-6. Joystick Button Events

    case SDL_JOYBUTTONDOWN:  /* Handle Joystick Button Presses */
+    if ( event.jbutton.button == 0 ) 
+    {
+        /* code goes here */
+    }
+    break;

Button checks are simpler than axis checks because a button can only be pressed or not pressed. The SDL_JOYBUTTONDOWN event is triggered when a button is pressed and the SDL_JOYBUTTONUP event is fired when a button is released. We do have to know what button was pressed though, that is done by reading the event.jbutton.button field.

Lastly when we are through using our joysticks we should close them with a call to SDL_JoystickClose. To close our opened joystick 0 we would do this at the end of our program: +

    SDL_JoystickClose(joystick);

Advanced Joystick Functions

That takes care of the controls that you can count on being on every joystick under the sun, but there are a few extra things that SDL can support. Joyballs are next on our list, they are alot like axis with a few minor differences. Joyballs store relative changes unlike the the absolute postion stored in a axis event. Also one trackball event contains both the change in x and they change in y. Our case for it is as follows:

Example 3-7. Joystick Ball Events

    case SDL_JOYBALLMOTION:  /* Handle Joyball Motion */
+    if( event.jball.ball == 0 )
+    {
+      /* ball handling */
+    }
+    break;

The above checks the first joyball on the joystick. The change in position will be stored in event.jball.xrel and event.jball.yrel.

Finally we have the hat event. Hats report only the direction they are pushed in. We check hat's position with the bitmasks: + +

SDL_HAT_CENTERED
SDL_HAT_UP
SDL_HAT_RIGHT
SDL_HAT_DOWN
SDL_HAT_LEFT

+ +Also there are some predefined combinations of the above: +

SDL_HAT_RIGHTUP
SDL_HAT_RIGHTDOWN
SDL_HAT_LEFTUP
SDL_HAT_LEFTDOWN

+ +Our case for the hat may resemble the following:

Example 3-8. Joystick Hat Events

    case SDL_JOYHATMOTION:  /* Handle Hat Motion */
+    if ( event.jhat.value & SDL_HAT_UP )
+    {
+        /* Do up stuff here */
+    }
+
+    if ( event.jhat.value & SDL_HAT_LEFT )
+    {
+        /* Do left stuff here */
+    }
+
+    if ( event.jhat.value & SDL_HAT_RIGHTDOWN )
+    {
+        /* Do right and down together stuff here */
+    }
+    break;

In addition to the queries for number of joysticks on the system and their names there are additional functions to query the capabilities of attached joysticks: +

SDL_JoystickNumAxesReturns the number of joysitck axes
SDL_JoystickNumButtonsReturns the number of joysitck buttons
SDL_JoystickNumBallsReturns the number of joysitck balls
SDL_JoystickNumHatsReturns the number of joysitck hats

+ +To use these functions we just have to pass in the joystick structure we got when we opened the joystick. For Example:

Example 3-9. Querying Joystick Characteristics

    int number_of_buttons;
+    SDL_Joystick *joystick;
+
+    joystick = SDL_JoystickOpen(0);
+    number_of_buttons = SDL_JoystickNumButtons(joystick);

This block of code would get the number of buttons on the first joystick in the system.


PrevHomeNext
Using OpenGL With SDLUpHandling the Keyboard
\ No newline at end of file diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/guideinputkeyboard.html b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/guideinputkeyboard.html new file mode 100644 index 000000000..787036c7f --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/guideinputkeyboard.html @@ -0,0 +1,746 @@ +Handling the Keyboard
SDL Library Documentation
PrevChapter 3. Input handlingNext

Handling the Keyboard

Keyboard Related Structures

It should make it a lot easier to understand this tutorial is you are familiar with the data types involved in keyboard access, so I'll explain them first.

SDLKey

SDLKey is an enumerated type defined in SDL/include/SDL_keysym.h and detailed here. Each SDLKey symbol represents a key, SDLK_a corresponds to the 'a' key on a keyboard, SDLK_SPACE corresponds to the space bar, and so on.

SDLMod

SDLMod is an enumerated type, similar to SDLKey, however it enumerates keyboard modifiers (Control, Alt, Shift). The full list of modifier symbols is here. SDLMod values can be AND'd together to represent several modifiers.

SDL_keysym

typedef struct{
+  Uint8 scancode;
+  SDLKey sym;
+  SDLMod mod;
+  Uint16 unicode;
+} SDL_keysym;

The SDL_keysym structure describes a key press or a key release. The scancode field is hardware specific and should be ignored unless you know what your doing. The sym field is the SDLKey value of the key being pressed or released. The mod field describes the state of the keyboard modifiers at the time the key press or release occurred. So a value of KMOD_NUM | KMOD_CAPS | KMOD_LSHIFT would mean that Numlock, Capslock and the left shift key were all press (or enabled in the case of the lock keys). Finally, the unicode field stores the 16-bit unicode value of the key.

Note: It should be noted and understood that this field is only valid when the SDL_keysym is describing a key press, not a key release. Unicode values only make sense on a key press because the unicode value describes an international character and only key presses produce characters. More information on Unicode can be found at www.unicode.org

Note: Unicode translation must be enabled using the SDL_EnableUNICODE function.

SDL_KeyboardEvent

typedef struct{
+  Uint8 type;
+  Uint8 state;
+  SDL_keysym keysym;
+} SDL_KeyboardEvent;

The SDL_KeyboardEvent describes a keyboard event (obviously). The key member of the SDL_Event union is a SDL_KeyboardEvent structure. The type field specifies whether the event is a key release (SDL_KEYUP) or a key press (SDL_KEYDOWN) event. The state is largely redundant, it reports the same information as the type field but uses different values (SDL_RELEASED and SDL_PRESSED). The keysym contains information of the key press or release that this event represents (see above).

Reading Keyboard Events

Reading keybaord events from the event queue is quite simple (the event queue and using it is described here). We read events using SDL_PollEvent in a while() loop and check for SDL_KEYUP and SDL_KEYDOWN events using a switch statement, like so:

Example 3-10. Reading Keyboard Events

  SDL_Event event;
+  .
+  .
+  /* Poll for events. SDL_PollEvent() returns 0 when there are no  */
+  /* more events on the event queue, our while loop will exit when */
+  /* that occurs.                                                  */
+  while( SDL_PollEvent( &event ) ){
+    /* We are only worried about SDL_KEYDOWN and SDL_KEYUP events */
+    switch( event.type ){
+      case SDL_KEYDOWN:
+        printf( "Key press detected\n" );
+        break;
+
+      case SDL_KEYUP:
+        printf( "Key release detected\n" );
+        break;
+
+      default:
+        break;
+    }
+  }
+  .
+  .

This is a very basic example. No information about the key press or release is interpreted. We will explore the other extreme out our first full example below - reporting all available information about a keyboard event.

A More Detailed Look

Before we can read events SDL must be initialised with SDL_Init and a video mode must be set using SDL_SetVideoMode. There are, however, two other functions we must use to obtain all the information required. We must enable unicode translation by calling SDL_EnableUNICODE(1) and we must convert SDLKey values into something printable, using SDL_GetKeyName

Note: It is useful to note that unicode values < 0x80 translate directly a characters ASCII value. THis is used in the example below

Example 3-11. Interpreting Key Event Information


    #include "SDL.h"
+
+    /* Function Prototypes */
+    void PrintKeyInfo( SDL_KeyboardEvent *key );
+    void PrintModifiers( SDLMod mod );
+
+    /* main */
+    int main( int argc, char *argv[] ){
+        
+        SDL_Event event;
+        int quit = 0;
+        
+        /* Initialise SDL */
+        if( SDL_Init( SDL_INIT_VIDEO ) < 0){
+            fprintf( stderr, "Could not initialise SDL: %s\n", SDL_GetError() );
+            exit( -1 );
+        }
+
+        /* Set a video mode */
+        if( !SDL_SetVideoMode( 320, 200, 0, 0 ) ){
+            fprintf( stderr, "Could not set video mode: %s\n", SDL_GetError() );
+            SDL_Quit();
+            exit( -1 );
+        }
+
+        /* Enable Unicode translation */
+        SDL_EnableUNICODE( 1 );
+
+        /* Loop until an SDL_QUIT event is found */
+        while( !quit ){
+
+            /* Poll for events */
+            while( SDL_PollEvent( &event ) ){
+                
+                switch( event.type ){
+                    /* Keyboard event */
+                    /* Pass the event data onto PrintKeyInfo() */
+                    case SDL_KEYDOWN:
+                    case SDL_KEYUP:
+                        PrintKeyInfo( &event.key );
+                        break;
+
+                    /* SDL_QUIT event (window close) */
+                    case SDL_QUIT:
+                        quit = 1;
+                        break;
+
+                    default:
+                        break;
+                }
+
+            }
+
+        }
+
+        /* Clean up */
+        SDL_Quit();
+        exit( 0 );
+    }
+
+    /* Print all information about a key event */
+    void PrintKeyInfo( SDL_KeyboardEvent *key ){
+        /* Is it a release or a press? */
+        if( key->type == SDL_KEYUP )
+            printf( "Release:- " );
+        else
+            printf( "Press:- " );
+
+        /* Print the hardware scancode first */
+        printf( "Scancode: 0x%02X", key->keysym.scancode );
+        /* Print the name of the key */
+        printf( ", Name: %s", SDL_GetKeyName( key->keysym.sym ) );
+        /* We want to print the unicode info, but we need to make */
+        /* sure its a press event first (remember, release events */
+        /* don't have unicode info                                */
+        if( key->type == SDL_KEYDOWN ){
+            /* If the Unicode value is less than 0x80 then the    */
+            /* unicode value can be used to get a printable       */
+            /* representation of the key, using (char)unicode.    */
+            printf(", Unicode: " );
+            if( key->keysym.unicode < 0x80 && key->keysym.unicode > 0 ){
+                printf( "%c (0x%04X)", (char)key->keysym.unicode,
+                        key->keysym.unicode );
+            }
+            else{
+                printf( "? (0x%04X)", key->keysym.unicode );
+            }
+        }
+        printf( "\n" );
+        /* Print modifier info */
+        PrintModifiers( key->keysym.mod );
+    }
+
+    /* Print modifier info */
+    void PrintModifiers( SDLMod mod ){
+        printf( "Modifers: " );
+
+        /* If there are none then say so and return */
+        if( mod == KMOD_NONE ){
+            printf( "None\n" );
+            return;
+        }
+
+        /* Check for the presence of each SDLMod value */
+        /* This looks messy, but there really isn't    */
+        /* a clearer way.                              */
+        if( mod & KMOD_NUM ) printf( "NUMLOCK " );
+        if( mod & KMOD_CAPS ) printf( "CAPSLOCK " );
+        if( mod & KMOD_LCTRL ) printf( "LCTRL " );
+        if( mod & KMOD_RCTRL ) printf( "RCTRL " );
+        if( mod & KMOD_RSHIFT ) printf( "RSHIFT " );
+        if( mod & KMOD_LSHIFT ) printf( "LSHIFT " );
+        if( mod & KMOD_RALT ) printf( "RALT " );
+        if( mod & KMOD_LALT ) printf( "LALT " );
+        if( mod & KMOD_CTRL ) printf( "CTRL " );
+        if( mod & KMOD_SHIFT ) printf( "SHIFT " );
+        if( mod & KMOD_ALT ) printf( "ALT " );
+        printf( "\n" );
+    }

Game-type Input

I have found that people using keyboard events for games and other interactive applications don't always understand one fundemental point.

Keyboard events only take place when a keys state changes from being unpressed to pressed, and vice versa.

Imagine you have an image of an alien that you wish to move around using the cursor keys: when you pressed the left arrow key you want him to slide over to the left, and when you press the down key you want him to slide down the screen. Examine the following code; it highlights an error that many people have made. +

    /* Alien screen coordinates */
+    int alien_x=0, alien_y=0;
+    .
+    .
+    /* Initialise SDL and video modes and all that */
+    .
+    /* Main game loop */
+    /* Check for events */
+    while( SDL_PollEvent( &event ) ){
+        switch( event.type ){
+            /* Look for a keypress */
+            case SDL_KEYDOWN:
+                /* Check the SDLKey values and move change the coords */
+                switch( event.key.keysym.sym ){
+                    case SDLK_LEFT:
+                        alien_x -= 1;
+                        break;
+                    case SDLK_RIGHT:
+                        alien_x += 1;
+                        break;
+                    case SDLK_UP:
+                        alien_y -= 1;
+                        break;
+                    case SDLK_DOWN:
+                        alien_y += 1;
+                        break;
+                    default:
+                        break;
+                }
+            }
+        }
+    }
+    .
+    .
+At first glance you may think this is a perfectly reasonable piece of code for the task, but it isn't. Like I said keyboard events only occur when a key changes state, so the user would have to press and release the left cursor key 100 times to move the alien 100 pixels to the left.

To get around this problem we must not use the events to change the position of the alien, we use the events to set flags which are then used in a seperate section of code to move the alien. Something like this:

Example 3-12. Proper Game Movement

    /* Alien screen coordinates */
+    int alien_x=0, alien_y=0;
+    int alien_xvel=0, alien_yvel=0;
+    .
+    .
+    /* Initialise SDL and video modes and all that */
+    .
+    /* Main game loop */
+    /* Check for events */
+    while( SDL_PollEvent( &event ) ){
+        switch( event.type ){
+            /* Look for a keypress */
+            case SDL_KEYDOWN:
+                /* Check the SDLKey values and move change the coords */
+                switch( event.key.keysym.sym ){
+                    case SDLK_LEFT:
+                        alien_xvel = -1;
+                        break;
+                    case SDLK_RIGHT:
+                        alien_xvel =  1;
+                        break;
+                    case SDLK_UP:
+                        alien_yvel = -1;
+                        break;
+                    case SDLK_DOWN:
+                        alien_yvel =  1;
+                        break;
+                    default:
+                        break;
+                }
+                break;
+            /* We must also use the SDL_KEYUP events to zero the x */
+            /* and y velocity variables. But we must also be       */
+            /* careful not to zero the velocities when we shouldn't*/
+            case SDL_KEYUP:
+                switch( event.key.keysym.sym ){
+                    case SDLK_LEFT:
+                        /* We check to make sure the alien is moving */
+                        /* to the left. If it is then we zero the    */
+                        /* velocity. If the alien is moving to the   */
+                        /* right then the right key is still press   */
+                        /* so we don't tocuh the velocity            */
+                        if( alien_xvel < 0 )
+                            alien_xvel = 0;
+                        break;
+                    case SDLK_RIGHT:
+                        if( alien_xvel > 0 )
+                            alien_xvel = 0;
+                        break;
+                    case SDLK_UP:
+                        if( alien_yvel < 0 )
+                            alien_yvel = 0;
+                        break;
+                    case SDLK_DOWN:
+                        if( alien_yvel > 0 )
+                            alien_yvel = 0;
+                        break;
+                    default:
+                        break;
+                }
+                break;
+            
+            default:
+                break;
+        }
+    }
+    .
+    .
+    /* Update the alien position */
+    alien_x += alien_xvel;
+    alien_y += alien_yvel;

As can be seen, we use two extra variables, alien_xvel and alien_yvel, which represent the motion of the ship, it is these variables that we update when we detect keypresses and releases.


PrevHomeNext
Input handlingUpExamples
\ No newline at end of file diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/guidepreface.html b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/guidepreface.html new file mode 100644 index 000000000..9986fc6b7 --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/guidepreface.html @@ -0,0 +1,178 @@ +Preface
SDL Library Documentation
PrevNext

Preface

About SDL

The SDL library is designed to make it easy to write games that run on Linux, *BSD, MacOS, Win32 and BeOS using the various native high-performance media interfaces, (for video, audio, etc) and presenting a single source-code level API to your application. SDL is a fairly low level API, but using it, completely portable applications can be written with a great deal of flexibility.


PrevHomeNext
SDL GuideUpAbout SDLdoc
\ No newline at end of file diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/guidethebasics.html b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/guidethebasics.html new file mode 100644 index 000000000..4f32363f3 --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/guidethebasics.html @@ -0,0 +1,173 @@ +The Basics
SDL Library Documentation
PrevNext

Chapter 1. The Basics

Introduction

The SDL Guide section is pretty incomplete. If you feel you have anything to add mail akawaka@skynet.ie or visit http://akawaka.csn.ul.ie/tne/.


PrevHomeNext
CreditsUpInitializing SDL
\ No newline at end of file diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/guidetimeexamples.html b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/guidetimeexamples.html new file mode 100644 index 000000000..42b5019eb --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/guidetimeexamples.html @@ -0,0 +1,183 @@ +Time Examples
SDL Library Documentation
PrevChapter 4. ExamplesNext

Time Examples

Time based game loop

#define TICK_INTERVAL    30
+
+static Uint32 next_time;
+
+Uint32 time_left(void)
+{
+    Uint32 now;
+
+    now = SDL_GetTicks();
+    if(next_time <= now)
+        return 0;
+    else
+        return next_time - now;
+}
+
+
+/* main game loop */
+
+    next_time = SDL_GetTicks() + TICK_INTERVAL;
+    while ( game_running ) {
+        update_game_state();
+        SDL_Delay(time_left());
+        next_time += TICK_INTERVAL;
+    }


PrevHomeNext
CDROM ExamplesUpSDL Reference
\ No newline at end of file diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/guidevideo.html b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/guidevideo.html new file mode 100644 index 000000000..85da77d1f --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/guidevideo.html @@ -0,0 +1,463 @@ +Graphics and Video
SDL Library Documentation
PrevNext

Chapter 2. Graphics and Video

Introduction to SDL Video

Video is probably the most common thing that SDL is used for, and +so it has the most complete subsystem. Here are a few +examples to demonstrate the basics.

Initializing the Video Display

This is what almost all SDL programs have to do in one way or +another.

Example 2-1. Initializing the Video Display

    SDL_Surface *screen;
+
+    /* Initialize the SDL library */
+    if( SDL_Init(SDL_INIT_VIDEO) < 0 ) {
+        fprintf(stderr,
+                "Couldn't initialize SDL: %s\n", SDL_GetError());
+        exit(1);
+    }
+
+    /* Clean up on exit */
+    atexit(SDL_Quit);
+    
+    /*
+     * Initialize the display in a 640x480 8-bit palettized mode,
+     * requesting a software surface
+     */
+    screen = SDL_SetVideoMode(640, 480, 8, SDL_SWSURFACE);
+    if ( screen == NULL ) {
+        fprintf(stderr, "Couldn't set 640x480x8 video mode: %s\n",
+                        SDL_GetError());
+        exit(1);
+    }

Initializing the Best Video Mode

If you have a preference for a certain pixel depth but will accept any +other, use SDL_SetVideoMode with SDL_ANYFORMAT as below. You can also +use SDL_VideoModeOK() to find the native video mode that is closest to +the mode you request.

Example 2-2. Initializing the Best Video Mode

    /* Have a preference for 8-bit, but accept any depth */
+    screen = SDL_SetVideoMode(640, 480, 8, SDL_SWSURFACE|SDL_ANYFORMAT);
+    if ( screen == NULL ) {
+        fprintf(stderr, "Couldn't set 640x480x8 video mode: %s\n",
+                        SDL_GetError());
+        exit(1);
+    }
+    printf("Set 640x480 at %d bits-per-pixel mode\n",
+           screen->format->BitsPerPixel);

Loading and Displaying a BMP File

The following function loads and displays a BMP file given as +argument, once SDL is initialised and a video mode has been set.

Example 2-3. Loading and Displaying a BMP File

void display_bmp(char *file_name)
+{
+    SDL_Surface *image;
+
+    /* Load the BMP file into a surface */
+    image = SDL_LoadBMP(file_name);
+    if (image == NULL) {
+        fprintf(stderr, "Couldn't load %s: %s\n", file_name, SDL_GetError());
+        return;
+    }
+
+    /*
+     * Palettized screen modes will have a default palette (a standard
+     * 8*8*4 colour cube), but if the image is palettized as well we can
+     * use that palette for a nicer colour matching
+     */
+    if (image->format->palette && screen->format->palette) {
+    SDL_SetColors(screen, image->format->palette->colors, 0,
+                  image->format->palette->ncolors);
+    }
+
+    /* Blit onto the screen surface */
+    if(SDL_BlitSurface(image, NULL, screen, NULL) < 0)
+        fprintf(stderr, "BlitSurface error: %s\n", SDL_GetError());
+
+    SDL_UpdateRect(screen, 0, 0, image->w, image->h);
+
+    /* Free the allocated BMP surface */
+    SDL_FreeSurface(image);
+}

Drawing Directly to the Display

The following two functions can be used to get and set single +pixels of a surface. They are carefully written to work with any depth +currently supported by SDL. Remember to lock the surface before +calling them, and to unlock it before calling any other SDL +functions.

To convert between pixel values and their red, green, blue +components, use SDL_GetRGB() and SDL_MapRGB().

Example 2-4. getpixel()

/*
+ * Return the pixel value at (x, y)
+ * NOTE: The surface must be locked before calling this!
+ */
+Uint32 getpixel(SDL_Surface *surface, int x, int y)
+{
+    int bpp = surface->format->BytesPerPixel;
+    /* Here p is the address to the pixel we want to retrieve */
+    Uint8 *p = (Uint8 *)surface->pixels + y * surface->pitch + x * bpp;
+
+    switch(bpp) {
+    case 1:
+        return *p;
+
+    case 2:
+        return *(Uint16 *)p;
+
+    case 3:
+        if(SDL_BYTEORDER == SDL_BIG_ENDIAN)
+            return p[0] << 16 | p[1] << 8 | p[2];
+        else
+            return p[0] | p[1] << 8 | p[2] << 16;
+
+    case 4:
+        return *(Uint32 *)p;
+
+    default:
+        return 0;       /* shouldn't happen, but avoids warnings */
+    }
+}

Example 2-5. putpixel()

/*
+ * Set the pixel at (x, y) to the given value
+ * NOTE: The surface must be locked before calling this!
+ */
+void putpixel(SDL_Surface *surface, int x, int y, Uint32 pixel)
+{
+    int bpp = surface->format->BytesPerPixel;
+    /* Here p is the address to the pixel we want to set */
+    Uint8 *p = (Uint8 *)surface->pixels + y * surface->pitch + x * bpp;
+
+    switch(bpp) {
+    case 1:
+        *p = pixel;
+        break;
+
+    case 2:
+        *(Uint16 *)p = pixel;
+        break;
+
+    case 3:
+        if(SDL_BYTEORDER == SDL_BIG_ENDIAN) {
+            p[0] = (pixel >> 16) & 0xff;
+            p[1] = (pixel >> 8) & 0xff;
+            p[2] = pixel & 0xff;
+        } else {
+            p[0] = pixel & 0xff;
+            p[1] = (pixel >> 8) & 0xff;
+            p[2] = (pixel >> 16) & 0xff;
+        }
+        break;
+
+    case 4:
+        *(Uint32 *)p = pixel;
+        break;
+    }
+}

The following code uses the putpixel() function above to set a +yellow pixel in the middle of the screen.

Example 2-6. Using putpixel()


    /* Code to set a yellow pixel at the center of the screen */
+
+    int x, y;
+    Uint32 yellow;
+
+    /* Map the color yellow to this display (R=0xff, G=0xFF, B=0x00)
+       Note:  If the display is palettized, you must set the palette first.
+    */
+    yellow = SDL_MapRGB(screen->format, 0xff, 0xff, 0x00);
+
+    x = screen->w / 2;
+    y = screen->h / 2;
+
+    /* Lock the screen for direct access to the pixels */
+    if ( SDL_MUSTLOCK(screen) ) {
+        if ( SDL_LockSurface(screen) < 0 ) {
+            fprintf(stderr, "Can't lock screen: %s\n", SDL_GetError());
+            return;
+        }
+    }
+
+    putpixel(screen, x, y, yellow);
+
+    if ( SDL_MUSTLOCK(screen) ) {
+        SDL_UnlockSurface(screen);
+    }
+    /* Update just the part of the display that we've changed */
+    SDL_UpdateRect(screen, x, y, 1, 1);
+
+    return;

PrevHomeNext
Initializing SDLUpUsing OpenGL With SDL
\ No newline at end of file diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/guidevideoopengl.html b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/guidevideoopengl.html new file mode 100644 index 000000000..0abd56718 --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/guidevideoopengl.html @@ -0,0 +1,730 @@ +Using OpenGL With SDL
SDL Library Documentation
PrevChapter 2. Graphics and VideoNext

Using OpenGL With SDL

SDL has the ability to create and use OpenGL contexts on several platforms(Linux/X11, Win32, BeOS, MacOS Classic/Toolbox, Mac OS X, FreeBSD/X11 and Solaris/X11). This allows you to use SDL's audio, event handling, threads and times in your OpenGL applications (a function often performed by GLUT).

Initialisation

Initialising SDL to use OpenGL is not very different to initialising SDL normally. There are three differences; you must pass SDL_OPENGL to SDL_SetVideoMode, you must specify several GL attributes (depth buffer size, framebuffer sizes) using SDL_GL_SetAttribute and finally, if you wish to use double buffering you must specify it as a GL attribute, not by passing the SDL_DOUBLEBUF flag to SDL_SetVideoMode.

Example 2-7. Initializing SDL with OpenGL

    /* Information about the current video settings. */
+    const SDL_VideoInfo* info = NULL;
+    /* Dimensions of our window. */
+    int width = 0;
+    int height = 0;
+    /* Color depth in bits of our window. */
+    int bpp = 0;
+    /* Flags we will pass into SDL_SetVideoMode. */
+    int flags = 0;
+
+    /* First, initialize SDL's video subsystem. */
+    if( SDL_Init( SDL_INIT_VIDEO ) < 0 ) {
+        /* Failed, exit. */
+        fprintf( stderr, "Video initialization failed: %s\n",
+             SDL_GetError( ) );
+        quit_tutorial( 1 );
+    }
+
+    /* Let's get some video information. */
+    info = SDL_GetVideoInfo( );
+
+    if( !info ) {
+        /* This should probably never happen. */
+        fprintf( stderr, "Video query failed: %s\n",
+             SDL_GetError( ) );
+        quit_tutorial( 1 );
+    }
+
+    /*
+     * Set our width/height to 640/480 (you would
+     * of course let the user decide this in a normal
+     * app). We get the bpp we will request from
+     * the display. On X11, VidMode can't change
+     * resolution, so this is probably being overly
+     * safe. Under Win32, ChangeDisplaySettings
+     * can change the bpp.
+     */
+    width = 640;
+    height = 480;
+    bpp = info->vfmt->BitsPerPixel;
+
+    /*
+     * Now, we want to setup our requested
+     * window attributes for our OpenGL window.
+     * We want *at least* 5 bits of red, green
+     * and blue. We also want at least a 16-bit
+     * depth buffer.
+     *
+     * The last thing we do is request a double
+     * buffered window. '1' turns on double
+     * buffering, '0' turns it off.
+     *
+     * Note that we do not use SDL_DOUBLEBUF in
+     * the flags to SDL_SetVideoMode. That does
+     * not affect the GL attribute state, only
+     * the standard 2D blitting setup.
+     */
+    SDL_GL_SetAttribute( SDL_GL_RED_SIZE, 5 );
+    SDL_GL_SetAttribute( SDL_GL_GREEN_SIZE, 5 );
+    SDL_GL_SetAttribute( SDL_GL_BLUE_SIZE, 5 );
+    SDL_GL_SetAttribute( SDL_GL_DEPTH_SIZE, 16 );
+    SDL_GL_SetAttribute( SDL_GL_DOUBLEBUFFER, 1 );
+
+    /*
+     * We want to request that SDL provide us
+     * with an OpenGL window, in a fullscreen
+     * video mode.
+     *
+     * EXERCISE:
+     * Make starting windowed an option, and
+     * handle the resize events properly with
+     * glViewport.
+     */
+    flags = SDL_OPENGL | SDL_FULLSCREEN;
+
+    /*
+     * Set the video mode
+     */
+    if( SDL_SetVideoMode( width, height, bpp, flags ) == 0 ) {
+        /* 
+         * This could happen for a variety of reasons,
+         * including DISPLAY not being set, the specified
+         * resolution not being available, etc.
+         */
+        fprintf( stderr, "Video mode set failed: %s\n",
+             SDL_GetError( ) );
+        quit_tutorial( 1 );
+    }

Drawing

Apart from initialisation, using OpenGL within SDL is the same as using OpenGL +with any other API, e.g. GLUT. You still use all the same function calls and +data types. However if you are using a double-buffered display, then you must +use +SDL_GL_SwapBuffers() +to swap the buffers and update the display. To request double-buffering +with OpenGL, use +SDL_GL_SetAttribute +with SDL_GL_DOUBLEBUFFER, and use +SDL_GL_GetAttribute +to see if you actually got it.

A full example code listing is now presented below.

Example 2-8. SDL and OpenGL

/*
+ * SDL OpenGL Tutorial.
+ * (c) Michael Vance, 2000
+ * briareos@lokigames.com
+ *
+ * Distributed under terms of the LGPL. 
+ */
+
+#include <SDL/SDL.h>
+#include <GL/gl.h>
+#include <GL/glu.h>
+
+#include <stdio.h>
+#include <stdlib.h>
+
+static GLboolean should_rotate = GL_TRUE;
+
+static void quit_tutorial( int code )
+{
+    /*
+     * Quit SDL so we can release the fullscreen
+     * mode and restore the previous video settings,
+     * etc.
+     */
+    SDL_Quit( );
+
+    /* Exit program. */
+    exit( code );
+}
+
+static void handle_key_down( SDL_keysym* keysym )
+{
+
+    /* 
+     * We're only interested if 'Esc' has
+     * been presssed.
+     *
+     * EXERCISE: 
+     * Handle the arrow keys and have that change the
+     * viewing position/angle.
+     */
+    switch( keysym->sym ) {
+    case SDLK_ESCAPE:
+        quit_tutorial( 0 );
+        break;
+    case SDLK_SPACE:
+        should_rotate = !should_rotate;
+        break;
+    default:
+        break;
+    }
+
+}
+
+static void process_events( void )
+{
+    /* Our SDL event placeholder. */
+    SDL_Event event;
+
+    /* Grab all the events off the queue. */
+    while( SDL_PollEvent( &event ) ) {
+
+        switch( event.type ) {
+        case SDL_KEYDOWN:
+            /* Handle key presses. */
+            handle_key_down( &event.key.keysym );
+            break;
+        case SDL_QUIT:
+            /* Handle quit requests (like Ctrl-c). */
+            quit_tutorial( 0 );
+            break;
+        }
+
+    }
+
+}
+
+static void draw_screen( void )
+{
+    /* Our angle of rotation. */
+    static float angle = 0.0f;
+
+    /*
+     * EXERCISE:
+     * Replace this awful mess with vertex
+     * arrays and a call to glDrawElements.
+     *
+     * EXERCISE:
+     * After completing the above, change
+     * it to use compiled vertex arrays.
+     *
+     * EXERCISE:
+     * Verify my windings are correct here ;).
+     */
+    static GLfloat v0[] = { -1.0f, -1.0f,  1.0f };
+    static GLfloat v1[] = {  1.0f, -1.0f,  1.0f };
+    static GLfloat v2[] = {  1.0f,  1.0f,  1.0f };
+    static GLfloat v3[] = { -1.0f,  1.0f,  1.0f };
+    static GLfloat v4[] = { -1.0f, -1.0f, -1.0f };
+    static GLfloat v5[] = {  1.0f, -1.0f, -1.0f };
+    static GLfloat v6[] = {  1.0f,  1.0f, -1.0f };
+    static GLfloat v7[] = { -1.0f,  1.0f, -1.0f };
+    static GLubyte red[]    = { 255,   0,   0, 255 };
+    static GLubyte green[]  = {   0, 255,   0, 255 };
+    static GLubyte blue[]   = {   0,   0, 255, 255 };
+    static GLubyte white[]  = { 255, 255, 255, 255 };
+    static GLubyte yellow[] = {   0, 255, 255, 255 };
+    static GLubyte black[]  = {   0,   0,   0, 255 };
+    static GLubyte orange[] = { 255, 255,   0, 255 };
+    static GLubyte purple[] = { 255,   0, 255,   0 };
+
+    /* Clear the color and depth buffers. */
+    glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT );
+
+    /* We don't want to modify the projection matrix. */
+    glMatrixMode( GL_MODELVIEW );
+    glLoadIdentity( );
+
+    /* Move down the z-axis. */
+    glTranslatef( 0.0, 0.0, -5.0 );
+
+    /* Rotate. */
+    glRotatef( angle, 0.0, 1.0, 0.0 );
+
+    if( should_rotate ) {
+
+        if( ++angle > 360.0f ) {
+            angle = 0.0f;
+        }
+
+    }
+
+    /* Send our triangle data to the pipeline. */
+    glBegin( GL_TRIANGLES );
+
+    glColor4ubv( red );
+    glVertex3fv( v0 );
+    glColor4ubv( green );
+    glVertex3fv( v1 );
+    glColor4ubv( blue );
+    glVertex3fv( v2 );
+
+    glColor4ubv( red );
+    glVertex3fv( v0 );
+    glColor4ubv( blue );
+    glVertex3fv( v2 );
+    glColor4ubv( white );
+    glVertex3fv( v3 );
+
+    glColor4ubv( green );
+    glVertex3fv( v1 );
+    glColor4ubv( black );
+    glVertex3fv( v5 );
+    glColor4ubv( orange );
+    glVertex3fv( v6 );
+
+    glColor4ubv( green );
+    glVertex3fv( v1 );
+    glColor4ubv( orange );
+    glVertex3fv( v6 );
+    glColor4ubv( blue );
+    glVertex3fv( v2 );
+
+    glColor4ubv( black );
+    glVertex3fv( v5 );
+    glColor4ubv( yellow );
+    glVertex3fv( v4 );
+    glColor4ubv( purple );
+    glVertex3fv( v7 );
+
+    glColor4ubv( black );
+    glVertex3fv( v5 );
+    glColor4ubv( purple );
+    glVertex3fv( v7 );
+    glColor4ubv( orange );
+    glVertex3fv( v6 );
+
+    glColor4ubv( yellow );
+    glVertex3fv( v4 );
+    glColor4ubv( red );
+    glVertex3fv( v0 );
+    glColor4ubv( white );
+    glVertex3fv( v3 );
+
+    glColor4ubv( yellow );
+    glVertex3fv( v4 );
+    glColor4ubv( white );
+    glVertex3fv( v3 );
+    glColor4ubv( purple );
+    glVertex3fv( v7 );
+
+    glColor4ubv( white );
+    glVertex3fv( v3 );
+    glColor4ubv( blue );
+    glVertex3fv( v2 );
+    glColor4ubv( orange );
+    glVertex3fv( v6 );
+
+    glColor4ubv( white );
+    glVertex3fv( v3 );
+    glColor4ubv( orange );
+    glVertex3fv( v6 );
+    glColor4ubv( purple );
+    glVertex3fv( v7 );
+
+    glColor4ubv( green );
+    glVertex3fv( v1 );
+    glColor4ubv( red );
+    glVertex3fv( v0 );
+    glColor4ubv( yellow );
+    glVertex3fv( v4 );
+
+    glColor4ubv( green );
+    glVertex3fv( v1 );
+    glColor4ubv( yellow );
+    glVertex3fv( v4 );
+    glColor4ubv( black );
+    glVertex3fv( v5 );
+
+    glEnd( );
+
+    /*
+     * EXERCISE:
+     * Draw text telling the user that 'Spc'
+     * pauses the rotation and 'Esc' quits.
+     * Do it using vetors and textured quads.
+     */
+
+    /*
+     * Swap the buffers. This this tells the driver to
+     * render the next frame from the contents of the
+     * back-buffer, and to set all rendering operations
+     * to occur on what was the front-buffer.
+     *
+     * Double buffering prevents nasty visual tearing
+     * from the application drawing on areas of the
+     * screen that are being updated at the same time.
+     */
+    SDL_GL_SwapBuffers( );
+}
+
+static void setup_opengl( int width, int height )
+{
+    float ratio = (float) width / (float) height;
+
+    /* Our shading model--Gouraud (smooth). */
+    glShadeModel( GL_SMOOTH );
+
+    /* Culling. */
+    glCullFace( GL_BACK );
+    glFrontFace( GL_CCW );
+    glEnable( GL_CULL_FACE );
+
+    /* Set the clear color. */
+    glClearColor( 0, 0, 0, 0 );
+
+    /* Setup our viewport. */
+    glViewport( 0, 0, width, height );
+
+    /*
+     * Change to the projection matrix and set
+     * our viewing volume.
+     */
+    glMatrixMode( GL_PROJECTION );
+    glLoadIdentity( );
+    /*
+     * EXERCISE:
+     * Replace this with a call to glFrustum.
+     */
+    gluPerspective( 60.0, ratio, 1.0, 1024.0 );
+}
+
+int main( int argc, char* argv[] )
+{
+    /* Information about the current video settings. */
+    const SDL_VideoInfo* info = NULL;
+    /* Dimensions of our window. */
+    int width = 0;
+    int height = 0;
+    /* Color depth in bits of our window. */
+    int bpp = 0;
+    /* Flags we will pass into SDL_SetVideoMode. */
+    int flags = 0;
+
+    /* First, initialize SDL's video subsystem. */
+    if( SDL_Init( SDL_INIT_VIDEO ) < 0 ) {
+        /* Failed, exit. */
+        fprintf( stderr, "Video initialization failed: %s\n",
+             SDL_GetError( ) );
+        quit_tutorial( 1 );
+    }
+
+    /* Let's get some video information. */
+    info = SDL_GetVideoInfo( );
+
+    if( !info ) {
+        /* This should probably never happen. */
+        fprintf( stderr, "Video query failed: %s\n",
+             SDL_GetError( ) );
+        quit_tutorial( 1 );
+    }
+
+    /*
+     * Set our width/height to 640/480 (you would
+     * of course let the user decide this in a normal
+     * app). We get the bpp we will request from
+     * the display. On X11, VidMode can't change
+     * resolution, so this is probably being overly
+     * safe. Under Win32, ChangeDisplaySettings
+     * can change the bpp.
+     */
+    width = 640;
+    height = 480;
+    bpp = info->vfmt->BitsPerPixel;
+
+    /*
+     * Now, we want to setup our requested
+     * window attributes for our OpenGL window.
+     * We want *at least* 5 bits of red, green
+     * and blue. We also want at least a 16-bit
+     * depth buffer.
+     *
+     * The last thing we do is request a double
+     * buffered window. '1' turns on double
+     * buffering, '0' turns it off.
+     *
+     * Note that we do not use SDL_DOUBLEBUF in
+     * the flags to SDL_SetVideoMode. That does
+     * not affect the GL attribute state, only
+     * the standard 2D blitting setup.
+     */
+    SDL_GL_SetAttribute( SDL_GL_RED_SIZE, 5 );
+    SDL_GL_SetAttribute( SDL_GL_GREEN_SIZE, 5 );
+    SDL_GL_SetAttribute( SDL_GL_BLUE_SIZE, 5 );
+    SDL_GL_SetAttribute( SDL_GL_DEPTH_SIZE, 16 );
+    SDL_GL_SetAttribute( SDL_GL_DOUBLEBUFFER, 1 );
+
+    /*
+     * We want to request that SDL provide us
+     * with an OpenGL window, in a fullscreen
+     * video mode.
+     *
+     * EXERCISE:
+     * Make starting windowed an option, and
+     * handle the resize events properly with
+     * glViewport.
+     */
+    flags = SDL_OPENGL | SDL_FULLSCREEN;
+
+    /*
+     * Set the video mode
+     */
+    if( SDL_SetVideoMode( width, height, bpp, flags ) == 0 ) {
+        /* 
+         * This could happen for a variety of reasons,
+         * including DISPLAY not being set, the specified
+         * resolution not being available, etc.
+         */
+        fprintf( stderr, "Video mode set failed: %s\n",
+             SDL_GetError( ) );
+        quit_tutorial( 1 );
+    }
+
+    /*
+     * At this point, we should have a properly setup
+     * double-buffered window for use with OpenGL.
+     */
+    setup_opengl( width, height );
+
+    /*
+     * Now we want to begin our normal app process--
+     * an event loop with a lot of redrawing.
+     */
+    while( 1 ) {
+        /* Process incoming events. */
+        process_events( );
+        /* Draw the screen. */
+        draw_screen( );
+    }
+
+    /*
+     * EXERCISE:
+     * Record timings using SDL_GetTicks() and
+     * and print out frames per second at program
+     * end.
+     */
+
+    /* Never reached. */
+    return 0;
+}

PrevHomeNext
Graphics and VideoUpInput handling
\ No newline at end of file diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/index.html b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/index.html new file mode 100644 index 000000000..f86ff191d --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/index.html @@ -0,0 +1,1156 @@ +
Table of Contents
I. SDL Guide
Preface
About SDL
About SDLdoc
Credits
1. The Basics
Introduction
Initializing SDL
2. Graphics and Video
Introduction to SDL Video
Using OpenGL With SDL
3. Input handling
Handling Joysticks
Handling the Keyboard
4. Examples
Introduction
Event Examples
Audio Examples
CDROM Examples
Time Examples
II. SDL Reference
5. General
SDL_Init -- Initializes SDL
SDL_InitSubSystem -- Initialize subsystems
SDL_QuitSubSystem -- Shut down a subsystem
SDL_Quit -- Shut down SDL
SDL_WasInit -- Check which subsystems are initialized
SDL_GetError -- Get SDL error string
SDL_envvars -- SDL environment variables
6. Video
SDL_GetVideoSurface -- returns a pointer to the current display surface
SDL_GetVideoInfo -- returns a pointer to information about the video hardware
SDL_VideoDriverName -- Obtain the name of the video driver
SDL_ListModes -- Returns a pointer to an array of available screen dimensions for +the given format and video flags
SDL_VideoModeOK -- Check to see if a particular video mode is supported.
SDL_SetVideoMode -- Set up a video mode with the specified width, height and bits-per-pixel.
SDL_UpdateRect -- Makes sure the given area is updated on the given screen.
SDL_UpdateRects -- Makes sure the given list of rectangles is updated on the given screen.
SDL_Flip -- Swaps screen buffers
SDL_SetColors -- Sets a portion of the colormap for the given 8-bit surface.
SDL_SetPalette -- Sets the colors in the palette of an 8-bit surface.
SDL_SetGamma -- Sets the color gamma function for the display
SDL_GetGammaRamp -- Gets the color gamma lookup tables for the display
SDL_SetGammaRamp -- Sets the color gamma lookup tables for the display
SDL_MapRGB -- Map a RGB color value to a pixel format.
SDL_MapRGBA -- Map a RGBA color value to a pixel format.
SDL_GetRGB -- Get RGB values from a pixel in the specified pixel format.
SDL_GetRGBA -- Get RGBA values from a pixel in the specified pixel format.
SDL_CreateRGBSurface -- Create an empty SDL_Surface
SDL_CreateRGBSurfaceFrom -- Create an SDL_Surface from pixel data
SDL_FreeSurface -- Frees (deletes) a SDL_Surface
SDL_LockSurface -- Lock a surface for directly access.
SDL_UnlockSurface -- Unlocks a previously locked surface.
SDL_LoadBMP -- Load a Windows BMP file into an SDL_Surface.
SDL_SaveBMP -- Save an SDL_Surface as a Windows BMP file.
SDL_SetColorKey -- Sets the color key (transparent pixel) in a blittable surface and +RLE acceleration.
SDL_SetAlpha -- Adjust the alpha properties of a surface
SDL_SetClipRect -- Sets the clipping rectangle for a surface.
SDL_GetClipRect -- Gets the clipping rectangle for a surface.
SDL_ConvertSurface -- Converts a surface to the same format as another surface.
SDL_BlitSurface -- This performs a fast blit from the source surface to the destination surface.
SDL_FillRect -- This function performs a fast fill of the given rectangle with some color
SDL_DisplayFormat -- Convert a surface to the display format
SDL_DisplayFormatAlpha -- Convert a surface to the display format
SDL_WarpMouse -- Set the position of the mouse cursor.
SDL_CreateCursor -- Creates a new mouse cursor.
SDL_FreeCursor -- Frees a cursor created with SDL_CreateCursor.
SDL_SetCursor -- Set the currently active mouse cursor.
SDL_GetCursor -- Get the currently active mouse cursor.
SDL_ShowCursor -- Toggle whether or not the cursor is shown on the screen.
SDL_GL_LoadLibrary -- Specify an OpenGL library
SDL_GL_GetProcAddress -- Get the address of a GL function
SDL_GL_GetAttribute -- Get the value of a special SDL/OpenGL attribute
SDL_GL_SetAttribute -- Set a special SDL/OpenGL attribute
SDL_GL_SwapBuffers -- Swap OpenGL framebuffers/Update Display
SDL_CreateYUVOverlay -- Create a YUV video overlay
SDL_LockYUVOverlay -- Lock an overlay
SDL_UnlockYUVOverlay -- Unlock an overlay
SDL_DisplayYUVOverlay -- Blit the overlay to the display
SDL_FreeYUVOverlay -- Free a YUV video overlay
SDL_GLattr -- SDL GL Attributes
SDL_Rect -- Defines a rectangular area
SDL_Color -- Format independent color description
SDL_Palette -- Color palette for 8-bit pixel formats
SDL_PixelFormat -- Stores surface format information
SDL_Surface -- Graphical Surface Structure
SDL_VideoInfo -- Video Target information
SDL_Overlay -- YUV video overlay
7. Window Management
SDL_WM_SetCaption -- Sets the window tile and icon name.
SDL_WM_GetCaption -- Gets the window title and icon name.
SDL_WM_SetIcon -- Sets the icon for the display window.
SDL_WM_IconifyWindow -- Iconify/Minimise the window
SDL_WM_ToggleFullScreen -- Toggles fullscreen mode
SDL_WM_GrabInput -- Grabs mouse and keyboard input.
8. Events
Introduction
SDL Event Structures.
Event Functions.
9. Joystick
SDL_NumJoysticks -- Count available joysticks.
SDL_JoystickName -- Get joystick name.
SDL_JoystickOpen -- Opens a joystick for use.
SDL_JoystickOpened -- Determine if a joystick has been opened
SDL_JoystickIndex -- Get the index of an SDL_Joystick.
SDL_JoystickNumAxes -- Get the number of joystick axes
SDL_JoystickNumBalls -- Get the number of joystick trackballs
SDL_JoystickNumHats -- Get the number of joystick hats
SDL_JoystickNumButtons -- Get the number of joysitck buttons
SDL_JoystickUpdate -- Updates the state of all joysticks
SDL_JoystickGetAxis -- Get the current state of an axis
SDL_JoystickGetHat -- Get the current state of a joystick hat
SDL_JoystickGetButton -- Get the current state of a given button on a given joystick
SDL_JoystickGetBall -- Get relative trackball motion
SDL_JoystickClose -- Closes a previously opened joystick
10. Audio
SDL_AudioSpec -- Audio Specification Structure
SDL_OpenAudio -- Opens the audio device with the desired parameters.
SDL_PauseAudio -- Pauses and unpauses the audio callback processing
SDL_GetAudioStatus -- Get the current audio state
SDL_LoadWAV -- Load a WAVE file
SDL_FreeWAV -- Frees previously opened WAV data
SDL_AudioCVT -- Audio Conversion Structure
SDL_BuildAudioCVT -- Initializes a SDL_AudioCVT structure for conversion
SDL_ConvertAudio -- Convert audio data to a desired audio format.
SDL_MixAudio -- Mix audio data
SDL_LockAudio -- Lock out the callback function
SDL_UnlockAudio -- Unlock the callback function
SDL_CloseAudio -- Shuts down audio processing and closes the audio device.
11. CD-ROM
SDL_CDNumDrives -- Returns the number of CD-ROM drives on the system.
SDL_CDName -- Returns a human-readable, system-dependent identifier for the CD-ROM.
SDL_CDOpen -- Opens a CD-ROM drive for access.
SDL_CDStatus -- Returns the current status of the given drive.
SDL_CDPlay -- Play a CD
SDL_CDPlayTracks -- Play the given CD track(s)
SDL_CDPause -- Pauses a CDROM
SDL_CDResume -- Resumes a CDROM
SDL_CDStop -- Stops a CDROM
SDL_CDEject -- Ejects a CDROM
SDL_CDClose -- Closes a SDL_CD handle
SDL_CD -- CDROM Drive Information
SDL_CDtrack -- CD Track Information Structure
12. Multi-threaded Programming
SDL_CreateThread -- Creates a new thread of execution that shares its parent's properties.
SDL_ThreadID -- Get the 32-bit thread identifier for the current thread.
SDL_GetThreadID -- Get the SDL thread ID of a SDL_Thread
SDL_WaitThread -- Wait for a thread to finish.
SDL_KillThread -- Gracelessly terminates the thread.
SDL_CreateMutex -- Create a mutex
SDL_DestroyMutex -- Destroy a mutex
SDL_mutexP -- Lock a mutex
SDL_mutexV -- Unlock a mutex
SDL_CreateSemaphore -- Creates a new semaphore and assigns an initial value to it.
SDL_DestroySemaphore -- Destroys a semaphore that was created by SDL_CreateSemaphore.
SDL_SemWait -- Lock a semaphore and suspend the thread if the semaphore value is zero.
SDL_SemTryWait -- Attempt to lock a semaphore but don't suspend the thread.
SDL_SemWaitTimeout -- Lock a semaphore, but only wait up to a specified maximum time.
SDL_SemPost -- Unlock a semaphore.
SDL_SemValue -- Return the current value of a semaphore.
SDL_CreateCond -- Create a condition variable
SDL_DestroyCond -- Destroy a condition variable
SDL_CondSignal -- Restart a thread wait on a condition variable
SDL_CondBroadcast -- Restart all threads waiting on a condition variable
SDL_CondWait -- Wait on a condition variable
SDL_CondWaitTimeout -- Wait on a condition variable, with timeout
13. Time
SDL_GetTicks -- Get the number of milliseconds since the SDL library initialization.
SDL_Delay -- Wait a specified number of milliseconds before returning.
SDL_AddTimer -- Add a timer which will call a callback after the specified number of milliseconds has +elapsed.
SDL_RemoveTimer -- Remove a timer which was added with +SDL_AddTimer.
SDL_SetTimer -- Set a callback to run after the specified number of milliseconds has +elapsed.

  Next
  SDL Guide
\ No newline at end of file diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/joystick.html b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/joystick.html new file mode 100644 index 000000000..abdb28c19 --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/joystick.html @@ -0,0 +1,296 @@ +Joystick
SDL Library Documentation
PrevNext

Chapter 9. Joystick

Table of Contents
SDL_NumJoysticks -- Count available joysticks.
SDL_JoystickName -- Get joystick name.
SDL_JoystickOpen -- Opens a joystick for use.
SDL_JoystickOpened -- Determine if a joystick has been opened
SDL_JoystickIndex -- Get the index of an SDL_Joystick.
SDL_JoystickNumAxes -- Get the number of joystick axes
SDL_JoystickNumBalls -- Get the number of joystick trackballs
SDL_JoystickNumHats -- Get the number of joystick hats
SDL_JoystickNumButtons -- Get the number of joysitck buttons
SDL_JoystickUpdate -- Updates the state of all joysticks
SDL_JoystickGetAxis -- Get the current state of an axis
SDL_JoystickGetHat -- Get the current state of a joystick hat
SDL_JoystickGetButton -- Get the current state of a given button on a given joystick
SDL_JoystickGetBall -- Get relative trackball motion
SDL_JoystickClose -- Closes a previously opened joystick

Joysticks, and other similar input devices, have a very strong role in game playing and SDL provides comprehensive support for them. Axes, Buttons, POV Hats and trackballs are all supported.

Joystick support is initialized by passed the SDL_INIT_JOYSTICK flag to SDL_Init. Once initilized joysticks must be opened using SDL_JoystickOpen.

While using the functions describe in this secton may seem like the best way to access and read from joysticks, in most cases they aren't. Ideally joysticks should be read using the event system. To enable this, you must set the joystick event processing state with SDL_JoystickEventState. Joysticks must be opened before they can be used of course.

Note: If you are not handling the joystick via the event queue then you must explicitly request a joystick update by calling SDL_JoystickUpdate.

Note: Force Feedback is not yet support. Sam (slouken@libsdl.org) is soliciting suggestions from people with force-feedback experience on the best wat to desgin the API.


PrevHomeNext
SDL_JoystickEventStateUpSDL_NumJoysticks
\ No newline at end of file diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/reference.html b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/reference.html new file mode 100644 index 000000000..e7707a750 --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/reference.html @@ -0,0 +1,194 @@ +SDL Reference
SDL Library Documentation
PrevNext

II. SDL Reference


PrevHomeNext
Time Examples General
\ No newline at end of file diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlactiveevent.html b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlactiveevent.html new file mode 100644 index 000000000..d3f2821e7 --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlactiveevent.html @@ -0,0 +1,335 @@ +SDL_ActiveEvent
SDL Library Documentation
PrevNext

SDL_ActiveEvent

Name

SDL_ActiveEvent -- Application visibility event structure

Structure Definition

typedef struct{
+  Uint8 type;
+  Uint8 gain;
+  Uint8 state;
+} SDL_ActiveEvent;

Structure Data

typeSDL_ACTIVEEVENT.
gain0 if the event is a loss or 1 if it is a gain.
stateSDL_APPMOUSEFOCUS if mouse focus was gained or lost, SDL_APPINPUTFOCUS if input focus was gained or lost, or SDL_APPACTIVE if the application was iconified (gain=0) or restored(gain=1).

Description

SDL_ActiveEvent is a member of the SDL_Event union and is used when an event of type SDL_ACTIVEEVENT is reported.

When the mouse leaves or enters the window area a SDL_APPMOUSEFOCUS type activation event occurs, if the mouse entered the window then gain will be 1, otherwise gain will be 0. A SDL_APPINPUTFOCUS type activation event occurs when the application loses or gains keyboard focus. This usually occurs when another application is made active. Finally, a SDL_APPACTIVE type event occurs when the application is either minimised/iconified (gain=0) or restored.

Note: This event does not occur when an application window is first created.


PrevHomeNext
SDL_EventUpSDL_KeyboardEvent
\ No newline at end of file diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdladdtimer.html b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdladdtimer.html new file mode 100644 index 000000000..81c49e56d --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdladdtimer.html @@ -0,0 +1,296 @@ +SDL_AddTimer
SDL Library Documentation
PrevNext

SDL_AddTimer

Name

SDL_AddTimer -- Add a timer which will call a callback after the specified number of milliseconds has +elapsed.

Synopsis

#include "SDL.h"

SDL_TimerID SDL_AddTimer(Uint32 interval, SDL_NewTimerCallback callback, void *param);

Callback

/* type definition for the "new" timer callback function */
+typedef Uint32 (*SDL_NewTimerCallback)(Uint32 interval, void *param);

Description

Adds a callback function to be run after the specified number of +milliseconds has elapsed. The callback function is passed the current +timer interval and the user supplied parameter from the +SDL_AddTimer call and returns the next timer +interval. If the returned value from the callback is the same as the one +passed in, the periodic alarm continues, otherwise a new alarm is +scheduled.

To cancel a currently running timer call +SDL_RemoveTimer with the +timer ID returned from +SDL_AddTimer.

The timer callback function may run in a different thread than your +main program, and so shouldn't call any functions from within itself. +You may always call SDL_PushEvent, however.

The granularity of the timer is platform-dependent, but you should count +on it being at least 10 ms as this is the most common number. +This means that if +you request a 16 ms timer, your callback will run approximately 20 ms +later on an unloaded system. If you wanted to set a flag signaling +a frame update at 30 frames per second (every 33 ms), you might set a +timer for 30 ms (see example below). + +If you use this function, you need to pass SDL_INIT_TIMER +to SDL_Init.

Return Value

Returns an ID value for the added timer or +NULL if there was an error.

Examples

my_timer_id = SDL_AddTimer((33/10)*10, my_callbackfunc, my_callback_param);


PrevHomeNext
SDL_DelayUpSDL_RemoveTimer
\ No newline at end of file diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlaudiocvt.html b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlaudiocvt.html new file mode 100644 index 000000000..ff3920908 --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlaudiocvt.html @@ -0,0 +1,556 @@ +SDL_AudioCVT
SDL Library Documentation
PrevNext

SDL_AudioCVT

Name

SDL_AudioCVT -- Audio Conversion Structure

Structure Definition

typedef struct{
+  int needed;
+  Uint16 src_format;
+  Uint16 dest_format;
+  double rate_incr;
+  Uint8 *buf;
+  int len;
+  int len_cvt;
+  int len_mult;
+  double len_ratio;
+  void (*filters[10])(struct SDL_AudioCVT *cvt, Uint16 format);
+  int filter_index;
+} SDL_AudioCVT;

Structure Data

neededSet to one if the conversion is possible
src_formatAudio format of the source
dest_formatAudio format of the destination
rate_incrRate conversion increment
bufAudio buffer
lenLength of the original audio buffer in bytes
len_cvtLength of converted audio buffer in bytes (calculated)
len_multbuf must be len*len_mult bytes in size(calculated)
len_ratioFinal audio size is len*len_ratio
filters[10](..)Pointers to functions needed for this conversion
filter_indexCurrent conversion function

Description

The SDL_AudioCVT is used to convert audio data between different formats. A SDL_AudioCVT structure is created with the SDL_BuildAudioCVT function, while the actual conversion is done by the SDL_ConvertAudio function.

Many of the fields in the SDL_AudioCVT structure should be considered private and their function will not be discussed here.

Uint8 *buf

This points to the audio data that will be used in the conversion. It is both the source and the destination, which means the converted audio data overwrites the original data. It also means that the converted data may be larger than the original data (if you were converting from 8-bit to 16-bit, for instance), so you must ensure buf is large enough. See below.

int len

This is the length of the original audio data in bytes.

int len_mult

As explained above, the audio buffer needs to be big enough to store the converted data, which may be bigger than the original audio data. The length of buf should be len*len_mult.

double len_ratio

When you have finished converting your audio data, you need to know how much of your audio buffer is valid. len*len_ratio is the size of the converted audio data in bytes. This is very similar to len_mult, however when the convert audio data is shorter than the original len_mult would be 1. len_ratio, on the other hand, would be a fractional number between 0 and 1.


PrevHomeNext
SDL_FreeWAVUpSDL_BuildAudioCVT
\ No newline at end of file diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlaudiospec.html b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlaudiospec.html new file mode 100644 index 000000000..fc6fa7503 --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlaudiospec.html @@ -0,0 +1,589 @@ +SDL_AudioSpec
SDL Library Documentation
PrevNext

SDL_AudioSpec

Name

SDL_AudioSpec -- Audio Specification Structure

Structure Definition

typedef struct{
+  int freq;
+  Uint16 format;
+  Uint8 channels;
+  Uint8 silence;
+  Uint16 samples;
+  Uint32 size;
+  void (*callback)(void *userdata, Uint8 *stream, int len);
+  void *userdata;
+} SDL_AudioSpec;

Structure Data

freqAudio frequency in samples per second
formatAudio data format
channelsNumber of channels: 1 mono, 2 stereo
silenceAudio buffer silence value (calculated)
samplesAudio buffer size in samples
sizeAudio buffer size in bytes (calculated)
callback(..)Callback function for filling the audio buffer
userdataPointer the user data which is passed to the callback function

Description

The SDL_AudioSpec structure is used to describe the format of some audio data. This structure is used by SDL_OpenAudio and SDL_LoadWAV. While all fields are used by SDL_OpenAudio only freq, format, samples and channels are used by SDL_LoadWAV. We will detail these common members here.

freq

The number of samples sent to the sound device every second. Common values are 11025, 22050 and 44100. The higher the better.

format

Specifies the size and type of each sample element +

AUDIO_U8

Unsigned 8-bit samples

AUDIO_S8

Signed 8-bit samples

AUDIO_U16 or AUDIO_U16LSB

Unsigned 16-bit little-endian samples

AUDIO_S16 or AUDIO_S16LSB

Signed 16-bit little-endian samples

AUDIO_U16MSB

Unsigned 16-bit big-endian samples

AUDIO_S16MSB

Signed 16-bit big-endian samples

AUDIO_U16SYS

Either AUDIO_U16LSB or AUDIO_U16MSB depending on you systems endianness

AUDIO_S16SYS

Either AUDIO_S16LSB or AUDIO_S16MSB depending on you systems endianness

channelsThe number of seperate sound channels. 1 is mono (single channel), 2 is stereo (dual channel).
samplesWhen used with SDL_OpenAudio this refers to the size of the audio buffer in samples. A sample a chunk of audio data of the size specified in format mulitplied by the number of channels. When the SDL_AudioSpec is used with SDL_LoadWAV samples is set to 4096.


PrevHomeNext
AudioUpSDL_OpenAudio
\ No newline at end of file diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlblitsurface.html b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlblitsurface.html new file mode 100644 index 000000000..3123ff5dd --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlblitsurface.html @@ -0,0 +1,339 @@ +SDL_BlitSurface
SDL Library Documentation
PrevNext

SDL_BlitSurface

Name

SDL_BlitSurface -- This performs a fast blit from the source surface to the destination surface.

Synopsis

#include "SDL.h"

int SDL_BlitSurface(SDL_Surface *src, SDL_Rect *srcrect, SDL_Surface *dst, SDL_Rect *dstrect);

Description

This performs a fast blit from the source surface to the destination surface.

The width and height in srcrect determine the +size of the copied rectangle. Only the position is used in the +dstrect (the width and height are ignored).

If srcrect is NULL, the +entire surface is copied. If dstrect is +NULL, then the destination position (upper left +corner) is (0, 0).

The final blit rectangle is saved in +dstrect after all clipping is performed +(srcrect is not modified).

The blit function should not be called on a locked surface.

The results of blitting operations vary greatly depending on whether SDL_SRCAPLHA is set or not. See SDL_SetAlpha for an explaination of how this affects your results. Colorkeying and alpha attributes also interact with surface blitting, as the following pseudo-code should hopefully explain. +

if (source surface has SDL_SRCALPHA set) {
+    if (source surface has alpha channel (that is, format->Amask != 0))
+        blit using per-pixel alpha, ignoring any colour key
+    else {
+        if (source surface has SDL_SRCCOLORKEY set)
+            blit using the colour key AND the per-surface alpha value
+        else
+            blit using the per-surface alpha value
+    }
+} else {
+    if (source surface has SDL_SRCCOLORKEY set)
+        blit using the colour key
+    else
+        ordinary opaque rectangular blit
+}

Return Value

If the blit is successful, it returns 0, +otherwise it returns -1.

If either of the surfaces were in video memory, and the blit returns +-2, the video memory was lost, so it should be +reloaded with artwork and re-blitted: +

        while ( SDL_BlitSurface(image, imgrect, screen, dstrect) == -2 ) {
+                while ( SDL_LockSurface(image)) < 0 )
+                        SDL_Delay(10);
+                -- Write image pixels to image->pixels --
+                SDL_UnlockSurface(image);
+        }
+This happens under DirectX 5.0 when the system switches away from your +fullscreen application. Locking the surface will also fail until you +have access to the video memory again.


PrevHomeNext
SDL_ConvertSurfaceUpSDL_FillRect
\ No newline at end of file diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlbuildaudiocvt.html b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlbuildaudiocvt.html new file mode 100644 index 000000000..2e8420e8a --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlbuildaudiocvt.html @@ -0,0 +1,291 @@ +SDL_BuildAudioCVT
SDL Library Documentation
PrevNext

SDL_BuildAudioCVT

Name

SDL_BuildAudioCVT -- Initializes a SDL_AudioCVT structure for conversion

Synopsis

#include "SDL.h"

int SDL_BuildAudioCVT(SDL_AudioCVT *cvt, Uint16 src_format, Uint8 src_channels, int src_rate, Uint16 dst_format, Uint8 dst_channels, int dst_rate);

Description

Before an SDL_AudioCVT structure can be used to convert audio data it must be initialized with source and destination information.

src_format and dst_format are the source and destination format of the conversion. (For information on audio formats see SDL_AudioSpec). src_channels and dst_channels are the number of channels in the source and destination formats. Finally, src_rate and dst_rate are the frequency or samples-per-second of the source and destination formats. Once again, see SDL_AudioSpec.

Return Values

Returns -1 if the filter could not be built or 1 if it could.

Examples

See SDL_ConvertAudio.


PrevHomeNext
SDL_AudioCVTUpSDL_ConvertAudio
\ No newline at end of file diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlcd.html b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlcd.html new file mode 100644 index 000000000..6f8a7cdf6 --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlcd.html @@ -0,0 +1,359 @@ +SDL_CD
SDL Library Documentation
PrevNext

SDL_CD

Name

SDL_CD -- CDROM Drive Information

Structure Definition

typedef struct{
+  int id;
+  CDstatus status;
+  int numtracks;
+  int cur_track;
+  int cur_frame;
+  SDL_CDtrack track[SDL_MAX_TRACKS+1];
+} SDL_CD;

Structure Data

idPrivate drive identifier
statusDrive status
numtracksNumber of tracks on the CD
cur_trackCurrent track
cur_frameCurrent frame offset within the track
track[SDL_MAX_TRACKS+1]Array of track descriptions. (see SDL_CDtrack)

Description

An SDL_CD structure is returned by SDL_CDOpen. It represents an opened CDROM device and stores information on the layout of the tracks on the disc.

A frame is the base data unit of a CD. CD_FPS frames is equal to 1 second of music. SDL provides two macros for converting between time and frames: FRAMES_TO_MSF(f, M,S,F) and MSF_TO_FRAMES.

Examples

int min, sec, frame;
+int frame_offset;
+
+FRAMES_TO_MSF(cdrom->cur_frame, &min, &sec, &frame);
+printf("Current Position: %d minutes, %d seconds, %d frames\n", min, sec, frame);
+
+frame_offset=MSF_TO_FRAMES(min, sec, frame);

PrevHomeNext
SDL_CDCloseUpSDL_CDtrack
\ No newline at end of file diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlcdclose.html b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlcdclose.html new file mode 100644 index 000000000..2a984a8b4 --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlcdclose.html @@ -0,0 +1,217 @@ +SDL_CDClose
SDL Library Documentation
PrevNext

SDL_CDClose

Name

SDL_CDClose -- Closes a SDL_CD handle

Synopsis

#include "SDL.h"

void SDL_CDClose(SDL_CD *cdrom);

Description

Closes the given cdrom handle.

See Also

SDL_CDOpen, +SDL_CD


PrevHomeNext
SDL_CDEjectUpSDL_CD
\ No newline at end of file diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlcdeject.html b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlcdeject.html new file mode 100644 index 000000000..03a3b780b --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlcdeject.html @@ -0,0 +1,226 @@ +SDL_CDEject
SDL Library Documentation
PrevNext

SDL_CDEject

Name

SDL_CDEject -- Ejects a CDROM

Synopsis

#include "SDL.h"

int SDL_CDEject(SDL_CD *cdrom);

Description

Ejects the given cdrom.

Return Value

Returns 0 on success, or -1 on an error.

See Also

SDL_CD


PrevHomeNext
SDL_CDStopUpSDL_CDClose
\ No newline at end of file diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlcdname.html b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlcdname.html new file mode 100644 index 000000000..55a18e26e --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlcdname.html @@ -0,0 +1,239 @@ +SDL_CDName
SDL Library Documentation
PrevNext

SDL_CDName

Name

SDL_CDName -- Returns a human-readable, system-dependent identifier for the CD-ROM.

Synopsis

#include "SDL.h"

const char *SDL_CDName(int drive);

Description

Returns a human-readable, system-dependent identifier for the CD-ROM. drive is the index of the drive. Drive indices start to 0 and end at SDL_CDNumDrives()-1.

Examples

  • "/dev/cdrom"

  • "E:"

  • "/dev/disk/ide/1/master"


PrevHomeNext
SDL_CDNumDrivesUpSDL_CDOpen
\ No newline at end of file diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlcdnumdrives.html b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlcdnumdrives.html new file mode 100644 index 000000000..9816a739b --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlcdnumdrives.html @@ -0,0 +1,205 @@ +SDL_CDNumDrives
SDL Library Documentation
PrevNext

SDL_CDNumDrives

Name

SDL_CDNumDrives -- Returns the number of CD-ROM drives on the system.

Synopsis

#include "SDL.h"

int SDL_CDNumDrives(void);

Description

Returns the number of CD-ROM drives on the system.

See Also

SDL_CDOpen


PrevHomeNext
CD-ROMUpSDL_CDName
\ No newline at end of file diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlcdopen.html b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlcdopen.html new file mode 100644 index 000000000..09a6bd9f7 --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlcdopen.html @@ -0,0 +1,275 @@ +SDL_CDOpen
SDL Library Documentation
PrevNext

SDL_CDOpen

Name

SDL_CDOpen -- Opens a CD-ROM drive for access.

Synopsis

#include "SDL.h"

SDL_CD *SDL_CDOpen(int drive);

Description

Opens a CD-ROM drive for access. It returns a SDL_CD structure on success, or NULL if the drive was invalid or busy. This newly opened CD-ROM becomes the default CD used when other CD functions are passed a NULL CD-ROM handle.

Drives are numbered starting with 0. +Drive 0 is the system default CD-ROM.

Examples

SDL_CD *cdrom;
+int cur_track;
+int min, sec, frame;
+SDL_Init(SDL_INIT_CDROM);
+atexit(SDL_Quit);
+
+/* Check for CD drives */
+if(!SDL_CDNumDrives()){
+  /* None found */
+  fprintf(stderr, "No CDROM devices available\n");
+  exit(-1);
+}
+
+/* Open the default drive */
+cdrom=SDL_CDOpen(0);
+
+/* Did if open? Check if cdrom is NULL */
+if(!cdrom){
+  fprintf(stderr, "Couldn't open drive: %s\n", SDL_GetError());
+  exit(-1);
+}
+
+/* Print Volume info */
+printf("Name: %s\n", SDL_CDName(0));
+printf("Tracks: %d\n", cdrom->numtracks);
+for(cur_track=0;cur_track < cdrom->numtracks; cur_track++){
+  FRAMES_TO_MSF(cdrom->track[cur_track].length, &min, &sec, &frame);
+  printf("\tTrack %d: Length %d:%d\n", cur_track, min, sec);
+}
+
+SDL_CDClose(cdrom);

PrevHomeNext
SDL_CDNameUpSDL_CDStatus
\ No newline at end of file diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlcdpause.html b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlcdpause.html new file mode 100644 index 000000000..4def8e362 --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlcdpause.html @@ -0,0 +1,233 @@ +SDL_CDPause
SDL Library Documentation
PrevNext

SDL_CDPause

Name

SDL_CDPause -- Pauses a CDROM

Synopsis

#include "SDL.h"

int SDL_CDPause(SDL_CD *cdrom);

Description

Pauses play on the given cdrom.

Return Value

Returns 0 on success, or -1 on an error.


PrevHomeNext
SDL_CDPlayTracksUpSDL_CDResume
\ No newline at end of file diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlcdplay.html b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlcdplay.html new file mode 100644 index 000000000..dc6489cc8 --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlcdplay.html @@ -0,0 +1,243 @@ +SDL_CDPlay
SDL Library Documentation
PrevNext

SDL_CDPlay

Name

SDL_CDPlay -- Play a CD

Synopsis

#include "SDL.h"

int SDL_CDPlay(SDL_CD *cdrom, int start, int length);

Description

Plays the given cdrom, starting a frame start for length frames.

Return Values

Returns 0 on success, or -1 on an error.


PrevHomeNext
SDL_CDStatusUpSDL_CDPlayTracks
\ No newline at end of file diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlcdplaytracks.html b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlcdplaytracks.html new file mode 100644 index 000000000..754618190 --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlcdplaytracks.html @@ -0,0 +1,325 @@ +SDL_CDPlayTracks
SDL Library Documentation
PrevNext

SDL_CDPlayTracks

Name

SDL_CDPlayTracks -- Play the given CD track(s)

Synopsis

#include "SDL.h"

int SDL_CDPlayTracks(SDL_CD *cdrom, int start_track, int start_frame, int ntracks, int nframes));

Description

SDL_CDPlayTracks plays the given CD starting at track +start_track, for ntracks tracks.

start_frame is the frame offset, from the beginning of the start_track, at which to start. nframes is the frame offset, from the beginning of the last track (start_track+ntracks), at which to end playing.

SDL_CDPlayTracks should only be called after calling +SDL_CDStatus +to get track information about the CD.

Note: Data tracks are ignored.

Return Value

Returns 0, or -1 +if there was an error.

Examples

/* assuming cdrom is a previously opened device */
+/* Play the entire CD */
+if(CD_INDRIVE(SDL_CDStatus(cdrom)))
+  SDL_CDPlayTracks(cdrom, 0, 0, 0, 0);
+
+/* Play the first track */
+if(CD_INDRIVE(SDL_CDStatus(cdrom)))
+  SDL_CDPlayTracks(cdrom, 0, 0, 1, 0);
+
+/* Play first 15 seconds of the 2nd track */
+if(CD_INDRIVE(SDL_CDStatus(cdrom)))
+  SDL_CDPlayTracks(cdrom, 1, 0, 0, CD_FPS*15);
+


PrevHomeNext
SDL_CDPlayUpSDL_CDPause
\ No newline at end of file diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlcdresume.html b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlcdresume.html new file mode 100644 index 000000000..4a25ab69b --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlcdresume.html @@ -0,0 +1,233 @@ +SDL_CDResume
SDL Library Documentation
PrevNext

SDL_CDResume

Name

SDL_CDResume -- Resumes a CDROM

Synopsis

#include "SDL.h"

int SDL_CDResume(SDL_CD *cdrom);

Description

Resumes play on the given cdrom.

Return Value

Returns 0 on success, or -1 on an error.


PrevHomeNext
SDL_CDPauseUpSDL_CDStop
\ No newline at end of file diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlcdstatus.html b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlcdstatus.html new file mode 100644 index 000000000..3ebf9657e --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlcdstatus.html @@ -0,0 +1,273 @@ +SDL_CDStatus
SDL Library Documentation
PrevNext

SDL_CDStatus

Name

SDL_CDStatus -- Returns the current status of the given drive.

Synopsis

#include "SDL.h"

CDstatus SDL_CDStatus(SDL_CD *cdrom);

/* Given a status, returns true if there's a disk in the drive */
+#define CD_INDRIVE(status)      ((int)status > 0)

Description

This function returns the current status of the given drive. Status is described like so: +

typedef enum {
+  CD_TRAYEMPTY,
+  CD_STOPPED,
+  CD_PLAYING,
+  CD_PAUSED,
+  CD_ERROR = -1
+} CDstatus;

If the drive has a CD in it, the table of contents of the CD and current +play position of the CD will be stored in the SDL_CD structure.

The macro CD_INDRIVE is provided for convenience, +and given a status returns true if there's a disk in the drive.

Note: SDL_CDStatus also updates the SDL_CD structure passed to it.

Example

int playTrack(int track)
+{
+  int playing = 0;
+
+  if ( CD_INDRIVE(SDL_CDStatus(cdrom)) ) {
+  /* clamp to the actual number of tracks on the CD */
+    if (track >= cdrom->numtracks) {
+      track = cdrom->numtracks-1;
+    }
+
+    if ( SDL_CDPlayTracks(cdrom, track, 0, 1, 0) == 0 ) {
+      playing = 1;
+    }
+  }
+  return playing;
+}

See Also

SDL_CD


PrevHomeNext
SDL_CDOpenUpSDL_CDPlay
\ No newline at end of file diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlcdstop.html b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlcdstop.html new file mode 100644 index 000000000..68f8d81be --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlcdstop.html @@ -0,0 +1,226 @@ +SDL_CDStop
SDL Library Documentation
PrevNext

SDL_CDStop

Name

SDL_CDStop -- Stops a CDROM

Synopsis

#include "SDL.h"

int SDL_CDStop(SDL_CD *cdrom);

Description

Stops play on the given cdrom.

Return Value

Returns 0 on success, or -1 on an error.

See Also

SDL_CDPlay,


PrevHomeNext
SDL_CDResumeUpSDL_CDEject
\ No newline at end of file diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlcdtrack.html b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlcdtrack.html new file mode 100644 index 000000000..bbb04bbd2 --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlcdtrack.html @@ -0,0 +1,313 @@ +SDL_CDtrack
SDL Library Documentation
PrevNext

SDL_CDtrack

Name

SDL_CDtrack -- CD Track Information Structure

Structure Definition

typedef struct{
+  Uint8 id;
+  Uint8 type;
+  Uint32 length;
+  Uint32 offset;
+} SDL_CDtrack;

Structure Data

idTrack number (0-99)
typeSDL_AUDIO_TRACK or SDL_DATA_TRACK
lengthLength, in frames, of this track
offsetFrame offset to the beginning of this track

Description

SDL_CDtrack stores data on each track on a CD, its fields should be pretty self explainatory. It is a member a the SDL_CD structure.

Note: Frames can be converted to standard timings. There are CD_FPS frames per second, so SDL_CDtrack.length/CD_FPS=length_in_seconds.

See Also

SDL_CD


PrevHomeNext
SDL_CDUpMulti-threaded Programming
\ No newline at end of file diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlcloseaudio.html b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlcloseaudio.html new file mode 100644 index 000000000..599f058e4 --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlcloseaudio.html @@ -0,0 +1,205 @@ +SDL_CloseAudio
SDL Library Documentation
PrevNext

SDL_CloseAudio

Name

SDL_CloseAudio -- Shuts down audio processing and closes the audio device.

Synopsis

#include "SDL.h"

void SDL_CloseAudio(void);

Description

This function shuts down audio processing and closes the audio device.

See Also

SDL_OpenAudio


PrevHomeNext
SDL_UnlockAudioUpCD-ROM
\ No newline at end of file diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlcolor.html b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlcolor.html new file mode 100644 index 000000000..c8b7d44fc --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlcolor.html @@ -0,0 +1,300 @@ +SDL_Color
SDL Library Documentation
PrevNext

SDL_Color

Name

SDL_Color -- Format independent color description

Structure Definition

typedef struct{
+  Uint8 r;
+  Uint8 g;
+  Uint8 b;
+  Uint8 unused;
+} SDL_Color;

Structure Data

rRed intensity
gGreen intensity
bBlue intensity
unusedUnused

Description

SDL_Color describes a color in a format independent way. You can convert a SDL_Color to a pixel value for a certain pixel format using SDL_MapRGB.


PrevHomeNext
SDL_RectUpSDL_Palette
\ No newline at end of file diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlcondbroadcast.html b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlcondbroadcast.html new file mode 100644 index 000000000..9b0fc83e0 --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlcondbroadcast.html @@ -0,0 +1,224 @@ +SDL_CondBroadcast
SDL Library Documentation
PrevNext

SDL_CondBroadcast

Name

SDL_CondBroadcast -- Restart all threads waiting on a condition variable

Synopsis

#include "SDL.h"
+#include "SDL_thread.h"

int SDL_CondBroadcast(SDL_cond *cond);

Description

Restarts all threads that are waiting on the condition variable, cond. Returns 0 on success, or -1 on an error.


PrevHomeNext
SDL_CondSignalUpSDL_CondWait
\ No newline at end of file diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlcondsignal.html b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlcondsignal.html new file mode 100644 index 000000000..24e917599 --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlcondsignal.html @@ -0,0 +1,224 @@ +SDL_CondSignal
SDL Library Documentation
PrevNext

SDL_CondSignal

Name

SDL_CondSignal -- Restart a thread wait on a condition variable

Synopsis

#include "SDL.h"
+#include "SDL_thread.h"

int SDL_CondSignal(SDL_cond *cond);

Description

Restart one of the threads that are waiting on the condition variable, cond. Returns 0 on success of -1 on an error.


PrevHomeNext
SDL_DestroyCondUpSDL_CondBroadcast
\ No newline at end of file diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlcondwait.html b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlcondwait.html new file mode 100644 index 000000000..8f1545258 --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlcondwait.html @@ -0,0 +1,231 @@ +SDL_CondWait
SDL Library Documentation
PrevNext

SDL_CondWait

Name

SDL_CondWait -- Wait on a condition variable

Synopsis

#include "SDL.h"
+#include "SDL_thread.h"

int SDL_CondWait(SDL_cond *cond, SDL_mutex *mut);

Description

Wait on the condition variable cond and unlock the provided mutex. The mutex must the locked before entering this function. Returns 0 when it is signalled, or -1 on an error.


PrevHomeNext
SDL_CondBroadcastUpSDL_CondWaitTimeout
\ No newline at end of file diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlcondwaittimeout.html b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlcondwaittimeout.html new file mode 100644 index 000000000..deed50bfe --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlcondwaittimeout.html @@ -0,0 +1,230 @@ +SDL_CondWaitTimeout
SDL Library Documentation
PrevNext

SDL_CondWaitTimeout

Name

SDL_CondWaitTimeout -- Wait on a condition variable, with timeout

Synopsis

#include "SDL.h"
+#include "SDL_thread.h"

int SDL_CondWaitTimeout(SDL_cond *cond, SDL_mutex *mutex, Uint32 ms);

Description

Wait on the condition variable cond for, at most, ms milliseconds. mut is unlocked so it must be locked when the function is called. Returns SDL_MUTEX_TIMEDOUT if the condition is not signalled in the allotted time, 0 if it was signalled or -1 on an error.

See Also

SDL_CondWait


PrevHomeNext
SDL_CondWaitUpTime
\ No newline at end of file diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlconvertaudio.html b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlconvertaudio.html new file mode 100644 index 000000000..52f122968 --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlconvertaudio.html @@ -0,0 +1,407 @@ +SDL_ConvertAudio
SDL Library Documentation
PrevNext

SDL_ConvertAudio

Name

SDL_ConvertAudio -- Convert audio data to a desired audio format.

Synopsis

#include "SDL.h"

int SDL_ConvertAudio(SDL_AudioCVT *cvt);

Description

SDL_ConvertAudio takes one parameter, cvt, which was previously initilized. Initilizing a SDL_AudioCVT is a two step process. First of all, the structure must be passed to SDL_BuildAudioCVT along with source and destination format parameters. Secondly, the cvt->buf and cvt->len fields must be setup. cvt->buf should point to the audio data and cvt->len should be set to the length of the audio data in bytes. Remember, the length of the buffer pointed to by buf show be len*len_mult bytes in length.

Once the SDL_AudioCVTstructure is initilized then we can pass it to SDL_ConvertAudio, which will convert the audio data pointer to by cvt->buf. If SDL_ConvertAudio returned 0 then the conversion was completed successfully, otherwise -1 is returned.

If the conversion completed successfully then the converted audio data can be read from cvt->buf. The amount of valid, converted, audio data in the buffer is equal to cvt->len*cvt->len_ratio.

Examples

/* Converting some WAV data to hardware format */
+void my_audio_callback(void *userdata, Uint8 *stream, int len);
+
+SDL_AudioSpec *desired, *obtained;
+SDL_AudioSpec wav_spec;
+SDL_AudioCVT  wav_cvt;
+Uint32 wav_len;
+Uint8 *wav_buf;
+int ret;
+
+/* Allocated audio specs */
+desired = malloc(sizeof(SDL_AudioSpec));
+obtained = malloc(sizeof(SDL_AudioSpec));
+
+/* Set desired format */
+desired->freq=22050;
+desired->format=AUDIO_S16LSB;
+desired->samples=8192;
+desired->callback=my_audio_callback;
+desired->userdata=NULL;
+
+/* Open the audio device */
+if ( SDL_OpenAudio(desired, obtained) < 0 ){
+  fprintf(stderr, "Couldn't open audio: %s\n", SDL_GetError());
+  exit(-1);
+}
+        
+free(desired);
+
+/* Load the test.wav */
+if( SDL_LoadWAV("test.wav", &wav_spec, &wav_buf, &wav_len) == NULL ){
+  fprintf(stderr, "Could not open test.wav: %s\n", SDL_GetError());
+  SDL_CloseAudio();
+  free(obtained);
+  exit(-1);
+}
+                                            
+/* Build AudioCVT */
+ret = SDL_BuildAudioCVT(&wav_cvt,
+                        wav_spec.format, wav_spec.channels, wav_spec.freq,
+                        obtained->format, obtained->channels, obtained->freq);
+
+/* Check that the convert was built */
+if(ret==-1){
+  fprintf(stderr, "Couldn't build converter!\n");
+  SDL_CloseAudio();
+  free(obtained);
+  SDL_FreeWAV(wav_buf);
+}
+
+/* Setup for conversion */
+wav_cvt.buf = malloc(wav_len * wav_cvt.len_mult);
+wav_cvt.len = wav_len;
+memcpy(wav_cvt.buf, wav_buf, wav_len);
+
+/* We can delete to original WAV data now */
+SDL_FreeWAV(wav_buf);
+
+/* And now we're ready to convert */
+SDL_ConvertAudio(&wav_cvt);
+
+/* do whatever */
+.
+.
+.
+.
+

PrevHomeNext
SDL_BuildAudioCVTUpSDL_MixAudio
\ No newline at end of file diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlconvertsurface.html b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlconvertsurface.html new file mode 100644 index 000000000..cc21f7833 --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlconvertsurface.html @@ -0,0 +1,271 @@ +SDL_ConvertSurface
SDL Library Documentation
PrevNext

SDL_ConvertSurface

Name

SDL_ConvertSurface -- Converts a surface to the same format as another surface.

Synopsis

#include "SDL/SDL.h"

SDL_Surface *SDL_ConvertSurface(SDL_Surface *src, SDL_PixelFormat *fmt, Uint32 flags);

Description

Creates a new surface of the specified format, and then copies and maps +the given surface to it. If this function fails, it returns +NULL.

The flags parameter is passed to +SDL_CreateRGBSurface +and has those semantics.

This function is used internally by +SDL_DisplayFormat.

This function can only be called after SDL_Init.

Return Value

Returns either a pointer to the new surface, or +NULL on error.


PrevHomeNext
SDL_GetClipRectUpSDL_BlitSurface
\ No newline at end of file diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlcreatecond.html b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlcreatecond.html new file mode 100644 index 000000000..02fcdb2b3 --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlcreatecond.html @@ -0,0 +1,240 @@ +SDL_CreateCond
SDL Library Documentation
PrevNext

SDL_CreateCond

Name

SDL_CreateCond -- Create a condition variable

Synopsis

#include "SDL.h"
+#include "SDL_thread.h"

SDL_cond *SDL_CreateCond(void);

Description

Creates a condition variable.

Examples

SDL_cond *cond;
+
+cond=SDL_CreateCond();
+.
+.
+/* Do stuff */
+
+.
+.
+SDL_DestroyCond(cond);

PrevHomeNext
SDL_SemValueUpSDL_DestroyCond
\ No newline at end of file diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlcreatecursor.html b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlcreatecursor.html new file mode 100644 index 000000000..a444165ff --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlcreatecursor.html @@ -0,0 +1,398 @@ +SDL_CreateCursor
SDL Library Documentation
PrevNext

SDL_CreateCursor

Name

SDL_CreateCursor -- Creates a new mouse cursor.

Synopsis

#include "SDL.h"

SDL_Cursor *SDL_CreateCursor(Uint8 *data, Uint8 *mask, int w, int h, int hot_x, int hot_y);

Description

Create a cursor using the specified data and mask (in MSB format). +The cursor width must be a multiple of 8 bits.

The cursor is created in black and white according to the following: +

Data / MaskResulting pixel on screen
0 / 1White
1 / 1Black
0 / 0Transparent
1 / 0Inverted color if possible, black if not.

Cursors created with this function must be freed with +SDL_FreeCursor.

Example

/* Stolen from the mailing list */
+/* Creates a new mouse cursor from an XPM */
+
+
+/* XPM */
+static const char *arrow[] = {
+  /* width height num_colors chars_per_pixel */
+  "    32    32        3            1",
+  /* colors */
+  "X c #000000",
+  ". c #ffffff",
+  "  c None",
+  /* pixels */
+  "X                               ",
+  "XX                              ",
+  "X.X                             ",
+  "X..X                            ",
+  "X...X                           ",
+  "X....X                          ",
+  "X.....X                         ",
+  "X......X                        ",
+  "X.......X                       ",
+  "X........X                      ",
+  "X.....XXXXX                     ",
+  "X..X..X                         ",
+  "X.X X..X                        ",
+  "XX  X..X                        ",
+  "X    X..X                       ",
+  "     X..X                       ",
+  "      X..X                      ",
+  "      X..X                      ",
+  "       XX                       ",
+  "                                ",
+  "                                ",
+  "                                ",
+  "                                ",
+  "                                ",
+  "                                ",
+  "                                ",
+  "                                ",
+  "                                ",
+  "                                ",
+  "                                ",
+  "                                ",
+  "                                ",
+  "0,0"
+};
+
+static SDL_Cursor *init_system_cursor(const char *image[])
+{
+  int i, row, col;
+  Uint8 data[4*32];
+  Uint8 mask[4*32];
+  int hot_x, hot_y;
+
+  i = -1;
+  for ( row=0; row<32; ++row ) {
+    for ( col=0; col<32; ++col ) {
+      if ( col % 8 ) {
+        data[i] <<= 1;
+        mask[i] <<= 1;
+      } else {
+        ++i;
+        data[i] = mask[i] = 0;
+      }
+      switch (image[4+row][col]) {
+        case 'X':
+          data[i] |= 0x01;
+          mask[i] |= 0x01;
+          break;
+        case '.':
+          mask[i] |= 0x01;
+          break;
+        case ' ':
+          break;
+      }
+    }
+  }
+  sscanf(image[4+row], "%d,%d", &hot_x, &hot_y);
+  return SDL_CreateCursor(data, mask, 32, 32, hot_x, hot_y);
+}

PrevHomeNext
SDL_WarpMouseUpSDL_FreeCursor
\ No newline at end of file diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlcreatemutex.html b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlcreatemutex.html new file mode 100644 index 000000000..53ed48bb2 --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlcreatemutex.html @@ -0,0 +1,249 @@ +SDL_CreateMutex
SDL Library Documentation
PrevNext

SDL_CreateMutex

Name

SDL_CreateMutex -- Create a mutex

Synopsis

#include "SDL.h"
+#include "SDL_thread.h"

SDL_mutex *SDL_CreateMutex(void);

Description

Create a new, unlocked mutex.

Examples

SDL_mutex *mut;
+
+mut=SDL_CreateMutex();
+.
+.
+if(SDL_mutexP(mut)==-1){
+  fprintf(stderr, "Couldn't lock mutex\n");
+  exit(-1);
+}
+.
+/* Do stuff while mutex is locked */
+.
+.
+if(SDL_mutexV(mut)==-1){
+  fprintf(stderr, "Couldn't unlock mutex\n");
+  exit(-1);
+}
+
+SDL_DestroyMutex(mut);

PrevHomeNext
SDL_KillThreadUpSDL_DestroyMutex
\ No newline at end of file diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlcreatergbsurface.html b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlcreatergbsurface.html new file mode 100644 index 000000000..736ec8f96 --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlcreatergbsurface.html @@ -0,0 +1,458 @@ +SDL_CreateRGBSurface
SDL Library Documentation
PrevNext

SDL_CreateRGBSurface

Name

SDL_CreateRGBSurface -- Create an empty SDL_Surface

Synopsis

#include "SDL.h"

SDL_Surface *SDL_CreateRGBSurface(Uint32 flags, int width, int height, int depth, Uint32 Rmask, Uint32 Gmask, Uint32 Bmask, Uint32 Amask);

Description

Allocate an empty surface (must be called after SDL_SetVideoMode)

If depth is 8 bits an empty palette is allocated for the surface, otherwise a 'packed-pixel' SDL_PixelFormat is created using the [RGBA]mask's provided (see SDL_PixelFormat). The flags specifies the type of surface that should be created, it is an OR'd combination of the following possible values.

SDL_SWSURFACESDL will create the surface in system memory. This improves the performance of pixel level access, however you may not be able to take advantage of some types of hardware blitting.
SDL_HWSURFACESDL will attempt to create the surface in video memory. This will allow SDL to take advantage of Video->Video blits (which are often accelerated).
SDL_SRCCOLORKEYThis flag turns on colourkeying for blits from this surface. If +SDL_HWSURFACE is also specified and colourkeyed blits +are hardware-accelerated, then SDL will attempt to place the surface in +video memory. +Use SDL_SetColorKey +to set or clear this flag after surface creation.
SDL_SRCALPHAThis flag turns on alpha-blending for blits from this surface. If +SDL_HWSURFACE is also specified and alpha-blending blits +are hardware-accelerated, then the surface will be placed in video memory if +possible. +Use SDL_SetAlpha to +set or clear this flag after surface creation.

Note: If an alpha-channel is specified (that is, if Amask is +nonzero), then the SDL_SRCALPHA flag is automatically +set. You may remove this flag by calling +SDL_SetAlpha +after surface creation.

Return Value

Returns the created surface, or NULL upon error.

Example

    /* Create a 32-bit surface with the bytes of each pixel in R,G,B,A order,
+       as expected by OpenGL for textures */
+    SDL_Surface *surface;
+    Uint32 rmask, gmask, bmask, amask;
+
+    /* SDL interprets each pixel as a 32-bit number, so our masks must depend
+       on the endianness (byte order) of the machine */
+#if SDL_BYTEORDER == SDL_BIG_ENDIAN
+    rmask = 0xff000000;
+    gmask = 0x00ff0000;
+    bmask = 0x0000ff00;
+    amask = 0x000000ff;
+#else
+    rmask = 0x000000ff;
+    gmask = 0x0000ff00;
+    bmask = 0x00ff0000;
+    amask = 0xff000000;
+#endif
+
+    surface = SDL_CreateRGBSurface(SDL_SWSURFACE, width, height, 32,
+                                   rmask, gmask, bmask, amask);
+    if(surface == NULL) {
+        fprintf(stderr, "CreateRGBSurface failed: %s\n", SDL_GetError());
+        exit(1);
+    }

PrevHomeNext
SDL_GetRGBAUpSDL_CreateRGBSurfaceFrom
\ No newline at end of file diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlcreatergbsurfacefrom.html b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlcreatergbsurfacefrom.html new file mode 100644 index 000000000..6acfdccae --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlcreatergbsurfacefrom.html @@ -0,0 +1,256 @@ +SDL_CreateRGBSurfaceFrom
SDL Library Documentation
PrevNext

SDL_CreateRGBSurfaceFrom

Name

SDL_CreateRGBSurfaceFrom -- Create an SDL_Surface from pixel data

Synopsis

#include "SDL.h"

SDL_Surface *SDL_CreateRGBSurfaceFrom(void *pixels, int width, int height, int depth, int pitch, Uint32 Rmask, Uint32 Gmask, Uint32 Bmask, Uint32 Amask);

Description

Creates an SDL_Surface from the provided pixel data.

The data stored in pixels is assumed to be of the depth specified in the parameter list. The pixel data is not copied into the SDL_Surface structure so it should not be freed until the surface has been freed with a called to SDL_FreeSurface. pitch is the length of each scanline in bytes.

See SDL_CreateRGBSurface for a more detailed description of the other parameters.

Return Value

Returns the created surface, or NULL upon error.


PrevHomeNext
SDL_CreateRGBSurfaceUpSDL_FreeSurface
\ No newline at end of file diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlcreatesemaphore.html b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlcreatesemaphore.html new file mode 100644 index 000000000..43dcbf5bf --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlcreatesemaphore.html @@ -0,0 +1,303 @@ +SDL_CreateSemaphore
SDL Library Documentation
PrevNext

SDL_CreateSemaphore

Name

SDL_CreateSemaphore -- Creates a new semaphore and assigns an initial value to it.

Synopsis

#include "SDL.h"
+#include "SDL_thread.h"

SDL_sem *SDL_CreateSemaphore(Uint32 initial_value);

Description

SDL_CreateSemaphore() creates a new semaphore and +initializes it with the value initial_value. +Each locking operation on the semaphore by +SDL_SemWait, +SDL_SemTryWait or +SDL_SemWaitTimeout +will atomically decrement the semaphore value. The locking operation will be blocked +if the semaphore value is not positive (greater than zero). Each unlock operation by +SDL_SemPost +will atomically increment the semaphore value.

Return Value

Returns a pointer to an initialized semaphore or +NULL if there was an error.

Examples

SDL_sem *my_sem;
+
+my_sem = SDL_CreateSemaphore(INITIAL_SEM_VALUE);
+
+if (my_sem == NULL) {
+        return CREATE_SEM_FAILED;
+}


PrevHomeNext
SDL_mutexVUpSDL_DestroySemaphore
\ No newline at end of file diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlcreatethread.html b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlcreatethread.html new file mode 100644 index 000000000..ca3c2d920 --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlcreatethread.html @@ -0,0 +1,223 @@ +SDL_CreateThread
SDL Library Documentation
PrevNext

SDL_CreateThread

Name

SDL_CreateThread -- Creates a new thread of execution that shares its parent's properties.

Synopsis

#include "SDL.h"
+#include "SDL_thread.h"

SDL_Thread *SDL_CreateThread(int (*fn)(void *), void *data);

Description

SDL_CreateThread creates a new thread of execution +that shares all of its parent's global memory, signal handlers, +file descriptors, etc, and runs the function fn +passed the void pointer data +The thread quits when this function returns.


PrevHomeNext
Multi-threaded ProgrammingUpSDL_ThreadID
\ No newline at end of file diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlcreateyuvoverlay.html b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlcreateyuvoverlay.html new file mode 100644 index 000000000..c24ef6ee2 --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlcreateyuvoverlay.html @@ -0,0 +1,256 @@ +SDL_CreateYUVOverlay
SDL Library Documentation
PrevNext

SDL_CreateYUVOverlay

Name

SDL_CreateYUVOverlay -- Create a YUV video overlay

Synopsis

#include "SDL.h"

SDL_Overlay *SDL_CreateYUVOverlay(int width, int height, Uint32 format, SDL_Surface *display);

Description

SDL_CreateYUVOverlay creates a YUV overlay of the specified width, height and format (see SDL_Overlay for a list of available formats), for the provided display. A SDL_Overlay structure is returned.

The term 'overlay' is a misnomer since, unless the overlay is created in hardware, the contents for the display surface underneath the area where the overlay is shown will be overwritten when the overlay is displayed.


PrevHomeNext
SDL_GL_SwapBuffersUpSDL_LockYUVOverlay
\ No newline at end of file diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdldelay.html b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdldelay.html new file mode 100644 index 000000000..a5417fa66 --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdldelay.html @@ -0,0 +1,231 @@ +SDL_Delay
SDL Library Documentation
PrevNext

SDL_Delay

Name

SDL_Delay -- Wait a specified number of milliseconds before returning.

Synopsis

#include "SDL.h"

void SDL_Delay(Uint32 ms);

Description

Wait a specified number of milliseconds before returning. SDL_Delay will wait at least the specified time, but possible longer due to OS scheduling.

Note: Count on a delay granularity of at least 10 ms. +Some platforms have shorter clock ticks but this is the most common.

See Also

SDL_AddTimer


PrevHomeNext
SDL_GetTicksUpSDL_AddTimer
\ No newline at end of file diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdldestroycond.html b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdldestroycond.html new file mode 100644 index 000000000..ac0804286 --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdldestroycond.html @@ -0,0 +1,206 @@ +SDL_DestroyCond
SDL Library Documentation
PrevNext

SDL_DestroyCond

Name

SDL_DestroyCond -- Destroy a condition variable

Synopsis

#include "SDL.h"
+#include "SDL_thread.h"

void SDL_DestroyCond(SDL_cond *cond);

Description

Destroys a condition variable.


PrevHomeNext
SDL_CreateCondUpSDL_CondSignal
\ No newline at end of file diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdldestroymutex.html b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdldestroymutex.html new file mode 100644 index 000000000..949bfc5d5 --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdldestroymutex.html @@ -0,0 +1,209 @@ +SDL_DestroyMutex
SDL Library Documentation
PrevNext

SDL_DestroyMutex

Name

SDL_DestroyMutex -- Destroy a mutex

Synopsis

#include "SDL.h"
+#include "SDL_thread.h"

void SDL_DestroyMutex(SDL_mutex *mutex);

Description

Destroy a previously created mutex.


PrevHomeNext
SDL_CreateMutexUpSDL_mutexP
\ No newline at end of file diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdldestroysemaphore.html b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdldestroysemaphore.html new file mode 100644 index 000000000..d32bdfaf5 --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdldestroysemaphore.html @@ -0,0 +1,278 @@ +SDL_DestroySemaphore
SDL Library Documentation
PrevNext

SDL_DestroySemaphore

Name

SDL_DestroySemaphore -- Destroys a semaphore that was created by SDL_CreateSemaphore.

Synopsis

#include "SDL.h"
+#include "SDL_thread.h"

void SDL_DestroySemaphore(SDL_sem *sem);

Description

SDL_DestroySemaphore destroys the semaphore pointed to +by sem that was created by +SDL_CreateSemaphore. +It is not safe to destroy a semaphore if there are threads currently blocked +waiting on it.

Examples

if (my_sem != NULL) {
+        SDL_DestroySemaphore(my_sem);
+        my_sem = NULL;
+}


PrevHomeNext
SDL_CreateSemaphoreUpSDL_SemWait
\ No newline at end of file diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdldisplayformat.html b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdldisplayformat.html new file mode 100644 index 000000000..c91adfe50 --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdldisplayformat.html @@ -0,0 +1,262 @@ +SDL_DisplayFormat
SDL Library Documentation
PrevNext

SDL_DisplayFormat

Name

SDL_DisplayFormat -- Convert a surface to the display format

Synopsis

#include "SDL.h"

SDL_Surface *SDL_DisplayFormat(SDL_Surface *surface);

Description

This function takes a surface and copies it to a new surface of the +pixel format and colors of the video framebuffer, suitable for fast +blitting onto the display surface. It calls +SDL_ConvertSurface

If you want to take advantage of hardware colorkey or alpha blit +acceleration, you should set the colorkey and alpha value before +calling this function.

If you want an alpha channel, see SDL_DisplayFormatAlpha.

Return Value

If the conversion fails or runs out of memory, it returns +NULL


PrevHomeNext
SDL_FillRectUpSDL_DisplayFormatAlpha
\ No newline at end of file diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdldisplayformatalpha.html b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdldisplayformatalpha.html new file mode 100644 index 000000000..6e88604d0 --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdldisplayformatalpha.html @@ -0,0 +1,250 @@ +SDL_DisplayFormatAlpha
SDL Library Documentation
PrevNext

SDL_DisplayFormatAlpha

Name

SDL_DisplayFormatAlpha -- Convert a surface to the display format

Synopsis

#include "SDL.h"

SDL_Surface *SDL_DisplayFormatAlpha(SDL_Surface *surface);

Description

This function takes a surface and copies it to a new surface of the +pixel format and colors of the video framebuffer plus an alpha channel, +suitable for fast blitting onto the display surface. It calls +SDL_ConvertSurface

If you want to take advantage of hardware colorkey or alpha blit +acceleration, you should set the colorkey and alpha value before +calling this function.

This function can be used to convert a colourkey to an alpha channel, +if the SDL_SRCCOLORKEY flag is set on the surface. +The generated surface will then be transparent (alpha=0) where the +pixels match the colourkey, and opaque (alpha=255) elsewhere.

Return Value

If the conversion fails or runs out of memory, it returns +NULL


PrevHomeNext
SDL_DisplayFormatUpSDL_WarpMouse
\ No newline at end of file diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdldisplayyuvoverlay.html b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdldisplayyuvoverlay.html new file mode 100644 index 000000000..456c9985d --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdldisplayyuvoverlay.html @@ -0,0 +1,246 @@ +SDL_DisplayYUVOverlay
SDL Library Documentation
PrevNext

SDL_DisplayYUVOverlay

Name

SDL_DisplayYUVOverlay -- Blit the overlay to the display

Synopsis

#include "SDL.h"

int SDL_DisplayYUVOverlay(SDL_Overlay *overlay, SDL_Rect *dstrect);

Description

Blit the overlay to the surface specified when it was created. The SDL_Rect structure, dstrect, specifies the position and size of the destination. If the dstrect is a larger or smaller than the overlay then the overlay will be scaled, this is optimized for 2x scaling.

Return Values

Returns 0 on success


PrevHomeNext
SDL_UnlockYUVOverlayUpSDL_FreeYUVOverlay
\ No newline at end of file diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlenablekeyrepeat.html b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlenablekeyrepeat.html new file mode 100644 index 000000000..878feb14f --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlenablekeyrepeat.html @@ -0,0 +1,238 @@ +SDL_EnableKeyRepeat
SDL Library Documentation
PrevNext

SDL_EnableKeyRepeat

Name

SDL_EnableKeyRepeat -- Set keyboard repeat rate.

Synopsis

#include "SDL.h"

int SDL_EnableKeyRepeat(int delay, int interval);

Description

Enables or disables the keyboard repeat rate. delay specifies how long the key must be pressed before it begins repeating, it then repeats at the speed specified by interval. Both delay and interval are expressed in milliseconds.

Setting delay to 0 disables key repeating completely. Good default values are SDL_DEFAULT_REPEAT_DELAY and SDL_DEFAULT_REPEAT_INTERVAL.

Return Value

Returns 0 on success and -1 on failure.


PrevHomeNext
SDL_EnableUNICODEUpSDL_GetMouseState
\ No newline at end of file diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlenableunicode.html b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlenableunicode.html new file mode 100644 index 000000000..855debbc9 --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlenableunicode.html @@ -0,0 +1,252 @@ +SDL_EnableUNICODE
SDL Library Documentation
PrevNext

SDL_EnableUNICODE

Name

SDL_EnableUNICODE -- Enable UNICODE translation

Synopsis

#include "SDL.h"

int SDL_EnableUNICODE(int enable);

Description

Enables/Disables Unicode keyboard translation.

To obtain the character codes corresponding to received keyboard events, +Unicode translation must first be turned on using this function. The +translation incurs a slight overhead for each keyboard event and is therefore +disabled by default. For each subsequently received key down event, the +unicode member of the +SDL_keysym structure +will then contain the corresponding character code, or zero for keysyms that do +not correspond to any character code.

A value of 1 for enable enables Unicode translation; +0 disables it, and -1 leaves it unchanged (useful for querying the current +translation mode).

Note that only key press events will be translated, not release events.

Return Value

Returns the previous translation mode (0 or 1).

See Also

SDL_keysym


PrevHomeNext
SDL_GetKeyNameUpSDL_EnableKeyRepeat
\ No newline at end of file diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlenvvars.html b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlenvvars.html new file mode 100644 index 000000000..8999ed1f1 --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlenvvars.html @@ -0,0 +1,1227 @@ +SDL_envvars
SDL Library Documentation
PrevNext

SDL_envvars

Name

SDL_envvars -- SDL environment variables

Description

Not a function, set using setenv()

Several environment variables are available to modify the +behaviour of SDL. Using these variables isn't recommened and the names +and presence of these variables aren't guaranteed from one release to +the next. However, they can be very useful for debugging +purposes.

Video

SDL_FBACCEL

If set to 0, disable hardware acceleration in the linux fbcon driver.

SDL_FBDEV

Frame buffer device to use in the linux fbcon driver, instead of /dev/fb0

SDL_FULLSCREEN_UPDATE

In the ps2gs driver, sets the SDL_ASYNCBLIT flag on the +display surface.

SDL_VIDEODRIVER

Selectes the video driver for SDL to use. Possible values, in the +order they are tried if this variable is not set:

x11

dga

(the XFree86 DGA2)

nanox

(Linux)

fbcon

(Linux)

directfb

(Linux)

ps2gs

(Playstation 2)

ggi

vgl

(BSD)

svgalib

(Linux)

aalib

directx

(Win32)

windib

(Win32)

bwindow

(BeOS)

toolbox

(MacOS Classic)

DSp

(MacOS Classic)

Quartz

(Mac OS X)

CGX

(Amiga)

photon

(QNX)

dummy

SDL_VIDEO_CENTERED

If set, tries to center the SDL window when running in X11 windowed +mode, or using the CyberGrafix driver.

SDL_VIDEO_GL_DRIVER

The openGL driver (shared library) to use for X11. Default is libGL.so.1

SDL_VIDEO_X11_DGAMOUSE

With XFree86, enables use of DGA mouse if set.

SDL_VIDEO_X11_MOUSEACCEL

For X11, sets the mouse acceleration. The value should be a string +on the form:

"n/d/t"

where n and d are the +acceleration numerator/denumerators (so mouse movement is accelerated by +n/d), and +t is the threshold above which acceleration applies +(counted as number of pixels the mouse moves at once).

SDL_VIDEO_X11_NODIRECTCOLOR

If set, don't attempt to use DirectColor visuals even if they are +present. (SDL will use them otherwise for gamma correction). +This is needed with older X servers when using the XVideo extension.

SDL_VIDEO_X11_VISUALID

ID of an X11 visual to use, overriding SDL's default visual selection +algorithm. It can be in decimal or in hex (prefixed by 0x).

SDL_VIDEO_YUV_DIRECT

If set, display YUV overlay directly on the video surface if possible, +instead of on the surface passed to +SDL_CreateYUVOverlay.

SDL_VIDEO_YUV_HWACCEL

If not set or set to a nonzero value, SDL will attempt to use +hardware YUV acceleration for video playback.

SDL_WINDOWID

For X11 or Win32, contains the ID number of the window to be used by +SDL instead of creating its own window. Either in decimal or +in hex (prefixed by 0x).

Events/Input

SDL_MOUSE_RELATIVE

If set to 0, do not use mouse relative mode in X11. The default is +to use it if the mouse is hidden and input is grabbed.

SDL_MOUSEDEV

The mouse device to use for the linux fbcon driver. If not set, +SDL first tries to use GPM in repeater mode, then various other +devices (/dev/pcaux, /dev/adbmouse, /dev/mouse etc).

SDL_MOUSEDEV_IMPS2

If set, SDL will not try to auto-detect the IMPS/2 protocol of +a PS/2 mouse but use it right away. For the fbcon and ps2gs drivers.

SDL_MOUSEDRV

For the linux fbcon driver: if set to ELO, use the ELO touchscreen +controller as a pointer device

SDL_NO_RAWKBD

For the libvga driver: If set, do not attempt to put the keyboard in raw mode.

SDL_NOMOUSE

If set, the linux fbcon driver will not use a mouse at all.

SDL_NO_LOCK_KEYS

Disable CAPS-LOCK and NUM-LOCK suppression of down+up key events, +suitable for games where the player needs these keys to do more than just toggle. +A value of 1 will effect both CAPS-LOCK and NUM-LOCK. +A value of 2 will effect only CAPS-LOCK. +A value of 3 will effect only NUM-LOCK. +All other values have no effect. +

Audio

AUDIODEV

The audio device to use, if SDL_PATH_DSP isn't set.

SDL_AUDIODRIVER

Selects the audio driver for SDL to use. Possible values, in the +order they are tried if this variable is not set:

openbsd

(OpenBSD)

dsp

(OSS /dev/dsp: Linux, Solaris, BSD etc)

alsa

(Linux)

pulse

(PulseAudio daemon)

audio

(Unix style /dev/audio: SunOS, Solaris etc)

AL

(Irix)

artsc

(ARTS audio daemon)

esd

(esound audio daemon)

nas

(NAS audio daemon)

dma

(OSS /dev/dsp, using DMA)

dsound

(Win32 DirectX)

waveout

(Win32 WaveOut)

baudio

(BeOS)

sndmgr

(MacOS SoundManager)

paud

(AIX)

AHI

(Amiga)

disk

(all; output to file)

SDL_DISKAUDIOFILE

The name of the output file for the "disk" audio driver. If not +set, the name sdlaudio.raw is used.

SDL_DISKAUDIODELAY

For the "disk" audio driver, how long to wait (in ms) before writing +a full sound buffer. The default is 150 ms.

SDL_DSP_NOSELECT

For some audio drivers (alsa, paud, dma and dsp), don't use select() +but a timed method instead. May cure some audio problems, or cause +others.

SDL_PATH_DSP

The audio device to use. If not set, SDL tries AUDIODEV and then +a platform-dependent default value (/dev/audio on Solaris, +/dev/dsp on Linux etc).

CD-ROM

SDL_CDROM

A colon-separated list of CD-ROM devices to use, in addition to +the standard devices (typically /dev/cdrom, platform-dependent).

Debugging

SDL_DEBUG

If set, causes every call to SDL_SetError (that +is, every time SDL signals an error) to also print an error message on +stderr.

Joystick

SDL_JOYSTICK_DEVICE

Joystick device to use in the linux joystick driver, in addition +to the usual: /dev/js*, /dev/input/event*, /dev/input/js*

SDL_LINUX_JOYSTICK

Special joystick configuration string for linux. The format is

"name numaxes numhats numballs"

where name is the name string of the joystick +(possibly in single quotes), and the rest are the number of axes, hats +and balls respectively.


PrevHomeNext
SDL_GetErrorUpVideo
diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlevent.html b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlevent.html new file mode 100644 index 000000000..dfd21b7fe --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlevent.html @@ -0,0 +1,994 @@ +SDL_Event
SDL Library Documentation
PrevNext

SDL_Event

Name

SDL_Event -- General event structure

Structure Definition

typedef union{
+  Uint8 type;
+  SDL_ActiveEvent active;
+  SDL_KeyboardEvent key;
+  SDL_MouseMotionEvent motion;
+  SDL_MouseButtonEvent button;
+  SDL_JoyAxisEvent jaxis;
+  SDL_JoyBallEvent jball;
+  SDL_JoyHatEvent jhat;
+  SDL_JoyButtonEvent jbutton;
+  SDL_ResizeEvent resize;
+  SDL_ExposeEvent expose;
+  SDL_QuitEvent quit;
+  SDL_UserEvent user;
+  SDL_SysWMEvent syswm;
+} SDL_Event;

Description

The SDL_Event union is the core to all event handling is SDL, its probably the most important structure after SDL_Surface. SDL_Event is a union of all event structures used in SDL, using it is a simple matter of knowing which union member relates to which event type.

Event typeEvent Structure
SDL_ACTIVEEVENTSDL_ActiveEvent
SDL_KEYDOWN/UPSDL_KeyboardEvent
SDL_MOUSEMOTIONSDL_MouseMotionEvent
SDL_MOUSEBUTTONDOWN/UPSDL_MouseButtonEvent
SDL_JOYAXISMOTIONSDL_JoyAxisEvent
SDL_JOYBALLMOTIONSDL_JoyBallEvent
SDL_JOYHATMOTIONSDL_JoyHatEvent
SDL_JOYBUTTONDOWN/UPSDL_JoyButtonEvent
SDL_QUITSDL_QuitEvent
SDL_SYSWMEVENTSDL_SysWMEvent
SDL_VIDEORESIZESDL_ResizeEvent
SDL_VIDEOEXPOSESDL_ExposeEvent
SDL_USEREVENTSDL_UserEvent

Use

The SDL_Event structure has two uses

  • Reading events on the event queue

  • Placing events on the event queue

Reading events from the event queue is done with either SDL_PollEvent or SDL_PeepEvents. We'll use SDL_PollEvent and step through an example.

First off, we create an empty SDL_Event structure. +

SDL_Event test_event;
+SDL_PollEvent removes the next event from the event queue, if there are no events on the queue it returns 0 otherwise it returns 1. We use a while loop to process each event in turn. +
while(SDL_PollEvent(&test_event)) {
+The SDL_PollEvent function take a pointer to an SDL_Event structure that is to be filled with event information. We know that if SDL_PollEvent removes an event from the queue then the event information will be placed in our test_event structure, but we also know that the type of event will be placed in the type member of test_event. So to handle each event type seperately we use a switch statement. +
  switch(test_event.type) {
+We need to know what kind of events we're looking for and the event type's of those events. So lets assume we want to detect where the user is moving the mouse pointer within our application. We look through our event types and notice that SDL_MOUSEMOTION is, more than likely, the event we're looking for. A little more research tells use that SDL_MOUSEMOTION events are handled within the SDL_MouseMotionEvent structure which is the motion member of SDL_Event. We can check for the SDL_MOUSEMOTION event type within our switch statement like so: +
    case SDL_MOUSEMOTION:
+All we need do now is read the information out of the motion member of test_event. +
      printf("We got a motion event.\n");
+      printf("Current mouse position is: (%d, %d)\n", test_event.motion.x, test_event.motion.y);
+      break;
+    default:
+      printf("Unhandled Event!\n");
+      break;
+  }
+}
+printf("Event queue empty.\n");

It is also possible to push events onto the event queue and so use it as a two-way communication path. Both SDL_PushEvent and SDL_PeepEvents allow you to place events onto the event queue. This is usually used to place a SDL_USEREVENT on the event queue, however you could use it to post fake input events if you wished. Creating your own events is a simple matter of choosing the event type you want, setting the type member and filling the appropriate member structure with information. +

SDL_Event user_event;
+
+user_event.type=SDL_USEREVENT;
+user_event.user.code=2;
+user_event.user.data1=NULL;
+user_event.user.data2=NULL;
+SDL_PushEvent(&user_event);


PrevHomeNext
SDL Event Structures.UpSDL_ActiveEvent
diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdleventstate.html b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdleventstate.html new file mode 100644 index 000000000..b9a24486c --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdleventstate.html @@ -0,0 +1,276 @@ +SDL_EventState
SDL Library Documentation
PrevNext

SDL_EventState

Name

SDL_EventState -- This function allows you to set the state of processing certain events.

Synopsis

#include "SDL.h"

Uint8 SDL_EventState(Uint8 type, int state);

Description

This function allows you to set the state of processing certain event type's.

If state is set to SDL_IGNORE, +that event type will be automatically dropped from the event queue and will +not be filtered.

If state is set to SDL_ENABLE, +that event type will be processed normally.

If state is set to SDL_QUERY, +SDL_EventState will return the current processing +state of the specified event type.

A list of event type's can be found in the SDL_Event section.

See Also

SDL_Event


PrevHomeNext
SDL_GetEventFilterUpSDL_GetKeyState
\ No newline at end of file diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlexposeevent.html b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlexposeevent.html new file mode 100644 index 000000000..82c2a3e7e --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlexposeevent.html @@ -0,0 +1,252 @@ +SDL_ExposeEvent
SDL Library Documentation
PrevNext

SDL_ExposeEvent

Name

SDL_ExposeEvent -- Quit requested event

Structure Definition

typedef struct{
+  Uint8 type
+} SDL_ExposeEvent;

Structure Data

typeSDL_VIDEOEXPOSE

Description

SDL_ExposeEvent is a member of the SDL_Event union and is used whan an event of type SDL_VIDEOEXPOSE is reported.

A VIDEOEXPOSE event is triggered when the screen has been modified +outside of the application, usually by the window manager and needs to +be redrawn.


PrevHomeNext
SDL_ResizeEventUpSDL_SysWMEvent
diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlfillrect.html b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlfillrect.html new file mode 100644 index 000000000..4ace062e2 --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlfillrect.html @@ -0,0 +1,291 @@ +SDL_FillRect
SDL Library Documentation
PrevNext

SDL_FillRect

Name

SDL_FillRect -- This function performs a fast fill of the given rectangle with some color

Synopsis

#include "SDL.h"

int SDL_FillRect(SDL_Surface *dst, SDL_Rect *dstrect, Uint32 color);

Description

This function performs a fast fill of the given rectangle with +color. If dstrect +is NULL, the whole surface will be filled with +color.

The color should be a pixel of the format used by the surface, and +can be generated by the +SDL_MapRGB or SDL_MapRGBA +functions. If the color value contains an alpha value then the +destination is simply "filled" with that alpha information, no blending +takes place.

If there is a clip rectangle set on the destination (set via +SDL_SetClipRect) then this +function will clip based on the intersection of the clip rectangle and +the dstrect rectangle and the dstrect rectangle +will be modified to represent the area actually filled.

Return Value

This function returns 0 on success, or +-1 on error.


PrevHomeNext
SDL_BlitSurfaceUpSDL_DisplayFormat
\ No newline at end of file diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlflip.html b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlflip.html new file mode 100644 index 000000000..b480f99aa --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlflip.html @@ -0,0 +1,259 @@ +SDL_Flip
SDL Library Documentation
PrevNext

SDL_Flip

Name

SDL_Flip -- Swaps screen buffers

Synopsis

#include "SDL.h"

int SDL_Flip(SDL_Surface *screen);

Description

On hardware that supports double-buffering, this function sets up a flip +and returns. The hardware will wait for vertical retrace, and then swap +video buffers before the next video surface blit or lock will return. +On hardware that doesn't support double-buffering, this is equivalent +to calling SDL_UpdateRect(screen, 0, 0, 0, 0)

The SDL_DOUBLEBUF flag must have been passed to +SDL_SetVideoMode, + when +setting the video mode for this function to perform hardware flipping.

Return Value

This function returns 0 if successful, or +-1 if there was an error.


PrevHomeNext
SDL_UpdateRectsUpSDL_SetColors
\ No newline at end of file diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlfreecursor.html b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlfreecursor.html new file mode 100644 index 000000000..01a4f7c25 --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlfreecursor.html @@ -0,0 +1,209 @@ +SDL_FreeCursor
SDL Library Documentation
PrevNext

SDL_FreeCursor

Name

SDL_FreeCursor -- Frees a cursor created with SDL_CreateCursor.

Synopsis

#include "SDL.h"

void SDL_FreeCursor(SDL_Cursor *cursor);

Description

Frees a SDL_Cursor that was created using +SDL_CreateCursor.


PrevHomeNext
SDL_CreateCursorUpSDL_SetCursor
\ No newline at end of file diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlfreesurface.html b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlfreesurface.html new file mode 100644 index 000000000..84b604810 --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlfreesurface.html @@ -0,0 +1,219 @@ +SDL_FreeSurface
SDL Library Documentation
PrevNext

SDL_FreeSurface

Name

SDL_FreeSurface -- Frees (deletes) a SDL_Surface

Synopsis

#include "SDL.h"

void SDL_FreeSurface(SDL_Surface *surface);

Description

Frees the resources used by a previously created SDL_Surface. If the surface was created using +SDL_CreateRGBSurfaceFrom then the pixel data is not freed.


PrevHomeNext
SDL_CreateRGBSurfaceFromUpSDL_LockSurface
\ No newline at end of file diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlfreewav.html b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlfreewav.html new file mode 100644 index 000000000..24242c4b0 --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlfreewav.html @@ -0,0 +1,222 @@ +SDL_FreeWAV
SDL Library Documentation
PrevNext

SDL_FreeWAV

Name

SDL_FreeWAV -- Frees previously opened WAV data

Synopsis

#include "SDL.h"

void SDL_FreeWAV(Uint8 *audio_buf);

Description

After a WAVE file has been opened with SDL_LoadWAV its data can eventually be freed with SDL_FreeWAV. audio_buf is a pointer to the buffer created by SDL_LoadWAV.

See Also

SDL_LoadWAV


PrevHomeNext
SDL_LoadWAVUpSDL_AudioCVT
\ No newline at end of file diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlfreeyuvoverlay.html b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlfreeyuvoverlay.html new file mode 100644 index 000000000..e82340d9e --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlfreeyuvoverlay.html @@ -0,0 +1,233 @@ +SDL_FreeYUVOverlay
SDL Library Documentation
PrevNext

SDL_FreeYUVOverlay

Name

SDL_FreeYUVOverlay -- Free a YUV video overlay

Synopsis

#include "SDL.h"

void SDL_FreeYUVOverlay(SDL_Overlay *overlay);

Description

Frees and overlay created by SDL_CreateYUVOverlay.


PrevHomeNext
SDL_DisplayYUVOverlayUpSDL_GLattr
\ No newline at end of file diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlgetappstate.html b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlgetappstate.html new file mode 100644 index 000000000..d09e2e0f0 --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlgetappstate.html @@ -0,0 +1,263 @@ +SDL_GetAppState
SDL Library Documentation
PrevNext

SDL_GetAppState

Name

SDL_GetAppState -- Get the state of the application

Synopsis

#include "SDL.h"

Uint8 SDL_GetAppState(void);

Description

This function returns the current state of the application. The value returned is a bitwise combination of:

SDL_APPMOUSEFOCUSThe application has mouse focus.
SDL_APPINPUTFOCUSThe application has keyboard focus
SDL_APPACTIVEThe application is visible


PrevHomeNext
SDL_GetRelativeMouseStateUpSDL_JoystickEventState
\ No newline at end of file diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlgetaudiostatus.html b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlgetaudiostatus.html new file mode 100644 index 000000000..3fc3a0911 --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlgetaudiostatus.html @@ -0,0 +1,221 @@ +SDL_GetAudioStatus
SDL Library Documentation
PrevNext

SDL_GetAudioStatus

Name

SDL_GetAudioStatus -- Get the current audio state

Synopsis

#include "SDL.h"

SDL_audiostatusSDL_GetAudioStatus(void);

Description

typedef enum{
+  SDL_AUDIO_STOPPED,
+  SDL_AUDIO_PAUSED,
+  SDL_AUDIO_PLAYING
+} SDL_audiostatus;

Returns either SDL_AUDIO_STOPPED, SDL_AUDIO_PAUSED or SDL_AUDIO_PLAYING depending on the current audio state.


PrevHomeNext
SDL_PauseAudioUpSDL_LoadWAV
\ No newline at end of file diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlgetcliprect.html b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlgetcliprect.html new file mode 100644 index 000000000..f00ac77f8 --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlgetcliprect.html @@ -0,0 +1,229 @@ +SDL_GetClipRect
SDL Library Documentation
PrevNext

SDL_GetClipRect

Name

SDL_GetClipRect -- Gets the clipping rectangle for a surface.

Synopsis

#include "SDL.h"

void SDL_GetClipRect(SDL_Surface *surface, SDL_Rect *rect);

Description

Gets the clipping rectangle for a surface. When this surface is the +destination of a blit, only the area within the clip rectangle is +drawn into.

The rectangle pointed to by rect will be +filled with the clipping rectangle of the surface.


PrevHomeNext
SDL_SetClipRectUpSDL_ConvertSurface
\ No newline at end of file diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlgetcursor.html b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlgetcursor.html new file mode 100644 index 000000000..72ecbc7c0 --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlgetcursor.html @@ -0,0 +1,219 @@ +SDL_GetCursor
SDL Library Documentation
PrevNext

SDL_GetCursor

Name

SDL_GetCursor -- Get the currently active mouse cursor.

Synopsis

#include "SDL.h"

SDL_Cursor *SDL_GetCursor(void);

Description

Returns the currently active mouse cursor.


PrevHomeNext
SDL_SetCursorUpSDL_ShowCursor
\ No newline at end of file diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlgeterror.html b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlgeterror.html new file mode 100644 index 000000000..cdf57924a --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlgeterror.html @@ -0,0 +1,205 @@ +SDL_GetError
SDL Library Documentation
PrevNext

SDL_GetError

Name

SDL_GetError -- Get SDL error string

Synopsis

#include "SDL/SDL.h"

char *SDL_GetError(void);

Description

SDL_GetError returns a NULL terminated string containing information about the last internal SDL error.

Return Value

SDL_GetError returns a string containing the last error.


PrevHomeNext
SDL_WasInitUpSDL_envvars
\ No newline at end of file diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlgeteventfilter.html b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlgeteventfilter.html new file mode 100644 index 000000000..d254d34a5 --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlgeteventfilter.html @@ -0,0 +1,235 @@ +SDL_GetEventFilter
SDL Library Documentation
PrevNext

SDL_GetEventFilter

Name

SDL_GetEventFilter -- Retrieves a pointer to he event filter

Synopsis

#include "SDL.h"

SDL_EventFilter SDL_GetEventFilter(void);

Description

This function retrieces a pointer to the event filter that was previously set using SDL_SetEventFilter. An SDL_EventFilter function is defined as: +

typedef int (*SDL_EventFilter)(const SDL_Event *event);

Return Value

Returns a pointer to the event filter or NULL if no filter has been set.


PrevHomeNext
SDL_SetEventFilterUpSDL_EventState
\ No newline at end of file diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlgetgammaramp.html b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlgetgammaramp.html new file mode 100644 index 000000000..bfcc03c4d --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlgetgammaramp.html @@ -0,0 +1,219 @@ +SDL_GetGammaRamp
SDL Library Documentation
PrevNext

SDL_GetGammaRamp

Name

SDL_GetGammaRamp -- Gets the color gamma lookup tables for the display

Synopsis

#include "SDL.h"

int SDL_GetGammaRamp(Uint16 *redtable, Uint16 *greentable, Uint16 *bluetable);

Description

Gets the gamma translation lookup tables currently used by the display. +Each table is an array of 256 Uint16 values.

Not all display hardware is able to change gamma.

Return Value

Returns -1 on error.


PrevHomeNext
SDL_SetGammaUpSDL_SetGammaRamp
\ No newline at end of file diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlgetkeyname.html b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlgetkeyname.html new file mode 100644 index 000000000..6c51c9497 --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlgetkeyname.html @@ -0,0 +1,216 @@ +SDL_GetKeyName
SDL Library Documentation
PrevNext

SDL_GetKeyName

Name

SDL_GetKeyName -- Get the name of an SDL virtual keysym

Synopsis

#include "SDL.h"

char *SDL_GetKeyName(SDLKey key);

Description

Returns the SDL-defined name of the SDLKey key.

See Also

SDLKey


PrevHomeNext
SDL_SetModStateUpSDL_EnableUNICODE
\ No newline at end of file diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlgetkeystate.html b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlgetkeystate.html new file mode 100644 index 000000000..1c16f2e50 --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlgetkeystate.html @@ -0,0 +1,253 @@ +SDL_GetKeyState
SDL Library Documentation
PrevNext

SDL_GetKeyState

Name

SDL_GetKeyState -- Get a snapshot of the current keyboard state

Synopsis

#include "SDL.h"

Uint8 *SDL_GetKeyState(int *numkeys);

Description

Gets a snapshot of the current keyboard state. The current state is return as a pointer to an array, the size of this array is stored in numkeys. The array is indexed by the SDLK_* symbols. A value of 1 means the key is pressed and a value of 0 means its not. The pointer returned is a pointer to an internal SDL array and should not be freed by the caller.

Note: Use SDL_PumpEvents to update the state array.

Example

Uint8 *keystate = SDL_GetKeyState(NULL);
+if ( keystate[SDLK_RETURN] ) printf("Return Key Pressed.\n");


PrevHomeNext
SDL_EventStateUpSDL_GetModState
\ No newline at end of file diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlgetmodstate.html b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlgetmodstate.html new file mode 100644 index 000000000..64d2f3562 --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlgetmodstate.html @@ -0,0 +1,257 @@ +SDL_GetModState
SDL Library Documentation
PrevNext

SDL_GetModState

Name

SDL_GetModState -- Get the state of modifier keys.

Synopsis

#include "SDL.h"

SDLMod SDL_GetModState(void);

Description

Returns the current state of the modifier keys (CTRL, ALT, etc.).

Return Value

The return value can be an OR'd combination of the SDLMod enum.

SDLMod

typedef enum {
+  KMOD_NONE  = 0x0000,
+  KMOD_LSHIFT= 0x0001,
+  KMOD_RSHIFT= 0x0002,
+  KMOD_LCTRL = 0x0040,
+  KMOD_RCTRL = 0x0080,
+  KMOD_LALT  = 0x0100,
+  KMOD_RALT  = 0x0200,
+  KMOD_LMETA = 0x0400,
+  KMOD_RMETA = 0x0800,
+  KMOD_NUM   = 0x1000,
+  KMOD_CAPS  = 0x2000,
+  KMOD_MODE  = 0x4000,
+} SDLMod;
+SDL also defines the following symbols for convenience: +
#define KMOD_CTRL (KMOD_LCTRL|KMOD_RCTRL)
+#define KMOD_SHIFT  (KMOD_LSHIFT|KMOD_RSHIFT)
+#define KMOD_ALT  (KMOD_LALT|KMOD_RALT)
+#define KMOD_META (KMOD_LMETA|KMOD_RMETA)


PrevHomeNext
SDL_GetKeyStateUpSDL_SetModState
\ No newline at end of file diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlgetmousestate.html b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlgetmousestate.html new file mode 100644 index 000000000..d96a55b8d --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlgetmousestate.html @@ -0,0 +1,253 @@ +SDL_GetMouseState
SDL Library Documentation
PrevNext

SDL_GetMouseState

Name

SDL_GetMouseState -- Retrieve the current state of the mouse

Synopsis

#include "SDL.h"

Uint8 SDL_GetMouseState(int *x, int *y);

Description

The current button state is returned as a button bitmask, which can +be tested using the SDL_BUTTON(X) macros, and x and y are set to the +current mouse cursor position. You can pass NULL for either x or y.

Example

SDL_PumpEvents();
+if(SDL_GetMouseState(NULL, NULL)&SDL_BUTTON(1))
+  printf("Mouse Button 1(left) is pressed.\n");

PrevHomeNext
SDL_EnableKeyRepeatUpSDL_GetRelativeMouseState
\ No newline at end of file diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlgetrelativemousestate.html b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlgetrelativemousestate.html new file mode 100644 index 000000000..52a51066b --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlgetrelativemousestate.html @@ -0,0 +1,235 @@ +SDL_GetRelativeMouseState
SDL Library Documentation
PrevNext

SDL_GetRelativeMouseState

Name

SDL_GetRelativeMouseState -- Retrieve the current state of the mouse

Synopsis

#include "SDL.h"

Uint8 SDL_GetRelativeMouseState(int *x, int *y);

Description

The current button state is returned as a button bitmask, which can +be tested using the SDL_BUTTON(X) macros, and x and y are set to the change in the mouse position since the last call to SDL_GetRelativeMouseState or since event initialization. You can pass NULL for either x or y.


PrevHomeNext
SDL_GetMouseStateUpSDL_GetAppState
\ No newline at end of file diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlgetrgb.html b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlgetrgb.html new file mode 100644 index 000000000..47774dc2e --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlgetrgb.html @@ -0,0 +1,231 @@ +SDL_GetRGB
SDL Library Documentation
PrevNext

SDL_GetRGB

Name

SDL_GetRGB -- Get RGB values from a pixel in the specified pixel format.

Synopsis

#include "SDL.h"

void SDL_GetRGB(Uint32 pixel, SDL_PixelFormat *fmt, Uint8 *r, Uint8 *g, Uint8 *b);

Description

Get RGB component values from a pixel stored in the specified pixel format.

This function uses the entire 8-bit [0..255] range when converting color +components from pixel formats with less than 8-bits per RGB component +(e.g., a completely white pixel in 16-bit RGB565 format would return +[0xff, 0xff, 0xff] not [0xf8, 0xfc, 0xf8]).


PrevHomeNext
SDL_MapRGBAUpSDL_GetRGBA
\ No newline at end of file diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlgetrgba.html b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlgetrgba.html new file mode 100644 index 000000000..a9e1093ad --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlgetrgba.html @@ -0,0 +1,222 @@ +SDL_GetRGBA
SDL Library Documentation
PrevNext

SDL_GetRGBA

Name

SDL_GetRGBA -- Get RGBA values from a pixel in the specified pixel format.

Synopsis

#include "SDL.h"

void SDL_GetRGBA(Uint32 pixel, SDL_PixelFormat *fmt, Uint8 *r, Uint8 *g, Uint8 *b, Uint8 *a);

Description

Get RGBA component values from a pixel stored in the specified pixel format.

This function uses the entire 8-bit [0..255] range when converting color +components from pixel formats with less than 8-bits per RGB component +(e.g., a completely white pixel in 16-bit RGB565 format would return +[0xff, 0xff, 0xff] not [0xf8, 0xfc, 0xf8]).

If the surface has no alpha component, the alpha will be returned as 0xff +(100% opaque).


PrevHomeNext
SDL_GetRGBUpSDL_CreateRGBSurface
\ No newline at end of file diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlgetthreadid.html b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlgetthreadid.html new file mode 100644 index 000000000..4bc59cb69 --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlgetthreadid.html @@ -0,0 +1,209 @@ +SDL_GetThreadID
SDL Library Documentation
PrevNext

SDL_GetThreadID

Name

SDL_GetThreadID -- Get the SDL thread ID of a SDL_Thread

Synopsis

#include "SDL.h"
+#include "SDL_thread.h"

Uint32 SDL_GetThreadID(SDL_Thread *thread);

Description

Returns the ID of a SDL_Thread created by SDL_CreateThread.


PrevHomeNext
SDL_ThreadIDUpSDL_WaitThread
\ No newline at end of file diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlgetticks.html b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlgetticks.html new file mode 100644 index 000000000..0911aae1a --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlgetticks.html @@ -0,0 +1,206 @@ +SDL_GetTicks
SDL Library Documentation
PrevNext

SDL_GetTicks

Name

SDL_GetTicks -- Get the number of milliseconds since the SDL library initialization.

Synopsis

#include "SDL.h"

Uint32 SDL_GetTicks(void);

Description

Get the number of milliseconds since the SDL library initialization. +Note that this value wraps if the program runs for more than ~49 days.

See Also

SDL_Delay


PrevHomeNext
TimeUpSDL_Delay
\ No newline at end of file diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlgetvideoinfo.html b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlgetvideoinfo.html new file mode 100644 index 000000000..25c4b458a --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlgetvideoinfo.html @@ -0,0 +1,226 @@ +SDL_GetVideoInfo
SDL Library Documentation
PrevNext

SDL_GetVideoInfo

Name

SDL_GetVideoInfo -- returns a pointer to information about the video hardware

Synopsis

#include "SDL.h"

SDL_VideoInfo *SDL_GetVideoInfo(void);

Description

This function returns a read-only pointer to information about the video +hardware. If this is called before SDL_SetVideoMode, the +vfmt member of the returned structure will contain the +pixel format of the "best" video mode.


PrevHomeNext
SDL_GetVideoSurfaceUpSDL_VideoDriverName
\ No newline at end of file diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlgetvideosurface.html b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlgetvideosurface.html new file mode 100644 index 000000000..905b1f6ac --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlgetvideosurface.html @@ -0,0 +1,208 @@ +SDL_GetVideoSurface
SDL Library Documentation
PrevNext

SDL_GetVideoSurface

Name

SDL_GetVideoSurface -- returns a pointer to the current display surface

Synopsis

#include "SDL.h"

SDL_Surface *SDL_GetVideoSurface(void);

Description

This function returns a pointer to the current display surface. +If SDL is doing format conversion on the display surface, this +function returns the publicly visible surface, not the real video +surface.

See Also

SDL_Surface


PrevHomeNext
VideoUpSDL_GetVideoInfo
\ No newline at end of file diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlglattr.html b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlglattr.html new file mode 100644 index 000000000..0ae01272a --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlglattr.html @@ -0,0 +1,379 @@ +SDL_GLattr
SDL Library Documentation
PrevNext

SDL_GLattr

Name

SDL_GLattr -- SDL GL Attributes

Attributes

SDL_GL_RED_SIZESize of the framebuffer red component, in bits
SDL_GL_GREEN_SIZESize of the framebuffer green component, in bits
SDL_GL_BLUE_SIZESize of the framebuffer blue component, in bits
SDL_GL_ALPHA_SIZESize of the framebuffer alpha component, in bits
SDL_GL_DOUBLEBUFFER0 or 1, enable or disable double buffering
SDL_GL_BUFFER_SIZESize of the framebuffer, in bits
SDL_GL_DEPTH_SIZESize of the depth buffer, in bits
SDL_GL_STENCIL_SIZESize of the stencil buffer, in bits
SDL_GL_ACCUM_RED_SIZESize of the accumulation buffer red component, in bits
SDL_GL_ACCUM_GREEN_SIZESize of the accumulation buffer green component, in bits
SDL_GL_ACCUM_BLUE_SIZESize of the accumulation buffer blue component, in bits
SDL_GL_ACCUM_ALPHA_SIZESize of the accumulation buffer alpha component, in bits

Description

While you can set most OpenGL attributes normally, the attributes list above must be known before SDL sets the video mode. These attributes a set and read with SDL_GL_SetAttribute and SDL_GL_GetAttribute.


PrevHomeNext
SDL_FreeYUVOverlayUpSDL_Rect
\ No newline at end of file diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlglgetattribute.html b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlglgetattribute.html new file mode 100644 index 000000000..26c8913bd --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlglgetattribute.html @@ -0,0 +1,247 @@ +SDL_GL_GetAttribute
SDL Library Documentation
PrevNext

SDL_GL_GetAttribute

Name

SDL_GL_GetAttribute -- Get the value of a special SDL/OpenGL attribute

Synopsis

#include "SDL.h"

int SDL_GL_GetAttribute(SDLGLattr attr, int *value);

Description

Places the value of the SDL/OpenGL attribute attr into value. This is useful after a call to SDL_SetVideoMode to check whether your attributes have been set as you expected.

Return Value

Returns 0 on success, or -1 on an error.


PrevHomeNext
SDL_GL_GetProcAddressUpSDL_GL_SetAttribute
\ No newline at end of file diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlglgetprocaddress.html b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlglgetprocaddress.html new file mode 100644 index 000000000..a6cf6e4c1 --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlglgetprocaddress.html @@ -0,0 +1,262 @@ +SDL_GL_GetProcAddress
SDL Library Documentation
PrevNext

SDL_GL_GetProcAddress

Name

SDL_GL_GetProcAddress -- Get the address of a GL function

Synopsis

#include "SDL.h"

void *SDL_GL_GetProcAddress(const char* proc);

Description

Returns the address of the GL function proc, or NULL if the function is not found. If the GL library is loaded at runtime, with SDL_GL_LoadLibrary, then all GL functions must be retrieved this way. Usually this is used to retrieve function pointers to OpenGL extensions.

Example

typedef void (*GL_ActiveTextureARB_Func)(unsigned int);
+GL_ActiveTextureARB_Func glActiveTextureARB_ptr = 0;
+int has_multitexture=1;
+.
+.
+.
+/* Get function pointer */
+glActiveTextureARB_ptr=(GL_ActiveTextureARB_Func) SDL_GL_GetProcAddress("glActiveTextureARB");
+
+/* Check for a valid function ptr */
+if(!glActiveTextureARB_ptr){
+  fprintf(stderr, "Multitexture Extensions not present.\n");
+  has_multitexture=0;
+}
+.
+.
+.
+.
+if(has_multitexture){
+  glActiveTextureARB_ptr(GL_TEXTURE0_ARB);
+  .
+  .
+}
+else{
+  .
+  .
+}

PrevHomeNext
SDL_GL_LoadLibraryUpSDL_GL_GetAttribute
\ No newline at end of file diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlglloadlibrary.html b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlglloadlibrary.html new file mode 100644 index 000000000..d3c4c6d79 --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlglloadlibrary.html @@ -0,0 +1,231 @@ +SDL_GL_LoadLibrary
SDL Library Documentation
PrevNext

SDL_GL_LoadLibrary

Name

SDL_GL_LoadLibrary -- Specify an OpenGL library

Synopsis

#include "SDL.h"

int SDL_GL_LoadLibrary(const char *path);

Description

If you wish, you may load the OpenGL library at runtime, this must be done before SDL_SetVideoMode is called. The path of the GL library is passed to SDL_GL_LoadLibrary and it returns 0 on success, or -1 on an error. You must then use SDL_GL_GetProcAddress to retrieve function pointers to GL functions.


PrevHomeNext
SDL_ShowCursorUpSDL_GL_GetProcAddress
\ No newline at end of file diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlglsetattribute.html b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlglsetattribute.html new file mode 100644 index 000000000..ffb1204b0 --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlglsetattribute.html @@ -0,0 +1,286 @@ +SDL_GL_SetAttribute
SDL Library Documentation
PrevNext

SDL_GL_SetAttribute

Name

SDL_GL_SetAttribute -- Set a special SDL/OpenGL attribute

Synopsis

#include "SDL.h"

int SDL_GL_SetAttribute(SDL_GLattr attr, int value);

Description

Sets the OpenGL attribute attr to value. The attributes you set don't take effect until after a call to SDL_SetVideoMode. You should use SDL_GL_GetAttribute to check the values after a SDL_SetVideoMode call.

Return Value

Returns 0 on success, or -1 on error.

Example

SDL_GL_SetAttribute( SDL_GL_RED_SIZE, 5 );
+SDL_GL_SetAttribute( SDL_GL_GREEN_SIZE, 5 );
+SDL_GL_SetAttribute( SDL_GL_BLUE_SIZE, 5 );
+SDL_GL_SetAttribute( SDL_GL_DEPTH_SIZE, 16 );
+SDL_GL_SetAttribute( SDL_GL_DOUBLEBUFFER, 1 );
+if ( (screen=SDL_SetVideoMode( 640, 480, 16, SDL_OPENGL )) == NULL ) {
+  fprintf(stderr, "Couldn't set GL mode: %s\n", SDL_GetError());
+  SDL_Quit();
+  return;
+}

Note: The SDL_DOUBLEBUF flag is not required to enable double buffering when setting an OpenGL video mode. Double buffering is enabled or disabled using the SDL_GL_DOUBLEBUFFER attribute.


PrevHomeNext
SDL_GL_GetAttributeUpSDL_GL_SwapBuffers
\ No newline at end of file diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlglswapbuffers.html b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlglswapbuffers.html new file mode 100644 index 000000000..fa383414d --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlglswapbuffers.html @@ -0,0 +1,212 @@ +SDL_GL_SwapBuffers
SDL Library Documentation
PrevNext

SDL_GL_SwapBuffers

Name

SDL_GL_SwapBuffers -- Swap OpenGL framebuffers/Update Display

Synopsis

#include "SDL.h"

void SDL_GL_SwapBuffers(void );

Description

Swap the OpenGL buffers, if double-buffering is supported.


PrevHomeNext
SDL_GL_SetAttributeUpSDL_CreateYUVOverlay
\ No newline at end of file diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlinit.html b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlinit.html new file mode 100644 index 000000000..11f27b81d --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlinit.html @@ -0,0 +1,368 @@ +SDL_Init
SDL Library Documentation
PrevNext

SDL_Init

Name

SDL_Init -- Initializes SDL

Synopsis

#include "SDL.h"

int SDL_Init(Uint32 flags);

Description

Initializes SDL. This should be called before all other SDL functions. The flags parameter specifies what part(s) of SDL to initialize.

SDL_INIT_TIMERInitializes the timer subsystem.
SDL_INIT_AUDIOInitializes the audio subsystem.
SDL_INIT_VIDEOInitializes the video subsystem.
SDL_INIT_CDROMInitializes the cdrom subsystem.
SDL_INIT_JOYSTICKInitializes the joystick subsystem.
SDL_INIT_EVERYTHINGInitialize all of the above.
SDL_INIT_NOPARACHUTEPrevents SDL from catching fatal signals.
SDL_INIT_EVENTTHREAD 

Return Value

Returns -1 on an error or 0 on success.


PrevHomeNext
GeneralUpSDL_InitSubSystem
\ No newline at end of file diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlinitsubsystem.html b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlinitsubsystem.html new file mode 100644 index 000000000..917fd1068 --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlinitsubsystem.html @@ -0,0 +1,283 @@ +SDL_InitSubSystem
SDL Library Documentation
PrevNext

SDL_InitSubSystem

Name

SDL_InitSubSystem -- Initialize subsystems

Synopsis

#include "SDL.h"

int SDL_InitSubSystem(Uint32 flags);

Description

After SDL has been initialized with SDL_Init you may initialize uninitialized subsystems with SDL_InitSubSystem. The flags parameter is the same as that used in SDL_Init.

Examples

/* Seperating Joystick and Video initialization. */
+SDL_Init(SDL_INIT_VIDEO);
+.
+.
+SDL_SetVideoMode(640, 480, 16, SDL_DOUBLEBUF|SDL_FULLSCREEN);
+.
+/* Do Some Video stuff */
+.
+.
+/* Initialize the joystick subsystem */
+SDL_InitSubSystem(SDL_INIT_JOYSTICK);
+
+/* Do some stuff with video and joystick */
+.
+.
+.
+/* Shut them both down */
+SDL_Quit();

Return Value

Returns -1 on an error or 0 on success.


PrevHomeNext
SDL_InitUpSDL_QuitSubSystem
\ No newline at end of file diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdljoyaxisevent.html b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdljoyaxisevent.html new file mode 100644 index 000000000..9f0166959 --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdljoyaxisevent.html @@ -0,0 +1,330 @@ +SDL_JoyAxisEvent
SDL Library Documentation
PrevNext

SDL_JoyAxisEvent

Name

SDL_JoyAxisEvent -- Joystick axis motion event structure

Structure Definition

typedef struct{
+  Uint8 type;
+  Uint8 which;
+  Uint8 axis;
+  Sint16 value;
+} SDL_JoyAxisEvent;

Structure Data

typeSDL_JOYAXISMOTION
whichJoystick device index
axisJoystick axis index
valueAxis value (range: -32768 to 32767)

Description

SDL_JoyAxisEvent is a member of the SDL_Event union and is used when an event of type SDL_JOYAXISMOTION is reported.

A SDL_JOYAXISMOTION event occurs when ever a user moves an axis on the joystick. The field which is the index of the joystick that reported the event and axis is the index of the axis (for a more detailed explaination see the Joystick section). value is the current position of the axis.


PrevHomeNext
SDL_MouseButtonEventUpSDL_JoyButtonEvent
\ No newline at end of file diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdljoyballevent.html b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdljoyballevent.html new file mode 100644 index 000000000..4ab96fe0e --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdljoyballevent.html @@ -0,0 +1,340 @@ +SDL_JoyBallEvent
SDL Library Documentation
PrevNext

SDL_JoyBallEvent

Name

SDL_JoyBallEvent -- Joystick trackball motion event structure

Structure Definition

typedef struct{
+  Uint8 type;
+  Uint8 which;
+  Uint8 ball;
+  Sint16 xrel, yrel;
+} SDL_JoyBallEvent;

Structure Data

typeSDL_JOYBALLMOTION
whichJoystick device index
ballJoystick trackball index
xrel, yrelThe relative motion in the X/Y direction

Description

SDL_JoyBallEvent is a member of the SDL_Event union and is used when an event of type SDL_JOYBALLMOTION is reported.

A SDL_JOYBALLMOTION event occurs when a user moves a trackball on the joystick. The field which is the index of the joystick that reported the event and ball is the index of the trackball (for a more detailed explaination see the Joystick section). Trackballs only return relative motion, this is the change in position on the ball since it was last polled (last cycle of the event loop) and it is stored in xrel and yrel.


PrevHomeNext
SDL_JoyHatEventUpSDL_ResizeEvent
\ No newline at end of file diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdljoybuttonevent.html b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdljoybuttonevent.html new file mode 100644 index 000000000..d1d9c1ef6 --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdljoybuttonevent.html @@ -0,0 +1,351 @@ +SDL_JoyButtonEvent
SDL Library Documentation
PrevNext

SDL_JoyButtonEvent

Name

SDL_JoyButtonEvent -- Joystick button event structure

Structure Definition

typedef struct{
+  Uint8 type;
+  Uint8 which;
+  Uint8 button;
+  Uint8 state;
+} SDL_JoyButtonEvent;

Structure Data

typeSDL_JOYBUTTONDOWN or SDL_JOYBUTTONUP
whichJoystick device index
buttonJoystick button index
stateSDL_PRESSED or SDL_RELEASED

Description

SDL_JoyButtonEvent is a member of the SDL_Event union and is used when an event of type SDL_JOYBUTTONDOWN or SDL_JOYBUTTONUP is reported.

A SDL_JOYBUTTONDOWN or SDL_JOYBUTTONUP event occurs when ever a user presses or releases a button on a joystick. The field which is the index of the joystick that reported the event and button is the index of the button (for a more detailed explaination see the Joystick section). state is the current state or the button which is either SDL_PRESSED or SDL_RELEASED.


PrevHomeNext
SDL_JoyAxisEventUpSDL_JoyHatEvent
\ No newline at end of file diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdljoyhatevent.html b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdljoyhatevent.html new file mode 100644 index 000000000..5e115be23 --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdljoyhatevent.html @@ -0,0 +1,413 @@ +SDL_JoyHatEvent
SDL Library Documentation
PrevNext

SDL_JoyHatEvent

Name

SDL_JoyHatEvent -- Joystick hat position change event structure

Structure Definition

typedef struct{
+  Uint8 type;
+  Uint8 which;
+  Uint8 hat;
+  Uint8 value;
+} SDL_JoyHatEvent;

Structure Data

typeSDL_JOY
whichJoystick device index
hatJoystick hat index
valueHat position

Description

SDL_JoyHatEvent is a member of the SDL_Event union and is used when an event of type SDL_JOYHATMOTION is reported.

A SDL_JOYHATMOTION event occurs when ever a user moves a hat on the joystick. The field which is the index of the joystick that reported the event and hat is the index of the hat (for a more detailed exlaination see the Joystick section). value is the current position of the hat. It is a logically OR'd combination of the following values (whose meanings should be pretty obvious:) :

SDL_HAT_CENTERED
SDL_HAT_UP
SDL_HAT_RIGHT
SDL_HAT_DOWN
SDL_HAT_LEFT

The following defines are also provided:

SDL_HAT_RIGHTUP
SDL_HAT_RIGHTDOWN
SDL_HAT_LEFTUP
SDL_HAT_LEFTDOWN


PrevHomeNext
SDL_JoyButtonEventUpSDL_JoyBallEvent
\ No newline at end of file diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdljoystickclose.html b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdljoystickclose.html new file mode 100644 index 000000000..efb44e0fe --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdljoystickclose.html @@ -0,0 +1,223 @@ +SDL_JoystickClose
SDL Library Documentation
PrevNext

SDL_JoystickClose

Name

SDL_JoystickClose -- Closes a previously opened joystick

Synopsis

#include "SDL.h"

void SDL_JoystickClose(SDL_Joystick *joystick);

Description

Close a joystick that was previously opened with SDL_JoystickOpen.


PrevHomeNext
SDL_JoystickGetBallUpAudio
\ No newline at end of file diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdljoystickeventstate.html b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdljoystickeventstate.html new file mode 100644 index 000000000..11b148a12 --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdljoystickeventstate.html @@ -0,0 +1,290 @@ +SDL_JoystickEventState
SDL Library Documentation
PrevNext

SDL_JoystickEventState

Name

SDL_JoystickEventState -- Enable/disable joystick event polling

Synopsis

#include "SDL.h"

int SDL_JoystickEventState(int state);

Description

This function is used to enable or disable joystick event processing. With joystick event processing disabled you will have to update joystick states with SDL_JoystickUpdate and read the joystick information manually. state is either SDL_QUERY, SDL_ENABLE or SDL_IGNORE.

Note: Joystick event handling is prefered

Return Value

If state is SDL_QUERY then the current state is returned, otherwise the new processing state is returned.


PrevHomeNext
SDL_GetAppStateUpJoystick
\ No newline at end of file diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdljoystickgetaxis.html b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdljoystickgetaxis.html new file mode 100644 index 000000000..40a17b4cc --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdljoystickgetaxis.html @@ -0,0 +1,271 @@ +SDL_JoystickGetAxis
SDL Library Documentation
PrevNext

SDL_JoystickGetAxis

Name

SDL_JoystickGetAxis -- Get the current state of an axis

Synopsis

#include "SDL.h"

Sint16 SDL_JoystickGetAxis(SDL_Joystick *joystick, int axis);

Description

SDL_JoystickGetAxis returns the current state of the given axis on the given joystick.

On most modern joysticks the X axis is usually represented by axis 0 and the Y axis by axis 1. The value returned by SDL_JoystickGetAxis is a signed integer (-32768 to 32768) representing the current position of the axis, it maybe necessary to impose certain tolerances on these values to account for jitter. It is worth noting that some joysticks use axes 2 and 3 for extra buttons.

Return Value

Returns a 16-bit signed integer representing the current position of the axis.

Examples

Sint16 x_move, y_move;
+SDL_Joystick *joy1;
+.
+.
+x_move=SDL_JoystickGetAxis(joy1, 0);
+y_move=SDL_JoystickGetAxis(joy1, 1);


PrevHomeNext
SDL_JoystickUpdateUpSDL_JoystickGetHat
\ No newline at end of file diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdljoystickgetball.html b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdljoystickgetball.html new file mode 100644 index 000000000..0da252ab1 --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdljoystickgetball.html @@ -0,0 +1,262 @@ +SDL_JoystickGetBall
SDL Library Documentation
PrevNext

SDL_JoystickGetBall

Name

SDL_JoystickGetBall -- Get relative trackball motion

Synopsis

#include "SDL.h"

int SDL_JoystickGetBall(SDL_Joystick *joystick, int ball, int *dx, int *dy);

Description

Get the ball axis change.

Trackballs can only return relative motion since the last call to SDL_JoystickGetBall, these motion deltas a placed into dx and dy.

Return Value

Returns 0 on success or -1 on failure

Examples

int delta_x, delta_y;
+SDL_Joystick *joy;
+.
+.
+.
+SDL_JoystickUpdate();
+if(SDL_JoystickGetBall(joy, 0, &delta_x, &delta_y)==-1)
+  printf("TrackBall Read Error!\n");
+printf("Trackball Delta- X:%d, Y:%d\n", delta_x, delta_y);


PrevHomeNext
SDL_JoystickGetButtonUpSDL_JoystickClose
\ No newline at end of file diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdljoystickgetbutton.html b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdljoystickgetbutton.html new file mode 100644 index 000000000..680e3569d --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdljoystickgetbutton.html @@ -0,0 +1,231 @@ +SDL_JoystickGetButton
SDL Library Documentation
PrevNext

SDL_JoystickGetButton

Name

SDL_JoystickGetButton -- Get the current state of a given button on a given joystick

Synopsis

#include "SDL.h"

Uint8 SDL_JoystickGetButton(SDL_Joystick *joystick, int button);

Description

SDL_JoystickGetButton returns the current state of the given button on the given joystick.

Return Value

1 if the button is pressed. Otherwise, 0.


PrevHomeNext
SDL_JoystickGetHatUpSDL_JoystickGetBall
\ No newline at end of file diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdljoystickgethat.html b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdljoystickgethat.html new file mode 100644 index 000000000..c638abb7c --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdljoystickgethat.html @@ -0,0 +1,297 @@ +SDL_JoystickGetHat
SDL Library Documentation
PrevNext

SDL_JoystickGetHat

Name

SDL_JoystickGetHat -- Get the current state of a joystick hat

Synopsis

#include "SDL.h"

Uint8 SDL_JoystickGetHat(SDL_Joystick *joystick, int hat);

Description

SDL_JoystickGetHat returns the current state of the given hat on the given joystick.

Return Value

The current state is returned as a Uint8 which is defined as an OR'd combination of one or more of the following

SDL_HAT_CENTERED
SDL_HAT_UP
SDL_HAT_RIGHT
SDL_HAT_DOWN
SDL_HAT_LEFT
SDL_HAT_RIGHTUP
SDL_HAT_RIGHTDOWN
SDL_HAT_LEFTUP
SDL_HAT_LEFTDOWN


PrevHomeNext
SDL_JoystickGetAxisUpSDL_JoystickGetButton
\ No newline at end of file diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdljoystickindex.html b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdljoystickindex.html new file mode 100644 index 000000000..868a75add --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdljoystickindex.html @@ -0,0 +1,218 @@ +SDL_JoystickIndex
SDL Library Documentation
PrevNext

SDL_JoystickIndex

Name

SDL_JoystickIndex -- Get the index of an SDL_Joystick.

Synopsis

#include "SDL.h"

int SDL_JoystickIndex(SDL_Joystick *joystick);

Description

Returns the index of a given SDL_Joystick structure.

Return Value

Index number of the joystick.


PrevHomeNext
SDL_JoystickOpenedUpSDL_JoystickNumAxes
\ No newline at end of file diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdljoystickname.html b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdljoystickname.html new file mode 100644 index 000000000..0add817dc --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdljoystickname.html @@ -0,0 +1,238 @@ +SDL_JoystickName
SDL Library Documentation
PrevNext

SDL_JoystickName

Name

SDL_JoystickName -- Get joystick name.

Synopsis

#include "SDL.h"

const char *SDL_JoystickName(int index);

Description

Get the implementation dependent name of joystick. The index parameter refers to the N'th joystick on the system.

Return Value

Returns a char pointer to the joystick name.

Examples

/* Print the names of all attached joysticks */
+int num_joy, i;
+num_joy=SDL_NumJoysticks();
+printf("%d joysticks found\n", num_joy);
+for(i=0;i<num_joy;i++)
+  printf("%s\n", SDL_JoystickName(i));


PrevHomeNext
SDL_NumJoysticksUpSDL_JoystickOpen
\ No newline at end of file diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdljoysticknumaxes.html b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdljoysticknumaxes.html new file mode 100644 index 000000000..53b67f523 --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdljoysticknumaxes.html @@ -0,0 +1,225 @@ +SDL_JoystickNumAxes
SDL Library Documentation
PrevNext

SDL_JoystickNumAxes

Name

SDL_JoystickNumAxes -- Get the number of joystick axes

Synopsis

#include "SDL.h"

int SDL_JoystickNumAxes(SDL_Joystick *joystick);

Description

Return the number of axes available from a previously opened SDL_Joystick.

Return Value

Number of axes.


PrevHomeNext
SDL_JoystickIndexUpSDL_JoystickNumBalls
\ No newline at end of file diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdljoysticknumballs.html b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdljoysticknumballs.html new file mode 100644 index 000000000..0a8405dc9 --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdljoysticknumballs.html @@ -0,0 +1,225 @@ +SDL_JoystickNumBalls
SDL Library Documentation
PrevNext

SDL_JoystickNumBalls

Name

SDL_JoystickNumBalls -- Get the number of joystick trackballs

Synopsis

#include "SDL.h"

int SDL_JoystickNumBalls(SDL_Joystick *joystick);

Description

Return the number of trackballs available from a previously opened SDL_Joystick.

Return Value

Number of trackballs.


PrevHomeNext
SDL_JoystickNumAxesUpSDL_JoystickNumHats
\ No newline at end of file diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdljoysticknumbuttons.html b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdljoysticknumbuttons.html new file mode 100644 index 000000000..625b893a6 --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdljoysticknumbuttons.html @@ -0,0 +1,225 @@ +SDL_JoystickNumButtons
SDL Library Documentation
PrevNext

SDL_JoystickNumButtons

Name

SDL_JoystickNumButtons -- Get the number of joysitck buttons

Synopsis

#include "SDL.h"

int SDL_JoystickNumButtons(SDL_Joystick *joystick);

Description

Return the number of buttons available from a previously opened SDL_Joystick.

Return Value

Number of buttons.


PrevHomeNext
SDL_JoystickNumHatsUpSDL_JoystickUpdate
\ No newline at end of file diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdljoysticknumhats.html b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdljoysticknumhats.html new file mode 100644 index 000000000..ed5323585 --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdljoysticknumhats.html @@ -0,0 +1,225 @@ +SDL_JoystickNumHats
SDL Library Documentation
PrevNext

SDL_JoystickNumHats

Name

SDL_JoystickNumHats -- Get the number of joystick hats

Synopsis

#include "SDL.h"

int SDL_JoystickNumHats(SDL_Joystick *joystick);

Description

Return the number of hats available from a previously opened SDL_Joystick.

Return Value

Number of hats.


PrevHomeNext
SDL_JoystickNumBallsUpSDL_JoystickNumButtons
\ No newline at end of file diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdljoystickopen.html b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdljoystickopen.html new file mode 100644 index 000000000..e608c4370 --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdljoystickopen.html @@ -0,0 +1,259 @@ +SDL_JoystickOpen
SDL Library Documentation
PrevNext

SDL_JoystickOpen

Name

SDL_JoystickOpen -- Opens a joystick for use.

Synopsis

#include "SDL.h"

SDL_Joystick *SDL_JoystickOpen(int index);

Description

Opens a joystick for use within SDL. The index refers to the N'th joystick in the system. A joystick must be opened before it game be used.

Return Value

Returns a SDL_Joystick structure on success. NULL on failure.

Examples

SDL_Joystick *joy;
+// Check for joystick
+if(SDL_NumJoysticks()>0){
+  // Open joystick
+  joy=SDL_JoystickOpen(0);
+  
+  if(joy)
+  {
+    printf("Opened Joystick 0\n");
+    printf("Name: %s\n", SDL_JoystickName(0));
+    printf("Number of Axes: %d\n", SDL_JoystickNumAxes(joy));
+    printf("Number of Buttons: %d\n", SDL_JoystickNumButtons(joy));
+    printf("Number of Balls: %d\n", SDL_JoystickNumBalls(joy));
+  }
+  else
+    printf("Couldn't open Joystick 0\n");
+  
+  // Close if opened
+  if(SDL_JoystickOpened(0))
+    SDL_JoystickClose(joy);
+}


PrevHomeNext
SDL_JoystickNameUpSDL_JoystickOpened
\ No newline at end of file diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdljoystickopened.html b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdljoystickopened.html new file mode 100644 index 000000000..5275a099d --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdljoystickopened.html @@ -0,0 +1,233 @@ +SDL_JoystickOpened
SDL Library Documentation
PrevNext

SDL_JoystickOpened

Name

SDL_JoystickOpened -- Determine if a joystick has been opened

Synopsis

#include "SDL.h"

int SDL_JoystickOpened(int index);

Description

Determines whether a joystick has already been opened within the application. index refers to the N'th joystick on the system.

Return Value

Returns 1 if the joystick has been opened, or 0 if it has not.


PrevHomeNext
SDL_JoystickOpenUpSDL_JoystickIndex
\ No newline at end of file diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdljoystickupdate.html b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdljoystickupdate.html new file mode 100644 index 000000000..0cb37dc22 --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdljoystickupdate.html @@ -0,0 +1,211 @@ +SDL_JoystickUpdate
SDL Library Documentation
PrevNext

SDL_JoystickUpdate

Name

SDL_JoystickUpdate -- Updates the state of all joysticks

Synopsis

#include "SDL.h"

void SDL_JoystickUpdate(void);

Description

Updates the state(position, buttons, etc.) of all open joysticks. If joystick events have been enabled with SDL_JoystickEventState then this is called automatically in the event loop.


PrevHomeNext
SDL_JoystickNumButtonsUpSDL_JoystickGetAxis
\ No newline at end of file diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlkey.html b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlkey.html new file mode 100644 index 000000000..6591884d1 --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlkey.html @@ -0,0 +1,2630 @@ +SDLKey
SDL Library Documentation
PrevNext

SDLKey

Name

SDLKey -- Keysym definitions.

Description

Table 8-1. SDL Keysym definitions

SDLKeyASCII valueCommon name
SDLK_BACKSPACE'\b'backspace
SDLK_TAB'\t'tab
SDLK_CLEAR clear
SDLK_RETURN'\r'return
SDLK_PAUSE pause
SDLK_ESCAPE'^['escape
SDLK_SPACE' 'space
SDLK_EXCLAIM'!'exclaim
SDLK_QUOTEDBL'"'quotedbl
SDLK_HASH'#'hash
SDLK_DOLLAR'$'dollar
SDLK_AMPERSAND'&'ampersand
SDLK_QUOTE'''quote
SDLK_LEFTPAREN'('left parenthesis
SDLK_RIGHTPAREN')'right parenthesis
SDLK_ASTERISK'*'asterisk
SDLK_PLUS'+'plus sign
SDLK_COMMA','comma
SDLK_MINUS'-'minus sign
SDLK_PERIOD'.'period
SDLK_SLASH'/'forward slash
SDLK_0'0'0
SDLK_1'1'1
SDLK_2'2'2
SDLK_3'3'3
SDLK_4'4'4
SDLK_5'5'5
SDLK_6'6'6
SDLK_7'7'7
SDLK_8'8'8
SDLK_9'9'9
SDLK_COLON':'colon
SDLK_SEMICOLON';'semicolon
SDLK_LESS'<'less-than sign
SDLK_EQUALS'='equals sign
SDLK_GREATER'>'greater-than sign
SDLK_QUESTION'?'question mark
SDLK_AT'@'at
SDLK_LEFTBRACKET'['left bracket
SDLK_BACKSLASH'\'backslash
SDLK_RIGHTBRACKET']'right bracket
SDLK_CARET'^'caret
SDLK_UNDERSCORE'_'underscore
SDLK_BACKQUOTE'`'grave
SDLK_a'a'a
SDLK_b'b'b
SDLK_c'c'c
SDLK_d'd'd
SDLK_e'e'e
SDLK_f'f'f
SDLK_g'g'g
SDLK_h'h'h
SDLK_i'i'i
SDLK_j'j'j
SDLK_k'k'k
SDLK_l'l'l
SDLK_m'm'm
SDLK_n'n'n
SDLK_o'o'o
SDLK_p'p'p
SDLK_q'q'q
SDLK_r'r'r
SDLK_s's's
SDLK_t't't
SDLK_u'u'u
SDLK_v'v'v
SDLK_w'w'w
SDLK_x'x'x
SDLK_y'y'y
SDLK_z'z'z
SDLK_DELETE'^?'delete
SDLK_KP0 keypad 0
SDLK_KP1 keypad 1
SDLK_KP2 keypad 2
SDLK_KP3 keypad 3
SDLK_KP4 keypad 4
SDLK_KP5 keypad 5
SDLK_KP6 keypad 6
SDLK_KP7 keypad 7
SDLK_KP8 keypad 8
SDLK_KP9 keypad 9
SDLK_KP_PERIOD'.'keypad period
SDLK_KP_DIVIDE'/'keypad divide
SDLK_KP_MULTIPLY'*'keypad multiply
SDLK_KP_MINUS'-'keypad minus
SDLK_KP_PLUS'+'keypad plus
SDLK_KP_ENTER'\r'keypad enter
SDLK_KP_EQUALS'='keypad equals
SDLK_UP up arrow
SDLK_DOWN down arrow
SDLK_RIGHT right arrow
SDLK_LEFT left arrow
SDLK_INSERT insert
SDLK_HOME home
SDLK_END end
SDLK_PAGEUP page up
SDLK_PAGEDOWN page down
SDLK_F1 F1
SDLK_F2 F2
SDLK_F3 F3
SDLK_F4 F4
SDLK_F5 F5
SDLK_F6 F6
SDLK_F7 F7
SDLK_F8 F8
SDLK_F9 F9
SDLK_F10 F10
SDLK_F11 F11
SDLK_F12 F12
SDLK_F13 F13
SDLK_F14 F14
SDLK_F15 F15
SDLK_NUMLOCK numlock
SDLK_CAPSLOCK capslock
SDLK_SCROLLOCK scrollock
SDLK_RSHIFT right shift
SDLK_LSHIFT left shift
SDLK_RCTRL right ctrl
SDLK_LCTRL left ctrl
SDLK_RALT right alt
SDLK_LALT left alt
SDLK_RMETA right meta
SDLK_LMETA left meta
SDLK_LSUPER left windows key
SDLK_RSUPER right windows key
SDLK_MODE mode shift
SDLK_HELP help
SDLK_PRINT print-screen
SDLK_SYSREQ SysRq
SDLK_BREAK break
SDLK_MENU menu
SDLK_POWER power
SDLK_EURO euro
+ +

Table 8-2. SDL modifier definitions

SDL ModifierMeaning
KMOD_NONENo modifiers applicable
KMOD_NUMNumlock is down
KMOD_CAPSCapslock is down
KMOD_LCTRLLeft Control is down
KMOD_RCTRLRight Control is down
KMOD_RSHIFTRight Shift is down
KMOD_LSHIFTLeft Shift is down
KMOD_RALTRight Alt is down
KMOD_LALTLeft Alt is down
KMOD_CTRLA Control key is down
KMOD_SHIFTA Shift key is down
KMOD_ALTAn Alt key is down


PrevHomeNext
SDL_keysymUpEvent Functions.
\ No newline at end of file diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlkeyboardevent.html b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlkeyboardevent.html new file mode 100644 index 000000000..1a6962c74 --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlkeyboardevent.html @@ -0,0 +1,375 @@ +SDL_KeyboardEvent
SDL Library Documentation
PrevNext

SDL_KeyboardEvent

Name

SDL_KeyboardEvent -- Keyboard event structure

Structure Definition

typedef struct{
+  Uint8 type;
+  Uint8 state;
+  SDL_keysym keysym;
+} SDL_KeyboardEvent;

Structure Data

typeSDL_KEYDOWN or SDL_KEYUP
stateSDL_PRESSED or SDL_RELEASED
keysymContains key press information

Description

SDL_KeyboardEvent is a member of the SDL_Event union and is used when an event of type SDL_KEYDOWN or SDL_KEYUP is reported.

The type and state actually report the same information, they just use different values to do it! A keyboard event occurs when a key is released (type=SDK_KEYUP or state=SDL_RELEASED) and when a key is pressed (type=SDL_KEYDOWN or state=SDL_PRESSED). The information on what key was pressed or released is in the keysym structure.

Note: Repeating SDL_KEYDOWN events will occur if key repeat is enabled (see SDL_EnableKeyRepeat).


PrevHomeNext
SDL_ActiveEventUpSDL_MouseMotionEvent
\ No newline at end of file diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlkeysym.html b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlkeysym.html new file mode 100644 index 000000000..7a22f7951 --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlkeysym.html @@ -0,0 +1,355 @@ +SDL_keysym
SDL Library Documentation
PrevNext

SDL_keysym

Name

SDL_keysym -- Keysym structure

Structure Definition

typedef struct{
+  Uint8 scancode;
+  SDLKey sym;
+  SDLMod mod;
+  Uint16 unicode;
+} SDL_keysym;

Structure Data

scancodeHardware specific scancode
symSDL virtual keysym
modCurrent key modifiers
unicodeTranslated character

Description

The SDL_keysym structure is used by reporting key presses and releases since it is a part of the SDL_KeyboardEvent.

The scancode field should generally be left alone, it is the hardware dependent scancode returned by the keyboard. The sym field is extremely useful. It is the SDL-defined value of the key (see SDL Key Syms. This field is very useful when you are checking for certain key presses, like so: +

.
+.
+while(SDL_PollEvent(&event)){
+  switch(event.type){
+    case SDL_KEYDOWN:
+      if(event.key.keysym.sym==SDLK_LEFT)
+        move_left();
+      break;
+    .
+    .
+    .
+  }
+}
+.
+.
+mod stores the current state of the keyboard modifiers as explained in SDL_GetModState. The unicode is only used when UNICODE translation is enabled with SDL_EnableUNICODE. If unicode is non-zero then this a the UNICODE character corresponding to the keypress. If the high 9 bits of the character are 0, then this maps to the equivalent ASCII character: +
char ch;
+if ( (keysym.unicode & 0xFF80) == 0 ) {
+  ch = keysym.unicode & 0x7F;
+}
+else {
+  printf("An International Character.\n");
+}
+UNICODE translation does have a slight overhead so don't enable it unless its needed.

See Also

SDLKey


PrevHomeNext
SDL_QuitEventUpSDLKey
\ No newline at end of file diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlkillthread.html b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlkillthread.html new file mode 100644 index 000000000..2ce7b9b58 --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlkillthread.html @@ -0,0 +1,223 @@ +SDL_KillThread
SDL Library Documentation
PrevNext

SDL_KillThread

Name

SDL_KillThread -- Gracelessly terminates the thread.

Synopsis

#include "SDL.h"
+#include "SDL_thread.h"

void SDL_KillThread(SDL_Thread *thread);

Description

SDL_KillThread gracelessly terminates the thread +associated with thread. If possible, you should +use some other form of IPC to signal the thread to quit.


PrevHomeNext
SDL_WaitThreadUpSDL_CreateMutex
\ No newline at end of file diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdllistmodes.html b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdllistmodes.html new file mode 100644 index 000000000..ee7bc0eee --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdllistmodes.html @@ -0,0 +1,310 @@ +SDL_ListModes
SDL Library Documentation
PrevNext

SDL_ListModes

Name

SDL_ListModes -- Returns a pointer to an array of available screen dimensions for +the given format and video flags

Synopsis

#include "SDL.h"

SDL_Rect **SDL_ListModes(SDL_PixelFormat *format, Uint32 flags);

Description

Return a pointer to an array of available screen dimensions for the given +format and video flags, sorted largest to smallest. Returns +NULL if there are no dimensions available for a particular +format, or -1 if any dimension is okay for +the given format.

If format is NULL, the mode list +will be for the format returned by SDL_GetVideoInfo()->vfmt. The flag parameter is an OR'd combination of surface flags. The flags are the same as those used SDL_SetVideoMode and they play a strong role in deciding what modes are valid. For instance, if you pass SDL_HWSURFACE as a flag only modes that support hardware video surfaces will be returned.

Example

SDL_Rect **modes;
+int i;
+.
+.
+.
+
+/* Get available fullscreen/hardware modes */
+modes=SDL_ListModes(NULL, SDL_FULLSCREEN|SDL_HWSURFACE);
+
+/* Check is there are any modes available */
+if(modes == (SDL_Rect **)0){
+  printf("No modes available!\n");
+  exit(-1);
+}
+
+/* Check if our resolution is restricted */
+if(modes == (SDL_Rect **)-1){
+  printf("All resolutions available.\n");
+}
+else{
+  /* Print valid modes */
+  printf("Available Modes\n");
+  for(i=0;modes[i];++i)
+    printf("  %d x %d\n", modes[i]->w, modes[i]->h);
+}
+.
+.

PrevHomeNext
SDL_VideoDriverNameUpSDL_VideoModeOK
\ No newline at end of file diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlloadbmp.html b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlloadbmp.html new file mode 100644 index 000000000..41556e34a --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlloadbmp.html @@ -0,0 +1,219 @@ +SDL_LoadBMP
SDL Library Documentation
PrevNext

SDL_LoadBMP

Name

SDL_LoadBMP -- Load a Windows BMP file into an SDL_Surface.

Synopsis

#include "SDL.h"

SDL_Surface *SDL_LoadBMP(const char *file);

Description

Loads a surface from a named Windows BMP file.

Return Value

Returns the new surface, or NULL +if there was an error.

See Also

SDL_SaveBMP


PrevHomeNext
SDL_UnlockSurfaceUpSDL_SaveBMP
\ No newline at end of file diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlloadwav.html b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlloadwav.html new file mode 100644 index 000000000..8abb73ec3 --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlloadwav.html @@ -0,0 +1,296 @@ +SDL_LoadWAV
SDL Library Documentation
PrevNext

SDL_LoadWAV

Name

SDL_LoadWAV -- Load a WAVE file

Synopsis

#include "SDL.h"

SDL_AudioSpec *SDL_LoadWAV(const char *file, SDL_AudioSpec *spec, Uint8 **audio_buf, Uint32 *audio_len);

Description

SDL_LoadWAV +This function loads a WAVE file into memory.

If this function succeeds, it returns the given +SDL_AudioSpec, +filled with the audio data format of the wave data, and sets +audio_buf to a malloc'd +buffer containing the audio data, and sets audio_len +to the length of that audio buffer, in bytes. You need to free the audio +buffer with SDL_FreeWAV when you are +done with it.

This function returns NULL and sets the SDL +error message if the wave file cannot be opened, uses an unknown data format, +or is corrupt. Currently raw, MS-ADPCM and IMA-ADPCM WAVE files are supported.

Example

SDL_AudioSpec wav_spec;
+Uint32 wav_length;
+Uint8 *wav_buffer;
+
+/* Load the WAV */
+if( SDL_LoadWAV("test.wav", &wav_spec, &wav_buffer, &wav_length) == NULL ){
+  fprintf(stderr, "Could not open test.wav: %s\n", SDL_GetError());
+  exit(-1);
+}
+.
+.
+.
+/* Do stuff with the WAV */
+.
+.
+/* Free It */
+SDL_FreeWAV(wav_buffer);

PrevHomeNext
SDL_GetAudioStatusUpSDL_FreeWAV
\ No newline at end of file diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdllockaudio.html b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdllockaudio.html new file mode 100644 index 000000000..0e6fc292b --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdllockaudio.html @@ -0,0 +1,208 @@ +SDL_LockAudio
SDL Library Documentation
PrevNext

SDL_LockAudio

Name

SDL_LockAudio -- Lock out the callback function

Synopsis

#include "SDL.h"

void SDL_LockAudio(void);

Description

The lock manipulated by these functions protects the callback function. +During a LockAudio period, you can be guaranteed that the +callback function is not running. Do not call these from the callback +function or you will cause deadlock.


PrevHomeNext
SDL_MixAudioUpSDL_UnlockAudio
\ No newline at end of file diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdllocksurface.html b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdllocksurface.html new file mode 100644 index 000000000..40c8959ea --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdllocksurface.html @@ -0,0 +1,306 @@ +SDL_LockSurface
SDL Library Documentation
PrevNext

SDL_LockSurface

Name

SDL_LockSurface -- Lock a surface for directly access.

Synopsis

#include "SDL.h"

int SDL_LockSurface(SDL_Surface *surface);

Description

SDL_LockSurface sets up a surface for directly +accessing the pixels. Between calls to SDL_LockSurface +and SDL_UnlockSurface, you can write to and read from +surface->pixels, using the pixel format stored in +surface->format. Once you are done accessing the +surface, you should use SDL_UnlockSurface to release it.

Not all surfaces require locking. +If SDL_MUSTLOCK(surface) +evaluates to 0, then you can read and write to the +surface at any time, and the pixel format of the surface will not change.

No operating system or library calls should be made between lock/unlock +pairs, as critical system locks may be held during this time.

It should be noted, that since SDL 1.1.8 surface locks are recursive. This means that you can lock a surface multiple times, but each lock must have a match unlock. +

    .
+    .
+    SDL_LockSurface( surface );
+    .
+    /* Surface is locked */
+    /* Direct pixel access on surface here */
+    .
+    SDL_LockSurface( surface );
+    .
+    /* More direct pixel access on surface */
+    .
+    SDL_UnlockSurface( surface );
+    /* Surface is still locked */
+    /* Note: Is versions < 1.1.8, the surface would have been */
+    /* no longer locked at this stage                         */
+    .
+    SDL_UnlockSurface( surface );
+    /* Surface is now unlocked */
+    .
+    .

Return Value

SDL_LockSurface returns 0, +or -1 if the surface couldn't be locked.


PrevHomeNext
SDL_FreeSurfaceUpSDL_UnlockSurface
\ No newline at end of file diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdllockyuvoverlay.html b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdllockyuvoverlay.html new file mode 100644 index 000000000..74e6ce673 --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdllockyuvoverlay.html @@ -0,0 +1,252 @@ +SDL_LockYUVOverlay
SDL Library Documentation
PrevNext

SDL_LockYUVOverlay

Name

SDL_LockYUVOverlay -- Lock an overlay

Synopsis

#include "SDL.h"

int SDL_LockYUVOverlay(SDL_Overlay *overlay);

Description

Much the same as SDL_LockSurface, SDL_LockYUVOverlay locks the overlay for direct access to pixel data.

Return Value

Returns 0 on success, or -1 on an error.


PrevHomeNext
SDL_CreateYUVOverlayUpSDL_UnlockYUVOverlay
\ No newline at end of file diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlmaprgb.html b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlmaprgb.html new file mode 100644 index 000000000..5086d0c7d --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlmaprgb.html @@ -0,0 +1,254 @@ +SDL_MapRGB
SDL Library Documentation
PrevNext

SDL_MapRGB

Name

SDL_MapRGB -- Map a RGB color value to a pixel format.

Synopsis

#include "SDL.h"

Uint32 SDL_MapRGB(SDL_PixelFormat *fmt, Uint8 r, Uint8 g, Uint8 b);

Description

Maps the RGB color value to the specified pixel format and returns the +pixel value as a 32-bit int.

If the format has a palette (8-bit) the index of the closest matching +color in the palette will be returned.

If the specified pixel format has an alpha component it will be returned +as all 1 bits (fully opaque).

Return Value

A pixel value best approximating the given RGB color value for a given +pixel format. If the pixel format bpp (color depth) is less than 32-bpp +then the unused upper bits of the return value can safely be ignored +(e.g., with a 16-bpp format the return value can be assigned to a +Uint16, and similarly a Uint8 for an 8-bpp +format).


PrevHomeNext
SDL_SetGammaRampUpSDL_MapRGBA
\ No newline at end of file diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlmaprgba.html b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlmaprgba.html new file mode 100644 index 000000000..e6bff276f --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlmaprgba.html @@ -0,0 +1,242 @@ +SDL_MapRGBA
SDL Library Documentation
PrevNext

SDL_MapRGBA

Name

SDL_MapRGBA -- Map a RGBA color value to a pixel format.

Synopsis

#include "SDL.h"

Uint32 SDL_MapRGBA(SDL_PixelFormat *fmt, Uint8 r, Uint8 g, Uint8 b, Uint8 a);

Description

Maps the RGBA color value to the specified pixel format and returns the +pixel value as a 32-bit int.

If the format has a palette (8-bit) the index of the closest matching +color in the palette will be returned.

If the specified pixel format has no alpha component the alpha value +will be ignored (as it will be in formats with a palette).

Return Value

A pixel value best approximating the given RGBA color value for a given +pixel format. If the pixel format bpp (color depth) is less than 32-bpp +then the unused upper bits of the return value can safely be ignored +(e.g., with a 16-bpp format the return value can be assigned to a +Uint16, and similarly a Uint8 for an 8-bpp +format).


PrevHomeNext
SDL_MapRGBUpSDL_GetRGB
\ No newline at end of file diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlmixaudio.html b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlmixaudio.html new file mode 100644 index 000000000..6cbf0f0db --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlmixaudio.html @@ -0,0 +1,237 @@ +SDL_MixAudio
SDL Library Documentation
PrevNext

SDL_MixAudio

Name

SDL_MixAudio -- Mix audio data

Synopsis

#include "SDL.h"

void SDL_MixAudio(Uint8 *dst, Uint8 *src, Uint32 len, int volume);

Description

This function takes two audio buffers of len bytes each +of the playing audio format and mixes them, performing addition, volume +adjustment, and overflow clipping. The volume ranges +from 0 to SDL_MIX_MAXVOLUME and should be set to the maximum +value for full audio volume. Note this does not change hardware volume. This is +provided for convenience -- you can mix your own audio data.

Note: Do not use this function for mixing together more than two streams of sample +data. The output from repeated application of this function may be distorted +by clipping, because there is no accumulator with greater range than the +input (not to mention this being an inefficient way of doing it). +Use mixing functions from SDL_mixer, OpenAL, or write your own mixer instead.


PrevHomeNext
SDL_ConvertAudioUpSDL_LockAudio
\ No newline at end of file diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlmousebuttonevent.html b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlmousebuttonevent.html new file mode 100644 index 000000000..b0b40df97 --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlmousebuttonevent.html @@ -0,0 +1,346 @@ +SDL_MouseButtonEvent
SDL Library Documentation
PrevNext

SDL_MouseButtonEvent

Name

SDL_MouseButtonEvent -- Mouse button event structure

Structure Definition

typedef struct{
+  Uint8 type;
+  Uint8 button;
+  Uint8 state;
+  Uint16 x, y;
+} SDL_MouseButtonEvent;

Structure Data

typeSDL_MOUSEBUTTONDOWN or SDL_MOUSEBUTTONUP
buttonThe mouse button index (SDL_BUTTON_LEFT, SDL_BUTTON_MIDDLE, SDL_BUTTON_RIGHT)
stateSDL_PRESSED or SDL_RELEASED
x, yThe X/Y coordinates of the mouse at press/release time

Description

SDL_MouseButtonEvent is a member of the SDL_Event union and is used when an event of type SDL_MOUSEBUTTONDOWN or SDL_MOUSEBUTTONUP is reported.

When a mouse button press or release is detected then number of the button pressed (from 1 to 255, with 1 usually being the left button and 2 the right) is placed into button, the position of the mouse when this event occured is stored in the x and the y fields. Like SDL_KeyboardEvent, information on whether the event was a press or a release event is stored in both the type and state fields, but this should be obvious.


PrevHomeNext
SDL_MouseMotionEventUpSDL_JoyAxisEvent
\ No newline at end of file diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlmousemotionevent.html b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlmousemotionevent.html new file mode 100644 index 000000000..3cc7cb5c6 --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlmousemotionevent.html @@ -0,0 +1,365 @@ +SDL_MouseMotionEvent
SDL Library Documentation
PrevNext

SDL_MouseMotionEvent

Name

SDL_MouseMotionEvent -- Mouse motion event structure

Structure Definition

typedef struct{
+  Uint8 type;
+  Uint8 state;
+  Uint16 x, y;
+  Sint16 xrel, yrel;
+} SDL_MouseMotionEvent;

Structure Data

typeSDL_MOUSEMOTION
stateThe current button state
x, yThe X/Y coordinates of the mouse
xrel, yrelRelative motion in the X/Y direction

Description

SDL_MouseMotionEvent is a member of the SDL_Event union and is used when an event of type SDL_MOUSEMOTION is reported.

Simply put, a SDL_MOUSEMOTION type event occurs when a user moves the mouse within the application window or when SDL_WarpMouse is called. Both the absolute (x and y) and relative (xrel and yrel) coordinates are reported along with the current button states (state). The button state can be interpreted using the SDL_BUTTON macro (see SDL_GetMouseState).

If the cursor is hidden (SDL_ShowCursor(0)) and the input is grabbed (SDL_WM_GrabInput(SDL_GRAB_ON)), then the mouse will give relative motion events even when the cursor reaches the edge fo the screen. This is currently only implemented on Windows and Linux/Unix-a-likes.


PrevHomeNext
SDL_KeyboardEventUpSDL_MouseButtonEvent
\ No newline at end of file diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlmutexp.html b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlmutexp.html new file mode 100644 index 000000000..fc32ca599 --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlmutexp.html @@ -0,0 +1,241 @@ +SDL_mutexP
SDL Library Documentation
PrevNext

SDL_mutexP

Name

SDL_mutexP -- Lock a mutex

Synopsis

#include "SDL.h"
+#include "SDL_thread.h"

int SDL_mutexP(SDL_mutex *mutex);

Description

Locks the mutex, which was previously created with SDL_CreateMutex. If the mutex is already locked then SDL_mutexP will not return until it is unlocked. Returns 0 on success, or -1 on an error.

SDL also defines a macro #define SDL_LockMutex(m) SDL_mutexP(m).


PrevHomeNext
SDL_DestroyMutexUpSDL_mutexV
\ No newline at end of file diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlmutexv.html b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlmutexv.html new file mode 100644 index 000000000..06a68bdc5 --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlmutexv.html @@ -0,0 +1,235 @@ +SDL_mutexV
SDL Library Documentation
PrevNext

SDL_mutexV

Name

SDL_mutexV -- Unlock a mutex

Synopsis

#include "SDL.h"
+#include "SDL_thread.h"

int SDL_mutexV(SDL_mutex *mutex);

Description

Unlocks the mutex, which was previously created with SDL_CreateMutex. Returns 0 on success, or -1 on an error.

SDL also defines a macro #define SDL_UnlockMutex(m) SDL_mutexV(m).


PrevHomeNext
SDL_mutexPUpSDL_CreateSemaphore
\ No newline at end of file diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlnumjoysticks.html b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlnumjoysticks.html new file mode 100644 index 000000000..68e3e3a72 --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlnumjoysticks.html @@ -0,0 +1,222 @@ +SDL_NumJoysticks
SDL Library Documentation
PrevNext

SDL_NumJoysticks

Name

SDL_NumJoysticks -- Count available joysticks.

Synopsis

#include "SDL.h"

int SDL_NumJoysticks(void);

Description

Counts the number of joysticks attached to the system.

Return Value

Returns the number of attached joysticks


PrevHomeNext
JoystickUpSDL_JoystickName
\ No newline at end of file diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlopenaudio.html b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlopenaudio.html new file mode 100644 index 000000000..bcfed54a7 --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlopenaudio.html @@ -0,0 +1,578 @@ +SDL_OpenAudio
SDL Library Documentation
PrevNext

SDL_OpenAudio

Name

SDL_OpenAudio -- Opens the audio device with the desired parameters.

Synopsis

#include "SDL.h"

int SDL_OpenAudio(SDL_AudioSpec *desired, SDL_AudioSpec *obtained);

Description

This function opens the audio device with the desired parameters, and +returns 0 if successful, placing the actual hardware parameters in the +structure pointed to by obtained. If obtained is NULL, the audio +data passed to the callback function will be guaranteed to be in the +requested format, and will be automatically converted to the hardware +audio format if necessary. This function returns -1 if it failed +to open the audio device, or couldn't set up the audio thread.

To open the audio device a desired SDL_AudioSpec must be created. +

SDL_AudioSpec *desired;
+.
+.
+desired = malloc(sizeof(SDL_AudioSpec));
+You must then fill this structure with your desired audio specifications.

desired->freq

The desired audio frequency in samples-per-second.

desired->format

The desired audio format (see SDL_AudioSpec)

desired->samples

The desired size of the audio buffer in samples. This number should be a power of two, and may be adjusted by the audio driver to a value more suitable for the hardware. Good values seem to range between 512 and 8192 inclusive, depending on the application and CPU speed. Smaller values yield faster response time, but can lead to underflow if the application is doing heavy processing and cannot fill the audio buffer in time. A stereo sample consists of both right and left channels in LR ordering. Note that the number of samples is directly related to time by the following formula: ms = (samples*1000)/freq

desired->callback

This should be set to a function that will be called when the audio device is ready for more data. It is passed a pointer to the audio buffer, and the length in bytes of the audio buffer. This function usually runs in a separate thread, and so you should protect data structures that it accesses by calling SDL_LockAudio and SDL_UnlockAudio in your code. The callback prototype is: +

void callback(void *userdata, Uint8 *stream, int len);
+userdata is the pointer stored in userdata field of the SDL_AudioSpec. stream is a pointer to the audio buffer you want to fill with information and len is the length of the audio buffer in bytes.

desired->userdata

This pointer is passed as the first parameter to the callback function.

SDL_OpenAudio reads these fields from the desired SDL_AudioSpec structure pass to the function and attempts to find an audio configuration matching your desired. As mentioned above, if the obtained parameter is NULL then SDL with convert from your desired audio settings to the hardware settings as it plays.

If obtained is NULL then the desired SDL_AudioSpec is your working specification, otherwise the obtained SDL_AudioSpec becomes the working specification and the desirec specification can be deleted. The data in the working specification is used when building SDL_AudioCVT's for converting loaded data to the hardware format.

SDL_OpenAudio calculates the size and silence fields for both the desired and obtained specifications. The size field stores the total size of the audio buffer in bytes, while the silence stores the value used to represent silence in the audio buffer

The audio device starts out playing silence when it's opened, and should be enabled for playing by calling SDL_PauseAudio(0) when you are ready for your audio callback function to be called. Since the audio driver may modify the requested size of the audio buffer, you should allocate any local mixing buffers after you open the audio device.

Examples

/* Prototype of our callback function */
+void my_audio_callback(void *userdata, Uint8 *stream, int len);
+
+/* Open the audio device */
+SDL_AudioSpec *desired, *obtained;
+SDL_AudioSpec *hardware_spec;
+
+/* Allocate a desired SDL_AudioSpec */
+desired = malloc(sizeof(SDL_AudioSpec));
+
+/* Allocate space for the obtained SDL_AudioSpec */
+obtained = malloc(sizeof(SDL_AudioSpec));
+
+/* 22050Hz - FM Radio quality */
+desired->freq=22050;
+
+/* 16-bit signed audio */
+desired->format=AUDIO_S16LSB;
+
+/* Mono */
+desired->channels=0;
+
+/* Large audio buffer reduces risk of dropouts but increases response time */
+desired->samples=8192;
+
+/* Our callback function */
+desired->callback=my_audio_callback;
+
+desired->userdata=NULL;
+
+/* Open the audio device */
+if ( SDL_OpenAudio(desired, obtained) < 0 ){
+  fprintf(stderr, "Couldn't open audio: %s\n", SDL_GetError());
+  exit(-1);
+}
+/* desired spec is no longer needed */
+free(desired);
+hardware_spec=obtained;
+.
+.
+/* Prepare callback for playing */
+.
+.
+.
+/* Start playing */
+SDL_PauseAudio(0);

PrevHomeNext
SDL_AudioSpecUpSDL_PauseAudio
\ No newline at end of file diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdloverlay.html b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdloverlay.html new file mode 100644 index 000000000..422919edc --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdloverlay.html @@ -0,0 +1,362 @@ +SDL_Overlay
SDL Library Documentation
PrevNext

SDL_Overlay

Name

SDL_Overlay -- YUV video overlay

Structure Definition

typedef struct{
+  Uint32 format;
+  int w, h;
+  int planes;
+  Uint16 *pitches;
+  Uint8 **pixels;
+  Uint32 hw_overlay:1;
+} SDL_Overlay;

Structure Data

formatOverlay format (see below)
w, hWidth and height of overlay
planesNumber of planes in the overlay. Usually either 1 or 3
pitchesAn array of pitches, one for each plane. Pitch is the length of a row in bytes.
pixelsAn array of pointers to teh data of each plane. The overlay should be locked before these pointers are used.
hw_overlayThis will be set to 1 if the overlay is hardware accelerated.

Description

A SDL_Overlay is similar to a SDL_Surface except it stores a YUV overlay. All the fields are read only, except for pixels which should be locked before use. The format field stores the format of the overlay which is one of the following: +

#define SDL_YV12_OVERLAY  0x32315659  /* Planar mode: Y + V + U */
+#define SDL_IYUV_OVERLAY  0x56555949  /* Planar mode: Y + U + V */
+#define SDL_YUY2_OVERLAY  0x32595559  /* Packed mode: Y0+U0+Y1+V0 */
+#define SDL_UYVY_OVERLAY  0x59565955  /* Packed mode: U0+Y0+V0+Y1 */
+#define SDL_YVYU_OVERLAY  0x55595659  /* Packed mode: Y0+V0+Y1+U0 */
+More information on YUV formats can be found at http://www.webartz.com/fourcc/indexyuv.htm.


PrevHomeNext
SDL_VideoInfoUpWindow Management
\ No newline at end of file diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlpalette.html b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlpalette.html new file mode 100644 index 000000000..6498ac40b --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlpalette.html @@ -0,0 +1,301 @@ +SDL_Palette
SDL Library Documentation
PrevNext

SDL_Palette

Name

SDL_Palette -- Color palette for 8-bit pixel formats

Structure Definition

typedef struct{
+  int ncolors;
+  SDL_Color *colors;
+} SDL_Palette;

Structure Data

ncolorsNumber of colors used in this palette
colorsPointer to SDL_Color structures that make up the palette.

Description

Each pixel in an 8-bit surface is an index into the colors field of the SDL_Palette structure store in SDL_PixelFormat. A SDL_Palette should never need to be created manually. It is automatically created when SDL allocates a SDL_PixelFormat for a surface. The colors values of a SDL_Surfaces palette can be set with the SDL_SetColors.


PrevHomeNext
SDL_ColorUpSDL_PixelFormat
\ No newline at end of file diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlpauseaudio.html b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlpauseaudio.html new file mode 100644 index 000000000..39d5a0f0f --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlpauseaudio.html @@ -0,0 +1,221 @@ +SDL_PauseAudio
SDL Library Documentation
PrevNext

SDL_PauseAudio

Name

SDL_PauseAudio -- Pauses and unpauses the audio callback processing

Synopsis

#include "SDL.h"

void SDL_PauseAudio(int pause_on);

Description

This function pauses and unpauses the audio callback processing. +It should be called with pause_on=0 after opening the audio +device to start playing sound. This is so you can safely initialize +data for your callback function after opening the audio device. +Silence will be written to the audio device during the pause.


PrevHomeNext
SDL_OpenAudioUpSDL_GetAudioStatus
\ No newline at end of file diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlpeepevents.html b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlpeepevents.html new file mode 100644 index 000000000..d5a0ff6f9 --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlpeepevents.html @@ -0,0 +1,321 @@ +SDL_PeepEvents
SDL Library Documentation
PrevNext

SDL_PeepEvents

Name

SDL_PeepEvents -- Checks the event queue for messages and optionally returns them.

Synopsis

#include "SDL.h"

int SDL_PeepEvents(SDL_Event *events, int numevents, SDL_eventaction action, Uint32 mask);

Description

Checks the event queue for messages and optionally returns them.

If action is SDL_ADDEVENT, up to +numevents events will be added to the back of the event + queue.

If action is SDL_PEEKEVENT, up to +numevents events at the front of the event queue, +matching mask, +will be returned and will not be removed from the queue.

If action is SDL_GETEVENT, up to +numevents events at the front of the event queue, +matching mask, +will be returned and will be removed from the queue.

The mask parameter is an bitwise OR of +SDL_EVENTMASK(event_type), for all +event types you are interested in.

This function is thread-safe.

Return Value

This function returns the number of events actually stored, or +-1 if there was an error.


PrevHomeNext
SDL_PumpEventsUpSDL_PollEvent
\ No newline at end of file diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlpixelformat.html b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlpixelformat.html new file mode 100644 index 000000000..000ddc08b --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlpixelformat.html @@ -0,0 +1,528 @@ +SDL_PixelFormat
SDL Library Documentation
PrevNext

SDL_PixelFormat

Name

SDL_PixelFormat -- Stores surface format information

Structure Definition

typedef struct SDL_PixelFormat {
+  SDL_Palette *palette;
+  Uint8  BitsPerPixel;
+  Uint8  BytesPerPixel;
+  Uint8  Rloss, Gloss, Bloss, Aloss;
+  Uint8  Rshift, Gshift, Bshift, Ashift;
+  Uint32 Rmask, Gmask, Bmask, Amask;
+  Uint32 colorkey;
+  Uint8  alpha;
+} SDL_PixelFormat;

Structure Data

palettePointer to the palette, or NULL if the BitsPerPixel>8
BitsPerPixelThe number of bits used to represent each pixel in a surface. Usually 8, 16, 24 or 32.
BytesPerPixelThe number of bytes used to represent each pixel in a surface. Usually one to four.
[RGBA]maskBinary mask used to retrieve individual color values
[RGBA]lossPrecision loss of each color component (2[RGBA]loss)
[RGBA]shiftBinary left shift of each color component in the pixel value
colorkeyPixel value of transparent pixels
alphaOverall surface alpha value

Description

A SDL_PixelFormat describes the format of the pixel data stored at the pixels field of a SDL_Surface. Every surface stores a SDL_PixelFormat in the format field.

If you wish to do pixel level modifications on a surface, then understanding how SDL stores its color information is essential.

8-bit pixel formats are the easiest to understand. Since its an 8-bit format, we have 8 BitsPerPixel and 1 BytesPerPixel. Since BytesPerPixel is 1, all pixels are represented by a Uint8 which contains an index into palette->colors. So, to determine the color of a pixel in a 8-bit surface: we read the color index from surface->pixels and we use that index to read the SDL_Color structure from surface->format->palette->colors. Like so: +

SDL_Surface *surface;
+SDL_PixelFormat *fmt;
+SDL_Color *color;
+Uint8 index;
+
+.
+.
+
+/* Create surface */
+.
+.
+fmt=surface->format;
+
+/* Check the bitdepth of the surface */
+if(fmt->BitsPerPixel!=8){
+  fprintf(stderr, "Not an 8-bit surface.\n");
+  return(-1);
+}
+
+/* Lock the surface */
+SDL_LockSurface(surface);
+
+/* Get the topleft pixel */
+index=*(Uint8 *)surface->pixels;
+color=fmt->palette->colors[index];
+
+/* Unlock the surface */
+SDL_UnlockSurface(surface);
+printf("Pixel Color-> Red: %d, Green: %d, Blue: %d. Index: %d\n",
+          color->r, color->g, color->b, index);
+.
+.

Pixel formats above 8-bit are an entirely different experience. They are +considered to be "TrueColor" formats and the color information is stored in the +pixels themselves, not in a palette. The mask, shift and loss fields tell us +how the color information is encoded. The mask fields allow us to isolate each +color component, the shift fields tell us the number of bits to the right of +each component in the pixel value and the loss fields tell us the number of +bits lost from each component when packing 8-bit color component in a pixel. +

/* Extracting color components from a 32-bit color value */
+SDL_PixelFormat *fmt;
+SDL_Surface *surface;
+Uint32 temp, pixel;
+Uint8 red, green, blue, alpha;
+.
+.
+.
+fmt=surface->format;
+SDL_LockSurface(surface);
+pixel=*((Uint32*)surface->pixels);
+SDL_UnlockSurface(surface);
+
+/* Get Red component */
+temp=pixel&fmt->Rmask; /* Isolate red component */
+temp=temp>>fmt->Rshift;/* Shift it down to 8-bit */
+temp=temp<<fmt->Rloss; /* Expand to a full 8-bit number */
+red=(Uint8)temp;
+
+/* Get Green component */
+temp=pixel&fmt->Gmask; /* Isolate green component */
+temp=temp>>fmt->Gshift;/* Shift it down to 8-bit */
+temp=temp<<fmt->Gloss; /* Expand to a full 8-bit number */
+green=(Uint8)temp;
+
+/* Get Blue component */
+temp=pixel&fmt->Bmask; /* Isolate blue component */
+temp=temp>>fmt->Bshift;/* Shift it down to 8-bit */
+temp=temp<<fmt->Bloss; /* Expand to a full 8-bit number */
+blue=(Uint8)temp;
+
+/* Get Alpha component */
+temp=pixel&fmt->Amask; /* Isolate alpha component */
+temp=temp>>fmt->Ashift;/* Shift it down to 8-bit */
+temp=temp<<fmt->Aloss; /* Expand to a full 8-bit number */
+alpha=(Uint8)temp;
+
+printf("Pixel Color -> R: %d,  G: %d,  B: %d,  A: %d\n", red, green, blue, alpha);
+.
+.
+.


PrevHomeNext
SDL_PaletteUpSDL_Surface
diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlpollevent.html b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlpollevent.html new file mode 100644 index 000000000..f97c22d96 --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlpollevent.html @@ -0,0 +1,269 @@ +SDL_PollEvent
SDL Library Documentation
PrevNext

SDL_PollEvent

Name

SDL_PollEvent -- Polls for currently pending events.

Synopsis

#include "SDL.h"

int SDL_PollEvent(SDL_Event *event);

Description

Polls for currently pending events, and returns 1 +if there are any pending events, or 0 if there +are none available.

If event is not NULL, the next +event is removed from the queue and stored in that area.

Examples

SDL_Event event; /* Event structure */
+
+.
+.
+.
+/* Check for events */
+while(SDL_PollEvent(&event)){  /* Loop until there are no events left on the queue */
+  switch(event.type){  /* Process the appropiate event type */
+    case SDL_KEYDOWN:  /* Handle a KEYDOWN event */         
+      printf("Oh! Key press\n");
+      break;
+    case SDL_MOUSEMOTION:
+      .
+      .
+      .
+    default: /* Report an unhandled event */
+      printf("I don't know what this event is!\n");
+  }
+}


PrevHomeNext
SDL_PeepEventsUpSDL_WaitEvent
\ No newline at end of file diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlpumpevents.html b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlpumpevents.html new file mode 100644 index 000000000..a7e528f19 --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlpumpevents.html @@ -0,0 +1,244 @@ +SDL_PumpEvents
SDL Library Documentation
PrevNext

SDL_PumpEvents

Name

SDL_PumpEvents -- Pumps the event loop, gathering events from the input devices.

Synopsis

#include "SDL.h"

void SDL_PumpEvents(void);

Description

Pumps the event loop, gathering events from the input devices.

SDL_PumpEvents gathers all the pending input information from devices and places it on the event queue. Without calls to SDL_PumpEvents no events would ever be placed on the queue. Often calls the need for SDL_PumpEvents is hidden from the user since SDL_PollEvent and SDL_WaitEvent implicitly call SDL_PumpEvents. However, if you are not polling or waiting for events (e.g. you are filtering them), then you must call SDL_PumpEvents to force an event queue update.

Note: You can only call this function in the thread that set the video mode.


PrevHomeNext
Event Functions.UpSDL_PeepEvents
\ No newline at end of file diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlpushevent.html b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlpushevent.html new file mode 100644 index 000000000..6905385c3 --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlpushevent.html @@ -0,0 +1,266 @@ +SDL_PushEvent
SDL Library Documentation
PrevNext

SDL_PushEvent

Name

SDL_PushEvent -- Pushes an event onto the event queue

Synopsis

#include "SDL.h"

int SDL_PushEvent(SDL_Event *event);

Description

The event queue can actually be used as a two way communication channel. Not only can events be read from the queue, but the user can also push their own events onto it. event is a pointer to the event structure you wish to push onto the queue.

Note: Pushing device input events onto the queue doesn't modify the state of the device within SDL.

Return Value

Returns 0 on success or -1 if the event couldn't be pushed.

Examples

See SDL_Event.


PrevHomeNext
SDL_WaitEventUpSDL_SetEventFilter
\ No newline at end of file diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlquit.html b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlquit.html new file mode 100644 index 000000000..1f31c8255 --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlquit.html @@ -0,0 +1,244 @@ +SDL_Quit
SDL Library Documentation
PrevNext

SDL_Quit

Name

SDL_Quit -- Shut down SDL

Synopsis

#include "SDL.h"

void SDL_Quit(void);

Description

SDL_Quit shuts down all SDL subsystems and frees the resources allocated to them. This should always be called before you exit. For the sake of simplicity you can set SDL_Quit as your atexit call, like: +

SDL_Init(SDL_INIT_VIDEO|SDL_INIT_AUDIO);
+atexit(SDL_Quit);
+.
+.

Note: While using atexit maybe be fine for small programs, more advanced users should shut down SDL in their own cleanup code. Plus, using atexit in a library is a sure way to crash dynamically loaded code


PrevHomeNext
SDL_QuitSubSystemUpSDL_WasInit
\ No newline at end of file diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlquitevent.html b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlquitevent.html new file mode 100644 index 000000000..d575f38b7 --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlquitevent.html @@ -0,0 +1,263 @@ +SDL_QuitEvent
SDL Library Documentation
PrevNext

SDL_QuitEvent

Name

SDL_QuitEvent -- Quit requested event

Structure Definition

typedef struct{
+  Uint8 type
+} SDL_QuitEvent;

Structure Data

typeSDL_QUIT

Description

SDL_QuitEvent is a member of the SDL_Event union and is used whan an event of type SDL_QUIT is reported.

As can be seen, the SDL_QuitEvent structure serves no useful purpose. The event itself, on the other hand, is very important. If you filter out or ignore a quit event then it is impossible for the user to close the window. On the other hand, if you do accept a quit event then the application window will be closed, and screen updates will still report success event though the application will no longer be visible.

Note: The macro SDL_QuitRequested will return non-zero if a quit event is pending


PrevHomeNext
SDL_UserEventUpSDL_keysym
\ No newline at end of file diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlquitsubsystem.html b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlquitsubsystem.html new file mode 100644 index 000000000..877e3ce11 --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlquitsubsystem.html @@ -0,0 +1,248 @@ +SDL_QuitSubSystem
SDL Library Documentation
PrevNext

SDL_QuitSubSystem

Name

SDL_QuitSubSystem -- Shut down a subsystem

Synopsis

#include "SDL.h"

void SDL_QuitSubSystem(Uint32 flags);

Description

SDL_QuitSubSystem allows you to shut down a subsystem that has been previously initialized by SDL_Init or SDL_InitSubSystem. The flags tells SDL_QuitSubSystem which subsystems to shut down, it uses the same values that are passed to SDL_Init.


PrevHomeNext
SDL_InitSubSystemUpSDL_Quit
\ No newline at end of file diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlrect.html b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlrect.html new file mode 100644 index 000000000..ba4a80be6 --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlrect.html @@ -0,0 +1,258 @@ +SDL_Rect
SDL Library Documentation
PrevNext

SDL_Rect

Name

SDL_Rect -- Defines a rectangular area

Structure Definition

typedef struct{
+  Sint16 x, y;
+  Uint16 w, h;
+} SDL_Rect;

Structure Data

x, yPosition of the upper-left corner of the rectangle
w, hThe width and height of the rectangle

Description

A SDL_Rect defines a rectangular area of pixels. It is used by SDL_BlitSurface to define blitting regions and by several other video functions.


PrevHomeNext
SDL_GLattrUpSDL_Color
\ No newline at end of file diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlremovetimer.html b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlremovetimer.html new file mode 100644 index 000000000..26a3d11f7 --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlremovetimer.html @@ -0,0 +1,236 @@ +SDL_RemoveTimer
SDL Library Documentation
PrevNext

SDL_RemoveTimer

Name

SDL_RemoveTimer -- Remove a timer which was added with +SDL_AddTimer.

Synopsis

#include "SDL.h"

SDL_bool SDL_RemoveTimer(SDL_TimerID id);

Description

Removes a timer callback previously added with +SDL_AddTimer.

Return Value

Returns a boolean value indicating success.

Examples

SDL_RemoveTimer(my_timer_id);

See Also

SDL_AddTimer


PrevHomeNext
SDL_AddTimerUpSDL_SetTimer
\ No newline at end of file diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlresizeevent.html b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlresizeevent.html new file mode 100644 index 000000000..1d446a54c --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlresizeevent.html @@ -0,0 +1,307 @@ +SDL_ResizeEvent
SDL Library Documentation
PrevNext

SDL_ResizeEvent

Name

SDL_ResizeEvent -- Window resize event structure

Structure Definition

typedef struct{
+  Uint8 type;
+  int w, h;
+} SDL_ResizeEvent;

Structure Data

typeSDL_VIDEORESIZE
w, hNew width and height of the window

Description

SDL_ResizeEvent is a member of the SDL_Event union and is used when an event of type SDL_VIDEORESIZE is reported.

When SDL_RESIZABLE is passed as a flag to SDL_SetVideoMode the user is allowed to resize the applications window. When the window is resized an SDL_VIDEORESIZE is report, with the new window width and height values stored in w and h, respectively. When an SDL_VIDEORESIZE is recieved the window should be resized to the new dimensions using SDL_SetVideoMode.


PrevHomeNext
SDL_JoyBallEventUpSDL_ExposeEvent
\ No newline at end of file diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlsavebmp.html b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlsavebmp.html new file mode 100644 index 000000000..4c318ed75 --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlsavebmp.html @@ -0,0 +1,236 @@ +SDL_SaveBMP
SDL Library Documentation
PrevNext

SDL_SaveBMP

Name

SDL_SaveBMP -- Save an SDL_Surface as a Windows BMP file.

Synopsis

#include "SDL.h"

int SDL_SaveBMP(SDL_Surface *surface, const char *file);

Description

Saves the SDL_Surface surface as a Windows BMP file named file.

Return Value

Returns 0 if successful or +-1 +if there was an error.

See Also

SDL_LoadBMP


PrevHomeNext
SDL_LoadBMPUpSDL_SetColorKey
\ No newline at end of file diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlsempost.html b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlsempost.html new file mode 100644 index 000000000..18fb01ab2 --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlsempost.html @@ -0,0 +1,299 @@ +SDL_SemPost
SDL Library Documentation
PrevNext

SDL_SemPost

Name

SDL_SemPost -- Unlock a semaphore.

Synopsis

#include "SDL.h"
+#include "SDL_thread.h"

int SDL_SemPost(SDL_sem *sem);

Description

SDL_SemPost unlocks the semaphore pointed to by +sem and atomically increments the semaphores value. +Threads that were blocking on the semaphore may be scheduled after this call +succeeds.

SDL_SemPost should be called after a semaphore is locked by a successful call to +SDL_SemWait, +SDL_SemTryWait or +SDL_SemWaitTimeout.

Return Value

Returns 0 if successful or +-1 if there was an error (leaving the semaphore unchanged).

Examples

SDL_SemPost(my_sem);


PrevHomeNext
SDL_SemWaitTimeoutUpSDL_SemValue
\ No newline at end of file diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlsemtrywait.html b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlsemtrywait.html new file mode 100644 index 000000000..86f47a1c8 --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlsemtrywait.html @@ -0,0 +1,319 @@ +SDL_SemTryWait
SDL Library Documentation
PrevNext

SDL_SemTryWait

Name

SDL_SemTryWait -- Attempt to lock a semaphore but don't suspend the thread.

Synopsis

#include "SDL.h"
+#include "SDL_thread.h"

int SDL_SemTryWait(SDL_sem *sem);

Description

SDL_SemTryWait is a non-blocking varient of +SDL_SemWait. If the value of the semaphore +pointed to by sem is positive it will atomically +decrement the semaphore value and return 0, otherwise it will return +SDL_MUTEX_TIMEDOUT instead of suspending the thread.

After SDL_SemTryWait is successful, the semaphore +can be released and its count atomically incremented by a successful call to +SDL_SemPost.

Return Value

Returns 0 if the semaphore was successfully locked or +either SDL_MUTEX_TIMEDOUT or -1 +if the thread would have suspended or there was an error, respectivly.

If the semaphore was not successfully locked, the semaphore will be unchanged.

Examples

res = SDL_SemTryWait(my_sem);
+
+if (res == SDL_MUTEX_TIMEDOUT) {
+        return TRY_AGAIN;
+}
+if (res == -1) {
+        return WAIT_ERROR;
+}
+
+...
+
+SDL_SemPost(my_sem);


PrevHomeNext
SDL_SemWaitUpSDL_SemWaitTimeout
\ No newline at end of file diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlsemvalue.html b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlsemvalue.html new file mode 100644 index 000000000..7867369b1 --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlsemvalue.html @@ -0,0 +1,273 @@ +SDL_SemValue
SDL Library Documentation
PrevNext

SDL_SemValue

Name

SDL_SemValue -- Return the current value of a semaphore.

Synopsis

#include "SDL.h"
+#include "SDL/SDL_thread.h"

Uint32 SDL_SemValue(SDL_sem *sem);

Description

SDL_SemValue() returns the current semaphore value from +the semaphore pointed to by sem.

Return Value

Returns current value of the semaphore.

Examples

  sem_value = SDL_SemValue(my_sem);


PrevHomeNext
SDL_SemPostUpSDL_CreateCond
\ No newline at end of file diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlsemwait.html b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlsemwait.html new file mode 100644 index 000000000..5e98d552e --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlsemwait.html @@ -0,0 +1,298 @@ +SDL_SemWait
SDL Library Documentation
PrevNext

SDL_SemWait

Name

SDL_SemWait -- Lock a semaphore and suspend the thread if the semaphore value is zero.

Synopsis

#include "SDL.h"
+#include "SDL_thread.h"

int SDL_SemWait(SDL_sem *sem);

Description

SDL_SemWait() suspends the calling thread until either +the semaphore pointed to by sem has a positive value, +the call is interrupted by a signal or error. If the call is successful it +will atomically decrement the semaphore value.

After SDL_SemWait() is successful, the semaphore +can be released and its count atomically incremented by a successful call to +SDL_SemPost.

Return Value

Returns 0 if successful or +-1 if there was an error (leaving the semaphore unchanged).

Examples

if (SDL_SemWait(my_sem) == -1) {
+        return WAIT_FAILED;
+}
+
+...
+
+SDL_SemPost(my_sem);


PrevHomeNext
SDL_DestroySemaphoreUpSDL_SemTryWait
\ No newline at end of file diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlsemwaittimeout.html b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlsemwaittimeout.html new file mode 100644 index 000000000..788f5b725 --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlsemwaittimeout.html @@ -0,0 +1,322 @@ +SDL_SemWaitTimeout
SDL Library Documentation
PrevNext

SDL_SemWaitTimeout

Name

SDL_SemWaitTimeout -- Lock a semaphore, but only wait up to a specified maximum time.

Synopsis

#include "SDL.h"
+#include "SDL_thread.h"

int SDL_SemWaitTimeout(SDL_sem *sem, Uint32 timeout);

Description

SDL_SemWaitTimeout() is a varient of +SDL_SemWait +with a maximum timeout value. +If the value of the semaphore pointed to by sem is +positive (greater than zero) it will atomically decrement the semaphore value +and return 0, otherwise it will wait up to timeout +milliseconds trying to lock the semaphore. This function is to be avoided if +possible since on some platforms it is implemented by polling the semaphore +every millisecond in a busy loop.

After SDL_SemWaitTimeout() is successful, the semaphore +can be released and its count atomically incremented by a successful call to +SDL_SemPost.

Return Value

Returns 0 if the semaphore was successfully locked or +either SDL_MUTEX_TIMEDOUT or -1 +if the timeout period was exceeded or there was an error, respectivly.

If the semaphore was not successfully locked, the semaphore will be unchanged.

Examples

res = SDL_SemWaitTimeout(my_sem, WAIT_TIMEOUT_MILLISEC);
+
+if (res == SDL_MUTEX_TIMEDOUT) {
+        return TRY_AGAIN;
+}
+if (res == -1) {
+        return WAIT_ERROR;
+}
+
+...
+
+SDL_SemPost(my_sem);


PrevHomeNext
SDL_SemTryWaitUpSDL_SemPost
\ No newline at end of file diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlsetalpha.html b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlsetalpha.html new file mode 100644 index 000000000..fc844981f --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlsetalpha.html @@ -0,0 +1,500 @@ +SDL_SetAlpha
SDL Library Documentation
PrevNext

SDL_SetAlpha

Name

SDL_SetAlpha -- Adjust the alpha properties of a surface

Synopsis

#include "SDL.h"

int SDL_SetAlpha(SDL_Surface *surface, Uint32 flag, Uint8 alpha);

Description

Note: This function and the semantics of SDL alpha blending have changed since version 1.1.4. Up until version 1.1.5, an alpha value of 0 was considered opaque and a value of 255 was considered transparent. This has now been inverted: 0 (SDL_ALPHA_TRANSPARENT) is now considered transparent and 255 (SDL_ALPHA_OPAQUE) is now considered opaque.

SDL_SetAlpha is used for setting the per-surface alpha +value and/or enabling and disabling alpha blending.

Thesurface parameter specifies which surface whose alpha +attributes you wish to adjust. flags is used to specify +whether alpha blending should be used (SDL_SRCALPHA) and +whether the surface should use RLE acceleration for blitting +(SDL_RLEACCEL). flags can be an OR'd +combination of these two options, one of these options or 0. If +SDL_SRCALPHA is not passed as a flag then all alpha +information is ignored when blitting the surface. The +alpha parameter is the per-surface alpha value; a +surface need not have an alpha channel to use per-surface alpha and blitting +can still be accelerated with SDL_RLEACCEL.

Note: The per-surface alpha value of 128 is considered a special case and +is optimised, so it's much faster than other per-surface values.

Alpha effects surface blitting in the following ways:

RGBA->RGB with SDL_SRCALPHA

The source is alpha-blended with the destination, using the alpha channel. SDL_SRCCOLORKEY and the per-surface alpha are ignored.

RGBA->RGB without SDL_SRCALPHA

The RGB data is copied from the source. The source alpha channel and the per-surface alpha value are ignored.

RGB->RGBA with SDL_SRCALPHA

The source is alpha-blended with the destination using the per-surface alpha +value. If SDL_SRCCOLORKEY is set, only the pixels not +matching the colorkey value are copied. The alpha channel of the copied pixels +is set to opaque.

RGB->RGBA without SDL_SRCALPHA

The RGB data is copied from the source and the alpha value of the copied pixels +is set to opaque. If SDL_SRCCOLORKEY is set, only the pixels +not matching the colorkey value are copied.

RGBA->RGBA with SDL_SRCALPHA

The source is alpha-blended with the destination using the source alpha +channel. The alpha channel in the destination surface is left untouched. +SDL_SRCCOLORKEY is ignored.

RGBA->RGBA without SDL_SRCALPHA

The RGBA data is copied to the destination surface. If SDL_SRCCOLORKEY is set, only the pixels not matching the colorkey value are copied.

RGB->RGB with SDL_SRCALPHA

The source is alpha-blended with the destination using the per-surface alpha value. If SDL_SRCCOLORKEY is set, only the pixels not matching the colorkey value are copied.

RGB->RGB without SDL_SRCALPHA

The RGB data is copied from the source. If SDL_SRCCOLORKEY is set, only the pixels not matching the colorkey value are copied.

Note: Note that RGBA->RGBA blits (with SDL_SRCALPHA set) keep the alpha +of the destination surface. This means that you cannot compose two arbitrary +RGBA surfaces this way and get the result you would expect from "overlaying" +them; the destination alpha will work as a mask.

Also note that per-pixel and per-surface alpha cannot be combined; +the per-pixel alpha is always used if available

Return Value

This function returns 0, or +-1 if there was an error.


PrevHomeNext
SDL_SetColorKeyUpSDL_SetClipRect
\ No newline at end of file diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlsetcliprect.html b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlsetcliprect.html new file mode 100644 index 000000000..03898d55a --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlsetcliprect.html @@ -0,0 +1,241 @@ +SDL_SetClipRect
SDL Library Documentation
PrevNext

SDL_SetClipRect

Name

SDL_SetClipRect -- Sets the clipping rectangle for a surface.

Synopsis

#include "SDL.h"

void SDL_SetClipRect(SDL_Surface *surface, SDL_Rect *rect);

Description

Sets the clipping rectangle for a surface. When this surface is the +destination of a blit, only the area within the clip rectangle will be +drawn into.

The rectangle pointed to by rect will be +clipped to the edges of the surface so that the clip rectangle for a +surface can never fall outside the edges of the surface.

If rect is NULL the clipping +rectangle will be set to the full size of the surface.


PrevHomeNext
SDL_SetAlphaUpSDL_GetClipRect
\ No newline at end of file diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlsetcolorkey.html b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlsetcolorkey.html new file mode 100644 index 000000000..0cb669579 --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlsetcolorkey.html @@ -0,0 +1,321 @@ +SDL_SetColorKey
SDL Library Documentation
PrevNext

SDL_SetColorKey

Name

SDL_SetColorKey -- Sets the color key (transparent pixel) in a blittable surface and +RLE acceleration.

Synopsis

#include "SDL.h"

int SDL_SetColorKey(SDL_Surface *surface, Uint32 flag, Uint32 key);

Description

Sets the color key (transparent pixel) in a blittable surface and enables or + disables RLE blit acceleration.

RLE acceleration can substantially speed up blitting of images with large +horizontal runs of transparent pixels (i.e., pixels that match the +key value). The key must be of the same pixel format as the surface, SDL_MapRGB is often useful for obtaining an acceptable value.

If flag is SDL_SRCCOLORKEY then +key is the transparent pixel value in the source image of a +blit.

If flag is OR'd with +SDL_RLEACCEL then the surface will be draw using RLE +acceleration when drawn with +SDL_BlitSurface. The surface will +actually be encoded for RLE acceleration the first time +SDL_BlitSurface or +SDL_DisplayFormat is called on the +surface.

If flag is 0, this function clears +any current color key.

Return Value

This function returns 0, or +-1 if there was an error.


PrevHomeNext
SDL_SaveBMPUpSDL_SetAlpha
\ No newline at end of file diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlsetcolors.html b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlsetcolors.html new file mode 100644 index 000000000..569564598 --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlsetcolors.html @@ -0,0 +1,358 @@ +SDL_SetColors
SDL Library Documentation
PrevNext

SDL_SetColors

Name

SDL_SetColors -- Sets a portion of the colormap for the given 8-bit surface.

Synopsis

#include "SDL.h"

int SDL_SetColors(SDL_Surface *surface, SDL_Color *colors, int firstcolor, int ncolors);

Description

Sets a portion of the colormap for the given 8-bit surface.

When surface is the surface associated with the current +display, the display colormap will be updated with the requested colors. If +SDL_HWPALETTE was set in SDL_SetVideoMode flags, +SDL_SetColors will always return 1, +and the palette is guaranteed to be set the way you desire, even if the window +colormap has to be warped or run under emulation.

The color components of a +SDL_Color +structure are 8-bits in size, giving you a total of 2563 +=16777216 colors.

Palettized (8-bit) screen surfaces with the SDL_HWPALETTE +flag have two palettes, a logical palette that is used for mapping blits +to/from the surface and a physical palette (that determines how the +hardware will map the colors to the display). SDL_SetColors +modifies both palettes (if present), and is equivalent to calling +SDL_SetPalette with the +flags set to +(SDL_LOGPAL | SDL_PHYSPAL).

Return Value

If surface is not a palettized surface, this function +does nothing, returning 0. If all of the colors were set +as passed to SDL_SetColors, it will return +1. If not all the color entries were set exactly as +given, it will return 0, and you should look at the +surface palette to determine the actual color palette.

Example

/* Create a display surface with a grayscale palette */
+SDL_Surface *screen;
+SDL_Color colors[256];
+int i;
+.
+.
+.
+/* Fill colors with color information */
+for(i=0;i<256;i++){
+  colors[i].r=i;
+  colors[i].g=i;
+  colors[i].b=i;
+}
+
+/* Create display */
+screen=SDL_SetVideoMode(640, 480, 8, SDL_HWPALETTE);
+if(!screen){
+  printf("Couldn't set video mode: %s\n", SDL_GetError());
+  exit(-1);
+}
+
+/* Set palette */
+SDL_SetColors(screen, colors, 0, 256);
+.
+.
+.
+.

PrevHomeNext
SDL_FlipUpSDL_SetPalette
\ No newline at end of file diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlsetcursor.html b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlsetcursor.html new file mode 100644 index 000000000..9c5443e53 --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlsetcursor.html @@ -0,0 +1,222 @@ +SDL_SetCursor
SDL Library Documentation
PrevNext

SDL_SetCursor

Name

SDL_SetCursor -- Set the currently active mouse cursor.

Synopsis

#include "SDL.h"

void SDL_SetCursor(SDL_Cursor *cursor);

Description

Sets the currently active cursor to +the specified one. +If the cursor is currently visible, the change will be immediately +represented on the display.


PrevHomeNext
SDL_FreeCursorUpSDL_GetCursor
diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlseteventfilter.html b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlseteventfilter.html new file mode 100644 index 000000000..0808bab3c --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlseteventfilter.html @@ -0,0 +1,284 @@ +SDL_SetEventFilter
SDL Library Documentation
PrevNext

SDL_SetEventFilter

Name

SDL_SetEventFilter -- Sets up a filter to process all events before they are posted +to the event queue.

Synopsis

#include "SDL.h"

void SDL_SetEventFilter(SDL_EventFilter filter);

Description

This function sets up a filter to process all events before they are posted +to the event queue. This is a very powerful and flexible feature. The filter +is prototyped as: +

typedef int (*SDL_EventFilter)(const SDL_Event *event);
+If the filter returns 1, then the event will be +added to the internal queue. If it returns 0, +then the event will be dropped from the queue. This allows selective +filtering of dynamically.

There is one caveat when dealing with the SDL_QUITEVENT event type. The +event filter is only called when the window manager desires to close the +application window. If the event filter returns 1, then the window will +be closed, otherwise the window will remain open if possible. +If the quit event is generated by an interrupt signal, it will bypass the +internal queue and be delivered to the application at the next event poll.

Note: Events pushed onto the queue with SDL_PushEvent or SDL_PeepEvents do not get passed through the event filter.

Note: Be Careful! The event filter function may run in a different thread so be careful what you do within it.


PrevHomeNext
SDL_PushEventUpSDL_GetEventFilter
\ No newline at end of file diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlsetgamma.html b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlsetgamma.html new file mode 100644 index 000000000..6443a966a --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlsetgamma.html @@ -0,0 +1,231 @@ +SDL_SetGamma
SDL Library Documentation
PrevNext

SDL_SetGamma

Name

SDL_SetGamma -- Sets the color gamma function for the display

Synopsis

#include "SDL.h"

int SDL_SetGamma(float redgamma, float greengamma, float bluegamma);

Description

Sets the "gamma function" for the display of each color component. Gamma +controls the brightness/contrast of colors displayed on the screen. +A gamma value of 1.0 is identity (i.e., no adjustment +is made).

This function adjusts the gamma based on the "gamma function" parameter, +you can directly specify lookup tables for gamma adjustment with +SDL_SetGammaRamp.

Not all display hardware is able to change gamma.

Return Value

Returns -1 on error (or if gamma adjustment is not supported).


PrevHomeNext
SDL_SetPaletteUpSDL_GetGammaRamp
\ No newline at end of file diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlsetgammaramp.html b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlsetgammaramp.html new file mode 100644 index 000000000..79599c8d5 --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlsetgammaramp.html @@ -0,0 +1,230 @@ +SDL_SetGammaRamp
SDL Library Documentation
PrevNext

SDL_SetGammaRamp

Name

SDL_SetGammaRamp -- Sets the color gamma lookup tables for the display

Synopsis

#include "SDL.h"

int SDL_SetGammaRamp(Uint16 *redtable, Uint16 *greentable, Uint16 *bluetable);

Description

Sets the gamma lookup tables for the display for each color component. +Each table is an array of 256 Uint16 values, representing a mapping +between the input and output for that channel. The input is the index +into the array, and the output is the 16-bit gamma value at that index, +scaled to the output color precision. You may pass NULL to any of the +channels to leave them unchanged.

This function adjusts the gamma based on lookup tables, you can also +have the gamma calculated based on a "gamma function" parameter with +SDL_SetGamma.

Not all display hardware is able to change gamma.

Return Value

Returns -1 on error (or if gamma adjustment is not supported).


PrevHomeNext
SDL_GetGammaRampUpSDL_MapRGB
\ No newline at end of file diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlsetmodstate.html b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlsetmodstate.html new file mode 100644 index 000000000..ee69a3f5d --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlsetmodstate.html @@ -0,0 +1,237 @@ +SDL_SetModState
SDL Library Documentation
PrevNext

SDL_SetModState

Name

SDL_SetModState -- Set the current key modifier state

Synopsis

#include "SDL.h"

void SDL_SetModState(SDLMod modstate);

Description

The inverse of SDL_GetModState, SDL_SetModState allows you to impose modifier key states on your application.

Simply pass your desired modifier states into modstate. This value my be a logical OR'd combination of the following:

typedef enum {
+  KMOD_NONE  = 0x0000,
+  KMOD_LSHIFT= 0x0001,
+  KMOD_RSHIFT= 0x0002,
+  KMOD_LCTRL = 0x0040,
+  KMOD_RCTRL = 0x0080,
+  KMOD_LALT  = 0x0100,
+  KMOD_RALT  = 0x0200,
+  KMOD_LMETA = 0x0400,
+  KMOD_RMETA = 0x0800,
+  KMOD_NUM   = 0x1000,
+  KMOD_CAPS  = 0x2000,
+  KMOD_MODE  = 0x4000,
+} SDLMod;

PrevHomeNext
SDL_GetModStateUpSDL_GetKeyName
\ No newline at end of file diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlsetpalette.html b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlsetpalette.html new file mode 100644 index 000000000..1622f1590 --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlsetpalette.html @@ -0,0 +1,352 @@ +SDL_SetPalette
SDL Library Documentation
PrevNext

SDL_SetPalette

Name

SDL_SetPalette -- Sets the colors in the palette of an 8-bit surface.

Synopsis

#include "SDL.h"

int SDL_SetPalette(SDL_Surface *surface, int flags, SDL_Color *colors, int firstcolor, int ncolors);

Description

Sets a portion of the palette for the given 8-bit surface.

Palettized (8-bit) screen surfaces with the +SDL_HWPALETTE flag have two palettes, a logical +palette that is used for mapping blits to/from the surface and a +physical palette (that determines how the hardware will map the colors +to the display). SDL_BlitSurface +always uses the logical palette when blitting surfaces (if it has to +convert between surface pixel formats). Because of this, it is often +useful to modify only one or the other palette to achieve various +special color effects (e.g., screen fading, color flashes, screen dimming).

This function can modify either the logical or physical palette by +specifing SDL_LOGPAL or +SDL_PHYSPALthe in the flags +parameter.

When surface is the surface associated with the current +display, the display colormap will be updated with the requested colors. If +SDL_HWPALETTE was set in SDL_SetVideoMode flags, +SDL_SetPalette will always return 1, +and the palette is guaranteed to be set the way you desire, even if the window +colormap has to be warped or run under emulation.

The color components of a +SDL_Color structure +are 8-bits in size, giving you a total of +2563=16777216 colors.

Return Value

If surface is not a palettized surface, this function +does nothing, returning 0. If all of the colors were set +as passed to SDL_SetPalette, it will return +1. If not all the color entries were set exactly as +given, it will return 0, and you should look at the +surface palette to determine the actual color palette.

Example

        /* Create a display surface with a grayscale palette */
+        SDL_Surface *screen;
+        SDL_Color colors[256];
+        int i;
+        .
+        .
+        .
+        /* Fill colors with color information */
+        for(i=0;i<256;i++){
+          colors[i].r=i;
+          colors[i].g=i;
+          colors[i].b=i;
+        }
+
+        /* Create display */
+        screen=SDL_SetVideoMode(640, 480, 8, SDL_HWPALETTE);
+        if(!screen){
+          printf("Couldn't set video mode: %s\n", SDL_GetError());
+          exit(-1);
+        }
+
+        /* Set palette */
+        SDL_SetPalette(screen, SDL_LOGPAL|SDL_PHYSPAL, colors, 0, 256);
+        .
+        .
+        .
+        .

PrevHomeNext
SDL_SetColorsUpSDL_SetGamma
\ No newline at end of file diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlsettimer.html b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlsettimer.html new file mode 100644 index 000000000..40b737ce8 --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlsettimer.html @@ -0,0 +1,267 @@ +SDL_SetTimer
SDL Library Documentation
Prev 

SDL_SetTimer

Name

SDL_SetTimer -- Set a callback to run after the specified number of milliseconds has +elapsed.

Synopsis

#include "SDL.h"

int SDL_SetTimer(Uint32 interval, SDL_TimerCallback callback);

Callback

/* Function prototype for the timer callback function */ +typedef Uint32 (*SDL_TimerCallback)(Uint32 interval);

Description

Set a callback to run after the specified number of milliseconds has +elapsed. The callback function is passed the current timer interval +and returns the next timer interval. If the returned value is the +same as the one passed in, the periodic alarm continues, otherwise a +new alarm is scheduled.

To cancel a currently running timer, call +SDL_SetTimer(0, NULL);

The timer callback function may run in a different thread than your +main constant, and so shouldn't call any functions from within itself.

The maximum resolution of this timer is 10 ms, which means that if +you request a 16 ms timer, your callback will run approximately 20 ms +later on an unloaded system. If you wanted to set a flag signaling +a frame update at 30 frames per second (every 33 ms), you might set a +timer for 30 ms (see example below).

If you use this function, you need to pass SDL_INIT_TIMER +to SDL_Init().

Note: This function is kept for compatibility but has been superseded +by the new timer functions +SDL_AddTimer and +SDL_RemoveTimer which support +multiple timers.

Examples

SDL_SetTimer((33/10)*10, my_callback);

See Also

SDL_AddTimer


PrevHome 
SDL_RemoveTimerUp 
\ No newline at end of file diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlsetvideomode.html b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlsetvideomode.html new file mode 100644 index 000000000..8b309b048 --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlsetvideomode.html @@ -0,0 +1,558 @@ +SDL_SetVideoMode
SDL Library Documentation
PrevNext

SDL_SetVideoMode

Name

SDL_SetVideoMode -- Set up a video mode with the specified width, height and bits-per-pixel.

Synopsis

#include "SDL.h"

SDL_Surface *SDL_SetVideoMode(int width, int height, int bpp, Uint32 flags);

Description

Set up a video mode with the specified width, height and bits-per-pixel.

If bpp is 0, it is treated as the +current display bits per pixel.

The flags parameter is the same as the flags field of the SDL_Surface structure. OR'd combinations of the following values are valid.

SDL_SWSURFACECreate the video surface in system memory
SDL_HWSURFACECreate the video surface in video memory
SDL_ASYNCBLITEnables the use of asynchronous updates of the display surface. This will +usually slow down blitting on single CPU machines, but may provide a speed +increase on SMP systems.
SDL_ANYFORMATNormally, if a video surface of the requested bits-per-pixel (bpp) is not available, SDL will emulate one with a shadow surface. Passing SDL_ANYFORMAT prevents this and causes SDL to use the video surface, regardless of its pixel depth.
SDL_HWPALETTEGive SDL exclusive palette access. Without this flag you may not always get the the colors you request with SDL_SetColors or SDL_SetPalette.
SDL_DOUBLEBUFEnable hardware double buffering; only valid with SDL_HWSURFACE. Calling +SDL_Flip will flip the +buffers and update the screen. All drawing will take place on the surface +that is not displayed at the moment. If double buffering could not be enabled +then SDL_Flip will just perform a +SDL_UpdateRect +on the entire screen.
SDL_FULLSCREENSDL will attempt to use a fullscreen mode. If a hardware resolution change is +not possible (for whatever reason), the next higher resolution will be used and +the display window centered on a black background.
SDL_OPENGLCreate an OpenGL rendering context. You should have previously set OpenGL video attributes with SDL_GL_SetAttribute.
SDL_OPENGLBLITCreate an OpenGL rendering context, like above, but allow normal blitting +operations. The screen (2D) surface may have an alpha channel, and +SDL_UpdateRects +must be used for updating changes to the screen surface. NOTE: This option +is kept for compatibility only, and is not recommended for +new code.
SDL_RESIZABLECreate a resizable window. When the window is resized by the user a SDL_VIDEORESIZE event is generated and SDL_SetVideoMode can be called again with the new size.
SDL_NOFRAMEIf possible, SDL_NOFRAME causes SDL to create a window with no title bar or frame decoration. Fullscreen modes automatically have this flag set.

Note: Whatever flags SDL_SetVideoMode could satisfy are set in the flags member of the returned surface.

Note: The bpp parameter is the number of bits per pixel, +so a bpp of 24 uses the packed representation of +3 bytes/pixel. For the more common 4 bytes/pixel mode, use a +bpp of 32. Somewhat oddly, both 15 and 16 will +request a 2 bytes/pixel mode, but different pixel formats.

Return Value

The framebuffer surface, or NULL if it fails. +The surface returned is freed by SDL_Quit() and should nt be freed by +the caller.


PrevHomeNext
SDL_VideoModeOKUpSDL_UpdateRect
\ No newline at end of file diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlshowcursor.html b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlshowcursor.html new file mode 100644 index 000000000..5a8f19da2 --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlshowcursor.html @@ -0,0 +1,239 @@ +SDL_ShowCursor
SDL Library Documentation
PrevNext

SDL_ShowCursor

Name

SDL_ShowCursor -- Toggle whether or not the cursor is shown on the screen.

Synopsis

#include "SDL.h"

int SDL_ShowCursor(int toggle);

Description

Toggle whether or not the cursor is shown on the screen. Passing SDL_ENABLE displays the cursor and passing SDL_DISABLE hides it. The current state of the mouse cursor can be queried by passing SDL_QUERY, either SDL_DISABLE or SDL_ENABLE will be returned.

The cursor starts off displayed, but can be turned off.

Return Value

Returns the current state of the cursor.


PrevHomeNext
SDL_GetCursorUpSDL_GL_LoadLibrary
\ No newline at end of file diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlsurface.html b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlsurface.html new file mode 100644 index 000000000..fda55f173 --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlsurface.html @@ -0,0 +1,597 @@ +SDL_Surface
SDL Library Documentation
PrevNext

SDL_Surface

Name

SDL_Surface -- Graphical Surface Structure

Structure Definition

typedef struct SDL_Surface {
+        Uint32 flags;                           /* Read-only */
+        SDL_PixelFormat *format;                /* Read-only */
+        int w, h;                               /* Read-only */
+        Uint16 pitch;                           /* Read-only */
+        void *pixels;                           /* Read-write */
+
+        /* clipping information */
+        SDL_Rect clip_rect;                     /* Read-only */
+
+        /* Reference count -- used when freeing surface */
+        int refcount;                           /* Read-mostly */
+
+	/* This structure also contains private fields not shown here */
+} SDL_Surface;

Structure Data

flagsSurface flags
formatPixel format
w, hWidth and height of the surface
pitchLength of a surface scanline in bytes
pixelsPointer to the actual pixel data
clip_rectsurface clip rectangle

Description

SDL_Surface's represent areas of "graphical" +memory, memory that can be drawn to. The video framebuffer is returned +as a SDL_Surface by +SDL_SetVideoMode +and SDL_GetVideoSurface. +Most of the fields should be pretty obvious. +w and h are the +width and height of the surface in pixels. +pixels is a pointer to the actual pixel data, +the surface should be locked +before accessing this field. The clip_rect field +is the clipping rectangle as set by +SDL_SetClipRect.

The following are supported in the +flags field.

SDL_SWSURFACESurface is stored in system memory
SDL_HWSURFACESurface is stored in video memory
SDL_ASYNCBLITSurface uses asynchronous blits if possible
SDL_ANYFORMATAllows any pixel-format (Display surface)
SDL_HWPALETTESurface has exclusive palette
SDL_DOUBLEBUFSurface is double buffered (Display surface)
SDL_FULLSCREENSurface is full screen (Display Surface)
SDL_OPENGLSurface has an OpenGL context (Display Surface)
SDL_OPENGLBLITSurface supports OpenGL blitting (Display Surface)
SDL_RESIZABLESurface is resizable (Display Surface)
SDL_HWACCELSurface blit uses hardware acceleration
SDL_SRCCOLORKEYSurface use colorkey blitting
SDL_RLEACCELColorkey blitting is accelerated with RLE
SDL_SRCALPHASurface blit uses alpha blending
SDL_PREALLOCSurface uses preallocated memory


PrevHomeNext
SDL_PixelFormatUpSDL_VideoInfo
\ No newline at end of file diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlsyswmevent.html b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlsyswmevent.html new file mode 100644 index 000000000..fd7180ee2 --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlsyswmevent.html @@ -0,0 +1,233 @@ +SDL_SysWMEvent
SDL Library Documentation
PrevNext

SDL_SysWMEvent

Name

SDL_SysWMEvent -- Platform-dependent window manager event.

Description

The system window manager event contains a pointer to system-specific +information about unknown window manager events. If you enable this event +using +SDL_EventState(), +it will be generated whenever unhandled events are received from the window +manager. This can be used, for example, to implement cut-and-paste in your +application. + +

typedef struct {
+         Uint8 type;   /* Always SDL_SYSWMEVENT */
+         SDL_SysWMmsg *msg;
+ } SDL_SysWMEvent;
+ +If you want to obtain system-specific information about the window manager, +you can fill the version member of a SDL_SysWMinfo +structure (details can be found in SDL_syswm.h, which must be included) using the SDL_VERSION() macro found in +SDL_version.h, and pass it to the +function: +

int SDL_GetWMInfo(SDL_SysWMinfo *info);


PrevHomeNext
SDL_ExposeEventUpSDL_UserEvent
\ No newline at end of file diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlthreadid.html b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlthreadid.html new file mode 100644 index 000000000..e0bde2e2a --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlthreadid.html @@ -0,0 +1,190 @@ +SDL_ThreadID
SDL Library Documentation
PrevNext

SDL_ThreadID

Name

SDL_ThreadID -- Get the 32-bit thread identifier for the current thread.

Synopsis

#include "SDL.h"
+#include "SDL_thread.h"

Uint32 SDL_ThreadID(void);

Description

Get the 32-bit thread identifier for the current thread.


PrevHomeNext
SDL_CreateThreadUpSDL_GetThreadID
\ No newline at end of file diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlunlockaudio.html b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlunlockaudio.html new file mode 100644 index 000000000..0019bd692 --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlunlockaudio.html @@ -0,0 +1,211 @@ +SDL_UnlockAudio
SDL Library Documentation
PrevNext

SDL_UnlockAudio

Name

SDL_UnlockAudio -- Unlock the callback function

Synopsis

#include "SDL.h"

void SDL_UnlockAudio(void);

Description

Unlocks a previous SDL_LockAudio call.


PrevHomeNext
SDL_LockAudioUpSDL_CloseAudio
\ No newline at end of file diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlunlocksurface.html b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlunlocksurface.html new file mode 100644 index 000000000..13ba5fc8e --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlunlocksurface.html @@ -0,0 +1,219 @@ +SDL_UnlockSurface
SDL Library Documentation
PrevNext

SDL_UnlockSurface

Name

SDL_UnlockSurface -- Unlocks a previously locked surface.

Synopsis

#include "SDL.h"

void SDL_UnlockSurface(SDL_Surface *surface);

Description

Surfaces that were previously locked using SDL_LockSurface must be unlocked with SDL_UnlockSurface. Surfaces should be unlocked as soon as possible.

It should be noted that since 1.1.8, surface locks are recursive. See SDL_LockSurface.


PrevHomeNext
SDL_LockSurfaceUpSDL_LoadBMP
\ No newline at end of file diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlunlockyuvoverlay.html b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlunlockyuvoverlay.html new file mode 100644 index 000000000..936ed9eaf --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlunlockyuvoverlay.html @@ -0,0 +1,225 @@ +SDL_UnlockYUVOverlay
SDL Library Documentation
PrevNext

SDL_UnlockYUVOverlay

Name

SDL_UnlockYUVOverlay -- Unlock an overlay

Synopsis

#include "SDL.h"

void SDL_UnlockYUVOverlay(SDL_Overlay *overlay);

Description

The opposite to SDL_LockYUVOverlay. Unlocks a previously locked overlay. An overlay must be unlocked before it can be displayed.


PrevHomeNext
SDL_LockYUVOverlayUpSDL_DisplayYUVOverlay
\ No newline at end of file diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlupdaterect.html b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlupdaterect.html new file mode 100644 index 000000000..f54d9f5e2 --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlupdaterect.html @@ -0,0 +1,266 @@ +SDL_UpdateRect
SDL Library Documentation
PrevNext

SDL_UpdateRect

Name

SDL_UpdateRect -- Makes sure the given area is updated on the given screen.

Synopsis

#include "SDL.h"

void SDL_UpdateRect(SDL_Surface *screen, Sint32 x, Sint32 y, Sint32 w, Sint32 h);

Description

Makes sure the given area is updated on the given screen. The rectangle must +be confined within the screen boundaries (no clipping is done).

If 'x', 'y', 'w' +and 'h' are all 0, +SDL_UpdateRect will update the +entire screen.

This function should not be called while 'screen' is +locked.


PrevHomeNext
SDL_SetVideoModeUpSDL_UpdateRects
\ No newline at end of file diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlupdaterects.html b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlupdaterects.html new file mode 100644 index 000000000..0553a7a9d --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlupdaterects.html @@ -0,0 +1,255 @@ +SDL_UpdateRects
SDL Library Documentation
PrevNext

SDL_UpdateRects

Name

SDL_UpdateRects -- Makes sure the given list of rectangles is updated on the given screen.

Synopsis

#include "SDL.h"

void SDL_UpdateRects(SDL_Surface *screen, int numrects, SDL_Rect *rects);

Description

Makes sure the given list of rectangles is updated on the given screen. +The rectangles must all be confined within the screen boundaries (no +clipping is done).

This function should not be called while screen is +locked.

Note: It is adviced to call this function only once per frame, since each +call has some processing overhead. This is no restriction since you +can pass any number of rectangles each time.

The rectangles are not automatically merged or checked for overlap. In +general, the programmer can use his knowledge about his particular +rectangles to merge them in an efficient way, to avoid overdraw.


PrevHomeNext
SDL_UpdateRectUpSDL_Flip
\ No newline at end of file diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdluserevent.html b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdluserevent.html new file mode 100644 index 000000000..178769c51 --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdluserevent.html @@ -0,0 +1,337 @@ +SDL_UserEvent
SDL Library Documentation
PrevNext

SDL_UserEvent

Name

SDL_UserEvent -- A user-defined event type

Structure Definition

typedef struct{
+  Uint8 type;
+  int code;
+  void *data1;
+  void *data2;
+} SDL_UserEvent;

Structure Data

typeSDL_USEREVENT through to SDL_NUMEVENTS-1
codeUser defined event code
data1User defined data pointer
data2User defined data pointer

Description

SDL_UserEvent is in the user member of the structure SDL_Event. This event is unique, it is never created by SDL but only by the user. The event can be pushed onto the event queue using SDL_PushEvent. The contents of the structure members or completely up to the programmer, the only requirement is that type is a value from SDL_USEREVENT to SDL_NUMEVENTS-1 (inclusive).

Examples

SDL_Event event;
+
+event.type = SDL_USEREVENT;
+event.user.code = my_event_code;
+event.user.data1 = significant_data;
+event.user.data2 = 0;
+SDL_PushEvent(&event);


PrevHomeNext
SDL_SysWMEventUpSDL_QuitEvent
\ No newline at end of file diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlvideodrivername.html b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlvideodrivername.html new file mode 100644 index 000000000..141965623 --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlvideodrivername.html @@ -0,0 +1,243 @@ +SDL_VideoDriverName
SDL Library Documentation
PrevNext

SDL_VideoDriverName

Name

SDL_VideoDriverName -- Obtain the name of the video driver

Synopsis

#include "SDL.h"

char *SDL_VideoDriverName(char *namebuf, int maxlen);

Description

The buffer pointed to by namebuf is filled up to a maximum of maxlen characters (include the NULL terminator) with the name of the initialised video driver. The driver name is a simple one word identifier like "x11" or "windib".

Return Value

Returns NULL if video has not been initialised with SDL_Init or a pointer to namebuf otherwise.


PrevHomeNext
SDL_GetVideoInfoUpSDL_ListModes
\ No newline at end of file diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlvideoinfo.html b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlvideoinfo.html new file mode 100644 index 000000000..3a0da31da --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlvideoinfo.html @@ -0,0 +1,408 @@ +SDL_VideoInfo
SDL Library Documentation
PrevNext

SDL_VideoInfo

Name

SDL_VideoInfo -- Video Target information

Structure Definition

typedef struct{
+  Uint32 hw_available:1;
+  Uint32 wm_available:1;
+  Uint32 blit_hw:1;
+  Uint32 blit_hw_CC:1;
+  Uint32 blit_hw_A:1;
+  Uint32 blit_sw:1;
+  Uint32 blit_sw_CC:1;
+  Uint32 blit_sw_A:1;
+  Uint32 blit_fill;
+  Uint32 video_mem;
+  SDL_PixelFormat *vfmt;
+} SDL_VideoInfo;

Structure Data

hw_availableIs it possible to create hardware surfaces?
wm_availableIs there a window manager available
blit_hwAre hardware to hardware blits accelerated?
blit_hw_CCAre hardware to hardware colorkey blits accelerated?
blit_hw_AAre hardware to hardware alpha blits accelerated?
blit_swAre software to hardware blits accelerated?
blit_sw_CCAre software to hardware colorkey blits accelerated?
blit_sw_AAre software to hardware alpha blits accelerated?
blit_fillAre color fills accelerated?
video_memTotal amount of video memory in Kilobytes
vfmtPixel format of the video device

Description

This (read-only) structure is returned by SDL_GetVideoInfo. It contains information on either the 'best' available mode (if called before SDL_SetVideoMode) or the current video mode.


PrevHomeNext
SDL_SurfaceUpSDL_Overlay
\ No newline at end of file diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlvideomodeok.html b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlvideomodeok.html new file mode 100644 index 000000000..5d2d6c4eb --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlvideomodeok.html @@ -0,0 +1,270 @@ +SDL_VideoModeOK
SDL Library Documentation
PrevNext

SDL_VideoModeOK

Name

SDL_VideoModeOK -- Check to see if a particular video mode is supported.

Synopsis

#include "SDL.h"

int SDL_VideoModeOK(int width, int height, int bpp, Uint32 flags);

Description

SDL_VideoModeOK returns 0 +if the requested mode is not supported under any bit depth, or returns the +bits-per-pixel of the closest available mode with the given width, height and requested surface flags (see SDL_SetVideoMode).

The bits-per-pixel value returned is only a suggested mode. You can usually request and bpp you want when setting the video mode and SDL will emulate that color depth with a shadow video surface.

The arguments to SDL_VideoModeOK are the same ones you +would pass to SDL_SetVideoMode

Example

SDL_Surface *screen;
+Uint32 bpp;
+.
+.
+.
+printf("Checking mode 640x480@16bpp.\n");
+bpp=SDL_VideoModeOK(640, 480, 16, SDL_HWSURFACE);
+
+if(!bpp){
+  printf("Mode not available.\n");
+  exit(-1);
+}
+
+printf("SDL Recommends 640x480@%dbpp.\n", bpp);
+screen=SDL_SetVideoMode(640, 480, bpp, SDL_HWSURFACE);
+.
+.

PrevHomeNext
SDL_ListModesUpSDL_SetVideoMode
\ No newline at end of file diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlwaitevent.html b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlwaitevent.html new file mode 100644 index 000000000..b473d3b06 --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlwaitevent.html @@ -0,0 +1,231 @@ +SDL_WaitEvent
SDL Library Documentation
PrevNext

SDL_WaitEvent

Name

SDL_WaitEvent -- Waits indefinitely for the next available event.

Synopsis

#include "SDL.h"

int SDL_WaitEvent(SDL_Event *event);

Description

Waits indefinitely for the next available event, returning +1, or 0 if there was +an error while waiting for events.

If event is not NULL, the next +event is removed from the queue and stored in that area.


PrevHomeNext
SDL_PollEventUpSDL_PushEvent
\ No newline at end of file diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlwaitthread.html b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlwaitthread.html new file mode 100644 index 000000000..2becfbc47 --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlwaitthread.html @@ -0,0 +1,231 @@ +SDL_WaitThread
SDL Library Documentation
PrevNext

SDL_WaitThread

Name

SDL_WaitThread -- Wait for a thread to finish.

Synopsis

#include "SDL.h"
+#include "SDL_thread.h"

void SDL_WaitThread(SDL_Thread *thread, int *status);

Description

Wait for a thread to finish (timeouts are not supported).

Return Value

The return code for the thread function is placed in the area pointed to by +status, if status is not +NULL.


PrevHomeNext
SDL_GetThreadIDUpSDL_KillThread
\ No newline at end of file diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlwarpmouse.html b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlwarpmouse.html new file mode 100644 index 000000000..e7b2d8d79 --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlwarpmouse.html @@ -0,0 +1,205 @@ +SDL_WarpMouse
SDL Library Documentation
PrevNext

SDL_WarpMouse

Name

SDL_WarpMouse -- Set the position of the mouse cursor.

Synopsis

#include "SDL.h"

void SDL_WarpMouse(Uint16 x, Uint16 y);

Description

Set the position of the mouse cursor (generates a mouse motion event).


PrevHomeNext
SDL_DisplayFormatAlphaUpSDL_CreateCursor
\ No newline at end of file diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlwasinit.html b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlwasinit.html new file mode 100644 index 000000000..b4effeb68 --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlwasinit.html @@ -0,0 +1,284 @@ +SDL_WasInit
SDL Library Documentation
PrevNext

SDL_WasInit

Name

SDL_WasInit -- Check which subsystems are initialized

Synopsis

#include "SDL.h"

Uint32 SDL_WasInit(Uint32 flags);

Description

SDL_WasInit allows you to see which SDL subsytems have been initialized. flags is a bitwise OR'd combination of the subsystems you wish to check (see SDL_Init for a list of subsystem flags).

Return Value

SDL_WasInit returns a bitwised OR'd combination of the initialized subsystems.

Examples


/* Here are several ways you can use SDL_WasInit() */
+
+/* Get init data on all the subsystems */
+Uint32 subsystem_init;
+
+subsystem_init=SDL_WasInit(SDL_INIT_EVERYTHING);
+
+if(subsystem_init&SDL_INIT_VIDEO)
+  printf("Video is initialized.\n");
+else
+  printf("Video is not initialized.\n");
+
+
+
+/* Just check for one specfic subsystem */
+
+if(SDL_WasInit(SDL_INIT_VIDEO)!=0)
+  printf("Video is initialized.\n");
+else
+  printf("Video is not initialized.\n");
+
+
+
+
+/* Check for two subsystems */
+
+Uint32 subsystem_mask=SDL_INIT_VIDEO|SDL_INIT_AUDIO;
+
+if(SDL_WasInit(subsystem_mask)==subsystem_mask)
+  printf("Video and Audio initialized.\n");
+else
+  printf("Video and Audio not initialized.\n");

PrevHomeNext
SDL_QuitUpSDL_GetError
\ No newline at end of file diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlwmgetcaption.html b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlwmgetcaption.html new file mode 100644 index 000000000..829c68aaa --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlwmgetcaption.html @@ -0,0 +1,222 @@ +SDL_WM_GetCaption
SDL Library Documentation
PrevNext

SDL_WM_GetCaption

Name

SDL_WM_GetCaption -- Gets the window title and icon name.

Synopsis

#include "SDL.h"

void SDL_WM_GetCaption(char **title, char **icon);

Description

Set pointers to the window title and icon name.


PrevHomeNext
SDL_WM_SetCaptionUpSDL_WM_SetIcon
\ No newline at end of file diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlwmgrabinput.html b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlwmgrabinput.html new file mode 100644 index 000000000..740dcd6b2 --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlwmgrabinput.html @@ -0,0 +1,224 @@ +SDL_WM_GrabInput
SDL Library Documentation
PrevNext

SDL_WM_GrabInput

Name

SDL_WM_GrabInput -- Grabs mouse and keyboard input.

Synopsis

#include "SDL.h"

SDL_GrabMode SDL_WM_GrabInput(SDL_GrabMode mode);

Description

Grabbing means that the mouse is confined to the application window, +and nearly all keyboard input is passed directly to the application, +and not interpreted by a window manager, if any.

When mode is SDL_GRAB_QUERY the grab mode is not changed, but the current grab mode is returned.

typedef enum {
+  SDL_GRAB_QUERY,
+  SDL_GRAB_OFF,
+  SDL_GRAB_ON
+} SDL_GrabMode;
+

Return Value

The current/new SDL_GrabMode.


PrevHomeNext
SDL_WM_ToggleFullScreenUpEvents
\ No newline at end of file diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlwmiconifywindow.html b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlwmiconifywindow.html new file mode 100644 index 000000000..111365686 --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlwmiconifywindow.html @@ -0,0 +1,211 @@ +SDL_WM_IconifyWindow
SDL Library Documentation
PrevNext

SDL_WM_IconifyWindow

Name

SDL_WM_IconifyWindow -- Iconify/Minimise the window

Synopsis

#include "SDL.h"

int SDL_WM_IconifyWindow(void);

Description

If the application is running in a window managed environment SDL attempts to iconify/minimise it. If SDL_WM_IconifyWindow is successful, the application will receive a SDL_APPACTIVE loss event.

Return Value

Returns non-zero on success or 0 if iconification is not support or was refused by the window manager.


PrevHomeNext
SDL_WM_SetIconUpSDL_WM_ToggleFullScreen
\ No newline at end of file diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlwmsetcaption.html b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlwmsetcaption.html new file mode 100644 index 000000000..bc47c278b --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlwmsetcaption.html @@ -0,0 +1,212 @@ +SDL_WM_SetCaption
SDL Library Documentation
PrevNext

SDL_WM_SetCaption

Name

SDL_WM_SetCaption -- Sets the window tile and icon name.

Synopsis

#include "SDL.h"

void SDL_WM_SetCaption(const char *title, const char *icon);

Description

Sets the title-bar and icon name of the display window.


PrevHomeNext
Window ManagementUpSDL_WM_GetCaption
\ No newline at end of file diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlwmseticon.html b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlwmseticon.html new file mode 100644 index 000000000..12eb207c6 --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlwmseticon.html @@ -0,0 +1,260 @@ +SDL_WM_SetIcon
SDL Library Documentation
PrevNext

SDL_WM_SetIcon

Name

SDL_WM_SetIcon -- Sets the icon for the display window.

Synopsis

#include "SDL.h"

void SDL_WM_SetIcon(SDL_Surface *icon, Uint8 *mask);

Description

Sets the icon for the display window. Win32 icons must be 32x32.

This function must be called before the first call to +SDL_SetVideoMode.

The mask is a bitmask that describes the shape of the +icon. If mask is NULL, then the shape is determined by +the colorkey of icon, if any, or makes the icon +rectangular (no transparency) otherwise.

If mask is non-NULL, it points to a bitmap with bits set +where the corresponding pixel should be visible. The format of the bitmap is as +follows: Scanlines come in the usual top-down order. Each scanline consists of +(width / 8) bytes, rounded up. The most significant bit of each byte represents +the leftmost pixel.

Example

SDL_WM_SetIcon(SDL_LoadBMP("icon.bmp"), NULL);

PrevHomeNext
SDL_WM_GetCaptionUpSDL_WM_IconifyWindow
\ No newline at end of file diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlwmtogglefullscreen.html b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlwmtogglefullscreen.html new file mode 100644 index 000000000..b7973de55 --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/sdlwmtogglefullscreen.html @@ -0,0 +1,205 @@ +SDL_WM_ToggleFullScreen
SDL Library Documentation
PrevNext

SDL_WM_ToggleFullScreen

Name

SDL_WM_ToggleFullScreen -- Toggles fullscreen mode

Synopsis

#include "SDL.h"

int SDL_WM_ToggleFullScreen(SDL_Surface *surface);

Description

Toggles the application between windowed and fullscreen mode, if supported. (X11 is the only target currently supported, BeOS support is experimental).

Return Value

Returns 0 on failure or 1 on success.


PrevHomeNext
SDL_WM_IconifyWindowUpSDL_WM_GrabInput
\ No newline at end of file diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/thread.html b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/thread.html new file mode 100644 index 000000000..c66018eff --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/thread.html @@ -0,0 +1,313 @@ +Multi-threaded Programming
SDL Library Documentation
PrevNext

Chapter 12. Multi-threaded Programming

Table of Contents
SDL_CreateThread -- Creates a new thread of execution that shares its parent's properties.
SDL_ThreadID -- Get the 32-bit thread identifier for the current thread.
SDL_GetThreadID -- Get the SDL thread ID of a SDL_Thread
SDL_WaitThread -- Wait for a thread to finish.
SDL_KillThread -- Gracelessly terminates the thread.
SDL_CreateMutex -- Create a mutex
SDL_DestroyMutex -- Destroy a mutex
SDL_mutexP -- Lock a mutex
SDL_mutexV -- Unlock a mutex
SDL_CreateSemaphore -- Creates a new semaphore and assigns an initial value to it.
SDL_DestroySemaphore -- Destroys a semaphore that was created by SDL_CreateSemaphore.
SDL_SemWait -- Lock a semaphore and suspend the thread if the semaphore value is zero.
SDL_SemTryWait -- Attempt to lock a semaphore but don't suspend the thread.
SDL_SemWaitTimeout -- Lock a semaphore, but only wait up to a specified maximum time.
SDL_SemPost -- Unlock a semaphore.
SDL_SemValue -- Return the current value of a semaphore.
SDL_CreateCond -- Create a condition variable
SDL_DestroyCond -- Destroy a condition variable
SDL_CondSignal -- Restart a thread wait on a condition variable
SDL_CondBroadcast -- Restart all threads waiting on a condition variable
SDL_CondWait -- Wait on a condition variable
SDL_CondWaitTimeout -- Wait on a condition variable, with timeout

SDL provides functions for creating threads, mutexes, semphores and condition variables.

In general, you must be very aware of concurrency and data integrity issues +when writing multi-threaded programs. Some good guidelines include: +

  • Don't call SDL video/event functions from separate threads

  • Don't use any library functions in separate threads

  • Don't perform any memory management in separate threads

  • Lock global variables which may be accessed by multiple threads

  • Never terminate threads, always set a flag and wait for them to quit

  • Think very carefully about all possible ways your code may interact

Note: SDL's threading is not implemented on MacOS, due to that lack of preemptive thread support (Mac OS X dos nt suffer from this problem)


PrevHomeNext
SDL_CDtrackUpSDL_CreateThread
\ No newline at end of file diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/time.html b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/time.html new file mode 100644 index 000000000..854b7cb57 --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/time.html @@ -0,0 +1,206 @@ +Time
SDL Library Documentation
PrevNext

Chapter 13. Time

Table of Contents
SDL_GetTicks -- Get the number of milliseconds since the SDL library initialization.
SDL_Delay -- Wait a specified number of milliseconds before returning.
SDL_AddTimer -- Add a timer which will call a callback after the specified number of milliseconds has +elapsed.
SDL_RemoveTimer -- Remove a timer which was added with +SDL_AddTimer.
SDL_SetTimer -- Set a callback to run after the specified number of milliseconds has +elapsed.

SDL provides several cross-platform functions for dealing with time. +It provides a way to get the current time, a way to wait a little while, +and a simple timer mechanism. These functions give you two ways of moving an +object every x milliseconds: + +

  • Use a timer callback function. This may have the bad effect that it runs in a seperate thread or uses alarm signals, but it's easier to implement.

  • Or you can get the number of milliseconds passed, and move the object if, for example, 30 ms passed.


PrevHomeNext
SDL_CondWaitTimeoutUpSDL_GetTicks
\ No newline at end of file diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/video.html b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/video.html new file mode 100644 index 000000000..9b1434e62 --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/video.html @@ -0,0 +1,507 @@ +Video
SDL Library Documentation
PrevNext

Chapter 6. Video

Table of Contents
SDL_GetVideoSurface -- returns a pointer to the current display surface
SDL_GetVideoInfo -- returns a pointer to information about the video hardware
SDL_VideoDriverName -- Obtain the name of the video driver
SDL_ListModes -- Returns a pointer to an array of available screen dimensions for +the given format and video flags
SDL_VideoModeOK -- Check to see if a particular video mode is supported.
SDL_SetVideoMode -- Set up a video mode with the specified width, height and bits-per-pixel.
SDL_UpdateRect -- Makes sure the given area is updated on the given screen.
SDL_UpdateRects -- Makes sure the given list of rectangles is updated on the given screen.
SDL_Flip -- Swaps screen buffers
SDL_SetColors -- Sets a portion of the colormap for the given 8-bit surface.
SDL_SetPalette -- Sets the colors in the palette of an 8-bit surface.
SDL_SetGamma -- Sets the color gamma function for the display
SDL_GetGammaRamp -- Gets the color gamma lookup tables for the display
SDL_SetGammaRamp -- Sets the color gamma lookup tables for the display
SDL_MapRGB -- Map a RGB color value to a pixel format.
SDL_MapRGBA -- Map a RGBA color value to a pixel format.
SDL_GetRGB -- Get RGB values from a pixel in the specified pixel format.
SDL_GetRGBA -- Get RGBA values from a pixel in the specified pixel format.
SDL_CreateRGBSurface -- Create an empty SDL_Surface
SDL_CreateRGBSurfaceFrom -- Create an SDL_Surface from pixel data
SDL_FreeSurface -- Frees (deletes) a SDL_Surface
SDL_LockSurface -- Lock a surface for directly access.
SDL_UnlockSurface -- Unlocks a previously locked surface.
SDL_LoadBMP -- Load a Windows BMP file into an SDL_Surface.
SDL_SaveBMP -- Save an SDL_Surface as a Windows BMP file.
SDL_SetColorKey -- Sets the color key (transparent pixel) in a blittable surface and +RLE acceleration.
SDL_SetAlpha -- Adjust the alpha properties of a surface
SDL_SetClipRect -- Sets the clipping rectangle for a surface.
SDL_GetClipRect -- Gets the clipping rectangle for a surface.
SDL_ConvertSurface -- Converts a surface to the same format as another surface.
SDL_BlitSurface -- This performs a fast blit from the source surface to the destination surface.
SDL_FillRect -- This function performs a fast fill of the given rectangle with some color
SDL_DisplayFormat -- Convert a surface to the display format
SDL_DisplayFormatAlpha -- Convert a surface to the display format
SDL_WarpMouse -- Set the position of the mouse cursor.
SDL_CreateCursor -- Creates a new mouse cursor.
SDL_FreeCursor -- Frees a cursor created with SDL_CreateCursor.
SDL_SetCursor -- Set the currently active mouse cursor.
SDL_GetCursor -- Get the currently active mouse cursor.
SDL_ShowCursor -- Toggle whether or not the cursor is shown on the screen.
SDL_GL_LoadLibrary -- Specify an OpenGL library
SDL_GL_GetProcAddress -- Get the address of a GL function
SDL_GL_GetAttribute -- Get the value of a special SDL/OpenGL attribute
SDL_GL_SetAttribute -- Set a special SDL/OpenGL attribute
SDL_GL_SwapBuffers -- Swap OpenGL framebuffers/Update Display
SDL_CreateYUVOverlay -- Create a YUV video overlay
SDL_LockYUVOverlay -- Lock an overlay
SDL_UnlockYUVOverlay -- Unlock an overlay
SDL_DisplayYUVOverlay -- Blit the overlay to the display
SDL_FreeYUVOverlay -- Free a YUV video overlay
SDL_GLattr -- SDL GL Attributes
SDL_Rect -- Defines a rectangular area
SDL_Color -- Format independent color description
SDL_Palette -- Color palette for 8-bit pixel formats
SDL_PixelFormat -- Stores surface format information
SDL_Surface -- Graphical Surface Structure
SDL_VideoInfo -- Video Target information
SDL_Overlay -- YUV video overlay

SDL presents a very simple interface to the display framebuffer. The +framebuffer is represented as an offscreen surface to which you can write +directly. If you want the screen to show what you have written, call the update function which will +guarantee that the desired portion of the screen is updated.

Before you call any of the SDL video functions, you must first call +SDL_Init(SDL_INIT_VIDEO), which initializes the video +and events in the SDL library. Check the return code, which should be +0, to see if there were any errors in starting up.

If you use both sound and video in your application, you need to call +SDL_Init(SDL_INIT_AUDIO | SDL_INIT_VIDEO) before opening the +sound device, otherwise under Win32 DirectX, you won't be able to set +full-screen display modes.

After you have initialized the library, you can start up the video display in a +number of ways. The easiest way is to pick a common screen resolution and +depth and just initialize the video, checking for errors. You will probably +get what you want, but SDL may be emulating your requested mode and converting +the display on update. The best way is to +query, for the best +video mode closest to the desired one, and then +convert +your images to that pixel format.

SDL currently supports any bit depth >= 8 bits per pixel. 8 bpp formats are +considered 8-bit palettized modes, while 12, 15, 16, 24, and 32 bits per pixel +are considered "packed pixel" modes, meaning each pixel contains the RGB color +components packed in the bits of the pixel.

After you have initialized your video mode, you can take the surface that was +returned, and write to it like any other framebuffer, calling the update +routine as you go.

When you have finished your video access and are ready to quit your +application, you should call "SDL_Quit()" to shutdown the +video and events.


PrevHomeNext
SDL_envvarsUpSDL_GetVideoSurface
\ No newline at end of file diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/wm.html b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/wm.html new file mode 100644 index 000000000..f53a349c1 --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/html/wm.html @@ -0,0 +1,188 @@ +Window Management
SDL Library Documentation
PrevNext

Chapter 7. Window Management

Table of Contents
SDL_WM_SetCaption -- Sets the window tile and icon name.
SDL_WM_GetCaption -- Gets the window title and icon name.
SDL_WM_SetIcon -- Sets the icon for the display window.
SDL_WM_IconifyWindow -- Iconify/Minimise the window
SDL_WM_ToggleFullScreen -- Toggles fullscreen mode
SDL_WM_GrabInput -- Grabs mouse and keyboard input.

SDL provides a small set of window management functions which allow applications to change their title and toggle from windowed mode to fullscreen (if available)


PrevHomeNext
SDL_OverlayUpSDL_WM_SetCaption
\ No newline at end of file diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/images/rainbow.gif b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/images/rainbow.gif new file mode 100644 index 000000000..07eb184f7 Binary files /dev/null and b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/images/rainbow.gif differ diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/index.html b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/index.html new file mode 100644 index 000000000..7d572533e --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/docs/index.html @@ -0,0 +1,55 @@ + + +Simple DirectMedia Layer Introduction + + +
+

Simple DirectMedia Layer Introduction

+

+This library is designed to make it easy to write games that run on many +different platforms using the various native high-performance media interfaces, +(for video, audio, etc) and presenting a single source-code level API to +your application. This is a fairly low level API, but using this, completely +portable applications can be written with a great deal of flexibility. +

+An introduction to SDL can be found online at: + + http://www.libsdl.org/intro.php +

+Tutorials on a variety of topics can be found online at: + + http://www.libsdl.org/tutorials.php +

+Documentation in Wiki form can be found online at: + + http://www.libsdl.org/cgi/docwiki.cgi/ +

+Enjoy! +

+    Sam Lantinga + +

+


+

Table of Contents

+ +
diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/include/SDL.h b/dep/recastnavigation/RecastDemo/Contrib/SDL/include/SDL.h new file mode 100644 index 000000000..119ed7ff1 --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/include/SDL.h @@ -0,0 +1,101 @@ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + Sam Lantinga + slouken@libsdl.org +*/ + +/** @file SDL.h + * Main include header for the SDL library + */ + +#ifndef _SDL_H +#define _SDL_H + +#include "SDL_main.h" +#include "SDL_stdinc.h" +#include "SDL_audio.h" +#include "SDL_cdrom.h" +#include "SDL_cpuinfo.h" +#include "SDL_endian.h" +#include "SDL_error.h" +#include "SDL_events.h" +#include "SDL_loadso.h" +#include "SDL_mutex.h" +#include "SDL_rwops.h" +#include "SDL_thread.h" +#include "SDL_timer.h" +#include "SDL_video.h" +#include "SDL_version.h" + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/** @file SDL.h + * @note As of version 0.5, SDL is loaded dynamically into the application + */ + +/** @name SDL_INIT Flags + * These are the flags which may be passed to SDL_Init() -- you should + * specify the subsystems which you will be using in your application. + */ +/*@{*/ +#define SDL_INIT_TIMER 0x00000001 +#define SDL_INIT_AUDIO 0x00000010 +#define SDL_INIT_VIDEO 0x00000020 +#define SDL_INIT_CDROM 0x00000100 +#define SDL_INIT_JOYSTICK 0x00000200 +#define SDL_INIT_NOPARACHUTE 0x00100000 /**< Don't catch fatal signals */ +#define SDL_INIT_EVENTTHREAD 0x01000000 /**< Not supported on all OS's */ +#define SDL_INIT_EVERYTHING 0x0000FFFF +/*@}*/ + +/** This function loads the SDL dynamically linked library and initializes + * the subsystems specified by 'flags' (and those satisfying dependencies) + * Unless the SDL_INIT_NOPARACHUTE flag is set, it will install cleanup + * signal handlers for some commonly ignored fatal signals (like SIGSEGV) + */ +extern DECLSPEC int SDLCALL SDL_Init(Uint32 flags); + +/** This function initializes specific SDL subsystems */ +extern DECLSPEC int SDLCALL SDL_InitSubSystem(Uint32 flags); + +/** This function cleans up specific SDL subsystems */ +extern DECLSPEC void SDLCALL SDL_QuitSubSystem(Uint32 flags); + +/** This function returns mask of the specified subsystems which have + * been initialized. + * If 'flags' is 0, it returns a mask of all initialized subsystems. + */ +extern DECLSPEC Uint32 SDLCALL SDL_WasInit(Uint32 flags); + +/** This function cleans up all initialized subsystems and unloads the + * dynamically linked library. You should call it upon all exit conditions. + */ +extern DECLSPEC void SDLCALL SDL_Quit(void); + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* _SDL_H */ diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/include/SDL_active.h b/dep/recastnavigation/RecastDemo/Contrib/SDL/include/SDL_active.h new file mode 100644 index 000000000..0ae92f2d5 --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/include/SDL_active.h @@ -0,0 +1,63 @@ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + Sam Lantinga + slouken@libsdl.org +*/ + +/** + * @file SDL_active.h + * Include file for SDL application focus event handling + */ + +#ifndef _SDL_active_h +#define _SDL_active_h + +#include "SDL_stdinc.h" +#include "SDL_error.h" + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/** @name The available application states */ +/*@{*/ +#define SDL_APPMOUSEFOCUS 0x01 /**< The app has mouse coverage */ +#define SDL_APPINPUTFOCUS 0x02 /**< The app has input focus */ +#define SDL_APPACTIVE 0x04 /**< The application is active */ +/*@}*/ + +/* Function prototypes */ +/** + * This function returns the current state of the application, which is a + * bitwise combination of SDL_APPMOUSEFOCUS, SDL_APPINPUTFOCUS, and + * SDL_APPACTIVE. If SDL_APPACTIVE is set, then the user is able to + * see your application, otherwise it has been iconified or disabled. + */ +extern DECLSPEC Uint8 SDLCALL SDL_GetAppState(void); + + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* _SDL_active_h */ diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/include/SDL_audio.h b/dep/recastnavigation/RecastDemo/Contrib/SDL/include/SDL_audio.h new file mode 100644 index 000000000..3a8e7fa8b --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/include/SDL_audio.h @@ -0,0 +1,284 @@ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + Sam Lantinga + slouken@libsdl.org +*/ + +/** + * @file SDL_audio.h + * Access to the raw audio mixing buffer for the SDL library + */ + +#ifndef _SDL_audio_h +#define _SDL_audio_h + +#include "SDL_stdinc.h" +#include "SDL_error.h" +#include "SDL_endian.h" +#include "SDL_mutex.h" +#include "SDL_thread.h" +#include "SDL_rwops.h" + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/** + * When filling in the desired audio spec structure, + * - 'desired->freq' should be the desired audio frequency in samples-per-second. + * - 'desired->format' should be the desired audio format. + * - 'desired->samples' is the desired size of the audio buffer, in samples. + * This number should be a power of two, and may be adjusted by the audio + * driver to a value more suitable for the hardware. Good values seem to + * range between 512 and 8096 inclusive, depending on the application and + * CPU speed. Smaller values yield faster response time, but can lead + * to underflow if the application is doing heavy processing and cannot + * fill the audio buffer in time. A stereo sample consists of both right + * and left channels in LR ordering. + * Note that the number of samples is directly related to time by the + * following formula: ms = (samples*1000)/freq + * - 'desired->size' is the size in bytes of the audio buffer, and is + * calculated by SDL_OpenAudio(). + * - 'desired->silence' is the value used to set the buffer to silence, + * and is calculated by SDL_OpenAudio(). + * - 'desired->callback' should be set to a function that will be called + * when the audio device is ready for more data. It is passed a pointer + * to the audio buffer, and the length in bytes of the audio buffer. + * This function usually runs in a separate thread, and so you should + * protect data structures that it accesses by calling SDL_LockAudio() + * and SDL_UnlockAudio() in your code. + * - 'desired->userdata' is passed as the first parameter to your callback + * function. + * + * @note The calculated values in this structure are calculated by SDL_OpenAudio() + * + */ +typedef struct SDL_AudioSpec { + int freq; /**< DSP frequency -- samples per second */ + Uint16 format; /**< Audio data format */ + Uint8 channels; /**< Number of channels: 1 mono, 2 stereo */ + Uint8 silence; /**< Audio buffer silence value (calculated) */ + Uint16 samples; /**< Audio buffer size in samples (power of 2) */ + Uint16 padding; /**< Necessary for some compile environments */ + Uint32 size; /**< Audio buffer size in bytes (calculated) */ + /** + * This function is called when the audio device needs more data. + * + * @param[out] stream A pointer to the audio data buffer + * @param[in] len The length of the audio buffer in bytes. + * + * Once the callback returns, the buffer will no longer be valid. + * Stereo samples are stored in a LRLRLR ordering. + */ + void (SDLCALL *callback)(void *userdata, Uint8 *stream, int len); + void *userdata; +} SDL_AudioSpec; + +/** + * @name Audio format flags + * defaults to LSB byte order + */ +/*@{*/ +#define AUDIO_U8 0x0008 /**< Unsigned 8-bit samples */ +#define AUDIO_S8 0x8008 /**< Signed 8-bit samples */ +#define AUDIO_U16LSB 0x0010 /**< Unsigned 16-bit samples */ +#define AUDIO_S16LSB 0x8010 /**< Signed 16-bit samples */ +#define AUDIO_U16MSB 0x1010 /**< As above, but big-endian byte order */ +#define AUDIO_S16MSB 0x9010 /**< As above, but big-endian byte order */ +#define AUDIO_U16 AUDIO_U16LSB +#define AUDIO_S16 AUDIO_S16LSB + +/** + * @name Native audio byte ordering + */ +/*@{*/ +#if SDL_BYTEORDER == SDL_LIL_ENDIAN +#define AUDIO_U16SYS AUDIO_U16LSB +#define AUDIO_S16SYS AUDIO_S16LSB +#else +#define AUDIO_U16SYS AUDIO_U16MSB +#define AUDIO_S16SYS AUDIO_S16MSB +#endif +/*@}*/ + +/*@}*/ + + +/** A structure to hold a set of audio conversion filters and buffers */ +typedef struct SDL_AudioCVT { + int needed; /**< Set to 1 if conversion possible */ + Uint16 src_format; /**< Source audio format */ + Uint16 dst_format; /**< Target audio format */ + double rate_incr; /**< Rate conversion increment */ + Uint8 *buf; /**< Buffer to hold entire audio data */ + int len; /**< Length of original audio buffer */ + int len_cvt; /**< Length of converted audio buffer */ + int len_mult; /**< buffer must be len*len_mult big */ + double len_ratio; /**< Given len, final size is len*len_ratio */ + void (SDLCALL *filters[10])(struct SDL_AudioCVT *cvt, Uint16 format); + int filter_index; /**< Current audio conversion function */ +} SDL_AudioCVT; + + +/* Function prototypes */ + +/** + * @name Audio Init and Quit + * These functions are used internally, and should not be used unless you + * have a specific need to specify the audio driver you want to use. + * You should normally use SDL_Init() or SDL_InitSubSystem(). + */ +/*@{*/ +extern DECLSPEC int SDLCALL SDL_AudioInit(const char *driver_name); +extern DECLSPEC void SDLCALL SDL_AudioQuit(void); +/*@}*/ + +/** + * This function fills the given character buffer with the name of the + * current audio driver, and returns a pointer to it if the audio driver has + * been initialized. It returns NULL if no driver has been initialized. + */ +extern DECLSPEC char * SDLCALL SDL_AudioDriverName(char *namebuf, int maxlen); + +/** + * This function opens the audio device with the desired parameters, and + * returns 0 if successful, placing the actual hardware parameters in the + * structure pointed to by 'obtained'. If 'obtained' is NULL, the audio + * data passed to the callback function will be guaranteed to be in the + * requested format, and will be automatically converted to the hardware + * audio format if necessary. This function returns -1 if it failed + * to open the audio device, or couldn't set up the audio thread. + * + * The audio device starts out playing silence when it's opened, and should + * be enabled for playing by calling SDL_PauseAudio(0) when you are ready + * for your audio callback function to be called. Since the audio driver + * may modify the requested size of the audio buffer, you should allocate + * any local mixing buffers after you open the audio device. + * + * @sa SDL_AudioSpec + */ +extern DECLSPEC int SDLCALL SDL_OpenAudio(SDL_AudioSpec *desired, SDL_AudioSpec *obtained); + +typedef enum { + SDL_AUDIO_STOPPED = 0, + SDL_AUDIO_PLAYING, + SDL_AUDIO_PAUSED +} SDL_audiostatus; + +/** Get the current audio state */ +extern DECLSPEC SDL_audiostatus SDLCALL SDL_GetAudioStatus(void); + +/** + * This function pauses and unpauses the audio callback processing. + * It should be called with a parameter of 0 after opening the audio + * device to start playing sound. This is so you can safely initialize + * data for your callback function after opening the audio device. + * Silence will be written to the audio device during the pause. + */ +extern DECLSPEC void SDLCALL SDL_PauseAudio(int pause_on); + +/** + * This function loads a WAVE from the data source, automatically freeing + * that source if 'freesrc' is non-zero. For example, to load a WAVE file, + * you could do: + * @code SDL_LoadWAV_RW(SDL_RWFromFile("sample.wav", "rb"), 1, ...); @endcode + * + * If this function succeeds, it returns the given SDL_AudioSpec, + * filled with the audio data format of the wave data, and sets + * 'audio_buf' to a malloc()'d buffer containing the audio data, + * and sets 'audio_len' to the length of that audio buffer, in bytes. + * You need to free the audio buffer with SDL_FreeWAV() when you are + * done with it. + * + * This function returns NULL and sets the SDL error message if the + * wave file cannot be opened, uses an unknown data format, or is + * corrupt. Currently raw and MS-ADPCM WAVE files are supported. + */ +extern DECLSPEC SDL_AudioSpec * SDLCALL SDL_LoadWAV_RW(SDL_RWops *src, int freesrc, SDL_AudioSpec *spec, Uint8 **audio_buf, Uint32 *audio_len); + +/** Compatibility convenience function -- loads a WAV from a file */ +#define SDL_LoadWAV(file, spec, audio_buf, audio_len) \ + SDL_LoadWAV_RW(SDL_RWFromFile(file, "rb"),1, spec,audio_buf,audio_len) + +/** + * This function frees data previously allocated with SDL_LoadWAV_RW() + */ +extern DECLSPEC void SDLCALL SDL_FreeWAV(Uint8 *audio_buf); + +/** + * This function takes a source format and rate and a destination format + * and rate, and initializes the 'cvt' structure with information needed + * by SDL_ConvertAudio() to convert a buffer of audio data from one format + * to the other. + * + * @return This function returns 0, or -1 if there was an error. + */ +extern DECLSPEC int SDLCALL SDL_BuildAudioCVT(SDL_AudioCVT *cvt, + Uint16 src_format, Uint8 src_channels, int src_rate, + Uint16 dst_format, Uint8 dst_channels, int dst_rate); + +/** + * Once you have initialized the 'cvt' structure using SDL_BuildAudioCVT(), + * created an audio buffer cvt->buf, and filled it with cvt->len bytes of + * audio data in the source format, this function will convert it in-place + * to the desired format. + * The data conversion may expand the size of the audio data, so the buffer + * cvt->buf should be allocated after the cvt structure is initialized by + * SDL_BuildAudioCVT(), and should be cvt->len*cvt->len_mult bytes long. + */ +extern DECLSPEC int SDLCALL SDL_ConvertAudio(SDL_AudioCVT *cvt); + + +#define SDL_MIX_MAXVOLUME 128 +/** + * This takes two audio buffers of the playing audio format and mixes + * them, performing addition, volume adjustment, and overflow clipping. + * The volume ranges from 0 - 128, and should be set to SDL_MIX_MAXVOLUME + * for full audio volume. Note this does not change hardware volume. + * This is provided for convenience -- you can mix your own audio data. + */ +extern DECLSPEC void SDLCALL SDL_MixAudio(Uint8 *dst, const Uint8 *src, Uint32 len, int volume); + +/** + * @name Audio Locks + * The lock manipulated by these functions protects the callback function. + * During a LockAudio/UnlockAudio pair, you can be guaranteed that the + * callback function is not running. Do not call these from the callback + * function or you will cause deadlock. + */ +/*@{*/ +extern DECLSPEC void SDLCALL SDL_LockAudio(void); +extern DECLSPEC void SDLCALL SDL_UnlockAudio(void); +/*@}*/ + +/** + * This function shuts down audio processing and closes the audio device. + */ +extern DECLSPEC void SDLCALL SDL_CloseAudio(void); + + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* _SDL_audio_h */ diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/include/SDL_byteorder.h b/dep/recastnavigation/RecastDemo/Contrib/SDL/include/SDL_byteorder.h new file mode 100644 index 000000000..9b93cd69a --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/include/SDL_byteorder.h @@ -0,0 +1,29 @@ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + Sam Lantinga + slouken@libsdl.org +*/ + +/** + * @file SDL_byteorder.h + * @deprecated Use SDL_endian.h instead + */ + +/* DEPRECATED */ +#include "SDL_endian.h" diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/include/SDL_cdrom.h b/dep/recastnavigation/RecastDemo/Contrib/SDL/include/SDL_cdrom.h new file mode 100644 index 000000000..fff5cfa15 --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/include/SDL_cdrom.h @@ -0,0 +1,202 @@ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + Sam Lantinga + slouken@libsdl.org +*/ + +/** + * @file SDL_cdrom.h + * This is the CD-audio control API for Simple DirectMedia Layer + */ + +#ifndef _SDL_cdrom_h +#define _SDL_cdrom_h + +#include "SDL_stdinc.h" +#include "SDL_error.h" + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @file SDL_cdrom.h + * In order to use these functions, SDL_Init() must have been called + * with the SDL_INIT_CDROM flag. This causes SDL to scan the system + * for CD-ROM drives, and load appropriate drivers. + */ + +/** The maximum number of CD-ROM tracks on a disk */ +#define SDL_MAX_TRACKS 99 + +/** @name Track Types + * The types of CD-ROM track possible + */ +/*@{*/ +#define SDL_AUDIO_TRACK 0x00 +#define SDL_DATA_TRACK 0x04 +/*@}*/ + +/** The possible states which a CD-ROM drive can be in. */ +typedef enum { + CD_TRAYEMPTY, + CD_STOPPED, + CD_PLAYING, + CD_PAUSED, + CD_ERROR = -1 +} CDstatus; + +/** Given a status, returns true if there's a disk in the drive */ +#define CD_INDRIVE(status) ((int)(status) > 0) + +typedef struct SDL_CDtrack { + Uint8 id; /**< Track number */ + Uint8 type; /**< Data or audio track */ + Uint16 unused; + Uint32 length; /**< Length, in frames, of this track */ + Uint32 offset; /**< Offset, in frames, from start of disk */ +} SDL_CDtrack; + +/** This structure is only current as of the last call to SDL_CDStatus() */ +typedef struct SDL_CD { + int id; /**< Private drive identifier */ + CDstatus status; /**< Current drive status */ + + /** The rest of this structure is only valid if there's a CD in drive */ + /*@{*/ + int numtracks; /**< Number of tracks on disk */ + int cur_track; /**< Current track position */ + int cur_frame; /**< Current frame offset within current track */ + SDL_CDtrack track[SDL_MAX_TRACKS+1]; + /*@}*/ +} SDL_CD; + +/** @name Frames / MSF Conversion Functions + * Conversion functions from frames to Minute/Second/Frames and vice versa + */ +/*@{*/ +#define CD_FPS 75 +#define FRAMES_TO_MSF(f, M,S,F) { \ + int value = f; \ + *(F) = value%CD_FPS; \ + value /= CD_FPS; \ + *(S) = value%60; \ + value /= 60; \ + *(M) = value; \ +} +#define MSF_TO_FRAMES(M, S, F) ((M)*60*CD_FPS+(S)*CD_FPS+(F)) +/*@}*/ + +/* CD-audio API functions: */ + +/** + * Returns the number of CD-ROM drives on the system, or -1 if + * SDL_Init() has not been called with the SDL_INIT_CDROM flag. + */ +extern DECLSPEC int SDLCALL SDL_CDNumDrives(void); + +/** + * Returns a human-readable, system-dependent identifier for the CD-ROM. + * Example: + * - "/dev/cdrom" + * - "E:" + * - "/dev/disk/ide/1/master" + */ +extern DECLSPEC const char * SDLCALL SDL_CDName(int drive); + +/** + * Opens a CD-ROM drive for access. It returns a drive handle on success, + * or NULL if the drive was invalid or busy. This newly opened CD-ROM + * becomes the default CD used when other CD functions are passed a NULL + * CD-ROM handle. + * Drives are numbered starting with 0. Drive 0 is the system default CD-ROM. + */ +extern DECLSPEC SDL_CD * SDLCALL SDL_CDOpen(int drive); + +/** + * This function returns the current status of the given drive. + * If the drive has a CD in it, the table of contents of the CD and current + * play position of the CD will be stored in the SDL_CD structure. + */ +extern DECLSPEC CDstatus SDLCALL SDL_CDStatus(SDL_CD *cdrom); + +/** + * Play the given CD starting at 'start_track' and 'start_frame' for 'ntracks' + * tracks and 'nframes' frames. If both 'ntrack' and 'nframe' are 0, play + * until the end of the CD. This function will skip data tracks. + * This function should only be called after calling SDL_CDStatus() to + * get track information about the CD. + * For example: + * @code + * // Play entire CD: + * if ( CD_INDRIVE(SDL_CDStatus(cdrom)) ) + * SDL_CDPlayTracks(cdrom, 0, 0, 0, 0); + * // Play last track: + * if ( CD_INDRIVE(SDL_CDStatus(cdrom)) ) { + * SDL_CDPlayTracks(cdrom, cdrom->numtracks-1, 0, 0, 0); + * } + * // Play first and second track and 10 seconds of third track: + * if ( CD_INDRIVE(SDL_CDStatus(cdrom)) ) + * SDL_CDPlayTracks(cdrom, 0, 0, 2, 10); + * @endcode + * + * @return This function returns 0, or -1 if there was an error. + */ +extern DECLSPEC int SDLCALL SDL_CDPlayTracks(SDL_CD *cdrom, + int start_track, int start_frame, int ntracks, int nframes); + +/** + * Play the given CD starting at 'start' frame for 'length' frames. + * @return It returns 0, or -1 if there was an error. + */ +extern DECLSPEC int SDLCALL SDL_CDPlay(SDL_CD *cdrom, int start, int length); + +/** Pause play + * @return returns 0, or -1 on error + */ +extern DECLSPEC int SDLCALL SDL_CDPause(SDL_CD *cdrom); + +/** Resume play + * @return returns 0, or -1 on error + */ +extern DECLSPEC int SDLCALL SDL_CDResume(SDL_CD *cdrom); + +/** Stop play + * @return returns 0, or -1 on error + */ +extern DECLSPEC int SDLCALL SDL_CDStop(SDL_CD *cdrom); + +/** Eject CD-ROM + * @return returns 0, or -1 on error + */ +extern DECLSPEC int SDLCALL SDL_CDEject(SDL_CD *cdrom); + +/** Closes the handle for the CD-ROM drive */ +extern DECLSPEC void SDLCALL SDL_CDClose(SDL_CD *cdrom); + + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* _SDL_video_h */ diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/include/SDL_config.h b/dep/recastnavigation/RecastDemo/Contrib/SDL/include/SDL_config.h new file mode 100644 index 000000000..a50810169 --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/include/SDL_config.h @@ -0,0 +1,45 @@ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + Sam Lantinga + slouken@libsdl.org +*/ + +#ifndef _SDL_config_h +#define _SDL_config_h + +#include "SDL_platform.h" + +/* Add any platform that doesn't build using the configure system */ +#if defined(__DREAMCAST__) +#include "SDL_config_dreamcast.h" +#elif defined(__MACOS__) +#include "SDL_config_macos.h" +#elif defined(__MACOSX__) +#include "SDL_config_macosx.h" +#elif defined(__SYMBIAN32__) +#include "SDL_config_symbian.h" /* must be before win32! */ +#elif defined(__WIN32__) +#include "SDL_config_win32.h" +#elif defined(__OS2__) +#include "SDL_config_os2.h" +#else +#include "SDL_config_minimal.h" +#endif /* platform config */ + +#endif /* _SDL_config_h */ diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/include/SDL_config_amiga.h b/dep/recastnavigation/RecastDemo/Contrib/SDL/include/SDL_config_amiga.h new file mode 100644 index 000000000..23e086192 --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/include/SDL_config_amiga.h @@ -0,0 +1,80 @@ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2006 Sam Lantinga + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + Sam Lantinga + slouken@libsdl.org +*/ + +#ifndef _SDL_config_amiga_h +#define _SDL_config_amiga_h + +#include "SDL_platform.h" + +/* This is a set of defines to configure the SDL features */ + +#define SDL_HAS_64BIT_TYPE 1 + +/* Useful headers */ +#define HAVE_SYS_TYPES_H 1 +#define HAVE_STDIO_H 1 +#define STDC_HEADERS 1 +#define HAVE_STRING_H 1 +#define HAVE_INTTYPES_H 1 +#define HAVE_SIGNAL_H 1 + +/* C library functions */ +#define HAVE_MALLOC 1 +#define HAVE_CALLOC 1 +#define HAVE_REALLOC 1 +#define HAVE_FREE 1 +#define HAVE_ALLOCA 1 +#define HAVE_GETENV 1 +#define HAVE_PUTENV 1 +#define HAVE_MEMSET 1 +#define HAVE_MEMCPY 1 +#define HAVE_MEMMOVE 1 +#define HAVE_MEMCMP 1 + +/* Enable various audio drivers */ +#define SDL_AUDIO_DRIVER_AHI 1 +#define SDL_AUDIO_DRIVER_DISK 1 +#define SDL_AUDIO_DRIVER_DUMMY 1 + +/* Enable various cdrom drivers */ +#define SDL_CDROM_DUMMY 1 + +/* Enable various input drivers */ +#define SDL_JOYSTICK_AMIGA 1 + +/* Enable various shared object loading systems */ +#define SDL_LOADSO_DUMMY 1 + +/* Enable various threading systems */ +#define SDL_THREAD_AMIGA 1 + +/* Enable various timer systems */ +#define SDL_TIMER_AMIGA 1 + +/* Enable various video drivers */ +#define SDL_VIDEO_DRIVER_CYBERGRAPHICS 1 +#define SDL_VIDEO_DRIVER_DUMMY 1 + +/* Enable OpenGL support */ +#define SDL_VIDEO_OPENGL 1 + +#endif /* _SDL_config_amiga_h */ diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/include/SDL_config_dreamcast.h b/dep/recastnavigation/RecastDemo/Contrib/SDL/include/SDL_config_dreamcast.h new file mode 100644 index 000000000..07c2f0815 --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/include/SDL_config_dreamcast.h @@ -0,0 +1,106 @@ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + Sam Lantinga + slouken@libsdl.org +*/ + +#ifndef _SDL_config_dreamcast_h +#define _SDL_config_dreamcast_h + +#include "SDL_platform.h" + +/* This is a set of defines to configure the SDL features */ + +typedef signed char int8_t; +typedef unsigned char uint8_t; +typedef signed short int16_t; +typedef unsigned short uint16_t; +typedef signed int int32_t; +typedef unsigned int uint32_t; +typedef signed long long int64_t; +typedef unsigned long long uint64_t; +typedef unsigned long uintptr_t; +#define SDL_HAS_64BIT_TYPE 1 + +/* Useful headers */ +#define HAVE_SYS_TYPES_H 1 +#define HAVE_STDIO_H 1 +#define STDC_HEADERS 1 +#define HAVE_STRING_H 1 +#define HAVE_CTYPE_H 1 + +/* C library functions */ +#define HAVE_MALLOC 1 +#define HAVE_CALLOC 1 +#define HAVE_REALLOC 1 +#define HAVE_FREE 1 +#define HAVE_ALLOCA 1 +#define HAVE_GETENV 1 +#define HAVE_PUTENV 1 +#define HAVE_QSORT 1 +#define HAVE_ABS 1 +#define HAVE_BCOPY 1 +#define HAVE_MEMSET 1 +#define HAVE_MEMCPY 1 +#define HAVE_MEMMOVE 1 +#define HAVE_MEMCMP 1 +#define HAVE_STRLEN 1 +#define HAVE_STRDUP 1 +#define HAVE_INDEX 1 +#define HAVE_RINDEX 1 +#define HAVE_STRCHR 1 +#define HAVE_STRRCHR 1 +#define HAVE_STRSTR 1 +#define HAVE_STRTOL 1 +#define HAVE_STRTOD 1 +#define HAVE_ATOI 1 +#define HAVE_ATOF 1 +#define HAVE_STRCMP 1 +#define HAVE_STRNCMP 1 +#define HAVE_STRICMP 1 +#define HAVE_STRCASECMP 1 +#define HAVE_SSCANF 1 +#define HAVE_SNPRINTF 1 +#define HAVE_VSNPRINTF 1 + +/* Enable various audio drivers */ +#define SDL_AUDIO_DRIVER_DC 1 +#define SDL_AUDIO_DRIVER_DISK 1 +#define SDL_AUDIO_DRIVER_DUMMY 1 + +/* Enable various cdrom drivers */ +#define SDL_CDROM_DC 1 + +/* Enable various input drivers */ +#define SDL_JOYSTICK_DC 1 + +/* Enable various shared object loading systems */ +#define SDL_LOADSO_DUMMY 1 + +/* Enable various threading systems */ +#define SDL_THREAD_DC 1 + +/* Enable various timer systems */ +#define SDL_TIMER_DC 1 + +/* Enable various video drivers */ +#define SDL_VIDEO_DRIVER_DC 1 +#define SDL_VIDEO_DRIVER_DUMMY 1 + +#endif /* _SDL_config_dreamcast_h */ diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/include/SDL_config_macos.h b/dep/recastnavigation/RecastDemo/Contrib/SDL/include/SDL_config_macos.h new file mode 100644 index 000000000..4ba5c22c3 --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/include/SDL_config_macos.h @@ -0,0 +1,112 @@ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + Sam Lantinga + slouken@libsdl.org +*/ + +#ifndef _SDL_config_macos_h +#define _SDL_config_macos_h + +#include "SDL_platform.h" + +/* This is a set of defines to configure the SDL features */ + +#include + +typedef SInt8 int8_t; +typedef UInt8 uint8_t; +typedef SInt16 int16_t; +typedef UInt16 uint16_t; +typedef SInt32 int32_t; +typedef UInt32 uint32_t; +typedef SInt64 int64_t; +typedef UInt64 uint64_t; +typedef unsigned long uintptr_t; + +#define SDL_HAS_64BIT_TYPE 1 + +/* Useful headers */ +#define HAVE_STDIO_H 1 +#define STDC_HEADERS 1 +#define HAVE_STRING_H 1 +#define HAVE_CTYPE_H 1 +#define HAVE_MATH_H 1 +#define HAVE_SIGNAL_H 1 + +/* C library functions */ +#define HAVE_MALLOC 1 +#define HAVE_CALLOC 1 +#define HAVE_REALLOC 1 +#define HAVE_FREE 1 +#define HAVE_ALLOCA 1 +#define HAVE_ABS 1 +#define HAVE_MEMSET 1 +#define HAVE_MEMCPY 1 +#define HAVE_MEMMOVE 1 +#define HAVE_MEMCMP 1 +#define HAVE_STRLEN 1 +#define HAVE_STRCHR 1 +#define HAVE_STRRCHR 1 +#define HAVE_STRSTR 1 +#define HAVE_ITOA 1 +#define HAVE_STRTOL 1 +#define HAVE_STRTOD 1 +#define HAVE_ATOI 1 +#define HAVE_ATOF 1 +#define HAVE_STRCMP 1 +#define HAVE_STRNCMP 1 +#define HAVE_SSCANF 1 + +/* Enable various audio drivers */ +#define SDL_AUDIO_DRIVER_SNDMGR 1 +#define SDL_AUDIO_DRIVER_DISK 1 +#define SDL_AUDIO_DRIVER_DUMMY 1 + +/* Enable various cdrom drivers */ +#if TARGET_API_MAC_CARBON +#define SDL_CDROM_DUMMY 1 +#else +#define SDL_CDROM_MACOS 1 +#endif + +/* Enable various input drivers */ +#if TARGET_API_MAC_CARBON +#define SDL_JOYSTICK_DUMMY 1 +#else +#define SDL_JOYSTICK_MACOS 1 +#endif + +/* Enable various shared object loading systems */ +#define SDL_LOADSO_MACOS 1 + +/* Enable various threading systems */ +#define SDL_THREADS_DISABLED 1 + +/* Enable various timer systems */ +#define SDL_TIMER_MACOS 1 + +/* Enable various video drivers */ +#define SDL_VIDEO_DRIVER_DUMMY 1 +#define SDL_VIDEO_DRIVER_DRAWSPROCKET 1 +#define SDL_VIDEO_DRIVER_TOOLBOX 1 + +/* Enable OpenGL support */ +#define SDL_VIDEO_OPENGL 1 + +#endif /* _SDL_config_macos_h */ diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/include/SDL_config_macosx.h b/dep/recastnavigation/RecastDemo/Contrib/SDL/include/SDL_config_macosx.h new file mode 100644 index 000000000..295b87245 --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/include/SDL_config_macosx.h @@ -0,0 +1,150 @@ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + Sam Lantinga + slouken@libsdl.org +*/ + +#ifndef _SDL_config_macosx_h +#define _SDL_config_macosx_h + +#include "SDL_platform.h" + +/* This gets us MAC_OS_X_VERSION_MIN_REQUIRED... */ +#include + +/* This is a set of defines to configure the SDL features */ + +#define SDL_HAS_64BIT_TYPE 1 + +/* Useful headers */ +/* If we specified an SDK or have a post-PowerPC chip, then alloca.h exists. */ +#if ( (MAC_OS_X_VERSION_MIN_REQUIRED >= 1030) || (!defined(__POWERPC__)) ) +#define HAVE_ALLOCA_H 1 +#endif +#define HAVE_SYS_TYPES_H 1 +#define HAVE_STDIO_H 1 +#define STDC_HEADERS 1 +#define HAVE_STRING_H 1 +#define HAVE_INTTYPES_H 1 +#define HAVE_STDINT_H 1 +#define HAVE_CTYPE_H 1 +#define HAVE_MATH_H 1 +#define HAVE_SIGNAL_H 1 + +/* C library functions */ +#define HAVE_MALLOC 1 +#define HAVE_CALLOC 1 +#define HAVE_REALLOC 1 +#define HAVE_FREE 1 +#define HAVE_ALLOCA 1 +#define HAVE_GETENV 1 +#define HAVE_PUTENV 1 +#define HAVE_UNSETENV 1 +#define HAVE_QSORT 1 +#define HAVE_ABS 1 +#define HAVE_BCOPY 1 +#define HAVE_MEMSET 1 +#define HAVE_MEMCPY 1 +#define HAVE_MEMMOVE 1 +#define HAVE_MEMCMP 1 +#define HAVE_STRLEN 1 +#define HAVE_STRLCPY 1 +#define HAVE_STRLCAT 1 +#define HAVE_STRDUP 1 +#define HAVE_STRCHR 1 +#define HAVE_STRRCHR 1 +#define HAVE_STRSTR 1 +#define HAVE_STRTOL 1 +#define HAVE_STRTOUL 1 +#define HAVE_STRTOLL 1 +#define HAVE_STRTOULL 1 +#define HAVE_STRTOD 1 +#define HAVE_ATOI 1 +#define HAVE_ATOF 1 +#define HAVE_STRCMP 1 +#define HAVE_STRNCMP 1 +#define HAVE_STRCASECMP 1 +#define HAVE_STRNCASECMP 1 +#define HAVE_SSCANF 1 +#define HAVE_SNPRINTF 1 +#define HAVE_VSNPRINTF 1 +#define HAVE_SIGACTION 1 +#define HAVE_SETJMP 1 +#define HAVE_NANOSLEEP 1 + +/* Enable various audio drivers */ +#define SDL_AUDIO_DRIVER_COREAUDIO 1 +#define SDL_AUDIO_DRIVER_DISK 1 +#define SDL_AUDIO_DRIVER_DUMMY 1 + +/* Enable various cdrom drivers */ +#define SDL_CDROM_MACOSX 1 + +/* Enable various input drivers */ +#define SDL_JOYSTICK_IOKIT 1 + +/* Enable various shared object loading systems */ +#ifdef __ppc__ +/* For Mac OS X 10.2 compatibility */ +#define SDL_LOADSO_DLCOMPAT 1 +#else +#define SDL_LOADSO_DLOPEN 1 +#endif + +/* Enable various threading systems */ +#define SDL_THREAD_PTHREAD 1 +#define SDL_THREAD_PTHREAD_RECURSIVE_MUTEX 1 + +/* Enable various timer systems */ +#define SDL_TIMER_UNIX 1 + +/* Enable various video drivers */ +#define SDL_VIDEO_DRIVER_DUMMY 1 +#if ((defined TARGET_API_MAC_CARBON) && (TARGET_API_MAC_CARBON)) +#define SDL_VIDEO_DRIVER_TOOLBOX 1 +#else +#define SDL_VIDEO_DRIVER_QUARTZ 1 +#endif +#define SDL_VIDEO_DRIVER_DGA 1 +#define SDL_VIDEO_DRIVER_X11 1 +#define SDL_VIDEO_DRIVER_X11_DGAMOUSE 1 +#define SDL_VIDEO_DRIVER_X11_DYNAMIC "/usr/X11R6/lib/libX11.6.dylib" +#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XEXT "/usr/X11R6/lib/libXext.6.dylib" +#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XRANDR "/usr/X11R6/lib/libXrandr.2.dylib" +#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XRENDER "/usr/X11R6/lib/libXrender.1.dylib" +#define SDL_VIDEO_DRIVER_X11_VIDMODE 1 +#define SDL_VIDEO_DRIVER_X11_XINERAMA 1 +#define SDL_VIDEO_DRIVER_X11_XME 1 +#define SDL_VIDEO_DRIVER_X11_XRANDR 1 +#define SDL_VIDEO_DRIVER_X11_XV 1 + +/* Enable OpenGL support */ +#define SDL_VIDEO_OPENGL 1 +#define SDL_VIDEO_OPENGL_GLX 1 + +/* Disable screensaver */ +#define SDL_VIDEO_DISABLE_SCREENSAVER 1 + +/* Enable assembly routines */ +#define SDL_ASSEMBLY_ROUTINES 1 +#ifdef __ppc__ +#define SDL_ALTIVEC_BLITTERS 1 +#endif + +#endif /* _SDL_config_macosx_h */ diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/include/SDL_config_minimal.h b/dep/recastnavigation/RecastDemo/Contrib/SDL/include/SDL_config_minimal.h new file mode 100644 index 000000000..002c56ead --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/include/SDL_config_minimal.h @@ -0,0 +1,62 @@ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + Sam Lantinga + slouken@libsdl.org +*/ + +#ifndef _SDL_config_minimal_h +#define _SDL_config_minimal_h + +#include "SDL_platform.h" + +/* This is the minimal configuration that can be used to build SDL */ + +#include + +typedef signed char int8_t; +typedef unsigned char uint8_t; +typedef signed short int16_t; +typedef unsigned short uint16_t; +typedef signed int int32_t; +typedef unsigned int uint32_t; +typedef unsigned int size_t; +typedef unsigned long uintptr_t; + +/* Enable the dummy audio driver (src/audio/dummy/\*.c) */ +#define SDL_AUDIO_DRIVER_DUMMY 1 + +/* Enable the stub cdrom driver (src/cdrom/dummy/\*.c) */ +#define SDL_CDROM_DISABLED 1 + +/* Enable the stub joystick driver (src/joystick/dummy/\*.c) */ +#define SDL_JOYSTICK_DISABLED 1 + +/* Enable the stub shared object loader (src/loadso/dummy/\*.c) */ +#define SDL_LOADSO_DISABLED 1 + +/* Enable the stub thread support (src/thread/generic/\*.c) */ +#define SDL_THREADS_DISABLED 1 + +/* Enable the stub timer support (src/timer/dummy/\*.c) */ +#define SDL_TIMERS_DISABLED 1 + +/* Enable the dummy video driver (src/video/dummy/\*.c) */ +#define SDL_VIDEO_DRIVER_DUMMY 1 + +#endif /* _SDL_config_minimal_h */ diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/include/SDL_config_nds.h b/dep/recastnavigation/RecastDemo/Contrib/SDL/include/SDL_config_nds.h new file mode 100644 index 000000000..4ac60a504 --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/include/SDL_config_nds.h @@ -0,0 +1,115 @@ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + Sam Lantinga + slouken@libsdl.org +*/ + +#ifndef _SDL_config_nds_h +#define _SDL_config_nds_h + +#include "SDL_platform.h" + +/* This is a set of defines to configure the SDL features */ + +/* General platform specific identifiers */ +#include "SDL_platform.h" + +/* C datatypes */ +#define SDL_HAS_64BIT_TYPE 1 + +/* Endianness */ +#define SDL_BYTEORDER 1234 + +/* Useful headers */ +#define HAVE_ALLOCA_H 1 +#define HAVE_SYS_TYPES_H 1 +#define HAVE_STDIO_H 1 +#define STDC_HEADERS 1 +#define HAVE_STDLIB_H 1 +#define HAVE_STDARG_H 1 +#define HAVE_MALLOC_H 1 +#define HAVE_STRING_H 1 +#define HAVE_INTTYPES_H 1 +#define HAVE_STDINT_H 1 +#define HAVE_CTYPE_H 1 +#define HAVE_MATH_H 1 +#define HAVE_ICONV_H 1 +#define HAVE_SIGNAL_H 1 + +/* C library functions */ +#define HAVE_MALLOC 1 +#define HAVE_CALLOC 1 +#define HAVE_REALLOC 1 +#define HAVE_FREE 1 +#define HAVE_ALLOCA 1 +#define HAVE_GETENV 1 +#define HAVE_PUTENV 1 +#define HAVE_UNSETENV 1 +#define HAVE_QSORT 1 +#define HAVE_ABS 1 +#define HAVE_BCOPY 1 +#define HAVE_MEMSET 1 +#define HAVE_MEMCPY 1 +#define HAVE_MEMMOVE 1 +#define HAVE_STRLEN 1 +#define HAVE_STRLCPY 1 +#define HAVE_STRLCAT 1 +#define HAVE_STRDUP 1 +#define HAVE_STRCHR 1 +#define HAVE_STRRCHR 1 +#define HAVE_STRSTR 1 +#define HAVE_STRTOL 1 +#define HAVE_STRTOUL 1 +#define HAVE_STRTOLL 1 +#define HAVE_STRTOULL 1 +#define HAVE_ATOI 1 +#define HAVE_ATOF 1 +#define HAVE_STRCMP 1 +#define HAVE_STRNCMP 1 +#define HAVE_STRCASECMP 1 +#define HAVE_STRNCASECMP 1 +#define HAVE_SSCANF 1 +#define HAVE_SNPRINTF 1 +#define HAVE_VSNPRINTF 1 +#define HAVE_SETJMP 1 + +/* Enable various audio drivers */ +#define SDL_AUDIO_DRIVER_NDS 1 +#define SDL_AUDIO_DRIVER_DUMMY 1 + +/* Enable the stub cdrom driver (src/cdrom/dummy/\*.c) */ +#define SDL_CDROM_DISABLED 1 + +/* Enable various input drivers */ +#define SDL_JOYSTICK_NDS 1 + +/* Enable the stub shared object loader (src/loadso/dummy/\*.c) */ +#define SDL_LOADSO_DISABLED 1 + +/* Enable the stub thread support (src/thread/generic/\*.c) */ +#define SDL_THREADS_DISABLED 1 + +/* Enable various timer systems */ +#define SDL_TIMER_NDS 1 + +/* Enable various video drivers */ +#define SDL_VIDEO_DRIVER_NDS 1 +#define SDL_VIDEO_DRIVER_DUMMY 1 + +#endif /* _SDL_config_nds_h */ diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/include/SDL_config_os2.h b/dep/recastnavigation/RecastDemo/Contrib/SDL/include/SDL_config_os2.h new file mode 100644 index 000000000..bb40df001 --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/include/SDL_config_os2.h @@ -0,0 +1,141 @@ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + Sam Lantinga + slouken@libsdl.org +*/ + +#ifndef _SDL_config_os2_h +#define _SDL_config_os2_h + +#include "SDL_platform.h" + +/* This is a set of defines to configure the SDL features */ + +typedef signed char int8_t; +typedef unsigned char uint8_t; +typedef signed short int16_t; +typedef unsigned short uint16_t; +typedef signed int int32_t; +typedef unsigned int uint32_t; +typedef unsigned int size_t; +typedef unsigned long uintptr_t; +typedef signed long long int64_t; +typedef unsigned long long uint64_t; + +#define SDL_HAS_64BIT_TYPE 1 + +/* Use Watcom's LIBC */ +#define HAVE_LIBC 1 + +/* Useful headers */ +#define HAVE_SYS_TYPES_H 1 +#define HAVE_STDIO_H 1 +#define STDC_HEADERS 1 +#define HAVE_STDLIB_H 1 +#define HAVE_STDARG_H 1 +#define HAVE_MALLOC_H 1 +#define HAVE_MEMORY_H 1 +#define HAVE_STRING_H 1 +#define HAVE_STRINGS_H 1 +#define HAVE_INTTYPES_H 1 +#define HAVE_STDINT_H 1 +#define HAVE_CTYPE_H 1 +#define HAVE_MATH_H 1 +#define HAVE_SIGNAL_H 1 + +/* C library functions */ +#define HAVE_MALLOC 1 +#define HAVE_CALLOC 1 +#define HAVE_REALLOC 1 +#define HAVE_FREE 1 +#define HAVE_ALLOCA 1 +#define HAVE_GETENV 1 +#define HAVE_PUTENV 1 +#define HAVE_UNSETENV 1 +#define HAVE_QSORT 1 +#define HAVE_ABS 1 +#define HAVE_BCOPY 1 +#define HAVE_MEMSET 1 +#define HAVE_MEMCPY 1 +#define HAVE_MEMMOVE 1 +#define HAVE_MEMCMP 1 +#define HAVE_STRLEN 1 +#define HAVE_STRLCPY 1 +#define HAVE_STRLCAT 1 +#define HAVE_STRDUP 1 +#define HAVE__STRREV 1 +#define HAVE__STRUPR 1 +#define HAVE__STRLWR 1 +#define HAVE_INDEX 1 +#define HAVE_RINDEX 1 +#define HAVE_STRCHR 1 +#define HAVE_STRRCHR 1 +#define HAVE_STRSTR 1 +#define HAVE_ITOA 1 +#define HAVE__LTOA 1 +#define HAVE__UITOA 1 +#define HAVE__ULTOA 1 +#define HAVE_STRTOL 1 +#define HAVE__I64TOA 1 +#define HAVE__UI64TOA 1 +#define HAVE_STRTOLL 1 +#define HAVE_STRTOD 1 +#define HAVE_ATOI 1 +#define HAVE_ATOF 1 +#define HAVE_STRCMP 1 +#define HAVE_STRNCMP 1 +#define HAVE_STRICMP 1 +#define HAVE_STRCASECMP 1 +#define HAVE_SSCANF 1 +#define HAVE_SNPRINTF 1 +#define HAVE_VSNPRINTF 1 +#define HAVE_SETJMP 1 +#define HAVE_CLOCK_GETTIME 1 + +/* Enable various audio drivers */ +#define SDL_AUDIO_DRIVER_DART 1 +#define SDL_AUDIO_DRIVER_DISK 1 +#define SDL_AUDIO_DRIVER_DUMMY 1 + +/* Enable various cdrom drivers */ +#define SDL_CDROM_OS2 1 + +/* Enable various input drivers */ +#define SDL_JOYSTICK_OS2 1 + +/* Enable various shared object loading systems */ +#define SDL_LOADSO_OS2 1 + +/* Enable various threading systems */ +#define SDL_THREAD_OS2 1 + +/* Enable various timer systems */ +#define SDL_TIMER_OS2 1 + +/* Enable various video drivers */ +#define SDL_VIDEO_DRIVER_DUMMY 1 +#define SDL_VIDEO_DRIVER_OS2FS 1 + +/* Enable OpenGL support */ +/* Nothing here yet for OS/2... :( */ + +/* Enable assembly routines where available */ +#define SDL_ASSEMBLY_ROUTINES 1 + +#endif /* _SDL_config_os2_h */ diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/include/SDL_config_symbian.h b/dep/recastnavigation/RecastDemo/Contrib/SDL/include/SDL_config_symbian.h new file mode 100644 index 000000000..53527b232 --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/include/SDL_config_symbian.h @@ -0,0 +1,146 @@ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + Sam Lantinga + slouken@libsdl.org +*/ + +/* + +Symbian version Markus Mertama + +*/ + + +#ifndef _SDL_CONFIG_SYMBIAN_H +#define _SDL_CONFIG_SYMBIAN_H + +#include "SDL_platform.h" + +/* This is the minimal configuration that can be used to build SDL */ + + +#include +#include + + +#ifdef __GCCE__ +#define SYMBIAN32_GCCE +#endif + +#ifndef _SIZE_T_DEFINED +typedef unsigned int size_t; +#endif + +#ifndef _INTPTR_T_DECLARED +typedef unsigned int uintptr_t; +#endif + +#ifndef _INT8_T_DECLARED +typedef signed char int8_t; +#endif + +#ifndef _UINT8_T_DECLARED +typedef unsigned char uint8_t; +#endif + +#ifndef _INT16_T_DECLARED +typedef signed short int16_t; +#endif + +#ifndef _UINT16_T_DECLARED +typedef unsigned short uint16_t; +#endif + +#ifndef _INT32_T_DECLARED +typedef signed int int32_t; +#endif + +#ifndef _UINT32_T_DECLARED +typedef unsigned int uint32_t; +#endif + +#ifndef _INT64_T_DECLARED +typedef signed long long int64_t; +#endif + +#ifndef _UINT64_T_DECLARED +typedef unsigned long long uint64_t; +#endif + +#define SDL_AUDIO_DRIVER_EPOCAUDIO 1 + + +/* Enable the stub cdrom driver (src/cdrom/dummy/\*.c) */ +#define SDL_CDROM_DISABLED 1 + +/* Enable the stub joystick driver (src/joystick/dummy/\*.c) */ +#define SDL_JOYSTICK_DISABLED 1 + +/* Enable the stub shared object loader (src/loadso/dummy/\*.c) */ +#define SDL_LOADSO_DISABLED 1 + +#define SDL_THREAD_SYMBIAN 1 + +#define SDL_VIDEO_DRIVER_EPOC 1 + +#define SDL_VIDEO_OPENGL 0 + +#define SDL_HAS_64BIT_TYPE 1 + +#define HAVE_LIBC 1 +#define HAVE_STDIO_H 1 +#define STDC_HEADERS 1 +#define HAVE_STRING_H 1 +#define HAVE_CTYPE_H 1 +#define HAVE_MATH_H 1 + +#define HAVE_MALLOC 1 +#define HAVE_CALLOC 1 +#define HAVE_REALLOC 1 +#define HAVE_FREE 1 +/*#define HAVE_ALLOCA 1*/ +#define HAVE_QSORT 1 +#define HAVE_ABS 1 +#define HAVE_MEMSET 1 +#define HAVE_MEMCPY 1 +#define HAVE_MEMMOVE 1 +#define HAVE_MEMCMP 1 +#define HAVE_STRLEN 1 +#define HAVE__STRUPR 1 +#define HAVE_STRCHR 1 +#define HAVE_STRRCHR 1 +#define HAVE_STRSTR 1 +#define HAVE_ITOA 1 +#define HAVE_STRTOL 1 +#define HAVE_STRTOUL 1 +#define HAVE_STRTOLL 1 +#define HAVE_STRTOD 1 +#define HAVE_ATOI 1 +#define HAVE_ATOF 1 +#define HAVE_STRCMP 1 +#define HAVE_STRNCMP 1 +/*#define HAVE__STRICMP 1*/ +#define HAVE__STRNICMP 1 +#define HAVE_SSCANF 1 +#define HAVE_STDARG_H 1 +#define HAVE_STDDEF_H 1 + + + +#endif /* _SDL_CONFIG_SYMBIAN_H */ diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/include/SDL_config_win32.h b/dep/recastnavigation/RecastDemo/Contrib/SDL/include/SDL_config_win32.h new file mode 100644 index 000000000..6d019a8d9 --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/include/SDL_config_win32.h @@ -0,0 +1,183 @@ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + Sam Lantinga + slouken@libsdl.org +*/ + +#ifndef _SDL_config_win32_h +#define _SDL_config_win32_h + +#include "SDL_platform.h" + +/* This is a set of defines to configure the SDL features */ + +#if defined(__GNUC__) || defined(__DMC__) +#define HAVE_STDINT_H 1 +#elif defined(_MSC_VER) +typedef signed __int8 int8_t; +typedef unsigned __int8 uint8_t; +typedef signed __int16 int16_t; +typedef unsigned __int16 uint16_t; +typedef signed __int32 int32_t; +typedef unsigned __int32 uint32_t; +typedef signed __int64 int64_t; +typedef unsigned __int64 uint64_t; +#ifndef _UINTPTR_T_DEFINED +#ifdef _WIN64 +typedef unsigned __int64 uintptr_t; +#else +typedef unsigned int uintptr_t; +#endif +#define _UINTPTR_T_DEFINED +#endif +/* Older Visual C++ headers don't have the Win64-compatible typedefs... */ +#if ((_MSC_VER <= 1200) && (!defined(DWORD_PTR))) +#define DWORD_PTR DWORD +#endif +#if ((_MSC_VER <= 1200) && (!defined(LONG_PTR))) +#define LONG_PTR LONG +#endif +#else /* !__GNUC__ && !_MSC_VER */ +typedef signed char int8_t; +typedef unsigned char uint8_t; +typedef signed short int16_t; +typedef unsigned short uint16_t; +typedef signed int int32_t; +typedef unsigned int uint32_t; +typedef signed long long int64_t; +typedef unsigned long long uint64_t; +#ifndef _SIZE_T_DEFINED_ +#define _SIZE_T_DEFINED_ +typedef unsigned int size_t; +#endif +typedef unsigned int uintptr_t; +#endif /* __GNUC__ || _MSC_VER */ +#define SDL_HAS_64BIT_TYPE 1 + +/* Enabled for SDL 1.2 (binary compatibility) */ +#define HAVE_LIBC 1 +#ifdef HAVE_LIBC +/* Useful headers */ +#define HAVE_STDIO_H 1 +#define STDC_HEADERS 1 +#define HAVE_STRING_H 1 +#define HAVE_CTYPE_H 1 +#define HAVE_MATH_H 1 +#ifndef _WIN32_WCE +#define HAVE_SIGNAL_H 1 +#endif + +/* C library functions */ +#define HAVE_MALLOC 1 +#define HAVE_CALLOC 1 +#define HAVE_REALLOC 1 +#define HAVE_FREE 1 +#define HAVE_ALLOCA 1 +#define HAVE_QSORT 1 +#define HAVE_ABS 1 +#define HAVE_MEMSET 1 +#define HAVE_MEMCPY 1 +#define HAVE_MEMMOVE 1 +#define HAVE_MEMCMP 1 +#define HAVE_STRLEN 1 +#define HAVE__STRREV 1 +#define HAVE__STRUPR 1 +#define HAVE__STRLWR 1 +#define HAVE_STRCHR 1 +#define HAVE_STRRCHR 1 +#define HAVE_STRSTR 1 +#define HAVE_ITOA 1 +#define HAVE__LTOA 1 +#define HAVE__ULTOA 1 +#define HAVE_STRTOL 1 +#define HAVE_STRTOUL 1 +#define HAVE_STRTOLL 1 +#define HAVE_STRTOD 1 +#define HAVE_ATOI 1 +#define HAVE_ATOF 1 +#define HAVE_STRCMP 1 +#define HAVE_STRNCMP 1 +#define HAVE__STRICMP 1 +#define HAVE__STRNICMP 1 +#define HAVE_SSCANF 1 +#else +#define HAVE_STDARG_H 1 +#define HAVE_STDDEF_H 1 +#endif + +/* Enable various audio drivers */ +#ifndef _WIN32_WCE +#define SDL_AUDIO_DRIVER_DSOUND 1 +#endif +#define SDL_AUDIO_DRIVER_WAVEOUT 1 +#define SDL_AUDIO_DRIVER_DISK 1 +#define SDL_AUDIO_DRIVER_DUMMY 1 + +/* Enable various cdrom drivers */ +#ifdef _WIN32_WCE +#define SDL_CDROM_DISABLED 1 +#else +#define SDL_CDROM_WIN32 1 +#endif + +/* Enable various input drivers */ +#ifdef _WIN32_WCE +#define SDL_JOYSTICK_DISABLED 1 +#else +#define SDL_JOYSTICK_WINMM 1 +#endif + +/* Enable various shared object loading systems */ +#define SDL_LOADSO_WIN32 1 + +/* Enable various threading systems */ +#define SDL_THREAD_WIN32 1 + +/* Enable various timer systems */ +#ifdef _WIN32_WCE +#define SDL_TIMER_WINCE 1 +#else +#define SDL_TIMER_WIN32 1 +#endif + +/* Enable various video drivers */ +#ifdef _WIN32_WCE +#define SDL_VIDEO_DRIVER_GAPI 1 +#endif +#ifndef _WIN32_WCE +#define SDL_VIDEO_DRIVER_DDRAW 1 +#endif +#define SDL_VIDEO_DRIVER_DUMMY 1 +#define SDL_VIDEO_DRIVER_WINDIB 1 + +/* Enable OpenGL support */ +#ifndef _WIN32_WCE +#define SDL_VIDEO_OPENGL 1 +#define SDL_VIDEO_OPENGL_WGL 1 +#endif + +/* Disable screensaver */ +#define SDL_VIDEO_DISABLE_SCREENSAVER 1 + +/* Enable assembly routines (Win64 doesn't have inline asm) */ +#ifndef _WIN64 +#define SDL_ASSEMBLY_ROUTINES 1 +#endif + +#endif /* _SDL_config_win32_h */ diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/include/SDL_copying.h b/dep/recastnavigation/RecastDemo/Contrib/SDL/include/SDL_copying.h new file mode 100644 index 000000000..1bd6b84cd --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/include/SDL_copying.h @@ -0,0 +1,22 @@ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + Sam Lantinga + slouken@libsdl.org +*/ + diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/include/SDL_cpuinfo.h b/dep/recastnavigation/RecastDemo/Contrib/SDL/include/SDL_cpuinfo.h new file mode 100644 index 000000000..f4be8e032 --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/include/SDL_cpuinfo.h @@ -0,0 +1,69 @@ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + Sam Lantinga + slouken@libsdl.org +*/ + +/** + * @file SDL_cpuinfo.h + * CPU feature detection for SDL + */ + +#ifndef _SDL_cpuinfo_h +#define _SDL_cpuinfo_h + +#include "SDL_stdinc.h" + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/** This function returns true if the CPU has the RDTSC instruction */ +extern DECLSPEC SDL_bool SDLCALL SDL_HasRDTSC(void); + +/** This function returns true if the CPU has MMX features */ +extern DECLSPEC SDL_bool SDLCALL SDL_HasMMX(void); + +/** This function returns true if the CPU has MMX Ext. features */ +extern DECLSPEC SDL_bool SDLCALL SDL_HasMMXExt(void); + +/** This function returns true if the CPU has 3DNow features */ +extern DECLSPEC SDL_bool SDLCALL SDL_Has3DNow(void); + +/** This function returns true if the CPU has 3DNow! Ext. features */ +extern DECLSPEC SDL_bool SDLCALL SDL_Has3DNowExt(void); + +/** This function returns true if the CPU has SSE features */ +extern DECLSPEC SDL_bool SDLCALL SDL_HasSSE(void); + +/** This function returns true if the CPU has SSE2 features */ +extern DECLSPEC SDL_bool SDLCALL SDL_HasSSE2(void); + +/** This function returns true if the CPU has AltiVec features */ +extern DECLSPEC SDL_bool SDLCALL SDL_HasAltiVec(void); + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* _SDL_cpuinfo_h */ diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/include/SDL_endian.h b/dep/recastnavigation/RecastDemo/Contrib/SDL/include/SDL_endian.h new file mode 100644 index 000000000..f7a2e2f8c --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/include/SDL_endian.h @@ -0,0 +1,209 @@ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + Sam Lantinga + slouken@libsdl.org +*/ + +/** + * @file SDL_endian.h + * Functions for reading and writing endian-specific values + */ + +#ifndef _SDL_endian_h +#define _SDL_endian_h + +#include "SDL_stdinc.h" + +/** @name SDL_ENDIANs + * The two types of endianness + */ +/*@{*/ +#define SDL_LIL_ENDIAN 1234 +#define SDL_BIG_ENDIAN 4321 +/*@}*/ + +#ifndef SDL_BYTEORDER /* Not defined in SDL_config.h? */ +#if defined(__hppa__) || \ + defined(__m68k__) || defined(mc68000) || defined(_M_M68K) || \ + (defined(__MIPS__) && defined(__MISPEB__)) || \ + defined(__ppc__) || defined(__POWERPC__) || defined(_M_PPC) || \ + defined(__sparc__) +#define SDL_BYTEORDER SDL_BIG_ENDIAN +#else +#define SDL_BYTEORDER SDL_LIL_ENDIAN +#endif +#endif /* !SDL_BYTEORDER */ + + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @name SDL_Swap Functions + * Use inline functions for compilers that support them, and static + * functions for those that do not. Because these functions become + * static for compilers that do not support inline functions, this + * header should only be included in files that actually use them. + */ +/*@{*/ +#if defined(__GNUC__) && defined(__i386__) && \ + !(__GNUC__ == 2 && __GNUC_MINOR__ <= 95 /* broken gcc version */) +static __inline__ Uint16 SDL_Swap16(Uint16 x) +{ + __asm__("xchgb %b0,%h0" : "=q" (x) : "0" (x)); + return x; +} +#elif defined(__GNUC__) && defined(__x86_64__) +static __inline__ Uint16 SDL_Swap16(Uint16 x) +{ + __asm__("xchgb %b0,%h0" : "=Q" (x) : "0" (x)); + return x; +} +#elif defined(__GNUC__) && (defined(__powerpc__) || defined(__ppc__)) +static __inline__ Uint16 SDL_Swap16(Uint16 x) +{ + Uint16 result; + + __asm__("rlwimi %0,%2,8,16,23" : "=&r" (result) : "0" (x >> 8), "r" (x)); + return result; +} +#elif defined(__GNUC__) && (defined(__M68000__) || defined(__M68020__)) +static __inline__ Uint16 SDL_Swap16(Uint16 x) +{ + __asm__("rorw #8,%0" : "=d" (x) : "0" (x) : "cc"); + return x; +} +#else +static __inline__ Uint16 SDL_Swap16(Uint16 x) { + return((x<<8)|(x>>8)); +} +#endif + +#if defined(__GNUC__) && defined(__i386__) && \ + !(__GNUC__ == 2 && __GNUC_MINOR__ <= 95 /* broken gcc version */) +static __inline__ Uint32 SDL_Swap32(Uint32 x) +{ + __asm__("bswap %0" : "=r" (x) : "0" (x)); + return x; +} +#elif defined(__GNUC__) && defined(__x86_64__) +static __inline__ Uint32 SDL_Swap32(Uint32 x) +{ + __asm__("bswapl %0" : "=r" (x) : "0" (x)); + return x; +} +#elif defined(__GNUC__) && (defined(__powerpc__) || defined(__ppc__)) +static __inline__ Uint32 SDL_Swap32(Uint32 x) +{ + Uint32 result; + + __asm__("rlwimi %0,%2,24,16,23" : "=&r" (result) : "0" (x>>24), "r" (x)); + __asm__("rlwimi %0,%2,8,8,15" : "=&r" (result) : "0" (result), "r" (x)); + __asm__("rlwimi %0,%2,24,0,7" : "=&r" (result) : "0" (result), "r" (x)); + return result; +} +#elif defined(__GNUC__) && (defined(__M68000__) || defined(__M68020__)) +static __inline__ Uint32 SDL_Swap32(Uint32 x) +{ + __asm__("rorw #8,%0\n\tswap %0\n\trorw #8,%0" : "=d" (x) : "0" (x) : "cc"); + return x; +} +#else +static __inline__ Uint32 SDL_Swap32(Uint32 x) { + return((x<<24)|((x<<8)&0x00FF0000)|((x>>8)&0x0000FF00)|(x>>24)); +} +#endif + +#ifdef SDL_HAS_64BIT_TYPE +#if defined(__GNUC__) && defined(__i386__) && \ + !(__GNUC__ == 2 && __GNUC_MINOR__ <= 95 /* broken gcc version */) +static __inline__ Uint64 SDL_Swap64(Uint64 x) +{ + union { + struct { Uint32 a,b; } s; + Uint64 u; + } v; + v.u = x; + __asm__("bswapl %0 ; bswapl %1 ; xchgl %0,%1" + : "=r" (v.s.a), "=r" (v.s.b) + : "0" (v.s.a), "1" (v.s.b)); + return v.u; +} +#elif defined(__GNUC__) && defined(__x86_64__) +static __inline__ Uint64 SDL_Swap64(Uint64 x) +{ + __asm__("bswapq %0" : "=r" (x) : "0" (x)); + return x; +} +#else +static __inline__ Uint64 SDL_Swap64(Uint64 x) +{ + Uint32 hi, lo; + + /* Separate into high and low 32-bit values and swap them */ + lo = SDL_static_cast(Uint32, x & 0xFFFFFFFF); + x >>= 32; + hi = SDL_static_cast(Uint32, x & 0xFFFFFFFF); + x = SDL_Swap32(lo); + x <<= 32; + x |= SDL_Swap32(hi); + return(x); +} +#endif +#else +/* This is mainly to keep compilers from complaining in SDL code. + * If there is no real 64-bit datatype, then compilers will complain about + * the fake 64-bit datatype that SDL provides when it compiles user code. + */ +#define SDL_Swap64(X) (X) +#endif /* SDL_HAS_64BIT_TYPE */ +/*@}*/ + +/** + * @name SDL_SwapLE and SDL_SwapBE Functions + * Byteswap item from the specified endianness to the native endianness + */ +/*@{*/ +#if SDL_BYTEORDER == SDL_LIL_ENDIAN +#define SDL_SwapLE16(X) (X) +#define SDL_SwapLE32(X) (X) +#define SDL_SwapLE64(X) (X) +#define SDL_SwapBE16(X) SDL_Swap16(X) +#define SDL_SwapBE32(X) SDL_Swap32(X) +#define SDL_SwapBE64(X) SDL_Swap64(X) +#else +#define SDL_SwapLE16(X) SDL_Swap16(X) +#define SDL_SwapLE32(X) SDL_Swap32(X) +#define SDL_SwapLE64(X) SDL_Swap64(X) +#define SDL_SwapBE16(X) (X) +#define SDL_SwapBE32(X) (X) +#define SDL_SwapBE64(X) (X) +#endif +/*@}*/ + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* _SDL_endian_h */ diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/include/SDL_error.h b/dep/recastnavigation/RecastDemo/Contrib/SDL/include/SDL_error.h new file mode 100644 index 000000000..b103703a5 --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/include/SDL_error.h @@ -0,0 +1,72 @@ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + Sam Lantinga + slouken@libsdl.org +*/ + +/** + * @file SDL_error.h + * Simple error message routines for SDL + */ + +#ifndef _SDL_error_h +#define _SDL_error_h + +#include "SDL_stdinc.h" + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @name Public functions + */ +/*@{*/ +extern DECLSPEC void SDLCALL SDL_SetError(const char *fmt, ...); +extern DECLSPEC char * SDLCALL SDL_GetError(void); +extern DECLSPEC void SDLCALL SDL_ClearError(void); +/*@}*/ + +/** + * @name Private functions + * @internal Private error message function - used internally + */ +/*@{*/ +#define SDL_OutOfMemory() SDL_Error(SDL_ENOMEM) +#define SDL_Unsupported() SDL_Error(SDL_UNSUPPORTED) +typedef enum { + SDL_ENOMEM, + SDL_EFREAD, + SDL_EFWRITE, + SDL_EFSEEK, + SDL_UNSUPPORTED, + SDL_LASTERROR +} SDL_errorcode; +extern DECLSPEC void SDLCALL SDL_Error(SDL_errorcode code); +/*@}*/ + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* _SDL_error_h */ diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/include/SDL_events.h b/dep/recastnavigation/RecastDemo/Contrib/SDL/include/SDL_events.h new file mode 100644 index 000000000..c94a30c9c --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/include/SDL_events.h @@ -0,0 +1,356 @@ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + Sam Lantinga + slouken@libsdl.org +*/ + +/** + * @file SDL_events.h + * Include file for SDL event handling + */ + +#ifndef _SDL_events_h +#define _SDL_events_h + +#include "SDL_stdinc.h" +#include "SDL_error.h" +#include "SDL_active.h" +#include "SDL_keyboard.h" +#include "SDL_mouse.h" +#include "SDL_joystick.h" +#include "SDL_quit.h" + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/** @name General keyboard/mouse state definitions */ +/*@{*/ +#define SDL_RELEASED 0 +#define SDL_PRESSED 1 +/*@}*/ + +/** Event enumerations */ +typedef enum { + SDL_NOEVENT = 0, /**< Unused (do not remove) */ + SDL_ACTIVEEVENT, /**< Application loses/gains visibility */ + SDL_KEYDOWN, /**< Keys pressed */ + SDL_KEYUP, /**< Keys released */ + SDL_MOUSEMOTION, /**< Mouse moved */ + SDL_MOUSEBUTTONDOWN, /**< Mouse button pressed */ + SDL_MOUSEBUTTONUP, /**< Mouse button released */ + SDL_JOYAXISMOTION, /**< Joystick axis motion */ + SDL_JOYBALLMOTION, /**< Joystick trackball motion */ + SDL_JOYHATMOTION, /**< Joystick hat position change */ + SDL_JOYBUTTONDOWN, /**< Joystick button pressed */ + SDL_JOYBUTTONUP, /**< Joystick button released */ + SDL_QUIT, /**< User-requested quit */ + SDL_SYSWMEVENT, /**< System specific event */ + SDL_EVENT_RESERVEDA, /**< Reserved for future use.. */ + SDL_EVENT_RESERVEDB, /**< Reserved for future use.. */ + SDL_VIDEORESIZE, /**< User resized video mode */ + SDL_VIDEOEXPOSE, /**< Screen needs to be redrawn */ + SDL_EVENT_RESERVED2, /**< Reserved for future use.. */ + SDL_EVENT_RESERVED3, /**< Reserved for future use.. */ + SDL_EVENT_RESERVED4, /**< Reserved for future use.. */ + SDL_EVENT_RESERVED5, /**< Reserved for future use.. */ + SDL_EVENT_RESERVED6, /**< Reserved for future use.. */ + SDL_EVENT_RESERVED7, /**< Reserved for future use.. */ + /** Events SDL_USEREVENT through SDL_MAXEVENTS-1 are for your use */ + SDL_USEREVENT = 24, + /** This last event is only for bounding internal arrays + * It is the number of bits in the event mask datatype -- Uint32 + */ + SDL_NUMEVENTS = 32 +} SDL_EventType; + +/** @name Predefined event masks */ +/*@{*/ +#define SDL_EVENTMASK(X) (1<<(X)) +typedef enum { + SDL_ACTIVEEVENTMASK = SDL_EVENTMASK(SDL_ACTIVEEVENT), + SDL_KEYDOWNMASK = SDL_EVENTMASK(SDL_KEYDOWN), + SDL_KEYUPMASK = SDL_EVENTMASK(SDL_KEYUP), + SDL_KEYEVENTMASK = SDL_EVENTMASK(SDL_KEYDOWN)| + SDL_EVENTMASK(SDL_KEYUP), + SDL_MOUSEMOTIONMASK = SDL_EVENTMASK(SDL_MOUSEMOTION), + SDL_MOUSEBUTTONDOWNMASK = SDL_EVENTMASK(SDL_MOUSEBUTTONDOWN), + SDL_MOUSEBUTTONUPMASK = SDL_EVENTMASK(SDL_MOUSEBUTTONUP), + SDL_MOUSEEVENTMASK = SDL_EVENTMASK(SDL_MOUSEMOTION)| + SDL_EVENTMASK(SDL_MOUSEBUTTONDOWN)| + SDL_EVENTMASK(SDL_MOUSEBUTTONUP), + SDL_JOYAXISMOTIONMASK = SDL_EVENTMASK(SDL_JOYAXISMOTION), + SDL_JOYBALLMOTIONMASK = SDL_EVENTMASK(SDL_JOYBALLMOTION), + SDL_JOYHATMOTIONMASK = SDL_EVENTMASK(SDL_JOYHATMOTION), + SDL_JOYBUTTONDOWNMASK = SDL_EVENTMASK(SDL_JOYBUTTONDOWN), + SDL_JOYBUTTONUPMASK = SDL_EVENTMASK(SDL_JOYBUTTONUP), + SDL_JOYEVENTMASK = SDL_EVENTMASK(SDL_JOYAXISMOTION)| + SDL_EVENTMASK(SDL_JOYBALLMOTION)| + SDL_EVENTMASK(SDL_JOYHATMOTION)| + SDL_EVENTMASK(SDL_JOYBUTTONDOWN)| + SDL_EVENTMASK(SDL_JOYBUTTONUP), + SDL_VIDEORESIZEMASK = SDL_EVENTMASK(SDL_VIDEORESIZE), + SDL_VIDEOEXPOSEMASK = SDL_EVENTMASK(SDL_VIDEOEXPOSE), + SDL_QUITMASK = SDL_EVENTMASK(SDL_QUIT), + SDL_SYSWMEVENTMASK = SDL_EVENTMASK(SDL_SYSWMEVENT) +} SDL_EventMask ; +#define SDL_ALLEVENTS 0xFFFFFFFF +/*@}*/ + +/** Application visibility event structure */ +typedef struct SDL_ActiveEvent { + Uint8 type; /**< SDL_ACTIVEEVENT */ + Uint8 gain; /**< Whether given states were gained or lost (1/0) */ + Uint8 state; /**< A mask of the focus states */ +} SDL_ActiveEvent; + +/** Keyboard event structure */ +typedef struct SDL_KeyboardEvent { + Uint8 type; /**< SDL_KEYDOWN or SDL_KEYUP */ + Uint8 which; /**< The keyboard device index */ + Uint8 state; /**< SDL_PRESSED or SDL_RELEASED */ + SDL_keysym keysym; +} SDL_KeyboardEvent; + +/** Mouse motion event structure */ +typedef struct SDL_MouseMotionEvent { + Uint8 type; /**< SDL_MOUSEMOTION */ + Uint8 which; /**< The mouse device index */ + Uint8 state; /**< The current button state */ + Uint16 x, y; /**< The X/Y coordinates of the mouse */ + Sint16 xrel; /**< The relative motion in the X direction */ + Sint16 yrel; /**< The relative motion in the Y direction */ +} SDL_MouseMotionEvent; + +/** Mouse button event structure */ +typedef struct SDL_MouseButtonEvent { + Uint8 type; /**< SDL_MOUSEBUTTONDOWN or SDL_MOUSEBUTTONUP */ + Uint8 which; /**< The mouse device index */ + Uint8 button; /**< The mouse button index */ + Uint8 state; /**< SDL_PRESSED or SDL_RELEASED */ + Uint16 x, y; /**< The X/Y coordinates of the mouse at press time */ +} SDL_MouseButtonEvent; + +/** Joystick axis motion event structure */ +typedef struct SDL_JoyAxisEvent { + Uint8 type; /**< SDL_JOYAXISMOTION */ + Uint8 which; /**< The joystick device index */ + Uint8 axis; /**< The joystick axis index */ + Sint16 value; /**< The axis value (range: -32768 to 32767) */ +} SDL_JoyAxisEvent; + +/** Joystick trackball motion event structure */ +typedef struct SDL_JoyBallEvent { + Uint8 type; /**< SDL_JOYBALLMOTION */ + Uint8 which; /**< The joystick device index */ + Uint8 ball; /**< The joystick trackball index */ + Sint16 xrel; /**< The relative motion in the X direction */ + Sint16 yrel; /**< The relative motion in the Y direction */ +} SDL_JoyBallEvent; + +/** Joystick hat position change event structure */ +typedef struct SDL_JoyHatEvent { + Uint8 type; /**< SDL_JOYHATMOTION */ + Uint8 which; /**< The joystick device index */ + Uint8 hat; /**< The joystick hat index */ + Uint8 value; /**< The hat position value: + * SDL_HAT_LEFTUP SDL_HAT_UP SDL_HAT_RIGHTUP + * SDL_HAT_LEFT SDL_HAT_CENTERED SDL_HAT_RIGHT + * SDL_HAT_LEFTDOWN SDL_HAT_DOWN SDL_HAT_RIGHTDOWN + * Note that zero means the POV is centered. + */ +} SDL_JoyHatEvent; + +/** Joystick button event structure */ +typedef struct SDL_JoyButtonEvent { + Uint8 type; /**< SDL_JOYBUTTONDOWN or SDL_JOYBUTTONUP */ + Uint8 which; /**< The joystick device index */ + Uint8 button; /**< The joystick button index */ + Uint8 state; /**< SDL_PRESSED or SDL_RELEASED */ +} SDL_JoyButtonEvent; + +/** The "window resized" event + * When you get this event, you are responsible for setting a new video + * mode with the new width and height. + */ +typedef struct SDL_ResizeEvent { + Uint8 type; /**< SDL_VIDEORESIZE */ + int w; /**< New width */ + int h; /**< New height */ +} SDL_ResizeEvent; + +/** The "screen redraw" event */ +typedef struct SDL_ExposeEvent { + Uint8 type; /**< SDL_VIDEOEXPOSE */ +} SDL_ExposeEvent; + +/** The "quit requested" event */ +typedef struct SDL_QuitEvent { + Uint8 type; /**< SDL_QUIT */ +} SDL_QuitEvent; + +/** A user-defined event type */ +typedef struct SDL_UserEvent { + Uint8 type; /**< SDL_USEREVENT through SDL_NUMEVENTS-1 */ + int code; /**< User defined event code */ + void *data1; /**< User defined data pointer */ + void *data2; /**< User defined data pointer */ +} SDL_UserEvent; + +/** If you want to use this event, you should include SDL_syswm.h */ +struct SDL_SysWMmsg; +typedef struct SDL_SysWMmsg SDL_SysWMmsg; +typedef struct SDL_SysWMEvent { + Uint8 type; + SDL_SysWMmsg *msg; +} SDL_SysWMEvent; + +/** General event structure */ +typedef union SDL_Event { + Uint8 type; + SDL_ActiveEvent active; + SDL_KeyboardEvent key; + SDL_MouseMotionEvent motion; + SDL_MouseButtonEvent button; + SDL_JoyAxisEvent jaxis; + SDL_JoyBallEvent jball; + SDL_JoyHatEvent jhat; + SDL_JoyButtonEvent jbutton; + SDL_ResizeEvent resize; + SDL_ExposeEvent expose; + SDL_QuitEvent quit; + SDL_UserEvent user; + SDL_SysWMEvent syswm; +} SDL_Event; + + +/* Function prototypes */ + +/** Pumps the event loop, gathering events from the input devices. + * This function updates the event queue and internal input device state. + * This should only be run in the thread that sets the video mode. + */ +extern DECLSPEC void SDLCALL SDL_PumpEvents(void); + +typedef enum { + SDL_ADDEVENT, + SDL_PEEKEVENT, + SDL_GETEVENT +} SDL_eventaction; + +/** + * Checks the event queue for messages and optionally returns them. + * + * If 'action' is SDL_ADDEVENT, up to 'numevents' events will be added to + * the back of the event queue. + * If 'action' is SDL_PEEKEVENT, up to 'numevents' events at the front + * of the event queue, matching 'mask', will be returned and will not + * be removed from the queue. + * If 'action' is SDL_GETEVENT, up to 'numevents' events at the front + * of the event queue, matching 'mask', will be returned and will be + * removed from the queue. + * + * @return + * This function returns the number of events actually stored, or -1 + * if there was an error. + * + * This function is thread-safe. + */ +extern DECLSPEC int SDLCALL SDL_PeepEvents(SDL_Event *events, int numevents, + SDL_eventaction action, Uint32 mask); + +/** Polls for currently pending events, and returns 1 if there are any pending + * events, or 0 if there are none available. If 'event' is not NULL, the next + * event is removed from the queue and stored in that area. + */ +extern DECLSPEC int SDLCALL SDL_PollEvent(SDL_Event *event); + +/** Waits indefinitely for the next available event, returning 1, or 0 if there + * was an error while waiting for events. If 'event' is not NULL, the next + * event is removed from the queue and stored in that area. + */ +extern DECLSPEC int SDLCALL SDL_WaitEvent(SDL_Event *event); + +/** Add an event to the event queue. + * This function returns 0 on success, or -1 if the event queue was full + * or there was some other error. + */ +extern DECLSPEC int SDLCALL SDL_PushEvent(SDL_Event *event); + +/** @name Event Filtering */ +/*@{*/ +typedef int (SDLCALL *SDL_EventFilter)(const SDL_Event *event); +/** + * This function sets up a filter to process all events before they + * change internal state and are posted to the internal event queue. + * + * The filter is protypted as: + * @code typedef int (SDLCALL *SDL_EventFilter)(const SDL_Event *event); @endcode + * + * If the filter returns 1, then the event will be added to the internal queue. + * If it returns 0, then the event will be dropped from the queue, but the + * internal state will still be updated. This allows selective filtering of + * dynamically arriving events. + * + * @warning Be very careful of what you do in the event filter function, as + * it may run in a different thread! + * + * There is one caveat when dealing with the SDL_QUITEVENT event type. The + * event filter is only called when the window manager desires to close the + * application window. If the event filter returns 1, then the window will + * be closed, otherwise the window will remain open if possible. + * If the quit event is generated by an interrupt signal, it will bypass the + * internal queue and be delivered to the application at the next event poll. + */ +extern DECLSPEC void SDLCALL SDL_SetEventFilter(SDL_EventFilter filter); + +/** + * Return the current event filter - can be used to "chain" filters. + * If there is no event filter set, this function returns NULL. + */ +extern DECLSPEC SDL_EventFilter SDLCALL SDL_GetEventFilter(void); +/*@}*/ + +/** @name Event State */ +/*@{*/ +#define SDL_QUERY -1 +#define SDL_IGNORE 0 +#define SDL_DISABLE 0 +#define SDL_ENABLE 1 +/*@}*/ + +/** +* This function allows you to set the state of processing certain events. +* If 'state' is set to SDL_IGNORE, that event will be automatically dropped +* from the event queue and will not event be filtered. +* If 'state' is set to SDL_ENABLE, that event will be processed normally. +* If 'state' is set to SDL_QUERY, SDL_EventState() will return the +* current processing state of the specified event. +*/ +extern DECLSPEC Uint8 SDLCALL SDL_EventState(Uint8 type, int state); + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* _SDL_events_h */ diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/include/SDL_getenv.h b/dep/recastnavigation/RecastDemo/Contrib/SDL/include/SDL_getenv.h new file mode 100644 index 000000000..253ad88cc --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/include/SDL_getenv.h @@ -0,0 +1,28 @@ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + Sam Lantinga + slouken@libsdl.org +*/ + +/** @file SDL_getenv.h + * @deprecated Use SDL_stdinc.h instead + */ + +/* DEPRECATED */ +#include "SDL_stdinc.h" diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/include/SDL_joystick.h b/dep/recastnavigation/RecastDemo/Contrib/SDL/include/SDL_joystick.h new file mode 100644 index 000000000..d5135c3d5 --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/include/SDL_joystick.h @@ -0,0 +1,187 @@ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + Sam Lantinga + slouken@libsdl.org +*/ + +/** @file SDL_joystick.h + * Include file for SDL joystick event handling + */ + +#ifndef _SDL_joystick_h +#define _SDL_joystick_h + +#include "SDL_stdinc.h" +#include "SDL_error.h" + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/** @file SDL_joystick.h + * @note In order to use these functions, SDL_Init() must have been called + * with the SDL_INIT_JOYSTICK flag. This causes SDL to scan the system + * for joysticks, and load appropriate drivers. + */ + +/** The joystick structure used to identify an SDL joystick */ +struct _SDL_Joystick; +typedef struct _SDL_Joystick SDL_Joystick; + +/* Function prototypes */ +/** + * Count the number of joysticks attached to the system + */ +extern DECLSPEC int SDLCALL SDL_NumJoysticks(void); + +/** + * Get the implementation dependent name of a joystick. + * + * This can be called before any joysticks are opened. + * If no name can be found, this function returns NULL. + */ +extern DECLSPEC const char * SDLCALL SDL_JoystickName(int device_index); + +/** + * Open a joystick for use. + * + * @param[in] device_index + * The index passed as an argument refers to + * the N'th joystick on the system. This index is the value which will + * identify this joystick in future joystick events. + * + * @return This function returns a joystick identifier, or NULL if an error occurred. + */ +extern DECLSPEC SDL_Joystick * SDLCALL SDL_JoystickOpen(int device_index); + +/** + * Returns 1 if the joystick has been opened, or 0 if it has not. + */ +extern DECLSPEC int SDLCALL SDL_JoystickOpened(int device_index); + +/** + * Get the device index of an opened joystick. + */ +extern DECLSPEC int SDLCALL SDL_JoystickIndex(SDL_Joystick *joystick); + +/** + * Get the number of general axis controls on a joystick + */ +extern DECLSPEC int SDLCALL SDL_JoystickNumAxes(SDL_Joystick *joystick); + +/** + * Get the number of trackballs on a joystick + * + * Joystick trackballs have only relative motion events associated + * with them and their state cannot be polled. + */ +extern DECLSPEC int SDLCALL SDL_JoystickNumBalls(SDL_Joystick *joystick); + +/** + * Get the number of POV hats on a joystick + */ +extern DECLSPEC int SDLCALL SDL_JoystickNumHats(SDL_Joystick *joystick); + +/** + * Get the number of buttons on a joystick + */ +extern DECLSPEC int SDLCALL SDL_JoystickNumButtons(SDL_Joystick *joystick); + +/** + * Update the current state of the open joysticks. + * + * This is called automatically by the event loop if any joystick + * events are enabled. + */ +extern DECLSPEC void SDLCALL SDL_JoystickUpdate(void); + +/** + * Enable/disable joystick event polling. + * + * If joystick events are disabled, you must call SDL_JoystickUpdate() + * yourself and check the state of the joystick when you want joystick + * information. + * + * @param[in] state The state can be one of SDL_QUERY, SDL_ENABLE or SDL_IGNORE. + */ +extern DECLSPEC int SDLCALL SDL_JoystickEventState(int state); + +/** + * Get the current state of an axis control on a joystick + * + * @param[in] axis The axis indices start at index 0. + * + * @return The state is a value ranging from -32768 to 32767. + */ +extern DECLSPEC Sint16 SDLCALL SDL_JoystickGetAxis(SDL_Joystick *joystick, int axis); + +/** + * @name Hat Positions + * The return value of SDL_JoystickGetHat() is one of the following positions: + */ +/*@{*/ +#define SDL_HAT_CENTERED 0x00 +#define SDL_HAT_UP 0x01 +#define SDL_HAT_RIGHT 0x02 +#define SDL_HAT_DOWN 0x04 +#define SDL_HAT_LEFT 0x08 +#define SDL_HAT_RIGHTUP (SDL_HAT_RIGHT|SDL_HAT_UP) +#define SDL_HAT_RIGHTDOWN (SDL_HAT_RIGHT|SDL_HAT_DOWN) +#define SDL_HAT_LEFTUP (SDL_HAT_LEFT|SDL_HAT_UP) +#define SDL_HAT_LEFTDOWN (SDL_HAT_LEFT|SDL_HAT_DOWN) +/*@}*/ + +/** + * Get the current state of a POV hat on a joystick + * + * @param[in] hat The hat indices start at index 0. + */ +extern DECLSPEC Uint8 SDLCALL SDL_JoystickGetHat(SDL_Joystick *joystick, int hat); + +/** + * Get the ball axis change since the last poll + * + * @param[in] ball The ball indices start at index 0. + * + * @return This returns 0, or -1 if you passed it invalid parameters. + */ +extern DECLSPEC int SDLCALL SDL_JoystickGetBall(SDL_Joystick *joystick, int ball, int *dx, int *dy); + +/** + * Get the current state of a button on a joystick + * + * @param[in] button The button indices start at index 0. + */ +extern DECLSPEC Uint8 SDLCALL SDL_JoystickGetButton(SDL_Joystick *joystick, int button); + +/** + * Close a joystick previously opened with SDL_JoystickOpen() + */ +extern DECLSPEC void SDLCALL SDL_JoystickClose(SDL_Joystick *joystick); + + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* _SDL_joystick_h */ diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/include/SDL_keyboard.h b/dep/recastnavigation/RecastDemo/Contrib/SDL/include/SDL_keyboard.h new file mode 100644 index 000000000..7b59d24e5 --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/include/SDL_keyboard.h @@ -0,0 +1,135 @@ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + Sam Lantinga + slouken@libsdl.org +*/ + +/** @file SDL_keyboard.h + * Include file for SDL keyboard event handling + */ + +#ifndef _SDL_keyboard_h +#define _SDL_keyboard_h + +#include "SDL_stdinc.h" +#include "SDL_error.h" +#include "SDL_keysym.h" + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/** Keysym structure + * + * - The scancode is hardware dependent, and should not be used by general + * applications. If no hardware scancode is available, it will be 0. + * + * - The 'unicode' translated character is only available when character + * translation is enabled by the SDL_EnableUNICODE() API. If non-zero, + * this is a UNICODE character corresponding to the keypress. If the + * high 9 bits of the character are 0, then this maps to the equivalent + * ASCII character: + * @code + * char ch; + * if ( (keysym.unicode & 0xFF80) == 0 ) { + * ch = keysym.unicode & 0x7F; + * } else { + * An international character.. + * } + * @endcode + */ +typedef struct SDL_keysym { + Uint8 scancode; /**< hardware specific scancode */ + SDLKey sym; /**< SDL virtual keysym */ + SDLMod mod; /**< current key modifiers */ + Uint16 unicode; /**< translated character */ +} SDL_keysym; + +/** This is the mask which refers to all hotkey bindings */ +#define SDL_ALL_HOTKEYS 0xFFFFFFFF + +/* Function prototypes */ +/** + * Enable/Disable UNICODE translation of keyboard input. + * + * This translation has some overhead, so translation defaults off. + * + * @param[in] enable + * If 'enable' is 1, translation is enabled. + * If 'enable' is 0, translation is disabled. + * If 'enable' is -1, the translation state is not changed. + * + * @return It returns the previous state of keyboard translation. + */ +extern DECLSPEC int SDLCALL SDL_EnableUNICODE(int enable); + +#define SDL_DEFAULT_REPEAT_DELAY 500 +#define SDL_DEFAULT_REPEAT_INTERVAL 30 +/** + * Enable/Disable keyboard repeat. Keyboard repeat defaults to off. + * + * @param[in] delay + * 'delay' is the initial delay in ms between the time when a key is + * pressed, and keyboard repeat begins. + * + * @param[in] interval + * 'interval' is the time in ms between keyboard repeat events. + * + * If 'delay' is set to 0, keyboard repeat is disabled. + */ +extern DECLSPEC int SDLCALL SDL_EnableKeyRepeat(int delay, int interval); +extern DECLSPEC void SDLCALL SDL_GetKeyRepeat(int *delay, int *interval); + +/** + * Get a snapshot of the current state of the keyboard. + * Returns an array of keystates, indexed by the SDLK_* syms. + * Usage: + * @code + * Uint8 *keystate = SDL_GetKeyState(NULL); + * if ( keystate[SDLK_RETURN] ) //... \ is pressed. + * @endcode + */ +extern DECLSPEC Uint8 * SDLCALL SDL_GetKeyState(int *numkeys); + +/** + * Get the current key modifier state + */ +extern DECLSPEC SDLMod SDLCALL SDL_GetModState(void); + +/** + * Set the current key modifier state. + * This does not change the keyboard state, only the key modifier flags. + */ +extern DECLSPEC void SDLCALL SDL_SetModState(SDLMod modstate); + +/** + * Get the name of an SDL virtual keysym + */ +extern DECLSPEC char * SDLCALL SDL_GetKeyName(SDLKey key); + + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* _SDL_keyboard_h */ diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/include/SDL_keysym.h b/dep/recastnavigation/RecastDemo/Contrib/SDL/include/SDL_keysym.h new file mode 100644 index 000000000..90101286e --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/include/SDL_keysym.h @@ -0,0 +1,326 @@ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + Sam Lantinga + slouken@libsdl.org +*/ + +#ifndef _SDL_keysym_h +#define _SDL_keysym_h + +/** What we really want is a mapping of every raw key on the keyboard. + * To support international keyboards, we use the range 0xA1 - 0xFF + * as international virtual keycodes. We'll follow in the footsteps of X11... + * @brief The names of the keys + */ +typedef enum { + /** @name ASCII mapped keysyms + * The keyboard syms have been cleverly chosen to map to ASCII + */ + /*@{*/ + SDLK_UNKNOWN = 0, + SDLK_FIRST = 0, + SDLK_BACKSPACE = 8, + SDLK_TAB = 9, + SDLK_CLEAR = 12, + SDLK_RETURN = 13, + SDLK_PAUSE = 19, + SDLK_ESCAPE = 27, + SDLK_SPACE = 32, + SDLK_EXCLAIM = 33, + SDLK_QUOTEDBL = 34, + SDLK_HASH = 35, + SDLK_DOLLAR = 36, + SDLK_AMPERSAND = 38, + SDLK_QUOTE = 39, + SDLK_LEFTPAREN = 40, + SDLK_RIGHTPAREN = 41, + SDLK_ASTERISK = 42, + SDLK_PLUS = 43, + SDLK_COMMA = 44, + SDLK_MINUS = 45, + SDLK_PERIOD = 46, + SDLK_SLASH = 47, + SDLK_0 = 48, + SDLK_1 = 49, + SDLK_2 = 50, + SDLK_3 = 51, + SDLK_4 = 52, + SDLK_5 = 53, + SDLK_6 = 54, + SDLK_7 = 55, + SDLK_8 = 56, + SDLK_9 = 57, + SDLK_COLON = 58, + SDLK_SEMICOLON = 59, + SDLK_LESS = 60, + SDLK_EQUALS = 61, + SDLK_GREATER = 62, + SDLK_QUESTION = 63, + SDLK_AT = 64, + /* + Skip uppercase letters + */ + SDLK_LEFTBRACKET = 91, + SDLK_BACKSLASH = 92, + SDLK_RIGHTBRACKET = 93, + SDLK_CARET = 94, + SDLK_UNDERSCORE = 95, + SDLK_BACKQUOTE = 96, + SDLK_a = 97, + SDLK_b = 98, + SDLK_c = 99, + SDLK_d = 100, + SDLK_e = 101, + SDLK_f = 102, + SDLK_g = 103, + SDLK_h = 104, + SDLK_i = 105, + SDLK_j = 106, + SDLK_k = 107, + SDLK_l = 108, + SDLK_m = 109, + SDLK_n = 110, + SDLK_o = 111, + SDLK_p = 112, + SDLK_q = 113, + SDLK_r = 114, + SDLK_s = 115, + SDLK_t = 116, + SDLK_u = 117, + SDLK_v = 118, + SDLK_w = 119, + SDLK_x = 120, + SDLK_y = 121, + SDLK_z = 122, + SDLK_DELETE = 127, + /* End of ASCII mapped keysyms */ + /*@}*/ + + /** @name International keyboard syms */ + /*@{*/ + SDLK_WORLD_0 = 160, /* 0xA0 */ + SDLK_WORLD_1 = 161, + SDLK_WORLD_2 = 162, + SDLK_WORLD_3 = 163, + SDLK_WORLD_4 = 164, + SDLK_WORLD_5 = 165, + SDLK_WORLD_6 = 166, + SDLK_WORLD_7 = 167, + SDLK_WORLD_8 = 168, + SDLK_WORLD_9 = 169, + SDLK_WORLD_10 = 170, + SDLK_WORLD_11 = 171, + SDLK_WORLD_12 = 172, + SDLK_WORLD_13 = 173, + SDLK_WORLD_14 = 174, + SDLK_WORLD_15 = 175, + SDLK_WORLD_16 = 176, + SDLK_WORLD_17 = 177, + SDLK_WORLD_18 = 178, + SDLK_WORLD_19 = 179, + SDLK_WORLD_20 = 180, + SDLK_WORLD_21 = 181, + SDLK_WORLD_22 = 182, + SDLK_WORLD_23 = 183, + SDLK_WORLD_24 = 184, + SDLK_WORLD_25 = 185, + SDLK_WORLD_26 = 186, + SDLK_WORLD_27 = 187, + SDLK_WORLD_28 = 188, + SDLK_WORLD_29 = 189, + SDLK_WORLD_30 = 190, + SDLK_WORLD_31 = 191, + SDLK_WORLD_32 = 192, + SDLK_WORLD_33 = 193, + SDLK_WORLD_34 = 194, + SDLK_WORLD_35 = 195, + SDLK_WORLD_36 = 196, + SDLK_WORLD_37 = 197, + SDLK_WORLD_38 = 198, + SDLK_WORLD_39 = 199, + SDLK_WORLD_40 = 200, + SDLK_WORLD_41 = 201, + SDLK_WORLD_42 = 202, + SDLK_WORLD_43 = 203, + SDLK_WORLD_44 = 204, + SDLK_WORLD_45 = 205, + SDLK_WORLD_46 = 206, + SDLK_WORLD_47 = 207, + SDLK_WORLD_48 = 208, + SDLK_WORLD_49 = 209, + SDLK_WORLD_50 = 210, + SDLK_WORLD_51 = 211, + SDLK_WORLD_52 = 212, + SDLK_WORLD_53 = 213, + SDLK_WORLD_54 = 214, + SDLK_WORLD_55 = 215, + SDLK_WORLD_56 = 216, + SDLK_WORLD_57 = 217, + SDLK_WORLD_58 = 218, + SDLK_WORLD_59 = 219, + SDLK_WORLD_60 = 220, + SDLK_WORLD_61 = 221, + SDLK_WORLD_62 = 222, + SDLK_WORLD_63 = 223, + SDLK_WORLD_64 = 224, + SDLK_WORLD_65 = 225, + SDLK_WORLD_66 = 226, + SDLK_WORLD_67 = 227, + SDLK_WORLD_68 = 228, + SDLK_WORLD_69 = 229, + SDLK_WORLD_70 = 230, + SDLK_WORLD_71 = 231, + SDLK_WORLD_72 = 232, + SDLK_WORLD_73 = 233, + SDLK_WORLD_74 = 234, + SDLK_WORLD_75 = 235, + SDLK_WORLD_76 = 236, + SDLK_WORLD_77 = 237, + SDLK_WORLD_78 = 238, + SDLK_WORLD_79 = 239, + SDLK_WORLD_80 = 240, + SDLK_WORLD_81 = 241, + SDLK_WORLD_82 = 242, + SDLK_WORLD_83 = 243, + SDLK_WORLD_84 = 244, + SDLK_WORLD_85 = 245, + SDLK_WORLD_86 = 246, + SDLK_WORLD_87 = 247, + SDLK_WORLD_88 = 248, + SDLK_WORLD_89 = 249, + SDLK_WORLD_90 = 250, + SDLK_WORLD_91 = 251, + SDLK_WORLD_92 = 252, + SDLK_WORLD_93 = 253, + SDLK_WORLD_94 = 254, + SDLK_WORLD_95 = 255, /* 0xFF */ + /*@}*/ + + /** @name Numeric keypad */ + /*@{*/ + SDLK_KP0 = 256, + SDLK_KP1 = 257, + SDLK_KP2 = 258, + SDLK_KP3 = 259, + SDLK_KP4 = 260, + SDLK_KP5 = 261, + SDLK_KP6 = 262, + SDLK_KP7 = 263, + SDLK_KP8 = 264, + SDLK_KP9 = 265, + SDLK_KP_PERIOD = 266, + SDLK_KP_DIVIDE = 267, + SDLK_KP_MULTIPLY = 268, + SDLK_KP_MINUS = 269, + SDLK_KP_PLUS = 270, + SDLK_KP_ENTER = 271, + SDLK_KP_EQUALS = 272, + /*@}*/ + + /** @name Arrows + Home/End pad */ + /*@{*/ + SDLK_UP = 273, + SDLK_DOWN = 274, + SDLK_RIGHT = 275, + SDLK_LEFT = 276, + SDLK_INSERT = 277, + SDLK_HOME = 278, + SDLK_END = 279, + SDLK_PAGEUP = 280, + SDLK_PAGEDOWN = 281, + /*@}*/ + + /** @name Function keys */ + /*@{*/ + SDLK_F1 = 282, + SDLK_F2 = 283, + SDLK_F3 = 284, + SDLK_F4 = 285, + SDLK_F5 = 286, + SDLK_F6 = 287, + SDLK_F7 = 288, + SDLK_F8 = 289, + SDLK_F9 = 290, + SDLK_F10 = 291, + SDLK_F11 = 292, + SDLK_F12 = 293, + SDLK_F13 = 294, + SDLK_F14 = 295, + SDLK_F15 = 296, + /*@}*/ + + /** @name Key state modifier keys */ + /*@{*/ + SDLK_NUMLOCK = 300, + SDLK_CAPSLOCK = 301, + SDLK_SCROLLOCK = 302, + SDLK_RSHIFT = 303, + SDLK_LSHIFT = 304, + SDLK_RCTRL = 305, + SDLK_LCTRL = 306, + SDLK_RALT = 307, + SDLK_LALT = 308, + SDLK_RMETA = 309, + SDLK_LMETA = 310, + SDLK_LSUPER = 311, /**< Left "Windows" key */ + SDLK_RSUPER = 312, /**< Right "Windows" key */ + SDLK_MODE = 313, /**< "Alt Gr" key */ + SDLK_COMPOSE = 314, /**< Multi-key compose key */ + /*@}*/ + + /** @name Miscellaneous function keys */ + /*@{*/ + SDLK_HELP = 315, + SDLK_PRINT = 316, + SDLK_SYSREQ = 317, + SDLK_BREAK = 318, + SDLK_MENU = 319, + SDLK_POWER = 320, /**< Power Macintosh power key */ + SDLK_EURO = 321, /**< Some european keyboards */ + SDLK_UNDO = 322, /**< Atari keyboard has Undo */ + /*@}*/ + + /* Add any other keys here */ + + SDLK_LAST +} SDLKey; + +/** Enumeration of valid key mods (possibly OR'd together) */ +typedef enum { + KMOD_NONE = 0x0000, + KMOD_LSHIFT= 0x0001, + KMOD_RSHIFT= 0x0002, + KMOD_LCTRL = 0x0040, + KMOD_RCTRL = 0x0080, + KMOD_LALT = 0x0100, + KMOD_RALT = 0x0200, + KMOD_LMETA = 0x0400, + KMOD_RMETA = 0x0800, + KMOD_NUM = 0x1000, + KMOD_CAPS = 0x2000, + KMOD_MODE = 0x4000, + KMOD_RESERVED = 0x8000 +} SDLMod; + +#define KMOD_CTRL (KMOD_LCTRL|KMOD_RCTRL) +#define KMOD_SHIFT (KMOD_LSHIFT|KMOD_RSHIFT) +#define KMOD_ALT (KMOD_LALT|KMOD_RALT) +#define KMOD_META (KMOD_LMETA|KMOD_RMETA) + +#endif /* _SDL_keysym_h */ diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/include/SDL_loadso.h b/dep/recastnavigation/RecastDemo/Contrib/SDL/include/SDL_loadso.h new file mode 100644 index 000000000..45a17f9f4 --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/include/SDL_loadso.h @@ -0,0 +1,78 @@ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + Sam Lantinga + slouken@libsdl.org +*/ + +/** @file SDL_loadso.h + * System dependent library loading routines + */ + +/** @file SDL_loadso.h + * Some things to keep in mind: + * - These functions only work on C function names. Other languages may + * have name mangling and intrinsic language support that varies from + * compiler to compiler. + * - Make sure you declare your function pointers with the same calling + * convention as the actual library function. Your code will crash + * mysteriously if you do not do this. + * - Avoid namespace collisions. If you load a symbol from the library, + * it is not defined whether or not it goes into the global symbol + * namespace for the application. If it does and it conflicts with + * symbols in your code or other shared libraries, you will not get + * the results you expect. :) + */ + + +#ifndef _SDL_loadso_h +#define _SDL_loadso_h + +#include "SDL_stdinc.h" +#include "SDL_error.h" + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/** + * This function dynamically loads a shared object and returns a pointer + * to the object handle (or NULL if there was an error). + * The 'sofile' parameter is a system dependent name of the object file. + */ +extern DECLSPEC void * SDLCALL SDL_LoadObject(const char *sofile); + +/** + * Given an object handle, this function looks up the address of the + * named function in the shared object and returns it. This address + * is no longer valid after calling SDL_UnloadObject(). + */ +extern DECLSPEC void * SDLCALL SDL_LoadFunction(void *handle, const char *name); + +/** Unload a shared object from memory */ +extern DECLSPEC void SDLCALL SDL_UnloadObject(void *handle); + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* _SDL_loadso_h */ diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/include/SDL_main.h b/dep/recastnavigation/RecastDemo/Contrib/SDL/include/SDL_main.h new file mode 100644 index 000000000..b7f6b2c82 --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/include/SDL_main.h @@ -0,0 +1,106 @@ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + Sam Lantinga + slouken@libsdl.org +*/ + +#ifndef _SDL_main_h +#define _SDL_main_h + +#include "SDL_stdinc.h" + +/** @file SDL_main.h + * Redefine main() on Win32 and MacOS so that it is called by winmain.c + */ + +#if defined(__WIN32__) || \ + (defined(__MWERKS__) && !defined(__BEOS__)) || \ + defined(__MACOS__) || defined(__MACOSX__) || \ + defined(__SYMBIAN32__) || defined(QWS) + +#ifdef __cplusplus +#define C_LINKAGE "C" +#else +#define C_LINKAGE +#endif /* __cplusplus */ + +/** The application's main() function must be called with C linkage, + * and should be declared like this: + * @code + * #ifdef __cplusplus + * extern "C" + * #endif + * int main(int argc, char *argv[]) + * { + * } + * @endcode + */ +#define main SDL_main + +/** The prototype for the application's main() function */ +extern C_LINKAGE int SDL_main(int argc, char *argv[]); + + +/** @name From the SDL library code -- needed for registering the app on Win32 */ +/*@{*/ +#ifdef __WIN32__ + +#include "begin_code.h" +#ifdef __cplusplus +extern "C" { +#endif + +/** This should be called from your WinMain() function, if any */ +extern DECLSPEC void SDLCALL SDL_SetModuleHandle(void *hInst); +/** This can also be called, but is no longer necessary */ +extern DECLSPEC int SDLCALL SDL_RegisterApp(char *name, Uint32 style, void *hInst); +/** This can also be called, but is no longer necessary (SDL_Quit calls it) */ +extern DECLSPEC void SDLCALL SDL_UnregisterApp(void); +#ifdef __cplusplus +} +#endif +#include "close_code.h" +#endif +/*@}*/ + +/** @name From the SDL library code -- needed for registering QuickDraw on MacOS */ +/*@{*/ +#if defined(__MACOS__) + +#include "begin_code.h" +#ifdef __cplusplus +extern "C" { +#endif + +/** Forward declaration so we don't need to include QuickDraw.h */ +struct QDGlobals; + +/** This should be called from your main() function, if any */ +extern DECLSPEC void SDLCALL SDL_InitQuickDraw(struct QDGlobals *the_qd); + +#ifdef __cplusplus +} +#endif +#include "close_code.h" +#endif +/*@}*/ + +#endif /* Need to redefine main()? */ + +#endif /* _SDL_main_h */ diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/include/SDL_mouse.h b/dep/recastnavigation/RecastDemo/Contrib/SDL/include/SDL_mouse.h new file mode 100644 index 000000000..a573f04ee --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/include/SDL_mouse.h @@ -0,0 +1,143 @@ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + Sam Lantinga + slouken@libsdl.org +*/ + +/** @file SDL_mouse.h + * Include file for SDL mouse event handling + */ + +#ifndef _SDL_mouse_h +#define _SDL_mouse_h + +#include "SDL_stdinc.h" +#include "SDL_error.h" +#include "SDL_video.h" + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct WMcursor WMcursor; /**< Implementation dependent */ +typedef struct SDL_Cursor { + SDL_Rect area; /**< The area of the mouse cursor */ + Sint16 hot_x, hot_y; /**< The "tip" of the cursor */ + Uint8 *data; /**< B/W cursor data */ + Uint8 *mask; /**< B/W cursor mask */ + Uint8 *save[2]; /**< Place to save cursor area */ + WMcursor *wm_cursor; /**< Window-manager cursor */ +} SDL_Cursor; + +/* Function prototypes */ +/** + * Retrieve the current state of the mouse. + * The current button state is returned as a button bitmask, which can + * be tested using the SDL_BUTTON(X) macros, and x and y are set to the + * current mouse cursor position. You can pass NULL for either x or y. + */ +extern DECLSPEC Uint8 SDLCALL SDL_GetMouseState(int *x, int *y); + +/** + * Retrieve the current state of the mouse. + * The current button state is returned as a button bitmask, which can + * be tested using the SDL_BUTTON(X) macros, and x and y are set to the + * mouse deltas since the last call to SDL_GetRelativeMouseState(). + */ +extern DECLSPEC Uint8 SDLCALL SDL_GetRelativeMouseState(int *x, int *y); + +/** + * Set the position of the mouse cursor (generates a mouse motion event) + */ +extern DECLSPEC void SDLCALL SDL_WarpMouse(Uint16 x, Uint16 y); + +/** + * Create a cursor using the specified data and mask (in MSB format). + * The cursor width must be a multiple of 8 bits. + * + * The cursor is created in black and white according to the following: + * data mask resulting pixel on screen + * 0 1 White + * 1 1 Black + * 0 0 Transparent + * 1 0 Inverted color if possible, black if not. + * + * Cursors created with this function must be freed with SDL_FreeCursor(). + */ +extern DECLSPEC SDL_Cursor * SDLCALL SDL_CreateCursor + (Uint8 *data, Uint8 *mask, int w, int h, int hot_x, int hot_y); + +/** + * Set the currently active cursor to the specified one. + * If the cursor is currently visible, the change will be immediately + * represented on the display. + */ +extern DECLSPEC void SDLCALL SDL_SetCursor(SDL_Cursor *cursor); + +/** + * Returns the currently active cursor. + */ +extern DECLSPEC SDL_Cursor * SDLCALL SDL_GetCursor(void); + +/** + * Deallocates a cursor created with SDL_CreateCursor(). + */ +extern DECLSPEC void SDLCALL SDL_FreeCursor(SDL_Cursor *cursor); + +/** + * Toggle whether or not the cursor is shown on the screen. + * The cursor start off displayed, but can be turned off. + * SDL_ShowCursor() returns 1 if the cursor was being displayed + * before the call, or 0 if it was not. You can query the current + * state by passing a 'toggle' value of -1. + */ +extern DECLSPEC int SDLCALL SDL_ShowCursor(int toggle); + +/*@{*/ +/** Used as a mask when testing buttons in buttonstate + * Button 1: Left mouse button + * Button 2: Middle mouse button + * Button 3: Right mouse button + * Button 4: Mouse wheel up (may also be a real button) + * Button 5: Mouse wheel down (may also be a real button) + */ +#define SDL_BUTTON(X) (1 << ((X)-1)) +#define SDL_BUTTON_LEFT 1 +#define SDL_BUTTON_MIDDLE 2 +#define SDL_BUTTON_RIGHT 3 +#define SDL_BUTTON_WHEELUP 4 +#define SDL_BUTTON_WHEELDOWN 5 +#define SDL_BUTTON_X1 6 +#define SDL_BUTTON_X2 7 +#define SDL_BUTTON_LMASK SDL_BUTTON(SDL_BUTTON_LEFT) +#define SDL_BUTTON_MMASK SDL_BUTTON(SDL_BUTTON_MIDDLE) +#define SDL_BUTTON_RMASK SDL_BUTTON(SDL_BUTTON_RIGHT) +#define SDL_BUTTON_X1MASK SDL_BUTTON(SDL_BUTTON_X1) +#define SDL_BUTTON_X2MASK SDL_BUTTON(SDL_BUTTON_X2) +/*@}*/ + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* _SDL_mouse_h */ diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/include/SDL_mutex.h b/dep/recastnavigation/RecastDemo/Contrib/SDL/include/SDL_mutex.h new file mode 100644 index 000000000..920971dfa --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/include/SDL_mutex.h @@ -0,0 +1,177 @@ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + Sam Lantinga + slouken@libsdl.org +*/ + +#ifndef _SDL_mutex_h +#define _SDL_mutex_h + +/** @file SDL_mutex.h + * Functions to provide thread synchronization primitives + * + * @note These are independent of the other SDL routines. + */ + +#include "SDL_stdinc.h" +#include "SDL_error.h" + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/** Synchronization functions which can time out return this value + * if they time out. + */ +#define SDL_MUTEX_TIMEDOUT 1 + +/** This is the timeout value which corresponds to never time out */ +#define SDL_MUTEX_MAXWAIT (~(Uint32)0) + + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +/** @name Mutex functions */ /*@{*/ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +/** The SDL mutex structure, defined in SDL_mutex.c */ +struct SDL_mutex; +typedef struct SDL_mutex SDL_mutex; + +/** Create a mutex, initialized unlocked */ +extern DECLSPEC SDL_mutex * SDLCALL SDL_CreateMutex(void); + +#define SDL_LockMutex(m) SDL_mutexP(m) +/** Lock the mutex + * @return 0, or -1 on error + */ +extern DECLSPEC int SDLCALL SDL_mutexP(SDL_mutex *mutex); + +#define SDL_UnlockMutex(m) SDL_mutexV(m) +/** Unlock the mutex + * @return 0, or -1 on error + * + * It is an error to unlock a mutex that has not been locked by + * the current thread, and doing so results in undefined behavior. + */ +extern DECLSPEC int SDLCALL SDL_mutexV(SDL_mutex *mutex); + +/** Destroy a mutex */ +extern DECLSPEC void SDLCALL SDL_DestroyMutex(SDL_mutex *mutex); + +/*@}*/ + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +/** @name Semaphore functions */ /*@{*/ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +/** The SDL semaphore structure, defined in SDL_sem.c */ +struct SDL_semaphore; +typedef struct SDL_semaphore SDL_sem; + +/** Create a semaphore, initialized with value, returns NULL on failure. */ +extern DECLSPEC SDL_sem * SDLCALL SDL_CreateSemaphore(Uint32 initial_value); + +/** Destroy a semaphore */ +extern DECLSPEC void SDLCALL SDL_DestroySemaphore(SDL_sem *sem); + +/** + * This function suspends the calling thread until the semaphore pointed + * to by sem has a positive count. It then atomically decreases the semaphore + * count. + */ +extern DECLSPEC int SDLCALL SDL_SemWait(SDL_sem *sem); + +/** Non-blocking variant of SDL_SemWait(). + * @return 0 if the wait succeeds, + * SDL_MUTEX_TIMEDOUT if the wait would block, and -1 on error. + */ +extern DECLSPEC int SDLCALL SDL_SemTryWait(SDL_sem *sem); + +/** Variant of SDL_SemWait() with a timeout in milliseconds, returns 0 if + * the wait succeeds, SDL_MUTEX_TIMEDOUT if the wait does not succeed in + * the allotted time, and -1 on error. + * + * On some platforms this function is implemented by looping with a delay + * of 1 ms, and so should be avoided if possible. + */ +extern DECLSPEC int SDLCALL SDL_SemWaitTimeout(SDL_sem *sem, Uint32 ms); + +/** Atomically increases the semaphore's count (not blocking). + * @return 0, or -1 on error. + */ +extern DECLSPEC int SDLCALL SDL_SemPost(SDL_sem *sem); + +/** Returns the current count of the semaphore */ +extern DECLSPEC Uint32 SDLCALL SDL_SemValue(SDL_sem *sem); + +/*@}*/ + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +/** @name Condition_variable_functions */ /*@{*/ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +/*@{*/ +/** The SDL condition variable structure, defined in SDL_cond.c */ +struct SDL_cond; +typedef struct SDL_cond SDL_cond; +/*@}*/ + +/** Create a condition variable */ +extern DECLSPEC SDL_cond * SDLCALL SDL_CreateCond(void); + +/** Destroy a condition variable */ +extern DECLSPEC void SDLCALL SDL_DestroyCond(SDL_cond *cond); + +/** Restart one of the threads that are waiting on the condition variable, + * @return 0 or -1 on error. + */ +extern DECLSPEC int SDLCALL SDL_CondSignal(SDL_cond *cond); + +/** Restart all threads that are waiting on the condition variable, + * @return 0 or -1 on error. + */ +extern DECLSPEC int SDLCALL SDL_CondBroadcast(SDL_cond *cond); + +/** Wait on the condition variable, unlocking the provided mutex. + * The mutex must be locked before entering this function! + * The mutex is re-locked once the condition variable is signaled. + * @return 0 when it is signaled, or -1 on error. + */ +extern DECLSPEC int SDLCALL SDL_CondWait(SDL_cond *cond, SDL_mutex *mut); + +/** Waits for at most 'ms' milliseconds, and returns 0 if the condition + * variable is signaled, SDL_MUTEX_TIMEDOUT if the condition is not + * signaled in the allotted time, and -1 on error. + * On some platforms this function is implemented by looping with a delay + * of 1 ms, and so should be avoided if possible. + */ +extern DECLSPEC int SDLCALL SDL_CondWaitTimeout(SDL_cond *cond, SDL_mutex *mutex, Uint32 ms); + +/*@}*/ + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* _SDL_mutex_h */ + diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/include/SDL_name.h b/dep/recastnavigation/RecastDemo/Contrib/SDL/include/SDL_name.h new file mode 100644 index 000000000..511619af5 --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/include/SDL_name.h @@ -0,0 +1,11 @@ + +#ifndef _SDLname_h_ +#define _SDLname_h_ + +#if defined(__STDC__) || defined(__cplusplus) +#define NeedFunctionPrototypes 1 +#endif + +#define SDL_NAME(X) SDL_##X + +#endif /* _SDLname_h_ */ diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/include/SDL_opengl.h b/dep/recastnavigation/RecastDemo/Contrib/SDL/include/SDL_opengl.h new file mode 100644 index 000000000..c479a3a4e --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/include/SDL_opengl.h @@ -0,0 +1,6556 @@ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + Sam Lantinga + slouken@libsdl.org +*/ + +/** @file SDL_opengl.h + * This is a simple file to encapsulate the OpenGL API headers + */ + +#include "SDL_config.h" + +#ifdef __WIN32__ +#define WIN32_LEAN_AND_MEAN +#ifndef NOMINMAX +#define NOMINMAX /* Don't defined min() and max() */ +#endif +#include +#endif +#ifndef NO_SDL_GLEXT +#define __glext_h_ /* Don't let gl.h include glext.h */ +#endif +#if defined(__MACOSX__) +#include /* Header File For The OpenGL Library */ +#include /* Header File For The GLU Library */ +#elif defined(__MACOS__) +#include /* Header File For The OpenGL Library */ +#include /* Header File For The GLU Library */ +#else +#include /* Header File For The OpenGL Library */ +#include /* Header File For The GLU Library */ +#endif +#ifndef NO_SDL_GLEXT +#undef __glext_h_ +#endif + +/** @name GLext.h + * This file taken from "GLext.h" from the Jeff Molofee OpenGL tutorials. + * It is included here because glext.h is not available on some systems. + * If you don't want this version included, simply define "NO_SDL_GLEXT" + */ +/*@{*/ +#ifndef NO_SDL_GLEXT +#if !defined(__glext_h_) && !defined(GL_GLEXT_LEGACY) +#define __glext_h_ + +#ifdef __cplusplus +extern "C" { +#endif + +/* +** License Applicability. Except to the extent portions of this file are +** made subject to an alternative license as permitted in the SGI Free +** Software License B, Version 1.1 (the "License"), the contents of this +** file are subject only to the provisions of the License. You may not use +** this file except in compliance with the License. You may obtain a copy +** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600 +** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at: +** +** http://oss.sgi.com/projects/FreeB +** +** Note that, as provided in the License, the Software is distributed on an +** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS +** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND +** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A +** PARTICULAR PURPOSE, AND NON-INFRINGEMENT. +** +** Original Code. The Original Code is: OpenGL Sample Implementation, +** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, +** Inc. The Original Code is Copyright (c) 1991-2004 Silicon Graphics, Inc. +** Copyright in any portions created by third parties is as indicated +** elsewhere herein. All Rights Reserved. +** +** Additional Notice Provisions: This software was created using the +** OpenGL(R) version 1.2.1 Sample Implementation published by SGI, but has +** not been independently verified as being compliant with the OpenGL(R) +** version 1.2.1 Specification. +*/ + +#if defined(_WIN32) && !defined(APIENTRY) && !defined(__CYGWIN__) && !defined(__SCITECH_SNAP__) +#define WIN32_LEAN_AND_MEAN 1 +#include +#endif + +#ifndef APIENTRY +#define APIENTRY +#endif +#ifndef APIENTRYP +#define APIENTRYP APIENTRY * +#endif +#ifndef GLAPI +#define GLAPI extern +#endif + +/*************************************************************/ + +/* Header file version number, required by OpenGL ABI for Linux */ +/* glext.h last updated 2005/06/20 */ +/* Current version at http://oss.sgi.com/projects/ogl-sample/registry/ */ +#define GL_GLEXT_VERSION 29 + +#ifndef GL_VERSION_1_2 +#define GL_UNSIGNED_BYTE_3_3_2 0x8032 +#define GL_UNSIGNED_SHORT_4_4_4_4 0x8033 +#define GL_UNSIGNED_SHORT_5_5_5_1 0x8034 +#define GL_UNSIGNED_INT_8_8_8_8 0x8035 +#define GL_UNSIGNED_INT_10_10_10_2 0x8036 +#define GL_RESCALE_NORMAL 0x803A +#define GL_TEXTURE_BINDING_3D 0x806A +#define GL_PACK_SKIP_IMAGES 0x806B +#define GL_PACK_IMAGE_HEIGHT 0x806C +#define GL_UNPACK_SKIP_IMAGES 0x806D +#define GL_UNPACK_IMAGE_HEIGHT 0x806E +#define GL_TEXTURE_3D 0x806F +#define GL_PROXY_TEXTURE_3D 0x8070 +#define GL_TEXTURE_DEPTH 0x8071 +#define GL_TEXTURE_WRAP_R 0x8072 +#define GL_MAX_3D_TEXTURE_SIZE 0x8073 +#define GL_UNSIGNED_BYTE_2_3_3_REV 0x8362 +#define GL_UNSIGNED_SHORT_5_6_5 0x8363 +#define GL_UNSIGNED_SHORT_5_6_5_REV 0x8364 +#define GL_UNSIGNED_SHORT_4_4_4_4_REV 0x8365 +#define GL_UNSIGNED_SHORT_1_5_5_5_REV 0x8366 +#define GL_UNSIGNED_INT_8_8_8_8_REV 0x8367 +#define GL_UNSIGNED_INT_2_10_10_10_REV 0x8368 +#define GL_BGR 0x80E0 +#define GL_BGRA 0x80E1 +#define GL_MAX_ELEMENTS_VERTICES 0x80E8 +#define GL_MAX_ELEMENTS_INDICES 0x80E9 +#define GL_CLAMP_TO_EDGE 0x812F +#define GL_TEXTURE_MIN_LOD 0x813A +#define GL_TEXTURE_MAX_LOD 0x813B +#define GL_TEXTURE_BASE_LEVEL 0x813C +#define GL_TEXTURE_MAX_LEVEL 0x813D +#define GL_LIGHT_MODEL_COLOR_CONTROL 0x81F8 +#define GL_SINGLE_COLOR 0x81F9 +#define GL_SEPARATE_SPECULAR_COLOR 0x81FA +#define GL_SMOOTH_POINT_SIZE_RANGE 0x0B12 +#define GL_SMOOTH_POINT_SIZE_GRANULARITY 0x0B13 +#define GL_SMOOTH_LINE_WIDTH_RANGE 0x0B22 +#define GL_SMOOTH_LINE_WIDTH_GRANULARITY 0x0B23 +#define GL_ALIASED_POINT_SIZE_RANGE 0x846D +#define GL_ALIASED_LINE_WIDTH_RANGE 0x846E +#endif + +#ifndef GL_ARB_imaging +#define GL_CONSTANT_COLOR 0x8001 +#define GL_ONE_MINUS_CONSTANT_COLOR 0x8002 +#define GL_CONSTANT_ALPHA 0x8003 +#define GL_ONE_MINUS_CONSTANT_ALPHA 0x8004 +#define GL_BLEND_COLOR 0x8005 +#define GL_FUNC_ADD 0x8006 +#define GL_MIN 0x8007 +#define GL_MAX 0x8008 +#define GL_BLEND_EQUATION 0x8009 +#define GL_FUNC_SUBTRACT 0x800A +#define GL_FUNC_REVERSE_SUBTRACT 0x800B +#define GL_CONVOLUTION_1D 0x8010 +#define GL_CONVOLUTION_2D 0x8011 +#define GL_SEPARABLE_2D 0x8012 +#define GL_CONVOLUTION_BORDER_MODE 0x8013 +#define GL_CONVOLUTION_FILTER_SCALE 0x8014 +#define GL_CONVOLUTION_FILTER_BIAS 0x8015 +#define GL_REDUCE 0x8016 +#define GL_CONVOLUTION_FORMAT 0x8017 +#define GL_CONVOLUTION_WIDTH 0x8018 +#define GL_CONVOLUTION_HEIGHT 0x8019 +#define GL_MAX_CONVOLUTION_WIDTH 0x801A +#define GL_MAX_CONVOLUTION_HEIGHT 0x801B +#define GL_POST_CONVOLUTION_RED_SCALE 0x801C +#define GL_POST_CONVOLUTION_GREEN_SCALE 0x801D +#define GL_POST_CONVOLUTION_BLUE_SCALE 0x801E +#define GL_POST_CONVOLUTION_ALPHA_SCALE 0x801F +#define GL_POST_CONVOLUTION_RED_BIAS 0x8020 +#define GL_POST_CONVOLUTION_GREEN_BIAS 0x8021 +#define GL_POST_CONVOLUTION_BLUE_BIAS 0x8022 +#define GL_POST_CONVOLUTION_ALPHA_BIAS 0x8023 +#define GL_HISTOGRAM 0x8024 +#define GL_PROXY_HISTOGRAM 0x8025 +#define GL_HISTOGRAM_WIDTH 0x8026 +#define GL_HISTOGRAM_FORMAT 0x8027 +#define GL_HISTOGRAM_RED_SIZE 0x8028 +#define GL_HISTOGRAM_GREEN_SIZE 0x8029 +#define GL_HISTOGRAM_BLUE_SIZE 0x802A +#define GL_HISTOGRAM_ALPHA_SIZE 0x802B +#define GL_HISTOGRAM_LUMINANCE_SIZE 0x802C +#define GL_HISTOGRAM_SINK 0x802D +#define GL_MINMAX 0x802E +#define GL_MINMAX_FORMAT 0x802F +#define GL_MINMAX_SINK 0x8030 +#define GL_TABLE_TOO_LARGE 0x8031 +#define GL_COLOR_MATRIX 0x80B1 +#define GL_COLOR_MATRIX_STACK_DEPTH 0x80B2 +#define GL_MAX_COLOR_MATRIX_STACK_DEPTH 0x80B3 +#define GL_POST_COLOR_MATRIX_RED_SCALE 0x80B4 +#define GL_POST_COLOR_MATRIX_GREEN_SCALE 0x80B5 +#define GL_POST_COLOR_MATRIX_BLUE_SCALE 0x80B6 +#define GL_POST_COLOR_MATRIX_ALPHA_SCALE 0x80B7 +#define GL_POST_COLOR_MATRIX_RED_BIAS 0x80B8 +#define GL_POST_COLOR_MATRIX_GREEN_BIAS 0x80B9 +#define GL_POST_COLOR_MATRIX_BLUE_BIAS 0x80BA +#define GL_POST_COLOR_MATRIX_ALPHA_BIAS 0x80BB +#define GL_COLOR_TABLE 0x80D0 +#define GL_POST_CONVOLUTION_COLOR_TABLE 0x80D1 +#define GL_POST_COLOR_MATRIX_COLOR_TABLE 0x80D2 +#define GL_PROXY_COLOR_TABLE 0x80D3 +#define GL_PROXY_POST_CONVOLUTION_COLOR_TABLE 0x80D4 +#define GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE 0x80D5 +#define GL_COLOR_TABLE_SCALE 0x80D6 +#define GL_COLOR_TABLE_BIAS 0x80D7 +#define GL_COLOR_TABLE_FORMAT 0x80D8 +#define GL_COLOR_TABLE_WIDTH 0x80D9 +#define GL_COLOR_TABLE_RED_SIZE 0x80DA +#define GL_COLOR_TABLE_GREEN_SIZE 0x80DB +#define GL_COLOR_TABLE_BLUE_SIZE 0x80DC +#define GL_COLOR_TABLE_ALPHA_SIZE 0x80DD +#define GL_COLOR_TABLE_LUMINANCE_SIZE 0x80DE +#define GL_COLOR_TABLE_INTENSITY_SIZE 0x80DF +#define GL_CONSTANT_BORDER 0x8151 +#define GL_REPLICATE_BORDER 0x8153 +#define GL_CONVOLUTION_BORDER_COLOR 0x8154 +#endif + +#ifndef GL_VERSION_1_3 +#define GL_TEXTURE0 0x84C0 +#define GL_TEXTURE1 0x84C1 +#define GL_TEXTURE2 0x84C2 +#define GL_TEXTURE3 0x84C3 +#define GL_TEXTURE4 0x84C4 +#define GL_TEXTURE5 0x84C5 +#define GL_TEXTURE6 0x84C6 +#define GL_TEXTURE7 0x84C7 +#define GL_TEXTURE8 0x84C8 +#define GL_TEXTURE9 0x84C9 +#define GL_TEXTURE10 0x84CA +#define GL_TEXTURE11 0x84CB +#define GL_TEXTURE12 0x84CC +#define GL_TEXTURE13 0x84CD +#define GL_TEXTURE14 0x84CE +#define GL_TEXTURE15 0x84CF +#define GL_TEXTURE16 0x84D0 +#define GL_TEXTURE17 0x84D1 +#define GL_TEXTURE18 0x84D2 +#define GL_TEXTURE19 0x84D3 +#define GL_TEXTURE20 0x84D4 +#define GL_TEXTURE21 0x84D5 +#define GL_TEXTURE22 0x84D6 +#define GL_TEXTURE23 0x84D7 +#define GL_TEXTURE24 0x84D8 +#define GL_TEXTURE25 0x84D9 +#define GL_TEXTURE26 0x84DA +#define GL_TEXTURE27 0x84DB +#define GL_TEXTURE28 0x84DC +#define GL_TEXTURE29 0x84DD +#define GL_TEXTURE30 0x84DE +#define GL_TEXTURE31 0x84DF +#define GL_ACTIVE_TEXTURE 0x84E0 +#define GL_CLIENT_ACTIVE_TEXTURE 0x84E1 +#define GL_MAX_TEXTURE_UNITS 0x84E2 +#define GL_TRANSPOSE_MODELVIEW_MATRIX 0x84E3 +#define GL_TRANSPOSE_PROJECTION_MATRIX 0x84E4 +#define GL_TRANSPOSE_TEXTURE_MATRIX 0x84E5 +#define GL_TRANSPOSE_COLOR_MATRIX 0x84E6 +#define GL_MULTISAMPLE 0x809D +#define GL_SAMPLE_ALPHA_TO_COVERAGE 0x809E +#define GL_SAMPLE_ALPHA_TO_ONE 0x809F +#define GL_SAMPLE_COVERAGE 0x80A0 +#define GL_SAMPLE_BUFFERS 0x80A8 +#define GL_SAMPLES 0x80A9 +#define GL_SAMPLE_COVERAGE_VALUE 0x80AA +#define GL_SAMPLE_COVERAGE_INVERT 0x80AB +#define GL_MULTISAMPLE_BIT 0x20000000 +#define GL_NORMAL_MAP 0x8511 +#define GL_REFLECTION_MAP 0x8512 +#define GL_TEXTURE_CUBE_MAP 0x8513 +#define GL_TEXTURE_BINDING_CUBE_MAP 0x8514 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_X 0x8515 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X 0x8516 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y 0x8517 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y 0x8518 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z 0x8519 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z 0x851A +#define GL_PROXY_TEXTURE_CUBE_MAP 0x851B +#define GL_MAX_CUBE_MAP_TEXTURE_SIZE 0x851C +#define GL_COMPRESSED_ALPHA 0x84E9 +#define GL_COMPRESSED_LUMINANCE 0x84EA +#define GL_COMPRESSED_LUMINANCE_ALPHA 0x84EB +#define GL_COMPRESSED_INTENSITY 0x84EC +#define GL_COMPRESSED_RGB 0x84ED +#define GL_COMPRESSED_RGBA 0x84EE +#define GL_TEXTURE_COMPRESSION_HINT 0x84EF +#define GL_TEXTURE_COMPRESSED_IMAGE_SIZE 0x86A0 +#define GL_TEXTURE_COMPRESSED 0x86A1 +#define GL_NUM_COMPRESSED_TEXTURE_FORMATS 0x86A2 +#define GL_COMPRESSED_TEXTURE_FORMATS 0x86A3 +#define GL_CLAMP_TO_BORDER 0x812D +#define GL_COMBINE 0x8570 +#define GL_COMBINE_RGB 0x8571 +#define GL_COMBINE_ALPHA 0x8572 +#define GL_SOURCE0_RGB 0x8580 +#define GL_SOURCE1_RGB 0x8581 +#define GL_SOURCE2_RGB 0x8582 +#define GL_SOURCE0_ALPHA 0x8588 +#define GL_SOURCE1_ALPHA 0x8589 +#define GL_SOURCE2_ALPHA 0x858A +#define GL_OPERAND0_RGB 0x8590 +#define GL_OPERAND1_RGB 0x8591 +#define GL_OPERAND2_RGB 0x8592 +#define GL_OPERAND0_ALPHA 0x8598 +#define GL_OPERAND1_ALPHA 0x8599 +#define GL_OPERAND2_ALPHA 0x859A +#define GL_RGB_SCALE 0x8573 +#define GL_ADD_SIGNED 0x8574 +#define GL_INTERPOLATE 0x8575 +#define GL_SUBTRACT 0x84E7 +#define GL_CONSTANT 0x8576 +#define GL_PRIMARY_COLOR 0x8577 +#define GL_PREVIOUS 0x8578 +#define GL_DOT3_RGB 0x86AE +#define GL_DOT3_RGBA 0x86AF +#endif + +#ifndef GL_VERSION_1_4 +#define GL_BLEND_DST_RGB 0x80C8 +#define GL_BLEND_SRC_RGB 0x80C9 +#define GL_BLEND_DST_ALPHA 0x80CA +#define GL_BLEND_SRC_ALPHA 0x80CB +#define GL_POINT_SIZE_MIN 0x8126 +#define GL_POINT_SIZE_MAX 0x8127 +#define GL_POINT_FADE_THRESHOLD_SIZE 0x8128 +#define GL_POINT_DISTANCE_ATTENUATION 0x8129 +#define GL_GENERATE_MIPMAP 0x8191 +#define GL_GENERATE_MIPMAP_HINT 0x8192 +#define GL_DEPTH_COMPONENT16 0x81A5 +#define GL_DEPTH_COMPONENT24 0x81A6 +#define GL_DEPTH_COMPONENT32 0x81A7 +#define GL_MIRRORED_REPEAT 0x8370 +#define GL_FOG_COORDINATE_SOURCE 0x8450 +#define GL_FOG_COORDINATE 0x8451 +#define GL_FRAGMENT_DEPTH 0x8452 +#define GL_CURRENT_FOG_COORDINATE 0x8453 +#define GL_FOG_COORDINATE_ARRAY_TYPE 0x8454 +#define GL_FOG_COORDINATE_ARRAY_STRIDE 0x8455 +#define GL_FOG_COORDINATE_ARRAY_POINTER 0x8456 +#define GL_FOG_COORDINATE_ARRAY 0x8457 +#define GL_COLOR_SUM 0x8458 +#define GL_CURRENT_SECONDARY_COLOR 0x8459 +#define GL_SECONDARY_COLOR_ARRAY_SIZE 0x845A +#define GL_SECONDARY_COLOR_ARRAY_TYPE 0x845B +#define GL_SECONDARY_COLOR_ARRAY_STRIDE 0x845C +#define GL_SECONDARY_COLOR_ARRAY_POINTER 0x845D +#define GL_SECONDARY_COLOR_ARRAY 0x845E +#define GL_MAX_TEXTURE_LOD_BIAS 0x84FD +#define GL_TEXTURE_FILTER_CONTROL 0x8500 +#define GL_TEXTURE_LOD_BIAS 0x8501 +#define GL_INCR_WRAP 0x8507 +#define GL_DECR_WRAP 0x8508 +#define GL_TEXTURE_DEPTH_SIZE 0x884A +#define GL_DEPTH_TEXTURE_MODE 0x884B +#define GL_TEXTURE_COMPARE_MODE 0x884C +#define GL_TEXTURE_COMPARE_FUNC 0x884D +#define GL_COMPARE_R_TO_TEXTURE 0x884E +#endif + +#ifndef GL_VERSION_1_5 +#define GL_BUFFER_SIZE 0x8764 +#define GL_BUFFER_USAGE 0x8765 +#define GL_QUERY_COUNTER_BITS 0x8864 +#define GL_CURRENT_QUERY 0x8865 +#define GL_QUERY_RESULT 0x8866 +#define GL_QUERY_RESULT_AVAILABLE 0x8867 +#define GL_ARRAY_BUFFER 0x8892 +#define GL_ELEMENT_ARRAY_BUFFER 0x8893 +#define GL_ARRAY_BUFFER_BINDING 0x8894 +#define GL_ELEMENT_ARRAY_BUFFER_BINDING 0x8895 +#define GL_VERTEX_ARRAY_BUFFER_BINDING 0x8896 +#define GL_NORMAL_ARRAY_BUFFER_BINDING 0x8897 +#define GL_COLOR_ARRAY_BUFFER_BINDING 0x8898 +#define GL_INDEX_ARRAY_BUFFER_BINDING 0x8899 +#define GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING 0x889A +#define GL_EDGE_FLAG_ARRAY_BUFFER_BINDING 0x889B +#define GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING 0x889C +#define GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING 0x889D +#define GL_WEIGHT_ARRAY_BUFFER_BINDING 0x889E +#define GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING 0x889F +#define GL_READ_ONLY 0x88B8 +#define GL_WRITE_ONLY 0x88B9 +#define GL_READ_WRITE 0x88BA +#define GL_BUFFER_ACCESS 0x88BB +#define GL_BUFFER_MAPPED 0x88BC +#define GL_BUFFER_MAP_POINTER 0x88BD +#define GL_STREAM_DRAW 0x88E0 +#define GL_STREAM_READ 0x88E1 +#define GL_STREAM_COPY 0x88E2 +#define GL_STATIC_DRAW 0x88E4 +#define GL_STATIC_READ 0x88E5 +#define GL_STATIC_COPY 0x88E6 +#define GL_DYNAMIC_DRAW 0x88E8 +#define GL_DYNAMIC_READ 0x88E9 +#define GL_DYNAMIC_COPY 0x88EA +#define GL_SAMPLES_PASSED 0x8914 +#define GL_FOG_COORD_SRC GL_FOG_COORDINATE_SOURCE +#define GL_FOG_COORD GL_FOG_COORDINATE +#define GL_CURRENT_FOG_COORD GL_CURRENT_FOG_COORDINATE +#define GL_FOG_COORD_ARRAY_TYPE GL_FOG_COORDINATE_ARRAY_TYPE +#define GL_FOG_COORD_ARRAY_STRIDE GL_FOG_COORDINATE_ARRAY_STRIDE +#define GL_FOG_COORD_ARRAY_POINTER GL_FOG_COORDINATE_ARRAY_POINTER +#define GL_FOG_COORD_ARRAY GL_FOG_COORDINATE_ARRAY +#define GL_FOG_COORD_ARRAY_BUFFER_BINDING GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING +#define GL_SRC0_RGB GL_SOURCE0_RGB +#define GL_SRC1_RGB GL_SOURCE1_RGB +#define GL_SRC2_RGB GL_SOURCE2_RGB +#define GL_SRC0_ALPHA GL_SOURCE0_ALPHA +#define GL_SRC1_ALPHA GL_SOURCE1_ALPHA +#define GL_SRC2_ALPHA GL_SOURCE2_ALPHA +#endif + +#ifndef GL_VERSION_2_0 +#define GL_BLEND_EQUATION_RGB GL_BLEND_EQUATION +#define GL_VERTEX_ATTRIB_ARRAY_ENABLED 0x8622 +#define GL_VERTEX_ATTRIB_ARRAY_SIZE 0x8623 +#define GL_VERTEX_ATTRIB_ARRAY_STRIDE 0x8624 +#define GL_VERTEX_ATTRIB_ARRAY_TYPE 0x8625 +#define GL_CURRENT_VERTEX_ATTRIB 0x8626 +#define GL_VERTEX_PROGRAM_POINT_SIZE 0x8642 +#define GL_VERTEX_PROGRAM_TWO_SIDE 0x8643 +#define GL_VERTEX_ATTRIB_ARRAY_POINTER 0x8645 +#define GL_STENCIL_BACK_FUNC 0x8800 +#define GL_STENCIL_BACK_FAIL 0x8801 +#define GL_STENCIL_BACK_PASS_DEPTH_FAIL 0x8802 +#define GL_STENCIL_BACK_PASS_DEPTH_PASS 0x8803 +#define GL_MAX_DRAW_BUFFERS 0x8824 +#define GL_DRAW_BUFFER0 0x8825 +#define GL_DRAW_BUFFER1 0x8826 +#define GL_DRAW_BUFFER2 0x8827 +#define GL_DRAW_BUFFER3 0x8828 +#define GL_DRAW_BUFFER4 0x8829 +#define GL_DRAW_BUFFER5 0x882A +#define GL_DRAW_BUFFER6 0x882B +#define GL_DRAW_BUFFER7 0x882C +#define GL_DRAW_BUFFER8 0x882D +#define GL_DRAW_BUFFER9 0x882E +#define GL_DRAW_BUFFER10 0x882F +#define GL_DRAW_BUFFER11 0x8830 +#define GL_DRAW_BUFFER12 0x8831 +#define GL_DRAW_BUFFER13 0x8832 +#define GL_DRAW_BUFFER14 0x8833 +#define GL_DRAW_BUFFER15 0x8834 +#define GL_BLEND_EQUATION_ALPHA 0x883D +#define GL_POINT_SPRITE 0x8861 +#define GL_COORD_REPLACE 0x8862 +#define GL_MAX_VERTEX_ATTRIBS 0x8869 +#define GL_VERTEX_ATTRIB_ARRAY_NORMALIZED 0x886A +#define GL_MAX_TEXTURE_COORDS 0x8871 +#define GL_MAX_TEXTURE_IMAGE_UNITS 0x8872 +#define GL_FRAGMENT_SHADER 0x8B30 +#define GL_VERTEX_SHADER 0x8B31 +#define GL_MAX_FRAGMENT_UNIFORM_COMPONENTS 0x8B49 +#define GL_MAX_VERTEX_UNIFORM_COMPONENTS 0x8B4A +#define GL_MAX_VARYING_FLOATS 0x8B4B +#define GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS 0x8B4C +#define GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS 0x8B4D +#define GL_SHADER_TYPE 0x8B4F +#define GL_FLOAT_VEC2 0x8B50 +#define GL_FLOAT_VEC3 0x8B51 +#define GL_FLOAT_VEC4 0x8B52 +#define GL_INT_VEC2 0x8B53 +#define GL_INT_VEC3 0x8B54 +#define GL_INT_VEC4 0x8B55 +#define GL_BOOL 0x8B56 +#define GL_BOOL_VEC2 0x8B57 +#define GL_BOOL_VEC3 0x8B58 +#define GL_BOOL_VEC4 0x8B59 +#define GL_FLOAT_MAT2 0x8B5A +#define GL_FLOAT_MAT3 0x8B5B +#define GL_FLOAT_MAT4 0x8B5C +#define GL_SAMPLER_1D 0x8B5D +#define GL_SAMPLER_2D 0x8B5E +#define GL_SAMPLER_3D 0x8B5F +#define GL_SAMPLER_CUBE 0x8B60 +#define GL_SAMPLER_1D_SHADOW 0x8B61 +#define GL_SAMPLER_2D_SHADOW 0x8B62 +#define GL_DELETE_STATUS 0x8B80 +#define GL_COMPILE_STATUS 0x8B81 +#define GL_LINK_STATUS 0x8B82 +#define GL_VALIDATE_STATUS 0x8B83 +#define GL_INFO_LOG_LENGTH 0x8B84 +#define GL_ATTACHED_SHADERS 0x8B85 +#define GL_ACTIVE_UNIFORMS 0x8B86 +#define GL_ACTIVE_UNIFORM_MAX_LENGTH 0x8B87 +#define GL_SHADER_SOURCE_LENGTH 0x8B88 +#define GL_ACTIVE_ATTRIBUTES 0x8B89 +#define GL_ACTIVE_ATTRIBUTE_MAX_LENGTH 0x8B8A +#define GL_FRAGMENT_SHADER_DERIVATIVE_HINT 0x8B8B +#define GL_SHADING_LANGUAGE_VERSION 0x8B8C +#define GL_CURRENT_PROGRAM 0x8B8D +#define GL_POINT_SPRITE_COORD_ORIGIN 0x8CA0 +#define GL_LOWER_LEFT 0x8CA1 +#define GL_UPPER_LEFT 0x8CA2 +#define GL_STENCIL_BACK_REF 0x8CA3 +#define GL_STENCIL_BACK_VALUE_MASK 0x8CA4 +#define GL_STENCIL_BACK_WRITEMASK 0x8CA5 +#endif + +#ifndef GL_ARB_multitexture +#define GL_TEXTURE0_ARB 0x84C0 +#define GL_TEXTURE1_ARB 0x84C1 +#define GL_TEXTURE2_ARB 0x84C2 +#define GL_TEXTURE3_ARB 0x84C3 +#define GL_TEXTURE4_ARB 0x84C4 +#define GL_TEXTURE5_ARB 0x84C5 +#define GL_TEXTURE6_ARB 0x84C6 +#define GL_TEXTURE7_ARB 0x84C7 +#define GL_TEXTURE8_ARB 0x84C8 +#define GL_TEXTURE9_ARB 0x84C9 +#define GL_TEXTURE10_ARB 0x84CA +#define GL_TEXTURE11_ARB 0x84CB +#define GL_TEXTURE12_ARB 0x84CC +#define GL_TEXTURE13_ARB 0x84CD +#define GL_TEXTURE14_ARB 0x84CE +#define GL_TEXTURE15_ARB 0x84CF +#define GL_TEXTURE16_ARB 0x84D0 +#define GL_TEXTURE17_ARB 0x84D1 +#define GL_TEXTURE18_ARB 0x84D2 +#define GL_TEXTURE19_ARB 0x84D3 +#define GL_TEXTURE20_ARB 0x84D4 +#define GL_TEXTURE21_ARB 0x84D5 +#define GL_TEXTURE22_ARB 0x84D6 +#define GL_TEXTURE23_ARB 0x84D7 +#define GL_TEXTURE24_ARB 0x84D8 +#define GL_TEXTURE25_ARB 0x84D9 +#define GL_TEXTURE26_ARB 0x84DA +#define GL_TEXTURE27_ARB 0x84DB +#define GL_TEXTURE28_ARB 0x84DC +#define GL_TEXTURE29_ARB 0x84DD +#define GL_TEXTURE30_ARB 0x84DE +#define GL_TEXTURE31_ARB 0x84DF +#define GL_ACTIVE_TEXTURE_ARB 0x84E0 +#define GL_CLIENT_ACTIVE_TEXTURE_ARB 0x84E1 +#define GL_MAX_TEXTURE_UNITS_ARB 0x84E2 +#endif + +#ifndef GL_ARB_transpose_matrix +#define GL_TRANSPOSE_MODELVIEW_MATRIX_ARB 0x84E3 +#define GL_TRANSPOSE_PROJECTION_MATRIX_ARB 0x84E4 +#define GL_TRANSPOSE_TEXTURE_MATRIX_ARB 0x84E5 +#define GL_TRANSPOSE_COLOR_MATRIX_ARB 0x84E6 +#endif + +#ifndef GL_ARB_multisample +#define GL_MULTISAMPLE_ARB 0x809D +#define GL_SAMPLE_ALPHA_TO_COVERAGE_ARB 0x809E +#define GL_SAMPLE_ALPHA_TO_ONE_ARB 0x809F +#define GL_SAMPLE_COVERAGE_ARB 0x80A0 +#define GL_SAMPLE_BUFFERS_ARB 0x80A8 +#define GL_SAMPLES_ARB 0x80A9 +#define GL_SAMPLE_COVERAGE_VALUE_ARB 0x80AA +#define GL_SAMPLE_COVERAGE_INVERT_ARB 0x80AB +#define GL_MULTISAMPLE_BIT_ARB 0x20000000 +#endif + +#ifndef GL_ARB_texture_env_add +#endif + +#ifndef GL_ARB_texture_cube_map +#define GL_NORMAL_MAP_ARB 0x8511 +#define GL_REFLECTION_MAP_ARB 0x8512 +#define GL_TEXTURE_CUBE_MAP_ARB 0x8513 +#define GL_TEXTURE_BINDING_CUBE_MAP_ARB 0x8514 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB 0x8515 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB 0x8516 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB 0x8517 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB 0x8518 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB 0x8519 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB 0x851A +#define GL_PROXY_TEXTURE_CUBE_MAP_ARB 0x851B +#define GL_MAX_CUBE_MAP_TEXTURE_SIZE_ARB 0x851C +#endif + +#ifndef GL_ARB_texture_compression +#define GL_COMPRESSED_ALPHA_ARB 0x84E9 +#define GL_COMPRESSED_LUMINANCE_ARB 0x84EA +#define GL_COMPRESSED_LUMINANCE_ALPHA_ARB 0x84EB +#define GL_COMPRESSED_INTENSITY_ARB 0x84EC +#define GL_COMPRESSED_RGB_ARB 0x84ED +#define GL_COMPRESSED_RGBA_ARB 0x84EE +#define GL_TEXTURE_COMPRESSION_HINT_ARB 0x84EF +#define GL_TEXTURE_COMPRESSED_IMAGE_SIZE_ARB 0x86A0 +#define GL_TEXTURE_COMPRESSED_ARB 0x86A1 +#define GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB 0x86A2 +#define GL_COMPRESSED_TEXTURE_FORMATS_ARB 0x86A3 +#endif + +#ifndef GL_ARB_texture_border_clamp +#define GL_CLAMP_TO_BORDER_ARB 0x812D +#endif + +#ifndef GL_ARB_point_parameters +#define GL_POINT_SIZE_MIN_ARB 0x8126 +#define GL_POINT_SIZE_MAX_ARB 0x8127 +#define GL_POINT_FADE_THRESHOLD_SIZE_ARB 0x8128 +#define GL_POINT_DISTANCE_ATTENUATION_ARB 0x8129 +#endif + +#ifndef GL_ARB_vertex_blend +#define GL_MAX_VERTEX_UNITS_ARB 0x86A4 +#define GL_ACTIVE_VERTEX_UNITS_ARB 0x86A5 +#define GL_WEIGHT_SUM_UNITY_ARB 0x86A6 +#define GL_VERTEX_BLEND_ARB 0x86A7 +#define GL_CURRENT_WEIGHT_ARB 0x86A8 +#define GL_WEIGHT_ARRAY_TYPE_ARB 0x86A9 +#define GL_WEIGHT_ARRAY_STRIDE_ARB 0x86AA +#define GL_WEIGHT_ARRAY_SIZE_ARB 0x86AB +#define GL_WEIGHT_ARRAY_POINTER_ARB 0x86AC +#define GL_WEIGHT_ARRAY_ARB 0x86AD +#define GL_MODELVIEW0_ARB 0x1700 +#define GL_MODELVIEW1_ARB 0x850A +#define GL_MODELVIEW2_ARB 0x8722 +#define GL_MODELVIEW3_ARB 0x8723 +#define GL_MODELVIEW4_ARB 0x8724 +#define GL_MODELVIEW5_ARB 0x8725 +#define GL_MODELVIEW6_ARB 0x8726 +#define GL_MODELVIEW7_ARB 0x8727 +#define GL_MODELVIEW8_ARB 0x8728 +#define GL_MODELVIEW9_ARB 0x8729 +#define GL_MODELVIEW10_ARB 0x872A +#define GL_MODELVIEW11_ARB 0x872B +#define GL_MODELVIEW12_ARB 0x872C +#define GL_MODELVIEW13_ARB 0x872D +#define GL_MODELVIEW14_ARB 0x872E +#define GL_MODELVIEW15_ARB 0x872F +#define GL_MODELVIEW16_ARB 0x8730 +#define GL_MODELVIEW17_ARB 0x8731 +#define GL_MODELVIEW18_ARB 0x8732 +#define GL_MODELVIEW19_ARB 0x8733 +#define GL_MODELVIEW20_ARB 0x8734 +#define GL_MODELVIEW21_ARB 0x8735 +#define GL_MODELVIEW22_ARB 0x8736 +#define GL_MODELVIEW23_ARB 0x8737 +#define GL_MODELVIEW24_ARB 0x8738 +#define GL_MODELVIEW25_ARB 0x8739 +#define GL_MODELVIEW26_ARB 0x873A +#define GL_MODELVIEW27_ARB 0x873B +#define GL_MODELVIEW28_ARB 0x873C +#define GL_MODELVIEW29_ARB 0x873D +#define GL_MODELVIEW30_ARB 0x873E +#define GL_MODELVIEW31_ARB 0x873F +#endif + +#ifndef GL_ARB_matrix_palette +#define GL_MATRIX_PALETTE_ARB 0x8840 +#define GL_MAX_MATRIX_PALETTE_STACK_DEPTH_ARB 0x8841 +#define GL_MAX_PALETTE_MATRICES_ARB 0x8842 +#define GL_CURRENT_PALETTE_MATRIX_ARB 0x8843 +#define GL_MATRIX_INDEX_ARRAY_ARB 0x8844 +#define GL_CURRENT_MATRIX_INDEX_ARB 0x8845 +#define GL_MATRIX_INDEX_ARRAY_SIZE_ARB 0x8846 +#define GL_MATRIX_INDEX_ARRAY_TYPE_ARB 0x8847 +#define GL_MATRIX_INDEX_ARRAY_STRIDE_ARB 0x8848 +#define GL_MATRIX_INDEX_ARRAY_POINTER_ARB 0x8849 +#endif + +#ifndef GL_ARB_texture_env_combine +#define GL_COMBINE_ARB 0x8570 +#define GL_COMBINE_RGB_ARB 0x8571 +#define GL_COMBINE_ALPHA_ARB 0x8572 +#define GL_SOURCE0_RGB_ARB 0x8580 +#define GL_SOURCE1_RGB_ARB 0x8581 +#define GL_SOURCE2_RGB_ARB 0x8582 +#define GL_SOURCE0_ALPHA_ARB 0x8588 +#define GL_SOURCE1_ALPHA_ARB 0x8589 +#define GL_SOURCE2_ALPHA_ARB 0x858A +#define GL_OPERAND0_RGB_ARB 0x8590 +#define GL_OPERAND1_RGB_ARB 0x8591 +#define GL_OPERAND2_RGB_ARB 0x8592 +#define GL_OPERAND0_ALPHA_ARB 0x8598 +#define GL_OPERAND1_ALPHA_ARB 0x8599 +#define GL_OPERAND2_ALPHA_ARB 0x859A +#define GL_RGB_SCALE_ARB 0x8573 +#define GL_ADD_SIGNED_ARB 0x8574 +#define GL_INTERPOLATE_ARB 0x8575 +#define GL_SUBTRACT_ARB 0x84E7 +#define GL_CONSTANT_ARB 0x8576 +#define GL_PRIMARY_COLOR_ARB 0x8577 +#define GL_PREVIOUS_ARB 0x8578 +#endif + +#ifndef GL_ARB_texture_env_crossbar +#endif + +#ifndef GL_ARB_texture_env_dot3 +#define GL_DOT3_RGB_ARB 0x86AE +#define GL_DOT3_RGBA_ARB 0x86AF +#endif + +#ifndef GL_ARB_texture_mirrored_repeat +#define GL_MIRRORED_REPEAT_ARB 0x8370 +#endif + +#ifndef GL_ARB_depth_texture +#define GL_DEPTH_COMPONENT16_ARB 0x81A5 +#define GL_DEPTH_COMPONENT24_ARB 0x81A6 +#define GL_DEPTH_COMPONENT32_ARB 0x81A7 +#define GL_TEXTURE_DEPTH_SIZE_ARB 0x884A +#define GL_DEPTH_TEXTURE_MODE_ARB 0x884B +#endif + +#ifndef GL_ARB_shadow +#define GL_TEXTURE_COMPARE_MODE_ARB 0x884C +#define GL_TEXTURE_COMPARE_FUNC_ARB 0x884D +#define GL_COMPARE_R_TO_TEXTURE_ARB 0x884E +#endif + +#ifndef GL_ARB_shadow_ambient +#define GL_TEXTURE_COMPARE_FAIL_VALUE_ARB 0x80BF +#endif + +#ifndef GL_ARB_window_pos +#endif + +#ifndef GL_ARB_vertex_program +#define GL_COLOR_SUM_ARB 0x8458 +#define GL_VERTEX_PROGRAM_ARB 0x8620 +#define GL_VERTEX_ATTRIB_ARRAY_ENABLED_ARB 0x8622 +#define GL_VERTEX_ATTRIB_ARRAY_SIZE_ARB 0x8623 +#define GL_VERTEX_ATTRIB_ARRAY_STRIDE_ARB 0x8624 +#define GL_VERTEX_ATTRIB_ARRAY_TYPE_ARB 0x8625 +#define GL_CURRENT_VERTEX_ATTRIB_ARB 0x8626 +#define GL_PROGRAM_LENGTH_ARB 0x8627 +#define GL_PROGRAM_STRING_ARB 0x8628 +#define GL_MAX_PROGRAM_MATRIX_STACK_DEPTH_ARB 0x862E +#define GL_MAX_PROGRAM_MATRICES_ARB 0x862F +#define GL_CURRENT_MATRIX_STACK_DEPTH_ARB 0x8640 +#define GL_CURRENT_MATRIX_ARB 0x8641 +#define GL_VERTEX_PROGRAM_POINT_SIZE_ARB 0x8642 +#define GL_VERTEX_PROGRAM_TWO_SIDE_ARB 0x8643 +#define GL_VERTEX_ATTRIB_ARRAY_POINTER_ARB 0x8645 +#define GL_PROGRAM_ERROR_POSITION_ARB 0x864B +#define GL_PROGRAM_BINDING_ARB 0x8677 +#define GL_MAX_VERTEX_ATTRIBS_ARB 0x8869 +#define GL_VERTEX_ATTRIB_ARRAY_NORMALIZED_ARB 0x886A +#define GL_PROGRAM_ERROR_STRING_ARB 0x8874 +#define GL_PROGRAM_FORMAT_ASCII_ARB 0x8875 +#define GL_PROGRAM_FORMAT_ARB 0x8876 +#define GL_PROGRAM_INSTRUCTIONS_ARB 0x88A0 +#define GL_MAX_PROGRAM_INSTRUCTIONS_ARB 0x88A1 +#define GL_PROGRAM_NATIVE_INSTRUCTIONS_ARB 0x88A2 +#define GL_MAX_PROGRAM_NATIVE_INSTRUCTIONS_ARB 0x88A3 +#define GL_PROGRAM_TEMPORARIES_ARB 0x88A4 +#define GL_MAX_PROGRAM_TEMPORARIES_ARB 0x88A5 +#define GL_PROGRAM_NATIVE_TEMPORARIES_ARB 0x88A6 +#define GL_MAX_PROGRAM_NATIVE_TEMPORARIES_ARB 0x88A7 +#define GL_PROGRAM_PARAMETERS_ARB 0x88A8 +#define GL_MAX_PROGRAM_PARAMETERS_ARB 0x88A9 +#define GL_PROGRAM_NATIVE_PARAMETERS_ARB 0x88AA +#define GL_MAX_PROGRAM_NATIVE_PARAMETERS_ARB 0x88AB +#define GL_PROGRAM_ATTRIBS_ARB 0x88AC +#define GL_MAX_PROGRAM_ATTRIBS_ARB 0x88AD +#define GL_PROGRAM_NATIVE_ATTRIBS_ARB 0x88AE +#define GL_MAX_PROGRAM_NATIVE_ATTRIBS_ARB 0x88AF +#define GL_PROGRAM_ADDRESS_REGISTERS_ARB 0x88B0 +#define GL_MAX_PROGRAM_ADDRESS_REGISTERS_ARB 0x88B1 +#define GL_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB 0x88B2 +#define GL_MAX_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB 0x88B3 +#define GL_MAX_PROGRAM_LOCAL_PARAMETERS_ARB 0x88B4 +#define GL_MAX_PROGRAM_ENV_PARAMETERS_ARB 0x88B5 +#define GL_PROGRAM_UNDER_NATIVE_LIMITS_ARB 0x88B6 +#define GL_TRANSPOSE_CURRENT_MATRIX_ARB 0x88B7 +#define GL_MATRIX0_ARB 0x88C0 +#define GL_MATRIX1_ARB 0x88C1 +#define GL_MATRIX2_ARB 0x88C2 +#define GL_MATRIX3_ARB 0x88C3 +#define GL_MATRIX4_ARB 0x88C4 +#define GL_MATRIX5_ARB 0x88C5 +#define GL_MATRIX6_ARB 0x88C6 +#define GL_MATRIX7_ARB 0x88C7 +#define GL_MATRIX8_ARB 0x88C8 +#define GL_MATRIX9_ARB 0x88C9 +#define GL_MATRIX10_ARB 0x88CA +#define GL_MATRIX11_ARB 0x88CB +#define GL_MATRIX12_ARB 0x88CC +#define GL_MATRIX13_ARB 0x88CD +#define GL_MATRIX14_ARB 0x88CE +#define GL_MATRIX15_ARB 0x88CF +#define GL_MATRIX16_ARB 0x88D0 +#define GL_MATRIX17_ARB 0x88D1 +#define GL_MATRIX18_ARB 0x88D2 +#define GL_MATRIX19_ARB 0x88D3 +#define GL_MATRIX20_ARB 0x88D4 +#define GL_MATRIX21_ARB 0x88D5 +#define GL_MATRIX22_ARB 0x88D6 +#define GL_MATRIX23_ARB 0x88D7 +#define GL_MATRIX24_ARB 0x88D8 +#define GL_MATRIX25_ARB 0x88D9 +#define GL_MATRIX26_ARB 0x88DA +#define GL_MATRIX27_ARB 0x88DB +#define GL_MATRIX28_ARB 0x88DC +#define GL_MATRIX29_ARB 0x88DD +#define GL_MATRIX30_ARB 0x88DE +#define GL_MATRIX31_ARB 0x88DF +#endif + +#ifndef GL_ARB_fragment_program +#define GL_FRAGMENT_PROGRAM_ARB 0x8804 +#define GL_PROGRAM_ALU_INSTRUCTIONS_ARB 0x8805 +#define GL_PROGRAM_TEX_INSTRUCTIONS_ARB 0x8806 +#define GL_PROGRAM_TEX_INDIRECTIONS_ARB 0x8807 +#define GL_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB 0x8808 +#define GL_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB 0x8809 +#define GL_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB 0x880A +#define GL_MAX_PROGRAM_ALU_INSTRUCTIONS_ARB 0x880B +#define GL_MAX_PROGRAM_TEX_INSTRUCTIONS_ARB 0x880C +#define GL_MAX_PROGRAM_TEX_INDIRECTIONS_ARB 0x880D +#define GL_MAX_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB 0x880E +#define GL_MAX_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB 0x880F +#define GL_MAX_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB 0x8810 +#define GL_MAX_TEXTURE_COORDS_ARB 0x8871 +#define GL_MAX_TEXTURE_IMAGE_UNITS_ARB 0x8872 +#endif + +#ifndef GL_ARB_vertex_buffer_object +#define GL_BUFFER_SIZE_ARB 0x8764 +#define GL_BUFFER_USAGE_ARB 0x8765 +#define GL_ARRAY_BUFFER_ARB 0x8892 +#define GL_ELEMENT_ARRAY_BUFFER_ARB 0x8893 +#define GL_ARRAY_BUFFER_BINDING_ARB 0x8894 +#define GL_ELEMENT_ARRAY_BUFFER_BINDING_ARB 0x8895 +#define GL_VERTEX_ARRAY_BUFFER_BINDING_ARB 0x8896 +#define GL_NORMAL_ARRAY_BUFFER_BINDING_ARB 0x8897 +#define GL_COLOR_ARRAY_BUFFER_BINDING_ARB 0x8898 +#define GL_INDEX_ARRAY_BUFFER_BINDING_ARB 0x8899 +#define GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING_ARB 0x889A +#define GL_EDGE_FLAG_ARRAY_BUFFER_BINDING_ARB 0x889B +#define GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING_ARB 0x889C +#define GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING_ARB 0x889D +#define GL_WEIGHT_ARRAY_BUFFER_BINDING_ARB 0x889E +#define GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB 0x889F +#define GL_READ_ONLY_ARB 0x88B8 +#define GL_WRITE_ONLY_ARB 0x88B9 +#define GL_READ_WRITE_ARB 0x88BA +#define GL_BUFFER_ACCESS_ARB 0x88BB +#define GL_BUFFER_MAPPED_ARB 0x88BC +#define GL_BUFFER_MAP_POINTER_ARB 0x88BD +#define GL_STREAM_DRAW_ARB 0x88E0 +#define GL_STREAM_READ_ARB 0x88E1 +#define GL_STREAM_COPY_ARB 0x88E2 +#define GL_STATIC_DRAW_ARB 0x88E4 +#define GL_STATIC_READ_ARB 0x88E5 +#define GL_STATIC_COPY_ARB 0x88E6 +#define GL_DYNAMIC_DRAW_ARB 0x88E8 +#define GL_DYNAMIC_READ_ARB 0x88E9 +#define GL_DYNAMIC_COPY_ARB 0x88EA +#endif + +#ifndef GL_ARB_occlusion_query +#define GL_QUERY_COUNTER_BITS_ARB 0x8864 +#define GL_CURRENT_QUERY_ARB 0x8865 +#define GL_QUERY_RESULT_ARB 0x8866 +#define GL_QUERY_RESULT_AVAILABLE_ARB 0x8867 +#define GL_SAMPLES_PASSED_ARB 0x8914 +#endif + +#ifndef GL_ARB_shader_objects +#define GL_PROGRAM_OBJECT_ARB 0x8B40 +#define GL_SHADER_OBJECT_ARB 0x8B48 +#define GL_OBJECT_TYPE_ARB 0x8B4E +#define GL_OBJECT_SUBTYPE_ARB 0x8B4F +#define GL_FLOAT_VEC2_ARB 0x8B50 +#define GL_FLOAT_VEC3_ARB 0x8B51 +#define GL_FLOAT_VEC4_ARB 0x8B52 +#define GL_INT_VEC2_ARB 0x8B53 +#define GL_INT_VEC3_ARB 0x8B54 +#define GL_INT_VEC4_ARB 0x8B55 +#define GL_BOOL_ARB 0x8B56 +#define GL_BOOL_VEC2_ARB 0x8B57 +#define GL_BOOL_VEC3_ARB 0x8B58 +#define GL_BOOL_VEC4_ARB 0x8B59 +#define GL_FLOAT_MAT2_ARB 0x8B5A +#define GL_FLOAT_MAT3_ARB 0x8B5B +#define GL_FLOAT_MAT4_ARB 0x8B5C +#define GL_SAMPLER_1D_ARB 0x8B5D +#define GL_SAMPLER_2D_ARB 0x8B5E +#define GL_SAMPLER_3D_ARB 0x8B5F +#define GL_SAMPLER_CUBE_ARB 0x8B60 +#define GL_SAMPLER_1D_SHADOW_ARB 0x8B61 +#define GL_SAMPLER_2D_SHADOW_ARB 0x8B62 +#define GL_SAMPLER_2D_RECT_ARB 0x8B63 +#define GL_SAMPLER_2D_RECT_SHADOW_ARB 0x8B64 +#define GL_OBJECT_DELETE_STATUS_ARB 0x8B80 +#define GL_OBJECT_COMPILE_STATUS_ARB 0x8B81 +#define GL_OBJECT_LINK_STATUS_ARB 0x8B82 +#define GL_OBJECT_VALIDATE_STATUS_ARB 0x8B83 +#define GL_OBJECT_INFO_LOG_LENGTH_ARB 0x8B84 +#define GL_OBJECT_ATTACHED_OBJECTS_ARB 0x8B85 +#define GL_OBJECT_ACTIVE_UNIFORMS_ARB 0x8B86 +#define GL_OBJECT_ACTIVE_UNIFORM_MAX_LENGTH_ARB 0x8B87 +#define GL_OBJECT_SHADER_SOURCE_LENGTH_ARB 0x8B88 +#endif + +#ifndef GL_ARB_vertex_shader +#define GL_VERTEX_SHADER_ARB 0x8B31 +#define GL_MAX_VERTEX_UNIFORM_COMPONENTS_ARB 0x8B4A +#define GL_MAX_VARYING_FLOATS_ARB 0x8B4B +#define GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB 0x8B4C +#define GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS_ARB 0x8B4D +#define GL_OBJECT_ACTIVE_ATTRIBUTES_ARB 0x8B89 +#define GL_OBJECT_ACTIVE_ATTRIBUTE_MAX_LENGTH_ARB 0x8B8A +#endif + +#ifndef GL_ARB_fragment_shader +#define GL_FRAGMENT_SHADER_ARB 0x8B30 +#define GL_MAX_FRAGMENT_UNIFORM_COMPONENTS_ARB 0x8B49 +#define GL_FRAGMENT_SHADER_DERIVATIVE_HINT_ARB 0x8B8B +#endif + +#ifndef GL_ARB_shading_language_100 +#define GL_SHADING_LANGUAGE_VERSION_ARB 0x8B8C +#endif + +#ifndef GL_ARB_texture_non_power_of_two +#endif + +#ifndef GL_ARB_point_sprite +#define GL_POINT_SPRITE_ARB 0x8861 +#define GL_COORD_REPLACE_ARB 0x8862 +#endif + +#ifndef GL_ARB_fragment_program_shadow +#endif + +#ifndef GL_ARB_draw_buffers +#define GL_MAX_DRAW_BUFFERS_ARB 0x8824 +#define GL_DRAW_BUFFER0_ARB 0x8825 +#define GL_DRAW_BUFFER1_ARB 0x8826 +#define GL_DRAW_BUFFER2_ARB 0x8827 +#define GL_DRAW_BUFFER3_ARB 0x8828 +#define GL_DRAW_BUFFER4_ARB 0x8829 +#define GL_DRAW_BUFFER5_ARB 0x882A +#define GL_DRAW_BUFFER6_ARB 0x882B +#define GL_DRAW_BUFFER7_ARB 0x882C +#define GL_DRAW_BUFFER8_ARB 0x882D +#define GL_DRAW_BUFFER9_ARB 0x882E +#define GL_DRAW_BUFFER10_ARB 0x882F +#define GL_DRAW_BUFFER11_ARB 0x8830 +#define GL_DRAW_BUFFER12_ARB 0x8831 +#define GL_DRAW_BUFFER13_ARB 0x8832 +#define GL_DRAW_BUFFER14_ARB 0x8833 +#define GL_DRAW_BUFFER15_ARB 0x8834 +#endif + +#ifndef GL_ARB_texture_rectangle +#define GL_TEXTURE_RECTANGLE_ARB 0x84F5 +#define GL_TEXTURE_BINDING_RECTANGLE_ARB 0x84F6 +#define GL_PROXY_TEXTURE_RECTANGLE_ARB 0x84F7 +#define GL_MAX_RECTANGLE_TEXTURE_SIZE_ARB 0x84F8 +#endif + +#ifndef GL_ARB_color_buffer_float +#define GL_RGBA_FLOAT_MODE_ARB 0x8820 +#define GL_CLAMP_VERTEX_COLOR_ARB 0x891A +#define GL_CLAMP_FRAGMENT_COLOR_ARB 0x891B +#define GL_CLAMP_READ_COLOR_ARB 0x891C +#define GL_FIXED_ONLY_ARB 0x891D +#endif + +#ifndef GL_ARB_half_float_pixel +#define GL_HALF_FLOAT_ARB 0x140B +#endif + +#ifndef GL_ARB_texture_float +#define GL_TEXTURE_RED_TYPE_ARB 0x8C10 +#define GL_TEXTURE_GREEN_TYPE_ARB 0x8C11 +#define GL_TEXTURE_BLUE_TYPE_ARB 0x8C12 +#define GL_TEXTURE_ALPHA_TYPE_ARB 0x8C13 +#define GL_TEXTURE_LUMINANCE_TYPE_ARB 0x8C14 +#define GL_TEXTURE_INTENSITY_TYPE_ARB 0x8C15 +#define GL_TEXTURE_DEPTH_TYPE_ARB 0x8C16 +#define GL_UNSIGNED_NORMALIZED_ARB 0x8C17 +#define GL_RGBA32F_ARB 0x8814 +#define GL_RGB32F_ARB 0x8815 +#define GL_ALPHA32F_ARB 0x8816 +#define GL_INTENSITY32F_ARB 0x8817 +#define GL_LUMINANCE32F_ARB 0x8818 +#define GL_LUMINANCE_ALPHA32F_ARB 0x8819 +#define GL_RGBA16F_ARB 0x881A +#define GL_RGB16F_ARB 0x881B +#define GL_ALPHA16F_ARB 0x881C +#define GL_INTENSITY16F_ARB 0x881D +#define GL_LUMINANCE16F_ARB 0x881E +#define GL_LUMINANCE_ALPHA16F_ARB 0x881F +#endif + +#ifndef GL_ARB_pixel_buffer_object +#define GL_PIXEL_PACK_BUFFER_ARB 0x88EB +#define GL_PIXEL_UNPACK_BUFFER_ARB 0x88EC +#define GL_PIXEL_PACK_BUFFER_BINDING_ARB 0x88ED +#define GL_PIXEL_UNPACK_BUFFER_BINDING_ARB 0x88EF +#endif + +#ifndef GL_EXT_abgr +#define GL_ABGR_EXT 0x8000 +#endif + +#ifndef GL_EXT_blend_color +#define GL_CONSTANT_COLOR_EXT 0x8001 +#define GL_ONE_MINUS_CONSTANT_COLOR_EXT 0x8002 +#define GL_CONSTANT_ALPHA_EXT 0x8003 +#define GL_ONE_MINUS_CONSTANT_ALPHA_EXT 0x8004 +#define GL_BLEND_COLOR_EXT 0x8005 +#endif + +#ifndef GL_EXT_polygon_offset +#define GL_POLYGON_OFFSET_EXT 0x8037 +#define GL_POLYGON_OFFSET_FACTOR_EXT 0x8038 +#define GL_POLYGON_OFFSET_BIAS_EXT 0x8039 +#endif + +#ifndef GL_EXT_texture +#define GL_ALPHA4_EXT 0x803B +#define GL_ALPHA8_EXT 0x803C +#define GL_ALPHA12_EXT 0x803D +#define GL_ALPHA16_EXT 0x803E +#define GL_LUMINANCE4_EXT 0x803F +#define GL_LUMINANCE8_EXT 0x8040 +#define GL_LUMINANCE12_EXT 0x8041 +#define GL_LUMINANCE16_EXT 0x8042 +#define GL_LUMINANCE4_ALPHA4_EXT 0x8043 +#define GL_LUMINANCE6_ALPHA2_EXT 0x8044 +#define GL_LUMINANCE8_ALPHA8_EXT 0x8045 +#define GL_LUMINANCE12_ALPHA4_EXT 0x8046 +#define GL_LUMINANCE12_ALPHA12_EXT 0x8047 +#define GL_LUMINANCE16_ALPHA16_EXT 0x8048 +#define GL_INTENSITY_EXT 0x8049 +#define GL_INTENSITY4_EXT 0x804A +#define GL_INTENSITY8_EXT 0x804B +#define GL_INTENSITY12_EXT 0x804C +#define GL_INTENSITY16_EXT 0x804D +#define GL_RGB2_EXT 0x804E +#define GL_RGB4_EXT 0x804F +#define GL_RGB5_EXT 0x8050 +#define GL_RGB8_EXT 0x8051 +#define GL_RGB10_EXT 0x8052 +#define GL_RGB12_EXT 0x8053 +#define GL_RGB16_EXT 0x8054 +#define GL_RGBA2_EXT 0x8055 +#define GL_RGBA4_EXT 0x8056 +#define GL_RGB5_A1_EXT 0x8057 +#define GL_RGBA8_EXT 0x8058 +#define GL_RGB10_A2_EXT 0x8059 +#define GL_RGBA12_EXT 0x805A +#define GL_RGBA16_EXT 0x805B +#define GL_TEXTURE_RED_SIZE_EXT 0x805C +#define GL_TEXTURE_GREEN_SIZE_EXT 0x805D +#define GL_TEXTURE_BLUE_SIZE_EXT 0x805E +#define GL_TEXTURE_ALPHA_SIZE_EXT 0x805F +#define GL_TEXTURE_LUMINANCE_SIZE_EXT 0x8060 +#define GL_TEXTURE_INTENSITY_SIZE_EXT 0x8061 +#define GL_REPLACE_EXT 0x8062 +#define GL_PROXY_TEXTURE_1D_EXT 0x8063 +#define GL_PROXY_TEXTURE_2D_EXT 0x8064 +#define GL_TEXTURE_TOO_LARGE_EXT 0x8065 +#endif + +#ifndef GL_EXT_texture3D +#define GL_PACK_SKIP_IMAGES_EXT 0x806B +#define GL_PACK_IMAGE_HEIGHT_EXT 0x806C +#define GL_UNPACK_SKIP_IMAGES_EXT 0x806D +#define GL_UNPACK_IMAGE_HEIGHT_EXT 0x806E +#define GL_TEXTURE_3D_EXT 0x806F +#define GL_PROXY_TEXTURE_3D_EXT 0x8070 +#define GL_TEXTURE_DEPTH_EXT 0x8071 +#define GL_TEXTURE_WRAP_R_EXT 0x8072 +#define GL_MAX_3D_TEXTURE_SIZE_EXT 0x8073 +#endif + +#ifndef GL_SGIS_texture_filter4 +#define GL_FILTER4_SGIS 0x8146 +#define GL_TEXTURE_FILTER4_SIZE_SGIS 0x8147 +#endif + +#ifndef GL_EXT_subtexture +#endif + +#ifndef GL_EXT_copy_texture +#endif + +#ifndef GL_EXT_histogram +#define GL_HISTOGRAM_EXT 0x8024 +#define GL_PROXY_HISTOGRAM_EXT 0x8025 +#define GL_HISTOGRAM_WIDTH_EXT 0x8026 +#define GL_HISTOGRAM_FORMAT_EXT 0x8027 +#define GL_HISTOGRAM_RED_SIZE_EXT 0x8028 +#define GL_HISTOGRAM_GREEN_SIZE_EXT 0x8029 +#define GL_HISTOGRAM_BLUE_SIZE_EXT 0x802A +#define GL_HISTOGRAM_ALPHA_SIZE_EXT 0x802B +#define GL_HISTOGRAM_LUMINANCE_SIZE_EXT 0x802C +#define GL_HISTOGRAM_SINK_EXT 0x802D +#define GL_MINMAX_EXT 0x802E +#define GL_MINMAX_FORMAT_EXT 0x802F +#define GL_MINMAX_SINK_EXT 0x8030 +#define GL_TABLE_TOO_LARGE_EXT 0x8031 +#endif + +#ifndef GL_EXT_convolution +#define GL_CONVOLUTION_1D_EXT 0x8010 +#define GL_CONVOLUTION_2D_EXT 0x8011 +#define GL_SEPARABLE_2D_EXT 0x8012 +#define GL_CONVOLUTION_BORDER_MODE_EXT 0x8013 +#define GL_CONVOLUTION_FILTER_SCALE_EXT 0x8014 +#define GL_CONVOLUTION_FILTER_BIAS_EXT 0x8015 +#define GL_REDUCE_EXT 0x8016 +#define GL_CONVOLUTION_FORMAT_EXT 0x8017 +#define GL_CONVOLUTION_WIDTH_EXT 0x8018 +#define GL_CONVOLUTION_HEIGHT_EXT 0x8019 +#define GL_MAX_CONVOLUTION_WIDTH_EXT 0x801A +#define GL_MAX_CONVOLUTION_HEIGHT_EXT 0x801B +#define GL_POST_CONVOLUTION_RED_SCALE_EXT 0x801C +#define GL_POST_CONVOLUTION_GREEN_SCALE_EXT 0x801D +#define GL_POST_CONVOLUTION_BLUE_SCALE_EXT 0x801E +#define GL_POST_CONVOLUTION_ALPHA_SCALE_EXT 0x801F +#define GL_POST_CONVOLUTION_RED_BIAS_EXT 0x8020 +#define GL_POST_CONVOLUTION_GREEN_BIAS_EXT 0x8021 +#define GL_POST_CONVOLUTION_BLUE_BIAS_EXT 0x8022 +#define GL_POST_CONVOLUTION_ALPHA_BIAS_EXT 0x8023 +#endif + +#ifndef GL_SGI_color_matrix +#define GL_COLOR_MATRIX_SGI 0x80B1 +#define GL_COLOR_MATRIX_STACK_DEPTH_SGI 0x80B2 +#define GL_MAX_COLOR_MATRIX_STACK_DEPTH_SGI 0x80B3 +#define GL_POST_COLOR_MATRIX_RED_SCALE_SGI 0x80B4 +#define GL_POST_COLOR_MATRIX_GREEN_SCALE_SGI 0x80B5 +#define GL_POST_COLOR_MATRIX_BLUE_SCALE_SGI 0x80B6 +#define GL_POST_COLOR_MATRIX_ALPHA_SCALE_SGI 0x80B7 +#define GL_POST_COLOR_MATRIX_RED_BIAS_SGI 0x80B8 +#define GL_POST_COLOR_MATRIX_GREEN_BIAS_SGI 0x80B9 +#define GL_POST_COLOR_MATRIX_BLUE_BIAS_SGI 0x80BA +#define GL_POST_COLOR_MATRIX_ALPHA_BIAS_SGI 0x80BB +#endif + +#ifndef GL_SGI_color_table +#define GL_COLOR_TABLE_SGI 0x80D0 +#define GL_POST_CONVOLUTION_COLOR_TABLE_SGI 0x80D1 +#define GL_POST_COLOR_MATRIX_COLOR_TABLE_SGI 0x80D2 +#define GL_PROXY_COLOR_TABLE_SGI 0x80D3 +#define GL_PROXY_POST_CONVOLUTION_COLOR_TABLE_SGI 0x80D4 +#define GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE_SGI 0x80D5 +#define GL_COLOR_TABLE_SCALE_SGI 0x80D6 +#define GL_COLOR_TABLE_BIAS_SGI 0x80D7 +#define GL_COLOR_TABLE_FORMAT_SGI 0x80D8 +#define GL_COLOR_TABLE_WIDTH_SGI 0x80D9 +#define GL_COLOR_TABLE_RED_SIZE_SGI 0x80DA +#define GL_COLOR_TABLE_GREEN_SIZE_SGI 0x80DB +#define GL_COLOR_TABLE_BLUE_SIZE_SGI 0x80DC +#define GL_COLOR_TABLE_ALPHA_SIZE_SGI 0x80DD +#define GL_COLOR_TABLE_LUMINANCE_SIZE_SGI 0x80DE +#define GL_COLOR_TABLE_INTENSITY_SIZE_SGI 0x80DF +#endif + +#ifndef GL_SGIS_pixel_texture +#define GL_PIXEL_TEXTURE_SGIS 0x8353 +#define GL_PIXEL_FRAGMENT_RGB_SOURCE_SGIS 0x8354 +#define GL_PIXEL_FRAGMENT_ALPHA_SOURCE_SGIS 0x8355 +#define GL_PIXEL_GROUP_COLOR_SGIS 0x8356 +#endif + +#ifndef GL_SGIX_pixel_texture +#define GL_PIXEL_TEX_GEN_SGIX 0x8139 +#define GL_PIXEL_TEX_GEN_MODE_SGIX 0x832B +#endif + +#ifndef GL_SGIS_texture4D +#define GL_PACK_SKIP_VOLUMES_SGIS 0x8130 +#define GL_PACK_IMAGE_DEPTH_SGIS 0x8131 +#define GL_UNPACK_SKIP_VOLUMES_SGIS 0x8132 +#define GL_UNPACK_IMAGE_DEPTH_SGIS 0x8133 +#define GL_TEXTURE_4D_SGIS 0x8134 +#define GL_PROXY_TEXTURE_4D_SGIS 0x8135 +#define GL_TEXTURE_4DSIZE_SGIS 0x8136 +#define GL_TEXTURE_WRAP_Q_SGIS 0x8137 +#define GL_MAX_4D_TEXTURE_SIZE_SGIS 0x8138 +#define GL_TEXTURE_4D_BINDING_SGIS 0x814F +#endif + +#ifndef GL_SGI_texture_color_table +#define GL_TEXTURE_COLOR_TABLE_SGI 0x80BC +#define GL_PROXY_TEXTURE_COLOR_TABLE_SGI 0x80BD +#endif + +#ifndef GL_EXT_cmyka +#define GL_CMYK_EXT 0x800C +#define GL_CMYKA_EXT 0x800D +#define GL_PACK_CMYK_HINT_EXT 0x800E +#define GL_UNPACK_CMYK_HINT_EXT 0x800F +#endif + +#ifndef GL_EXT_texture_object +#define GL_TEXTURE_PRIORITY_EXT 0x8066 +#define GL_TEXTURE_RESIDENT_EXT 0x8067 +#define GL_TEXTURE_1D_BINDING_EXT 0x8068 +#define GL_TEXTURE_2D_BINDING_EXT 0x8069 +#define GL_TEXTURE_3D_BINDING_EXT 0x806A +#endif + +#ifndef GL_SGIS_detail_texture +#define GL_DETAIL_TEXTURE_2D_SGIS 0x8095 +#define GL_DETAIL_TEXTURE_2D_BINDING_SGIS 0x8096 +#define GL_LINEAR_DETAIL_SGIS 0x8097 +#define GL_LINEAR_DETAIL_ALPHA_SGIS 0x8098 +#define GL_LINEAR_DETAIL_COLOR_SGIS 0x8099 +#define GL_DETAIL_TEXTURE_LEVEL_SGIS 0x809A +#define GL_DETAIL_TEXTURE_MODE_SGIS 0x809B +#define GL_DETAIL_TEXTURE_FUNC_POINTS_SGIS 0x809C +#endif + +#ifndef GL_SGIS_sharpen_texture +#define GL_LINEAR_SHARPEN_SGIS 0x80AD +#define GL_LINEAR_SHARPEN_ALPHA_SGIS 0x80AE +#define GL_LINEAR_SHARPEN_COLOR_SGIS 0x80AF +#define GL_SHARPEN_TEXTURE_FUNC_POINTS_SGIS 0x80B0 +#endif + +#ifndef GL_EXT_packed_pixels +#define GL_UNSIGNED_BYTE_3_3_2_EXT 0x8032 +#define GL_UNSIGNED_SHORT_4_4_4_4_EXT 0x8033 +#define GL_UNSIGNED_SHORT_5_5_5_1_EXT 0x8034 +#define GL_UNSIGNED_INT_8_8_8_8_EXT 0x8035 +#define GL_UNSIGNED_INT_10_10_10_2_EXT 0x8036 +#endif + +#ifndef GL_SGIS_texture_lod +#define GL_TEXTURE_MIN_LOD_SGIS 0x813A +#define GL_TEXTURE_MAX_LOD_SGIS 0x813B +#define GL_TEXTURE_BASE_LEVEL_SGIS 0x813C +#define GL_TEXTURE_MAX_LEVEL_SGIS 0x813D +#endif + +#ifndef GL_SGIS_multisample +#define GL_MULTISAMPLE_SGIS 0x809D +#define GL_SAMPLE_ALPHA_TO_MASK_SGIS 0x809E +#define GL_SAMPLE_ALPHA_TO_ONE_SGIS 0x809F +#define GL_SAMPLE_MASK_SGIS 0x80A0 +#define GL_1PASS_SGIS 0x80A1 +#define GL_2PASS_0_SGIS 0x80A2 +#define GL_2PASS_1_SGIS 0x80A3 +#define GL_4PASS_0_SGIS 0x80A4 +#define GL_4PASS_1_SGIS 0x80A5 +#define GL_4PASS_2_SGIS 0x80A6 +#define GL_4PASS_3_SGIS 0x80A7 +#define GL_SAMPLE_BUFFERS_SGIS 0x80A8 +#define GL_SAMPLES_SGIS 0x80A9 +#define GL_SAMPLE_MASK_VALUE_SGIS 0x80AA +#define GL_SAMPLE_MASK_INVERT_SGIS 0x80AB +#define GL_SAMPLE_PATTERN_SGIS 0x80AC +#endif + +#ifndef GL_EXT_rescale_normal +#define GL_RESCALE_NORMAL_EXT 0x803A +#endif + +#ifndef GL_EXT_vertex_array +#define GL_VERTEX_ARRAY_EXT 0x8074 +#define GL_NORMAL_ARRAY_EXT 0x8075 +#define GL_COLOR_ARRAY_EXT 0x8076 +#define GL_INDEX_ARRAY_EXT 0x8077 +#define GL_TEXTURE_COORD_ARRAY_EXT 0x8078 +#define GL_EDGE_FLAG_ARRAY_EXT 0x8079 +#define GL_VERTEX_ARRAY_SIZE_EXT 0x807A +#define GL_VERTEX_ARRAY_TYPE_EXT 0x807B +#define GL_VERTEX_ARRAY_STRIDE_EXT 0x807C +#define GL_VERTEX_ARRAY_COUNT_EXT 0x807D +#define GL_NORMAL_ARRAY_TYPE_EXT 0x807E +#define GL_NORMAL_ARRAY_STRIDE_EXT 0x807F +#define GL_NORMAL_ARRAY_COUNT_EXT 0x8080 +#define GL_COLOR_ARRAY_SIZE_EXT 0x8081 +#define GL_COLOR_ARRAY_TYPE_EXT 0x8082 +#define GL_COLOR_ARRAY_STRIDE_EXT 0x8083 +#define GL_COLOR_ARRAY_COUNT_EXT 0x8084 +#define GL_INDEX_ARRAY_TYPE_EXT 0x8085 +#define GL_INDEX_ARRAY_STRIDE_EXT 0x8086 +#define GL_INDEX_ARRAY_COUNT_EXT 0x8087 +#define GL_TEXTURE_COORD_ARRAY_SIZE_EXT 0x8088 +#define GL_TEXTURE_COORD_ARRAY_TYPE_EXT 0x8089 +#define GL_TEXTURE_COORD_ARRAY_STRIDE_EXT 0x808A +#define GL_TEXTURE_COORD_ARRAY_COUNT_EXT 0x808B +#define GL_EDGE_FLAG_ARRAY_STRIDE_EXT 0x808C +#define GL_EDGE_FLAG_ARRAY_COUNT_EXT 0x808D +#define GL_VERTEX_ARRAY_POINTER_EXT 0x808E +#define GL_NORMAL_ARRAY_POINTER_EXT 0x808F +#define GL_COLOR_ARRAY_POINTER_EXT 0x8090 +#define GL_INDEX_ARRAY_POINTER_EXT 0x8091 +#define GL_TEXTURE_COORD_ARRAY_POINTER_EXT 0x8092 +#define GL_EDGE_FLAG_ARRAY_POINTER_EXT 0x8093 +#endif + +#ifndef GL_EXT_misc_attribute +#endif + +#ifndef GL_SGIS_generate_mipmap +#define GL_GENERATE_MIPMAP_SGIS 0x8191 +#define GL_GENERATE_MIPMAP_HINT_SGIS 0x8192 +#endif + +#ifndef GL_SGIX_clipmap +#define GL_LINEAR_CLIPMAP_LINEAR_SGIX 0x8170 +#define GL_TEXTURE_CLIPMAP_CENTER_SGIX 0x8171 +#define GL_TEXTURE_CLIPMAP_FRAME_SGIX 0x8172 +#define GL_TEXTURE_CLIPMAP_OFFSET_SGIX 0x8173 +#define GL_TEXTURE_CLIPMAP_VIRTUAL_DEPTH_SGIX 0x8174 +#define GL_TEXTURE_CLIPMAP_LOD_OFFSET_SGIX 0x8175 +#define GL_TEXTURE_CLIPMAP_DEPTH_SGIX 0x8176 +#define GL_MAX_CLIPMAP_DEPTH_SGIX 0x8177 +#define GL_MAX_CLIPMAP_VIRTUAL_DEPTH_SGIX 0x8178 +#define GL_NEAREST_CLIPMAP_NEAREST_SGIX 0x844D +#define GL_NEAREST_CLIPMAP_LINEAR_SGIX 0x844E +#define GL_LINEAR_CLIPMAP_NEAREST_SGIX 0x844F +#endif + +#ifndef GL_SGIX_shadow +#define GL_TEXTURE_COMPARE_SGIX 0x819A +#define GL_TEXTURE_COMPARE_OPERATOR_SGIX 0x819B +#define GL_TEXTURE_LEQUAL_R_SGIX 0x819C +#define GL_TEXTURE_GEQUAL_R_SGIX 0x819D +#endif + +#ifndef GL_SGIS_texture_edge_clamp +#define GL_CLAMP_TO_EDGE_SGIS 0x812F +#endif + +#ifndef GL_SGIS_texture_border_clamp +#define GL_CLAMP_TO_BORDER_SGIS 0x812D +#endif + +#ifndef GL_EXT_blend_minmax +#define GL_FUNC_ADD_EXT 0x8006 +#define GL_MIN_EXT 0x8007 +#define GL_MAX_EXT 0x8008 +#define GL_BLEND_EQUATION_EXT 0x8009 +#endif + +#ifndef GL_EXT_blend_subtract +#define GL_FUNC_SUBTRACT_EXT 0x800A +#define GL_FUNC_REVERSE_SUBTRACT_EXT 0x800B +#endif + +#ifndef GL_EXT_blend_logic_op +#endif + +#ifndef GL_SGIX_interlace +#define GL_INTERLACE_SGIX 0x8094 +#endif + +#ifndef GL_SGIX_pixel_tiles +#define GL_PIXEL_TILE_BEST_ALIGNMENT_SGIX 0x813E +#define GL_PIXEL_TILE_CACHE_INCREMENT_SGIX 0x813F +#define GL_PIXEL_TILE_WIDTH_SGIX 0x8140 +#define GL_PIXEL_TILE_HEIGHT_SGIX 0x8141 +#define GL_PIXEL_TILE_GRID_WIDTH_SGIX 0x8142 +#define GL_PIXEL_TILE_GRID_HEIGHT_SGIX 0x8143 +#define GL_PIXEL_TILE_GRID_DEPTH_SGIX 0x8144 +#define GL_PIXEL_TILE_CACHE_SIZE_SGIX 0x8145 +#endif + +#ifndef GL_SGIS_texture_select +#define GL_DUAL_ALPHA4_SGIS 0x8110 +#define GL_DUAL_ALPHA8_SGIS 0x8111 +#define GL_DUAL_ALPHA12_SGIS 0x8112 +#define GL_DUAL_ALPHA16_SGIS 0x8113 +#define GL_DUAL_LUMINANCE4_SGIS 0x8114 +#define GL_DUAL_LUMINANCE8_SGIS 0x8115 +#define GL_DUAL_LUMINANCE12_SGIS 0x8116 +#define GL_DUAL_LUMINANCE16_SGIS 0x8117 +#define GL_DUAL_INTENSITY4_SGIS 0x8118 +#define GL_DUAL_INTENSITY8_SGIS 0x8119 +#define GL_DUAL_INTENSITY12_SGIS 0x811A +#define GL_DUAL_INTENSITY16_SGIS 0x811B +#define GL_DUAL_LUMINANCE_ALPHA4_SGIS 0x811C +#define GL_DUAL_LUMINANCE_ALPHA8_SGIS 0x811D +#define GL_QUAD_ALPHA4_SGIS 0x811E +#define GL_QUAD_ALPHA8_SGIS 0x811F +#define GL_QUAD_LUMINANCE4_SGIS 0x8120 +#define GL_QUAD_LUMINANCE8_SGIS 0x8121 +#define GL_QUAD_INTENSITY4_SGIS 0x8122 +#define GL_QUAD_INTENSITY8_SGIS 0x8123 +#define GL_DUAL_TEXTURE_SELECT_SGIS 0x8124 +#define GL_QUAD_TEXTURE_SELECT_SGIS 0x8125 +#endif + +#ifndef GL_SGIX_sprite +#define GL_SPRITE_SGIX 0x8148 +#define GL_SPRITE_MODE_SGIX 0x8149 +#define GL_SPRITE_AXIS_SGIX 0x814A +#define GL_SPRITE_TRANSLATION_SGIX 0x814B +#define GL_SPRITE_AXIAL_SGIX 0x814C +#define GL_SPRITE_OBJECT_ALIGNED_SGIX 0x814D +#define GL_SPRITE_EYE_ALIGNED_SGIX 0x814E +#endif + +#ifndef GL_SGIX_texture_multi_buffer +#define GL_TEXTURE_MULTI_BUFFER_HINT_SGIX 0x812E +#endif + +#ifndef GL_EXT_point_parameters +#define GL_POINT_SIZE_MIN_EXT 0x8126 +#define GL_POINT_SIZE_MAX_EXT 0x8127 +#define GL_POINT_FADE_THRESHOLD_SIZE_EXT 0x8128 +#define GL_DISTANCE_ATTENUATION_EXT 0x8129 +#endif + +#ifndef GL_SGIS_point_parameters +#define GL_POINT_SIZE_MIN_SGIS 0x8126 +#define GL_POINT_SIZE_MAX_SGIS 0x8127 +#define GL_POINT_FADE_THRESHOLD_SIZE_SGIS 0x8128 +#define GL_DISTANCE_ATTENUATION_SGIS 0x8129 +#endif + +#ifndef GL_SGIX_instruments +#define GL_INSTRUMENT_BUFFER_POINTER_SGIX 0x8180 +#define GL_INSTRUMENT_MEASUREMENTS_SGIX 0x8181 +#endif + +#ifndef GL_SGIX_texture_scale_bias +#define GL_POST_TEXTURE_FILTER_BIAS_SGIX 0x8179 +#define GL_POST_TEXTURE_FILTER_SCALE_SGIX 0x817A +#define GL_POST_TEXTURE_FILTER_BIAS_RANGE_SGIX 0x817B +#define GL_POST_TEXTURE_FILTER_SCALE_RANGE_SGIX 0x817C +#endif + +#ifndef GL_SGIX_framezoom +#define GL_FRAMEZOOM_SGIX 0x818B +#define GL_FRAMEZOOM_FACTOR_SGIX 0x818C +#define GL_MAX_FRAMEZOOM_FACTOR_SGIX 0x818D +#endif + +#ifndef GL_SGIX_tag_sample_buffer +#endif + +#ifndef GL_FfdMaskSGIX +#define GL_TEXTURE_DEFORMATION_BIT_SGIX 0x00000001 +#define GL_GEOMETRY_DEFORMATION_BIT_SGIX 0x00000002 +#endif + +#ifndef GL_SGIX_polynomial_ffd +#define GL_GEOMETRY_DEFORMATION_SGIX 0x8194 +#define GL_TEXTURE_DEFORMATION_SGIX 0x8195 +#define GL_DEFORMATIONS_MASK_SGIX 0x8196 +#define GL_MAX_DEFORMATION_ORDER_SGIX 0x8197 +#endif + +#ifndef GL_SGIX_reference_plane +#define GL_REFERENCE_PLANE_SGIX 0x817D +#define GL_REFERENCE_PLANE_EQUATION_SGIX 0x817E +#endif + +#ifndef GL_SGIX_flush_raster +#endif + +#ifndef GL_SGIX_depth_texture +#define GL_DEPTH_COMPONENT16_SGIX 0x81A5 +#define GL_DEPTH_COMPONENT24_SGIX 0x81A6 +#define GL_DEPTH_COMPONENT32_SGIX 0x81A7 +#endif + +#ifndef GL_SGIS_fog_function +#define GL_FOG_FUNC_SGIS 0x812A +#define GL_FOG_FUNC_POINTS_SGIS 0x812B +#define GL_MAX_FOG_FUNC_POINTS_SGIS 0x812C +#endif + +#ifndef GL_SGIX_fog_offset +#define GL_FOG_OFFSET_SGIX 0x8198 +#define GL_FOG_OFFSET_VALUE_SGIX 0x8199 +#endif + +#ifndef GL_HP_image_transform +#define GL_IMAGE_SCALE_X_HP 0x8155 +#define GL_IMAGE_SCALE_Y_HP 0x8156 +#define GL_IMAGE_TRANSLATE_X_HP 0x8157 +#define GL_IMAGE_TRANSLATE_Y_HP 0x8158 +#define GL_IMAGE_ROTATE_ANGLE_HP 0x8159 +#define GL_IMAGE_ROTATE_ORIGIN_X_HP 0x815A +#define GL_IMAGE_ROTATE_ORIGIN_Y_HP 0x815B +#define GL_IMAGE_MAG_FILTER_HP 0x815C +#define GL_IMAGE_MIN_FILTER_HP 0x815D +#define GL_IMAGE_CUBIC_WEIGHT_HP 0x815E +#define GL_CUBIC_HP 0x815F +#define GL_AVERAGE_HP 0x8160 +#define GL_IMAGE_TRANSFORM_2D_HP 0x8161 +#define GL_POST_IMAGE_TRANSFORM_COLOR_TABLE_HP 0x8162 +#define GL_PROXY_POST_IMAGE_TRANSFORM_COLOR_TABLE_HP 0x8163 +#endif + +#ifndef GL_HP_convolution_border_modes +#define GL_IGNORE_BORDER_HP 0x8150 +#define GL_CONSTANT_BORDER_HP 0x8151 +#define GL_REPLICATE_BORDER_HP 0x8153 +#define GL_CONVOLUTION_BORDER_COLOR_HP 0x8154 +#endif + +#ifndef GL_INGR_palette_buffer +#endif + +#ifndef GL_SGIX_texture_add_env +#define GL_TEXTURE_ENV_BIAS_SGIX 0x80BE +#endif + +#ifndef GL_EXT_color_subtable +#endif + +#ifndef GL_PGI_vertex_hints +#define GL_VERTEX_DATA_HINT_PGI 0x1A22A +#define GL_VERTEX_CONSISTENT_HINT_PGI 0x1A22B +#define GL_MATERIAL_SIDE_HINT_PGI 0x1A22C +#define GL_MAX_VERTEX_HINT_PGI 0x1A22D +#define GL_COLOR3_BIT_PGI 0x00010000 +#define GL_COLOR4_BIT_PGI 0x00020000 +#define GL_EDGEFLAG_BIT_PGI 0x00040000 +#define GL_INDEX_BIT_PGI 0x00080000 +#define GL_MAT_AMBIENT_BIT_PGI 0x00100000 +#define GL_MAT_AMBIENT_AND_DIFFUSE_BIT_PGI 0x00200000 +#define GL_MAT_DIFFUSE_BIT_PGI 0x00400000 +#define GL_MAT_EMISSION_BIT_PGI 0x00800000 +#define GL_MAT_COLOR_INDEXES_BIT_PGI 0x01000000 +#define GL_MAT_SHININESS_BIT_PGI 0x02000000 +#define GL_MAT_SPECULAR_BIT_PGI 0x04000000 +#define GL_NORMAL_BIT_PGI 0x08000000 +#define GL_TEXCOORD1_BIT_PGI 0x10000000 +#define GL_TEXCOORD2_BIT_PGI 0x20000000 +#define GL_TEXCOORD3_BIT_PGI 0x40000000 +#define GL_TEXCOORD4_BIT_PGI 0x80000000 +#define GL_VERTEX23_BIT_PGI 0x00000004 +#define GL_VERTEX4_BIT_PGI 0x00000008 +#endif + +#ifndef GL_PGI_misc_hints +#define GL_PREFER_DOUBLEBUFFER_HINT_PGI 0x1A1F8 +#define GL_CONSERVE_MEMORY_HINT_PGI 0x1A1FD +#define GL_RECLAIM_MEMORY_HINT_PGI 0x1A1FE +#define GL_NATIVE_GRAPHICS_HANDLE_PGI 0x1A202 +#define GL_NATIVE_GRAPHICS_BEGIN_HINT_PGI 0x1A203 +#define GL_NATIVE_GRAPHICS_END_HINT_PGI 0x1A204 +#define GL_ALWAYS_FAST_HINT_PGI 0x1A20C +#define GL_ALWAYS_SOFT_HINT_PGI 0x1A20D +#define GL_ALLOW_DRAW_OBJ_HINT_PGI 0x1A20E +#define GL_ALLOW_DRAW_WIN_HINT_PGI 0x1A20F +#define GL_ALLOW_DRAW_FRG_HINT_PGI 0x1A210 +#define GL_ALLOW_DRAW_MEM_HINT_PGI 0x1A211 +#define GL_STRICT_DEPTHFUNC_HINT_PGI 0x1A216 +#define GL_STRICT_LIGHTING_HINT_PGI 0x1A217 +#define GL_STRICT_SCISSOR_HINT_PGI 0x1A218 +#define GL_FULL_STIPPLE_HINT_PGI 0x1A219 +#define GL_CLIP_NEAR_HINT_PGI 0x1A220 +#define GL_CLIP_FAR_HINT_PGI 0x1A221 +#define GL_WIDE_LINE_HINT_PGI 0x1A222 +#define GL_BACK_NORMALS_HINT_PGI 0x1A223 +#endif + +#ifndef GL_EXT_paletted_texture +#define GL_COLOR_INDEX1_EXT 0x80E2 +#define GL_COLOR_INDEX2_EXT 0x80E3 +#define GL_COLOR_INDEX4_EXT 0x80E4 +#define GL_COLOR_INDEX8_EXT 0x80E5 +#define GL_COLOR_INDEX12_EXT 0x80E6 +#define GL_COLOR_INDEX16_EXT 0x80E7 +#define GL_TEXTURE_INDEX_SIZE_EXT 0x80ED +#endif + +#ifndef GL_EXT_clip_volume_hint +#define GL_CLIP_VOLUME_CLIPPING_HINT_EXT 0x80F0 +#endif + +#ifndef GL_SGIX_list_priority +#define GL_LIST_PRIORITY_SGIX 0x8182 +#endif + +#ifndef GL_SGIX_ir_instrument1 +#define GL_IR_INSTRUMENT1_SGIX 0x817F +#endif + +#ifndef GL_SGIX_calligraphic_fragment +#define GL_CALLIGRAPHIC_FRAGMENT_SGIX 0x8183 +#endif + +#ifndef GL_SGIX_texture_lod_bias +#define GL_TEXTURE_LOD_BIAS_S_SGIX 0x818E +#define GL_TEXTURE_LOD_BIAS_T_SGIX 0x818F +#define GL_TEXTURE_LOD_BIAS_R_SGIX 0x8190 +#endif + +#ifndef GL_SGIX_shadow_ambient +#define GL_SHADOW_AMBIENT_SGIX 0x80BF +#endif + +#ifndef GL_EXT_index_texture +#endif + +#ifndef GL_EXT_index_material +#define GL_INDEX_MATERIAL_EXT 0x81B8 +#define GL_INDEX_MATERIAL_PARAMETER_EXT 0x81B9 +#define GL_INDEX_MATERIAL_FACE_EXT 0x81BA +#endif + +#ifndef GL_EXT_index_func +#define GL_INDEX_TEST_EXT 0x81B5 +#define GL_INDEX_TEST_FUNC_EXT 0x81B6 +#define GL_INDEX_TEST_REF_EXT 0x81B7 +#endif + +#ifndef GL_EXT_index_array_formats +#define GL_IUI_V2F_EXT 0x81AD +#define GL_IUI_V3F_EXT 0x81AE +#define GL_IUI_N3F_V2F_EXT 0x81AF +#define GL_IUI_N3F_V3F_EXT 0x81B0 +#define GL_T2F_IUI_V2F_EXT 0x81B1 +#define GL_T2F_IUI_V3F_EXT 0x81B2 +#define GL_T2F_IUI_N3F_V2F_EXT 0x81B3 +#define GL_T2F_IUI_N3F_V3F_EXT 0x81B4 +#endif + +#ifndef GL_EXT_compiled_vertex_array +#define GL_ARRAY_ELEMENT_LOCK_FIRST_EXT 0x81A8 +#define GL_ARRAY_ELEMENT_LOCK_COUNT_EXT 0x81A9 +#endif + +#ifndef GL_EXT_cull_vertex +#define GL_CULL_VERTEX_EXT 0x81AA +#define GL_CULL_VERTEX_EYE_POSITION_EXT 0x81AB +#define GL_CULL_VERTEX_OBJECT_POSITION_EXT 0x81AC +#endif + +#ifndef GL_SGIX_ycrcb +#define GL_YCRCB_422_SGIX 0x81BB +#define GL_YCRCB_444_SGIX 0x81BC +#endif + +#ifndef GL_SGIX_fragment_lighting +#define GL_FRAGMENT_LIGHTING_SGIX 0x8400 +#define GL_FRAGMENT_COLOR_MATERIAL_SGIX 0x8401 +#define GL_FRAGMENT_COLOR_MATERIAL_FACE_SGIX 0x8402 +#define GL_FRAGMENT_COLOR_MATERIAL_PARAMETER_SGIX 0x8403 +#define GL_MAX_FRAGMENT_LIGHTS_SGIX 0x8404 +#define GL_MAX_ACTIVE_LIGHTS_SGIX 0x8405 +#define GL_CURRENT_RASTER_NORMAL_SGIX 0x8406 +#define GL_LIGHT_ENV_MODE_SGIX 0x8407 +#define GL_FRAGMENT_LIGHT_MODEL_LOCAL_VIEWER_SGIX 0x8408 +#define GL_FRAGMENT_LIGHT_MODEL_TWO_SIDE_SGIX 0x8409 +#define GL_FRAGMENT_LIGHT_MODEL_AMBIENT_SGIX 0x840A +#define GL_FRAGMENT_LIGHT_MODEL_NORMAL_INTERPOLATION_SGIX 0x840B +#define GL_FRAGMENT_LIGHT0_SGIX 0x840C +#define GL_FRAGMENT_LIGHT1_SGIX 0x840D +#define GL_FRAGMENT_LIGHT2_SGIX 0x840E +#define GL_FRAGMENT_LIGHT3_SGIX 0x840F +#define GL_FRAGMENT_LIGHT4_SGIX 0x8410 +#define GL_FRAGMENT_LIGHT5_SGIX 0x8411 +#define GL_FRAGMENT_LIGHT6_SGIX 0x8412 +#define GL_FRAGMENT_LIGHT7_SGIX 0x8413 +#endif + +#ifndef GL_IBM_rasterpos_clip +#define GL_RASTER_POSITION_UNCLIPPED_IBM 0x19262 +#endif + +#ifndef GL_HP_texture_lighting +#define GL_TEXTURE_LIGHTING_MODE_HP 0x8167 +#define GL_TEXTURE_POST_SPECULAR_HP 0x8168 +#define GL_TEXTURE_PRE_SPECULAR_HP 0x8169 +#endif + +#ifndef GL_EXT_draw_range_elements +#define GL_MAX_ELEMENTS_VERTICES_EXT 0x80E8 +#define GL_MAX_ELEMENTS_INDICES_EXT 0x80E9 +#endif + +#ifndef GL_WIN_phong_shading +#define GL_PHONG_WIN 0x80EA +#define GL_PHONG_HINT_WIN 0x80EB +#endif + +#ifndef GL_WIN_specular_fog +#define GL_FOG_SPECULAR_TEXTURE_WIN 0x80EC +#endif + +#ifndef GL_EXT_light_texture +#define GL_FRAGMENT_MATERIAL_EXT 0x8349 +#define GL_FRAGMENT_NORMAL_EXT 0x834A +#define GL_FRAGMENT_COLOR_EXT 0x834C +#define GL_ATTENUATION_EXT 0x834D +#define GL_SHADOW_ATTENUATION_EXT 0x834E +#define GL_TEXTURE_APPLICATION_MODE_EXT 0x834F +#define GL_TEXTURE_LIGHT_EXT 0x8350 +#define GL_TEXTURE_MATERIAL_FACE_EXT 0x8351 +#define GL_TEXTURE_MATERIAL_PARAMETER_EXT 0x8352 +/* reuse GL_FRAGMENT_DEPTH_EXT */ +#endif + +#ifndef GL_SGIX_blend_alpha_minmax +#define GL_ALPHA_MIN_SGIX 0x8320 +#define GL_ALPHA_MAX_SGIX 0x8321 +#endif + +#ifndef GL_SGIX_impact_pixel_texture +#define GL_PIXEL_TEX_GEN_Q_CEILING_SGIX 0x8184 +#define GL_PIXEL_TEX_GEN_Q_ROUND_SGIX 0x8185 +#define GL_PIXEL_TEX_GEN_Q_FLOOR_SGIX 0x8186 +#define GL_PIXEL_TEX_GEN_ALPHA_REPLACE_SGIX 0x8187 +#define GL_PIXEL_TEX_GEN_ALPHA_NO_REPLACE_SGIX 0x8188 +#define GL_PIXEL_TEX_GEN_ALPHA_LS_SGIX 0x8189 +#define GL_PIXEL_TEX_GEN_ALPHA_MS_SGIX 0x818A +#endif + +#ifndef GL_EXT_bgra +#define GL_BGR_EXT 0x80E0 +#define GL_BGRA_EXT 0x80E1 +#endif + +#ifndef GL_SGIX_async +#define GL_ASYNC_MARKER_SGIX 0x8329 +#endif + +#ifndef GL_SGIX_async_pixel +#define GL_ASYNC_TEX_IMAGE_SGIX 0x835C +#define GL_ASYNC_DRAW_PIXELS_SGIX 0x835D +#define GL_ASYNC_READ_PIXELS_SGIX 0x835E +#define GL_MAX_ASYNC_TEX_IMAGE_SGIX 0x835F +#define GL_MAX_ASYNC_DRAW_PIXELS_SGIX 0x8360 +#define GL_MAX_ASYNC_READ_PIXELS_SGIX 0x8361 +#endif + +#ifndef GL_SGIX_async_histogram +#define GL_ASYNC_HISTOGRAM_SGIX 0x832C +#define GL_MAX_ASYNC_HISTOGRAM_SGIX 0x832D +#endif + +#ifndef GL_INTEL_texture_scissor +#endif + +#ifndef GL_INTEL_parallel_arrays +#define GL_PARALLEL_ARRAYS_INTEL 0x83F4 +#define GL_VERTEX_ARRAY_PARALLEL_POINTERS_INTEL 0x83F5 +#define GL_NORMAL_ARRAY_PARALLEL_POINTERS_INTEL 0x83F6 +#define GL_COLOR_ARRAY_PARALLEL_POINTERS_INTEL 0x83F7 +#define GL_TEXTURE_COORD_ARRAY_PARALLEL_POINTERS_INTEL 0x83F8 +#endif + +#ifndef GL_HP_occlusion_test +#define GL_OCCLUSION_TEST_HP 0x8165 +#define GL_OCCLUSION_TEST_RESULT_HP 0x8166 +#endif + +#ifndef GL_EXT_pixel_transform +#define GL_PIXEL_TRANSFORM_2D_EXT 0x8330 +#define GL_PIXEL_MAG_FILTER_EXT 0x8331 +#define GL_PIXEL_MIN_FILTER_EXT 0x8332 +#define GL_PIXEL_CUBIC_WEIGHT_EXT 0x8333 +#define GL_CUBIC_EXT 0x8334 +#define GL_AVERAGE_EXT 0x8335 +#define GL_PIXEL_TRANSFORM_2D_STACK_DEPTH_EXT 0x8336 +#define GL_MAX_PIXEL_TRANSFORM_2D_STACK_DEPTH_EXT 0x8337 +#define GL_PIXEL_TRANSFORM_2D_MATRIX_EXT 0x8338 +#endif + +#ifndef GL_EXT_pixel_transform_color_table +#endif + +#ifndef GL_EXT_shared_texture_palette +#define GL_SHARED_TEXTURE_PALETTE_EXT 0x81FB +#endif + +#ifndef GL_EXT_separate_specular_color +#define GL_LIGHT_MODEL_COLOR_CONTROL_EXT 0x81F8 +#define GL_SINGLE_COLOR_EXT 0x81F9 +#define GL_SEPARATE_SPECULAR_COLOR_EXT 0x81FA +#endif + +#ifndef GL_EXT_secondary_color +#define GL_COLOR_SUM_EXT 0x8458 +#define GL_CURRENT_SECONDARY_COLOR_EXT 0x8459 +#define GL_SECONDARY_COLOR_ARRAY_SIZE_EXT 0x845A +#define GL_SECONDARY_COLOR_ARRAY_TYPE_EXT 0x845B +#define GL_SECONDARY_COLOR_ARRAY_STRIDE_EXT 0x845C +#define GL_SECONDARY_COLOR_ARRAY_POINTER_EXT 0x845D +#define GL_SECONDARY_COLOR_ARRAY_EXT 0x845E +#endif + +#ifndef GL_EXT_texture_perturb_normal +#define GL_PERTURB_EXT 0x85AE +#define GL_TEXTURE_NORMAL_EXT 0x85AF +#endif + +#ifndef GL_EXT_multi_draw_arrays +#endif + +#ifndef GL_EXT_fog_coord +#define GL_FOG_COORDINATE_SOURCE_EXT 0x8450 +#define GL_FOG_COORDINATE_EXT 0x8451 +#define GL_FRAGMENT_DEPTH_EXT 0x8452 +#define GL_CURRENT_FOG_COORDINATE_EXT 0x8453 +#define GL_FOG_COORDINATE_ARRAY_TYPE_EXT 0x8454 +#define GL_FOG_COORDINATE_ARRAY_STRIDE_EXT 0x8455 +#define GL_FOG_COORDINATE_ARRAY_POINTER_EXT 0x8456 +#define GL_FOG_COORDINATE_ARRAY_EXT 0x8457 +#endif + +#ifndef GL_REND_screen_coordinates +#define GL_SCREEN_COORDINATES_REND 0x8490 +#define GL_INVERTED_SCREEN_W_REND 0x8491 +#endif + +#ifndef GL_EXT_coordinate_frame +#define GL_TANGENT_ARRAY_EXT 0x8439 +#define GL_BINORMAL_ARRAY_EXT 0x843A +#define GL_CURRENT_TANGENT_EXT 0x843B +#define GL_CURRENT_BINORMAL_EXT 0x843C +#define GL_TANGENT_ARRAY_TYPE_EXT 0x843E +#define GL_TANGENT_ARRAY_STRIDE_EXT 0x843F +#define GL_BINORMAL_ARRAY_TYPE_EXT 0x8440 +#define GL_BINORMAL_ARRAY_STRIDE_EXT 0x8441 +#define GL_TANGENT_ARRAY_POINTER_EXT 0x8442 +#define GL_BINORMAL_ARRAY_POINTER_EXT 0x8443 +#define GL_MAP1_TANGENT_EXT 0x8444 +#define GL_MAP2_TANGENT_EXT 0x8445 +#define GL_MAP1_BINORMAL_EXT 0x8446 +#define GL_MAP2_BINORMAL_EXT 0x8447 +#endif + +#ifndef GL_EXT_texture_env_combine +#define GL_COMBINE_EXT 0x8570 +#define GL_COMBINE_RGB_EXT 0x8571 +#define GL_COMBINE_ALPHA_EXT 0x8572 +#define GL_RGB_SCALE_EXT 0x8573 +#define GL_ADD_SIGNED_EXT 0x8574 +#define GL_INTERPOLATE_EXT 0x8575 +#define GL_CONSTANT_EXT 0x8576 +#define GL_PRIMARY_COLOR_EXT 0x8577 +#define GL_PREVIOUS_EXT 0x8578 +#define GL_SOURCE0_RGB_EXT 0x8580 +#define GL_SOURCE1_RGB_EXT 0x8581 +#define GL_SOURCE2_RGB_EXT 0x8582 +#define GL_SOURCE0_ALPHA_EXT 0x8588 +#define GL_SOURCE1_ALPHA_EXT 0x8589 +#define GL_SOURCE2_ALPHA_EXT 0x858A +#define GL_OPERAND0_RGB_EXT 0x8590 +#define GL_OPERAND1_RGB_EXT 0x8591 +#define GL_OPERAND2_RGB_EXT 0x8592 +#define GL_OPERAND0_ALPHA_EXT 0x8598 +#define GL_OPERAND1_ALPHA_EXT 0x8599 +#define GL_OPERAND2_ALPHA_EXT 0x859A +#endif + +#ifndef GL_APPLE_specular_vector +#define GL_LIGHT_MODEL_SPECULAR_VECTOR_APPLE 0x85B0 +#endif + +#ifndef GL_APPLE_transform_hint +#define GL_TRANSFORM_HINT_APPLE 0x85B1 +#endif + +#ifndef GL_SGIX_fog_scale +#define GL_FOG_SCALE_SGIX 0x81FC +#define GL_FOG_SCALE_VALUE_SGIX 0x81FD +#endif + +#ifndef GL_SUNX_constant_data +#define GL_UNPACK_CONSTANT_DATA_SUNX 0x81D5 +#define GL_TEXTURE_CONSTANT_DATA_SUNX 0x81D6 +#endif + +#ifndef GL_SUN_global_alpha +#define GL_GLOBAL_ALPHA_SUN 0x81D9 +#define GL_GLOBAL_ALPHA_FACTOR_SUN 0x81DA +#endif + +#ifndef GL_SUN_triangle_list +#define GL_RESTART_SUN 0x0001 +#define GL_REPLACE_MIDDLE_SUN 0x0002 +#define GL_REPLACE_OLDEST_SUN 0x0003 +#define GL_TRIANGLE_LIST_SUN 0x81D7 +#define GL_REPLACEMENT_CODE_SUN 0x81D8 +#define GL_REPLACEMENT_CODE_ARRAY_SUN 0x85C0 +#define GL_REPLACEMENT_CODE_ARRAY_TYPE_SUN 0x85C1 +#define GL_REPLACEMENT_CODE_ARRAY_STRIDE_SUN 0x85C2 +#define GL_REPLACEMENT_CODE_ARRAY_POINTER_SUN 0x85C3 +#define GL_R1UI_V3F_SUN 0x85C4 +#define GL_R1UI_C4UB_V3F_SUN 0x85C5 +#define GL_R1UI_C3F_V3F_SUN 0x85C6 +#define GL_R1UI_N3F_V3F_SUN 0x85C7 +#define GL_R1UI_C4F_N3F_V3F_SUN 0x85C8 +#define GL_R1UI_T2F_V3F_SUN 0x85C9 +#define GL_R1UI_T2F_N3F_V3F_SUN 0x85CA +#define GL_R1UI_T2F_C4F_N3F_V3F_SUN 0x85CB +#endif + +#ifndef GL_SUN_vertex +#endif + +#ifndef GL_EXT_blend_func_separate +#define GL_BLEND_DST_RGB_EXT 0x80C8 +#define GL_BLEND_SRC_RGB_EXT 0x80C9 +#define GL_BLEND_DST_ALPHA_EXT 0x80CA +#define GL_BLEND_SRC_ALPHA_EXT 0x80CB +#endif + +#ifndef GL_INGR_color_clamp +#define GL_RED_MIN_CLAMP_INGR 0x8560 +#define GL_GREEN_MIN_CLAMP_INGR 0x8561 +#define GL_BLUE_MIN_CLAMP_INGR 0x8562 +#define GL_ALPHA_MIN_CLAMP_INGR 0x8563 +#define GL_RED_MAX_CLAMP_INGR 0x8564 +#define GL_GREEN_MAX_CLAMP_INGR 0x8565 +#define GL_BLUE_MAX_CLAMP_INGR 0x8566 +#define GL_ALPHA_MAX_CLAMP_INGR 0x8567 +#endif + +#ifndef GL_INGR_interlace_read +#define GL_INTERLACE_READ_INGR 0x8568 +#endif + +#ifndef GL_EXT_stencil_wrap +#define GL_INCR_WRAP_EXT 0x8507 +#define GL_DECR_WRAP_EXT 0x8508 +#endif + +#ifndef GL_EXT_422_pixels +#define GL_422_EXT 0x80CC +#define GL_422_REV_EXT 0x80CD +#define GL_422_AVERAGE_EXT 0x80CE +#define GL_422_REV_AVERAGE_EXT 0x80CF +#endif + +#ifndef GL_NV_texgen_reflection +#define GL_NORMAL_MAP_NV 0x8511 +#define GL_REFLECTION_MAP_NV 0x8512 +#endif + +#ifndef GL_EXT_texture_cube_map +#define GL_NORMAL_MAP_EXT 0x8511 +#define GL_REFLECTION_MAP_EXT 0x8512 +#define GL_TEXTURE_CUBE_MAP_EXT 0x8513 +#define GL_TEXTURE_BINDING_CUBE_MAP_EXT 0x8514 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_X_EXT 0x8515 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X_EXT 0x8516 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y_EXT 0x8517 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_EXT 0x8518 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z_EXT 0x8519 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_EXT 0x851A +#define GL_PROXY_TEXTURE_CUBE_MAP_EXT 0x851B +#define GL_MAX_CUBE_MAP_TEXTURE_SIZE_EXT 0x851C +#endif + +#ifndef GL_SUN_convolution_border_modes +#define GL_WRAP_BORDER_SUN 0x81D4 +#endif + +#ifndef GL_EXT_texture_env_add +#endif + +#ifndef GL_EXT_texture_lod_bias +#define GL_MAX_TEXTURE_LOD_BIAS_EXT 0x84FD +#define GL_TEXTURE_FILTER_CONTROL_EXT 0x8500 +#define GL_TEXTURE_LOD_BIAS_EXT 0x8501 +#endif + +#ifndef GL_EXT_texture_filter_anisotropic +#define GL_TEXTURE_MAX_ANISOTROPY_EXT 0x84FE +#define GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT 0x84FF +#endif + +#ifndef GL_EXT_vertex_weighting +#define GL_MODELVIEW0_STACK_DEPTH_EXT GL_MODELVIEW_STACK_DEPTH +#define GL_MODELVIEW1_STACK_DEPTH_EXT 0x8502 +#define GL_MODELVIEW0_MATRIX_EXT GL_MODELVIEW_MATRIX +#define GL_MODELVIEW1_MATRIX_EXT 0x8506 +#define GL_VERTEX_WEIGHTING_EXT 0x8509 +#define GL_MODELVIEW0_EXT GL_MODELVIEW +#define GL_MODELVIEW1_EXT 0x850A +#define GL_CURRENT_VERTEX_WEIGHT_EXT 0x850B +#define GL_VERTEX_WEIGHT_ARRAY_EXT 0x850C +#define GL_VERTEX_WEIGHT_ARRAY_SIZE_EXT 0x850D +#define GL_VERTEX_WEIGHT_ARRAY_TYPE_EXT 0x850E +#define GL_VERTEX_WEIGHT_ARRAY_STRIDE_EXT 0x850F +#define GL_VERTEX_WEIGHT_ARRAY_POINTER_EXT 0x8510 +#endif + +#ifndef GL_NV_light_max_exponent +#define GL_MAX_SHININESS_NV 0x8504 +#define GL_MAX_SPOT_EXPONENT_NV 0x8505 +#endif + +#ifndef GL_NV_vertex_array_range +#define GL_VERTEX_ARRAY_RANGE_NV 0x851D +#define GL_VERTEX_ARRAY_RANGE_LENGTH_NV 0x851E +#define GL_VERTEX_ARRAY_RANGE_VALID_NV 0x851F +#define GL_MAX_VERTEX_ARRAY_RANGE_ELEMENT_NV 0x8520 +#define GL_VERTEX_ARRAY_RANGE_POINTER_NV 0x8521 +#endif + +#ifndef GL_NV_register_combiners +#define GL_REGISTER_COMBINERS_NV 0x8522 +#define GL_VARIABLE_A_NV 0x8523 +#define GL_VARIABLE_B_NV 0x8524 +#define GL_VARIABLE_C_NV 0x8525 +#define GL_VARIABLE_D_NV 0x8526 +#define GL_VARIABLE_E_NV 0x8527 +#define GL_VARIABLE_F_NV 0x8528 +#define GL_VARIABLE_G_NV 0x8529 +#define GL_CONSTANT_COLOR0_NV 0x852A +#define GL_CONSTANT_COLOR1_NV 0x852B +#define GL_PRIMARY_COLOR_NV 0x852C +#define GL_SECONDARY_COLOR_NV 0x852D +#define GL_SPARE0_NV 0x852E +#define GL_SPARE1_NV 0x852F +#define GL_DISCARD_NV 0x8530 +#define GL_E_TIMES_F_NV 0x8531 +#define GL_SPARE0_PLUS_SECONDARY_COLOR_NV 0x8532 +#define GL_UNSIGNED_IDENTITY_NV 0x8536 +#define GL_UNSIGNED_INVERT_NV 0x8537 +#define GL_EXPAND_NORMAL_NV 0x8538 +#define GL_EXPAND_NEGATE_NV 0x8539 +#define GL_HALF_BIAS_NORMAL_NV 0x853A +#define GL_HALF_BIAS_NEGATE_NV 0x853B +#define GL_SIGNED_IDENTITY_NV 0x853C +#define GL_SIGNED_NEGATE_NV 0x853D +#define GL_SCALE_BY_TWO_NV 0x853E +#define GL_SCALE_BY_FOUR_NV 0x853F +#define GL_SCALE_BY_ONE_HALF_NV 0x8540 +#define GL_BIAS_BY_NEGATIVE_ONE_HALF_NV 0x8541 +#define GL_COMBINER_INPUT_NV 0x8542 +#define GL_COMBINER_MAPPING_NV 0x8543 +#define GL_COMBINER_COMPONENT_USAGE_NV 0x8544 +#define GL_COMBINER_AB_DOT_PRODUCT_NV 0x8545 +#define GL_COMBINER_CD_DOT_PRODUCT_NV 0x8546 +#define GL_COMBINER_MUX_SUM_NV 0x8547 +#define GL_COMBINER_SCALE_NV 0x8548 +#define GL_COMBINER_BIAS_NV 0x8549 +#define GL_COMBINER_AB_OUTPUT_NV 0x854A +#define GL_COMBINER_CD_OUTPUT_NV 0x854B +#define GL_COMBINER_SUM_OUTPUT_NV 0x854C +#define GL_MAX_GENERAL_COMBINERS_NV 0x854D +#define GL_NUM_GENERAL_COMBINERS_NV 0x854E +#define GL_COLOR_SUM_CLAMP_NV 0x854F +#define GL_COMBINER0_NV 0x8550 +#define GL_COMBINER1_NV 0x8551 +#define GL_COMBINER2_NV 0x8552 +#define GL_COMBINER3_NV 0x8553 +#define GL_COMBINER4_NV 0x8554 +#define GL_COMBINER5_NV 0x8555 +#define GL_COMBINER6_NV 0x8556 +#define GL_COMBINER7_NV 0x8557 +/* reuse GL_TEXTURE0_ARB */ +/* reuse GL_TEXTURE1_ARB */ +/* reuse GL_ZERO */ +/* reuse GL_NONE */ +/* reuse GL_FOG */ +#endif + +#ifndef GL_NV_fog_distance +#define GL_FOG_DISTANCE_MODE_NV 0x855A +#define GL_EYE_RADIAL_NV 0x855B +#define GL_EYE_PLANE_ABSOLUTE_NV 0x855C +/* reuse GL_EYE_PLANE */ +#endif + +#ifndef GL_NV_texgen_emboss +#define GL_EMBOSS_LIGHT_NV 0x855D +#define GL_EMBOSS_CONSTANT_NV 0x855E +#define GL_EMBOSS_MAP_NV 0x855F +#endif + +#ifndef GL_NV_blend_square +#endif + +#ifndef GL_NV_texture_env_combine4 +#define GL_COMBINE4_NV 0x8503 +#define GL_SOURCE3_RGB_NV 0x8583 +#define GL_SOURCE3_ALPHA_NV 0x858B +#define GL_OPERAND3_RGB_NV 0x8593 +#define GL_OPERAND3_ALPHA_NV 0x859B +#endif + +#ifndef GL_MESA_resize_buffers +#endif + +#ifndef GL_MESA_window_pos +#endif + +#ifndef GL_EXT_texture_compression_s3tc +#define GL_COMPRESSED_RGB_S3TC_DXT1_EXT 0x83F0 +#define GL_COMPRESSED_RGBA_S3TC_DXT1_EXT 0x83F1 +#define GL_COMPRESSED_RGBA_S3TC_DXT3_EXT 0x83F2 +#define GL_COMPRESSED_RGBA_S3TC_DXT5_EXT 0x83F3 +#endif + +#ifndef GL_IBM_cull_vertex +#define GL_CULL_VERTEX_IBM 103050 +#endif + +#ifndef GL_IBM_multimode_draw_arrays +#endif + +#ifndef GL_IBM_vertex_array_lists +#define GL_VERTEX_ARRAY_LIST_IBM 103070 +#define GL_NORMAL_ARRAY_LIST_IBM 103071 +#define GL_COLOR_ARRAY_LIST_IBM 103072 +#define GL_INDEX_ARRAY_LIST_IBM 103073 +#define GL_TEXTURE_COORD_ARRAY_LIST_IBM 103074 +#define GL_EDGE_FLAG_ARRAY_LIST_IBM 103075 +#define GL_FOG_COORDINATE_ARRAY_LIST_IBM 103076 +#define GL_SECONDARY_COLOR_ARRAY_LIST_IBM 103077 +#define GL_VERTEX_ARRAY_LIST_STRIDE_IBM 103080 +#define GL_NORMAL_ARRAY_LIST_STRIDE_IBM 103081 +#define GL_COLOR_ARRAY_LIST_STRIDE_IBM 103082 +#define GL_INDEX_ARRAY_LIST_STRIDE_IBM 103083 +#define GL_TEXTURE_COORD_ARRAY_LIST_STRIDE_IBM 103084 +#define GL_EDGE_FLAG_ARRAY_LIST_STRIDE_IBM 103085 +#define GL_FOG_COORDINATE_ARRAY_LIST_STRIDE_IBM 103086 +#define GL_SECONDARY_COLOR_ARRAY_LIST_STRIDE_IBM 103087 +#endif + +#ifndef GL_SGIX_subsample +#define GL_PACK_SUBSAMPLE_RATE_SGIX 0x85A0 +#define GL_UNPACK_SUBSAMPLE_RATE_SGIX 0x85A1 +#define GL_PIXEL_SUBSAMPLE_4444_SGIX 0x85A2 +#define GL_PIXEL_SUBSAMPLE_2424_SGIX 0x85A3 +#define GL_PIXEL_SUBSAMPLE_4242_SGIX 0x85A4 +#endif + +#ifndef GL_SGIX_ycrcb_subsample +#endif + +#ifndef GL_SGIX_ycrcba +#define GL_YCRCB_SGIX 0x8318 +#define GL_YCRCBA_SGIX 0x8319 +#endif + +#ifndef GL_SGI_depth_pass_instrument +#define GL_DEPTH_PASS_INSTRUMENT_SGIX 0x8310 +#define GL_DEPTH_PASS_INSTRUMENT_COUNTERS_SGIX 0x8311 +#define GL_DEPTH_PASS_INSTRUMENT_MAX_SGIX 0x8312 +#endif + +#ifndef GL_3DFX_texture_compression_FXT1 +#define GL_COMPRESSED_RGB_FXT1_3DFX 0x86B0 +#define GL_COMPRESSED_RGBA_FXT1_3DFX 0x86B1 +#endif + +#ifndef GL_3DFX_multisample +#define GL_MULTISAMPLE_3DFX 0x86B2 +#define GL_SAMPLE_BUFFERS_3DFX 0x86B3 +#define GL_SAMPLES_3DFX 0x86B4 +#define GL_MULTISAMPLE_BIT_3DFX 0x20000000 +#endif + +#ifndef GL_3DFX_tbuffer +#endif + +#ifndef GL_EXT_multisample +#define GL_MULTISAMPLE_EXT 0x809D +#define GL_SAMPLE_ALPHA_TO_MASK_EXT 0x809E +#define GL_SAMPLE_ALPHA_TO_ONE_EXT 0x809F +#define GL_SAMPLE_MASK_EXT 0x80A0 +#define GL_1PASS_EXT 0x80A1 +#define GL_2PASS_0_EXT 0x80A2 +#define GL_2PASS_1_EXT 0x80A3 +#define GL_4PASS_0_EXT 0x80A4 +#define GL_4PASS_1_EXT 0x80A5 +#define GL_4PASS_2_EXT 0x80A6 +#define GL_4PASS_3_EXT 0x80A7 +#define GL_SAMPLE_BUFFERS_EXT 0x80A8 +#define GL_SAMPLES_EXT 0x80A9 +#define GL_SAMPLE_MASK_VALUE_EXT 0x80AA +#define GL_SAMPLE_MASK_INVERT_EXT 0x80AB +#define GL_SAMPLE_PATTERN_EXT 0x80AC +#define GL_MULTISAMPLE_BIT_EXT 0x20000000 +#endif + +#ifndef GL_SGIX_vertex_preclip +#define GL_VERTEX_PRECLIP_SGIX 0x83EE +#define GL_VERTEX_PRECLIP_HINT_SGIX 0x83EF +#endif + +#ifndef GL_SGIX_convolution_accuracy +#define GL_CONVOLUTION_HINT_SGIX 0x8316 +#endif + +#ifndef GL_SGIX_resample +#define GL_PACK_RESAMPLE_SGIX 0x842C +#define GL_UNPACK_RESAMPLE_SGIX 0x842D +#define GL_RESAMPLE_REPLICATE_SGIX 0x842E +#define GL_RESAMPLE_ZERO_FILL_SGIX 0x842F +#define GL_RESAMPLE_DECIMATE_SGIX 0x8430 +#endif + +#ifndef GL_SGIS_point_line_texgen +#define GL_EYE_DISTANCE_TO_POINT_SGIS 0x81F0 +#define GL_OBJECT_DISTANCE_TO_POINT_SGIS 0x81F1 +#define GL_EYE_DISTANCE_TO_LINE_SGIS 0x81F2 +#define GL_OBJECT_DISTANCE_TO_LINE_SGIS 0x81F3 +#define GL_EYE_POINT_SGIS 0x81F4 +#define GL_OBJECT_POINT_SGIS 0x81F5 +#define GL_EYE_LINE_SGIS 0x81F6 +#define GL_OBJECT_LINE_SGIS 0x81F7 +#endif + +#ifndef GL_SGIS_texture_color_mask +#define GL_TEXTURE_COLOR_WRITEMASK_SGIS 0x81EF +#endif + +#ifndef GL_EXT_texture_env_dot3 +#define GL_DOT3_RGB_EXT 0x8740 +#define GL_DOT3_RGBA_EXT 0x8741 +#endif + +#ifndef GL_ATI_texture_mirror_once +#define GL_MIRROR_CLAMP_ATI 0x8742 +#define GL_MIRROR_CLAMP_TO_EDGE_ATI 0x8743 +#endif + +#ifndef GL_NV_fence +#define GL_ALL_COMPLETED_NV 0x84F2 +#define GL_FENCE_STATUS_NV 0x84F3 +#define GL_FENCE_CONDITION_NV 0x84F4 +#endif + +#ifndef GL_IBM_texture_mirrored_repeat +#define GL_MIRRORED_REPEAT_IBM 0x8370 +#endif + +#ifndef GL_NV_evaluators +#define GL_EVAL_2D_NV 0x86C0 +#define GL_EVAL_TRIANGULAR_2D_NV 0x86C1 +#define GL_MAP_TESSELLATION_NV 0x86C2 +#define GL_MAP_ATTRIB_U_ORDER_NV 0x86C3 +#define GL_MAP_ATTRIB_V_ORDER_NV 0x86C4 +#define GL_EVAL_FRACTIONAL_TESSELLATION_NV 0x86C5 +#define GL_EVAL_VERTEX_ATTRIB0_NV 0x86C6 +#define GL_EVAL_VERTEX_ATTRIB1_NV 0x86C7 +#define GL_EVAL_VERTEX_ATTRIB2_NV 0x86C8 +#define GL_EVAL_VERTEX_ATTRIB3_NV 0x86C9 +#define GL_EVAL_VERTEX_ATTRIB4_NV 0x86CA +#define GL_EVAL_VERTEX_ATTRIB5_NV 0x86CB +#define GL_EVAL_VERTEX_ATTRIB6_NV 0x86CC +#define GL_EVAL_VERTEX_ATTRIB7_NV 0x86CD +#define GL_EVAL_VERTEX_ATTRIB8_NV 0x86CE +#define GL_EVAL_VERTEX_ATTRIB9_NV 0x86CF +#define GL_EVAL_VERTEX_ATTRIB10_NV 0x86D0 +#define GL_EVAL_VERTEX_ATTRIB11_NV 0x86D1 +#define GL_EVAL_VERTEX_ATTRIB12_NV 0x86D2 +#define GL_EVAL_VERTEX_ATTRIB13_NV 0x86D3 +#define GL_EVAL_VERTEX_ATTRIB14_NV 0x86D4 +#define GL_EVAL_VERTEX_ATTRIB15_NV 0x86D5 +#define GL_MAX_MAP_TESSELLATION_NV 0x86D6 +#define GL_MAX_RATIONAL_EVAL_ORDER_NV 0x86D7 +#endif + +#ifndef GL_NV_packed_depth_stencil +#define GL_DEPTH_STENCIL_NV 0x84F9 +#define GL_UNSIGNED_INT_24_8_NV 0x84FA +#endif + +#ifndef GL_NV_register_combiners2 +#define GL_PER_STAGE_CONSTANTS_NV 0x8535 +#endif + +#ifndef GL_NV_texture_compression_vtc +#endif + +#ifndef GL_NV_texture_rectangle +#define GL_TEXTURE_RECTANGLE_NV 0x84F5 +#define GL_TEXTURE_BINDING_RECTANGLE_NV 0x84F6 +#define GL_PROXY_TEXTURE_RECTANGLE_NV 0x84F7 +#define GL_MAX_RECTANGLE_TEXTURE_SIZE_NV 0x84F8 +#endif + +#ifndef GL_NV_texture_shader +#define GL_OFFSET_TEXTURE_RECTANGLE_NV 0x864C +#define GL_OFFSET_TEXTURE_RECTANGLE_SCALE_NV 0x864D +#define GL_DOT_PRODUCT_TEXTURE_RECTANGLE_NV 0x864E +#define GL_RGBA_UNSIGNED_DOT_PRODUCT_MAPPING_NV 0x86D9 +#define GL_UNSIGNED_INT_S8_S8_8_8_NV 0x86DA +#define GL_UNSIGNED_INT_8_8_S8_S8_REV_NV 0x86DB +#define GL_DSDT_MAG_INTENSITY_NV 0x86DC +#define GL_SHADER_CONSISTENT_NV 0x86DD +#define GL_TEXTURE_SHADER_NV 0x86DE +#define GL_SHADER_OPERATION_NV 0x86DF +#define GL_CULL_MODES_NV 0x86E0 +#define GL_OFFSET_TEXTURE_MATRIX_NV 0x86E1 +#define GL_OFFSET_TEXTURE_SCALE_NV 0x86E2 +#define GL_OFFSET_TEXTURE_BIAS_NV 0x86E3 +#define GL_OFFSET_TEXTURE_2D_MATRIX_NV GL_OFFSET_TEXTURE_MATRIX_NV +#define GL_OFFSET_TEXTURE_2D_SCALE_NV GL_OFFSET_TEXTURE_SCALE_NV +#define GL_OFFSET_TEXTURE_2D_BIAS_NV GL_OFFSET_TEXTURE_BIAS_NV +#define GL_PREVIOUS_TEXTURE_INPUT_NV 0x86E4 +#define GL_CONST_EYE_NV 0x86E5 +#define GL_PASS_THROUGH_NV 0x86E6 +#define GL_CULL_FRAGMENT_NV 0x86E7 +#define GL_OFFSET_TEXTURE_2D_NV 0x86E8 +#define GL_DEPENDENT_AR_TEXTURE_2D_NV 0x86E9 +#define GL_DEPENDENT_GB_TEXTURE_2D_NV 0x86EA +#define GL_DOT_PRODUCT_NV 0x86EC +#define GL_DOT_PRODUCT_DEPTH_REPLACE_NV 0x86ED +#define GL_DOT_PRODUCT_TEXTURE_2D_NV 0x86EE +#define GL_DOT_PRODUCT_TEXTURE_CUBE_MAP_NV 0x86F0 +#define GL_DOT_PRODUCT_DIFFUSE_CUBE_MAP_NV 0x86F1 +#define GL_DOT_PRODUCT_REFLECT_CUBE_MAP_NV 0x86F2 +#define GL_DOT_PRODUCT_CONST_EYE_REFLECT_CUBE_MAP_NV 0x86F3 +#define GL_HILO_NV 0x86F4 +#define GL_DSDT_NV 0x86F5 +#define GL_DSDT_MAG_NV 0x86F6 +#define GL_DSDT_MAG_VIB_NV 0x86F7 +#define GL_HILO16_NV 0x86F8 +#define GL_SIGNED_HILO_NV 0x86F9 +#define GL_SIGNED_HILO16_NV 0x86FA +#define GL_SIGNED_RGBA_NV 0x86FB +#define GL_SIGNED_RGBA8_NV 0x86FC +#define GL_SIGNED_RGB_NV 0x86FE +#define GL_SIGNED_RGB8_NV 0x86FF +#define GL_SIGNED_LUMINANCE_NV 0x8701 +#define GL_SIGNED_LUMINANCE8_NV 0x8702 +#define GL_SIGNED_LUMINANCE_ALPHA_NV 0x8703 +#define GL_SIGNED_LUMINANCE8_ALPHA8_NV 0x8704 +#define GL_SIGNED_ALPHA_NV 0x8705 +#define GL_SIGNED_ALPHA8_NV 0x8706 +#define GL_SIGNED_INTENSITY_NV 0x8707 +#define GL_SIGNED_INTENSITY8_NV 0x8708 +#define GL_DSDT8_NV 0x8709 +#define GL_DSDT8_MAG8_NV 0x870A +#define GL_DSDT8_MAG8_INTENSITY8_NV 0x870B +#define GL_SIGNED_RGB_UNSIGNED_ALPHA_NV 0x870C +#define GL_SIGNED_RGB8_UNSIGNED_ALPHA8_NV 0x870D +#define GL_HI_SCALE_NV 0x870E +#define GL_LO_SCALE_NV 0x870F +#define GL_DS_SCALE_NV 0x8710 +#define GL_DT_SCALE_NV 0x8711 +#define GL_MAGNITUDE_SCALE_NV 0x8712 +#define GL_VIBRANCE_SCALE_NV 0x8713 +#define GL_HI_BIAS_NV 0x8714 +#define GL_LO_BIAS_NV 0x8715 +#define GL_DS_BIAS_NV 0x8716 +#define GL_DT_BIAS_NV 0x8717 +#define GL_MAGNITUDE_BIAS_NV 0x8718 +#define GL_VIBRANCE_BIAS_NV 0x8719 +#define GL_TEXTURE_BORDER_VALUES_NV 0x871A +#define GL_TEXTURE_HI_SIZE_NV 0x871B +#define GL_TEXTURE_LO_SIZE_NV 0x871C +#define GL_TEXTURE_DS_SIZE_NV 0x871D +#define GL_TEXTURE_DT_SIZE_NV 0x871E +#define GL_TEXTURE_MAG_SIZE_NV 0x871F +#endif + +#ifndef GL_NV_texture_shader2 +#define GL_DOT_PRODUCT_TEXTURE_3D_NV 0x86EF +#endif + +#ifndef GL_NV_vertex_array_range2 +#define GL_VERTEX_ARRAY_RANGE_WITHOUT_FLUSH_NV 0x8533 +#endif + +#ifndef GL_NV_vertex_program +#define GL_VERTEX_PROGRAM_NV 0x8620 +#define GL_VERTEX_STATE_PROGRAM_NV 0x8621 +#define GL_ATTRIB_ARRAY_SIZE_NV 0x8623 +#define GL_ATTRIB_ARRAY_STRIDE_NV 0x8624 +#define GL_ATTRIB_ARRAY_TYPE_NV 0x8625 +#define GL_CURRENT_ATTRIB_NV 0x8626 +#define GL_PROGRAM_LENGTH_NV 0x8627 +#define GL_PROGRAM_STRING_NV 0x8628 +#define GL_MODELVIEW_PROJECTION_NV 0x8629 +#define GL_IDENTITY_NV 0x862A +#define GL_INVERSE_NV 0x862B +#define GL_TRANSPOSE_NV 0x862C +#define GL_INVERSE_TRANSPOSE_NV 0x862D +#define GL_MAX_TRACK_MATRIX_STACK_DEPTH_NV 0x862E +#define GL_MAX_TRACK_MATRICES_NV 0x862F +#define GL_MATRIX0_NV 0x8630 +#define GL_MATRIX1_NV 0x8631 +#define GL_MATRIX2_NV 0x8632 +#define GL_MATRIX3_NV 0x8633 +#define GL_MATRIX4_NV 0x8634 +#define GL_MATRIX5_NV 0x8635 +#define GL_MATRIX6_NV 0x8636 +#define GL_MATRIX7_NV 0x8637 +#define GL_CURRENT_MATRIX_STACK_DEPTH_NV 0x8640 +#define GL_CURRENT_MATRIX_NV 0x8641 +#define GL_VERTEX_PROGRAM_POINT_SIZE_NV 0x8642 +#define GL_VERTEX_PROGRAM_TWO_SIDE_NV 0x8643 +#define GL_PROGRAM_PARAMETER_NV 0x8644 +#define GL_ATTRIB_ARRAY_POINTER_NV 0x8645 +#define GL_PROGRAM_TARGET_NV 0x8646 +#define GL_PROGRAM_RESIDENT_NV 0x8647 +#define GL_TRACK_MATRIX_NV 0x8648 +#define GL_TRACK_MATRIX_TRANSFORM_NV 0x8649 +#define GL_VERTEX_PROGRAM_BINDING_NV 0x864A +#define GL_PROGRAM_ERROR_POSITION_NV 0x864B +#define GL_VERTEX_ATTRIB_ARRAY0_NV 0x8650 +#define GL_VERTEX_ATTRIB_ARRAY1_NV 0x8651 +#define GL_VERTEX_ATTRIB_ARRAY2_NV 0x8652 +#define GL_VERTEX_ATTRIB_ARRAY3_NV 0x8653 +#define GL_VERTEX_ATTRIB_ARRAY4_NV 0x8654 +#define GL_VERTEX_ATTRIB_ARRAY5_NV 0x8655 +#define GL_VERTEX_ATTRIB_ARRAY6_NV 0x8656 +#define GL_VERTEX_ATTRIB_ARRAY7_NV 0x8657 +#define GL_VERTEX_ATTRIB_ARRAY8_NV 0x8658 +#define GL_VERTEX_ATTRIB_ARRAY9_NV 0x8659 +#define GL_VERTEX_ATTRIB_ARRAY10_NV 0x865A +#define GL_VERTEX_ATTRIB_ARRAY11_NV 0x865B +#define GL_VERTEX_ATTRIB_ARRAY12_NV 0x865C +#define GL_VERTEX_ATTRIB_ARRAY13_NV 0x865D +#define GL_VERTEX_ATTRIB_ARRAY14_NV 0x865E +#define GL_VERTEX_ATTRIB_ARRAY15_NV 0x865F +#define GL_MAP1_VERTEX_ATTRIB0_4_NV 0x8660 +#define GL_MAP1_VERTEX_ATTRIB1_4_NV 0x8661 +#define GL_MAP1_VERTEX_ATTRIB2_4_NV 0x8662 +#define GL_MAP1_VERTEX_ATTRIB3_4_NV 0x8663 +#define GL_MAP1_VERTEX_ATTRIB4_4_NV 0x8664 +#define GL_MAP1_VERTEX_ATTRIB5_4_NV 0x8665 +#define GL_MAP1_VERTEX_ATTRIB6_4_NV 0x8666 +#define GL_MAP1_VERTEX_ATTRIB7_4_NV 0x8667 +#define GL_MAP1_VERTEX_ATTRIB8_4_NV 0x8668 +#define GL_MAP1_VERTEX_ATTRIB9_4_NV 0x8669 +#define GL_MAP1_VERTEX_ATTRIB10_4_NV 0x866A +#define GL_MAP1_VERTEX_ATTRIB11_4_NV 0x866B +#define GL_MAP1_VERTEX_ATTRIB12_4_NV 0x866C +#define GL_MAP1_VERTEX_ATTRIB13_4_NV 0x866D +#define GL_MAP1_VERTEX_ATTRIB14_4_NV 0x866E +#define GL_MAP1_VERTEX_ATTRIB15_4_NV 0x866F +#define GL_MAP2_VERTEX_ATTRIB0_4_NV 0x8670 +#define GL_MAP2_VERTEX_ATTRIB1_4_NV 0x8671 +#define GL_MAP2_VERTEX_ATTRIB2_4_NV 0x8672 +#define GL_MAP2_VERTEX_ATTRIB3_4_NV 0x8673 +#define GL_MAP2_VERTEX_ATTRIB4_4_NV 0x8674 +#define GL_MAP2_VERTEX_ATTRIB5_4_NV 0x8675 +#define GL_MAP2_VERTEX_ATTRIB6_4_NV 0x8676 +#define GL_MAP2_VERTEX_ATTRIB7_4_NV 0x8677 +#define GL_MAP2_VERTEX_ATTRIB8_4_NV 0x8678 +#define GL_MAP2_VERTEX_ATTRIB9_4_NV 0x8679 +#define GL_MAP2_VERTEX_ATTRIB10_4_NV 0x867A +#define GL_MAP2_VERTEX_ATTRIB11_4_NV 0x867B +#define GL_MAP2_VERTEX_ATTRIB12_4_NV 0x867C +#define GL_MAP2_VERTEX_ATTRIB13_4_NV 0x867D +#define GL_MAP2_VERTEX_ATTRIB14_4_NV 0x867E +#define GL_MAP2_VERTEX_ATTRIB15_4_NV 0x867F +#endif + +#ifndef GL_SGIX_texture_coordinate_clamp +#define GL_TEXTURE_MAX_CLAMP_S_SGIX 0x8369 +#define GL_TEXTURE_MAX_CLAMP_T_SGIX 0x836A +#define GL_TEXTURE_MAX_CLAMP_R_SGIX 0x836B +#endif + +#ifndef GL_SGIX_scalebias_hint +#define GL_SCALEBIAS_HINT_SGIX 0x8322 +#endif + +#ifndef GL_OML_interlace +#define GL_INTERLACE_OML 0x8980 +#define GL_INTERLACE_READ_OML 0x8981 +#endif + +#ifndef GL_OML_subsample +#define GL_FORMAT_SUBSAMPLE_24_24_OML 0x8982 +#define GL_FORMAT_SUBSAMPLE_244_244_OML 0x8983 +#endif + +#ifndef GL_OML_resample +#define GL_PACK_RESAMPLE_OML 0x8984 +#define GL_UNPACK_RESAMPLE_OML 0x8985 +#define GL_RESAMPLE_REPLICATE_OML 0x8986 +#define GL_RESAMPLE_ZERO_FILL_OML 0x8987 +#define GL_RESAMPLE_AVERAGE_OML 0x8988 +#define GL_RESAMPLE_DECIMATE_OML 0x8989 +#endif + +#ifndef GL_NV_copy_depth_to_color +#define GL_DEPTH_STENCIL_TO_RGBA_NV 0x886E +#define GL_DEPTH_STENCIL_TO_BGRA_NV 0x886F +#endif + +#ifndef GL_ATI_envmap_bumpmap +#define GL_BUMP_ROT_MATRIX_ATI 0x8775 +#define GL_BUMP_ROT_MATRIX_SIZE_ATI 0x8776 +#define GL_BUMP_NUM_TEX_UNITS_ATI 0x8777 +#define GL_BUMP_TEX_UNITS_ATI 0x8778 +#define GL_DUDV_ATI 0x8779 +#define GL_DU8DV8_ATI 0x877A +#define GL_BUMP_ENVMAP_ATI 0x877B +#define GL_BUMP_TARGET_ATI 0x877C +#endif + +#ifndef GL_ATI_fragment_shader +#define GL_FRAGMENT_SHADER_ATI 0x8920 +#define GL_REG_0_ATI 0x8921 +#define GL_REG_1_ATI 0x8922 +#define GL_REG_2_ATI 0x8923 +#define GL_REG_3_ATI 0x8924 +#define GL_REG_4_ATI 0x8925 +#define GL_REG_5_ATI 0x8926 +#define GL_REG_6_ATI 0x8927 +#define GL_REG_7_ATI 0x8928 +#define GL_REG_8_ATI 0x8929 +#define GL_REG_9_ATI 0x892A +#define GL_REG_10_ATI 0x892B +#define GL_REG_11_ATI 0x892C +#define GL_REG_12_ATI 0x892D +#define GL_REG_13_ATI 0x892E +#define GL_REG_14_ATI 0x892F +#define GL_REG_15_ATI 0x8930 +#define GL_REG_16_ATI 0x8931 +#define GL_REG_17_ATI 0x8932 +#define GL_REG_18_ATI 0x8933 +#define GL_REG_19_ATI 0x8934 +#define GL_REG_20_ATI 0x8935 +#define GL_REG_21_ATI 0x8936 +#define GL_REG_22_ATI 0x8937 +#define GL_REG_23_ATI 0x8938 +#define GL_REG_24_ATI 0x8939 +#define GL_REG_25_ATI 0x893A +#define GL_REG_26_ATI 0x893B +#define GL_REG_27_ATI 0x893C +#define GL_REG_28_ATI 0x893D +#define GL_REG_29_ATI 0x893E +#define GL_REG_30_ATI 0x893F +#define GL_REG_31_ATI 0x8940 +#define GL_CON_0_ATI 0x8941 +#define GL_CON_1_ATI 0x8942 +#define GL_CON_2_ATI 0x8943 +#define GL_CON_3_ATI 0x8944 +#define GL_CON_4_ATI 0x8945 +#define GL_CON_5_ATI 0x8946 +#define GL_CON_6_ATI 0x8947 +#define GL_CON_7_ATI 0x8948 +#define GL_CON_8_ATI 0x8949 +#define GL_CON_9_ATI 0x894A +#define GL_CON_10_ATI 0x894B +#define GL_CON_11_ATI 0x894C +#define GL_CON_12_ATI 0x894D +#define GL_CON_13_ATI 0x894E +#define GL_CON_14_ATI 0x894F +#define GL_CON_15_ATI 0x8950 +#define GL_CON_16_ATI 0x8951 +#define GL_CON_17_ATI 0x8952 +#define GL_CON_18_ATI 0x8953 +#define GL_CON_19_ATI 0x8954 +#define GL_CON_20_ATI 0x8955 +#define GL_CON_21_ATI 0x8956 +#define GL_CON_22_ATI 0x8957 +#define GL_CON_23_ATI 0x8958 +#define GL_CON_24_ATI 0x8959 +#define GL_CON_25_ATI 0x895A +#define GL_CON_26_ATI 0x895B +#define GL_CON_27_ATI 0x895C +#define GL_CON_28_ATI 0x895D +#define GL_CON_29_ATI 0x895E +#define GL_CON_30_ATI 0x895F +#define GL_CON_31_ATI 0x8960 +#define GL_MOV_ATI 0x8961 +#define GL_ADD_ATI 0x8963 +#define GL_MUL_ATI 0x8964 +#define GL_SUB_ATI 0x8965 +#define GL_DOT3_ATI 0x8966 +#define GL_DOT4_ATI 0x8967 +#define GL_MAD_ATI 0x8968 +#define GL_LERP_ATI 0x8969 +#define GL_CND_ATI 0x896A +#define GL_CND0_ATI 0x896B +#define GL_DOT2_ADD_ATI 0x896C +#define GL_SECONDARY_INTERPOLATOR_ATI 0x896D +#define GL_NUM_FRAGMENT_REGISTERS_ATI 0x896E +#define GL_NUM_FRAGMENT_CONSTANTS_ATI 0x896F +#define GL_NUM_PASSES_ATI 0x8970 +#define GL_NUM_INSTRUCTIONS_PER_PASS_ATI 0x8971 +#define GL_NUM_INSTRUCTIONS_TOTAL_ATI 0x8972 +#define GL_NUM_INPUT_INTERPOLATOR_COMPONENTS_ATI 0x8973 +#define GL_NUM_LOOPBACK_COMPONENTS_ATI 0x8974 +#define GL_COLOR_ALPHA_PAIRING_ATI 0x8975 +#define GL_SWIZZLE_STR_ATI 0x8976 +#define GL_SWIZZLE_STQ_ATI 0x8977 +#define GL_SWIZZLE_STR_DR_ATI 0x8978 +#define GL_SWIZZLE_STQ_DQ_ATI 0x8979 +#define GL_SWIZZLE_STRQ_ATI 0x897A +#define GL_SWIZZLE_STRQ_DQ_ATI 0x897B +#define GL_RED_BIT_ATI 0x00000001 +#define GL_GREEN_BIT_ATI 0x00000002 +#define GL_BLUE_BIT_ATI 0x00000004 +#define GL_2X_BIT_ATI 0x00000001 +#define GL_4X_BIT_ATI 0x00000002 +#define GL_8X_BIT_ATI 0x00000004 +#define GL_HALF_BIT_ATI 0x00000008 +#define GL_QUARTER_BIT_ATI 0x00000010 +#define GL_EIGHTH_BIT_ATI 0x00000020 +#define GL_SATURATE_BIT_ATI 0x00000040 +#define GL_COMP_BIT_ATI 0x00000002 +#define GL_NEGATE_BIT_ATI 0x00000004 +#define GL_BIAS_BIT_ATI 0x00000008 +#endif + +#ifndef GL_ATI_pn_triangles +#define GL_PN_TRIANGLES_ATI 0x87F0 +#define GL_MAX_PN_TRIANGLES_TESSELATION_LEVEL_ATI 0x87F1 +#define GL_PN_TRIANGLES_POINT_MODE_ATI 0x87F2 +#define GL_PN_TRIANGLES_NORMAL_MODE_ATI 0x87F3 +#define GL_PN_TRIANGLES_TESSELATION_LEVEL_ATI 0x87F4 +#define GL_PN_TRIANGLES_POINT_MODE_LINEAR_ATI 0x87F5 +#define GL_PN_TRIANGLES_POINT_MODE_CUBIC_ATI 0x87F6 +#define GL_PN_TRIANGLES_NORMAL_MODE_LINEAR_ATI 0x87F7 +#define GL_PN_TRIANGLES_NORMAL_MODE_QUADRATIC_ATI 0x87F8 +#endif + +#ifndef GL_ATI_vertex_array_object +#define GL_STATIC_ATI 0x8760 +#define GL_DYNAMIC_ATI 0x8761 +#define GL_PRESERVE_ATI 0x8762 +#define GL_DISCARD_ATI 0x8763 +#define GL_OBJECT_BUFFER_SIZE_ATI 0x8764 +#define GL_OBJECT_BUFFER_USAGE_ATI 0x8765 +#define GL_ARRAY_OBJECT_BUFFER_ATI 0x8766 +#define GL_ARRAY_OBJECT_OFFSET_ATI 0x8767 +#endif + +#ifndef GL_EXT_vertex_shader +#define GL_VERTEX_SHADER_EXT 0x8780 +#define GL_VERTEX_SHADER_BINDING_EXT 0x8781 +#define GL_OP_INDEX_EXT 0x8782 +#define GL_OP_NEGATE_EXT 0x8783 +#define GL_OP_DOT3_EXT 0x8784 +#define GL_OP_DOT4_EXT 0x8785 +#define GL_OP_MUL_EXT 0x8786 +#define GL_OP_ADD_EXT 0x8787 +#define GL_OP_MADD_EXT 0x8788 +#define GL_OP_FRAC_EXT 0x8789 +#define GL_OP_MAX_EXT 0x878A +#define GL_OP_MIN_EXT 0x878B +#define GL_OP_SET_GE_EXT 0x878C +#define GL_OP_SET_LT_EXT 0x878D +#define GL_OP_CLAMP_EXT 0x878E +#define GL_OP_FLOOR_EXT 0x878F +#define GL_OP_ROUND_EXT 0x8790 +#define GL_OP_EXP_BASE_2_EXT 0x8791 +#define GL_OP_LOG_BASE_2_EXT 0x8792 +#define GL_OP_POWER_EXT 0x8793 +#define GL_OP_RECIP_EXT 0x8794 +#define GL_OP_RECIP_SQRT_EXT 0x8795 +#define GL_OP_SUB_EXT 0x8796 +#define GL_OP_CROSS_PRODUCT_EXT 0x8797 +#define GL_OP_MULTIPLY_MATRIX_EXT 0x8798 +#define GL_OP_MOV_EXT 0x8799 +#define GL_OUTPUT_VERTEX_EXT 0x879A +#define GL_OUTPUT_COLOR0_EXT 0x879B +#define GL_OUTPUT_COLOR1_EXT 0x879C +#define GL_OUTPUT_TEXTURE_COORD0_EXT 0x879D +#define GL_OUTPUT_TEXTURE_COORD1_EXT 0x879E +#define GL_OUTPUT_TEXTURE_COORD2_EXT 0x879F +#define GL_OUTPUT_TEXTURE_COORD3_EXT 0x87A0 +#define GL_OUTPUT_TEXTURE_COORD4_EXT 0x87A1 +#define GL_OUTPUT_TEXTURE_COORD5_EXT 0x87A2 +#define GL_OUTPUT_TEXTURE_COORD6_EXT 0x87A3 +#define GL_OUTPUT_TEXTURE_COORD7_EXT 0x87A4 +#define GL_OUTPUT_TEXTURE_COORD8_EXT 0x87A5 +#define GL_OUTPUT_TEXTURE_COORD9_EXT 0x87A6 +#define GL_OUTPUT_TEXTURE_COORD10_EXT 0x87A7 +#define GL_OUTPUT_TEXTURE_COORD11_EXT 0x87A8 +#define GL_OUTPUT_TEXTURE_COORD12_EXT 0x87A9 +#define GL_OUTPUT_TEXTURE_COORD13_EXT 0x87AA +#define GL_OUTPUT_TEXTURE_COORD14_EXT 0x87AB +#define GL_OUTPUT_TEXTURE_COORD15_EXT 0x87AC +#define GL_OUTPUT_TEXTURE_COORD16_EXT 0x87AD +#define GL_OUTPUT_TEXTURE_COORD17_EXT 0x87AE +#define GL_OUTPUT_TEXTURE_COORD18_EXT 0x87AF +#define GL_OUTPUT_TEXTURE_COORD19_EXT 0x87B0 +#define GL_OUTPUT_TEXTURE_COORD20_EXT 0x87B1 +#define GL_OUTPUT_TEXTURE_COORD21_EXT 0x87B2 +#define GL_OUTPUT_TEXTURE_COORD22_EXT 0x87B3 +#define GL_OUTPUT_TEXTURE_COORD23_EXT 0x87B4 +#define GL_OUTPUT_TEXTURE_COORD24_EXT 0x87B5 +#define GL_OUTPUT_TEXTURE_COORD25_EXT 0x87B6 +#define GL_OUTPUT_TEXTURE_COORD26_EXT 0x87B7 +#define GL_OUTPUT_TEXTURE_COORD27_EXT 0x87B8 +#define GL_OUTPUT_TEXTURE_COORD28_EXT 0x87B9 +#define GL_OUTPUT_TEXTURE_COORD29_EXT 0x87BA +#define GL_OUTPUT_TEXTURE_COORD30_EXT 0x87BB +#define GL_OUTPUT_TEXTURE_COORD31_EXT 0x87BC +#define GL_OUTPUT_FOG_EXT 0x87BD +#define GL_SCALAR_EXT 0x87BE +#define GL_VECTOR_EXT 0x87BF +#define GL_MATRIX_EXT 0x87C0 +#define GL_VARIANT_EXT 0x87C1 +#define GL_INVARIANT_EXT 0x87C2 +#define GL_LOCAL_CONSTANT_EXT 0x87C3 +#define GL_LOCAL_EXT 0x87C4 +#define GL_MAX_VERTEX_SHADER_INSTRUCTIONS_EXT 0x87C5 +#define GL_MAX_VERTEX_SHADER_VARIANTS_EXT 0x87C6 +#define GL_MAX_VERTEX_SHADER_INVARIANTS_EXT 0x87C7 +#define GL_MAX_VERTEX_SHADER_LOCAL_CONSTANTS_EXT 0x87C8 +#define GL_MAX_VERTEX_SHADER_LOCALS_EXT 0x87C9 +#define GL_MAX_OPTIMIZED_VERTEX_SHADER_INSTRUCTIONS_EXT 0x87CA +#define GL_MAX_OPTIMIZED_VERTEX_SHADER_VARIANTS_EXT 0x87CB +#define GL_MAX_OPTIMIZED_VERTEX_SHADER_LOCAL_CONSTANTS_EXT 0x87CC +#define GL_MAX_OPTIMIZED_VERTEX_SHADER_INVARIANTS_EXT 0x87CD +#define GL_MAX_OPTIMIZED_VERTEX_SHADER_LOCALS_EXT 0x87CE +#define GL_VERTEX_SHADER_INSTRUCTIONS_EXT 0x87CF +#define GL_VERTEX_SHADER_VARIANTS_EXT 0x87D0 +#define GL_VERTEX_SHADER_INVARIANTS_EXT 0x87D1 +#define GL_VERTEX_SHADER_LOCAL_CONSTANTS_EXT 0x87D2 +#define GL_VERTEX_SHADER_LOCALS_EXT 0x87D3 +#define GL_VERTEX_SHADER_OPTIMIZED_EXT 0x87D4 +#define GL_X_EXT 0x87D5 +#define GL_Y_EXT 0x87D6 +#define GL_Z_EXT 0x87D7 +#define GL_W_EXT 0x87D8 +#define GL_NEGATIVE_X_EXT 0x87D9 +#define GL_NEGATIVE_Y_EXT 0x87DA +#define GL_NEGATIVE_Z_EXT 0x87DB +#define GL_NEGATIVE_W_EXT 0x87DC +#define GL_ZERO_EXT 0x87DD +#define GL_ONE_EXT 0x87DE +#define GL_NEGATIVE_ONE_EXT 0x87DF +#define GL_NORMALIZED_RANGE_EXT 0x87E0 +#define GL_FULL_RANGE_EXT 0x87E1 +#define GL_CURRENT_VERTEX_EXT 0x87E2 +#define GL_MVP_MATRIX_EXT 0x87E3 +#define GL_VARIANT_VALUE_EXT 0x87E4 +#define GL_VARIANT_DATATYPE_EXT 0x87E5 +#define GL_VARIANT_ARRAY_STRIDE_EXT 0x87E6 +#define GL_VARIANT_ARRAY_TYPE_EXT 0x87E7 +#define GL_VARIANT_ARRAY_EXT 0x87E8 +#define GL_VARIANT_ARRAY_POINTER_EXT 0x87E9 +#define GL_INVARIANT_VALUE_EXT 0x87EA +#define GL_INVARIANT_DATATYPE_EXT 0x87EB +#define GL_LOCAL_CONSTANT_VALUE_EXT 0x87EC +#define GL_LOCAL_CONSTANT_DATATYPE_EXT 0x87ED +#endif + +#ifndef GL_ATI_vertex_streams +#define GL_MAX_VERTEX_STREAMS_ATI 0x876B +#define GL_VERTEX_STREAM0_ATI 0x876C +#define GL_VERTEX_STREAM1_ATI 0x876D +#define GL_VERTEX_STREAM2_ATI 0x876E +#define GL_VERTEX_STREAM3_ATI 0x876F +#define GL_VERTEX_STREAM4_ATI 0x8770 +#define GL_VERTEX_STREAM5_ATI 0x8771 +#define GL_VERTEX_STREAM6_ATI 0x8772 +#define GL_VERTEX_STREAM7_ATI 0x8773 +#define GL_VERTEX_SOURCE_ATI 0x8774 +#endif + +#ifndef GL_ATI_element_array +#define GL_ELEMENT_ARRAY_ATI 0x8768 +#define GL_ELEMENT_ARRAY_TYPE_ATI 0x8769 +#define GL_ELEMENT_ARRAY_POINTER_ATI 0x876A +#endif + +#ifndef GL_SUN_mesh_array +#define GL_QUAD_MESH_SUN 0x8614 +#define GL_TRIANGLE_MESH_SUN 0x8615 +#endif + +#ifndef GL_SUN_slice_accum +#define GL_SLICE_ACCUM_SUN 0x85CC +#endif + +#ifndef GL_NV_multisample_filter_hint +#define GL_MULTISAMPLE_FILTER_HINT_NV 0x8534 +#endif + +#ifndef GL_NV_depth_clamp +#define GL_DEPTH_CLAMP_NV 0x864F +#endif + +#ifndef GL_NV_occlusion_query +#define GL_PIXEL_COUNTER_BITS_NV 0x8864 +#define GL_CURRENT_OCCLUSION_QUERY_ID_NV 0x8865 +#define GL_PIXEL_COUNT_NV 0x8866 +#define GL_PIXEL_COUNT_AVAILABLE_NV 0x8867 +#endif + +#ifndef GL_NV_point_sprite +#define GL_POINT_SPRITE_NV 0x8861 +#define GL_COORD_REPLACE_NV 0x8862 +#define GL_POINT_SPRITE_R_MODE_NV 0x8863 +#endif + +#ifndef GL_NV_texture_shader3 +#define GL_OFFSET_PROJECTIVE_TEXTURE_2D_NV 0x8850 +#define GL_OFFSET_PROJECTIVE_TEXTURE_2D_SCALE_NV 0x8851 +#define GL_OFFSET_PROJECTIVE_TEXTURE_RECTANGLE_NV 0x8852 +#define GL_OFFSET_PROJECTIVE_TEXTURE_RECTANGLE_SCALE_NV 0x8853 +#define GL_OFFSET_HILO_TEXTURE_2D_NV 0x8854 +#define GL_OFFSET_HILO_TEXTURE_RECTANGLE_NV 0x8855 +#define GL_OFFSET_HILO_PROJECTIVE_TEXTURE_2D_NV 0x8856 +#define GL_OFFSET_HILO_PROJECTIVE_TEXTURE_RECTANGLE_NV 0x8857 +#define GL_DEPENDENT_HILO_TEXTURE_2D_NV 0x8858 +#define GL_DEPENDENT_RGB_TEXTURE_3D_NV 0x8859 +#define GL_DEPENDENT_RGB_TEXTURE_CUBE_MAP_NV 0x885A +#define GL_DOT_PRODUCT_PASS_THROUGH_NV 0x885B +#define GL_DOT_PRODUCT_TEXTURE_1D_NV 0x885C +#define GL_DOT_PRODUCT_AFFINE_DEPTH_REPLACE_NV 0x885D +#define GL_HILO8_NV 0x885E +#define GL_SIGNED_HILO8_NV 0x885F +#define GL_FORCE_BLUE_TO_ONE_NV 0x8860 +#endif + +#ifndef GL_NV_vertex_program1_1 +#endif + +#ifndef GL_EXT_shadow_funcs +#endif + +#ifndef GL_EXT_stencil_two_side +#define GL_STENCIL_TEST_TWO_SIDE_EXT 0x8910 +#define GL_ACTIVE_STENCIL_FACE_EXT 0x8911 +#endif + +#ifndef GL_ATI_text_fragment_shader +#define GL_TEXT_FRAGMENT_SHADER_ATI 0x8200 +#endif + +#ifndef GL_APPLE_client_storage +#define GL_UNPACK_CLIENT_STORAGE_APPLE 0x85B2 +#endif + +#ifndef GL_APPLE_element_array +#define GL_ELEMENT_ARRAY_APPLE 0x8768 +#define GL_ELEMENT_ARRAY_TYPE_APPLE 0x8769 +#define GL_ELEMENT_ARRAY_POINTER_APPLE 0x876A +#endif + +#ifndef GL_APPLE_fence +#define GL_DRAW_PIXELS_APPLE 0x8A0A +#define GL_FENCE_APPLE 0x8A0B +#endif + +#ifndef GL_APPLE_vertex_array_object +#define GL_VERTEX_ARRAY_BINDING_APPLE 0x85B5 +#endif + +#ifndef GL_APPLE_vertex_array_range +#define GL_VERTEX_ARRAY_RANGE_APPLE 0x851D +#define GL_VERTEX_ARRAY_RANGE_LENGTH_APPLE 0x851E +#define GL_VERTEX_ARRAY_STORAGE_HINT_APPLE 0x851F +#define GL_VERTEX_ARRAY_RANGE_POINTER_APPLE 0x8521 +#define GL_STORAGE_CACHED_APPLE 0x85BE +#define GL_STORAGE_SHARED_APPLE 0x85BF +#endif + +#ifndef GL_APPLE_ycbcr_422 +#define GL_YCBCR_422_APPLE 0x85B9 +#define GL_UNSIGNED_SHORT_8_8_APPLE 0x85BA +#define GL_UNSIGNED_SHORT_8_8_REV_APPLE 0x85BB +#endif + +#ifndef GL_S3_s3tc +#define GL_RGB_S3TC 0x83A0 +#define GL_RGB4_S3TC 0x83A1 +#define GL_RGBA_S3TC 0x83A2 +#define GL_RGBA4_S3TC 0x83A3 +#endif + +#ifndef GL_ATI_draw_buffers +#define GL_MAX_DRAW_BUFFERS_ATI 0x8824 +#define GL_DRAW_BUFFER0_ATI 0x8825 +#define GL_DRAW_BUFFER1_ATI 0x8826 +#define GL_DRAW_BUFFER2_ATI 0x8827 +#define GL_DRAW_BUFFER3_ATI 0x8828 +#define GL_DRAW_BUFFER4_ATI 0x8829 +#define GL_DRAW_BUFFER5_ATI 0x882A +#define GL_DRAW_BUFFER6_ATI 0x882B +#define GL_DRAW_BUFFER7_ATI 0x882C +#define GL_DRAW_BUFFER8_ATI 0x882D +#define GL_DRAW_BUFFER9_ATI 0x882E +#define GL_DRAW_BUFFER10_ATI 0x882F +#define GL_DRAW_BUFFER11_ATI 0x8830 +#define GL_DRAW_BUFFER12_ATI 0x8831 +#define GL_DRAW_BUFFER13_ATI 0x8832 +#define GL_DRAW_BUFFER14_ATI 0x8833 +#define GL_DRAW_BUFFER15_ATI 0x8834 +#endif + +#ifndef GL_ATI_pixel_format_float +#define GL_TYPE_RGBA_FLOAT_ATI 0x8820 +#define GL_COLOR_CLEAR_UNCLAMPED_VALUE_ATI 0x8835 +#endif + +#ifndef GL_ATI_texture_env_combine3 +#define GL_MODULATE_ADD_ATI 0x8744 +#define GL_MODULATE_SIGNED_ADD_ATI 0x8745 +#define GL_MODULATE_SUBTRACT_ATI 0x8746 +#endif + +#ifndef GL_ATI_texture_float +#define GL_RGBA_FLOAT32_ATI 0x8814 +#define GL_RGB_FLOAT32_ATI 0x8815 +#define GL_ALPHA_FLOAT32_ATI 0x8816 +#define GL_INTENSITY_FLOAT32_ATI 0x8817 +#define GL_LUMINANCE_FLOAT32_ATI 0x8818 +#define GL_LUMINANCE_ALPHA_FLOAT32_ATI 0x8819 +#define GL_RGBA_FLOAT16_ATI 0x881A +#define GL_RGB_FLOAT16_ATI 0x881B +#define GL_ALPHA_FLOAT16_ATI 0x881C +#define GL_INTENSITY_FLOAT16_ATI 0x881D +#define GL_LUMINANCE_FLOAT16_ATI 0x881E +#define GL_LUMINANCE_ALPHA_FLOAT16_ATI 0x881F +#endif + +#ifndef GL_NV_float_buffer +#define GL_FLOAT_R_NV 0x8880 +#define GL_FLOAT_RG_NV 0x8881 +#define GL_FLOAT_RGB_NV 0x8882 +#define GL_FLOAT_RGBA_NV 0x8883 +#define GL_FLOAT_R16_NV 0x8884 +#define GL_FLOAT_R32_NV 0x8885 +#define GL_FLOAT_RG16_NV 0x8886 +#define GL_FLOAT_RG32_NV 0x8887 +#define GL_FLOAT_RGB16_NV 0x8888 +#define GL_FLOAT_RGB32_NV 0x8889 +#define GL_FLOAT_RGBA16_NV 0x888A +#define GL_FLOAT_RGBA32_NV 0x888B +#define GL_TEXTURE_FLOAT_COMPONENTS_NV 0x888C +#define GL_FLOAT_CLEAR_COLOR_VALUE_NV 0x888D +#define GL_FLOAT_RGBA_MODE_NV 0x888E +#endif + +#ifndef GL_NV_fragment_program +#define GL_MAX_FRAGMENT_PROGRAM_LOCAL_PARAMETERS_NV 0x8868 +#define GL_FRAGMENT_PROGRAM_NV 0x8870 +#define GL_MAX_TEXTURE_COORDS_NV 0x8871 +#define GL_MAX_TEXTURE_IMAGE_UNITS_NV 0x8872 +#define GL_FRAGMENT_PROGRAM_BINDING_NV 0x8873 +#define GL_PROGRAM_ERROR_STRING_NV 0x8874 +#endif + +#ifndef GL_NV_half_float +#define GL_HALF_FLOAT_NV 0x140B +#endif + +#ifndef GL_NV_pixel_data_range +#define GL_WRITE_PIXEL_DATA_RANGE_NV 0x8878 +#define GL_READ_PIXEL_DATA_RANGE_NV 0x8879 +#define GL_WRITE_PIXEL_DATA_RANGE_LENGTH_NV 0x887A +#define GL_READ_PIXEL_DATA_RANGE_LENGTH_NV 0x887B +#define GL_WRITE_PIXEL_DATA_RANGE_POINTER_NV 0x887C +#define GL_READ_PIXEL_DATA_RANGE_POINTER_NV 0x887D +#endif + +#ifndef GL_NV_primitive_restart +#define GL_PRIMITIVE_RESTART_NV 0x8558 +#define GL_PRIMITIVE_RESTART_INDEX_NV 0x8559 +#endif + +#ifndef GL_NV_texture_expand_normal +#define GL_TEXTURE_UNSIGNED_REMAP_MODE_NV 0x888F +#endif + +#ifndef GL_NV_vertex_program2 +#endif + +#ifndef GL_ATI_map_object_buffer +#endif + +#ifndef GL_ATI_separate_stencil +#define GL_STENCIL_BACK_FUNC_ATI 0x8800 +#define GL_STENCIL_BACK_FAIL_ATI 0x8801 +#define GL_STENCIL_BACK_PASS_DEPTH_FAIL_ATI 0x8802 +#define GL_STENCIL_BACK_PASS_DEPTH_PASS_ATI 0x8803 +#endif + +#ifndef GL_ATI_vertex_attrib_array_object +#endif + +#ifndef GL_OES_read_format +#define GL_IMPLEMENTATION_COLOR_READ_TYPE_OES 0x8B9A +#define GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES 0x8B9B +#endif + +#ifndef GL_EXT_depth_bounds_test +#define GL_DEPTH_BOUNDS_TEST_EXT 0x8890 +#define GL_DEPTH_BOUNDS_EXT 0x8891 +#endif + +#ifndef GL_EXT_texture_mirror_clamp +#define GL_MIRROR_CLAMP_EXT 0x8742 +#define GL_MIRROR_CLAMP_TO_EDGE_EXT 0x8743 +#define GL_MIRROR_CLAMP_TO_BORDER_EXT 0x8912 +#endif + +#ifndef GL_EXT_blend_equation_separate +#define GL_BLEND_EQUATION_RGB_EXT GL_BLEND_EQUATION +#define GL_BLEND_EQUATION_ALPHA_EXT 0x883D +#endif + +#ifndef GL_MESA_pack_invert +#define GL_PACK_INVERT_MESA 0x8758 +#endif + +#ifndef GL_MESA_ycbcr_texture +#define GL_UNSIGNED_SHORT_8_8_MESA 0x85BA +#define GL_UNSIGNED_SHORT_8_8_REV_MESA 0x85BB +#define GL_YCBCR_MESA 0x8757 +#endif + +#ifndef GL_EXT_pixel_buffer_object +#define GL_PIXEL_PACK_BUFFER_EXT 0x88EB +#define GL_PIXEL_UNPACK_BUFFER_EXT 0x88EC +#define GL_PIXEL_PACK_BUFFER_BINDING_EXT 0x88ED +#define GL_PIXEL_UNPACK_BUFFER_BINDING_EXT 0x88EF +#endif + +#ifndef GL_NV_fragment_program_option +#endif + +#ifndef GL_NV_fragment_program2 +#define GL_MAX_PROGRAM_EXEC_INSTRUCTIONS_NV 0x88F4 +#define GL_MAX_PROGRAM_CALL_DEPTH_NV 0x88F5 +#define GL_MAX_PROGRAM_IF_DEPTH_NV 0x88F6 +#define GL_MAX_PROGRAM_LOOP_DEPTH_NV 0x88F7 +#define GL_MAX_PROGRAM_LOOP_COUNT_NV 0x88F8 +#endif + +#ifndef GL_NV_vertex_program2_option +/* reuse GL_MAX_PROGRAM_EXEC_INSTRUCTIONS_NV */ +/* reuse GL_MAX_PROGRAM_CALL_DEPTH_NV */ +#endif + +#ifndef GL_NV_vertex_program3 +/* reuse GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB */ +#endif + +#ifndef GL_EXT_framebuffer_object +#define GL_INVALID_FRAMEBUFFER_OPERATION_EXT 0x0506 +#define GL_MAX_RENDERBUFFER_SIZE_EXT 0x84E8 +#define GL_FRAMEBUFFER_BINDING_EXT 0x8CA6 +#define GL_RENDERBUFFER_BINDING_EXT 0x8CA7 +#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_EXT 0x8CD0 +#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_EXT 0x8CD1 +#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL_EXT 0x8CD2 +#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE_EXT 0x8CD3 +#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_3D_ZOFFSET_EXT 0x8CD4 +#define GL_FRAMEBUFFER_COMPLETE_EXT 0x8CD5 +#define GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT 0x8CD6 +#define GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT 0x8CD7 +#define GL_FRAMEBUFFER_INCOMPLETE_DUPLICATE_ATTACHMENT_EXT 0x8CD8 +#define GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT 0x8CD9 +#define GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT 0x8CDA +#define GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT 0x8CDB +#define GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT 0x8CDC +#define GL_FRAMEBUFFER_UNSUPPORTED_EXT 0x8CDD +#define GL_MAX_COLOR_ATTACHMENTS_EXT 0x8CDF +#define GL_COLOR_ATTACHMENT0_EXT 0x8CE0 +#define GL_COLOR_ATTACHMENT1_EXT 0x8CE1 +#define GL_COLOR_ATTACHMENT2_EXT 0x8CE2 +#define GL_COLOR_ATTACHMENT3_EXT 0x8CE3 +#define GL_COLOR_ATTACHMENT4_EXT 0x8CE4 +#define GL_COLOR_ATTACHMENT5_EXT 0x8CE5 +#define GL_COLOR_ATTACHMENT6_EXT 0x8CE6 +#define GL_COLOR_ATTACHMENT7_EXT 0x8CE7 +#define GL_COLOR_ATTACHMENT8_EXT 0x8CE8 +#define GL_COLOR_ATTACHMENT9_EXT 0x8CE9 +#define GL_COLOR_ATTACHMENT10_EXT 0x8CEA +#define GL_COLOR_ATTACHMENT11_EXT 0x8CEB +#define GL_COLOR_ATTACHMENT12_EXT 0x8CEC +#define GL_COLOR_ATTACHMENT13_EXT 0x8CED +#define GL_COLOR_ATTACHMENT14_EXT 0x8CEE +#define GL_COLOR_ATTACHMENT15_EXT 0x8CEF +#define GL_DEPTH_ATTACHMENT_EXT 0x8D00 +#define GL_STENCIL_ATTACHMENT_EXT 0x8D20 +#define GL_FRAMEBUFFER_EXT 0x8D40 +#define GL_RENDERBUFFER_EXT 0x8D41 +#define GL_RENDERBUFFER_WIDTH_EXT 0x8D42 +#define GL_RENDERBUFFER_HEIGHT_EXT 0x8D43 +#define GL_RENDERBUFFER_INTERNAL_FORMAT_EXT 0x8D44 +#define GL_STENCIL_INDEX1_EXT 0x8D46 +#define GL_STENCIL_INDEX4_EXT 0x8D47 +#define GL_STENCIL_INDEX8_EXT 0x8D48 +#define GL_STENCIL_INDEX16_EXT 0x8D49 +#define GL_RENDERBUFFER_RED_SIZE_EXT 0x8D50 +#define GL_RENDERBUFFER_GREEN_SIZE_EXT 0x8D51 +#define GL_RENDERBUFFER_BLUE_SIZE_EXT 0x8D52 +#define GL_RENDERBUFFER_ALPHA_SIZE_EXT 0x8D53 +#define GL_RENDERBUFFER_DEPTH_SIZE_EXT 0x8D54 +#define GL_RENDERBUFFER_STENCIL_SIZE_EXT 0x8D55 +#endif + +#ifndef GL_GREMEDY_string_marker +#endif + + +/*************************************************************/ + +#include +#ifndef GL_VERSION_2_0 +/* GL type for program/shader text */ +typedef char GLchar; /* native character */ +#endif + +#ifndef GL_VERSION_1_5 +/* GL types for handling large vertex buffer objects */ +typedef ptrdiff_t GLintptr; +typedef ptrdiff_t GLsizeiptr; +#endif + +#ifndef GL_ARB_vertex_buffer_object +/* GL types for handling large vertex buffer objects */ +typedef ptrdiff_t GLintptrARB; +typedef ptrdiff_t GLsizeiptrARB; +#endif + +#ifndef GL_ARB_shader_objects +/* GL types for handling shader object handles and program/shader text */ +typedef char GLcharARB; /* native character */ +typedef unsigned int GLhandleARB; /* shader object handle */ +#endif + +/* GL types for "half" precision (s10e5) float data in host memory */ +#ifndef GL_ARB_half_float_pixel +typedef unsigned short GLhalfARB; +#endif + +#ifndef GL_NV_half_float +typedef unsigned short GLhalfNV; +#endif + +#ifndef GL_VERSION_1_2 +#define GL_VERSION_1_2 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBlendColor (GLclampf, GLclampf, GLclampf, GLclampf); +GLAPI void APIENTRY glBlendEquation (GLenum); +GLAPI void APIENTRY glDrawRangeElements (GLenum, GLuint, GLuint, GLsizei, GLenum, const GLvoid *); +GLAPI void APIENTRY glColorTable (GLenum, GLenum, GLsizei, GLenum, GLenum, const GLvoid *); +GLAPI void APIENTRY glColorTableParameterfv (GLenum, GLenum, const GLfloat *); +GLAPI void APIENTRY glColorTableParameteriv (GLenum, GLenum, const GLint *); +GLAPI void APIENTRY glCopyColorTable (GLenum, GLenum, GLint, GLint, GLsizei); +GLAPI void APIENTRY glGetColorTable (GLenum, GLenum, GLenum, GLvoid *); +GLAPI void APIENTRY glGetColorTableParameterfv (GLenum, GLenum, GLfloat *); +GLAPI void APIENTRY glGetColorTableParameteriv (GLenum, GLenum, GLint *); +GLAPI void APIENTRY glColorSubTable (GLenum, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *); +GLAPI void APIENTRY glCopyColorSubTable (GLenum, GLsizei, GLint, GLint, GLsizei); +GLAPI void APIENTRY glConvolutionFilter1D (GLenum, GLenum, GLsizei, GLenum, GLenum, const GLvoid *); +GLAPI void APIENTRY glConvolutionFilter2D (GLenum, GLenum, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *); +GLAPI void APIENTRY glConvolutionParameterf (GLenum, GLenum, GLfloat); +GLAPI void APIENTRY glConvolutionParameterfv (GLenum, GLenum, const GLfloat *); +GLAPI void APIENTRY glConvolutionParameteri (GLenum, GLenum, GLint); +GLAPI void APIENTRY glConvolutionParameteriv (GLenum, GLenum, const GLint *); +GLAPI void APIENTRY glCopyConvolutionFilter1D (GLenum, GLenum, GLint, GLint, GLsizei); +GLAPI void APIENTRY glCopyConvolutionFilter2D (GLenum, GLenum, GLint, GLint, GLsizei, GLsizei); +GLAPI void APIENTRY glGetConvolutionFilter (GLenum, GLenum, GLenum, GLvoid *); +GLAPI void APIENTRY glGetConvolutionParameterfv (GLenum, GLenum, GLfloat *); +GLAPI void APIENTRY glGetConvolutionParameteriv (GLenum, GLenum, GLint *); +GLAPI void APIENTRY glGetSeparableFilter (GLenum, GLenum, GLenum, GLvoid *, GLvoid *, GLvoid *); +GLAPI void APIENTRY glSeparableFilter2D (GLenum, GLenum, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *, const GLvoid *); +GLAPI void APIENTRY glGetHistogram (GLenum, GLboolean, GLenum, GLenum, GLvoid *); +GLAPI void APIENTRY glGetHistogramParameterfv (GLenum, GLenum, GLfloat *); +GLAPI void APIENTRY glGetHistogramParameteriv (GLenum, GLenum, GLint *); +GLAPI void APIENTRY glGetMinmax (GLenum, GLboolean, GLenum, GLenum, GLvoid *); +GLAPI void APIENTRY glGetMinmaxParameterfv (GLenum, GLenum, GLfloat *); +GLAPI void APIENTRY glGetMinmaxParameteriv (GLenum, GLenum, GLint *); +GLAPI void APIENTRY glHistogram (GLenum, GLsizei, GLenum, GLboolean); +GLAPI void APIENTRY glMinmax (GLenum, GLenum, GLboolean); +GLAPI void APIENTRY glResetHistogram (GLenum); +GLAPI void APIENTRY glResetMinmax (GLenum); +GLAPI void APIENTRY glTexImage3D (GLenum, GLint, GLint, GLsizei, GLsizei, GLsizei, GLint, GLenum, GLenum, const GLvoid *); +GLAPI void APIENTRY glTexSubImage3D (GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *); +GLAPI void APIENTRY glCopyTexSubImage3D (GLenum, GLint, GLint, GLint, GLint, GLint, GLint, GLsizei, GLsizei); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLBLENDCOLORPROC) (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha); +typedef void (APIENTRYP PFNGLBLENDEQUATIONPROC) (GLenum mode); +typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTSPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices); +typedef void (APIENTRYP PFNGLCOLORTABLEPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *table); +typedef void (APIENTRYP PFNGLCOLORTABLEPARAMETERFVPROC) (GLenum target, GLenum pname, const GLfloat *params); +typedef void (APIENTRYP PFNGLCOLORTABLEPARAMETERIVPROC) (GLenum target, GLenum pname, const GLint *params); +typedef void (APIENTRYP PFNGLCOPYCOLORTABLEPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); +typedef void (APIENTRYP PFNGLGETCOLORTABLEPROC) (GLenum target, GLenum format, GLenum type, GLvoid *table); +typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLCOLORSUBTABLEPROC) (GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid *data); +typedef void (APIENTRYP PFNGLCOPYCOLORSUBTABLEPROC) (GLenum target, GLsizei start, GLint x, GLint y, GLsizei width); +typedef void (APIENTRYP PFNGLCONVOLUTIONFILTER1DPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *image); +typedef void (APIENTRYP PFNGLCONVOLUTIONFILTER2DPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *image); +typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERFPROC) (GLenum target, GLenum pname, GLfloat params); +typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERFVPROC) (GLenum target, GLenum pname, const GLfloat *params); +typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERIPROC) (GLenum target, GLenum pname, GLint params); +typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERIVPROC) (GLenum target, GLenum pname, const GLint *params); +typedef void (APIENTRYP PFNGLCOPYCONVOLUTIONFILTER1DPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); +typedef void (APIENTRYP PFNGLCOPYCONVOLUTIONFILTER2DPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height); +typedef void (APIENTRYP PFNGLGETCONVOLUTIONFILTERPROC) (GLenum target, GLenum format, GLenum type, GLvoid *image); +typedef void (APIENTRYP PFNGLGETCONVOLUTIONPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETCONVOLUTIONPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETSEPARABLEFILTERPROC) (GLenum target, GLenum format, GLenum type, GLvoid *row, GLvoid *column, GLvoid *span); +typedef void (APIENTRYP PFNGLSEPARABLEFILTER2DPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *row, const GLvoid *column); +typedef void (APIENTRYP PFNGLGETHISTOGRAMPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values); +typedef void (APIENTRYP PFNGLGETHISTOGRAMPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETHISTOGRAMPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETMINMAXPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values); +typedef void (APIENTRYP PFNGLGETMINMAXPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETMINMAXPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLHISTOGRAMPROC) (GLenum target, GLsizei width, GLenum internalformat, GLboolean sink); +typedef void (APIENTRYP PFNGLMINMAXPROC) (GLenum target, GLenum internalformat, GLboolean sink); +typedef void (APIENTRYP PFNGLRESETHISTOGRAMPROC) (GLenum target); +typedef void (APIENTRYP PFNGLRESETMINMAXPROC) (GLenum target); +typedef void (APIENTRYP PFNGLTEXIMAGE3DPROC) (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels); +typedef void (APIENTRYP PFNGLTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels); +typedef void (APIENTRYP PFNGLCOPYTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); +#endif + +#ifndef GL_VERSION_1_3 +#define GL_VERSION_1_3 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glActiveTexture (GLenum); +GLAPI void APIENTRY glClientActiveTexture (GLenum); +GLAPI void APIENTRY glMultiTexCoord1d (GLenum, GLdouble); +GLAPI void APIENTRY glMultiTexCoord1dv (GLenum, const GLdouble *); +GLAPI void APIENTRY glMultiTexCoord1f (GLenum, GLfloat); +GLAPI void APIENTRY glMultiTexCoord1fv (GLenum, const GLfloat *); +GLAPI void APIENTRY glMultiTexCoord1i (GLenum, GLint); +GLAPI void APIENTRY glMultiTexCoord1iv (GLenum, const GLint *); +GLAPI void APIENTRY glMultiTexCoord1s (GLenum, GLshort); +GLAPI void APIENTRY glMultiTexCoord1sv (GLenum, const GLshort *); +GLAPI void APIENTRY glMultiTexCoord2d (GLenum, GLdouble, GLdouble); +GLAPI void APIENTRY glMultiTexCoord2dv (GLenum, const GLdouble *); +GLAPI void APIENTRY glMultiTexCoord2f (GLenum, GLfloat, GLfloat); +GLAPI void APIENTRY glMultiTexCoord2fv (GLenum, const GLfloat *); +GLAPI void APIENTRY glMultiTexCoord2i (GLenum, GLint, GLint); +GLAPI void APIENTRY glMultiTexCoord2iv (GLenum, const GLint *); +GLAPI void APIENTRY glMultiTexCoord2s (GLenum, GLshort, GLshort); +GLAPI void APIENTRY glMultiTexCoord2sv (GLenum, const GLshort *); +GLAPI void APIENTRY glMultiTexCoord3d (GLenum, GLdouble, GLdouble, GLdouble); +GLAPI void APIENTRY glMultiTexCoord3dv (GLenum, const GLdouble *); +GLAPI void APIENTRY glMultiTexCoord3f (GLenum, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glMultiTexCoord3fv (GLenum, const GLfloat *); +GLAPI void APIENTRY glMultiTexCoord3i (GLenum, GLint, GLint, GLint); +GLAPI void APIENTRY glMultiTexCoord3iv (GLenum, const GLint *); +GLAPI void APIENTRY glMultiTexCoord3s (GLenum, GLshort, GLshort, GLshort); +GLAPI void APIENTRY glMultiTexCoord3sv (GLenum, const GLshort *); +GLAPI void APIENTRY glMultiTexCoord4d (GLenum, GLdouble, GLdouble, GLdouble, GLdouble); +GLAPI void APIENTRY glMultiTexCoord4dv (GLenum, const GLdouble *); +GLAPI void APIENTRY glMultiTexCoord4f (GLenum, GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glMultiTexCoord4fv (GLenum, const GLfloat *); +GLAPI void APIENTRY glMultiTexCoord4i (GLenum, GLint, GLint, GLint, GLint); +GLAPI void APIENTRY glMultiTexCoord4iv (GLenum, const GLint *); +GLAPI void APIENTRY glMultiTexCoord4s (GLenum, GLshort, GLshort, GLshort, GLshort); +GLAPI void APIENTRY glMultiTexCoord4sv (GLenum, const GLshort *); +GLAPI void APIENTRY glLoadTransposeMatrixf (const GLfloat *); +GLAPI void APIENTRY glLoadTransposeMatrixd (const GLdouble *); +GLAPI void APIENTRY glMultTransposeMatrixf (const GLfloat *); +GLAPI void APIENTRY glMultTransposeMatrixd (const GLdouble *); +GLAPI void APIENTRY glSampleCoverage (GLclampf, GLboolean); +GLAPI void APIENTRY glCompressedTexImage3D (GLenum, GLint, GLenum, GLsizei, GLsizei, GLsizei, GLint, GLsizei, const GLvoid *); +GLAPI void APIENTRY glCompressedTexImage2D (GLenum, GLint, GLenum, GLsizei, GLsizei, GLint, GLsizei, const GLvoid *); +GLAPI void APIENTRY glCompressedTexImage1D (GLenum, GLint, GLenum, GLsizei, GLint, GLsizei, const GLvoid *); +GLAPI void APIENTRY glCompressedTexSubImage3D (GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLenum, GLsizei, const GLvoid *); +GLAPI void APIENTRY glCompressedTexSubImage2D (GLenum, GLint, GLint, GLint, GLsizei, GLsizei, GLenum, GLsizei, const GLvoid *); +GLAPI void APIENTRY glCompressedTexSubImage1D (GLenum, GLint, GLint, GLsizei, GLenum, GLsizei, const GLvoid *); +GLAPI void APIENTRY glGetCompressedTexImage (GLenum, GLint, GLvoid *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLACTIVETEXTUREPROC) (GLenum texture); +typedef void (APIENTRYP PFNGLCLIENTACTIVETEXTUREPROC) (GLenum texture); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1DPROC) (GLenum target, GLdouble s); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1DVPROC) (GLenum target, const GLdouble *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1FPROC) (GLenum target, GLfloat s); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1FVPROC) (GLenum target, const GLfloat *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1IPROC) (GLenum target, GLint s); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1IVPROC) (GLenum target, const GLint *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1SPROC) (GLenum target, GLshort s); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1SVPROC) (GLenum target, const GLshort *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2DPROC) (GLenum target, GLdouble s, GLdouble t); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2DVPROC) (GLenum target, const GLdouble *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2FPROC) (GLenum target, GLfloat s, GLfloat t); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2FVPROC) (GLenum target, const GLfloat *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2IPROC) (GLenum target, GLint s, GLint t); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2IVPROC) (GLenum target, const GLint *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2SPROC) (GLenum target, GLshort s, GLshort t); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2SVPROC) (GLenum target, const GLshort *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3DPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3DVPROC) (GLenum target, const GLdouble *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3FPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3FVPROC) (GLenum target, const GLfloat *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3IPROC) (GLenum target, GLint s, GLint t, GLint r); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3IVPROC) (GLenum target, const GLint *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3SPROC) (GLenum target, GLshort s, GLshort t, GLshort r); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3SVPROC) (GLenum target, const GLshort *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4DPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4DVPROC) (GLenum target, const GLdouble *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4FPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4FVPROC) (GLenum target, const GLfloat *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4IPROC) (GLenum target, GLint s, GLint t, GLint r, GLint q); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4IVPROC) (GLenum target, const GLint *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4SPROC) (GLenum target, GLshort s, GLshort t, GLshort r, GLshort q); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4SVPROC) (GLenum target, const GLshort *v); +typedef void (APIENTRYP PFNGLLOADTRANSPOSEMATRIXFPROC) (const GLfloat *m); +typedef void (APIENTRYP PFNGLLOADTRANSPOSEMATRIXDPROC) (const GLdouble *m); +typedef void (APIENTRYP PFNGLMULTTRANSPOSEMATRIXFPROC) (const GLfloat *m); +typedef void (APIENTRYP PFNGLMULTTRANSPOSEMATRIXDPROC) (const GLdouble *m); +typedef void (APIENTRYP PFNGLSAMPLECOVERAGEPROC) (GLclampf value, GLboolean invert); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE3DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE2DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE1DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data); +typedef void (APIENTRYP PFNGLGETCOMPRESSEDTEXIMAGEPROC) (GLenum target, GLint level, GLvoid *img); +#endif + +#ifndef GL_VERSION_1_4 +#define GL_VERSION_1_4 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBlendFuncSeparate (GLenum, GLenum, GLenum, GLenum); +GLAPI void APIENTRY glFogCoordf (GLfloat); +GLAPI void APIENTRY glFogCoordfv (const GLfloat *); +GLAPI void APIENTRY glFogCoordd (GLdouble); +GLAPI void APIENTRY glFogCoorddv (const GLdouble *); +GLAPI void APIENTRY glFogCoordPointer (GLenum, GLsizei, const GLvoid *); +GLAPI void APIENTRY glMultiDrawArrays (GLenum, GLint *, GLsizei *, GLsizei); +GLAPI void APIENTRY glMultiDrawElements (GLenum, const GLsizei *, GLenum, const GLvoid* *, GLsizei); +GLAPI void APIENTRY glPointParameterf (GLenum, GLfloat); +GLAPI void APIENTRY glPointParameterfv (GLenum, const GLfloat *); +GLAPI void APIENTRY glPointParameteri (GLenum, GLint); +GLAPI void APIENTRY glPointParameteriv (GLenum, const GLint *); +GLAPI void APIENTRY glSecondaryColor3b (GLbyte, GLbyte, GLbyte); +GLAPI void APIENTRY glSecondaryColor3bv (const GLbyte *); +GLAPI void APIENTRY glSecondaryColor3d (GLdouble, GLdouble, GLdouble); +GLAPI void APIENTRY glSecondaryColor3dv (const GLdouble *); +GLAPI void APIENTRY glSecondaryColor3f (GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glSecondaryColor3fv (const GLfloat *); +GLAPI void APIENTRY glSecondaryColor3i (GLint, GLint, GLint); +GLAPI void APIENTRY glSecondaryColor3iv (const GLint *); +GLAPI void APIENTRY glSecondaryColor3s (GLshort, GLshort, GLshort); +GLAPI void APIENTRY glSecondaryColor3sv (const GLshort *); +GLAPI void APIENTRY glSecondaryColor3ub (GLubyte, GLubyte, GLubyte); +GLAPI void APIENTRY glSecondaryColor3ubv (const GLubyte *); +GLAPI void APIENTRY glSecondaryColor3ui (GLuint, GLuint, GLuint); +GLAPI void APIENTRY glSecondaryColor3uiv (const GLuint *); +GLAPI void APIENTRY glSecondaryColor3us (GLushort, GLushort, GLushort); +GLAPI void APIENTRY glSecondaryColor3usv (const GLushort *); +GLAPI void APIENTRY glSecondaryColorPointer (GLint, GLenum, GLsizei, const GLvoid *); +GLAPI void APIENTRY glWindowPos2d (GLdouble, GLdouble); +GLAPI void APIENTRY glWindowPos2dv (const GLdouble *); +GLAPI void APIENTRY glWindowPos2f (GLfloat, GLfloat); +GLAPI void APIENTRY glWindowPos2fv (const GLfloat *); +GLAPI void APIENTRY glWindowPos2i (GLint, GLint); +GLAPI void APIENTRY glWindowPos2iv (const GLint *); +GLAPI void APIENTRY glWindowPos2s (GLshort, GLshort); +GLAPI void APIENTRY glWindowPos2sv (const GLshort *); +GLAPI void APIENTRY glWindowPos3d (GLdouble, GLdouble, GLdouble); +GLAPI void APIENTRY glWindowPos3dv (const GLdouble *); +GLAPI void APIENTRY glWindowPos3f (GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glWindowPos3fv (const GLfloat *); +GLAPI void APIENTRY glWindowPos3i (GLint, GLint, GLint); +GLAPI void APIENTRY glWindowPos3iv (const GLint *); +GLAPI void APIENTRY glWindowPos3s (GLshort, GLshort, GLshort); +GLAPI void APIENTRY glWindowPos3sv (const GLshort *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLBLENDFUNCSEPARATEPROC) (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); +typedef void (APIENTRYP PFNGLFOGCOORDFPROC) (GLfloat coord); +typedef void (APIENTRYP PFNGLFOGCOORDFVPROC) (const GLfloat *coord); +typedef void (APIENTRYP PFNGLFOGCOORDDPROC) (GLdouble coord); +typedef void (APIENTRYP PFNGLFOGCOORDDVPROC) (const GLdouble *coord); +typedef void (APIENTRYP PFNGLFOGCOORDPOINTERPROC) (GLenum type, GLsizei stride, const GLvoid *pointer); +typedef void (APIENTRYP PFNGLMULTIDRAWARRAYSPROC) (GLenum mode, GLint *first, GLsizei *count, GLsizei primcount); +typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTSPROC) (GLenum mode, const GLsizei *count, GLenum type, const GLvoid* *indices, GLsizei primcount); +typedef void (APIENTRYP PFNGLPOINTPARAMETERFPROC) (GLenum pname, GLfloat param); +typedef void (APIENTRYP PFNGLPOINTPARAMETERFVPROC) (GLenum pname, const GLfloat *params); +typedef void (APIENTRYP PFNGLPOINTPARAMETERIPROC) (GLenum pname, GLint param); +typedef void (APIENTRYP PFNGLPOINTPARAMETERIVPROC) (GLenum pname, const GLint *params); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3BPROC) (GLbyte red, GLbyte green, GLbyte blue); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3BVPROC) (const GLbyte *v); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3DPROC) (GLdouble red, GLdouble green, GLdouble blue); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3DVPROC) (const GLdouble *v); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3FPROC) (GLfloat red, GLfloat green, GLfloat blue); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3FVPROC) (const GLfloat *v); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3IPROC) (GLint red, GLint green, GLint blue); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3IVPROC) (const GLint *v); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3SPROC) (GLshort red, GLshort green, GLshort blue); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3SVPROC) (const GLshort *v); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UBPROC) (GLubyte red, GLubyte green, GLubyte blue); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UBVPROC) (const GLubyte *v); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UIPROC) (GLuint red, GLuint green, GLuint blue); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UIVPROC) (const GLuint *v); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3USPROC) (GLushort red, GLushort green, GLushort blue); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3USVPROC) (const GLushort *v); +typedef void (APIENTRYP PFNGLSECONDARYCOLORPOINTERPROC) (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); +typedef void (APIENTRYP PFNGLWINDOWPOS2DPROC) (GLdouble x, GLdouble y); +typedef void (APIENTRYP PFNGLWINDOWPOS2DVPROC) (const GLdouble *v); +typedef void (APIENTRYP PFNGLWINDOWPOS2FPROC) (GLfloat x, GLfloat y); +typedef void (APIENTRYP PFNGLWINDOWPOS2FVPROC) (const GLfloat *v); +typedef void (APIENTRYP PFNGLWINDOWPOS2IPROC) (GLint x, GLint y); +typedef void (APIENTRYP PFNGLWINDOWPOS2IVPROC) (const GLint *v); +typedef void (APIENTRYP PFNGLWINDOWPOS2SPROC) (GLshort x, GLshort y); +typedef void (APIENTRYP PFNGLWINDOWPOS2SVPROC) (const GLshort *v); +typedef void (APIENTRYP PFNGLWINDOWPOS3DPROC) (GLdouble x, GLdouble y, GLdouble z); +typedef void (APIENTRYP PFNGLWINDOWPOS3DVPROC) (const GLdouble *v); +typedef void (APIENTRYP PFNGLWINDOWPOS3FPROC) (GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLWINDOWPOS3FVPROC) (const GLfloat *v); +typedef void (APIENTRYP PFNGLWINDOWPOS3IPROC) (GLint x, GLint y, GLint z); +typedef void (APIENTRYP PFNGLWINDOWPOS3IVPROC) (const GLint *v); +typedef void (APIENTRYP PFNGLWINDOWPOS3SPROC) (GLshort x, GLshort y, GLshort z); +typedef void (APIENTRYP PFNGLWINDOWPOS3SVPROC) (const GLshort *v); +#endif + +#ifndef GL_VERSION_1_5 +#define GL_VERSION_1_5 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glGenQueries (GLsizei, GLuint *); +GLAPI void APIENTRY glDeleteQueries (GLsizei, const GLuint *); +GLAPI GLboolean APIENTRY glIsQuery (GLuint); +GLAPI void APIENTRY glBeginQuery (GLenum, GLuint); +GLAPI void APIENTRY glEndQuery (GLenum); +GLAPI void APIENTRY glGetQueryiv (GLenum, GLenum, GLint *); +GLAPI void APIENTRY glGetQueryObjectiv (GLuint, GLenum, GLint *); +GLAPI void APIENTRY glGetQueryObjectuiv (GLuint, GLenum, GLuint *); +GLAPI void APIENTRY glBindBuffer (GLenum, GLuint); +GLAPI void APIENTRY glDeleteBuffers (GLsizei, const GLuint *); +GLAPI void APIENTRY glGenBuffers (GLsizei, GLuint *); +GLAPI GLboolean APIENTRY glIsBuffer (GLuint); +GLAPI void APIENTRY glBufferData (GLenum, GLsizeiptr, const GLvoid *, GLenum); +GLAPI void APIENTRY glBufferSubData (GLenum, GLintptr, GLsizeiptr, const GLvoid *); +GLAPI void APIENTRY glGetBufferSubData (GLenum, GLintptr, GLsizeiptr, GLvoid *); +GLAPI GLvoid* APIENTRY glMapBuffer (GLenum, GLenum); +GLAPI GLboolean APIENTRY glUnmapBuffer (GLenum); +GLAPI void APIENTRY glGetBufferParameteriv (GLenum, GLenum, GLint *); +GLAPI void APIENTRY glGetBufferPointerv (GLenum, GLenum, GLvoid* *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLGENQUERIESPROC) (GLsizei n, GLuint *ids); +typedef void (APIENTRYP PFNGLDELETEQUERIESPROC) (GLsizei n, const GLuint *ids); +typedef GLboolean (APIENTRYP PFNGLISQUERYPROC) (GLuint id); +typedef void (APIENTRYP PFNGLBEGINQUERYPROC) (GLenum target, GLuint id); +typedef void (APIENTRYP PFNGLENDQUERYPROC) (GLenum target); +typedef void (APIENTRYP PFNGLGETQUERYIVPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETQUERYOBJECTIVPROC) (GLuint id, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETQUERYOBJECTUIVPROC) (GLuint id, GLenum pname, GLuint *params); +typedef void (APIENTRYP PFNGLBINDBUFFERPROC) (GLenum target, GLuint buffer); +typedef void (APIENTRYP PFNGLDELETEBUFFERSPROC) (GLsizei n, const GLuint *buffers); +typedef void (APIENTRYP PFNGLGENBUFFERSPROC) (GLsizei n, GLuint *buffers); +typedef GLboolean (APIENTRYP PFNGLISBUFFERPROC) (GLuint buffer); +typedef void (APIENTRYP PFNGLBUFFERDATAPROC) (GLenum target, GLsizeiptr size, const GLvoid *data, GLenum usage); +typedef void (APIENTRYP PFNGLBUFFERSUBDATAPROC) (GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid *data); +typedef void (APIENTRYP PFNGLGETBUFFERSUBDATAPROC) (GLenum target, GLintptr offset, GLsizeiptr size, GLvoid *data); +typedef GLvoid* (APIENTRYP PFNGLMAPBUFFERPROC) (GLenum target, GLenum access); +typedef GLboolean (APIENTRYP PFNGLUNMAPBUFFERPROC) (GLenum target); +typedef void (APIENTRYP PFNGLGETBUFFERPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETBUFFERPOINTERVPROC) (GLenum target, GLenum pname, GLvoid* *params); +#endif + +#ifndef GL_VERSION_2_0 +#define GL_VERSION_2_0 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBlendEquationSeparate (GLenum, GLenum); +GLAPI void APIENTRY glDrawBuffers (GLsizei, const GLenum *); +GLAPI void APIENTRY glStencilOpSeparate (GLenum, GLenum, GLenum, GLenum); +GLAPI void APIENTRY glStencilFuncSeparate (GLenum, GLenum, GLint, GLuint); +GLAPI void APIENTRY glStencilMaskSeparate (GLenum, GLuint); +GLAPI void APIENTRY glAttachShader (GLuint, GLuint); +GLAPI void APIENTRY glBindAttribLocation (GLuint, GLuint, const GLchar *); +GLAPI void APIENTRY glCompileShader (GLuint); +GLAPI GLuint APIENTRY glCreateProgram (void); +GLAPI GLuint APIENTRY glCreateShader (GLenum); +GLAPI void APIENTRY glDeleteProgram (GLuint); +GLAPI void APIENTRY glDeleteShader (GLuint); +GLAPI void APIENTRY glDetachShader (GLuint, GLuint); +GLAPI void APIENTRY glDisableVertexAttribArray (GLuint); +GLAPI void APIENTRY glEnableVertexAttribArray (GLuint); +GLAPI void APIENTRY glGetActiveAttrib (GLuint, GLuint, GLsizei, GLsizei *, GLint *, GLenum *, GLchar *); +GLAPI void APIENTRY glGetActiveUniform (GLuint, GLuint, GLsizei, GLsizei *, GLint *, GLenum *, GLchar *); +GLAPI void APIENTRY glGetAttachedShaders (GLuint, GLsizei, GLsizei *, GLuint *); +GLAPI GLint APIENTRY glGetAttribLocation (GLuint, const GLchar *); +GLAPI void APIENTRY glGetProgramiv (GLuint, GLenum, GLint *); +GLAPI void APIENTRY glGetProgramInfoLog (GLuint, GLsizei, GLsizei *, GLchar *); +GLAPI void APIENTRY glGetShaderiv (GLuint, GLenum, GLint *); +GLAPI void APIENTRY glGetShaderInfoLog (GLuint, GLsizei, GLsizei *, GLchar *); +GLAPI void APIENTRY glGetShaderSource (GLuint, GLsizei, GLsizei *, GLchar *); +GLAPI GLint APIENTRY glGetUniformLocation (GLuint, const GLchar *); +GLAPI void APIENTRY glGetUniformfv (GLuint, GLint, GLfloat *); +GLAPI void APIENTRY glGetUniformiv (GLuint, GLint, GLint *); +GLAPI void APIENTRY glGetVertexAttribdv (GLuint, GLenum, GLdouble *); +GLAPI void APIENTRY glGetVertexAttribfv (GLuint, GLenum, GLfloat *); +GLAPI void APIENTRY glGetVertexAttribiv (GLuint, GLenum, GLint *); +GLAPI void APIENTRY glGetVertexAttribPointerv (GLuint, GLenum, GLvoid* *); +GLAPI GLboolean APIENTRY glIsProgram (GLuint); +GLAPI GLboolean APIENTRY glIsShader (GLuint); +GLAPI void APIENTRY glLinkProgram (GLuint); +GLAPI void APIENTRY glShaderSource (GLuint, GLsizei, const GLchar* *, const GLint *); +GLAPI void APIENTRY glUseProgram (GLuint); +GLAPI void APIENTRY glUniform1f (GLint, GLfloat); +GLAPI void APIENTRY glUniform2f (GLint, GLfloat, GLfloat); +GLAPI void APIENTRY glUniform3f (GLint, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glUniform4f (GLint, GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glUniform1i (GLint, GLint); +GLAPI void APIENTRY glUniform2i (GLint, GLint, GLint); +GLAPI void APIENTRY glUniform3i (GLint, GLint, GLint, GLint); +GLAPI void APIENTRY glUniform4i (GLint, GLint, GLint, GLint, GLint); +GLAPI void APIENTRY glUniform1fv (GLint, GLsizei, const GLfloat *); +GLAPI void APIENTRY glUniform2fv (GLint, GLsizei, const GLfloat *); +GLAPI void APIENTRY glUniform3fv (GLint, GLsizei, const GLfloat *); +GLAPI void APIENTRY glUniform4fv (GLint, GLsizei, const GLfloat *); +GLAPI void APIENTRY glUniform1iv (GLint, GLsizei, const GLint *); +GLAPI void APIENTRY glUniform2iv (GLint, GLsizei, const GLint *); +GLAPI void APIENTRY glUniform3iv (GLint, GLsizei, const GLint *); +GLAPI void APIENTRY glUniform4iv (GLint, GLsizei, const GLint *); +GLAPI void APIENTRY glUniformMatrix2fv (GLint, GLsizei, GLboolean, const GLfloat *); +GLAPI void APIENTRY glUniformMatrix3fv (GLint, GLsizei, GLboolean, const GLfloat *); +GLAPI void APIENTRY glUniformMatrix4fv (GLint, GLsizei, GLboolean, const GLfloat *); +GLAPI void APIENTRY glValidateProgram (GLuint); +GLAPI void APIENTRY glVertexAttrib1d (GLuint, GLdouble); +GLAPI void APIENTRY glVertexAttrib1dv (GLuint, const GLdouble *); +GLAPI void APIENTRY glVertexAttrib1f (GLuint, GLfloat); +GLAPI void APIENTRY glVertexAttrib1fv (GLuint, const GLfloat *); +GLAPI void APIENTRY glVertexAttrib1s (GLuint, GLshort); +GLAPI void APIENTRY glVertexAttrib1sv (GLuint, const GLshort *); +GLAPI void APIENTRY glVertexAttrib2d (GLuint, GLdouble, GLdouble); +GLAPI void APIENTRY glVertexAttrib2dv (GLuint, const GLdouble *); +GLAPI void APIENTRY glVertexAttrib2f (GLuint, GLfloat, GLfloat); +GLAPI void APIENTRY glVertexAttrib2fv (GLuint, const GLfloat *); +GLAPI void APIENTRY glVertexAttrib2s (GLuint, GLshort, GLshort); +GLAPI void APIENTRY glVertexAttrib2sv (GLuint, const GLshort *); +GLAPI void APIENTRY glVertexAttrib3d (GLuint, GLdouble, GLdouble, GLdouble); +GLAPI void APIENTRY glVertexAttrib3dv (GLuint, const GLdouble *); +GLAPI void APIENTRY glVertexAttrib3f (GLuint, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glVertexAttrib3fv (GLuint, const GLfloat *); +GLAPI void APIENTRY glVertexAttrib3s (GLuint, GLshort, GLshort, GLshort); +GLAPI void APIENTRY glVertexAttrib3sv (GLuint, const GLshort *); +GLAPI void APIENTRY glVertexAttrib4Nbv (GLuint, const GLbyte *); +GLAPI void APIENTRY glVertexAttrib4Niv (GLuint, const GLint *); +GLAPI void APIENTRY glVertexAttrib4Nsv (GLuint, const GLshort *); +GLAPI void APIENTRY glVertexAttrib4Nub (GLuint, GLubyte, GLubyte, GLubyte, GLubyte); +GLAPI void APIENTRY glVertexAttrib4Nubv (GLuint, const GLubyte *); +GLAPI void APIENTRY glVertexAttrib4Nuiv (GLuint, const GLuint *); +GLAPI void APIENTRY glVertexAttrib4Nusv (GLuint, const GLushort *); +GLAPI void APIENTRY glVertexAttrib4bv (GLuint, const GLbyte *); +GLAPI void APIENTRY glVertexAttrib4d (GLuint, GLdouble, GLdouble, GLdouble, GLdouble); +GLAPI void APIENTRY glVertexAttrib4dv (GLuint, const GLdouble *); +GLAPI void APIENTRY glVertexAttrib4f (GLuint, GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glVertexAttrib4fv (GLuint, const GLfloat *); +GLAPI void APIENTRY glVertexAttrib4iv (GLuint, const GLint *); +GLAPI void APIENTRY glVertexAttrib4s (GLuint, GLshort, GLshort, GLshort, GLshort); +GLAPI void APIENTRY glVertexAttrib4sv (GLuint, const GLshort *); +GLAPI void APIENTRY glVertexAttrib4ubv (GLuint, const GLubyte *); +GLAPI void APIENTRY glVertexAttrib4uiv (GLuint, const GLuint *); +GLAPI void APIENTRY glVertexAttrib4usv (GLuint, const GLushort *); +GLAPI void APIENTRY glVertexAttribPointer (GLuint, GLint, GLenum, GLboolean, GLsizei, const GLvoid *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLBLENDEQUATIONSEPARATEPROC) (GLenum modeRGB, GLenum modeAlpha); +typedef void (APIENTRYP PFNGLDRAWBUFFERSPROC) (GLsizei n, const GLenum *bufs); +typedef void (APIENTRYP PFNGLSTENCILOPSEPARATEPROC) (GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass); +typedef void (APIENTRYP PFNGLSTENCILFUNCSEPARATEPROC) (GLenum frontfunc, GLenum backfunc, GLint ref, GLuint mask); +typedef void (APIENTRYP PFNGLSTENCILMASKSEPARATEPROC) (GLenum face, GLuint mask); +typedef void (APIENTRYP PFNGLATTACHSHADERPROC) (GLuint program, GLuint shader); +typedef void (APIENTRYP PFNGLBINDATTRIBLOCATIONPROC) (GLuint program, GLuint index, const GLchar *name); +typedef void (APIENTRYP PFNGLCOMPILESHADERPROC) (GLuint shader); +typedef GLuint (APIENTRYP PFNGLCREATEPROGRAMPROC) (void); +typedef GLuint (APIENTRYP PFNGLCREATESHADERPROC) (GLenum type); +typedef void (APIENTRYP PFNGLDELETEPROGRAMPROC) (GLuint program); +typedef void (APIENTRYP PFNGLDELETESHADERPROC) (GLuint shader); +typedef void (APIENTRYP PFNGLDETACHSHADERPROC) (GLuint program, GLuint shader); +typedef void (APIENTRYP PFNGLDISABLEVERTEXATTRIBARRAYPROC) (GLuint index); +typedef void (APIENTRYP PFNGLENABLEVERTEXATTRIBARRAYPROC) (GLuint index); +typedef void (APIENTRYP PFNGLGETACTIVEATTRIBPROC) (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name); +typedef void (APIENTRYP PFNGLGETACTIVEUNIFORMPROC) (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name); +typedef void (APIENTRYP PFNGLGETATTACHEDSHADERSPROC) (GLuint program, GLsizei maxCount, GLsizei *count, GLuint *obj); +typedef GLint (APIENTRYP PFNGLGETATTRIBLOCATIONPROC) (GLuint program, const GLchar *name); +typedef void (APIENTRYP PFNGLGETPROGRAMIVPROC) (GLuint program, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETPROGRAMINFOLOGPROC) (GLuint program, GLsizei bufSize, GLsizei *length, GLchar *infoLog); +typedef void (APIENTRYP PFNGLGETSHADERIVPROC) (GLuint shader, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETSHADERINFOLOGPROC) (GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *infoLog); +typedef void (APIENTRYP PFNGLGETSHADERSOURCEPROC) (GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *source); +typedef GLint (APIENTRYP PFNGLGETUNIFORMLOCATIONPROC) (GLuint program, const GLchar *name); +typedef void (APIENTRYP PFNGLGETUNIFORMFVPROC) (GLuint program, GLint location, GLfloat *params); +typedef void (APIENTRYP PFNGLGETUNIFORMIVPROC) (GLuint program, GLint location, GLint *params); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBDVPROC) (GLuint index, GLenum pname, GLdouble *params); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBFVPROC) (GLuint index, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIVPROC) (GLuint index, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBPOINTERVPROC) (GLuint index, GLenum pname, GLvoid* *pointer); +typedef GLboolean (APIENTRYP PFNGLISPROGRAMPROC) (GLuint program); +typedef GLboolean (APIENTRYP PFNGLISSHADERPROC) (GLuint shader); +typedef void (APIENTRYP PFNGLLINKPROGRAMPROC) (GLuint program); +typedef void (APIENTRYP PFNGLSHADERSOURCEPROC) (GLuint shader, GLsizei count, const GLchar* *string, const GLint *length); +typedef void (APIENTRYP PFNGLUSEPROGRAMPROC) (GLuint program); +typedef void (APIENTRYP PFNGLUNIFORM1FPROC) (GLint location, GLfloat v0); +typedef void (APIENTRYP PFNGLUNIFORM2FPROC) (GLint location, GLfloat v0, GLfloat v1); +typedef void (APIENTRYP PFNGLUNIFORM3FPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2); +typedef void (APIENTRYP PFNGLUNIFORM4FPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); +typedef void (APIENTRYP PFNGLUNIFORM1IPROC) (GLint location, GLint v0); +typedef void (APIENTRYP PFNGLUNIFORM2IPROC) (GLint location, GLint v0, GLint v1); +typedef void (APIENTRYP PFNGLUNIFORM3IPROC) (GLint location, GLint v0, GLint v1, GLint v2); +typedef void (APIENTRYP PFNGLUNIFORM4IPROC) (GLint location, GLint v0, GLint v1, GLint v2, GLint v3); +typedef void (APIENTRYP PFNGLUNIFORM1FVPROC) (GLint location, GLsizei count, const GLfloat *value); +typedef void (APIENTRYP PFNGLUNIFORM2FVPROC) (GLint location, GLsizei count, const GLfloat *value); +typedef void (APIENTRYP PFNGLUNIFORM3FVPROC) (GLint location, GLsizei count, const GLfloat *value); +typedef void (APIENTRYP PFNGLUNIFORM4FVPROC) (GLint location, GLsizei count, const GLfloat *value); +typedef void (APIENTRYP PFNGLUNIFORM1IVPROC) (GLint location, GLsizei count, const GLint *value); +typedef void (APIENTRYP PFNGLUNIFORM2IVPROC) (GLint location, GLsizei count, const GLint *value); +typedef void (APIENTRYP PFNGLUNIFORM3IVPROC) (GLint location, GLsizei count, const GLint *value); +typedef void (APIENTRYP PFNGLUNIFORM4IVPROC) (GLint location, GLsizei count, const GLint *value); +typedef void (APIENTRYP PFNGLUNIFORMMATRIX2FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLUNIFORMMATRIX3FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLUNIFORMMATRIX4FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLVALIDATEPROGRAMPROC) (GLuint program); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1DPROC) (GLuint index, GLdouble x); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1DVPROC) (GLuint index, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1FPROC) (GLuint index, GLfloat x); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1FVPROC) (GLuint index, const GLfloat *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1SPROC) (GLuint index, GLshort x); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1SVPROC) (GLuint index, const GLshort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2DPROC) (GLuint index, GLdouble x, GLdouble y); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2DVPROC) (GLuint index, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2FPROC) (GLuint index, GLfloat x, GLfloat y); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2FVPROC) (GLuint index, const GLfloat *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2SPROC) (GLuint index, GLshort x, GLshort y); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2SVPROC) (GLuint index, const GLshort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3DPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3DVPROC) (GLuint index, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3FPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3FVPROC) (GLuint index, const GLfloat *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3SPROC) (GLuint index, GLshort x, GLshort y, GLshort z); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3SVPROC) (GLuint index, const GLshort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4NBVPROC) (GLuint index, const GLbyte *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4NIVPROC) (GLuint index, const GLint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4NSVPROC) (GLuint index, const GLshort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUBPROC) (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUBVPROC) (GLuint index, const GLubyte *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUIVPROC) (GLuint index, const GLuint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUSVPROC) (GLuint index, const GLushort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4BVPROC) (GLuint index, const GLbyte *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4DPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4DVPROC) (GLuint index, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4FPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4FVPROC) (GLuint index, const GLfloat *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4IVPROC) (GLuint index, const GLint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4SPROC) (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4SVPROC) (GLuint index, const GLshort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4UBVPROC) (GLuint index, const GLubyte *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4UIVPROC) (GLuint index, const GLuint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4USVPROC) (GLuint index, const GLushort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBPOINTERPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid *pointer); +#endif + +#ifndef GL_ARB_multitexture +#define GL_ARB_multitexture 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glActiveTextureARB (GLenum); +GLAPI void APIENTRY glClientActiveTextureARB (GLenum); +GLAPI void APIENTRY glMultiTexCoord1dARB (GLenum, GLdouble); +GLAPI void APIENTRY glMultiTexCoord1dvARB (GLenum, const GLdouble *); +GLAPI void APIENTRY glMultiTexCoord1fARB (GLenum, GLfloat); +GLAPI void APIENTRY glMultiTexCoord1fvARB (GLenum, const GLfloat *); +GLAPI void APIENTRY glMultiTexCoord1iARB (GLenum, GLint); +GLAPI void APIENTRY glMultiTexCoord1ivARB (GLenum, const GLint *); +GLAPI void APIENTRY glMultiTexCoord1sARB (GLenum, GLshort); +GLAPI void APIENTRY glMultiTexCoord1svARB (GLenum, const GLshort *); +GLAPI void APIENTRY glMultiTexCoord2dARB (GLenum, GLdouble, GLdouble); +GLAPI void APIENTRY glMultiTexCoord2dvARB (GLenum, const GLdouble *); +GLAPI void APIENTRY glMultiTexCoord2fARB (GLenum, GLfloat, GLfloat); +GLAPI void APIENTRY glMultiTexCoord2fvARB (GLenum, const GLfloat *); +GLAPI void APIENTRY glMultiTexCoord2iARB (GLenum, GLint, GLint); +GLAPI void APIENTRY glMultiTexCoord2ivARB (GLenum, const GLint *); +GLAPI void APIENTRY glMultiTexCoord2sARB (GLenum, GLshort, GLshort); +GLAPI void APIENTRY glMultiTexCoord2svARB (GLenum, const GLshort *); +GLAPI void APIENTRY glMultiTexCoord3dARB (GLenum, GLdouble, GLdouble, GLdouble); +GLAPI void APIENTRY glMultiTexCoord3dvARB (GLenum, const GLdouble *); +GLAPI void APIENTRY glMultiTexCoord3fARB (GLenum, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glMultiTexCoord3fvARB (GLenum, const GLfloat *); +GLAPI void APIENTRY glMultiTexCoord3iARB (GLenum, GLint, GLint, GLint); +GLAPI void APIENTRY glMultiTexCoord3ivARB (GLenum, const GLint *); +GLAPI void APIENTRY glMultiTexCoord3sARB (GLenum, GLshort, GLshort, GLshort); +GLAPI void APIENTRY glMultiTexCoord3svARB (GLenum, const GLshort *); +GLAPI void APIENTRY glMultiTexCoord4dARB (GLenum, GLdouble, GLdouble, GLdouble, GLdouble); +GLAPI void APIENTRY glMultiTexCoord4dvARB (GLenum, const GLdouble *); +GLAPI void APIENTRY glMultiTexCoord4fARB (GLenum, GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glMultiTexCoord4fvARB (GLenum, const GLfloat *); +GLAPI void APIENTRY glMultiTexCoord4iARB (GLenum, GLint, GLint, GLint, GLint); +GLAPI void APIENTRY glMultiTexCoord4ivARB (GLenum, const GLint *); +GLAPI void APIENTRY glMultiTexCoord4sARB (GLenum, GLshort, GLshort, GLshort, GLshort); +GLAPI void APIENTRY glMultiTexCoord4svARB (GLenum, const GLshort *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLACTIVETEXTUREARBPROC) (GLenum texture); +typedef void (APIENTRYP PFNGLCLIENTACTIVETEXTUREARBPROC) (GLenum texture); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1DARBPROC) (GLenum target, GLdouble s); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1DVARBPROC) (GLenum target, const GLdouble *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1FARBPROC) (GLenum target, GLfloat s); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1FVARBPROC) (GLenum target, const GLfloat *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1IARBPROC) (GLenum target, GLint s); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1IVARBPROC) (GLenum target, const GLint *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1SARBPROC) (GLenum target, GLshort s); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1SVARBPROC) (GLenum target, const GLshort *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2DARBPROC) (GLenum target, GLdouble s, GLdouble t); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2DVARBPROC) (GLenum target, const GLdouble *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2FARBPROC) (GLenum target, GLfloat s, GLfloat t); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2FVARBPROC) (GLenum target, const GLfloat *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2IARBPROC) (GLenum target, GLint s, GLint t); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2IVARBPROC) (GLenum target, const GLint *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2SARBPROC) (GLenum target, GLshort s, GLshort t); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2SVARBPROC) (GLenum target, const GLshort *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3DARBPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3DVARBPROC) (GLenum target, const GLdouble *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3FARBPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3FVARBPROC) (GLenum target, const GLfloat *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3IARBPROC) (GLenum target, GLint s, GLint t, GLint r); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3IVARBPROC) (GLenum target, const GLint *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3SARBPROC) (GLenum target, GLshort s, GLshort t, GLshort r); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3SVARBPROC) (GLenum target, const GLshort *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4DARBPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4DVARBPROC) (GLenum target, const GLdouble *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4FARBPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4FVARBPROC) (GLenum target, const GLfloat *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4IARBPROC) (GLenum target, GLint s, GLint t, GLint r, GLint q); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4IVARBPROC) (GLenum target, const GLint *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4SARBPROC) (GLenum target, GLshort s, GLshort t, GLshort r, GLshort q); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4SVARBPROC) (GLenum target, const GLshort *v); +#endif + +#ifndef GL_ARB_transpose_matrix +#define GL_ARB_transpose_matrix 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glLoadTransposeMatrixfARB (const GLfloat *); +GLAPI void APIENTRY glLoadTransposeMatrixdARB (const GLdouble *); +GLAPI void APIENTRY glMultTransposeMatrixfARB (const GLfloat *); +GLAPI void APIENTRY glMultTransposeMatrixdARB (const GLdouble *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLLOADTRANSPOSEMATRIXFARBPROC) (const GLfloat *m); +typedef void (APIENTRYP PFNGLLOADTRANSPOSEMATRIXDARBPROC) (const GLdouble *m); +typedef void (APIENTRYP PFNGLMULTTRANSPOSEMATRIXFARBPROC) (const GLfloat *m); +typedef void (APIENTRYP PFNGLMULTTRANSPOSEMATRIXDARBPROC) (const GLdouble *m); +#endif + +#ifndef GL_ARB_multisample +#define GL_ARB_multisample 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glSampleCoverageARB (GLclampf, GLboolean); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLSAMPLECOVERAGEARBPROC) (GLclampf value, GLboolean invert); +#endif + +#ifndef GL_ARB_texture_env_add +#define GL_ARB_texture_env_add 1 +#endif + +#ifndef GL_ARB_texture_cube_map +#define GL_ARB_texture_cube_map 1 +#endif + +#ifndef GL_ARB_texture_compression +#define GL_ARB_texture_compression 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glCompressedTexImage3DARB (GLenum, GLint, GLenum, GLsizei, GLsizei, GLsizei, GLint, GLsizei, const GLvoid *); +GLAPI void APIENTRY glCompressedTexImage2DARB (GLenum, GLint, GLenum, GLsizei, GLsizei, GLint, GLsizei, const GLvoid *); +GLAPI void APIENTRY glCompressedTexImage1DARB (GLenum, GLint, GLenum, GLsizei, GLint, GLsizei, const GLvoid *); +GLAPI void APIENTRY glCompressedTexSubImage3DARB (GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLenum, GLsizei, const GLvoid *); +GLAPI void APIENTRY glCompressedTexSubImage2DARB (GLenum, GLint, GLint, GLint, GLsizei, GLsizei, GLenum, GLsizei, const GLvoid *); +GLAPI void APIENTRY glCompressedTexSubImage1DARB (GLenum, GLint, GLint, GLsizei, GLenum, GLsizei, const GLvoid *); +GLAPI void APIENTRY glGetCompressedTexImageARB (GLenum, GLint, GLvoid *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE3DARBPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE2DARBPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE1DARBPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE3DARBPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE2DARBPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE1DARBPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data); +typedef void (APIENTRYP PFNGLGETCOMPRESSEDTEXIMAGEARBPROC) (GLenum target, GLint level, GLvoid *img); +#endif + +#ifndef GL_ARB_texture_border_clamp +#define GL_ARB_texture_border_clamp 1 +#endif + +#ifndef GL_ARB_point_parameters +#define GL_ARB_point_parameters 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glPointParameterfARB (GLenum, GLfloat); +GLAPI void APIENTRY glPointParameterfvARB (GLenum, const GLfloat *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLPOINTPARAMETERFARBPROC) (GLenum pname, GLfloat param); +typedef void (APIENTRYP PFNGLPOINTPARAMETERFVARBPROC) (GLenum pname, const GLfloat *params); +#endif + +#ifndef GL_ARB_vertex_blend +#define GL_ARB_vertex_blend 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glWeightbvARB (GLint, const GLbyte *); +GLAPI void APIENTRY glWeightsvARB (GLint, const GLshort *); +GLAPI void APIENTRY glWeightivARB (GLint, const GLint *); +GLAPI void APIENTRY glWeightfvARB (GLint, const GLfloat *); +GLAPI void APIENTRY glWeightdvARB (GLint, const GLdouble *); +GLAPI void APIENTRY glWeightubvARB (GLint, const GLubyte *); +GLAPI void APIENTRY glWeightusvARB (GLint, const GLushort *); +GLAPI void APIENTRY glWeightuivARB (GLint, const GLuint *); +GLAPI void APIENTRY glWeightPointerARB (GLint, GLenum, GLsizei, const GLvoid *); +GLAPI void APIENTRY glVertexBlendARB (GLint); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLWEIGHTBVARBPROC) (GLint size, const GLbyte *weights); +typedef void (APIENTRYP PFNGLWEIGHTSVARBPROC) (GLint size, const GLshort *weights); +typedef void (APIENTRYP PFNGLWEIGHTIVARBPROC) (GLint size, const GLint *weights); +typedef void (APIENTRYP PFNGLWEIGHTFVARBPROC) (GLint size, const GLfloat *weights); +typedef void (APIENTRYP PFNGLWEIGHTDVARBPROC) (GLint size, const GLdouble *weights); +typedef void (APIENTRYP PFNGLWEIGHTUBVARBPROC) (GLint size, const GLubyte *weights); +typedef void (APIENTRYP PFNGLWEIGHTUSVARBPROC) (GLint size, const GLushort *weights); +typedef void (APIENTRYP PFNGLWEIGHTUIVARBPROC) (GLint size, const GLuint *weights); +typedef void (APIENTRYP PFNGLWEIGHTPOINTERARBPROC) (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); +typedef void (APIENTRYP PFNGLVERTEXBLENDARBPROC) (GLint count); +#endif + +#ifndef GL_ARB_matrix_palette +#define GL_ARB_matrix_palette 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glCurrentPaletteMatrixARB (GLint); +GLAPI void APIENTRY glMatrixIndexubvARB (GLint, const GLubyte *); +GLAPI void APIENTRY glMatrixIndexusvARB (GLint, const GLushort *); +GLAPI void APIENTRY glMatrixIndexuivARB (GLint, const GLuint *); +GLAPI void APIENTRY glMatrixIndexPointerARB (GLint, GLenum, GLsizei, const GLvoid *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLCURRENTPALETTEMATRIXARBPROC) (GLint index); +typedef void (APIENTRYP PFNGLMATRIXINDEXUBVARBPROC) (GLint size, const GLubyte *indices); +typedef void (APIENTRYP PFNGLMATRIXINDEXUSVARBPROC) (GLint size, const GLushort *indices); +typedef void (APIENTRYP PFNGLMATRIXINDEXUIVARBPROC) (GLint size, const GLuint *indices); +typedef void (APIENTRYP PFNGLMATRIXINDEXPOINTERARBPROC) (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); +#endif + +#ifndef GL_ARB_texture_env_combine +#define GL_ARB_texture_env_combine 1 +#endif + +#ifndef GL_ARB_texture_env_crossbar +#define GL_ARB_texture_env_crossbar 1 +#endif + +#ifndef GL_ARB_texture_env_dot3 +#define GL_ARB_texture_env_dot3 1 +#endif + +#ifndef GL_ARB_texture_mirrored_repeat +#define GL_ARB_texture_mirrored_repeat 1 +#endif + +#ifndef GL_ARB_depth_texture +#define GL_ARB_depth_texture 1 +#endif + +#ifndef GL_ARB_shadow +#define GL_ARB_shadow 1 +#endif + +#ifndef GL_ARB_shadow_ambient +#define GL_ARB_shadow_ambient 1 +#endif + +#ifndef GL_ARB_window_pos +#define GL_ARB_window_pos 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glWindowPos2dARB (GLdouble, GLdouble); +GLAPI void APIENTRY glWindowPos2dvARB (const GLdouble *); +GLAPI void APIENTRY glWindowPos2fARB (GLfloat, GLfloat); +GLAPI void APIENTRY glWindowPos2fvARB (const GLfloat *); +GLAPI void APIENTRY glWindowPos2iARB (GLint, GLint); +GLAPI void APIENTRY glWindowPos2ivARB (const GLint *); +GLAPI void APIENTRY glWindowPos2sARB (GLshort, GLshort); +GLAPI void APIENTRY glWindowPos2svARB (const GLshort *); +GLAPI void APIENTRY glWindowPos3dARB (GLdouble, GLdouble, GLdouble); +GLAPI void APIENTRY glWindowPos3dvARB (const GLdouble *); +GLAPI void APIENTRY glWindowPos3fARB (GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glWindowPos3fvARB (const GLfloat *); +GLAPI void APIENTRY glWindowPos3iARB (GLint, GLint, GLint); +GLAPI void APIENTRY glWindowPos3ivARB (const GLint *); +GLAPI void APIENTRY glWindowPos3sARB (GLshort, GLshort, GLshort); +GLAPI void APIENTRY glWindowPos3svARB (const GLshort *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLWINDOWPOS2DARBPROC) (GLdouble x, GLdouble y); +typedef void (APIENTRYP PFNGLWINDOWPOS2DVARBPROC) (const GLdouble *v); +typedef void (APIENTRYP PFNGLWINDOWPOS2FARBPROC) (GLfloat x, GLfloat y); +typedef void (APIENTRYP PFNGLWINDOWPOS2FVARBPROC) (const GLfloat *v); +typedef void (APIENTRYP PFNGLWINDOWPOS2IARBPROC) (GLint x, GLint y); +typedef void (APIENTRYP PFNGLWINDOWPOS2IVARBPROC) (const GLint *v); +typedef void (APIENTRYP PFNGLWINDOWPOS2SARBPROC) (GLshort x, GLshort y); +typedef void (APIENTRYP PFNGLWINDOWPOS2SVARBPROC) (const GLshort *v); +typedef void (APIENTRYP PFNGLWINDOWPOS3DARBPROC) (GLdouble x, GLdouble y, GLdouble z); +typedef void (APIENTRYP PFNGLWINDOWPOS3DVARBPROC) (const GLdouble *v); +typedef void (APIENTRYP PFNGLWINDOWPOS3FARBPROC) (GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLWINDOWPOS3FVARBPROC) (const GLfloat *v); +typedef void (APIENTRYP PFNGLWINDOWPOS3IARBPROC) (GLint x, GLint y, GLint z); +typedef void (APIENTRYP PFNGLWINDOWPOS3IVARBPROC) (const GLint *v); +typedef void (APIENTRYP PFNGLWINDOWPOS3SARBPROC) (GLshort x, GLshort y, GLshort z); +typedef void (APIENTRYP PFNGLWINDOWPOS3SVARBPROC) (const GLshort *v); +#endif + +#ifndef GL_ARB_vertex_program +#define GL_ARB_vertex_program 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glVertexAttrib1dARB (GLuint, GLdouble); +GLAPI void APIENTRY glVertexAttrib1dvARB (GLuint, const GLdouble *); +GLAPI void APIENTRY glVertexAttrib1fARB (GLuint, GLfloat); +GLAPI void APIENTRY glVertexAttrib1fvARB (GLuint, const GLfloat *); +GLAPI void APIENTRY glVertexAttrib1sARB (GLuint, GLshort); +GLAPI void APIENTRY glVertexAttrib1svARB (GLuint, const GLshort *); +GLAPI void APIENTRY glVertexAttrib2dARB (GLuint, GLdouble, GLdouble); +GLAPI void APIENTRY glVertexAttrib2dvARB (GLuint, const GLdouble *); +GLAPI void APIENTRY glVertexAttrib2fARB (GLuint, GLfloat, GLfloat); +GLAPI void APIENTRY glVertexAttrib2fvARB (GLuint, const GLfloat *); +GLAPI void APIENTRY glVertexAttrib2sARB (GLuint, GLshort, GLshort); +GLAPI void APIENTRY glVertexAttrib2svARB (GLuint, const GLshort *); +GLAPI void APIENTRY glVertexAttrib3dARB (GLuint, GLdouble, GLdouble, GLdouble); +GLAPI void APIENTRY glVertexAttrib3dvARB (GLuint, const GLdouble *); +GLAPI void APIENTRY glVertexAttrib3fARB (GLuint, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glVertexAttrib3fvARB (GLuint, const GLfloat *); +GLAPI void APIENTRY glVertexAttrib3sARB (GLuint, GLshort, GLshort, GLshort); +GLAPI void APIENTRY glVertexAttrib3svARB (GLuint, const GLshort *); +GLAPI void APIENTRY glVertexAttrib4NbvARB (GLuint, const GLbyte *); +GLAPI void APIENTRY glVertexAttrib4NivARB (GLuint, const GLint *); +GLAPI void APIENTRY glVertexAttrib4NsvARB (GLuint, const GLshort *); +GLAPI void APIENTRY glVertexAttrib4NubARB (GLuint, GLubyte, GLubyte, GLubyte, GLubyte); +GLAPI void APIENTRY glVertexAttrib4NubvARB (GLuint, const GLubyte *); +GLAPI void APIENTRY glVertexAttrib4NuivARB (GLuint, const GLuint *); +GLAPI void APIENTRY glVertexAttrib4NusvARB (GLuint, const GLushort *); +GLAPI void APIENTRY glVertexAttrib4bvARB (GLuint, const GLbyte *); +GLAPI void APIENTRY glVertexAttrib4dARB (GLuint, GLdouble, GLdouble, GLdouble, GLdouble); +GLAPI void APIENTRY glVertexAttrib4dvARB (GLuint, const GLdouble *); +GLAPI void APIENTRY glVertexAttrib4fARB (GLuint, GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glVertexAttrib4fvARB (GLuint, const GLfloat *); +GLAPI void APIENTRY glVertexAttrib4ivARB (GLuint, const GLint *); +GLAPI void APIENTRY glVertexAttrib4sARB (GLuint, GLshort, GLshort, GLshort, GLshort); +GLAPI void APIENTRY glVertexAttrib4svARB (GLuint, const GLshort *); +GLAPI void APIENTRY glVertexAttrib4ubvARB (GLuint, const GLubyte *); +GLAPI void APIENTRY glVertexAttrib4uivARB (GLuint, const GLuint *); +GLAPI void APIENTRY glVertexAttrib4usvARB (GLuint, const GLushort *); +GLAPI void APIENTRY glVertexAttribPointerARB (GLuint, GLint, GLenum, GLboolean, GLsizei, const GLvoid *); +GLAPI void APIENTRY glEnableVertexAttribArrayARB (GLuint); +GLAPI void APIENTRY glDisableVertexAttribArrayARB (GLuint); +GLAPI void APIENTRY glProgramStringARB (GLenum, GLenum, GLsizei, const GLvoid *); +GLAPI void APIENTRY glBindProgramARB (GLenum, GLuint); +GLAPI void APIENTRY glDeleteProgramsARB (GLsizei, const GLuint *); +GLAPI void APIENTRY glGenProgramsARB (GLsizei, GLuint *); +GLAPI void APIENTRY glProgramEnvParameter4dARB (GLenum, GLuint, GLdouble, GLdouble, GLdouble, GLdouble); +GLAPI void APIENTRY glProgramEnvParameter4dvARB (GLenum, GLuint, const GLdouble *); +GLAPI void APIENTRY glProgramEnvParameter4fARB (GLenum, GLuint, GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glProgramEnvParameter4fvARB (GLenum, GLuint, const GLfloat *); +GLAPI void APIENTRY glProgramLocalParameter4dARB (GLenum, GLuint, GLdouble, GLdouble, GLdouble, GLdouble); +GLAPI void APIENTRY glProgramLocalParameter4dvARB (GLenum, GLuint, const GLdouble *); +GLAPI void APIENTRY glProgramLocalParameter4fARB (GLenum, GLuint, GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glProgramLocalParameter4fvARB (GLenum, GLuint, const GLfloat *); +GLAPI void APIENTRY glGetProgramEnvParameterdvARB (GLenum, GLuint, GLdouble *); +GLAPI void APIENTRY glGetProgramEnvParameterfvARB (GLenum, GLuint, GLfloat *); +GLAPI void APIENTRY glGetProgramLocalParameterdvARB (GLenum, GLuint, GLdouble *); +GLAPI void APIENTRY glGetProgramLocalParameterfvARB (GLenum, GLuint, GLfloat *); +GLAPI void APIENTRY glGetProgramivARB (GLenum, GLenum, GLint *); +GLAPI void APIENTRY glGetProgramStringARB (GLenum, GLenum, GLvoid *); +GLAPI void APIENTRY glGetVertexAttribdvARB (GLuint, GLenum, GLdouble *); +GLAPI void APIENTRY glGetVertexAttribfvARB (GLuint, GLenum, GLfloat *); +GLAPI void APIENTRY glGetVertexAttribivARB (GLuint, GLenum, GLint *); +GLAPI void APIENTRY glGetVertexAttribPointervARB (GLuint, GLenum, GLvoid* *); +GLAPI GLboolean APIENTRY glIsProgramARB (GLuint); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLVERTEXATTRIB1DARBPROC) (GLuint index, GLdouble x); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1DVARBPROC) (GLuint index, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1FARBPROC) (GLuint index, GLfloat x); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1FVARBPROC) (GLuint index, const GLfloat *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1SARBPROC) (GLuint index, GLshort x); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1SVARBPROC) (GLuint index, const GLshort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2DARBPROC) (GLuint index, GLdouble x, GLdouble y); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2DVARBPROC) (GLuint index, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2FARBPROC) (GLuint index, GLfloat x, GLfloat y); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2FVARBPROC) (GLuint index, const GLfloat *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2SARBPROC) (GLuint index, GLshort x, GLshort y); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2SVARBPROC) (GLuint index, const GLshort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3DARBPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3DVARBPROC) (GLuint index, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3FARBPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3FVARBPROC) (GLuint index, const GLfloat *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3SARBPROC) (GLuint index, GLshort x, GLshort y, GLshort z); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3SVARBPROC) (GLuint index, const GLshort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4NBVARBPROC) (GLuint index, const GLbyte *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4NIVARBPROC) (GLuint index, const GLint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4NSVARBPROC) (GLuint index, const GLshort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUBARBPROC) (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUBVARBPROC) (GLuint index, const GLubyte *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUIVARBPROC) (GLuint index, const GLuint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUSVARBPROC) (GLuint index, const GLushort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4BVARBPROC) (GLuint index, const GLbyte *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4DARBPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4DVARBPROC) (GLuint index, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4FARBPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4FVARBPROC) (GLuint index, const GLfloat *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4IVARBPROC) (GLuint index, const GLint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4SARBPROC) (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4SVARBPROC) (GLuint index, const GLshort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4UBVARBPROC) (GLuint index, const GLubyte *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4UIVARBPROC) (GLuint index, const GLuint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4USVARBPROC) (GLuint index, const GLushort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBPOINTERARBPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid *pointer); +typedef void (APIENTRYP PFNGLENABLEVERTEXATTRIBARRAYARBPROC) (GLuint index); +typedef void (APIENTRYP PFNGLDISABLEVERTEXATTRIBARRAYARBPROC) (GLuint index); +typedef void (APIENTRYP PFNGLPROGRAMSTRINGARBPROC) (GLenum target, GLenum format, GLsizei len, const GLvoid *string); +typedef void (APIENTRYP PFNGLBINDPROGRAMARBPROC) (GLenum target, GLuint program); +typedef void (APIENTRYP PFNGLDELETEPROGRAMSARBPROC) (GLsizei n, const GLuint *programs); +typedef void (APIENTRYP PFNGLGENPROGRAMSARBPROC) (GLsizei n, GLuint *programs); +typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETER4DARBPROC) (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETER4DVARBPROC) (GLenum target, GLuint index, const GLdouble *params); +typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETER4FARBPROC) (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETER4FVARBPROC) (GLenum target, GLuint index, const GLfloat *params); +typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETER4DARBPROC) (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETER4DVARBPROC) (GLenum target, GLuint index, const GLdouble *params); +typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETER4FARBPROC) (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETER4FVARBPROC) (GLenum target, GLuint index, const GLfloat *params); +typedef void (APIENTRYP PFNGLGETPROGRAMENVPARAMETERDVARBPROC) (GLenum target, GLuint index, GLdouble *params); +typedef void (APIENTRYP PFNGLGETPROGRAMENVPARAMETERFVARBPROC) (GLenum target, GLuint index, GLfloat *params); +typedef void (APIENTRYP PFNGLGETPROGRAMLOCALPARAMETERDVARBPROC) (GLenum target, GLuint index, GLdouble *params); +typedef void (APIENTRYP PFNGLGETPROGRAMLOCALPARAMETERFVARBPROC) (GLenum target, GLuint index, GLfloat *params); +typedef void (APIENTRYP PFNGLGETPROGRAMIVARBPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETPROGRAMSTRINGARBPROC) (GLenum target, GLenum pname, GLvoid *string); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBDVARBPROC) (GLuint index, GLenum pname, GLdouble *params); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBFVARBPROC) (GLuint index, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIVARBPROC) (GLuint index, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBPOINTERVARBPROC) (GLuint index, GLenum pname, GLvoid* *pointer); +typedef GLboolean (APIENTRYP PFNGLISPROGRAMARBPROC) (GLuint program); +#endif + +#ifndef GL_ARB_fragment_program +#define GL_ARB_fragment_program 1 +/* All ARB_fragment_program entry points are shared with ARB_vertex_program. */ +#endif + +#ifndef GL_ARB_vertex_buffer_object +#define GL_ARB_vertex_buffer_object 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBindBufferARB (GLenum, GLuint); +GLAPI void APIENTRY glDeleteBuffersARB (GLsizei, const GLuint *); +GLAPI void APIENTRY glGenBuffersARB (GLsizei, GLuint *); +GLAPI GLboolean APIENTRY glIsBufferARB (GLuint); +GLAPI void APIENTRY glBufferDataARB (GLenum, GLsizeiptrARB, const GLvoid *, GLenum); +GLAPI void APIENTRY glBufferSubDataARB (GLenum, GLintptrARB, GLsizeiptrARB, const GLvoid *); +GLAPI void APIENTRY glGetBufferSubDataARB (GLenum, GLintptrARB, GLsizeiptrARB, GLvoid *); +GLAPI GLvoid* APIENTRY glMapBufferARB (GLenum, GLenum); +GLAPI GLboolean APIENTRY glUnmapBufferARB (GLenum); +GLAPI void APIENTRY glGetBufferParameterivARB (GLenum, GLenum, GLint *); +GLAPI void APIENTRY glGetBufferPointervARB (GLenum, GLenum, GLvoid* *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLBINDBUFFERARBPROC) (GLenum target, GLuint buffer); +typedef void (APIENTRYP PFNGLDELETEBUFFERSARBPROC) (GLsizei n, const GLuint *buffers); +typedef void (APIENTRYP PFNGLGENBUFFERSARBPROC) (GLsizei n, GLuint *buffers); +typedef GLboolean (APIENTRYP PFNGLISBUFFERARBPROC) (GLuint buffer); +typedef void (APIENTRYP PFNGLBUFFERDATAARBPROC) (GLenum target, GLsizeiptrARB size, const GLvoid *data, GLenum usage); +typedef void (APIENTRYP PFNGLBUFFERSUBDATAARBPROC) (GLenum target, GLintptrARB offset, GLsizeiptrARB size, const GLvoid *data); +typedef void (APIENTRYP PFNGLGETBUFFERSUBDATAARBPROC) (GLenum target, GLintptrARB offset, GLsizeiptrARB size, GLvoid *data); +typedef GLvoid* (APIENTRYP PFNGLMAPBUFFERARBPROC) (GLenum target, GLenum access); +typedef GLboolean (APIENTRYP PFNGLUNMAPBUFFERARBPROC) (GLenum target); +typedef void (APIENTRYP PFNGLGETBUFFERPARAMETERIVARBPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETBUFFERPOINTERVARBPROC) (GLenum target, GLenum pname, GLvoid* *params); +#endif + +#ifndef GL_ARB_occlusion_query +#define GL_ARB_occlusion_query 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glGenQueriesARB (GLsizei, GLuint *); +GLAPI void APIENTRY glDeleteQueriesARB (GLsizei, const GLuint *); +GLAPI GLboolean APIENTRY glIsQueryARB (GLuint); +GLAPI void APIENTRY glBeginQueryARB (GLenum, GLuint); +GLAPI void APIENTRY glEndQueryARB (GLenum); +GLAPI void APIENTRY glGetQueryivARB (GLenum, GLenum, GLint *); +GLAPI void APIENTRY glGetQueryObjectivARB (GLuint, GLenum, GLint *); +GLAPI void APIENTRY glGetQueryObjectuivARB (GLuint, GLenum, GLuint *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLGENQUERIESARBPROC) (GLsizei n, GLuint *ids); +typedef void (APIENTRYP PFNGLDELETEQUERIESARBPROC) (GLsizei n, const GLuint *ids); +typedef GLboolean (APIENTRYP PFNGLISQUERYARBPROC) (GLuint id); +typedef void (APIENTRYP PFNGLBEGINQUERYARBPROC) (GLenum target, GLuint id); +typedef void (APIENTRYP PFNGLENDQUERYARBPROC) (GLenum target); +typedef void (APIENTRYP PFNGLGETQUERYIVARBPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETQUERYOBJECTIVARBPROC) (GLuint id, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETQUERYOBJECTUIVARBPROC) (GLuint id, GLenum pname, GLuint *params); +#endif + +#ifndef GL_ARB_shader_objects +#define GL_ARB_shader_objects 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glDeleteObjectARB (GLhandleARB); +GLAPI GLhandleARB APIENTRY glGetHandleARB (GLenum); +GLAPI void APIENTRY glDetachObjectARB (GLhandleARB, GLhandleARB); +GLAPI GLhandleARB APIENTRY glCreateShaderObjectARB (GLenum); +GLAPI void APIENTRY glShaderSourceARB (GLhandleARB, GLsizei, const GLcharARB* *, const GLint *); +GLAPI void APIENTRY glCompileShaderARB (GLhandleARB); +GLAPI GLhandleARB APIENTRY glCreateProgramObjectARB (void); +GLAPI void APIENTRY glAttachObjectARB (GLhandleARB, GLhandleARB); +GLAPI void APIENTRY glLinkProgramARB (GLhandleARB); +GLAPI void APIENTRY glUseProgramObjectARB (GLhandleARB); +GLAPI void APIENTRY glValidateProgramARB (GLhandleARB); +GLAPI void APIENTRY glUniform1fARB (GLint, GLfloat); +GLAPI void APIENTRY glUniform2fARB (GLint, GLfloat, GLfloat); +GLAPI void APIENTRY glUniform3fARB (GLint, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glUniform4fARB (GLint, GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glUniform1iARB (GLint, GLint); +GLAPI void APIENTRY glUniform2iARB (GLint, GLint, GLint); +GLAPI void APIENTRY glUniform3iARB (GLint, GLint, GLint, GLint); +GLAPI void APIENTRY glUniform4iARB (GLint, GLint, GLint, GLint, GLint); +GLAPI void APIENTRY glUniform1fvARB (GLint, GLsizei, const GLfloat *); +GLAPI void APIENTRY glUniform2fvARB (GLint, GLsizei, const GLfloat *); +GLAPI void APIENTRY glUniform3fvARB (GLint, GLsizei, const GLfloat *); +GLAPI void APIENTRY glUniform4fvARB (GLint, GLsizei, const GLfloat *); +GLAPI void APIENTRY glUniform1ivARB (GLint, GLsizei, const GLint *); +GLAPI void APIENTRY glUniform2ivARB (GLint, GLsizei, const GLint *); +GLAPI void APIENTRY glUniform3ivARB (GLint, GLsizei, const GLint *); +GLAPI void APIENTRY glUniform4ivARB (GLint, GLsizei, const GLint *); +GLAPI void APIENTRY glUniformMatrix2fvARB (GLint, GLsizei, GLboolean, const GLfloat *); +GLAPI void APIENTRY glUniformMatrix3fvARB (GLint, GLsizei, GLboolean, const GLfloat *); +GLAPI void APIENTRY glUniformMatrix4fvARB (GLint, GLsizei, GLboolean, const GLfloat *); +GLAPI void APIENTRY glGetObjectParameterfvARB (GLhandleARB, GLenum, GLfloat *); +GLAPI void APIENTRY glGetObjectParameterivARB (GLhandleARB, GLenum, GLint *); +GLAPI void APIENTRY glGetInfoLogARB (GLhandleARB, GLsizei, GLsizei *, GLcharARB *); +GLAPI void APIENTRY glGetAttachedObjectsARB (GLhandleARB, GLsizei, GLsizei *, GLhandleARB *); +GLAPI GLint APIENTRY glGetUniformLocationARB (GLhandleARB, const GLcharARB *); +GLAPI void APIENTRY glGetActiveUniformARB (GLhandleARB, GLuint, GLsizei, GLsizei *, GLint *, GLenum *, GLcharARB *); +GLAPI void APIENTRY glGetUniformfvARB (GLhandleARB, GLint, GLfloat *); +GLAPI void APIENTRY glGetUniformivARB (GLhandleARB, GLint, GLint *); +GLAPI void APIENTRY glGetShaderSourceARB (GLhandleARB, GLsizei, GLsizei *, GLcharARB *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLDELETEOBJECTARBPROC) (GLhandleARB obj); +typedef GLhandleARB (APIENTRYP PFNGLGETHANDLEARBPROC) (GLenum pname); +typedef void (APIENTRYP PFNGLDETACHOBJECTARBPROC) (GLhandleARB containerObj, GLhandleARB attachedObj); +typedef GLhandleARB (APIENTRYP PFNGLCREATESHADEROBJECTARBPROC) (GLenum shaderType); +typedef void (APIENTRYP PFNGLSHADERSOURCEARBPROC) (GLhandleARB shaderObj, GLsizei count, const GLcharARB* *string, const GLint *length); +typedef void (APIENTRYP PFNGLCOMPILESHADERARBPROC) (GLhandleARB shaderObj); +typedef GLhandleARB (APIENTRYP PFNGLCREATEPROGRAMOBJECTARBPROC) (void); +typedef void (APIENTRYP PFNGLATTACHOBJECTARBPROC) (GLhandleARB containerObj, GLhandleARB obj); +typedef void (APIENTRYP PFNGLLINKPROGRAMARBPROC) (GLhandleARB programObj); +typedef void (APIENTRYP PFNGLUSEPROGRAMOBJECTARBPROC) (GLhandleARB programObj); +typedef void (APIENTRYP PFNGLVALIDATEPROGRAMARBPROC) (GLhandleARB programObj); +typedef void (APIENTRYP PFNGLUNIFORM1FARBPROC) (GLint location, GLfloat v0); +typedef void (APIENTRYP PFNGLUNIFORM2FARBPROC) (GLint location, GLfloat v0, GLfloat v1); +typedef void (APIENTRYP PFNGLUNIFORM3FARBPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2); +typedef void (APIENTRYP PFNGLUNIFORM4FARBPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); +typedef void (APIENTRYP PFNGLUNIFORM1IARBPROC) (GLint location, GLint v0); +typedef void (APIENTRYP PFNGLUNIFORM2IARBPROC) (GLint location, GLint v0, GLint v1); +typedef void (APIENTRYP PFNGLUNIFORM3IARBPROC) (GLint location, GLint v0, GLint v1, GLint v2); +typedef void (APIENTRYP PFNGLUNIFORM4IARBPROC) (GLint location, GLint v0, GLint v1, GLint v2, GLint v3); +typedef void (APIENTRYP PFNGLUNIFORM1FVARBPROC) (GLint location, GLsizei count, const GLfloat *value); +typedef void (APIENTRYP PFNGLUNIFORM2FVARBPROC) (GLint location, GLsizei count, const GLfloat *value); +typedef void (APIENTRYP PFNGLUNIFORM3FVARBPROC) (GLint location, GLsizei count, const GLfloat *value); +typedef void (APIENTRYP PFNGLUNIFORM4FVARBPROC) (GLint location, GLsizei count, const GLfloat *value); +typedef void (APIENTRYP PFNGLUNIFORM1IVARBPROC) (GLint location, GLsizei count, const GLint *value); +typedef void (APIENTRYP PFNGLUNIFORM2IVARBPROC) (GLint location, GLsizei count, const GLint *value); +typedef void (APIENTRYP PFNGLUNIFORM3IVARBPROC) (GLint location, GLsizei count, const GLint *value); +typedef void (APIENTRYP PFNGLUNIFORM4IVARBPROC) (GLint location, GLsizei count, const GLint *value); +typedef void (APIENTRYP PFNGLUNIFORMMATRIX2FVARBPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLUNIFORMMATRIX3FVARBPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLUNIFORMMATRIX4FVARBPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLGETOBJECTPARAMETERFVARBPROC) (GLhandleARB obj, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETOBJECTPARAMETERIVARBPROC) (GLhandleARB obj, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETINFOLOGARBPROC) (GLhandleARB obj, GLsizei maxLength, GLsizei *length, GLcharARB *infoLog); +typedef void (APIENTRYP PFNGLGETATTACHEDOBJECTSARBPROC) (GLhandleARB containerObj, GLsizei maxCount, GLsizei *count, GLhandleARB *obj); +typedef GLint (APIENTRYP PFNGLGETUNIFORMLOCATIONARBPROC) (GLhandleARB programObj, const GLcharARB *name); +typedef void (APIENTRYP PFNGLGETACTIVEUNIFORMARBPROC) (GLhandleARB programObj, GLuint index, GLsizei maxLength, GLsizei *length, GLint *size, GLenum *type, GLcharARB *name); +typedef void (APIENTRYP PFNGLGETUNIFORMFVARBPROC) (GLhandleARB programObj, GLint location, GLfloat *params); +typedef void (APIENTRYP PFNGLGETUNIFORMIVARBPROC) (GLhandleARB programObj, GLint location, GLint *params); +typedef void (APIENTRYP PFNGLGETSHADERSOURCEARBPROC) (GLhandleARB obj, GLsizei maxLength, GLsizei *length, GLcharARB *source); +#endif + +#ifndef GL_ARB_vertex_shader +#define GL_ARB_vertex_shader 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBindAttribLocationARB (GLhandleARB, GLuint, const GLcharARB *); +GLAPI void APIENTRY glGetActiveAttribARB (GLhandleARB, GLuint, GLsizei, GLsizei *, GLint *, GLenum *, GLcharARB *); +GLAPI GLint APIENTRY glGetAttribLocationARB (GLhandleARB, const GLcharARB *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLBINDATTRIBLOCATIONARBPROC) (GLhandleARB programObj, GLuint index, const GLcharARB *name); +typedef void (APIENTRYP PFNGLGETACTIVEATTRIBARBPROC) (GLhandleARB programObj, GLuint index, GLsizei maxLength, GLsizei *length, GLint *size, GLenum *type, GLcharARB *name); +typedef GLint (APIENTRYP PFNGLGETATTRIBLOCATIONARBPROC) (GLhandleARB programObj, const GLcharARB *name); +#endif + +#ifndef GL_ARB_fragment_shader +#define GL_ARB_fragment_shader 1 +#endif + +#ifndef GL_ARB_shading_language_100 +#define GL_ARB_shading_language_100 1 +#endif + +#ifndef GL_ARB_texture_non_power_of_two +#define GL_ARB_texture_non_power_of_two 1 +#endif + +#ifndef GL_ARB_point_sprite +#define GL_ARB_point_sprite 1 +#endif + +#ifndef GL_ARB_fragment_program_shadow +#define GL_ARB_fragment_program_shadow 1 +#endif + +#ifndef GL_ARB_draw_buffers +#define GL_ARB_draw_buffers 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glDrawBuffersARB (GLsizei, const GLenum *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLDRAWBUFFERSARBPROC) (GLsizei n, const GLenum *bufs); +#endif + +#ifndef GL_ARB_texture_rectangle +#define GL_ARB_texture_rectangle 1 +#endif + +#ifndef GL_ARB_color_buffer_float +#define GL_ARB_color_buffer_float 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glClampColorARB (GLenum, GLenum); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLCLAMPCOLORARBPROC) (GLenum target, GLenum clamp); +#endif + +#ifndef GL_ARB_half_float_pixel +#define GL_ARB_half_float_pixel 1 +#endif + +#ifndef GL_ARB_texture_float +#define GL_ARB_texture_float 1 +#endif + +#ifndef GL_ARB_pixel_buffer_object +#define GL_ARB_pixel_buffer_object 1 +#endif + +#ifndef GL_EXT_abgr +#define GL_EXT_abgr 1 +#endif + +#ifndef GL_EXT_blend_color +#define GL_EXT_blend_color 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBlendColorEXT (GLclampf, GLclampf, GLclampf, GLclampf); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLBLENDCOLOREXTPROC) (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha); +#endif + +#ifndef GL_EXT_polygon_offset +#define GL_EXT_polygon_offset 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glPolygonOffsetEXT (GLfloat, GLfloat); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLPOLYGONOFFSETEXTPROC) (GLfloat factor, GLfloat bias); +#endif + +#ifndef GL_EXT_texture +#define GL_EXT_texture 1 +#endif + +#ifndef GL_EXT_texture3D +#define GL_EXT_texture3D 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glTexImage3DEXT (GLenum, GLint, GLenum, GLsizei, GLsizei, GLsizei, GLint, GLenum, GLenum, const GLvoid *); +GLAPI void APIENTRY glTexSubImage3DEXT (GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLTEXIMAGE3DEXTPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels); +typedef void (APIENTRYP PFNGLTEXSUBIMAGE3DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels); +#endif + +#ifndef GL_SGIS_texture_filter4 +#define GL_SGIS_texture_filter4 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glGetTexFilterFuncSGIS (GLenum, GLenum, GLfloat *); +GLAPI void APIENTRY glTexFilterFuncSGIS (GLenum, GLenum, GLsizei, const GLfloat *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLGETTEXFILTERFUNCSGISPROC) (GLenum target, GLenum filter, GLfloat *weights); +typedef void (APIENTRYP PFNGLTEXFILTERFUNCSGISPROC) (GLenum target, GLenum filter, GLsizei n, const GLfloat *weights); +#endif + +#ifndef GL_EXT_subtexture +#define GL_EXT_subtexture 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glTexSubImage1DEXT (GLenum, GLint, GLint, GLsizei, GLenum, GLenum, const GLvoid *); +GLAPI void APIENTRY glTexSubImage2DEXT (GLenum, GLint, GLint, GLint, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLTEXSUBIMAGE1DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels); +typedef void (APIENTRYP PFNGLTEXSUBIMAGE2DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels); +#endif + +#ifndef GL_EXT_copy_texture +#define GL_EXT_copy_texture 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glCopyTexImage1DEXT (GLenum, GLint, GLenum, GLint, GLint, GLsizei, GLint); +GLAPI void APIENTRY glCopyTexImage2DEXT (GLenum, GLint, GLenum, GLint, GLint, GLsizei, GLsizei, GLint); +GLAPI void APIENTRY glCopyTexSubImage1DEXT (GLenum, GLint, GLint, GLint, GLint, GLsizei); +GLAPI void APIENTRY glCopyTexSubImage2DEXT (GLenum, GLint, GLint, GLint, GLint, GLint, GLsizei, GLsizei); +GLAPI void APIENTRY glCopyTexSubImage3DEXT (GLenum, GLint, GLint, GLint, GLint, GLint, GLint, GLsizei, GLsizei); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLCOPYTEXIMAGE1DEXTPROC) (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border); +typedef void (APIENTRYP PFNGLCOPYTEXIMAGE2DEXTPROC) (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); +typedef void (APIENTRYP PFNGLCOPYTEXSUBIMAGE1DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width); +typedef void (APIENTRYP PFNGLCOPYTEXSUBIMAGE2DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); +typedef void (APIENTRYP PFNGLCOPYTEXSUBIMAGE3DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); +#endif + +#ifndef GL_EXT_histogram +#define GL_EXT_histogram 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glGetHistogramEXT (GLenum, GLboolean, GLenum, GLenum, GLvoid *); +GLAPI void APIENTRY glGetHistogramParameterfvEXT (GLenum, GLenum, GLfloat *); +GLAPI void APIENTRY glGetHistogramParameterivEXT (GLenum, GLenum, GLint *); +GLAPI void APIENTRY glGetMinmaxEXT (GLenum, GLboolean, GLenum, GLenum, GLvoid *); +GLAPI void APIENTRY glGetMinmaxParameterfvEXT (GLenum, GLenum, GLfloat *); +GLAPI void APIENTRY glGetMinmaxParameterivEXT (GLenum, GLenum, GLint *); +GLAPI void APIENTRY glHistogramEXT (GLenum, GLsizei, GLenum, GLboolean); +GLAPI void APIENTRY glMinmaxEXT (GLenum, GLenum, GLboolean); +GLAPI void APIENTRY glResetHistogramEXT (GLenum); +GLAPI void APIENTRY glResetMinmaxEXT (GLenum); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLGETHISTOGRAMEXTPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values); +typedef void (APIENTRYP PFNGLGETHISTOGRAMPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETHISTOGRAMPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETMINMAXEXTPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values); +typedef void (APIENTRYP PFNGLGETMINMAXPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETMINMAXPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLHISTOGRAMEXTPROC) (GLenum target, GLsizei width, GLenum internalformat, GLboolean sink); +typedef void (APIENTRYP PFNGLMINMAXEXTPROC) (GLenum target, GLenum internalformat, GLboolean sink); +typedef void (APIENTRYP PFNGLRESETHISTOGRAMEXTPROC) (GLenum target); +typedef void (APIENTRYP PFNGLRESETMINMAXEXTPROC) (GLenum target); +#endif + +#ifndef GL_EXT_convolution +#define GL_EXT_convolution 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glConvolutionFilter1DEXT (GLenum, GLenum, GLsizei, GLenum, GLenum, const GLvoid *); +GLAPI void APIENTRY glConvolutionFilter2DEXT (GLenum, GLenum, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *); +GLAPI void APIENTRY glConvolutionParameterfEXT (GLenum, GLenum, GLfloat); +GLAPI void APIENTRY glConvolutionParameterfvEXT (GLenum, GLenum, const GLfloat *); +GLAPI void APIENTRY glConvolutionParameteriEXT (GLenum, GLenum, GLint); +GLAPI void APIENTRY glConvolutionParameterivEXT (GLenum, GLenum, const GLint *); +GLAPI void APIENTRY glCopyConvolutionFilter1DEXT (GLenum, GLenum, GLint, GLint, GLsizei); +GLAPI void APIENTRY glCopyConvolutionFilter2DEXT (GLenum, GLenum, GLint, GLint, GLsizei, GLsizei); +GLAPI void APIENTRY glGetConvolutionFilterEXT (GLenum, GLenum, GLenum, GLvoid *); +GLAPI void APIENTRY glGetConvolutionParameterfvEXT (GLenum, GLenum, GLfloat *); +GLAPI void APIENTRY glGetConvolutionParameterivEXT (GLenum, GLenum, GLint *); +GLAPI void APIENTRY glGetSeparableFilterEXT (GLenum, GLenum, GLenum, GLvoid *, GLvoid *, GLvoid *); +GLAPI void APIENTRY glSeparableFilter2DEXT (GLenum, GLenum, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *, const GLvoid *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLCONVOLUTIONFILTER1DEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *image); +typedef void (APIENTRYP PFNGLCONVOLUTIONFILTER2DEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *image); +typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERFEXTPROC) (GLenum target, GLenum pname, GLfloat params); +typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERFVEXTPROC) (GLenum target, GLenum pname, const GLfloat *params); +typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERIEXTPROC) (GLenum target, GLenum pname, GLint params); +typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERIVEXTPROC) (GLenum target, GLenum pname, const GLint *params); +typedef void (APIENTRYP PFNGLCOPYCONVOLUTIONFILTER1DEXTPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); +typedef void (APIENTRYP PFNGLCOPYCONVOLUTIONFILTER2DEXTPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height); +typedef void (APIENTRYP PFNGLGETCONVOLUTIONFILTEREXTPROC) (GLenum target, GLenum format, GLenum type, GLvoid *image); +typedef void (APIENTRYP PFNGLGETCONVOLUTIONPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETCONVOLUTIONPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETSEPARABLEFILTEREXTPROC) (GLenum target, GLenum format, GLenum type, GLvoid *row, GLvoid *column, GLvoid *span); +typedef void (APIENTRYP PFNGLSEPARABLEFILTER2DEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *row, const GLvoid *column); +#endif + +#ifndef GL_EXT_color_matrix +#define GL_EXT_color_matrix 1 +#endif + +#ifndef GL_SGI_color_table +#define GL_SGI_color_table 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glColorTableSGI (GLenum, GLenum, GLsizei, GLenum, GLenum, const GLvoid *); +GLAPI void APIENTRY glColorTableParameterfvSGI (GLenum, GLenum, const GLfloat *); +GLAPI void APIENTRY glColorTableParameterivSGI (GLenum, GLenum, const GLint *); +GLAPI void APIENTRY glCopyColorTableSGI (GLenum, GLenum, GLint, GLint, GLsizei); +GLAPI void APIENTRY glGetColorTableSGI (GLenum, GLenum, GLenum, GLvoid *); +GLAPI void APIENTRY glGetColorTableParameterfvSGI (GLenum, GLenum, GLfloat *); +GLAPI void APIENTRY glGetColorTableParameterivSGI (GLenum, GLenum, GLint *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLCOLORTABLESGIPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *table); +typedef void (APIENTRYP PFNGLCOLORTABLEPARAMETERFVSGIPROC) (GLenum target, GLenum pname, const GLfloat *params); +typedef void (APIENTRYP PFNGLCOLORTABLEPARAMETERIVSGIPROC) (GLenum target, GLenum pname, const GLint *params); +typedef void (APIENTRYP PFNGLCOPYCOLORTABLESGIPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); +typedef void (APIENTRYP PFNGLGETCOLORTABLESGIPROC) (GLenum target, GLenum format, GLenum type, GLvoid *table); +typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERFVSGIPROC) (GLenum target, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERIVSGIPROC) (GLenum target, GLenum pname, GLint *params); +#endif + +#ifndef GL_SGIX_pixel_texture +#define GL_SGIX_pixel_texture 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glPixelTexGenSGIX (GLenum); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLPIXELTEXGENSGIXPROC) (GLenum mode); +#endif + +#ifndef GL_SGIS_pixel_texture +#define GL_SGIS_pixel_texture 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glPixelTexGenParameteriSGIS (GLenum, GLint); +GLAPI void APIENTRY glPixelTexGenParameterivSGIS (GLenum, const GLint *); +GLAPI void APIENTRY glPixelTexGenParameterfSGIS (GLenum, GLfloat); +GLAPI void APIENTRY glPixelTexGenParameterfvSGIS (GLenum, const GLfloat *); +GLAPI void APIENTRY glGetPixelTexGenParameterivSGIS (GLenum, GLint *); +GLAPI void APIENTRY glGetPixelTexGenParameterfvSGIS (GLenum, GLfloat *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLPIXELTEXGENPARAMETERISGISPROC) (GLenum pname, GLint param); +typedef void (APIENTRYP PFNGLPIXELTEXGENPARAMETERIVSGISPROC) (GLenum pname, const GLint *params); +typedef void (APIENTRYP PFNGLPIXELTEXGENPARAMETERFSGISPROC) (GLenum pname, GLfloat param); +typedef void (APIENTRYP PFNGLPIXELTEXGENPARAMETERFVSGISPROC) (GLenum pname, const GLfloat *params); +typedef void (APIENTRYP PFNGLGETPIXELTEXGENPARAMETERIVSGISPROC) (GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETPIXELTEXGENPARAMETERFVSGISPROC) (GLenum pname, GLfloat *params); +#endif + +#ifndef GL_SGIS_texture4D +#define GL_SGIS_texture4D 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glTexImage4DSGIS (GLenum, GLint, GLenum, GLsizei, GLsizei, GLsizei, GLsizei, GLint, GLenum, GLenum, const GLvoid *); +GLAPI void APIENTRY glTexSubImage4DSGIS (GLenum, GLint, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLTEXIMAGE4DSGISPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLsizei size4d, GLint border, GLenum format, GLenum type, const GLvoid *pixels); +typedef void (APIENTRYP PFNGLTEXSUBIMAGE4DSGISPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint woffset, GLsizei width, GLsizei height, GLsizei depth, GLsizei size4d, GLenum format, GLenum type, const GLvoid *pixels); +#endif + +#ifndef GL_SGI_texture_color_table +#define GL_SGI_texture_color_table 1 +#endif + +#ifndef GL_EXT_cmyka +#define GL_EXT_cmyka 1 +#endif + +#ifndef GL_EXT_texture_object +#define GL_EXT_texture_object 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI GLboolean APIENTRY glAreTexturesResidentEXT (GLsizei, const GLuint *, GLboolean *); +GLAPI void APIENTRY glBindTextureEXT (GLenum, GLuint); +GLAPI void APIENTRY glDeleteTexturesEXT (GLsizei, const GLuint *); +GLAPI void APIENTRY glGenTexturesEXT (GLsizei, GLuint *); +GLAPI GLboolean APIENTRY glIsTextureEXT (GLuint); +GLAPI void APIENTRY glPrioritizeTexturesEXT (GLsizei, const GLuint *, const GLclampf *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef GLboolean (APIENTRYP PFNGLARETEXTURESRESIDENTEXTPROC) (GLsizei n, const GLuint *textures, GLboolean *residences); +typedef void (APIENTRYP PFNGLBINDTEXTUREEXTPROC) (GLenum target, GLuint texture); +typedef void (APIENTRYP PFNGLDELETETEXTURESEXTPROC) (GLsizei n, const GLuint *textures); +typedef void (APIENTRYP PFNGLGENTEXTURESEXTPROC) (GLsizei n, GLuint *textures); +typedef GLboolean (APIENTRYP PFNGLISTEXTUREEXTPROC) (GLuint texture); +typedef void (APIENTRYP PFNGLPRIORITIZETEXTURESEXTPROC) (GLsizei n, const GLuint *textures, const GLclampf *priorities); +#endif + +#ifndef GL_SGIS_detail_texture +#define GL_SGIS_detail_texture 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glDetailTexFuncSGIS (GLenum, GLsizei, const GLfloat *); +GLAPI void APIENTRY glGetDetailTexFuncSGIS (GLenum, GLfloat *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLDETAILTEXFUNCSGISPROC) (GLenum target, GLsizei n, const GLfloat *points); +typedef void (APIENTRYP PFNGLGETDETAILTEXFUNCSGISPROC) (GLenum target, GLfloat *points); +#endif + +#ifndef GL_SGIS_sharpen_texture +#define GL_SGIS_sharpen_texture 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glSharpenTexFuncSGIS (GLenum, GLsizei, const GLfloat *); +GLAPI void APIENTRY glGetSharpenTexFuncSGIS (GLenum, GLfloat *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLSHARPENTEXFUNCSGISPROC) (GLenum target, GLsizei n, const GLfloat *points); +typedef void (APIENTRYP PFNGLGETSHARPENTEXFUNCSGISPROC) (GLenum target, GLfloat *points); +#endif + +#ifndef GL_EXT_packed_pixels +#define GL_EXT_packed_pixels 1 +#endif + +#ifndef GL_SGIS_texture_lod +#define GL_SGIS_texture_lod 1 +#endif + +#ifndef GL_SGIS_multisample +#define GL_SGIS_multisample 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glSampleMaskSGIS (GLclampf, GLboolean); +GLAPI void APIENTRY glSamplePatternSGIS (GLenum); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLSAMPLEMASKSGISPROC) (GLclampf value, GLboolean invert); +typedef void (APIENTRYP PFNGLSAMPLEPATTERNSGISPROC) (GLenum pattern); +#endif + +#ifndef GL_EXT_rescale_normal +#define GL_EXT_rescale_normal 1 +#endif + +#ifndef GL_EXT_vertex_array +#define GL_EXT_vertex_array 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glArrayElementEXT (GLint); +GLAPI void APIENTRY glColorPointerEXT (GLint, GLenum, GLsizei, GLsizei, const GLvoid *); +GLAPI void APIENTRY glDrawArraysEXT (GLenum, GLint, GLsizei); +GLAPI void APIENTRY glEdgeFlagPointerEXT (GLsizei, GLsizei, const GLboolean *); +GLAPI void APIENTRY glGetPointervEXT (GLenum, GLvoid* *); +GLAPI void APIENTRY glIndexPointerEXT (GLenum, GLsizei, GLsizei, const GLvoid *); +GLAPI void APIENTRY glNormalPointerEXT (GLenum, GLsizei, GLsizei, const GLvoid *); +GLAPI void APIENTRY glTexCoordPointerEXT (GLint, GLenum, GLsizei, GLsizei, const GLvoid *); +GLAPI void APIENTRY glVertexPointerEXT (GLint, GLenum, GLsizei, GLsizei, const GLvoid *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLARRAYELEMENTEXTPROC) (GLint i); +typedef void (APIENTRYP PFNGLCOLORPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer); +typedef void (APIENTRYP PFNGLDRAWARRAYSEXTPROC) (GLenum mode, GLint first, GLsizei count); +typedef void (APIENTRYP PFNGLEDGEFLAGPOINTEREXTPROC) (GLsizei stride, GLsizei count, const GLboolean *pointer); +typedef void (APIENTRYP PFNGLGETPOINTERVEXTPROC) (GLenum pname, GLvoid* *params); +typedef void (APIENTRYP PFNGLINDEXPOINTEREXTPROC) (GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer); +typedef void (APIENTRYP PFNGLNORMALPOINTEREXTPROC) (GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer); +typedef void (APIENTRYP PFNGLTEXCOORDPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer); +typedef void (APIENTRYP PFNGLVERTEXPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer); +#endif + +#ifndef GL_EXT_misc_attribute +#define GL_EXT_misc_attribute 1 +#endif + +#ifndef GL_SGIS_generate_mipmap +#define GL_SGIS_generate_mipmap 1 +#endif + +#ifndef GL_SGIX_clipmap +#define GL_SGIX_clipmap 1 +#endif + +#ifndef GL_SGIX_shadow +#define GL_SGIX_shadow 1 +#endif + +#ifndef GL_SGIS_texture_edge_clamp +#define GL_SGIS_texture_edge_clamp 1 +#endif + +#ifndef GL_SGIS_texture_border_clamp +#define GL_SGIS_texture_border_clamp 1 +#endif + +#ifndef GL_EXT_blend_minmax +#define GL_EXT_blend_minmax 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBlendEquationEXT (GLenum); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLBLENDEQUATIONEXTPROC) (GLenum mode); +#endif + +#ifndef GL_EXT_blend_subtract +#define GL_EXT_blend_subtract 1 +#endif + +#ifndef GL_EXT_blend_logic_op +#define GL_EXT_blend_logic_op 1 +#endif + +#ifndef GL_SGIX_interlace +#define GL_SGIX_interlace 1 +#endif + +#ifndef GL_SGIX_pixel_tiles +#define GL_SGIX_pixel_tiles 1 +#endif + +#ifndef GL_SGIX_texture_select +#define GL_SGIX_texture_select 1 +#endif + +#ifndef GL_SGIX_sprite +#define GL_SGIX_sprite 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glSpriteParameterfSGIX (GLenum, GLfloat); +GLAPI void APIENTRY glSpriteParameterfvSGIX (GLenum, const GLfloat *); +GLAPI void APIENTRY glSpriteParameteriSGIX (GLenum, GLint); +GLAPI void APIENTRY glSpriteParameterivSGIX (GLenum, const GLint *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLSPRITEPARAMETERFSGIXPROC) (GLenum pname, GLfloat param); +typedef void (APIENTRYP PFNGLSPRITEPARAMETERFVSGIXPROC) (GLenum pname, const GLfloat *params); +typedef void (APIENTRYP PFNGLSPRITEPARAMETERISGIXPROC) (GLenum pname, GLint param); +typedef void (APIENTRYP PFNGLSPRITEPARAMETERIVSGIXPROC) (GLenum pname, const GLint *params); +#endif + +#ifndef GL_SGIX_texture_multi_buffer +#define GL_SGIX_texture_multi_buffer 1 +#endif + +#ifndef GL_EXT_point_parameters +#define GL_EXT_point_parameters 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glPointParameterfEXT (GLenum, GLfloat); +GLAPI void APIENTRY glPointParameterfvEXT (GLenum, const GLfloat *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLPOINTPARAMETERFEXTPROC) (GLenum pname, GLfloat param); +typedef void (APIENTRYP PFNGLPOINTPARAMETERFVEXTPROC) (GLenum pname, const GLfloat *params); +#endif + +#ifndef GL_SGIS_point_parameters +#define GL_SGIS_point_parameters 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glPointParameterfSGIS (GLenum, GLfloat); +GLAPI void APIENTRY glPointParameterfvSGIS (GLenum, const GLfloat *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLPOINTPARAMETERFSGISPROC) (GLenum pname, GLfloat param); +typedef void (APIENTRYP PFNGLPOINTPARAMETERFVSGISPROC) (GLenum pname, const GLfloat *params); +#endif + +#ifndef GL_SGIX_instruments +#define GL_SGIX_instruments 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI GLint APIENTRY glGetInstrumentsSGIX (void); +GLAPI void APIENTRY glInstrumentsBufferSGIX (GLsizei, GLint *); +GLAPI GLint APIENTRY glPollInstrumentsSGIX (GLint *); +GLAPI void APIENTRY glReadInstrumentsSGIX (GLint); +GLAPI void APIENTRY glStartInstrumentsSGIX (void); +GLAPI void APIENTRY glStopInstrumentsSGIX (GLint); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef GLint (APIENTRYP PFNGLGETINSTRUMENTSSGIXPROC) (void); +typedef void (APIENTRYP PFNGLINSTRUMENTSBUFFERSGIXPROC) (GLsizei size, GLint *buffer); +typedef GLint (APIENTRYP PFNGLPOLLINSTRUMENTSSGIXPROC) (GLint *marker_p); +typedef void (APIENTRYP PFNGLREADINSTRUMENTSSGIXPROC) (GLint marker); +typedef void (APIENTRYP PFNGLSTARTINSTRUMENTSSGIXPROC) (void); +typedef void (APIENTRYP PFNGLSTOPINSTRUMENTSSGIXPROC) (GLint marker); +#endif + +#ifndef GL_SGIX_texture_scale_bias +#define GL_SGIX_texture_scale_bias 1 +#endif + +#ifndef GL_SGIX_framezoom +#define GL_SGIX_framezoom 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glFrameZoomSGIX (GLint); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLFRAMEZOOMSGIXPROC) (GLint factor); +#endif + +#ifndef GL_SGIX_tag_sample_buffer +#define GL_SGIX_tag_sample_buffer 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glTagSampleBufferSGIX (void); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLTAGSAMPLEBUFFERSGIXPROC) (void); +#endif + +#ifndef GL_SGIX_polynomial_ffd +#define GL_SGIX_polynomial_ffd 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glDeformationMap3dSGIX (GLenum, GLdouble, GLdouble, GLint, GLint, GLdouble, GLdouble, GLint, GLint, GLdouble, GLdouble, GLint, GLint, const GLdouble *); +GLAPI void APIENTRY glDeformationMap3fSGIX (GLenum, GLfloat, GLfloat, GLint, GLint, GLfloat, GLfloat, GLint, GLint, GLfloat, GLfloat, GLint, GLint, const GLfloat *); +GLAPI void APIENTRY glDeformSGIX (GLbitfield); +GLAPI void APIENTRY glLoadIdentityDeformationMapSGIX (GLbitfield); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLDEFORMATIONMAP3DSGIXPROC) (GLenum target, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, GLdouble w1, GLdouble w2, GLint wstride, GLint worder, const GLdouble *points); +typedef void (APIENTRYP PFNGLDEFORMATIONMAP3FSGIXPROC) (GLenum target, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, GLfloat w1, GLfloat w2, GLint wstride, GLint worder, const GLfloat *points); +typedef void (APIENTRYP PFNGLDEFORMSGIXPROC) (GLbitfield mask); +typedef void (APIENTRYP PFNGLLOADIDENTITYDEFORMATIONMAPSGIXPROC) (GLbitfield mask); +#endif + +#ifndef GL_SGIX_reference_plane +#define GL_SGIX_reference_plane 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glReferencePlaneSGIX (const GLdouble *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLREFERENCEPLANESGIXPROC) (const GLdouble *equation); +#endif + +#ifndef GL_SGIX_flush_raster +#define GL_SGIX_flush_raster 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glFlushRasterSGIX (void); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLFLUSHRASTERSGIXPROC) (void); +#endif + +#ifndef GL_SGIX_depth_texture +#define GL_SGIX_depth_texture 1 +#endif + +#ifndef GL_SGIS_fog_function +#define GL_SGIS_fog_function 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glFogFuncSGIS (GLsizei, const GLfloat *); +GLAPI void APIENTRY glGetFogFuncSGIS (GLfloat *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLFOGFUNCSGISPROC) (GLsizei n, const GLfloat *points); +typedef void (APIENTRYP PFNGLGETFOGFUNCSGISPROC) (GLfloat *points); +#endif + +#ifndef GL_SGIX_fog_offset +#define GL_SGIX_fog_offset 1 +#endif + +#ifndef GL_HP_image_transform +#define GL_HP_image_transform 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glImageTransformParameteriHP (GLenum, GLenum, GLint); +GLAPI void APIENTRY glImageTransformParameterfHP (GLenum, GLenum, GLfloat); +GLAPI void APIENTRY glImageTransformParameterivHP (GLenum, GLenum, const GLint *); +GLAPI void APIENTRY glImageTransformParameterfvHP (GLenum, GLenum, const GLfloat *); +GLAPI void APIENTRY glGetImageTransformParameterivHP (GLenum, GLenum, GLint *); +GLAPI void APIENTRY glGetImageTransformParameterfvHP (GLenum, GLenum, GLfloat *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLIMAGETRANSFORMPARAMETERIHPPROC) (GLenum target, GLenum pname, GLint param); +typedef void (APIENTRYP PFNGLIMAGETRANSFORMPARAMETERFHPPROC) (GLenum target, GLenum pname, GLfloat param); +typedef void (APIENTRYP PFNGLIMAGETRANSFORMPARAMETERIVHPPROC) (GLenum target, GLenum pname, const GLint *params); +typedef void (APIENTRYP PFNGLIMAGETRANSFORMPARAMETERFVHPPROC) (GLenum target, GLenum pname, const GLfloat *params); +typedef void (APIENTRYP PFNGLGETIMAGETRANSFORMPARAMETERIVHPPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETIMAGETRANSFORMPARAMETERFVHPPROC) (GLenum target, GLenum pname, GLfloat *params); +#endif + +#ifndef GL_HP_convolution_border_modes +#define GL_HP_convolution_border_modes 1 +#endif + +#ifndef GL_SGIX_texture_add_env +#define GL_SGIX_texture_add_env 1 +#endif + +#ifndef GL_EXT_color_subtable +#define GL_EXT_color_subtable 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glColorSubTableEXT (GLenum, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *); +GLAPI void APIENTRY glCopyColorSubTableEXT (GLenum, GLsizei, GLint, GLint, GLsizei); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLCOLORSUBTABLEEXTPROC) (GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid *data); +typedef void (APIENTRYP PFNGLCOPYCOLORSUBTABLEEXTPROC) (GLenum target, GLsizei start, GLint x, GLint y, GLsizei width); +#endif + +#ifndef GL_PGI_vertex_hints +#define GL_PGI_vertex_hints 1 +#endif + +#ifndef GL_PGI_misc_hints +#define GL_PGI_misc_hints 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glHintPGI (GLenum, GLint); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLHINTPGIPROC) (GLenum target, GLint mode); +#endif + +#ifndef GL_EXT_paletted_texture +#define GL_EXT_paletted_texture 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glColorTableEXT (GLenum, GLenum, GLsizei, GLenum, GLenum, const GLvoid *); +GLAPI void APIENTRY glGetColorTableEXT (GLenum, GLenum, GLenum, GLvoid *); +GLAPI void APIENTRY glGetColorTableParameterivEXT (GLenum, GLenum, GLint *); +GLAPI void APIENTRY glGetColorTableParameterfvEXT (GLenum, GLenum, GLfloat *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLCOLORTABLEEXTPROC) (GLenum target, GLenum internalFormat, GLsizei width, GLenum format, GLenum type, const GLvoid *table); +typedef void (APIENTRYP PFNGLGETCOLORTABLEEXTPROC) (GLenum target, GLenum format, GLenum type, GLvoid *data); +typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat *params); +#endif + +#ifndef GL_EXT_clip_volume_hint +#define GL_EXT_clip_volume_hint 1 +#endif + +#ifndef GL_SGIX_list_priority +#define GL_SGIX_list_priority 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glGetListParameterfvSGIX (GLuint, GLenum, GLfloat *); +GLAPI void APIENTRY glGetListParameterivSGIX (GLuint, GLenum, GLint *); +GLAPI void APIENTRY glListParameterfSGIX (GLuint, GLenum, GLfloat); +GLAPI void APIENTRY glListParameterfvSGIX (GLuint, GLenum, const GLfloat *); +GLAPI void APIENTRY glListParameteriSGIX (GLuint, GLenum, GLint); +GLAPI void APIENTRY glListParameterivSGIX (GLuint, GLenum, const GLint *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLGETLISTPARAMETERFVSGIXPROC) (GLuint list, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETLISTPARAMETERIVSGIXPROC) (GLuint list, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLLISTPARAMETERFSGIXPROC) (GLuint list, GLenum pname, GLfloat param); +typedef void (APIENTRYP PFNGLLISTPARAMETERFVSGIXPROC) (GLuint list, GLenum pname, const GLfloat *params); +typedef void (APIENTRYP PFNGLLISTPARAMETERISGIXPROC) (GLuint list, GLenum pname, GLint param); +typedef void (APIENTRYP PFNGLLISTPARAMETERIVSGIXPROC) (GLuint list, GLenum pname, const GLint *params); +#endif + +#ifndef GL_SGIX_ir_instrument1 +#define GL_SGIX_ir_instrument1 1 +#endif + +#ifndef GL_SGIX_calligraphic_fragment +#define GL_SGIX_calligraphic_fragment 1 +#endif + +#ifndef GL_SGIX_texture_lod_bias +#define GL_SGIX_texture_lod_bias 1 +#endif + +#ifndef GL_SGIX_shadow_ambient +#define GL_SGIX_shadow_ambient 1 +#endif + +#ifndef GL_EXT_index_texture +#define GL_EXT_index_texture 1 +#endif + +#ifndef GL_EXT_index_material +#define GL_EXT_index_material 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glIndexMaterialEXT (GLenum, GLenum); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLINDEXMATERIALEXTPROC) (GLenum face, GLenum mode); +#endif + +#ifndef GL_EXT_index_func +#define GL_EXT_index_func 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glIndexFuncEXT (GLenum, GLclampf); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLINDEXFUNCEXTPROC) (GLenum func, GLclampf ref); +#endif + +#ifndef GL_EXT_index_array_formats +#define GL_EXT_index_array_formats 1 +#endif + +#ifndef GL_EXT_compiled_vertex_array +#define GL_EXT_compiled_vertex_array 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glLockArraysEXT (GLint, GLsizei); +GLAPI void APIENTRY glUnlockArraysEXT (void); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLLOCKARRAYSEXTPROC) (GLint first, GLsizei count); +typedef void (APIENTRYP PFNGLUNLOCKARRAYSEXTPROC) (void); +#endif + +#ifndef GL_EXT_cull_vertex +#define GL_EXT_cull_vertex 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glCullParameterdvEXT (GLenum, GLdouble *); +GLAPI void APIENTRY glCullParameterfvEXT (GLenum, GLfloat *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLCULLPARAMETERDVEXTPROC) (GLenum pname, GLdouble *params); +typedef void (APIENTRYP PFNGLCULLPARAMETERFVEXTPROC) (GLenum pname, GLfloat *params); +#endif + +#ifndef GL_SGIX_ycrcb +#define GL_SGIX_ycrcb 1 +#endif + +#ifndef GL_SGIX_fragment_lighting +#define GL_SGIX_fragment_lighting 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glFragmentColorMaterialSGIX (GLenum, GLenum); +GLAPI void APIENTRY glFragmentLightfSGIX (GLenum, GLenum, GLfloat); +GLAPI void APIENTRY glFragmentLightfvSGIX (GLenum, GLenum, const GLfloat *); +GLAPI void APIENTRY glFragmentLightiSGIX (GLenum, GLenum, GLint); +GLAPI void APIENTRY glFragmentLightivSGIX (GLenum, GLenum, const GLint *); +GLAPI void APIENTRY glFragmentLightModelfSGIX (GLenum, GLfloat); +GLAPI void APIENTRY glFragmentLightModelfvSGIX (GLenum, const GLfloat *); +GLAPI void APIENTRY glFragmentLightModeliSGIX (GLenum, GLint); +GLAPI void APIENTRY glFragmentLightModelivSGIX (GLenum, const GLint *); +GLAPI void APIENTRY glFragmentMaterialfSGIX (GLenum, GLenum, GLfloat); +GLAPI void APIENTRY glFragmentMaterialfvSGIX (GLenum, GLenum, const GLfloat *); +GLAPI void APIENTRY glFragmentMaterialiSGIX (GLenum, GLenum, GLint); +GLAPI void APIENTRY glFragmentMaterialivSGIX (GLenum, GLenum, const GLint *); +GLAPI void APIENTRY glGetFragmentLightfvSGIX (GLenum, GLenum, GLfloat *); +GLAPI void APIENTRY glGetFragmentLightivSGIX (GLenum, GLenum, GLint *); +GLAPI void APIENTRY glGetFragmentMaterialfvSGIX (GLenum, GLenum, GLfloat *); +GLAPI void APIENTRY glGetFragmentMaterialivSGIX (GLenum, GLenum, GLint *); +GLAPI void APIENTRY glLightEnviSGIX (GLenum, GLint); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLFRAGMENTCOLORMATERIALSGIXPROC) (GLenum face, GLenum mode); +typedef void (APIENTRYP PFNGLFRAGMENTLIGHTFSGIXPROC) (GLenum light, GLenum pname, GLfloat param); +typedef void (APIENTRYP PFNGLFRAGMENTLIGHTFVSGIXPROC) (GLenum light, GLenum pname, const GLfloat *params); +typedef void (APIENTRYP PFNGLFRAGMENTLIGHTISGIXPROC) (GLenum light, GLenum pname, GLint param); +typedef void (APIENTRYP PFNGLFRAGMENTLIGHTIVSGIXPROC) (GLenum light, GLenum pname, const GLint *params); +typedef void (APIENTRYP PFNGLFRAGMENTLIGHTMODELFSGIXPROC) (GLenum pname, GLfloat param); +typedef void (APIENTRYP PFNGLFRAGMENTLIGHTMODELFVSGIXPROC) (GLenum pname, const GLfloat *params); +typedef void (APIENTRYP PFNGLFRAGMENTLIGHTMODELISGIXPROC) (GLenum pname, GLint param); +typedef void (APIENTRYP PFNGLFRAGMENTLIGHTMODELIVSGIXPROC) (GLenum pname, const GLint *params); +typedef void (APIENTRYP PFNGLFRAGMENTMATERIALFSGIXPROC) (GLenum face, GLenum pname, GLfloat param); +typedef void (APIENTRYP PFNGLFRAGMENTMATERIALFVSGIXPROC) (GLenum face, GLenum pname, const GLfloat *params); +typedef void (APIENTRYP PFNGLFRAGMENTMATERIALISGIXPROC) (GLenum face, GLenum pname, GLint param); +typedef void (APIENTRYP PFNGLFRAGMENTMATERIALIVSGIXPROC) (GLenum face, GLenum pname, const GLint *params); +typedef void (APIENTRYP PFNGLGETFRAGMENTLIGHTFVSGIXPROC) (GLenum light, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETFRAGMENTLIGHTIVSGIXPROC) (GLenum light, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETFRAGMENTMATERIALFVSGIXPROC) (GLenum face, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETFRAGMENTMATERIALIVSGIXPROC) (GLenum face, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLLIGHTENVISGIXPROC) (GLenum pname, GLint param); +#endif + +#ifndef GL_IBM_rasterpos_clip +#define GL_IBM_rasterpos_clip 1 +#endif + +#ifndef GL_HP_texture_lighting +#define GL_HP_texture_lighting 1 +#endif + +#ifndef GL_EXT_draw_range_elements +#define GL_EXT_draw_range_elements 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glDrawRangeElementsEXT (GLenum, GLuint, GLuint, GLsizei, GLenum, const GLvoid *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTSEXTPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices); +#endif + +#ifndef GL_WIN_phong_shading +#define GL_WIN_phong_shading 1 +#endif + +#ifndef GL_WIN_specular_fog +#define GL_WIN_specular_fog 1 +#endif + +#ifndef GL_EXT_light_texture +#define GL_EXT_light_texture 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glApplyTextureEXT (GLenum); +GLAPI void APIENTRY glTextureLightEXT (GLenum); +GLAPI void APIENTRY glTextureMaterialEXT (GLenum, GLenum); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLAPPLYTEXTUREEXTPROC) (GLenum mode); +typedef void (APIENTRYP PFNGLTEXTURELIGHTEXTPROC) (GLenum pname); +typedef void (APIENTRYP PFNGLTEXTUREMATERIALEXTPROC) (GLenum face, GLenum mode); +#endif + +#ifndef GL_SGIX_blend_alpha_minmax +#define GL_SGIX_blend_alpha_minmax 1 +#endif + +#ifndef GL_EXT_bgra +#define GL_EXT_bgra 1 +#endif + +#ifndef GL_SGIX_async +#define GL_SGIX_async 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glAsyncMarkerSGIX (GLuint); +GLAPI GLint APIENTRY glFinishAsyncSGIX (GLuint *); +GLAPI GLint APIENTRY glPollAsyncSGIX (GLuint *); +GLAPI GLuint APIENTRY glGenAsyncMarkersSGIX (GLsizei); +GLAPI void APIENTRY glDeleteAsyncMarkersSGIX (GLuint, GLsizei); +GLAPI GLboolean APIENTRY glIsAsyncMarkerSGIX (GLuint); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLASYNCMARKERSGIXPROC) (GLuint marker); +typedef GLint (APIENTRYP PFNGLFINISHASYNCSGIXPROC) (GLuint *markerp); +typedef GLint (APIENTRYP PFNGLPOLLASYNCSGIXPROC) (GLuint *markerp); +typedef GLuint (APIENTRYP PFNGLGENASYNCMARKERSSGIXPROC) (GLsizei range); +typedef void (APIENTRYP PFNGLDELETEASYNCMARKERSSGIXPROC) (GLuint marker, GLsizei range); +typedef GLboolean (APIENTRYP PFNGLISASYNCMARKERSGIXPROC) (GLuint marker); +#endif + +#ifndef GL_SGIX_async_pixel +#define GL_SGIX_async_pixel 1 +#endif + +#ifndef GL_SGIX_async_histogram +#define GL_SGIX_async_histogram 1 +#endif + +#ifndef GL_INTEL_parallel_arrays +#define GL_INTEL_parallel_arrays 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glVertexPointervINTEL (GLint, GLenum, const GLvoid* *); +GLAPI void APIENTRY glNormalPointervINTEL (GLenum, const GLvoid* *); +GLAPI void APIENTRY glColorPointervINTEL (GLint, GLenum, const GLvoid* *); +GLAPI void APIENTRY glTexCoordPointervINTEL (GLint, GLenum, const GLvoid* *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLVERTEXPOINTERVINTELPROC) (GLint size, GLenum type, const GLvoid* *pointer); +typedef void (APIENTRYP PFNGLNORMALPOINTERVINTELPROC) (GLenum type, const GLvoid* *pointer); +typedef void (APIENTRYP PFNGLCOLORPOINTERVINTELPROC) (GLint size, GLenum type, const GLvoid* *pointer); +typedef void (APIENTRYP PFNGLTEXCOORDPOINTERVINTELPROC) (GLint size, GLenum type, const GLvoid* *pointer); +#endif + +#ifndef GL_HP_occlusion_test +#define GL_HP_occlusion_test 1 +#endif + +#ifndef GL_EXT_pixel_transform +#define GL_EXT_pixel_transform 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glPixelTransformParameteriEXT (GLenum, GLenum, GLint); +GLAPI void APIENTRY glPixelTransformParameterfEXT (GLenum, GLenum, GLfloat); +GLAPI void APIENTRY glPixelTransformParameterivEXT (GLenum, GLenum, const GLint *); +GLAPI void APIENTRY glPixelTransformParameterfvEXT (GLenum, GLenum, const GLfloat *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLPIXELTRANSFORMPARAMETERIEXTPROC) (GLenum target, GLenum pname, GLint param); +typedef void (APIENTRYP PFNGLPIXELTRANSFORMPARAMETERFEXTPROC) (GLenum target, GLenum pname, GLfloat param); +typedef void (APIENTRYP PFNGLPIXELTRANSFORMPARAMETERIVEXTPROC) (GLenum target, GLenum pname, const GLint *params); +typedef void (APIENTRYP PFNGLPIXELTRANSFORMPARAMETERFVEXTPROC) (GLenum target, GLenum pname, const GLfloat *params); +#endif + +#ifndef GL_EXT_pixel_transform_color_table +#define GL_EXT_pixel_transform_color_table 1 +#endif + +#ifndef GL_EXT_shared_texture_palette +#define GL_EXT_shared_texture_palette 1 +#endif + +#ifndef GL_EXT_separate_specular_color +#define GL_EXT_separate_specular_color 1 +#endif + +#ifndef GL_EXT_secondary_color +#define GL_EXT_secondary_color 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glSecondaryColor3bEXT (GLbyte, GLbyte, GLbyte); +GLAPI void APIENTRY glSecondaryColor3bvEXT (const GLbyte *); +GLAPI void APIENTRY glSecondaryColor3dEXT (GLdouble, GLdouble, GLdouble); +GLAPI void APIENTRY glSecondaryColor3dvEXT (const GLdouble *); +GLAPI void APIENTRY glSecondaryColor3fEXT (GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glSecondaryColor3fvEXT (const GLfloat *); +GLAPI void APIENTRY glSecondaryColor3iEXT (GLint, GLint, GLint); +GLAPI void APIENTRY glSecondaryColor3ivEXT (const GLint *); +GLAPI void APIENTRY glSecondaryColor3sEXT (GLshort, GLshort, GLshort); +GLAPI void APIENTRY glSecondaryColor3svEXT (const GLshort *); +GLAPI void APIENTRY glSecondaryColor3ubEXT (GLubyte, GLubyte, GLubyte); +GLAPI void APIENTRY glSecondaryColor3ubvEXT (const GLubyte *); +GLAPI void APIENTRY glSecondaryColor3uiEXT (GLuint, GLuint, GLuint); +GLAPI void APIENTRY glSecondaryColor3uivEXT (const GLuint *); +GLAPI void APIENTRY glSecondaryColor3usEXT (GLushort, GLushort, GLushort); +GLAPI void APIENTRY glSecondaryColor3usvEXT (const GLushort *); +GLAPI void APIENTRY glSecondaryColorPointerEXT (GLint, GLenum, GLsizei, const GLvoid *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3BEXTPROC) (GLbyte red, GLbyte green, GLbyte blue); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3BVEXTPROC) (const GLbyte *v); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3DEXTPROC) (GLdouble red, GLdouble green, GLdouble blue); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3DVEXTPROC) (const GLdouble *v); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3FEXTPROC) (GLfloat red, GLfloat green, GLfloat blue); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3FVEXTPROC) (const GLfloat *v); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3IEXTPROC) (GLint red, GLint green, GLint blue); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3IVEXTPROC) (const GLint *v); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3SEXTPROC) (GLshort red, GLshort green, GLshort blue); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3SVEXTPROC) (const GLshort *v); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UBEXTPROC) (GLubyte red, GLubyte green, GLubyte blue); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UBVEXTPROC) (const GLubyte *v); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UIEXTPROC) (GLuint red, GLuint green, GLuint blue); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UIVEXTPROC) (const GLuint *v); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3USEXTPROC) (GLushort red, GLushort green, GLushort blue); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3USVEXTPROC) (const GLushort *v); +typedef void (APIENTRYP PFNGLSECONDARYCOLORPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); +#endif + +#ifndef GL_EXT_texture_perturb_normal +#define GL_EXT_texture_perturb_normal 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glTextureNormalEXT (GLenum); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLTEXTURENORMALEXTPROC) (GLenum mode); +#endif + +#ifndef GL_EXT_multi_draw_arrays +#define GL_EXT_multi_draw_arrays 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glMultiDrawArraysEXT (GLenum, GLint *, GLsizei *, GLsizei); +GLAPI void APIENTRY glMultiDrawElementsEXT (GLenum, const GLsizei *, GLenum, const GLvoid* *, GLsizei); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLMULTIDRAWARRAYSEXTPROC) (GLenum mode, GLint *first, GLsizei *count, GLsizei primcount); +typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTSEXTPROC) (GLenum mode, const GLsizei *count, GLenum type, const GLvoid* *indices, GLsizei primcount); +#endif + +#ifndef GL_EXT_fog_coord +#define GL_EXT_fog_coord 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glFogCoordfEXT (GLfloat); +GLAPI void APIENTRY glFogCoordfvEXT (const GLfloat *); +GLAPI void APIENTRY glFogCoorddEXT (GLdouble); +GLAPI void APIENTRY glFogCoorddvEXT (const GLdouble *); +GLAPI void APIENTRY glFogCoordPointerEXT (GLenum, GLsizei, const GLvoid *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLFOGCOORDFEXTPROC) (GLfloat coord); +typedef void (APIENTRYP PFNGLFOGCOORDFVEXTPROC) (const GLfloat *coord); +typedef void (APIENTRYP PFNGLFOGCOORDDEXTPROC) (GLdouble coord); +typedef void (APIENTRYP PFNGLFOGCOORDDVEXTPROC) (const GLdouble *coord); +typedef void (APIENTRYP PFNGLFOGCOORDPOINTEREXTPROC) (GLenum type, GLsizei stride, const GLvoid *pointer); +#endif + +#ifndef GL_REND_screen_coordinates +#define GL_REND_screen_coordinates 1 +#endif + +#ifndef GL_EXT_coordinate_frame +#define GL_EXT_coordinate_frame 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glTangent3bEXT (GLbyte, GLbyte, GLbyte); +GLAPI void APIENTRY glTangent3bvEXT (const GLbyte *); +GLAPI void APIENTRY glTangent3dEXT (GLdouble, GLdouble, GLdouble); +GLAPI void APIENTRY glTangent3dvEXT (const GLdouble *); +GLAPI void APIENTRY glTangent3fEXT (GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glTangent3fvEXT (const GLfloat *); +GLAPI void APIENTRY glTangent3iEXT (GLint, GLint, GLint); +GLAPI void APIENTRY glTangent3ivEXT (const GLint *); +GLAPI void APIENTRY glTangent3sEXT (GLshort, GLshort, GLshort); +GLAPI void APIENTRY glTangent3svEXT (const GLshort *); +GLAPI void APIENTRY glBinormal3bEXT (GLbyte, GLbyte, GLbyte); +GLAPI void APIENTRY glBinormal3bvEXT (const GLbyte *); +GLAPI void APIENTRY glBinormal3dEXT (GLdouble, GLdouble, GLdouble); +GLAPI void APIENTRY glBinormal3dvEXT (const GLdouble *); +GLAPI void APIENTRY glBinormal3fEXT (GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glBinormal3fvEXT (const GLfloat *); +GLAPI void APIENTRY glBinormal3iEXT (GLint, GLint, GLint); +GLAPI void APIENTRY glBinormal3ivEXT (const GLint *); +GLAPI void APIENTRY glBinormal3sEXT (GLshort, GLshort, GLshort); +GLAPI void APIENTRY glBinormal3svEXT (const GLshort *); +GLAPI void APIENTRY glTangentPointerEXT (GLenum, GLsizei, const GLvoid *); +GLAPI void APIENTRY glBinormalPointerEXT (GLenum, GLsizei, const GLvoid *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLTANGENT3BEXTPROC) (GLbyte tx, GLbyte ty, GLbyte tz); +typedef void (APIENTRYP PFNGLTANGENT3BVEXTPROC) (const GLbyte *v); +typedef void (APIENTRYP PFNGLTANGENT3DEXTPROC) (GLdouble tx, GLdouble ty, GLdouble tz); +typedef void (APIENTRYP PFNGLTANGENT3DVEXTPROC) (const GLdouble *v); +typedef void (APIENTRYP PFNGLTANGENT3FEXTPROC) (GLfloat tx, GLfloat ty, GLfloat tz); +typedef void (APIENTRYP PFNGLTANGENT3FVEXTPROC) (const GLfloat *v); +typedef void (APIENTRYP PFNGLTANGENT3IEXTPROC) (GLint tx, GLint ty, GLint tz); +typedef void (APIENTRYP PFNGLTANGENT3IVEXTPROC) (const GLint *v); +typedef void (APIENTRYP PFNGLTANGENT3SEXTPROC) (GLshort tx, GLshort ty, GLshort tz); +typedef void (APIENTRYP PFNGLTANGENT3SVEXTPROC) (const GLshort *v); +typedef void (APIENTRYP PFNGLBINORMAL3BEXTPROC) (GLbyte bx, GLbyte by, GLbyte bz); +typedef void (APIENTRYP PFNGLBINORMAL3BVEXTPROC) (const GLbyte *v); +typedef void (APIENTRYP PFNGLBINORMAL3DEXTPROC) (GLdouble bx, GLdouble by, GLdouble bz); +typedef void (APIENTRYP PFNGLBINORMAL3DVEXTPROC) (const GLdouble *v); +typedef void (APIENTRYP PFNGLBINORMAL3FEXTPROC) (GLfloat bx, GLfloat by, GLfloat bz); +typedef void (APIENTRYP PFNGLBINORMAL3FVEXTPROC) (const GLfloat *v); +typedef void (APIENTRYP PFNGLBINORMAL3IEXTPROC) (GLint bx, GLint by, GLint bz); +typedef void (APIENTRYP PFNGLBINORMAL3IVEXTPROC) (const GLint *v); +typedef void (APIENTRYP PFNGLBINORMAL3SEXTPROC) (GLshort bx, GLshort by, GLshort bz); +typedef void (APIENTRYP PFNGLBINORMAL3SVEXTPROC) (const GLshort *v); +typedef void (APIENTRYP PFNGLTANGENTPOINTEREXTPROC) (GLenum type, GLsizei stride, const GLvoid *pointer); +typedef void (APIENTRYP PFNGLBINORMALPOINTEREXTPROC) (GLenum type, GLsizei stride, const GLvoid *pointer); +#endif + +#ifndef GL_EXT_texture_env_combine +#define GL_EXT_texture_env_combine 1 +#endif + +#ifndef GL_APPLE_specular_vector +#define GL_APPLE_specular_vector 1 +#endif + +#ifndef GL_APPLE_transform_hint +#define GL_APPLE_transform_hint 1 +#endif + +#ifndef GL_SGIX_fog_scale +#define GL_SGIX_fog_scale 1 +#endif + +#ifndef GL_SUNX_constant_data +#define GL_SUNX_constant_data 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glFinishTextureSUNX (void); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLFINISHTEXTURESUNXPROC) (void); +#endif + +#ifndef GL_SUN_global_alpha +#define GL_SUN_global_alpha 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glGlobalAlphaFactorbSUN (GLbyte); +GLAPI void APIENTRY glGlobalAlphaFactorsSUN (GLshort); +GLAPI void APIENTRY glGlobalAlphaFactoriSUN (GLint); +GLAPI void APIENTRY glGlobalAlphaFactorfSUN (GLfloat); +GLAPI void APIENTRY glGlobalAlphaFactordSUN (GLdouble); +GLAPI void APIENTRY glGlobalAlphaFactorubSUN (GLubyte); +GLAPI void APIENTRY glGlobalAlphaFactorusSUN (GLushort); +GLAPI void APIENTRY glGlobalAlphaFactoruiSUN (GLuint); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORBSUNPROC) (GLbyte factor); +typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORSSUNPROC) (GLshort factor); +typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORISUNPROC) (GLint factor); +typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORFSUNPROC) (GLfloat factor); +typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORDSUNPROC) (GLdouble factor); +typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORUBSUNPROC) (GLubyte factor); +typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORUSSUNPROC) (GLushort factor); +typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORUISUNPROC) (GLuint factor); +#endif + +#ifndef GL_SUN_triangle_list +#define GL_SUN_triangle_list 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glReplacementCodeuiSUN (GLuint); +GLAPI void APIENTRY glReplacementCodeusSUN (GLushort); +GLAPI void APIENTRY glReplacementCodeubSUN (GLubyte); +GLAPI void APIENTRY glReplacementCodeuivSUN (const GLuint *); +GLAPI void APIENTRY glReplacementCodeusvSUN (const GLushort *); +GLAPI void APIENTRY glReplacementCodeubvSUN (const GLubyte *); +GLAPI void APIENTRY glReplacementCodePointerSUN (GLenum, GLsizei, const GLvoid* *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUISUNPROC) (GLuint code); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUSSUNPROC) (GLushort code); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUBSUNPROC) (GLubyte code); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUIVSUNPROC) (const GLuint *code); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUSVSUNPROC) (const GLushort *code); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUBVSUNPROC) (const GLubyte *code); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEPOINTERSUNPROC) (GLenum type, GLsizei stride, const GLvoid* *pointer); +#endif + +#ifndef GL_SUN_vertex +#define GL_SUN_vertex 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glColor4ubVertex2fSUN (GLubyte, GLubyte, GLubyte, GLubyte, GLfloat, GLfloat); +GLAPI void APIENTRY glColor4ubVertex2fvSUN (const GLubyte *, const GLfloat *); +GLAPI void APIENTRY glColor4ubVertex3fSUN (GLubyte, GLubyte, GLubyte, GLubyte, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glColor4ubVertex3fvSUN (const GLubyte *, const GLfloat *); +GLAPI void APIENTRY glColor3fVertex3fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glColor3fVertex3fvSUN (const GLfloat *, const GLfloat *); +GLAPI void APIENTRY glNormal3fVertex3fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glNormal3fVertex3fvSUN (const GLfloat *, const GLfloat *); +GLAPI void APIENTRY glColor4fNormal3fVertex3fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glColor4fNormal3fVertex3fvSUN (const GLfloat *, const GLfloat *, const GLfloat *); +GLAPI void APIENTRY glTexCoord2fVertex3fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glTexCoord2fVertex3fvSUN (const GLfloat *, const GLfloat *); +GLAPI void APIENTRY glTexCoord4fVertex4fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glTexCoord4fVertex4fvSUN (const GLfloat *, const GLfloat *); +GLAPI void APIENTRY glTexCoord2fColor4ubVertex3fSUN (GLfloat, GLfloat, GLubyte, GLubyte, GLubyte, GLubyte, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glTexCoord2fColor4ubVertex3fvSUN (const GLfloat *, const GLubyte *, const GLfloat *); +GLAPI void APIENTRY glTexCoord2fColor3fVertex3fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glTexCoord2fColor3fVertex3fvSUN (const GLfloat *, const GLfloat *, const GLfloat *); +GLAPI void APIENTRY glTexCoord2fNormal3fVertex3fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glTexCoord2fNormal3fVertex3fvSUN (const GLfloat *, const GLfloat *, const GLfloat *); +GLAPI void APIENTRY glTexCoord2fColor4fNormal3fVertex3fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glTexCoord2fColor4fNormal3fVertex3fvSUN (const GLfloat *, const GLfloat *, const GLfloat *, const GLfloat *); +GLAPI void APIENTRY glTexCoord4fColor4fNormal3fVertex4fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glTexCoord4fColor4fNormal3fVertex4fvSUN (const GLfloat *, const GLfloat *, const GLfloat *, const GLfloat *); +GLAPI void APIENTRY glReplacementCodeuiVertex3fSUN (GLuint, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glReplacementCodeuiVertex3fvSUN (const GLuint *, const GLfloat *); +GLAPI void APIENTRY glReplacementCodeuiColor4ubVertex3fSUN (GLuint, GLubyte, GLubyte, GLubyte, GLubyte, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glReplacementCodeuiColor4ubVertex3fvSUN (const GLuint *, const GLubyte *, const GLfloat *); +GLAPI void APIENTRY glReplacementCodeuiColor3fVertex3fSUN (GLuint, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glReplacementCodeuiColor3fVertex3fvSUN (const GLuint *, const GLfloat *, const GLfloat *); +GLAPI void APIENTRY glReplacementCodeuiNormal3fVertex3fSUN (GLuint, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glReplacementCodeuiNormal3fVertex3fvSUN (const GLuint *, const GLfloat *, const GLfloat *); +GLAPI void APIENTRY glReplacementCodeuiColor4fNormal3fVertex3fSUN (GLuint, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glReplacementCodeuiColor4fNormal3fVertex3fvSUN (const GLuint *, const GLfloat *, const GLfloat *, const GLfloat *); +GLAPI void APIENTRY glReplacementCodeuiTexCoord2fVertex3fSUN (GLuint, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glReplacementCodeuiTexCoord2fVertex3fvSUN (const GLuint *, const GLfloat *, const GLfloat *); +GLAPI void APIENTRY glReplacementCodeuiTexCoord2fNormal3fVertex3fSUN (GLuint, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN (const GLuint *, const GLfloat *, const GLfloat *, const GLfloat *); +GLAPI void APIENTRY glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN (GLuint, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN (const GLuint *, const GLfloat *, const GLfloat *, const GLfloat *, const GLfloat *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLCOLOR4UBVERTEX2FSUNPROC) (GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y); +typedef void (APIENTRYP PFNGLCOLOR4UBVERTEX2FVSUNPROC) (const GLubyte *c, const GLfloat *v); +typedef void (APIENTRYP PFNGLCOLOR4UBVERTEX3FSUNPROC) (GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLCOLOR4UBVERTEX3FVSUNPROC) (const GLubyte *c, const GLfloat *v); +typedef void (APIENTRYP PFNGLCOLOR3FVERTEX3FSUNPROC) (GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLCOLOR3FVERTEX3FVSUNPROC) (const GLfloat *c, const GLfloat *v); +typedef void (APIENTRYP PFNGLNORMAL3FVERTEX3FSUNPROC) (GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLNORMAL3FVERTEX3FVSUNPROC) (const GLfloat *n, const GLfloat *v); +typedef void (APIENTRYP PFNGLCOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLCOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLfloat *c, const GLfloat *n, const GLfloat *v); +typedef void (APIENTRYP PFNGLTEXCOORD2FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLTEXCOORD2FVERTEX3FVSUNPROC) (const GLfloat *tc, const GLfloat *v); +typedef void (APIENTRYP PFNGLTEXCOORD4FVERTEX4FSUNPROC) (GLfloat s, GLfloat t, GLfloat p, GLfloat q, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (APIENTRYP PFNGLTEXCOORD4FVERTEX4FVSUNPROC) (const GLfloat *tc, const GLfloat *v); +typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR4UBVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR4UBVERTEX3FVSUNPROC) (const GLfloat *tc, const GLubyte *c, const GLfloat *v); +typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR3FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR3FVERTEX3FVSUNPROC) (const GLfloat *tc, const GLfloat *c, const GLfloat *v); +typedef void (APIENTRYP PFNGLTEXCOORD2FNORMAL3FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLTEXCOORD2FNORMAL3FVERTEX3FVSUNPROC) (const GLfloat *tc, const GLfloat *n, const GLfloat *v); +typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLfloat *tc, const GLfloat *c, const GLfloat *n, const GLfloat *v); +typedef void (APIENTRYP PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FSUNPROC) (GLfloat s, GLfloat t, GLfloat p, GLfloat q, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (APIENTRYP PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FVSUNPROC) (const GLfloat *tc, const GLfloat *c, const GLfloat *n, const GLfloat *v); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUIVERTEX3FSUNPROC) (GLuint rc, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUIVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *v); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FSUNPROC) (GLuint rc, GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FVSUNPROC) (const GLuint *rc, const GLubyte *c, const GLfloat *v); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FSUNPROC) (GLuint rc, GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *c, const GLfloat *v); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FSUNPROC) (GLuint rc, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *n, const GLfloat *v); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLuint rc, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *c, const GLfloat *n, const GLfloat *v); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FSUNPROC) (GLuint rc, GLfloat s, GLfloat t, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *tc, const GLfloat *v); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FSUNPROC) (GLuint rc, GLfloat s, GLfloat t, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *tc, const GLfloat *n, const GLfloat *v); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLuint rc, GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *tc, const GLfloat *c, const GLfloat *n, const GLfloat *v); +#endif + +#ifndef GL_EXT_blend_func_separate +#define GL_EXT_blend_func_separate 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBlendFuncSeparateEXT (GLenum, GLenum, GLenum, GLenum); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLBLENDFUNCSEPARATEEXTPROC) (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); +#endif + +#ifndef GL_INGR_blend_func_separate +#define GL_INGR_blend_func_separate 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBlendFuncSeparateINGR (GLenum, GLenum, GLenum, GLenum); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLBLENDFUNCSEPARATEINGRPROC) (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); +#endif + +#ifndef GL_INGR_color_clamp +#define GL_INGR_color_clamp 1 +#endif + +#ifndef GL_INGR_interlace_read +#define GL_INGR_interlace_read 1 +#endif + +#ifndef GL_EXT_stencil_wrap +#define GL_EXT_stencil_wrap 1 +#endif + +#ifndef GL_EXT_422_pixels +#define GL_EXT_422_pixels 1 +#endif + +#ifndef GL_NV_texgen_reflection +#define GL_NV_texgen_reflection 1 +#endif + +#ifndef GL_SUN_convolution_border_modes +#define GL_SUN_convolution_border_modes 1 +#endif + +#ifndef GL_EXT_texture_env_add +#define GL_EXT_texture_env_add 1 +#endif + +#ifndef GL_EXT_texture_lod_bias +#define GL_EXT_texture_lod_bias 1 +#endif + +#ifndef GL_EXT_texture_filter_anisotropic +#define GL_EXT_texture_filter_anisotropic 1 +#endif + +#ifndef GL_EXT_vertex_weighting +#define GL_EXT_vertex_weighting 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glVertexWeightfEXT (GLfloat); +GLAPI void APIENTRY glVertexWeightfvEXT (const GLfloat *); +GLAPI void APIENTRY glVertexWeightPointerEXT (GLsizei, GLenum, GLsizei, const GLvoid *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLVERTEXWEIGHTFEXTPROC) (GLfloat weight); +typedef void (APIENTRYP PFNGLVERTEXWEIGHTFVEXTPROC) (const GLfloat *weight); +typedef void (APIENTRYP PFNGLVERTEXWEIGHTPOINTEREXTPROC) (GLsizei size, GLenum type, GLsizei stride, const GLvoid *pointer); +#endif + +#ifndef GL_NV_light_max_exponent +#define GL_NV_light_max_exponent 1 +#endif + +#ifndef GL_NV_vertex_array_range +#define GL_NV_vertex_array_range 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glFlushVertexArrayRangeNV (void); +GLAPI void APIENTRY glVertexArrayRangeNV (GLsizei, const GLvoid *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLFLUSHVERTEXARRAYRANGENVPROC) (void); +typedef void (APIENTRYP PFNGLVERTEXARRAYRANGENVPROC) (GLsizei length, const GLvoid *pointer); +#endif + +#ifndef GL_NV_register_combiners +#define GL_NV_register_combiners 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glCombinerParameterfvNV (GLenum, const GLfloat *); +GLAPI void APIENTRY glCombinerParameterfNV (GLenum, GLfloat); +GLAPI void APIENTRY glCombinerParameterivNV (GLenum, const GLint *); +GLAPI void APIENTRY glCombinerParameteriNV (GLenum, GLint); +GLAPI void APIENTRY glCombinerInputNV (GLenum, GLenum, GLenum, GLenum, GLenum, GLenum); +GLAPI void APIENTRY glCombinerOutputNV (GLenum, GLenum, GLenum, GLenum, GLenum, GLenum, GLenum, GLboolean, GLboolean, GLboolean); +GLAPI void APIENTRY glFinalCombinerInputNV (GLenum, GLenum, GLenum, GLenum); +GLAPI void APIENTRY glGetCombinerInputParameterfvNV (GLenum, GLenum, GLenum, GLenum, GLfloat *); +GLAPI void APIENTRY glGetCombinerInputParameterivNV (GLenum, GLenum, GLenum, GLenum, GLint *); +GLAPI void APIENTRY glGetCombinerOutputParameterfvNV (GLenum, GLenum, GLenum, GLfloat *); +GLAPI void APIENTRY glGetCombinerOutputParameterivNV (GLenum, GLenum, GLenum, GLint *); +GLAPI void APIENTRY glGetFinalCombinerInputParameterfvNV (GLenum, GLenum, GLfloat *); +GLAPI void APIENTRY glGetFinalCombinerInputParameterivNV (GLenum, GLenum, GLint *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLCOMBINERPARAMETERFVNVPROC) (GLenum pname, const GLfloat *params); +typedef void (APIENTRYP PFNGLCOMBINERPARAMETERFNVPROC) (GLenum pname, GLfloat param); +typedef void (APIENTRYP PFNGLCOMBINERPARAMETERIVNVPROC) (GLenum pname, const GLint *params); +typedef void (APIENTRYP PFNGLCOMBINERPARAMETERINVPROC) (GLenum pname, GLint param); +typedef void (APIENTRYP PFNGLCOMBINERINPUTNVPROC) (GLenum stage, GLenum portion, GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage); +typedef void (APIENTRYP PFNGLCOMBINEROUTPUTNVPROC) (GLenum stage, GLenum portion, GLenum abOutput, GLenum cdOutput, GLenum sumOutput, GLenum scale, GLenum bias, GLboolean abDotProduct, GLboolean cdDotProduct, GLboolean muxSum); +typedef void (APIENTRYP PFNGLFINALCOMBINERINPUTNVPROC) (GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage); +typedef void (APIENTRYP PFNGLGETCOMBINERINPUTPARAMETERFVNVPROC) (GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETCOMBINERINPUTPARAMETERIVNVPROC) (GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETCOMBINEROUTPUTPARAMETERFVNVPROC) (GLenum stage, GLenum portion, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETCOMBINEROUTPUTPARAMETERIVNVPROC) (GLenum stage, GLenum portion, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETFINALCOMBINERINPUTPARAMETERFVNVPROC) (GLenum variable, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETFINALCOMBINERINPUTPARAMETERIVNVPROC) (GLenum variable, GLenum pname, GLint *params); +#endif + +#ifndef GL_NV_fog_distance +#define GL_NV_fog_distance 1 +#endif + +#ifndef GL_NV_texgen_emboss +#define GL_NV_texgen_emboss 1 +#endif + +#ifndef GL_NV_blend_square +#define GL_NV_blend_square 1 +#endif + +#ifndef GL_NV_texture_env_combine4 +#define GL_NV_texture_env_combine4 1 +#endif + +#ifndef GL_MESA_resize_buffers +#define GL_MESA_resize_buffers 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glResizeBuffersMESA (void); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLRESIZEBUFFERSMESAPROC) (void); +#endif + +#ifndef GL_MESA_window_pos +#define GL_MESA_window_pos 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glWindowPos2dMESA (GLdouble, GLdouble); +GLAPI void APIENTRY glWindowPos2dvMESA (const GLdouble *); +GLAPI void APIENTRY glWindowPos2fMESA (GLfloat, GLfloat); +GLAPI void APIENTRY glWindowPos2fvMESA (const GLfloat *); +GLAPI void APIENTRY glWindowPos2iMESA (GLint, GLint); +GLAPI void APIENTRY glWindowPos2ivMESA (const GLint *); +GLAPI void APIENTRY glWindowPos2sMESA (GLshort, GLshort); +GLAPI void APIENTRY glWindowPos2svMESA (const GLshort *); +GLAPI void APIENTRY glWindowPos3dMESA (GLdouble, GLdouble, GLdouble); +GLAPI void APIENTRY glWindowPos3dvMESA (const GLdouble *); +GLAPI void APIENTRY glWindowPos3fMESA (GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glWindowPos3fvMESA (const GLfloat *); +GLAPI void APIENTRY glWindowPos3iMESA (GLint, GLint, GLint); +GLAPI void APIENTRY glWindowPos3ivMESA (const GLint *); +GLAPI void APIENTRY glWindowPos3sMESA (GLshort, GLshort, GLshort); +GLAPI void APIENTRY glWindowPos3svMESA (const GLshort *); +GLAPI void APIENTRY glWindowPos4dMESA (GLdouble, GLdouble, GLdouble, GLdouble); +GLAPI void APIENTRY glWindowPos4dvMESA (const GLdouble *); +GLAPI void APIENTRY glWindowPos4fMESA (GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glWindowPos4fvMESA (const GLfloat *); +GLAPI void APIENTRY glWindowPos4iMESA (GLint, GLint, GLint, GLint); +GLAPI void APIENTRY glWindowPos4ivMESA (const GLint *); +GLAPI void APIENTRY glWindowPos4sMESA (GLshort, GLshort, GLshort, GLshort); +GLAPI void APIENTRY glWindowPos4svMESA (const GLshort *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLWINDOWPOS2DMESAPROC) (GLdouble x, GLdouble y); +typedef void (APIENTRYP PFNGLWINDOWPOS2DVMESAPROC) (const GLdouble *v); +typedef void (APIENTRYP PFNGLWINDOWPOS2FMESAPROC) (GLfloat x, GLfloat y); +typedef void (APIENTRYP PFNGLWINDOWPOS2FVMESAPROC) (const GLfloat *v); +typedef void (APIENTRYP PFNGLWINDOWPOS2IMESAPROC) (GLint x, GLint y); +typedef void (APIENTRYP PFNGLWINDOWPOS2IVMESAPROC) (const GLint *v); +typedef void (APIENTRYP PFNGLWINDOWPOS2SMESAPROC) (GLshort x, GLshort y); +typedef void (APIENTRYP PFNGLWINDOWPOS2SVMESAPROC) (const GLshort *v); +typedef void (APIENTRYP PFNGLWINDOWPOS3DMESAPROC) (GLdouble x, GLdouble y, GLdouble z); +typedef void (APIENTRYP PFNGLWINDOWPOS3DVMESAPROC) (const GLdouble *v); +typedef void (APIENTRYP PFNGLWINDOWPOS3FMESAPROC) (GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLWINDOWPOS3FVMESAPROC) (const GLfloat *v); +typedef void (APIENTRYP PFNGLWINDOWPOS3IMESAPROC) (GLint x, GLint y, GLint z); +typedef void (APIENTRYP PFNGLWINDOWPOS3IVMESAPROC) (const GLint *v); +typedef void (APIENTRYP PFNGLWINDOWPOS3SMESAPROC) (GLshort x, GLshort y, GLshort z); +typedef void (APIENTRYP PFNGLWINDOWPOS3SVMESAPROC) (const GLshort *v); +typedef void (APIENTRYP PFNGLWINDOWPOS4DMESAPROC) (GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (APIENTRYP PFNGLWINDOWPOS4DVMESAPROC) (const GLdouble *v); +typedef void (APIENTRYP PFNGLWINDOWPOS4FMESAPROC) (GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (APIENTRYP PFNGLWINDOWPOS4FVMESAPROC) (const GLfloat *v); +typedef void (APIENTRYP PFNGLWINDOWPOS4IMESAPROC) (GLint x, GLint y, GLint z, GLint w); +typedef void (APIENTRYP PFNGLWINDOWPOS4IVMESAPROC) (const GLint *v); +typedef void (APIENTRYP PFNGLWINDOWPOS4SMESAPROC) (GLshort x, GLshort y, GLshort z, GLshort w); +typedef void (APIENTRYP PFNGLWINDOWPOS4SVMESAPROC) (const GLshort *v); +#endif + +#ifndef GL_IBM_cull_vertex +#define GL_IBM_cull_vertex 1 +#endif + +#ifndef GL_IBM_multimode_draw_arrays +#define GL_IBM_multimode_draw_arrays 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glMultiModeDrawArraysIBM (const GLenum *, const GLint *, const GLsizei *, GLsizei, GLint); +GLAPI void APIENTRY glMultiModeDrawElementsIBM (const GLenum *, const GLsizei *, GLenum, const GLvoid* const *, GLsizei, GLint); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLMULTIMODEDRAWARRAYSIBMPROC) (const GLenum *mode, const GLint *first, const GLsizei *count, GLsizei primcount, GLint modestride); +typedef void (APIENTRYP PFNGLMULTIMODEDRAWELEMENTSIBMPROC) (const GLenum *mode, const GLsizei *count, GLenum type, const GLvoid* const *indices, GLsizei primcount, GLint modestride); +#endif + +#ifndef GL_IBM_vertex_array_lists +#define GL_IBM_vertex_array_lists 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glColorPointerListIBM (GLint, GLenum, GLint, const GLvoid* *, GLint); +GLAPI void APIENTRY glSecondaryColorPointerListIBM (GLint, GLenum, GLint, const GLvoid* *, GLint); +GLAPI void APIENTRY glEdgeFlagPointerListIBM (GLint, const GLboolean* *, GLint); +GLAPI void APIENTRY glFogCoordPointerListIBM (GLenum, GLint, const GLvoid* *, GLint); +GLAPI void APIENTRY glIndexPointerListIBM (GLenum, GLint, const GLvoid* *, GLint); +GLAPI void APIENTRY glNormalPointerListIBM (GLenum, GLint, const GLvoid* *, GLint); +GLAPI void APIENTRY glTexCoordPointerListIBM (GLint, GLenum, GLint, const GLvoid* *, GLint); +GLAPI void APIENTRY glVertexPointerListIBM (GLint, GLenum, GLint, const GLvoid* *, GLint); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLCOLORPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride); +typedef void (APIENTRYP PFNGLSECONDARYCOLORPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride); +typedef void (APIENTRYP PFNGLEDGEFLAGPOINTERLISTIBMPROC) (GLint stride, const GLboolean* *pointer, GLint ptrstride); +typedef void (APIENTRYP PFNGLFOGCOORDPOINTERLISTIBMPROC) (GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride); +typedef void (APIENTRYP PFNGLINDEXPOINTERLISTIBMPROC) (GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride); +typedef void (APIENTRYP PFNGLNORMALPOINTERLISTIBMPROC) (GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride); +typedef void (APIENTRYP PFNGLTEXCOORDPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride); +typedef void (APIENTRYP PFNGLVERTEXPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride); +#endif + +#ifndef GL_SGIX_subsample +#define GL_SGIX_subsample 1 +#endif + +#ifndef GL_SGIX_ycrcba +#define GL_SGIX_ycrcba 1 +#endif + +#ifndef GL_SGIX_ycrcb_subsample +#define GL_SGIX_ycrcb_subsample 1 +#endif + +#ifndef GL_SGIX_depth_pass_instrument +#define GL_SGIX_depth_pass_instrument 1 +#endif + +#ifndef GL_3DFX_texture_compression_FXT1 +#define GL_3DFX_texture_compression_FXT1 1 +#endif + +#ifndef GL_3DFX_multisample +#define GL_3DFX_multisample 1 +#endif + +#ifndef GL_3DFX_tbuffer +#define GL_3DFX_tbuffer 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glTbufferMask3DFX (GLuint); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLTBUFFERMASK3DFXPROC) (GLuint mask); +#endif + +#ifndef GL_EXT_multisample +#define GL_EXT_multisample 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glSampleMaskEXT (GLclampf, GLboolean); +GLAPI void APIENTRY glSamplePatternEXT (GLenum); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLSAMPLEMASKEXTPROC) (GLclampf value, GLboolean invert); +typedef void (APIENTRYP PFNGLSAMPLEPATTERNEXTPROC) (GLenum pattern); +#endif + +#ifndef GL_SGIX_vertex_preclip +#define GL_SGIX_vertex_preclip 1 +#endif + +#ifndef GL_SGIX_convolution_accuracy +#define GL_SGIX_convolution_accuracy 1 +#endif + +#ifndef GL_SGIX_resample +#define GL_SGIX_resample 1 +#endif + +#ifndef GL_SGIS_point_line_texgen +#define GL_SGIS_point_line_texgen 1 +#endif + +#ifndef GL_SGIS_texture_color_mask +#define GL_SGIS_texture_color_mask 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glTextureColorMaskSGIS (GLboolean, GLboolean, GLboolean, GLboolean); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLTEXTURECOLORMASKSGISPROC) (GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha); +#endif + +#ifndef GL_SGIX_igloo_interface +#define GL_SGIX_igloo_interface 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glIglooInterfaceSGIX (GLenum, const GLvoid *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLIGLOOINTERFACESGIXPROC) (GLenum pname, const GLvoid *params); +#endif + +#ifndef GL_EXT_texture_env_dot3 +#define GL_EXT_texture_env_dot3 1 +#endif + +#ifndef GL_ATI_texture_mirror_once +#define GL_ATI_texture_mirror_once 1 +#endif + +#ifndef GL_NV_fence +#define GL_NV_fence 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glDeleteFencesNV (GLsizei, const GLuint *); +GLAPI void APIENTRY glGenFencesNV (GLsizei, GLuint *); +GLAPI GLboolean APIENTRY glIsFenceNV (GLuint); +GLAPI GLboolean APIENTRY glTestFenceNV (GLuint); +GLAPI void APIENTRY glGetFenceivNV (GLuint, GLenum, GLint *); +GLAPI void APIENTRY glFinishFenceNV (GLuint); +GLAPI void APIENTRY glSetFenceNV (GLuint, GLenum); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLDELETEFENCESNVPROC) (GLsizei n, const GLuint *fences); +typedef void (APIENTRYP PFNGLGENFENCESNVPROC) (GLsizei n, GLuint *fences); +typedef GLboolean (APIENTRYP PFNGLISFENCENVPROC) (GLuint fence); +typedef GLboolean (APIENTRYP PFNGLTESTFENCENVPROC) (GLuint fence); +typedef void (APIENTRYP PFNGLGETFENCEIVNVPROC) (GLuint fence, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLFINISHFENCENVPROC) (GLuint fence); +typedef void (APIENTRYP PFNGLSETFENCENVPROC) (GLuint fence, GLenum condition); +#endif + +#ifndef GL_NV_evaluators +#define GL_NV_evaluators 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glMapControlPointsNV (GLenum, GLuint, GLenum, GLsizei, GLsizei, GLint, GLint, GLboolean, const GLvoid *); +GLAPI void APIENTRY glMapParameterivNV (GLenum, GLenum, const GLint *); +GLAPI void APIENTRY glMapParameterfvNV (GLenum, GLenum, const GLfloat *); +GLAPI void APIENTRY glGetMapControlPointsNV (GLenum, GLuint, GLenum, GLsizei, GLsizei, GLboolean, GLvoid *); +GLAPI void APIENTRY glGetMapParameterivNV (GLenum, GLenum, GLint *); +GLAPI void APIENTRY glGetMapParameterfvNV (GLenum, GLenum, GLfloat *); +GLAPI void APIENTRY glGetMapAttribParameterivNV (GLenum, GLuint, GLenum, GLint *); +GLAPI void APIENTRY glGetMapAttribParameterfvNV (GLenum, GLuint, GLenum, GLfloat *); +GLAPI void APIENTRY glEvalMapsNV (GLenum, GLenum); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLMAPCONTROLPOINTSNVPROC) (GLenum target, GLuint index, GLenum type, GLsizei ustride, GLsizei vstride, GLint uorder, GLint vorder, GLboolean packed, const GLvoid *points); +typedef void (APIENTRYP PFNGLMAPPARAMETERIVNVPROC) (GLenum target, GLenum pname, const GLint *params); +typedef void (APIENTRYP PFNGLMAPPARAMETERFVNVPROC) (GLenum target, GLenum pname, const GLfloat *params); +typedef void (APIENTRYP PFNGLGETMAPCONTROLPOINTSNVPROC) (GLenum target, GLuint index, GLenum type, GLsizei ustride, GLsizei vstride, GLboolean packed, GLvoid *points); +typedef void (APIENTRYP PFNGLGETMAPPARAMETERIVNVPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETMAPPARAMETERFVNVPROC) (GLenum target, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETMAPATTRIBPARAMETERIVNVPROC) (GLenum target, GLuint index, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETMAPATTRIBPARAMETERFVNVPROC) (GLenum target, GLuint index, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLEVALMAPSNVPROC) (GLenum target, GLenum mode); +#endif + +#ifndef GL_NV_packed_depth_stencil +#define GL_NV_packed_depth_stencil 1 +#endif + +#ifndef GL_NV_register_combiners2 +#define GL_NV_register_combiners2 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glCombinerStageParameterfvNV (GLenum, GLenum, const GLfloat *); +GLAPI void APIENTRY glGetCombinerStageParameterfvNV (GLenum, GLenum, GLfloat *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLCOMBINERSTAGEPARAMETERFVNVPROC) (GLenum stage, GLenum pname, const GLfloat *params); +typedef void (APIENTRYP PFNGLGETCOMBINERSTAGEPARAMETERFVNVPROC) (GLenum stage, GLenum pname, GLfloat *params); +#endif + +#ifndef GL_NV_texture_compression_vtc +#define GL_NV_texture_compression_vtc 1 +#endif + +#ifndef GL_NV_texture_rectangle +#define GL_NV_texture_rectangle 1 +#endif + +#ifndef GL_NV_texture_shader +#define GL_NV_texture_shader 1 +#endif + +#ifndef GL_NV_texture_shader2 +#define GL_NV_texture_shader2 1 +#endif + +#ifndef GL_NV_vertex_array_range2 +#define GL_NV_vertex_array_range2 1 +#endif + +#ifndef GL_NV_vertex_program +#define GL_NV_vertex_program 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI GLboolean APIENTRY glAreProgramsResidentNV (GLsizei, const GLuint *, GLboolean *); +GLAPI void APIENTRY glBindProgramNV (GLenum, GLuint); +GLAPI void APIENTRY glDeleteProgramsNV (GLsizei, const GLuint *); +GLAPI void APIENTRY glExecuteProgramNV (GLenum, GLuint, const GLfloat *); +GLAPI void APIENTRY glGenProgramsNV (GLsizei, GLuint *); +GLAPI void APIENTRY glGetProgramParameterdvNV (GLenum, GLuint, GLenum, GLdouble *); +GLAPI void APIENTRY glGetProgramParameterfvNV (GLenum, GLuint, GLenum, GLfloat *); +GLAPI void APIENTRY glGetProgramivNV (GLuint, GLenum, GLint *); +GLAPI void APIENTRY glGetProgramStringNV (GLuint, GLenum, GLubyte *); +GLAPI void APIENTRY glGetTrackMatrixivNV (GLenum, GLuint, GLenum, GLint *); +GLAPI void APIENTRY glGetVertexAttribdvNV (GLuint, GLenum, GLdouble *); +GLAPI void APIENTRY glGetVertexAttribfvNV (GLuint, GLenum, GLfloat *); +GLAPI void APIENTRY glGetVertexAttribivNV (GLuint, GLenum, GLint *); +GLAPI void APIENTRY glGetVertexAttribPointervNV (GLuint, GLenum, GLvoid* *); +GLAPI GLboolean APIENTRY glIsProgramNV (GLuint); +GLAPI void APIENTRY glLoadProgramNV (GLenum, GLuint, GLsizei, const GLubyte *); +GLAPI void APIENTRY glProgramParameter4dNV (GLenum, GLuint, GLdouble, GLdouble, GLdouble, GLdouble); +GLAPI void APIENTRY glProgramParameter4dvNV (GLenum, GLuint, const GLdouble *); +GLAPI void APIENTRY glProgramParameter4fNV (GLenum, GLuint, GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glProgramParameter4fvNV (GLenum, GLuint, const GLfloat *); +GLAPI void APIENTRY glProgramParameters4dvNV (GLenum, GLuint, GLuint, const GLdouble *); +GLAPI void APIENTRY glProgramParameters4fvNV (GLenum, GLuint, GLuint, const GLfloat *); +GLAPI void APIENTRY glRequestResidentProgramsNV (GLsizei, const GLuint *); +GLAPI void APIENTRY glTrackMatrixNV (GLenum, GLuint, GLenum, GLenum); +GLAPI void APIENTRY glVertexAttribPointerNV (GLuint, GLint, GLenum, GLsizei, const GLvoid *); +GLAPI void APIENTRY glVertexAttrib1dNV (GLuint, GLdouble); +GLAPI void APIENTRY glVertexAttrib1dvNV (GLuint, const GLdouble *); +GLAPI void APIENTRY glVertexAttrib1fNV (GLuint, GLfloat); +GLAPI void APIENTRY glVertexAttrib1fvNV (GLuint, const GLfloat *); +GLAPI void APIENTRY glVertexAttrib1sNV (GLuint, GLshort); +GLAPI void APIENTRY glVertexAttrib1svNV (GLuint, const GLshort *); +GLAPI void APIENTRY glVertexAttrib2dNV (GLuint, GLdouble, GLdouble); +GLAPI void APIENTRY glVertexAttrib2dvNV (GLuint, const GLdouble *); +GLAPI void APIENTRY glVertexAttrib2fNV (GLuint, GLfloat, GLfloat); +GLAPI void APIENTRY glVertexAttrib2fvNV (GLuint, const GLfloat *); +GLAPI void APIENTRY glVertexAttrib2sNV (GLuint, GLshort, GLshort); +GLAPI void APIENTRY glVertexAttrib2svNV (GLuint, const GLshort *); +GLAPI void APIENTRY glVertexAttrib3dNV (GLuint, GLdouble, GLdouble, GLdouble); +GLAPI void APIENTRY glVertexAttrib3dvNV (GLuint, const GLdouble *); +GLAPI void APIENTRY glVertexAttrib3fNV (GLuint, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glVertexAttrib3fvNV (GLuint, const GLfloat *); +GLAPI void APIENTRY glVertexAttrib3sNV (GLuint, GLshort, GLshort, GLshort); +GLAPI void APIENTRY glVertexAttrib3svNV (GLuint, const GLshort *); +GLAPI void APIENTRY glVertexAttrib4dNV (GLuint, GLdouble, GLdouble, GLdouble, GLdouble); +GLAPI void APIENTRY glVertexAttrib4dvNV (GLuint, const GLdouble *); +GLAPI void APIENTRY glVertexAttrib4fNV (GLuint, GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glVertexAttrib4fvNV (GLuint, const GLfloat *); +GLAPI void APIENTRY glVertexAttrib4sNV (GLuint, GLshort, GLshort, GLshort, GLshort); +GLAPI void APIENTRY glVertexAttrib4svNV (GLuint, const GLshort *); +GLAPI void APIENTRY glVertexAttrib4ubNV (GLuint, GLubyte, GLubyte, GLubyte, GLubyte); +GLAPI void APIENTRY glVertexAttrib4ubvNV (GLuint, const GLubyte *); +GLAPI void APIENTRY glVertexAttribs1dvNV (GLuint, GLsizei, const GLdouble *); +GLAPI void APIENTRY glVertexAttribs1fvNV (GLuint, GLsizei, const GLfloat *); +GLAPI void APIENTRY glVertexAttribs1svNV (GLuint, GLsizei, const GLshort *); +GLAPI void APIENTRY glVertexAttribs2dvNV (GLuint, GLsizei, const GLdouble *); +GLAPI void APIENTRY glVertexAttribs2fvNV (GLuint, GLsizei, const GLfloat *); +GLAPI void APIENTRY glVertexAttribs2svNV (GLuint, GLsizei, const GLshort *); +GLAPI void APIENTRY glVertexAttribs3dvNV (GLuint, GLsizei, const GLdouble *); +GLAPI void APIENTRY glVertexAttribs3fvNV (GLuint, GLsizei, const GLfloat *); +GLAPI void APIENTRY glVertexAttribs3svNV (GLuint, GLsizei, const GLshort *); +GLAPI void APIENTRY glVertexAttribs4dvNV (GLuint, GLsizei, const GLdouble *); +GLAPI void APIENTRY glVertexAttribs4fvNV (GLuint, GLsizei, const GLfloat *); +GLAPI void APIENTRY glVertexAttribs4svNV (GLuint, GLsizei, const GLshort *); +GLAPI void APIENTRY glVertexAttribs4ubvNV (GLuint, GLsizei, const GLubyte *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef GLboolean (APIENTRYP PFNGLAREPROGRAMSRESIDENTNVPROC) (GLsizei n, const GLuint *programs, GLboolean *residences); +typedef void (APIENTRYP PFNGLBINDPROGRAMNVPROC) (GLenum target, GLuint id); +typedef void (APIENTRYP PFNGLDELETEPROGRAMSNVPROC) (GLsizei n, const GLuint *programs); +typedef void (APIENTRYP PFNGLEXECUTEPROGRAMNVPROC) (GLenum target, GLuint id, const GLfloat *params); +typedef void (APIENTRYP PFNGLGENPROGRAMSNVPROC) (GLsizei n, GLuint *programs); +typedef void (APIENTRYP PFNGLGETPROGRAMPARAMETERDVNVPROC) (GLenum target, GLuint index, GLenum pname, GLdouble *params); +typedef void (APIENTRYP PFNGLGETPROGRAMPARAMETERFVNVPROC) (GLenum target, GLuint index, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETPROGRAMIVNVPROC) (GLuint id, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETPROGRAMSTRINGNVPROC) (GLuint id, GLenum pname, GLubyte *program); +typedef void (APIENTRYP PFNGLGETTRACKMATRIXIVNVPROC) (GLenum target, GLuint address, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBDVNVPROC) (GLuint index, GLenum pname, GLdouble *params); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBFVNVPROC) (GLuint index, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIVNVPROC) (GLuint index, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBPOINTERVNVPROC) (GLuint index, GLenum pname, GLvoid* *pointer); +typedef GLboolean (APIENTRYP PFNGLISPROGRAMNVPROC) (GLuint id); +typedef void (APIENTRYP PFNGLLOADPROGRAMNVPROC) (GLenum target, GLuint id, GLsizei len, const GLubyte *program); +typedef void (APIENTRYP PFNGLPROGRAMPARAMETER4DNVPROC) (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (APIENTRYP PFNGLPROGRAMPARAMETER4DVNVPROC) (GLenum target, GLuint index, const GLdouble *v); +typedef void (APIENTRYP PFNGLPROGRAMPARAMETER4FNVPROC) (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (APIENTRYP PFNGLPROGRAMPARAMETER4FVNVPROC) (GLenum target, GLuint index, const GLfloat *v); +typedef void (APIENTRYP PFNGLPROGRAMPARAMETERS4DVNVPROC) (GLenum target, GLuint index, GLuint count, const GLdouble *v); +typedef void (APIENTRYP PFNGLPROGRAMPARAMETERS4FVNVPROC) (GLenum target, GLuint index, GLuint count, const GLfloat *v); +typedef void (APIENTRYP PFNGLREQUESTRESIDENTPROGRAMSNVPROC) (GLsizei n, const GLuint *programs); +typedef void (APIENTRYP PFNGLTRACKMATRIXNVPROC) (GLenum target, GLuint address, GLenum matrix, GLenum transform); +typedef void (APIENTRYP PFNGLVERTEXATTRIBPOINTERNVPROC) (GLuint index, GLint fsize, GLenum type, GLsizei stride, const GLvoid *pointer); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1DNVPROC) (GLuint index, GLdouble x); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1DVNVPROC) (GLuint index, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1FNVPROC) (GLuint index, GLfloat x); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1FVNVPROC) (GLuint index, const GLfloat *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1SNVPROC) (GLuint index, GLshort x); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1SVNVPROC) (GLuint index, const GLshort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2DNVPROC) (GLuint index, GLdouble x, GLdouble y); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2DVNVPROC) (GLuint index, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2FNVPROC) (GLuint index, GLfloat x, GLfloat y); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2FVNVPROC) (GLuint index, const GLfloat *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2SNVPROC) (GLuint index, GLshort x, GLshort y); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2SVNVPROC) (GLuint index, const GLshort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3DNVPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3DVNVPROC) (GLuint index, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3FNVPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3FVNVPROC) (GLuint index, const GLfloat *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3SNVPROC) (GLuint index, GLshort x, GLshort y, GLshort z); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3SVNVPROC) (GLuint index, const GLshort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4DNVPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4DVNVPROC) (GLuint index, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4FNVPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4FVNVPROC) (GLuint index, const GLfloat *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4SNVPROC) (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4SVNVPROC) (GLuint index, const GLshort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4UBNVPROC) (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4UBVNVPROC) (GLuint index, const GLubyte *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBS1DVNVPROC) (GLuint index, GLsizei count, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBS1FVNVPROC) (GLuint index, GLsizei count, const GLfloat *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBS1SVNVPROC) (GLuint index, GLsizei count, const GLshort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBS2DVNVPROC) (GLuint index, GLsizei count, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBS2FVNVPROC) (GLuint index, GLsizei count, const GLfloat *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBS2SVNVPROC) (GLuint index, GLsizei count, const GLshort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBS3DVNVPROC) (GLuint index, GLsizei count, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBS3FVNVPROC) (GLuint index, GLsizei count, const GLfloat *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBS3SVNVPROC) (GLuint index, GLsizei count, const GLshort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBS4DVNVPROC) (GLuint index, GLsizei count, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBS4FVNVPROC) (GLuint index, GLsizei count, const GLfloat *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBS4SVNVPROC) (GLuint index, GLsizei count, const GLshort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBS4UBVNVPROC) (GLuint index, GLsizei count, const GLubyte *v); +#endif + +#ifndef GL_SGIX_texture_coordinate_clamp +#define GL_SGIX_texture_coordinate_clamp 1 +#endif + +#ifndef GL_SGIX_scalebias_hint +#define GL_SGIX_scalebias_hint 1 +#endif + +#ifndef GL_OML_interlace +#define GL_OML_interlace 1 +#endif + +#ifndef GL_OML_subsample +#define GL_OML_subsample 1 +#endif + +#ifndef GL_OML_resample +#define GL_OML_resample 1 +#endif + +#ifndef GL_NV_copy_depth_to_color +#define GL_NV_copy_depth_to_color 1 +#endif + +#ifndef GL_ATI_envmap_bumpmap +#define GL_ATI_envmap_bumpmap 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glTexBumpParameterivATI (GLenum, const GLint *); +GLAPI void APIENTRY glTexBumpParameterfvATI (GLenum, const GLfloat *); +GLAPI void APIENTRY glGetTexBumpParameterivATI (GLenum, GLint *); +GLAPI void APIENTRY glGetTexBumpParameterfvATI (GLenum, GLfloat *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLTEXBUMPPARAMETERIVATIPROC) (GLenum pname, const GLint *param); +typedef void (APIENTRYP PFNGLTEXBUMPPARAMETERFVATIPROC) (GLenum pname, const GLfloat *param); +typedef void (APIENTRYP PFNGLGETTEXBUMPPARAMETERIVATIPROC) (GLenum pname, GLint *param); +typedef void (APIENTRYP PFNGLGETTEXBUMPPARAMETERFVATIPROC) (GLenum pname, GLfloat *param); +#endif + +#ifndef GL_ATI_fragment_shader +#define GL_ATI_fragment_shader 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI GLuint APIENTRY glGenFragmentShadersATI (GLuint); +GLAPI void APIENTRY glBindFragmentShaderATI (GLuint); +GLAPI void APIENTRY glDeleteFragmentShaderATI (GLuint); +GLAPI void APIENTRY glBeginFragmentShaderATI (void); +GLAPI void APIENTRY glEndFragmentShaderATI (void); +GLAPI void APIENTRY glPassTexCoordATI (GLuint, GLuint, GLenum); +GLAPI void APIENTRY glSampleMapATI (GLuint, GLuint, GLenum); +GLAPI void APIENTRY glColorFragmentOp1ATI (GLenum, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint); +GLAPI void APIENTRY glColorFragmentOp2ATI (GLenum, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint); +GLAPI void APIENTRY glColorFragmentOp3ATI (GLenum, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint); +GLAPI void APIENTRY glAlphaFragmentOp1ATI (GLenum, GLuint, GLuint, GLuint, GLuint, GLuint); +GLAPI void APIENTRY glAlphaFragmentOp2ATI (GLenum, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint); +GLAPI void APIENTRY glAlphaFragmentOp3ATI (GLenum, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint); +GLAPI void APIENTRY glSetFragmentShaderConstantATI (GLuint, const GLfloat *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef GLuint (APIENTRYP PFNGLGENFRAGMENTSHADERSATIPROC) (GLuint range); +typedef void (APIENTRYP PFNGLBINDFRAGMENTSHADERATIPROC) (GLuint id); +typedef void (APIENTRYP PFNGLDELETEFRAGMENTSHADERATIPROC) (GLuint id); +typedef void (APIENTRYP PFNGLBEGINFRAGMENTSHADERATIPROC) (void); +typedef void (APIENTRYP PFNGLENDFRAGMENTSHADERATIPROC) (void); +typedef void (APIENTRYP PFNGLPASSTEXCOORDATIPROC) (GLuint dst, GLuint coord, GLenum swizzle); +typedef void (APIENTRYP PFNGLSAMPLEMAPATIPROC) (GLuint dst, GLuint interp, GLenum swizzle); +typedef void (APIENTRYP PFNGLCOLORFRAGMENTOP1ATIPROC) (GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod); +typedef void (APIENTRYP PFNGLCOLORFRAGMENTOP2ATIPROC) (GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod); +typedef void (APIENTRYP PFNGLCOLORFRAGMENTOP3ATIPROC) (GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, GLuint arg3Rep, GLuint arg3Mod); +typedef void (APIENTRYP PFNGLALPHAFRAGMENTOP1ATIPROC) (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod); +typedef void (APIENTRYP PFNGLALPHAFRAGMENTOP2ATIPROC) (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod); +typedef void (APIENTRYP PFNGLALPHAFRAGMENTOP3ATIPROC) (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, GLuint arg3Rep, GLuint arg3Mod); +typedef void (APIENTRYP PFNGLSETFRAGMENTSHADERCONSTANTATIPROC) (GLuint dst, const GLfloat *value); +#endif + +#ifndef GL_ATI_pn_triangles +#define GL_ATI_pn_triangles 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glPNTrianglesiATI (GLenum, GLint); +GLAPI void APIENTRY glPNTrianglesfATI (GLenum, GLfloat); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLPNTRIANGLESIATIPROC) (GLenum pname, GLint param); +typedef void (APIENTRYP PFNGLPNTRIANGLESFATIPROC) (GLenum pname, GLfloat param); +#endif + +#ifndef GL_ATI_vertex_array_object +#define GL_ATI_vertex_array_object 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI GLuint APIENTRY glNewObjectBufferATI (GLsizei, const GLvoid *, GLenum); +GLAPI GLboolean APIENTRY glIsObjectBufferATI (GLuint); +GLAPI void APIENTRY glUpdateObjectBufferATI (GLuint, GLuint, GLsizei, const GLvoid *, GLenum); +GLAPI void APIENTRY glGetObjectBufferfvATI (GLuint, GLenum, GLfloat *); +GLAPI void APIENTRY glGetObjectBufferivATI (GLuint, GLenum, GLint *); +GLAPI void APIENTRY glFreeObjectBufferATI (GLuint); +GLAPI void APIENTRY glArrayObjectATI (GLenum, GLint, GLenum, GLsizei, GLuint, GLuint); +GLAPI void APIENTRY glGetArrayObjectfvATI (GLenum, GLenum, GLfloat *); +GLAPI void APIENTRY glGetArrayObjectivATI (GLenum, GLenum, GLint *); +GLAPI void APIENTRY glVariantArrayObjectATI (GLuint, GLenum, GLsizei, GLuint, GLuint); +GLAPI void APIENTRY glGetVariantArrayObjectfvATI (GLuint, GLenum, GLfloat *); +GLAPI void APIENTRY glGetVariantArrayObjectivATI (GLuint, GLenum, GLint *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef GLuint (APIENTRYP PFNGLNEWOBJECTBUFFERATIPROC) (GLsizei size, const GLvoid *pointer, GLenum usage); +typedef GLboolean (APIENTRYP PFNGLISOBJECTBUFFERATIPROC) (GLuint buffer); +typedef void (APIENTRYP PFNGLUPDATEOBJECTBUFFERATIPROC) (GLuint buffer, GLuint offset, GLsizei size, const GLvoid *pointer, GLenum preserve); +typedef void (APIENTRYP PFNGLGETOBJECTBUFFERFVATIPROC) (GLuint buffer, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETOBJECTBUFFERIVATIPROC) (GLuint buffer, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLFREEOBJECTBUFFERATIPROC) (GLuint buffer); +typedef void (APIENTRYP PFNGLARRAYOBJECTATIPROC) (GLenum array, GLint size, GLenum type, GLsizei stride, GLuint buffer, GLuint offset); +typedef void (APIENTRYP PFNGLGETARRAYOBJECTFVATIPROC) (GLenum array, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETARRAYOBJECTIVATIPROC) (GLenum array, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLVARIANTARRAYOBJECTATIPROC) (GLuint id, GLenum type, GLsizei stride, GLuint buffer, GLuint offset); +typedef void (APIENTRYP PFNGLGETVARIANTARRAYOBJECTFVATIPROC) (GLuint id, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETVARIANTARRAYOBJECTIVATIPROC) (GLuint id, GLenum pname, GLint *params); +#endif + +#ifndef GL_EXT_vertex_shader +#define GL_EXT_vertex_shader 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBeginVertexShaderEXT (void); +GLAPI void APIENTRY glEndVertexShaderEXT (void); +GLAPI void APIENTRY glBindVertexShaderEXT (GLuint); +GLAPI GLuint APIENTRY glGenVertexShadersEXT (GLuint); +GLAPI void APIENTRY glDeleteVertexShaderEXT (GLuint); +GLAPI void APIENTRY glShaderOp1EXT (GLenum, GLuint, GLuint); +GLAPI void APIENTRY glShaderOp2EXT (GLenum, GLuint, GLuint, GLuint); +GLAPI void APIENTRY glShaderOp3EXT (GLenum, GLuint, GLuint, GLuint, GLuint); +GLAPI void APIENTRY glSwizzleEXT (GLuint, GLuint, GLenum, GLenum, GLenum, GLenum); +GLAPI void APIENTRY glWriteMaskEXT (GLuint, GLuint, GLenum, GLenum, GLenum, GLenum); +GLAPI void APIENTRY glInsertComponentEXT (GLuint, GLuint, GLuint); +GLAPI void APIENTRY glExtractComponentEXT (GLuint, GLuint, GLuint); +GLAPI GLuint APIENTRY glGenSymbolsEXT (GLenum, GLenum, GLenum, GLuint); +GLAPI void APIENTRY glSetInvariantEXT (GLuint, GLenum, const GLvoid *); +GLAPI void APIENTRY glSetLocalConstantEXT (GLuint, GLenum, const GLvoid *); +GLAPI void APIENTRY glVariantbvEXT (GLuint, const GLbyte *); +GLAPI void APIENTRY glVariantsvEXT (GLuint, const GLshort *); +GLAPI void APIENTRY glVariantivEXT (GLuint, const GLint *); +GLAPI void APIENTRY glVariantfvEXT (GLuint, const GLfloat *); +GLAPI void APIENTRY glVariantdvEXT (GLuint, const GLdouble *); +GLAPI void APIENTRY glVariantubvEXT (GLuint, const GLubyte *); +GLAPI void APIENTRY glVariantusvEXT (GLuint, const GLushort *); +GLAPI void APIENTRY glVariantuivEXT (GLuint, const GLuint *); +GLAPI void APIENTRY glVariantPointerEXT (GLuint, GLenum, GLuint, const GLvoid *); +GLAPI void APIENTRY glEnableVariantClientStateEXT (GLuint); +GLAPI void APIENTRY glDisableVariantClientStateEXT (GLuint); +GLAPI GLuint APIENTRY glBindLightParameterEXT (GLenum, GLenum); +GLAPI GLuint APIENTRY glBindMaterialParameterEXT (GLenum, GLenum); +GLAPI GLuint APIENTRY glBindTexGenParameterEXT (GLenum, GLenum, GLenum); +GLAPI GLuint APIENTRY glBindTextureUnitParameterEXT (GLenum, GLenum); +GLAPI GLuint APIENTRY glBindParameterEXT (GLenum); +GLAPI GLboolean APIENTRY glIsVariantEnabledEXT (GLuint, GLenum); +GLAPI void APIENTRY glGetVariantBooleanvEXT (GLuint, GLenum, GLboolean *); +GLAPI void APIENTRY glGetVariantIntegervEXT (GLuint, GLenum, GLint *); +GLAPI void APIENTRY glGetVariantFloatvEXT (GLuint, GLenum, GLfloat *); +GLAPI void APIENTRY glGetVariantPointervEXT (GLuint, GLenum, GLvoid* *); +GLAPI void APIENTRY glGetInvariantBooleanvEXT (GLuint, GLenum, GLboolean *); +GLAPI void APIENTRY glGetInvariantIntegervEXT (GLuint, GLenum, GLint *); +GLAPI void APIENTRY glGetInvariantFloatvEXT (GLuint, GLenum, GLfloat *); +GLAPI void APIENTRY glGetLocalConstantBooleanvEXT (GLuint, GLenum, GLboolean *); +GLAPI void APIENTRY glGetLocalConstantIntegervEXT (GLuint, GLenum, GLint *); +GLAPI void APIENTRY glGetLocalConstantFloatvEXT (GLuint, GLenum, GLfloat *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLBEGINVERTEXSHADEREXTPROC) (void); +typedef void (APIENTRYP PFNGLENDVERTEXSHADEREXTPROC) (void); +typedef void (APIENTRYP PFNGLBINDVERTEXSHADEREXTPROC) (GLuint id); +typedef GLuint (APIENTRYP PFNGLGENVERTEXSHADERSEXTPROC) (GLuint range); +typedef void (APIENTRYP PFNGLDELETEVERTEXSHADEREXTPROC) (GLuint id); +typedef void (APIENTRYP PFNGLSHADEROP1EXTPROC) (GLenum op, GLuint res, GLuint arg1); +typedef void (APIENTRYP PFNGLSHADEROP2EXTPROC) (GLenum op, GLuint res, GLuint arg1, GLuint arg2); +typedef void (APIENTRYP PFNGLSHADEROP3EXTPROC) (GLenum op, GLuint res, GLuint arg1, GLuint arg2, GLuint arg3); +typedef void (APIENTRYP PFNGLSWIZZLEEXTPROC) (GLuint res, GLuint in, GLenum outX, GLenum outY, GLenum outZ, GLenum outW); +typedef void (APIENTRYP PFNGLWRITEMASKEXTPROC) (GLuint res, GLuint in, GLenum outX, GLenum outY, GLenum outZ, GLenum outW); +typedef void (APIENTRYP PFNGLINSERTCOMPONENTEXTPROC) (GLuint res, GLuint src, GLuint num); +typedef void (APIENTRYP PFNGLEXTRACTCOMPONENTEXTPROC) (GLuint res, GLuint src, GLuint num); +typedef GLuint (APIENTRYP PFNGLGENSYMBOLSEXTPROC) (GLenum datatype, GLenum storagetype, GLenum range, GLuint components); +typedef void (APIENTRYP PFNGLSETINVARIANTEXTPROC) (GLuint id, GLenum type, const GLvoid *addr); +typedef void (APIENTRYP PFNGLSETLOCALCONSTANTEXTPROC) (GLuint id, GLenum type, const GLvoid *addr); +typedef void (APIENTRYP PFNGLVARIANTBVEXTPROC) (GLuint id, const GLbyte *addr); +typedef void (APIENTRYP PFNGLVARIANTSVEXTPROC) (GLuint id, const GLshort *addr); +typedef void (APIENTRYP PFNGLVARIANTIVEXTPROC) (GLuint id, const GLint *addr); +typedef void (APIENTRYP PFNGLVARIANTFVEXTPROC) (GLuint id, const GLfloat *addr); +typedef void (APIENTRYP PFNGLVARIANTDVEXTPROC) (GLuint id, const GLdouble *addr); +typedef void (APIENTRYP PFNGLVARIANTUBVEXTPROC) (GLuint id, const GLubyte *addr); +typedef void (APIENTRYP PFNGLVARIANTUSVEXTPROC) (GLuint id, const GLushort *addr); +typedef void (APIENTRYP PFNGLVARIANTUIVEXTPROC) (GLuint id, const GLuint *addr); +typedef void (APIENTRYP PFNGLVARIANTPOINTEREXTPROC) (GLuint id, GLenum type, GLuint stride, const GLvoid *addr); +typedef void (APIENTRYP PFNGLENABLEVARIANTCLIENTSTATEEXTPROC) (GLuint id); +typedef void (APIENTRYP PFNGLDISABLEVARIANTCLIENTSTATEEXTPROC) (GLuint id); +typedef GLuint (APIENTRYP PFNGLBINDLIGHTPARAMETEREXTPROC) (GLenum light, GLenum value); +typedef GLuint (APIENTRYP PFNGLBINDMATERIALPARAMETEREXTPROC) (GLenum face, GLenum value); +typedef GLuint (APIENTRYP PFNGLBINDTEXGENPARAMETEREXTPROC) (GLenum unit, GLenum coord, GLenum value); +typedef GLuint (APIENTRYP PFNGLBINDTEXTUREUNITPARAMETEREXTPROC) (GLenum unit, GLenum value); +typedef GLuint (APIENTRYP PFNGLBINDPARAMETEREXTPROC) (GLenum value); +typedef GLboolean (APIENTRYP PFNGLISVARIANTENABLEDEXTPROC) (GLuint id, GLenum cap); +typedef void (APIENTRYP PFNGLGETVARIANTBOOLEANVEXTPROC) (GLuint id, GLenum value, GLboolean *data); +typedef void (APIENTRYP PFNGLGETVARIANTINTEGERVEXTPROC) (GLuint id, GLenum value, GLint *data); +typedef void (APIENTRYP PFNGLGETVARIANTFLOATVEXTPROC) (GLuint id, GLenum value, GLfloat *data); +typedef void (APIENTRYP PFNGLGETVARIANTPOINTERVEXTPROC) (GLuint id, GLenum value, GLvoid* *data); +typedef void (APIENTRYP PFNGLGETINVARIANTBOOLEANVEXTPROC) (GLuint id, GLenum value, GLboolean *data); +typedef void (APIENTRYP PFNGLGETINVARIANTINTEGERVEXTPROC) (GLuint id, GLenum value, GLint *data); +typedef void (APIENTRYP PFNGLGETINVARIANTFLOATVEXTPROC) (GLuint id, GLenum value, GLfloat *data); +typedef void (APIENTRYP PFNGLGETLOCALCONSTANTBOOLEANVEXTPROC) (GLuint id, GLenum value, GLboolean *data); +typedef void (APIENTRYP PFNGLGETLOCALCONSTANTINTEGERVEXTPROC) (GLuint id, GLenum value, GLint *data); +typedef void (APIENTRYP PFNGLGETLOCALCONSTANTFLOATVEXTPROC) (GLuint id, GLenum value, GLfloat *data); +#endif + +#ifndef GL_ATI_vertex_streams +#define GL_ATI_vertex_streams 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glVertexStream1sATI (GLenum, GLshort); +GLAPI void APIENTRY glVertexStream1svATI (GLenum, const GLshort *); +GLAPI void APIENTRY glVertexStream1iATI (GLenum, GLint); +GLAPI void APIENTRY glVertexStream1ivATI (GLenum, const GLint *); +GLAPI void APIENTRY glVertexStream1fATI (GLenum, GLfloat); +GLAPI void APIENTRY glVertexStream1fvATI (GLenum, const GLfloat *); +GLAPI void APIENTRY glVertexStream1dATI (GLenum, GLdouble); +GLAPI void APIENTRY glVertexStream1dvATI (GLenum, const GLdouble *); +GLAPI void APIENTRY glVertexStream2sATI (GLenum, GLshort, GLshort); +GLAPI void APIENTRY glVertexStream2svATI (GLenum, const GLshort *); +GLAPI void APIENTRY glVertexStream2iATI (GLenum, GLint, GLint); +GLAPI void APIENTRY glVertexStream2ivATI (GLenum, const GLint *); +GLAPI void APIENTRY glVertexStream2fATI (GLenum, GLfloat, GLfloat); +GLAPI void APIENTRY glVertexStream2fvATI (GLenum, const GLfloat *); +GLAPI void APIENTRY glVertexStream2dATI (GLenum, GLdouble, GLdouble); +GLAPI void APIENTRY glVertexStream2dvATI (GLenum, const GLdouble *); +GLAPI void APIENTRY glVertexStream3sATI (GLenum, GLshort, GLshort, GLshort); +GLAPI void APIENTRY glVertexStream3svATI (GLenum, const GLshort *); +GLAPI void APIENTRY glVertexStream3iATI (GLenum, GLint, GLint, GLint); +GLAPI void APIENTRY glVertexStream3ivATI (GLenum, const GLint *); +GLAPI void APIENTRY glVertexStream3fATI (GLenum, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glVertexStream3fvATI (GLenum, const GLfloat *); +GLAPI void APIENTRY glVertexStream3dATI (GLenum, GLdouble, GLdouble, GLdouble); +GLAPI void APIENTRY glVertexStream3dvATI (GLenum, const GLdouble *); +GLAPI void APIENTRY glVertexStream4sATI (GLenum, GLshort, GLshort, GLshort, GLshort); +GLAPI void APIENTRY glVertexStream4svATI (GLenum, const GLshort *); +GLAPI void APIENTRY glVertexStream4iATI (GLenum, GLint, GLint, GLint, GLint); +GLAPI void APIENTRY glVertexStream4ivATI (GLenum, const GLint *); +GLAPI void APIENTRY glVertexStream4fATI (GLenum, GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glVertexStream4fvATI (GLenum, const GLfloat *); +GLAPI void APIENTRY glVertexStream4dATI (GLenum, GLdouble, GLdouble, GLdouble, GLdouble); +GLAPI void APIENTRY glVertexStream4dvATI (GLenum, const GLdouble *); +GLAPI void APIENTRY glNormalStream3bATI (GLenum, GLbyte, GLbyte, GLbyte); +GLAPI void APIENTRY glNormalStream3bvATI (GLenum, const GLbyte *); +GLAPI void APIENTRY glNormalStream3sATI (GLenum, GLshort, GLshort, GLshort); +GLAPI void APIENTRY glNormalStream3svATI (GLenum, const GLshort *); +GLAPI void APIENTRY glNormalStream3iATI (GLenum, GLint, GLint, GLint); +GLAPI void APIENTRY glNormalStream3ivATI (GLenum, const GLint *); +GLAPI void APIENTRY glNormalStream3fATI (GLenum, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glNormalStream3fvATI (GLenum, const GLfloat *); +GLAPI void APIENTRY glNormalStream3dATI (GLenum, GLdouble, GLdouble, GLdouble); +GLAPI void APIENTRY glNormalStream3dvATI (GLenum, const GLdouble *); +GLAPI void APIENTRY glClientActiveVertexStreamATI (GLenum); +GLAPI void APIENTRY glVertexBlendEnviATI (GLenum, GLint); +GLAPI void APIENTRY glVertexBlendEnvfATI (GLenum, GLfloat); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLVERTEXSTREAM1SATIPROC) (GLenum stream, GLshort x); +typedef void (APIENTRYP PFNGLVERTEXSTREAM1SVATIPROC) (GLenum stream, const GLshort *coords); +typedef void (APIENTRYP PFNGLVERTEXSTREAM1IATIPROC) (GLenum stream, GLint x); +typedef void (APIENTRYP PFNGLVERTEXSTREAM1IVATIPROC) (GLenum stream, const GLint *coords); +typedef void (APIENTRYP PFNGLVERTEXSTREAM1FATIPROC) (GLenum stream, GLfloat x); +typedef void (APIENTRYP PFNGLVERTEXSTREAM1FVATIPROC) (GLenum stream, const GLfloat *coords); +typedef void (APIENTRYP PFNGLVERTEXSTREAM1DATIPROC) (GLenum stream, GLdouble x); +typedef void (APIENTRYP PFNGLVERTEXSTREAM1DVATIPROC) (GLenum stream, const GLdouble *coords); +typedef void (APIENTRYP PFNGLVERTEXSTREAM2SATIPROC) (GLenum stream, GLshort x, GLshort y); +typedef void (APIENTRYP PFNGLVERTEXSTREAM2SVATIPROC) (GLenum stream, const GLshort *coords); +typedef void (APIENTRYP PFNGLVERTEXSTREAM2IATIPROC) (GLenum stream, GLint x, GLint y); +typedef void (APIENTRYP PFNGLVERTEXSTREAM2IVATIPROC) (GLenum stream, const GLint *coords); +typedef void (APIENTRYP PFNGLVERTEXSTREAM2FATIPROC) (GLenum stream, GLfloat x, GLfloat y); +typedef void (APIENTRYP PFNGLVERTEXSTREAM2FVATIPROC) (GLenum stream, const GLfloat *coords); +typedef void (APIENTRYP PFNGLVERTEXSTREAM2DATIPROC) (GLenum stream, GLdouble x, GLdouble y); +typedef void (APIENTRYP PFNGLVERTEXSTREAM2DVATIPROC) (GLenum stream, const GLdouble *coords); +typedef void (APIENTRYP PFNGLVERTEXSTREAM3SATIPROC) (GLenum stream, GLshort x, GLshort y, GLshort z); +typedef void (APIENTRYP PFNGLVERTEXSTREAM3SVATIPROC) (GLenum stream, const GLshort *coords); +typedef void (APIENTRYP PFNGLVERTEXSTREAM3IATIPROC) (GLenum stream, GLint x, GLint y, GLint z); +typedef void (APIENTRYP PFNGLVERTEXSTREAM3IVATIPROC) (GLenum stream, const GLint *coords); +typedef void (APIENTRYP PFNGLVERTEXSTREAM3FATIPROC) (GLenum stream, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLVERTEXSTREAM3FVATIPROC) (GLenum stream, const GLfloat *coords); +typedef void (APIENTRYP PFNGLVERTEXSTREAM3DATIPROC) (GLenum stream, GLdouble x, GLdouble y, GLdouble z); +typedef void (APIENTRYP PFNGLVERTEXSTREAM3DVATIPROC) (GLenum stream, const GLdouble *coords); +typedef void (APIENTRYP PFNGLVERTEXSTREAM4SATIPROC) (GLenum stream, GLshort x, GLshort y, GLshort z, GLshort w); +typedef void (APIENTRYP PFNGLVERTEXSTREAM4SVATIPROC) (GLenum stream, const GLshort *coords); +typedef void (APIENTRYP PFNGLVERTEXSTREAM4IATIPROC) (GLenum stream, GLint x, GLint y, GLint z, GLint w); +typedef void (APIENTRYP PFNGLVERTEXSTREAM4IVATIPROC) (GLenum stream, const GLint *coords); +typedef void (APIENTRYP PFNGLVERTEXSTREAM4FATIPROC) (GLenum stream, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (APIENTRYP PFNGLVERTEXSTREAM4FVATIPROC) (GLenum stream, const GLfloat *coords); +typedef void (APIENTRYP PFNGLVERTEXSTREAM4DATIPROC) (GLenum stream, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (APIENTRYP PFNGLVERTEXSTREAM4DVATIPROC) (GLenum stream, const GLdouble *coords); +typedef void (APIENTRYP PFNGLNORMALSTREAM3BATIPROC) (GLenum stream, GLbyte nx, GLbyte ny, GLbyte nz); +typedef void (APIENTRYP PFNGLNORMALSTREAM3BVATIPROC) (GLenum stream, const GLbyte *coords); +typedef void (APIENTRYP PFNGLNORMALSTREAM3SATIPROC) (GLenum stream, GLshort nx, GLshort ny, GLshort nz); +typedef void (APIENTRYP PFNGLNORMALSTREAM3SVATIPROC) (GLenum stream, const GLshort *coords); +typedef void (APIENTRYP PFNGLNORMALSTREAM3IATIPROC) (GLenum stream, GLint nx, GLint ny, GLint nz); +typedef void (APIENTRYP PFNGLNORMALSTREAM3IVATIPROC) (GLenum stream, const GLint *coords); +typedef void (APIENTRYP PFNGLNORMALSTREAM3FATIPROC) (GLenum stream, GLfloat nx, GLfloat ny, GLfloat nz); +typedef void (APIENTRYP PFNGLNORMALSTREAM3FVATIPROC) (GLenum stream, const GLfloat *coords); +typedef void (APIENTRYP PFNGLNORMALSTREAM3DATIPROC) (GLenum stream, GLdouble nx, GLdouble ny, GLdouble nz); +typedef void (APIENTRYP PFNGLNORMALSTREAM3DVATIPROC) (GLenum stream, const GLdouble *coords); +typedef void (APIENTRYP PFNGLCLIENTACTIVEVERTEXSTREAMATIPROC) (GLenum stream); +typedef void (APIENTRYP PFNGLVERTEXBLENDENVIATIPROC) (GLenum pname, GLint param); +typedef void (APIENTRYP PFNGLVERTEXBLENDENVFATIPROC) (GLenum pname, GLfloat param); +#endif + +#ifndef GL_ATI_element_array +#define GL_ATI_element_array 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glElementPointerATI (GLenum, const GLvoid *); +GLAPI void APIENTRY glDrawElementArrayATI (GLenum, GLsizei); +GLAPI void APIENTRY glDrawRangeElementArrayATI (GLenum, GLuint, GLuint, GLsizei); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLELEMENTPOINTERATIPROC) (GLenum type, const GLvoid *pointer); +typedef void (APIENTRYP PFNGLDRAWELEMENTARRAYATIPROC) (GLenum mode, GLsizei count); +typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTARRAYATIPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count); +#endif + +#ifndef GL_SUN_mesh_array +#define GL_SUN_mesh_array 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glDrawMeshArraysSUN (GLenum, GLint, GLsizei, GLsizei); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLDRAWMESHARRAYSSUNPROC) (GLenum mode, GLint first, GLsizei count, GLsizei width); +#endif + +#ifndef GL_SUN_slice_accum +#define GL_SUN_slice_accum 1 +#endif + +#ifndef GL_NV_multisample_filter_hint +#define GL_NV_multisample_filter_hint 1 +#endif + +#ifndef GL_NV_depth_clamp +#define GL_NV_depth_clamp 1 +#endif + +#ifndef GL_NV_occlusion_query +#define GL_NV_occlusion_query 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glGenOcclusionQueriesNV (GLsizei, GLuint *); +GLAPI void APIENTRY glDeleteOcclusionQueriesNV (GLsizei, const GLuint *); +GLAPI GLboolean APIENTRY glIsOcclusionQueryNV (GLuint); +GLAPI void APIENTRY glBeginOcclusionQueryNV (GLuint); +GLAPI void APIENTRY glEndOcclusionQueryNV (void); +GLAPI void APIENTRY glGetOcclusionQueryivNV (GLuint, GLenum, GLint *); +GLAPI void APIENTRY glGetOcclusionQueryuivNV (GLuint, GLenum, GLuint *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLGENOCCLUSIONQUERIESNVPROC) (GLsizei n, GLuint *ids); +typedef void (APIENTRYP PFNGLDELETEOCCLUSIONQUERIESNVPROC) (GLsizei n, const GLuint *ids); +typedef GLboolean (APIENTRYP PFNGLISOCCLUSIONQUERYNVPROC) (GLuint id); +typedef void (APIENTRYP PFNGLBEGINOCCLUSIONQUERYNVPROC) (GLuint id); +typedef void (APIENTRYP PFNGLENDOCCLUSIONQUERYNVPROC) (void); +typedef void (APIENTRYP PFNGLGETOCCLUSIONQUERYIVNVPROC) (GLuint id, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETOCCLUSIONQUERYUIVNVPROC) (GLuint id, GLenum pname, GLuint *params); +#endif + +#ifndef GL_NV_point_sprite +#define GL_NV_point_sprite 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glPointParameteriNV (GLenum, GLint); +GLAPI void APIENTRY glPointParameterivNV (GLenum, const GLint *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLPOINTPARAMETERINVPROC) (GLenum pname, GLint param); +typedef void (APIENTRYP PFNGLPOINTPARAMETERIVNVPROC) (GLenum pname, const GLint *params); +#endif + +#ifndef GL_NV_texture_shader3 +#define GL_NV_texture_shader3 1 +#endif + +#ifndef GL_NV_vertex_program1_1 +#define GL_NV_vertex_program1_1 1 +#endif + +#ifndef GL_EXT_shadow_funcs +#define GL_EXT_shadow_funcs 1 +#endif + +#ifndef GL_EXT_stencil_two_side +#define GL_EXT_stencil_two_side 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glActiveStencilFaceEXT (GLenum); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLACTIVESTENCILFACEEXTPROC) (GLenum face); +#endif + +#ifndef GL_ATI_text_fragment_shader +#define GL_ATI_text_fragment_shader 1 +#endif + +#ifndef GL_APPLE_client_storage +#define GL_APPLE_client_storage 1 +#endif + +#ifndef GL_APPLE_element_array +#define GL_APPLE_element_array 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glElementPointerAPPLE (GLenum, const GLvoid *); +GLAPI void APIENTRY glDrawElementArrayAPPLE (GLenum, GLint, GLsizei); +GLAPI void APIENTRY glDrawRangeElementArrayAPPLE (GLenum, GLuint, GLuint, GLint, GLsizei); +GLAPI void APIENTRY glMultiDrawElementArrayAPPLE (GLenum, const GLint *, const GLsizei *, GLsizei); +GLAPI void APIENTRY glMultiDrawRangeElementArrayAPPLE (GLenum, GLuint, GLuint, const GLint *, const GLsizei *, GLsizei); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLELEMENTPOINTERAPPLEPROC) (GLenum type, const GLvoid *pointer); +typedef void (APIENTRYP PFNGLDRAWELEMENTARRAYAPPLEPROC) (GLenum mode, GLint first, GLsizei count); +typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTARRAYAPPLEPROC) (GLenum mode, GLuint start, GLuint end, GLint first, GLsizei count); +typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTARRAYAPPLEPROC) (GLenum mode, const GLint *first, const GLsizei *count, GLsizei primcount); +typedef void (APIENTRYP PFNGLMULTIDRAWRANGEELEMENTARRAYAPPLEPROC) (GLenum mode, GLuint start, GLuint end, const GLint *first, const GLsizei *count, GLsizei primcount); +#endif + +#ifndef GL_APPLE_fence +#define GL_APPLE_fence 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glGenFencesAPPLE (GLsizei, GLuint *); +GLAPI void APIENTRY glDeleteFencesAPPLE (GLsizei, const GLuint *); +GLAPI void APIENTRY glSetFenceAPPLE (GLuint); +GLAPI GLboolean APIENTRY glIsFenceAPPLE (GLuint); +GLAPI GLboolean APIENTRY glTestFenceAPPLE (GLuint); +GLAPI void APIENTRY glFinishFenceAPPLE (GLuint); +GLAPI GLboolean APIENTRY glTestObjectAPPLE (GLenum, GLuint); +GLAPI void APIENTRY glFinishObjectAPPLE (GLenum, GLint); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLGENFENCESAPPLEPROC) (GLsizei n, GLuint *fences); +typedef void (APIENTRYP PFNGLDELETEFENCESAPPLEPROC) (GLsizei n, const GLuint *fences); +typedef void (APIENTRYP PFNGLSETFENCEAPPLEPROC) (GLuint fence); +typedef GLboolean (APIENTRYP PFNGLISFENCEAPPLEPROC) (GLuint fence); +typedef GLboolean (APIENTRYP PFNGLTESTFENCEAPPLEPROC) (GLuint fence); +typedef void (APIENTRYP PFNGLFINISHFENCEAPPLEPROC) (GLuint fence); +typedef GLboolean (APIENTRYP PFNGLTESTOBJECTAPPLEPROC) (GLenum object, GLuint name); +typedef void (APIENTRYP PFNGLFINISHOBJECTAPPLEPROC) (GLenum object, GLint name); +#endif + +#ifndef GL_APPLE_vertex_array_object +#define GL_APPLE_vertex_array_object 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBindVertexArrayAPPLE (GLuint); +GLAPI void APIENTRY glDeleteVertexArraysAPPLE (GLsizei, const GLuint *); +GLAPI void APIENTRY glGenVertexArraysAPPLE (GLsizei, const GLuint *); +GLAPI GLboolean APIENTRY glIsVertexArrayAPPLE (GLuint); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLBINDVERTEXARRAYAPPLEPROC) (GLuint array); +typedef void (APIENTRYP PFNGLDELETEVERTEXARRAYSAPPLEPROC) (GLsizei n, const GLuint *arrays); +typedef void (APIENTRYP PFNGLGENVERTEXARRAYSAPPLEPROC) (GLsizei n, const GLuint *arrays); +typedef GLboolean (APIENTRYP PFNGLISVERTEXARRAYAPPLEPROC) (GLuint array); +#endif + +#ifndef GL_APPLE_vertex_array_range +#define GL_APPLE_vertex_array_range 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glVertexArrayRangeAPPLE (GLsizei, GLvoid *); +GLAPI void APIENTRY glFlushVertexArrayRangeAPPLE (GLsizei, GLvoid *); +GLAPI void APIENTRY glVertexArrayParameteriAPPLE (GLenum, GLint); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLVERTEXARRAYRANGEAPPLEPROC) (GLsizei length, GLvoid *pointer); +typedef void (APIENTRYP PFNGLFLUSHVERTEXARRAYRANGEAPPLEPROC) (GLsizei length, GLvoid *pointer); +typedef void (APIENTRYP PFNGLVERTEXARRAYPARAMETERIAPPLEPROC) (GLenum pname, GLint param); +#endif + +#ifndef GL_APPLE_ycbcr_422 +#define GL_APPLE_ycbcr_422 1 +#endif + +#ifndef GL_S3_s3tc +#define GL_S3_s3tc 1 +#endif + +#ifndef GL_ATI_draw_buffers +#define GL_ATI_draw_buffers 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glDrawBuffersATI (GLsizei, const GLenum *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLDRAWBUFFERSATIPROC) (GLsizei n, const GLenum *bufs); +#endif + +#ifndef GL_ATI_pixel_format_float +#define GL_ATI_pixel_format_float 1 +/* This is really a WGL extension, but defines some associated GL enums. + * ATI does not export "GL_ATI_pixel_format_float" in the GL_EXTENSIONS string. + */ +#endif + +#ifndef GL_ATI_texture_env_combine3 +#define GL_ATI_texture_env_combine3 1 +#endif + +#ifndef GL_ATI_texture_float +#define GL_ATI_texture_float 1 +#endif + +#ifndef GL_NV_float_buffer +#define GL_NV_float_buffer 1 +#endif + +#ifndef GL_NV_fragment_program +#define GL_NV_fragment_program 1 +/* Some NV_fragment_program entry points are shared with ARB_vertex_program. */ +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glProgramNamedParameter4fNV (GLuint, GLsizei, const GLubyte *, GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glProgramNamedParameter4dNV (GLuint, GLsizei, const GLubyte *, GLdouble, GLdouble, GLdouble, GLdouble); +GLAPI void APIENTRY glProgramNamedParameter4fvNV (GLuint, GLsizei, const GLubyte *, const GLfloat *); +GLAPI void APIENTRY glProgramNamedParameter4dvNV (GLuint, GLsizei, const GLubyte *, const GLdouble *); +GLAPI void APIENTRY glGetProgramNamedParameterfvNV (GLuint, GLsizei, const GLubyte *, GLfloat *); +GLAPI void APIENTRY glGetProgramNamedParameterdvNV (GLuint, GLsizei, const GLubyte *, GLdouble *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLPROGRAMNAMEDPARAMETER4FNVPROC) (GLuint id, GLsizei len, const GLubyte *name, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (APIENTRYP PFNGLPROGRAMNAMEDPARAMETER4DNVPROC) (GLuint id, GLsizei len, const GLubyte *name, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (APIENTRYP PFNGLPROGRAMNAMEDPARAMETER4FVNVPROC) (GLuint id, GLsizei len, const GLubyte *name, const GLfloat *v); +typedef void (APIENTRYP PFNGLPROGRAMNAMEDPARAMETER4DVNVPROC) (GLuint id, GLsizei len, const GLubyte *name, const GLdouble *v); +typedef void (APIENTRYP PFNGLGETPROGRAMNAMEDPARAMETERFVNVPROC) (GLuint id, GLsizei len, const GLubyte *name, GLfloat *params); +typedef void (APIENTRYP PFNGLGETPROGRAMNAMEDPARAMETERDVNVPROC) (GLuint id, GLsizei len, const GLubyte *name, GLdouble *params); +#endif + +#ifndef GL_NV_half_float +#define GL_NV_half_float 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glVertex2hNV (GLhalfNV, GLhalfNV); +GLAPI void APIENTRY glVertex2hvNV (const GLhalfNV *); +GLAPI void APIENTRY glVertex3hNV (GLhalfNV, GLhalfNV, GLhalfNV); +GLAPI void APIENTRY glVertex3hvNV (const GLhalfNV *); +GLAPI void APIENTRY glVertex4hNV (GLhalfNV, GLhalfNV, GLhalfNV, GLhalfNV); +GLAPI void APIENTRY glVertex4hvNV (const GLhalfNV *); +GLAPI void APIENTRY glNormal3hNV (GLhalfNV, GLhalfNV, GLhalfNV); +GLAPI void APIENTRY glNormal3hvNV (const GLhalfNV *); +GLAPI void APIENTRY glColor3hNV (GLhalfNV, GLhalfNV, GLhalfNV); +GLAPI void APIENTRY glColor3hvNV (const GLhalfNV *); +GLAPI void APIENTRY glColor4hNV (GLhalfNV, GLhalfNV, GLhalfNV, GLhalfNV); +GLAPI void APIENTRY glColor4hvNV (const GLhalfNV *); +GLAPI void APIENTRY glTexCoord1hNV (GLhalfNV); +GLAPI void APIENTRY glTexCoord1hvNV (const GLhalfNV *); +GLAPI void APIENTRY glTexCoord2hNV (GLhalfNV, GLhalfNV); +GLAPI void APIENTRY glTexCoord2hvNV (const GLhalfNV *); +GLAPI void APIENTRY glTexCoord3hNV (GLhalfNV, GLhalfNV, GLhalfNV); +GLAPI void APIENTRY glTexCoord3hvNV (const GLhalfNV *); +GLAPI void APIENTRY glTexCoord4hNV (GLhalfNV, GLhalfNV, GLhalfNV, GLhalfNV); +GLAPI void APIENTRY glTexCoord4hvNV (const GLhalfNV *); +GLAPI void APIENTRY glMultiTexCoord1hNV (GLenum, GLhalfNV); +GLAPI void APIENTRY glMultiTexCoord1hvNV (GLenum, const GLhalfNV *); +GLAPI void APIENTRY glMultiTexCoord2hNV (GLenum, GLhalfNV, GLhalfNV); +GLAPI void APIENTRY glMultiTexCoord2hvNV (GLenum, const GLhalfNV *); +GLAPI void APIENTRY glMultiTexCoord3hNV (GLenum, GLhalfNV, GLhalfNV, GLhalfNV); +GLAPI void APIENTRY glMultiTexCoord3hvNV (GLenum, const GLhalfNV *); +GLAPI void APIENTRY glMultiTexCoord4hNV (GLenum, GLhalfNV, GLhalfNV, GLhalfNV, GLhalfNV); +GLAPI void APIENTRY glMultiTexCoord4hvNV (GLenum, const GLhalfNV *); +GLAPI void APIENTRY glFogCoordhNV (GLhalfNV); +GLAPI void APIENTRY glFogCoordhvNV (const GLhalfNV *); +GLAPI void APIENTRY glSecondaryColor3hNV (GLhalfNV, GLhalfNV, GLhalfNV); +GLAPI void APIENTRY glSecondaryColor3hvNV (const GLhalfNV *); +GLAPI void APIENTRY glVertexWeighthNV (GLhalfNV); +GLAPI void APIENTRY glVertexWeighthvNV (const GLhalfNV *); +GLAPI void APIENTRY glVertexAttrib1hNV (GLuint, GLhalfNV); +GLAPI void APIENTRY glVertexAttrib1hvNV (GLuint, const GLhalfNV *); +GLAPI void APIENTRY glVertexAttrib2hNV (GLuint, GLhalfNV, GLhalfNV); +GLAPI void APIENTRY glVertexAttrib2hvNV (GLuint, const GLhalfNV *); +GLAPI void APIENTRY glVertexAttrib3hNV (GLuint, GLhalfNV, GLhalfNV, GLhalfNV); +GLAPI void APIENTRY glVertexAttrib3hvNV (GLuint, const GLhalfNV *); +GLAPI void APIENTRY glVertexAttrib4hNV (GLuint, GLhalfNV, GLhalfNV, GLhalfNV, GLhalfNV); +GLAPI void APIENTRY glVertexAttrib4hvNV (GLuint, const GLhalfNV *); +GLAPI void APIENTRY glVertexAttribs1hvNV (GLuint, GLsizei, const GLhalfNV *); +GLAPI void APIENTRY glVertexAttribs2hvNV (GLuint, GLsizei, const GLhalfNV *); +GLAPI void APIENTRY glVertexAttribs3hvNV (GLuint, GLsizei, const GLhalfNV *); +GLAPI void APIENTRY glVertexAttribs4hvNV (GLuint, GLsizei, const GLhalfNV *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLVERTEX2HNVPROC) (GLhalfNV x, GLhalfNV y); +typedef void (APIENTRYP PFNGLVERTEX2HVNVPROC) (const GLhalfNV *v); +typedef void (APIENTRYP PFNGLVERTEX3HNVPROC) (GLhalfNV x, GLhalfNV y, GLhalfNV z); +typedef void (APIENTRYP PFNGLVERTEX3HVNVPROC) (const GLhalfNV *v); +typedef void (APIENTRYP PFNGLVERTEX4HNVPROC) (GLhalfNV x, GLhalfNV y, GLhalfNV z, GLhalfNV w); +typedef void (APIENTRYP PFNGLVERTEX4HVNVPROC) (const GLhalfNV *v); +typedef void (APIENTRYP PFNGLNORMAL3HNVPROC) (GLhalfNV nx, GLhalfNV ny, GLhalfNV nz); +typedef void (APIENTRYP PFNGLNORMAL3HVNVPROC) (const GLhalfNV *v); +typedef void (APIENTRYP PFNGLCOLOR3HNVPROC) (GLhalfNV red, GLhalfNV green, GLhalfNV blue); +typedef void (APIENTRYP PFNGLCOLOR3HVNVPROC) (const GLhalfNV *v); +typedef void (APIENTRYP PFNGLCOLOR4HNVPROC) (GLhalfNV red, GLhalfNV green, GLhalfNV blue, GLhalfNV alpha); +typedef void (APIENTRYP PFNGLCOLOR4HVNVPROC) (const GLhalfNV *v); +typedef void (APIENTRYP PFNGLTEXCOORD1HNVPROC) (GLhalfNV s); +typedef void (APIENTRYP PFNGLTEXCOORD1HVNVPROC) (const GLhalfNV *v); +typedef void (APIENTRYP PFNGLTEXCOORD2HNVPROC) (GLhalfNV s, GLhalfNV t); +typedef void (APIENTRYP PFNGLTEXCOORD2HVNVPROC) (const GLhalfNV *v); +typedef void (APIENTRYP PFNGLTEXCOORD3HNVPROC) (GLhalfNV s, GLhalfNV t, GLhalfNV r); +typedef void (APIENTRYP PFNGLTEXCOORD3HVNVPROC) (const GLhalfNV *v); +typedef void (APIENTRYP PFNGLTEXCOORD4HNVPROC) (GLhalfNV s, GLhalfNV t, GLhalfNV r, GLhalfNV q); +typedef void (APIENTRYP PFNGLTEXCOORD4HVNVPROC) (const GLhalfNV *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1HNVPROC) (GLenum target, GLhalfNV s); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1HVNVPROC) (GLenum target, const GLhalfNV *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2HNVPROC) (GLenum target, GLhalfNV s, GLhalfNV t); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2HVNVPROC) (GLenum target, const GLhalfNV *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3HNVPROC) (GLenum target, GLhalfNV s, GLhalfNV t, GLhalfNV r); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3HVNVPROC) (GLenum target, const GLhalfNV *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4HNVPROC) (GLenum target, GLhalfNV s, GLhalfNV t, GLhalfNV r, GLhalfNV q); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4HVNVPROC) (GLenum target, const GLhalfNV *v); +typedef void (APIENTRYP PFNGLFOGCOORDHNVPROC) (GLhalfNV fog); +typedef void (APIENTRYP PFNGLFOGCOORDHVNVPROC) (const GLhalfNV *fog); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3HNVPROC) (GLhalfNV red, GLhalfNV green, GLhalfNV blue); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3HVNVPROC) (const GLhalfNV *v); +typedef void (APIENTRYP PFNGLVERTEXWEIGHTHNVPROC) (GLhalfNV weight); +typedef void (APIENTRYP PFNGLVERTEXWEIGHTHVNVPROC) (const GLhalfNV *weight); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1HNVPROC) (GLuint index, GLhalfNV x); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1HVNVPROC) (GLuint index, const GLhalfNV *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2HNVPROC) (GLuint index, GLhalfNV x, GLhalfNV y); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2HVNVPROC) (GLuint index, const GLhalfNV *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3HNVPROC) (GLuint index, GLhalfNV x, GLhalfNV y, GLhalfNV z); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3HVNVPROC) (GLuint index, const GLhalfNV *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4HNVPROC) (GLuint index, GLhalfNV x, GLhalfNV y, GLhalfNV z, GLhalfNV w); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4HVNVPROC) (GLuint index, const GLhalfNV *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBS1HVNVPROC) (GLuint index, GLsizei n, const GLhalfNV *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBS2HVNVPROC) (GLuint index, GLsizei n, const GLhalfNV *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBS3HVNVPROC) (GLuint index, GLsizei n, const GLhalfNV *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBS4HVNVPROC) (GLuint index, GLsizei n, const GLhalfNV *v); +#endif + +#ifndef GL_NV_pixel_data_range +#define GL_NV_pixel_data_range 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glPixelDataRangeNV (GLenum, GLsizei, GLvoid *); +GLAPI void APIENTRY glFlushPixelDataRangeNV (GLenum); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLPIXELDATARANGENVPROC) (GLenum target, GLsizei length, GLvoid *pointer); +typedef void (APIENTRYP PFNGLFLUSHPIXELDATARANGENVPROC) (GLenum target); +#endif + +#ifndef GL_NV_primitive_restart +#define GL_NV_primitive_restart 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glPrimitiveRestartNV (void); +GLAPI void APIENTRY glPrimitiveRestartIndexNV (GLuint); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLPRIMITIVERESTARTNVPROC) (void); +typedef void (APIENTRYP PFNGLPRIMITIVERESTARTINDEXNVPROC) (GLuint index); +#endif + +#ifndef GL_NV_texture_expand_normal +#define GL_NV_texture_expand_normal 1 +#endif + +#ifndef GL_NV_vertex_program2 +#define GL_NV_vertex_program2 1 +#endif + +#ifndef GL_ATI_map_object_buffer +#define GL_ATI_map_object_buffer 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI GLvoid* APIENTRY glMapObjectBufferATI (GLuint); +GLAPI void APIENTRY glUnmapObjectBufferATI (GLuint); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef GLvoid* (APIENTRYP PFNGLMAPOBJECTBUFFERATIPROC) (GLuint buffer); +typedef void (APIENTRYP PFNGLUNMAPOBJECTBUFFERATIPROC) (GLuint buffer); +#endif + +#ifndef GL_ATI_separate_stencil +#define GL_ATI_separate_stencil 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glStencilOpSeparateATI (GLenum, GLenum, GLenum, GLenum); +GLAPI void APIENTRY glStencilFuncSeparateATI (GLenum, GLenum, GLint, GLuint); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLSTENCILOPSEPARATEATIPROC) (GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass); +typedef void (APIENTRYP PFNGLSTENCILFUNCSEPARATEATIPROC) (GLenum frontfunc, GLenum backfunc, GLint ref, GLuint mask); +#endif + +#ifndef GL_ATI_vertex_attrib_array_object +#define GL_ATI_vertex_attrib_array_object 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glVertexAttribArrayObjectATI (GLuint, GLint, GLenum, GLboolean, GLsizei, GLuint, GLuint); +GLAPI void APIENTRY glGetVertexAttribArrayObjectfvATI (GLuint, GLenum, GLfloat *); +GLAPI void APIENTRY glGetVertexAttribArrayObjectivATI (GLuint, GLenum, GLint *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLVERTEXATTRIBARRAYOBJECTATIPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, GLuint buffer, GLuint offset); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBARRAYOBJECTFVATIPROC) (GLuint index, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBARRAYOBJECTIVATIPROC) (GLuint index, GLenum pname, GLint *params); +#endif + +#ifndef GL_OES_read_format +#define GL_OES_read_format 1 +#endif + +#ifndef GL_EXT_depth_bounds_test +#define GL_EXT_depth_bounds_test 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glDepthBoundsEXT (GLclampd, GLclampd); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLDEPTHBOUNDSEXTPROC) (GLclampd zmin, GLclampd zmax); +#endif + +#ifndef GL_EXT_texture_mirror_clamp +#define GL_EXT_texture_mirror_clamp 1 +#endif + +#ifndef GL_EXT_blend_equation_separate +#define GL_EXT_blend_equation_separate 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBlendEquationSeparateEXT (GLenum, GLenum); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLBLENDEQUATIONSEPARATEEXTPROC) (GLenum modeRGB, GLenum modeAlpha); +#endif + +#ifndef GL_MESA_pack_invert +#define GL_MESA_pack_invert 1 +#endif + +#ifndef GL_MESA_ycbcr_texture +#define GL_MESA_ycbcr_texture 1 +#endif + +#ifndef GL_EXT_pixel_buffer_object +#define GL_EXT_pixel_buffer_object 1 +#endif + +#ifndef GL_NV_fragment_program_option +#define GL_NV_fragment_program_option 1 +#endif + +#ifndef GL_NV_fragment_program2 +#define GL_NV_fragment_program2 1 +#endif + +#ifndef GL_NV_vertex_program2_option +#define GL_NV_vertex_program2_option 1 +#endif + +#ifndef GL_NV_vertex_program3 +#define GL_NV_vertex_program3 1 +#endif + +#ifndef GL_EXT_framebuffer_object +#define GL_EXT_framebuffer_object 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI GLboolean APIENTRY glIsRenderbufferEXT (GLuint); +GLAPI void APIENTRY glBindRenderbufferEXT (GLenum, GLuint); +GLAPI void APIENTRY glDeleteRenderbuffersEXT (GLsizei, const GLuint *); +GLAPI void APIENTRY glGenRenderbuffersEXT (GLsizei, GLuint *); +GLAPI void APIENTRY glRenderbufferStorageEXT (GLenum, GLenum, GLsizei, GLsizei); +GLAPI void APIENTRY glGetRenderbufferParameterivEXT (GLenum, GLenum, GLint *); +GLAPI GLboolean APIENTRY glIsFramebufferEXT (GLuint); +GLAPI void APIENTRY glBindFramebufferEXT (GLenum, GLuint); +GLAPI void APIENTRY glDeleteFramebuffersEXT (GLsizei, const GLuint *); +GLAPI void APIENTRY glGenFramebuffersEXT (GLsizei, GLuint *); +GLAPI GLenum APIENTRY glCheckFramebufferStatusEXT (GLenum); +GLAPI void APIENTRY glFramebufferTexture1DEXT (GLenum, GLenum, GLenum, GLuint, GLint); +GLAPI void APIENTRY glFramebufferTexture2DEXT (GLenum, GLenum, GLenum, GLuint, GLint); +GLAPI void APIENTRY glFramebufferTexture3DEXT (GLenum, GLenum, GLenum, GLuint, GLint, GLint); +GLAPI void APIENTRY glFramebufferRenderbufferEXT (GLenum, GLenum, GLenum, GLuint); +GLAPI void APIENTRY glGetFramebufferAttachmentParameterivEXT (GLenum, GLenum, GLenum, GLint *); +GLAPI void APIENTRY glGenerateMipmapEXT (GLenum); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef GLboolean (APIENTRYP PFNGLISRENDERBUFFEREXTPROC) (GLuint renderbuffer); +typedef void (APIENTRYP PFNGLBINDRENDERBUFFEREXTPROC) (GLenum target, GLuint renderbuffer); +typedef void (APIENTRYP PFNGLDELETERENDERBUFFERSEXTPROC) (GLsizei n, const GLuint *renderbuffers); +typedef void (APIENTRYP PFNGLGENRENDERBUFFERSEXTPROC) (GLsizei n, GLuint *renderbuffers); +typedef void (APIENTRYP PFNGLRENDERBUFFERSTORAGEEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height); +typedef void (APIENTRYP PFNGLGETRENDERBUFFERPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params); +typedef GLboolean (APIENTRYP PFNGLISFRAMEBUFFEREXTPROC) (GLuint framebuffer); +typedef void (APIENTRYP PFNGLBINDFRAMEBUFFEREXTPROC) (GLenum target, GLuint framebuffer); +typedef void (APIENTRYP PFNGLDELETEFRAMEBUFFERSEXTPROC) (GLsizei n, const GLuint *framebuffers); +typedef void (APIENTRYP PFNGLGENFRAMEBUFFERSEXTPROC) (GLsizei n, GLuint *framebuffers); +typedef GLenum (APIENTRYP PFNGLCHECKFRAMEBUFFERSTATUSEXTPROC) (GLenum target); +typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE1DEXTPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); +typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE2DEXTPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); +typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE3DEXTPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset); +typedef void (APIENTRYP PFNGLFRAMEBUFFERRENDERBUFFEREXTPROC) (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); +typedef void (APIENTRYP PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC) (GLenum target, GLenum attachment, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGENERATEMIPMAPEXTPROC) (GLenum target); +#endif + +#ifndef GL_GREMEDY_string_marker +#define GL_GREMEDY_string_marker 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glStringMarkerGREMEDY (GLsizei, const GLvoid *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLSTRINGMARKERGREMEDYPROC) (GLsizei len, const GLvoid *string); +#endif + + +#ifdef __cplusplus +} +#endif + +#endif +#endif /* NO_SDL_GLEXT */ +/*@}*/ diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/include/SDL_platform.h b/dep/recastnavigation/RecastDemo/Contrib/SDL/include/SDL_platform.h new file mode 100644 index 000000000..11d867366 --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/include/SDL_platform.h @@ -0,0 +1,110 @@ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + Sam Lantinga + slouken@libsdl.org +*/ + +/** @file SDL_platform.h + * Try to get a standard set of platform defines + */ + +#ifndef _SDL_platform_h +#define _SDL_platform_h + +#if defined(_AIX) +#undef __AIX__ +#define __AIX__ 1 +#endif +#if defined(__BEOS__) +#undef __BEOS__ +#define __BEOS__ 1 +#endif +#if defined(__HAIKU__) +#undef __HAIKU__ +#define __HAIKU__ 1 +#endif +#if defined(bsdi) || defined(__bsdi) || defined(__bsdi__) +#undef __BSDI__ +#define __BSDI__ 1 +#endif +#if defined(_arch_dreamcast) +#undef __DREAMCAST__ +#define __DREAMCAST__ 1 +#endif +#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__DragonFly__) +#undef __FREEBSD__ +#define __FREEBSD__ 1 +#endif +#if defined(__HAIKU__) +#undef __HAIKU__ +#define __HAIKU__ 1 +#endif +#if defined(hpux) || defined(__hpux) || defined(__hpux__) +#undef __HPUX__ +#define __HPUX__ 1 +#endif +#if defined(sgi) || defined(__sgi) || defined(__sgi__) || defined(_SGI_SOURCE) +#undef __IRIX__ +#define __IRIX__ 1 +#endif +#if defined(linux) || defined(__linux) || defined(__linux__) +#undef __LINUX__ +#define __LINUX__ 1 +#endif +#if defined(__APPLE__) +#undef __MACOSX__ +#define __MACOSX__ 1 +#elif defined(macintosh) +#undef __MACOS__ +#define __MACOS__ 1 +#endif +#if defined(__NetBSD__) +#undef __NETBSD__ +#define __NETBSD__ 1 +#endif +#if defined(__OpenBSD__) +#undef __OPENBSD__ +#define __OPENBSD__ 1 +#endif +#if defined(__OS2__) +#undef __OS2__ +#define __OS2__ 1 +#endif +#if defined(osf) || defined(__osf) || defined(__osf__) || defined(_OSF_SOURCE) +#undef __OSF__ +#define __OSF__ 1 +#endif +#if defined(__QNXNTO__) +#undef __QNXNTO__ +#define __QNXNTO__ 1 +#endif +#if defined(riscos) || defined(__riscos) || defined(__riscos__) +#undef __RISCOS__ +#define __RISCOS__ 1 +#endif +#if defined(__SVR4) +#undef __SOLARIS__ +#define __SOLARIS__ 1 +#endif +#if defined(WIN32) || defined(_WIN32) +#undef __WIN32__ +#define __WIN32__ 1 +#endif + +#endif /* _SDL_platform_h */ diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/include/SDL_quit.h b/dep/recastnavigation/RecastDemo/Contrib/SDL/include/SDL_quit.h new file mode 100644 index 000000000..6d82e7e06 --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/include/SDL_quit.h @@ -0,0 +1,55 @@ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + Sam Lantinga + slouken@libsdl.org +*/ + +/** @file SDL_quit.h + * Include file for SDL quit event handling + */ + +#ifndef _SDL_quit_h +#define _SDL_quit_h + +#include "SDL_stdinc.h" +#include "SDL_error.h" + +/** @file SDL_quit.h + * An SDL_QUITEVENT is generated when the user tries to close the application + * window. If it is ignored or filtered out, the window will remain open. + * If it is not ignored or filtered, it is queued normally and the window + * is allowed to close. When the window is closed, screen updates will + * complete, but have no effect. + * + * SDL_Init() installs signal handlers for SIGINT (keyboard interrupt) + * and SIGTERM (system termination request), if handlers do not already + * exist, that generate SDL_QUITEVENT events as well. There is no way + * to determine the cause of an SDL_QUITEVENT, but setting a signal + * handler in your application will override the default generation of + * quit events for that signal. + */ + +/** @file SDL_quit.h + * There are no functions directly affecting the quit event + */ + +#define SDL_QuitRequested() \ + (SDL_PumpEvents(), SDL_PeepEvents(NULL,0,SDL_PEEKEVENT,SDL_QUITMASK)) + +#endif /* _SDL_quit_h */ diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/include/SDL_rwops.h b/dep/recastnavigation/RecastDemo/Contrib/SDL/include/SDL_rwops.h new file mode 100644 index 000000000..a450119f1 --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/include/SDL_rwops.h @@ -0,0 +1,155 @@ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + Sam Lantinga + slouken@libsdl.org +*/ + +/** @file SDL_rwops.h + * This file provides a general interface for SDL to read and write + * data sources. It can easily be extended to files, memory, etc. + */ + +#ifndef _SDL_rwops_h +#define _SDL_rwops_h + +#include "SDL_stdinc.h" +#include "SDL_error.h" + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/** This is the read/write operation structure -- very basic */ + +typedef struct SDL_RWops { + /** Seek to 'offset' relative to whence, one of stdio's whence values: + * SEEK_SET, SEEK_CUR, SEEK_END + * Returns the final offset in the data source. + */ + int (SDLCALL *seek)(struct SDL_RWops *context, int offset, int whence); + + /** Read up to 'maxnum' objects each of size 'size' from the data + * source to the area pointed at by 'ptr'. + * Returns the number of objects read, or -1 if the read failed. + */ + int (SDLCALL *read)(struct SDL_RWops *context, void *ptr, int size, int maxnum); + + /** Write exactly 'num' objects each of size 'objsize' from the area + * pointed at by 'ptr' to data source. + * Returns 'num', or -1 if the write failed. + */ + int (SDLCALL *write)(struct SDL_RWops *context, const void *ptr, int size, int num); + + /** Close and free an allocated SDL_FSops structure */ + int (SDLCALL *close)(struct SDL_RWops *context); + + Uint32 type; + union { +#if defined(__WIN32__) && !defined(__SYMBIAN32__) + struct { + int append; + void *h; + struct { + void *data; + int size; + int left; + } buffer; + } win32io; +#endif +#ifdef HAVE_STDIO_H + struct { + int autoclose; + FILE *fp; + } stdio; +#endif + struct { + Uint8 *base; + Uint8 *here; + Uint8 *stop; + } mem; + struct { + void *data1; + } unknown; + } hidden; + +} SDL_RWops; + + +/** @name Functions to create SDL_RWops structures from various data sources */ +/*@{*/ + +extern DECLSPEC SDL_RWops * SDLCALL SDL_RWFromFile(const char *file, const char *mode); + +#ifdef HAVE_STDIO_H +extern DECLSPEC SDL_RWops * SDLCALL SDL_RWFromFP(FILE *fp, int autoclose); +#endif + +extern DECLSPEC SDL_RWops * SDLCALL SDL_RWFromMem(void *mem, int size); +extern DECLSPEC SDL_RWops * SDLCALL SDL_RWFromConstMem(const void *mem, int size); + +extern DECLSPEC SDL_RWops * SDLCALL SDL_AllocRW(void); +extern DECLSPEC void SDLCALL SDL_FreeRW(SDL_RWops *area); + +/*@}*/ + +/** @name Seek Reference Points */ +/*@{*/ +#define RW_SEEK_SET 0 /**< Seek from the beginning of data */ +#define RW_SEEK_CUR 1 /**< Seek relative to current read point */ +#define RW_SEEK_END 2 /**< Seek relative to the end of data */ +/*@}*/ + +/** @name Macros to easily read and write from an SDL_RWops structure */ +/*@{*/ +#define SDL_RWseek(ctx, offset, whence) (ctx)->seek(ctx, offset, whence) +#define SDL_RWtell(ctx) (ctx)->seek(ctx, 0, RW_SEEK_CUR) +#define SDL_RWread(ctx, ptr, size, n) (ctx)->read(ctx, ptr, size, n) +#define SDL_RWwrite(ctx, ptr, size, n) (ctx)->write(ctx, ptr, size, n) +#define SDL_RWclose(ctx) (ctx)->close(ctx) +/*@}*/ + +/** @name Read an item of the specified endianness and return in native format */ +/*@{*/ +extern DECLSPEC Uint16 SDLCALL SDL_ReadLE16(SDL_RWops *src); +extern DECLSPEC Uint16 SDLCALL SDL_ReadBE16(SDL_RWops *src); +extern DECLSPEC Uint32 SDLCALL SDL_ReadLE32(SDL_RWops *src); +extern DECLSPEC Uint32 SDLCALL SDL_ReadBE32(SDL_RWops *src); +extern DECLSPEC Uint64 SDLCALL SDL_ReadLE64(SDL_RWops *src); +extern DECLSPEC Uint64 SDLCALL SDL_ReadBE64(SDL_RWops *src); +/*@}*/ + +/** @name Write an item of native format to the specified endianness */ +/*@{*/ +extern DECLSPEC int SDLCALL SDL_WriteLE16(SDL_RWops *dst, Uint16 value); +extern DECLSPEC int SDLCALL SDL_WriteBE16(SDL_RWops *dst, Uint16 value); +extern DECLSPEC int SDLCALL SDL_WriteLE32(SDL_RWops *dst, Uint32 value); +extern DECLSPEC int SDLCALL SDL_WriteBE32(SDL_RWops *dst, Uint32 value); +extern DECLSPEC int SDLCALL SDL_WriteLE64(SDL_RWops *dst, Uint64 value); +extern DECLSPEC int SDLCALL SDL_WriteBE64(SDL_RWops *dst, Uint64 value); +/*@}*/ + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* _SDL_rwops_h */ diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/include/SDL_stdinc.h b/dep/recastnavigation/RecastDemo/Contrib/SDL/include/SDL_stdinc.h new file mode 100644 index 000000000..e1f85fb75 --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/include/SDL_stdinc.h @@ -0,0 +1,620 @@ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + Sam Lantinga + slouken@libsdl.org +*/ + +/** @file SDL_stdinc.h + * This is a general header that includes C language support + */ + +#ifndef _SDL_stdinc_h +#define _SDL_stdinc_h + +#include "SDL_config.h" + + +#ifdef HAVE_SYS_TYPES_H +#include +#endif +#ifdef HAVE_STDIO_H +#include +#endif +#if defined(STDC_HEADERS) +# include +# include +# include +#else +# if defined(HAVE_STDLIB_H) +# include +# elif defined(HAVE_MALLOC_H) +# include +# endif +# if defined(HAVE_STDDEF_H) +# include +# endif +# if defined(HAVE_STDARG_H) +# include +# endif +#endif +#ifdef HAVE_STRING_H +# if !defined(STDC_HEADERS) && defined(HAVE_MEMORY_H) +# include +# endif +# include +#endif +#ifdef HAVE_STRINGS_H +# include +#endif +#if defined(HAVE_INTTYPES_H) +# include +#elif defined(HAVE_STDINT_H) +# include +#endif +#ifdef HAVE_CTYPE_H +# include +#endif +#if defined(HAVE_ICONV) && defined(HAVE_ICONV_H) +# include +#endif + +/** The number of elements in an array */ +#define SDL_arraysize(array) (sizeof(array)/sizeof(array[0])) +#define SDL_TABLESIZE(table) SDL_arraysize(table) + +/* Use proper C++ casts when compiled as C++ to be compatible with the option + -Wold-style-cast of GCC (and -Werror=old-style-cast in GCC 4.2 and above. */ +#ifdef __cplusplus +#define SDL_reinterpret_cast(type, expression) reinterpret_cast(expression) +#define SDL_static_cast(type, expression) static_cast(expression) +#else +#define SDL_reinterpret_cast(type, expression) ((type)(expression)) +#define SDL_static_cast(type, expression) ((type)(expression)) +#endif + +/** @name Basic data types */ +/*@{*/ +typedef enum { + SDL_FALSE = 0, + SDL_TRUE = 1 +} SDL_bool; + +typedef int8_t Sint8; +typedef uint8_t Uint8; +typedef int16_t Sint16; +typedef uint16_t Uint16; +typedef int32_t Sint32; +typedef uint32_t Uint32; + +#ifdef SDL_HAS_64BIT_TYPE +typedef int64_t Sint64; +#ifndef SYMBIAN32_GCCE +typedef uint64_t Uint64; +#endif +#else +/* This is really just a hack to prevent the compiler from complaining */ +typedef struct { + Uint32 hi; + Uint32 lo; +} Uint64, Sint64; +#endif + +/*@}*/ + +/** @name Make sure the types really have the right sizes */ +/*@{*/ +#define SDL_COMPILE_TIME_ASSERT(name, x) \ + typedef int SDL_dummy_ ## name[(x) * 2 - 1] + +SDL_COMPILE_TIME_ASSERT(uint8, sizeof(Uint8) == 1); +SDL_COMPILE_TIME_ASSERT(sint8, sizeof(Sint8) == 1); +SDL_COMPILE_TIME_ASSERT(uint16, sizeof(Uint16) == 2); +SDL_COMPILE_TIME_ASSERT(sint16, sizeof(Sint16) == 2); +SDL_COMPILE_TIME_ASSERT(uint32, sizeof(Uint32) == 4); +SDL_COMPILE_TIME_ASSERT(sint32, sizeof(Sint32) == 4); +SDL_COMPILE_TIME_ASSERT(uint64, sizeof(Uint64) == 8); +SDL_COMPILE_TIME_ASSERT(sint64, sizeof(Sint64) == 8); +/*@}*/ + +/** @name Enum Size Check + * Check to make sure enums are the size of ints, for structure packing. + * For both Watcom C/C++ and Borland C/C++ the compiler option that makes + * enums having the size of an int must be enabled. + * This is "-b" for Borland C/C++ and "-ei" for Watcom C/C++ (v11). + */ +/* Enable enums always int in CodeWarrior (for MPW use "-enum int") */ +#ifdef __MWERKS__ +#pragma enumsalwaysint on +#endif + +typedef enum { + DUMMY_ENUM_VALUE +} SDL_DUMMY_ENUM; + +#ifndef __NDS__ +SDL_COMPILE_TIME_ASSERT(enum, sizeof(SDL_DUMMY_ENUM) == sizeof(int)); +#endif +/*@}*/ + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +#ifdef HAVE_MALLOC +#define SDL_malloc malloc +#else +extern DECLSPEC void * SDLCALL SDL_malloc(size_t size); +#endif + +#ifdef HAVE_CALLOC +#define SDL_calloc calloc +#else +extern DECLSPEC void * SDLCALL SDL_calloc(size_t nmemb, size_t size); +#endif + +#ifdef HAVE_REALLOC +#define SDL_realloc realloc +#else +extern DECLSPEC void * SDLCALL SDL_realloc(void *mem, size_t size); +#endif + +#ifdef HAVE_FREE +#define SDL_free free +#else +extern DECLSPEC void SDLCALL SDL_free(void *mem); +#endif + +#if defined(HAVE_ALLOCA) && !defined(alloca) +# if defined(HAVE_ALLOCA_H) +# include +# elif defined(__GNUC__) +# define alloca __builtin_alloca +# elif defined(_MSC_VER) +# include +# define alloca _alloca +# elif defined(__WATCOMC__) +# include +# elif defined(__BORLANDC__) +# include +# elif defined(__DMC__) +# include +# elif defined(__AIX__) + #pragma alloca +# elif defined(__MRC__) + void *alloca (unsigned); +# else + char *alloca (); +# endif +#endif +#ifdef HAVE_ALLOCA +#define SDL_stack_alloc(type, count) (type*)alloca(sizeof(type)*(count)) +#define SDL_stack_free(data) +#else +#define SDL_stack_alloc(type, count) (type*)SDL_malloc(sizeof(type)*(count)) +#define SDL_stack_free(data) SDL_free(data) +#endif + +#ifdef HAVE_GETENV +#define SDL_getenv getenv +#else +extern DECLSPEC char * SDLCALL SDL_getenv(const char *name); +#endif + +#ifdef HAVE_PUTENV +#define SDL_putenv putenv +#else +extern DECLSPEC int SDLCALL SDL_putenv(const char *variable); +#endif + +#ifdef HAVE_QSORT +#define SDL_qsort qsort +#else +extern DECLSPEC void SDLCALL SDL_qsort(void *base, size_t nmemb, size_t size, + int (*compare)(const void *, const void *)); +#endif + +#ifdef HAVE_ABS +#define SDL_abs abs +#else +#define SDL_abs(X) ((X) < 0 ? -(X) : (X)) +#endif + +#define SDL_min(x, y) (((x) < (y)) ? (x) : (y)) +#define SDL_max(x, y) (((x) > (y)) ? (x) : (y)) + +#ifdef HAVE_CTYPE_H +#define SDL_isdigit(X) isdigit(X) +#define SDL_isspace(X) isspace(X) +#define SDL_toupper(X) toupper(X) +#define SDL_tolower(X) tolower(X) +#else +#define SDL_isdigit(X) (((X) >= '0') && ((X) <= '9')) +#define SDL_isspace(X) (((X) == ' ') || ((X) == '\t') || ((X) == '\r') || ((X) == '\n')) +#define SDL_toupper(X) (((X) >= 'a') && ((X) <= 'z') ? ('A'+((X)-'a')) : (X)) +#define SDL_tolower(X) (((X) >= 'A') && ((X) <= 'Z') ? ('a'+((X)-'A')) : (X)) +#endif + +#ifdef HAVE_MEMSET +#define SDL_memset memset +#else +extern DECLSPEC void * SDLCALL SDL_memset(void *dst, int c, size_t len); +#endif + +#if defined(__GNUC__) && defined(i386) +#define SDL_memset4(dst, val, len) \ +do { \ + int u0, u1, u2; \ + __asm__ __volatile__ ( \ + "cld\n\t" \ + "rep ; stosl\n\t" \ + : "=&D" (u0), "=&a" (u1), "=&c" (u2) \ + : "0" (dst), "1" (val), "2" (SDL_static_cast(Uint32, len)) \ + : "memory" ); \ +} while(0) +#endif +#ifndef SDL_memset4 +#define SDL_memset4(dst, val, len) \ +do { \ + unsigned _count = (len); \ + unsigned _n = (_count + 3) / 4; \ + Uint32 *_p = SDL_static_cast(Uint32 *, dst); \ + Uint32 _val = (val); \ + if (len == 0) break; \ + switch (_count % 4) { \ + case 0: do { *_p++ = _val; \ + case 3: *_p++ = _val; \ + case 2: *_p++ = _val; \ + case 1: *_p++ = _val; \ + } while ( --_n ); \ + } \ +} while(0) +#endif + +/* We can count on memcpy existing on Mac OS X and being well-tuned. */ +#if defined(__MACH__) && defined(__APPLE__) +#define SDL_memcpy(dst, src, len) memcpy(dst, src, len) +#elif defined(__GNUC__) && defined(i386) +#define SDL_memcpy(dst, src, len) \ +do { \ + int u0, u1, u2; \ + __asm__ __volatile__ ( \ + "cld\n\t" \ + "rep ; movsl\n\t" \ + "testb $2,%b4\n\t" \ + "je 1f\n\t" \ + "movsw\n" \ + "1:\ttestb $1,%b4\n\t" \ + "je 2f\n\t" \ + "movsb\n" \ + "2:" \ + : "=&c" (u0), "=&D" (u1), "=&S" (u2) \ + : "0" (SDL_static_cast(unsigned, len)/4), "q" (len), "1" (dst),"2" (src) \ + : "memory" ); \ +} while(0) +#endif +#ifndef SDL_memcpy +#ifdef HAVE_MEMCPY +#define SDL_memcpy memcpy +#elif defined(HAVE_BCOPY) +#define SDL_memcpy(d, s, n) bcopy((s), (d), (n)) +#else +extern DECLSPEC void * SDLCALL SDL_memcpy(void *dst, const void *src, size_t len); +#endif +#endif + +/* We can count on memcpy existing on Mac OS X and being well-tuned. */ +#if defined(__MACH__) && defined(__APPLE__) +#define SDL_memcpy4(dst, src, len) memcpy(dst, src, (len)*4) +#elif defined(__GNUC__) && defined(i386) +#define SDL_memcpy4(dst, src, len) \ +do { \ + int ecx, edi, esi; \ + __asm__ __volatile__ ( \ + "cld\n\t" \ + "rep ; movsl" \ + : "=&c" (ecx), "=&D" (edi), "=&S" (esi) \ + : "0" (SDL_static_cast(unsigned, len)), "1" (dst), "2" (src) \ + : "memory" ); \ +} while(0) +#endif +#ifndef SDL_memcpy4 +#define SDL_memcpy4(dst, src, len) SDL_memcpy(dst, src, (len) << 2) +#endif + +#if defined(__GNUC__) && defined(i386) +#define SDL_revcpy(dst, src, len) \ +do { \ + int u0, u1, u2; \ + char *dstp = SDL_static_cast(char *, dst); \ + char *srcp = SDL_static_cast(char *, src); \ + int n = (len); \ + if ( n >= 4 ) { \ + __asm__ __volatile__ ( \ + "std\n\t" \ + "rep ; movsl\n\t" \ + "cld\n\t" \ + : "=&c" (u0), "=&D" (u1), "=&S" (u2) \ + : "0" (n >> 2), \ + "1" (dstp+(n-4)), "2" (srcp+(n-4)) \ + : "memory" ); \ + } \ + switch (n & 3) { \ + case 3: dstp[2] = srcp[2]; \ + case 2: dstp[1] = srcp[1]; \ + case 1: dstp[0] = srcp[0]; \ + break; \ + default: \ + break; \ + } \ +} while(0) +#endif +#ifndef SDL_revcpy +extern DECLSPEC void * SDLCALL SDL_revcpy(void *dst, const void *src, size_t len); +#endif + +#ifdef HAVE_MEMMOVE +#define SDL_memmove memmove +#elif defined(HAVE_BCOPY) +#define SDL_memmove(d, s, n) bcopy((s), (d), (n)) +#else +#define SDL_memmove(dst, src, len) \ +do { \ + if ( dst < src ) { \ + SDL_memcpy(dst, src, len); \ + } else { \ + SDL_revcpy(dst, src, len); \ + } \ +} while(0) +#endif + +#ifdef HAVE_MEMCMP +#define SDL_memcmp memcmp +#else +extern DECLSPEC int SDLCALL SDL_memcmp(const void *s1, const void *s2, size_t len); +#endif + +#ifdef HAVE_STRLEN +#define SDL_strlen strlen +#else +extern DECLSPEC size_t SDLCALL SDL_strlen(const char *string); +#endif + +#ifdef HAVE_STRLCPY +#define SDL_strlcpy strlcpy +#else +extern DECLSPEC size_t SDLCALL SDL_strlcpy(char *dst, const char *src, size_t maxlen); +#endif + +#ifdef HAVE_STRLCAT +#define SDL_strlcat strlcat +#else +extern DECLSPEC size_t SDLCALL SDL_strlcat(char *dst, const char *src, size_t maxlen); +#endif + +#ifdef HAVE_STRDUP +#define SDL_strdup strdup +#else +extern DECLSPEC char * SDLCALL SDL_strdup(const char *string); +#endif + +#ifdef HAVE__STRREV +#define SDL_strrev _strrev +#else +extern DECLSPEC char * SDLCALL SDL_strrev(char *string); +#endif + +#ifdef HAVE__STRUPR +#define SDL_strupr _strupr +#else +extern DECLSPEC char * SDLCALL SDL_strupr(char *string); +#endif + +#ifdef HAVE__STRLWR +#define SDL_strlwr _strlwr +#else +extern DECLSPEC char * SDLCALL SDL_strlwr(char *string); +#endif + +#ifdef HAVE_STRCHR +#define SDL_strchr strchr +#elif defined(HAVE_INDEX) +#define SDL_strchr index +#else +extern DECLSPEC char * SDLCALL SDL_strchr(const char *string, int c); +#endif + +#ifdef HAVE_STRRCHR +#define SDL_strrchr strrchr +#elif defined(HAVE_RINDEX) +#define SDL_strrchr rindex +#else +extern DECLSPEC char * SDLCALL SDL_strrchr(const char *string, int c); +#endif + +#ifdef HAVE_STRSTR +#define SDL_strstr strstr +#else +extern DECLSPEC char * SDLCALL SDL_strstr(const char *haystack, const char *needle); +#endif + +#ifdef HAVE_ITOA +#define SDL_itoa itoa +#else +#define SDL_itoa(value, string, radix) SDL_ltoa((long)value, string, radix) +#endif + +#ifdef HAVE__LTOA +#define SDL_ltoa _ltoa +#else +extern DECLSPEC char * SDLCALL SDL_ltoa(long value, char *string, int radix); +#endif + +#ifdef HAVE__UITOA +#define SDL_uitoa _uitoa +#else +#define SDL_uitoa(value, string, radix) SDL_ultoa((long)value, string, radix) +#endif + +#ifdef HAVE__ULTOA +#define SDL_ultoa _ultoa +#else +extern DECLSPEC char * SDLCALL SDL_ultoa(unsigned long value, char *string, int radix); +#endif + +#ifdef HAVE_STRTOL +#define SDL_strtol strtol +#else +extern DECLSPEC long SDLCALL SDL_strtol(const char *string, char **endp, int base); +#endif + +#ifdef HAVE_STRTOUL +#define SDL_strtoul strtoul +#else +extern DECLSPEC unsigned long SDLCALL SDL_strtoul(const char *string, char **endp, int base); +#endif + +#ifdef SDL_HAS_64BIT_TYPE + +#ifdef HAVE__I64TOA +#define SDL_lltoa _i64toa +#else +extern DECLSPEC char* SDLCALL SDL_lltoa(Sint64 value, char *string, int radix); +#endif + +#ifdef HAVE__UI64TOA +#define SDL_ulltoa _ui64toa +#else +extern DECLSPEC char* SDLCALL SDL_ulltoa(Uint64 value, char *string, int radix); +#endif + +#ifdef HAVE_STRTOLL +#define SDL_strtoll strtoll +#else +extern DECLSPEC Sint64 SDLCALL SDL_strtoll(const char *string, char **endp, int base); +#endif + +#ifdef HAVE_STRTOULL +#define SDL_strtoull strtoull +#else +extern DECLSPEC Uint64 SDLCALL SDL_strtoull(const char *string, char **endp, int base); +#endif + +#endif /* SDL_HAS_64BIT_TYPE */ + +#ifdef HAVE_STRTOD +#define SDL_strtod strtod +#else +extern DECLSPEC double SDLCALL SDL_strtod(const char *string, char **endp); +#endif + +#ifdef HAVE_ATOI +#define SDL_atoi atoi +#else +#define SDL_atoi(X) SDL_strtol(X, NULL, 0) +#endif + +#ifdef HAVE_ATOF +#define SDL_atof atof +#else +#define SDL_atof(X) SDL_strtod(X, NULL) +#endif + +#ifdef HAVE_STRCMP +#define SDL_strcmp strcmp +#else +extern DECLSPEC int SDLCALL SDL_strcmp(const char *str1, const char *str2); +#endif + +#ifdef HAVE_STRNCMP +#define SDL_strncmp strncmp +#else +extern DECLSPEC int SDLCALL SDL_strncmp(const char *str1, const char *str2, size_t maxlen); +#endif + +#ifdef HAVE_STRCASECMP +#define SDL_strcasecmp strcasecmp +#elif defined(HAVE__STRICMP) +#define SDL_strcasecmp _stricmp +#else +extern DECLSPEC int SDLCALL SDL_strcasecmp(const char *str1, const char *str2); +#endif + +#ifdef HAVE_STRNCASECMP +#define SDL_strncasecmp strncasecmp +#elif defined(HAVE__STRNICMP) +#define SDL_strncasecmp _strnicmp +#else +extern DECLSPEC int SDLCALL SDL_strncasecmp(const char *str1, const char *str2, size_t maxlen); +#endif + +#ifdef HAVE_SSCANF +#define SDL_sscanf sscanf +#else +extern DECLSPEC int SDLCALL SDL_sscanf(const char *text, const char *fmt, ...); +#endif + +#ifdef HAVE_SNPRINTF +#define SDL_snprintf snprintf +#else +extern DECLSPEC int SDLCALL SDL_snprintf(char *text, size_t maxlen, const char *fmt, ...); +#endif + +#ifdef HAVE_VSNPRINTF +#define SDL_vsnprintf vsnprintf +#else +extern DECLSPEC int SDLCALL SDL_vsnprintf(char *text, size_t maxlen, const char *fmt, va_list ap); +#endif + +/** @name SDL_ICONV Error Codes + * The SDL implementation of iconv() returns these error codes + */ +/*@{*/ +#define SDL_ICONV_ERROR (size_t)-1 +#define SDL_ICONV_E2BIG (size_t)-2 +#define SDL_ICONV_EILSEQ (size_t)-3 +#define SDL_ICONV_EINVAL (size_t)-4 +/*@}*/ + +#if defined(HAVE_ICONV) && defined(HAVE_ICONV_H) +#define SDL_iconv_t iconv_t +#define SDL_iconv_open iconv_open +#define SDL_iconv_close iconv_close +#else +typedef struct _SDL_iconv_t *SDL_iconv_t; +extern DECLSPEC SDL_iconv_t SDLCALL SDL_iconv_open(const char *tocode, const char *fromcode); +extern DECLSPEC int SDLCALL SDL_iconv_close(SDL_iconv_t cd); +#endif +extern DECLSPEC size_t SDLCALL SDL_iconv(SDL_iconv_t cd, const char **inbuf, size_t *inbytesleft, char **outbuf, size_t *outbytesleft); +/** This function converts a string between encodings in one pass, returning a + * string that must be freed with SDL_free() or NULL on error. + */ +extern DECLSPEC char * SDLCALL SDL_iconv_string(const char *tocode, const char *fromcode, const char *inbuf, size_t inbytesleft); +#define SDL_iconv_utf8_locale(S) SDL_iconv_string("", "UTF-8", S, SDL_strlen(S)+1) +#define SDL_iconv_utf8_ucs2(S) (Uint16 *)SDL_iconv_string("UCS-2", "UTF-8", S, SDL_strlen(S)+1) +#define SDL_iconv_utf8_ucs4(S) (Uint32 *)SDL_iconv_string("UCS-4", "UTF-8", S, SDL_strlen(S)+1) + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* _SDL_stdinc_h */ diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/include/SDL_syswm.h b/dep/recastnavigation/RecastDemo/Contrib/SDL/include/SDL_syswm.h new file mode 100644 index 000000000..716dddcb7 --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/include/SDL_syswm.h @@ -0,0 +1,225 @@ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + Sam Lantinga + slouken@libsdl.org +*/ + +/** @file SDL_syswm.h + * Include file for SDL custom system window manager hooks + */ + +#ifndef _SDL_syswm_h +#define _SDL_syswm_h + +#include "SDL_stdinc.h" +#include "SDL_error.h" +#include "SDL_version.h" + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/** @file SDL_syswm.h + * Your application has access to a special type of event 'SDL_SYSWMEVENT', + * which contains window-manager specific information and arrives whenever + * an unhandled window event occurs. This event is ignored by default, but + * you can enable it with SDL_EventState() + */ +#ifdef SDL_PROTOTYPES_ONLY +struct SDL_SysWMinfo; +typedef struct SDL_SysWMinfo SDL_SysWMinfo; +#else + +/* This is the structure for custom window manager events */ +#if defined(SDL_VIDEO_DRIVER_X11) +#if defined(__APPLE__) && defined(__MACH__) +/* conflicts with Quickdraw.h */ +#define Cursor X11Cursor +#endif + +#include +#include + +#if defined(__APPLE__) && defined(__MACH__) +/* matches the re-define above */ +#undef Cursor +#endif + +/** These are the various supported subsystems under UNIX */ +typedef enum { + SDL_SYSWM_X11 +} SDL_SYSWM_TYPE; + +/** The UNIX custom event structure */ +struct SDL_SysWMmsg { + SDL_version version; + SDL_SYSWM_TYPE subsystem; + union { + XEvent xevent; + } event; +}; + +/** The UNIX custom window manager information structure. + * When this structure is returned, it holds information about which + * low level system it is using, and will be one of SDL_SYSWM_TYPE. + */ +typedef struct SDL_SysWMinfo { + SDL_version version; + SDL_SYSWM_TYPE subsystem; + union { + struct { + Display *display; /**< The X11 display */ + Window window; /**< The X11 display window */ + /** These locking functions should be called around + * any X11 functions using the display variable, + * but not the gfxdisplay variable. + * They lock the event thread, so should not be + * called around event functions or from event filters. + */ + /*@{*/ + void (*lock_func)(void); + void (*unlock_func)(void); + /*@}*/ + + /** @name Introduced in SDL 1.0.2 */ + /*@{*/ + Window fswindow; /**< The X11 fullscreen window */ + Window wmwindow; /**< The X11 managed input window */ + /*@}*/ + + /** @name Introduced in SDL 1.2.12 */ + /*@{*/ + Display *gfxdisplay; /**< The X11 display to which rendering is done */ + /*@}*/ + } x11; + } info; +} SDL_SysWMinfo; + +#elif defined(SDL_VIDEO_DRIVER_NANOX) +#include + +/** The generic custom event structure */ +struct SDL_SysWMmsg { + SDL_version version; + int data; +}; + +/** The windows custom window manager information structure */ +typedef struct SDL_SysWMinfo { + SDL_version version ; + GR_WINDOW_ID window ; /* The display window */ +} SDL_SysWMinfo; + +#elif defined(SDL_VIDEO_DRIVER_WINDIB) || defined(SDL_VIDEO_DRIVER_DDRAW) || defined(SDL_VIDEO_DRIVER_GAPI) +#define WIN32_LEAN_AND_MEAN +#include + +/** The windows custom event structure */ +struct SDL_SysWMmsg { + SDL_version version; + HWND hwnd; /**< The window for the message */ + UINT msg; /**< The type of message */ + WPARAM wParam; /**< WORD message parameter */ + LPARAM lParam; /**< LONG message parameter */ +}; + +/** The windows custom window manager information structure */ +typedef struct SDL_SysWMinfo { + SDL_version version; + HWND window; /**< The Win32 display window */ + HGLRC hglrc; /**< The OpenGL context, if any */ +} SDL_SysWMinfo; + +#elif defined(SDL_VIDEO_DRIVER_RISCOS) + +/** RISC OS custom event structure */ +struct SDL_SysWMmsg { + SDL_version version; + int eventCode; /**< The window for the message */ + int pollBlock[64]; +}; + +/** The RISC OS custom window manager information structure */ +typedef struct SDL_SysWMinfo { + SDL_version version; + int wimpVersion; /**< Wimp version running under */ + int taskHandle; /**< The RISC OS task handle */ + int window; /**< The RISC OS display window */ +} SDL_SysWMinfo; + +#elif defined(SDL_VIDEO_DRIVER_PHOTON) +#include +#include + +/** The QNX custom event structure */ +struct SDL_SysWMmsg { + SDL_version version; + int data; +}; + +/** The QNX custom window manager information structure */ +typedef struct SDL_SysWMinfo { + SDL_version version; + int data; +} SDL_SysWMinfo; + +#else + +/** The generic custom event structure */ +struct SDL_SysWMmsg { + SDL_version version; + int data; +}; + +/** The generic custom window manager information structure */ +typedef struct SDL_SysWMinfo { + SDL_version version; + int data; +} SDL_SysWMinfo; + +#endif /* video driver type */ + +#endif /* SDL_PROTOTYPES_ONLY */ + +/* Function prototypes */ +/** + * This function gives you custom hooks into the window manager information. + * It fills the structure pointed to by 'info' with custom information and + * returns 1 if the function is implemented. If it's not implemented, or + * the version member of the 'info' structure is invalid, it returns 0. + * + * You typically use this function like this: + * @code + * SDL_SysWMInfo info; + * SDL_VERSION(&info.version); + * if ( SDL_GetWMInfo(&info) ) { ... } + * @endcode + */ +extern DECLSPEC int SDLCALL SDL_GetWMInfo(SDL_SysWMinfo *info); + + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* _SDL_syswm_h */ diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/include/SDL_thread.h b/dep/recastnavigation/RecastDemo/Contrib/SDL/include/SDL_thread.h new file mode 100644 index 000000000..1ca9a1bc4 --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/include/SDL_thread.h @@ -0,0 +1,120 @@ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + Sam Lantinga + slouken@libsdl.org +*/ + +#ifndef _SDL_thread_h +#define _SDL_thread_h + +/** @file SDL_thread.h + * Header for the SDL thread management routines + * + * @note These are independent of the other SDL routines. + */ + +#include "SDL_stdinc.h" +#include "SDL_error.h" + +/* Thread synchronization primitives */ +#include "SDL_mutex.h" + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/** The SDL thread structure, defined in SDL_thread.c */ +struct SDL_Thread; +typedef struct SDL_Thread SDL_Thread; + +/** Create a thread */ +#if ((defined(__WIN32__) && !defined(HAVE_LIBC)) || defined(__OS2__)) && !defined(__SYMBIAN32__) +/** + * We compile SDL into a DLL on OS/2. This means, that it's the DLL which + * creates a new thread for the calling process with the SDL_CreateThread() + * API. There is a problem with this, that only the RTL of the SDL.DLL will + * be initialized for those threads, and not the RTL of the calling application! + * To solve this, we make a little hack here. + * We'll always use the caller's _beginthread() and _endthread() APIs to + * start a new thread. This way, if it's the SDL.DLL which uses this API, + * then the RTL of SDL.DLL will be used to create the new thread, and if it's + * the application, then the RTL of the application will be used. + * So, in short: + * Always use the _beginthread() and _endthread() of the calling runtime library! + */ +#define SDL_PASSED_BEGINTHREAD_ENDTHREAD +#ifndef _WIN32_WCE +#include /* This has _beginthread() and _endthread() defined! */ +#endif + +#ifdef __OS2__ +typedef int (*pfnSDL_CurrentBeginThread)(void (*func)(void *), void *, unsigned, void *arg); +typedef void (*pfnSDL_CurrentEndThread)(void); +#elif __GNUC__ +typedef unsigned long (__cdecl *pfnSDL_CurrentBeginThread) (void *, unsigned, + unsigned (__stdcall *func)(void *), void *arg, + unsigned, unsigned *threadID); +typedef void (__cdecl *pfnSDL_CurrentEndThread)(unsigned code); +#else +typedef uintptr_t (__cdecl *pfnSDL_CurrentBeginThread) (void *, unsigned, + unsigned (__stdcall *func)(void *), void *arg, + unsigned, unsigned *threadID); +typedef void (__cdecl *pfnSDL_CurrentEndThread)(unsigned code); +#endif + +extern DECLSPEC SDL_Thread * SDLCALL SDL_CreateThread(int (SDLCALL *fn)(void *), void *data, pfnSDL_CurrentBeginThread pfnBeginThread, pfnSDL_CurrentEndThread pfnEndThread); + +#ifdef __OS2__ +#define SDL_CreateThread(fn, data) SDL_CreateThread(fn, data, _beginthread, _endthread) +#elif defined(_WIN32_WCE) +#define SDL_CreateThread(fn, data) SDL_CreateThread(fn, data, NULL, NULL) +#else +#define SDL_CreateThread(fn, data) SDL_CreateThread(fn, data, _beginthreadex, _endthreadex) +#endif +#else +extern DECLSPEC SDL_Thread * SDLCALL SDL_CreateThread(int (SDLCALL *fn)(void *), void *data); +#endif + +/** Get the 32-bit thread identifier for the current thread */ +extern DECLSPEC Uint32 SDLCALL SDL_ThreadID(void); + +/** Get the 32-bit thread identifier for the specified thread, + * equivalent to SDL_ThreadID() if the specified thread is NULL. + */ +extern DECLSPEC Uint32 SDLCALL SDL_GetThreadID(SDL_Thread *thread); + +/** Wait for a thread to finish. + * The return code for the thread function is placed in the area + * pointed to by 'status', if 'status' is not NULL. + */ +extern DECLSPEC void SDLCALL SDL_WaitThread(SDL_Thread *thread, int *status); + +/** Forcefully kill a thread without worrying about its state */ +extern DECLSPEC void SDLCALL SDL_KillThread(SDL_Thread *thread); + + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* _SDL_thread_h */ diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/include/SDL_timer.h b/dep/recastnavigation/RecastDemo/Contrib/SDL/include/SDL_timer.h new file mode 100644 index 000000000..d7cd02460 --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/include/SDL_timer.h @@ -0,0 +1,125 @@ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + Sam Lantinga + slouken@libsdl.org +*/ + +#ifndef _SDL_timer_h +#define _SDL_timer_h + +/** @file SDL_timer.h + * Header for the SDL time management routines + */ + +#include "SDL_stdinc.h" +#include "SDL_error.h" + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/** This is the OS scheduler timeslice, in milliseconds */ +#define SDL_TIMESLICE 10 + +/** This is the maximum resolution of the SDL timer on all platforms */ +#define TIMER_RESOLUTION 10 /**< Experimentally determined */ + +/** + * Get the number of milliseconds since the SDL library initialization. + * Note that this value wraps if the program runs for more than ~49 days. + */ +extern DECLSPEC Uint32 SDLCALL SDL_GetTicks(void); + +/** Wait a specified number of milliseconds before returning */ +extern DECLSPEC void SDLCALL SDL_Delay(Uint32 ms); + +/** Function prototype for the timer callback function */ +typedef Uint32 (SDLCALL *SDL_TimerCallback)(Uint32 interval); + +/** + * Set a callback to run after the specified number of milliseconds has + * elapsed. The callback function is passed the current timer interval + * and returns the next timer interval. If the returned value is the + * same as the one passed in, the periodic alarm continues, otherwise a + * new alarm is scheduled. If the callback returns 0, the periodic alarm + * is cancelled. + * + * To cancel a currently running timer, call SDL_SetTimer(0, NULL); + * + * The timer callback function may run in a different thread than your + * main code, and so shouldn't call any functions from within itself. + * + * The maximum resolution of this timer is 10 ms, which means that if + * you request a 16 ms timer, your callback will run approximately 20 ms + * later on an unloaded system. If you wanted to set a flag signaling + * a frame update at 30 frames per second (every 33 ms), you might set a + * timer for 30 ms: + * @code SDL_SetTimer((33/10)*10, flag_update); @endcode + * + * If you use this function, you need to pass SDL_INIT_TIMER to SDL_Init(). + * + * Under UNIX, you should not use raise or use SIGALRM and this function + * in the same program, as it is implemented using setitimer(). You also + * should not use this function in multi-threaded applications as signals + * to multi-threaded apps have undefined behavior in some implementations. + * + * This function returns 0 if successful, or -1 if there was an error. + */ +extern DECLSPEC int SDLCALL SDL_SetTimer(Uint32 interval, SDL_TimerCallback callback); + +/** @name New timer API + * New timer API, supports multiple timers + * Written by Stephane Peter + */ +/*@{*/ + +/** + * Function prototype for the new timer callback function. + * The callback function is passed the current timer interval and returns + * the next timer interval. If the returned value is the same as the one + * passed in, the periodic alarm continues, otherwise a new alarm is + * scheduled. If the callback returns 0, the periodic alarm is cancelled. + */ +typedef Uint32 (SDLCALL *SDL_NewTimerCallback)(Uint32 interval, void *param); + +/** Definition of the timer ID type */ +typedef struct _SDL_TimerID *SDL_TimerID; + +/** Add a new timer to the pool of timers already running. + * Returns a timer ID, or NULL when an error occurs. + */ +extern DECLSPEC SDL_TimerID SDLCALL SDL_AddTimer(Uint32 interval, SDL_NewTimerCallback callback, void *param); + +/** + * Remove one of the multiple timers knowing its ID. + * Returns a boolean value indicating success. + */ +extern DECLSPEC SDL_bool SDLCALL SDL_RemoveTimer(SDL_TimerID t); + +/*@}*/ + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* _SDL_timer_h */ diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/include/SDL_types.h b/dep/recastnavigation/RecastDemo/Contrib/SDL/include/SDL_types.h new file mode 100644 index 000000000..cfa35236a --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/include/SDL_types.h @@ -0,0 +1,28 @@ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + Sam Lantinga + slouken@libsdl.org +*/ + +/** @file SDL_types.h + * @deprecated Use SDL_stdinc.h instead. + */ + +/* DEPRECATED */ +#include "SDL_stdinc.h" diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/include/SDL_version.h b/dep/recastnavigation/RecastDemo/Contrib/SDL/include/SDL_version.h new file mode 100644 index 000000000..fa02c3f6d --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/include/SDL_version.h @@ -0,0 +1,91 @@ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + Sam Lantinga + slouken@libsdl.org +*/ + +/** @file SDL_version.h + * This header defines the current SDL version + */ + +#ifndef _SDL_version_h +#define _SDL_version_h + +#include "SDL_stdinc.h" + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/** @name Version Number + * Printable format: "%d.%d.%d", MAJOR, MINOR, PATCHLEVEL + */ +/*@{*/ +#define SDL_MAJOR_VERSION 1 +#define SDL_MINOR_VERSION 2 +#define SDL_PATCHLEVEL 14 +/*@}*/ + +typedef struct SDL_version { + Uint8 major; + Uint8 minor; + Uint8 patch; +} SDL_version; + +/** + * This macro can be used to fill a version structure with the compile-time + * version of the SDL library. + */ +#define SDL_VERSION(X) \ +{ \ + (X)->major = SDL_MAJOR_VERSION; \ + (X)->minor = SDL_MINOR_VERSION; \ + (X)->patch = SDL_PATCHLEVEL; \ +} + +/** This macro turns the version numbers into a numeric value: + * (1,2,3) -> (1203) + * This assumes that there will never be more than 100 patchlevels + */ +#define SDL_VERSIONNUM(X, Y, Z) \ + ((X)*1000 + (Y)*100 + (Z)) + +/** This is the version number macro for the current SDL version */ +#define SDL_COMPILEDVERSION \ + SDL_VERSIONNUM(SDL_MAJOR_VERSION, SDL_MINOR_VERSION, SDL_PATCHLEVEL) + +/** This macro will evaluate to true if compiled with SDL at least X.Y.Z */ +#define SDL_VERSION_ATLEAST(X, Y, Z) \ + (SDL_COMPILEDVERSION >= SDL_VERSIONNUM(X, Y, Z)) + +/** This function gets the version of the dynamically linked SDL library. + * it should NOT be used to fill a version structure, instead you should + * use the SDL_Version() macro. + */ +extern DECLSPEC const SDL_version * SDLCALL SDL_Linked_Version(void); + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* _SDL_version_h */ diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/include/SDL_video.h b/dep/recastnavigation/RecastDemo/Contrib/SDL/include/SDL_video.h new file mode 100644 index 000000000..8f7f30520 --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/include/SDL_video.h @@ -0,0 +1,951 @@ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + Sam Lantinga + slouken@libsdl.org +*/ + +/** @file SDL_video.h + * Header file for access to the SDL raw framebuffer window + */ + +#ifndef _SDL_video_h +#define _SDL_video_h + +#include "SDL_stdinc.h" +#include "SDL_error.h" +#include "SDL_rwops.h" + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/** @name Transparency definitions + * These define alpha as the opacity of a surface + */ +/*@{*/ +#define SDL_ALPHA_OPAQUE 255 +#define SDL_ALPHA_TRANSPARENT 0 +/*@}*/ + +/** @name Useful data types */ +/*@{*/ +typedef struct SDL_Rect { + Sint16 x, y; + Uint16 w, h; +} SDL_Rect; + +typedef struct SDL_Color { + Uint8 r; + Uint8 g; + Uint8 b; + Uint8 unused; +} SDL_Color; +#define SDL_Colour SDL_Color + +typedef struct SDL_Palette { + int ncolors; + SDL_Color *colors; +} SDL_Palette; +/*@}*/ + +/** Everything in the pixel format structure is read-only */ +typedef struct SDL_PixelFormat { + SDL_Palette *palette; + Uint8 BitsPerPixel; + Uint8 BytesPerPixel; + Uint8 Rloss; + Uint8 Gloss; + Uint8 Bloss; + Uint8 Aloss; + Uint8 Rshift; + Uint8 Gshift; + Uint8 Bshift; + Uint8 Ashift; + Uint32 Rmask; + Uint32 Gmask; + Uint32 Bmask; + Uint32 Amask; + + /** RGB color key information */ + Uint32 colorkey; + /** Alpha value information (per-surface alpha) */ + Uint8 alpha; +} SDL_PixelFormat; + +/** This structure should be treated as read-only, except for 'pixels', + * which, if not NULL, contains the raw pixel data for the surface. + */ +typedef struct SDL_Surface { + Uint32 flags; /**< Read-only */ + SDL_PixelFormat *format; /**< Read-only */ + int w, h; /**< Read-only */ + Uint16 pitch; /**< Read-only */ + void *pixels; /**< Read-write */ + int offset; /**< Private */ + + /** Hardware-specific surface info */ + struct private_hwdata *hwdata; + + /** clipping information */ + SDL_Rect clip_rect; /**< Read-only */ + Uint32 unused1; /**< for binary compatibility */ + + /** Allow recursive locks */ + Uint32 locked; /**< Private */ + + /** info for fast blit mapping to other surfaces */ + struct SDL_BlitMap *map; /**< Private */ + + /** format version, bumped at every change to invalidate blit maps */ + unsigned int format_version; /**< Private */ + + /** Reference count -- used when freeing surface */ + int refcount; /**< Read-mostly */ +} SDL_Surface; + +/** @name SDL_Surface Flags + * These are the currently supported flags for the SDL_surface + */ +/*@{*/ + +/** Available for SDL_CreateRGBSurface() or SDL_SetVideoMode() */ +/*@{*/ +#define SDL_SWSURFACE 0x00000000 /**< Surface is in system memory */ +#define SDL_HWSURFACE 0x00000001 /**< Surface is in video memory */ +#define SDL_ASYNCBLIT 0x00000004 /**< Use asynchronous blits if possible */ +/*@}*/ + +/** Available for SDL_SetVideoMode() */ +/*@{*/ +#define SDL_ANYFORMAT 0x10000000 /**< Allow any video depth/pixel-format */ +#define SDL_HWPALETTE 0x20000000 /**< Surface has exclusive palette */ +#define SDL_DOUBLEBUF 0x40000000 /**< Set up double-buffered video mode */ +#define SDL_FULLSCREEN 0x80000000 /**< Surface is a full screen display */ +#define SDL_OPENGL 0x00000002 /**< Create an OpenGL rendering context */ +#define SDL_OPENGLBLIT 0x0000000A /**< Create an OpenGL rendering context and use it for blitting */ +#define SDL_RESIZABLE 0x00000010 /**< This video mode may be resized */ +#define SDL_NOFRAME 0x00000020 /**< No window caption or edge frame */ +/*@}*/ + +/** Used internally (read-only) */ +/*@{*/ +#define SDL_HWACCEL 0x00000100 /**< Blit uses hardware acceleration */ +#define SDL_SRCCOLORKEY 0x00001000 /**< Blit uses a source color key */ +#define SDL_RLEACCELOK 0x00002000 /**< Private flag */ +#define SDL_RLEACCEL 0x00004000 /**< Surface is RLE encoded */ +#define SDL_SRCALPHA 0x00010000 /**< Blit uses source alpha blending */ +#define SDL_PREALLOC 0x01000000 /**< Surface uses preallocated memory */ +/*@}*/ + +/*@}*/ + +/** Evaluates to true if the surface needs to be locked before access */ +#define SDL_MUSTLOCK(surface) \ + (surface->offset || \ + ((surface->flags & (SDL_HWSURFACE|SDL_ASYNCBLIT|SDL_RLEACCEL)) != 0)) + +/** typedef for private surface blitting functions */ +typedef int (*SDL_blit)(struct SDL_Surface *src, SDL_Rect *srcrect, + struct SDL_Surface *dst, SDL_Rect *dstrect); + + +/** Useful for determining the video hardware capabilities */ +typedef struct SDL_VideoInfo { + Uint32 hw_available :1; /**< Flag: Can you create hardware surfaces? */ + Uint32 wm_available :1; /**< Flag: Can you talk to a window manager? */ + Uint32 UnusedBits1 :6; + Uint32 UnusedBits2 :1; + Uint32 blit_hw :1; /**< Flag: Accelerated blits HW --> HW */ + Uint32 blit_hw_CC :1; /**< Flag: Accelerated blits with Colorkey */ + Uint32 blit_hw_A :1; /**< Flag: Accelerated blits with Alpha */ + Uint32 blit_sw :1; /**< Flag: Accelerated blits SW --> HW */ + Uint32 blit_sw_CC :1; /**< Flag: Accelerated blits with Colorkey */ + Uint32 blit_sw_A :1; /**< Flag: Accelerated blits with Alpha */ + Uint32 blit_fill :1; /**< Flag: Accelerated color fill */ + Uint32 UnusedBits3 :16; + Uint32 video_mem; /**< The total amount of video memory (in K) */ + SDL_PixelFormat *vfmt; /**< Value: The format of the video surface */ + int current_w; /**< Value: The current video mode width */ + int current_h; /**< Value: The current video mode height */ +} SDL_VideoInfo; + + +/** @name Overlay Formats + * The most common video overlay formats. + * For an explanation of these pixel formats, see: + * http://www.webartz.com/fourcc/indexyuv.htm + * + * For information on the relationship between color spaces, see: + * http://www.neuro.sfc.keio.ac.jp/~aly/polygon/info/color-space-faq.html + */ +/*@{*/ +#define SDL_YV12_OVERLAY 0x32315659 /**< Planar mode: Y + V + U (3 planes) */ +#define SDL_IYUV_OVERLAY 0x56555949 /**< Planar mode: Y + U + V (3 planes) */ +#define SDL_YUY2_OVERLAY 0x32595559 /**< Packed mode: Y0+U0+Y1+V0 (1 plane) */ +#define SDL_UYVY_OVERLAY 0x59565955 /**< Packed mode: U0+Y0+V0+Y1 (1 plane) */ +#define SDL_YVYU_OVERLAY 0x55595659 /**< Packed mode: Y0+V0+Y1+U0 (1 plane) */ +/*@}*/ + +/** The YUV hardware video overlay */ +typedef struct SDL_Overlay { + Uint32 format; /**< Read-only */ + int w, h; /**< Read-only */ + int planes; /**< Read-only */ + Uint16 *pitches; /**< Read-only */ + Uint8 **pixels; /**< Read-write */ + + /** @name Hardware-specific surface info */ + /*@{*/ + struct private_yuvhwfuncs *hwfuncs; + struct private_yuvhwdata *hwdata; + /*@{*/ + + /** @name Special flags */ + /*@{*/ + Uint32 hw_overlay :1; /**< Flag: This overlay hardware accelerated? */ + Uint32 UnusedBits :31; + /*@}*/ +} SDL_Overlay; + + +/** Public enumeration for setting the OpenGL window attributes. */ +typedef enum { + SDL_GL_RED_SIZE, + SDL_GL_GREEN_SIZE, + SDL_GL_BLUE_SIZE, + SDL_GL_ALPHA_SIZE, + SDL_GL_BUFFER_SIZE, + SDL_GL_DOUBLEBUFFER, + SDL_GL_DEPTH_SIZE, + SDL_GL_STENCIL_SIZE, + SDL_GL_ACCUM_RED_SIZE, + SDL_GL_ACCUM_GREEN_SIZE, + SDL_GL_ACCUM_BLUE_SIZE, + SDL_GL_ACCUM_ALPHA_SIZE, + SDL_GL_STEREO, + SDL_GL_MULTISAMPLEBUFFERS, + SDL_GL_MULTISAMPLESAMPLES, + SDL_GL_ACCELERATED_VISUAL, + SDL_GL_SWAP_CONTROL +} SDL_GLattr; + +/** @name flags for SDL_SetPalette() */ +/*@{*/ +#define SDL_LOGPAL 0x01 +#define SDL_PHYSPAL 0x02 +/*@}*/ + +/* Function prototypes */ + +/** + * @name Video Init and Quit + * These functions are used internally, and should not be used unless you + * have a specific need to specify the video driver you want to use. + * You should normally use SDL_Init() or SDL_InitSubSystem(). + */ +/*@{*/ +/** + * Initializes the video subsystem. Sets up a connection + * to the window manager, etc, and determines the current video mode and + * pixel format, but does not initialize a window or graphics mode. + * Note that event handling is activated by this routine. + * + * If you use both sound and video in your application, you need to call + * SDL_Init() before opening the sound device, otherwise under Win32 DirectX, + * you won't be able to set full-screen display modes. + */ +extern DECLSPEC int SDLCALL SDL_VideoInit(const char *driver_name, Uint32 flags); +extern DECLSPEC void SDLCALL SDL_VideoQuit(void); +/*@}*/ + +/** + * This function fills the given character buffer with the name of the + * video driver, and returns a pointer to it if the video driver has + * been initialized. It returns NULL if no driver has been initialized. + */ +extern DECLSPEC char * SDLCALL SDL_VideoDriverName(char *namebuf, int maxlen); + +/** + * This function returns a pointer to the current display surface. + * If SDL is doing format conversion on the display surface, this + * function returns the publicly visible surface, not the real video + * surface. + */ +extern DECLSPEC SDL_Surface * SDLCALL SDL_GetVideoSurface(void); + +/** + * This function returns a read-only pointer to information about the + * video hardware. If this is called before SDL_SetVideoMode(), the 'vfmt' + * member of the returned structure will contain the pixel format of the + * "best" video mode. + */ +extern DECLSPEC const SDL_VideoInfo * SDLCALL SDL_GetVideoInfo(void); + +/** + * Check to see if a particular video mode is supported. + * It returns 0 if the requested mode is not supported under any bit depth, + * or returns the bits-per-pixel of the closest available mode with the + * given width and height. If this bits-per-pixel is different from the + * one used when setting the video mode, SDL_SetVideoMode() will succeed, + * but will emulate the requested bits-per-pixel with a shadow surface. + * + * The arguments to SDL_VideoModeOK() are the same ones you would pass to + * SDL_SetVideoMode() + */ +extern DECLSPEC int SDLCALL SDL_VideoModeOK(int width, int height, int bpp, Uint32 flags); + +/** + * Return a pointer to an array of available screen dimensions for the + * given format and video flags, sorted largest to smallest. Returns + * NULL if there are no dimensions available for a particular format, + * or (SDL_Rect **)-1 if any dimension is okay for the given format. + * + * If 'format' is NULL, the mode list will be for the format given + * by SDL_GetVideoInfo()->vfmt + */ +extern DECLSPEC SDL_Rect ** SDLCALL SDL_ListModes(SDL_PixelFormat *format, Uint32 flags); + +/** + * Set up a video mode with the specified width, height and bits-per-pixel. + * + * If 'bpp' is 0, it is treated as the current display bits per pixel. + * + * If SDL_ANYFORMAT is set in 'flags', the SDL library will try to set the + * requested bits-per-pixel, but will return whatever video pixel format is + * available. The default is to emulate the requested pixel format if it + * is not natively available. + * + * If SDL_HWSURFACE is set in 'flags', the video surface will be placed in + * video memory, if possible, and you may have to call SDL_LockSurface() + * in order to access the raw framebuffer. Otherwise, the video surface + * will be created in system memory. + * + * If SDL_ASYNCBLIT is set in 'flags', SDL will try to perform rectangle + * updates asynchronously, but you must always lock before accessing pixels. + * SDL will wait for updates to complete before returning from the lock. + * + * If SDL_HWPALETTE is set in 'flags', the SDL library will guarantee + * that the colors set by SDL_SetColors() will be the colors you get. + * Otherwise, in 8-bit mode, SDL_SetColors() may not be able to set all + * of the colors exactly the way they are requested, and you should look + * at the video surface structure to determine the actual palette. + * If SDL cannot guarantee that the colors you request can be set, + * i.e. if the colormap is shared, then the video surface may be created + * under emulation in system memory, overriding the SDL_HWSURFACE flag. + * + * If SDL_FULLSCREEN is set in 'flags', the SDL library will try to set + * a fullscreen video mode. The default is to create a windowed mode + * if the current graphics system has a window manager. + * If the SDL library is able to set a fullscreen video mode, this flag + * will be set in the surface that is returned. + * + * If SDL_DOUBLEBUF is set in 'flags', the SDL library will try to set up + * two surfaces in video memory and swap between them when you call + * SDL_Flip(). This is usually slower than the normal single-buffering + * scheme, but prevents "tearing" artifacts caused by modifying video + * memory while the monitor is refreshing. It should only be used by + * applications that redraw the entire screen on every update. + * + * If SDL_RESIZABLE is set in 'flags', the SDL library will allow the + * window manager, if any, to resize the window at runtime. When this + * occurs, SDL will send a SDL_VIDEORESIZE event to you application, + * and you must respond to the event by re-calling SDL_SetVideoMode() + * with the requested size (or another size that suits the application). + * + * If SDL_NOFRAME is set in 'flags', the SDL library will create a window + * without any title bar or frame decoration. Fullscreen video modes have + * this flag set automatically. + * + * This function returns the video framebuffer surface, or NULL if it fails. + * + * If you rely on functionality provided by certain video flags, check the + * flags of the returned surface to make sure that functionality is available. + * SDL will fall back to reduced functionality if the exact flags you wanted + * are not available. + */ +extern DECLSPEC SDL_Surface * SDLCALL SDL_SetVideoMode + (int width, int height, int bpp, Uint32 flags); + +/** @name SDL_Update Functions + * These functions should not be called while 'screen' is locked. + */ +/*@{*/ +/** + * Makes sure the given list of rectangles is updated on the given screen. + */ +extern DECLSPEC void SDLCALL SDL_UpdateRects + (SDL_Surface *screen, int numrects, SDL_Rect *rects); +/** + * If 'x', 'y', 'w' and 'h' are all 0, SDL_UpdateRect will update the entire + * screen. + */ +extern DECLSPEC void SDLCALL SDL_UpdateRect + (SDL_Surface *screen, Sint32 x, Sint32 y, Uint32 w, Uint32 h); +/*@}*/ + +/** + * On hardware that supports double-buffering, this function sets up a flip + * and returns. The hardware will wait for vertical retrace, and then swap + * video buffers before the next video surface blit or lock will return. + * On hardware that doesn not support double-buffering, this is equivalent + * to calling SDL_UpdateRect(screen, 0, 0, 0, 0); + * The SDL_DOUBLEBUF flag must have been passed to SDL_SetVideoMode() when + * setting the video mode for this function to perform hardware flipping. + * This function returns 0 if successful, or -1 if there was an error. + */ +extern DECLSPEC int SDLCALL SDL_Flip(SDL_Surface *screen); + +/** + * Set the gamma correction for each of the color channels. + * The gamma values range (approximately) between 0.1 and 10.0 + * + * If this function isn't supported directly by the hardware, it will + * be emulated using gamma ramps, if available. If successful, this + * function returns 0, otherwise it returns -1. + */ +extern DECLSPEC int SDLCALL SDL_SetGamma(float red, float green, float blue); + +/** + * Set the gamma translation table for the red, green, and blue channels + * of the video hardware. Each table is an array of 256 16-bit quantities, + * representing a mapping between the input and output for that channel. + * The input is the index into the array, and the output is the 16-bit + * gamma value at that index, scaled to the output color precision. + * + * You may pass NULL for any of the channels to leave it unchanged. + * If the call succeeds, it will return 0. If the display driver or + * hardware does not support gamma translation, or otherwise fails, + * this function will return -1. + */ +extern DECLSPEC int SDLCALL SDL_SetGammaRamp(const Uint16 *red, const Uint16 *green, const Uint16 *blue); + +/** + * Retrieve the current values of the gamma translation tables. + * + * You must pass in valid pointers to arrays of 256 16-bit quantities. + * Any of the pointers may be NULL to ignore that channel. + * If the call succeeds, it will return 0. If the display driver or + * hardware does not support gamma translation, or otherwise fails, + * this function will return -1. + */ +extern DECLSPEC int SDLCALL SDL_GetGammaRamp(Uint16 *red, Uint16 *green, Uint16 *blue); + +/** + * Sets a portion of the colormap for the given 8-bit surface. If 'surface' + * is not a palettized surface, this function does nothing, returning 0. + * If all of the colors were set as passed to SDL_SetColors(), it will + * return 1. If not all the color entries were set exactly as given, + * it will return 0, and you should look at the surface palette to + * determine the actual color palette. + * + * When 'surface' is the surface associated with the current display, the + * display colormap will be updated with the requested colors. If + * SDL_HWPALETTE was set in SDL_SetVideoMode() flags, SDL_SetColors() + * will always return 1, and the palette is guaranteed to be set the way + * you desire, even if the window colormap has to be warped or run under + * emulation. + */ +extern DECLSPEC int SDLCALL SDL_SetColors(SDL_Surface *surface, + SDL_Color *colors, int firstcolor, int ncolors); + +/** + * Sets a portion of the colormap for a given 8-bit surface. + * 'flags' is one or both of: + * SDL_LOGPAL -- set logical palette, which controls how blits are mapped + * to/from the surface, + * SDL_PHYSPAL -- set physical palette, which controls how pixels look on + * the screen + * Only screens have physical palettes. Separate change of physical/logical + * palettes is only possible if the screen has SDL_HWPALETTE set. + * + * The return value is 1 if all colours could be set as requested, and 0 + * otherwise. + * + * SDL_SetColors() is equivalent to calling this function with + * flags = (SDL_LOGPAL|SDL_PHYSPAL). + */ +extern DECLSPEC int SDLCALL SDL_SetPalette(SDL_Surface *surface, int flags, + SDL_Color *colors, int firstcolor, + int ncolors); + +/** + * Maps an RGB triple to an opaque pixel value for a given pixel format + */ +extern DECLSPEC Uint32 SDLCALL SDL_MapRGB +(const SDL_PixelFormat * const format, + const Uint8 r, const Uint8 g, const Uint8 b); + +/** + * Maps an RGBA quadruple to a pixel value for a given pixel format + */ +extern DECLSPEC Uint32 SDLCALL SDL_MapRGBA +(const SDL_PixelFormat * const format, + const Uint8 r, const Uint8 g, const Uint8 b, const Uint8 a); + +/** + * Maps a pixel value into the RGB components for a given pixel format + */ +extern DECLSPEC void SDLCALL SDL_GetRGB(Uint32 pixel, + const SDL_PixelFormat * const fmt, + Uint8 *r, Uint8 *g, Uint8 *b); + +/** + * Maps a pixel value into the RGBA components for a given pixel format + */ +extern DECLSPEC void SDLCALL SDL_GetRGBA(Uint32 pixel, + const SDL_PixelFormat * const fmt, + Uint8 *r, Uint8 *g, Uint8 *b, Uint8 *a); + +/** @sa SDL_CreateRGBSurface */ +#define SDL_AllocSurface SDL_CreateRGBSurface +/** + * Allocate and free an RGB surface (must be called after SDL_SetVideoMode) + * If the depth is 4 or 8 bits, an empty palette is allocated for the surface. + * If the depth is greater than 8 bits, the pixel format is set using the + * flags '[RGB]mask'. + * If the function runs out of memory, it will return NULL. + * + * The 'flags' tell what kind of surface to create. + * SDL_SWSURFACE means that the surface should be created in system memory. + * SDL_HWSURFACE means that the surface should be created in video memory, + * with the same format as the display surface. This is useful for surfaces + * that will not change much, to take advantage of hardware acceleration + * when being blitted to the display surface. + * SDL_ASYNCBLIT means that SDL will try to perform asynchronous blits with + * this surface, but you must always lock it before accessing the pixels. + * SDL will wait for current blits to finish before returning from the lock. + * SDL_SRCCOLORKEY indicates that the surface will be used for colorkey blits. + * If the hardware supports acceleration of colorkey blits between + * two surfaces in video memory, SDL will try to place the surface in + * video memory. If this isn't possible or if there is no hardware + * acceleration available, the surface will be placed in system memory. + * SDL_SRCALPHA means that the surface will be used for alpha blits and + * if the hardware supports hardware acceleration of alpha blits between + * two surfaces in video memory, to place the surface in video memory + * if possible, otherwise it will be placed in system memory. + * If the surface is created in video memory, blits will be _much_ faster, + * but the surface format must be identical to the video surface format, + * and the only way to access the pixels member of the surface is to use + * the SDL_LockSurface() and SDL_UnlockSurface() calls. + * If the requested surface actually resides in video memory, SDL_HWSURFACE + * will be set in the flags member of the returned surface. If for some + * reason the surface could not be placed in video memory, it will not have + * the SDL_HWSURFACE flag set, and will be created in system memory instead. + */ +extern DECLSPEC SDL_Surface * SDLCALL SDL_CreateRGBSurface + (Uint32 flags, int width, int height, int depth, + Uint32 Rmask, Uint32 Gmask, Uint32 Bmask, Uint32 Amask); +/** @sa SDL_CreateRGBSurface */ +extern DECLSPEC SDL_Surface * SDLCALL SDL_CreateRGBSurfaceFrom(void *pixels, + int width, int height, int depth, int pitch, + Uint32 Rmask, Uint32 Gmask, Uint32 Bmask, Uint32 Amask); +extern DECLSPEC void SDLCALL SDL_FreeSurface(SDL_Surface *surface); + +/** + * SDL_LockSurface() sets up a surface for directly accessing the pixels. + * Between calls to SDL_LockSurface()/SDL_UnlockSurface(), you can write + * to and read from 'surface->pixels', using the pixel format stored in + * 'surface->format'. Once you are done accessing the surface, you should + * use SDL_UnlockSurface() to release it. + * + * Not all surfaces require locking. If SDL_MUSTLOCK(surface) evaluates + * to 0, then you can read and write to the surface at any time, and the + * pixel format of the surface will not change. In particular, if the + * SDL_HWSURFACE flag is not given when calling SDL_SetVideoMode(), you + * will not need to lock the display surface before accessing it. + * + * No operating system or library calls should be made between lock/unlock + * pairs, as critical system locks may be held during this time. + * + * SDL_LockSurface() returns 0, or -1 if the surface couldn't be locked. + */ +extern DECLSPEC int SDLCALL SDL_LockSurface(SDL_Surface *surface); +extern DECLSPEC void SDLCALL SDL_UnlockSurface(SDL_Surface *surface); + +/** + * Load a surface from a seekable SDL data source (memory or file.) + * If 'freesrc' is non-zero, the source will be closed after being read. + * Returns the new surface, or NULL if there was an error. + * The new surface should be freed with SDL_FreeSurface(). + */ +extern DECLSPEC SDL_Surface * SDLCALL SDL_LoadBMP_RW(SDL_RWops *src, int freesrc); + +/** Convenience macro -- load a surface from a file */ +#define SDL_LoadBMP(file) SDL_LoadBMP_RW(SDL_RWFromFile(file, "rb"), 1) + +/** + * Save a surface to a seekable SDL data source (memory or file.) + * If 'freedst' is non-zero, the source will be closed after being written. + * Returns 0 if successful or -1 if there was an error. + */ +extern DECLSPEC int SDLCALL SDL_SaveBMP_RW + (SDL_Surface *surface, SDL_RWops *dst, int freedst); + +/** Convenience macro -- save a surface to a file */ +#define SDL_SaveBMP(surface, file) \ + SDL_SaveBMP_RW(surface, SDL_RWFromFile(file, "wb"), 1) + +/** + * Sets the color key (transparent pixel) in a blittable surface. + * If 'flag' is SDL_SRCCOLORKEY (optionally OR'd with SDL_RLEACCEL), + * 'key' will be the transparent pixel in the source image of a blit. + * SDL_RLEACCEL requests RLE acceleration for the surface if present, + * and removes RLE acceleration if absent. + * If 'flag' is 0, this function clears any current color key. + * This function returns 0, or -1 if there was an error. + */ +extern DECLSPEC int SDLCALL SDL_SetColorKey + (SDL_Surface *surface, Uint32 flag, Uint32 key); + +/** + * This function sets the alpha value for the entire surface, as opposed to + * using the alpha component of each pixel. This value measures the range + * of transparency of the surface, 0 being completely transparent to 255 + * being completely opaque. An 'alpha' value of 255 causes blits to be + * opaque, the source pixels copied to the destination (the default). Note + * that per-surface alpha can be combined with colorkey transparency. + * + * If 'flag' is 0, alpha blending is disabled for the surface. + * If 'flag' is SDL_SRCALPHA, alpha blending is enabled for the surface. + * OR:ing the flag with SDL_RLEACCEL requests RLE acceleration for the + * surface; if SDL_RLEACCEL is not specified, the RLE accel will be removed. + * + * The 'alpha' parameter is ignored for surfaces that have an alpha channel. + */ +extern DECLSPEC int SDLCALL SDL_SetAlpha(SDL_Surface *surface, Uint32 flag, Uint8 alpha); + +/** + * Sets the clipping rectangle for the destination surface in a blit. + * + * If the clip rectangle is NULL, clipping will be disabled. + * If the clip rectangle doesn't intersect the surface, the function will + * return SDL_FALSE and blits will be completely clipped. Otherwise the + * function returns SDL_TRUE and blits to the surface will be clipped to + * the intersection of the surface area and the clipping rectangle. + * + * Note that blits are automatically clipped to the edges of the source + * and destination surfaces. + */ +extern DECLSPEC SDL_bool SDLCALL SDL_SetClipRect(SDL_Surface *surface, const SDL_Rect *rect); + +/** + * Gets the clipping rectangle for the destination surface in a blit. + * 'rect' must be a pointer to a valid rectangle which will be filled + * with the correct values. + */ +extern DECLSPEC void SDLCALL SDL_GetClipRect(SDL_Surface *surface, SDL_Rect *rect); + +/** + * Creates a new surface of the specified format, and then copies and maps + * the given surface to it so the blit of the converted surface will be as + * fast as possible. If this function fails, it returns NULL. + * + * The 'flags' parameter is passed to SDL_CreateRGBSurface() and has those + * semantics. You can also pass SDL_RLEACCEL in the flags parameter and + * SDL will try to RLE accelerate colorkey and alpha blits in the resulting + * surface. + * + * This function is used internally by SDL_DisplayFormat(). + */ +extern DECLSPEC SDL_Surface * SDLCALL SDL_ConvertSurface + (SDL_Surface *src, SDL_PixelFormat *fmt, Uint32 flags); + +/** + * This performs a fast blit from the source surface to the destination + * surface. It assumes that the source and destination rectangles are + * the same size. If either 'srcrect' or 'dstrect' are NULL, the entire + * surface (src or dst) is copied. The final blit rectangles are saved + * in 'srcrect' and 'dstrect' after all clipping is performed. + * If the blit is successful, it returns 0, otherwise it returns -1. + * + * The blit function should not be called on a locked surface. + * + * The blit semantics for surfaces with and without alpha and colorkey + * are defined as follows: + * + * RGBA->RGB: + * SDL_SRCALPHA set: + * alpha-blend (using alpha-channel). + * SDL_SRCCOLORKEY ignored. + * SDL_SRCALPHA not set: + * copy RGB. + * if SDL_SRCCOLORKEY set, only copy the pixels matching the + * RGB values of the source colour key, ignoring alpha in the + * comparison. + * + * RGB->RGBA: + * SDL_SRCALPHA set: + * alpha-blend (using the source per-surface alpha value); + * set destination alpha to opaque. + * SDL_SRCALPHA not set: + * copy RGB, set destination alpha to source per-surface alpha value. + * both: + * if SDL_SRCCOLORKEY set, only copy the pixels matching the + * source colour key. + * + * RGBA->RGBA: + * SDL_SRCALPHA set: + * alpha-blend (using the source alpha channel) the RGB values; + * leave destination alpha untouched. [Note: is this correct?] + * SDL_SRCCOLORKEY ignored. + * SDL_SRCALPHA not set: + * copy all of RGBA to the destination. + * if SDL_SRCCOLORKEY set, only copy the pixels matching the + * RGB values of the source colour key, ignoring alpha in the + * comparison. + * + * RGB->RGB: + * SDL_SRCALPHA set: + * alpha-blend (using the source per-surface alpha value). + * SDL_SRCALPHA not set: + * copy RGB. + * both: + * if SDL_SRCCOLORKEY set, only copy the pixels matching the + * source colour key. + * + * If either of the surfaces were in video memory, and the blit returns -2, + * the video memory was lost, so it should be reloaded with artwork and + * re-blitted: + * @code + * while ( SDL_BlitSurface(image, imgrect, screen, dstrect) == -2 ) { + * while ( SDL_LockSurface(image) < 0 ) + * Sleep(10); + * -- Write image pixels to image->pixels -- + * SDL_UnlockSurface(image); + * } + * @endcode + * + * This happens under DirectX 5.0 when the system switches away from your + * fullscreen application. The lock will also fail until you have access + * to the video memory again. + * + * You should call SDL_BlitSurface() unless you know exactly how SDL + * blitting works internally and how to use the other blit functions. + */ +#define SDL_BlitSurface SDL_UpperBlit + +/** This is the public blit function, SDL_BlitSurface(), and it performs + * rectangle validation and clipping before passing it to SDL_LowerBlit() + */ +extern DECLSPEC int SDLCALL SDL_UpperBlit + (SDL_Surface *src, SDL_Rect *srcrect, + SDL_Surface *dst, SDL_Rect *dstrect); +/** This is a semi-private blit function and it performs low-level surface + * blitting only. + */ +extern DECLSPEC int SDLCALL SDL_LowerBlit + (SDL_Surface *src, SDL_Rect *srcrect, + SDL_Surface *dst, SDL_Rect *dstrect); + +/** + * This function performs a fast fill of the given rectangle with 'color' + * The given rectangle is clipped to the destination surface clip area + * and the final fill rectangle is saved in the passed in pointer. + * If 'dstrect' is NULL, the whole surface will be filled with 'color' + * The color should be a pixel of the format used by the surface, and + * can be generated by the SDL_MapRGB() function. + * This function returns 0 on success, or -1 on error. + */ +extern DECLSPEC int SDLCALL SDL_FillRect + (SDL_Surface *dst, SDL_Rect *dstrect, Uint32 color); + +/** + * This function takes a surface and copies it to a new surface of the + * pixel format and colors of the video framebuffer, suitable for fast + * blitting onto the display surface. It calls SDL_ConvertSurface() + * + * If you want to take advantage of hardware colorkey or alpha blit + * acceleration, you should set the colorkey and alpha value before + * calling this function. + * + * If the conversion fails or runs out of memory, it returns NULL + */ +extern DECLSPEC SDL_Surface * SDLCALL SDL_DisplayFormat(SDL_Surface *surface); + +/** + * This function takes a surface and copies it to a new surface of the + * pixel format and colors of the video framebuffer (if possible), + * suitable for fast alpha blitting onto the display surface. + * The new surface will always have an alpha channel. + * + * If you want to take advantage of hardware colorkey or alpha blit + * acceleration, you should set the colorkey and alpha value before + * calling this function. + * + * If the conversion fails or runs out of memory, it returns NULL + */ +extern DECLSPEC SDL_Surface * SDLCALL SDL_DisplayFormatAlpha(SDL_Surface *surface); + + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +/** @name YUV video surface overlay functions */ /*@{*/ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +/** This function creates a video output overlay + * Calling the returned surface an overlay is something of a misnomer because + * the contents of the display surface underneath the area where the overlay + * is shown is undefined - it may be overwritten with the converted YUV data. + */ +extern DECLSPEC SDL_Overlay * SDLCALL SDL_CreateYUVOverlay(int width, int height, + Uint32 format, SDL_Surface *display); + +/** Lock an overlay for direct access, and unlock it when you are done */ +extern DECLSPEC int SDLCALL SDL_LockYUVOverlay(SDL_Overlay *overlay); +extern DECLSPEC void SDLCALL SDL_UnlockYUVOverlay(SDL_Overlay *overlay); + +/** Blit a video overlay to the display surface. + * The contents of the video surface underneath the blit destination are + * not defined. + * The width and height of the destination rectangle may be different from + * that of the overlay, but currently only 2x scaling is supported. + */ +extern DECLSPEC int SDLCALL SDL_DisplayYUVOverlay(SDL_Overlay *overlay, SDL_Rect *dstrect); + +/** Free a video overlay */ +extern DECLSPEC void SDLCALL SDL_FreeYUVOverlay(SDL_Overlay *overlay); + +/*@}*/ + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +/** @name OpenGL support functions. */ /*@{*/ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +/** + * Dynamically load an OpenGL library, or the default one if path is NULL + * + * If you do this, you need to retrieve all of the GL functions used in + * your program from the dynamic library using SDL_GL_GetProcAddress(). + */ +extern DECLSPEC int SDLCALL SDL_GL_LoadLibrary(const char *path); + +/** + * Get the address of a GL function + */ +extern DECLSPEC void * SDLCALL SDL_GL_GetProcAddress(const char* proc); + +/** + * Set an attribute of the OpenGL subsystem before intialization. + */ +extern DECLSPEC int SDLCALL SDL_GL_SetAttribute(SDL_GLattr attr, int value); + +/** + * Get an attribute of the OpenGL subsystem from the windowing + * interface, such as glX. This is of course different from getting + * the values from SDL's internal OpenGL subsystem, which only + * stores the values you request before initialization. + * + * Developers should track the values they pass into SDL_GL_SetAttribute + * themselves if they want to retrieve these values. + */ +extern DECLSPEC int SDLCALL SDL_GL_GetAttribute(SDL_GLattr attr, int* value); + +/** + * Swap the OpenGL buffers, if double-buffering is supported. + */ +extern DECLSPEC void SDLCALL SDL_GL_SwapBuffers(void); + +/** @name OpenGL Internal Functions + * Internal functions that should not be called unless you have read + * and understood the source code for these functions. + */ +/*@{*/ +extern DECLSPEC void SDLCALL SDL_GL_UpdateRects(int numrects, SDL_Rect* rects); +extern DECLSPEC void SDLCALL SDL_GL_Lock(void); +extern DECLSPEC void SDLCALL SDL_GL_Unlock(void); +/*@}*/ + +/*@}*/ + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +/** @name Window Manager Functions */ +/** These functions allow interaction with the window manager, if any. */ /*@{*/ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +/** + * Sets the title and icon text of the display window (UTF-8 encoded) + */ +extern DECLSPEC void SDLCALL SDL_WM_SetCaption(const char *title, const char *icon); +/** + * Gets the title and icon text of the display window (UTF-8 encoded) + */ +extern DECLSPEC void SDLCALL SDL_WM_GetCaption(char **title, char **icon); + +/** + * Sets the icon for the display window. + * This function must be called before the first call to SDL_SetVideoMode(). + * It takes an icon surface, and a mask in MSB format. + * If 'mask' is NULL, the entire icon surface will be used as the icon. + */ +extern DECLSPEC void SDLCALL SDL_WM_SetIcon(SDL_Surface *icon, Uint8 *mask); + +/** + * This function iconifies the window, and returns 1 if it succeeded. + * If the function succeeds, it generates an SDL_APPACTIVE loss event. + * This function is a noop and returns 0 in non-windowed environments. + */ +extern DECLSPEC int SDLCALL SDL_WM_IconifyWindow(void); + +/** + * Toggle fullscreen mode without changing the contents of the screen. + * If the display surface does not require locking before accessing + * the pixel information, then the memory pointers will not change. + * + * If this function was able to toggle fullscreen mode (change from + * running in a window to fullscreen, or vice-versa), it will return 1. + * If it is not implemented, or fails, it returns 0. + * + * The next call to SDL_SetVideoMode() will set the mode fullscreen + * attribute based on the flags parameter - if SDL_FULLSCREEN is not + * set, then the display will be windowed by default where supported. + * + * This is currently only implemented in the X11 video driver. + */ +extern DECLSPEC int SDLCALL SDL_WM_ToggleFullScreen(SDL_Surface *surface); + +typedef enum { + SDL_GRAB_QUERY = -1, + SDL_GRAB_OFF = 0, + SDL_GRAB_ON = 1, + SDL_GRAB_FULLSCREEN /**< Used internally */ +} SDL_GrabMode; +/** + * This function allows you to set and query the input grab state of + * the application. It returns the new input grab state. + * + * Grabbing means that the mouse is confined to the application window, + * and nearly all keyboard input is passed directly to the application, + * and not interpreted by a window manager, if any. + */ +extern DECLSPEC SDL_GrabMode SDLCALL SDL_WM_GrabInput(SDL_GrabMode mode); + +/*@}*/ + +/** @internal Not in public API at the moment - do not use! */ +extern DECLSPEC int SDLCALL SDL_SoftStretch(SDL_Surface *src, SDL_Rect *srcrect, + SDL_Surface *dst, SDL_Rect *dstrect); + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* _SDL_video_h */ diff --git a/dep/recastnavigation/RecastDemo/Contrib/SDL/include/begin_code.h b/dep/recastnavigation/RecastDemo/Contrib/SDL/include/begin_code.h new file mode 100644 index 000000000..22748090c --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/SDL/include/begin_code.h @@ -0,0 +1,191 @@ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + Sam Lantinga + slouken@libsdl.org +*/ + +/** + * @file begin_code.h + * This file sets things up for C dynamic library function definitions, + * static inlined functions, and structures aligned at 4-byte alignment. + * If you don't like ugly C preprocessor code, don't look at this file. :) + */ + +/** + * @file begin_code.h + * This shouldn't be nested -- included it around code only. + */ +#ifdef _begin_code_h +#error Nested inclusion of begin_code.h +#endif +#define _begin_code_h + +/** + * @def DECLSPEC + * Some compilers use a special export keyword + */ +#ifndef DECLSPEC +# if defined(__BEOS__) || defined(__HAIKU__) +# if defined(__GNUC__) +# define DECLSPEC __declspec(dllexport) +# else +# define DECLSPEC __declspec(export) +# endif +# elif defined(__WIN32__) +# ifdef __BORLANDC__ +# ifdef BUILD_SDL +# define DECLSPEC +# else +# define DECLSPEC __declspec(dllimport) +# endif +# else +# define DECLSPEC __declspec(dllexport) +# endif +# elif defined(__OS2__) +# ifdef __WATCOMC__ +# ifdef BUILD_SDL +# define DECLSPEC __declspec(dllexport) +# else +# define DECLSPEC +# endif +# elif defined (__GNUC__) && __GNUC__ < 4 +# /* Added support for GCC-EMX = 4 +# define DECLSPEC __attribute__ ((visibility("default"))) +# else +# define DECLSPEC +# endif +# endif +#endif + +/** + * @def SDLCALL + * By default SDL uses the C calling convention + */ +#ifndef SDLCALL +# if defined(__WIN32__) && !defined(__GNUC__) +# define SDLCALL __cdecl +# elif defined(__OS2__) +# if defined (__GNUC__) && __GNUC__ < 4 +# /* Added support for GCC-EMX 9 bits but less + than 16 available + 0.56 fix bug: zlib uncompressed mode len vs. nlen + 0.55 fix bug: restart_interval not initialized to 0 + 0.54 allow NULL for 'int *comp' + 0.53 fix bug in png 3->4; speedup png decoding + 0.52 png handles req_comp=3,4 directly; minor cleanup; jpeg comments + 0.51 obey req_comp requests, 1-component jpegs return as 1-component, + on 'test' only check type, not whether we support this variant +*/ + + +#ifndef STBI_INCLUDE_STB_IMAGE_H +#define STBI_INCLUDE_STB_IMAGE_H + +//// begin header file //////////////////////////////////////////////////// +// +// Limitations: +// - no progressive/interlaced support (jpeg, png) +// - 8-bit samples only (jpeg, png) +// - not threadsafe +// - channel subsampling of at most 2 in each dimension (jpeg) +// - no delayed line count (jpeg) -- IJG doesn't support either +// +// Basic usage (see HDR discussion below): +// int x,y,n; +// unsigned char *data = stbi_load(filename, &x, &y, &n, 0); +// // ... process data if not NULL ... +// // ... x = width, y = height, n = # 8-bit components per pixel ... +// // ... replace '0' with '1'..'4' to force that many components per pixel +// stbi_image_free(data) +// +// Standard parameters: +// int *x -- outputs image width in pixels +// int *y -- outputs image height in pixels +// int *comp -- outputs # of image components in image file +// int req_comp -- if non-zero, # of image components requested in result +// +// The return value from an image loader is an 'unsigned char *' which points +// to the pixel data. The pixel data consists of *y scanlines of *x pixels, +// with each pixel consisting of N interleaved 8-bit components; the first +// pixel pointed to is top-left-most in the image. There is no padding between +// image scanlines or between pixels, regardless of format. The number of +// components N is 'req_comp' if req_comp is non-zero, or *comp otherwise. +// If req_comp is non-zero, *comp has the number of components that _would_ +// have been output otherwise. E.g. if you set req_comp to 4, you will always +// get RGBA output, but you can check *comp to easily see if it's opaque. +// +// An output image with N components has the following components interleaved +// in this order in each pixel: +// +// N=#comp components +// 1 grey +// 2 grey, alpha +// 3 red, green, blue +// 4 red, green, blue, alpha +// +// If image loading fails for any reason, the return value will be NULL, +// and *x, *y, *comp will be unchanged. The function stbi_failure_reason() +// can be queried for an extremely brief, end-user unfriendly explanation +// of why the load failed. Define STBI_NO_FAILURE_STRINGS to avoid +// compiling these strings at all, and STBI_FAILURE_USERMSG to get slightly +// more user-friendly ones. +// +// Paletted PNG and BMP images are automatically depalettized. +// +// +// =========================================================================== +// +// HDR image support (disable by defining STBI_NO_HDR) +// +// stb_image now supports loading HDR images in general, and currently +// the Radiance .HDR file format, although the support is provided +// generically. You can still load any file through the existing interface; +// if you attempt to load an HDR file, it will be automatically remapped to +// LDR, assuming gamma 2.2 and an arbitrary scale factor defaulting to 1; +// both of these constants can be reconfigured through this interface: +// +// stbi_hdr_to_ldr_gamma(2.2f); +// stbi_hdr_to_ldr_scale(1.0f); +// +// (note, do not use _inverse_ constants; stbi_image will invert them +// appropriately). +// +// Additionally, there is a new, parallel interface for loading files as +// (linear) floats to preserve the full dynamic range: +// +// float *data = stbi_loadf(filename, &x, &y, &n, 0); +// +// If you load LDR images through this interface, those images will +// be promoted to floating point values, run through the inverse of +// constants corresponding to the above: +// +// stbi_ldr_to_hdr_scale(1.0f); +// stbi_ldr_to_hdr_gamma(2.2f); +// +// Finally, given a filename (or an open file or memory block--see header +// file for details) containing image data, you can query for the "most +// appropriate" interface to use (that is, whether the image is HDR or +// not), using: +// +// stbi_is_hdr(char *filename); + +#ifndef STBI_NO_STDIO +#include +#endif + +#define STBI_VERSION 1 + +enum +{ + STBI_default = 0, // only used for req_comp + + STBI_grey = 1, + STBI_grey_alpha = 2, + STBI_rgb = 3, + STBI_rgb_alpha = 4, +}; + +typedef unsigned char stbi_uc; + +#ifdef __cplusplus +extern "C" { +#endif + +// WRITING API + +#if !defined(STBI_NO_WRITE) && !defined(STBI_NO_STDIO) +// write a BMP/TGA file given tightly packed 'comp' channels (no padding, nor bmp-stride-padding) +// (you must include the appropriate extension in the filename). +// returns TRUE on success, FALSE if couldn't open file, error writing file +extern int stbi_write_bmp (char const *filename, int x, int y, int comp, void *data); +extern int stbi_write_tga (char const *filename, int x, int y, int comp, void *data); +#endif + +// PRIMARY API - works on images of any type + +// load image by filename, open file, or memory buffer +#ifndef STBI_NO_STDIO +extern stbi_uc *stbi_load (char const *filename, int *x, int *y, int *comp, int req_comp); +extern stbi_uc *stbi_load_from_file (FILE *f, int *x, int *y, int *comp, int req_comp); +extern int stbi_info_from_file (FILE *f, int *x, int *y, int *comp); +#endif +extern stbi_uc *stbi_load_from_memory(stbi_uc const *buffer, int len, int *x, int *y, int *comp, int req_comp); +// for stbi_load_from_file, file pointer is left pointing immediately after image + +#ifndef STBI_NO_HDR +#ifndef STBI_NO_STDIO +extern float *stbi_loadf (char const *filename, int *x, int *y, int *comp, int req_comp); +extern float *stbi_loadf_from_file (FILE *f, int *x, int *y, int *comp, int req_comp); +#endif +extern float *stbi_loadf_from_memory(stbi_uc const *buffer, int len, int *x, int *y, int *comp, int req_comp); + +extern void stbi_hdr_to_ldr_gamma(float gamma); +extern void stbi_hdr_to_ldr_scale(float scale); + +extern void stbi_ldr_to_hdr_gamma(float gamma); +extern void stbi_ldr_to_hdr_scale(float scale); + +#endif // STBI_NO_HDR + +// get a VERY brief reason for failure +// NOT THREADSAFE +extern const char *stbi_failure_reason (void); + +// free the loaded image -- this is just free() +extern void stbi_image_free (void *retval_from_stbi_load); + +// get image dimensions & components without fully decoding +extern int stbi_info_from_memory(stbi_uc const *buffer, int len, int *x, int *y, int *comp); +extern int stbi_is_hdr_from_memory(stbi_uc const *buffer, int len); +#ifndef STBI_NO_STDIO +extern int stbi_info (char const *filename, int *x, int *y, int *comp); +extern int stbi_is_hdr (char const *filename); +extern int stbi_is_hdr_from_file(FILE *f); +#endif + +// ZLIB client - used by PNG, available for other purposes + +extern char *stbi_zlib_decode_malloc_guesssize(const char *buffer, int len, int initial_size, int *outlen); +extern char *stbi_zlib_decode_malloc(const char *buffer, int len, int *outlen); +extern int stbi_zlib_decode_buffer(char *obuffer, int olen, const char *ibuffer, int ilen); + +extern char *stbi_zlib_decode_noheader_malloc(const char *buffer, int len, int *outlen); +extern int stbi_zlib_decode_noheader_buffer(char *obuffer, int olen, const char *ibuffer, int ilen); + +// TYPE-SPECIFIC ACCESS + +// is it a jpeg? +extern int stbi_jpeg_test_memory (stbi_uc const *buffer, int len); +extern stbi_uc *stbi_jpeg_load_from_memory(stbi_uc const *buffer, int len, int *x, int *y, int *comp, int req_comp); +extern int stbi_jpeg_info_from_memory(stbi_uc const *buffer, int len, int *x, int *y, int *comp); + +#ifndef STBI_NO_STDIO +extern stbi_uc *stbi_jpeg_load (char const *filename, int *x, int *y, int *comp, int req_comp); +extern int stbi_jpeg_test_file (FILE *f); +extern stbi_uc *stbi_jpeg_load_from_file (FILE *f, int *x, int *y, int *comp, int req_comp); + +extern int stbi_jpeg_info (char const *filename, int *x, int *y, int *comp); +extern int stbi_jpeg_info_from_file (FILE *f, int *x, int *y, int *comp); +#endif + +// is it a png? +extern int stbi_png_test_memory (stbi_uc const *buffer, int len); +extern stbi_uc *stbi_png_load_from_memory (stbi_uc const *buffer, int len, int *x, int *y, int *comp, int req_comp); +extern int stbi_png_info_from_memory (stbi_uc const *buffer, int len, int *x, int *y, int *comp); + +#ifndef STBI_NO_STDIO +extern stbi_uc *stbi_png_load (char const *filename, int *x, int *y, int *comp, int req_comp); +extern int stbi_png_info (char const *filename, int *x, int *y, int *comp); +extern int stbi_png_test_file (FILE *f); +extern stbi_uc *stbi_png_load_from_file (FILE *f, int *x, int *y, int *comp, int req_comp); +extern int stbi_png_info_from_file (FILE *f, int *x, int *y, int *comp); +#endif + +// is it a bmp? +extern int stbi_bmp_test_memory (stbi_uc const *buffer, int len); + +extern stbi_uc *stbi_bmp_load (char const *filename, int *x, int *y, int *comp, int req_comp); +extern stbi_uc *stbi_bmp_load_from_memory (stbi_uc const *buffer, int len, int *x, int *y, int *comp, int req_comp); +#ifndef STBI_NO_STDIO +extern int stbi_bmp_test_file (FILE *f); +extern stbi_uc *stbi_bmp_load_from_file (FILE *f, int *x, int *y, int *comp, int req_comp); +#endif + +// is it a tga? +extern int stbi_tga_test_memory (stbi_uc const *buffer, int len); + +extern stbi_uc *stbi_tga_load (char const *filename, int *x, int *y, int *comp, int req_comp); +extern stbi_uc *stbi_tga_load_from_memory (stbi_uc const *buffer, int len, int *x, int *y, int *comp, int req_comp); +#ifndef STBI_NO_STDIO +extern int stbi_tga_test_file (FILE *f); +extern stbi_uc *stbi_tga_load_from_file (FILE *f, int *x, int *y, int *comp, int req_comp); +#endif + +// is it a psd? +extern int stbi_psd_test_memory (stbi_uc const *buffer, int len); + +extern stbi_uc *stbi_psd_load (char const *filename, int *x, int *y, int *comp, int req_comp); +extern stbi_uc *stbi_psd_load_from_memory (stbi_uc const *buffer, int len, int *x, int *y, int *comp, int req_comp); +#ifndef STBI_NO_STDIO +extern int stbi_psd_test_file (FILE *f); +extern stbi_uc *stbi_psd_load_from_file (FILE *f, int *x, int *y, int *comp, int req_comp); +#endif + +// is it an hdr? +extern int stbi_hdr_test_memory (stbi_uc const *buffer, int len); + +extern float * stbi_hdr_load (char const *filename, int *x, int *y, int *comp, int req_comp); +extern float * stbi_hdr_load_from_memory (stbi_uc const *buffer, int len, int *x, int *y, int *comp, int req_comp); +#ifndef STBI_NO_STDIO +extern int stbi_hdr_test_file (FILE *f); +extern float * stbi_hdr_load_from_file (FILE *f, int *x, int *y, int *comp, int req_comp); +#endif + +// define new loaders +typedef struct +{ + int (*test_memory)(stbi_uc const *buffer, int len); + stbi_uc * (*load_from_memory)(stbi_uc const *buffer, int len, int *x, int *y, int *comp, int req_comp); + #ifndef STBI_NO_STDIO + int (*test_file)(FILE *f); + stbi_uc * (*load_from_file)(FILE *f, int *x, int *y, int *comp, int req_comp); + #endif +} stbi_loader; + +// register a loader by filling out the above structure (you must defined ALL functions) +// returns 1 if added or already added, 0 if not added (too many loaders) +// NOT THREADSAFE +extern int stbi_register_loader(stbi_loader *loader); + +// define faster low-level operations (typically SIMD support) +#if STBI_SIMD +typedef void (*stbi_idct_8x8)(uint8 *out, int out_stride, short data[64], unsigned short *dequantize); +// compute an integer IDCT on "input" +// input[x] = data[x] * dequantize[x] +// write results to 'out': 64 samples, each run of 8 spaced by 'out_stride' +// CLAMP results to 0..255 +typedef void (*stbi_YCbCr_to_RGB_run)(uint8 *output, uint8 const *y, uint8 const *cb, uint8 const *cr, int count, int step); +// compute a conversion from YCbCr to RGB +// 'count' pixels +// write pixels to 'output'; each pixel is 'step' bytes (either 3 or 4; if 4, write '255' as 4th), order R,G,B +// y: Y input channel +// cb: Cb input channel; scale/biased to be 0..255 +// cr: Cr input channel; scale/biased to be 0..255 + +extern void stbi_install_idct(stbi_idct_8x8 func); +extern void stbi_install_YCbCr_to_RGB(stbi_YCbCr_to_RGB_run func); +#endif // STBI_SIMD + +#ifdef __cplusplus +} +#endif + +// +// +//// end header file ///////////////////////////////////////////////////// +#endif // STBI_INCLUDE_STB_IMAGE_H + +#ifndef STBI_HEADER_FILE_ONLY + +#ifndef STBI_NO_HDR +#include // ldexp +#include // strcmp +#endif + +#ifndef STBI_NO_STDIO +#include +#endif +#include +#include +#include +#include + +#ifndef _MSC_VER + #ifdef __cplusplus + #define __forceinline inline + #else + #define __forceinline + #endif +#endif + + +// implementation: +typedef unsigned char uint8; +typedef unsigned short uint16; +typedef signed short int16; +typedef unsigned int uint32; +typedef signed int int32; +typedef unsigned int uint; + +// should produce compiler error if size is wrong +typedef unsigned char validate_uint32[sizeof(uint32)==4]; + +#if defined(STBI_NO_STDIO) && !defined(STBI_NO_WRITE) +#define STBI_NO_WRITE +#endif + +////////////////////////////////////////////////////////////////////////////// +// +// Generic API that works on all image types +// + +// this is not threadsafe +static const char *failure_reason; + +const char *stbi_failure_reason(void) +{ + return failure_reason; +} + +static int e(const char *str) +{ + failure_reason = str; + return 0; +} + +#ifdef STBI_NO_FAILURE_STRINGS + #define e(x,y) 0 +#elif defined(STBI_FAILURE_USERMSG) + #define e(x,y) e(y) +#else + #define e(x,y) e(x) +#endif + +#define epf(x,y) ((float *) (e(x,y)?NULL:NULL)) +#define epuc(x,y) ((unsigned char *) (e(x,y)?NULL:NULL)) + +void stbi_image_free(void *retval_from_stbi_load) +{ + free(retval_from_stbi_load); +} + +#define MAX_LOADERS 32 +stbi_loader *loaders[MAX_LOADERS]; +static int max_loaders = 0; + +int stbi_register_loader(stbi_loader *loader) +{ + int i; + for (i=0; i < MAX_LOADERS; ++i) { + // already present? + if (loaders[i] == loader) + return 1; + // end of the list? + if (loaders[i] == NULL) { + loaders[i] = loader; + max_loaders = i+1; + return 1; + } + } + // no room for it + return 0; +} + +#ifndef STBI_NO_HDR +static float *ldr_to_hdr(stbi_uc *data, int x, int y, int comp); +static stbi_uc *hdr_to_ldr(float *data, int x, int y, int comp); +#endif + +#ifndef STBI_NO_STDIO +unsigned char *stbi_load(char const *filename, int *x, int *y, int *comp, int req_comp) +{ + FILE *f = fopen(filename, "rb"); + unsigned char *result; + if (!f) return epuc("can't fopen", "Unable to open file"); + result = stbi_load_from_file(f,x,y,comp,req_comp); + fclose(f); + return result; +} + +unsigned char *stbi_load_from_file(FILE *f, int *x, int *y, int *comp, int req_comp) +{ + int i; + if (stbi_jpeg_test_file(f)) + return stbi_jpeg_load_from_file(f,x,y,comp,req_comp); + if (stbi_png_test_file(f)) + return stbi_png_load_from_file(f,x,y,comp,req_comp); + if (stbi_bmp_test_file(f)) + return stbi_bmp_load_from_file(f,x,y,comp,req_comp); + if (stbi_psd_test_file(f)) + return stbi_psd_load_from_file(f,x,y,comp,req_comp); + #ifndef STBI_NO_HDR + if (stbi_hdr_test_file(f)) { + float *hdr = stbi_hdr_load_from_file(f, x,y,comp,req_comp); + return hdr_to_ldr(hdr, *x, *y, req_comp ? req_comp : *comp); + } + #endif + for (i=0; i < max_loaders; ++i) + if (loaders[i]->test_file(f)) + return loaders[i]->load_from_file(f,x,y,comp,req_comp); + // test tga last because it's a crappy test! + if (stbi_tga_test_file(f)) + return stbi_tga_load_from_file(f,x,y,comp,req_comp); + return epuc("unknown image type", "Image not of any known type, or corrupt"); +} +#endif + +unsigned char *stbi_load_from_memory(stbi_uc const *buffer, int len, int *x, int *y, int *comp, int req_comp) +{ + int i; + if (stbi_jpeg_test_memory(buffer,len)) + return stbi_jpeg_load_from_memory(buffer,len,x,y,comp,req_comp); + if (stbi_png_test_memory(buffer,len)) + return stbi_png_load_from_memory(buffer,len,x,y,comp,req_comp); + if (stbi_bmp_test_memory(buffer,len)) + return stbi_bmp_load_from_memory(buffer,len,x,y,comp,req_comp); + if (stbi_psd_test_memory(buffer,len)) + return stbi_psd_load_from_memory(buffer,len,x,y,comp,req_comp); + #ifndef STBI_NO_HDR + if (stbi_hdr_test_memory(buffer, len)) { + float *hdr = stbi_hdr_load_from_memory(buffer, len,x,y,comp,req_comp); + return hdr_to_ldr(hdr, *x, *y, req_comp ? req_comp : *comp); + } + #endif + for (i=0; i < max_loaders; ++i) + if (loaders[i]->test_memory(buffer,len)) + return loaders[i]->load_from_memory(buffer,len,x,y,comp,req_comp); + // test tga last because it's a crappy test! + if (stbi_tga_test_memory(buffer,len)) + return stbi_tga_load_from_memory(buffer,len,x,y,comp,req_comp); + return epuc("unknown image type", "Image not of any known type, or corrupt"); +} + +#ifndef STBI_NO_HDR + +#ifndef STBI_NO_STDIO +float *stbi_loadf(char const *filename, int *x, int *y, int *comp, int req_comp) +{ + FILE *f = fopen(filename, "rb"); + float *result; + if (!f) return epf("can't fopen", "Unable to open file"); + result = stbi_loadf_from_file(f,x,y,comp,req_comp); + fclose(f); + return result; +} + +float *stbi_loadf_from_file(FILE *f, int *x, int *y, int *comp, int req_comp) +{ + unsigned char *data; + #ifndef STBI_NO_HDR + if (stbi_hdr_test_file(f)) + return stbi_hdr_load_from_file(f,x,y,comp,req_comp); + #endif + data = stbi_load_from_file(f, x, y, comp, req_comp); + if (data) + return ldr_to_hdr(data, *x, *y, req_comp ? req_comp : *comp); + return epf("unknown image type", "Image not of any known type, or corrupt"); +} +#endif + +float *stbi_loadf_from_memory(stbi_uc const *buffer, int len, int *x, int *y, int *comp, int req_comp) +{ + stbi_uc *data; + #ifndef STBI_NO_HDR + if (stbi_hdr_test_memory(buffer, len)) + return stbi_hdr_load_from_memory(buffer, len,x,y,comp,req_comp); + #endif + data = stbi_load_from_memory(buffer, len, x, y, comp, req_comp); + if (data) + return ldr_to_hdr(data, *x, *y, req_comp ? req_comp : *comp); + return epf("unknown image type", "Image not of any known type, or corrupt"); +} +#endif + +// these is-hdr-or-not is defined independent of whether STBI_NO_HDR is +// defined, for API simplicity; if STBI_NO_HDR is defined, it always +// reports false! + +int stbi_is_hdr_from_memory(stbi_uc const *buffer, int len) +{ + #ifndef STBI_NO_HDR + return stbi_hdr_test_memory(buffer, len); + #else + return 0; + #endif +} + +#ifndef STBI_NO_STDIO +extern int stbi_is_hdr (char const *filename) +{ + FILE *f = fopen(filename, "rb"); + int result=0; + if (f) { + result = stbi_is_hdr_from_file(f); + fclose(f); + } + return result; +} + +extern int stbi_is_hdr_from_file(FILE *f) +{ + #ifndef STBI_NO_HDR + return stbi_hdr_test_file(f); + #else + return 0; + #endif +} + +#endif + +// @TODO: get image dimensions & components without fully decoding +#ifndef STBI_NO_STDIO +extern int stbi_info (char const *filename, int *x, int *y, int *comp); +extern int stbi_info_from_file (FILE *f, int *x, int *y, int *comp); +#endif +extern int stbi_info_from_memory(stbi_uc const *buffer, int len, int *x, int *y, int *comp); + +#ifndef STBI_NO_HDR +static float h2l_gamma_i=1.0f/2.2f, h2l_scale_i=1.0f; +static float l2h_gamma=2.2f, l2h_scale=1.0f; + +void stbi_hdr_to_ldr_gamma(float gamma) { h2l_gamma_i = 1/gamma; } +void stbi_hdr_to_ldr_scale(float scale) { h2l_scale_i = 1/scale; } + +void stbi_ldr_to_hdr_gamma(float gamma) { l2h_gamma = gamma; } +void stbi_ldr_to_hdr_scale(float scale) { l2h_scale = scale; } +#endif + + +////////////////////////////////////////////////////////////////////////////// +// +// Common code used by all image loaders +// + +enum +{ + SCAN_load=0, + SCAN_type, + SCAN_header, +}; + +typedef struct +{ + uint32 img_x, img_y; + int img_n, img_out_n; + + #ifndef STBI_NO_STDIO + FILE *img_file; + #endif + uint8 *img_buffer, *img_buffer_end; +} stbi; + +#ifndef STBI_NO_STDIO +static void start_file(stbi *s, FILE *f) +{ + s->img_file = f; + s->img_buffer = NULL; + s->img_buffer_end = NULL; +} +#endif + +static void start_mem(stbi *s, uint8 const *buffer, int len) +{ +#ifndef STBI_NO_STDIO + s->img_file = NULL; +#endif + s->img_buffer = (uint8 *) buffer; + s->img_buffer_end = (uint8 *) buffer+len; +} + +__forceinline static int get8(stbi *s) +{ +#ifndef STBI_NO_STDIO + if (s->img_file) { + int c = fgetc(s->img_file); + return c == EOF ? 0 : c; + } +#endif + if (s->img_buffer < s->img_buffer_end) + return *s->img_buffer++; + return 0; +} + +__forceinline static int at_eof(stbi *s) +{ +#ifndef STBI_NO_STDIO + if (s->img_file) + return feof(s->img_file); +#endif + return s->img_buffer >= s->img_buffer_end; +} + +__forceinline static uint8 get8u(stbi *s) +{ + return (uint8) get8(s); +} + +static void skip(stbi *s, int n) +{ +#ifndef STBI_NO_STDIO + if (s->img_file) + fseek(s->img_file, n, SEEK_CUR); + else +#endif + s->img_buffer += n; +} + +static int get16(stbi *s) +{ + int z = get8(s); + return (z << 8) + get8(s); +} + +static uint32 get32(stbi *s) +{ + uint32 z = get16(s); + return (z << 16) + get16(s); +} + +static int get16le(stbi *s) +{ + int z = get8(s); + return z + (get8(s) << 8); +} + +static uint32 get32le(stbi *s) +{ + uint32 z = get16le(s); + return z + (get16le(s) << 16); +} + +static void getn(stbi *s, stbi_uc *buffer, int n) +{ +#ifndef STBI_NO_STDIO + if (s->img_file) { + fread(buffer, 1, n, s->img_file); + return; + } +#endif + memcpy(buffer, s->img_buffer, n); + s->img_buffer += n; +} + +////////////////////////////////////////////////////////////////////////////// +// +// generic converter from built-in img_n to req_comp +// individual types do this automatically as much as possible (e.g. jpeg +// does all cases internally since it needs to colorspace convert anyway, +// and it never has alpha, so very few cases ). png can automatically +// interleave an alpha=255 channel, but falls back to this for other cases +// +// assume data buffer is malloced, so malloc a new one and free that one +// only failure mode is malloc failing + +static uint8 compute_y(int r, int g, int b) +{ + return (uint8) (((r*77) + (g*150) + (29*b)) >> 8); +} + +static unsigned char *convert_format(unsigned char *data, int img_n, int req_comp, uint x, uint y) +{ + int i,j; + unsigned char *good; + + if (req_comp == img_n) return data; + assert(req_comp >= 1 && req_comp <= 4); + + good = (unsigned char *) malloc(req_comp * x * y); + if (good == NULL) { + free(data); + return epuc("outofmem", "Out of memory"); + } + + for (j=0; j < (int) y; ++j) { + unsigned char *src = data + j * x * img_n ; + unsigned char *dest = good + j * x * req_comp; + + #define COMBO(a,b) ((a)*8+(b)) + #define CASE(a,b) case COMBO(a,b): for(i=x-1; i >= 0; --i, src += a, dest += b) + // convert source image with img_n components to one with req_comp components; + // avoid switch per pixel, so use switch per scanline and massive macros + switch(COMBO(img_n, req_comp)) { + CASE(1,2) dest[0]=src[0], dest[1]=255; break; + CASE(1,3) dest[0]=dest[1]=dest[2]=src[0]; break; + CASE(1,4) dest[0]=dest[1]=dest[2]=src[0], dest[3]=255; break; + CASE(2,1) dest[0]=src[0]; break; + CASE(2,3) dest[0]=dest[1]=dest[2]=src[0]; break; + CASE(2,4) dest[0]=dest[1]=dest[2]=src[0], dest[3]=src[1]; break; + CASE(3,4) dest[0]=src[0],dest[1]=src[1],dest[2]=src[2],dest[3]=255; break; + CASE(3,1) dest[0]=compute_y(src[0],src[1],src[2]); break; + CASE(3,2) dest[0]=compute_y(src[0],src[1],src[2]), dest[1] = 255; break; + CASE(4,1) dest[0]=compute_y(src[0],src[1],src[2]); break; + CASE(4,2) dest[0]=compute_y(src[0],src[1],src[2]), dest[1] = src[3]; break; + CASE(4,3) dest[0]=src[0],dest[1]=src[1],dest[2]=src[2]; break; + default: assert(0); + } + #undef CASE + } + + free(data); + return good; +} + +#ifndef STBI_NO_HDR +static float *ldr_to_hdr(stbi_uc *data, int x, int y, int comp) +{ + int i,k,n; + float *output = (float *) malloc(x * y * comp * sizeof(float)); + if (output == NULL) { free(data); return epf("outofmem", "Out of memory"); } + // compute number of non-alpha components + if (comp & 1) n = comp; else n = comp-1; + for (i=0; i < x*y; ++i) { + for (k=0; k < n; ++k) { + output[i*comp + k] = (float) pow(data[i*comp+k]/255.0f, l2h_gamma) * l2h_scale; + } + if (k < comp) output[i*comp + k] = data[i*comp+k]/255.0f; + } + free(data); + return output; +} + +#define float2int(x) ((int) (x)) +static stbi_uc *hdr_to_ldr(float *data, int x, int y, int comp) +{ + int i,k,n; + stbi_uc *output = (stbi_uc *) malloc(x * y * comp); + if (output == NULL) { free(data); return epuc("outofmem", "Out of memory"); } + // compute number of non-alpha components + if (comp & 1) n = comp; else n = comp-1; + for (i=0; i < x*y; ++i) { + for (k=0; k < n; ++k) { + float z = (float) pow(data[i*comp+k]*h2l_scale_i, h2l_gamma_i) * 255 + 0.5f; + if (z < 0) z = 0; + if (z > 255) z = 255; + output[i*comp + k] = (stbi_uc)float2int(z); + } + if (k < comp) { + float z = data[i*comp+k] * 255 + 0.5f; + if (z < 0) z = 0; + if (z > 255) z = 255; + output[i*comp + k] = (stbi_uc)float2int(z); + } + } + free(data); + return output; +} +#endif + +////////////////////////////////////////////////////////////////////////////// +// +// "baseline" JPEG/JFIF decoder (not actually fully baseline implementation) +// +// simple implementation +// - channel subsampling of at most 2 in each dimension +// - doesn't support delayed output of y-dimension +// - simple interface (only one output format: 8-bit interleaved RGB) +// - doesn't try to recover corrupt jpegs +// - doesn't allow partial loading, loading multiple at once +// - still fast on x86 (copying globals into locals doesn't help x86) +// - allocates lots of intermediate memory (full size of all components) +// - non-interleaved case requires this anyway +// - allows good upsampling (see next) +// high-quality +// - upsampled channels are bilinearly interpolated, even across blocks +// - quality integer IDCT derived from IJG's 'slow' +// performance +// - fast huffman; reasonable integer IDCT +// - uses a lot of intermediate memory, could cache poorly +// - load http://nothings.org/remote/anemones.jpg 3 times on 2.8Ghz P4 +// stb_jpeg: 1.34 seconds (MSVC6, default release build) +// stb_jpeg: 1.06 seconds (MSVC6, processor = Pentium Pro) +// IJL11.dll: 1.08 seconds (compiled by intel) +// IJG 1998: 0.98 seconds (MSVC6, makefile provided by IJG) +// IJG 1998: 0.95 seconds (MSVC6, makefile + proc=PPro) + +// huffman decoding acceleration +#define FAST_BITS 9 // larger handles more cases; smaller stomps less cache + +typedef struct +{ + uint8 fast[1 << FAST_BITS]; + // weirdly, repacking this into AoS is a 10% speed loss, instead of a win + uint16 code[256]; + uint8 values[256]; + uint8 size[257]; + unsigned int maxcode[18]; + int delta[17]; // old 'firstsymbol' - old 'firstcode' +} huffman; + +typedef struct +{ + #if STBI_SIMD + unsigned short dequant2[4][64]; + #endif + stbi s; + huffman huff_dc[4]; + huffman huff_ac[4]; + uint8 dequant[4][64]; + +// sizes for components, interleaved MCUs + int img_h_max, img_v_max; + int img_mcu_x, img_mcu_y; + int img_mcu_w, img_mcu_h; + +// definition of jpeg image component + struct + { + int id; + int h,v; + int tq; + int hd,ha; + int dc_pred; + + int x,y,w2,h2; + uint8 *data; + void *raw_data; + uint8 *linebuf; + } img_comp[4]; + + uint32 code_buffer; // jpeg entropy-coded buffer + int code_bits; // number of valid bits + unsigned char marker; // marker seen while filling entropy buffer + int nomore; // flag if we saw a marker so must stop + + int scan_n, order[4]; + int restart_interval, todo; +} jpeg; + +static int build_huffman(huffman *h, int *count) +{ + int i,j,k=0,code; + // build size list for each symbol (from JPEG spec) + for (i=0; i < 16; ++i) + for (j=0; j < count[i]; ++j) + h->size[k++] = (uint8) (i+1); + h->size[k] = 0; + + // compute actual symbols (from jpeg spec) + code = 0; + k = 0; + for(j=1; j <= 16; ++j) { + // compute delta to add to code to compute symbol id + h->delta[j] = k - code; + if (h->size[k] == j) { + while (h->size[k] == j) + h->code[k++] = (uint16) (code++); + if (code-1 >= (1 << j)) return e("bad code lengths","Corrupt JPEG"); + } + // compute largest code + 1 for this size, preshifted as needed later + h->maxcode[j] = code << (16-j); + code <<= 1; + } + h->maxcode[j] = 0xffffffff; + + // build non-spec acceleration table; 255 is flag for not-accelerated + memset(h->fast, 255, 1 << FAST_BITS); + for (i=0; i < k; ++i) { + int s = h->size[i]; + if (s <= FAST_BITS) { + int c = h->code[i] << (FAST_BITS-s); + int m = 1 << (FAST_BITS-s); + for (j=0; j < m; ++j) { + h->fast[c+j] = (uint8) i; + } + } + } + return 1; +} + +static void grow_buffer_unsafe(jpeg *j) +{ + do { + int b = j->nomore ? 0 : get8(&j->s); + if (b == 0xff) { + int c = get8(&j->s); + if (c != 0) { + j->marker = (unsigned char) c; + j->nomore = 1; + return; + } + } + j->code_buffer = (j->code_buffer << 8) | b; + j->code_bits += 8; + } while (j->code_bits <= 24); +} + +// (1 << n) - 1 +static uint32 bmask[17]={0,1,3,7,15,31,63,127,255,511,1023,2047,4095,8191,16383,32767,65535}; + +// decode a jpeg huffman value from the bitstream +__forceinline static int decode(jpeg *j, huffman *h) +{ + unsigned int temp; + int c,k; + + if (j->code_bits < 16) grow_buffer_unsafe(j); + + // look at the top FAST_BITS and determine what symbol ID it is, + // if the code is <= FAST_BITS + c = (j->code_buffer >> (j->code_bits - FAST_BITS)) & ((1 << FAST_BITS)-1); + k = h->fast[c]; + if (k < 255) { + if (h->size[k] > j->code_bits) + return -1; + j->code_bits -= h->size[k]; + return h->values[k]; + } + + // naive test is to shift the code_buffer down so k bits are + // valid, then test against maxcode. To speed this up, we've + // preshifted maxcode left so that it has (16-k) 0s at the + // end; in other words, regardless of the number of bits, it + // wants to be compared against something shifted to have 16; + // that way we don't need to shift inside the loop. + if (j->code_bits < 16) + temp = (j->code_buffer << (16 - j->code_bits)) & 0xffff; + else + temp = (j->code_buffer >> (j->code_bits - 16)) & 0xffff; + for (k=FAST_BITS+1 ; ; ++k) + if (temp < h->maxcode[k]) + break; + if (k == 17) { + // error! code not found + j->code_bits -= 16; + return -1; + } + + if (k > j->code_bits) + return -1; + + // convert the huffman code to the symbol id + c = ((j->code_buffer >> (j->code_bits - k)) & bmask[k]) + h->delta[k]; + assert((((j->code_buffer) >> (j->code_bits - h->size[c])) & bmask[h->size[c]]) == h->code[c]); + + // convert the id to a symbol + j->code_bits -= k; + return h->values[c]; +} + +// combined JPEG 'receive' and JPEG 'extend', since baseline +// always extends everything it receives. +__forceinline static int extend_receive(jpeg *j, int n) +{ + unsigned int m = 1 << (n-1); + unsigned int k; + if (j->code_bits < n) grow_buffer_unsafe(j); + k = (j->code_buffer >> (j->code_bits - n)) & bmask[n]; + j->code_bits -= n; + // the following test is probably a random branch that won't + // predict well. I tried to table accelerate it but failed. + // maybe it's compiling as a conditional move? + if (k < m) + return (-1 << n) + k + 1; + else + return k; +} + +// given a value that's at position X in the zigzag stream, +// where does it appear in the 8x8 matrix coded as row-major? +static uint8 dezigzag[64+15] = +{ + 0, 1, 8, 16, 9, 2, 3, 10, + 17, 24, 32, 25, 18, 11, 4, 5, + 12, 19, 26, 33, 40, 48, 41, 34, + 27, 20, 13, 6, 7, 14, 21, 28, + 35, 42, 49, 56, 57, 50, 43, 36, + 29, 22, 15, 23, 30, 37, 44, 51, + 58, 59, 52, 45, 38, 31, 39, 46, + 53, 60, 61, 54, 47, 55, 62, 63, + // let corrupt input sample past end + 63, 63, 63, 63, 63, 63, 63, 63, + 63, 63, 63, 63, 63, 63, 63 +}; + +// decode one 64-entry block-- +static int decode_block(jpeg *j, short data[64], huffman *hdc, huffman *hac, int b) +{ + int diff,dc,k; + int t = decode(j, hdc); + if (t < 0) return e("bad huffman code","Corrupt JPEG"); + + // 0 all the ac values now so we can do it 32-bits at a time + memset(data,0,64*sizeof(data[0])); + + diff = t ? extend_receive(j, t) : 0; + dc = j->img_comp[b].dc_pred + diff; + j->img_comp[b].dc_pred = dc; + data[0] = (short) dc; + + // decode AC components, see JPEG spec + k = 1; + do { + int r,s; + int rs = decode(j, hac); + if (rs < 0) return e("bad huffman code","Corrupt JPEG"); + s = rs & 15; + r = rs >> 4; + if (s == 0) { + if (rs != 0xf0) break; // end block + k += 16; + } else { + k += r; + // decode into unzigzag'd location + data[dezigzag[k++]] = (short) extend_receive(j,s); + } + } while (k < 64); + return 1; +} + +// take a -128..127 value and clamp it and convert to 0..255 +__forceinline static uint8 clamp(int x) +{ + x += 128; + // trick to use a single test to catch both cases + if ((unsigned int) x > 255) { + if (x < 0) return 0; + if (x > 255) return 255; + } + return (uint8) x; +} + +#define f2f(x) (int) (((x) * 4096 + 0.5)) +#define fsh(x) ((x) << 12) + +// derived from jidctint -- DCT_ISLOW +#define IDCT_1D(s0,s1,s2,s3,s4,s5,s6,s7) \ + int t0,t1,t2,t3,p1,p2,p3,p4,p5,x0,x1,x2,x3; \ + p2 = s2; \ + p3 = s6; \ + p1 = (p2+p3) * f2f(0.5411961f); \ + t2 = p1 + p3*f2f(-1.847759065f); \ + t3 = p1 + p2*f2f( 0.765366865f); \ + p2 = s0; \ + p3 = s4; \ + t0 = fsh(p2+p3); \ + t1 = fsh(p2-p3); \ + x0 = t0+t3; \ + x3 = t0-t3; \ + x1 = t1+t2; \ + x2 = t1-t2; \ + t0 = s7; \ + t1 = s5; \ + t2 = s3; \ + t3 = s1; \ + p3 = t0+t2; \ + p4 = t1+t3; \ + p1 = t0+t3; \ + p2 = t1+t2; \ + p5 = (p3+p4)*f2f( 1.175875602f); \ + t0 = t0*f2f( 0.298631336f); \ + t1 = t1*f2f( 2.053119869f); \ + t2 = t2*f2f( 3.072711026f); \ + t3 = t3*f2f( 1.501321110f); \ + p1 = p5 + p1*f2f(-0.899976223f); \ + p2 = p5 + p2*f2f(-2.562915447f); \ + p3 = p3*f2f(-1.961570560f); \ + p4 = p4*f2f(-0.390180644f); \ + t3 += p1+p4; \ + t2 += p2+p3; \ + t1 += p2+p4; \ + t0 += p1+p3; + +#if !STBI_SIMD +// .344 seconds on 3*anemones.jpg +static void idct_block(uint8 *out, int out_stride, short data[64], uint8 *dequantize) +{ + int i,val[64],*v=val; + uint8 *o,*dq = dequantize; + short *d = data; + + // columns + for (i=0; i < 8; ++i,++d,++dq, ++v) { + // if all zeroes, shortcut -- this avoids dequantizing 0s and IDCTing + if (d[ 8]==0 && d[16]==0 && d[24]==0 && d[32]==0 + && d[40]==0 && d[48]==0 && d[56]==0) { + // no shortcut 0 seconds + // (1|2|3|4|5|6|7)==0 0 seconds + // all separate -0.047 seconds + // 1 && 2|3 && 4|5 && 6|7: -0.047 seconds + int dcterm = d[0] * dq[0] << 2; + v[0] = v[8] = v[16] = v[24] = v[32] = v[40] = v[48] = v[56] = dcterm; + } else { + IDCT_1D(d[ 0]*dq[ 0],d[ 8]*dq[ 8],d[16]*dq[16],d[24]*dq[24], + d[32]*dq[32],d[40]*dq[40],d[48]*dq[48],d[56]*dq[56]) + // constants scaled things up by 1<<12; let's bring them back + // down, but keep 2 extra bits of precision + x0 += 512; x1 += 512; x2 += 512; x3 += 512; + v[ 0] = (x0+t3) >> 10; + v[56] = (x0-t3) >> 10; + v[ 8] = (x1+t2) >> 10; + v[48] = (x1-t2) >> 10; + v[16] = (x2+t1) >> 10; + v[40] = (x2-t1) >> 10; + v[24] = (x3+t0) >> 10; + v[32] = (x3-t0) >> 10; + } + } + + for (i=0, v=val, o=out; i < 8; ++i,v+=8,o+=out_stride) { + // no fast case since the first 1D IDCT spread components out + IDCT_1D(v[0],v[1],v[2],v[3],v[4],v[5],v[6],v[7]) + // constants scaled things up by 1<<12, plus we had 1<<2 from first + // loop, plus horizontal and vertical each scale by sqrt(8) so together + // we've got an extra 1<<3, so 1<<17 total we need to remove. + x0 += 65536; x1 += 65536; x2 += 65536; x3 += 65536; + o[0] = clamp((x0+t3) >> 17); + o[7] = clamp((x0-t3) >> 17); + o[1] = clamp((x1+t2) >> 17); + o[6] = clamp((x1-t2) >> 17); + o[2] = clamp((x2+t1) >> 17); + o[5] = clamp((x2-t1) >> 17); + o[3] = clamp((x3+t0) >> 17); + o[4] = clamp((x3-t0) >> 17); + } +} +#else +static void idct_block(uint8 *out, int out_stride, short data[64], unsigned short *dequantize) +{ + int i,val[64],*v=val; + uint8 *o; + unsigned short *dq = dequantize; + short *d = data; + + // columns + for (i=0; i < 8; ++i,++d,++dq, ++v) { + // if all zeroes, shortcut -- this avoids dequantizing 0s and IDCTing + if (d[ 8]==0 && d[16]==0 && d[24]==0 && d[32]==0 + && d[40]==0 && d[48]==0 && d[56]==0) { + // no shortcut 0 seconds + // (1|2|3|4|5|6|7)==0 0 seconds + // all separate -0.047 seconds + // 1 && 2|3 && 4|5 && 6|7: -0.047 seconds + int dcterm = d[0] * dq[0] << 2; + v[0] = v[8] = v[16] = v[24] = v[32] = v[40] = v[48] = v[56] = dcterm; + } else { + IDCT_1D(d[ 0]*dq[ 0],d[ 8]*dq[ 8],d[16]*dq[16],d[24]*dq[24], + d[32]*dq[32],d[40]*dq[40],d[48]*dq[48],d[56]*dq[56]) + // constants scaled things up by 1<<12; let's bring them back + // down, but keep 2 extra bits of precision + x0 += 512; x1 += 512; x2 += 512; x3 += 512; + v[ 0] = (x0+t3) >> 10; + v[56] = (x0-t3) >> 10; + v[ 8] = (x1+t2) >> 10; + v[48] = (x1-t2) >> 10; + v[16] = (x2+t1) >> 10; + v[40] = (x2-t1) >> 10; + v[24] = (x3+t0) >> 10; + v[32] = (x3-t0) >> 10; + } + } + + for (i=0, v=val, o=out; i < 8; ++i,v+=8,o+=out_stride) { + // no fast case since the first 1D IDCT spread components out + IDCT_1D(v[0],v[1],v[2],v[3],v[4],v[5],v[6],v[7]) + // constants scaled things up by 1<<12, plus we had 1<<2 from first + // loop, plus horizontal and vertical each scale by sqrt(8) so together + // we've got an extra 1<<3, so 1<<17 total we need to remove. + x0 += 65536; x1 += 65536; x2 += 65536; x3 += 65536; + o[0] = clamp((x0+t3) >> 17); + o[7] = clamp((x0-t3) >> 17); + o[1] = clamp((x1+t2) >> 17); + o[6] = clamp((x1-t2) >> 17); + o[2] = clamp((x2+t1) >> 17); + o[5] = clamp((x2-t1) >> 17); + o[3] = clamp((x3+t0) >> 17); + o[4] = clamp((x3-t0) >> 17); + } +} +static stbi_idct_8x8 stbi_idct_installed = idct_block; + +extern void stbi_install_idct(stbi_idct_8x8 func) +{ + stbi_idct_installed = func; +} +#endif + +#define MARKER_none 0xff +// if there's a pending marker from the entropy stream, return that +// otherwise, fetch from the stream and get a marker. if there's no +// marker, return 0xff, which is never a valid marker value +static uint8 get_marker(jpeg *j) +{ + uint8 x; + if (j->marker != MARKER_none) { x = j->marker; j->marker = MARKER_none; return x; } + x = get8u(&j->s); + if (x != 0xff) return MARKER_none; + while (x == 0xff) + x = get8u(&j->s); + return x; +} + +// in each scan, we'll have scan_n components, and the order +// of the components is specified by order[] +#define RESTART(x) ((x) >= 0xd0 && (x) <= 0xd7) + +// after a restart interval, reset the entropy decoder and +// the dc prediction +static void reset(jpeg *j) +{ + j->code_bits = 0; + j->code_buffer = 0; + j->nomore = 0; + j->img_comp[0].dc_pred = j->img_comp[1].dc_pred = j->img_comp[2].dc_pred = 0; + j->marker = MARKER_none; + j->todo = j->restart_interval ? j->restart_interval : 0x7fffffff; + // no more than 1<<31 MCUs if no restart_interal? that's plenty safe, + // since we don't even allow 1<<30 pixels +} + +static int parse_entropy_coded_data(jpeg *z) +{ + reset(z); + if (z->scan_n == 1) { + int i,j; + #if STBI_SIMD + __declspec(align(16)) + #endif + short data[64]; + int n = z->order[0]; + // non-interleaved data, we just need to process one block at a time, + // in trivial scanline order + // number of blocks to do just depends on how many actual "pixels" this + // component has, independent of interleaved MCU blocking and such + int w = (z->img_comp[n].x+7) >> 3; + int h = (z->img_comp[n].y+7) >> 3; + for (j=0; j < h; ++j) { + for (i=0; i < w; ++i) { + if (!decode_block(z, data, z->huff_dc+z->img_comp[n].hd, z->huff_ac+z->img_comp[n].ha, n)) return 0; + #if STBI_SIMD + stbi_idct_installed(z->img_comp[n].data+z->img_comp[n].w2*j*8+i*8, z->img_comp[n].w2, data, z->dequant2[z->img_comp[n].tq]); + #else + idct_block(z->img_comp[n].data+z->img_comp[n].w2*j*8+i*8, z->img_comp[n].w2, data, z->dequant[z->img_comp[n].tq]); + #endif + // every data block is an MCU, so countdown the restart interval + if (--z->todo <= 0) { + if (z->code_bits < 24) grow_buffer_unsafe(z); + // if it's NOT a restart, then just bail, so we get corrupt data + // rather than no data + if (!RESTART(z->marker)) return 1; + reset(z); + } + } + } + } else { // interleaved! + int i,j,k,x,y; + short data[64]; + for (j=0; j < z->img_mcu_y; ++j) { + for (i=0; i < z->img_mcu_x; ++i) { + // scan an interleaved mcu... process scan_n components in order + for (k=0; k < z->scan_n; ++k) { + int n = z->order[k]; + // scan out an mcu's worth of this component; that's just determined + // by the basic H and V specified for the component + for (y=0; y < z->img_comp[n].v; ++y) { + for (x=0; x < z->img_comp[n].h; ++x) { + int x2 = (i*z->img_comp[n].h + x)*8; + int y2 = (j*z->img_comp[n].v + y)*8; + if (!decode_block(z, data, z->huff_dc+z->img_comp[n].hd, z->huff_ac+z->img_comp[n].ha, n)) return 0; + #if STBI_SIMD + stbi_idct_installed(z->img_comp[n].data+z->img_comp[n].w2*y2+x2, z->img_comp[n].w2, data, z->dequant2[z->img_comp[n].tq]); + #else + idct_block(z->img_comp[n].data+z->img_comp[n].w2*y2+x2, z->img_comp[n].w2, data, z->dequant[z->img_comp[n].tq]); + #endif + } + } + } + // after all interleaved components, that's an interleaved MCU, + // so now count down the restart interval + if (--z->todo <= 0) { + if (z->code_bits < 24) grow_buffer_unsafe(z); + // if it's NOT a restart, then just bail, so we get corrupt data + // rather than no data + if (!RESTART(z->marker)) return 1; + reset(z); + } + } + } + } + return 1; +} + +static int process_marker(jpeg *z, int m) +{ + int L; + switch (m) { + case MARKER_none: // no marker found + return e("expected marker","Corrupt JPEG"); + + case 0xC2: // SOF - progressive + return e("progressive jpeg","JPEG format not supported (progressive)"); + + case 0xDD: // DRI - specify restart interval + if (get16(&z->s) != 4) return e("bad DRI len","Corrupt JPEG"); + z->restart_interval = get16(&z->s); + return 1; + + case 0xDB: // DQT - define quantization table + L = get16(&z->s)-2; + while (L > 0) { + int q = get8(&z->s); + int p = q >> 4; + int t = q & 15,i; + if (p != 0) return e("bad DQT type","Corrupt JPEG"); + if (t > 3) return e("bad DQT table","Corrupt JPEG"); + for (i=0; i < 64; ++i) + z->dequant[t][dezigzag[i]] = get8u(&z->s); + #if STBI_SIMD + for (i=0; i < 64; ++i) + z->dequant2[t][i] = z->dequant[t][i]; + #endif + L -= 65; + } + return L==0; + + case 0xC4: // DHT - define huffman table + L = get16(&z->s)-2; + while (L > 0) { + uint8 *v; + int sizes[16],i,m=0; + int q = get8(&z->s); + int tc = q >> 4; + int th = q & 15; + if (tc > 1 || th > 3) return e("bad DHT header","Corrupt JPEG"); + for (i=0; i < 16; ++i) { + sizes[i] = get8(&z->s); + m += sizes[i]; + } + L -= 17; + if (tc == 0) { + if (!build_huffman(z->huff_dc+th, sizes)) return 0; + v = z->huff_dc[th].values; + } else { + if (!build_huffman(z->huff_ac+th, sizes)) return 0; + v = z->huff_ac[th].values; + } + for (i=0; i < m; ++i) + v[i] = get8u(&z->s); + L -= m; + } + return L==0; + } + // check for comment block or APP blocks + if ((m >= 0xE0 && m <= 0xEF) || m == 0xFE) { + skip(&z->s, get16(&z->s)-2); + return 1; + } + return 0; +} + +// after we see SOS +static int process_scan_header(jpeg *z) +{ + int i; + int Ls = get16(&z->s); + z->scan_n = get8(&z->s); + if (z->scan_n < 1 || z->scan_n > 4 || z->scan_n > (int) z->s.img_n) return e("bad SOS component count","Corrupt JPEG"); + if (Ls != 6+2*z->scan_n) return e("bad SOS len","Corrupt JPEG"); + for (i=0; i < z->scan_n; ++i) { + int id = get8(&z->s), which; + int q = get8(&z->s); + for (which = 0; which < z->s.img_n; ++which) + if (z->img_comp[which].id == id) + break; + if (which == z->s.img_n) return 0; + z->img_comp[which].hd = q >> 4; if (z->img_comp[which].hd > 3) return e("bad DC huff","Corrupt JPEG"); + z->img_comp[which].ha = q & 15; if (z->img_comp[which].ha > 3) return e("bad AC huff","Corrupt JPEG"); + z->order[i] = which; + } + if (get8(&z->s) != 0) return e("bad SOS","Corrupt JPEG"); + get8(&z->s); // should be 63, but might be 0 + if (get8(&z->s) != 0) return e("bad SOS","Corrupt JPEG"); + + return 1; +} + +static int process_frame_header(jpeg *z, int scan) +{ + stbi *s = &z->s; + int Lf,p,i,q, h_max=1,v_max=1,c; + Lf = get16(s); if (Lf < 11) return e("bad SOF len","Corrupt JPEG"); // JPEG + p = get8(s); if (p != 8) return e("only 8-bit","JPEG format not supported: 8-bit only"); // JPEG baseline + s->img_y = get16(s); if (s->img_y == 0) return e("no header height", "JPEG format not supported: delayed height"); // Legal, but we don't handle it--but neither does IJG + s->img_x = get16(s); if (s->img_x == 0) return e("0 width","Corrupt JPEG"); // JPEG requires + c = get8(s); + if (c != 3 && c != 1) return e("bad component count","Corrupt JPEG"); // JFIF requires + s->img_n = c; + for (i=0; i < c; ++i) { + z->img_comp[i].data = NULL; + z->img_comp[i].linebuf = NULL; + } + + if (Lf != 8+3*s->img_n) return e("bad SOF len","Corrupt JPEG"); + + for (i=0; i < s->img_n; ++i) { + z->img_comp[i].id = get8(s); + if (z->img_comp[i].id != i+1) // JFIF requires + if (z->img_comp[i].id != i) // some version of jpegtran outputs non-JFIF-compliant files! + return e("bad component ID","Corrupt JPEG"); + q = get8(s); + z->img_comp[i].h = (q >> 4); if (!z->img_comp[i].h || z->img_comp[i].h > 4) return e("bad H","Corrupt JPEG"); + z->img_comp[i].v = q & 15; if (!z->img_comp[i].v || z->img_comp[i].v > 4) return e("bad V","Corrupt JPEG"); + z->img_comp[i].tq = get8(s); if (z->img_comp[i].tq > 3) return e("bad TQ","Corrupt JPEG"); + } + + if (scan != SCAN_load) return 1; + + if ((1 << 30) / s->img_x / s->img_n < s->img_y) return e("too large", "Image too large to decode"); + + for (i=0; i < s->img_n; ++i) { + if (z->img_comp[i].h > h_max) h_max = z->img_comp[i].h; + if (z->img_comp[i].v > v_max) v_max = z->img_comp[i].v; + } + + // compute interleaved mcu info + z->img_h_max = h_max; + z->img_v_max = v_max; + z->img_mcu_w = h_max * 8; + z->img_mcu_h = v_max * 8; + z->img_mcu_x = (s->img_x + z->img_mcu_w-1) / z->img_mcu_w; + z->img_mcu_y = (s->img_y + z->img_mcu_h-1) / z->img_mcu_h; + + for (i=0; i < s->img_n; ++i) { + // number of effective pixels (e.g. for non-interleaved MCU) + z->img_comp[i].x = (s->img_x * z->img_comp[i].h + h_max-1) / h_max; + z->img_comp[i].y = (s->img_y * z->img_comp[i].v + v_max-1) / v_max; + // to simplify generation, we'll allocate enough memory to decode + // the bogus oversized data from using interleaved MCUs and their + // big blocks (e.g. a 16x16 iMCU on an image of width 33); we won't + // discard the extra data until colorspace conversion + z->img_comp[i].w2 = z->img_mcu_x * z->img_comp[i].h * 8; + z->img_comp[i].h2 = z->img_mcu_y * z->img_comp[i].v * 8; + z->img_comp[i].raw_data = malloc(z->img_comp[i].w2 * z->img_comp[i].h2+15); + if (z->img_comp[i].raw_data == NULL) { + for(--i; i >= 0; --i) { + free(z->img_comp[i].raw_data); + z->img_comp[i].data = NULL; + } + return e("outofmem", "Out of memory"); + } + // align blocks for installable-idct using mmx/sse + z->img_comp[i].data = (uint8*) (((size_t) z->img_comp[i].raw_data + 15) & ~15); + z->img_comp[i].linebuf = NULL; + } + + return 1; +} + +// use comparisons since in some cases we handle more than one case (e.g. SOF) +#define DNL(x) ((x) == 0xdc) +#define SOI(x) ((x) == 0xd8) +#define EOI(x) ((x) == 0xd9) +#define SOF(x) ((x) == 0xc0 || (x) == 0xc1) +#define SOS(x) ((x) == 0xda) + +static int decode_jpeg_header(jpeg *z, int scan) +{ + int m; + z->marker = MARKER_none; // initialize cached marker to empty + m = get_marker(z); + if (!SOI(m)) return e("no SOI","Corrupt JPEG"); + if (scan == SCAN_type) return 1; + m = get_marker(z); + while (!SOF(m)) { + if (!process_marker(z,m)) return 0; + m = get_marker(z); + while (m == MARKER_none) { + // some files have extra padding after their blocks, so ok, we'll scan + if (at_eof(&z->s)) return e("no SOF", "Corrupt JPEG"); + m = get_marker(z); + } + } + if (!process_frame_header(z, scan)) return 0; + return 1; +} + +static int decode_jpeg_image(jpeg *j) +{ + int m; + j->restart_interval = 0; + if (!decode_jpeg_header(j, SCAN_load)) return 0; + m = get_marker(j); + while (!EOI(m)) { + if (SOS(m)) { + if (!process_scan_header(j)) return 0; + if (!parse_entropy_coded_data(j)) return 0; + } else { + if (!process_marker(j, m)) return 0; + } + m = get_marker(j); + } + return 1; +} + +// static jfif-centered resampling (across block boundaries) + +typedef uint8 *(*resample_row_func)(uint8 *out, uint8 *in0, uint8 *in1, + int w, int hs); + +#define div4(x) ((uint8) ((x) >> 2)) + +static uint8 *resample_row_1(uint8 * /*out*/, uint8 *in_near, uint8 * /*in_far*/, int /*w*/, int /*hs*/) +{ + return in_near; +} + +static uint8* resample_row_v_2(uint8 *out, uint8 *in_near, uint8 * in_far, int w, int /*hs*/) +{ + // need to generate two samples vertically for every one in input + int i; + for (i=0; i < w; ++i) + out[i] = div4(3*in_near[i] + in_far[i] + 2); + return out; +} + +static uint8* resample_row_h_2(uint8 *out, uint8 *in_near, uint8 * /*in_far*/, int w, int /*hs*/) +{ + // need to generate two samples horizontally for every one in input + int i; + uint8 *input = in_near; + if (w == 1) { + // if only one sample, can't do any interpolation + out[0] = out[1] = input[0]; + return out; + } + + out[0] = input[0]; + out[1] = div4(input[0]*3 + input[1] + 2); + for (i=1; i < w-1; ++i) { + int n = 3*input[i]+2; + out[i*2+0] = div4(n+input[i-1]); + out[i*2+1] = div4(n+input[i+1]); + } + out[i*2+0] = div4(input[w-2]*3 + input[w-1] + 2); + out[i*2+1] = input[w-1]; + return out; +} + +#define div16(x) ((uint8) ((x) >> 4)) + +static uint8 *resample_row_hv_2(uint8 *out, uint8 *in_near, uint8 *in_far, int w, int /*hs*/) +{ + // need to generate 2x2 samples for every one in input + int i,t0,t1; + if (w == 1) { + out[0] = out[1] = div4(3*in_near[0] + in_far[0] + 2); + return out; + } + + t1 = 3*in_near[0] + in_far[0]; + out[0] = div4(t1+2); + for (i=1; i < w; ++i) { + t0 = t1; + t1 = 3*in_near[i]+in_far[i]; + out[i*2-1] = div16(3*t0 + t1 + 8); + out[i*2 ] = div16(3*t1 + t0 + 8); + } + out[w*2-1] = div4(t1+2); + return out; +} + +static uint8 *resample_row_generic(uint8 *out, uint8 *in_near, uint8 * /*in_far*/, int w, int hs) +{ + // resample with nearest-neighbor + int i,j; + for (i=0; i < w; ++i) + for (j=0; j < hs; ++j) + out[i*hs+j] = in_near[i]; + return out; +} + +#define float2fixed(x) ((int) ((x) * 65536 + 0.5)) + +// 0.38 seconds on 3*anemones.jpg (0.25 with processor = Pro) +// VC6 without processor=Pro is generating multiple LEAs per multiply! +static void YCbCr_to_RGB_row(uint8 *out, const uint8 *y, const uint8 *pcb, const uint8 *pcr, int count, int step) +{ + int i; + for (i=0; i < count; ++i) { + int y_fixed = (y[i] << 16) + 32768; // rounding + int r,g,b; + int cr = pcr[i] - 128; + int cb = pcb[i] - 128; + r = y_fixed + cr*float2fixed(1.40200f); + g = y_fixed - cr*float2fixed(0.71414f) - cb*float2fixed(0.34414f); + b = y_fixed + cb*float2fixed(1.77200f); + r >>= 16; + g >>= 16; + b >>= 16; + if ((unsigned) r > 255) { if (r < 0) r = 0; else r = 255; } + if ((unsigned) g > 255) { if (g < 0) g = 0; else g = 255; } + if ((unsigned) b > 255) { if (b < 0) b = 0; else b = 255; } + out[0] = (uint8)r; + out[1] = (uint8)g; + out[2] = (uint8)b; + out[3] = 255; + out += step; + } +} + +#if STBI_SIMD +static stbi_YCbCr_to_RGB_run stbi_YCbCr_installed = YCbCr_to_RGB_row; + +void stbi_install_YCbCr_to_RGB(stbi_YCbCr_to_RGB_run func) +{ + stbi_YCbCr_installed = func; +} +#endif + + +// clean up the temporary component buffers +static void cleanup_jpeg(jpeg *j) +{ + int i; + for (i=0; i < j->s.img_n; ++i) { + if (j->img_comp[i].data) { + free(j->img_comp[i].raw_data); + j->img_comp[i].data = NULL; + } + if (j->img_comp[i].linebuf) { + free(j->img_comp[i].linebuf); + j->img_comp[i].linebuf = NULL; + } + } +} + +typedef struct +{ + resample_row_func resample; + uint8 *line0,*line1; + int hs,vs; // expansion factor in each axis + int w_lores; // horizontal pixels pre-expansion + int ystep; // how far through vertical expansion we are + int ypos; // which pre-expansion row we're on +} stbi_resample; + +static uint8 *load_jpeg_image(jpeg *z, int *out_x, int *out_y, int *comp, int req_comp) +{ + int n, decode_n; + // validate req_comp + if (req_comp < 0 || req_comp > 4) return epuc("bad req_comp", "Internal error"); + z->s.img_n = 0; + + // load a jpeg image from whichever source + if (!decode_jpeg_image(z)) { cleanup_jpeg(z); return NULL; } + + // determine actual number of components to generate + n = req_comp ? req_comp : z->s.img_n; + + if (z->s.img_n == 3 && n < 3) + decode_n = 1; + else + decode_n = z->s.img_n; + + // resample and color-convert + { + int k; + uint i,j; + uint8 *output; + uint8 *coutput[4]; + + stbi_resample res_comp[4]; + + for (k=0; k < decode_n; ++k) { + stbi_resample *r = &res_comp[k]; + + // allocate line buffer big enough for upsampling off the edges + // with upsample factor of 4 + z->img_comp[k].linebuf = (uint8 *) malloc(z->s.img_x + 3); + if (!z->img_comp[k].linebuf) { cleanup_jpeg(z); return epuc("outofmem", "Out of memory"); } + + r->hs = z->img_h_max / z->img_comp[k].h; + r->vs = z->img_v_max / z->img_comp[k].v; + r->ystep = r->vs >> 1; + r->w_lores = (z->s.img_x + r->hs-1) / r->hs; + r->ypos = 0; + r->line0 = r->line1 = z->img_comp[k].data; + + if (r->hs == 1 && r->vs == 1) r->resample = resample_row_1; + else if (r->hs == 1 && r->vs == 2) r->resample = resample_row_v_2; + else if (r->hs == 2 && r->vs == 1) r->resample = resample_row_h_2; + else if (r->hs == 2 && r->vs == 2) r->resample = resample_row_hv_2; + else r->resample = resample_row_generic; + } + + // can't error after this so, this is safe + output = (uint8 *) malloc(n * z->s.img_x * z->s.img_y + 1); + if (!output) { cleanup_jpeg(z); return epuc("outofmem", "Out of memory"); } + + // now go ahead and resample + for (j=0; j < z->s.img_y; ++j) { + uint8 *out = output + n * z->s.img_x * j; + for (k=0; k < decode_n; ++k) { + stbi_resample *r = &res_comp[k]; + int y_bot = r->ystep >= (r->vs >> 1); + coutput[k] = r->resample(z->img_comp[k].linebuf, + y_bot ? r->line1 : r->line0, + y_bot ? r->line0 : r->line1, + r->w_lores, r->hs); + if (++r->ystep >= r->vs) { + r->ystep = 0; + r->line0 = r->line1; + if (++r->ypos < z->img_comp[k].y) + r->line1 += z->img_comp[k].w2; + } + } + if (n >= 3) { + uint8 *y = coutput[0]; + if (z->s.img_n == 3) { + #if STBI_SIMD + stbi_YCbCr_installed(out, y, coutput[1], coutput[2], z->s.img_x, n); + #else + YCbCr_to_RGB_row(out, y, coutput[1], coutput[2], z->s.img_x, n); + #endif + } else + for (i=0; i < z->s.img_x; ++i) { + out[0] = out[1] = out[2] = y[i]; + out[3] = 255; // not used if n==3 + out += n; + } + } else { + uint8 *y = coutput[0]; + if (n == 1) + for (i=0; i < z->s.img_x; ++i) out[i] = y[i]; + else + for (i=0; i < z->s.img_x; ++i) *out++ = y[i], *out++ = 255; + } + } + cleanup_jpeg(z); + *out_x = z->s.img_x; + *out_y = z->s.img_y; + if (comp) *comp = z->s.img_n; // report original components, not output + return output; + } +} + +#ifndef STBI_NO_STDIO +unsigned char *stbi_jpeg_load_from_file(FILE *f, int *x, int *y, int *comp, int req_comp) +{ + jpeg j; + start_file(&j.s, f); + return load_jpeg_image(&j, x,y,comp,req_comp); +} + +unsigned char *stbi_jpeg_load(char const *filename, int *x, int *y, int *comp, int req_comp) +{ + unsigned char *data; + FILE *f = fopen(filename, "rb"); + if (!f) return NULL; + data = stbi_jpeg_load_from_file(f,x,y,comp,req_comp); + fclose(f); + return data; +} +#endif + +unsigned char *stbi_jpeg_load_from_memory(stbi_uc const *buffer, int len, int *x, int *y, int *comp, int req_comp) +{ + jpeg j; + start_mem(&j.s, buffer,len); + return load_jpeg_image(&j, x,y,comp,req_comp); +} + +#ifndef STBI_NO_STDIO +int stbi_jpeg_test_file(FILE *f) +{ + int n,r; + jpeg j; + n = ftell(f); + start_file(&j.s, f); + r = decode_jpeg_header(&j, SCAN_type); + fseek(f,n,SEEK_SET); + return r; +} +#endif + +int stbi_jpeg_test_memory(stbi_uc const *buffer, int len) +{ + jpeg j; + start_mem(&j.s, buffer,len); + return decode_jpeg_header(&j, SCAN_type); +} + +// @TODO: +#ifndef STBI_NO_STDIO +extern int stbi_jpeg_info (char const *filename, int *x, int *y, int *comp); +extern int stbi_jpeg_info_from_file (FILE *f, int *x, int *y, int *comp); +#endif +extern int stbi_jpeg_info_from_memory(stbi_uc const *buffer, int len, int *x, int *y, int *comp); + +// public domain zlib decode v0.2 Sean Barrett 2006-11-18 +// simple implementation +// - all input must be provided in an upfront buffer +// - all output is written to a single output buffer (can malloc/realloc) +// performance +// - fast huffman + +// fast-way is faster to check than jpeg huffman, but slow way is slower +#define ZFAST_BITS 9 // accelerate all cases in default tables +#define ZFAST_MASK ((1 << ZFAST_BITS) - 1) + +// zlib-style huffman encoding +// (jpegs packs from left, zlib from right, so can't share code) +typedef struct +{ + uint16 fast[1 << ZFAST_BITS]; + uint16 firstcode[16]; + int maxcode[17]; + uint16 firstsymbol[16]; + uint8 size[288]; + uint16 value[288]; +} zhuffman; + +__forceinline static int bitreverse16(int n) +{ + n = ((n & 0xAAAA) >> 1) | ((n & 0x5555) << 1); + n = ((n & 0xCCCC) >> 2) | ((n & 0x3333) << 2); + n = ((n & 0xF0F0) >> 4) | ((n & 0x0F0F) << 4); + n = ((n & 0xFF00) >> 8) | ((n & 0x00FF) << 8); + return n; +} + +__forceinline static int bit_reverse(int v, int bits) +{ + assert(bits <= 16); + // to bit reverse n bits, reverse 16 and shift + // e.g. 11 bits, bit reverse and shift away 5 + return bitreverse16(v) >> (16-bits); +} + +static int zbuild_huffman(zhuffman *z, uint8 *sizelist, int num) +{ + int i,k=0; + int code, next_code[16], sizes[17]; + + // DEFLATE spec for generating codes + memset(sizes, 0, sizeof(sizes)); + memset(z->fast, 255, sizeof(z->fast)); + for (i=0; i < num; ++i) + ++sizes[sizelist[i]]; + sizes[0] = 0; + for (i=1; i < 16; ++i) + assert(sizes[i] <= (1 << i)); + code = 0; + for (i=1; i < 16; ++i) { + next_code[i] = code; + z->firstcode[i] = (uint16) code; + z->firstsymbol[i] = (uint16) k; + code = (code + sizes[i]); + if (sizes[i]) + if (code-1 >= (1 << i)) return e("bad codelengths","Corrupt JPEG"); + z->maxcode[i] = code << (16-i); // preshift for inner loop + code <<= 1; + k += sizes[i]; + } + z->maxcode[16] = 0x10000; // sentinel + for (i=0; i < num; ++i) { + int s = sizelist[i]; + if (s) { + int c = next_code[s] - z->firstcode[s] + z->firstsymbol[s]; + z->size[c] = (uint8)s; + z->value[c] = (uint16)i; + if (s <= ZFAST_BITS) { + int k = bit_reverse(next_code[s],s); + while (k < (1 << ZFAST_BITS)) { + z->fast[k] = (uint16) c; + k += (1 << s); + } + } + ++next_code[s]; + } + } + return 1; +} + +// zlib-from-memory implementation for PNG reading +// because PNG allows splitting the zlib stream arbitrarily, +// and it's annoying structurally to have PNG call ZLIB call PNG, +// we require PNG read all the IDATs and combine them into a single +// memory buffer + +typedef struct +{ + uint8 *zbuffer, *zbuffer_end; + int num_bits; + uint32 code_buffer; + + char *zout; + char *zout_start; + char *zout_end; + int z_expandable; + + zhuffman z_length, z_distance; +} zbuf; + +__forceinline static int zget8(zbuf *z) +{ + if (z->zbuffer >= z->zbuffer_end) return 0; + return *z->zbuffer++; +} + +static void fill_bits(zbuf *z) +{ + do { + assert(z->code_buffer < (1U << z->num_bits)); + z->code_buffer |= zget8(z) << z->num_bits; + z->num_bits += 8; + } while (z->num_bits <= 24); +} + +__forceinline static unsigned int zreceive(zbuf *z, int n) +{ + unsigned int k; + if (z->num_bits < n) fill_bits(z); + k = z->code_buffer & ((1 << n) - 1); + z->code_buffer >>= n; + z->num_bits -= n; + return k; +} + +__forceinline static int zhuffman_decode(zbuf *a, zhuffman *z) +{ + int b,s,k; + if (a->num_bits < 16) fill_bits(a); + b = z->fast[a->code_buffer & ZFAST_MASK]; + if (b < 0xffff) { + s = z->size[b]; + a->code_buffer >>= s; + a->num_bits -= s; + return z->value[b]; + } + + // not resolved by fast table, so compute it the slow way + // use jpeg approach, which requires MSbits at top + k = bit_reverse(a->code_buffer, 16); + for (s=ZFAST_BITS+1; ; ++s) + if (k < z->maxcode[s]) + break; + if (s == 16) return -1; // invalid code! + // code size is s, so: + b = (k >> (16-s)) - z->firstcode[s] + z->firstsymbol[s]; + assert(z->size[b] == s); + a->code_buffer >>= s; + a->num_bits -= s; + return z->value[b]; +} + +static int expand(zbuf *z, int n) // need to make room for n bytes +{ + char *q; + int cur, limit; + if (!z->z_expandable) return e("output buffer limit","Corrupt PNG"); + cur = (int) (z->zout - z->zout_start); + limit = (int) (z->zout_end - z->zout_start); + while (cur + n > limit) + limit *= 2; + q = (char *) realloc(z->zout_start, limit); + if (q == NULL) return e("outofmem", "Out of memory"); + z->zout_start = q; + z->zout = q + cur; + z->zout_end = q + limit; + return 1; +} + +static int length_base[31] = { + 3,4,5,6,7,8,9,10,11,13, + 15,17,19,23,27,31,35,43,51,59, + 67,83,99,115,131,163,195,227,258,0,0 }; + +static int length_extra[31]= +{ 0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0 }; + +static int dist_base[32] = { 1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193, +257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0}; + +static int dist_extra[32] = +{ 0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13}; + +static int parse_huffman_block(zbuf *a) +{ + for(;;) { + int z = zhuffman_decode(a, &a->z_length); + if (z < 256) { + if (z < 0) return e("bad huffman code","Corrupt PNG"); // error in huffman codes + if (a->zout >= a->zout_end) if (!expand(a, 1)) return 0; + *a->zout++ = (char) z; + } else { + uint8 *p; + int len,dist; + if (z == 256) return 1; + z -= 257; + len = length_base[z]; + if (length_extra[z]) len += zreceive(a, length_extra[z]); + z = zhuffman_decode(a, &a->z_distance); + if (z < 0) return e("bad huffman code","Corrupt PNG"); + dist = dist_base[z]; + if (dist_extra[z]) dist += zreceive(a, dist_extra[z]); + if (a->zout - a->zout_start < dist) return e("bad dist","Corrupt PNG"); + if (a->zout + len > a->zout_end) if (!expand(a, len)) return 0; + p = (uint8 *) (a->zout - dist); + while (len--) + *a->zout++ = *p++; + } + } +} + +static int compute_huffman_codes(zbuf *a) +{ + static uint8 length_dezigzag[19] = { 16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15 }; + zhuffman z_codelength; + uint8 lencodes[286+32+137];//padding for maximum single op + uint8 codelength_sizes[19]; + int i,n; + + int hlit = zreceive(a,5) + 257; + int hdist = zreceive(a,5) + 1; + int hclen = zreceive(a,4) + 4; + + memset(codelength_sizes, 0, sizeof(codelength_sizes)); + for (i=0; i < hclen; ++i) { + int s = zreceive(a,3); + codelength_sizes[length_dezigzag[i]] = (uint8) s; + } + if (!zbuild_huffman(&z_codelength, codelength_sizes, 19)) return 0; + + n = 0; + while (n < hlit + hdist) { + int c = zhuffman_decode(a, &z_codelength); + assert(c >= 0 && c < 19); + if (c < 16) + lencodes[n++] = (uint8) c; + else if (c == 16) { + c = zreceive(a,2)+3; + memset(lencodes+n, lencodes[n-1], c); + n += c; + } else if (c == 17) { + c = zreceive(a,3)+3; + memset(lencodes+n, 0, c); + n += c; + } else { + assert(c == 18); + c = zreceive(a,7)+11; + memset(lencodes+n, 0, c); + n += c; + } + } + if (n != hlit+hdist) return e("bad codelengths","Corrupt PNG"); + if (!zbuild_huffman(&a->z_length, lencodes, hlit)) return 0; + if (!zbuild_huffman(&a->z_distance, lencodes+hlit, hdist)) return 0; + return 1; +} + +static int parse_uncompressed_block(zbuf *a) +{ + uint8 header[4]; + int len,nlen,k; + if (a->num_bits & 7) + zreceive(a, a->num_bits & 7); // discard + // drain the bit-packed data into header + k = 0; + while (a->num_bits > 0) { + header[k++] = (uint8) (a->code_buffer & 255); // wtf this warns? + a->code_buffer >>= 8; + a->num_bits -= 8; + } + assert(a->num_bits == 0); + // now fill header the normal way + while (k < 4) + header[k++] = (uint8) zget8(a); + len = header[1] * 256 + header[0]; + nlen = header[3] * 256 + header[2]; + if (nlen != (len ^ 0xffff)) return e("zlib corrupt","Corrupt PNG"); + if (a->zbuffer + len > a->zbuffer_end) return e("read past buffer","Corrupt PNG"); + if (a->zout + len > a->zout_end) + if (!expand(a, len)) return 0; + memcpy(a->zout, a->zbuffer, len); + a->zbuffer += len; + a->zout += len; + return 1; +} + +static int parse_zlib_header(zbuf *a) +{ + int cmf = zget8(a); + int cm = cmf & 15; + /* int cinfo = cmf >> 4; */ + int flg = zget8(a); + if ((cmf*256+flg) % 31 != 0) return e("bad zlib header","Corrupt PNG"); // zlib spec + if (flg & 32) return e("no preset dict","Corrupt PNG"); // preset dictionary not allowed in png + if (cm != 8) return e("bad compression","Corrupt PNG"); // DEFLATE required for png + // window = 1 << (8 + cinfo)... but who cares, we fully buffer output + return 1; +} + +// @TODO: should statically initialize these for optimal thread safety +static uint8 default_length[288], default_distance[32]; +static void init_defaults(void) +{ + int i; // use <= to match clearly with spec + for (i=0; i <= 143; ++i) default_length[i] = 8; + for ( ; i <= 255; ++i) default_length[i] = 9; + for ( ; i <= 279; ++i) default_length[i] = 7; + for ( ; i <= 287; ++i) default_length[i] = 8; + + for (i=0; i <= 31; ++i) default_distance[i] = 5; +} + +int stbi_png_partial; // a quick hack to only allow decoding some of a PNG... I should implement real streaming support instead +static int parse_zlib(zbuf *a, int parse_header) +{ + int final, type; + if (parse_header) + if (!parse_zlib_header(a)) return 0; + a->num_bits = 0; + a->code_buffer = 0; + do { + final = zreceive(a,1); + type = zreceive(a,2); + if (type == 0) { + if (!parse_uncompressed_block(a)) return 0; + } else if (type == 3) { + return 0; + } else { + if (type == 1) { + // use fixed code lengths + if (!default_distance[31]) init_defaults(); + if (!zbuild_huffman(&a->z_length , default_length , 288)) return 0; + if (!zbuild_huffman(&a->z_distance, default_distance, 32)) return 0; + } else { + if (!compute_huffman_codes(a)) return 0; + } + if (!parse_huffman_block(a)) return 0; + } + if (stbi_png_partial && a->zout - a->zout_start > 65536) + break; + } while (!final); + return 1; +} + +static int do_zlib(zbuf *a, char *obuf, int olen, int exp, int parse_header) +{ + a->zout_start = obuf; + a->zout = obuf; + a->zout_end = obuf + olen; + a->z_expandable = exp; + + return parse_zlib(a, parse_header); +} + +char *stbi_zlib_decode_malloc_guesssize(const char *buffer, int len, int initial_size, int *outlen) +{ + zbuf a; + char *p = (char *) malloc(initial_size); + if (p == NULL) return NULL; + a.zbuffer = (uint8 *) buffer; + a.zbuffer_end = (uint8 *) buffer + len; + if (do_zlib(&a, p, initial_size, 1, 1)) { + if (outlen) *outlen = (int) (a.zout - a.zout_start); + return a.zout_start; + } else { + free(a.zout_start); + return NULL; + } +} + +char *stbi_zlib_decode_malloc(char const *buffer, int len, int *outlen) +{ + return stbi_zlib_decode_malloc_guesssize(buffer, len, 16384, outlen); +} + +int stbi_zlib_decode_buffer(char *obuffer, int olen, char const *ibuffer, int ilen) +{ + zbuf a; + a.zbuffer = (uint8 *) ibuffer; + a.zbuffer_end = (uint8 *) ibuffer + ilen; + if (do_zlib(&a, obuffer, olen, 0, 1)) + return (int) (a.zout - a.zout_start); + else + return -1; +} + +char *stbi_zlib_decode_noheader_malloc(char const *buffer, int len, int *outlen) +{ + zbuf a; + char *p = (char *) malloc(16384); + if (p == NULL) return NULL; + a.zbuffer = (uint8 *) buffer; + a.zbuffer_end = (uint8 *) buffer+len; + if (do_zlib(&a, p, 16384, 1, 0)) { + if (outlen) *outlen = (int) (a.zout - a.zout_start); + return a.zout_start; + } else { + free(a.zout_start); + return NULL; + } +} + +int stbi_zlib_decode_noheader_buffer(char *obuffer, int olen, const char *ibuffer, int ilen) +{ + zbuf a; + a.zbuffer = (uint8 *) ibuffer; + a.zbuffer_end = (uint8 *) ibuffer + ilen; + if (do_zlib(&a, obuffer, olen, 0, 0)) + return (int) (a.zout - a.zout_start); + else + return -1; +} + +// public domain "baseline" PNG decoder v0.10 Sean Barrett 2006-11-18 +// simple implementation +// - only 8-bit samples +// - no CRC checking +// - allocates lots of intermediate memory +// - avoids problem of streaming data between subsystems +// - avoids explicit window management +// performance +// - uses stb_zlib, a PD zlib implementation with fast huffman decoding + + +typedef struct +{ + uint32 length; + uint32 type; +} chunk; + +#define PNG_TYPE(a,b,c,d) (((a) << 24) + ((b) << 16) + ((c) << 8) + (d)) + +static chunk get_chunk_header(stbi *s) +{ + chunk c; + c.length = get32(s); + c.type = get32(s); + return c; +} + +static int check_png_header(stbi *s) +{ + static uint8 png_sig[8] = { 137,80,78,71,13,10,26,10 }; + int i; + for (i=0; i < 8; ++i) + if (get8(s) != png_sig[i]) return e("bad png sig","Not a PNG"); + return 1; +} + +typedef struct +{ + stbi s; + uint8 *idata, *expanded, *out; +} png; + + +enum { + F_none=0, F_sub=1, F_up=2, F_avg=3, F_paeth=4, + F_avg_first, F_paeth_first, +}; + +static uint8 first_row_filter[5] = +{ + F_none, F_sub, F_none, F_avg_first, F_paeth_first +}; + +static int paeth(int a, int b, int c) +{ + int p = a + b - c; + int pa = abs(p-a); + int pb = abs(p-b); + int pc = abs(p-c); + if (pa <= pb && pa <= pc) return a; + if (pb <= pc) return b; + return c; +} + +// create the png data from post-deflated data +static int create_png_image_raw(png *a, uint8 *raw, uint32 raw_len, int out_n, uint32 x, uint32 y) +{ + stbi *s = &a->s; + uint32 i,j,stride = x*out_n; + int k; + int img_n = s->img_n; // copy it into a local for later + assert(out_n == s->img_n || out_n == s->img_n+1); + if (stbi_png_partial) y = 1; + a->out = (uint8 *) malloc(x * y * out_n); + if (!a->out) return e("outofmem", "Out of memory"); + if (!stbi_png_partial) { + if (s->img_x == x && s->img_y == y) + if (raw_len != (img_n * x + 1) * y) return e("not enough pixels","Corrupt PNG"); + else // interlaced: + if (raw_len < (img_n * x + 1) * y) return e("not enough pixels","Corrupt PNG"); + } + for (j=0; j < y; ++j) { + uint8 *cur = a->out + stride*j; + uint8 *prior = cur - stride; + int filter = *raw++; + if (filter > 4) return e("invalid filter","Corrupt PNG"); + // if first row, use special filter that doesn't sample previous row + if (j == 0) filter = first_row_filter[filter]; + // handle first pixel explicitly + for (k=0; k < img_n; ++k) { + switch(filter) { + case F_none : cur[k] = raw[k]; break; + case F_sub : cur[k] = raw[k]; break; + case F_up : cur[k] = raw[k] + prior[k]; break; + case F_avg : cur[k] = raw[k] + (prior[k]>>1); break; + case F_paeth : cur[k] = (uint8) (raw[k] + paeth(0,prior[k],0)); break; + case F_avg_first : cur[k] = raw[k]; break; + case F_paeth_first: cur[k] = raw[k]; break; + } + } + if (img_n != out_n) cur[img_n] = 255; + raw += img_n; + cur += out_n; + prior += out_n; + // this is a little gross, so that we don't switch per-pixel or per-component + if (img_n == out_n) { + #define CASE(f) \ + case f: \ + for (i=x-1; i >= 1; --i, raw+=img_n,cur+=img_n,prior+=img_n) \ + for (k=0; k < img_n; ++k) + switch(filter) { + CASE(F_none) cur[k] = raw[k]; break; + CASE(F_sub) cur[k] = raw[k] + cur[k-img_n]; break; + CASE(F_up) cur[k] = raw[k] + prior[k]; break; + CASE(F_avg) cur[k] = raw[k] + ((prior[k] + cur[k-img_n])>>1); break; + CASE(F_paeth) cur[k] = (uint8) (raw[k] + paeth(cur[k-img_n],prior[k],prior[k-img_n])); break; + CASE(F_avg_first) cur[k] = raw[k] + (cur[k-img_n] >> 1); break; + CASE(F_paeth_first) cur[k] = (uint8) (raw[k] + paeth(cur[k-img_n],0,0)); break; + } + #undef CASE + } else { + assert(img_n+1 == out_n); + #define CASE(f) \ + case f: \ + for (i=x-1; i >= 1; --i, cur[img_n]=255,raw+=img_n,cur+=out_n,prior+=out_n) \ + for (k=0; k < img_n; ++k) + switch(filter) { + CASE(F_none) cur[k] = raw[k]; break; + CASE(F_sub) cur[k] = raw[k] + cur[k-out_n]; break; + CASE(F_up) cur[k] = raw[k] + prior[k]; break; + CASE(F_avg) cur[k] = raw[k] + ((prior[k] + cur[k-out_n])>>1); break; + CASE(F_paeth) cur[k] = (uint8) (raw[k] + paeth(cur[k-out_n],prior[k],prior[k-out_n])); break; + CASE(F_avg_first) cur[k] = raw[k] + (cur[k-out_n] >> 1); break; + CASE(F_paeth_first) cur[k] = (uint8) (raw[k] + paeth(cur[k-out_n],0,0)); break; + } + #undef CASE + } + } + return 1; +} + +static int create_png_image(png *a, uint8 *raw, uint32 raw_len, int out_n, int interlaced) +{ + uint8 *final; + int p; + int save; + if (!interlaced) + return create_png_image_raw(a, raw, raw_len, out_n, a->s.img_x, a->s.img_y); + save = stbi_png_partial; + stbi_png_partial = 0; + + // de-interlacing + final = (uint8 *) malloc(a->s.img_x * a->s.img_y * out_n); + for (p=0; p < 7; ++p) { + int xorig[] = { 0,4,0,2,0,1,0 }; + int yorig[] = { 0,0,4,0,2,0,1 }; + int xspc[] = { 8,8,4,4,2,2,1 }; + int yspc[] = { 8,8,8,4,4,2,2 }; + int i,j,x,y; + // pass1_x[4] = 0, pass1_x[5] = 1, pass1_x[12] = 1 + x = (a->s.img_x - xorig[p] + xspc[p]-1) / xspc[p]; + y = (a->s.img_y - yorig[p] + yspc[p]-1) / yspc[p]; + if (x && y) { + if (!create_png_image_raw(a, raw, raw_len, out_n, x, y)) { + free(final); + return 0; + } + for (j=0; j < y; ++j) + for (i=0; i < x; ++i) + memcpy(final + (j*yspc[p]+yorig[p])*a->s.img_x*out_n + (i*xspc[p]+xorig[p])*out_n, + a->out + (j*x+i)*out_n, out_n); + free(a->out); + raw += (x*out_n+1)*y; + raw_len -= (x*out_n+1)*y; + } + } + a->out = final; + + stbi_png_partial = save; + return 1; +} + +static int compute_transparency(png *z, uint8 tc[3], int out_n) +{ + stbi *s = &z->s; + uint32 i, pixel_count = s->img_x * s->img_y; + uint8 *p = z->out; + + // compute color-based transparency, assuming we've + // already got 255 as the alpha value in the output + assert(out_n == 2 || out_n == 4); + + if (out_n == 2) { + for (i=0; i < pixel_count; ++i) { + p[1] = (p[0] == tc[0] ? 0 : 255); + p += 2; + } + } else { + for (i=0; i < pixel_count; ++i) { + if (p[0] == tc[0] && p[1] == tc[1] && p[2] == tc[2]) + p[3] = 0; + p += 4; + } + } + return 1; +} + +static int expand_palette(png *a, uint8 *palette, int /*len*/, int pal_img_n) +{ + uint32 i, pixel_count = a->s.img_x * a->s.img_y; + uint8 *p, *temp_out, *orig = a->out; + + p = (uint8 *) malloc(pixel_count * pal_img_n); + if (p == NULL) return e("outofmem", "Out of memory"); + + // between here and free(out) below, exitting would leak + temp_out = p; + + if (pal_img_n == 3) { + for (i=0; i < pixel_count; ++i) { + int n = orig[i]*4; + p[0] = palette[n ]; + p[1] = palette[n+1]; + p[2] = palette[n+2]; + p += 3; + } + } else { + for (i=0; i < pixel_count; ++i) { + int n = orig[i]*4; + p[0] = palette[n ]; + p[1] = palette[n+1]; + p[2] = palette[n+2]; + p[3] = palette[n+3]; + p += 4; + } + } + free(a->out); + a->out = temp_out; + return 1; +} + +static int parse_png_file(png *z, int scan, int req_comp) +{ + uint8 palette[1024], pal_img_n=0; + uint8 has_trans=0, tc[3]; + uint32 ioff=0, idata_limit=0, i, pal_len=0; + int first=1,k,interlace=0; + stbi *s = &z->s; + + if (!check_png_header(s)) return 0; + + if (scan == SCAN_type) return 1; + + for(;;first=0) { + chunk c = get_chunk_header(s); + if (first && c.type != PNG_TYPE('I','H','D','R')) + return e("first not IHDR","Corrupt PNG"); + switch (c.type) { + case PNG_TYPE('I','H','D','R'): { + int depth,color,comp,filter; + if (!first) return e("multiple IHDR","Corrupt PNG"); + if (c.length != 13) return e("bad IHDR len","Corrupt PNG"); + s->img_x = get32(s); if (s->img_x > (1 << 24)) return e("too large","Very large image (corrupt?)"); + s->img_y = get32(s); if (s->img_y > (1 << 24)) return e("too large","Very large image (corrupt?)"); + depth = get8(s); if (depth != 8) return e("8bit only","PNG not supported: 8-bit only"); + color = get8(s); if (color > 6) return e("bad ctype","Corrupt PNG"); + if (color == 3) pal_img_n = 3; else if (color & 1) return e("bad ctype","Corrupt PNG"); + comp = get8(s); if (comp) return e("bad comp method","Corrupt PNG"); + filter= get8(s); if (filter) return e("bad filter method","Corrupt PNG"); + interlace = get8(s); if (interlace>1) return e("bad interlace method","Corrupt PNG"); + if (!s->img_x || !s->img_y) return e("0-pixel image","Corrupt PNG"); + if (!pal_img_n) { + s->img_n = (color & 2 ? 3 : 1) + (color & 4 ? 1 : 0); + if ((1 << 30) / s->img_x / s->img_n < s->img_y) return e("too large", "Image too large to decode"); + if (scan == SCAN_header) return 1; + } else { + // if paletted, then pal_n is our final components, and + // img_n is # components to decompress/filter. + s->img_n = 1; + if ((1 << 30) / s->img_x / 4 < s->img_y) return e("too large","Corrupt PNG"); + // if SCAN_header, have to scan to see if we have a tRNS + } + break; + } + + case PNG_TYPE('P','L','T','E'): { + if (c.length > 256*3) return e("invalid PLTE","Corrupt PNG"); + pal_len = c.length / 3; + if (pal_len * 3 != c.length) return e("invalid PLTE","Corrupt PNG"); + for (i=0; i < pal_len; ++i) { + palette[i*4+0] = get8u(s); + palette[i*4+1] = get8u(s); + palette[i*4+2] = get8u(s); + palette[i*4+3] = 255; + } + break; + } + + case PNG_TYPE('t','R','N','S'): { + if (z->idata) return e("tRNS after IDAT","Corrupt PNG"); + if (pal_img_n) { + if (scan == SCAN_header) { s->img_n = 4; return 1; } + if (pal_len == 0) return e("tRNS before PLTE","Corrupt PNG"); + if (c.length > pal_len) return e("bad tRNS len","Corrupt PNG"); + pal_img_n = 4; + for (i=0; i < c.length; ++i) + palette[i*4+3] = get8u(s); + } else { + if (!(s->img_n & 1)) return e("tRNS with alpha","Corrupt PNG"); + if (c.length != (uint32) s->img_n*2) return e("bad tRNS len","Corrupt PNG"); + has_trans = 1; + for (k=0; k < s->img_n; ++k) + tc[k] = (uint8) get16(s); // non 8-bit images will be larger + } + break; + } + + case PNG_TYPE('I','D','A','T'): { + if (pal_img_n && !pal_len) return e("no PLTE","Corrupt PNG"); + if (scan == SCAN_header) { s->img_n = pal_img_n; return 1; } + if (ioff + c.length > idata_limit) { + uint8 *p; + if (idata_limit == 0) idata_limit = c.length > 4096 ? c.length : 4096; + while (ioff + c.length > idata_limit) + idata_limit *= 2; + p = (uint8 *) realloc(z->idata, idata_limit); if (p == NULL) return e("outofmem", "Out of memory"); + z->idata = p; + } + #ifndef STBI_NO_STDIO + if (s->img_file) + { + if (fread(z->idata+ioff,1,c.length,s->img_file) != c.length) return e("outofdata","Corrupt PNG"); + } + else + #endif + { + memcpy(z->idata+ioff, s->img_buffer, c.length); + s->img_buffer += c.length; + } + ioff += c.length; + break; + } + + case PNG_TYPE('I','E','N','D'): { + uint32 raw_len; + if (scan != SCAN_load) return 1; + if (z->idata == NULL) return e("no IDAT","Corrupt PNG"); + z->expanded = (uint8 *) stbi_zlib_decode_malloc((char *) z->idata, ioff, (int *) &raw_len); + if (z->expanded == NULL) return 0; // zlib should set error + free(z->idata); z->idata = NULL; + if ((req_comp == s->img_n+1 && req_comp != 3 && !pal_img_n) || has_trans) + s->img_out_n = s->img_n+1; + else + s->img_out_n = s->img_n; + if (!create_png_image(z, z->expanded, raw_len, s->img_out_n, interlace)) return 0; + if (has_trans) + if (!compute_transparency(z, tc, s->img_out_n)) return 0; + if (pal_img_n) { + // pal_img_n == 3 or 4 + s->img_n = pal_img_n; // record the actual colors we had + s->img_out_n = pal_img_n; + if (req_comp >= 3) s->img_out_n = req_comp; + if (!expand_palette(z, palette, pal_len, s->img_out_n)) + return 0; + } + free(z->expanded); z->expanded = NULL; + return 1; + } + + default: + // if critical, fail + if ((c.type & (1 << 29)) == 0) { + #ifndef STBI_NO_FAILURE_STRINGS + // not threadsafe + static char invalid_chunk[] = "XXXX chunk not known"; + invalid_chunk[0] = (uint8) (c.type >> 24); + invalid_chunk[1] = (uint8) (c.type >> 16); + invalid_chunk[2] = (uint8) (c.type >> 8); + invalid_chunk[3] = (uint8) (c.type >> 0); + #endif + return e(invalid_chunk, "PNG not supported: unknown chunk type"); + } + skip(s, c.length); + break; + } + // end of chunk, read and skip CRC + get32(s); + } +} + +static unsigned char *do_png(png *p, int *x, int *y, int *n, int req_comp) +{ + unsigned char *result=NULL; + p->expanded = NULL; + p->idata = NULL; + p->out = NULL; + if (req_comp < 0 || req_comp > 4) return epuc("bad req_comp", "Internal error"); + if (parse_png_file(p, SCAN_load, req_comp)) { + result = p->out; + p->out = NULL; + if (req_comp && req_comp != p->s.img_out_n) { + result = convert_format(result, p->s.img_out_n, req_comp, p->s.img_x, p->s.img_y); + p->s.img_out_n = req_comp; + if (result == NULL) return result; + } + *x = p->s.img_x; + *y = p->s.img_y; + if (n) *n = p->s.img_n; + } + free(p->out); p->out = NULL; + free(p->expanded); p->expanded = NULL; + free(p->idata); p->idata = NULL; + + return result; +} + +#ifndef STBI_NO_STDIO +unsigned char *stbi_png_load_from_file(FILE *f, int *x, int *y, int *comp, int req_comp) +{ + png p; + start_file(&p.s, f); + return do_png(&p, x,y,comp,req_comp); +} + +unsigned char *stbi_png_load(char const *filename, int *x, int *y, int *comp, int req_comp) +{ + unsigned char *data; + FILE *f = fopen(filename, "rb"); + if (!f) return NULL; + data = stbi_png_load_from_file(f,x,y,comp,req_comp); + fclose(f); + return data; +} +#endif + +unsigned char *stbi_png_load_from_memory(stbi_uc const *buffer, int len, int *x, int *y, int *comp, int req_comp) +{ + png p; + start_mem(&p.s, buffer,len); + return do_png(&p, x,y,comp,req_comp); +} + +#ifndef STBI_NO_STDIO +int stbi_png_test_file(FILE *f) +{ + png p; + int n,r; + n = ftell(f); + start_file(&p.s, f); + r = parse_png_file(&p, SCAN_type,STBI_default); + fseek(f,n,SEEK_SET); + return r; +} +#endif + +int stbi_png_test_memory(stbi_uc const *buffer, int len) +{ + png p; + start_mem(&p.s, buffer, len); + return parse_png_file(&p, SCAN_type,STBI_default); +} + +// TODO: load header from png +#ifndef STBI_NO_STDIO +int stbi_png_info (char const *filename, int *x, int *y, int *comp) +{ + png p; + FILE *f = fopen(filename, "rb"); + if (!f) return 0; + start_file(&p.s, f); + if (parse_png_file(&p, SCAN_header, 0)) { + if(x) *x = p.s.img_x; + if(y) *y = p.s.img_y; + if (comp) *comp = p.s.img_n; + fclose(f); + return 1; + } + fclose(f); + return 0; +} + +extern int stbi_png_info_from_file (FILE *f, int *x, int *y, int *comp); +#endif +extern int stbi_png_info_from_memory (stbi_uc const *buffer, int len, int *x, int *y, int *comp); + +// Microsoft/Windows BMP image + +static int bmp_test(stbi *s) +{ + int sz; + if (get8(s) != 'B') return 0; + if (get8(s) != 'M') return 0; + get32le(s); // discard filesize + get16le(s); // discard reserved + get16le(s); // discard reserved + get32le(s); // discard data offset + sz = get32le(s); + if (sz == 12 || sz == 40 || sz == 56 || sz == 108) return 1; + return 0; +} + +#ifndef STBI_NO_STDIO +int stbi_bmp_test_file (FILE *f) +{ + stbi s; + int r,n = ftell(f); + start_file(&s,f); + r = bmp_test(&s); + fseek(f,n,SEEK_SET); + return r; +} +#endif + +int stbi_bmp_test_memory (stbi_uc const *buffer, int len) +{ + stbi s; + start_mem(&s, buffer, len); + return bmp_test(&s); +} + +// returns 0..31 for the highest set bit +static int high_bit(unsigned int z) +{ + int n=0; + if (z == 0) return -1; + if (z >= 0x10000) n += 16, z >>= 16; + if (z >= 0x00100) n += 8, z >>= 8; + if (z >= 0x00010) n += 4, z >>= 4; + if (z >= 0x00004) n += 2, z >>= 2; + if (z >= 0x00002) n += 1, z >>= 1; + return n; +} + +static int bitcount(unsigned int a) +{ + a = (a & 0x55555555) + ((a >> 1) & 0x55555555); // max 2 + a = (a & 0x33333333) + ((a >> 2) & 0x33333333); // max 4 + a = (a + (a >> 4)) & 0x0f0f0f0f; // max 8 per 4, now 8 bits + a = (a + (a >> 8)); // max 16 per 8 bits + a = (a + (a >> 16)); // max 32 per 8 bits + return a & 0xff; +} + +static int shiftsigned(int v, int shift, int bits) +{ + int result; + int z=0; + + if (shift < 0) v <<= -shift; + else v >>= shift; + result = v; + + z = bits; + while (z < 8) { + result += v >> z; + z += bits; + } + return result; +} + +static stbi_uc *bmp_load(stbi *s, int *x, int *y, int *comp, int req_comp) +{ + uint8 *out; + unsigned int mr=0,mg=0,mb=0,ma=0, fake_a=0; + stbi_uc pal[256][4]; + int psize=0,i,j,compress=0,width; + int bpp, flip_vertically, pad, target, offset, hsz; + if (get8(s) != 'B' || get8(s) != 'M') return epuc("not BMP", "Corrupt BMP"); + get32le(s); // discard filesize + get16le(s); // discard reserved + get16le(s); // discard reserved + offset = get32le(s); + hsz = get32le(s); + if (hsz != 12 && hsz != 40 && hsz != 56 && hsz != 108) return epuc("unknown BMP", "BMP type not supported: unknown"); + failure_reason = "bad BMP"; + if (hsz == 12) { + s->img_x = get16le(s); + s->img_y = get16le(s); + } else { + s->img_x = get32le(s); + s->img_y = get32le(s); + } + if (get16le(s) != 1) return 0; + bpp = get16le(s); + if (bpp == 1) return epuc("monochrome", "BMP type not supported: 1-bit"); + flip_vertically = ((int) s->img_y) > 0; + s->img_y = abs((int) s->img_y); + if (hsz == 12) { + if (bpp < 24) + psize = (offset - 14 - 24) / 3; + } else { + compress = get32le(s); + if (compress == 1 || compress == 2) return epuc("BMP RLE", "BMP type not supported: RLE"); + get32le(s); // discard sizeof + get32le(s); // discard hres + get32le(s); // discard vres + get32le(s); // discard colorsused + get32le(s); // discard max important + if (hsz == 40 || hsz == 56) { + if (hsz == 56) { + get32le(s); + get32le(s); + get32le(s); + get32le(s); + } + if (bpp == 16 || bpp == 32) { + mr = mg = mb = 0; + if (compress == 0) { + if (bpp == 32) { + mr = 0xff << 16; + mg = 0xff << 8; + mb = 0xff << 0; + ma = (unsigned int)(0xff << 24); + fake_a = 1; // @TODO: check for cases like alpha value is all 0 and switch it to 255 + } else { + mr = 31 << 10; + mg = 31 << 5; + mb = 31 << 0; + } + } else if (compress == 3) { + mr = get32le(s); + mg = get32le(s); + mb = get32le(s); + // not documented, but generated by photoshop and handled by mspaint + if (mr == mg && mg == mb) { + // ?!?!? + return NULL; + } + } else + return NULL; + } + } else { + assert(hsz == 108); + mr = get32le(s); + mg = get32le(s); + mb = get32le(s); + ma = get32le(s); + get32le(s); // discard color space + for (i=0; i < 12; ++i) + get32le(s); // discard color space parameters + } + if (bpp < 16) + psize = (offset - 14 - hsz) >> 2; + } + s->img_n = ma ? 4 : 3; + if (req_comp && req_comp >= 3) // we can directly decode 3 or 4 + target = req_comp; + else + target = s->img_n; // if they want monochrome, we'll post-convert + out = (stbi_uc *) malloc(target * s->img_x * s->img_y); + if (!out) return epuc("outofmem", "Out of memory"); + if (bpp < 16) { + int z=0; + if (psize == 0 || psize > 256) { free(out); return epuc("invalid", "Corrupt BMP"); } + for (i=0; i < psize; ++i) { + pal[i][2] = (stbi_uc)get8(s); + pal[i][1] = (stbi_uc)get8(s); + pal[i][0] = (stbi_uc)get8(s); + if (hsz != 12) get8(s); + pal[i][3] = 255; + } + skip(s, offset - 14 - hsz - psize * (hsz == 12 ? 3 : 4)); + if (bpp == 4) width = (s->img_x + 1) >> 1; + else if (bpp == 8) width = s->img_x; + else { free(out); return epuc("bad bpp", "Corrupt BMP"); } + pad = (-width)&3; + for (j=0; j < (int) s->img_y; ++j) { + for (i=0; i < (int) s->img_x; i += 2) { + int v=get8(s),v2=0; + if (bpp == 4) { + v2 = v & 15; + v >>= 4; + } + out[z++] = pal[v][0]; + out[z++] = pal[v][1]; + out[z++] = pal[v][2]; + if (target == 4) out[z++] = 255; + if (i+1 == (int) s->img_x) break; + v = (bpp == 8) ? get8(s) : v2; + out[z++] = pal[v][0]; + out[z++] = pal[v][1]; + out[z++] = pal[v][2]; + if (target == 4) out[z++] = 255; + } + skip(s, pad); + } + } else { + int rshift=0,gshift=0,bshift=0,ashift=0,rcount=0,gcount=0,bcount=0,acount=0; + int z = 0; + int easy=0; + skip(s, offset - 14 - hsz); + if (bpp == 24) width = 3 * s->img_x; + else if (bpp == 16) width = 2*s->img_x; + else /* bpp = 32 and pad = 0 */ width=0; + pad = (-width) & 3; + if (bpp == 24) { + easy = 1; + } else if (bpp == 32) { + if (mb == 0xff && mg == 0xff00 && mr == 0xff000000 && ma == 0xff000000) + easy = 2; + } + if (!easy) { + if (!mr || !mg || !mb) return epuc("bad masks", "Corrupt BMP"); + // right shift amt to put high bit in position #7 + rshift = high_bit(mr)-7; rcount = bitcount(mr); + gshift = high_bit(mg)-7; gcount = bitcount(mr); + bshift = high_bit(mb)-7; bcount = bitcount(mr); + ashift = high_bit(ma)-7; acount = bitcount(mr); + } + for (j=0; j < (int) s->img_y; ++j) { + if (easy) { + for (i=0; i < (int) s->img_x; ++i) { + int a; + out[z+2] = (uint8)get8(s); + out[z+1] = (uint8)get8(s); + out[z+0] = (uint8)get8(s); + z += 3; + a = (easy == 2 ? get8(s) : 255); + if (target == 4) out[z++] = (uint8)a; + } + } else { + for (i=0; i < (int) s->img_x; ++i) { + uint32 v = (bpp == 16 ? get16le(s) : get32le(s)); + int a; + out[z++] = (uint8)shiftsigned(v & mr, rshift, rcount); + out[z++] = (uint8)shiftsigned(v & mg, gshift, gcount); + out[z++] = (uint8)shiftsigned(v & mb, bshift, bcount); + a = (ma ? shiftsigned(v & ma, ashift, acount) : 255); + if (target == 4) out[z++] = (uint8)a; + } + } + skip(s, pad); + } + } + if (flip_vertically) { + stbi_uc t; + for (j=0; j < (int) s->img_y>>1; ++j) { + stbi_uc *p1 = out + j *s->img_x*target; + stbi_uc *p2 = out + (s->img_y-1-j)*s->img_x*target; + for (i=0; i < (int) s->img_x*target; ++i) { + t = p1[i], p1[i] = p2[i], p2[i] = t; + } + } + } + + if (req_comp && req_comp != target) { + out = convert_format(out, target, req_comp, s->img_x, s->img_y); + if (out == NULL) return out; // convert_format frees input on failure + } + + *x = s->img_x; + *y = s->img_y; + if (comp) *comp = target; + return out; +} + +#ifndef STBI_NO_STDIO +stbi_uc *stbi_bmp_load (char const *filename, int *x, int *y, int *comp, int req_comp) +{ + stbi_uc *data; + FILE *f = fopen(filename, "rb"); + if (!f) return NULL; + data = stbi_bmp_load_from_file(f, x,y,comp,req_comp); + fclose(f); + return data; +} + +stbi_uc *stbi_bmp_load_from_file (FILE *f, int *x, int *y, int *comp, int req_comp) +{ + stbi s; + start_file(&s, f); + return bmp_load(&s, x,y,comp,req_comp); +} +#endif + +stbi_uc *stbi_bmp_load_from_memory (stbi_uc const *buffer, int len, int *x, int *y, int *comp, int req_comp) +{ + stbi s; + start_mem(&s, buffer, len); + return bmp_load(&s, x,y,comp,req_comp); +} + +// Targa Truevision - TGA +// by Jonathan Dummer + +static int tga_test(stbi *s) +{ + int sz; + get8u(s); // discard Offset + sz = get8u(s); // color type + if( sz > 1 ) return 0; // only RGB or indexed allowed + sz = get8u(s); // image type + if( (sz != 1) && (sz != 2) && (sz != 3) && (sz != 9) && (sz != 10) && (sz != 11) ) return 0; // only RGB or grey allowed, +/- RLE + get16(s); // discard palette start + get16(s); // discard palette length + get8(s); // discard bits per palette color entry + get16(s); // discard x origin + get16(s); // discard y origin + if( get16(s) < 1 ) return 0; // test width + if( get16(s) < 1 ) return 0; // test height + sz = get8(s); // bits per pixel + if( (sz != 8) && (sz != 16) && (sz != 24) && (sz != 32) ) return 0; // only RGB or RGBA or grey allowed + return 1; // seems to have passed everything +} + +#ifndef STBI_NO_STDIO +int stbi_tga_test_file (FILE *f) +{ + stbi s; + int r,n = ftell(f); + start_file(&s, f); + r = tga_test(&s); + fseek(f,n,SEEK_SET); + return r; +} +#endif + +int stbi_tga_test_memory (stbi_uc const *buffer, int len) +{ + stbi s; + start_mem(&s, buffer, len); + return tga_test(&s); +} + +static stbi_uc *tga_load(stbi *s, int *x, int *y, int *comp, int req_comp) +{ + // read in the TGA header stuff + int tga_offset = get8u(s); + int tga_indexed = get8u(s); + int tga_image_type = get8u(s); + int tga_is_RLE = 0; + int tga_palette_start = get16le(s); + int tga_palette_len = get16le(s); + int tga_palette_bits = get8u(s); + int tga_x_origin = get16le(s); + int tga_y_origin = get16le(s); + int tga_width = get16le(s); + int tga_height = get16le(s); + int tga_bits_per_pixel = get8u(s); + int tga_inverted = get8u(s); + // image data + unsigned char *tga_data; + unsigned char *tga_palette = NULL; + int i, j; + unsigned char raw_data[4] = {0,0,0,0}; + unsigned char trans_data[4] = {0,0,0,0}; + int RLE_count = 0; + int RLE_repeating = 0; + int read_next_pixel = 1; + // do a tiny bit of precessing + if( tga_image_type >= 8 ) + { + tga_image_type -= 8; + tga_is_RLE = 1; + } + /* int tga_alpha_bits = tga_inverted & 15; */ + tga_inverted = 1 - ((tga_inverted >> 5) & 1); + + // error check + if( //(tga_indexed) || + (tga_width < 1) || (tga_height < 1) || + (tga_image_type < 1) || (tga_image_type > 3) || + ((tga_bits_per_pixel != 8) && (tga_bits_per_pixel != 16) && + (tga_bits_per_pixel != 24) && (tga_bits_per_pixel != 32)) + ) + { + return NULL; + } + + // If I'm paletted, then I'll use the number of bits from the palette + if( tga_indexed ) + { + tga_bits_per_pixel = tga_palette_bits; + } + + // tga info + *x = tga_width; + *y = tga_height; + if( (req_comp < 1) || (req_comp > 4) ) + { + // just use whatever the file was + req_comp = tga_bits_per_pixel / 8; + *comp = req_comp; + } else + { + // force a new number of components + *comp = tga_bits_per_pixel/8; + } + tga_data = (unsigned char*)malloc( tga_width * tga_height * req_comp ); + + // skip to the data's starting position (offset usually = 0) + skip(s, tga_offset ); + // do I need to load a palette? + if( tga_indexed ) + { + // any data to skip? (offset usually = 0) + skip(s, tga_palette_start ); + // load the palette + tga_palette = (unsigned char*)malloc( tga_palette_len * tga_palette_bits / 8 ); + getn(s, tga_palette, tga_palette_len * tga_palette_bits / 8 ); + } + // load the data + for( i = 0; i < tga_width * tga_height; ++i ) + { + // if I'm in RLE mode, do I need to get a RLE chunk? + if( tga_is_RLE ) + { + if( RLE_count == 0 ) + { + // yep, get the next byte as a RLE command + int RLE_cmd = get8u(s); + RLE_count = 1 + (RLE_cmd & 127); + RLE_repeating = RLE_cmd >> 7; + read_next_pixel = 1; + } else if( !RLE_repeating ) + { + read_next_pixel = 1; + } + } else + { + read_next_pixel = 1; + } + // OK, if I need to read a pixel, do it now + if( read_next_pixel ) + { + // load however much data we did have + if( tga_indexed ) + { + // read in 1 byte, then perform the lookup + int pal_idx = get8u(s); + if( pal_idx >= tga_palette_len ) + { + // invalid index + pal_idx = 0; + } + pal_idx *= tga_bits_per_pixel / 8; + for( j = 0; j*8 < tga_bits_per_pixel; ++j ) + { + raw_data[j] = tga_palette[pal_idx+j]; + } + } else + { + // read in the data raw + for( j = 0; j*8 < tga_bits_per_pixel; ++j ) + { + raw_data[j] = get8u(s); + } + } + // convert raw to the intermediate format + switch( tga_bits_per_pixel ) + { + case 8: + // Luminous => RGBA + trans_data[0] = raw_data[0]; + trans_data[1] = raw_data[0]; + trans_data[2] = raw_data[0]; + trans_data[3] = 255; + break; + case 16: + // Luminous,Alpha => RGBA + trans_data[0] = raw_data[0]; + trans_data[1] = raw_data[0]; + trans_data[2] = raw_data[0]; + trans_data[3] = raw_data[1]; + break; + case 24: + // BGR => RGBA + trans_data[0] = raw_data[2]; + trans_data[1] = raw_data[1]; + trans_data[2] = raw_data[0]; + trans_data[3] = 255; + break; + case 32: + // BGRA => RGBA + trans_data[0] = raw_data[2]; + trans_data[1] = raw_data[1]; + trans_data[2] = raw_data[0]; + trans_data[3] = raw_data[3]; + break; + } + // clear the reading flag for the next pixel + read_next_pixel = 0; + } // end of reading a pixel + // convert to final format + switch( req_comp ) + { + case 1: + // RGBA => Luminance + tga_data[i*req_comp+0] = compute_y(trans_data[0],trans_data[1],trans_data[2]); + break; + case 2: + // RGBA => Luminance,Alpha + tga_data[i*req_comp+0] = compute_y(trans_data[0],trans_data[1],trans_data[2]); + tga_data[i*req_comp+1] = trans_data[3]; + break; + case 3: + // RGBA => RGB + tga_data[i*req_comp+0] = trans_data[0]; + tga_data[i*req_comp+1] = trans_data[1]; + tga_data[i*req_comp+2] = trans_data[2]; + break; + case 4: + // RGBA => RGBA + tga_data[i*req_comp+0] = trans_data[0]; + tga_data[i*req_comp+1] = trans_data[1]; + tga_data[i*req_comp+2] = trans_data[2]; + tga_data[i*req_comp+3] = trans_data[3]; + break; + } + // in case we're in RLE mode, keep counting down + --RLE_count; + } + // do I need to invert the image? + if( tga_inverted ) + { + for( j = 0; j*2 < tga_height; ++j ) + { + int index1 = j * tga_width * req_comp; + int index2 = (tga_height - 1 - j) * tga_width * req_comp; + for( i = tga_width * req_comp; i > 0; --i ) + { + unsigned char temp = tga_data[index1]; + tga_data[index1] = tga_data[index2]; + tga_data[index2] = temp; + ++index1; + ++index2; + } + } + } + // clear my palette, if I had one + if( tga_palette != NULL ) + { + free( tga_palette ); + } + // the things I do to get rid of an error message, and yet keep + // Microsoft's C compilers happy... [8^( + tga_palette_start = tga_palette_len = tga_palette_bits = + tga_x_origin = tga_y_origin = 0; + // OK, done + return tga_data; +} + +#ifndef STBI_NO_STDIO +stbi_uc *stbi_tga_load (char const *filename, int *x, int *y, int *comp, int req_comp) +{ + stbi_uc *data; + FILE *f = fopen(filename, "rb"); + if (!f) return NULL; + data = stbi_tga_load_from_file(f, x,y,comp,req_comp); + fclose(f); + return data; +} + +stbi_uc *stbi_tga_load_from_file (FILE *f, int *x, int *y, int *comp, int req_comp) +{ + stbi s; + start_file(&s, f); + return tga_load(&s, x,y,comp,req_comp); +} +#endif + +stbi_uc *stbi_tga_load_from_memory (stbi_uc const *buffer, int len, int *x, int *y, int *comp, int req_comp) +{ + stbi s; + start_mem(&s, buffer, len); + return tga_load(&s, x,y,comp,req_comp); +} + + +// ************************************************************************************************* +// Photoshop PSD loader -- PD by Thatcher Ulrich, integration by Nicholas Schulz, tweaked by STB + +static int psd_test(stbi *s) +{ + if (get32(s) != 0x38425053) return 0; // "8BPS" + else return 1; +} + +#ifndef STBI_NO_STDIO +int stbi_psd_test_file(FILE *f) +{ + stbi s; + int r,n = ftell(f); + start_file(&s, f); + r = psd_test(&s); + fseek(f,n,SEEK_SET); + return r; +} +#endif + +int stbi_psd_test_memory(stbi_uc const *buffer, int len) +{ + stbi s; + start_mem(&s, buffer, len); + return psd_test(&s); +} + +static stbi_uc *psd_load(stbi *s, int *x, int *y, int *comp, int req_comp) +{ + int pixelCount; + int channelCount, compression; + int channel, i, count, len; + int w,h; + uint8 *out; + + // Check identifier + if (get32(s) != 0x38425053) // "8BPS" + return epuc("not PSD", "Corrupt PSD image"); + + // Check file type version. + if (get16(s) != 1) + return epuc("wrong version", "Unsupported version of PSD image"); + + // Skip 6 reserved bytes. + skip(s, 6 ); + + // Read the number of channels (R, G, B, A, etc). + channelCount = get16(s); + if (channelCount < 0 || channelCount > 16) + return epuc("wrong channel count", "Unsupported number of channels in PSD image"); + + // Read the rows and columns of the image. + h = get32(s); + w = get32(s); + + // Make sure the depth is 8 bits. + if (get16(s) != 8) + return epuc("unsupported bit depth", "PSD bit depth is not 8 bit"); + + // Make sure the color mode is RGB. + // Valid options are: + // 0: Bitmap + // 1: Grayscale + // 2: Indexed color + // 3: RGB color + // 4: CMYK color + // 7: Multichannel + // 8: Duotone + // 9: Lab color + if (get16(s) != 3) + return epuc("wrong color format", "PSD is not in RGB color format"); + + // Skip the Mode Data. (It's the palette for indexed color; other info for other modes.) + skip(s,get32(s) ); + + // Skip the image resources. (resolution, pen tool paths, etc) + skip(s, get32(s) ); + + // Skip the reserved data. + skip(s, get32(s) ); + + // Find out if the data is compressed. + // Known values: + // 0: no compression + // 1: RLE compressed + compression = get16(s); + if (compression > 1) + return epuc("bad compression", "PSD has an unknown compression format"); + + // Create the destination image. + out = (stbi_uc *) malloc(4 * w*h); + if (!out) return epuc("outofmem", "Out of memory"); + pixelCount = w*h; + + // Initialize the data to zero. + //memset( out, 0, pixelCount * 4 ); + + // Finally, the image data. + if (compression) { + // RLE as used by .PSD and .TIFF + // Loop until you get the number of unpacked bytes you are expecting: + // Read the next source byte into n. + // If n is between 0 and 127 inclusive, copy the next n+1 bytes literally. + // Else if n is between -127 and -1 inclusive, copy the next byte -n+1 times. + // Else if n is 128, noop. + // Endloop + + // The RLE-compressed data is preceeded by a 2-byte data count for each row in the data, + // which we're going to just skip. + skip(s, h * channelCount * 2 ); + + // Read the RLE data by channel. + for (channel = 0; channel < 4; channel++) { + uint8 *p; + + p = out+channel; + if (channel >= channelCount) { + // Fill this channel with default data. + for (i = 0; i < pixelCount; i++) *p = (channel == 3 ? 255 : 0), p += 4; + } else { + // Read the RLE data. + count = 0; + while (count < pixelCount) { + len = get8(s); + if (len == 128) { + // No-op. + } else if (len < 128) { + // Copy next len+1 bytes literally. + len++; + count += len; + while (len) { + *p = (uint8)get8(s); + p += 4; + len--; + } + } else if (len > 128) { + uint32 val; + // Next -len+1 bytes in the dest are replicated from next source byte. + // (Interpret len as a negative 8-bit int.) + len ^= 0x0FF; + len += 2; + val = get8(s); + count += len; + while (len) { + *p = (uint8)val; + p += 4; + len--; + } + } + } + } + } + + } else { + // We're at the raw image data. It's each channel in order (Red, Green, Blue, Alpha, ...) + // where each channel consists of an 8-bit value for each pixel in the image. + + // Read the data by channel. + for (channel = 0; channel < 4; channel++) { + uint8 *p; + + p = out + channel; + if (channel > channelCount) { + // Fill this channel with default data. + for (i = 0; i < pixelCount; i++) *p = channel == 3 ? 255 : 0, p += 4; + } else { + // Read the data. + count = 0; + for (i = 0; i < pixelCount; i++) + *p = (uint8)get8(s), p += 4; + } + } + } + + if (req_comp && req_comp != 4) { + out = convert_format(out, 4, req_comp, w, h); + if (out == NULL) return out; // convert_format frees input on failure + } + + if (comp) *comp = channelCount; + *y = h; + *x = w; + + return out; +} + +#ifndef STBI_NO_STDIO +stbi_uc *stbi_psd_load(char const *filename, int *x, int *y, int *comp, int req_comp) +{ + stbi_uc *data; + FILE *f = fopen(filename, "rb"); + if (!f) return NULL; + data = stbi_psd_load_from_file(f, x,y,comp,req_comp); + fclose(f); + return data; +} + +stbi_uc *stbi_psd_load_from_file(FILE *f, int *x, int *y, int *comp, int req_comp) +{ + stbi s; + start_file(&s, f); + return psd_load(&s, x,y,comp,req_comp); +} +#endif + +stbi_uc *stbi_psd_load_from_memory (stbi_uc const *buffer, int len, int *x, int *y, int *comp, int req_comp) +{ + stbi s; + start_mem(&s, buffer, len); + return psd_load(&s, x,y,comp,req_comp); +} + + +// ************************************************************************************************* +// Radiance RGBE HDR loader +// originally by Nicolas Schulz +#ifndef STBI_NO_HDR +static int hdr_test(stbi *s) +{ + const char *signature = "#?RADIANCE\n"; + int i; + for (i=0; signature[i]; ++i) + if (get8(s) != signature[i]) + return 0; + return 1; +} + +int stbi_hdr_test_memory(stbi_uc const *buffer, int len) +{ + stbi s; + start_mem(&s, buffer, len); + return hdr_test(&s); +} + +#ifndef STBI_NO_STDIO +int stbi_hdr_test_file(FILE *f) +{ + stbi s; + int r,n = ftell(f); + start_file(&s, f); + r = hdr_test(&s); + fseek(f,n,SEEK_SET); + return r; +} +#endif + +#define HDR_BUFLEN 1024 +static char *hdr_gettoken(stbi *z, char *buffer) +{ + int len=0; + char c = '\0'; + + c = (char)get8(z); + + while (!at_eof(z) && c != '\n') { + buffer[len++] = c; + if (len == HDR_BUFLEN-1) { + // flush to end of line + while (!at_eof(z) && get8(z) != '\n') + ; + break; + } + c = (char)get8(z); + } + + buffer[len] = 0; + return buffer; +} + +static void hdr_convert(float *output, stbi_uc *input, int req_comp) +{ + if( input[3] != 0 ) { + float f1; + // Exponent + f1 = (float) ldexp(1.0f, input[3] - (int)(128 + 8)); + if (req_comp <= 2) + output[0] = (input[0] + input[1] + input[2]) * f1 / 3; + else { + output[0] = input[0] * f1; + output[1] = input[1] * f1; + output[2] = input[2] * f1; + } + if (req_comp == 2) output[1] = 1; + if (req_comp == 4) output[3] = 1; + } else { + switch (req_comp) { + case 4: output[3] = 1; /* fallthrough */ + case 3: output[0] = output[1] = output[2] = 0; + break; + case 2: output[1] = 1; /* fallthrough */ + case 1: output[0] = 0; + break; + } + } +} + + +static float *hdr_load(stbi *s, int *x, int *y, int *comp, int req_comp) +{ + char buffer[HDR_BUFLEN]; + char *token; + int valid = 0; + int width, height; + stbi_uc *scanline; + float *hdr_data; + int len; + unsigned char count, value; + int i, j, k, c1,c2, z; + + + // Check identifier + if (strcmp(hdr_gettoken(s,buffer), "#?RADIANCE") != 0) + return epf("not HDR", "Corrupt HDR image"); + + // Parse header + for(;;) { + token = hdr_gettoken(s,buffer); + if (token[0] == 0) break; + if (strcmp(token, "FORMAT=32-bit_rle_rgbe") == 0) valid = 1; + } + + if (!valid) return epf("unsupported format", "Unsupported HDR format"); + + // Parse width and height + // can't use sscanf() if we're not using stdio! + token = hdr_gettoken(s,buffer); + if (strncmp(token, "-Y ", 3)) return epf("unsupported data layout", "Unsupported HDR format"); + token += 3; + height = strtol(token, &token, 10); + while (*token == ' ') ++token; + if (strncmp(token, "+X ", 3)) return epf("unsupported data layout", "Unsupported HDR format"); + token += 3; + width = strtol(token, NULL, 10); + + *x = width; + *y = height; + + *comp = 3; + if (req_comp == 0) req_comp = 3; + + // Read data + hdr_data = (float *) malloc(height * width * req_comp * sizeof(float)); + + // Load image data + // image data is stored as some number of sca + if( width < 8 || width >= 32768) { + // Read flat data + for (j=0; j < height; ++j) { + for (i=0; i < width; ++i) { + stbi_uc rgbe[4]; + main_decode_loop: + getn(s, rgbe, 4); + hdr_convert(hdr_data + j * width * req_comp + i * req_comp, rgbe, req_comp); + } + } + } else { + // Read RLE-encoded data + scanline = NULL; + + for (j = 0; j < height; ++j) { + c1 = get8(s); + c2 = get8(s); + len = get8(s); + if (c1 != 2 || c2 != 2 || (len & 0x80)) { + // not run-length encoded, so we have to actually use THIS data as a decoded + // pixel (note this can't be a valid pixel--one of RGB must be >= 128) + stbi_uc rgbe[4] = { (stbi_uc)c1,(stbi_uc)c2,(stbi_uc)len, (stbi_uc)get8(s) }; + hdr_convert(hdr_data, rgbe, req_comp); + i = 1; + j = 0; + free(scanline); + goto main_decode_loop; // yes, this is fucking insane; blame the fucking insane format + } + len <<= 8; + len |= get8(s); + if (len != width) { free(hdr_data); free(scanline); return epf("invalid decoded scanline length", "corrupt HDR"); } + if (scanline == NULL) scanline = (stbi_uc *) malloc(width * 4); + + for (k = 0; k < 4; ++k) { + i = 0; + while (i < width) { + count = (unsigned char)get8(s); + if (count > 128) { + // Run + value = (unsigned char)get8(s); + count -= 128; + for (z = 0; z < count; ++z) + scanline[i++ * 4 + k] = value; + } else { + // Dump + for (z = 0; z < count; ++z) + scanline[i++ * 4 + k] = (stbi_uc)get8(s); + } + } + } + for (i=0; i < width; ++i) + hdr_convert(hdr_data+(j*width + i)*req_comp, scanline + i*4, req_comp); + } + free(scanline); + } + + return hdr_data; +} + +#ifndef STBI_NO_STDIO +float *stbi_hdr_load_from_file(FILE *f, int *x, int *y, int *comp, int req_comp) +{ + stbi s; + start_file(&s,f); + return hdr_load(&s,x,y,comp,req_comp); +} +#endif + +float *stbi_hdr_load_from_memory(stbi_uc const *buffer, int len, int *x, int *y, int *comp, int req_comp) +{ + stbi s; + start_mem(&s,buffer, len); + return hdr_load(&s,x,y,comp,req_comp); +} + +#endif // STBI_NO_HDR + +/////////////////////// write image /////////////////////// + +#ifndef STBI_NO_WRITE + +static void write8(FILE *f, int x) { uint8 z = (uint8) x; fwrite(&z,1,1,f); } + +static void writefv(FILE *f, const char *fmt, va_list v) +{ + while (*fmt) { + switch (*fmt++) { + case ' ': break; + case '1': { uint8 x = (uint8)va_arg(v, int); write8(f,x); break; } + case '2': { int16 x = (int16)va_arg(v, int); write8(f,x); write8(f,x>>8); break; } + case '4': { int32 x = va_arg(v, int); write8(f,x); write8(f,x>>8); write8(f,x>>16); write8(f,x>>24); break; } + default: + assert(0); + va_end(v); + return; + } + } +} + +static void writef(FILE *f, const char *fmt, ...) +{ + va_list v; + va_start(v, fmt); + writefv(f,fmt,v); + va_end(v); +} + +static void write_pixels(FILE *f, int rgb_dir, int vdir, int x, int y, int comp, void *data, int write_alpha, int scanline_pad) +{ + uint8 bg[3] = { 255, 0, 255}, px[3]; + uint32 zero = 0; + int i,j,k, j_end; + + if (vdir < 0) + j_end = -1, j = y-1; + else + j_end = y, j = 0; + + for (; j != j_end; j += vdir) { + for (i=0; i < x; ++i) { + uint8 *d = (uint8 *) data + (j*x+i)*comp; + if (write_alpha < 0) + fwrite(&d[comp-1], 1, 1, f); + switch (comp) { + case 1: + case 2: writef(f, "111", d[0],d[0],d[0]); + break; + case 4: + if (!write_alpha) { + for (k=0; k < 3; ++k) + px[k] = bg[k] + ((d[k] - bg[k]) * d[3])/255; + writef(f, "111", px[1-rgb_dir],px[1],px[1+rgb_dir]); + break; + } + /* FALLTHROUGH */ + case 3: + writef(f, "111", d[1-rgb_dir],d[1],d[1+rgb_dir]); + break; + } + if (write_alpha > 0) + fwrite(&d[comp-1], 1, 1, f); + } + fwrite(&zero,scanline_pad,1,f); + } +} + +static int outfile(char const *filename, int rgb_dir, int vdir, int x, int y, int comp, void *data, int alpha, int pad, const char *fmt, ...) +{ + FILE *f = fopen(filename, "wb"); + if (f) { + va_list v; + va_start(v, fmt); + writefv(f, fmt, v); + va_end(v); + write_pixels(f,rgb_dir,vdir,x,y,comp,data,alpha,pad); + fclose(f); + } + return f != NULL; +} + +int stbi_write_bmp(char const *filename, int x, int y, int comp, void *data) +{ + int pad = (-x*3) & 3; + return outfile(filename,-1,-1,x,y,comp,data,0,pad, + "11 4 22 4" "4 44 22 444444", + 'B', 'M', 14+40+(x*3+pad)*y, 0,0, 14+40, // file header + 40, x,y, 1,24, 0,0,0,0,0,0); // bitmap header +} + +int stbi_write_tga(char const *filename, int x, int y, int comp, void *data) +{ + int has_alpha = !(comp & 1); + return outfile(filename, -1,-1, x, y, comp, data, has_alpha, 0, + "111 221 2222 11", 0,0,2, 0,0,0, 0,0,x,y, 24+8*has_alpha, 8*has_alpha); +} + +// any other image formats that do interleaved rgb data? +// PNG: requires adler32,crc32 -- significant amount of code +// PSD: no, channels output separately +// TIFF: no, stripwise-interleaved... i think + +#endif // STBI_NO_WRITE + +#endif // STBI_HEADER_FILE_ONLY + diff --git a/dep/recastnavigation/RecastDemo/Contrib/stb_truetype.h b/dep/recastnavigation/RecastDemo/Contrib/stb_truetype.h new file mode 100644 index 000000000..92dc8c244 --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Contrib/stb_truetype.h @@ -0,0 +1,1806 @@ +// stb_truetype.h - v0.3 - public domain - 2009 Sean Barrett / RAD Game Tools +// +// This library processes TrueType files: +// parse files +// extract glyph metrics +// extract glyph shapes +// render glyphs to one-channel bitmaps with antialiasing (box filter) +// +// Todo: +// non-MS cmaps +// crashproof on bad data +// hinting +// subpixel positioning when rendering bitmap +// cleartype-style AA +// +// ADDITIONAL CONTRIBUTORS +// +// Mikko Mononen: compound shape support, more cmap formats +// +// VERSIONS +// +// 0.3 (2009-06-24) cmap fmt=12, compound shapes (MM) +// userdata, malloc-from-userdata, non-zero fill (STB) +// 0.2 (2009-03-11) Fix unsigned/signed char warnings +// 0.1 (2009-03-09) First public release +// +// USAGE +// +// Include this file in whatever places neeed to refer to it. In ONE C/C++ +// file, write: +// #define STB_TRUETYPE_IMPLEMENTATION +// before the #include of this file. This expands out the actual +// implementation into that C/C++ file. +// +// Look at the header-file sections below for the API, but here's a quick skim: +// +// Simple 3D API (don't ship this, but it's fine for tools and quick start, +// and you can cut and paste from it to move to more advanced) +// stbtt_BakeFontBitmap() -- bake a font to a bitmap for use as texture +// stbtt_GetBakedQuad() -- compute quad to draw for a given char +// +// "Load" a font file from a memory buffer (you have to keep the buffer loaded) +// stbtt_InitFont() +// stbtt_GetFontOffsetForIndex() -- use for TTC font collections +// +// Render a unicode codepoint to a bitmap +// stbtt_GetCodepointBitmap() -- allocates and returns a bitmap +// stbtt_MakeCodepointBitmap() -- renders into bitmap you provide +// stbtt_GetCodepointBitmapBox() -- how big the bitmap must be +// +// Character advance/positioning +// stbtt_GetCodepointHMetrics() +// stbtt_GetFontVMetrics() +// +// NOTES +// +// The system uses the raw data found in the .ttf file without changing it +// and without building auxiliary data structures. This is a bit inefficient +// on little-endian systems (the data is big-endian), but assuming you're +// caching the bitmaps or glyph shapes this shouldn't be a big deal. +// +// It appears to be very hard to programmatically determine what font a +// given file is in a general way. I provide an API for this, but I don't +// recommend it. +// +// +// SOURCE STATISTICS (based on v0.3, 1800 LOC) +// +// Documentation & header file 350 LOC \___ 500 LOC documentation +// Sample code 140 LOC / +// Truetype parsing 580 LOC ---- 600 LOC TrueType +// Software rasterization 240 LOC \ . +// Curve tesselation 120 LOC \__ 500 LOC Bitmap creation +// Bitmap management 70 LOC / +// Baked bitmap interface 70 LOC / +// Font name matching & access 150 LOC ---- 150 +// C runtime library abstraction 60 LOC ---- 60 + + +////////////////////////////////////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////////// +//// +//// SAMPLE PROGRAMS +//// +// +// Incomplete text-in-3d-api example, which draws quads properly aligned to be lossless +// +#if 0 +#define STB_TRUETYPE_IMPLEMENTATION // force following include to generate implementation +#include "stb_truetype.h" + +char ttf_buffer[1<<20]; +unsigned char temp_bitmap[512*512]; + +stbtt_chardata cdata[96]; // ASCII 32..126 is 95 glyphs +GLstbtt_uint ftex; + +void my_stbtt_initfont(void) +{ + fread(ttf_buffer, 1, 1<<20, fopen("c:/windows/fonts/times.ttf", "rb")); + stbtt_BakeFontBitmap(data,0, 32.0, temp_bitmap,512,512, 32,96, cdata); // no guarantee this fits! + // can free ttf_buffer at this point + glGenTextures(1, &ftex); + glBindTexture(GL_TEXTURE_2D, ftex); + glTexImage2D(GL_TEXTURE_2D, 0, GL_ALPHA, 512,512, 0, GL_ALPHA, GL_UNSIGNED_BYTE, temp_bitmap); + // can free temp_bitmap at this point + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); +} + +void my_stbtt_print(float x, float y, char *text) +{ + // assume orthographic projection with units = screen pixels, origin at top left + glBindTexture(GL_TEXTURE_2D, ftex); + glBegin(GL_QUADS); + while (*text) { + if (*text >= 32 && *text < 128) { + stbtt_aligned_quad q; + stbtt_GetBakedQuad(cdata, 512,512, *text-32, &x,&y,&q,1);//1=opengl,0=old d3d + glTexCoord2f(q.s0,q.t1); glVertex2f(q.x0,q.y0); + glTexCoord2f(q.s1,q.t1); glVertex2f(q.x1,q.y0); + glTexCoord2f(q.s1,q.t0); glVertex2f(q.x1,q.y1); + glTexCoord2f(q.s0,q.t0); glVertex2f(q.x0,q.y1); + } + ++text; + } + glEnd(); +} +#endif +// +// +////////////////////////////////////////////////////////////////////////////// +// +// Complete program (this compiles): get a single bitmap, print as ASCII art +// +#if 0 +#include +#define STB_TRUETYPE_IMPLEMENTATION // force following include to generate implementation +#include "stb_truetype.h" + +char ttf_buffer[1<<25]; + +int main(int argc, char **argv) +{ + stbtt_fontinfo font; + unsigned char *bitmap; + int w,h,i,j,c = (argc > 1 ? atoi(argv[1]) : 'a'), s = (argc > 2 ? atoi(argv[2]) : 20); + + fread(ttf_buffer, 1, 1<<25, fopen(argc > 3 ? argv[3] : "c:/windows/fonts/arialbd.ttf", "rb")); + + stbtt_InitFont(&font, ttf_buffer, stbtt_GetFontOffsetForIndex(ttf_buffer,0)); + bitmap = stbtt_GetCodepointBitmap(&font, 0,stbtt_ScaleForPixelHeight(&font, s), c, &w, &h, 0,0); + + for (j=0; j < h; ++j) { + for (i=0; i < w; ++i) + putchar(" .:ioVM@"[bitmap[j*w+i]>>5]); + putchar('\n'); + } + return 0; +} +#endif +// +// Output: +// +// .ii. +// @@@@@@. +// V@Mio@@o +// :i. V@V +// :oM@@M +// :@@@MM@M +// @@o o@M +// :@@. M@M +// @@@o@@@@ +// :M@@V:@@. +// +////////////////////////////////////////////////////////////////////////////// +// +// Complete program: print "Hello World!" banner, with bugs +// +#if 0 +int main(int arg, char **argv) +{ + unsigned char screen[20][79]; + int i,j, pos=0; + float scale; + char *text = "Heljo World!"; + + fread(buffer, 1, 1000000, fopen("c:/windows/fonts/arialbd.ttf", "rb")); + stbtt_InitFont(&font, buffer, 0); + + scale = stbtt_ScaleForPixelHeight(&font, 16); + memset(screen, 0, sizeof(screen)); + + while (*text) { + int advance,lsb,x0,y0,x1,y1, newpos, baseline=13; + stbtt_GetCodepointHMetrics(&font, *text, &advance, &lsb); + stbtt_GetCodepointBitmapBox(&font, *text, scale,scale, &x0,&y0,&x1,&y1); + newpos = pos + (int) (lsb * scale) + x0; + stbtt_MakeCodepointBitmap(&font, &screen[baseline + y0][newpos], x1-x0,y1-y0, 79, scale,scale, *text); + // note that this stomps the old data, so where character boxes overlap (e.g. 'lj') it's wrong + // because this API is really for baking character bitmaps into textures + pos += (int) (advance * scale); + ++text; + } + + for (j=0; j < 20; ++j) { + for (i=0; i < 79; ++i) + putchar(" .:ioVM@"[screen[j][i]>>5]); + putchar('\n'); + } + + return 0; +} +#endif + + +////////////////////////////////////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////////// +//// +//// INTEGRATION WITH RUNTIME LIBRARIES +//// + +#ifdef STB_TRUETYPE_IMPLEMENTATION + // #define your own (u)stbtt_int8/16/32 before including to override this + #ifndef stbtt_uint8 + typedef unsigned char stbtt_uint8; + typedef signed char stbtt_int8; + typedef unsigned short stbtt_uint16; + typedef signed short stbtt_int16; + typedef unsigned int stbtt_uint32; + typedef signed int stbtt_int32; + #endif + + typedef char stbtt__check_size32[sizeof(stbtt_int32)==4 ? 1 : -1]; + typedef char stbtt__check_size16[sizeof(stbtt_int16)==2 ? 1 : -1]; + + // #define your own STBTT_sort() to override this to avoid qsort + #ifndef STBTT_sort + #include + #define STBTT_sort(data,num_items,item_size,compare_func) qsort(data,num_items,item_size,compare_func) + #endif + + // #define your own STBTT_ifloor/STBTT_iceil() to avoid math.h + #ifndef STBTT_ifloor + #include + #define STBTT_ifloor(x) ((int) floor(x)) + #define STBTT_iceil(x) ((int) ceil(x)) + #endif + + // #define your own functions "STBTT_malloc" / "STBTT_free" to avoid malloc.h + #ifndef STBTT_malloc + #include + #define STBTT_malloc(x,u) malloc(x) + #define STBTT_free(x,u) free(x) + #endif + + #ifndef STBTT_assert + #include + #define STBTT_assert(x) assert(x) + #endif + + #ifndef STBTT_strlen + #include + #define STBTT_strlen(x) strlen(x) + #endif + + #ifndef STBTT_memcpy + #include + #define STBTT_memcpy memcpy + #define STBTT_memset memset + #endif +#endif + +/////////////////////////////////////////////////////////////////////////////// +/////////////////////////////////////////////////////////////////////////////// +//// +//// INTERFACE +//// +//// + +#ifndef __STB_INCLUDE_STB_TRUETYPE_H__ +#define __STB_INCLUDE_STB_TRUETYPE_H__ + +#ifdef __cplusplus +extern "C" { +#endif + +////////////////////////////////////////////////////////////////////////////// +// +// TEXTURE BAKING API +// +// If you use this API, you only have to call two functions ever. +// + +typedef struct +{ + unsigned short x0,y0,x1,y1; // coordinates of bbox in bitmap + float xoff,yoff,xadvance; +} stbtt_bakedchar; + +extern int stbtt_BakeFontBitmap(const unsigned char *data, int offset, // font location (use offset=0 for plain .ttf) + float pixel_height, // height of font in pixels + unsigned char *pixels, int pw, int ph, // bitmap to be filled in + int first_char, int num_chars, // characters to bake + stbtt_bakedchar *chardata); // you allocate this, it's num_chars long +// if return is positive, the first unused row of the bitmap +// if return is negative, returns the negative of the number of characters that fit +// if return is 0, no characters fit and no rows were used +// This uses a very crappy packing. + +typedef struct +{ + float x0,y0,s0,t0; // top-left + float x1,y1,s1,t1; // bottom-right +} stbtt_aligned_quad; + +extern void stbtt_GetBakedQuad(stbtt_bakedchar *chardata, int pw, int ph, // same data as above + int char_index, // character to display + float *xpos, float *ypos, // pointers to current position in screen pixel space + stbtt_aligned_quad *q, // output: quad to draw + int opengl_fillrule); // true if opengl fill rule; false if DX9 or earlier +// Call GetBakedQuad with char_index = 'character - first_char', and it +// creates the quad you need to draw and advances the current position. +// It's inefficient; you might want to c&p it and optimize it. + + +////////////////////////////////////////////////////////////////////////////// +// +// FONT LOADING +// +// + +extern int stbtt_GetFontOffsetForIndex(const unsigned char *data, int index); +// Each .ttf file may have more than one font. Each has a sequential index +// number starting from 0. Call this function to get the font offset for a +// given index; it returns -1 if the index is out of range. A regular .ttf +// file will only define one font and it always be at offset 0, so it will +// return '0' for index 0, and -1 for all other indices. You can just skip +// this step if you know it's that kind of font. + + +// The following structure is defined publically so you can declare one on +// the stack or as a global or etc. +typedef struct +{ + void *userdata; + unsigned char *data; // pointer to .ttf file + int fontstart; // offset of start of font + + int numGlyphs; // number of glyphs, needed for range checking + + int loca,head,glyf,hhea,hmtx; // table locations as offset from start of .ttf + int index_map; // a cmap mapping for our chosen character encoding + int indexToLocFormat; // format needed to map from glyph index to glyph +} stbtt_fontinfo; + +extern int stbtt_InitFont(stbtt_fontinfo *info, const unsigned char *data, int offset); +// Given an offset into the file that defines a font, this function builds +// the necessary cached info for the rest of the system. You must allocate +// the stbtt_fontinfo yourself, and stbtt_InitFont will fill it out. You don't +// need to do anything special to free it, because the contents are a pure +// cache with no additional data structures. Returns 0 on failure. + + +////////////////////////////////////////////////////////////////////////////// +// +// CHARACTER TO GLYPH-INDEX CONVERSIOn + +int stbtt_FindGlyphIndex(const stbtt_fontinfo *info, int unicode_codepoint); +// If you're going to perform multiple operations on the same character +// and you want a speed-up, call this function with the character you're +// going to process, then use glyph-based functions instead of the +// codepoint-based functions. + + +////////////////////////////////////////////////////////////////////////////// +// +// CHARACTER PROPERTIES +// + +extern float stbtt_ScaleForPixelHeight(const stbtt_fontinfo *info, float pixels); +// computes a scale factor to produce a font whose "height" is 'pixels' tall. +// Height is measured as the distance from the highest ascender to the lowest +// descender; in other words, it's equivalent to calling stbtt_GetFontVMetrics +// and computing: +// scale = pixels / (ascent - descent) +// so if you prefer to measure height by the ascent only, use a similar calculation. + +extern void stbtt_GetFontVMetrics(const stbtt_fontinfo *info, int *ascent, int *descent, int *lineGap); +// ascent is the coordinate above the baseline the font extends; descent +// is the coordinate below the baseline the font extends (i.e. it is typically negative) +// lineGap is the spacing between one row's descent and the next row's ascent... +// so you should advance the vertical position by "*ascent - *descent + *lineGap" +// these are expressed in unscaled coordinates + +extern void stbtt_GetCodepointHMetrics(const stbtt_fontinfo *info, int codepoint, int *advanceWidth, int *leftSideBearing); +// leftSideBearing is the offset from the current horizontal position to the left edge of the character +// advanceWidth is the offset from the current horizontal position to the next horizontal position +// these are expressed in unscaled coordinates + +extern int stbtt_GetCodepointKernAdvance(const stbtt_fontinfo *info, int ch1, int ch2); +// an additional amount to add to the 'advance' value between ch1 and ch2 +// @TODO; for now always returns 0! + +extern int stbtt_GetCodepointBox(const stbtt_fontinfo *info, int codepoint, int *x0, int *y0, int *x1, int *y1); +// Gets the bounding box of the visible part of the glyph, in unscaled coordinates + +extern void stbtt_GetGlyphHMetrics(const stbtt_fontinfo *info, int glyph_index, int *advanceWidth, int *leftSideBearing); +extern int stbtt_GetGlyphKernAdvance(const stbtt_fontinfo *info, int glyph1, int glyph2); +extern int stbtt_GetGlyphBox(const stbtt_fontinfo *info, int glyph_index, int *x0, int *y0, int *x1, int *y1); +// as above, but takes one or more glyph indices for greater efficiency + + +////////////////////////////////////////////////////////////////////////////// +// +// GLYPH SHAPES (you probably don't need these, but they have to go before +// the bitmaps for C declaration-order reasons) +// + +#ifndef STBTT_vmove // you can predefine these to use different values (but why?) + enum { + STBTT_vmove=1, + STBTT_vline, + STBTT_vcurve + }; +#endif + +#ifndef stbtt_vertex // you can predefine this to use different values + // (we share this with other code at RAD) + #define stbtt_vertex_type short // can't use stbtt_int16 because that's not visible in the header file + typedef struct + { + stbtt_vertex_type x,y,cx,cy; + unsigned char type,padding; + } stbtt_vertex; +#endif + +extern int stbtt_GetCodepointShape(const stbtt_fontinfo *info, int unicode_codepoint, stbtt_vertex **vertices); +extern int stbtt_GetGlyphShape(const stbtt_fontinfo *info, int glyph_index, stbtt_vertex **vertices); +// returns # of vertices and fills *vertices with the pointer to them +// these are expressed in "unscaled" coordinates + +extern void stbtt_FreeShape(const stbtt_fontinfo *info, stbtt_vertex *vertices); +// frees the data allocated above + +////////////////////////////////////////////////////////////////////////////// +// +// BITMAP RENDERING +// + +extern void stbtt_FreeBitmap(unsigned char *bitmap, void *userdata); +// frees the bitmap allocated below + +extern unsigned char *stbtt_GetCodepointBitmap(const stbtt_fontinfo *info, float scale_x, float scale_y, int codepoint, int *width, int *height, int *xoff, int *yoff); +// allocates a large-enough single-channel 8bpp bitmap and renders the +// specified character/glyph at the specified scale into it, with +// antialiasing. 0 is no coverage (transparent), 255 is fully covered (opaque). +// *width & *height are filled out with the width & height of the bitmap, +// which is stored left-to-right, top-to-bottom. +// +// xoff/yoff are the offset it pixel space from the glyph origin to the top-left of the bitmap + +extern void stbtt_MakeCodepointBitmap(const stbtt_fontinfo *info, unsigned char *output, int out_w, int out_h, int out_stride, float scale_x, float scale_y, int codepoint); +// the same as above, but you pass in storage for the bitmap in the form +// of 'output', with row spacing of 'out_stride' bytes. the bitmap is +// clipped to out_w/out_h bytes. call the next function to get the +// height and width and positioning info + +extern void stbtt_GetCodepointBitmapBox(const stbtt_fontinfo *font, int codepoint, float scale_x, float scale_y, int *ix0, int *iy0, int *ix1, int *iy1); +// get the bbox of the bitmap centered around the glyph origin; so the +// bitmap width is ix1-ix0, height is iy1-iy0, and location to place +// the bitmap top left is (leftSideBearing*scale,iy0). +// (Note that the bitmap uses y-increases-down, but the shape uses +// y-increases-up, so CodepointBitmapBox and CodepointBox are inverted.) + +extern unsigned char *stbtt_GetGlyphBitmap(const stbtt_fontinfo *info, float scale_x, float scale_y, int glyph, int *width, int *height, int *xoff, int *yoff); +extern void stbtt_GetGlyphBitmapBox(const stbtt_fontinfo *font, int glyph, float scale_x, float scale_y, int *ix0, int *iy0, int *ix1, int *iy1); +extern void stbtt_MakeGlyphBitmap(const stbtt_fontinfo *info, unsigned char *output, int out_w, int out_h, int out_stride, float scale_x, float scale_y, int glyph); + +//extern void stbtt_get_true_bbox(stbtt_vertex *vertices, int num_verts, float scale_x, float scale_y, int *ix0, int *iy0, int *ix1, int *iy1); + +// @TODO: don't expose this structure +typedef struct +{ + int w,h,stride; + unsigned char *pixels; +} stbtt__bitmap; + +extern void stbtt_Rasterize(stbtt__bitmap *result, float flatness_in_pixels, stbtt_vertex *vertices, int num_verts, float scale_x, float scale_y, int x_off, int y_off, int invert, void *userdata); + +////////////////////////////////////////////////////////////////////////////// +// +// Finding the right font... +// +// You should really just solve this offline, keep your own tables +// of what font is what, and don't try to get it out of the .ttf file. +// That's because getting it out of the .ttf file is really hard, because +// the names in the file can appear in many possible encodings, in many +// possible languages, and e.g. if you need a case-insensitive comparison, +// the details of that depend on the encoding & language in a complex way +// (actually underspecified in truetype, but also gigantic). +// +// But you can use the provided functions in two possible ways: +// stbtt_FindMatchingFont() will use *case-sensitive* comparisons on +// unicode-encoded names to try to find the font you want; +// you can run this before calling stbtt_InitFont() +// +// stbtt_GetFontNameString() lets you get any of the various strings +// from the file yourself and do your own comparisons on them. +// You have to have called stbtt_InitFont() first. + + +extern int stbtt_FindMatchingFont(const unsigned char *fontdata, const char *name, int flags); +// returns the offset (not index) of the font that matches, or -1 if none +// if you use STBTT_MACSTYLE_DONTCARE, use a font name like "Arial Bold". +// if you use any other flag, use a font name like "Arial"; this checks +// the 'macStyle' header field; i don't know if fonts set this consistently +#define STBTT_MACSTYLE_DONTCARE 0 +#define STBTT_MACSTYLE_BOLD 1 +#define STBTT_MACSTYLE_ITALIC 2 +#define STBTT_MACSTYLE_UNDERSCORE 4 +#define STBTT_MACSTYLE_NONE 8 // <= not same as 0, this makes us check the bitfield is 0 + +extern int stbtt_CompareUTF8toUTF16_bigendian(const char *s1, int len1, const char *s2, int len2); +// returns 1/0 whether the first string interpreted as utf8 is identical to +// the second string interpreted as big-endian utf16... useful for strings from next func + +extern char *stbtt_GetFontNameString(const stbtt_fontinfo *font, int *length, int platformID, int encodingID, int languageID, int nameID); +// returns the string (which may be big-endian double byte, e.g. for unicode) +// and puts the length in bytes in *length. +// +// some of the values for the IDs are below; for more see the truetype spec: +// http://developer.apple.com/textfonts/TTRefMan/RM06/Chap6name.html +// http://www.microsoft.com/typography/otspec/name.htm + +enum { // platformID + STBTT_PLATFORM_ID_UNICODE =0, + STBTT_PLATFORM_ID_MAC =1, + STBTT_PLATFORM_ID_ISO =2, + STBTT_PLATFORM_ID_MICROSOFT =3 +}; + +enum { // encodingID for STBTT_PLATFORM_ID_UNICODE + STBTT_UNICODE_EID_UNICODE_1_0 =0, + STBTT_UNICODE_EID_UNICODE_1_1 =1, + STBTT_UNICODE_EID_ISO_10646 =2, + STBTT_UNICODE_EID_UNICODE_2_0_BMP=3, + STBTT_UNICODE_EID_UNICODE_2_0_FULL=4, +}; + +enum { // encodingID for STBTT_PLATFORM_ID_MICROSOFT + STBTT_MS_EID_SYMBOL =0, + STBTT_MS_EID_UNICODE_BMP =1, + STBTT_MS_EID_SHIFTJIS =2, + STBTT_MS_EID_UNICODE_FULL =10, +}; + +enum { // encodingID for STBTT_PLATFORM_ID_MAC; same as Script Manager codes + STBTT_MAC_EID_ROMAN =0, STBTT_MAC_EID_ARABIC =4, + STBTT_MAC_EID_JAPANESE =1, STBTT_MAC_EID_HEBREW =5, + STBTT_MAC_EID_CHINESE_TRAD =2, STBTT_MAC_EID_GREEK =6, + STBTT_MAC_EID_KOREAN =3, STBTT_MAC_EID_RUSSIAN =7, +}; + +enum { // languageID for STBTT_PLATFORM_ID_MICROSOFT; same as LCID... + // problematic because there are e.g. 16 english LCIDs and 16 arabic LCIDs + STBTT_MS_LANG_ENGLISH =0x0409, STBTT_MS_LANG_ITALIAN =0x0410, + STBTT_MS_LANG_CHINESE =0x0804, STBTT_MS_LANG_JAPANESE =0x0411, + STBTT_MS_LANG_DUTCH =0x0413, STBTT_MS_LANG_KOREAN =0x0412, + STBTT_MS_LANG_FRENCH =0x040c, STBTT_MS_LANG_RUSSIAN =0x0419, + STBTT_MS_LANG_GERMAN =0x0407, STBTT_MS_LANG_SPANISH =0x0409, + STBTT_MS_LANG_HEBREW =0x040d, STBTT_MS_LANG_SWEDISH =0x041D, +}; + +enum { // languageID for STBTT_PLATFORM_ID_MAC + STBTT_MAC_LANG_ENGLISH =0 , STBTT_MAC_LANG_JAPANESE =11, + STBTT_MAC_LANG_ARABIC =12, STBTT_MAC_LANG_KOREAN =23, + STBTT_MAC_LANG_DUTCH =4 , STBTT_MAC_LANG_RUSSIAN =32, + STBTT_MAC_LANG_FRENCH =1 , STBTT_MAC_LANG_SPANISH =6 , + STBTT_MAC_LANG_GERMAN =2 , STBTT_MAC_LANG_SWEDISH =5 , + STBTT_MAC_LANG_HEBREW =10, STBTT_MAC_LANG_CHINESE_SIMPLIFIED =33, + STBTT_MAC_LANG_ITALIAN =3 , STBTT_MAC_LANG_CHINESE_TRAD =19, +}; + +#ifdef __cplusplus +} +#endif + +#endif // __STB_INCLUDE_STB_TRUETYPE_H__ + +/////////////////////////////////////////////////////////////////////////////// +/////////////////////////////////////////////////////////////////////////////// +//// +//// IMPLEMENTATION +//// +//// + +#ifdef STB_TRUETYPE_IMPLEMENTATION + +////////////////////////////////////////////////////////////////////////// +// +// accessors to parse data from file +// + +// on platforms that don't allow misaligned reads, if we want to allow +// truetype fonts that aren't padded to alignment, define ALLOW_UNALIGNED_TRUETYPE + +#define ttBYTE(p) (* (stbtt_uint8 *) (p)) +#define ttCHAR(p) (* (stbtt_int8 *) (p)) +#define ttFixed(p) ttLONG(p) + +#if defined(STB_TRUETYPE_BIGENDIAN) && !defined(ALLOW_UNALIGNED_TRUETYPE) + + #define ttUSHORT(p) (* (stbtt_uint16 *) (p)) + #define ttSHORT(p) (* (stbtt_int16 *) (p)) + #define ttULONG(p) (* (stbtt_uint32 *) (p)) + #define ttLONG(p) (* (stbtt_int32 *) (p)) + +#else + + stbtt_uint16 ttUSHORT(const stbtt_uint8 *p) { return p[0]*256 + p[1]; } + stbtt_int16 ttSHORT(const stbtt_uint8 *p) { return p[0]*256 + p[1]; } + stbtt_uint32 ttULONG(const stbtt_uint8 *p) { return (p[0]<<24) + (p[1]<<16) + (p[2]<<8) + p[3]; } + stbtt_int32 ttLONG(const stbtt_uint8 *p) { return (p[0]<<24) + (p[1]<<16) + (p[2]<<8) + p[3]; } + +#endif + +#define stbtt_tag4(p,c0,c1,c2,c3) ((p)[0] == (c0) && (p)[1] == (c1) && (p)[2] == (c2) && (p)[3] == (c3)) +#define stbtt_tag(p,str) stbtt_tag4(p,str[0],str[1],str[2],str[3]) + +static int stbtt__isfont(const stbtt_uint8 *font) +{ + // check the version number + if (stbtt_tag(font, "1")) return 1; // TrueType 1 + if (stbtt_tag(font, "typ1")) return 1; // TrueType with type 1 font -- we don't support this! + if (stbtt_tag(font, "OTTO")) return 1; // OpenType with CFF + if (stbtt_tag4(font, 0,1,0,0)) return 1; // OpenType 1.0 + return 0; +} + +// @OPTIMIZE: binary search +static stbtt_uint32 stbtt__find_table(stbtt_uint8 *data, stbtt_uint32 fontstart, const char *tag) +{ + stbtt_int32 num_tables = ttUSHORT(data+fontstart+4); + stbtt_uint32 tabledir = fontstart + 12; + stbtt_int32 i; + for (i=0; i < num_tables; ++i) { + stbtt_uint32 loc = tabledir + 16*i; + if (stbtt_tag(data+loc+0, tag)) + return ttULONG(data+loc+8); + } + return 0; +} + +int stbtt_GetFontOffsetForIndex(const unsigned char *font_collection, int index) +{ + // if it's just a font, there's only one valid index + if (stbtt__isfont(font_collection)) + return index == 0 ? 0 : -1; + + // check if it's a TTC + if (stbtt_tag(font_collection, "ttcf")) { + // version 1? + if (ttULONG(font_collection+4) == 0x00010000 || ttULONG(font_collection+4) == 0x00020000) { + stbtt_int32 n = ttLONG(font_collection+8); + if (index >= n) + return -1; + return ttULONG(font_collection+12+index*14); + } + } + return -1; +} + +int stbtt_InitFont(stbtt_fontinfo *info, const unsigned char *data2, int fontstart) +{ + stbtt_uint8 *data = (stbtt_uint8 *) data2; + stbtt_uint32 cmap, t; + stbtt_int32 i,numTables; + + info->data = data; + info->fontstart = fontstart; + + cmap = stbtt__find_table(data, fontstart, "cmap"); + info->loca = stbtt__find_table(data, fontstart, "loca"); + info->head = stbtt__find_table(data, fontstart, "head"); + info->glyf = stbtt__find_table(data, fontstart, "glyf"); + info->hhea = stbtt__find_table(data, fontstart, "hhea"); + info->hmtx = stbtt__find_table(data, fontstart, "hmtx"); + if (!cmap || !info->loca || !info->head || !info->glyf || !info->hhea || !info->hmtx) + return 0; + + t = stbtt__find_table(data, fontstart, "maxp"); + if (t) + info->numGlyphs = ttUSHORT(data+t+4); + else + info->numGlyphs = 0xffff; + + // find a cmap encoding table we understand *now* to avoid searching + // later. (todo: could make this installable) + // the same regardless of glyph. + numTables = ttUSHORT(data + cmap + 2); + info->index_map = 0; + for (i=0; i < numTables; ++i) { + stbtt_uint32 encoding_record = cmap + 4 + 8 * i; + // find an encoding we understand: + switch(ttUSHORT(data+encoding_record)) { + case STBTT_PLATFORM_ID_MICROSOFT: + switch (ttUSHORT(data+encoding_record+2)) { + case STBTT_MS_EID_UNICODE_BMP: + case STBTT_MS_EID_UNICODE_FULL: + // MS/Unicode + info->index_map = cmap + ttULONG(data+encoding_record+4); + break; + } + break; + } + } + if (info->index_map == 0) + return 0; + + info->indexToLocFormat = ttUSHORT(data+info->head + 50); + return 1; +} + +int stbtt_FindGlyphIndex(const stbtt_fontinfo *info, int unicode_codepoint) +{ + stbtt_uint8 *data = info->data; + stbtt_uint32 index_map = info->index_map; + + stbtt_uint16 format = ttUSHORT(data + index_map + 0); + if (format == 0) { // apple byte encoding + stbtt_int32 bytes = ttUSHORT(data + index_map + 2); + if (unicode_codepoint < bytes-6) + return ttBYTE(data + index_map + 6 + unicode_codepoint); + return 0; + } else if (format == 6) { + stbtt_uint32 first = ttUSHORT(data + index_map + 6); + stbtt_uint32 count = ttUSHORT(data + index_map + 8); + if ((stbtt_uint32) unicode_codepoint >= first && (stbtt_uint32) unicode_codepoint < first+count) + return ttUSHORT(data + index_map + 10 + (unicode_codepoint - first)*2); + return 0; + } else if (format == 2) { + STBTT_assert(0); // @TODO: high-byte mapping for japanese/chinese/korean + return 0; + } else if (format == 4) { // standard mapping for windows fonts: binary search collection of ranges + stbtt_uint16 segcount = ttUSHORT(data+index_map+6) >> 1; + stbtt_uint16 searchRange = ttUSHORT(data+index_map+8) >> 1; + stbtt_uint16 entrySelector = ttUSHORT(data+index_map+10); + stbtt_uint16 rangeShift = ttUSHORT(data+index_map+12) >> 1; + stbtt_uint16 item, offset, start, end; + + // do a binary search of the segments + stbtt_uint32 endCount = index_map + 14; + stbtt_uint32 search = endCount; + + if (unicode_codepoint > 0xffff) + return 0; + + // they lie from endCount .. endCount + segCount + // but searchRange is the nearest power of two, so... + if (unicode_codepoint >= ttUSHORT(data + search + rangeShift*2)) + search += rangeShift*2; + + // now decrement to bias correctly to find smallest + search -= 2; + while (entrySelector) { + stbtt_uint16 start, end; + searchRange >>= 1; + start = ttUSHORT(data + search + 2 + segcount*2 + 2); + end = ttUSHORT(data + search + 2); + start = ttUSHORT(data + search + searchRange*2 + segcount*2 + 2); + end = ttUSHORT(data + search + searchRange*2); + if (unicode_codepoint > end) + search += searchRange*2; + --entrySelector; + } + search += 2; + + item = (stbtt_uint16) ((search - endCount) >> 1); + + STBTT_assert(unicode_codepoint <= ttUSHORT(data + endCount + 2*item)); + start = ttUSHORT(data + index_map + 14 + segcount*2 + 2 + 2*item); + end = ttUSHORT(data + index_map + 14 + 2 + 2*item); + if (unicode_codepoint < start) + return 0; + + offset = ttUSHORT(data + index_map + 14 + segcount*6 + 2 + 2*item); + if (offset == 0) + return unicode_codepoint + ttSHORT(data + index_map + 14 + segcount*4 + 2 + 2*item); + + return ttUSHORT(data + offset + (unicode_codepoint-start)*2 + index_map + 14 + segcount*6 + 2 + 2*item); + } else if (format == 12) { + stbtt_uint16 ngroups = ttUSHORT(data+index_map+6); + stbtt_int32 low,high; + low = 0; high = (stbtt_int32)ngroups; + // Binary search the right group. + while (low <= high) { + stbtt_int32 mid = low + ((high-low) >> 1); // rounds down, so low <= mid < high + stbtt_uint32 start_char = ttULONG(data+index_map+16+mid*12); + stbtt_uint32 end_char = ttULONG(data+index_map+16+mid*12+4); + if ((stbtt_uint32) unicode_codepoint < start_char) + high = mid-1; + else if ((stbtt_uint32) unicode_codepoint > end_char) + low = mid+1; + else { + stbtt_uint32 start_glyph = ttULONG(data+index_map+16+mid*12+8); + return start_glyph + unicode_codepoint-start_char; + } + } + return 0; // not found + } + // @TODO + STBTT_assert(0); + return 0; +} + +int stbtt_GetCodepointShape(const stbtt_fontinfo *info, int unicode_codepoint, stbtt_vertex **vertices) +{ + return stbtt_GetGlyphShape(info, stbtt_FindGlyphIndex(info, unicode_codepoint), vertices); +} + +static void stbtt_setvertex(stbtt_vertex *v, stbtt_uint8 type, stbtt_int16 x, stbtt_int16 y, stbtt_int16 cx, stbtt_int16 cy) +{ + v->type = type; + v->x = x; + v->y = y; + v->cx = cx; + v->cy = cy; +} + +static int stbtt__GetGlyfOffset(const stbtt_fontinfo *info, int glyph_index) +{ + int g1,g2; + + if (glyph_index >= info->numGlyphs) return -1; // glyph index out of range + if (info->indexToLocFormat >= 2) return -1; // unknown index->glyph map format + + if (info->indexToLocFormat == 0) { + g1 = info->glyf + ttUSHORT(info->data + info->loca + glyph_index * 2) * 2; + g2 = info->glyf + ttUSHORT(info->data + info->loca + glyph_index * 2 + 2) * 2; + } else { + g1 = info->glyf + ttULONG (info->data + info->loca + glyph_index * 4); + g2 = info->glyf + ttULONG (info->data + info->loca + glyph_index * 4 + 4); + } + + return g1==g2 ? -1 : g1; // if length is 0, return -1 +} + +int stbtt_GetGlyphBox(const stbtt_fontinfo *info, int glyph_index, int *x0, int *y0, int *x1, int *y1) +{ + int g = stbtt__GetGlyfOffset(info, glyph_index); + if (g < 0) return 0; + + if (x0) *x0 = ttSHORT(info->data + g + 2); + if (y0) *y0 = ttSHORT(info->data + g + 4); + if (x1) *x1 = ttSHORT(info->data + g + 6); + if (y1) *y1 = ttSHORT(info->data + g + 8); + return 1; +} + +int stbtt_GetCodepointBox(const stbtt_fontinfo *info, int codepoint, int *x0, int *y0, int *x1, int *y1) +{ + return stbtt_GetGlyphBox(info, stbtt_FindGlyphIndex(info,codepoint), x0,y0,x1,y1); +} + +int stbtt_GetGlyphShape(const stbtt_fontinfo *info, int glyph_index, stbtt_vertex **pvertices) +{ + stbtt_int16 numberOfContours; + stbtt_uint8 *endPtsOfContours; + stbtt_uint8 *data = info->data; + stbtt_vertex *vertices=0; + int num_vertices=0; + int g = stbtt__GetGlyfOffset(info, glyph_index); + + *pvertices = NULL; + + if (g < 0) return 0; + + numberOfContours = ttSHORT(data + g); + + if (numberOfContours > 0) { + stbtt_uint8 flags=0,flagcount; + stbtt_int32 ins, i,j=0,m,n, next_move, was_off=0, off; + stbtt_int16 x,y,cx,cy,sx,sy; + stbtt_uint8 *points; + endPtsOfContours = (data + g + 10); + ins = ttUSHORT(data + g + 10 + numberOfContours * 2); + points = data + g + 10 + numberOfContours * 2 + 2 + ins; + + n = 1+ttUSHORT(endPtsOfContours + numberOfContours*2-2); + + m = n + numberOfContours; // a loose bound on how many vertices we might need + vertices = (stbtt_vertex *) STBTT_malloc(m * sizeof(vertices[0]), info->userdata); + if (vertices == 0) + return 0; + + next_move = 0; + flagcount=0; + + // in first pass, we load uninterpreted data into the allocated array + // above, shifted to the end of the array so we won't overwrite it when + // we create our final data starting from the front + + off = m - n; // starting offset for uninterpreted data, regardless of how m ends up being calculated + + // first load flags + + for (i=0; i < n; ++i) { + if (flagcount == 0) { + flags = *points++; + if (flags & 8) + flagcount = *points++; + } else + --flagcount; + vertices[off+i].type = flags; + } + + // now load x coordinates + x=0; + for (i=0; i < n; ++i) { + flags = vertices[off+i].type; + if (flags & 2) { + stbtt_int16 dx = *points++; + x += (flags & 16) ? dx : -dx; // ??? + } else { + if (!(flags & 16)) { + x = x + (stbtt_int16) (points[0]*256 + points[1]); + points += 2; + } + } + vertices[off+i].x = x; + } + + // now load y coordinates + y=0; + for (i=0; i < n; ++i) { + flags = vertices[off+i].type; + if (flags & 4) { + stbtt_int16 dy = *points++; + y += (flags & 32) ? dy : -dy; // ??? + } else { + if (!(flags & 32)) { + y = y + (stbtt_int16) (points[0]*256 + points[1]); + points += 2; + } + } + vertices[off+i].y = y; + } + + // now convert them to our format + num_vertices=0; + sx = sy = cx = cy = 0; + for (i=0; i < n; ++i) { + flags = vertices[off+i].type; + x = (stbtt_int16) vertices[off+i].x; + y = (stbtt_int16) vertices[off+i].y; + if (next_move == i) { + // when we get to the end, we have to close the shape explicitly + if (i != 0) { + if (was_off) + stbtt_setvertex(&vertices[num_vertices++], STBTT_vcurve,sx,sy,cx,cy); + else + stbtt_setvertex(&vertices[num_vertices++], STBTT_vline,sx,sy,0,0); + } + + // now start the new one + stbtt_setvertex(&vertices[num_vertices++], STBTT_vmove,x,y,0,0); + next_move = 1 + ttUSHORT(endPtsOfContours+j*2); + ++j; + was_off = 0; + sx = x; + sy = y; + } else { + if (!(flags & 1)) { // if it's a curve + if (was_off) // two off-curve control points in a row means interpolate an on-curve midpoint + stbtt_setvertex(&vertices[num_vertices++], STBTT_vcurve, (cx+x)>>1, (cy+y)>>1, cx, cy); + cx = x; + cy = y; + was_off = 1; + } else { + if (was_off) + stbtt_setvertex(&vertices[num_vertices++], STBTT_vcurve, x,y, cx, cy); + else + stbtt_setvertex(&vertices[num_vertices++], STBTT_vline, x,y,0,0); + was_off = 0; + } + } + } + if (i != 0) { + if (was_off) + stbtt_setvertex(&vertices[num_vertices++], STBTT_vcurve,sx,sy,cx,cy); + else + stbtt_setvertex(&vertices[num_vertices++], STBTT_vline,sx,sy,0,0); + } + } else if (numberOfContours == -1) { + // Compound shapes. + int more = 1; + stbtt_uint8 *comp = data + g + 10; + num_vertices = 0; + vertices = 0; + while (more) { + stbtt_uint16 flags, gidx; + int comp_num_verts = 0, i; + stbtt_vertex *comp_verts = 0, *tmp = 0; + float mtx[6] = {1,0,0,1,0,0}, m, n; + + flags = ttSHORT(comp); comp+=2; + gidx = ttSHORT(comp); comp+=2; + + if (flags & 2) { // XY values + if (flags & 1) { // shorts + mtx[4] = ttSHORT(comp); comp+=2; + mtx[5] = ttSHORT(comp); comp+=2; + } else { + mtx[4] = ttCHAR(comp); comp+=1; + mtx[5] = ttCHAR(comp); comp+=1; + } + } + else { + // @TODO handle matching point + STBTT_assert(0); + } + if (flags & (1<<3)) { // WE_HAVE_A_SCALE + mtx[0] = mtx[3] = ttSHORT(comp)/16384.0f; comp+=2; + mtx[1] = mtx[2] = 0; + } else if (flags & (1<<6)) { // WE_HAVE_AN_X_AND_YSCALE + mtx[0] = ttSHORT(comp)/16384.0f; comp+=2; + mtx[1] = mtx[2] = 0; + mtx[3] = ttSHORT(comp)/16384.0f; comp+=2; + } else if (flags & (1<<7)) { // WE_HAVE_A_TWO_BY_TWO + mtx[0] = ttSHORT(comp)/16384.0f; comp+=2; + mtx[1] = ttSHORT(comp)/16384.0f; comp+=2; + mtx[2] = ttSHORT(comp)/16384.0f; comp+=2; + mtx[3] = ttSHORT(comp)/16384.0f; comp+=2; + } + + // Find transformation scales. + m = (float) sqrt(mtx[0]*mtx[0] + mtx[1]*mtx[1]); + n = (float) sqrt(mtx[2]*mtx[2] + mtx[3]*mtx[3]); + + // Get indexed glyph. + comp_num_verts = stbtt_GetGlyphShape(info, gidx, &comp_verts); + if (comp_num_verts > 0) { + // Transform vertices. + for (i = 0; i < comp_num_verts; ++i) { + stbtt_vertex* v = &comp_verts[i]; + stbtt_vertex_type x,y; + x=v->x; y=v->y; + v->x = (stbtt_vertex_type)(m * (mtx[0]*x + mtx[2]*y + mtx[4])); + v->y = (stbtt_vertex_type)(n * (mtx[1]*x + mtx[3]*y + mtx[5])); + x=v->cx; y=v->cy; + v->cx = (stbtt_vertex_type)(m * (mtx[0]*x + mtx[2]*y + mtx[4])); + v->cy = (stbtt_vertex_type)(n * (mtx[1]*x + mtx[3]*y + mtx[5])); + } + // Append vertices. + tmp = (stbtt_vertex*)STBTT_malloc((num_vertices+comp_num_verts)*sizeof(stbtt_vertex), info->userdata); + if (!tmp) { + if (vertices) STBTT_free(vertices, info->userdata); + if (comp_verts) STBTT_free(comp_verts, info->userdata); + return 0; + } + if (num_vertices > 0) memcpy(tmp, vertices, num_vertices*sizeof(stbtt_vertex)); + memcpy(tmp+num_vertices, comp_verts, comp_num_verts*sizeof(stbtt_vertex)); + if (vertices) STBTT_free(vertices, info->userdata); + vertices = tmp; + STBTT_free(comp_verts, info->userdata); + num_vertices += comp_num_verts; + } + // More components ? + more = flags & (1<<5); + } + } else if (numberOfContours < 0) { + // @TODO other compound variations? + STBTT_assert(0); + } else { + // numberOfCounters == 0, do nothing + } + + *pvertices = vertices; + return num_vertices; +} + +void stbtt_GetGlyphHMetrics(const stbtt_fontinfo *info, int glyph_index, int *advanceWidth, int *leftSideBearing) +{ + stbtt_uint16 numOfLongHorMetrics = ttUSHORT(info->data+info->hhea + 34); + if (glyph_index < numOfLongHorMetrics) { + if (advanceWidth) *advanceWidth = ttSHORT(info->data + info->hmtx + 4*glyph_index); + if (leftSideBearing) *leftSideBearing = ttSHORT(info->data + info->hmtx + 4*glyph_index + 2); + } else { + if (advanceWidth) *advanceWidth = ttSHORT(info->data + info->hmtx + 4*(numOfLongHorMetrics-1)); + if (leftSideBearing) *leftSideBearing = ttSHORT(info->data + info->hmtx + 4*numOfLongHorMetrics + 2*(glyph_index - numOfLongHorMetrics)); + } +} + +int stbtt_GetGlyphKernAdvance(const stbtt_fontinfo * /*info*/, int /*glyph1*/, int /*glyph2*/) +{ + return 0; +} + +int stbtt_GetCodepointKernAdvance(const stbtt_fontinfo * /*info*/, int /*ch1*/, int /*ch2*/) +{ + return 0; +} + +void stbtt_GetCodepointHMetrics(const stbtt_fontinfo *info, int codepoint, int *advanceWidth, int *leftSideBearing) +{ + stbtt_GetGlyphHMetrics(info, stbtt_FindGlyphIndex(info,codepoint), advanceWidth, leftSideBearing); +} + +void stbtt_GetFontVMetrics(const stbtt_fontinfo *info, int *ascent, int *descent, int *lineGap) +{ + if (ascent ) *ascent = ttSHORT(info->data+info->hhea + 4); + if (descent) *descent = ttSHORT(info->data+info->hhea + 6); + if (lineGap) *lineGap = ttSHORT(info->data+info->hhea + 8); +} + +float stbtt_ScaleForPixelHeight(const stbtt_fontinfo *info, float height) +{ + int fheight = ttSHORT(info->data + info->hhea + 4) - ttSHORT(info->data + info->hhea + 6); + return (float) height / fheight; +} + +void stbtt_FreeShape(const stbtt_fontinfo *info, stbtt_vertex *v) +{ + STBTT_free(v, info->userdata); +} + +////////////////////////////////////////////////////////////////////////////// +// +// antialiasing software rasterizer +// + +void stbtt_GetGlyphBitmapBox(const stbtt_fontinfo *font, int glyph, float scale_x, float scale_y, int *ix0, int *iy0, int *ix1, int *iy1) +{ + int x0,y0,x1,y1; + if (!stbtt_GetGlyphBox(font, glyph, &x0,&y0,&x1,&y1)) + x0=y0=x1=y1=0; // e.g. space character + // now move to integral bboxes (treating pixels as little squares, what pixels get touched)? + if (ix0) *ix0 = STBTT_ifloor(x0 * scale_x); + if (iy0) *iy0 = -STBTT_iceil (y1 * scale_y); + if (ix1) *ix1 = STBTT_iceil (x1 * scale_x); + if (iy1) *iy1 = -STBTT_ifloor(y0 * scale_y); +} + +void stbtt_GetCodepointBitmapBox(const stbtt_fontinfo *font, int codepoint, float scale_x, float scale_y, int *ix0, int *iy0, int *ix1, int *iy1) +{ + stbtt_GetGlyphBitmapBox(font, stbtt_FindGlyphIndex(font,codepoint), scale_x, scale_y, ix0,iy0,ix1,iy1); +} + +typedef struct stbtt__edge { + float x0,y0, x1,y1; + int invert; +} stbtt__edge; + +typedef struct stbtt__active_edge +{ + int x,dx; + float ey; + struct stbtt__active_edge *next; + int valid; +} stbtt__active_edge; + +#define FIXSHIFT 10 +#define FIX (1 << FIXSHIFT) +#define FIXMASK (FIX-1) + +static stbtt__active_edge *new_active(stbtt__edge *e, int off_x, float start_point, void *userdata) +{ + stbtt__active_edge *z = (stbtt__active_edge *) STBTT_malloc(sizeof(*z), userdata); // @TODO: make a pool of these!!! + float dxdy = (e->x1 - e->x0) / (e->y1 - e->y0); + STBTT_assert(e->y0 <= start_point); + if (!z) return z; + // round dx down to avoid going too far + if (dxdy < 0) + z->dx = -STBTT_ifloor(FIX * -dxdy); + else + z->dx = STBTT_ifloor(FIX * dxdy); + z->x = STBTT_ifloor(FIX * (e->x0 + dxdy * (start_point - e->y0))); + z->x -= off_x * FIX; + z->ey = e->y1; + z->next = 0; + z->valid = e->invert ? 1 : -1; + return z; +} + +// note: this routine clips fills that extend off the edges... ideally this +// wouldn't happen, but it could happen if the truetype glyph bounding boxes +// are wrong, or if the user supplies a too-small bitmap +static void stbtt__fill_active_edges(unsigned char *scanline, int len, stbtt__active_edge *e, int max_weight) +{ + // non-zero winding fill + int x0=0, w=0; + + while (e) { + if (w == 0) { + // if we're currently at zero, we need to record the edge start point + x0 = e->x; w += e->valid; + } else { + int x1 = e->x; w += e->valid; + // if we went to zero, we need to draw + if (w == 0) { + int i = x0 >> FIXSHIFT; + int j = x1 >> FIXSHIFT; + + if (i < len && j >= 0) { + if (i == j) { + // x0,x1 are the same pixel, so compute combined coverage + scanline[i] = scanline[i] + (stbtt_uint8) ((x1 - x0) * max_weight >> FIXSHIFT); + } else { + if (i >= 0) // add antialiasing for x0 + scanline[i] = scanline[i] + (stbtt_uint8) (((FIX - (x0 & FIXMASK)) * max_weight) >> FIXSHIFT); + else + i = -1; // clip + + if (j < len) // add antialiasing for x1 + scanline[j] = scanline[j] + (stbtt_uint8) (((x1 & FIXMASK) * max_weight) >> FIXSHIFT); + else + j = len; // clip + + for (++i; i < j; ++i) // fill pixels between x0 and x1 + scanline[i] = scanline[i] + (stbtt_uint8) max_weight; + } + } + } + } + + e = e->next; + } +} + +static void stbtt__rasterize_sorted_edges(stbtt__bitmap *result, stbtt__edge *e, int n, int vsubsample, int off_x, int off_y, void *userdata) +{ + stbtt__active_edge *active = NULL; + int y,j=0; + int max_weight = (255 / vsubsample); // weight per vertical scanline + int s; // vertical subsample index + unsigned char scanline_data[512], *scanline; + + if (result->w > 512) + scanline = (unsigned char *) STBTT_malloc(result->w, userdata); + else + scanline = scanline_data; + + y = off_y * vsubsample; + e[n].y0 = (off_y + result->h) * (float) vsubsample + 1; + + while (j < result->h) { + STBTT_memset(scanline, 0, result->w); + for (s=0; s < vsubsample; ++s) { + // find center of pixel for this scanline + float scan_y = y + 0.5f; + stbtt__active_edge **step = &active; + + // update all active edges; + // remove all active edges that terminate before the center of this scanline + while (*step) { + stbtt__active_edge * z = *step; + if (z->ey <= scan_y) { + *step = z->next; // delete from list + STBTT_assert(z->valid); + z->valid = 0; + STBTT_free(z, userdata); + } else { + z->x += z->dx; // advance to position for current scanline + step = &((*step)->next); // advance through list + } + } + + // resort the list if needed + for(;;) { + int changed=0; + step = &active; + while (*step && (*step)->next) { + if ((*step)->x > (*step)->next->x) { + stbtt__active_edge *t = *step; + stbtt__active_edge *q = t->next; + + t->next = q->next; + q->next = t; + *step = q; + changed = 1; + } + step = &(*step)->next; + } + if (!changed) break; + } + + // insert all edges that start before the center of this scanline -- omit ones that also end on this scanline + while (e->y0 <= scan_y) { + if (e->y1 > scan_y) { + stbtt__active_edge *z = new_active(e, off_x, scan_y, userdata); + // find insertion point + if (active == NULL) + active = z; + else if (z->x < active->x) { + // insert at front + z->next = active; + active = z; + } else { + // find thing to insert AFTER + stbtt__active_edge *p = active; + while (p->next && p->next->x < z->x) + p = p->next; + // at this point, p->next->x is NOT < z->x + z->next = p->next; + p->next = z; + } + } + ++e; + } + + // now process all active edges in XOR fashion + if (active) + stbtt__fill_active_edges(scanline, result->w, active, max_weight); + + ++y; + } + STBTT_memcpy(result->pixels + j * result->stride, scanline, result->w); + ++j; + } + + while (active) { + stbtt__active_edge *z = active; + active = active->next; + STBTT_free(z, userdata); + } + + if (scanline != scanline_data) + STBTT_free(scanline, userdata); +} + +static int stbtt__edge_compare(const void *p, const void *q) +{ + stbtt__edge *a = (stbtt__edge *) p; + stbtt__edge *b = (stbtt__edge *) q; + + if (a->y0 < b->y0) return -1; + if (a->y0 > b->y0) return 1; + return 0; +} + +typedef struct +{ + float x,y; +} stbtt__point; + +static void stbtt__rasterize(stbtt__bitmap *result, stbtt__point *pts, int *wcount, int windings, float scale_x, float scale_y, int off_x, int off_y, int invert, void *userdata) +{ + float y_scale_inv = invert ? -scale_y : scale_y; + stbtt__edge *e; + int n,i,j,k,m; + int vsubsample = result->h < 8 ? 15 : 5; + // vsubsample should divide 255 evenly; otherwise we won't reach full opacity + + // now we have to blow out the windings into explicit edge lists + n = 0; + for (i=0; i < windings; ++i) + n += wcount[i]; + + e = (stbtt__edge *) STBTT_malloc(sizeof(*e) * (n+1), userdata); // add an extra one as a sentinel + if (e == 0) return; + n = 0; + + m=0; + for (i=0; i < windings; ++i) { + stbtt__point *p = pts + m; + m += wcount[i]; + j = wcount[i]-1; + for (k=0; k < wcount[i]; j=k++) { + int a=k,b=j; + // skip the edge if horizontal + if (p[j].y == p[k].y) + continue; + // add edge from j to k to the list + e[n].invert = 0; + if (invert ? p[j].y > p[k].y : p[j].y < p[k].y) { + e[n].invert = 1; + a=j,b=k; + } + e[n].x0 = p[a].x * scale_x; + e[n].y0 = p[a].y * y_scale_inv * vsubsample; + e[n].x1 = p[b].x * scale_x; + e[n].y1 = p[b].y * y_scale_inv * vsubsample; + ++n; + } + } + + // now sort the edges by their highest point (should snap to integer, and then by x) + STBTT_sort(e, n, sizeof(e[0]), stbtt__edge_compare); + + // now, traverse the scanlines and find the intersections on each scanline, use xor winding rule + stbtt__rasterize_sorted_edges(result, e, n, vsubsample, off_x, off_y, userdata); + + STBTT_free(e, userdata); +} + +static void stbtt__add_point(stbtt__point *points, int n, float x, float y) +{ + if (!points) return; // during first pass, it's unallocated + points[n].x = x; + points[n].y = y; +} + +// tesselate until threshhold p is happy... @TODO warped to compensate for non-linear stretching +static int stbtt__tesselate_curve(stbtt__point *points, int *num_points, float x0, float y0, float x1, float y1, float x2, float y2, float objspace_flatness_squared, int n) +{ + // midpoint + float mx = (x0 + 2*x1 + x2)/4; + float my = (y0 + 2*y1 + y2)/4; + // versus directly drawn line + float dx = (x0+x2)/2 - mx; + float dy = (y0+y2)/2 - my; + if (n > 16) // 65536 segments on one curve better be enough! + return 1; + if (dx*dx+dy*dy > objspace_flatness_squared) { // half-pixel error allowed... need to be smaller if AA + stbtt__tesselate_curve(points, num_points, x0,y0, (x0+x1)/2.0f,(y0+y1)/2.0f, mx,my, objspace_flatness_squared,n+1); + stbtt__tesselate_curve(points, num_points, mx,my, (x1+x2)/2.0f,(y1+y2)/2.0f, x2,y2, objspace_flatness_squared,n+1); + } else { + stbtt__add_point(points, *num_points,x2,y2); + *num_points = *num_points+1; + } + return 1; +} + +// returns number of contours +stbtt__point *stbtt_FlattenCurves(stbtt_vertex *vertices, int num_verts, float objspace_flatness, int **contour_lengths, int *num_contours, void *userdata) +{ + stbtt__point *points=0; + int num_points=0; + + float objspace_flatness_squared = objspace_flatness * objspace_flatness; + int i,n=0,start=0, pass; + + // count how many "moves" there are to get the contour count + for (i=0; i < num_verts; ++i) + if (vertices[i].type == STBTT_vmove) + ++n; + + *num_contours = n; + if (n == 0) return 0; + + *contour_lengths = (int *) STBTT_malloc(sizeof(**contour_lengths) * n, userdata); + + if (*contour_lengths == 0) { + *num_contours = 0; + return 0; + } + + // make two passes through the points so we don't need to realloc + for (pass=0; pass < 2; ++pass) { + float x=0,y=0; + if (pass == 1) { + points = (stbtt__point *) STBTT_malloc(num_points * sizeof(points[0]), userdata); + if (points == NULL) goto error; + } + num_points = 0; + n= -1; + for (i=0; i < num_verts; ++i) { + switch (vertices[i].type) { + case STBTT_vmove: + // start the next contour + if (n >= 0) + (*contour_lengths)[n] = num_points - start; + ++n; + start = num_points; + + x = vertices[i].x, y = vertices[i].y; + stbtt__add_point(points, num_points++, x,y); + break; + case STBTT_vline: + x = vertices[i].x, y = vertices[i].y; + stbtt__add_point(points, num_points++, x, y); + break; + case STBTT_vcurve: + stbtt__tesselate_curve(points, &num_points, x,y, + vertices[i].cx, vertices[i].cy, + vertices[i].x, vertices[i].y, + objspace_flatness_squared, 0); + x = vertices[i].x, y = vertices[i].y; + break; + } + } + (*contour_lengths)[n] = num_points - start; + } + + return points; +error: + STBTT_free(points, userdata); + STBTT_free(*contour_lengths, userdata); + *contour_lengths = 0; + *num_contours = 0; + return NULL; +} + +void stbtt_Rasterize(stbtt__bitmap *result, float flatness_in_pixels, stbtt_vertex *vertices, int num_verts, float scale_x, float scale_y, int x_off, int y_off, int invert, void *userdata) +{ + float scale = scale_x > scale_y ? scale_y : scale_x; + int winding_count, *winding_lengths; + stbtt__point *windings = stbtt_FlattenCurves(vertices, num_verts, flatness_in_pixels / scale, &winding_lengths, &winding_count, userdata); + if (windings) { + stbtt__rasterize(result, windings, winding_lengths, winding_count, scale_x, scale_y, x_off, y_off, invert, userdata); + STBTT_free(winding_lengths, userdata); + STBTT_free(windings, userdata); + } +} + +void stbtt_FreeBitmap(unsigned char *bitmap, void *userdata) +{ + STBTT_free(bitmap, userdata); +} + +unsigned char *stbtt_GetGlyphBitmap(const stbtt_fontinfo *info, float scale_x, float scale_y, int glyph, int *width, int *height, int *xoff, int *yoff) +{ + int ix0,iy0,ix1,iy1; + stbtt__bitmap gbm; + stbtt_vertex *vertices; + int num_verts = stbtt_GetGlyphShape(info, glyph, &vertices); + + if (scale_x == 0) scale_x = scale_y; + if (scale_y == 0) { + if (scale_x == 0) return NULL; + scale_y = scale_x; + } + + stbtt_GetGlyphBitmapBox(info, glyph, scale_x, scale_y, &ix0,&iy0,&ix1,&iy1); + + // now we get the size + gbm.w = (ix1 - ix0); + gbm.h = (iy1 - iy0); + gbm.pixels = NULL; // in case we error + + if (width ) *width = gbm.w; + if (height) *height = gbm.h; + if (xoff ) *xoff = ix0; + if (yoff ) *yoff = iy0; + + if (gbm.w && gbm.h) { + gbm.pixels = (unsigned char *) STBTT_malloc(gbm.w * gbm.h, info->userdata); + if (gbm.pixels) { + gbm.stride = gbm.w; + + stbtt_Rasterize(&gbm, 0.35f, vertices, num_verts, scale_x, scale_y, ix0, iy0, 1, info->userdata); + } + } + STBTT_free(vertices, info->userdata); + return gbm.pixels; +} + +void stbtt_MakeGlyphBitmap(const stbtt_fontinfo *info, unsigned char *output, int out_w, int out_h, int out_stride, float scale_x, float scale_y, int glyph) +{ + int ix0,iy0; + stbtt_vertex *vertices; + int num_verts = stbtt_GetGlyphShape(info, glyph, &vertices); + stbtt__bitmap gbm; + + stbtt_GetGlyphBitmapBox(info, glyph, scale_x, scale_y, &ix0,&iy0,0,0); + gbm.pixels = output; + gbm.w = out_w; + gbm.h = out_h; + gbm.stride = out_stride; + + if (gbm.w && gbm.h) + stbtt_Rasterize(&gbm, 0.35f, vertices, num_verts, scale_x, scale_y, ix0,iy0, 1, info->userdata); + + STBTT_free(vertices, info->userdata); +} + +unsigned char *stbtt_GetCodepointBitmap(const stbtt_fontinfo *info, float scale_x, float scale_y, int codepoint, int *width, int *height, int *xoff, int *yoff) +{ + return stbtt_GetGlyphBitmap(info, scale_x, scale_y, stbtt_FindGlyphIndex(info,codepoint), width,height,xoff,yoff); +} + +void stbtt_MakeCodepointBitmap(const stbtt_fontinfo *info, unsigned char *output, int out_w, int out_h, int out_stride, float scale_x, float scale_y, int codepoint) +{ + stbtt_MakeGlyphBitmap(info, output, out_w, out_h, out_stride, scale_x, scale_y, stbtt_FindGlyphIndex(info,codepoint)); +} + +////////////////////////////////////////////////////////////////////////////// +// +// bitmap baking +// +// This is SUPER-SHITTY packing to keep source code small + +extern int stbtt_BakeFontBitmap(const unsigned char *data, int offset, // font location (use offset=0 for plain .ttf) + float pixel_height, // height of font in pixels + unsigned char *pixels, int pw, int ph, // bitmap to be filled in + int first_char, int num_chars, // characters to bake + stbtt_bakedchar *chardata) +{ + float scale; + int x,y,bottom_y, i; + stbtt_fontinfo f; + stbtt_InitFont(&f, data, offset); + STBTT_memset(pixels, 0, pw*ph); // background of 0 around pixels + x=y=1; + bottom_y = 1; + + scale = stbtt_ScaleForPixelHeight(&f, pixel_height); + + for (i=0; i < num_chars; ++i) { + int advance, lsb, x0,y0,x1,y1,gw,gh; + int g = stbtt_FindGlyphIndex(&f, first_char + i); + stbtt_GetGlyphHMetrics(&f, g, &advance, &lsb); + stbtt_GetGlyphBitmapBox(&f, g, scale,scale, &x0,&y0,&x1,&y1); + gw = x1-x0; + gh = y1-y0; + if (x + gw + 1 >= pw) + y = bottom_y, x = 1; // advance to next row + if (y + gh + 1 >= ph) // check if it fits vertically AFTER potentially moving to next row + return -i; + STBTT_assert(x+gw < pw); + STBTT_assert(y+gh < ph); + stbtt_MakeGlyphBitmap(&f, pixels+x+y*pw, gw,gh,pw, scale,scale, g); + chardata[i].x0 = (stbtt_int16) x; + chardata[i].y0 = (stbtt_int16) y; + chardata[i].x1 = (stbtt_int16) (x + gw); + chardata[i].y1 = (stbtt_int16) (y + gh); + chardata[i].xadvance = scale * advance; + chardata[i].xoff = (float) x0; + chardata[i].yoff = (float) y0; + x = x + gw + 2; + if (y+gh+2 > bottom_y) + bottom_y = y+gh+2; + } + return bottom_y; +} + +void stbtt_GetBakedQuad(stbtt_bakedchar *chardata, int pw, int ph, int char_index, float *xpos, float *ypos, stbtt_aligned_quad *q, int opengl_fillrule) +{ + float d3d_bias = opengl_fillrule ? 0 : -0.5f; + float ipw = 1.0f / pw, iph = 1.0f / ph; + stbtt_bakedchar *b = chardata + char_index; + int round_x = STBTT_ifloor((*xpos + b->xoff) + 0.5); + int round_y = STBTT_ifloor((*ypos + b->yoff) + 0.5); + + q->x0 = round_x + d3d_bias; + q->y0 = round_y + d3d_bias; + q->x1 = round_x + b->x1 - b->x0 + d3d_bias; + q->y1 = round_y + b->y1 - b->y0 + d3d_bias; + + q->s0 = b->x0 * ipw; + q->t0 = b->y0 * ipw; + q->s1 = b->x1 * iph; + q->t1 = b->y1 * iph; + + *xpos += b->xadvance; +} + +////////////////////////////////////////////////////////////////////////////// +// +// font name matching -- recommended not to use this +// + +// check if a utf8 string contains a prefix which is the utf16 string; if so return length of matching utf8 string +static stbtt_int32 stbtt__CompareUTF8toUTF16_bigendian_prefix(stbtt_uint8 *s1, stbtt_int32 len1, stbtt_uint8 *s2, stbtt_int32 len2) +{ + stbtt_int32 i=0; + + // convert utf16 to utf8 and compare the results while converting + while (len2) { + stbtt_uint16 ch = s2[0]*256 + s2[1]; + if (ch < 0x80) { + if (i >= len1) return -1; + if (s1[i++] != ch) return -1; + } else if (ch < 0x800) { + if (i+1 >= len1) return -1; + if (s1[i++] != 0xc0 + (ch >> 6)) return -1; + if (s1[i++] != 0x80 + (ch & 0x3f)) return -1; + } else if (ch >= 0xd800 && ch < 0xdc00) { + stbtt_uint32 c; + stbtt_uint16 ch2 = s2[2]*256 + s2[3]; + if (i+3 >= len1) return -1; + c = ((ch - 0xd800) << 10) + (ch2 - 0xdc00) + 0x10000; + if (s1[i++] != 0xf0 + (c >> 18)) return -1; + if (s1[i++] != 0x80 + ((c >> 12) & 0x3f)) return -1; + if (s1[i++] != 0x80 + ((c >> 6) & 0x3f)) return -1; + if (s1[i++] != 0x80 + ((c ) & 0x3f)) return -1; + s2 += 2; // plus another 2 below + len2 -= 2; + } else if (ch >= 0xdc00 && ch < 0xe000) { + return -1; + } else { + if (i+2 >= len1) return -1; + if (s1[i++] != 0xe0 + (ch >> 12)) return -1; + if (s1[i++] != 0x80 + ((ch >> 6) & 0x3f)) return -1; + if (s1[i++] != 0x80 + ((ch ) & 0x3f)) return -1; + } + s2 += 2; + len2 -= 2; + } + return i; +} + +int stbtt_CompareUTF8toUTF16_bigendian(const char *s1, int len1, const char *s2, int len2) +{ + return len1 == stbtt__CompareUTF8toUTF16_bigendian_prefix((stbtt_uint8*) s1, len1, (stbtt_uint8*) s2, len2); +} + +// returns results in whatever encoding you request... but note that 2-byte encodings +// will be BIG-ENDIAN... use stbtt_CompareUTF8toUTF16_bigendian() to compare +char *stbtt_GetFontNameString(const stbtt_fontinfo *font, int *length, int platformID, int encodingID, int languageID, int nameID) +{ + stbtt_int32 i,count,stringOffset; + stbtt_uint8 *fc = font->data; + stbtt_uint32 offset = font->fontstart; + stbtt_uint32 nm = stbtt__find_table(fc, offset, "name"); + if (!nm) return NULL; + + count = ttUSHORT(fc+nm+2); + stringOffset = nm + ttUSHORT(fc+nm+4); + for (i=0; i < count; ++i) { + stbtt_uint32 loc = nm + 6 + 12 * i; + if (platformID == ttUSHORT(fc+loc+0) && encodingID == ttUSHORT(fc+loc+2) + && languageID == ttUSHORT(fc+loc+4) && nameID == ttUSHORT(fc+loc+6)) { + *length = ttUSHORT(fc+loc+8); + return (char *) (fc+stringOffset+ttUSHORT(fc+loc+10)); + } + } + return NULL; +} + +static int stbtt__matchpair(stbtt_uint8 *fc, stbtt_uint32 nm, stbtt_uint8 *name, stbtt_int32 nlen, stbtt_int32 target_id, stbtt_int32 next_id) +{ + stbtt_int32 i; + stbtt_int32 count = ttUSHORT(fc+nm+2); + stbtt_int32 stringOffset = nm + ttUSHORT(fc+nm+4); + + for (i=0; i < count; ++i) { + stbtt_uint32 loc = nm + 6 + 12 * i; + stbtt_int32 id = ttUSHORT(fc+loc+6); + if (id == target_id) { + // find the encoding + stbtt_int32 platform = ttUSHORT(fc+loc+0), encoding = ttUSHORT(fc+loc+2), language = ttUSHORT(fc+loc+4); + + // is this a Unicode encoding? + if (platform == 0 || (platform == 3 && encoding == 1) || (platform == 3 && encoding == 10)) { + stbtt_int32 slen = ttUSHORT(fc+loc+8), off = ttUSHORT(fc+loc+10); + + // check if there's a prefix match + stbtt_int32 matchlen = stbtt__CompareUTF8toUTF16_bigendian_prefix(name, nlen, fc+stringOffset+off,slen); + if (matchlen >= 0) { + // check for target_id+1 immediately following, with same encoding & language + if (i+1 < count && ttUSHORT(fc+loc+12+6) == next_id && ttUSHORT(fc+loc+12) == platform && ttUSHORT(fc+loc+12+2) == encoding && ttUSHORT(fc+loc+12+4) == language) { + stbtt_int32 slen = ttUSHORT(fc+loc+12+8), off = ttUSHORT(fc+loc+12+10); + if (slen == 0) { + if (matchlen == nlen) + return 1; + } else if (matchlen < nlen && name[matchlen] == ' ') { + ++matchlen; + if (stbtt_CompareUTF8toUTF16_bigendian((char*) (name+matchlen), nlen-matchlen, (char*)(fc+stringOffset+off),slen)) + return 1; + } + } else { + // if nothing immediately following + if (matchlen == nlen) + return 1; + } + } + } + + // @TODO handle other encodings + } + } + return 0; +} + +static int stbtt__matches(stbtt_uint8 *fc, stbtt_uint32 offset, stbtt_uint8 *name, stbtt_int32 flags) +{ + stbtt_int32 nlen = STBTT_strlen((char *) name); + stbtt_uint32 nm,hd; + if (!stbtt__isfont(fc+offset)) return 0; + + // check italics/bold/underline flags in macStyle... + if (flags) { + hd = stbtt__find_table(fc, offset, "head"); + if ((ttUSHORT(fc+hd+44) & 7) != (flags & 7)) return 0; + } + + nm = stbtt__find_table(fc, offset, "name"); + if (!nm) return 0; + + if (flags) { + // if we checked the macStyle flags, then just check the family and ignore the subfamily + if (stbtt__matchpair(fc, nm, name, nlen, 16, -1)) return 1; + if (stbtt__matchpair(fc, nm, name, nlen, 1, -1)) return 1; + if (stbtt__matchpair(fc, nm, name, nlen, 3, -1)) return 1; + } else { + if (stbtt__matchpair(fc, nm, name, nlen, 16, 17)) return 1; + if (stbtt__matchpair(fc, nm, name, nlen, 1, 2)) return 1; + if (stbtt__matchpair(fc, nm, name, nlen, 3, -1)) return 1; + } + + return 0; +} + +int stbtt_FindMatchingFont(const unsigned char *font_collection, const char *name_utf8, stbtt_int32 flags) +{ + stbtt_int32 i; + for (i=0;;++i) { + stbtt_int32 off = stbtt_GetFontOffsetForIndex(font_collection, i); + if (off < 0) return off; + if (stbtt__matches((stbtt_uint8 *) font_collection, off, (stbtt_uint8*) name_utf8, flags)) + return off; + } +} + +#endif // STB_TRUETYPE_IMPLEMENTATION diff --git a/dep/recastnavigation/RecastDemo/Include/ChunkyTriMesh.h b/dep/recastnavigation/RecastDemo/Include/ChunkyTriMesh.h new file mode 100644 index 000000000..9be77880f --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Include/ChunkyTriMesh.h @@ -0,0 +1,52 @@ +// +// Copyright (c) 2009-2010 Mikko Mononen memon@inside.org +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. +// + +#ifndef CHUNKYTRIMESH_H +#define CHUNKYTRIMESH_H + +struct rcChunkyTriMeshNode +{ + float bmin[2], bmax[2]; + int i, n; +}; + +struct rcChunkyTriMesh +{ + inline rcChunkyTriMesh() : nodes(0), tris(0) {}; + inline ~rcChunkyTriMesh() { delete [] nodes; delete [] tris; } + + rcChunkyTriMeshNode* nodes; + int nnodes; + int* tris; + int ntris; + int maxTrisPerChunk; +}; + +// Creates partitioned triangle mesh (AABB tree), +// where each node contains at max trisPerChunk triangles. +bool rcCreateChunkyTriMesh(const float* verts, const int* tris, int ntris, + int trisPerChunk, rcChunkyTriMesh* cm); + +// Returns the chunk indices which overlap the input rectable. +int rcGetChunksOverlappingRect(const rcChunkyTriMesh* cm, float bmin[2], float bmax[2], int* ids, const int maxIds); + +// Returns the chunk indices which overlap the input segment. +int rcGetChunksOverlappingSegment(const rcChunkyTriMesh* cm, float p[2], float q[2], int* ids, const int maxIds); + + +#endif // CHUNKYTRIMESH_H diff --git a/dep/recastnavigation/RecastDemo/Include/ConvexVolumeTool.h b/dep/recastnavigation/RecastDemo/Include/ConvexVolumeTool.h new file mode 100644 index 000000000..e3382305d --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Include/ConvexVolumeTool.h @@ -0,0 +1,55 @@ +// +// Copyright (c) 2009-2010 Mikko Mononen memon@inside.org +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. +// + +#ifndef CONVEXVOLUMETOOL_H +#define CONVEXVOLUMETOOL_H + +#include "Sample.h" + +// Tool to create convex volumess for InputGeom + +class ConvexVolumeTool : public SampleTool +{ + Sample* m_sample; + int m_areaType; + float m_boxHeight; + float m_boxDescent; + + static const int MAX_PTS = 12; + float m_pts[MAX_PTS*3]; + int m_npts; + int m_hull[MAX_PTS]; + int m_nhull; + +public: + ConvexVolumeTool(); + ~ConvexVolumeTool(); + + virtual int type() { return TOOL_CONVEX_VOLUME; } + virtual void init(Sample* sample); + virtual void reset(); + virtual void handleMenu(); + virtual void handleClick(const float* s, const float* p, bool shift); + virtual void handleToggle(); + virtual void handleStep(); + virtual void handleUpdate(const float dt); + virtual void handleRender(); + virtual void handleRenderOverlay(double* proj, double* model, int* view); +}; + +#endif // CONVEXVOLUMETOOL_H diff --git a/dep/recastnavigation/RecastDemo/Include/CrowdManager.h b/dep/recastnavigation/RecastDemo/Include/CrowdManager.h new file mode 100644 index 000000000..faa642361 --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Include/CrowdManager.h @@ -0,0 +1,335 @@ +// +// Copyright (c) 2009-2010 Mikko Mononen memon@inside.org +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. +// + +#ifndef CROWDMANAGER_H +#define CROWDMANAGER_H + +#include "DetourNavMeshQuery.h" +#include "DetourObstacleAvoidance.h" +#include "ValueHistory.h" + + +class ProximityGrid +{ + int m_maxItems; + float m_cellSize; + float m_invCellSize; + + struct Item + { + unsigned short id; + short x,y; + unsigned short next; + }; + Item* m_pool; + int m_poolHead; + int m_poolSize; + + unsigned short* m_buckets; + int m_bucketsSize; + + int m_bounds[4]; + +public: + ProximityGrid(); + ~ProximityGrid(); + + bool init(const int maxItems, const float cellSize); + + void clear(); + + void addItem(const unsigned short id, + const float minx, const float miny, + const float maxx, const float maxy); + + int queryItems(const float minx, const float miny, + const float maxx, const float maxy, + unsigned short* ids, const int maxIds) const; + + int getItemCountAt(const int x, const int y) const; + const int* getBounds() const { return m_bounds; } + const float getCellSize() const { return m_cellSize; } +}; + + + + +static const unsigned int PATHQ_INVALID = 0; + +enum PathQueueRequestState +{ + PATHQ_STATE_INVALID, + PATHQ_STATE_WORKING, + PATHQ_STATE_READY, +}; + +typedef unsigned int PathQueueRef; + +class PathQueue +{ + static const int PQ_MAX_PATH = 256; + + struct PathQuery + { + // Path find start and end location. + float startPos[3], endPos[3]; + dtPolyRef startRef, endRef; + // Result. + dtPolyRef path[PQ_MAX_PATH]; + bool ready; + int npath; + PathQueueRef ref; + const dtQueryFilter* filter; // TODO: This is potentially dangerous! + int keepalive; + }; + + static const int MAX_QUEUE = 8; + PathQuery m_queue[MAX_QUEUE]; + PathQueueRef m_nextHandle; + + int m_delay; + +public: + PathQueue(); + ~PathQueue(); + + void update(dtNavMeshQuery* navquery); + PathQueueRef request(dtPolyRef startRef, dtPolyRef endRef, + const float* startPos, const float* endPos, + const dtQueryFilter* filter); + int getRequestState(PathQueueRef ref); + int getPathResult(PathQueueRef ref, dtPolyRef* path, const int maxPath); +}; + + +class PathCorridor +{ + float m_pos[3]; + float m_target[3]; + + dtPolyRef* m_path; + int m_npath; + int m_maxPath; + +public: + PathCorridor(); + ~PathCorridor(); + + bool init(const int maxPath); + + void reset(dtPolyRef ref, const float* pos); + + int findCorners(float* cornerVerts, unsigned char* cornerFlags, + dtPolyRef* cornerPolys, const int maxCorners, + dtNavMeshQuery* navquery, const dtQueryFilter* filter); + + void optimizePathVisibility(const float* next, const float pathOptimizationRange, + dtNavMeshQuery* navquery, const dtQueryFilter* filter); + + bool optimizePathTopology(dtNavMeshQuery* navquery, const dtQueryFilter* filter); + + void movePosition(const float* npos, dtNavMeshQuery* navquery, const dtQueryFilter* filter); + void moveTargetPosition(const float* npos, dtNavMeshQuery* navquery, const dtQueryFilter* filter); + + void setCorridor(const float* target, const dtPolyRef* polys, const int npolys); + + inline const float* getPos() const { return m_pos; } + inline const float* getTarget() const { return m_target; } + + inline dtPolyRef getFirstPoly() const { return m_npath ? m_path[0] : 0; } + + inline const dtPolyRef* getPath() const { return m_path; } + inline int getPathCount() const { return m_npath; } +}; + + +class LocalBoundary +{ + static const int MAX_SEGS = 8; + + struct Segment + { + float s[6]; // Segment start/end + float d; // Distance for pruning. + }; + + float m_center[3]; + Segment m_segs[MAX_SEGS]; + int m_nsegs; + + void addSegment(const float dist, const float* seg); + +public: + LocalBoundary(); + ~LocalBoundary(); + + void reset(); + + void update(dtPolyRef ref, const float* pos, const float collisionQueryRange, + dtNavMeshQuery* navquery, const dtQueryFilter* filter); + + inline const float* getCenter() const { return m_center; } + inline int getSegmentCount() const { return m_nsegs; } + inline const float* getSegment(int i) const { return m_segs[i].s; } +}; + + +static const int AGENT_MAX_NEIGHBOURS = 6; +static const int AGENT_MAX_CORNERS = 4; +static const int AGENT_MAX_TRAIL = 64; + +struct Neighbour +{ + int idx; + float dist; +}; + +struct Agent +{ + void integrate(const float maxAcc, const float dt); + void calcSmoothSteerDirection(float* dir); + void calcStraightSteerDirection(float* dir); + float getDistanceToGoal(const float range) const; + + unsigned char active; + + PathCorridor corridor; + LocalBoundary boundary; + + float maxspeed; + float t; + float var; + + float collisionQueryRange; + float pathOptimizationRange; + + float topologyOptTime; + + Neighbour neis[AGENT_MAX_NEIGHBOURS]; + int nneis; + + float radius, height; + float npos[3]; + float disp[3]; + float dvel[3]; + float nvel[3]; + float vel[3]; + + float cornerVerts[AGENT_MAX_CORNERS*3]; + unsigned char cornerFlags[AGENT_MAX_CORNERS]; + dtPolyRef cornerPolys[AGENT_MAX_CORNERS]; + int ncorners; + + float opts[3], opte[3]; + + float trail[AGENT_MAX_TRAIL*3]; + int htrail; +}; + + +enum UpdateFlags +{ + CROWDMAN_ANTICIPATE_TURNS = 1, + CROWDMAN_USE_VO = 2, + CROWDMAN_DRUNK = 4, + CROWDMAN_OPTIMIZE_VIS = 8, + CROWDMAN_OPTIMIZE_TOPO = 16, +}; + + +class CrowdManager +{ + static const int MAX_AGENTS = 128; + Agent m_agents[MAX_AGENTS]; + dtObstacleAvoidanceDebugData* m_vodebug[MAX_AGENTS]; + + dtObstacleAvoidanceQuery* m_obstacleQuery; + PathQueue m_pathq; + ProximityGrid m_grid; + + dtPolyRef* m_pathResult; + int m_maxPathResult; + + float m_ext[3]; + dtQueryFilter m_filter; + + int m_totalTime; + int m_rvoTime; + int m_sampleCount; + + enum MoveRequestState + { + MR_TARGET_FAILED, + MR_TARGET_VALID, + MR_TARGET_REQUESTING, + MR_TARGET_WAITING_FOR_PATH, + MR_TARGET_ADJUST, + }; + + static const int MAX_TEMP_PATH = 32; + + struct MoveRequest + { + unsigned char state; // State of the request + int idx; // Agent index + dtPolyRef ref; // Goal ref + float pos[3]; // Goal position + PathQueueRef pathqRef; // Path find query ref + dtPolyRef aref; // Goal adjustment ref + float apos[3]; // Goal adjustment pos + dtPolyRef temp[MAX_TEMP_PATH]; // Adjusted path to the goal + int ntemp; + }; + MoveRequest m_moveRequests[MAX_AGENTS]; + int m_moveRequestCount; + + int getNeighbours(const float* pos, const float height, const float range, + const Agent* skip, Neighbour* result, const int maxResult); + + void updateTopologyOptimization(const float dt, dtNavMeshQuery* navquery, const dtQueryFilter* filter); + void updateMoveRequest(const float dt, dtNavMeshQuery* navquery, const dtQueryFilter* filter); + +public: + CrowdManager(); + ~CrowdManager(); + + void reset(); + const Agent* getAgent(const int idx); + const int getAgentCount() const; + int addAgent(const float* pos, const float radius, const float height, dtNavMeshQuery* navquery); + void removeAgent(const int idx); + + bool requestMoveTarget(const int idx, dtPolyRef ref, const float* pos); + bool adjustMoveTarget(const int idx, dtPolyRef ref, const float* pos); + + int getActiveAgents(Agent** agents, const int maxAgents); + void update(const float dt, unsigned int flags, dtNavMeshQuery* navquery); + + const dtQueryFilter* getFilter() const { return &m_filter; } + const float* getQueryExtents() const { return m_ext; } + + const dtObstacleAvoidanceDebugData* getVODebugData(const int idx) const { return m_vodebug[idx]; } + inline int getTotalTime() const { return m_totalTime; } + inline int getRVOTime() const { return m_rvoTime; } + inline int getSampleCount() const { return m_sampleCount; } + const ProximityGrid* getGrid() const { return &m_grid; } + +}; + + +#endif // CROWDMANAGER_H \ No newline at end of file diff --git a/dep/recastnavigation/RecastDemo/Include/CrowdTool.h b/dep/recastnavigation/RecastDemo/Include/CrowdTool.h new file mode 100644 index 000000000..1c69f6e74 --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Include/CrowdTool.h @@ -0,0 +1,88 @@ +// +// Copyright (c) 2009-2010 Mikko Mononen memon@inside.org +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. +// + +#ifndef CROWDTOOL_H +#define CROWDTOOL_H + +#include "Sample.h" +#include "DetourNavMesh.h" +#include "DetourObstacleAvoidance.h" +#include "ValueHistory.h" +#include "CrowdManager.h" + +// Tool to create crowds. + +class CrowdTool : public SampleTool +{ + Sample* m_sample; + unsigned char m_oldFlags; + + float m_targetPos[3]; + dtPolyRef m_targetRef; + + bool m_expandDebugDraw; + bool m_showLabels; + bool m_showCorners; + bool m_showTargets; + bool m_showCollisionSegments; + bool m_showPath; + bool m_showVO; + bool m_showOpt; + bool m_showGrid; + bool m_showNodes; + bool m_showPerfGraph; + + bool m_expandOptions; + bool m_anticipateTurns; + bool m_optimizeVis; + bool m_optimizeTopo; + bool m_useVO; + bool m_drunkMove; + + bool m_run; + + CrowdManager m_crowd; + + ValueHistory m_crowdTotalTime; + ValueHistory m_crowdRvoTime; + ValueHistory m_crowdSampleCount; + + enum ToolMode + { + TOOLMODE_CREATE, + TOOLMODE_MOVE_TARGET, + }; + ToolMode m_mode; + +public: + CrowdTool(); + ~CrowdTool(); + + virtual int type() { return TOOL_CROWD; } + virtual void init(Sample* sample); + virtual void reset(); + virtual void handleMenu(); + virtual void handleClick(const float* s, const float* p, bool shift); + virtual void handleToggle(); + virtual void handleStep(); + virtual void handleUpdate(const float dt); + virtual void handleRender(); + virtual void handleRenderOverlay(double* proj, double* model, int* view); +}; + +#endif // CROWDTOOL_H diff --git a/dep/recastnavigation/RecastDemo/Include/Debug.h b/dep/recastnavigation/RecastDemo/Include/Debug.h new file mode 100644 index 000000000..721fea117 --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Include/Debug.h @@ -0,0 +1,66 @@ + +#ifndef _MMAP_DEBUG_H +#define _MMAP_DEBUG_H + +#include +#include "DetourNavMesh.h" +#include "Recast.h" +#include "ChunkyTriMesh.h" +#include "MeshLoaderObj.h" + +//void duReadObjMesh(int mapID, rcInputGeom* geom); +void duReadNavMesh(char* tile, dtNavMesh* &navMesh); +int duReadHeightfield(char* tile, rcHeightfield* &hf); +int duReadCompactHeightfield(char* tile, rcCompactHeightfield* &chf); +int duReadContourSet(char* tile, rcContourSet* &cs); +int duReadPolyMesh(char* tile, rcPolyMesh* &mesh); +int duReadDetailMesh(char* tile, rcPolyMeshDetail* &mesh); + +class myMeshLoaderObj +{ +private: + float* m_verts; + int* m_tris; + float* m_normals; + int m_vertCount; + int m_triCount; + char m_filename[260]; + +public: + myMeshLoaderObj(); + ~myMeshLoaderObj(); + + bool load(const char* fileName); + + inline const float* getVerts() const { return m_verts; } + inline const float* getNormals() const { return m_normals; } + inline const int* getTris() const { return m_tris; } + inline int getVertCount() const { return m_vertCount; } + inline int getTriCount() const { return m_triCount; } + inline const char* getFileName() const { return m_filename; } +}; + +enum NavTerrain +{ + NAV_EMPTY = 0x00, + NAV_GROUND = 0x01, + NAV_MAGMA = 0x02, + NAV_SLIME = 0x04, + NAV_WATER = 0x08, + NAV_UNUSED1 = 0x10, + NAV_UNUSED2 = 0x20, + NAV_UNUSED3 = 0x40, + NAV_UNUSED4 = 0x80 + // we only have 8 bits +}; + +struct MmapTileHeader +{ + unsigned int mmapMagic; + unsigned int dtVersion; + unsigned int mmapVersion; + unsigned int size; + bool usesLiquid : 1; +}; + +#endif diff --git a/dep/recastnavigation/RecastDemo/Include/Filelist.h b/dep/recastnavigation/RecastDemo/Include/Filelist.h new file mode 100644 index 000000000..63c85b122 --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Include/Filelist.h @@ -0,0 +1,35 @@ +// +// Copyright (c) 2009-2010 Mikko Mononen memon@inside.org +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. +// + +#ifndef FILELIST_H +#define FILELIST_H + +struct FileList +{ + static const int MAX_FILES = 256; + + FileList(); + ~FileList(); + + char* files[MAX_FILES]; + int size; +}; + +void scanDirectory(const char* path, const char* ext, FileList& list); + +#endif // FILELIST_H diff --git a/dep/recastnavigation/RecastDemo/Include/InputGeom.h b/dep/recastnavigation/RecastDemo/Include/InputGeom.h new file mode 100644 index 000000000..7b93f0036 --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Include/InputGeom.h @@ -0,0 +1,94 @@ +// +// Copyright (c) 2009-2010 Mikko Mononen memon@inside.org +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. +// + +#ifndef INPUTGEOM_H +#define INPUTGEOM_H + +#include "ChunkyTriMesh.h" +#include "MeshLoaderObj.h" +#include "Debug.h" + +static const int MAX_CONVEXVOL_PTS = 12; +struct ConvexVolume +{ + float verts[MAX_CONVEXVOL_PTS*3]; + float hmin, hmax; + int nverts; + int area; +}; + +class InputGeom +{ + rcChunkyTriMesh* m_chunkyMesh; + myMeshLoaderObj* m_mesh; + float m_meshBMin[3], m_meshBMax[3]; + + // Off-Mesh connections. + static const int MAX_OFFMESH_CONNECTIONS = 256; + float m_offMeshConVerts[MAX_OFFMESH_CONNECTIONS*3*2]; + float m_offMeshConRads[MAX_OFFMESH_CONNECTIONS]; + unsigned char m_offMeshConDirs[MAX_OFFMESH_CONNECTIONS]; + unsigned char m_offMeshConAreas[MAX_OFFMESH_CONNECTIONS]; + unsigned short m_offMeshConFlags[MAX_OFFMESH_CONNECTIONS]; + unsigned int m_offMeshConId[MAX_OFFMESH_CONNECTIONS]; + int m_offMeshConCount; + + // Convex Volumes. + static const int MAX_VOLUMES = 256; + ConvexVolume m_volumes[MAX_VOLUMES]; + int m_volumeCount; + +public: + InputGeom(); + ~InputGeom(); + + bool loadMesh(class rcContext* ctx, const char* filepath); + + bool load(class rcContext* ctx, const char* filepath); + bool save(const char* filepath); + + // Method to return static mesh data. + inline const myMeshLoaderObj* getMesh() const { return m_mesh; } + inline const float* getMeshBoundsMin() const { return m_meshBMin; } + inline const float* getMeshBoundsMax() const { return m_meshBMax; } + inline const rcChunkyTriMesh* getChunkyMesh() const { return m_chunkyMesh; } + bool raycastMesh(float* src, float* dst, float& tmin); + + // Off-Mesh connections. + int getOffMeshConnectionCount() const { return m_offMeshConCount; } + const float* getOffMeshConnectionVerts() const { return m_offMeshConVerts; } + const float* getOffMeshConnectionRads() const { return m_offMeshConRads; } + const unsigned char* getOffMeshConnectionDirs() const { return m_offMeshConDirs; } + const unsigned char* getOffMeshConnectionAreas() const { return m_offMeshConAreas; } + const unsigned short* getOffMeshConnectionFlags() const { return m_offMeshConFlags; } + const unsigned int* getOffMeshConnectionId() const { return m_offMeshConId; } + void addOffMeshConnection(const float* spos, const float* epos, const float rad, + unsigned char bidir, unsigned char area, unsigned short flags); + void deleteOffMeshConnection(int i); + void drawOffMeshConnections(struct duDebugDraw* dd, bool hilight = false); + + // Box Volumes. + int getConvexVolumeCount() const { return m_volumeCount; } + const ConvexVolume* getConvexVolumes() const { return m_volumes; } + void addConvexVolume(const float* verts, const int nverts, + const float minh, const float maxh, unsigned char area); + void deleteConvexVolume(int i); + void drawConvexVolumes(struct duDebugDraw* dd, bool hilight = false); +}; + +#endif // INPUTGEOM_H diff --git a/dep/recastnavigation/RecastDemo/Include/MeshLoaderObj.h b/dep/recastnavigation/RecastDemo/Include/MeshLoaderObj.h new file mode 100644 index 000000000..8e13e4959 --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Include/MeshLoaderObj.h @@ -0,0 +1,51 @@ +// +// Copyright (c) 2009-2010 Mikko Mononen memon@inside.org +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. +// + +#ifndef MESHLOADER_OBJ +#define MESHLOADER_OBJ + +class rcMeshLoaderObj +{ +public: + rcMeshLoaderObj(); + ~rcMeshLoaderObj(); + + bool load(const char* fileName); + + inline const float* getVerts() const { return m_verts; } + inline const float* getNormals() const { return m_normals; } + inline const int* getTris() const { return m_tris; } + inline int getVertCount() const { return m_vertCount; } + inline int getTriCount() const { return m_triCount; } + inline const char* getFileName() const { return m_filename; } + +private: + + void addVertex(float x, float y, float z, int& cap); + void addTriangle(int a, int b, int c, int& cap); + + char m_filename[260]; + + float* m_verts; + int* m_tris; + float* m_normals; + int m_vertCount; + int m_triCount; +}; + +#endif // MESHLOADER_OBJ diff --git a/dep/recastnavigation/RecastDemo/Include/NavMeshTesterTool.h b/dep/recastnavigation/RecastDemo/Include/NavMeshTesterTool.h new file mode 100644 index 000000000..51f16f7da --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Include/NavMeshTesterTool.h @@ -0,0 +1,106 @@ +// +// Copyright (c) 2009-2010 Mikko Mononen memon@inside.org +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. +// + +#ifndef NAVMESHTESTERTOOL_H +#define NAVMESHTESTERTOOL_H + +#include "Sample.h" +#include "DetourNavMesh.h" +#include "DetourNavMeshQuery.h" + +class NavMeshTesterTool : public SampleTool +{ + Sample* m_sample; + + dtNavMesh* m_navMesh; + dtNavMeshQuery* m_navQuery; + + dtQueryFilter m_filter; + + dtStatus m_pathFindStatus; + + enum ToolMode + { + TOOLMODE_PATHFIND_FOLLOW, + TOOLMODE_PATHFIND_STRAIGHT, + TOOLMODE_PATHFIND_SLICED, + TOOLMODE_RAYCAST, + TOOLMODE_DISTANCE_TO_WALL, + TOOLMODE_FIND_POLYS_IN_CIRCLE, + TOOLMODE_FIND_POLYS_IN_SHAPE, + TOOLMODE_FIND_LOCAL_NEIGHBOURHOOD, + }; + + ToolMode m_toolMode; + + static const int MAX_POLYS = 256; + static const int MAX_SMOOTH = 2048; + + dtPolyRef m_startRef; + dtPolyRef m_endRef; + dtPolyRef m_polys[MAX_POLYS]; + dtPolyRef m_parent[MAX_POLYS]; + int m_npolys; + float m_straightPath[MAX_POLYS*3]; + unsigned char m_straightPathFlags[MAX_POLYS]; + dtPolyRef m_straightPathPolys[MAX_POLYS]; + int m_nstraightPath; + float m_polyPickExt[3]; + float m_smoothPath[MAX_SMOOTH*3]; + int m_nsmoothPath; + float m_queryPoly[4*3]; + + float m_spos[3]; + float m_epos[3]; + float m_hitPos[3]; + float m_hitNormal[3]; + bool m_hitResult; + float m_distanceToWall; + float m_neighbourhoodRadius; + bool m_sposSet; + bool m_eposSet; + + int m_pathIterNum; + dtPolyRef m_pathIterPolys[MAX_POLYS]; + int m_pathIterPolyCount; + float m_prevIterPos[3], m_iterPos[3], m_steerPos[3], m_targetPos[3]; + + static const int MAX_STEER_POINTS = 10; + float m_steerPoints[MAX_STEER_POINTS*3]; + int m_steerPointCount; + +public: + NavMeshTesterTool(); + ~NavMeshTesterTool(); + + virtual int type() { return TOOL_NAVMESH_TESTER; } + virtual void init(Sample* sample); + virtual void reset(); + virtual void handleMenu(); + virtual void handleClick(const float* s, const float* p, bool shift); + virtual void handleToggle(); + virtual void handleStep(); + virtual void handleUpdate(const float dt); + virtual void handleRender(); + virtual void handleRenderOverlay(double* proj, double* model, int* view); + + void recalc(); + void drawAgent(const float* pos, float r, float h, float c, const unsigned int col); +}; + +#endif // NAVMESHTESTERTOOL_H \ No newline at end of file diff --git a/dep/recastnavigation/RecastDemo/Include/OffMeshConnectionTool.h b/dep/recastnavigation/RecastDemo/Include/OffMeshConnectionTool.h new file mode 100644 index 000000000..1b5aefbf9 --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Include/OffMeshConnectionTool.h @@ -0,0 +1,50 @@ +// +// Copyright (c) 2009-2010 Mikko Mononen memon@inside.org +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. +// + +#ifndef OFFMESHCONNECTIONTOOL_H +#define OFFMESHCONNECTIONTOOL_H + +#include "Sample.h" + +// Tool to create off-mesh connection for InputGeom + +class OffMeshConnectionTool : public SampleTool +{ + Sample* m_sample; + float m_hitPos[3]; + bool m_hitPosSet; + bool m_bidir; + unsigned char m_oldFlags; + +public: + OffMeshConnectionTool(); + ~OffMeshConnectionTool(); + + virtual int type() { return TOOL_OFFMESH_CONNECTION; } + virtual void init(Sample* sample); + virtual void reset(); + virtual void handleMenu(); + virtual void handleClick(const float* s, const float* p, bool shift); + virtual void handleToggle(); + virtual void handleStep(); + virtual void handleUpdate(const float dt); + virtual void handleRender(); + virtual void handleRenderOverlay(double* proj, double* model, int* view); +}; + +#endif // OFFMESHCONNECTIONTOOL_H diff --git a/dep/recastnavigation/RecastDemo/Include/PerfTimer.h b/dep/recastnavigation/RecastDemo/Include/PerfTimer.h new file mode 100644 index 000000000..a5de026f5 --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Include/PerfTimer.h @@ -0,0 +1,32 @@ +// +// Copyright (c) 2009-2010 Mikko Mononen memon@inside.org +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. +// + +#ifndef PERFTIMER_H +#define PERFTIMER_H + +#ifdef __GNUC__ +#include +typedef int64_t TimeVal; +#else +typedef __int64 TimeVal; +#endif + +TimeVal getPerfTime(); +int getPerfDeltaTimeUsec(const TimeVal start, const TimeVal end); + +#endif // PERFTIMER_H \ No newline at end of file diff --git a/dep/recastnavigation/RecastDemo/Include/SDLMain.h b/dep/recastnavigation/RecastDemo/Include/SDLMain.h new file mode 100644 index 000000000..4683df57a --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Include/SDLMain.h @@ -0,0 +1,11 @@ +/* SDLMain.m - main entry point for our Cocoa-ized SDL app + Initial Version: Darrell Walisser + Non-NIB-Code & other changes: Max Horn + + Feel free to customize this file to suit your needs +*/ + +#import + +@interface SDLMain : NSObject +@end diff --git a/dep/recastnavigation/RecastDemo/Include/Sample.h b/dep/recastnavigation/RecastDemo/Include/Sample.h new file mode 100644 index 000000000..77fe0ba89 --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Include/Sample.h @@ -0,0 +1,144 @@ +// +// Copyright (c) 2009-2010 Mikko Mononen memon@inside.org +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. +// + +#ifndef RECASTSAMPLE_H +#define RECASTSAMPLE_H + +#include + +#include "Recast.h" +#include "SampleInterfaces.h" + + +// Tool types. +enum SampleToolType +{ + TOOL_NONE = 0, + TOOL_TILE_EDIT, + TOOL_TILE_HIGHLIGHT, + TOOL_NAVMESH_TESTER, + TOOL_OFFMESH_CONNECTION, + TOOL_CONVEX_VOLUME, + TOOL_CROWD, +}; + +// These are just sample areas to use consistent values across the samples. +// The use should specify these base on his needs. +enum SamplePolyAreas +{ + SAMPLE_POLYAREA_GROUND, + SAMPLE_POLYAREA_WATER, + SAMPLE_POLYAREA_ROAD, + SAMPLE_POLYAREA_DOOR, + SAMPLE_POLYAREA_GRASS, + SAMPLE_POLYAREA_JUMP, +}; +enum SamplePolyFlags +{ + SAMPLE_POLYFLAGS_WALK = 0x01, // Ability to walk (ground, grass, road) + SAMPLE_POLYFLAGS_SWIM = 0x02, // Ability to swim (water). + SAMPLE_POLYFLAGS_DOOR = 0x04, // Ability to move through doors. + SAMPLE_POLYFLAGS_JUMP = 0x08, // Ability to jump. + SAMPLE_POLYFLAGS_ALL = 0xffff // All abilities. +}; + +struct SampleTool +{ + virtual ~SampleTool() {} + virtual int type() = 0; + virtual void init(class Sample* sample) = 0; + virtual void reset() = 0; + virtual void handleMenu() = 0; + virtual void handleClick(const float* s, const float* p, bool shift) = 0; + virtual void handleRender() = 0; + virtual void handleRenderOverlay(double* proj, double* model, int* view) = 0; + virtual void handleToggle() = 0; + virtual void handleStep() = 0; + virtual void handleUpdate(const float dt) = 0; +}; + + +class Sample +{ +protected: + class InputGeom* m_geom; + class dtNavMesh* m_navMesh; + class dtNavMeshQuery* m_navQuery; + unsigned char m_navMeshDrawFlags; + + float m_cellSize; + float m_cellHeight; + float m_agentHeight; + float m_agentRadius; + float m_agentMaxClimb; + float m_agentMaxSlope; + float m_regionMinSize; + float m_regionMergeSize; + float m_edgeMaxLen; + float m_edgeMaxError; + float m_vertsPerPoly; + float m_detailSampleDist; + float m_detailSampleMaxError; + + SampleTool* m_tool; + + BuildContext* m_ctx; + + char m_meshName[128]; + +public: + Sample(); + virtual ~Sample(); + + void setContext(BuildContext* ctx) { m_ctx = ctx; } + + void setTool(SampleTool* tool); + + virtual void handleSettings(); + virtual void handleTools(); + virtual void handleDebugMode(); + virtual void handleClick(const float* s, const float* p, bool shift); + virtual void handleToggle(); + virtual void handleStep(); + virtual void handleRender(); + virtual void handleRenderOverlay(double* proj, double* model, int* view); + virtual void handleMeshChanged(class InputGeom* geom); + virtual bool handleBuild(); + virtual void handleUpdate(const float dt); + + virtual class InputGeom* getInputGeom() { return m_geom; } + virtual class dtNavMesh* getNavMesh() { return m_navMesh; } + virtual class dtNavMeshQuery* getNavMeshQuery() { return m_navQuery; } + virtual float getAgentRadius() { return m_agentRadius; } + virtual float getAgentHeight() { return m_agentHeight; } + virtual float getAgentClimb() { return m_agentMaxClimb; } + virtual const float* getBoundsMin(); + virtual const float* getBoundsMax(); + + inline unsigned char getNavMeshDrawFlags() const { return m_navMeshDrawFlags; } + inline void setNavMeshDrawFlags(unsigned char flags) { m_navMeshDrawFlags = flags; } + + void resetCommonSettings(); + void handleCommonSettings(); + + inline void setMeshName(char* meshName) { memcpy(m_meshName, meshName, 128*sizeof(char)); } + inline char* getMeshName() { return m_meshName; } +}; + + +#endif // RECASTSAMPLE_H diff --git a/dep/recastnavigation/RecastDemo/Include/SampleInterfaces.h b/dep/recastnavigation/RecastDemo/Include/SampleInterfaces.h new file mode 100644 index 000000000..bacbb2051 --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Include/SampleInterfaces.h @@ -0,0 +1,91 @@ +// +// Copyright (c) 2009-2010 Mikko Mononen memon@inside.org +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. +// + +#ifndef SAMPLEINTERFACES_H +#define SAMPLEINTERFACES_H + +#include "DebugDraw.h" +#include "Recast.h" +#include "RecastDump.h" +#include "PerfTimer.h" + +// These are example implementations of various interfaces used in Recast and Detour. + +// Recast build context. +class BuildContext : public rcContext +{ + TimeVal m_startTime[RC_MAX_TIMERS]; + int m_accTime[RC_MAX_TIMERS]; + + static const int MAX_MESSAGES = 1000; + const char* m_messages[MAX_MESSAGES]; + int m_messageCount; + static const int TEXT_POOL_SIZE = 8000; + char m_textPool[TEXT_POOL_SIZE]; + int m_textPoolSize; + +public: + BuildContext(); + virtual ~BuildContext(); + + // Dumps the log to stdout. + void dumpLog(const char* format, ...); + // Returns number of log messages. + int getLogCount() const; + // Returns log message text. + const char* getLogText(const int i) const; + +protected: + // Virtual functions for custom implementations. + virtual void doResetLog(); + virtual void doLog(const rcLogCategory /*category*/, const char* /*msg*/, const int /*len*/); + virtual void doResetTimers(); + virtual void doStartTimer(const rcTimerLabel /*label*/); + virtual void doStopTimer(const rcTimerLabel /*label*/); + virtual int doGetAccumulatedTime(const rcTimerLabel /*label*/) const; +}; + +// OpenGL debug draw implementation. +class DebugDrawGL : public duDebugDraw +{ +public: + virtual void depthMask(bool state); + virtual void begin(duDebugDrawPrimitives prim, float size = 1.0f); + virtual void vertex(const float* pos, unsigned int color); + virtual void vertex(const float x, const float y, const float z, unsigned int color); + virtual void end(); +}; + +// stdio file implementation. +class FileIO : public duFileIO +{ + FILE* m_fp; + int m_mode; +public: + FileIO(); + virtual ~FileIO(); + bool openForWrite(const char* path); + bool openForRead(const char* path); + virtual bool isWriting() const; + virtual bool isReading() const; + virtual bool write(const void* ptr, const size_t size); + virtual bool read(void* ptr, const size_t size); +}; + +#endif // SAMPLEINTERFACES_H + diff --git a/dep/recastnavigation/RecastDemo/Include/Sample_Debug.h b/dep/recastnavigation/RecastDemo/Include/Sample_Debug.h new file mode 100644 index 000000000..8dfacc9b9 --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Include/Sample_Debug.h @@ -0,0 +1,71 @@ +// +// Copyright (c) 2009-2010 Mikko Mononen memon@inside.org +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. +// + +#ifndef RECASTSAMPLEDEBUG_H +#define RECASTSAMPLEDEBUG_H + +#include "Sample_SoloMeshTiled.h" +#include "DetourNavMesh.h" +#include "Recast.h" + +// Sample used for random debugging. +class Sample_Debug : public Sample_SoloMeshTiled +{ +protected: + int m_hfCount; + rcHeightfield* m_hf; + + int m_chfCount; + rcCompactHeightfield* m_chf; + rcContourSet* m_cset; + + int m_csetCount; + + int m_pmeshCount; + rcPolyMesh* m_pmeshes; + + int m_dmeshCount; + rcPolyMeshDetail* m_dmeshes; + + float m_ext[3]; + float m_center[3]; + float m_bmin[3], m_bmax[3]; + dtPolyRef m_ref; + +public: + virtual void cleanup(); + Sample_Debug(); + virtual ~Sample_Debug(); + + virtual void handleSettings(); + virtual void handleTools(); + virtual void handleDebugMode(); + virtual void handleClick(const float* p, bool shift); + virtual void handleToggle(); + virtual void handleRender(); + virtual void handleRenderOverlay(double* proj, double* model, int* view); + virtual void handleMeshChanged(class InputGeom* geom); + virtual bool handleBuild(); + virtual void setHighlightedTile(const float* pos); + + virtual const float* getBoundsMin(); + virtual const float* getBoundsMax(); +}; + + +#endif // RECASTSAMPLE_H diff --git a/dep/recastnavigation/RecastDemo/Include/Sample_SoloMeshSimple.h b/dep/recastnavigation/RecastDemo/Include/Sample_SoloMeshSimple.h new file mode 100644 index 000000000..f9ce5d3e8 --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Include/Sample_SoloMeshSimple.h @@ -0,0 +1,81 @@ +// +// Copyright (c) 2009-2010 Mikko Mononen memon@inside.org +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. +// + +#ifndef RECASTSAMPLESOLOMESHSIMPLE_H +#define RECASTSAMPLESOLOMESHSIMPLE_H + +#include "Sample.h" +#include "DetourNavMesh.h" +#include "Recast.h" + +class Sample_SoloMeshSimple : public Sample +{ +protected: + bool m_keepInterResults; + float m_totalBuildTimeMs; + + unsigned char* m_triareas; + rcHeightfield* m_solid; + rcCompactHeightfield* m_chf; + rcContourSet* m_cset; + rcPolyMesh* m_pmesh; + rcConfig m_cfg; + rcPolyMeshDetail* m_dmesh; + + enum DrawMode + { + DRAWMODE_NAVMESH, + DRAWMODE_NAVMESH_TRANS, + DRAWMODE_NAVMESH_BVTREE, + DRAWMODE_NAVMESH_NODES, + DRAWMODE_NAVMESH_INVIS, + DRAWMODE_MESH, + DRAWMODE_VOXELS, + DRAWMODE_VOXELS_WALKABLE, + DRAWMODE_COMPACT, + DRAWMODE_COMPACT_DISTANCE, + DRAWMODE_COMPACT_REGIONS, + DRAWMODE_REGION_CONNECTIONS, + DRAWMODE_RAW_CONTOURS, + DRAWMODE_BOTH_CONTOURS, + DRAWMODE_CONTOURS, + DRAWMODE_POLYMESH, + DRAWMODE_POLYMESH_DETAIL, + MAX_DRAWMODE + }; + + DrawMode m_drawMode; + + void cleanup(); + +public: + Sample_SoloMeshSimple(); + virtual ~Sample_SoloMeshSimple(); + + virtual void handleSettings(); + virtual void handleTools(); + virtual void handleDebugMode(); + + virtual void handleRender(); + virtual void handleRenderOverlay(double* proj, double* model, int* view); + virtual void handleMeshChanged(class InputGeom* geom); + virtual bool handleBuild(); +}; + + +#endif // RECASTSAMPLESOLOMESHSIMPLE_H diff --git a/dep/recastnavigation/RecastDemo/Include/Sample_SoloMeshTiled.h b/dep/recastnavigation/RecastDemo/Include/Sample_SoloMeshTiled.h new file mode 100644 index 000000000..95d4f0a38 --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Include/Sample_SoloMeshTiled.h @@ -0,0 +1,124 @@ +// +// Copyright (c) 2009-2010 Mikko Mononen memon@inside.org +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. +// + +#ifndef RECASTSAMPLESOLOMESHTILED_H +#define RECASTSAMPLESOLOMESHTILED_H + +#include "Sample.h" +#include "DetourNavMesh.h" +#include "Recast.h" +#include "ChunkyTriMesh.h" + +class Sample_SoloMeshTiled : public Sample +{ +protected: + struct Tile + { + inline Tile() : chf(0), solid(0), cset(0), pmesh(0), dmesh(0), buildTime(0) {} + inline ~Tile() + { + rcFreeCompactHeightfield(chf); + rcFreeContourSet(cset); + rcFreeHeightField(solid); + rcFreePolyMesh(pmesh); + rcFreePolyMeshDetail(dmesh); + } + int x, y; + rcCompactHeightfield* chf; + rcHeightfield* solid; + rcContourSet* cset; + rcPolyMesh* pmesh; + rcPolyMeshDetail* dmesh; + int buildTime; + }; + + struct TileSet + { + inline TileSet() : width(0), height(0), tiles(0) {} + inline ~TileSet() { delete [] tiles; } + int width, height; + float bmin[3], bmax[3]; + float cs, ch; + Tile* tiles; + }; + + bool m_measurePerTileTimings; + bool m_keepInterResults; + float m_tileSize; + float m_totalBuildTimeMs; + + rcPolyMesh* m_pmesh; + rcPolyMeshDetail* m_dmesh; + rcConfig m_cfg; + TileSet* m_tileSet; + + static const int MAX_STAT_BUCKETS = 1000; + int m_statPolysPerTile[MAX_STAT_BUCKETS]; + int m_statPolysPerTileSamples; + int m_statTimePerTile[MAX_STAT_BUCKETS]; + int m_statTimePerTileSamples; + + int m_highLightedTileX, m_highLightedTileY; + + enum DrawMode + { + DRAWMODE_NAVMESH, + DRAWMODE_NAVMESH_TRANS, + DRAWMODE_NAVMESH_BVTREE, + DRAWMODE_NAVMESH_NODES, + DRAWMODE_NAVMESH_INVIS, + DRAWMODE_MESH, + DRAWMODE_VOXELS, + DRAWMODE_VOXELS_WALKABLE, + DRAWMODE_COMPACT, + DRAWMODE_COMPACT_DISTANCE, + DRAWMODE_COMPACT_REGIONS, + DRAWMODE_REGION_CONNECTIONS, + DRAWMODE_RAW_CONTOURS, + DRAWMODE_BOTH_CONTOURS, + DRAWMODE_CONTOURS, + DRAWMODE_POLYMESH, + DRAWMODE_POLYMESH_DETAIL, + MAX_DRAWMODE + }; + + DrawMode m_drawMode; + + void cleanup(); + bool canDrawTile(int x, int y); + +public: + Sample_SoloMeshTiled(); + virtual ~Sample_SoloMeshTiled(); + + virtual void handleSettings(); + virtual void handleTools(); + virtual void handleDebugMode(); + + virtual void handleRender(); + virtual void handleRenderOverlay(double* proj, double* model, int* view); + virtual void handleMeshChanged(class InputGeom* geom); + virtual bool handleBuild(); + + void setHighlightedTile(const float* pos); + inline int getHilightedTileX() const { return m_highLightedTileX; } + inline int getHilightedTileY() const { return m_highLightedTileY; } +}; + + +#endif // RECASTSAMPLESOLOMESHTILED_H diff --git a/dep/recastnavigation/RecastDemo/Include/Sample_TileMesh.h b/dep/recastnavigation/RecastDemo/Include/Sample_TileMesh.h new file mode 100644 index 000000000..c010d2a27 --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Include/Sample_TileMesh.h @@ -0,0 +1,107 @@ +// +// Copyright (c) 2009-2010 Mikko Mononen memon@inside.org +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. +// + +#ifndef RECASTSAMPLETILEMESH_H +#define RECASTSAMPLETILEMESH_H + +#include "Sample.h" +#include "DetourNavMesh.h" +#include "Recast.h" +#include "ChunkyTriMesh.h" + +class Sample_TileMesh : public Sample +{ +protected: + bool m_keepInterResults; + bool m_buildAll; + float m_totalBuildTimeMs; + bool m_drawPortals; + + unsigned char* m_triareas; + rcHeightfield* m_solid; + rcCompactHeightfield* m_chf; + rcContourSet* m_cset; + rcPolyMesh* m_pmesh; + rcPolyMeshDetail* m_dmesh; + rcConfig m_cfg; + + enum DrawMode + { + DRAWMODE_NAVMESH, + DRAWMODE_NAVMESH_TRANS, + DRAWMODE_NAVMESH_BVTREE, + DRAWMODE_NAVMESH_NODES, + DRAWMODE_NAVMESH_PORTALS, + DRAWMODE_NAVMESH_INVIS, + DRAWMODE_MESH, + DRAWMODE_VOXELS, + DRAWMODE_VOXELS_WALKABLE, + DRAWMODE_COMPACT, + DRAWMODE_COMPACT_DISTANCE, + DRAWMODE_COMPACT_REGIONS, + DRAWMODE_REGION_CONNECTIONS, + DRAWMODE_RAW_CONTOURS, + DRAWMODE_BOTH_CONTOURS, + DRAWMODE_CONTOURS, + DRAWMODE_POLYMESH, + DRAWMODE_POLYMESH_DETAIL, + MAX_DRAWMODE + }; + + DrawMode m_drawMode; + + int m_maxTiles; + int m_maxPolysPerTile; + float m_tileSize; + + unsigned int m_tileCol; + float m_tileBmin[3]; + float m_tileBmax[3]; + float m_tileBuildTime; + float m_tileMemUsage; + int m_tileTriCount; + + unsigned char* buildTileMesh(const int tx, const int ty, const float* bmin, const float* bmax, int& dataSize); + + void cleanup(); + + void saveAll(const char* path, const dtNavMesh* mesh); + dtNavMesh* loadAll(const char* path); + +public: + Sample_TileMesh(); + virtual ~Sample_TileMesh(); + + virtual void handleSettings(); + virtual void handleTools(); + virtual void handleDebugMode(); + virtual void handleRender(); + virtual void handleRenderOverlay(double* proj, double* model, int* view); + virtual void handleMeshChanged(class InputGeom* geom); + virtual bool handleBuild(); + + void getTilePos(const float* pos, int& tx, int& ty); + + void buildTile(const float* pos); + void removeTile(const float* pos); + void buildAllTiles(); + void removeAllTiles(); +}; + + +#endif // RECASTSAMPLETILEMESH_H diff --git a/dep/recastnavigation/RecastDemo/Include/SlideShow.h b/dep/recastnavigation/RecastDemo/Include/SlideShow.h new file mode 100644 index 000000000..c2f5d16d6 --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Include/SlideShow.h @@ -0,0 +1,53 @@ +// +// Copyright (c) 2009-2010 Mikko Mononen memon@inside.org +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. +// + +#ifndef SLIDESHOW_H +#define SLIDESHOW_H + +#include "Filelist.h" + +class SlideShow +{ + FileList m_files; + char m_path[256]; + + int m_width; + int m_height; + unsigned int m_texId; + + void purgeImage(); + bool loadImage(const char* path); + + bool m_showSlides; + bool m_showCurSlide; + float m_slideAlpha; + int m_curSlide; + int m_nextSlide; + +public: + SlideShow(); + ~SlideShow(); + + bool init(const char* path); + void nextSlide(); + void prevSlide(); + void setSlide(int n); + void updateAndDraw(float dt, const float w, const float h); +}; + +#endif // SLIDESHOW_H diff --git a/dep/recastnavigation/RecastDemo/Include/TestCase.h b/dep/recastnavigation/RecastDemo/Include/TestCase.h new file mode 100644 index 000000000..19d1b915e --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Include/TestCase.h @@ -0,0 +1,79 @@ +// +// Copyright (c) 2009-2010 Mikko Mononen memon@inside.org +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. +// + +#ifndef TESTCASE_H +#define TESTCASE_H + +#include "DetourNavMesh.h" + +class TestCase +{ + enum TestType + { + TEST_PATHFIND, + }; + + struct Test + { + Test() : straight(0), nstraight(0), polys(0), npolys(0) {}; + ~Test() + { + delete [] straight; + delete [] polys; + } + + TestType type; + float spos[3], epos[3]; + float radius; + int includeFlags, excludeFlags; + bool expand; + + float* straight; + int nstraight; + dtPolyRef* polys; + int npolys; + + int findNearestPolyTime; + int findPathTime; + int findStraightPathTime; + + Test* next; + }; + + char m_sampleName[256]; + char m_geomFileName[256]; + Test* m_tests; + + void resetTimes(); + +public: + TestCase(); + ~TestCase(); + + bool load(const char* filePath); + + inline const char* getSampleName() const { return m_sampleName; } + inline const char* getGeomFileName() const { return m_geomFileName; } + + void doTests(class dtNavMesh* navmesh, class dtNavMeshQuery* navquery); + + void handleRender(); + bool handleRenderOverlay(double* proj, double* model, int* view); +}; + +#endif // TESTCASE_H \ No newline at end of file diff --git a/dep/recastnavigation/RecastDemo/Include/ValueHistory.h b/dep/recastnavigation/RecastDemo/Include/ValueHistory.h new file mode 100644 index 000000000..4a37ed9c2 --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Include/ValueHistory.h @@ -0,0 +1,51 @@ +#ifndef VALUEHISTORY_H +#define VALUEHISTORY_H + +class ValueHistory +{ + static const int MAX_HISTORY = 256; + float m_samples[MAX_HISTORY]; + int m_hsamples; +public: + ValueHistory(); + ~ValueHistory(); + + inline void addSample(const float val) + { + m_hsamples = (m_hsamples+MAX_HISTORY-1) % MAX_HISTORY; + m_samples[m_hsamples] = val; + } + + inline int getSampleCount() const + { + return MAX_HISTORY; + } + + inline float getSample(const int i) const + { + return m_samples[(m_hsamples+i) % MAX_HISTORY]; + } + + float getSampleMin() const; + float getSampleMax() const; + float getAverage() const; +}; + +struct GraphParams +{ + void setRect(int ix, int iy, int iw, int ih, int ipad); + void setValueRange(float ivmin, float ivmax, int indiv, const char* iunits); + + int x, y, w, h, pad; + float vmin, vmax; + int ndiv; + char units[16]; +}; + +void drawGraphBackground(const GraphParams* p); + +void drawGraph(const GraphParams* p, const ValueHistory* graph, + int idx, const char* label, const unsigned int col); + + +#endif // VALUEHISTORY_H \ No newline at end of file diff --git a/dep/recastnavigation/RecastDemo/Include/imgui.h b/dep/recastnavigation/RecastDemo/Include/imgui.h new file mode 100644 index 000000000..325829b3d --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Include/imgui.h @@ -0,0 +1,108 @@ +// +// Copyright (c) 2009-2010 Mikko Mononen memon@inside.org +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. +// + +#ifndef IMGUI_H +#define IMGUI_H + +enum imguiMouseButton +{ + IMGUI_MBUT_LEFT = 0x01, + IMGUI_MBUT_RIGHT = 0x02, +}; + +enum imguiTextAlign +{ + IMGUI_ALIGN_LEFT, + IMGUI_ALIGN_CENTER, + IMGUI_ALIGN_RIGHT, +}; + +inline unsigned int imguiRGBA(unsigned char r, unsigned char g, unsigned char b, unsigned char a=255) +{ + return (r) | (g << 8) | (b << 16) | (a << 24); +} + +void imguiBeginFrame(int mx, int my, unsigned char mbut, int scroll); +void imguiEndFrame(); + +bool imguiBeginScrollArea(const char* name, int x, int y, int w, int h, int* scroll); +void imguiEndScrollArea(); + +void imguiIndent(); +void imguiUnindent(); +void imguiSeparator(); +void imguiSeparatorLine(); + +bool imguiButton(const char* text, bool enabled = true); +bool imguiItem(const char* text, bool enabled = true); +bool imguiCheck(const char* text, bool checked, bool enabled = true); +bool imguiCollapse(const char* text, const char* subtext, bool checked, bool enabled = true); +void imguiLabel(const char* text); +void imguiValue(const char* text); +bool imguiSlider(const char* text, float* val, float vmin, float vmax, float vinc, bool enabled = true); + +void imguiDrawText(int x, int y, int align, const char* text, unsigned int color); +void imguiDrawLine(float x0, float y0, float x1, float y1, float r, unsigned int color); +void imguiDrawRoundedRect(float x, float y, float w, float h, float r, unsigned int color); +void imguiDrawRect(float x, float y, float w, float h, unsigned int color); + +// Pull render interface. +enum imguiGfxCmdType +{ + IMGUI_GFXCMD_RECT, + IMGUI_GFXCMD_TRIANGLE, + IMGUI_GFXCMD_LINE, + IMGUI_GFXCMD_TEXT, + IMGUI_GFXCMD_SCISSOR, +}; + +struct imguiGfxRect +{ + short x,y,w,h,r; +}; + +struct imguiGfxText +{ + short x,y,align; + const char* text; +}; + +struct imguiGfxLine +{ + short x0,y0,x1,y1,r; +}; + +struct imguiGfxCmd +{ + char type; + char flags; + char pad[2]; + unsigned int col; + union + { + imguiGfxLine line; + imguiGfxRect rect; + imguiGfxText text; + }; +}; + +const imguiGfxCmd* imguiGetRenderQueue(); +int imguiGetRenderQueueSize(); + + +#endif // IMGUI_H diff --git a/dep/recastnavigation/RecastDemo/Include/imguiRenderGL.h b/dep/recastnavigation/RecastDemo/Include/imguiRenderGL.h new file mode 100644 index 000000000..b14834169 --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Include/imguiRenderGL.h @@ -0,0 +1,26 @@ +// +// Copyright (c) 2009-2010 Mikko Mononen memon@inside.org +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. +// + +#ifndef IMGUI_RENDER_GL_H +#define IMGUI_RENDER_GL_H + +bool imguiRenderGLInit(const char* fontpath); +void imguiRenderGLDestroy(); +void imguiRenderGLDraw(); + +#endif // IMGUI_RENDER_GL_H \ No newline at end of file diff --git a/dep/recastnavigation/RecastDemo/Source/ChunkyTriMesh.cpp b/dep/recastnavigation/RecastDemo/Source/ChunkyTriMesh.cpp new file mode 100644 index 000000000..47e877875 --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Source/ChunkyTriMesh.cpp @@ -0,0 +1,315 @@ +// +// Copyright (c) 2009-2010 Mikko Mononen memon@inside.org +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. +// + +#include "ChunkyTriMesh.h" +#include +#include +#include + +struct BoundsItem +{ + float bmin[2]; + float bmax[2]; + int i; +}; + +static int compareItemX(const void* va, const void* vb) +{ + const BoundsItem* a = (const BoundsItem*)va; + const BoundsItem* b = (const BoundsItem*)vb; + if (a->bmin[0] < b->bmin[0]) + return -1; + if (a->bmin[0] > b->bmin[0]) + return 1; + return 0; +} + +static int compareItemY(const void* va, const void* vb) +{ + const BoundsItem* a = (const BoundsItem*)va; + const BoundsItem* b = (const BoundsItem*)vb; + if (a->bmin[1] < b->bmin[1]) + return -1; + if (a->bmin[1] > b->bmin[1]) + return 1; + return 0; +} + +static void calcExtends(const BoundsItem* items, const int /*nitems*/, + const int imin, const int imax, + float* bmin, float* bmax) +{ + bmin[0] = items[imin].bmin[0]; + bmin[1] = items[imin].bmin[1]; + + bmax[0] = items[imin].bmax[0]; + bmax[1] = items[imin].bmax[1]; + + for (int i = imin+1; i < imax; ++i) + { + const BoundsItem& it = items[i]; + if (it.bmin[0] < bmin[0]) bmin[0] = it.bmin[0]; + if (it.bmin[1] < bmin[1]) bmin[1] = it.bmin[1]; + + if (it.bmax[0] > bmax[0]) bmax[0] = it.bmax[0]; + if (it.bmax[1] > bmax[1]) bmax[1] = it.bmax[1]; + } +} + +inline int longestAxis(float x, float y) +{ + return y > x ? 1 : 0; +} + +static void subdivide(BoundsItem* items, int nitems, int imin, int imax, int trisPerChunk, + int& curNode, rcChunkyTriMeshNode* nodes, const int maxNodes, + int& curTri, int* outTris, const int* inTris) +{ + int inum = imax - imin; + int icur = curNode; + + if (curNode > maxNodes) + return; + + rcChunkyTriMeshNode& node = nodes[curNode++]; + + if (inum <= trisPerChunk) + { + // Leaf + calcExtends(items, nitems, imin, imax, node.bmin, node.bmax); + + // Copy triangles. + node.i = curTri; + node.n = inum; + + for (int i = imin; i < imax; ++i) + { + const int* src = &inTris[items[i].i*3]; + int* dst = &outTris[curTri*3]; + curTri++; + dst[0] = src[0]; + dst[1] = src[1]; + dst[2] = src[2]; + } + } + else + { + // Split + calcExtends(items, nitems, imin, imax, node.bmin, node.bmax); + + int axis = longestAxis(node.bmax[0] - node.bmin[0], + node.bmax[1] - node.bmin[1]); + + if (axis == 0) + { + // Sort along x-axis + qsort(items+imin, inum, sizeof(BoundsItem), compareItemX); + } + else if (axis == 1) + { + // Sort along y-axis + qsort(items+imin, inum, sizeof(BoundsItem), compareItemY); + } + + int isplit = imin+inum/2; + + // Left + subdivide(items, nitems, imin, isplit, trisPerChunk, curNode, nodes, maxNodes, curTri, outTris, inTris); + // Right + subdivide(items, nitems, isplit, imax, trisPerChunk, curNode, nodes, maxNodes, curTri, outTris, inTris); + + int iescape = curNode - icur; + // Negative index means escape. + node.i = -iescape; + } +} + +bool rcCreateChunkyTriMesh(const float* verts, const int* tris, int ntris, + int trisPerChunk, rcChunkyTriMesh* cm) +{ + int nchunks = (ntris + trisPerChunk-1) / trisPerChunk; + + cm->nodes = new rcChunkyTriMeshNode[nchunks*4]; + if (!cm->nodes) + return false; + + cm->tris = new int[ntris*3]; + if (!cm->tris) + return false; + + cm->ntris = ntris; + + // Build tree + BoundsItem* items = new BoundsItem[ntris]; + if (!items) + return false; + + for (int i = 0; i < ntris; i++) + { + const int* t = &tris[i*3]; + BoundsItem& it = items[i]; + it.i = i; + // Calc triangle XZ bounds. + it.bmin[0] = it.bmax[0] = verts[t[0]*3+0]; + it.bmin[1] = it.bmax[1] = verts[t[0]*3+2]; + for (int j = 1; j < 3; ++j) + { + const float* v = &verts[t[j]*3]; + if (v[0] < it.bmin[0]) it.bmin[0] = v[0]; + if (v[2] < it.bmin[1]) it.bmin[1] = v[2]; + + if (v[0] > it.bmax[0]) it.bmax[0] = v[0]; + if (v[2] > it.bmax[1]) it.bmax[1] = v[2]; + } + } + + int curTri = 0; + int curNode = 0; + subdivide(items, ntris, 0, ntris, trisPerChunk, curNode, cm->nodes, nchunks*4, curTri, cm->tris, tris); + + delete [] items; + + cm->nnodes = curNode; + + // Calc max tris per node. + cm->maxTrisPerChunk = 0; + for (int i = 0; i < cm->nnodes; ++i) + { + rcChunkyTriMeshNode& node = cm->nodes[i]; + const bool isLeaf = node.i >= 0; + if (!isLeaf) continue; + if (node.n > cm->maxTrisPerChunk) + cm->maxTrisPerChunk = node.n; + } + + return true; +} + + +inline bool checkOverlapRect(const float amin[2], const float amax[2], + const float bmin[2], const float bmax[2]) +{ + bool overlap = true; + overlap = (amin[0] > bmax[0] || amax[0] < bmin[0]) ? false : overlap; + overlap = (amin[1] > bmax[1] || amax[1] < bmin[1]) ? false : overlap; + return overlap; +} + +int rcGetChunksOverlappingRect(const rcChunkyTriMesh* cm, + float bmin[2], float bmax[2], + int* ids, const int maxIds) +{ + // Traverse tree + int i = 0; + int n = 0; + while (i < cm->nnodes) + { + const rcChunkyTriMeshNode* node = &cm->nodes[i]; + const bool overlap = checkOverlapRect(bmin, bmax, node->bmin, node->bmax); + const bool isLeafNode = node->i >= 0; + + if (isLeafNode && overlap) + { + if (n < maxIds) + { + ids[n] = i; + n++; + } + } + + if (overlap || isLeafNode) + i++; + else + { + const int escapeIndex = -node->i; + i += escapeIndex; + } + } + + return n; +} + + + +static bool checkOverlapSegment(const float p[2], const float q[2], + const float bmin[2], const float bmax[2]) +{ + static const float EPSILON = 1e-6f; + + float tmin = 0; + float tmax = 1; + float d[2]; + d[0] = q[0] - p[0]; + d[1] = q[1] - p[1]; + + for (int i = 0; i < 2; i++) + { + if (fabsf(d[i]) < EPSILON) + { + // Ray is parallel to slab. No hit if origin not within slab + if (p[i] < bmin[i] || p[i] > bmax[i]) + return false; + } + else + { + // Compute intersection t value of ray with near and far plane of slab + float ood = 1.0f / d[i]; + float t1 = (bmin[i] - p[i]) * ood; + float t2 = (bmax[i] - p[i]) * ood; + if (t1 > t2) { float tmp = t1; t1 = t2; t2 = tmp; } + if (t1 > tmin) tmin = t1; + if (t2 < tmax) tmax = t2; + if (tmin > tmax) return false; + } + } + return true; +} + +int rcGetChunksOverlappingSegment(const rcChunkyTriMesh* cm, + float p[2], float q[2], + int* ids, const int maxIds) +{ + // Traverse tree + int i = 0; + int n = 0; + while (i < cm->nnodes) + { + const rcChunkyTriMeshNode* node = &cm->nodes[i]; + const bool overlap = checkOverlapSegment(p, q, node->bmin, node->bmax); + const bool isLeafNode = node->i >= 0; + + if (isLeafNode && overlap) + { + if (n < maxIds) + { + ids[n] = i; + n++; + } + } + + if (overlap || isLeafNode) + i++; + else + { + const int escapeIndex = -node->i; + i += escapeIndex; + } + } + + return n; +} diff --git a/dep/recastnavigation/RecastDemo/Source/ConvexVolumeTool.cpp b/dep/recastnavigation/RecastDemo/Source/ConvexVolumeTool.cpp new file mode 100644 index 000000000..00c9e0997 --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Source/ConvexVolumeTool.cpp @@ -0,0 +1,283 @@ +// +// Copyright (c) 2009-2010 Mikko Mononen memon@inside.org +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. +// + +#define _USE_MATH_DEFINES +#include +#include +#include +#include +#include "SDL.h" +#include "SDL_opengl.h" +#include "imgui.h" +#include "ConvexVolumeTool.h" +#include "InputGeom.h" +#include "Sample.h" +#include "Recast.h" +#include "RecastDebugDraw.h" +#include "DetourDebugDraw.h" + +#ifdef WIN32 +# define snprintf _snprintf +#endif + +// Quick and dirty convex hull. + +// Returns true if 'c' is left of line 'a'-'b'. +inline bool left(const float* a, const float* b, const float* c) +{ + const float u1 = b[0] - a[0]; + const float v1 = b[2] - a[2]; + const float u2 = c[0] - a[0]; + const float v2 = c[2] - a[2]; + return u1 * v2 - v1 * u2 < 0; +} + +// Returns true if 'a' is more lower-left than 'b'. +inline bool cmppt(const float* a, const float* b) +{ + if (a[0] < b[0]) return true; + if (a[0] > b[0]) return false; + if (a[2] < b[2]) return true; + if (a[2] > b[2]) return false; + return false; +} +// Calculates convex hull on xz-plane of points on 'pts', +// stores the indices of the resulting hull in 'out' and +// returns number of points on hull. +static int convexhull(const float* pts, int npts, int* out) +{ + // Find lower-leftmost point. + int hull = 0; + for (int i = 1; i < npts; ++i) + if (cmppt(&pts[i*3], &pts[hull*3])) + hull = i; + // Gift wrap hull. + int endpt = 0; + int i = 0; + do + { + out[i++] = hull; + endpt = 0; + for (int j = 1; j < npts; ++j) + if (hull == endpt || left(&pts[hull*3], &pts[endpt*3], &pts[j*3])) + endpt = j; + hull = endpt; + } + while (endpt != out[0]); + + return i; +} + +static int pointInPoly(int nvert, const float* verts, const float* p) +{ + int i, j, c = 0; + for (i = 0, j = nvert-1; i < nvert; j = i++) + { + const float* vi = &verts[i*3]; + const float* vj = &verts[j*3]; + if (((vi[2] > p[2]) != (vj[2] > p[2])) && + (p[0] < (vj[0]-vi[0]) * (p[2]-vi[2]) / (vj[2]-vi[2]) + vi[0]) ) + c = !c; + } + return c; +} + + +ConvexVolumeTool::ConvexVolumeTool() : + m_sample(0), + m_areaType(SAMPLE_POLYAREA_GRASS), + m_boxHeight(6.0f), + m_boxDescent(1.0f), + m_npts(0), + m_nhull(0) +{ +} + +ConvexVolumeTool::~ConvexVolumeTool() +{ +} + +void ConvexVolumeTool::init(Sample* sample) +{ + m_sample = sample; +} + +void ConvexVolumeTool::reset() +{ + m_npts = 0; + m_nhull = 0; +} + +void ConvexVolumeTool::handleMenu() +{ + imguiSlider("Shape Height", &m_boxHeight, 0.1f, 20.0f, 0.1f); + imguiSlider("Shape Descent", &m_boxDescent, 0.1f, 20.0f, 0.1f); + + imguiSeparator(); + + imguiLabel("Area Type"); + imguiIndent(); + if (imguiCheck("Grass", m_areaType == SAMPLE_POLYAREA_GRASS)) + m_areaType = SAMPLE_POLYAREA_GRASS; + if (imguiCheck("Road", m_areaType == SAMPLE_POLYAREA_ROAD)) + m_areaType = SAMPLE_POLYAREA_ROAD; + if (imguiCheck("Water", m_areaType == SAMPLE_POLYAREA_WATER)) + m_areaType = SAMPLE_POLYAREA_WATER; + if (imguiCheck("Door", m_areaType == SAMPLE_POLYAREA_DOOR)) + m_areaType = SAMPLE_POLYAREA_DOOR; + imguiUnindent(); + + imguiSeparator(); + + if (imguiButton("Clear Shape")) + { + m_npts = 0; + m_nhull = 0; + } + + imguiSeparator(); + + imguiValue("Click to create points."); + imguiValue("The shape is convex hull"); + imguiValue("of all the create points."); + imguiValue("Click on highlited point"); + imguiValue("to finish the shape."); + + imguiSeparator(); +} + +void ConvexVolumeTool::handleClick(const float* /*s*/, const float* p, bool shift) +{ + if (!m_sample) return; + InputGeom* geom = m_sample->getInputGeom(); + if (!geom) return; + + if (shift) + { + // Delete + int nearestIndex = -1; + const ConvexVolume* vols = geom->getConvexVolumes(); + for (int i = 0; i < geom->getConvexVolumeCount(); ++i) + { + if (pointInPoly(vols[i].nverts, vols[i].verts, p) && + p[1] >= vols[i].hmin && p[1] <= vols[i].hmax) + { + nearestIndex = i; + } + } + // If end point close enough, delete it. + if (nearestIndex != -1) + { + geom->deleteConvexVolume(nearestIndex); + } + } + else + { + // Create + + // If clicked on that last pt, create the shape. + if (m_npts && rcVdistSqr(p, &m_pts[(m_npts-1)*3]) < rcSqr(0.2f)) + { + if (m_nhull > 2) + { + // Create shape. + float verts[MAX_PTS*3]; + for (int i = 0; i < m_nhull; ++i) + rcVcopy(&verts[i*3], &m_pts[m_hull[i]*3]); + + float minh = FLT_MAX, maxh = 0; + for (int i = 0; i < m_nhull; ++i) + minh = rcMin(minh, verts[i*3+1]); + minh -= m_boxDescent; + maxh = minh + m_boxHeight; + + geom->addConvexVolume(verts, m_nhull, minh, maxh, (unsigned char)m_areaType); + } + + m_npts = 0; + m_nhull = 0; + } + else + { + // Add new point + if (m_npts < MAX_PTS) + { + rcVcopy(&m_pts[m_npts*3], p); + m_npts++; + // Update hull. + if (m_npts > 1) + m_nhull = convexhull(m_pts, m_npts, m_hull); + else + m_nhull = 0; + } + } + } + +} + +void ConvexVolumeTool::handleToggle() +{ +} + +void ConvexVolumeTool::handleStep() +{ +} + +void ConvexVolumeTool::handleUpdate(const float /*dt*/) +{ +} + +void ConvexVolumeTool::handleRender() +{ + DebugDrawGL dd; + + // Find height extents of the shape. + float minh = FLT_MAX, maxh = 0; + for (int i = 0; i < m_npts; ++i) + minh = rcMin(minh, m_pts[i*3+1]); + minh -= m_boxDescent; + maxh = minh + m_boxHeight; + + dd.begin(DU_DRAW_POINTS, 4.0f); + for (int i = 0; i < m_npts; ++i) + { + unsigned int col = duRGBA(255,255,255,255); + if (i == m_npts-1) + col = duRGBA(240,32,16,255); + dd.vertex(m_pts[i*3+0],m_pts[i*3+1]+0.1f,m_pts[i*3+2], col); + } + dd.end(); + + dd.begin(DU_DRAW_LINES, 2.0f); + for (int i = 0, j = m_nhull-1; i < m_nhull; j = i++) + { + const float* vi = &m_pts[m_hull[j]*3]; + const float* vj = &m_pts[m_hull[i]*3]; + dd.vertex(vj[0],minh,vj[2], duRGBA(255,255,255,64)); + dd.vertex(vi[0],minh,vi[2], duRGBA(255,255,255,64)); + dd.vertex(vj[0],maxh,vj[2], duRGBA(255,255,255,64)); + dd.vertex(vi[0],maxh,vi[2], duRGBA(255,255,255,64)); + dd.vertex(vj[0],minh,vj[2], duRGBA(255,255,255,64)); + dd.vertex(vj[0],maxh,vj[2], duRGBA(255,255,255,64)); + } + dd.end(); +} + +void ConvexVolumeTool::handleRenderOverlay(double* /*proj*/, double* /*model*/, int* /*view*/) +{ +} diff --git a/dep/recastnavigation/RecastDemo/Source/CrowdManager.cpp b/dep/recastnavigation/RecastDemo/Source/CrowdManager.cpp new file mode 100644 index 000000000..9211d675c --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Source/CrowdManager.cpp @@ -0,0 +1,1593 @@ +// +// Copyright (c) 2009-2010 Mikko Mononen memon@inside.org +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. +// + +#define _USE_MATH_DEFINES +#include +#include +#include +#include +#include +#include "DetourNavMesh.h" +#include "DetourNavMeshQuery.h" +#include "DetourObstacleAvoidance.h" +#include "DetourCommon.h" +#include "CrowdManager.h" +#include "SampleInterfaces.h" // For timer +#include "DetourAssert.h" +#include "DetourAlloc.h" + +static const int VO_ADAPTIVE_DIVS = 7; +static const int VO_ADAPTIVE_RINGS = 2; +static const int VO_ADAPTIVE_DEPTH = 5; + +static const int VO_GRID_SIZE = 33; + + +inline int hashPos2(int x, int y, int n) +{ + return ((x*73856093) ^ (y*19349663)) & (n-1); +} + +ProximityGrid::ProximityGrid() : + m_maxItems(0), + m_cellSize(0), + m_pool(0), + m_poolHead(0), + m_poolSize(0), + m_buckets(0), + m_bucketsSize(0) +{ +} + +ProximityGrid::~ProximityGrid() +{ + dtFree(m_buckets); + dtFree(m_pool); +} + +bool ProximityGrid::init(const int maxItems, const float cellSize) +{ + dtAssert(maxItems > 0); + dtAssert(cellSize > 0.0f); + + m_cellSize = cellSize; + m_invCellSize = 1.0f / m_cellSize; + + // Allocate hashs buckets + m_bucketsSize = dtNextPow2(maxItems); + m_buckets = (unsigned short*)dtAlloc(sizeof(unsigned short)*m_bucketsSize, DT_ALLOC_PERM); + if (!m_buckets) + return false; + + // Allocate pool of items. + m_poolSize = maxItems*4; + m_poolHead = 0; + m_pool = (Item*)dtAlloc(sizeof(Item)*m_poolSize, DT_ALLOC_PERM); + if (!m_pool) + return false; + + clear(); + + return true; +} + +void ProximityGrid::clear() +{ + memset(m_buckets, 0xff, sizeof(unsigned short)*m_bucketsSize); + m_poolHead = 0; + m_bounds[0] = 0xffff; + m_bounds[1] = 0xffff; + m_bounds[2] = -0xffff; + m_bounds[3] = -0xffff; +} + +void ProximityGrid::addItem(const unsigned short id, + const float minx, const float miny, + const float maxx, const float maxy) +{ + const int iminx = (int)floorf(minx * m_invCellSize); + const int iminy = (int)floorf(miny * m_invCellSize); + const int imaxx = (int)floorf(maxx * m_invCellSize); + const int imaxy = (int)floorf(maxy * m_invCellSize); + + m_bounds[0] = dtMin(m_bounds[0], iminx); + m_bounds[1] = dtMin(m_bounds[1], iminy); + m_bounds[2] = dtMax(m_bounds[2], imaxx); + m_bounds[3] = dtMax(m_bounds[3], imaxy); + + for (int y = iminy; y <= imaxy; ++y) + { + for (int x = iminx; x <= imaxx; ++x) + { + if (m_poolHead < m_poolSize) + { + const int h = hashPos2(x, y, m_bucketsSize); + const unsigned short idx = (unsigned short)m_poolHead; + m_poolHead++; + Item& item = m_pool[idx]; + item.x = (short)x; + item.y = (short)y; + item.id = id; + item.next = m_buckets[h]; + m_buckets[h] = idx; + } + } + } +} + +int ProximityGrid::queryItems(const float minx, const float miny, + const float maxx, const float maxy, + unsigned short* ids, const int maxIds) const +{ + const int iminx = (int)floorf(minx * m_invCellSize); + const int iminy = (int)floorf(miny * m_invCellSize); + const int imaxx = (int)floorf(maxx * m_invCellSize); + const int imaxy = (int)floorf(maxy * m_invCellSize); + + int n = 0; + + for (int y = iminy; y <= imaxy; ++y) + { + for (int x = iminx; x <= imaxx; ++x) + { + const int h = hashPos2(x, y, m_bucketsSize); + unsigned short idx = m_buckets[h]; + while (idx != 0xffff) + { + Item& item = m_pool[idx]; + if ((int)item.x == x && (int)item.y == y) + { + // Check if the id exists already. + const unsigned short* end = ids + n; + unsigned short* i = ids; + while (i != end && *i != item.id) + ++i; + // Item not found, add it. + if (i == end) + { + if (n >= maxIds) + return n; + ids[n++] = item.id; + } + } + idx = item.next; + } + } + } + + return n; +} + +int ProximityGrid::getItemCountAt(const int x, const int y) const +{ + int n = 0; + + const int h = hashPos2(x, y, m_bucketsSize); + unsigned short idx = m_buckets[h]; + while (idx != 0xffff) + { + Item& item = m_pool[idx]; + if ((int)item.x == x && (int)item.y == y) + n++; + idx = item.next; + } + + return n; +} + +PathQueue::PathQueue() : + m_nextHandle(1), + m_delay(0) +{ + for (int i = 0; i < MAX_QUEUE; ++i) + m_queue[i].ref = PATHQ_INVALID; +} + +PathQueue::~PathQueue() +{ +} + +void PathQueue::update(dtNavMeshQuery* navquery) +{ + // Artificial delay to test the code better, + // update only one request too. + + // TODO: Use sliced pathfinder. + m_delay++; + if ((m_delay % 4) == 0) + { + for (int i = 0; i < MAX_QUEUE; ++i) + { + PathQuery& q = m_queue[i]; + if (q.ref == PATHQ_INVALID) + continue; + navquery->findPath(q.startRef, q.endRef, q.startPos, q.endPos, + q.filter, q.path, &q.npath, PQ_MAX_PATH); + q.ready = true; + break; + } + } + + // Kill forgotten request. + for (int i = 0; i < MAX_QUEUE; ++i) + { + PathQuery& q = m_queue[i]; + if (q.ref != PATHQ_INVALID && q.ready) + { + q.keepalive++; + if (q.keepalive > 2) + q.ref = PATHQ_INVALID; + } + } +} + +PathQueueRef PathQueue::request(dtPolyRef startRef, dtPolyRef endRef, + const float* startPos, const float* endPos, + const dtQueryFilter* filter) +{ + // Find empty slot + int slot = -1; + for (int i = 0; i < MAX_QUEUE; ++i) + { + if (m_queue[i].ref == PATHQ_INVALID) + { + slot = i; + break; + } + } + // Could not find slot. + if (slot == -1) + return PATHQ_INVALID; + + PathQueueRef ref = m_nextHandle++; + if (m_nextHandle == PATHQ_INVALID) m_nextHandle++; + + PathQuery& q = m_queue[slot]; + q.ref = ref; + dtVcopy(q.startPos, startPos); + q.startRef = startRef; + dtVcopy(q.endPos, endPos); + q.endRef = endRef; + q.ready = false; + q.npath = 0; + q.filter = filter; // TODO: This is potentially dangerous! + q.keepalive = 0; + + return ref; +} + +int PathQueue::getRequestState(PathQueueRef ref) +{ + for (int i = 0; i < MAX_QUEUE; ++i) + { + if (m_queue[i].ref == ref) + return m_queue[i].ready ? PATHQ_STATE_READY : PATHQ_STATE_WORKING; + } + + return PATHQ_STATE_INVALID; +} + +int PathQueue::getPathResult(PathQueueRef ref, dtPolyRef* path, const int maxPath) +{ + for (int i = 0; i < MAX_QUEUE; ++i) + { + if (m_queue[i].ref == ref) + { + PathQuery& q = m_queue[i]; + // Allow to reuse the request. + q.ref = PATHQ_INVALID; + int n = 0; + for (int j = 0; j < q.npath && j < maxPath; ++j) + path[n++] = q.path[j]; + return n; + } + } + return 0; +} + + +static int fixupCorridor(dtPolyRef* path, const int npath, const int maxPath, + const dtPolyRef* visited, const int nvisited) +{ + int furthestPath = -1; + int furthestVisited = -1; + + // Find furthest common polygon. + for (int i = npath-1; i >= 0; --i) + { + bool found = false; + for (int j = nvisited-1; j >= 0; --j) + { + if (path[i] == visited[j]) + { + furthestPath = i; + furthestVisited = j; + found = true; + } + } + if (found) + break; + } + + // If no intersection found just return current path. + if (furthestPath == -1 || furthestVisited == -1) + return npath; + + // Concatenate paths. + + // Adjust beginning of the buffer to include the visited. + const int req = nvisited - furthestVisited; + const int orig = dtMin(furthestPath+1, npath); + int size = dtMax(0, npath-orig); + if (req+size > maxPath) + size = maxPath-req; + if (size) + memmove(path+req, path+orig, size*sizeof(dtPolyRef)); + + // Store visited + for (int i = 0; i < req; ++i) + path[i] = visited[(nvisited-1)-i]; + + return req+size; +} + +static int fixupCorridorEnd(dtPolyRef* path, const int npath, const int maxPath, + const dtPolyRef* visited, const int nvisited) +{ + int furthestPath = -1; + int furthestVisited = -1; + + // Find furthest common polygon. + for (int i = 0; i < npath; ++i) + { + bool found = false; + for (int j = nvisited-1; j >= 0; --j) + { + if (path[i] == visited[j]) + { + furthestPath = i; + furthestVisited = j; + found = true; + } + } + if (found) + break; + } + + // If no intersection found just return current path. + if (furthestPath == -1 || furthestVisited == -1) + return npath; + + // Concatenate paths. + const int ppos = furthestPath+1; + const int vpos = furthestVisited+1; + const int count = dtMin(nvisited-vpos, maxPath-ppos); + dtAssert(ppos+count <= maxPath); + if (count) + memcpy(path+ppos, visited+vpos, sizeof(dtPolyRef)*count); + + return ppos+count; +} + +static int mergeCorridor(dtPolyRef* path, const int npath, const int maxPath, + const dtPolyRef* visited, const int nvisited) +{ + int furthestPath = -1; + int furthestVisited = -1; + + // Find furthest common polygon. + for (int i = npath-1; i >= 0; --i) + { + bool found = false; + for (int j = nvisited-1; j >= 0; --j) + { + if (path[i] == visited[j]) + { + furthestPath = i; + furthestVisited = j; + found = true; + } + } + if (found) + break; + } + + // If no intersection found just return current path. + if (furthestPath == -1 || furthestVisited == -1) + return npath; + + // Concatenate paths. + + // Adjust beginning of the buffer to include the visited. + const int req = furthestVisited; + if (req <= 0) + return npath; + + const int orig = furthestPath; + int size = dtMax(0, npath-orig); + if (req+size > maxPath) + size = maxPath-req; + if (size) + memmove(path+req, path+orig, size*sizeof(dtPolyRef)); + + // Store visited + for (int i = 0; i < req; ++i) + path[i] = visited[i]; + + return req+size; +} + +PathCorridor::PathCorridor() : + m_path(0), + m_npath(0), + m_maxPath(0) +{ + +} + +PathCorridor::~PathCorridor() +{ + dtFree(m_path); +} + +bool PathCorridor::init(const int maxPath) +{ + dtAssert(!m_path); + m_path = (dtPolyRef*)dtAlloc(sizeof(dtPolyRef)*maxPath, DT_ALLOC_PERM); + if (!m_path) + return false; + m_npath = 0; + m_maxPath = maxPath; + return true; +} + +void PathCorridor::reset(dtPolyRef ref, const float* pos) +{ + dtAssert(m_path); + dtVcopy(m_pos, pos); + dtVcopy(m_target, pos); + m_path[0] = ref; + m_npath = 1; +} + +int PathCorridor::findCorners(float* cornerVerts, unsigned char* cornerFlags, + dtPolyRef* cornerPolys, const int maxCorners, + dtNavMeshQuery* navquery, const dtQueryFilter* filter) +{ + dtAssert(m_path); + dtAssert(m_npath); + + static const float MIN_TARGET_DIST = 0.01f; + + int ncorners = 0; + navquery->findStraightPath(m_pos, m_target, m_path, m_npath, + cornerVerts, cornerFlags, cornerPolys, &ncorners, maxCorners); + + // Prune points in the beginning of the path which are too close. + while (ncorners) + { + if ((cornerFlags[0] & DT_STRAIGHTPATH_OFFMESH_CONNECTION) || + dtVdist2DSqr(&cornerVerts[0], m_pos) > dtSqr(MIN_TARGET_DIST)) + break; + ncorners--; + if (ncorners) + { + memmove(cornerFlags, cornerFlags+1, sizeof(unsigned char)*ncorners); + memmove(cornerPolys, cornerPolys+1, sizeof(dtPolyRef)*ncorners); + memmove(cornerVerts, cornerVerts+3, sizeof(float)*3*ncorners); + } + } + + // Prune points after an off-mesh connection. + for (int i = 0; i < ncorners; ++i) + { + if (cornerFlags[i] & DT_STRAIGHTPATH_OFFMESH_CONNECTION) + { + ncorners = i+1; + break; + } + } + + return ncorners; +} + +void PathCorridor::optimizePathVisibility(const float* next, const float pathOptimizationRange, + dtNavMeshQuery* navquery, const dtQueryFilter* filter) +{ + dtAssert(m_path); + + // Clamp the ray to max distance. + float goal[3]; + dtVcopy(goal, next); + float dist = dtVdist2D(m_pos, goal); + + // If too close to the goal, do not try to optimize. + if (dist < 0.01f) + return; + + // Overshoot a little. This helps to optimize open fields in tiled meshes. + dist = dtMin(dist+0.01f, pathOptimizationRange); + + // Adjust ray length. + float delta[3]; + dtVsub(delta, goal, m_pos); + dtVmad(goal, m_pos, delta, pathOptimizationRange/dist); + + static const int MAX_RES = 32; + dtPolyRef res[MAX_RES]; + float t, norm[3]; + int nres = 0; + navquery->raycast(m_path[0], m_pos, goal, filter, &t, norm, res, &nres, MAX_RES); + if (nres > 1 && t > 0.99f) + { + m_npath = mergeCorridor(m_path, m_npath, m_maxPath, res, nres); + } +} + +bool PathCorridor::optimizePathTopology(dtNavMeshQuery* navquery, const dtQueryFilter* filter) +{ + dtAssert(m_path); + + if (m_npath < 3) + return false; + + static const int MAX_ITER = 32; + static const int MAX_RES = 32; + + dtPolyRef res[MAX_RES]; + int nres = 0; + navquery->initSlicedFindPath(m_path[0], m_path[m_npath-1], m_pos, m_target, filter); + navquery->updateSlicedFindPath(MAX_ITER); + dtStatus status = navquery->finalizeSlicedFindPathPartial(m_path, m_npath, res, &nres, MAX_RES); + + if (status == DT_SUCCESS && nres > 0) + { + m_npath = mergeCorridor(m_path, m_npath, m_maxPath, res, nres); + return true; + } + + return false; +} + +void PathCorridor::movePosition(const float* npos, dtNavMeshQuery* navquery, const dtQueryFilter* filter) +{ + dtAssert(m_path); + dtAssert(m_npath); + + // Move along navmesh and update new position. + float result[3]; + static const int MAX_VISITED = 16; + dtPolyRef visited[MAX_VISITED]; + int nvisited = 0; + navquery->moveAlongSurface(m_path[0], m_pos, npos, filter, + result, visited, &nvisited, MAX_VISITED); + m_npath = fixupCorridor(m_path, m_npath, m_maxPath, visited, nvisited); + + // Adjust the position to stay on top of the navmesh. + float h = m_pos[1]; + navquery->getPolyHeight(m_path[0], result, &h); + result[1] = h; + dtVcopy(m_pos, result); +} + +void PathCorridor::moveTargetPosition(const float* npos, dtNavMeshQuery* navquery, const dtQueryFilter* filter) +{ + dtAssert(m_path); + dtAssert(m_npath); + + // Move along navmesh and update new position. + float result[3]; + static const int MAX_VISITED = 16; + dtPolyRef visited[MAX_VISITED]; + int nvisited = 0; + navquery->moveAlongSurface(m_path[m_npath-1], m_target, npos, filter, + result, visited, &nvisited, MAX_VISITED); + m_npath = fixupCorridorEnd(m_path, m_npath, m_maxPath, visited, nvisited); + + // TODO: should we do that? + // Adjust the position to stay on top of the navmesh. +/* float h = m_target[1]; + navquery->getPolyHeight(m_path[m_npath-1], result, &h); + result[1] = h;*/ + + dtVcopy(m_target, result); +} + +void PathCorridor::setCorridor(const float* target, const dtPolyRef* path, const int npath) +{ + dtAssert(m_path); + dtAssert(npath > 0); + dtAssert(npath < m_maxPath); + + dtVcopy(m_target, target); + memcpy(m_path, path, sizeof(dtPolyRef)*npath); + m_npath = npath; +} + + + + +void Agent::integrate(const float maxAcc, const float dt) +{ + // Fake dynamic constraint. + const float maxDelta = maxAcc * dt; + float dv[3]; + dtVsub(dv, nvel, vel); + float ds = dtVlen(dv); + if (ds > maxDelta) + dtVscale(dv, dv, maxDelta/ds); + dtVadd(vel, vel, dv); + + // Integrate + if (dtVlen(vel) > 0.0001f) + dtVmad(npos, npos, vel, dt); + else + dtVset(vel,0,0,0); +} + +float Agent::getDistanceToGoal(const float range) const +{ + if (!ncorners) + return range; + + const bool endOfPath = (cornerFlags[ncorners-1] & DT_STRAIGHTPATH_END) ? true : false; + const bool offMeshConnection = (cornerFlags[ncorners-1] & DT_STRAIGHTPATH_OFFMESH_CONNECTION) ? true : false; + if (endOfPath || offMeshConnection) + return dtMin(dtVdist2D(npos, &cornerVerts[(ncorners-1)*3]), range); + + return range; +} + +void Agent::calcSmoothSteerDirection(float* dir) +{ + if (!ncorners) + { + dtVset(dir, 0,0,0); + return; + } + + const int ip0 = 0; + const int ip1 = dtMin(1, ncorners-1); + const float* p0 = &cornerVerts[ip0*3]; + const float* p1 = &cornerVerts[ip1*3]; + + float dir0[3], dir1[3]; + dtVsub(dir0, p0, npos); + dtVsub(dir1, p1, npos); + dir0[1] = 0; + dir1[1] = 0; + + float len0 = dtVlen(dir0); + float len1 = dtVlen(dir1); + if (len1 > 0.001f) + dtVscale(dir1,dir1,1.0f/len1); + + dir[0] = dir0[0] - dir1[0]*len0*0.5f; + dir[1] = 0; + dir[2] = dir0[2] - dir1[2]*len0*0.5f; + + dtVnormalize(dir); +} + +void Agent::calcStraightSteerDirection(float* dir) +{ + if (!ncorners) + { + dtVset(dir, 0,0,0); + return; + } + dtVsub(dir, &cornerVerts[0], npos); + dir[1] = 0; + dtVnormalize(dir); +} + + + +LocalBoundary::LocalBoundary() : + m_nsegs(0) +{ + dtVset(m_center, FLT_MAX,FLT_MAX,FLT_MAX); +} + +LocalBoundary::~LocalBoundary() +{ +} + +void LocalBoundary::reset() +{ + dtVset(m_center, FLT_MAX,FLT_MAX,FLT_MAX); + m_nsegs = 0; +} + +void LocalBoundary::addSegment(const float dist, const float* s) +{ + // Insert neighbour based on the distance. + Segment* seg = 0; + if (!m_nsegs) + { + // First, trivial accept. + seg = &m_segs[0]; + } + else if (dist >= m_segs[m_nsegs-1].d) + { + // Further than the last segment, skip. + if (m_nsegs >= MAX_SEGS) + return; + // Last, trivial accept. + seg = &m_segs[m_nsegs]; + } + else + { + // Insert inbetween. + int i; + for (i = 0; i < m_nsegs; ++i) + if (dist <= m_segs[i].d) + break; + const int tgt = i+1; + const int n = dtMin(m_nsegs-i, MAX_SEGS-tgt); + dtAssert(tgt+n <= MAX_SEGS); + if (n > 0) + memmove(&m_segs[tgt], &m_segs[i], sizeof(Segment)*n); + seg = &m_segs[i]; + } + + seg->d = dist; + memcpy(seg->s, s, sizeof(float)*6); + + if (m_nsegs < MAX_SEGS) + m_nsegs++; +} + +void LocalBoundary::update(dtPolyRef ref, const float* pos, const float collisionQueryRange, + dtNavMeshQuery* navquery, const dtQueryFilter* filter) +{ + static const int MAX_LOCAL_POLYS = 16; + static const int MAX_SEGS_PER_POLY = DT_VERTS_PER_POLYGON*2; + + if (!ref) + { + dtVset(m_center, FLT_MAX,FLT_MAX,FLT_MAX); + m_nsegs = 0; + return; + } + + dtVcopy(m_center, pos); + + // First query non-overlapping polygons. + dtPolyRef locals[MAX_LOCAL_POLYS]; + int nlocals = 0; + navquery->findLocalNeighbourhood(ref, pos, collisionQueryRange, + filter, locals, 0, &nlocals, MAX_LOCAL_POLYS); + + // Secondly, store all polygon edges. + m_nsegs = 0; + float segs[MAX_SEGS_PER_POLY*6]; + int nsegs = 0; + for (int j = 0; j < nlocals; ++j) + { + navquery->getPolyWallSegments(locals[j], filter, segs, &nsegs, MAX_SEGS_PER_POLY); + for (int k = 0; k < nsegs; ++k) + { + const float* s = &segs[k*6]; + // Skip too distant segments. + float tseg; + const float distSqr = dtDistancePtSegSqr2D(pos, s, s+3, tseg); + if (distSqr > dtSqr(collisionQueryRange)) + continue; + addSegment(distSqr, s); + } + } +} + + +CrowdManager::CrowdManager() : + m_obstacleQuery(0), + m_pathResult(0), + m_maxPathResult(0), + m_totalTime(0), + m_rvoTime(0), + m_sampleCount(0), + m_moveRequestCount(0) +{ + dtVset(m_ext, 2,4,2); + + m_obstacleQuery = dtAllocObstacleAvoidanceQuery(); + m_obstacleQuery->init(6, 8); + + m_obstacleQuery->setDesiredVelocityWeight(2.0f); + m_obstacleQuery->setCurrentVelocityWeight(0.75f); + m_obstacleQuery->setPreferredSideWeight(0.75f); + m_obstacleQuery->setCollisionTimeWeight(2.5f); + m_obstacleQuery->setTimeHorizon(2.5f); + m_obstacleQuery->setVelocitySelectionBias(0.4f); + + memset(m_vodebug, 0, sizeof(m_vodebug)); + const int maxAdaptiveSamples = (VO_ADAPTIVE_DIVS*VO_ADAPTIVE_RINGS+1)*VO_ADAPTIVE_DEPTH; + const int maxGridSamples = VO_GRID_SIZE*VO_GRID_SIZE; + const int sampleCount = dtMax(maxAdaptiveSamples, maxGridSamples); + for (int i = 0; i < MAX_AGENTS; ++i) + { + m_vodebug[i] = dtAllocObstacleAvoidanceDebugData(); + m_vodebug[i]->init(sampleCount); + } + + // Allocate temp buffer for merging paths. + m_maxPathResult = 256; + m_pathResult = (dtPolyRef*)dtAlloc(sizeof(dtPolyRef)*m_maxPathResult, DT_ALLOC_PERM); + + // Alloca corridors. + for (int i = 0; i < MAX_AGENTS; ++i) + { + m_agents[i].corridor.init(m_maxPathResult); + } + + // TODO: the radius should be related to the agent radius used to create the navmesh! + m_grid.init(100, 1.0f); + + reset(); +} + +CrowdManager::~CrowdManager() +{ + delete [] m_pathResult; + + for (int i = 0; i < MAX_AGENTS; ++i) + dtFreeObstacleAvoidanceDebugData(m_vodebug[i]); + dtFreeObstacleAvoidanceQuery(m_obstacleQuery); +} + +void CrowdManager::reset() +{ + for (int i = 0; i < MAX_AGENTS; ++i) + m_agents[i].active = 0; +} + +const int CrowdManager::getAgentCount() const +{ + return MAX_AGENTS; +} + +const Agent* CrowdManager::getAgent(const int idx) +{ + return &m_agents[idx]; +} + +int CrowdManager::addAgent(const float* pos, const float radius, const float height, dtNavMeshQuery* navquery) +{ + // Find empty slot. + int idx = -1; + for (int i = 0; i < MAX_AGENTS; ++i) + { + if (!m_agents[i].active) + { + idx = i; + break; + } + } + if (idx == -1) + return -1; + + Agent* ag = &m_agents[idx]; + + // Find nearest position on navmesh and place the agent there. + float nearest[3]; + dtPolyRef ref; + navquery->findNearestPoly(pos, m_ext, &m_filter, &ref, nearest); + if (!ref) + { + // Could not find a location on navmesh. + return -1; + } + + ag->corridor.reset(ref, nearest); + ag->boundary.reset(); + + ag->radius = radius; + ag->height = height; + ag->collisionQueryRange = radius * 8; + ag->pathOptimizationRange = radius * 30; + ag->topologyOptTime = 0; + ag->nneis = 0; + + dtVset(ag->dvel, 0,0,0); + dtVset(ag->nvel, 0,0,0); + dtVset(ag->vel, 0,0,0); + dtVcopy(ag->npos, nearest); + + ag->maxspeed = 0; + ag->t = 0; + dtVset(ag->opts, 0,0,0); + dtVset(ag->opte, 0,0,0); + ag->active = 1; + ag->var = (rand() % 10) / 9.0f; + + // Init trail + for (int i = 0; i < AGENT_MAX_TRAIL; ++i) + dtVcopy(&ag->trail[i*3], ag->corridor.getPos()); + ag->htrail = 0; + + return idx; +} + +void CrowdManager::removeAgent(const int idx) +{ + if (idx >= 0 && idx < MAX_AGENTS) + { + m_agents[idx].active = 0; + } +} + +bool CrowdManager::requestMoveTarget(const int idx, dtPolyRef ref, const float* pos) +{ + if (idx < 0 || idx > MAX_AGENTS) + return false; + if (!ref) + return false; + + MoveRequest* req = 0; + // Check if there is existing request and update that instead. + for (int i = 0; i < m_moveRequestCount; ++i) + { + if (m_moveRequests[i].idx == idx) + { + req = &m_moveRequests[i]; + break; + } + } + if (!req) + { + if (m_moveRequestCount >= MAX_AGENTS) + return false; + req = &m_moveRequests[m_moveRequestCount++]; + memset(req, 0, sizeof(MoveRequest)); + } + + // Initialize request. + req->idx = idx; + req->ref = ref; + dtVcopy(req->pos, pos); + req->pathqRef = PATHQ_INVALID; + req->state = MR_TARGET_REQUESTING; + + req->temp[0] = ref; + req->ntemp = 1; + + return true; +} + +bool CrowdManager::adjustMoveTarget(const int idx, dtPolyRef ref, const float* pos) +{ + if (idx < 0 || idx > MAX_AGENTS) + return false; + if (!ref) + return false; + + MoveRequest* req = 0; + // Check if there is existing request and update that instead. + for (int i = 0; i < m_moveRequestCount; ++i) + { + if (m_moveRequests[i].idx == idx) + { + req = &m_moveRequests[i]; + break; + } + } + if (!req) + { + if (m_moveRequestCount >= MAX_AGENTS) + return false; + req = &m_moveRequests[m_moveRequestCount++]; + memset(req, 0, sizeof(MoveRequest)); + + // New adjust request + req->state = MR_TARGET_ADJUST; + req->idx = idx; + } + + // Set adjustment request. + req->aref = ref; + dtVcopy(req->apos, pos); + + return true; +} + +int CrowdManager::getActiveAgents(Agent** agents, const int maxAgents) +{ + int n = 0; + for (int i = 0; i < MAX_AGENTS; ++i) + { + if (!m_agents[i].active) continue; + if (n < maxAgents) + agents[n++] = &m_agents[i]; + } + return n; +} + + +static int addNeighbour(const int idx, const float dist, + Neighbour* neis, const int nneis, const int maxNeis) +{ + // Insert neighbour based on the distance. + Neighbour* nei = 0; + if (!nneis) + { + nei = &neis[nneis]; + } + else if (dist >= neis[nneis-1].dist) + { + if (nneis >= maxNeis) + return nneis; + nei = &neis[nneis]; + } + else + { + int i; + for (i = 0; i < nneis; ++i) + if (dist <= neis[i].dist) + break; + + const int tgt = i+1; + const int n = dtMin(nneis-i, maxNeis-tgt); + + dtAssert(tgt+n <= maxNeis); + + if (n > 0) + memmove(&neis[tgt], &neis[i], sizeof(Neighbour)*n); + nei = &neis[i]; + } + + memset(nei, 0, sizeof(Neighbour)); + + nei->idx = idx; + nei->dist = dist; + + return dtMin(nneis+1, maxNeis); +} + +int CrowdManager::getNeighbours(const float* pos, const float height, const float range, + const Agent* skip, Neighbour* result, const int maxResult) +{ + int n = 0; + + unsigned short ids[MAX_AGENTS]; + int nids = m_grid.queryItems(pos[0]-range, pos[2]-range, + pos[0]+range, pos[2]+range, + ids, MAX_AGENTS); + + for (int i = 0; i < nids; ++i) + { + Agent* ag = &m_agents[ids[i]]; + + if (ag == skip) continue; + + // Check for overlap. + float diff[3]; + dtVsub(diff, pos, ag->npos); + if (fabsf(diff[1]) >= (height+ag->height)/2.0f) + continue; + diff[1] = 0; + const float distSqr = dtVlenSqr(diff); + if (distSqr > dtSqr(range)) + continue; + + n = addNeighbour(ids[i], distSqr, result, n, maxResult); + } + return n; +} + +void CrowdManager::updateMoveRequest(const float dt, dtNavMeshQuery* navquery, const dtQueryFilter* filter) +{ + // Fire off new requests. + for (int i = 0; i < m_moveRequestCount; ++i) + { + MoveRequest* req = &m_moveRequests[i]; + Agent* ag = &m_agents[req->idx]; + + // Agent not active anymore, kill request. + if (!ag->active) + req->state = MR_TARGET_FAILED; + + // Adjust target + if (req->aref) + { + if (req->state == MR_TARGET_ADJUST) + { + // Adjust existing path. + ag->corridor.moveTargetPosition(req->apos, navquery, filter); + req->state = MR_TARGET_VALID; + } + else + { + // Adjust on the flight request. + float result[3]; + static const int MAX_VISITED = 16; + dtPolyRef visited[MAX_VISITED]; + int nvisited = 0; + navquery->moveAlongSurface(req->temp[req->ntemp-1], req->pos, req->apos, filter, + result, visited, &nvisited, MAX_VISITED); + req->ntemp = fixupCorridorEnd(req->temp, req->ntemp, MAX_TEMP_PATH, visited, nvisited); + dtVcopy(req->pos, result); + + // Reset adjustment. + dtVset(req->apos, 0,0,0); + req->aref = 0; + } + } + + + if (req->state == MR_TARGET_REQUESTING) + { + // Calculate request position. + // If there is a lot of latency between requests, it is possible to + // project the current position ahead and use raycast to find the actual + // location and path. + const dtPolyRef* path = ag->corridor.getPath(); + const int npath = ag->corridor.getPathCount(); + dtAssert(npath); + + // Here we take the simple approach and set the path to be just the current location. + float reqPos[3]; + dtVcopy(reqPos, ag->corridor.getPos()); // The location of the request + dtPolyRef reqPath[8]; // The path to the request location + reqPath[0] = path[0]; + int reqPathCount = 1; + + req->pathqRef = m_pathq.request(reqPath[reqPathCount-1], req->ref, reqPos, req->pos, &m_filter); + if (req->pathqRef != PATHQ_INVALID) + { + ag->corridor.setCorridor(reqPos, reqPath, reqPathCount); + req->state = MR_TARGET_WAITING_FOR_PATH; + } + } + } + + // Update requests. + m_pathq.update(navquery); + + + // Process path results. + for (int i = 0; i < m_moveRequestCount; ++i) + { + MoveRequest* req = &m_moveRequests[i]; + Agent* ag = &m_agents[req->idx]; + + if (req->state == MR_TARGET_WAITING_FOR_PATH) + { + // Poll path queue. + int state = m_pathq.getRequestState(req->pathqRef); + if (state == PATHQ_STATE_INVALID) + { + req->pathqRef = PATHQ_INVALID; + req->state = MR_TARGET_FAILED; + } + else if (state == PATHQ_STATE_READY) + { + const dtPolyRef* path = ag->corridor.getPath(); + const int npath = ag->corridor.getPathCount(); + dtAssert(npath); + + // Apply results. + float targetPos[3]; + dtVcopy(targetPos, req->pos); + + dtPolyRef* res = m_pathResult; + bool valid = true; + int nres = m_pathq.getPathResult(req->pathqRef, res, m_maxPathResult); + if (!nres) + valid = false; + + // Merge with any target adjustment that happened during the search. + if (req->ntemp > 1) + { + nres = fixupCorridorEnd(res, nres, m_maxPathResult, req->temp, req->ntemp); + } + + // Merge result and existing path. + // The agent might have moved whilst the request is + // being processed, so the path may have changed. + // We assume that the end of the path is at the same location + // where the request was issued. + + // The last ref in the old path should be the same as + // the location where the request was issued.. + if (valid && path[npath-1] != res[0]) + valid = false; + + if (valid) + { + // Put the old path infront of the old path. + if (npath > 1) + { + // Make space for the old path. + if ((npath-1)+nres > m_maxPathResult) + nres = m_maxPathResult - (npath-1); + memmove(res+npath-1, res, sizeof(dtPolyRef)*nres); + // Copy old path in the beginning. + memcpy(res, path, sizeof(dtPolyRef)*(npath-1)); + nres += npath-1; + } + + // Check for partial path. + if (res[nres-1] != req->ref) + { + // Partial path, constrain target position inside the last polygon. + float nearest[3]; + if (navquery->closestPointOnPoly(res[nres-1], targetPos, nearest) == DT_SUCCESS) + dtVcopy(targetPos, nearest); + else + valid = false; + } + } + + if (valid) + { + ag->corridor.setCorridor(targetPos, res, nres); + req->state = MR_TARGET_VALID; + } + else + { + // Something went wrong. + req->state = MR_TARGET_FAILED; + } + } + } + + // Remove request when done with it. + if (req->state == MR_TARGET_VALID || req->state == MR_TARGET_FAILED) + { + m_moveRequestCount--; + if (i != m_moveRequestCount) + memcpy(&m_moveRequests[i], &m_moveRequests[m_moveRequestCount], sizeof(MoveRequest)); + --i; + } + } + +} + + + +static int addToOptQueue(Agent* newag, Agent** agents, const int nagents, const int maxAgents) +{ + // Insert neighbour based on greatest time. + int slot = 0; + if (!nagents) + { + slot = nagents; + } + else if (newag->topologyOptTime <= agents[nagents-1]->topologyOptTime) + { + if (nagents >= maxAgents) + return nagents; + slot = nagents; + } + else + { + int i; + for (i = 0; i < nagents; ++i) + if (newag->topologyOptTime >= agents[i]->topologyOptTime) + break; + + const int tgt = i+1; + const int n = dtMin(nagents-i, maxAgents-tgt); + + dtAssert(tgt+n <= maxAgents); + + if (n > 0) + memmove(&agents[tgt], &agents[i], sizeof(Agent*)*n); + slot = i; + } + + agents[slot] = newag; + + return dtMin(nagents+1, maxAgents); +} + +void CrowdManager::updateTopologyOptimization(const float dt, dtNavMeshQuery* navquery, const dtQueryFilter* filter) +{ + Agent* agents[MAX_AGENTS]; + int nagents = getActiveAgents(agents, MAX_AGENTS); + if (!nagents) + return; + + const float OPT_TIME_THR = 0.5f; // seconds + const int OPT_MAX_AGENTS = 1; + + Agent* queue[OPT_MAX_AGENTS]; + int nqueue = 0; + + for (int i = 0; i < nagents; ++i) + { + Agent* ag = agents[i]; + ag->topologyOptTime += dt; + if (ag->topologyOptTime >= OPT_TIME_THR) + { + nqueue = addToOptQueue(ag, queue, nqueue, OPT_MAX_AGENTS); + } + } + + for (int i = 0; i < nqueue; ++i) + { + Agent* ag = queue[i]; + ag->corridor.optimizePathTopology(navquery, filter); + ag->topologyOptTime = 0; + } + +} + +void CrowdManager::update(const float dt, unsigned int flags, dtNavMeshQuery* navquery) +{ + m_sampleCount = 0; + m_totalTime = 0; + m_rvoTime = 0; + + if (!navquery) + return; + + TimeVal startTime = getPerfTime(); + + Agent* agents[MAX_AGENTS]; + int nagents = getActiveAgents(agents, MAX_AGENTS); + + static const float MAX_ACC = 8.0f; + static const float MAX_SPEED = 3.5f; + + // Update async move request and path finder. + updateMoveRequest(dt, navquery, &m_filter); + + // Optimize path topology. + if (flags & CROWDMAN_OPTIMIZE_TOPO) + updateTopologyOptimization(dt, navquery, &m_filter); + + // Register agents to proximity grid. + m_grid.clear(); + for (int i = 0; i < nagents; ++i) + { + Agent* ag = agents[i]; + const float* p = ag->npos; + const float r = ag->radius; + m_grid.addItem((unsigned short)i, p[0]-r, p[2]-r, p[0]+r, p[2]+r); + } + + // Get nearby navmesh segments and agents to collide with. + for (int i = 0; i < nagents; ++i) + { + Agent* ag = agents[i]; + // Only update the collision boundary after certain distance has been passed. + if (dtVdist2DSqr(ag->npos, ag->boundary.getCenter()) > dtSqr(ag->collisionQueryRange*0.25f)) + ag->boundary.update(ag->corridor.getFirstPoly(), ag->npos, ag->collisionQueryRange, navquery, &m_filter); + // Query neighbour agents + ag->nneis = getNeighbours(ag->npos, ag->height, ag->collisionQueryRange, ag, ag->neis, AGENT_MAX_NEIGHBOURS); + } + + // Find next corner to steer to. + for (int i = 0; i < nagents; ++i) + { + Agent* ag = agents[i]; + + // Find corners for steering + ag->ncorners = ag->corridor.findCorners(ag->cornerVerts, ag->cornerFlags, ag->cornerPolys, + AGENT_MAX_CORNERS, navquery, &m_filter); + + // Check to see if the corner after the next corner is directly visible, + // and short cut to there. + if ((flags & CROWDMAN_OPTIMIZE_VIS) && ag->ncorners > 0) + { + const float* target = &ag->cornerVerts[dtMin(1,ag->ncorners-1)*3]; + dtVcopy(ag->opts, ag->corridor.getPos()); + dtVcopy(ag->opte, target); + ag->corridor.optimizePathVisibility(target, ag->pathOptimizationRange, navquery, &m_filter); + } + else + { + dtVset(ag->opts, 0,0,0); + dtVset(ag->opte, 0,0,0); + } + + // Copy data for debug purposes. + } + + // Calculate steering. + for (int i = 0; i < nagents; ++i) + { + Agent* ag = agents[i]; + + float dvel[3] = {0,0,0}; + + // Calculate steering direction. + if (flags & CROWDMAN_ANTICIPATE_TURNS) + ag->calcSmoothSteerDirection(dvel); + else + ag->calcStraightSteerDirection(dvel); + + // Calculate speed scale, which tells the agent to slowdown at the end of the path. + const float slowDownRadius = ag->radius*2; // TODO: make less hacky. + const float speedScale = ag->getDistanceToGoal(slowDownRadius) / slowDownRadius; + + // Apply style. + if (flags & CROWDMAN_DRUNK) + { + // Drunken steering + + // Pulsating speed. + ag->t += dt * (1.0f - ag->var*0.25f); + ag->maxspeed = MAX_SPEED*(1 + dtSqr(cosf(ag->t*2.0f))*0.3f); + + dtVscale(dvel, dvel, ag->maxspeed * speedScale); + + // Slightly wandering steering. + const float amp = cosf(ag->var*13.69f+ag->t*3.123f) * 0.2f; + const float nx = -dvel[2]; + const float nz = dvel[0]; + dvel[0] += nx*amp; + dvel[2] += nz*amp; + } + else + { + // Normal steering. + ag->maxspeed = MAX_SPEED; + dtVscale(dvel, dvel, ag->maxspeed * speedScale); + } + + // Set the desired velocity. + dtVcopy(ag->dvel, dvel); + } + + // Velocity planning. + TimeVal rvoStartTime = getPerfTime(); + + for (int i = 0; i < nagents; ++i) + { + Agent* ag = agents[i]; + + if (flags & CROWDMAN_USE_VO) + { + m_obstacleQuery->reset(); + + // Add neighbours as obstacles. + for (int j = 0; j < ag->nneis; ++j) + { + const Agent* nei = &m_agents[ag->neis[j].idx]; + m_obstacleQuery->addCircle(nei->npos, nei->radius, nei->vel, nei->dvel); + } + + // Append neighbour segments as obstacles. + for (int j = 0; j < ag->boundary.getSegmentCount(); ++j) + { + const float* s = ag->boundary.getSegment(j); + if (dtTriArea2D(ag->npos, s, s+3) < 0.0f) + continue; + m_obstacleQuery->addSegment(s, s+3); + } + + // Sample new safe velocity. + bool adaptive = true; + + if (adaptive) + { + m_obstacleQuery->sampleVelocityAdaptive(ag->npos, ag->radius, ag->maxspeed, + ag->vel, ag->dvel, ag->nvel, + VO_ADAPTIVE_DIVS, VO_ADAPTIVE_RINGS, VO_ADAPTIVE_DEPTH, + m_vodebug[i]); + } + else + { + m_obstacleQuery->sampleVelocityGrid(ag->npos, ag->radius, ag->maxspeed, + ag->vel, ag->dvel, ag->nvel, + VO_GRID_SIZE, m_vodebug[i]); + } + } + else + { + // If not using velocity planning, new velocity is directly the desired velocity. + dtVcopy(ag->nvel, ag->dvel); + } + } + TimeVal rvoEndTime = getPerfTime(); + + // Integrate. + for (int i = 0; i < nagents; ++i) + { + Agent* ag = agents[i]; + ag->integrate(MAX_ACC, dt); + } + + // Handle collisions. + for (int iter = 0; iter < 4; ++iter) + { + for (int i = 0; i < nagents; ++i) + { + Agent* ag = agents[i]; + + dtVset(ag->disp, 0,0,0); + + float w = 0; + + for (int j = 0; j < ag->nneis; ++j) + { + const Agent* nei = &m_agents[ag->neis[j].idx]; + + float diff[3]; + dtVsub(diff, ag->npos, nei->npos); + + if (fabsf(diff[1]) >= (ag->height+ nei->height)/2.0f) + continue; + + diff[1] = 0; + + float dist = dtVlenSqr(diff); + if (dist > dtSqr(ag->radius + nei->radius)) + continue; + dist = sqrtf(dist); + float pen = (ag->radius + nei->radius) - dist; + if (dist > 0.0001f) + pen = (1.0f/dist) * (pen*0.5f) * 0.7f; + + dtVmad(ag->disp, ag->disp, diff, pen); + + w += 1.0f; + } + + if (w > 0.0001f) + { + const float iw = 1.0f / w; + dtVscale(ag->disp, ag->disp, iw); + } + } + + for (int i = 0; i < nagents; ++i) + { + Agent* ag = agents[i]; + dtVadd(ag->npos, ag->npos, ag->disp); + } + } + + for (int i = 0; i < nagents; ++i) + { + Agent* ag = agents[i]; + // Move along navmesh. + ag->corridor.movePosition(ag->npos, navquery, &m_filter); + // Get valid constrained position back. + dtVcopy(ag->npos, ag->corridor.getPos()); + } + + TimeVal endTime = getPerfTime(); + + // Debug/demo book keeping + int ns = 0; + for (int i = 0; i < nagents; ++i) + { + Agent* ag = agents[i]; + + if (flags & CROWDMAN_USE_VO) + { + // Normalize samples for debug draw + m_vodebug[i]->normalizeSamples(); + ns += m_vodebug[i]->getSampleCount(); + } + + // Update agent movement trail. + ag->htrail = (ag->htrail + 1) % AGENT_MAX_TRAIL; + dtVcopy(&ag->trail[ag->htrail*3], ag->npos); + } + + m_sampleCount = ns; + m_rvoTime = getPerfDeltaTimeUsec(rvoStartTime, rvoEndTime); + m_totalTime = getPerfDeltaTimeUsec(startTime, endTime); +} + + diff --git a/dep/recastnavigation/RecastDemo/Source/CrowdTool.cpp b/dep/recastnavigation/RecastDemo/Source/CrowdTool.cpp new file mode 100644 index 000000000..9a739d655 --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Source/CrowdTool.cpp @@ -0,0 +1,642 @@ +// +// Copyright (c) 2009-2010 Mikko Mononen memon@inside.org +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. +// + +#define _USE_MATH_DEFINES +#include +#include +#include +#include +#include "SDL.h" +#include "SDL_opengl.h" +#include "imgui.h" +#include "CrowdTool.h" +#include "InputGeom.h" +#include "Sample.h" +#include "DetourDebugDraw.h" +#include "DetourObstacleAvoidance.h" +#include "DetourCommon.h" +#include "SampleInterfaces.h" +#include "CrowdManager.h" + +#ifdef WIN32 +# define snprintf _snprintf +#endif + + +static bool isectSegAABB(const float* sp, const float* sq, + const float* amin, const float* amax, + float& tmin, float& tmax) +{ + static const float EPS = 1e-6f; + + float d[3]; + dtVsub(d, sq, sp); + tmin = 0; // set to -FLT_MAX to get first hit on line + tmax = FLT_MAX; // set to max distance ray can travel (for segment) + + // For all three slabs + for (int i = 0; i < 3; i++) + { + if (fabsf(d[i]) < EPS) + { + // Ray is parallel to slab. No hit if origin not within slab + if (sp[i] < amin[i] || sp[i] > amax[i]) + return false; + } + else + { + // Compute intersection t value of ray with near and far plane of slab + const float ood = 1.0f / d[i]; + float t1 = (amin[i] - sp[i]) * ood; + float t2 = (amax[i] - sp[i]) * ood; + // Make t1 be intersection with near plane, t2 with far plane + if (t1 > t2) dtSwap(t1, t2); + // Compute the intersection of slab intersections intervals + if (t1 > tmin) tmin = t1; + if (t2 < tmax) tmax = t2; + // Exit with no collision as soon as slab intersection becomes empty + if (tmin > tmax) return false; + } + } + + return true; +} + +static void getAgentBounds(const Agent* ag, float* bmin, float* bmax) +{ + const float* p = ag->npos; + const float r = ag->radius; + const float h = ag->height; + bmin[0] = p[0] - r; + bmin[1] = p[1]; + bmin[2] = p[2] - r; + bmax[0] = p[0] + r; + bmax[1] = p[1] + h; + bmax[2] = p[2] + r; +} + +CrowdTool::CrowdTool() : + m_sample(0), + m_oldFlags(0), + m_targetRef(0), + m_expandDebugDraw(false), + m_showLabels(false), + m_showCorners(false), + m_showTargets(false), + m_showCollisionSegments(false), + m_showPath(false), + m_showVO(false), + m_showOpt(false), + m_showGrid(false), + m_showNodes(false), + m_showPerfGraph(false), + m_expandOptions(true), + m_anticipateTurns(true), + m_optimizeVis(true), + m_optimizeTopo(true), + m_useVO(true), + m_drunkMove(false), + m_run(true), + m_mode(TOOLMODE_CREATE) +{ +} + +CrowdTool::~CrowdTool() +{ + if (m_sample) + { + m_sample->setNavMeshDrawFlags(m_oldFlags); + } +} + +void CrowdTool::init(Sample* sample) +{ + if (m_sample != sample) + { + m_sample = sample; + m_oldFlags = m_sample->getNavMeshDrawFlags(); + m_sample->setNavMeshDrawFlags(m_oldFlags & ~DU_DRAWNAVMESH_CLOSEDLIST); + } +} + +void CrowdTool::reset() +{ + m_targetRef = 0; +} + +void CrowdTool::handleMenu() +{ + + if (imguiCheck("Create Agents", m_mode == TOOLMODE_CREATE)) + m_mode = TOOLMODE_CREATE; + if (imguiCheck("Move Target", m_mode == TOOLMODE_MOVE_TARGET)) + m_mode = TOOLMODE_MOVE_TARGET; + + imguiSeparator(); + + if (m_mode == TOOLMODE_CREATE) + { + imguiValue("Click to add agents."); + imguiValue("Shift+Click to remove."); + } + else if (m_mode == TOOLMODE_MOVE_TARGET) + { + imguiValue("Click to set move target."); + imguiValue("Shift+Click to adjust target."); + imguiValue("Adjusting uses special pathfinder"); + imguiValue("which is really fast to change the"); + imguiValue("target in small increments."); + } + + imguiSeparator(); + imguiSeparator(); + + if (imguiCollapse("Options", 0, m_expandOptions)) + m_expandOptions = !m_expandOptions; + + if (m_expandOptions) + { + imguiIndent(); + if (imguiCheck("Optimize Visibility", m_optimizeVis)) + m_optimizeVis = !m_optimizeVis; + if (imguiCheck("Optimize Topology", m_optimizeTopo)) + m_optimizeTopo = !m_optimizeTopo; + if (imguiCheck("Anticipate Turns", m_anticipateTurns)) + m_anticipateTurns = !m_anticipateTurns; + if (imguiCheck("Use VO", m_useVO)) + m_useVO = !m_useVO; + if (imguiCheck("Drunk Move", m_drunkMove)) + m_drunkMove = !m_drunkMove; + imguiUnindent(); + } + + if (imguiCollapse("Debug Draw", 0, m_expandDebugDraw)) + m_expandDebugDraw = !m_expandDebugDraw; + + if (m_expandDebugDraw) + { + imguiIndent(); + if (imguiCheck("Show Labels", m_showLabels)) + m_showLabels = !m_showLabels; + if (imguiCheck("Show Corners", m_showCorners)) + m_showCorners = !m_showCorners; + if (imguiCheck("Show Targets", m_showTargets)) + m_showTargets = !m_showTargets; + if (imguiCheck("Show Collision Segs", m_showCollisionSegments)) + m_showCollisionSegments = !m_showCollisionSegments; + if (imguiCheck("Show Path", m_showPath)) + m_showPath = !m_showPath; + if (imguiCheck("Show VO", m_showVO)) + m_showVO = !m_showVO; + if (imguiCheck("Show Path Optimization", m_showOpt)) + m_showOpt = !m_showOpt; + if (imguiCheck("Show Prox Grid", m_showGrid)) + m_showGrid = !m_showGrid; + if (imguiCheck("Show Nodes", m_showNodes)) + m_showNodes = !m_showNodes; + if (imguiCheck("Show Perf Graph", m_showPerfGraph)) + m_showPerfGraph = !m_showPerfGraph; + imguiUnindent(); + } +} + +void CrowdTool::handleClick(const float* s, const float* p, bool shift) +{ + if (!m_sample) return; + InputGeom* geom = m_sample->getInputGeom(); + if (!geom) return; + + if (m_mode == TOOLMODE_CREATE) + { + if (shift) + { + // Delete + int isel = -1; + float tsel = FLT_MAX; + + for (int i = 0; i < m_crowd.getAgentCount(); ++i) + { + const Agent* ag = m_crowd.getAgent(i); + if (!ag->active) continue; + float bmin[3], bmax[3]; + getAgentBounds(ag, bmin, bmax); + float tmin, tmax; + if (isectSegAABB(s, p, bmin,bmax, tmin, tmax)) + { + if (tmin > 0 && tmin < tsel) + { + isel = i; + tsel = tmin; + } + } + } + if (isel != -1) + { + m_crowd.removeAgent(isel); + } + } + else + { + // Add + dtNavMeshQuery* navquery = m_sample->getNavMeshQuery(); + int idx = m_crowd.addAgent(p, m_sample->getAgentRadius(), m_sample->getAgentHeight(), navquery); + if (idx != -1 && m_targetRef) + m_crowd.requestMoveTarget(idx, m_targetRef, m_targetPos); + } + } + else if (m_mode == TOOLMODE_MOVE_TARGET) + { + // Find nearest point on navmesh and set move request to that location. + dtNavMeshQuery* navquery = m_sample->getNavMeshQuery(); + const dtQueryFilter* filter = m_crowd.getFilter(); + const float* ext = m_crowd.getQueryExtents(); + + navquery->findNearestPoly(p, ext, filter, &m_targetRef, m_targetPos); + + if (shift) + { + // Adjust target using tiny local search. + for (int i = 0; i < m_crowd.getAgentCount(); ++i) + { + const Agent* ag = m_crowd.getAgent(i); + if (!ag->active) continue; + m_crowd.adjustMoveTarget(i, m_targetRef, m_targetPos); + } + } + else + { + // Move target using paht finder + for (int i = 0; i < m_crowd.getAgentCount(); ++i) + { + const Agent* ag = m_crowd.getAgent(i); + if (!ag->active) continue; + m_crowd.requestMoveTarget(i, m_targetRef, m_targetPos); + } + } + } +} + +void CrowdTool::handleStep() +{ +} + +void CrowdTool::handleToggle() +{ + m_run = !m_run; +} + +void CrowdTool::handleUpdate(const float dt) +{ + if (!m_sample) return; + if (!m_sample->getNavMesh()) return; + if (m_run) + { + unsigned int flags = 0; + + if (m_anticipateTurns) + flags |= CROWDMAN_ANTICIPATE_TURNS; + if (m_useVO) + flags |= CROWDMAN_USE_VO; + if (m_drunkMove) + flags |= CROWDMAN_DRUNK; + if (m_optimizeVis) + flags |= CROWDMAN_OPTIMIZE_VIS; + if (m_optimizeTopo) + flags |= CROWDMAN_OPTIMIZE_TOPO; + + m_crowd.update(dt, flags, m_sample->getNavMeshQuery()); + + m_crowdSampleCount.addSample((float)m_crowd.getSampleCount()); + m_crowdTotalTime.addSample(m_crowd.getTotalTime() / 1000.0f); + m_crowdRvoTime.addSample(m_crowd.getRVOTime() / 1000.0f); + } +} + +void CrowdTool::handleRender() +{ + DebugDrawGL dd; + const float s = m_sample->getAgentRadius(); + + dtNavMesh* nmesh = m_sample->getNavMesh(); + if (!nmesh) + return; + + dtNavMeshQuery* navquery = m_sample->getNavMeshQuery(); + + if (m_showNodes) + { + if (navquery) + duDebugDrawNavMeshNodes(&dd, *navquery); + } + + dd.depthMask(false); + + // Draw paths + if (m_showPath) + { + for (int i = 0; i < m_crowd.getAgentCount(); ++i) + { + const Agent* ag = m_crowd.getAgent(i); + if (!ag->active) continue; + + const dtPolyRef* path = ag->corridor.getPath(); + const int npath = ag->corridor.getPathCount(); + for (int i = 0; i < npath; ++i) + duDebugDrawNavMeshPoly(&dd, *nmesh, path[i], duRGBA(0,0,0,32)); + } + } + + if (m_targetRef) + duDebugDrawCross(&dd, m_targetPos[0],m_targetPos[1]+0.1f,m_targetPos[2], s, duRGBA(255,255,255,192), 2.0f); + + // Occupancy grid. + if (m_showGrid) + { + float gridy = -FLT_MAX; + for (int i = 0; i < m_crowd.getAgentCount(); ++i) + { + const Agent* ag = m_crowd.getAgent(i); + if (!ag->active) continue; + const float* pos = ag->corridor.getPos(); + gridy = dtMax(gridy, pos[1]); + } + gridy += 1.0f; + + dd.begin(DU_DRAW_QUADS); + const ProximityGrid* grid = m_crowd.getGrid(); + const int* bounds = grid->getBounds(); + const float cs = grid->getCellSize(); + for (int y = bounds[1]; y <= bounds[3]; ++y) + { + for (int x = bounds[0]; x <= bounds[2]; ++x) + { + const int count = grid->getItemCountAt(x,y); + if (!count) continue; + unsigned int col = duRGBA(128,0,0,dtMin(count*40,255)); + dd.vertex(x*cs, gridy, y*cs, col); + dd.vertex(x*cs, gridy, y*cs+cs, col); + dd.vertex(x*cs+cs, gridy, y*cs+cs, col); + dd.vertex(x*cs+cs, gridy, y*cs, col); + } + } + dd.end(); + } + + // Trail + for (int i = 0; i < m_crowd.getAgentCount(); ++i) + { + const Agent* ag = m_crowd.getAgent(i); + if (!ag->active) continue; + + const float* pos = ag->npos; + + dd.begin(DU_DRAW_LINES,3.0f); + float prev[3], preva = 1; + dtVcopy(prev, pos); + for (int j = 0; j < AGENT_MAX_TRAIL-1; ++j) + { + const int idx = (ag->htrail + AGENT_MAX_TRAIL-j) % AGENT_MAX_TRAIL; + const float* v = &ag->trail[idx*3]; + float a = 1 - j/(float)AGENT_MAX_TRAIL; + dd.vertex(prev[0],prev[1]+0.1f,prev[2], duRGBA(0,0,0,(int)(128*preva))); + dd.vertex(v[0],v[1]+0.1f,v[2], duRGBA(0,0,0,(int)(128*a))); + preva = a; + dtVcopy(prev, v); + } + dd.end(); + + } + + // Corners & co + for (int i = 0; i < m_crowd.getAgentCount(); ++i) + { + const Agent* ag = m_crowd.getAgent(i); + if (!ag->active) continue; + + const float radius = ag->radius; + const float* pos = ag->npos; + + if (m_showCorners) + { + if (ag->ncorners) + { + dd.begin(DU_DRAW_LINES, 2.0f); + for (int j = 0; j < ag->ncorners; ++j) + { + const float* va = j == 0 ? pos : &ag->cornerVerts[(j-1)*3]; + const float* vb = &ag->cornerVerts[j*3]; + dd.vertex(va[0],va[1]+radius,va[2], duRGBA(128,0,0,192)); + dd.vertex(vb[0],vb[1]+radius,vb[2], duRGBA(128,0,0,192)); + } + dd.end(); + + if (m_anticipateTurns) + { + /* float dvel[3], pos[3]; + calcSmoothSteerDirection(ag->pos, ag->cornerVerts, ag->ncorners, dvel); + pos[0] = ag->pos[0] + dvel[0]; + pos[1] = ag->pos[1] + dvel[1]; + pos[2] = ag->pos[2] + dvel[2]; + + const float off = ag->radius+0.1f; + const float* tgt = &ag->cornerVerts[0]; + const float y = ag->pos[1]+off; + + dd.begin(DU_DRAW_LINES, 2.0f); + + dd.vertex(ag->pos[0],y,ag->pos[2], duRGBA(255,0,0,192)); + dd.vertex(pos[0],y,pos[2], duRGBA(255,0,0,192)); + + dd.vertex(pos[0],y,pos[2], duRGBA(255,0,0,192)); + dd.vertex(tgt[0],y,tgt[2], duRGBA(255,0,0,192)); + + dd.end();*/ + } + } + } + + if (m_showCollisionSegments) + { + const float* center = ag->boundary.getCenter(); + duDebugDrawCross(&dd, center[0],center[1]+radius,center[2], 0.2f, duRGBA(192,0,128,255), 2.0f); + duDebugDrawCircle(&dd, center[0],center[1]+radius,center[2], ag->collisionQueryRange, + duRGBA(192,0,128,128), 2.0f); + + dd.begin(DU_DRAW_LINES, 3.0f); + for (int j = 0; j < ag->boundary.getSegmentCount(); ++j) + { + const float* s = ag->boundary.getSegment(j); + unsigned int col = duRGBA(192,0,128,192); + if (dtTriArea2D(pos, s, s+3) < 0.0f) + col = duDarkenCol(col); + + duAppendArrow(&dd, s[0],s[1]+0.2f,s[2], s[3],s[4]+0.2f,s[5], 0.0f, 0.3f, col); + } + dd.end(); + } + + if (m_showOpt) + { + dd.begin(DU_DRAW_LINES, 2.0f); + dd.vertex(ag->opts[0],ag->opts[1]+0.3f,ag->opts[2], duRGBA(0,128,0,192)); + dd.vertex(ag->opte[0],ag->opte[1]+0.3f,ag->opte[2], duRGBA(0,128,0,192)); + dd.end(); + } + } + + // Agent cylinders. + for (int i = 0; i < m_crowd.getAgentCount(); ++i) + { + const Agent* ag = m_crowd.getAgent(i); + if (!ag->active) continue; + + const float radius = ag->radius; + const float* pos = ag->npos; + + duDebugDrawCircle(&dd, pos[0], pos[1], pos[2], radius, duRGBA(0,0,0,32), 2.0f); + } + + for (int i = 0; i < m_crowd.getAgentCount(); ++i) + { + const Agent* ag = m_crowd.getAgent(i); + if (!ag->active) continue; + + const float height = ag->height; + const float radius = ag->radius; + const float* pos = ag->npos; + + duDebugDrawCylinder(&dd, pos[0]-radius, pos[1]+radius*0.1f, pos[2]-radius, + pos[0]+radius, pos[1]+height, pos[2]+radius, + duRGBA(220,220,220,128)); + } + + + // Velocity stuff. + for (int i = 0; i < m_crowd.getAgentCount(); ++i) + { + const Agent* ag = m_crowd.getAgent(i); + if (!ag->active) continue; + + const float radius = ag->radius; + const float height = ag->height; + const float* pos = ag->npos; + const float* vel = ag->vel; + const float* dvel = ag->dvel; + + duDebugDrawCircle(&dd, pos[0], pos[1]+height, pos[2], radius, duRGBA(220,220,220,192), 2.0f); + + if (m_showVO) + { + // Draw detail about agent sela + const dtObstacleAvoidanceDebugData* debug = m_crowd.getVODebugData(i); + + const float dx = pos[0]; + const float dy = pos[1]+height; + const float dz = pos[2]; + + dd.begin(DU_DRAW_QUADS); + for (int i = 0; i < debug->getSampleCount(); ++i) + { + const float* p = debug->getSampleVelocity(i); + const float sr = debug->getSampleSize(i); + const float pen = debug->getSamplePenalty(i); + const float pen2 = debug->getSamplePreferredSidePenalty(i); + unsigned int col = duLerpCol(duRGBA(255,255,255,220), duRGBA(128,96,0,220), (int)(pen*255)); + col = duLerpCol(col, duRGBA(128,0,0,220), (int)(pen2*128)); + dd.vertex(dx+p[0]-sr, dy, dz+p[2]-sr, col); + dd.vertex(dx+p[0]-sr, dy, dz+p[2]+sr, col); + dd.vertex(dx+p[0]+sr, dy, dz+p[2]+sr, col); + dd.vertex(dx+p[0]+sr, dy, dz+p[2]-sr, col); + } + dd.end(); + + } + + duDebugDrawArrow(&dd, pos[0],pos[1]+height,pos[2], + pos[0]+dvel[0],pos[1]+height+dvel[1],pos[2]+dvel[2], + 0.0f, 0.4f, duRGBA(0,192,255,192), 1.0f); + + duDebugDrawArrow(&dd, pos[0],pos[1]+height,pos[2], + pos[0]+vel[0],pos[1]+height+vel[1],pos[2]+vel[2], + 0.0f, 0.4f, duRGBA(0,0,0,192), 2.0f); + } + + // Targets + for (int i = 0; i < m_crowd.getAgentCount(); ++i) + { + const Agent* ag = m_crowd.getAgent(i); + if (!ag->active) continue; + + const float* pos = ag->npos; + const float* target = ag->corridor.getTarget(); + + if (m_showTargets) + { + duDebugDrawArc(&dd, pos[0], pos[1], pos[2], target[0], target[1], target[2], + 0.25f, 0, 0.4f, duRGBA(0,0,0,128), 1.0f); + } + } + + dd.depthMask(true); +} + +void CrowdTool::handleRenderOverlay(double* proj, double* model, int* view) +{ + GLdouble x, y, z; + + // Draw start and end point labels + if (m_targetRef && gluProject((GLdouble)m_targetPos[0], (GLdouble)m_targetPos[1], (GLdouble)m_targetPos[2], + model, proj, view, &x, &y, &z)) + { + imguiDrawText((int)x, (int)(y+25), IMGUI_ALIGN_CENTER, "TARGET", imguiRGBA(0,0,0,220)); + } + + if (m_showLabels) + { + char label[32]; + for (int i = 0; i < m_crowd.getAgentCount(); ++i) + { + const Agent* ag = m_crowd.getAgent(i); + if (!ag->active) continue; + const float* pos = ag->npos; + const float h = ag->height; + if (gluProject((GLdouble)pos[0], (GLdouble)pos[1]+h, (GLdouble)pos[2], + model, proj, view, &x, &y, &z)) + { + snprintf(label, 32, "%d", i); + imguiDrawText((int)x, (int)y+15, IMGUI_ALIGN_CENTER, label, imguiRGBA(0,0,0,220)); + } + + } + } + + if (m_showPerfGraph) + { + GraphParams gp; + gp.setRect(300, 10, 500, 200, 8); + gp.setValueRange(0.0f, 2.0f, 4, "ms"); + + drawGraphBackground(&gp); + drawGraph(&gp, &m_crowdRvoTime, 0, "RVO Sampling", duRGBA(255,0,128,255)); + drawGraph(&gp, &m_crowdTotalTime, 1, "Total", duRGBA(128,255,0,255)); + + gp.setRect(300, 10, 500, 50, 8); + gp.setValueRange(0.0f, 2000.0f, 1, "0"); + drawGraph(&gp, &m_crowdSampleCount, 0, "Sample Count", duRGBA(255,255,255,255)); + } +} diff --git a/dep/recastnavigation/RecastDemo/Source/Debug.cpp b/dep/recastnavigation/RecastDemo/Source/Debug.cpp new file mode 100644 index 000000000..744f188b1 --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Source/Debug.cpp @@ -0,0 +1,373 @@ + +#include "Debug.h" + +#include +#include "DetourNavMesh.h" +#include "Recast.h" + +#include +using namespace std; + +void duReadNavMesh(char* tile, dtNavMesh* &navMesh) +{ + FILE* file; + + string tileName(tile); + tileName = tileName.substr(0, tileName.find_first_of('.')); + string mapName = "mmaps/" + tileName.substr(0, 3) + ".mmap"; + file = fopen(mapName.c_str(), "rb"); + + if(!file) + return; + + dtNavMeshParams params; + fread(¶ms, sizeof(dtNavMeshParams), 1, file); + fclose(file); + + if (!navMesh) + { + dtFreeNavMesh(navMesh); + navMesh = dtAllocNavMesh(); + navMesh->init(¶ms); + } + + int map = atoi(tileName.substr(0, 3).c_str()); + int x = atoi(tileName.substr(5, 2).c_str()); + int y = atoi(tileName.substr(3, 2).c_str()); + bool loaded = false; + + char fname[50]; + + int count = 0; + for (int i = x-1; i <= x+1; ++i) + for (int j = y-1; j <= y+1; ++j) + //int i = x; + //int j = y; + { + sprintf(fname, "mmaps/%03i%02i%02i.mmtile", map, j, i); + file = fopen(fname, "rb"); + if(file) + { + MmapTileHeader header; + fread(&header, sizeof(MmapTileHeader), 1, file); + + unsigned char* data = (unsigned char*)dtAlloc(header.size, DT_ALLOC_PERM); + fread(data, header.size, 1, file); + + dtStatus status = navMesh->addTile(data, header.size, DT_TILE_FREE_DATA, 0 , NULL); + + if (status != DT_SUCCESS) + dtFree(data); + else + count++; + + fclose(file); + } + } + + if (!count) + { + dtFreeNavMesh(navMesh); + navMesh = NULL; + } +} + +int duReadHeightfield(char* tile, rcHeightfield* &hf) +{ + FILE* file; + + string tileName(tile); + tileName = tileName.substr(0, tileName.find_first_of('.')); + file = fopen(("meshes/" + tileName + ".hf").c_str(), "rb"); + + if(!file) + return false; + + hf = rcAllocHeightfield(); + + fread(&(hf->cs), sizeof(float), 1, file); + fread(&(hf->ch), sizeof(float), 1, file); + fread(&(hf->width), sizeof(int), 1, file); + fread(&(hf->height), sizeof(int), 1, file); + fread(hf->bmin, sizeof(float), 3, file); + fread(hf->bmax, sizeof(float), 3, file); + + hf->spans = new rcSpan*[hf->width*hf->height]; + memset(hf->spans, 0, sizeof(rcSpan*)*hf->width*hf->height); + + for(int y = 0; y < hf->height; ++y) + for(int x = 0; x < hf->width; ++x) + { + int spanCount; + fread(&spanCount, sizeof(int), 1, file); + + if(spanCount) + hf->spans[x + y*hf->width] = new rcSpan; + else + hf->spans[x + y*hf->width] = NULL; + + rcSpan* span = hf->spans[x + y*hf->width]; + + while(spanCount--) + { + fread(span, sizeof(rcSpan), 1, file); + + if(spanCount) + { + span->next = new rcSpan; + span = span->next; + } + else + span->next = NULL; + } + } + + fclose(file); + + return false; +} + +int duReadCompactHeightfield(char* tile, rcCompactHeightfield* &chf) +{ + FILE* file; + + string tileName(tile); + tileName = tileName.substr(0, tileName.find_first_of('.')); + file = fopen(("meshes/" + tileName + ".chf").c_str(), "rb"); + + if(!file) + return false; + + chf = rcAllocCompactHeightfield(); + + fread(&chf->width, sizeof(chf->width), 1, file); + fread(&chf->height, sizeof(chf->height), 1, file); + fread(&chf->spanCount, sizeof(chf->spanCount), 1, file); + + fread(&chf->walkableHeight, sizeof(chf->walkableHeight), 1, file); + fread(&chf->walkableClimb, sizeof(chf->walkableClimb), 1, file); + + fread(&chf->maxDistance, sizeof(chf->maxDistance), 1, file); + fread(&chf->maxRegions, sizeof(chf->maxRegions), 1, file); + + fread(chf->bmin, sizeof(chf->bmin), 1, file); + fread(chf->bmax, sizeof(chf->bmax), 1, file); + + fread(&chf->cs, sizeof(chf->cs), 1, file); + fread(&chf->ch, sizeof(chf->ch), 1, file); + + int tmp = 0; + fread(&tmp, sizeof(tmp), 1, file); + + if (tmp & 1) + { + chf->cells = new rcCompactCell[chf->width*chf->height]; + fread(chf->cells, sizeof(rcCompactCell), chf->width*chf->height, file); + } + if (tmp & 2) + { + chf->spans = new rcCompactSpan[chf->spanCount]; + fread(chf->spans, sizeof(rcCompactSpan), chf->spanCount, file); + } + if (tmp & 4) + { + chf->dist = new unsigned short[chf->spanCount]; + fread(chf->dist, sizeof(unsigned short), chf->spanCount, file); + } + if (tmp & 8) + { + chf->areas = new unsigned char[chf->spanCount]; + fread(chf->areas, sizeof(unsigned char), chf->spanCount, file); + } + + fclose(file); + + return false; +} + +int duReadContourSet(char* tile, rcContourSet* &cs) +{ + FILE* file; + + string tileName(tile); + tileName = tileName.substr(0, tileName.find_first_of('.')); + file = fopen(("meshes/" + tileName + ".cs").c_str(), "rb"); + + if(!file) + return false; + + cs = rcAllocContourSet(); + + fread(&(cs->cs), sizeof(float), 1, file); + fread(&(cs->ch), sizeof(float), 1, file); + fread(cs->bmin, sizeof(float), 3, file); + fread(cs->bmax, sizeof(float), 3, file); + fread(&(cs->nconts), sizeof(int), 1, file); + + if(cs->nconts) + cs->conts = new rcContour[cs->nconts]; + + for(int j = 0; j < cs->nconts; ++j) + { + cs->conts[j].verts = 0; + cs->conts[j].rverts = 0; + + fread(&(cs->conts[j].area), sizeof(unsigned char), 1, file); + fread(&(cs->conts[j].reg), sizeof(unsigned short), 1, file); + + fread(&(cs->conts[j].nverts), sizeof(int), 1, file); + cs->conts[j].verts = new int[cs->conts[j].nverts*4]; + fread(cs->conts[j].verts, sizeof(int), cs->conts[j].nverts*4, file); + + fread(&(cs->conts[j].nrverts), sizeof(int), 1, file); + cs->conts[j].rverts = new int[cs->conts[j].nrverts*4]; + fread(cs->conts[j].rverts, sizeof(int), cs->conts[j].nrverts*4, file); + } + + fclose(file); + + return false; +} + +int duReadPolyMesh(char* tile, rcPolyMesh* &mesh) +{ + FILE* file; + + string tileName(tile); + tileName = tileName.substr(0, tileName.find_first_of('.')); + file = fopen(("meshes/" + tileName + ".pmesh").c_str(), "rb"); + + if(!file) + return false; + + mesh = rcAllocPolyMesh(); + + fread(&(mesh->cs), sizeof(float), 1, file); + fread(&(mesh->ch), sizeof(float), 1, file); + fread(&(mesh->nvp), sizeof(int), 1, file); + fread(mesh->bmin, sizeof(float), 3, file); + fread(mesh->bmax, sizeof(float), 3, file); + fread(&(mesh->nverts), sizeof(int), 1, file); + mesh->verts = new unsigned short[mesh->nverts*3]; + fread(mesh->verts, sizeof(unsigned short), mesh->nverts*3, file); + fread(&(mesh->npolys), sizeof(int), 1, file); + mesh->polys = new unsigned short[mesh->npolys*mesh->nvp*2]; + mesh->flags = new unsigned short[mesh->npolys]; + mesh->areas = new unsigned char[mesh->npolys]; + mesh->regs = new unsigned short[mesh->npolys]; + fread(mesh->polys, sizeof(unsigned short), mesh->npolys*mesh->nvp*2, file); + fread(mesh->flags, sizeof(unsigned short), mesh->npolys, file); + fread(mesh->areas, sizeof(unsigned char), mesh->npolys, file); + fread(mesh->regs, sizeof(unsigned short), mesh->npolys, file); + + fclose(file); + + return true; +} + +int duReadDetailMesh(char* tile, rcPolyMeshDetail* &mesh) +{ + FILE* file; + + string tileName(tile); + tileName = tileName.substr(0, tileName.find_first_of('.')); + file = fopen(("meshes/" + tileName + ".dmesh").c_str(), "rb"); + + if(!file) + return false; + + mesh = rcAllocPolyMeshDetail(); + + fread(&(mesh->nverts), sizeof(int), 1, file); + mesh->verts = new float[mesh->nverts*3]; + fread(mesh->verts, sizeof(float), mesh->nverts*3, file); + + fread(&(mesh->ntris), sizeof(int), 1, file); + mesh->tris = new unsigned char[mesh->ntris*4]; + fread(mesh->tris, sizeof(char), mesh->ntris*4, file); + + fread(&(mesh->nmeshes), sizeof(int), 1, file); + mesh->meshes = new unsigned int[mesh->nmeshes*4]; + fread(mesh->meshes, sizeof(int), mesh->nmeshes*4, file); + + fclose(file); + + return true; +} + +myMeshLoaderObj::myMeshLoaderObj() : + m_verts(0), + m_tris(0), + m_normals(0), + m_vertCount(0), + m_triCount(0) +{ +} + +myMeshLoaderObj::~myMeshLoaderObj() +{ + delete [] m_verts; + delete [] m_normals; + delete [] m_tris; +} + +bool myMeshLoaderObj::load(const char* filename) +{ + FILE* file; + + float* verts = 0; + int vertCount = 0; + int* tris = 0; + int triCount = 0; + + if(!(file = fopen(filename, "rb"))) + return false; + + // read verts + fread(&vertCount, sizeof(int), 1, file); + verts = new float[vertCount*3]; + fread(verts, sizeof(float), vertCount*3, file); + + // read triangles + fread(&triCount, sizeof(int), 1, file); + tris = new int[triCount*3]; + fread(tris, sizeof(int), triCount*3, file); + + fclose(file); + + m_verts = verts; + m_vertCount = vertCount; + m_tris = tris; + m_triCount = triCount; + + m_normals = new float[m_triCount*3]; + for (int i = 0; i < m_triCount*3; i += 3) + { + const float* v0 = &m_verts[m_tris[i]*3]; + const float* v1 = &m_verts[m_tris[i+1]*3]; + const float* v2 = &m_verts[m_tris[i+2]*3]; + float e0[3], e1[3]; + for (int j = 0; j < 3; ++j) + { + e0[j] = v1[j] - v0[j]; + e1[j] = v2[j] - v0[j]; + } + float* n = &m_normals[i]; + n[0] = e0[1]*e1[2] - e0[2]*e1[1]; + n[1] = e0[2]*e1[0] - e0[0]*e1[2]; + n[2] = e0[0]*e1[1] - e0[1]*e1[0]; + float d = sqrtf(n[0]*n[0] + n[1]*n[1] + n[2]*n[2]); + if (d > 0) + { + d = 1.0f/d; + n[0] *= d; + n[1] *= d; + n[2] *= d; + } + } + + strncpy(m_filename, filename, sizeof(m_filename)); + m_filename[sizeof(m_filename)-1] = '\0'; + + return true; +} diff --git a/dep/recastnavigation/RecastDemo/Source/Filelist.cpp b/dep/recastnavigation/RecastDemo/Source/Filelist.cpp new file mode 100644 index 000000000..9df30345e --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Source/Filelist.cpp @@ -0,0 +1,100 @@ +// +// Copyright (c) 2009-2010 Mikko Mononen memon@inside.org +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. +// + +#include "Filelist.h" +#include +#include +#include +#ifdef WIN32 +# include +#else +# include +#endif + +static void fileListAdd(FileList& list, const char* path) +{ + if (list.size >= FileList::MAX_FILES) + return; + int n = strlen(path); + list.files[list.size] = new char[n+1]; + strcpy(list.files[list.size], path); + list.size++; +} + +static void fileListClear(FileList& list) +{ + for (int i = 0; i < list.size; ++i) + delete [] list.files[i]; + list.size = 0; +} + +FileList::FileList() : size(0) +{ + memset(files, 0, sizeof(char*)*MAX_FILES); +} + +FileList::~FileList() +{ + fileListClear(*this); +} + +static int cmp(const void* a, const void* b) +{ + return strcmp(*(const char**)a, *(const char**)b); +} + +void scanDirectory(const char* path, const char* ext, FileList& list) +{ + fileListClear(list); + +#ifdef WIN32 + _finddata_t dir; + char pathWithExt[260]; + long fh; + strcpy(pathWithExt, path); + strcat(pathWithExt, "/*"); + strcat(pathWithExt, ext); + fh = _findfirst(pathWithExt, &dir); + if (fh == -1L) + return; + do + { + fileListAdd(list, dir.name); + } + while (_findnext(fh, &dir) == 0); + _findclose(fh); +#else + dirent* current = 0; + DIR* dp = opendir(path); + if (!dp) + return; + + while ((current = readdir(dp)) != 0) + { + int len = strlen(current->d_name); + if (len > 4 && strncmp(current->d_name+len-4, ext, 4) == 0) + { + fileListAdd(list, current->d_name); + } + } + closedir(dp); +#endif + + if (list.size > 1) + qsort(list.files, list.size, sizeof(char*), cmp); +} diff --git a/dep/recastnavigation/RecastDemo/Source/InputGeom.cpp b/dep/recastnavigation/RecastDemo/Source/InputGeom.cpp new file mode 100644 index 000000000..46ff657b6 --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Source/InputGeom.cpp @@ -0,0 +1,512 @@ +// +// Copyright (c) 2009-2010 Mikko Mononen memon@inside.org +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. +// + +#define _USE_MATH_DEFINES +#include +#include +#include +#include +#include "Recast.h" +#include "InputGeom.h" +#include "ChunkyTriMesh.h" +#include "MeshLoaderObj.h" +#include "DebugDraw.h" +#include "RecastDebugDraw.h" +#include "DetourNavMesh.h" + +static bool intersectSegmentTriangle(const float* sp, const float* sq, + const float* a, const float* b, const float* c, + float &t) +{ + float v, w; + float ab[3], ac[3], qp[3], ap[3], norm[3], e[3]; + rcVsub(ab, b, a); + rcVsub(ac, c, a); + rcVsub(qp, sp, sq); + + // Compute triangle normal. Can be precalculated or cached if + // intersecting multiple segments against the same triangle + rcVcross(norm, ab, ac); + + // Compute denominator d. If d <= 0, segment is parallel to or points + // away from triangle, so exit early + float d = rcVdot(qp, norm); + if (d <= 0.0f) return false; + + // Compute intersection t value of pq with plane of triangle. A ray + // intersects iff 0 <= t. Segment intersects iff 0 <= t <= 1. Delay + // dividing by d until intersection has been found to pierce triangle + rcVsub(ap, sp, a); + t = rcVdot(ap, norm); + if (t < 0.0f) return false; + if (t > d) return false; // For segment; exclude this code line for a ray test + + // Compute barycentric coordinate components and test if within bounds + rcVcross(e, qp, ap); + v = rcVdot(ac, e); + if (v < 0.0f || v > d) return false; + w = -rcVdot(ab, e); + if (w < 0.0f || v + w > d) return false; + + // Segment/ray intersects triangle. Perform delayed division + t /= d; + + return true; +} + +static char* parseRow(char* buf, char* bufEnd, char* row, int len) +{ + bool start = true; + bool done = false; + int n = 0; + while (!done && buf < bufEnd) + { + char c = *buf; + buf++; + // multirow + switch (c) + { + case '\n': + if (start) break; + done = true; + break; + case '\r': + break; + case '\t': + case ' ': + if (start) break; + default: + start = false; + row[n++] = c; + if (n >= len-1) + done = true; + break; + } + } + row[n] = '\0'; + return buf; +} + + + +InputGeom::InputGeom() : + m_chunkyMesh(0), + m_mesh(0), + m_offMeshConCount(0), + m_volumeCount(0) +{ +} + +InputGeom::~InputGeom() +{ + delete m_chunkyMesh; + delete m_mesh; +} + +bool InputGeom::loadMesh(rcContext* ctx, const char* filepath) +{ + if (m_mesh) + { + delete m_chunkyMesh; + m_chunkyMesh = 0; + delete m_mesh; + m_mesh = 0; + } + m_offMeshConCount = 0; + m_volumeCount = 0; + + m_mesh = new myMeshLoaderObj; + if (!m_mesh) + { + ctx->log(RC_LOG_ERROR, "loadMesh: Out of memory 'm_mesh'."); + return false; + } + if (!m_mesh->load(filepath)) + { + ctx->log(RC_LOG_ERROR, "buildTiledNavigation: Could not load '%s'", filepath); + return false; + } + + rcCalcBounds(m_mesh->getVerts(), m_mesh->getVertCount(), m_meshBMin, m_meshBMax); + + m_chunkyMesh = new rcChunkyTriMesh; + if (!m_chunkyMesh) + { + ctx->log(RC_LOG_ERROR, "buildTiledNavigation: Out of memory 'm_chunkyMesh'."); + return false; + } + if (!rcCreateChunkyTriMesh(m_mesh->getVerts(), m_mesh->getTris(), m_mesh->getTriCount(), 256, m_chunkyMesh)) + { + ctx->log(RC_LOG_ERROR, "buildTiledNavigation: Failed to build chunky mesh."); + return false; + } + + return true; +} + +bool InputGeom::load(rcContext* ctx, const char* filePath) +{ + char* buf = 0; + FILE* fp = fopen(filePath, "rb"); + if (!fp) + return false; + fseek(fp, 0, SEEK_END); + int bufSize = ftell(fp); + fseek(fp, 0, SEEK_SET); + buf = new char[bufSize]; + if (!buf) + { + fclose(fp); + return false; + } + fread(buf, bufSize, 1, fp); + fclose(fp); + + m_offMeshConCount = 0; + m_volumeCount = 0; + delete m_mesh; + m_mesh = 0; + + char* src = buf; + char* srcEnd = buf + bufSize; + char row[512]; + while (src < srcEnd) + { + // Parse one row + row[0] = '\0'; + src = parseRow(src, srcEnd, row, sizeof(row)/sizeof(char)); + if (row[0] == 'f') + { + // File name. + const char* name = row+1; + // Skip white spaces + while (*name && isspace(*name)) + name++; + if (*name) + { + if (!loadMesh(ctx, name)) + { + delete [] buf; + return false; + } + } + } + else if (row[0] == 'c') + { + // Off-mesh connection + if (m_offMeshConCount < MAX_OFFMESH_CONNECTIONS) + { + float* v = &m_offMeshConVerts[m_offMeshConCount*3*2]; + int bidir, area = 0, flags = 0; + float rad; + sscanf(row+1, "%f %f %f %f %f %f %f %d %d %d", + &v[0], &v[1], &v[2], &v[3], &v[4], &v[5], &rad, &bidir, &area, &flags); + m_offMeshConRads[m_offMeshConCount] = rad; + m_offMeshConDirs[m_offMeshConCount] = (unsigned char)bidir; + m_offMeshConAreas[m_offMeshConCount] = (unsigned char)area; + m_offMeshConFlags[m_offMeshConCount] = (unsigned short)flags; + m_offMeshConCount++; + } + } + else if (row[0] == 'v') + { + // Convex volumes + if (m_volumeCount < MAX_VOLUMES) + { + ConvexVolume* vol = &m_volumes[m_volumeCount++]; + sscanf(row+1, "%d %d %f %f", &vol->nverts, &vol->area, &vol->hmin, &vol->hmax); + for (int i = 0; i < vol->nverts; ++i) + { + row[0] = '\0'; + src = parseRow(src, srcEnd, row, sizeof(row)/sizeof(char)); + sscanf(row, "%f %f %f", &vol->verts[i*3+0], &vol->verts[i*3+1], &vol->verts[i*3+2]); + } + } + } + } + + delete [] buf; + + return true; +} + +bool InputGeom::save(const char* filepath) +{ + if (!m_mesh) return false; + + FILE* fp = fopen(filepath, "w"); + if (!fp) return false; + + // Store mesh filename. + fprintf(fp, "f %s\n", m_mesh->getFileName()); + + // Store off-mesh links. + for (int i = 0; i < m_offMeshConCount; ++i) + { + const float* v = &m_offMeshConVerts[i*3*2]; + const float rad = m_offMeshConRads[i]; + const int bidir = m_offMeshConDirs[i]; + const int area = m_offMeshConAreas[i]; + const int flags = m_offMeshConFlags[i]; + fprintf(fp, "c %f %f %f %f %f %f %f %d %d %d\n", + v[0], v[1], v[2], v[3], v[4], v[5], rad, bidir, area, flags); + } + + // Convex volumes + for (int i = 0; i < m_volumeCount; ++i) + { + ConvexVolume* vol = &m_volumes[i]; + fprintf(fp, "v %d %d %f %f\n", vol->nverts, vol->area, vol->hmin, vol->hmax); + for (int i = 0; i < vol->nverts; ++i) + fprintf(fp, "%f %f %f\n", vol->verts[i*3+0], vol->verts[i*3+1], vol->verts[i*3+2]); + } + + fclose(fp); + + return true; +} + +static bool isectSegAABB(const float* sp, const float* sq, + const float* amin, const float* amax, + float& tmin, float& tmax) +{ + static const float EPS = 1e-6f; + + float d[3]; + d[0] = sq[0] - sp[0]; + d[1] = sq[1] - sp[1]; + d[2] = sq[2] - sp[2]; + tmin = 0.0; + tmax = 1.0f; + + for (int i = 0; i < 3; i++) + { + if (fabsf(d[i]) < EPS) + { + if (sp[i] < amin[i] || sp[i] > amax[i]) + return false; + } + else + { + const float ood = 1.0f / d[i]; + float t1 = (amin[i] - sp[i]) * ood; + float t2 = (amax[i] - sp[i]) * ood; + if (t1 > t2) { float tmp = t1; t1 = t2; t2 = tmp; } + if (t1 > tmin) tmin = t1; + if (t2 < tmax) tmax = t2; + if (tmin > tmax) return false; + } + } + + return true; +} + + +bool InputGeom::raycastMesh(float* src, float* dst, float& tmin) +{ + float dir[3]; + rcVsub(dir, dst, src); + + // Prune hit ray. + float btmin, btmax; + if (!isectSegAABB(src, dst, m_meshBMin, m_meshBMax, btmin, btmax)) + return false; + float p[2], q[2]; + p[0] = src[0] + (dst[0]-src[0])*btmin; + p[1] = src[2] + (dst[2]-src[2])*btmin; + q[0] = src[0] + (dst[0]-src[0])*btmax; + q[1] = src[2] + (dst[2]-src[2])*btmax; + + int cid[512]; + const int ncid = rcGetChunksOverlappingSegment(m_chunkyMesh, p, q, cid, 512); + if (!ncid) + return false; + + tmin = 1.0f; + bool hit = false; + const float* verts = m_mesh->getVerts(); + + for (int i = 0; i < ncid; ++i) + { + const rcChunkyTriMeshNode& node = m_chunkyMesh->nodes[cid[i]]; + const int* tris = &m_chunkyMesh->tris[node.i*3]; + const int ntris = node.n; + + for (int j = 0; j < ntris*3; j += 3) + { + float t = 1; + if (intersectSegmentTriangle(src, dst, + &verts[tris[j]*3], + &verts[tris[j+1]*3], + &verts[tris[j+2]*3], t)) + { + if (t < tmin) + tmin = t; + hit = true; + } + } + } + + return hit; +} + +void InputGeom::addOffMeshConnection(const float* spos, const float* epos, const float rad, + unsigned char bidir, unsigned char area, unsigned short flags) +{ + if (m_offMeshConCount >= MAX_OFFMESH_CONNECTIONS) return; + float* v = &m_offMeshConVerts[m_offMeshConCount*3*2]; + m_offMeshConRads[m_offMeshConCount] = rad; + m_offMeshConDirs[m_offMeshConCount] = bidir; + m_offMeshConAreas[m_offMeshConCount] = area; + m_offMeshConFlags[m_offMeshConCount] = flags; + m_offMeshConId[m_offMeshConCount] = 1000 + m_offMeshConCount; + rcVcopy(&v[0], spos); + rcVcopy(&v[3], epos); + m_offMeshConCount++; +} + +void InputGeom::deleteOffMeshConnection(int i) +{ + m_offMeshConCount--; + float* src = &m_offMeshConVerts[m_offMeshConCount*3*2]; + float* dst = &m_offMeshConVerts[i*3*2]; + rcVcopy(&dst[0], &src[0]); + rcVcopy(&dst[3], &src[3]); + m_offMeshConRads[i] = m_offMeshConRads[m_offMeshConCount]; + m_offMeshConDirs[i] = m_offMeshConDirs[m_offMeshConCount]; + m_offMeshConAreas[i] = m_offMeshConAreas[m_offMeshConCount]; + m_offMeshConFlags[i] = m_offMeshConFlags[m_offMeshConCount]; +} + +void InputGeom::drawOffMeshConnections(duDebugDraw* dd, bool hilight) +{ + unsigned int conColor = duRGBA(192,0,128,192); + unsigned int baseColor = duRGBA(0,0,0,64); + dd->depthMask(false); + + dd->begin(DU_DRAW_LINES, 2.0f); + for (int i = 0; i < m_offMeshConCount; ++i) + { + float* v = &m_offMeshConVerts[i*3*2]; + + dd->vertex(v[0],v[1],v[2], baseColor); + dd->vertex(v[0],v[1]+0.2f,v[2], baseColor); + + dd->vertex(v[3],v[4],v[5], baseColor); + dd->vertex(v[3],v[4]+0.2f,v[5], baseColor); + + duAppendCircle(dd, v[0],v[1]+0.1f,v[2], m_offMeshConRads[i], baseColor); + duAppendCircle(dd, v[3],v[4]+0.1f,v[5], m_offMeshConRads[i], baseColor); + + if (hilight) + { + duAppendArc(dd, v[0],v[1],v[2], v[3],v[4],v[5], 0.25f, + (m_offMeshConDirs[i]&1) ? 0.6f : 0.0f, 0.6f, conColor); + } + } + dd->end(); + + dd->depthMask(true); +} + +void InputGeom::addConvexVolume(const float* verts, const int nverts, + const float minh, const float maxh, unsigned char area) +{ + if (m_volumeCount >= MAX_VOLUMES) return; + ConvexVolume* vol = &m_volumes[m_volumeCount++]; + memset(vol, 0, sizeof(ConvexVolume)); + memcpy(vol->verts, verts, sizeof(float)*3*nverts); + vol->hmin = minh; + vol->hmax = maxh; + vol->nverts = nverts; + vol->area = area; +} + +void InputGeom::deleteConvexVolume(int i) +{ + m_volumeCount--; + m_volumes[i] = m_volumes[m_volumeCount]; +} + +void InputGeom::drawConvexVolumes(struct duDebugDraw* dd, bool /*hilight*/) +{ + dd->depthMask(false); + + dd->begin(DU_DRAW_TRIS); + + for (int i = 0; i < m_volumeCount; ++i) + { + const ConvexVolume* vol = &m_volumes[i]; + unsigned int col = duIntToCol(vol->area, 32); + for (int j = 0, k = vol->nverts-1; j < vol->nverts; k = j++) + { + const float* va = &vol->verts[k*3]; + const float* vb = &vol->verts[j*3]; + + dd->vertex(vol->verts[0],vol->hmax,vol->verts[2], col); + dd->vertex(vb[0],vol->hmax,vb[2], col); + dd->vertex(va[0],vol->hmax,va[2], col); + + dd->vertex(va[0],vol->hmin,va[2], duDarkenCol(col)); + dd->vertex(va[0],vol->hmax,va[2], col); + dd->vertex(vb[0],vol->hmax,vb[2], col); + + dd->vertex(va[0],vol->hmin,va[2], duDarkenCol(col)); + dd->vertex(vb[0],vol->hmax,vb[2], col); + dd->vertex(vb[0],vol->hmin,vb[2], duDarkenCol(col)); + } + } + + dd->end(); + + dd->begin(DU_DRAW_LINES, 2.0f); + for (int i = 0; i < m_volumeCount; ++i) + { + const ConvexVolume* vol = &m_volumes[i]; + unsigned int col = duIntToCol(vol->area, 220); + for (int j = 0, k = vol->nverts-1; j < vol->nverts; k = j++) + { + const float* va = &vol->verts[k*3]; + const float* vb = &vol->verts[j*3]; + dd->vertex(va[0],vol->hmin,va[2], duDarkenCol(col)); + dd->vertex(vb[0],vol->hmin,vb[2], duDarkenCol(col)); + dd->vertex(va[0],vol->hmax,va[2], col); + dd->vertex(vb[0],vol->hmax,vb[2], col); + dd->vertex(va[0],vol->hmin,va[2], duDarkenCol(col)); + dd->vertex(va[0],vol->hmax,va[2], col); + } + } + dd->end(); + + dd->begin(DU_DRAW_POINTS, 3.0f); + for (int i = 0; i < m_volumeCount; ++i) + { + const ConvexVolume* vol = &m_volumes[i]; + unsigned int col = duDarkenCol(duIntToCol(vol->area, 255)); + for (int j = 0; j < vol->nverts; ++j) + { + dd->vertex(vol->verts[j*3+0],vol->verts[j*3+1]+0.1f,vol->verts[j*3+2], col); + dd->vertex(vol->verts[j*3+0],vol->hmin,vol->verts[j*3+2], col); + dd->vertex(vol->verts[j*3+0],vol->hmax,vol->verts[j*3+2], col); + } + } + dd->end(); + + + dd->depthMask(true); +} diff --git a/dep/recastnavigation/RecastDemo/Source/MeshLoaderObj.cpp b/dep/recastnavigation/RecastDemo/Source/MeshLoaderObj.cpp new file mode 100644 index 000000000..182822083 --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Source/MeshLoaderObj.cpp @@ -0,0 +1,229 @@ +// +// Copyright (c) 2009-2010 Mikko Mononen memon@inside.org +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. +// + +#include "MeshLoaderObj.h" +#include +#include +#include +#define _USE_MATH_DEFINES +#include + +rcMeshLoaderObj::rcMeshLoaderObj() : + m_verts(0), + m_tris(0), + m_normals(0), + m_vertCount(0), + m_triCount(0) +{ +} + +rcMeshLoaderObj::~rcMeshLoaderObj() +{ + delete [] m_verts; + delete [] m_normals; + delete [] m_tris; +} + +void rcMeshLoaderObj::addVertex(float x, float y, float z, int& cap) +{ + if (m_vertCount+1 > cap) + { + cap = !cap ? 8 : cap*2; + float* nv = new float[cap*3]; + if (m_vertCount) + memcpy(nv, m_verts, m_vertCount*3*sizeof(float)); + delete [] m_verts; + m_verts = nv; + } + float* dst = &m_verts[m_vertCount*3]; + *dst++ = x; + *dst++ = y; + *dst++ = z; + m_vertCount++; +} + +void rcMeshLoaderObj::addTriangle(int a, int b, int c, int& cap) +{ + if (m_triCount+1 > cap) + { + cap = !cap ? 8 : cap*2; + int* nv = new int[cap*3]; + if (m_triCount) + memcpy(nv, m_tris, m_triCount*3*sizeof(int)); + delete [] m_tris; + m_tris = nv; + } + int* dst = &m_tris[m_triCount*3]; + *dst++ = a; + *dst++ = b; + *dst++ = c; + m_triCount++; +} + +static char* parseRow(char* buf, char* bufEnd, char* row, int len) +{ + bool cont = false; + bool start = true; + bool done = false; + int n = 0; + while (!done && buf < bufEnd) + { + char c = *buf; + buf++; + // multirow + switch (c) + { + case '\\': + cont = true; // multirow + break; + case '\n': + if (start) break; + done = true; + break; + case '\r': + break; + case '\t': + case ' ': + if (start) break; + default: + start = false; + cont = false; + row[n++] = c; + if (n >= len-1) + done = true; + break; + } + } + row[n] = '\0'; + return buf; +} + +static int parseFace(char* row, int* data, int n, int vcnt) +{ + int j = 0; + while (*row != '\0') + { + // Skip initial white space + while (*row != '\0' && (*row == ' ' || *row == '\t')) + row++; + char* s = row; + // Find vertex delimiter and terminated the string there for conversion. + while (*row != '\0' && *row != ' ' && *row != '\t') + { + if (*row == '/') *row = '\0'; + row++; + } + if (*s == '\0') + continue; + int vi = atoi(s); + data[j++] = vi < 0 ? vi+vcnt : vi-1; + if (j >= n) return j; + } + return j; +} + +bool rcMeshLoaderObj::load(const char* filename) +{ + char* buf = 0; + FILE* fp = fopen(filename, "rb"); + if (!fp) + return false; + fseek(fp, 0, SEEK_END); + int bufSize = ftell(fp); + fseek(fp, 0, SEEK_SET); + buf = new char[bufSize]; + if (!buf) + { + fclose(fp); + return false; + } + fread(buf, bufSize, 1, fp); + fclose(fp); + + char* src = buf; + char* srcEnd = buf + bufSize; + char row[512]; + int face[32]; + float x,y,z; + int nv; + int vcap = 0; + int tcap = 0; + + while (src < srcEnd) + { + // Parse one row + row[0] = '\0'; + src = parseRow(src, srcEnd, row, sizeof(row)/sizeof(char)); + // Skip comments + if (row[0] == '#') continue; + if (row[0] == 'v' && row[1] != 'n' && row[1] != 't') + { + // Vertex pos + sscanf(row+1, "%f %f %f", &x, &y, &z); + addVertex(x, y, z, vcap); + } + if (row[0] == 'f') + { + // Faces + nv = parseFace(row+1, face, 32, m_vertCount); + for (int i = 2; i < nv; ++i) + { + const int a = face[0]; + const int b = face[i-1]; + const int c = face[i]; + if (a < 0 || a >= m_vertCount || b < 0 || b >= m_vertCount || c < 0 || c >= m_vertCount) + continue; + addTriangle(a, b, c, tcap); + } + } + } + + delete [] buf; + + // Calculate normals. + m_normals = new float[m_triCount*3]; + for (int i = 0; i < m_triCount*3; i += 3) + { + const float* v0 = &m_verts[m_tris[i]*3]; + const float* v1 = &m_verts[m_tris[i+1]*3]; + const float* v2 = &m_verts[m_tris[i+2]*3]; + float e0[3], e1[3]; + for (int j = 0; j < 3; ++j) + { + e0[j] = v1[j] - v0[j]; + e1[j] = v2[j] - v0[j]; + } + float* n = &m_normals[i]; + n[0] = e0[1]*e1[2] - e0[2]*e1[1]; + n[1] = e0[2]*e1[0] - e0[0]*e1[2]; + n[2] = e0[0]*e1[1] - e0[1]*e1[0]; + float d = sqrtf(n[0]*n[0] + n[1]*n[1] + n[2]*n[2]); + if (d > 0) + { + d = 1.0f/d; + n[0] *= d; + n[1] *= d; + n[2] *= d; + } + } + + strncpy(m_filename, filename, sizeof(m_filename)); + m_filename[sizeof(m_filename)-1] = '\0'; + + return true; +} diff --git a/dep/recastnavigation/RecastDemo/Source/NavMeshTesterTool.cpp b/dep/recastnavigation/RecastDemo/Source/NavMeshTesterTool.cpp new file mode 100644 index 000000000..38b06e4a3 --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Source/NavMeshTesterTool.cpp @@ -0,0 +1,1216 @@ +// +// Copyright (c) 2009-2010 Mikko Mononen memon@inside.org +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. +// + +#define _USE_MATH_DEFINES +#include +#include +#include +#include "SDL.h" +#include "SDL_opengl.h" +#include "imgui.h" +#include "NavMeshTesterTool.h" +#include "Sample.h" +#include "Recast.h" +#include "RecastDebugDraw.h" +#include "DetourNavMesh.h" +#include "DetourNavMeshBuilder.h" +#include "DetourDebugDraw.h" +#include "DetourCommon.h" + +#ifdef WIN32 +# define snprintf _snprintf +#endif + +// Uncomment this to dump all the requests in stdout. +#define DUMP_REQS + +inline bool inRange(const float* v1, const float* v2, const float r, const float h) +{ + const float dx = v2[0] - v1[0]; + const float dy = v2[1] - v1[1]; + const float dz = v2[2] - v1[2]; + return (dx*dx + dz*dz) < r*r && fabsf(dy) < h; +} + + +static int fixupCorridor(dtPolyRef* path, const int npath, const int maxPath, + const dtPolyRef* visited, const int nvisited) +{ + int furthestPath = -1; + int furthestVisited = -1; + + // Find furthest common polygon. + for (int i = npath-1; i >= 0; --i) + { + bool found = false; + for (int j = nvisited-1; j >= 0; --j) + { + if (path[i] == visited[j]) + { + furthestPath = i; + furthestVisited = j; + found = true; + } + } + if (found) + break; + } + + // If no intersection found just return current path. + if (furthestPath == -1 || furthestVisited == -1) + return npath; + + // Concatenate paths. + + // Adjust beginning of the buffer to include the visited. + const int req = nvisited - furthestVisited; + const int orig = rcMin(furthestPath+1, npath); + int size = rcMax(0, npath-orig); + if (req+size > maxPath) + size = maxPath-req; + if (size) + memmove(path+req, path+orig, size*sizeof(dtPolyRef)); + + // Store visited + for (int i = 0; i < req; ++i) + path[i] = visited[(nvisited-1)-i]; + + return req+size; +} + +static bool getSteerTarget(dtNavMeshQuery* navQuery, const float* startPos, const float* endPos, + const float minTargetDist, + const dtPolyRef* path, const int pathSize, + float* steerPos, unsigned char& steerPosFlag, dtPolyRef& steerPosRef, + float* outPoints = 0, int* outPointCount = 0) +{ + // Find steer target. + static const int MAX_STEER_POINTS = 3; + float steerPath[MAX_STEER_POINTS*3]; + unsigned char steerPathFlags[MAX_STEER_POINTS]; + dtPolyRef steerPathPolys[MAX_STEER_POINTS]; + int nsteerPath = 0; + navQuery->findStraightPath(startPos, endPos, path, pathSize, + steerPath, steerPathFlags, steerPathPolys, &nsteerPath, MAX_STEER_POINTS); + if (!nsteerPath) + return false; + + if (outPoints && outPointCount) + { + *outPointCount = nsteerPath; + for (int i = 0; i < nsteerPath; ++i) + dtVcopy(&outPoints[i*3], &steerPath[i*3]); + } + + + // Find vertex far enough to steer to. + int ns = 0; + while (ns < nsteerPath) + { + // Stop at Off-Mesh link or when point is further than slop away. + if ((steerPathFlags[ns] & DT_STRAIGHTPATH_OFFMESH_CONNECTION) || + !inRange(&steerPath[ns*3], startPos, minTargetDist, 1000.0f)) + break; + ns++; + } + // Failed to find good point to steer to. + if (ns >= nsteerPath) + return false; + + dtVcopy(steerPos, &steerPath[ns*3]); + steerPos[1] = startPos[1]; + steerPosFlag = steerPathFlags[ns]; + steerPosRef = steerPathPolys[ns]; + + return true; +} + + +NavMeshTesterTool::NavMeshTesterTool() : + m_sample(0), + m_navMesh(0), + m_navQuery(0), + m_pathFindStatus(DT_FAILURE), + m_toolMode(TOOLMODE_PATHFIND_FOLLOW), + m_startRef(0), + m_endRef(0), + m_npolys(0), + m_nstraightPath(0), + m_nsmoothPath(0), + m_hitResult(false), + m_distanceToWall(0), + m_sposSet(false), + m_eposSet(false), + m_pathIterNum(0), + m_steerPointCount(0) +{ + m_filter.setIncludeFlags(SAMPLE_POLYFLAGS_ALL); + m_filter.setExcludeFlags(0); + + m_polyPickExt[0] = 2; + m_polyPickExt[1] = 4; + m_polyPickExt[2] = 2; + + m_neighbourhoodRadius = 2.5f; +} + +NavMeshTesterTool::~NavMeshTesterTool() +{ +} + +void NavMeshTesterTool::init(Sample* sample) +{ + m_sample = sample; + m_navMesh = sample->getNavMesh(); + m_navQuery = sample->getNavMeshQuery(); + recalc(); + + if (m_navQuery) + { + // Change costs. + m_filter.setAreaCost(SAMPLE_POLYAREA_GROUND, 1.0f); + m_filter.setAreaCost(SAMPLE_POLYAREA_WATER, 10.0f); + m_filter.setAreaCost(SAMPLE_POLYAREA_ROAD, 1.0f); + m_filter.setAreaCost(SAMPLE_POLYAREA_DOOR, 1.0f); + m_filter.setAreaCost(SAMPLE_POLYAREA_GRASS, 2.0f); + m_filter.setAreaCost(SAMPLE_POLYAREA_JUMP, 1.5f); + } + + m_neighbourhoodRadius = sample->getAgentRadius() * 20.0f; +} + +void NavMeshTesterTool::handleMenu() +{ + if (imguiCheck("Pathfind Follow", m_toolMode == TOOLMODE_PATHFIND_FOLLOW)) + { + m_toolMode = TOOLMODE_PATHFIND_FOLLOW; + recalc(); + } + if (imguiCheck("Pathfind Straight", m_toolMode == TOOLMODE_PATHFIND_STRAIGHT)) + { + m_toolMode = TOOLMODE_PATHFIND_STRAIGHT; + recalc(); + } + if (imguiCheck("Pathfind Sliced", m_toolMode == TOOLMODE_PATHFIND_SLICED)) + { + m_toolMode = TOOLMODE_PATHFIND_SLICED; + recalc(); + } + + imguiSeparator(); + + if (imguiCheck("Distance to Wall", m_toolMode == TOOLMODE_DISTANCE_TO_WALL)) + { + m_toolMode = TOOLMODE_DISTANCE_TO_WALL; + recalc(); + } + + imguiSeparator(); + + if (imguiCheck("Raycast", m_toolMode == TOOLMODE_RAYCAST)) + { + m_toolMode = TOOLMODE_RAYCAST; + recalc(); + } + + imguiSeparator(); + + if (imguiCheck("Find Polys in Circle", m_toolMode == TOOLMODE_FIND_POLYS_IN_CIRCLE)) + { + m_toolMode = TOOLMODE_FIND_POLYS_IN_CIRCLE; + recalc(); + } + if (imguiCheck("Find Polys in Shape", m_toolMode == TOOLMODE_FIND_POLYS_IN_SHAPE)) + { + m_toolMode = TOOLMODE_FIND_POLYS_IN_SHAPE; + recalc(); + } + + imguiSeparator(); + + if (imguiCheck("Find Local Neighbourhood", m_toolMode == TOOLMODE_FIND_LOCAL_NEIGHBOURHOOD)) + { + m_toolMode = TOOLMODE_FIND_LOCAL_NEIGHBOURHOOD; + recalc(); + } + + imguiSeparator(); + + imguiLabel("Include Flags"); + + imguiIndent(); + if (imguiCheck("Walk", (m_filter.getIncludeFlags() & SAMPLE_POLYFLAGS_WALK) != 0)) + { + m_filter.setIncludeFlags(m_filter.getIncludeFlags() ^ SAMPLE_POLYFLAGS_WALK); + recalc(); + } + if (imguiCheck("Swim", (m_filter.getIncludeFlags() & SAMPLE_POLYFLAGS_SWIM) != 0)) + { + m_filter.setIncludeFlags(m_filter.getIncludeFlags() ^ SAMPLE_POLYFLAGS_SWIM); + recalc(); + } + if (imguiCheck("Door", (m_filter.getIncludeFlags() & SAMPLE_POLYFLAGS_DOOR) != 0)) + { + m_filter.setIncludeFlags(m_filter.getIncludeFlags() ^ SAMPLE_POLYFLAGS_DOOR); + recalc(); + } + if (imguiCheck("Jump", (m_filter.getIncludeFlags() & SAMPLE_POLYFLAGS_JUMP) != 0)) + { + m_filter.setIncludeFlags(m_filter.getIncludeFlags() ^ SAMPLE_POLYFLAGS_JUMP); + recalc(); + } + imguiUnindent(); + + imguiSeparator(); + imguiLabel("Exclude Flags"); + + imguiIndent(); + if (imguiCheck("Walk", (m_filter.getExcludeFlags() & SAMPLE_POLYFLAGS_WALK) != 0)) + { + m_filter.setExcludeFlags(m_filter.getExcludeFlags() ^ SAMPLE_POLYFLAGS_WALK); + recalc(); + } + if (imguiCheck("Swim", (m_filter.getExcludeFlags() & SAMPLE_POLYFLAGS_SWIM) != 0)) + { + m_filter.setExcludeFlags(m_filter.getExcludeFlags() ^ SAMPLE_POLYFLAGS_SWIM); + recalc(); + } + if (imguiCheck("Door", (m_filter.getExcludeFlags() & SAMPLE_POLYFLAGS_DOOR) != 0)) + { + m_filter.setExcludeFlags(m_filter.getExcludeFlags() ^ SAMPLE_POLYFLAGS_DOOR); + recalc(); + } + if (imguiCheck("Jump", (m_filter.getExcludeFlags() & SAMPLE_POLYFLAGS_JUMP) != 0)) + { + m_filter.setExcludeFlags(m_filter.getExcludeFlags() ^ SAMPLE_POLYFLAGS_JUMP); + recalc(); + } + imguiUnindent(); + + imguiSeparator(); +} + +void NavMeshTesterTool::handleClick(const float* /*s*/, const float* p, bool shift) +{ + if (shift) + { + m_sposSet = true; + dtVcopy(m_spos, p); + } + else + { + m_eposSet = true; + dtVcopy(m_epos, p); + } + recalc(); +} + +void NavMeshTesterTool::handleStep() +{ +} + +void NavMeshTesterTool::handleToggle() +{ + // TODO: merge separate to a path iterator. Use same code in recalc() too. + if (m_toolMode != TOOLMODE_PATHFIND_FOLLOW) + return; + + if (!m_sposSet || !m_eposSet || !m_startRef || !m_endRef) + return; + + static const float STEP_SIZE = 0.5f; + static const float SLOP = 0.01f; + + if (m_pathIterNum == 0) + { + m_navQuery->findPath(m_startRef, m_endRef, m_spos, m_epos, &m_filter, m_polys, &m_npolys, MAX_POLYS); + m_nsmoothPath = 0; + + m_pathIterPolyCount = m_npolys; + if (m_pathIterPolyCount) + memcpy(m_pathIterPolys, m_polys, sizeof(dtPolyRef)*m_pathIterPolyCount); + + if (m_pathIterPolyCount) + { + // Iterate over the path to find smooth path on the detail mesh surface. + + m_navQuery->closestPointOnPolyBoundary(m_startRef, m_spos, m_iterPos); + m_navQuery->closestPointOnPolyBoundary(m_pathIterPolys[m_pathIterPolyCount-1], m_epos, m_targetPos); + + m_nsmoothPath = 0; + + dtVcopy(&m_smoothPath[m_nsmoothPath*3], m_iterPos); + m_nsmoothPath++; + } + } + + dtVcopy(m_prevIterPos, m_iterPos); + + m_pathIterNum++; + + if (!m_pathIterPolyCount) + return; + + if (m_nsmoothPath >= MAX_SMOOTH) + return; + + // Move towards target a small advancement at a time until target reached or + // when ran out of memory to store the path. + + // Find location to steer towards. + float steerPos[3]; + unsigned char steerPosFlag; + dtPolyRef steerPosRef; + + if (!getSteerTarget(m_navQuery, m_iterPos, m_targetPos, SLOP, + m_pathIterPolys, m_pathIterPolyCount, steerPos, steerPosFlag, steerPosRef, + m_steerPoints, &m_steerPointCount)) + return; + + dtVcopy(m_steerPos, steerPos); + + bool endOfPath = (steerPosFlag & DT_STRAIGHTPATH_END) ? true : false; + bool offMeshConnection = (steerPosFlag & DT_STRAIGHTPATH_OFFMESH_CONNECTION) ? true : false; + + // Find movement delta. + float delta[3], len; + dtVsub(delta, steerPos, m_iterPos); + len = sqrtf(dtVdot(delta,delta)); + // If the steer target is end of path or off-mesh link, do not move past the location. + if ((endOfPath || offMeshConnection) && len < STEP_SIZE) + len = 1; + else + len = STEP_SIZE / len; + float moveTgt[3]; + dtVmad(moveTgt, m_iterPos, delta, len); + + // Move + float result[3]; + dtPolyRef visited[16]; + int nvisited = 0; + m_navQuery->moveAlongSurface(m_pathIterPolys[0], m_iterPos, moveTgt, &m_filter, + result, visited, &nvisited, 16); + m_pathIterPolyCount = fixupCorridor(m_pathIterPolys, m_pathIterPolyCount, MAX_POLYS, visited, nvisited); + float h = 0; + m_navQuery->getPolyHeight(m_pathIterPolys[0], result, &h); + result[1] = h; + dtVcopy(m_iterPos, result); + + // Handle end of path and off-mesh links when close enough. + if (endOfPath && inRange(m_iterPos, steerPos, SLOP, 1.0f)) + { + // Reached end of path. + dtVcopy(m_iterPos, m_targetPos); + if (m_nsmoothPath < MAX_SMOOTH) + { + dtVcopy(&m_smoothPath[m_nsmoothPath*3], m_iterPos); + m_nsmoothPath++; + } + return; + } + else if (offMeshConnection && inRange(m_iterPos, steerPos, SLOP, 1.0f)) + { + // Reached off-mesh connection. + float startPos[3], endPos[3]; + + // Advance the path up to and over the off-mesh connection. + dtPolyRef prevRef = 0, polyRef = m_pathIterPolys[0]; + int npos = 0; + while (npos < m_pathIterPolyCount && polyRef != steerPosRef) + { + prevRef = polyRef; + polyRef = m_pathIterPolys[npos]; + npos++; + } + for (int i = npos; i < m_pathIterPolyCount; ++i) + m_pathIterPolys[i-npos] = m_pathIterPolys[i]; + m_pathIterPolyCount -= npos; + + // Handle the connection. + if (m_navMesh->getOffMeshConnectionPolyEndPoints(prevRef, polyRef, startPos, endPos) == DT_SUCCESS) + { + if (m_nsmoothPath < MAX_SMOOTH) + { + dtVcopy(&m_smoothPath[m_nsmoothPath*3], startPos); + m_nsmoothPath++; + // Hack to make the dotted path not visible during off-mesh connection. + if (m_nsmoothPath & 1) + { + dtVcopy(&m_smoothPath[m_nsmoothPath*3], startPos); + m_nsmoothPath++; + } + } + // Move position at the other side of the off-mesh link. + dtVcopy(m_iterPos, endPos); + float h; + m_navQuery->getPolyHeight(m_pathIterPolys[0], m_iterPos, &h); + m_iterPos[1] = h; + } + } + + // Store results. + if (m_nsmoothPath < MAX_SMOOTH) + { + dtVcopy(&m_smoothPath[m_nsmoothPath*3], m_iterPos); + m_nsmoothPath++; + } + +} + +void NavMeshTesterTool::handleUpdate(const float /*dt*/) +{ + if (m_toolMode == TOOLMODE_PATHFIND_SLICED) + { + if (m_pathFindStatus == DT_IN_PROGRESS) + { + m_pathFindStatus = m_navQuery->updateSlicedFindPath(1); + } + + if (m_pathFindStatus == DT_SUCCESS) + { + m_navQuery->finalizeSlicedFindPath(m_polys, &m_npolys, MAX_POLYS); + m_nstraightPath = 0; + if (m_npolys) + { + // In case of partial path, make sure the end point is clamped to the last polygon. + float epos[3]; + dtVcopy(epos, m_epos); + if (m_polys[m_npolys-1] != m_endRef) + m_navQuery->closestPointOnPoly(m_polys[m_npolys-1], m_epos, epos); + + m_navQuery->findStraightPath(m_spos, epos, m_polys, m_npolys, + m_straightPath, m_straightPathFlags, + m_straightPathPolys, &m_nstraightPath, MAX_POLYS); + } + + m_pathFindStatus = DT_FAILURE; + } + } +} + +void NavMeshTesterTool::reset() +{ + m_startRef = 0; + m_endRef = 0; + m_npolys = 0; + m_nstraightPath = 0; + m_nsmoothPath = 0; + memset(m_hitPos, 0, sizeof(m_hitPos)); + memset(m_hitNormal, 0, sizeof(m_hitNormal)); + m_distanceToWall = 0; +} + + +void NavMeshTesterTool::recalc() +{ + if (!m_navMesh) + return; + + if (m_sposSet) + m_navQuery->findNearestPoly(m_spos, m_polyPickExt, &m_filter, &m_startRef, 0); + else + m_startRef = 0; + + if (m_eposSet) + m_navQuery->findNearestPoly(m_epos, m_polyPickExt, &m_filter, &m_endRef, 0); + else + m_endRef = 0; + + m_pathFindStatus = DT_FAILURE; + + if (m_toolMode == TOOLMODE_PATHFIND_FOLLOW) + { + m_pathIterNum = 0; + if (m_sposSet && m_eposSet && m_startRef && m_endRef) + { +#ifdef DUMP_REQS + printf("pi %f %f %f %f %f %f 0x%x 0x%x\n", + m_spos[0],m_spos[1],m_spos[2], m_epos[0],m_epos[1],m_epos[2], + m_filter.getIncludeFlags(), m_filter.getExcludeFlags()); +#endif + + m_navQuery->findPath(m_startRef, m_endRef, m_spos, m_epos, &m_filter, m_polys, &m_npolys, MAX_POLYS); + + m_nsmoothPath = 0; + + if (m_npolys) + { + // Iterate over the path to find smooth path on the detail mesh surface. + dtPolyRef polys[MAX_POLYS]; + memcpy(polys, m_polys, sizeof(dtPolyRef)*m_npolys); + int npolys = m_npolys; + + float iterPos[3], targetPos[3]; + m_navQuery->closestPointOnPolyBoundary(m_startRef, m_spos, iterPos); + m_navQuery->closestPointOnPolyBoundary(polys[npolys-1], m_epos, targetPos); + + static const float STEP_SIZE = 0.5f; + static const float SLOP = 0.01f; + + m_nsmoothPath = 0; + + dtVcopy(&m_smoothPath[m_nsmoothPath*3], iterPos); + m_nsmoothPath++; + + // Move towards target a small advancement at a time until target reached or + // when ran out of memory to store the path. + while (npolys && m_nsmoothPath < MAX_SMOOTH) + { + // Find location to steer towards. + float steerPos[3]; + unsigned char steerPosFlag; + dtPolyRef steerPosRef; + + if (!getSteerTarget(m_navQuery, iterPos, targetPos, SLOP, + polys, npolys, steerPos, steerPosFlag, steerPosRef)) + break; + + bool endOfPath = (steerPosFlag & DT_STRAIGHTPATH_END) ? true : false; + bool offMeshConnection = (steerPosFlag & DT_STRAIGHTPATH_OFFMESH_CONNECTION) ? true : false; + + // Find movement delta. + float delta[3], len; + dtVsub(delta, steerPos, iterPos); + len = dtSqrt(dtVdot(delta,delta)); + // If the steer target is end of path or off-mesh link, do not move past the location. + if ((endOfPath || offMeshConnection) && len < STEP_SIZE) + len = 1; + else + len = STEP_SIZE / len; + float moveTgt[3]; + dtVmad(moveTgt, iterPos, delta, len); + + // Move + float result[3]; + dtPolyRef visited[16]; + int nvisited = 0; + m_navQuery->moveAlongSurface(polys[0], iterPos, moveTgt, &m_filter, + result, visited, &nvisited, 16); + + npolys = fixupCorridor(polys, npolys, MAX_POLYS, visited, nvisited); + float h = 0; + m_navQuery->getPolyHeight(polys[0], result, &h); + result[1] = h; + dtVcopy(iterPos, result); + + // Handle end of path and off-mesh links when close enough. + if (endOfPath && inRange(iterPos, steerPos, SLOP, 1.0f)) + { + // Reached end of path. + dtVcopy(iterPos, targetPos); + if (m_nsmoothPath < MAX_SMOOTH) + { + dtVcopy(&m_smoothPath[m_nsmoothPath*3], iterPos); + m_nsmoothPath++; + } + break; + } + else if (offMeshConnection && inRange(iterPos, steerPos, SLOP, 1.0f)) + { + // Reached off-mesh connection. + float startPos[3], endPos[3]; + + // Advance the path up to and over the off-mesh connection. + dtPolyRef prevRef = 0, polyRef = polys[0]; + int npos = 0; + while (npos < npolys && polyRef != steerPosRef) + { + prevRef = polyRef; + polyRef = polys[npos]; + npos++; + } + for (int i = npos; i < npolys; ++i) + polys[i-npos] = polys[i]; + npolys -= npos; + + // Handle the connection. + if (m_navMesh->getOffMeshConnectionPolyEndPoints(prevRef, polyRef, startPos, endPos) == DT_SUCCESS) + { + if (m_nsmoothPath < MAX_SMOOTH) + { + dtVcopy(&m_smoothPath[m_nsmoothPath*3], startPos); + m_nsmoothPath++; + // Hack to make the dotted path not visible during off-mesh connection. + if (m_nsmoothPath & 1) + { + dtVcopy(&m_smoothPath[m_nsmoothPath*3], startPos); + m_nsmoothPath++; + } + } + // Move position at the other side of the off-mesh link. + dtVcopy(iterPos, endPos); + float h; + m_navQuery->getPolyHeight(polys[0], iterPos, &h); + iterPos[1] = h; + } + } + + // Store results. + if (m_nsmoothPath < MAX_SMOOTH) + { + dtVcopy(&m_smoothPath[m_nsmoothPath*3], iterPos); + m_nsmoothPath++; + } + } + } + + } + else + { + m_npolys = 0; + m_nsmoothPath = 0; + } + } + else if (m_toolMode == TOOLMODE_PATHFIND_STRAIGHT) + { + if (m_sposSet && m_eposSet && m_startRef && m_endRef) + { +#ifdef DUMP_REQS + printf("ps %f %f %f %f %f %f 0x%x 0x%x\n", + m_spos[0],m_spos[1],m_spos[2], m_epos[0],m_epos[1],m_epos[2], + m_filter.getIncludeFlags(), m_filter.getExcludeFlags()); +#endif + m_navQuery->findPath(m_startRef, m_endRef, m_spos, m_epos, &m_filter, m_polys, &m_npolys, MAX_POLYS); + m_nstraightPath = 0; + if (m_npolys) + { + // In case of partial path, make sure the end point is clamped to the last polygon. + float epos[3]; + dtVcopy(epos, m_epos); + if (m_polys[m_npolys-1] != m_endRef) + m_navQuery->closestPointOnPoly(m_polys[m_npolys-1], m_epos, epos); + + m_navQuery->findStraightPath(m_spos, epos, m_polys, m_npolys, + m_straightPath, m_straightPathFlags, + m_straightPathPolys, &m_nstraightPath, MAX_POLYS); + } + } + else + { + m_npolys = 0; + m_nstraightPath = 0; + } + } + else if (m_toolMode == TOOLMODE_PATHFIND_SLICED) + { + if (m_sposSet && m_eposSet && m_startRef && m_endRef) + { +#ifdef DUMP_REQS + printf("ps %f %f %f %f %f %f 0x%x 0x%x\n", + m_spos[0],m_spos[1],m_spos[2], m_epos[0],m_epos[1],m_epos[2], + m_filter.getIncludeFlags(), m_filter.getExcludeFlags()); +#endif + m_npolys = 0; + m_nstraightPath = 0; + + m_pathFindStatus = m_navQuery->initSlicedFindPath(m_startRef, m_endRef, m_spos, m_epos, &m_filter); + } + else + { + m_npolys = 0; + m_nstraightPath = 0; + } + } + else if (m_toolMode == TOOLMODE_RAYCAST) + { + m_nstraightPath = 0; + if (m_sposSet && m_eposSet && m_startRef) + { +#ifdef DUMP_REQS + printf("rc %f %f %f %f %f %f 0x%x 0x%x\n", + m_spos[0],m_spos[1],m_spos[2], m_epos[0],m_epos[1],m_epos[2], + m_filter.getIncludeFlags(), m_filter.getExcludeFlags()); +#endif + float t = 0; + m_npolys = 0; + m_nstraightPath = 2; + m_straightPath[0] = m_spos[0]; + m_straightPath[1] = m_spos[1]; + m_straightPath[2] = m_spos[2]; + m_navQuery->raycast(m_startRef, m_spos, m_epos, &m_filter, &t, m_hitNormal, m_polys, &m_npolys, MAX_POLYS); + if (t > 1) + { + // No hit + dtVcopy(m_hitPos, m_epos); + m_hitResult = false; + } + else + { + // Hit + m_hitPos[0] = m_spos[0] + (m_epos[0] - m_spos[0]) * t; + m_hitPos[1] = m_spos[1] + (m_epos[1] - m_spos[1]) * t; + m_hitPos[2] = m_spos[2] + (m_epos[2] - m_spos[2]) * t; + if (m_npolys) + { + float h = 0; + m_navQuery->getPolyHeight(m_polys[m_npolys-1], m_hitPos, &h); + m_hitPos[1] = h; + } + m_hitResult = true; + } + dtVcopy(&m_straightPath[3], m_hitPos); + } + } + else if (m_toolMode == TOOLMODE_DISTANCE_TO_WALL) + { + m_distanceToWall = 0; + if (m_sposSet && m_startRef) + { +#ifdef DUMP_REQS + printf("dw %f %f %f %f 0x%x 0x%x\n", + m_spos[0],m_spos[1],m_spos[2], 100.0f, + m_filter.getIncludeFlags(), m_filter.getExcludeFlags()); +#endif + m_distanceToWall = 0.0f; + m_navQuery->findDistanceToWall(m_startRef, m_spos, 100.0f, &m_filter, &m_distanceToWall, m_hitPos, m_hitNormal); + } + } + else if (m_toolMode == TOOLMODE_FIND_POLYS_IN_CIRCLE) + { + if (m_sposSet && m_startRef && m_eposSet) + { + const float dx = m_epos[0] - m_spos[0]; + const float dz = m_epos[2] - m_spos[2]; + float dist = sqrtf(dx*dx + dz*dz); +#ifdef DUMP_REQS + printf("fpc %f %f %f %f 0x%x 0x%x\n", + m_spos[0],m_spos[1],m_spos[2], dist, + m_filter.getIncludeFlags(), m_filter.getExcludeFlags()); +#endif + m_navQuery->findPolysAroundCircle(m_startRef, m_spos, dist, &m_filter, + m_polys, m_parent, 0, &m_npolys, MAX_POLYS); + + } + } + else if (m_toolMode == TOOLMODE_FIND_POLYS_IN_SHAPE) + { + if (m_sposSet && m_startRef && m_eposSet) + { + const float nx = (m_epos[2] - m_spos[2])*0.25f; + const float nz = -(m_epos[0] - m_spos[0])*0.25f; + const float agentHeight = m_sample ? m_sample->getAgentHeight() : 0; + + m_queryPoly[0] = m_spos[0] + nx*1.2f; + m_queryPoly[1] = m_spos[1] + agentHeight/2; + m_queryPoly[2] = m_spos[2] + nz*1.2f; + + m_queryPoly[3] = m_spos[0] - nx*1.3f; + m_queryPoly[4] = m_spos[1] + agentHeight/2; + m_queryPoly[5] = m_spos[2] - nz*1.3f; + + m_queryPoly[6] = m_epos[0] - nx*0.8f; + m_queryPoly[7] = m_epos[1] + agentHeight/2; + m_queryPoly[8] = m_epos[2] - nz*0.8f; + + m_queryPoly[9] = m_epos[0] + nx; + m_queryPoly[10] = m_epos[1] + agentHeight/2; + m_queryPoly[11] = m_epos[2] + nz; + +#ifdef DUMP_REQS + printf("fpp %f %f %f %f %f %f %f %f %f %f %f %f 0x%x 0x%x\n", + m_queryPoly[0],m_queryPoly[1],m_queryPoly[2], + m_queryPoly[3],m_queryPoly[4],m_queryPoly[5], + m_queryPoly[6],m_queryPoly[7],m_queryPoly[8], + m_queryPoly[9],m_queryPoly[10],m_queryPoly[11], + m_filter.getIncludeFlags(), m_filter.getExcludeFlags()); +#endif + m_navQuery->findPolysAroundShape(m_startRef, m_queryPoly, 4, &m_filter, + m_polys, m_parent, 0, &m_npolys, MAX_POLYS); + } + } + else if (m_toolMode == TOOLMODE_FIND_LOCAL_NEIGHBOURHOOD) + { + if (m_sposSet && m_startRef) + { +#ifdef DUMP_REQS + printf("fln %f %f %f %f 0x%x 0x%x\n", + m_spos[0],m_spos[1],m_spos[2], m_neighbourhoodRadius, + m_filter.getIncludeFlags(), m_filter.getExcludeFlags()); +#endif + m_navQuery->findLocalNeighbourhood(m_startRef, m_spos, m_neighbourhoodRadius, &m_filter, + m_polys, m_parent, &m_npolys, MAX_POLYS); + } + } +} + +static void getPolyCenter(dtNavMesh* navMesh, dtPolyRef ref, float* center) +{ + center[0] = 0; + center[1] = 0; + center[2] = 0; + + const dtMeshTile* tile = 0; + const dtPoly* poly = 0; + if (navMesh->getTileAndPolyByRef(ref, &tile, &poly) != DT_SUCCESS) + return; + + for (int i = 0; i < (int)poly->vertCount; ++i) + { + const float* v = &tile->verts[poly->verts[i]*3]; + center[0] += v[0]; + center[1] += v[1]; + center[2] += v[2]; + } + const float s = 1.0f / poly->vertCount; + center[0] *= s; + center[1] *= s; + center[2] *= s; +} + + + +void NavMeshTesterTool::handleRender() +{ + DebugDrawGL dd; + + static const unsigned int startCol = duRGBA(128,25,0,192); + static const unsigned int endCol = duRGBA(51,102,0,129); + static const unsigned int pathCol = duRGBA(0,0,0,64); + + const float agentRadius = m_sample->getAgentRadius(); + const float agentHeight = m_sample->getAgentHeight(); + const float agentClimb = m_sample->getAgentClimb(); + + dd.depthMask(false); + if (m_sposSet) + drawAgent(m_spos, agentRadius, agentHeight, agentClimb, startCol); + if (m_eposSet) + drawAgent(m_epos, agentRadius, agentHeight, agentClimb, endCol); + dd.depthMask(true); + + if (!m_navMesh) + { + return; + } + + if (m_toolMode == TOOLMODE_PATHFIND_FOLLOW) + { + duDebugDrawNavMeshPoly(&dd, *m_navMesh, m_startRef, startCol); + duDebugDrawNavMeshPoly(&dd, *m_navMesh, m_endRef, endCol); + + if (m_npolys) + { + for (int i = 1; i < m_npolys-1; ++i) + duDebugDrawNavMeshPoly(&dd, *m_navMesh, m_polys[i], pathCol); + } + + if (m_nsmoothPath) + { + dd.depthMask(false); + const unsigned int pathCol = duRGBA(0,0,0,220); + dd.begin(DU_DRAW_LINES, 3.0f); + for (int i = 0; i < m_nsmoothPath; ++i) + dd.vertex(m_smoothPath[i*3], m_smoothPath[i*3+1]+0.1f, m_smoothPath[i*3+2], pathCol); + dd.end(); + dd.depthMask(true); + } + + if (m_pathIterNum) + { + duDebugDrawNavMeshPoly(&dd, *m_navMesh, m_pathIterPolys[0], duRGBA(255,255,255,128)); + + dd.depthMask(false); + dd.begin(DU_DRAW_LINES, 1.0f); + + const unsigned int prevCol = duRGBA(255,192,0,220); + const unsigned int curCol = duRGBA(255,255,255,220); + const unsigned int steerCol = duRGBA(0,192,255,220); + + dd.vertex(m_prevIterPos[0],m_prevIterPos[1]-0.3f,m_prevIterPos[2], prevCol); + dd.vertex(m_prevIterPos[0],m_prevIterPos[1]+0.3f,m_prevIterPos[2], prevCol); + + dd.vertex(m_iterPos[0],m_iterPos[1]-0.3f,m_iterPos[2], curCol); + dd.vertex(m_iterPos[0],m_iterPos[1]+0.3f,m_iterPos[2], curCol); + + dd.vertex(m_prevIterPos[0],m_prevIterPos[1]+0.3f,m_prevIterPos[2], prevCol); + dd.vertex(m_iterPos[0],m_iterPos[1]+0.3f,m_iterPos[2], prevCol); + + dd.vertex(m_prevIterPos[0],m_prevIterPos[1]+0.3f,m_prevIterPos[2], steerCol); + dd.vertex(m_steerPos[0],m_steerPos[1]+0.3f,m_steerPos[2], steerCol); + + for (int i = 0; i < m_steerPointCount-1; ++i) + { + dd.vertex(m_steerPoints[i*3+0],m_steerPoints[i*3+1]+0.2f,m_steerPoints[i*3+2], duDarkenCol(steerCol)); + dd.vertex(m_steerPoints[(i+1)*3+0],m_steerPoints[(i+1)*3+1]+0.2f,m_steerPoints[(i+1)*3+2], duDarkenCol(steerCol)); + } + + dd.end(); + dd.depthMask(true); + } + } + else if (m_toolMode == TOOLMODE_PATHFIND_STRAIGHT || m_toolMode == TOOLMODE_PATHFIND_SLICED) + { + duDebugDrawNavMeshPoly(&dd, *m_navMesh, m_startRef, startCol); + duDebugDrawNavMeshPoly(&dd, *m_navMesh, m_endRef, endCol); + + if (m_npolys) + { + for (int i = 1; i < m_npolys-1; ++i) + duDebugDrawNavMeshPoly(&dd, *m_navMesh, m_polys[i], pathCol); + } + + if (m_nstraightPath) + { + dd.depthMask(false); + const unsigned int pathCol = duRGBA(64,16,0,220); + const unsigned int offMeshCol = duRGBA(128,96,0,220); + dd.begin(DU_DRAW_LINES, 2.0f); + for (int i = 0; i < m_nstraightPath-1; ++i) + { + unsigned int col = 0; + if (m_straightPathFlags[i] & DT_STRAIGHTPATH_OFFMESH_CONNECTION) + col = offMeshCol; + else + col = pathCol; + + dd.vertex(m_straightPath[i*3], m_straightPath[i*3+1]+0.4f, m_straightPath[i*3+2], col); + dd.vertex(m_straightPath[(i+1)*3], m_straightPath[(i+1)*3+1]+0.4f, m_straightPath[(i+1)*3+2], col); + } + dd.end(); + dd.begin(DU_DRAW_POINTS, 6.0f); + for (int i = 0; i < m_nstraightPath; ++i) + { + unsigned int col = 0; + if (m_straightPathFlags[i] & DT_STRAIGHTPATH_START) + col = startCol; + else if (m_straightPathFlags[i] & DT_STRAIGHTPATH_START) + col = endCol; + else if (m_straightPathFlags[i] & DT_STRAIGHTPATH_OFFMESH_CONNECTION) + col = offMeshCol; + else + col = pathCol; + dd.vertex(m_straightPath[i*3], m_straightPath[i*3+1]+0.4f, m_straightPath[i*3+2], pathCol); + } + dd.end(); + dd.depthMask(true); + } + } + else if (m_toolMode == TOOLMODE_RAYCAST) + { + duDebugDrawNavMeshPoly(&dd, *m_navMesh, m_startRef, startCol); + + if (m_nstraightPath) + { + for (int i = 1; i < m_npolys; ++i) + duDebugDrawNavMeshPoly(&dd, *m_navMesh, m_polys[i], pathCol); + + dd.depthMask(false); + const unsigned int pathCol = m_hitResult ? duRGBA(64,16,0,220) : duRGBA(240,240,240,220); + dd.begin(DU_DRAW_LINES, 2.0f); + for (int i = 0; i < m_nstraightPath-1; ++i) + { + dd.vertex(m_straightPath[i*3], m_straightPath[i*3+1]+0.4f, m_straightPath[i*3+2], pathCol); + dd.vertex(m_straightPath[(i+1)*3], m_straightPath[(i+1)*3+1]+0.4f, m_straightPath[(i+1)*3+2], pathCol); + } + dd.end(); + dd.begin(DU_DRAW_POINTS, 4.0f); + for (int i = 0; i < m_nstraightPath; ++i) + dd.vertex(m_straightPath[i*3], m_straightPath[i*3+1]+0.4f, m_straightPath[i*3+2], pathCol); + dd.end(); + + if (m_hitResult) + { + const unsigned int hitCol = duRGBA(0,0,0,128); + dd.begin(DU_DRAW_LINES, 2.0f); + dd.vertex(m_hitPos[0], m_hitPos[1] + 0.4f, m_hitPos[2], hitCol); + dd.vertex(m_hitPos[0] + m_hitNormal[0]*agentRadius, + m_hitPos[1] + 0.4f + m_hitNormal[1]*agentRadius, + m_hitPos[2] + m_hitNormal[2]*agentRadius, hitCol); + dd.end(); + } + dd.depthMask(true); + } + } + else if (m_toolMode == TOOLMODE_DISTANCE_TO_WALL) + { + duDebugDrawNavMeshPoly(&dd, *m_navMesh, m_startRef, startCol); + dd.depthMask(false); + duDebugDrawCircle(&dd, m_spos[0], m_spos[1]+agentHeight/2, m_spos[2], m_distanceToWall, duRGBA(64,16,0,220), 2.0f); + dd.begin(DU_DRAW_LINES, 3.0f); + dd.vertex(m_hitPos[0], m_hitPos[1] + 0.02f, m_hitPos[2], duRGBA(0,0,0,192)); + dd.vertex(m_hitPos[0], m_hitPos[1] + agentHeight, m_hitPos[2], duRGBA(0,0,0,192)); + dd.end(); + dd.depthMask(true); + } + else if (m_toolMode == TOOLMODE_FIND_POLYS_IN_CIRCLE) + { + for (int i = 0; i < m_npolys; ++i) + { + duDebugDrawNavMeshPoly(&dd, *m_navMesh, m_polys[i], pathCol); + dd.depthMask(false); + if (m_parent[i]) + { + float p0[3], p1[3]; + dd.depthMask(false); + getPolyCenter(m_navMesh, m_parent[i], p0); + getPolyCenter(m_navMesh, m_polys[i], p1); + duDebugDrawArc(&dd, p0[0],p0[1],p0[2], p1[0],p1[1],p1[2], 0.25f, 0.0f, 0.4f, duRGBA(0,0,0,128), 2.0f); + dd.depthMask(true); + } + dd.depthMask(true); + } + + if (m_sposSet && m_eposSet) + { + dd.depthMask(false); + const float dx = m_epos[0] - m_spos[0]; + const float dz = m_epos[2] - m_spos[2]; + const float dist = sqrtf(dx*dx + dz*dz); + duDebugDrawCircle(&dd, m_spos[0], m_spos[1]+agentHeight/2, m_spos[2], dist, duRGBA(64,16,0,220), 2.0f); + dd.depthMask(true); + } + } + else if (m_toolMode == TOOLMODE_FIND_POLYS_IN_SHAPE) + { + for (int i = 0; i < m_npolys; ++i) + { + duDebugDrawNavMeshPoly(&dd, *m_navMesh, m_polys[i], pathCol); + dd.depthMask(false); + if (m_parent[i]) + { + float p0[3], p1[3]; + dd.depthMask(false); + getPolyCenter(m_navMesh, m_parent[i], p0); + getPolyCenter(m_navMesh, m_polys[i], p1); + duDebugDrawArc(&dd, p0[0],p0[1],p0[2], p1[0],p1[1],p1[2], 0.25f, 0.0f, 0.4f, duRGBA(0,0,0,128), 2.0f); + dd.depthMask(true); + } + dd.depthMask(true); + } + + if (m_sposSet && m_eposSet) + { + dd.depthMask(false); + const unsigned int col = duRGBA(64,16,0,220); + dd.begin(DU_DRAW_LINES, 2.0f); + for (int i = 0, j = 3; i < 4; j=i++) + { + const float* p0 = &m_queryPoly[j*3]; + const float* p1 = &m_queryPoly[i*3]; + dd.vertex(p0, col); + dd.vertex(p1, col); + } + dd.end(); + dd.depthMask(true); + } + } + else if (m_toolMode == TOOLMODE_FIND_LOCAL_NEIGHBOURHOOD) + { + for (int i = 0; i < m_npolys; ++i) + { + duDebugDrawNavMeshPoly(&dd, *m_navMesh, m_polys[i], pathCol); + dd.depthMask(false); + if (m_parent[i]) + { + float p0[3], p1[3]; + dd.depthMask(false); + getPolyCenter(m_navMesh, m_parent[i], p0); + getPolyCenter(m_navMesh, m_polys[i], p1); + duDebugDrawArc(&dd, p0[0],p0[1],p0[2], p1[0],p1[1],p1[2], 0.25f, 0.0f, 0.4f, duRGBA(0,0,0,128), 2.0f); + dd.depthMask(true); + } + + static const int MAX_SEGS = DT_VERTS_PER_POLYGON*2; + float segs[MAX_SEGS*6]; + int nsegs = 0; + m_navQuery->getPolyWallSegments(m_polys[i], &m_filter, segs, &nsegs, MAX_SEGS); + dd.begin(DU_DRAW_LINES, 2.0f); + for (int j = 0; j < nsegs; ++j) + { + const float* s = &segs[j*6]; + + // Skip too distant segments. + float tseg; + float distSqr = dtDistancePtSegSqr2D(m_spos, s, s+3, tseg); + if (distSqr > dtSqr(m_neighbourhoodRadius)) + continue; + + float delta[3], norm[3], p0[3], p1[3]; + dtVsub(delta, s+3,s); + dtVmad(p0, s, delta, 0.5f); + norm[0] = delta[2]; + norm[1] = 0; + norm[2] = -delta[0]; + dtVnormalize(norm); + dtVmad(p1, p0, norm, agentRadius*0.5f); + + // Skip backfacing segments. + unsigned int col = duRGBA(255,255,255,192); + if (dtTriArea2D(m_spos, s, s+3) < 0.0f) + col = duRGBA(255,255,255,64); + + dd.vertex(p0[0],p0[1]+agentClimb,p0[2],duRGBA(0,0,0,128)); + dd.vertex(p1[0],p1[1]+agentClimb,p1[2],duRGBA(0,0,0,128)); + + dd.vertex(s[0],s[1]+agentClimb,s[2],col); + dd.vertex(s[3],s[4]+agentClimb,s[5],col); + } + dd.end(); + + dd.depthMask(true); + } + + if (m_sposSet) + { + dd.depthMask(false); + duDebugDrawCircle(&dd, m_spos[0], m_spos[1]+agentHeight/2, m_spos[2], m_neighbourhoodRadius, duRGBA(64,16,0,220), 2.0f); + dd.depthMask(true); + } + } +} + +void NavMeshTesterTool::handleRenderOverlay(double* proj, double* model, int* view) +{ + GLdouble x, y, z; + + // Draw start and end point labels + if (m_sposSet && gluProject((GLdouble)m_spos[0], (GLdouble)m_spos[1], (GLdouble)m_spos[2], + model, proj, view, &x, &y, &z)) + { + imguiDrawText((int)x, (int)(y-25), IMGUI_ALIGN_CENTER, "Start", imguiRGBA(0,0,0,220)); + } + 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, (int)(y-25), IMGUI_ALIGN_CENTER, "End", imguiRGBA(0,0,0,220)); + } +} + +void NavMeshTesterTool::drawAgent(const float* pos, float r, float h, float c, const unsigned int col) +{ + DebugDrawGL dd; + + dd.depthMask(false); + + // Agent dimensions. + duDebugDrawCylinderWire(&dd, pos[0]-r, pos[1]+0.02f, pos[2]-r, pos[0]+r, pos[1]+h, pos[2]+r, col, 2.0f); + + duDebugDrawCircle(&dd, pos[0],pos[1]+c,pos[2],r,duRGBA(0,0,0,64),1.0f); + + unsigned int colb = duRGBA(0,0,0,196); + dd.begin(DU_DRAW_LINES); + dd.vertex(pos[0], pos[1]-c, pos[2], colb); + dd.vertex(pos[0], pos[1]+c, pos[2], colb); + dd.vertex(pos[0]-r/2, pos[1]+0.02f, pos[2], colb); + dd.vertex(pos[0]+r/2, pos[1]+0.02f, pos[2], colb); + dd.vertex(pos[0], pos[1]+0.02f, pos[2]-r/2, colb); + dd.vertex(pos[0], pos[1]+0.02f, pos[2]+r/2, colb); + dd.end(); + + dd.depthMask(true); +} diff --git a/dep/recastnavigation/RecastDemo/Source/OffMeshConnectionTool.cpp b/dep/recastnavigation/RecastDemo/Source/OffMeshConnectionTool.cpp new file mode 100644 index 000000000..ec192a603 --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Source/OffMeshConnectionTool.cpp @@ -0,0 +1,170 @@ +// +// Copyright (c) 2009-2010 Mikko Mononen memon@inside.org +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. +// + +#define _USE_MATH_DEFINES +#include +#include +#include +#include +#include "SDL.h" +#include "SDL_opengl.h" +#include "imgui.h" +#include "OffMeshConnectionTool.h" +#include "InputGeom.h" +#include "Sample.h" +#include "Recast.h" +#include "RecastDebugDraw.h" +#include "DetourDebugDraw.h" + +#ifdef WIN32 +# define snprintf _snprintf +#endif + +OffMeshConnectionTool::OffMeshConnectionTool() : + m_sample(0), + m_hitPosSet(0), + m_bidir(true), + m_oldFlags(0) +{ +} + +OffMeshConnectionTool::~OffMeshConnectionTool() +{ + if (m_sample) + { + m_sample->setNavMeshDrawFlags(m_oldFlags); + } +} + +void OffMeshConnectionTool::init(Sample* sample) +{ + if (m_sample != sample) + { + m_sample = sample; + m_oldFlags = m_sample->getNavMeshDrawFlags(); + m_sample->setNavMeshDrawFlags(m_oldFlags & ~DU_DRAWNAVMESH_OFFMESHCONS); + } +} + +void OffMeshConnectionTool::reset() +{ + m_hitPosSet = false; +} + +void OffMeshConnectionTool::handleMenu() +{ + if (imguiCheck("One Way", !m_bidir)) + m_bidir = false; + if (imguiCheck("Bidirectional", m_bidir)) + m_bidir = true; + + if (!m_hitPosSet) + { + imguiValue("Click to set connection start."); + } + else + { + imguiValue("Click to set connection end."); + } +} + +void OffMeshConnectionTool::handleClick(const float* /*s*/, const float* p, bool shift) +{ + if (!m_sample) return; + InputGeom* geom = m_sample->getInputGeom(); + if (!geom) return; + + if (shift) + { + // Delete + // Find nearest link end-point + float nearestDist = FLT_MAX; + int nearestIndex = -1; + const float* verts = geom->getOffMeshConnectionVerts(); + for (int i = 0; i < geom->getOffMeshConnectionCount()*2; ++i) + { + const float* v = &verts[i*3]; + float d = rcVdistSqr(p, v); + if (d < nearestDist) + { + nearestDist = d; + nearestIndex = i/2; // Each link has two vertices. + } + } + // If end point close enough, delete it. + if (nearestIndex != -1 && + sqrtf(nearestDist) < m_sample->getAgentRadius()) + { + geom->deleteOffMeshConnection(nearestIndex); + } + } + else + { + // Create + if (!m_hitPosSet) + { + rcVcopy(m_hitPos, p); + m_hitPosSet = true; + } + else + { + const unsigned char area = SAMPLE_POLYAREA_JUMP; + const unsigned short flags = SAMPLE_POLYFLAGS_JUMP; + geom->addOffMeshConnection(m_hitPos, p, m_sample->getAgentRadius(), m_bidir ? 1 : 0, area, flags); + m_hitPosSet = false; + } + } + +} + +void OffMeshConnectionTool::handleToggle() +{ +} + +void OffMeshConnectionTool::handleStep() +{ +} + +void OffMeshConnectionTool::handleUpdate(const float /*dt*/) +{ +} + +void OffMeshConnectionTool::handleRender() +{ + DebugDrawGL dd; + const float s = m_sample->getAgentRadius(); + + if (m_hitPosSet) + duDebugDrawCross(&dd, m_hitPos[0],m_hitPos[1]+0.1f,m_hitPos[2], s, duRGBA(0,0,0,128), 2.0f); + + InputGeom* geom = m_sample->getInputGeom(); + if (geom) + geom->drawOffMeshConnections(&dd, true); +} + +void OffMeshConnectionTool::handleRenderOverlay(double* proj, double* model, int* view) +{ + GLdouble x, y, z; + + // Draw start and end point labels + if (m_hitPosSet && gluProject((GLdouble)m_hitPos[0], (GLdouble)m_hitPos[1], (GLdouble)m_hitPos[2], + model, proj, view, &x, &y, &z)) + { + imguiDrawText((int)x, (int)(y-25), IMGUI_ALIGN_CENTER, "Start", imguiRGBA(0,0,0,220)); + } +} diff --git a/dep/recastnavigation/RecastDemo/Source/PerfTimer.cpp b/dep/recastnavigation/RecastDemo/Source/PerfTimer.cpp new file mode 100644 index 000000000..32c08968e --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Source/PerfTimer.cpp @@ -0,0 +1,60 @@ +// +// Copyright (c) 2009-2010 Mikko Mononen memon@inside.org +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. +// + +#include "PerfTimer.h" + +#if defined(WIN32) + +// Win32 +#include + +TimeVal getPerfTime() +{ + __int64 count; + QueryPerformanceCounter((LARGE_INTEGER*)&count); + return count; +} + +int getPerfDeltaTimeUsec(const TimeVal start, const TimeVal end) +{ + static __int64 freq = 0; + if (freq == 0) + QueryPerformanceFrequency((LARGE_INTEGER*)&freq); + __int64 elapsed = end - start; + return (int)(elapsed*1000000 / freq); +} + +#else + +// Linux, BSD, OSX + +#include + +TimeVal getPerfTime() +{ + timeval now; + gettimeofday(&now, 0); + return (TimeVal)now.tv_sec*1000000L + (TimeVal)now.tv_usec; +} + +int getPerfDeltaTimeUsec(const TimeVal start, const TimeVal end) +{ + return (int)(end - start); +} + +#endif diff --git a/dep/recastnavigation/RecastDemo/Source/SDLMain.m b/dep/recastnavigation/RecastDemo/Source/SDLMain.m new file mode 100644 index 000000000..2eaa1c11e --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Source/SDLMain.m @@ -0,0 +1,384 @@ +/* SDLMain.m - main entry point for our Cocoa-ized SDL app + Initial Version: Darrell Walisser + Non-NIB-Code & other changes: Max Horn + + Feel free to customize this file to suit your needs +*/ + +#import "SDL.h" +#import "SDLMain.h" +#import /* for MAXPATHLEN */ +#import + +/* For some reaon, Apple removed setAppleMenu from the headers in 10.4, + but the method still is there and works. To avoid warnings, we declare + it ourselves here. */ +@interface NSApplication(SDL_Missing_Methods) +- (void)setAppleMenu:(NSMenu *)menu; +@end + +/* Use this flag to determine whether we use SDLMain.nib or not */ +#define SDL_USE_NIB_FILE 0 + +/* Use this flag to determine whether we use CPS (docking) or not */ +#define SDL_USE_CPS 1 +#ifdef SDL_USE_CPS +/* Portions of CPS.h */ +typedef struct CPSProcessSerNum +{ + UInt32 lo; + UInt32 hi; +} CPSProcessSerNum; + +extern OSErr CPSGetCurrentProcess( CPSProcessSerNum *psn); +extern OSErr CPSEnableForegroundOperation( CPSProcessSerNum *psn, UInt32 _arg2, UInt32 _arg3, UInt32 _arg4, UInt32 _arg5); +extern OSErr CPSSetFrontProcess( CPSProcessSerNum *psn); + +#endif /* SDL_USE_CPS */ + +static int gArgc; +static char **gArgv; +static BOOL gFinderLaunch; +static BOOL gCalledAppMainline = FALSE; + +static NSString *getApplicationName(void) +{ + NSDictionary *dict; + NSString *appName = 0; + + /* Determine the application name */ + dict = (NSDictionary *)CFBundleGetInfoDictionary(CFBundleGetMainBundle()); + if (dict) + appName = [dict objectForKey: @"CFBundleName"]; + + if (![appName length]) + appName = [[NSProcessInfo processInfo] processName]; + + return appName; +} + +#if SDL_USE_NIB_FILE +/* A helper category for NSString */ +@interface NSString (ReplaceSubString) +- (NSString *)stringByReplacingRange:(NSRange)aRange with:(NSString *)aString; +@end +#endif + +@interface SDLApplication : NSApplication +@end + +@implementation SDLApplication +/* Invoked from the Quit menu item */ +- (void)terminate:(id)sender +{ + /* Post a SDL_QUIT event */ + SDL_Event event; + event.type = SDL_QUIT; + SDL_PushEvent(&event); +} +@end + +/* The main class of the application, the application's delegate */ +@implementation SDLMain + +/* Set the working directory to the .app's parent directory */ +- (void) setupWorkingDirectory:(BOOL)shouldChdir +{ + if (shouldChdir) + { + char parentdir[MAXPATHLEN]; + CFURLRef url = CFBundleCopyBundleURL(CFBundleGetMainBundle()); + CFURLRef url2 = CFURLCreateCopyDeletingLastPathComponent(0, url); + if (CFURLGetFileSystemRepresentation(url2, true, (UInt8 *)parentdir, MAXPATHLEN)) { + assert ( chdir (parentdir) == 0 ); /* chdir to the binary app's parent */ + } + CFRelease(url); + CFRelease(url2); + } + +} + +#if SDL_USE_NIB_FILE + +/* Fix menu to contain the real app name instead of "SDL App" */ +- (void)fixMenu:(NSMenu *)aMenu withAppName:(NSString *)appName +{ + NSRange aRange; + NSEnumerator *enumerator; + NSMenuItem *menuItem; + + aRange = [[aMenu title] rangeOfString:@"SDL App"]; + if (aRange.length != 0) + [aMenu setTitle: [[aMenu title] stringByReplacingRange:aRange with:appName]]; + + enumerator = [[aMenu itemArray] objectEnumerator]; + while ((menuItem = [enumerator nextObject])) + { + aRange = [[menuItem title] rangeOfString:@"SDL App"]; + if (aRange.length != 0) + [menuItem setTitle: [[menuItem title] stringByReplacingRange:aRange with:appName]]; + if ([menuItem hasSubmenu]) + [self fixMenu:[menuItem submenu] withAppName:appName]; + } + [ aMenu sizeToFit ]; +} + +#else + +static void setApplicationMenu(void) +{ + /* warning: this code is very odd */ + NSMenu *appleMenu; + NSMenuItem *menuItem; + NSString *title; + NSString *appName; + + appName = getApplicationName(); + appleMenu = [[NSMenu alloc] initWithTitle:@""]; + + /* Add menu items */ + title = [@"About " stringByAppendingString:appName]; + [appleMenu addItemWithTitle:title action:@selector(orderFrontStandardAboutPanel:) keyEquivalent:@""]; + + [appleMenu addItem:[NSMenuItem separatorItem]]; + + title = [@"Hide " stringByAppendingString:appName]; + [appleMenu addItemWithTitle:title action:@selector(hide:) keyEquivalent:@"h"]; + + menuItem = (NSMenuItem *)[appleMenu addItemWithTitle:@"Hide Others" action:@selector(hideOtherApplications:) keyEquivalent:@"h"]; + [menuItem setKeyEquivalentModifierMask:(NSAlternateKeyMask|NSCommandKeyMask)]; + + [appleMenu addItemWithTitle:@"Show All" action:@selector(unhideAllApplications:) keyEquivalent:@""]; + + [appleMenu addItem:[NSMenuItem separatorItem]]; + + title = [@"Quit " stringByAppendingString:appName]; + [appleMenu addItemWithTitle:title action:@selector(terminate:) keyEquivalent:@"q"]; + + + /* Put menu into the menubar */ + menuItem = [[NSMenuItem alloc] initWithTitle:@"" action:nil keyEquivalent:@""]; + [menuItem setSubmenu:appleMenu]; + [[NSApp mainMenu] addItem:menuItem]; + + /* Tell the application object that this is now the application menu */ + [NSApp setAppleMenu:appleMenu]; + + /* Finally give up our references to the objects */ + [appleMenu release]; + [menuItem release]; +} + +/* Create a window menu */ +static void setupWindowMenu(void) +{ + NSMenu *windowMenu; + NSMenuItem *windowMenuItem; + NSMenuItem *menuItem; + + windowMenu = [[NSMenu alloc] initWithTitle:@"Window"]; + + /* "Minimize" item */ + menuItem = [[NSMenuItem alloc] initWithTitle:@"Minimize" action:@selector(performMiniaturize:) keyEquivalent:@"m"]; + [windowMenu addItem:menuItem]; + [menuItem release]; + + /* Put menu into the menubar */ + windowMenuItem = [[NSMenuItem alloc] initWithTitle:@"Window" action:nil keyEquivalent:@""]; + [windowMenuItem setSubmenu:windowMenu]; + [[NSApp mainMenu] addItem:windowMenuItem]; + + /* Tell the application object that this is now the window menu */ + [NSApp setWindowsMenu:windowMenu]; + + /* Finally give up our references to the objects */ + [windowMenu release]; + [windowMenuItem release]; +} + +/* Replacement for NSApplicationMain */ +static void CustomApplicationMain (int argc, char **argv) +{ + NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; + SDLMain *sdlMain; + + /* Ensure the application object is initialised */ + [SDLApplication sharedApplication]; + +#ifdef SDL_USE_CPS + { + CPSProcessSerNum PSN; + /* Tell the dock about us */ + if (!CPSGetCurrentProcess(&PSN)) + if (!CPSEnableForegroundOperation(&PSN,0x03,0x3C,0x2C,0x1103)) + if (!CPSSetFrontProcess(&PSN)) + [SDLApplication sharedApplication]; + } +#endif /* SDL_USE_CPS */ + + /* Set up the menubar */ + [NSApp setMainMenu:[[NSMenu alloc] init]]; + setApplicationMenu(); + setupWindowMenu(); + + /* Create SDLMain and make it the app delegate */ + sdlMain = [[SDLMain alloc] init]; + [NSApp setDelegate:sdlMain]; + + /* Start the main event loop */ + [NSApp run]; + + [sdlMain release]; + [pool release]; +} + +#endif + + +/* + * Catch document open requests...this lets us notice files when the app + * was launched by double-clicking a document, or when a document was + * dragged/dropped on the app's icon. You need to have a + * CFBundleDocumentsType section in your Info.plist to get this message, + * apparently. + * + * Files are added to gArgv, so to the app, they'll look like command line + * arguments. Previously, apps launched from the finder had nothing but + * an argv[0]. + * + * This message may be received multiple times to open several docs on launch. + * + * This message is ignored once the app's mainline has been called. + */ +- (BOOL)application:(NSApplication *)theApplication openFile:(NSString *)filename +{ + const char *temparg; + size_t arglen; + char *arg; + char **newargv; + + if (!gFinderLaunch) /* MacOS is passing command line args. */ + return FALSE; + + if (gCalledAppMainline) /* app has started, ignore this document. */ + return FALSE; + + temparg = [filename UTF8String]; + arglen = SDL_strlen(temparg) + 1; + arg = (char *) SDL_malloc(arglen); + if (arg == NULL) + return FALSE; + + newargv = (char **) realloc(gArgv, sizeof (char *) * (gArgc + 2)); + if (newargv == NULL) + { + SDL_free(arg); + return FALSE; + } + gArgv = newargv; + + SDL_strlcpy(arg, temparg, arglen); + gArgv[gArgc++] = arg; + gArgv[gArgc] = NULL; + return TRUE; +} + + +/* Called when the internal event loop has just started running */ +- (void) applicationDidFinishLaunching: (NSNotification *) note +{ + int status; + + /* Set the working directory to the .app's parent directory */ + [self setupWorkingDirectory:gFinderLaunch]; + +#if SDL_USE_NIB_FILE + /* Set the main menu to contain the real app name instead of "SDL App" */ + [self fixMenu:[NSApp mainMenu] withAppName:getApplicationName()]; +#endif + + /* Hand off to main application code */ + gCalledAppMainline = TRUE; + status = SDL_main (gArgc, gArgv); + + /* We're done, thank you for playing */ + exit(status); +} +@end + + +@implementation NSString (ReplaceSubString) + +- (NSString *)stringByReplacingRange:(NSRange)aRange with:(NSString *)aString +{ + unsigned int bufferSize; + unsigned int selfLen = [self length]; + unsigned int aStringLen = [aString length]; + unichar *buffer; + NSRange localRange; + NSString *result; + + bufferSize = selfLen + aStringLen - aRange.length; + buffer = NSAllocateMemoryPages(bufferSize*sizeof(unichar)); + + /* Get first part into buffer */ + localRange.location = 0; + localRange.length = aRange.location; + [self getCharacters:buffer range:localRange]; + + /* Get middle part into buffer */ + localRange.location = 0; + localRange.length = aStringLen; + [aString getCharacters:(buffer+aRange.location) range:localRange]; + + /* Get last part into buffer */ + localRange.location = aRange.location + aRange.length; + localRange.length = selfLen - localRange.location; + [self getCharacters:(buffer+aRange.location+aStringLen) range:localRange]; + + /* Build output string */ + result = [NSString stringWithCharacters:buffer length:bufferSize]; + + NSDeallocateMemoryPages(buffer, bufferSize); + + return result; +} + +@end + + + +#ifdef main +# undef main +#endif + + +/* Main entry point to executable - should *not* be SDL_main! */ +int main (int argc, char **argv) +{ + /* Copy the arguments into a global variable */ + /* This is passed if we are launched by double-clicking */ + if ( argc >= 2 && strncmp (argv[1], "-psn", 4) == 0 ) { + gArgv = (char **) SDL_malloc(sizeof (char *) * 2); + gArgv[0] = argv[0]; + gArgv[1] = NULL; + gArgc = 1; + gFinderLaunch = YES; + } else { + int i; + gArgc = argc; + gArgv = (char **) SDL_malloc(sizeof (char *) * (argc+1)); + for (i = 0; i <= argc; i++) + gArgv[i] = argv[i]; + gFinderLaunch = NO; + } + +#if SDL_USE_NIB_FILE + [SDLApplication poseAsClass:[NSApplication class]]; + NSApplicationMain (argc, argv); +#else + CustomApplicationMain (argc, argv); +#endif + return 0; +} + diff --git a/dep/recastnavigation/RecastDemo/Source/Sample.cpp b/dep/recastnavigation/RecastDemo/Source/Sample.cpp new file mode 100644 index 000000000..c437bffa0 --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Source/Sample.cpp @@ -0,0 +1,201 @@ +// +// Copyright (c) 2009-2010 Mikko Mononen memon@inside.org +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. +// + +#define _USE_MATH_DEFINES +#include +#include +#include "Sample.h" +#include "InputGeom.h" +#include "Recast.h" +#include "RecastDebugDraw.h" +#include "DetourDebugDraw.h" +#include "DetourNavMesh.h" +#include "DetourNavMeshQuery.h" +#include "imgui.h" +#include "SDL.h" +#include "SDL_opengl.h" + +#ifdef WIN32 +# define snprintf _snprintf +#endif + +Sample::Sample() : + m_geom(0), + m_navMesh(0), + m_navQuery(0), + m_navMeshDrawFlags(DU_DRAWNAVMESH_OFFMESHCONS|DU_DRAWNAVMESH_CLOSEDLIST), + m_tool(0), + m_ctx(0) +{ + resetCommonSettings(); + m_navQuery = dtAllocNavMeshQuery(); +} + +Sample::~Sample() +{ + dtFreeNavMeshQuery(m_navQuery); + dtFreeNavMesh(m_navMesh); + delete m_tool; +} + +void Sample::setTool(SampleTool* tool) +{ + delete m_tool; + m_tool = tool; + if (tool) + m_tool->init(this); +} + +void Sample::handleSettings() +{ +} + +void Sample::handleTools() +{ +} + +void Sample::handleDebugMode() +{ +} + +void Sample::handleRender() +{ + if (!m_geom) + return; + + DebugDrawGL dd; + + // Draw mesh + duDebugDrawTriMesh(&dd, m_geom->getMesh()->getVerts(), m_geom->getMesh()->getVertCount(), + m_geom->getMesh()->getTris(), m_geom->getMesh()->getNormals(), m_geom->getMesh()->getTriCount(), 0); + // Draw bounds + const float* bmin = m_geom->getMeshBoundsMin(); + const float* bmax = m_geom->getMeshBoundsMax(); + duDebugDrawBoxWire(&dd, bmin[0],bmin[1],bmin[2], bmax[0],bmax[1],bmax[2], duRGBA(255,255,255,128), 1.0f); +} + +void Sample::handleRenderOverlay(double* /*proj*/, double* /*model*/, int* /*view*/) +{ +} + +void Sample::handleMeshChanged(InputGeom* geom) +{ + m_geom = geom; +} + +const float* Sample::getBoundsMin() +{ + if (!m_geom) return 0; + return m_geom->getMeshBoundsMin(); +} + +const float* Sample::getBoundsMax() +{ + if (!m_geom) return 0; + return m_geom->getMeshBoundsMax(); +} + +void Sample::resetCommonSettings() +{ + m_cellSize = 0.3f; + m_cellHeight = 0.2f; + m_agentHeight = 2.0f; + m_agentRadius = 0.6f; + m_agentMaxClimb = 0.9f; + m_agentMaxSlope = 45.0f; + m_regionMinSize = 8; + m_regionMergeSize = 20; + m_edgeMaxLen = 12.0f; + m_edgeMaxError = 1.3f; + m_vertsPerPoly = 6.0f; + m_detailSampleDist = 6.0f; + m_detailSampleMaxError = 1.0f; +} + +void Sample::handleCommonSettings() +{ + imguiLabel("Rasterization"); + imguiSlider("Cell Size", &m_cellSize, 0.1f, 1.0f, 0.01f); + imguiSlider("Cell Height", &m_cellHeight, 0.1f, 1.0f, 0.01f); + + if (m_geom) + { + const float* bmin = m_geom->getMeshBoundsMin(); + const float* bmax = m_geom->getMeshBoundsMax(); + int gw = 0, gh = 0; + rcCalcGridSize(bmin, bmax, m_cellSize, &gw, &gh); + char text[64]; + snprintf(text, 64, "Voxels %d x %d", gw, gh); + imguiValue(text); + } + + imguiSeparator(); + imguiLabel("Agent"); + imguiSlider("Height", &m_agentHeight, 0.1f, 5.0f, 0.1f); + imguiSlider("Radius", &m_agentRadius, 0.0f, 5.0f, 0.1f); + imguiSlider("Max Climb", &m_agentMaxClimb, 0.1f, 5.0f, 0.1f); + imguiSlider("Max Slope", &m_agentMaxSlope, 0.0f, 90.0f, 1.0f); + + imguiSeparator(); + imguiLabel("Region"); + imguiSlider("Min Region Size", &m_regionMinSize, 0.0f, 150.0f, 1.0f); + imguiSlider("Merged Region Size", &m_regionMergeSize, 0.0f, 150.0f, 1.0f); + + imguiSeparator(); + imguiLabel("Polygonization"); + imguiSlider("Max Edge Length", &m_edgeMaxLen, 0.0f, 50.0f, 1.0f); + imguiSlider("Max Edge Error", &m_edgeMaxError, 0.1f, 4.0f, 0.1f); + imguiSlider("Verts Per Poly", &m_vertsPerPoly, 3.0f, 12.0f, 1.0f); + + imguiSeparator(); + imguiLabel("Detail Mesh"); + imguiSlider("Sample Distance", &m_detailSampleDist, 0.0f, 32.0f, 1.0f); + imguiSlider("Max Sample Error", &m_detailSampleMaxError, 0.0f, 16.0f, 1.0f); + + imguiSeparator(); +} + +void Sample::handleClick(const float* s, const float* p, bool shift) +{ + if (m_tool) + m_tool->handleClick(s, p, shift); +} + +void Sample::handleToggle() +{ + if (m_tool) + m_tool->handleToggle(); +} + +void Sample::handleStep() +{ + if (m_tool) + m_tool->handleStep(); +} + +bool Sample::handleBuild() +{ + return true; +} + +void Sample::handleUpdate(const float dt) +{ + if (m_tool) + m_tool->handleUpdate(dt); +} + diff --git a/dep/recastnavigation/RecastDemo/Source/SampleInterfaces.cpp b/dep/recastnavigation/RecastDemo/Source/SampleInterfaces.cpp new file mode 100644 index 000000000..d3d96d6b0 --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Source/SampleInterfaces.cpp @@ -0,0 +1,242 @@ +#define _USE_MATH_DEFINES +#include +#include +#include +#include "SampleInterfaces.h" +#include "Recast.h" +#include "RecastDebugDraw.h" +#include "DetourDebugDraw.h" +#include "PerfTimer.h" +#include "SDL.h" +#include "SDL_opengl.h" + +#ifdef WIN32 +# define snprintf _snprintf +#endif + +//////////////////////////////////////////////////////////////////////////////////////////////////// + +BuildContext::BuildContext() : + m_messageCount(0), + m_textPoolSize(0) +{ + resetTimers(); +} + +BuildContext::~BuildContext() +{ +} + +// Virtual functions for custom implementations. +void BuildContext::doResetLog() +{ + m_messageCount = 0; + m_textPoolSize = 0; +} + +void BuildContext::doLog(const rcLogCategory category, const char* msg, const int len) +{ + if (!len) return; + if (m_messageCount >= MAX_MESSAGES) + return; + char* dst = &m_textPool[m_textPoolSize]; + 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 + *cat = (char)category; + // Store message + const int count = rcMin(len+1, maxtext); + memcpy(text, msg, count); + text[count-1] = '\0'; + m_textPoolSize += 1 + count; + m_messages[m_messageCount++] = dst; +} + +void BuildContext::doResetTimers() +{ + for (int i = 0; i < RC_MAX_TIMERS; ++i) + m_accTime[i] = -1; +} + +void BuildContext::doStartTimer(const rcTimerLabel label) +{ + m_startTime[label] = getPerfTime(); +} + +void BuildContext::doStopTimer(const rcTimerLabel label) +{ + const TimeVal endTime = getPerfTime(); + const int deltaTime = (int)(endTime - m_startTime[label]); + if (m_accTime[label] == -1) + m_accTime[label] = deltaTime; + else + m_accTime[label] += deltaTime; +} + +int BuildContext::doGetAccumulatedTime(const rcTimerLabel label) const +{ + return m_accTime[label]; +} + +void BuildContext::dumpLog(const char* format, ...) +{ + // Print header. + va_list ap; + va_start(ap, format); + vprintf(format, ap); + va_end(ap); + printf("\n"); + + // Print messages + const int TAB_STOPS[4] = { 28, 36, 44, 52 }; + for (int i = 0; i < m_messageCount; ++i) + { + const char* msg = m_messages[i]+1; + int n = 0; + while (*msg) + { + if (*msg == '\t') + { + int count = 1; + for (int j = 0; j < 4; ++j) + { + if (n < TAB_STOPS[j]) + { + count = TAB_STOPS[j] - n; + break; + } + } + while (--count) + { + putchar(' '); + n++; + } + } + else + { + putchar(*msg); + n++; + } + msg++; + } + putchar('\n'); + } +} + +int BuildContext::getLogCount() const +{ + return m_messageCount; +} + +const char* BuildContext::getLogText(const int i) const +{ + return m_messages[i]+1; +} + +//////////////////////////////////////////////////////////////////////////////////////////////////// + +void DebugDrawGL::depthMask(bool state) +{ + glDepthMask(state ? GL_TRUE : GL_FALSE); +} + +void DebugDrawGL::begin(duDebugDrawPrimitives prim, float size) +{ + switch (prim) + { + case DU_DRAW_POINTS: + glPointSize(size); + glBegin(GL_POINTS); + break; + case DU_DRAW_LINES: + glLineWidth(size); + glBegin(GL_LINES); + break; + case DU_DRAW_TRIS: + glBegin(GL_TRIANGLES); + break; + case DU_DRAW_QUADS: + glBegin(GL_QUADS); + break; + }; +} + +void DebugDrawGL::vertex(const float* pos, unsigned int color) +{ + glColor4ubv((GLubyte*)&color); + glVertex3fv(pos); +} + +void DebugDrawGL::vertex(const float x, const float y, const float z, unsigned int color) +{ + glColor4ubv((GLubyte*)&color); + glVertex3f(x,y,z); +} + +void DebugDrawGL::end() +{ + glEnd(); + glLineWidth(1.0f); + glPointSize(1.0f); +} + +//////////////////////////////////////////////////////////////////////////////////////////////////// + +FileIO::FileIO() : + m_fp(0), + m_mode(-1) +{ +} + +FileIO::~FileIO() +{ + if (m_fp) fclose(m_fp); +} + +bool FileIO::openForWrite(const char* path) +{ + if (m_fp) return false; + m_fp = fopen(path, "wb"); + if (!m_fp) return false; + m_mode = 1; + return true; +} + +bool FileIO::openForRead(const char* path) +{ + if (m_fp) return false; + m_fp = fopen(path, "rb"); + if (!m_fp) return false; + m_mode = 2; + return true; +} + +bool FileIO::isWriting() const +{ + return m_mode == 1; +} + +bool FileIO::isReading() const +{ + return m_mode == 2; +} + +bool FileIO::write(const void* ptr, const size_t size) +{ + if (!m_fp || m_mode != 1) return false; + fwrite(ptr, size, 1, m_fp); + return true; +} + +bool FileIO::read(void* ptr, const size_t size) +{ + if (!m_fp || m_mode != 2) return false; + fread(ptr, size, 1, m_fp); + return true; +} + + diff --git a/dep/recastnavigation/RecastDemo/Source/Sample_Debug.cpp b/dep/recastnavigation/RecastDemo/Source/Sample_Debug.cpp new file mode 100644 index 000000000..16c5ac250 --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Source/Sample_Debug.cpp @@ -0,0 +1,391 @@ +// +// Copyright (c) 2009-2010 Mikko Mononen memon@inside.org +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. +// + +#define _USE_MATH_DEFINES +#include +#include +#include "Sample_Debug.h" +#include "InputGeom.h" +#include "Recast.h" +#include "DetourNavMesh.h" +#include "RecastDebugDraw.h" +#include "DetourDebugDraw.h" +#include "RecastDump.h" +#include "imgui.h" +#include "SDL.h" +#include "SDL_opengl.h" + +#include "NavMeshTesterTool.h" +#include "Debug.h" + +#ifdef WIN32 +# define snprintf _snprintf +#endif + +Sample_Debug::Sample_Debug() : Sample_SoloMeshTiled(), + m_hf(0), m_hfCount(0), + m_chf(0), m_chfCount(0), + m_cset(0), m_csetCount(0), + m_pmeshes(0), m_pmeshCount(0), + m_dmeshes(0), m_dmeshCount(0) +{ + resetCommonSettings(); + + setTool(new NavMeshTesterTool); +} + +Sample_Debug::~Sample_Debug() +{ + cleanup(); +} + +void Sample_Debug::cleanup() +{ + rcFreeHeightField(m_hf); + m_hf = 0; + + rcFreeCompactHeightfield(m_chf); + m_chf = 0; + + rcFreeContourSet(m_cset); + m_cset = 0; + + rcFreePolyMesh(m_pmeshes); + m_pmeshes = 0; + + rcFreePolyMeshDetail(m_dmeshes); + m_dmeshes = 0; + + dtFreeNavMesh(m_navMesh); + m_navMesh = 0; +} + + + +void Sample_Debug::handleSettings() +{ +} + +void Sample_Debug::handleTools() +{ + Sample_SoloMeshTiled::handleTools(); +} + +void Sample_Debug::handleDebugMode() +{ + // Check which modes are valid. + bool valid[MAX_DRAWMODE]; + for (int i = 0; i < MAX_DRAWMODE; ++i) + valid[i] = false; + + bool hasChf = false; + bool hasSolid = false; + bool hasCset = false; + bool hasPmesh = false; + bool hasDmesh = false; + + if (m_hf) hasSolid = true; + if (m_chf) hasChf = true; + if (m_cset) hasCset = true; + if (m_pmeshes) hasPmesh = true; + if (m_dmeshes) hasDmesh = true; + + if (m_geom) + { + valid[DRAWMODE_NAVMESH] = m_navMesh != 0; + valid[DRAWMODE_NAVMESH_TRANS] = m_navMesh != 0; + valid[DRAWMODE_NAVMESH_BVTREE] = m_navMesh != 0; + valid[DRAWMODE_NAVMESH_INVIS] = m_navMesh != 0; + valid[DRAWMODE_MESH] = true; + valid[DRAWMODE_VOXELS] = hasSolid; + valid[DRAWMODE_VOXELS_WALKABLE] = hasSolid; + valid[DRAWMODE_COMPACT] = hasChf; + valid[DRAWMODE_COMPACT_DISTANCE] = hasChf; + valid[DRAWMODE_COMPACT_REGIONS] = hasChf; + valid[DRAWMODE_REGION_CONNECTIONS] = hasCset; + valid[DRAWMODE_RAW_CONTOURS] = hasCset; + valid[DRAWMODE_BOTH_CONTOURS] = hasCset; + valid[DRAWMODE_CONTOURS] = hasCset; + valid[DRAWMODE_POLYMESH] = hasPmesh; + valid[DRAWMODE_POLYMESH_DETAIL] = hasDmesh; + } + + int unavail = 0; + for (int i = 0; i < MAX_DRAWMODE; ++i) + if (!valid[i]) unavail++; + + if (unavail == MAX_DRAWMODE) + return; + + imguiLabel("Draw"); + if (imguiCheck("Input Mesh", m_drawMode == DRAWMODE_MESH, valid[DRAWMODE_MESH])) + m_drawMode = DRAWMODE_MESH; + if (imguiCheck("Navmesh", m_drawMode == DRAWMODE_NAVMESH, valid[DRAWMODE_NAVMESH])) + m_drawMode = DRAWMODE_NAVMESH; + if (imguiCheck("Navmesh Invis", m_drawMode == DRAWMODE_NAVMESH_INVIS, valid[DRAWMODE_NAVMESH_INVIS])) + m_drawMode = DRAWMODE_NAVMESH_INVIS; + if (imguiCheck("Navmesh Trans", m_drawMode == DRAWMODE_NAVMESH_TRANS, valid[DRAWMODE_NAVMESH_TRANS])) + m_drawMode = DRAWMODE_NAVMESH_TRANS; + if (imguiCheck("Navmesh BVTree", m_drawMode == DRAWMODE_NAVMESH_BVTREE, valid[DRAWMODE_NAVMESH_BVTREE])) + m_drawMode = DRAWMODE_NAVMESH_BVTREE; + if (imguiCheck("Voxels", m_drawMode == DRAWMODE_VOXELS, valid[DRAWMODE_VOXELS])) + m_drawMode = DRAWMODE_VOXELS; + if (imguiCheck("Walkable Voxels", m_drawMode == DRAWMODE_VOXELS_WALKABLE, valid[DRAWMODE_VOXELS_WALKABLE])) + m_drawMode = DRAWMODE_VOXELS_WALKABLE; + if (imguiCheck("Compact", m_drawMode == DRAWMODE_COMPACT, valid[DRAWMODE_COMPACT])) + m_drawMode = DRAWMODE_COMPACT; + if (imguiCheck("Compact Distance", m_drawMode == DRAWMODE_COMPACT_DISTANCE, valid[DRAWMODE_COMPACT_DISTANCE])) + m_drawMode = DRAWMODE_COMPACT_DISTANCE; + if (imguiCheck("Compact Regions", m_drawMode == DRAWMODE_COMPACT_REGIONS, valid[DRAWMODE_COMPACT_REGIONS])) + m_drawMode = DRAWMODE_COMPACT_REGIONS; + if (imguiCheck("Region Connections", m_drawMode == DRAWMODE_REGION_CONNECTIONS, valid[DRAWMODE_REGION_CONNECTIONS])) + m_drawMode = DRAWMODE_REGION_CONNECTIONS; + if (imguiCheck("Raw Contours", m_drawMode == DRAWMODE_RAW_CONTOURS, valid[DRAWMODE_RAW_CONTOURS])) + m_drawMode = DRAWMODE_RAW_CONTOURS; + if (imguiCheck("Both Contours", m_drawMode == DRAWMODE_BOTH_CONTOURS, valid[DRAWMODE_BOTH_CONTOURS])) + m_drawMode = DRAWMODE_BOTH_CONTOURS; + if (imguiCheck("Contours", m_drawMode == DRAWMODE_CONTOURS, valid[DRAWMODE_CONTOURS])) + m_drawMode = DRAWMODE_CONTOURS; + if (imguiCheck("Poly Mesh", m_drawMode == DRAWMODE_POLYMESH, valid[DRAWMODE_POLYMESH])) + m_drawMode = DRAWMODE_POLYMESH; + if (imguiCheck("Poly Mesh Detail", m_drawMode == DRAWMODE_POLYMESH_DETAIL, valid[DRAWMODE_POLYMESH_DETAIL])) + m_drawMode = DRAWMODE_POLYMESH_DETAIL; +} + +void Sample_Debug::handleRender() +{ + if (!m_geom || !m_geom->getMesh()) + return; + + DebugDrawGL dd; + + glEnable(GL_FOG); + glDepthMask(GL_TRUE); + + if (m_drawMode == DRAWMODE_MESH) + { + // Draw mesh + duDebugDrawTriMeshSlope(&dd, m_geom->getMesh()->getVerts(), m_geom->getMesh()->getVertCount(), + m_geom->getMesh()->getTris(), m_geom->getMesh()->getNormals(), m_geom->getMesh()->getTriCount(), + m_agentMaxSlope); + m_geom->drawOffMeshConnections(&dd); + } + else if (m_drawMode != DRAWMODE_NAVMESH_TRANS) + { + // Draw mesh + duDebugDrawTriMesh(&dd, m_geom->getMesh()->getVerts(), m_geom->getMesh()->getVertCount(), + m_geom->getMesh()->getTris(), m_geom->getMesh()->getNormals(), m_geom->getMesh()->getTriCount(), 0); + m_geom->drawOffMeshConnections(&dd); + } + + glDisable(GL_FOG); + glDepthMask(GL_FALSE); + + // Draw bounds + const float* bmin = m_geom->getMeshBoundsMin(); + const float* bmax = m_geom->getMeshBoundsMax(); + duDebugDrawBoxWire(&dd, bmin[0],bmin[1],bmin[2], bmax[0],bmax[1],bmax[2], duRGBA(255,255,255,128), 1.0f); + + // Tiling grid. + int gw = 0, gh = 0; + rcCalcGridSize(bmin, bmax, m_cellSize, &gw, &gh); + const int tw = (gw + (int)m_tileSize-1) / (int)m_tileSize; + const int th = (gh + (int)m_tileSize-1) / (int)m_tileSize; + duDebugDrawGridXZ(&dd, bmin[0],bmin[1],bmin[2], tw,th, m_tileSize, duRGBA(0,0,0,64), 1.0f); + + if (m_navMesh && + (m_drawMode == DRAWMODE_NAVMESH || + m_drawMode == DRAWMODE_NAVMESH_TRANS || + m_drawMode == DRAWMODE_NAVMESH_BVTREE || + m_drawMode == DRAWMODE_NAVMESH_INVIS)) + { + if (m_drawMode != DRAWMODE_NAVMESH_INVIS) + duDebugDrawNavMesh(&dd, *m_navMesh, m_navMeshDrawFlags); + if (m_drawMode == DRAWMODE_NAVMESH_BVTREE) + duDebugDrawNavMeshBVTree(&dd, *m_navMesh); + } + + glDepthMask(GL_TRUE); + + if (m_drawMode == DRAWMODE_COMPACT) + duDebugDrawCompactHeightfieldSolid(&dd, *m_chf); + + if (m_drawMode == DRAWMODE_COMPACT_DISTANCE) + duDebugDrawCompactHeightfieldDistance(&dd, *m_chf); + + if (m_drawMode == DRAWMODE_COMPACT_REGIONS) + duDebugDrawCompactHeightfieldRegions(&dd, *m_chf); + + if (m_drawMode == DRAWMODE_VOXELS) + { + glEnable(GL_FOG); + duDebugDrawHeightfieldSolid(&dd, *m_hf); + glDisable(GL_FOG); + } + + if (m_drawMode == DRAWMODE_VOXELS_WALKABLE) + { + glEnable(GL_FOG); + duDebugDrawHeightfieldWalkable(&dd, *m_hf); + glDisable(GL_FOG); + } + + if (m_drawMode == DRAWMODE_RAW_CONTOURS) + { + glDepthMask(GL_FALSE); + duDebugDrawRawContours(&dd, *m_cset); + glDepthMask(GL_TRUE); + } + + if (m_drawMode == DRAWMODE_BOTH_CONTOURS) + { + glDepthMask(GL_FALSE); + duDebugDrawRawContours(&dd, *m_cset, 0.5f); + duDebugDrawContours(&dd, *m_cset); + glDepthMask(GL_TRUE); + } + + if (m_drawMode == DRAWMODE_CONTOURS) + { + glDepthMask(GL_FALSE); + duDebugDrawContours(&dd, *m_cset); + glDepthMask(GL_TRUE); + } + + if (m_drawMode == DRAWMODE_REGION_CONNECTIONS) + { + duDebugDrawCompactHeightfieldRegions(&dd, *m_chf); + + glDepthMask(GL_FALSE); + duDebugDrawRegionConnections(&dd, *m_cset); + glDepthMask(GL_TRUE); + } + + if (/*m_pmesh &&*/ m_drawMode == DRAWMODE_POLYMESH) + { + glDepthMask(GL_FALSE); + duDebugDrawPolyMesh(&dd, *m_pmeshes); + glDepthMask(GL_TRUE); + } + + if (/*m_dmesh &&*/ m_drawMode == DRAWMODE_POLYMESH_DETAIL) + { + glDepthMask(GL_FALSE); + duDebugDrawPolyMeshDetail(&dd, *m_dmeshes); + glDepthMask(GL_TRUE); + } + + m_geom->drawConvexVolumes(&dd); + + if (m_tool) + m_tool->handleRender(); + + glDepthMask(GL_TRUE); +} + +void Sample_Debug::handleRenderOverlay(double* proj, double* model, int* view) +{ + Sample_SoloMeshTiled::handleRenderOverlay(proj, model, view); +} + +void Sample_Debug::handleMeshChanged(InputGeom* geom) +{ + Sample_SoloMeshTiled::handleMeshChanged(geom); +} + +const float* Sample_Debug::getBoundsMin() +{ + return Sample_SoloMeshTiled::getBoundsMin(); +} + +const float* Sample_Debug::getBoundsMax() +{ + return Sample_SoloMeshTiled::getBoundsMax(); +} + +void Sample_Debug::handleClick(const float* p, bool shift) +{ + Sample_SoloMeshTiled::handleClick(NULL, p, shift); +} + +void Sample_Debug::handleToggle() +{ + Sample_SoloMeshTiled::handleStep(); +} + +bool Sample_Debug::handleBuild() +{ + cleanup(); + + duReadNavMesh(m_meshName, m_navMesh); + m_pmeshCount = duReadPolyMesh(m_meshName, m_pmeshes); + m_hfCount = duReadHeightfield(m_meshName, m_hf); + m_chfCount = duReadCompactHeightfield(m_meshName, m_chf); + m_dmeshCount = duReadDetailMesh(m_meshName, m_dmeshes); + m_csetCount = duReadContourSet(m_meshName, m_cset); + + if(m_navMesh) + { + m_drawMode = DRAWMODE_NAVMESH_TRANS; + m_tileSize = m_navMesh->getParams()->tileHeight; + + m_navQuery = dtAllocNavMeshQuery(); + m_navQuery->init(m_navMesh, 2048); + } + + if(m_tool) + m_tool->init(this); + + return true; +} + +void Sample_Debug::setHighlightedTile(const float* pos) +{ + + if (!pos || !m_navMesh) + { + m_highLightedTileX = -1; + m_highLightedTileY = -1; + return; + } + + dtNavMeshQuery* query = dtAllocNavMeshQuery(); + query->init(m_navMesh, 2048); + + float extents[3] = {2.f, 4.f, 2.f}; + dtPolyRef polyRef = 0; + dtQueryFilter filter; + query->findNearestPoly(pos, extents, &filter, &polyRef, NULL); + unsigned char area = 0; + m_navMesh->getPolyArea(polyRef, &area); + unsigned short flags = 0; + m_navMesh->getPolyFlags(polyRef, &flags); + + const dtMeshTile* tile; + const dtPoly* poly; + m_navMesh->getTileAndPolyByRef(polyRef, &tile, &poly); + + if(!tile) + { + m_highLightedTileX = -1; + m_highLightedTileY = -1; + return; + } + m_highLightedTileX = tile->header->x; + m_highLightedTileY = tile->header->y; +} diff --git a/dep/recastnavigation/RecastDemo/Source/Sample_SoloMeshSimple.cpp b/dep/recastnavigation/RecastDemo/Source/Sample_SoloMeshSimple.cpp new file mode 100644 index 000000000..f70435163 --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Source/Sample_SoloMeshSimple.cpp @@ -0,0 +1,669 @@ +// +// Copyright (c) 2009-2010 Mikko Mononen memon@inside.org +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. +// + +#define _USE_MATH_DEFINES +#include +#include +#include +#include "SDL.h" +#include "SDL_opengl.h" +#include "imgui.h" +#include "InputGeom.h" +#include "Sample.h" +#include "Sample_SoloMeshSimple.h" +#include "Recast.h" +#include "RecastDebugDraw.h" +#include "RecastDump.h" +#include "DetourNavMesh.h" +#include "DetourNavMeshBuilder.h" +#include "DetourDebugDraw.h" +#include "NavMeshTesterTool.h" +#include "OffMeshConnectionTool.h" +#include "ConvexVolumeTool.h" +#include "CrowdTool.h" + +#ifdef WIN32 +# define snprintf _snprintf +#endif + + +Sample_SoloMeshSimple::Sample_SoloMeshSimple() : + m_keepInterResults(true), + m_totalBuildTimeMs(0), + m_triareas(0), + m_solid(0), + m_chf(0), + m_cset(0), + m_pmesh(0), + m_dmesh(0), + m_drawMode(DRAWMODE_NAVMESH) +{ + setTool(new NavMeshTesterTool); +} + +Sample_SoloMeshSimple::~Sample_SoloMeshSimple() +{ + cleanup(); +} + +void Sample_SoloMeshSimple::cleanup() +{ + delete [] m_triareas; + m_triareas = 0; + rcFreeHeightField(m_solid); + m_solid = 0; + rcFreeCompactHeightfield(m_chf); + m_chf = 0; + rcFreeContourSet(m_cset); + m_cset = 0; + rcFreePolyMesh(m_pmesh); + m_pmesh = 0; + rcFreePolyMeshDetail(m_dmesh); + m_dmesh = 0; + dtFreeNavMesh(m_navMesh); + m_navMesh = 0; +} + +void Sample_SoloMeshSimple::handleSettings() +{ + Sample::handleCommonSettings(); + + if (imguiCheck("Keep Itermediate Results", m_keepInterResults)) + m_keepInterResults = !m_keepInterResults; + + imguiSeparator(); + + char msg[64]; + snprintf(msg, 64, "Build Time: %.1fms", m_totalBuildTimeMs); + imguiLabel(msg); + + imguiSeparator(); +} + +void Sample_SoloMeshSimple::handleTools() +{ + int type = !m_tool ? TOOL_NONE : m_tool->type(); + + if (imguiCheck("Test Navmesh", type == TOOL_NAVMESH_TESTER)) + { + setTool(new NavMeshTesterTool); + } + if (imguiCheck("Create Off-Mesh Connections", type == TOOL_OFFMESH_CONNECTION)) + { + setTool(new OffMeshConnectionTool); + } + if (imguiCheck("Create Convex Volumes", type == TOOL_CONVEX_VOLUME)) + { + setTool(new ConvexVolumeTool); + } + if (imguiCheck("Create Crowds", type == TOOL_CROWD)) + { + setTool(new CrowdTool); + } + + imguiSeparatorLine(); + + imguiIndent(); + + if (m_tool) + m_tool->handleMenu(); + + imguiUnindent(); + +} + +void Sample_SoloMeshSimple::handleDebugMode() +{ + // Check which modes are valid. + bool valid[MAX_DRAWMODE]; + for (int i = 0; i < MAX_DRAWMODE; ++i) + valid[i] = false; + + if (m_geom) + { + valid[DRAWMODE_NAVMESH] = m_navMesh != 0; + valid[DRAWMODE_NAVMESH_TRANS] = m_navMesh != 0; + valid[DRAWMODE_NAVMESH_BVTREE] = m_navMesh != 0; + valid[DRAWMODE_NAVMESH_NODES] = m_navQuery != 0; + valid[DRAWMODE_NAVMESH_INVIS] = m_navMesh != 0; + valid[DRAWMODE_MESH] = true; + valid[DRAWMODE_VOXELS] = m_solid != 0; + valid[DRAWMODE_VOXELS_WALKABLE] = m_solid != 0; + valid[DRAWMODE_COMPACT] = m_chf != 0; + valid[DRAWMODE_COMPACT_DISTANCE] = m_chf != 0; + valid[DRAWMODE_COMPACT_REGIONS] = m_chf != 0; + valid[DRAWMODE_REGION_CONNECTIONS] = m_cset != 0; + valid[DRAWMODE_RAW_CONTOURS] = m_cset != 0; + valid[DRAWMODE_BOTH_CONTOURS] = m_cset != 0; + valid[DRAWMODE_CONTOURS] = m_cset != 0; + valid[DRAWMODE_POLYMESH] = m_pmesh != 0; + valid[DRAWMODE_POLYMESH_DETAIL] = m_dmesh != 0; + } + + int unavail = 0; + for (int i = 0; i < MAX_DRAWMODE; ++i) + if (!valid[i]) unavail++; + + if (unavail == MAX_DRAWMODE) + return; + + imguiLabel("Draw"); + if (imguiCheck("Input Mesh", m_drawMode == DRAWMODE_MESH, valid[DRAWMODE_MESH])) + m_drawMode = DRAWMODE_MESH; + if (imguiCheck("Navmesh", m_drawMode == DRAWMODE_NAVMESH, valid[DRAWMODE_NAVMESH])) + m_drawMode = DRAWMODE_NAVMESH; + if (imguiCheck("Navmesh Invis", m_drawMode == DRAWMODE_NAVMESH_INVIS, valid[DRAWMODE_NAVMESH_INVIS])) + m_drawMode = DRAWMODE_NAVMESH_INVIS; + if (imguiCheck("Navmesh Trans", m_drawMode == DRAWMODE_NAVMESH_TRANS, valid[DRAWMODE_NAVMESH_TRANS])) + m_drawMode = DRAWMODE_NAVMESH_TRANS; + if (imguiCheck("Navmesh BVTree", m_drawMode == DRAWMODE_NAVMESH_BVTREE, valid[DRAWMODE_NAVMESH_BVTREE])) + m_drawMode = DRAWMODE_NAVMESH_BVTREE; + if (imguiCheck("Navmesh Nodes", m_drawMode == DRAWMODE_NAVMESH_NODES, valid[DRAWMODE_NAVMESH_NODES])) + m_drawMode = DRAWMODE_NAVMESH_NODES; + if (imguiCheck("Voxels", m_drawMode == DRAWMODE_VOXELS, valid[DRAWMODE_VOXELS])) + m_drawMode = DRAWMODE_VOXELS; + if (imguiCheck("Walkable Voxels", m_drawMode == DRAWMODE_VOXELS_WALKABLE, valid[DRAWMODE_VOXELS_WALKABLE])) + m_drawMode = DRAWMODE_VOXELS_WALKABLE; + if (imguiCheck("Compact", m_drawMode == DRAWMODE_COMPACT, valid[DRAWMODE_COMPACT])) + m_drawMode = DRAWMODE_COMPACT; + if (imguiCheck("Compact Distance", m_drawMode == DRAWMODE_COMPACT_DISTANCE, valid[DRAWMODE_COMPACT_DISTANCE])) + m_drawMode = DRAWMODE_COMPACT_DISTANCE; + if (imguiCheck("Compact Regions", m_drawMode == DRAWMODE_COMPACT_REGIONS, valid[DRAWMODE_COMPACT_REGIONS])) + m_drawMode = DRAWMODE_COMPACT_REGIONS; + if (imguiCheck("Region Connections", m_drawMode == DRAWMODE_REGION_CONNECTIONS, valid[DRAWMODE_REGION_CONNECTIONS])) + m_drawMode = DRAWMODE_REGION_CONNECTIONS; + if (imguiCheck("Raw Contours", m_drawMode == DRAWMODE_RAW_CONTOURS, valid[DRAWMODE_RAW_CONTOURS])) + m_drawMode = DRAWMODE_RAW_CONTOURS; + if (imguiCheck("Both Contours", m_drawMode == DRAWMODE_BOTH_CONTOURS, valid[DRAWMODE_BOTH_CONTOURS])) + m_drawMode = DRAWMODE_BOTH_CONTOURS; + if (imguiCheck("Contours", m_drawMode == DRAWMODE_CONTOURS, valid[DRAWMODE_CONTOURS])) + m_drawMode = DRAWMODE_CONTOURS; + if (imguiCheck("Poly Mesh", m_drawMode == DRAWMODE_POLYMESH, valid[DRAWMODE_POLYMESH])) + m_drawMode = DRAWMODE_POLYMESH; + if (imguiCheck("Poly Mesh Detail", m_drawMode == DRAWMODE_POLYMESH_DETAIL, valid[DRAWMODE_POLYMESH_DETAIL])) + m_drawMode = DRAWMODE_POLYMESH_DETAIL; + + if (unavail) + { + imguiValue("Tick 'Keep Itermediate Results'"); + imguiValue("to see more debug mode options."); + } +} + +void Sample_SoloMeshSimple::handleRender() +{ + if (!m_geom || !m_geom->getMesh()) + return; + + DebugDrawGL dd; + + glEnable(GL_FOG); + glDepthMask(GL_TRUE); + + if (m_drawMode == DRAWMODE_MESH) + { + // Draw mesh + duDebugDrawTriMeshSlope(&dd, m_geom->getMesh()->getVerts(), m_geom->getMesh()->getVertCount(), + m_geom->getMesh()->getTris(), m_geom->getMesh()->getNormals(), m_geom->getMesh()->getTriCount(), + m_agentMaxSlope); + m_geom->drawOffMeshConnections(&dd); + } + else if (m_drawMode != DRAWMODE_NAVMESH_TRANS) + { + // Draw mesh + duDebugDrawTriMesh(&dd, m_geom->getMesh()->getVerts(), m_geom->getMesh()->getVertCount(), + m_geom->getMesh()->getTris(), m_geom->getMesh()->getNormals(), m_geom->getMesh()->getTriCount(), 0); + m_geom->drawOffMeshConnections(&dd); + } + + glDisable(GL_FOG); + glDepthMask(GL_FALSE); + + // Draw bounds + const float* bmin = m_geom->getMeshBoundsMin(); + const float* bmax = m_geom->getMeshBoundsMax(); + duDebugDrawBoxWire(&dd, bmin[0],bmin[1],bmin[2], bmax[0],bmax[1],bmax[2], duRGBA(255,255,255,128), 1.0f); + + if (m_navMesh && m_navQuery && + (m_drawMode == DRAWMODE_NAVMESH || + m_drawMode == DRAWMODE_NAVMESH_TRANS || + m_drawMode == DRAWMODE_NAVMESH_BVTREE || + m_drawMode == DRAWMODE_NAVMESH_NODES || + m_drawMode == DRAWMODE_NAVMESH_INVIS)) + { + if (m_drawMode != DRAWMODE_NAVMESH_INVIS) + duDebugDrawNavMeshWithClosedList(&dd, *m_navMesh, *m_navQuery, m_navMeshDrawFlags); + if (m_drawMode == DRAWMODE_NAVMESH_BVTREE) + duDebugDrawNavMeshBVTree(&dd, *m_navMesh); + if (m_drawMode == DRAWMODE_NAVMESH_NODES) + duDebugDrawNavMeshNodes(&dd, *m_navQuery); + } + + glDepthMask(GL_TRUE); + + if (m_chf && m_drawMode == DRAWMODE_COMPACT) + duDebugDrawCompactHeightfieldSolid(&dd, *m_chf); + + if (m_chf && m_drawMode == DRAWMODE_COMPACT_DISTANCE) + duDebugDrawCompactHeightfieldDistance(&dd, *m_chf); + if (m_chf && m_drawMode == DRAWMODE_COMPACT_REGIONS) + duDebugDrawCompactHeightfieldRegions(&dd, *m_chf); + if (m_solid && m_drawMode == DRAWMODE_VOXELS) + { + glEnable(GL_FOG); + duDebugDrawHeightfieldSolid(&dd, *m_solid); + glDisable(GL_FOG); + } + if (m_solid && m_drawMode == DRAWMODE_VOXELS_WALKABLE) + { + glEnable(GL_FOG); + duDebugDrawHeightfieldWalkable(&dd, *m_solid); + glDisable(GL_FOG); + } + if (m_cset && m_drawMode == DRAWMODE_RAW_CONTOURS) + { + glDepthMask(GL_FALSE); + duDebugDrawRawContours(&dd, *m_cset); + glDepthMask(GL_TRUE); + } + if (m_cset && m_drawMode == DRAWMODE_BOTH_CONTOURS) + { + glDepthMask(GL_FALSE); + duDebugDrawRawContours(&dd, *m_cset, 0.5f); + duDebugDrawContours(&dd, *m_cset); + glDepthMask(GL_TRUE); + } + if (m_cset && m_drawMode == DRAWMODE_CONTOURS) + { + glDepthMask(GL_FALSE); + duDebugDrawContours(&dd, *m_cset); + glDepthMask(GL_TRUE); + } + if (m_chf && m_cset && m_drawMode == DRAWMODE_REGION_CONNECTIONS) + { + duDebugDrawCompactHeightfieldRegions(&dd, *m_chf); + + glDepthMask(GL_FALSE); + duDebugDrawRegionConnections(&dd, *m_cset); + glDepthMask(GL_TRUE); + } + if (m_pmesh && m_drawMode == DRAWMODE_POLYMESH) + { + glDepthMask(GL_FALSE); + duDebugDrawPolyMesh(&dd, *m_pmesh); + glDepthMask(GL_TRUE); + } + if (m_dmesh && m_drawMode == DRAWMODE_POLYMESH_DETAIL) + { + glDepthMask(GL_FALSE); + duDebugDrawPolyMeshDetail(&dd, *m_dmesh); + glDepthMask(GL_TRUE); + } + + m_geom->drawConvexVolumes(&dd); + + if (m_tool) + m_tool->handleRender(); + + glDepthMask(GL_TRUE); +} + +void Sample_SoloMeshSimple::handleRenderOverlay(double* proj, double* model, int* view) +{ + if (m_tool) + m_tool->handleRenderOverlay(proj, model, view); +} + +void Sample_SoloMeshSimple::handleMeshChanged(class InputGeom* geom) +{ + Sample::handleMeshChanged(geom); + + dtFreeNavMesh(m_navMesh); + m_navMesh = 0; + + if (m_tool) + { + m_tool->reset(); + m_tool->init(this); + } +} + + +bool Sample_SoloMeshSimple::handleBuild() +{ + if (!m_geom || !m_geom->getMesh()) + { + m_ctx->log(RC_LOG_ERROR, "buildNavigation: Input mesh is not specified."); + return false; + } + + cleanup(); + + const float* bmin = m_geom->getMeshBoundsMin(); + const float* bmax = m_geom->getMeshBoundsMax(); + const float* verts = m_geom->getMesh()->getVerts(); + const int nverts = m_geom->getMesh()->getVertCount(); + const int* tris = m_geom->getMesh()->getTris(); + const int ntris = m_geom->getMesh()->getTriCount(); + + // + // Step 1. Initialize build config. + // + + // Init build configuration from GUI + memset(&m_cfg, 0, sizeof(m_cfg)); + m_cfg.cs = m_cellSize; + m_cfg.ch = m_cellHeight; + m_cfg.walkableSlopeAngle = m_agentMaxSlope; + m_cfg.walkableHeight = (int)ceilf(m_agentHeight / m_cfg.ch); + m_cfg.walkableClimb = (int)floorf(m_agentMaxClimb / m_cfg.ch); + m_cfg.walkableRadius = (int)ceilf(m_agentRadius / m_cfg.cs); + m_cfg.maxEdgeLen = (int)(m_edgeMaxLen / m_cellSize); + m_cfg.maxSimplificationError = m_edgeMaxError; + m_cfg.minRegionArea = (int)rcSqr(m_regionMinSize); // Note: area = size*size + m_cfg.mergeRegionArea = (int)rcSqr(m_regionMergeSize); // Note: area = size*size + m_cfg.maxVertsPerPoly = (int)m_vertsPerPoly; + m_cfg.detailSampleDist = m_detailSampleDist < 0.9f ? 0 : m_cellSize * m_detailSampleDist; + m_cfg.detailSampleMaxError = m_cellHeight * m_detailSampleMaxError; + + // Set the area where the navigation will be build. + // Here the bounds of the input mesh are used, but the + // area could be specified by an user defined box, etc. + rcVcopy(m_cfg.bmin, bmin); + rcVcopy(m_cfg.bmax, bmax); + rcCalcGridSize(m_cfg.bmin, m_cfg.bmax, m_cfg.cs, &m_cfg.width, &m_cfg.height); + + // Reset build times gathering. + m_ctx->resetTimers(); + + // Start the build process. + m_ctx->startTimer(RC_TIMER_TOTAL); + + m_ctx->log(RC_LOG_PROGRESS, "Building navigation:"); + m_ctx->log(RC_LOG_PROGRESS, " - %d x %d cells", m_cfg.width, m_cfg.height); + m_ctx->log(RC_LOG_PROGRESS, " - %.1fK verts, %.1fK tris", nverts/1000.0f, ntris/1000.0f); + + // + // Step 2. Rasterize input polygon soup. + // + + // Allocate voxel heightfield where we rasterize our input data to. + m_solid = rcAllocHeightfield(); + if (!m_solid) + { + m_ctx->log(RC_LOG_ERROR, "buildNavigation: Out of memory 'solid'."); + return false; + } + if (!rcCreateHeightfield(m_ctx, *m_solid, m_cfg.width, m_cfg.height, m_cfg.bmin, m_cfg.bmax, m_cfg.cs, m_cfg.ch)) + { + m_ctx->log(RC_LOG_ERROR, "buildNavigation: Could not create solid heightfield."); + return false; + } + + // Allocate array that can hold triangle area types. + // If you have multiple meshes you need to process, allocate + // and array which can hold the max number of triangles you need to process. + m_triareas = new unsigned char[ntris]; + if (!m_triareas) + { + m_ctx->log(RC_LOG_ERROR, "buildNavigation: Out of memory 'm_triareas' (%d).", ntris); + return false; + } + + // Find triangles which are walkable based on their slope and rasterize them. + // If your input data is multiple meshes, you can transform them here, calculate + // the are type for each of the meshes and rasterize them. + memset(m_triareas, 0, ntris*sizeof(unsigned char)); + rcMarkWalkableTriangles(m_ctx, m_cfg.walkableSlopeAngle, verts, nverts, tris, ntris, m_triareas); + rcRasterizeTriangles(m_ctx, verts, nverts, tris, m_triareas, ntris, *m_solid, m_cfg.walkableClimb); + + if (!m_keepInterResults) + { + delete [] m_triareas; + m_triareas = 0; + } + + // + // Step 3. Filter walkables surfaces. + // + + // Once all geoemtry is rasterized, we do initial pass of filtering to + // remove unwanted overhangs caused by the conservative rasterization + // as well as filter spans where the character cannot possibly stand. + rcFilterLowHangingWalkableObstacles(m_ctx, m_cfg.walkableClimb, *m_solid); + rcFilterLedgeSpans(m_ctx, m_cfg.walkableHeight, m_cfg.walkableClimb, *m_solid); + rcFilterWalkableLowHeightSpans(m_ctx, m_cfg.walkableHeight, *m_solid); + + + // + // Step 4. Partition walkable surface to simple regions. + // + + // Compact the heightfield so that it is faster to handle from now on. + // This will result more cache coherent data as well as the neighbours + // between walkable cells will be calculated. + m_chf = rcAllocCompactHeightfield(); + if (!m_chf) + { + m_ctx->log(RC_LOG_ERROR, "buildNavigation: Out of memory 'chf'."); + return false; + } + if (!rcBuildCompactHeightfield(m_ctx, m_cfg.walkableHeight, m_cfg.walkableClimb, *m_solid, *m_chf)) + { + m_ctx->log(RC_LOG_ERROR, "buildNavigation: Could not build compact data."); + return false; + } + + if (!m_keepInterResults) + { + rcFreeHeightField(m_solid); + m_solid = 0; + } + + // Erode the walkable area by agent radius. + if (!rcErodeWalkableArea(m_ctx, m_cfg.walkableRadius, *m_chf)) + { + m_ctx->log(RC_LOG_ERROR, "buildNavigation: Could not erode."); + return false; + } + + // (Optional) Mark areas. + const ConvexVolume* vols = m_geom->getConvexVolumes(); + for (int i = 0; i < m_geom->getConvexVolumeCount(); ++i) + rcMarkConvexPolyArea(m_ctx, vols[i].verts, vols[i].nverts, vols[i].hmin, vols[i].hmax, (unsigned char)vols[i].area, *m_chf); + + // Prepare for region partitioning, by calculating distance field along the walkable surface. + if (!rcBuildDistanceField(m_ctx, *m_chf)) + { + m_ctx->log(RC_LOG_ERROR, "buildNavigation: Could not build distance field."); + return false; + } + + // Partition the walkable surface into simple regions without holes. + if (!rcBuildRegions(m_ctx, *m_chf, m_cfg.borderSize, m_cfg.minRegionArea, m_cfg.mergeRegionArea)) + { + m_ctx->log(RC_LOG_ERROR, "buildNavigation: Could not build regions."); + return false; + } + + // + // Step 5. Trace and simplify region contours. + // + + // Create contours. + m_cset = rcAllocContourSet(); + if (!m_cset) + { + m_ctx->log(RC_LOG_ERROR, "buildNavigation: Out of memory 'cset'."); + return false; + } + if (!rcBuildContours(m_ctx, *m_chf, m_cfg.maxSimplificationError, m_cfg.maxEdgeLen, *m_cset)) + { + m_ctx->log(RC_LOG_ERROR, "buildNavigation: Could not create contours."); + return false; + } + + // + // Step 6. Build polygons mesh from contours. + // + + // Build polygon navmesh from the contours. + m_pmesh = rcAllocPolyMesh(); + if (!m_pmesh) + { + m_ctx->log(RC_LOG_ERROR, "buildNavigation: Out of memory 'pmesh'."); + return false; + } + if (!rcBuildPolyMesh(m_ctx, *m_cset, m_cfg.maxVertsPerPoly, *m_pmesh)) + { + m_ctx->log(RC_LOG_ERROR, "buildNavigation: Could not triangulate contours."); + return false; + } + + // + // Step 7. Create detail mesh which allows to access approximate height on each polygon. + // + + m_dmesh = rcAllocPolyMeshDetail(); + if (!m_dmesh) + { + m_ctx->log(RC_LOG_ERROR, "buildNavigation: Out of memory 'pmdtl'."); + return false; + } + + if (!rcBuildPolyMeshDetail(m_ctx, *m_pmesh, *m_chf, m_cfg.detailSampleDist, m_cfg.detailSampleMaxError, *m_dmesh)) + { + m_ctx->log(RC_LOG_ERROR, "buildNavigation: Could not build detail mesh."); + return false; + } + + if (!m_keepInterResults) + { + rcFreeCompactHeightfield(m_chf); + m_chf = 0; + rcFreeContourSet(m_cset); + m_cset = 0; + } + + // At this point the navigation mesh data is ready, you can access it from m_pmesh. + // See duDebugDrawPolyMesh or dtCreateNavMeshData as examples how to access the data. + + // + // (Optional) Step 8. Create Detour data from Recast poly mesh. + // + + // The GUI may allow more max points per polygon than Detour can handle. + // Only build the detour navmesh if we do not exceed the limit. + if (m_cfg.maxVertsPerPoly <= DT_VERTS_PER_POLYGON) + { + unsigned char* navData = 0; + int navDataSize = 0; + + // Update poly flags from areas. + for (int i = 0; i < m_pmesh->npolys; ++i) + { + if (m_pmesh->areas[i] == RC_WALKABLE_AREA) + m_pmesh->areas[i] = SAMPLE_POLYAREA_GROUND; + + if (m_pmesh->areas[i] == SAMPLE_POLYAREA_GROUND || + m_pmesh->areas[i] == SAMPLE_POLYAREA_GRASS || + m_pmesh->areas[i] == SAMPLE_POLYAREA_ROAD) + { + m_pmesh->flags[i] = SAMPLE_POLYFLAGS_WALK; + } + else if (m_pmesh->areas[i] == SAMPLE_POLYAREA_WATER) + { + m_pmesh->flags[i] = SAMPLE_POLYFLAGS_SWIM; + } + else if (m_pmesh->areas[i] == SAMPLE_POLYAREA_DOOR) + { + m_pmesh->flags[i] = SAMPLE_POLYFLAGS_WALK | SAMPLE_POLYFLAGS_DOOR; + } + } + + + dtNavMeshCreateParams params; + memset(¶ms, 0, sizeof(params)); + params.verts = m_pmesh->verts; + params.vertCount = m_pmesh->nverts; + params.polys = m_pmesh->polys; + params.polyAreas = m_pmesh->areas; + params.polyFlags = m_pmesh->flags; + params.polyCount = m_pmesh->npolys; + params.nvp = m_pmesh->nvp; + params.detailMeshes = m_dmesh->meshes; + params.detailVerts = m_dmesh->verts; + params.detailVertsCount = m_dmesh->nverts; + params.detailTris = m_dmesh->tris; + params.detailTriCount = m_dmesh->ntris; + params.offMeshConVerts = m_geom->getOffMeshConnectionVerts(); + params.offMeshConRad = m_geom->getOffMeshConnectionRads(); + params.offMeshConDir = m_geom->getOffMeshConnectionDirs(); + params.offMeshConAreas = m_geom->getOffMeshConnectionAreas(); + params.offMeshConFlags = m_geom->getOffMeshConnectionFlags(); + params.offMeshConUserID = m_geom->getOffMeshConnectionId(); + params.offMeshConCount = m_geom->getOffMeshConnectionCount(); + params.walkableHeight = m_agentHeight; + params.walkableRadius = m_agentRadius; + params.walkableClimb = m_agentMaxClimb; + rcVcopy(params.bmin, m_pmesh->bmin); + rcVcopy(params.bmax, m_pmesh->bmax); + params.cs = m_cfg.cs; + params.ch = m_cfg.ch; + + if (!dtCreateNavMeshData(¶ms, &navData, &navDataSize)) + { + m_ctx->log(RC_LOG_ERROR, "Could not build Detour navmesh."); + return false; + } + + m_navMesh = dtAllocNavMesh(); + if (!m_navMesh) + { + dtFree(navData); + m_ctx->log(RC_LOG_ERROR, "Could not create Detour navmesh"); + return false; + } + + if (m_navMesh->init(navData, navDataSize, DT_TILE_FREE_DATA) != DT_SUCCESS) + { + dtFree(navData); + m_ctx->log(RC_LOG_ERROR, "Could not init Detour navmesh"); + return false; + } + + if (m_navQuery->init(m_navMesh, 2048) != DT_SUCCESS) + { + m_ctx->log(RC_LOG_ERROR, "Could not init Detour navmesh query"); + return false; + } + } + + m_ctx->stopTimer(RC_TIMER_TOTAL); + + // Show performance stats. + duLogBuildTimes(*m_ctx, m_ctx->getAccumulatedTime(RC_TIMER_TOTAL)); + m_ctx->log(RC_LOG_PROGRESS, ">> Polymesh: %d vertices %d polygons", m_pmesh->nverts, m_pmesh->npolys); + + m_totalBuildTimeMs = m_ctx->getAccumulatedTime(RC_TIMER_TOTAL)/1000.0f; + + if (m_tool) + m_tool->init(this); + + return true; +} diff --git a/dep/recastnavigation/RecastDemo/Source/Sample_SoloMeshTiled.cpp b/dep/recastnavigation/RecastDemo/Source/Sample_SoloMeshTiled.cpp new file mode 100644 index 000000000..a6bf42357 --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Source/Sample_SoloMeshTiled.cpp @@ -0,0 +1,1130 @@ +// +// Copyright (c) 2009-2010 Mikko Mononen memon@inside.org +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. +// + +#define _USE_MATH_DEFINES +#include +#include +#include +#include "SDL.h" +#include "SDL_opengl.h" +#include "imgui.h" +#include "InputGeom.h" +#include "Sample.h" +#include "Sample_SoloMeshTiled.h" +#include "Recast.h" +#include "RecastDebugDraw.h" +#include "DetourNavMesh.h" +#include "DetourNavMeshBuilder.h" +#include "DetourDebugDraw.h" +#include "NavMeshTesterTool.h" +#include "OffMeshConnectionTool.h" +#include "ConvexVolumeTool.h" +#include "CrowdTool.h" + +#ifdef WIN32 +# define snprintf _snprintf +#endif + + +class TileHighlightTool : public SampleTool +{ + Sample_SoloMeshTiled* m_sample; + float m_hitPos[3]; + bool m_hitPosSet; + float m_agentRadius; + +public: + + TileHighlightTool() : + m_sample(0), + m_hitPosSet(false), + m_agentRadius(0) + { + m_hitPos[0] = m_hitPos[1] = m_hitPos[2] = 0; + } + + virtual ~TileHighlightTool() + { + if (m_sample) + m_sample->setHighlightedTile(0); + } + + virtual int type() { return TOOL_TILE_HIGHLIGHT; } + + virtual void init(Sample* sample) + { + m_sample = (Sample_SoloMeshTiled*)sample; + } + + virtual void reset() {} + + virtual void handleMenu() + { + imguiValue("Click LMB to highlight a tile."); + } + + virtual void handleClick(const float* /*s*/, const float* p, bool /*shift*/) + { + m_hitPosSet = true; + rcVcopy(m_hitPos,p); + if (m_sample) + m_sample->setHighlightedTile(m_hitPos); + } + + virtual void handleToggle() {} + + virtual void handleStep() {} + + virtual void handleUpdate(const float /*dt*/) {} + + virtual void handleRender() + { + if (m_hitPosSet) + { + const float s = m_sample->getAgentRadius(); + glColor4ub(0,0,0,128); + glLineWidth(2.0f); + glBegin(GL_LINES); + glVertex3f(m_hitPos[0]-s,m_hitPos[1]+0.1f,m_hitPos[2]); + glVertex3f(m_hitPos[0]+s,m_hitPos[1]+0.1f,m_hitPos[2]); + glVertex3f(m_hitPos[0],m_hitPos[1]-s+0.1f,m_hitPos[2]); + glVertex3f(m_hitPos[0],m_hitPos[1]+s+0.1f,m_hitPos[2]); + glVertex3f(m_hitPos[0],m_hitPos[1]+0.1f,m_hitPos[2]-s); + glVertex3f(m_hitPos[0],m_hitPos[1]+0.1f,m_hitPos[2]+s); + glEnd(); + glLineWidth(1.0f); + } + } + + virtual void handleRenderOverlay(double* proj, double* model, int* view) + { + GLdouble x, y, z; + + + // Draw start and end point labels + if (m_hitPosSet && gluProject((GLdouble)m_hitPos[0], (GLdouble)m_hitPos[1], (GLdouble)m_hitPos[2], + model, proj, view, &x, &y, &z)) + { + const int tx = m_sample->getHilightedTileX(); + const int ty = m_sample->getHilightedTileY(); + char text[32]; + snprintf(text,32,"Tile: (%d, %d)", tx, ty); + imguiDrawText((int)x, (int)y-25, IMGUI_ALIGN_CENTER, text, imguiRGBA(0,0,0,220)); + } + + } +}; + + +Sample_SoloMeshTiled::Sample_SoloMeshTiled() : + m_measurePerTileTimings(false), + m_keepInterResults(false), + m_tileSize(64), + m_totalBuildTimeMs(0), + m_pmesh(0), + m_dmesh(0), + m_tileSet(0), + m_statPolysPerTileSamples(0), + m_statTimePerTileSamples(0), + m_highLightedTileX(-1), + m_highLightedTileY(-1), + m_drawMode(DRAWMODE_NAVMESH) +{ + setTool(new NavMeshTesterTool); +} + +Sample_SoloMeshTiled::~Sample_SoloMeshTiled() +{ + cleanup(); +} + +void Sample_SoloMeshTiled::cleanup() +{ + delete m_tileSet; + m_tileSet = 0; + rcFreePolyMesh(m_pmesh); + m_pmesh = 0; + rcFreePolyMeshDetail(m_dmesh); + m_dmesh = 0; + dtFreeNavMesh(m_navMesh); + m_navMesh = 0; + m_statTimePerTileSamples = 0; + m_statPolysPerTileSamples = 0; +} + +void Sample_SoloMeshTiled::handleSettings() +{ + Sample::handleCommonSettings(); + + imguiLabel("Tiling"); + imguiSlider("TileSize", &m_tileSize, 16.0f, 1024.0f, 16.0f); + + if (m_geom) + { + const float* bmin = m_geom->getMeshBoundsMin(); + const float* bmax = m_geom->getMeshBoundsMax(); + char text[64]; + int gw = 0, gh = 0; + rcCalcGridSize(bmin, bmax, m_cellSize, &gw, &gh); + const int ts = (int)m_tileSize; + const int tw = (gw + ts-1) / ts; + const int th = (gh + ts-1) / ts; + snprintf(text, 64, "Tiles %d x %d", tw, th); + imguiValue(text); + } + + imguiSeparator(); + if (imguiCheck("Keep Itermediate Results", m_keepInterResults)) + m_keepInterResults = !m_keepInterResults; + if (imguiCheck("Measure Per Tile Timings", m_measurePerTileTimings)) + m_measurePerTileTimings = !m_measurePerTileTimings; + + imguiSeparator(); + + char msg[64]; + snprintf(msg, 64, "Build Time: %.1fms", m_totalBuildTimeMs); + imguiLabel(msg); + + imguiSeparator(); +} + +void Sample_SoloMeshTiled::handleTools() +{ + int type = !m_tool ? TOOL_NONE : m_tool->type(); + + if (imguiCheck("Test Navmesh", type == TOOL_NAVMESH_TESTER)) + { + setTool(new NavMeshTesterTool); + } + if (imguiCheck("Create Off-Mesh Links", type == TOOL_OFFMESH_CONNECTION)) + { + setTool(new OffMeshConnectionTool); + } + if (imguiCheck("Create Convex Volumes", type == TOOL_CONVEX_VOLUME)) + { + setTool(new ConvexVolumeTool); + } + if (imguiCheck("Create Crowds", type == TOOL_CROWD)) + { + setTool(new CrowdTool); + } + if (imguiCheck("Highlight Tile", type == TOOL_TILE_HIGHLIGHT)) + { + setTool(new TileHighlightTool); + } + + imguiSeparatorLine(); + + imguiIndent(); + + if (m_tool) + m_tool->handleMenu(); + + imguiUnindent(); +} + +void Sample_SoloMeshTiled::handleDebugMode() +{ + // Check which modes are valid. + bool valid[MAX_DRAWMODE]; + for (int i = 0; i < MAX_DRAWMODE; ++i) + valid[i] = false; + + bool hasChf = false; + bool hasSolid = false; + bool hasCset = false; + bool hasPmesh = false; + bool hasDmesh = false; + if (m_tileSet) + { + for (int i = 0; i < m_tileSet->width*m_tileSet->height; ++i) + { + if (m_tileSet->tiles[i].solid) hasSolid = true; + if (m_tileSet->tiles[i].chf) hasChf = true; + if (m_tileSet->tiles[i].cset) hasCset = true; + if (m_tileSet->tiles[i].pmesh) hasPmesh = true; + if (m_tileSet->tiles[i].dmesh) hasDmesh = true; + } + } + if (m_pmesh) hasPmesh = true; + if (m_dmesh) hasDmesh = true; + + if (m_geom) + { + valid[DRAWMODE_NAVMESH] = m_navMesh != 0; + valid[DRAWMODE_NAVMESH_TRANS] = m_navMesh != 0; + valid[DRAWMODE_NAVMESH_BVTREE] = m_navMesh != 0; + valid[DRAWMODE_NAVMESH_NODES] = m_navQuery != 0; + valid[DRAWMODE_NAVMESH_INVIS] = m_navMesh != 0; + valid[DRAWMODE_MESH] = true; + valid[DRAWMODE_VOXELS] = hasSolid; + valid[DRAWMODE_VOXELS_WALKABLE] = hasSolid; + valid[DRAWMODE_COMPACT] = hasChf; + valid[DRAWMODE_COMPACT_DISTANCE] = hasChf; + valid[DRAWMODE_COMPACT_REGIONS] = hasChf; + valid[DRAWMODE_REGION_CONNECTIONS] = hasCset; + valid[DRAWMODE_RAW_CONTOURS] = hasCset; + valid[DRAWMODE_BOTH_CONTOURS] = hasCset; + valid[DRAWMODE_CONTOURS] = hasCset; + valid[DRAWMODE_POLYMESH] = hasPmesh; + valid[DRAWMODE_POLYMESH_DETAIL] = hasDmesh; + } + + int unavail = 0; + for (int i = 0; i < MAX_DRAWMODE; ++i) + if (!valid[i]) unavail++; + + if (unavail == MAX_DRAWMODE) + return; + + imguiLabel("Draw"); + if (imguiCheck("Input Mesh", m_drawMode == DRAWMODE_MESH, valid[DRAWMODE_MESH])) + m_drawMode = DRAWMODE_MESH; + if (imguiCheck("Navmesh", m_drawMode == DRAWMODE_NAVMESH, valid[DRAWMODE_NAVMESH])) + m_drawMode = DRAWMODE_NAVMESH; + if (imguiCheck("Navmesh Invis", m_drawMode == DRAWMODE_NAVMESH_INVIS, valid[DRAWMODE_NAVMESH_INVIS])) + m_drawMode = DRAWMODE_NAVMESH_INVIS; + if (imguiCheck("Navmesh Trans", m_drawMode == DRAWMODE_NAVMESH_TRANS, valid[DRAWMODE_NAVMESH_TRANS])) + m_drawMode = DRAWMODE_NAVMESH_TRANS; + if (imguiCheck("Navmesh BVTree", m_drawMode == DRAWMODE_NAVMESH_BVTREE, valid[DRAWMODE_NAVMESH_BVTREE])) + m_drawMode = DRAWMODE_NAVMESH_BVTREE; + if (imguiCheck("Navmesh Nodes", m_drawMode == DRAWMODE_NAVMESH_NODES, valid[DRAWMODE_NAVMESH_NODES])) + m_drawMode = DRAWMODE_NAVMESH_NODES; + if (imguiCheck("Voxels", m_drawMode == DRAWMODE_VOXELS, valid[DRAWMODE_VOXELS])) + m_drawMode = DRAWMODE_VOXELS; + if (imguiCheck("Walkable Voxels", m_drawMode == DRAWMODE_VOXELS_WALKABLE, valid[DRAWMODE_VOXELS_WALKABLE])) + m_drawMode = DRAWMODE_VOXELS_WALKABLE; + if (imguiCheck("Compact", m_drawMode == DRAWMODE_COMPACT, valid[DRAWMODE_COMPACT])) + m_drawMode = DRAWMODE_COMPACT; + if (imguiCheck("Compact Distance", m_drawMode == DRAWMODE_COMPACT_DISTANCE, valid[DRAWMODE_COMPACT_DISTANCE])) + m_drawMode = DRAWMODE_COMPACT_DISTANCE; + if (imguiCheck("Compact Regions", m_drawMode == DRAWMODE_COMPACT_REGIONS, valid[DRAWMODE_COMPACT_REGIONS])) + m_drawMode = DRAWMODE_COMPACT_REGIONS; + if (imguiCheck("Region Connections", m_drawMode == DRAWMODE_REGION_CONNECTIONS, valid[DRAWMODE_REGION_CONNECTIONS])) + m_drawMode = DRAWMODE_REGION_CONNECTIONS; + if (imguiCheck("Raw Contours", m_drawMode == DRAWMODE_RAW_CONTOURS, valid[DRAWMODE_RAW_CONTOURS])) + m_drawMode = DRAWMODE_RAW_CONTOURS; + if (imguiCheck("Both Contours", m_drawMode == DRAWMODE_BOTH_CONTOURS, valid[DRAWMODE_BOTH_CONTOURS])) + m_drawMode = DRAWMODE_BOTH_CONTOURS; + if (imguiCheck("Contours", m_drawMode == DRAWMODE_CONTOURS, valid[DRAWMODE_CONTOURS])) + m_drawMode = DRAWMODE_CONTOURS; + if (imguiCheck("Poly Mesh", m_drawMode == DRAWMODE_POLYMESH, valid[DRAWMODE_POLYMESH])) + m_drawMode = DRAWMODE_POLYMESH; + if (imguiCheck("Poly Mesh Detail", m_drawMode == DRAWMODE_POLYMESH_DETAIL, valid[DRAWMODE_POLYMESH_DETAIL])) + m_drawMode = DRAWMODE_POLYMESH_DETAIL; + + if (unavail) + { + imguiValue("Tick 'Keep Itermediate Results'"); + imguiValue("to see more debug mode options."); + } +} + +void Sample_SoloMeshTiled::handleRender() +{ + if (!m_geom || !m_geom->getMesh()) + return; + + DebugDrawGL dd; + + glEnable(GL_FOG); + glDepthMask(GL_TRUE); + + if (m_drawMode == DRAWMODE_MESH) + { + // Draw mesh + duDebugDrawTriMeshSlope(&dd, m_geom->getMesh()->getVerts(), m_geom->getMesh()->getVertCount(), + m_geom->getMesh()->getTris(), m_geom->getMesh()->getNormals(), m_geom->getMesh()->getTriCount(), + m_agentMaxSlope); + m_geom->drawOffMeshConnections(&dd); + } + else if (m_drawMode != DRAWMODE_NAVMESH_TRANS) + { + // Draw mesh + duDebugDrawTriMesh(&dd, m_geom->getMesh()->getVerts(), m_geom->getMesh()->getVertCount(), + m_geom->getMesh()->getTris(), m_geom->getMesh()->getNormals(), m_geom->getMesh()->getTriCount(), 0); + m_geom->drawOffMeshConnections(&dd); + } + + glDisable(GL_FOG); + glDepthMask(GL_FALSE); + + // Draw bounds + const float* bmin = m_geom->getMeshBoundsMin(); + const float* bmax = m_geom->getMeshBoundsMax(); + duDebugDrawBoxWire(&dd, bmin[0],bmin[1],bmin[2], bmax[0],bmax[1],bmax[2], duRGBA(255,255,255,128), 1.0f); + + // Tiling grid. + int gw = 0, gh = 0; + rcCalcGridSize(bmin, bmax, m_cellSize, &gw, &gh); + const int tw = (gw + (int)m_tileSize-1) / (int)m_tileSize; + const int th = (gh + (int)m_tileSize-1) / (int)m_tileSize; + const float s = m_tileSize*m_cellSize; + duDebugDrawGridXZ(&dd, bmin[0],bmin[1],bmin[2], tw,th, s, duRGBA(0,0,0,64), 1.0f); + + if (m_navMesh && m_navQuery && + (m_drawMode == DRAWMODE_NAVMESH || + m_drawMode == DRAWMODE_NAVMESH_TRANS || + m_drawMode == DRAWMODE_NAVMESH_BVTREE || + m_drawMode == DRAWMODE_NAVMESH_NODES || + m_drawMode == DRAWMODE_NAVMESH_INVIS)) + { + if (m_drawMode != DRAWMODE_NAVMESH_INVIS) + duDebugDrawNavMeshWithClosedList(&dd, *m_navMesh, *m_navQuery, m_navMeshDrawFlags); + if (m_drawMode == DRAWMODE_NAVMESH_BVTREE) + duDebugDrawNavMeshBVTree(&dd, *m_navMesh); + if (m_drawMode == DRAWMODE_NAVMESH_NODES) + duDebugDrawNavMeshNodes(&dd, *m_navQuery); + } + + glDepthMask(GL_TRUE); + + if (m_tileSet) + { + if (m_drawMode == DRAWMODE_COMPACT) + { + for (int i = 0; i < m_tileSet->width*m_tileSet->height; ++i) + { + if (m_tileSet->tiles[i].chf && canDrawTile(m_tileSet->tiles[i].x,m_tileSet->tiles[i].y)) + duDebugDrawCompactHeightfieldSolid(&dd, *m_tileSet->tiles[i].chf); + } + } + + if (m_drawMode == DRAWMODE_COMPACT_DISTANCE) + { + for (int i = 0; i < m_tileSet->width*m_tileSet->height; ++i) + { + if (m_tileSet->tiles[i].chf && canDrawTile(m_tileSet->tiles[i].x,m_tileSet->tiles[i].y)) + duDebugDrawCompactHeightfieldDistance(&dd, *m_tileSet->tiles[i].chf); + } + } + if (m_drawMode == DRAWMODE_COMPACT_REGIONS) + { + for (int i = 0; i < m_tileSet->width*m_tileSet->height; ++i) + { + if (m_tileSet->tiles[i].chf && canDrawTile(m_tileSet->tiles[i].x,m_tileSet->tiles[i].y)) + duDebugDrawCompactHeightfieldRegions(&dd, *m_tileSet->tiles[i].chf); + } + } + + if (m_drawMode == DRAWMODE_VOXELS) + { + glEnable(GL_FOG); + for (int i = 0; i < m_tileSet->width*m_tileSet->height; ++i) + { + if (m_tileSet->tiles[i].solid && canDrawTile(m_tileSet->tiles[i].x,m_tileSet->tiles[i].y)) + duDebugDrawHeightfieldSolid(&dd, *m_tileSet->tiles[i].solid); + } + glDisable(GL_FOG); + } + if (m_drawMode == DRAWMODE_VOXELS_WALKABLE) + { + glEnable(GL_FOG); + for (int i = 0; i < m_tileSet->width*m_tileSet->height; ++i) + { + if (m_tileSet->tiles[i].solid && canDrawTile(m_tileSet->tiles[i].x,m_tileSet->tiles[i].y)) + duDebugDrawHeightfieldWalkable(&dd, *m_tileSet->tiles[i].solid); + } + glDisable(GL_FOG); + } + if (m_drawMode == DRAWMODE_RAW_CONTOURS) + { + glDepthMask(GL_FALSE); + for (int i = 0; i < m_tileSet->width*m_tileSet->height; ++i) + { + if (m_tileSet->tiles[i].cset && canDrawTile(m_tileSet->tiles[i].x,m_tileSet->tiles[i].y)) + duDebugDrawRawContours(&dd, *m_tileSet->tiles[i].cset); + } + glDepthMask(GL_TRUE); + } + if (m_drawMode == DRAWMODE_BOTH_CONTOURS) + { + glDepthMask(GL_FALSE); + for (int i = 0; i < m_tileSet->width*m_tileSet->height; ++i) + { + if (m_tileSet->tiles[i].cset && canDrawTile(m_tileSet->tiles[i].x,m_tileSet->tiles[i].y)) + { + duDebugDrawRawContours(&dd, *m_tileSet->tiles[i].cset, 0.5f); + duDebugDrawContours(&dd, *m_tileSet->tiles[i].cset); + } + } + glDepthMask(GL_TRUE); + } + if (m_drawMode == DRAWMODE_CONTOURS) + { + glDepthMask(GL_FALSE); + for (int i = 0; i < m_tileSet->width*m_tileSet->height; ++i) + { + if (m_tileSet->tiles[i].cset && canDrawTile(m_tileSet->tiles[i].x,m_tileSet->tiles[i].y)) + duDebugDrawContours(&dd, *m_tileSet->tiles[i].cset); + } + glDepthMask(GL_TRUE); + } + if (m_drawMode == DRAWMODE_REGION_CONNECTIONS) + { + for (int i = 0; i < m_tileSet->width*m_tileSet->height; ++i) + { + if (m_tileSet->tiles[i].chf && canDrawTile(m_tileSet->tiles[i].x,m_tileSet->tiles[i].y)) + duDebugDrawCompactHeightfieldRegions(&dd, *m_tileSet->tiles[i].chf); + } + + glDepthMask(GL_FALSE); + for (int i = 0; i < m_tileSet->width*m_tileSet->height; ++i) + { + if (m_tileSet->tiles[i].cset && canDrawTile(m_tileSet->tiles[i].x,m_tileSet->tiles[i].y)) + duDebugDrawRegionConnections(&dd, *m_tileSet->tiles[i].cset); + } + glDepthMask(GL_TRUE); + } + if (/*m_pmesh &&*/ m_drawMode == DRAWMODE_POLYMESH) + { + glDepthMask(GL_FALSE); + if (m_pmesh) + { + duDebugDrawPolyMesh(&dd, *m_pmesh); + } + else + { + for (int i = 0; i < m_tileSet->width*m_tileSet->height; ++i) + { + if (m_tileSet->tiles[i].pmesh && canDrawTile(m_tileSet->tiles[i].x,m_tileSet->tiles[i].y)) + duDebugDrawPolyMesh(&dd, *m_tileSet->tiles[i].pmesh); + } + } + + glDepthMask(GL_TRUE); + } + if (/*m_dmesh &&*/ m_drawMode == DRAWMODE_POLYMESH_DETAIL) + { + glDepthMask(GL_FALSE); + if (m_dmesh) + { + duDebugDrawPolyMeshDetail(&dd, *m_dmesh); + } + else + { + for (int i = 0; i < m_tileSet->width*m_tileSet->height; ++i) + { + if (m_tileSet->tiles[i].dmesh && canDrawTile(m_tileSet->tiles[i].x,m_tileSet->tiles[i].y)) + duDebugDrawPolyMeshDetail(&dd, *m_tileSet->tiles[i].dmesh); + } + } + glDepthMask(GL_TRUE); + } + } + + m_geom->drawConvexVolumes(&dd); + + if (m_tool) + m_tool->handleRender(); + + glDepthMask(GL_TRUE); +} + +static float nicenum(float x, int round) +{ + float expv = floorf(log10f(x)); + float f = x / powf(10.0f, expv); + float nf; + if (round) + { + if (f < 1.5f) nf = 1.0f; + else if (f < 3.0f) nf = 2.0f; + else if (f < 7.0f) nf = 5.0f; + else nf = 10.0f; + } + else + { + if (f <= 1.0f) nf = 1.0f; + else if (f <= 2.0f) nf = 2.0f; + else if (f <= 5.0f) nf = 5.0f; + else nf = 10.0f; + } + return nf*powf(10.0f, expv); +} + +static void drawLabels(int x, int y, int w, int h, + int nticks, float vmin, float vmax, const char* unit) +{ + char str[8], temp[32]; + + float range = nicenum(vmax-vmin, 0); + float d = nicenum(range/(float)(nticks-1), 1); + float graphmin = floorf(vmin/d)*d; + float graphmax = ceilf(vmax/d)*d; + int nfrac = (int)-floorf(log10f(d)); + if (nfrac < 0) nfrac = 0; + snprintf(str, 6, "%%.%df %%s", nfrac); + + for (float v = graphmin; v < graphmax+d/2; v += d) + { + float lx = x + (v-vmin)/(vmax-vmin)*w; + if (lx < 0 || lx > w) continue; + snprintf(temp, 20, str, v, unit); + imguiDrawText((int)lx+2, (int)y+2, IMGUI_ALIGN_LEFT, temp, imguiRGBA(255,255,255)); + glColor4ub(0,0,0,64); + glBegin(GL_LINES); + glVertex2f(lx,(float)y); + glVertex2f(lx,(float)(y+h)); + glEnd(); + } +} + +static void drawGraph(const char* name, int x, int y, int w, int h, float sd, + const int* samples, int n, int /*nsamples*/, const char* unit) +{ + char text[64]; + int first, last, maxval; + first = 0; + last = n-1; + while (first < n && samples[first] == 0) + first++; + while (last >= 0 && samples[last] == 0) + last--; + if (first == last) + return; + maxval = 1; + for (int i = first; i <= last; ++i) + { + if (samples[i] > maxval) + maxval = samples[i]; + } + const float sx = (float)w / (float)(last-first); + const float sy = (float)h / (float)maxval; + + glBegin(GL_QUADS); + glColor4ub(32,32,32,64); + glVertex2i(x,y); + glVertex2i(x+w,y); + glVertex2i(x+w,y+h); + glVertex2i(x,y+h); + glEnd(); + + glColor4ub(255,255,255,64); + glBegin(GL_LINES); + for (int i = 0; i <= 4; ++i) + { + int yy = y+i*h/4; + glVertex2i(x,yy); + glVertex2i(x+w,yy); + } + glEnd(); + + glColor4ub(0,196,255,255); + glBegin(GL_LINE_STRIP); + for (int i = first; i <= last; ++i) + { + float fx = x + (i-first)*sx; + float fy = y + samples[i]*sy; + glVertex2f(fx,fy); + } + glEnd(); + + snprintf(text,64,"%d", maxval); + imguiDrawText((int)x+w-2, (int)y+h-20, IMGUI_ALIGN_RIGHT, text, imguiRGBA(0,0,0)); + imguiDrawText((int)x+2, (int)y+h-20, IMGUI_ALIGN_LEFT, name, imguiRGBA(255,255,255)); + + drawLabels(x, y, w, h, 10, first*sd, last*sd, unit); +} + +void Sample_SoloMeshTiled::handleRenderOverlay(double* proj, double* model, int* view) +{ + if (m_measurePerTileTimings) + { + if (m_statTimePerTileSamples) + drawGraph("Build Time/Tile", 10, 10, 500, 100, 1.0f, m_statTimePerTile, MAX_STAT_BUCKETS, m_statTimePerTileSamples, "ms"); + + if (m_statPolysPerTileSamples) + drawGraph("Polygons/Tile", 10, 120, 500, 100, 1.0f, m_statPolysPerTile, MAX_STAT_BUCKETS, m_statPolysPerTileSamples, ""); + + int validTiles = 0; + if (m_tileSet) + { + for (int i = 0; i < m_tileSet->width*m_tileSet->height; ++i) + { + if (m_tileSet->tiles[i].buildTime > 0) + validTiles++; + } + } + char text[64]; + snprintf(text,64,"Tiles %d\n", validTiles); + imguiDrawText(10, 240, IMGUI_ALIGN_LEFT, text, imguiRGBA(255,255,255)); + } + + if (m_tool) + m_tool->handleRenderOverlay(proj, model, view); +} + +void Sample_SoloMeshTiled::handleMeshChanged(class InputGeom* geom) +{ + Sample::handleMeshChanged(geom); + + dtFreeNavMesh(m_navMesh); + m_navMesh = 0; + + m_statTimePerTileSamples = 0; + m_statPolysPerTileSamples = 0; + + if (m_tool) + { + m_tool->reset(); + m_tool->init(this); + } +} + +bool Sample_SoloMeshTiled::handleBuild() +{ + if (!m_geom || !m_geom->getMesh() || !m_geom->getChunkyMesh()) + { + m_ctx->log(RC_LOG_ERROR, "buildNavigation: Input mesh is not specified."); + return false; + } + + if (m_measurePerTileTimings) + { + memset(m_statPolysPerTile, 0, sizeof(m_statPolysPerTile)); + memset(m_statTimePerTile, 0, sizeof(m_statTimePerTile)); + m_statPolysPerTileSamples = 0; + m_statTimePerTileSamples = 0; + } + + cleanup(); + + const float* bmin = m_geom->getMeshBoundsMin(); + const float* bmax = m_geom->getMeshBoundsMax(); + const float* verts = m_geom->getMesh()->getVerts(); + const int nverts = m_geom->getMesh()->getVertCount(); + const int ntris = m_geom->getMesh()->getTriCount(); + const rcChunkyTriMesh* chunkyMesh = m_geom->getChunkyMesh(); + + // Init build configuration from GUI + memset(&m_cfg, 0, sizeof(m_cfg)); + m_cfg.cs = m_cellSize; + m_cfg.ch = m_cellHeight; + m_cfg.walkableSlopeAngle = m_agentMaxSlope; + m_cfg.walkableHeight = (int)ceilf(m_agentHeight / m_cfg.ch); + m_cfg.walkableClimb = (int)floorf(m_agentMaxClimb / m_cfg.ch); + m_cfg.walkableRadius = (int)ceilf(m_agentRadius / m_cfg.cs); + m_cfg.maxEdgeLen = (int)(m_edgeMaxLen / m_cellSize); + m_cfg.maxSimplificationError = m_edgeMaxError; + m_cfg.minRegionArea = (int)rcSqr(m_regionMinSize); // Note: area = size*size + m_cfg.mergeRegionArea = (int)rcSqr(m_regionMergeSize); // Note: area = size*size + m_cfg.maxVertsPerPoly = (int)m_vertsPerPoly; + m_cfg.tileSize = (int)m_tileSize; + m_cfg.borderSize = m_cfg.walkableRadius + 3; // Reserve enough padding. + m_cfg.detailSampleDist = m_detailSampleDist < 0.9f ? 0 : m_cellSize * m_detailSampleDist; + m_cfg.detailSampleMaxError = m_cellHeight * m_detailSampleMaxError; + + // Set the area where the navigation will be build. + // Here the bounds of the input mesh are used, but the + // area could be specified by an user defined box, etc. + rcVcopy(m_cfg.bmin, bmin); + rcVcopy(m_cfg.bmax, bmax); + rcCalcGridSize(m_cfg.bmin, m_cfg.bmax, m_cfg.cs, &m_cfg.width, &m_cfg.height); + + // Reset build times gathering. + m_ctx->resetTimers(); + + // Start the build process. + m_ctx->startTimer(RC_TIMER_TOTAL); + + // Calculate the number of tiles in the output and initialize tiles. + m_tileSet = new TileSet; + if (!m_tileSet) + { + m_ctx->log(RC_LOG_ERROR, "buildTiledNavigation: Out of memory 'tileSet'."); + return false; + } + rcVcopy(m_tileSet->bmin, m_cfg.bmin); + rcVcopy(m_tileSet->bmax, m_cfg.bmax); + m_tileSet->cs = m_cfg.cs; + m_tileSet->ch = m_cfg.ch; + m_tileSet->width = (m_cfg.width + m_cfg.tileSize-1) / m_cfg.tileSize; + m_tileSet->height = (m_cfg.height + m_cfg.tileSize-1) / m_cfg.tileSize; + m_tileSet->tiles = new Tile[m_tileSet->height * m_tileSet->width]; + if (!m_tileSet->tiles) + { + m_ctx->log(RC_LOG_ERROR, "buildTiledNavigation: Out of memory 'tileSet->tiles' (%d).", m_tileSet->height * m_tileSet->width); + return false; + } + + m_ctx->log(RC_LOG_PROGRESS, "Building navigation:"); + m_ctx->log(RC_LOG_PROGRESS, " - %d x %d cells", m_cfg.width, m_cfg.height); + m_ctx->log(RC_LOG_PROGRESS, " - %d x %d tiles", m_tileSet->width, m_tileSet->height); + m_ctx->log(RC_LOG_PROGRESS, " - %.1f verts, %.1f tris", nverts/1000.0f, ntris/1000.0f); + + // Initialize per tile config. + rcConfig tileCfg; + memcpy(&tileCfg, &m_cfg, sizeof(rcConfig)); + tileCfg.width = m_cfg.tileSize + m_cfg.borderSize*2; + tileCfg.height = m_cfg.tileSize + m_cfg.borderSize*2; + + // Allocate array that can hold triangle flags for all geom chunks. + unsigned char* triangleAreas = new unsigned char[chunkyMesh->maxTrisPerChunk]; + if (!triangleAreas) + { + m_ctx->log(RC_LOG_ERROR, "buildTiledNavigation: Out of memory 'triangleAreas' (%d).", + chunkyMesh->maxTrisPerChunk); + return false; + } + + for (int y = 0; y < m_tileSet->height; ++y) + { + for (int x = 0; x < m_tileSet->width; ++x) + { + m_ctx->startTimer(RC_TIMER_TEMP); + + Tile& tile = m_tileSet->tiles[x + y*m_tileSet->width]; + tile.x = x; + tile.y = y; + + // Calculate the per tile bounding box. + tileCfg.bmin[0] = m_cfg.bmin[0] + (x*m_cfg.tileSize - m_cfg.borderSize)*m_cfg.cs; + tileCfg.bmin[2] = m_cfg.bmin[2] + (y*m_cfg.tileSize - m_cfg.borderSize)*m_cfg.cs; + tileCfg.bmax[0] = m_cfg.bmin[0] + ((x+1)*m_cfg.tileSize + m_cfg.borderSize)*m_cfg.cs; + tileCfg.bmax[2] = m_cfg.bmin[2] + ((y+1)*m_cfg.tileSize + m_cfg.borderSize)*m_cfg.cs; + + float tbmin[2], tbmax[2]; + tbmin[0] = tileCfg.bmin[0]; + tbmin[1] = tileCfg.bmin[2]; + tbmax[0] = tileCfg.bmax[0]; + tbmax[1] = tileCfg.bmax[2]; + int cid[512];// TODO: Make grow when returning too many items. + const int ncid = rcGetChunksOverlappingRect(chunkyMesh, tbmin, tbmax, cid, 512); + if (!ncid) + continue; + + tile.solid = rcAllocHeightfield(); + if (!tile.solid) + { + m_ctx->log(RC_LOG_ERROR, "buildTiledNavigation: [%d,%d] Out of memory 'solid'.", x, y); + continue; + } + if (!rcCreateHeightfield(m_ctx, *tile.solid, tileCfg.width, tileCfg.height, tileCfg.bmin, tileCfg.bmax, tileCfg.cs, tileCfg.ch)) + { + m_ctx->log(RC_LOG_ERROR, "buildTiledNavigation: [%d,%d] Could not create solid heightfield.", x, y); + continue; + } + + for (int i = 0; i < ncid; ++i) + { + const rcChunkyTriMeshNode& node = chunkyMesh->nodes[cid[i]]; + const int* tris = &chunkyMesh->tris[node.i*3]; + const int ntris = node.n; + + memset(triangleAreas, 0, ntris*sizeof(unsigned char)); + rcMarkWalkableTriangles(m_ctx, tileCfg.walkableSlopeAngle, + verts, nverts, tris, ntris, triangleAreas); + + rcRasterizeTriangles(m_ctx, verts, nverts, tris, triangleAreas, ntris, *tile.solid, m_cfg.walkableClimb); + } + + rcFilterLowHangingWalkableObstacles(m_ctx, m_cfg.walkableClimb, *tile.solid); + rcFilterLedgeSpans(m_ctx, tileCfg.walkableHeight, tileCfg.walkableClimb, *tile.solid); + rcFilterWalkableLowHeightSpans(m_ctx, tileCfg.walkableHeight, *tile.solid); + + tile.chf = rcAllocCompactHeightfield(); + if (!tile.chf) + { + m_ctx->log(RC_LOG_ERROR, "buildTiledNavigation: [%d,%d] Out of memory 'chf'.", x, y); + continue; + } + if (!rcBuildCompactHeightfield(m_ctx, tileCfg.walkableHeight, tileCfg.walkableClimb, + *tile.solid, *tile.chf)) + { + m_ctx->log(RC_LOG_ERROR, "buildTiledNavigation: [%d,%d] Could not build compact data.", x, y); + continue; + } + + // Erode the walkable area by agent radius. + if (!rcErodeWalkableArea(m_ctx, m_cfg.walkableRadius, *tile.chf)) + { + m_ctx->log(RC_LOG_ERROR, "buildTiledNavigation: Could not erode."); + continue; + } + + // (Optional) Mark areas. + const ConvexVolume* vols = m_geom->getConvexVolumes(); + for (int i = 0; i < m_geom->getConvexVolumeCount(); ++i) + rcMarkConvexPolyArea(m_ctx, vols[i].verts, vols[i].nverts, vols[i].hmin, vols[i].hmax, (unsigned char)vols[i].area, *tile.chf); + + if (!rcBuildDistanceField(m_ctx, *tile.chf)) + { + m_ctx->log(RC_LOG_ERROR, "buildTiledNavigation: [%d,%d] Could not build distance fields.", x, y); + continue; + } + + if (!rcBuildRegions(m_ctx, *tile.chf, tileCfg.borderSize, tileCfg.minRegionArea, tileCfg.mergeRegionArea)) + { + m_ctx->log(RC_LOG_ERROR, "buildTiledNavigation: [%d,%d] Could not build regions.", x, y); + continue; + } + + tile.cset = rcAllocContourSet(); + if (!tile.cset) + { + m_ctx->log(RC_LOG_ERROR, "buildTiledNavigation: [%d,%d] Out of memory 'cset'.", x, y); + continue; + } + if (!rcBuildContours(m_ctx, *tile.chf, tileCfg.maxSimplificationError, tileCfg.maxEdgeLen, *tile.cset)) + { + m_ctx->log(RC_LOG_ERROR, "buildTiledNavigation: [%d,%d] Could not create contours.", x, y); + continue; + } + + tile.pmesh = rcAllocPolyMesh(); + if (!tile.pmesh) + { + m_ctx->log(RC_LOG_ERROR, "buildTiledNavigation: [%d,%d] Out of memory 'pmesh'.", x, y); + continue; + } + if (!rcBuildPolyMesh(m_ctx, *tile.cset, tileCfg.maxVertsPerPoly, *tile.pmesh)) + { + m_ctx->log(RC_LOG_ERROR, "buildTiledNavigation: [%d,%d] Could not create poly mesh.", x, y); + continue; + } + + tile.dmesh = rcAllocPolyMeshDetail(); + if (!tile.dmesh) + { + m_ctx->log(RC_LOG_ERROR, "buildTiledNavigation: [%d,%d] Out of memory 'dmesh'.", x, y); + continue; + } + + if (!rcBuildPolyMeshDetail(m_ctx, *tile.pmesh, *tile.chf, tileCfg.detailSampleDist, tileCfg .detailSampleMaxError, *tile.dmesh)) + { + m_ctx->log(RC_LOG_ERROR, "buildTiledNavigation: [%d,%d] Could not build detail mesh.", x, y); + continue; + } + + if (!m_keepInterResults) + { + rcFreeHeightField(tile.solid); + tile.solid = 0; + rcFreeCompactHeightfield(tile.chf); + tile.chf = 0; + rcFreeContourSet(tile.cset); + tile.cset = 0; + } + + m_ctx->stopTimer(RC_TIMER_TOTAL); + + tile.buildTime += m_ctx->getAccumulatedTime(RC_TIMER_TOTAL); + + // Some extra code to measure some per tile statistics, + // such as build time and how many polygons there are per tile. + if (tile.pmesh) + { + int bucket = tile.pmesh->npolys; + if (bucket < 0) bucket = 0; + if (bucket >= MAX_STAT_BUCKETS) bucket = MAX_STAT_BUCKETS-1; + m_statPolysPerTile[bucket]++; + m_statPolysPerTileSamples++; + } + int bucket = (tile.buildTime+500)/1000; + if (bucket < 0) bucket = 0; + if (bucket >= MAX_STAT_BUCKETS) bucket = MAX_STAT_BUCKETS-1; + m_statTimePerTile[bucket]++; + m_statTimePerTileSamples++; + } + } + + delete [] triangleAreas; + + // Merge per tile poly and detail meshes. + rcPolyMesh** pmmerge = new rcPolyMesh*[m_tileSet->width*m_tileSet->height]; + if (!pmmerge) + { + m_ctx->log(RC_LOG_ERROR, "buildTiledNavigation: Out of memory 'pmmerge' (%d).", m_tileSet->width*m_tileSet->height); + return false; + } + + rcPolyMeshDetail** dmmerge = new rcPolyMeshDetail*[m_tileSet->width*m_tileSet->height]; + if (!dmmerge) + { + m_ctx->log(RC_LOG_ERROR, "buildTiledNavigation: Out of memory 'dmmerge' (%d).", m_tileSet->width*m_tileSet->height); + return false; + } + + int nmerge = 0; + for (int y = 0; y < m_tileSet->height; ++y) + { + for (int x = 0; x < m_tileSet->width; ++x) + { + Tile& tile = m_tileSet->tiles[x + y*m_tileSet->width]; + if (tile.pmesh) + { + pmmerge[nmerge] = tile.pmesh; + dmmerge[nmerge] = tile.dmesh; + nmerge++; + } + } + } + + m_pmesh = rcAllocPolyMesh(); + if (!m_pmesh) + { + m_ctx->log(RC_LOG_ERROR, "buildNavigation: Out of memory 'pmesh'."); + return false; + } + rcMergePolyMeshes(m_ctx, pmmerge, nmerge, *m_pmesh); + + m_dmesh = rcAllocPolyMeshDetail(); + if (!m_dmesh) + { + m_ctx->log(RC_LOG_ERROR, "buildNavigation: Out of memory 'dmesh'."); + return false; + } + rcMergePolyMeshDetails(m_ctx, dmmerge, nmerge, *m_dmesh); + + delete [] pmmerge; + delete [] dmmerge; + + if (!m_keepInterResults) + { + for (int y = 0; y < m_tileSet->height; ++y) + { + for (int x = 0; x < m_tileSet->width; ++x) + { + Tile& tile = m_tileSet->tiles[x + y*m_tileSet->width]; + rcFreeContourSet(tile.cset); + tile.cset = 0; + rcFreePolyMesh(tile.pmesh); + tile.pmesh = 0; + rcFreePolyMeshDetail(tile.dmesh); + tile.dmesh = 0; + } + } + } + + if (m_pmesh && m_cfg.maxVertsPerPoly <= DT_VERTS_PER_POLYGON) + { + unsigned char* navData = 0; + int navDataSize = 0; + + // Update poly flags from areas. + for (int i = 0; i < m_pmesh->npolys; ++i) + { + if (m_pmesh->areas[i] == RC_WALKABLE_AREA) + m_pmesh->areas[i] = SAMPLE_POLYAREA_GROUND; + + if (m_pmesh->areas[i] == SAMPLE_POLYAREA_GROUND || + m_pmesh->areas[i] == SAMPLE_POLYAREA_GRASS || + m_pmesh->areas[i] == SAMPLE_POLYAREA_ROAD) + { + m_pmesh->flags[i] = SAMPLE_POLYFLAGS_WALK; + } + else if (m_pmesh->areas[i] == SAMPLE_POLYAREA_WATER) + { + m_pmesh->flags[i] = SAMPLE_POLYFLAGS_SWIM; + } + else if (m_pmesh->areas[i] == SAMPLE_POLYAREA_DOOR) + { + m_pmesh->flags[i] = SAMPLE_POLYFLAGS_WALK | SAMPLE_POLYFLAGS_DOOR; + } + } + + dtNavMeshCreateParams params; + memset(¶ms, 0, sizeof(params)); + params.verts = m_pmesh->verts; + params.vertCount = m_pmesh->nverts; + params.polys = m_pmesh->polys; + params.polyAreas = m_pmesh->areas; + params.polyFlags = m_pmesh->flags; + params.polyCount = m_pmesh->npolys; + params.nvp = m_pmesh->nvp; + params.detailMeshes = m_dmesh->meshes; + params.detailVerts = m_dmesh->verts; + params.detailVertsCount = m_dmesh->nverts; + params.detailTris = m_dmesh->tris; + params.detailTriCount = m_dmesh->ntris; + params.offMeshConVerts = m_geom->getOffMeshConnectionVerts(); + params.offMeshConRad = m_geom->getOffMeshConnectionRads(); + params.offMeshConDir = m_geom->getOffMeshConnectionDirs(); + params.offMeshConAreas = m_geom->getOffMeshConnectionAreas(); + params.offMeshConFlags = m_geom->getOffMeshConnectionFlags(); + params.offMeshConUserID = m_geom->getOffMeshConnectionId(); + params.offMeshConCount = m_geom->getOffMeshConnectionCount(); + params.walkableHeight = m_agentHeight; + params.walkableRadius = m_agentRadius; + params.walkableClimb = m_agentMaxClimb; + rcVcopy(params.bmin, m_pmesh->bmin); + rcVcopy(params.bmax, m_pmesh->bmax); + params.cs = m_cfg.cs; + params.ch = m_cfg.ch; + + if (!dtCreateNavMeshData(¶ms, &navData, &navDataSize)) + { + m_ctx->log(RC_LOG_ERROR, "Could not build Detour navmesh."); + return false; + } + + m_navMesh = dtAllocNavMesh(); + if (!m_navMesh) + { + dtFree(navData); + m_ctx->log(RC_LOG_ERROR, "Could not create Detour navmesh"); + return false; + } + + if (m_navMesh->init(navData, navDataSize, DT_TILE_FREE_DATA) != DT_SUCCESS) + { + dtFree(navData); + m_ctx->log(RC_LOG_ERROR, "Could not init Detour navmesh"); + return false; + } + + if (m_navQuery->init(m_navMesh, 2048) != DT_SUCCESS) + { + m_ctx->log(RC_LOG_ERROR, "Could not init Detour navmesh query"); + return false; + } + } + + m_ctx->stopTimer(RC_TIMER_TOTAL); + + duLogBuildTimes(*m_ctx, m_ctx->getAccumulatedTime(RC_TIMER_TOTAL)); + m_ctx->log(RC_LOG_PROGRESS, ">> Polymesh: %d vertices %d polygons", m_pmesh->nverts, m_pmesh->npolys); + + m_totalBuildTimeMs = m_ctx->getAccumulatedTime(RC_TIMER_TOTAL)/1000.0f; + + if (m_tool) + m_tool->init(this); + + return true; +} + +bool Sample_SoloMeshTiled::canDrawTile(int x, int y) +{ + if (m_highLightedTileX == -1) return true; + return m_highLightedTileX == x && m_highLightedTileY == y; +} + +void Sample_SoloMeshTiled::setHighlightedTile(const float* pos) +{ + if (!pos) + { + m_highLightedTileX = -1; + m_highLightedTileY = -1; + return; + } + const float* bmin = m_geom->getMeshBoundsMin(); + const float ts = m_tileSize*m_cellSize; + m_highLightedTileX = (int)((pos[0] - bmin[0]) / ts); + m_highLightedTileY = (int)((pos[2] - bmin[2]) / ts); +} diff --git a/dep/recastnavigation/RecastDemo/Source/Sample_TileMesh.cpp b/dep/recastnavigation/RecastDemo/Source/Sample_TileMesh.cpp new file mode 100644 index 000000000..e0fe3b25b --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Source/Sample_TileMesh.cpp @@ -0,0 +1,1196 @@ +// +// Copyright (c) 2009-2010 Mikko Mononen memon@inside.org +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. +// + +#define _USE_MATH_DEFINES +#include +#include +#include +#include "SDL.h" +#include "SDL_opengl.h" +#include "imgui.h" +#include "InputGeom.h" +#include "Sample.h" +#include "Sample_TileMesh.h" +#include "Recast.h" +#include "RecastDebugDraw.h" +#include "DetourNavMesh.h" +#include "DetourNavMeshBuilder.h" +#include "DetourDebugDraw.h" +#include "NavMeshTesterTool.h" +#include "OffMeshConnectionTool.h" +#include "ConvexVolumeTool.h" +#include "CrowdTool.h" + +#ifdef WIN32 +# define snprintf _snprintf +#endif + + +inline unsigned int nextPow2(unsigned int v) +{ + v--; + v |= v >> 1; + v |= v >> 2; + v |= v >> 4; + v |= v >> 8; + v |= v >> 16; + v++; + return v; +} + +inline unsigned int ilog2(unsigned int v) +{ + unsigned int r; + unsigned int shift; + r = (v > 0xffff) << 4; v >>= r; + shift = (v > 0xff) << 3; v >>= shift; r |= shift; + shift = (v > 0xf) << 2; v >>= shift; r |= shift; + shift = (v > 0x3) << 1; v >>= shift; r |= shift; + r |= (v >> 1); + return r; +} + +class NavMeshTileTool : public SampleTool +{ + Sample_TileMesh* m_sample; + float m_hitPos[3]; + bool m_hitPosSet; + float m_agentRadius; + +public: + + NavMeshTileTool() : + m_sample(0), + m_hitPosSet(false), + m_agentRadius(0) + { + m_hitPos[0] = m_hitPos[1] = m_hitPos[2] = 0; + } + + virtual ~NavMeshTileTool() + { + } + + virtual int type() { return TOOL_TILE_EDIT; } + + virtual void init(Sample* sample) + { + m_sample = (Sample_TileMesh*)sample; + } + + virtual void reset() {} + + virtual void handleMenu() + { + imguiLabel("Create Tiles"); + if (imguiButton("Create All")) + { + if (m_sample) + m_sample->buildAllTiles(); + } + if (imguiButton("Remove All")) + { + if (m_sample) + m_sample->removeAllTiles(); + } + imguiValue("Click LMB to create a tile."); + imguiValue("Shift+LMB to remove a tile."); + } + + virtual void handleClick(const float* /*s*/, const float* p, bool shift) + { + m_hitPosSet = true; + rcVcopy(m_hitPos,p); + if (m_sample) + { + if (shift) + m_sample->removeTile(m_hitPos); + else + m_sample->buildTile(m_hitPos); + } + } + + virtual void handleToggle() {} + + virtual void handleStep() {} + + virtual void handleUpdate(const float /*dt*/) {} + + virtual void handleRender() + { + if (m_hitPosSet) + { + const float s = m_sample->getAgentRadius(); + glColor4ub(0,0,0,128); + glLineWidth(2.0f); + glBegin(GL_LINES); + glVertex3f(m_hitPos[0]-s,m_hitPos[1]+0.1f,m_hitPos[2]); + glVertex3f(m_hitPos[0]+s,m_hitPos[1]+0.1f,m_hitPos[2]); + glVertex3f(m_hitPos[0],m_hitPos[1]-s+0.1f,m_hitPos[2]); + glVertex3f(m_hitPos[0],m_hitPos[1]+s+0.1f,m_hitPos[2]); + glVertex3f(m_hitPos[0],m_hitPos[1]+0.1f,m_hitPos[2]-s); + glVertex3f(m_hitPos[0],m_hitPos[1]+0.1f,m_hitPos[2]+s); + glEnd(); + glLineWidth(1.0f); + } + } + + virtual void handleRenderOverlay(double* proj, double* model, int* view) + { + GLdouble x, y, z; + if (m_hitPosSet && gluProject((GLdouble)m_hitPos[0], (GLdouble)m_hitPos[1], (GLdouble)m_hitPos[2], + model, proj, view, &x, &y, &z)) + { + int tx=0, ty=0; + m_sample->getTilePos(m_hitPos, tx, ty); + char text[32]; + snprintf(text,32,"(%d,%d)", tx,ty); + imguiDrawText((int)x, (int)y-25, IMGUI_ALIGN_CENTER, text, imguiRGBA(0,0,0,220)); + } + + } +}; + + + + +Sample_TileMesh::Sample_TileMesh() : + m_keepInterResults(false), + m_buildAll(true), + m_totalBuildTimeMs(0), + m_drawPortals(false), + m_triareas(0), + m_solid(0), + m_chf(0), + m_cset(0), + m_pmesh(0), + m_dmesh(0), + m_drawMode(DRAWMODE_NAVMESH), + m_maxTiles(0), + m_maxPolysPerTile(0), + m_tileSize(32), + m_tileCol(duRGBA(0,0,0,32)), + m_tileBuildTime(0), + m_tileMemUsage(0), + m_tileTriCount(0) +{ + resetCommonSettings(); + memset(m_tileBmin, 0, sizeof(m_tileBmin)); + memset(m_tileBmax, 0, sizeof(m_tileBmax)); + + setTool(new NavMeshTileTool); +} + +Sample_TileMesh::~Sample_TileMesh() +{ + cleanup(); + dtFreeNavMesh(m_navMesh); + m_navMesh = 0; +} + +void Sample_TileMesh::cleanup() +{ + delete [] m_triareas; + m_triareas = 0; + rcFreeHeightField(m_solid); + m_solid = 0; + rcFreeCompactHeightfield(m_chf); + m_chf = 0; + rcFreeContourSet(m_cset); + m_cset = 0; + rcFreePolyMesh(m_pmesh); + m_pmesh = 0; + rcFreePolyMeshDetail(m_dmesh); + m_dmesh = 0; +} + + +static const int NAVMESHSET_MAGIC = 'M'<<24 | 'S'<<16 | 'E'<<8 | 'T'; //'MSET'; +static const int NAVMESHSET_VERSION = 1; + +struct NavMeshSetHeader +{ + int magic; + int version; + int numTiles; + dtNavMeshParams params; +}; + +struct NavMeshTileHeader +{ + dtTileRef tileRef; + int dataSize; +}; + +void Sample_TileMesh::saveAll(const char* path, const dtNavMesh* mesh) +{ + if (!mesh) return; + + FILE* fp = fopen(path, "wb"); + if (!fp) + return; + + // Store header. + NavMeshSetHeader header; + header.magic = NAVMESHSET_MAGIC; + header.version = NAVMESHSET_VERSION; + header.numTiles = 0; + for (int i = 0; i < mesh->getMaxTiles(); ++i) + { + const dtMeshTile* tile = mesh->getTile(i); + if (!tile || !tile->header || !tile->dataSize) continue; + header.numTiles++; + } + memcpy(&header.params, mesh->getParams(), sizeof(dtNavMeshParams)); + fwrite(&header, sizeof(NavMeshSetHeader), 1, fp); + + // Store tiles. + for (int i = 0; i < mesh->getMaxTiles(); ++i) + { + const dtMeshTile* tile = mesh->getTile(i); + if (!tile || !tile->header || !tile->dataSize) continue; + + NavMeshTileHeader tileHeader; + tileHeader.tileRef = mesh->getTileRef(tile); + tileHeader.dataSize = tile->dataSize; + fwrite(&tileHeader, sizeof(tileHeader), 1, fp); + + fwrite(tile->data, tile->dataSize, 1, fp); + } + + fclose(fp); +} + +dtNavMesh* Sample_TileMesh::loadAll(const char* path) +{ + FILE* fp = fopen(path, "rb"); + if (!fp) return 0; + + // Read header. + NavMeshSetHeader header; + fread(&header, sizeof(NavMeshSetHeader), 1, fp); + if (header.magic != NAVMESHSET_MAGIC) + { + fclose(fp); + return 0; + } + if (header.version != NAVMESHSET_VERSION) + { + fclose(fp); + return 0; + } + + dtNavMesh* mesh = dtAllocNavMesh(); + + if (!mesh || mesh->init(&header.params) != DT_SUCCESS) + { + fclose(fp); + return 0; + } + + // Read tiles. + for (int i = 0; i < header.numTiles; ++i) + { + NavMeshTileHeader tileHeader; + fread(&tileHeader, sizeof(tileHeader), 1, fp); + if (!tileHeader.tileRef || !tileHeader.dataSize) + break; + + unsigned char* data = (unsigned char*)dtAlloc(tileHeader.dataSize, DT_ALLOC_PERM); + if (!data) break; + memset(data, 0, tileHeader.dataSize); + fread(data, tileHeader.dataSize, 1, fp); + + mesh->addTile(data, tileHeader.dataSize, DT_TILE_FREE_DATA, tileHeader.tileRef, 0); + } + + fclose(fp); + + return mesh; +} + +void Sample_TileMesh::handleSettings() +{ + Sample::handleCommonSettings(); + + if (imguiCheck("Keep Itermediate Results", m_keepInterResults)) + m_keepInterResults = !m_keepInterResults; + + if (imguiCheck("Build All Tiles", m_buildAll)) + m_buildAll = !m_buildAll; + + imguiLabel("Tiling"); + imguiSlider("TileSize", &m_tileSize, 16.0f, 1024.0f, 16.0f); + + if (m_geom) + { + const float* bmin = m_geom->getMeshBoundsMin(); + const float* bmax = m_geom->getMeshBoundsMax(); + char text[64]; + int gw = 0, gh = 0; + rcCalcGridSize(bmin, bmax, m_cellSize, &gw, &gh); + const int ts = (int)m_tileSize; + const int tw = (gw + ts-1) / ts; + const int th = (gh + ts-1) / ts; + snprintf(text, 64, "Tiles %d x %d", tw, th); + imguiValue(text); + + // Max tiles and max polys affect how the tile IDs are caculated. + // There are 22 bits available for identifying a tile and a polygon. + int tileBits = rcMin((int)ilog2(nextPow2(tw*th)), 14); + if (tileBits > 14) tileBits = 14; + int polyBits = 22 - tileBits; + m_maxTiles = 1 << tileBits; + m_maxPolysPerTile = 1 << polyBits; + snprintf(text, 64, "Max Tiles %d", m_maxTiles); + imguiValue(text); + snprintf(text, 64, "Max Polys %d", m_maxPolysPerTile); + imguiValue(text); + } + else + { + m_maxTiles = 0; + m_maxPolysPerTile = 0; + } + + imguiSeparator(); + + imguiIndent(); + imguiIndent(); + + if (imguiButton("Save")) + { + saveAll("all_tiles_navmesh.bin", m_navMesh); + } + + if (imguiButton("Load")) + { + dtFreeNavMesh(m_navMesh); + m_navMesh = loadAll("all_tiles_navmesh.bin"); + m_navQuery->init(m_navMesh, 2048); + } + + imguiUnindent(); + imguiUnindent(); + + char msg[64]; + snprintf(msg, 64, "Build Time: %.1fms", m_totalBuildTimeMs); + imguiLabel(msg); + + imguiSeparator(); + + imguiSeparator(); + +} + +void Sample_TileMesh::handleTools() +{ + int type = !m_tool ? TOOL_NONE : m_tool->type(); + + if (imguiCheck("Test Navmesh", type == TOOL_NAVMESH_TESTER)) + { + setTool(new NavMeshTesterTool); + } + if (imguiCheck("Create Tiles", type == TOOL_TILE_EDIT)) + { + setTool(new NavMeshTileTool); + } + if (imguiCheck("Create Off-Mesh Links", type == TOOL_OFFMESH_CONNECTION)) + { + setTool(new OffMeshConnectionTool); + } + if (imguiCheck("Create Convex Volumes", type == TOOL_CONVEX_VOLUME)) + { + setTool(new ConvexVolumeTool); + } + if (imguiCheck("Create Crowds", type == TOOL_CROWD)) + { + setTool(new CrowdTool); + } + + imguiSeparatorLine(); + + imguiIndent(); + + if (m_tool) + m_tool->handleMenu(); + + imguiUnindent(); +} + +void Sample_TileMesh::handleDebugMode() +{ + // Check which modes are valid. + bool valid[MAX_DRAWMODE]; + for (int i = 0; i < MAX_DRAWMODE; ++i) + valid[i] = false; + + if (m_geom) + { + valid[DRAWMODE_NAVMESH] = m_navMesh != 0; + valid[DRAWMODE_NAVMESH_TRANS] = m_navMesh != 0; + valid[DRAWMODE_NAVMESH_BVTREE] = m_navMesh != 0; + valid[DRAWMODE_NAVMESH_NODES] = m_navQuery != 0; + valid[DRAWMODE_NAVMESH_PORTALS] = m_navMesh != 0; + valid[DRAWMODE_NAVMESH_INVIS] = m_navMesh != 0; + valid[DRAWMODE_MESH] = true; + valid[DRAWMODE_VOXELS] = m_solid != 0; + valid[DRAWMODE_VOXELS_WALKABLE] = m_solid != 0; + valid[DRAWMODE_COMPACT] = m_chf != 0; + valid[DRAWMODE_COMPACT_DISTANCE] = m_chf != 0; + valid[DRAWMODE_COMPACT_REGIONS] = m_chf != 0; + valid[DRAWMODE_REGION_CONNECTIONS] = m_cset != 0; + valid[DRAWMODE_RAW_CONTOURS] = m_cset != 0; + valid[DRAWMODE_BOTH_CONTOURS] = m_cset != 0; + valid[DRAWMODE_CONTOURS] = m_cset != 0; + valid[DRAWMODE_POLYMESH] = m_pmesh != 0; + valid[DRAWMODE_POLYMESH_DETAIL] = m_dmesh != 0; + } + + int unavail = 0; + for (int i = 0; i < MAX_DRAWMODE; ++i) + if (!valid[i]) unavail++; + + if (unavail == MAX_DRAWMODE) + return; + + imguiLabel("Draw"); + if (imguiCheck("Input Mesh", m_drawMode == DRAWMODE_MESH, valid[DRAWMODE_MESH])) + m_drawMode = DRAWMODE_MESH; + if (imguiCheck("Navmesh", m_drawMode == DRAWMODE_NAVMESH, valid[DRAWMODE_NAVMESH])) + m_drawMode = DRAWMODE_NAVMESH; + if (imguiCheck("Navmesh Invis", m_drawMode == DRAWMODE_NAVMESH_INVIS, valid[DRAWMODE_NAVMESH_INVIS])) + m_drawMode = DRAWMODE_NAVMESH_INVIS; + if (imguiCheck("Navmesh Trans", m_drawMode == DRAWMODE_NAVMESH_TRANS, valid[DRAWMODE_NAVMESH_TRANS])) + m_drawMode = DRAWMODE_NAVMESH_TRANS; + if (imguiCheck("Navmesh BVTree", m_drawMode == DRAWMODE_NAVMESH_BVTREE, valid[DRAWMODE_NAVMESH_BVTREE])) + m_drawMode = DRAWMODE_NAVMESH_BVTREE; + if (imguiCheck("Navmesh Nodes", m_drawMode == DRAWMODE_NAVMESH_NODES, valid[DRAWMODE_NAVMESH_NODES])) + m_drawMode = DRAWMODE_NAVMESH_NODES; + if (imguiCheck("Navmesh Portals", m_drawMode == DRAWMODE_NAVMESH_PORTALS, valid[DRAWMODE_NAVMESH_PORTALS])) + m_drawMode = DRAWMODE_NAVMESH_PORTALS; + if (imguiCheck("Voxels", m_drawMode == DRAWMODE_VOXELS, valid[DRAWMODE_VOXELS])) + m_drawMode = DRAWMODE_VOXELS; + if (imguiCheck("Walkable Voxels", m_drawMode == DRAWMODE_VOXELS_WALKABLE, valid[DRAWMODE_VOXELS_WALKABLE])) + m_drawMode = DRAWMODE_VOXELS_WALKABLE; + if (imguiCheck("Compact", m_drawMode == DRAWMODE_COMPACT, valid[DRAWMODE_COMPACT])) + m_drawMode = DRAWMODE_COMPACT; + if (imguiCheck("Compact Distance", m_drawMode == DRAWMODE_COMPACT_DISTANCE, valid[DRAWMODE_COMPACT_DISTANCE])) + m_drawMode = DRAWMODE_COMPACT_DISTANCE; + if (imguiCheck("Compact Regions", m_drawMode == DRAWMODE_COMPACT_REGIONS, valid[DRAWMODE_COMPACT_REGIONS])) + m_drawMode = DRAWMODE_COMPACT_REGIONS; + if (imguiCheck("Region Connections", m_drawMode == DRAWMODE_REGION_CONNECTIONS, valid[DRAWMODE_REGION_CONNECTIONS])) + m_drawMode = DRAWMODE_REGION_CONNECTIONS; + if (imguiCheck("Raw Contours", m_drawMode == DRAWMODE_RAW_CONTOURS, valid[DRAWMODE_RAW_CONTOURS])) + m_drawMode = DRAWMODE_RAW_CONTOURS; + if (imguiCheck("Both Contours", m_drawMode == DRAWMODE_BOTH_CONTOURS, valid[DRAWMODE_BOTH_CONTOURS])) + m_drawMode = DRAWMODE_BOTH_CONTOURS; + if (imguiCheck("Contours", m_drawMode == DRAWMODE_CONTOURS, valid[DRAWMODE_CONTOURS])) + m_drawMode = DRAWMODE_CONTOURS; + if (imguiCheck("Poly Mesh", m_drawMode == DRAWMODE_POLYMESH, valid[DRAWMODE_POLYMESH])) + m_drawMode = DRAWMODE_POLYMESH; + if (imguiCheck("Poly Mesh Detail", m_drawMode == DRAWMODE_POLYMESH_DETAIL, valid[DRAWMODE_POLYMESH_DETAIL])) + m_drawMode = DRAWMODE_POLYMESH_DETAIL; + + if (unavail) + { + imguiValue("Tick 'Keep Itermediate Results'"); + imguiValue("rebuild some tiles to see"); + imguiValue("more debug mode options."); + } +} + +void Sample_TileMesh::handleRender() +{ + if (!m_geom || !m_geom->getMesh()) + return; + + DebugDrawGL dd; + + // Draw mesh + if (m_drawMode == DRAWMODE_MESH) + { + // Draw mesh + duDebugDrawTriMeshSlope(&dd, m_geom->getMesh()->getVerts(), m_geom->getMesh()->getVertCount(), + m_geom->getMesh()->getTris(), m_geom->getMesh()->getNormals(), m_geom->getMesh()->getTriCount(), + m_agentMaxSlope); + m_geom->drawOffMeshConnections(&dd); + } + else if (m_drawMode != DRAWMODE_NAVMESH_TRANS) + { + // Draw mesh + duDebugDrawTriMesh(&dd, m_geom->getMesh()->getVerts(), m_geom->getMesh()->getVertCount(), + m_geom->getMesh()->getTris(), m_geom->getMesh()->getNormals(), m_geom->getMesh()->getTriCount(), 0); + m_geom->drawOffMeshConnections(&dd); + } + +/* duDebugDrawTriMesh(&dd, m_geom->getMesh()->getVerts(), m_geom->getMesh()->getVertCount(), + m_geom->getMesh()->getTris(), m_geom->getMesh()->getNormals(), m_geom->getMesh()->getTriCount(), 0); + m_geom->drawOffMeshConnections(&dd);*/ + + glDepthMask(GL_FALSE); + + // Draw bounds + const float* bmin = m_geom->getMeshBoundsMin(); + const float* bmax = m_geom->getMeshBoundsMax(); + duDebugDrawBoxWire(&dd, bmin[0],bmin[1],bmin[2], bmax[0],bmax[1],bmax[2], duRGBA(255,255,255,128), 1.0f); + + // Tiling grid. + int gw = 0, gh = 0; + rcCalcGridSize(bmin, bmax, m_cellSize, &gw, &gh); + const int tw = (gw + (int)m_tileSize-1) / (int)m_tileSize; + const int th = (gh + (int)m_tileSize-1) / (int)m_tileSize; + const float s = m_tileSize*m_cellSize; + duDebugDrawGridXZ(&dd, bmin[0],bmin[1],bmin[2], tw,th, s, duRGBA(0,0,0,64), 1.0f); + + // Draw active tile + duDebugDrawBoxWire(&dd, m_tileBmin[0],m_tileBmin[1],m_tileBmin[2], m_tileBmax[0],m_tileBmax[1],m_tileBmax[2], m_tileCol, 2.0f); + +/* if (m_navMesh) + { + duDebugDrawNavMeshWithClosedList(&dd, *m_navMesh, *m_navQuery, m_navMeshDrawFlags); + if (m_drawPortals) + duDebugDrawNavMeshPortals(&dd, *m_navMesh); + }*/ + + if (m_navMesh && m_navQuery && + (m_drawMode == DRAWMODE_NAVMESH || + m_drawMode == DRAWMODE_NAVMESH_TRANS || + m_drawMode == DRAWMODE_NAVMESH_BVTREE || + m_drawMode == DRAWMODE_NAVMESH_NODES || + m_drawMode == DRAWMODE_NAVMESH_PORTALS || + m_drawMode == DRAWMODE_NAVMESH_INVIS)) + { + if (m_drawMode != DRAWMODE_NAVMESH_INVIS) + duDebugDrawNavMeshWithClosedList(&dd, *m_navMesh, *m_navQuery, m_navMeshDrawFlags); + if (m_drawMode == DRAWMODE_NAVMESH_BVTREE) + duDebugDrawNavMeshBVTree(&dd, *m_navMesh); + if (m_drawMode == DRAWMODE_NAVMESH_PORTALS) + duDebugDrawNavMeshPortals(&dd, *m_navMesh); + if (m_drawMode == DRAWMODE_NAVMESH_NODES) + duDebugDrawNavMeshNodes(&dd, *m_navQuery); + } + + + glDepthMask(GL_TRUE); + + if (m_chf && m_drawMode == DRAWMODE_COMPACT) + duDebugDrawCompactHeightfieldSolid(&dd, *m_chf); + + if (m_chf && m_drawMode == DRAWMODE_COMPACT_DISTANCE) + duDebugDrawCompactHeightfieldDistance(&dd, *m_chf); + if (m_chf && m_drawMode == DRAWMODE_COMPACT_REGIONS) + duDebugDrawCompactHeightfieldRegions(&dd, *m_chf); + if (m_solid && m_drawMode == DRAWMODE_VOXELS) + { + glEnable(GL_FOG); + duDebugDrawHeightfieldSolid(&dd, *m_solid); + glDisable(GL_FOG); + } + if (m_solid && m_drawMode == DRAWMODE_VOXELS_WALKABLE) + { + glEnable(GL_FOG); + duDebugDrawHeightfieldWalkable(&dd, *m_solid); + glDisable(GL_FOG); + } + if (m_cset && m_drawMode == DRAWMODE_RAW_CONTOURS) + { + glDepthMask(GL_FALSE); + duDebugDrawRawContours(&dd, *m_cset); + glDepthMask(GL_TRUE); + } + if (m_cset && m_drawMode == DRAWMODE_BOTH_CONTOURS) + { + glDepthMask(GL_FALSE); + duDebugDrawRawContours(&dd, *m_cset, 0.5f); + duDebugDrawContours(&dd, *m_cset); + glDepthMask(GL_TRUE); + } + if (m_cset && m_drawMode == DRAWMODE_CONTOURS) + { + glDepthMask(GL_FALSE); + duDebugDrawContours(&dd, *m_cset); + glDepthMask(GL_TRUE); + } + if (m_chf && m_cset && m_drawMode == DRAWMODE_REGION_CONNECTIONS) + { + duDebugDrawCompactHeightfieldRegions(&dd, *m_chf); + + glDepthMask(GL_FALSE); + duDebugDrawRegionConnections(&dd, *m_cset); + glDepthMask(GL_TRUE); + } + if (m_pmesh && m_drawMode == DRAWMODE_POLYMESH) + { + glDepthMask(GL_FALSE); + duDebugDrawPolyMesh(&dd, *m_pmesh); + glDepthMask(GL_TRUE); + } + if (m_dmesh && m_drawMode == DRAWMODE_POLYMESH_DETAIL) + { + glDepthMask(GL_FALSE); + duDebugDrawPolyMeshDetail(&dd, *m_dmesh); + glDepthMask(GL_TRUE); + } + + m_geom->drawConvexVolumes(&dd); + + if (m_tool) + m_tool->handleRender(); + + glDepthMask(GL_TRUE); +} + +void Sample_TileMesh::handleRenderOverlay(double* proj, double* model, int* view) +{ + GLdouble x, y, z; + + // Draw start and end point labels + if (m_tileBuildTime > 0.0f && gluProject((GLdouble)(m_tileBmin[0]+m_tileBmax[0])/2, (GLdouble)(m_tileBmin[1]+m_tileBmax[1])/2, (GLdouble)(m_tileBmin[2]+m_tileBmax[2])/2, + model, proj, view, &x, &y, &z)) + { + char text[32]; + snprintf(text,32,"%.3fms / %dTris / %.1fkB", m_tileBuildTime, m_tileTriCount, m_tileMemUsage); + imguiDrawText((int)x, (int)y-25, IMGUI_ALIGN_CENTER, text, imguiRGBA(0,0,0,220)); + } + + if (m_tool) + m_tool->handleRenderOverlay(proj, model, view); +} + +void Sample_TileMesh::handleMeshChanged(class InputGeom* geom) +{ + Sample::handleMeshChanged(geom); + + cleanup(); + + dtFreeNavMesh(m_navMesh); + m_navMesh = 0; + + if (m_tool) + { + m_tool->reset(); + m_tool->init(this); + } +} + +bool Sample_TileMesh::handleBuild() +{ + if (!m_geom || !m_geom->getMesh()) + { + m_ctx->log(RC_LOG_ERROR, "buildTiledNavigation: No vertices and triangles."); + return false; + } + + dtFreeNavMesh(m_navMesh); + + m_navMesh = dtAllocNavMesh(); + if (!m_navMesh) + { + m_ctx->log(RC_LOG_ERROR, "buildTiledNavigation: Could not allocate navmesh."); + return false; + } + + dtNavMeshParams params; + rcVcopy(params.orig, m_geom->getMeshBoundsMin()); + params.tileWidth = m_tileSize*m_cellSize; + params.tileHeight = m_tileSize*m_cellSize; + params.maxTiles = m_maxTiles; + params.maxPolys = m_maxPolysPerTile; + if (m_navMesh->init(¶ms) != DT_SUCCESS) + { + m_ctx->log(RC_LOG_ERROR, "buildTiledNavigation: Could not init navmesh."); + return false; + } + + if (m_navQuery->init(m_navMesh, 2048) != DT_SUCCESS) + { + m_ctx->log(RC_LOG_ERROR, "buildTiledNavigation: Could not init Detour navmesh query"); + return false; + } + + if (m_buildAll) + buildAllTiles(); + + if (m_tool) + m_tool->init(this); + + return true; +} + +void Sample_TileMesh::buildTile(const float* pos) +{ + if (!m_geom) return; + if (!m_navMesh) return; + + const float* bmin = m_geom->getMeshBoundsMin(); + const float* bmax = m_geom->getMeshBoundsMax(); + + const float ts = m_tileSize*m_cellSize; + const int tx = (int)((pos[0] - bmin[0]) / ts); + const int ty = (int)((pos[2] - bmin[2]) / ts); + + m_tileBmin[0] = bmin[0] + tx*ts; + m_tileBmin[1] = bmin[1]; + m_tileBmin[2] = bmin[2] + ty*ts; + + m_tileBmax[0] = bmin[0] + (tx+1)*ts; + m_tileBmax[1] = bmax[1]; + m_tileBmax[2] = bmin[2] + (ty+1)*ts; + + m_tileCol = duRGBA(77,204,0,255); + + m_ctx->resetLog(); + + int dataSize = 0; + unsigned char* data = buildTileMesh(tx, ty, m_tileBmin, m_tileBmax, dataSize); + + if (data) + { + // Remove any previous data (navmesh owns and deletes the data). + m_navMesh->removeTile(m_navMesh->getTileRefAt(tx,ty),0,0); + + // Let the navmesh own the data. + if (m_navMesh->addTile(data,dataSize,DT_TILE_FREE_DATA,0,0) != DT_SUCCESS) + dtFree(data); + } + + m_ctx->dumpLog("Build Tile (%d,%d):", tx,ty); +} + +void Sample_TileMesh::getTilePos(const float* pos, int& tx, int& ty) +{ + if (!m_geom) return; + + const float* bmin = m_geom->getMeshBoundsMin(); + + const float ts = m_tileSize*m_cellSize; + tx = (int)((pos[0] - bmin[0]) / ts); + ty = (int)((pos[2] - bmin[2]) / ts); +} + +void Sample_TileMesh::removeTile(const float* pos) +{ + if (!m_geom) return; + if (!m_navMesh) return; + + const float* bmin = m_geom->getMeshBoundsMin(); + const float* bmax = m_geom->getMeshBoundsMax(); + + const float ts = m_tileSize*m_cellSize; + const int tx = (int)((pos[0] - bmin[0]) / ts); + const int ty = (int)((pos[2] - bmin[2]) / ts); + + m_tileBmin[0] = bmin[0] + tx*ts; + m_tileBmin[1] = bmin[1]; + m_tileBmin[2] = bmin[2] + ty*ts; + + m_tileBmax[0] = bmin[0] + (tx+1)*ts; + m_tileBmax[1] = bmax[1]; + m_tileBmax[2] = bmin[2] + (ty+1)*ts; + + m_tileCol = duRGBA(204,25,0,255); + + m_navMesh->removeTile(m_navMesh->getTileRefAt(tx,ty),0,0); +} + +void Sample_TileMesh::buildAllTiles() +{ + if (!m_geom) return; + if (!m_navMesh) return; + + const float* bmin = m_geom->getMeshBoundsMin(); + const float* bmax = m_geom->getMeshBoundsMax(); + int gw = 0, gh = 0; + rcCalcGridSize(bmin, bmax, m_cellSize, &gw, &gh); + const int ts = (int)m_tileSize; + const int tw = (gw + ts-1) / ts; + const int th = (gh + ts-1) / ts; + const float tcs = m_tileSize*m_cellSize; + + + // Start the build process. + m_ctx->startTimer(RC_TIMER_TEMP); + + for (int y = 0; y < th; ++y) + { + for (int x = 0; x < tw; ++x) + { + m_tileBmin[0] = bmin[0] + x*tcs; + m_tileBmin[1] = bmin[1]; + m_tileBmin[2] = bmin[2] + y*tcs; + + m_tileBmax[0] = bmin[0] + (x+1)*tcs; + m_tileBmax[1] = bmax[1]; + m_tileBmax[2] = bmin[2] + (y+1)*tcs; + + int dataSize = 0; + unsigned char* data = buildTileMesh(x, y, m_tileBmin, m_tileBmax, dataSize); + if (data) + { + // Remove any previous data (navmesh owns and deletes the data). + m_navMesh->removeTile(m_navMesh->getTileRefAt(x,y),0,0); + // Let the navmesh own the data. + if (m_navMesh->addTile(data,dataSize,DT_TILE_FREE_DATA,0,0) != DT_SUCCESS) + dtFree(data); + } + } + } + + // Start the build process. + m_ctx->startTimer(RC_TIMER_TEMP); + + m_totalBuildTimeMs = m_ctx->getAccumulatedTime(RC_TIMER_TEMP)/1000.0f; +} + +void Sample_TileMesh::removeAllTiles() +{ + const float* bmin = m_geom->getMeshBoundsMin(); + const float* bmax = m_geom->getMeshBoundsMax(); + int gw = 0, gh = 0; + rcCalcGridSize(bmin, bmax, m_cellSize, &gw, &gh); + const int ts = (int)m_tileSize; + const int tw = (gw + ts-1) / ts; + const int th = (gh + ts-1) / ts; + + for (int y = 0; y < th; ++y) + for (int x = 0; x < tw; ++x) + m_navMesh->removeTile(m_navMesh->getTileRefAt(x,y),0,0); +} + +unsigned char* Sample_TileMesh::buildTileMesh(const int tx, const int ty, const float* bmin, const float* bmax, int& dataSize) +{ + if (!m_geom || !m_geom->getMesh() || !m_geom->getChunkyMesh()) + { + m_ctx->log(RC_LOG_ERROR, "buildNavigation: Input mesh is not specified."); + return 0; + } + + m_tileMemUsage = 0; + m_tileBuildTime = 0; + + cleanup(); + + const float* verts = m_geom->getMesh()->getVerts(); + const int nverts = m_geom->getMesh()->getVertCount(); + const int ntris = m_geom->getMesh()->getTriCount(); + const rcChunkyTriMesh* chunkyMesh = m_geom->getChunkyMesh(); + + // Init build configuration from GUI + memset(&m_cfg, 0, sizeof(m_cfg)); + m_cfg.cs = m_cellSize; + m_cfg.ch = m_cellHeight; + m_cfg.walkableSlopeAngle = m_agentMaxSlope; + m_cfg.walkableHeight = (int)ceilf(m_agentHeight / m_cfg.ch); + m_cfg.walkableClimb = (int)floorf(m_agentMaxClimb / m_cfg.ch); + m_cfg.walkableRadius = (int)ceilf(m_agentRadius / m_cfg.cs); + m_cfg.maxEdgeLen = (int)(m_edgeMaxLen / m_cellSize); + m_cfg.maxSimplificationError = m_edgeMaxError; + m_cfg.minRegionArea = (int)rcSqr(m_regionMinSize); // Note: area = size*size + m_cfg.mergeRegionArea = (int)rcSqr(m_regionMergeSize); // Note: area = size*size + m_cfg.maxVertsPerPoly = (int)m_vertsPerPoly; + m_cfg.tileSize = (int)m_tileSize; + m_cfg.borderSize = m_cfg.walkableRadius + 3; // Reserve enough padding. + m_cfg.width = m_cfg.tileSize + m_cfg.borderSize*2; + m_cfg.height = m_cfg.tileSize + m_cfg.borderSize*2; + m_cfg.detailSampleDist = m_detailSampleDist < 0.9f ? 0 : m_cellSize * m_detailSampleDist; + m_cfg.detailSampleMaxError = m_cellHeight * m_detailSampleMaxError; + + rcVcopy(m_cfg.bmin, bmin); + rcVcopy(m_cfg.bmax, bmax); + m_cfg.bmin[0] -= m_cfg.borderSize*m_cfg.cs; + m_cfg.bmin[2] -= m_cfg.borderSize*m_cfg.cs; + m_cfg.bmax[0] += m_cfg.borderSize*m_cfg.cs; + m_cfg.bmax[2] += m_cfg.borderSize*m_cfg.cs; + + // Reset build times gathering. + m_ctx->resetTimers(); + + // Start the build process. + m_ctx->startTimer(RC_TIMER_TOTAL); + + m_ctx->log(RC_LOG_PROGRESS, "Building navigation:"); + m_ctx->log(RC_LOG_PROGRESS, " - %d x %d cells", m_cfg.width, m_cfg.height); + m_ctx->log(RC_LOG_PROGRESS, " - %.1fK verts, %.1fK tris", nverts/1000.0f, ntris/1000.0f); + + // Allocate voxel heightfield where we rasterize our input data to. + m_solid = rcAllocHeightfield(); + if (!m_solid) + { + m_ctx->log(RC_LOG_ERROR, "buildNavigation: Out of memory 'solid'."); + return 0; + } + if (!rcCreateHeightfield(m_ctx, *m_solid, m_cfg.width, m_cfg.height, m_cfg.bmin, m_cfg.bmax, m_cfg.cs, m_cfg.ch)) + { + m_ctx->log(RC_LOG_ERROR, "buildNavigation: Could not create solid heightfield."); + return 0; + } + + // Allocate array that can hold triangle flags. + // If you have multiple meshes you need to process, allocate + // and array which can hold the max number of triangles you need to process. + m_triareas = new unsigned char[chunkyMesh->maxTrisPerChunk]; + if (!m_triareas) + { + m_ctx->log(RC_LOG_ERROR, "buildNavigation: Out of memory 'm_triareas' (%d).", chunkyMesh->maxTrisPerChunk); + return 0; + } + + float tbmin[2], tbmax[2]; + tbmin[0] = m_cfg.bmin[0]; + tbmin[1] = m_cfg.bmin[2]; + tbmax[0] = m_cfg.bmax[0]; + tbmax[1] = m_cfg.bmax[2]; + int cid[512];// TODO: Make grow when returning too many items. + const int ncid = rcGetChunksOverlappingRect(chunkyMesh, tbmin, tbmax, cid, 512); + if (!ncid) + return 0; + + m_tileTriCount = 0; + + for (int i = 0; i < ncid; ++i) + { + const rcChunkyTriMeshNode& node = chunkyMesh->nodes[cid[i]]; + const int* tris = &chunkyMesh->tris[node.i*3]; + const int ntris = node.n; + + m_tileTriCount += ntris; + + memset(m_triareas, 0, ntris*sizeof(unsigned char)); + rcMarkWalkableTriangles(m_ctx, m_cfg.walkableSlopeAngle, + verts, nverts, tris, ntris, m_triareas); + + rcRasterizeTriangles(m_ctx, verts, nverts, tris, m_triareas, ntris, *m_solid, m_cfg.walkableClimb); + } + + if (!m_keepInterResults) + { + delete [] m_triareas; + m_triareas = 0; + } + + // Once all geometry is rasterized, we do initial pass of filtering to + // remove unwanted overhangs caused by the conservative rasterization + // as well as filter spans where the character cannot possibly stand. + rcFilterLowHangingWalkableObstacles(m_ctx, m_cfg.walkableClimb, *m_solid); + rcFilterLedgeSpans(m_ctx, m_cfg.walkableHeight, m_cfg.walkableClimb, *m_solid); + rcFilterWalkableLowHeightSpans(m_ctx, m_cfg.walkableHeight, *m_solid); + + // Compact the heightfield so that it is faster to handle from now on. + // This will result more cache coherent data as well as the neighbours + // between walkable cells will be calculated. + m_chf = rcAllocCompactHeightfield(); + if (!m_chf) + { + m_ctx->log(RC_LOG_ERROR, "buildNavigation: Out of memory 'chf'."); + return 0; + } + if (!rcBuildCompactHeightfield(m_ctx, m_cfg.walkableHeight, m_cfg.walkableClimb, *m_solid, *m_chf)) + { + m_ctx->log(RC_LOG_ERROR, "buildNavigation: Could not build compact data."); + return 0; + } + + if (!m_keepInterResults) + { + rcFreeHeightField(m_solid); + m_solid = 0; + } + + // Erode the walkable area by agent radius. + if (!rcErodeWalkableArea(m_ctx, m_cfg.walkableRadius, *m_chf)) + { + m_ctx->log(RC_LOG_ERROR, "buildNavigation: Could not erode."); + return false; + } + + // (Optional) Mark areas. + const ConvexVolume* vols = m_geom->getConvexVolumes(); + for (int i = 0; i < m_geom->getConvexVolumeCount(); ++i) + rcMarkConvexPolyArea(m_ctx, vols[i].verts, vols[i].nverts, vols[i].hmin, vols[i].hmax, (unsigned char)vols[i].area, *m_chf); + + // Prepare for region partitioning, by calculating distance field along the walkable surface. + if (!rcBuildDistanceField(m_ctx, *m_chf)) + { + m_ctx->log(RC_LOG_ERROR, "buildNavigation: Could not build distance field."); + return 0; + } + + // Partition the walkable surface into simple regions without holes. + if (!rcBuildRegions(m_ctx, *m_chf, m_cfg.borderSize, m_cfg.minRegionArea, m_cfg.mergeRegionArea)) + { + m_ctx->log(RC_LOG_ERROR, "buildNavigation: Could not build regions."); + return 0; + } + + // Create contours. + m_cset = rcAllocContourSet(); + if (!m_cset) + { + m_ctx->log(RC_LOG_ERROR, "buildNavigation: Out of memory 'cset'."); + return 0; + } + if (!rcBuildContours(m_ctx, *m_chf, m_cfg.maxSimplificationError, m_cfg.maxEdgeLen, *m_cset)) + { + m_ctx->log(RC_LOG_ERROR, "buildNavigation: Could not create contours."); + return 0; + } + + if (m_cset->nconts == 0) + { + return 0; + } + + // Build polygon navmesh from the contours. + m_pmesh = rcAllocPolyMesh(); + if (!m_pmesh) + { + m_ctx->log(RC_LOG_ERROR, "buildNavigation: Out of memory 'pmesh'."); + return 0; + } + if (!rcBuildPolyMesh(m_ctx, *m_cset, m_cfg.maxVertsPerPoly, *m_pmesh)) + { + m_ctx->log(RC_LOG_ERROR, "buildNavigation: Could not triangulate contours."); + return 0; + } + + // Build detail mesh. + m_dmesh = rcAllocPolyMeshDetail(); + if (!m_dmesh) + { + m_ctx->log(RC_LOG_ERROR, "buildNavigation: Out of memory 'dmesh'."); + return 0; + } + + if (!rcBuildPolyMeshDetail(m_ctx, *m_pmesh, *m_chf, + m_cfg.detailSampleDist, m_cfg.detailSampleMaxError, + *m_dmesh)) + { + m_ctx->log(RC_LOG_ERROR, "buildNavigation: Could build polymesh detail."); + return 0; + } + + if (!m_keepInterResults) + { + rcFreeCompactHeightfield(m_chf); + m_chf = 0; + rcFreeContourSet(m_cset); + m_cset = 0; + } + + unsigned char* navData = 0; + int navDataSize = 0; + if (m_cfg.maxVertsPerPoly <= DT_VERTS_PER_POLYGON) + { + // Remove padding from the polymesh data. TODO: Remove this odditity. + for (int i = 0; i < m_pmesh->nverts; ++i) + { + unsigned short* v = &m_pmesh->verts[i*3]; + v[0] -= (unsigned short)m_cfg.borderSize; + v[2] -= (unsigned short)m_cfg.borderSize; + } + + if (m_pmesh->nverts >= 0xffff) + { + // The vertex indices are ushorts, and cannot point to more than 0xffff vertices. + m_ctx->log(RC_LOG_ERROR, "Too many vertices per tile %d (max: %d).", m_pmesh->nverts, 0xffff); + return false; + } + + // Update poly flags from areas. + for (int i = 0; i < m_pmesh->npolys; ++i) + { + if (m_pmesh->areas[i] == RC_WALKABLE_AREA) + m_pmesh->areas[i] = SAMPLE_POLYAREA_GROUND; + + if (m_pmesh->areas[i] == SAMPLE_POLYAREA_GROUND || + m_pmesh->areas[i] == SAMPLE_POLYAREA_GRASS || + m_pmesh->areas[i] == SAMPLE_POLYAREA_ROAD) + { + m_pmesh->flags[i] = SAMPLE_POLYFLAGS_WALK; + } + else if (m_pmesh->areas[i] == SAMPLE_POLYAREA_WATER) + { + m_pmesh->flags[i] = SAMPLE_POLYFLAGS_SWIM; + } + else if (m_pmesh->areas[i] == SAMPLE_POLYAREA_DOOR) + { + m_pmesh->flags[i] = SAMPLE_POLYFLAGS_WALK | SAMPLE_POLYFLAGS_DOOR; + } + } + + dtNavMeshCreateParams params; + memset(¶ms, 0, sizeof(params)); + params.verts = m_pmesh->verts; + params.vertCount = m_pmesh->nverts; + params.polys = m_pmesh->polys; + params.polyAreas = m_pmesh->areas; + params.polyFlags = m_pmesh->flags; + params.polyCount = m_pmesh->npolys; + params.nvp = m_pmesh->nvp; + params.detailMeshes = m_dmesh->meshes; + params.detailVerts = m_dmesh->verts; + params.detailVertsCount = m_dmesh->nverts; + params.detailTris = m_dmesh->tris; + params.detailTriCount = m_dmesh->ntris; + params.offMeshConVerts = m_geom->getOffMeshConnectionVerts(); + params.offMeshConRad = m_geom->getOffMeshConnectionRads(); + params.offMeshConDir = m_geom->getOffMeshConnectionDirs(); + params.offMeshConAreas = m_geom->getOffMeshConnectionAreas(); + params.offMeshConFlags = m_geom->getOffMeshConnectionFlags(); + params.offMeshConUserID = m_geom->getOffMeshConnectionId(); + params.offMeshConCount = m_geom->getOffMeshConnectionCount(); + params.walkableHeight = m_agentHeight; + params.walkableRadius = m_agentRadius; + params.walkableClimb = m_agentMaxClimb; + params.tileX = tx; + params.tileY = ty; + rcVcopy(params.bmin, bmin); + rcVcopy(params.bmax, bmax); + params.cs = m_cfg.cs; + params.ch = m_cfg.ch; + params.tileSize = m_cfg.tileSize; + + if (!dtCreateNavMeshData(¶ms, &navData, &navDataSize)) + { + m_ctx->log(RC_LOG_ERROR, "Could not build Detour navmesh."); + return 0; + } + + // Restore padding so that the debug visualization is correct. + for (int i = 0; i < m_pmesh->nverts; ++i) + { + unsigned short* v = &m_pmesh->verts[i*3]; + v[0] += (unsigned short)m_cfg.borderSize; + v[2] += (unsigned short)m_cfg.borderSize; + } + + } + m_tileMemUsage = navDataSize/1024.0f; + + m_ctx->stopTimer(RC_TIMER_TOTAL); + + // Show performance stats. + duLogBuildTimes(*m_ctx, m_ctx->getAccumulatedTime(RC_TIMER_TOTAL)); + m_ctx->log(RC_LOG_PROGRESS, ">> Polymesh: %d vertices %d polygons", m_pmesh->nverts, m_pmesh->npolys); + + m_tileBuildTime = m_ctx->getAccumulatedTime(RC_TIMER_TOTAL)/1000.0f; + + dataSize = navDataSize; + return navData; +} diff --git a/dep/recastnavigation/RecastDemo/Source/SlideShow.cpp b/dep/recastnavigation/RecastDemo/Source/SlideShow.cpp new file mode 100644 index 000000000..65b2dcfe9 --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Source/SlideShow.cpp @@ -0,0 +1,159 @@ +// +// Copyright (c) 2009-2010 Mikko Mononen memon@inside.org +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. +// + +#include "SlideShow.h" +#include +#include +#include +//#define STBI_HEADER_FILE_ONLY +#include "stb_image.h" + +SlideShow::SlideShow() : + m_width(0), + m_height(0), + m_texId(0), + m_showCurSlide(true), + m_slideAlpha(1.0f), + m_curSlide(-1), + m_nextSlide(0) +{ +} + +SlideShow::~SlideShow() +{ + purgeImage(); +} + +void SlideShow::purgeImage() +{ + if (m_texId) + { + glDeleteTextures(1, (GLuint*)&m_texId); + m_texId = 0; + m_width = 0; + m_height = 0; + } +} + +bool SlideShow::loadImage(const char* path) +{ + purgeImage(); + + int bpp; + unsigned char* data = stbi_load(path, &m_width, &m_height, &bpp, 4); + if (!data) + { + printf("Could not load file '%s': %s\n", path, stbi_failure_reason()); + return false; + } + + glGenTextures(1, (GLuint*)&m_texId); + glBindTexture(GL_TEXTURE_RECTANGLE_ARB, m_texId); + glTexImage2D(GL_TEXTURE_RECTANGLE_ARB, 0, GL_RGBA, m_width, m_height, 0, + GL_RGBA, GL_UNSIGNED_BYTE, data); + + glTexParameteri(GL_TEXTURE_RECTANGLE_ARB, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); + glTexParameteri(GL_TEXTURE_RECTANGLE_ARB, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); + + glTexParameteri(GL_TEXTURE_RECTANGLE_ARB, GL_TEXTURE_MAG_FILTER, GL_LINEAR); + glTexParameteri(GL_TEXTURE_RECTANGLE_ARB, GL_TEXTURE_MIN_FILTER, GL_LINEAR); + + stbi_image_free(data); + + return true; +} + +bool SlideShow::init(const char* path) +{ + strcpy(m_path, path); + scanDirectory(m_path, ".png", m_files); + + return true; +} + +void SlideShow::nextSlide() +{ + setSlide(m_nextSlide+1); +} + +void SlideShow::prevSlide() +{ + setSlide(m_nextSlide-1); +} + +void SlideShow::setSlide(int n) +{ + const int maxIdx = m_files.size ? m_files.size-1 : 0; + m_nextSlide = n; + if (m_nextSlide < 0) m_nextSlide = 0; + if (m_nextSlide > maxIdx) m_nextSlide = maxIdx; +} + +void SlideShow::updateAndDraw(float dt, const float w, const float h) +{ + float slideAlphaTarget = (m_showCurSlide && m_texId) ? 1.0f : 0.0f; + if (m_curSlide != m_nextSlide) + slideAlphaTarget = 0; + + if (slideAlphaTarget > m_slideAlpha) + m_slideAlpha += dt*4; + else if (slideAlphaTarget < m_slideAlpha) + m_slideAlpha -= dt*4; + if (m_slideAlpha < 0) m_slideAlpha = 0; + if (m_slideAlpha > 1) m_slideAlpha = 1; + + if (m_curSlide != m_nextSlide && m_slideAlpha < 0.01f) + { + m_curSlide = m_nextSlide; + if (m_curSlide >= 0 && m_curSlide < m_files.size) + { + char path[256]; + strcpy(path, m_path); + strcat(path, m_files.files[m_curSlide]); + loadImage(path); + } + } + + if (m_slideAlpha > 0.01f && m_texId) + { + unsigned char alpha = (unsigned char)(m_slideAlpha*255.0f); + + glEnable(GL_TEXTURE_RECTANGLE_ARB); + glBindTexture(GL_TEXTURE_RECTANGLE_ARB, m_texId); + + const float tw = (float)m_width; + const float th = (float)m_height; + const float hw = w*0.5f; + const float hh = h*0.5f; + + glColor4ub(255,255,255,alpha); + glBegin(GL_QUADS); + glTexCoord2f(0,th); + glVertex2f(hw-tw/2,hh-th/2); + glTexCoord2f(tw,th); + glVertex2f(hw+tw/2,hh-th/2); + glTexCoord2f(tw,0); + glVertex2f(hw+tw/2,hh+th/2); + glTexCoord2f(0,0); + glVertex2f(hw-tw/2,hh+th/2); + glEnd(); + + glDisable(GL_TEXTURE_RECTANGLE_ARB); + } + +} diff --git a/dep/recastnavigation/RecastDemo/Source/TestCase.cpp b/dep/recastnavigation/RecastDemo/Source/TestCase.cpp new file mode 100644 index 000000000..95293f506 --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Source/TestCase.cpp @@ -0,0 +1,353 @@ +// +// Copyright (c) 2009-2010 Mikko Mononen memon@inside.org +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. +// + +#include +#include +#include +#include +#include "TestCase.h" +#include "DetourNavMesh.h" +#include "DetourNavMeshQuery.h" +#include "DetourCommon.h" +#include "SDL.h" +#include "SDL_opengl.h" +#include "imgui.h" +#include "PerfTimer.h" + +#ifdef WIN32 +#define snprintf _snprintf +#endif + +TestCase::TestCase() : + m_tests(0) +{ +} + +TestCase::~TestCase() +{ + Test* iter = m_tests; + while (iter) + { + Test* next = iter->next; + delete iter; + iter = next; + } +} + + +static char* parseRow(char* buf, char* bufEnd, char* row, int len) +{ + bool start = true; + bool done = false; + int n = 0; + while (!done && buf < bufEnd) + { + char c = *buf; + buf++; + // multirow + switch (c) + { + case '\n': + if (start) break; + done = true; + break; + case '\r': + break; + case '\t': + case ' ': + if (start) break; + default: + start = false; + row[n++] = c; + if (n >= len-1) + done = true; + break; + } + } + row[n] = '\0'; + return buf; +} + +static void copyName(char* dst, const char* src) +{ + // Skip white spaces + while (*src && isspace(*src)) + src++; + strcpy(dst, src); +} + +bool TestCase::load(const char* filePath) +{ + char* buf = 0; + FILE* fp = fopen(filePath, "rb"); + if (!fp) + return false; + fseek(fp, 0, SEEK_END); + int bufSize = ftell(fp); + fseek(fp, 0, SEEK_SET); + buf = new char[bufSize]; + if (!buf) + { + fclose(fp); + return false; + } + fread(buf, bufSize, 1, fp); + fclose(fp); + + char* src = buf; + char* srcEnd = buf + bufSize; + char row[512]; + while (src < srcEnd) + { + // Parse one row + row[0] = '\0'; + src = parseRow(src, srcEnd, row, sizeof(row)/sizeof(char)); + if (row[0] == 's') + { + // Sample name. + copyName(m_sampleName, row+1); + } + else if (row[0] == 'f') + { + // File name. + copyName(m_geomFileName, row+1); + } + else if (row[0] == 'p' && row[1] == 'f') + { + // Pathfind test. + Test* test = new Test; + memset(test, 0, sizeof(Test)); + test->type = TEST_PATHFIND; + test->expand = false; + test->next = m_tests; + m_tests = test; + sscanf(row+2, "%f %f %f %f %f %f %x %x", + &test->spos[0], &test->spos[1], &test->spos[2], + &test->epos[0], &test->epos[1], &test->epos[2], + &test->includeFlags, &test->excludeFlags); + } + } + + delete [] buf; + + return true; +} + +void TestCase::resetTimes() +{ + for (Test* iter = m_tests; iter; iter = iter->next) + { + iter->findNearestPolyTime = 0; + iter->findPathTime = 0; + iter->findStraightPathTime = 0; + } +} + +void TestCase::doTests(dtNavMesh* navmesh, dtNavMeshQuery* navquery) +{ + if (!navmesh || !navquery) + return; + + resetTimes(); + + static const int MAX_POLYS = 256; + dtPolyRef polys[MAX_POLYS]; + float straight[MAX_POLYS*3]; + const float polyPickExt[3] = {2,4,2}; + + for (Test* iter = m_tests; iter; iter = iter->next) + { + delete [] iter->polys; + iter->polys = 0; + iter->npolys = 0; + delete [] iter->straight; + iter->straight = 0; + iter->nstraight = 0; + + dtQueryFilter filter; + filter.setIncludeFlags((unsigned short)iter->includeFlags); + filter.setExcludeFlags((unsigned short)iter->excludeFlags); + + // Find start points + TimeVal findNearestPolyStart = getPerfTime(); + + dtPolyRef startRef, endRef; + navquery->findNearestPoly(iter->spos, polyPickExt, &filter, &startRef, 0); + navquery->findNearestPoly(iter->epos, polyPickExt, &filter, &endRef, 0); + + TimeVal findNearestPolyEnd = getPerfTime(); + iter->findNearestPolyTime += getPerfDeltaTimeUsec(findNearestPolyStart, findNearestPolyEnd); + + if (!startRef || ! endRef) + continue; + + // Find path + TimeVal findPathStart = getPerfTime(); + + navquery->findPath(startRef, endRef, iter->spos, iter->epos, &filter, polys, &iter->npolys, MAX_POLYS); + + TimeVal findPathEnd = getPerfTime(); + iter->findPathTime += getPerfDeltaTimeUsec(findPathStart, findPathEnd); + + // Find straight path + if (iter->npolys) + { + TimeVal findStraightPathStart = getPerfTime(); + + navquery->findStraightPath(iter->spos, iter->epos, polys, iter->npolys, + straight, 0, 0, &iter->nstraight, MAX_POLYS); + TimeVal findStraightPathEnd = getPerfTime(); + iter->findStraightPathTime += getPerfDeltaTimeUsec(findStraightPathStart, findStraightPathEnd); + } + + // Copy results + if (iter->npolys) + { + iter->polys = new dtPolyRef[iter->npolys]; + memcpy(iter->polys, polys, sizeof(dtPolyRef)*iter->npolys); + } + if (iter->nstraight) + { + iter->straight = new float[iter->nstraight*3]; + memcpy(iter->straight, straight, sizeof(float)*3*iter->nstraight); + } + } + + + printf("Test Results:\n"); + int n = 0; + for (Test* iter = m_tests; iter; iter = iter->next) + { + const int total = iter->findNearestPolyTime + iter->findPathTime + iter->findStraightPathTime; + printf(" - Path %02d: %.4f ms\n", n, (float)total/1000.0f); + printf(" - poly: %.4f ms\n", (float)iter->findNearestPolyTime/1000.0f); + printf(" - path: %.4f ms\n", (float)iter->findPathTime/1000.0f); + printf(" - straight: %.4f ms\n", (float)iter->findStraightPathTime/1000.0f); + n++; + } +} + +void TestCase::handleRender() +{ + glLineWidth(2.0f); + glBegin(GL_LINES); + for (Test* iter = m_tests; iter; iter = iter->next) + { + float dir[3]; + dtVsub(dir, iter->epos, iter->spos); + dtVnormalize(dir); + glColor4ub(128,25,0,192); + glVertex3f(iter->spos[0],iter->spos[1]-0.3f,iter->spos[2]); + glVertex3f(iter->spos[0],iter->spos[1]+0.3f,iter->spos[2]); + glVertex3f(iter->spos[0],iter->spos[1]+0.3f,iter->spos[2]); + glVertex3f(iter->spos[0]+dir[0]*0.3f,iter->spos[1]+0.3f+dir[1]*0.3f,iter->spos[2]+dir[2]*0.3f); + glColor4ub(51,102,0,129); + glVertex3f(iter->epos[0],iter->epos[1]-0.3f,iter->epos[2]); + glVertex3f(iter->epos[0],iter->epos[1]+0.3f,iter->epos[2]); + + if (iter->expand) + glColor4ub(255,192,0,255); + else + glColor4ub(0,0,0,64); + + for (int i = 0; i < iter->nstraight-1; ++i) + { + glVertex3f(iter->straight[i*3+0],iter->straight[i*3+1]+0.3f,iter->straight[i*3+2]); + glVertex3f(iter->straight[(i+1)*3+0],iter->straight[(i+1)*3+1]+0.3f,iter->straight[(i+1)*3+2]); + } + } + glEnd(); + glLineWidth(1.0f); +} + +bool TestCase::handleRenderOverlay(double* proj, double* model, int* view) +{ + GLdouble x, y, z; + char text[64], subtext[64]; + int n = 0; + + static const float LABEL_DIST = 1.0f; + + for (Test* iter = m_tests; iter; iter = iter->next) + { + float pt[3], dir[3]; + if (iter->nstraight) + { + dtVcopy(pt, &iter->straight[3]); + if (dtVdist(pt, iter->spos) > LABEL_DIST) + { + dtVsub(dir, pt, iter->spos); + dtVnormalize(dir); + dtVmad(pt, iter->spos, dir, LABEL_DIST); + } + pt[1]+=0.5f; + } + else + { + dtVsub(dir, iter->epos, iter->spos); + dtVnormalize(dir); + dtVmad(pt, iter->spos, dir, LABEL_DIST); + pt[1]+=0.5f; + } + + if (gluProject((GLdouble)pt[0], (GLdouble)pt[1], (GLdouble)pt[2], + model, proj, view, &x, &y, &z)) + { + snprintf(text, 64, "Path %d\n", n); + unsigned int col = imguiRGBA(0,0,0,128); + if (iter->expand) + col = imguiRGBA(255,192,0,220); + imguiDrawText((int)x, (int)(y-25), IMGUI_ALIGN_CENTER, text, col); + } + n++; + } + + static int resScroll = 0; + bool mouseOverMenu = imguiBeginScrollArea("Test Results", 10, view[3] - 10 - 350, 200, 350, &resScroll); +// mouseOverMenu = true; + + n = 0; + for (Test* iter = m_tests; iter; iter = iter->next) + { + const int total = iter->findNearestPolyTime + iter->findPathTime + iter->findStraightPathTime; + snprintf(subtext, 64, "%.4f ms", (float)total/1000.0f); + snprintf(text, 64, "Path %d", n); + + if (imguiCollapse(text, subtext, iter->expand)) + iter->expand = !iter->expand; + if (iter->expand) + { + snprintf(text, 64, "Poly: %.4f ms", (float)iter->findNearestPolyTime/1000.0f); + imguiValue(text); + + snprintf(text, 64, "Path: %.4f ms", (float)iter->findPathTime/1000.0f); + imguiValue(text); + + snprintf(text, 64, "Straight: %.4f ms", (float)iter->findStraightPathTime/1000.0f); + imguiValue(text); + + imguiSeparator(); + } + + n++; + } + + imguiEndScrollArea(); + + return mouseOverMenu; +} diff --git a/dep/recastnavigation/RecastDemo/Source/ValueHistory.cpp b/dep/recastnavigation/RecastDemo/Source/ValueHistory.cpp new file mode 100644 index 000000000..30ae4b6fe --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Source/ValueHistory.cpp @@ -0,0 +1,119 @@ +#include "ValueHistory.h" +#include "imgui.h" +#include +#include + +#ifdef WIN32 +# define snprintf _snprintf +#endif + +ValueHistory::ValueHistory() : + m_hsamples(0) +{ + for (int i = 0; i < MAX_HISTORY; ++i) + m_samples[i] = 0; +} + +ValueHistory::~ValueHistory() +{ +} + +float ValueHistory::getSampleMin() const +{ + float val = m_samples[0]; + for (int i = 1; i < MAX_HISTORY; ++i) + if (m_samples[i] < val) + val = m_samples[i]; + return val; +} + +float ValueHistory::getSampleMax() const +{ + float val = m_samples[0]; + for (int i = 1; i < MAX_HISTORY; ++i) + if (m_samples[i] > val) + val = m_samples[i]; + return val; +} + +float ValueHistory::getAverage() const +{ + float val = 0; + for (int i = 0; i < MAX_HISTORY; ++i) + val += m_samples[i]; + return val/(float)MAX_HISTORY; +} + +void GraphParams::setRect(int ix, int iy, int iw, int ih, int ipad) +{ + x = ix; + y = iy; + w = iw; + h = ih; + pad = ipad; +} + +void GraphParams::setValueRange(float ivmin, float ivmax, int indiv, const char* iunits) +{ + vmin = ivmin; + vmax = ivmax; + ndiv = indiv; + strcpy(units, iunits); +} + +void drawGraphBackground(const GraphParams* p) +{ + // BG + imguiDrawRoundedRect((float)p->x, (float)p->y, (float)p->w, (float)p->h, (float)p->pad, imguiRGBA(64,64,64,128)); + + const float sy = (p->h-p->pad*2) / (p->vmax-p->vmin); + const float oy = p->y+p->pad-p->vmin*sy; + + char text[64]; + + // Divider Lines + for (int i = 0; i <= p->ndiv; ++i) + { + const float u = (float)i/(float)p->ndiv; + const float v = p->vmin + (p->vmax-p->vmin)*u; + snprintf(text, 64, "%.2f %s", v, p->units); + const float fy = oy + v*sy; + imguiDrawText(p->x + p->w - p->pad, (int)fy-4, IMGUI_ALIGN_RIGHT, text, imguiRGBA(0,0,0,255)); + imguiDrawLine((float)p->x + (float)p->pad, fy, (float)p->x + (float)p->w - (float)p->pad - 50, fy, 1.0f, imguiRGBA(0,0,0,64)); + } +} + +void drawGraph(const GraphParams* p, const ValueHistory* graph, + int idx, const char* label, const unsigned int col) +{ + const float sx = (p->w - p->pad*2) / (float)graph->getSampleCount(); + const float sy = (p->h - p->pad*2) / (p->vmax - p->vmin); + const float ox = (float)p->x + (float)p->pad; + const float oy = (float)p->y + (float)p->pad - p->vmin*sy; + + // Values + float px=0, py=0; + for (int i = 0; i < graph->getSampleCount()-1; ++i) + { + const float x = ox + i*sx; + const float y = oy + graph->getSample(i)*sy; + if (i > 0) + imguiDrawLine(px,py, x,y, 2.0f, col); + px = x; + py = y; + } + + // Label + const int size = 15; + const int spacing = 10; + int ix = p->x + p->w + 5; + int iy = p->y + p->h - (idx+1)*(size+spacing); + + imguiDrawRoundedRect((float)ix, (float)iy, (float)size, (float)size, 2.0f, col); + + char text[64]; + snprintf(text, 64, "%.2f %s", graph->getAverage(), p->units); + imguiDrawText(ix+size+5, iy+3, IMGUI_ALIGN_LEFT, label, imguiRGBA(255,255,255,192)); + imguiDrawText(ix+size+150, iy+3, IMGUI_ALIGN_RIGHT, text, imguiRGBA(255,255,255,128)); +} + diff --git a/dep/recastnavigation/RecastDemo/Source/imgui.cpp b/dep/recastnavigation/RecastDemo/Source/imgui.cpp new file mode 100644 index 000000000..36bbffa46 --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Source/imgui.cpp @@ -0,0 +1,676 @@ +// +// Copyright (c) 2009-2010 Mikko Mononen memon@inside.org +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. +// + +#include +#include +#define _USE_MATH_DEFINES +#include +#include "imgui.h" + +#ifdef WIN32 +# define snprintf _snprintf +#endif + +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +static const unsigned TEXT_POOL_SIZE = 8000; +static char g_textPool[TEXT_POOL_SIZE]; +static unsigned g_textPoolSize = 0; +static const char* allocText(const char* text) +{ + unsigned len = strlen(text)+1; + if (g_textPoolSize + len >= TEXT_POOL_SIZE) + return 0; + char* dst = &g_textPool[g_textPoolSize]; + memcpy(dst, text, len); + g_textPoolSize += len; + return dst; +} + +static const unsigned GFXCMD_QUEUE_SIZE = 5000; +static imguiGfxCmd g_gfxCmdQueue[GFXCMD_QUEUE_SIZE]; +static unsigned g_gfxCmdQueueSize = 0; + +static void resetGfxCmdQueue() +{ + g_gfxCmdQueueSize = 0; + g_textPoolSize = 0; +} + +static void addGfxCmdScissor(int x, int y, int w, int h) +{ + if (g_gfxCmdQueueSize >= GFXCMD_QUEUE_SIZE) + return; + imguiGfxCmd& cmd = g_gfxCmdQueue[g_gfxCmdQueueSize++]; + cmd.type = IMGUI_GFXCMD_SCISSOR; + cmd.flags = x < 0 ? 0 : 1; // on/off flag. + cmd.col = 0; + cmd.rect.x = (short)x; + cmd.rect.y = (short)y; + cmd.rect.w = (short)w; + cmd.rect.h = (short)h; +} + +static void addGfxCmdRect(float x, float y, float w, float h, unsigned int color) +{ + if (g_gfxCmdQueueSize >= GFXCMD_QUEUE_SIZE) + return; + imguiGfxCmd& cmd = g_gfxCmdQueue[g_gfxCmdQueueSize++]; + cmd.type = IMGUI_GFXCMD_RECT; + cmd.flags = 0; + cmd.col = color; + cmd.rect.x = (short)(x*8.0f); + cmd.rect.y = (short)(y*8.0f); + cmd.rect.w = (short)(w*8.0f); + cmd.rect.h = (short)(h*8.0f); + cmd.rect.r = 0; +} + +static void addGfxCmdLine(float x0, float y0, float x1, float y1, float r, unsigned int color) +{ + if (g_gfxCmdQueueSize >= GFXCMD_QUEUE_SIZE) + return; + imguiGfxCmd& cmd = g_gfxCmdQueue[g_gfxCmdQueueSize++]; + cmd.type = IMGUI_GFXCMD_LINE; + cmd.flags = 0; + cmd.col = color; + cmd.line.x0 = (short)(x0*8.0f); + cmd.line.y0 = (short)(y0*8.0f); + cmd.line.x1 = (short)(x1*8.0f); + cmd.line.y1 = (short)(y1*8.0f); + cmd.line.r = (short)(r*8.0f); +} + +static void addGfxCmdRoundedRect(float x, float y, float w, float h, float r, unsigned int color) +{ + if (g_gfxCmdQueueSize >= GFXCMD_QUEUE_SIZE) + return; + imguiGfxCmd& cmd = g_gfxCmdQueue[g_gfxCmdQueueSize++]; + cmd.type = IMGUI_GFXCMD_RECT; + cmd.flags = 0; + cmd.col = color; + cmd.rect.x = (short)(x*8.0f); + cmd.rect.y = (short)(y*8.0f); + cmd.rect.w = (short)(w*8.0f); + cmd.rect.h = (short)(h*8.0f); + cmd.rect.r = (short)(r*8.0f); +} + +static void addGfxCmdTriangle(int x, int y, int w, int h, int flags, unsigned int color) +{ + if (g_gfxCmdQueueSize >= GFXCMD_QUEUE_SIZE) + return; + imguiGfxCmd& cmd = g_gfxCmdQueue[g_gfxCmdQueueSize++]; + cmd.type = IMGUI_GFXCMD_TRIANGLE; + cmd.flags = (char)flags; + cmd.col = color; + cmd.rect.x = (short)(x*8.0f); + cmd.rect.y = (short)(y*8.0f); + cmd.rect.w = (short)(w*8.0f); + cmd.rect.h = (short)(h*8.0f); +} + +static void addGfxCmdText(int x, int y, int align, const char* text, unsigned int color) +{ + if (g_gfxCmdQueueSize >= GFXCMD_QUEUE_SIZE) + return; + imguiGfxCmd& cmd = g_gfxCmdQueue[g_gfxCmdQueueSize++]; + cmd.type = IMGUI_GFXCMD_TEXT; + cmd.flags = 0; + cmd.col = color; + cmd.text.x = (short)x; + cmd.text.y = (short)y; + cmd.text.align = (short)align; + cmd.text.text = allocText(text); +} + +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +struct GuiState +{ + GuiState() : + left(false), leftPressed(false), leftReleased(false), + mx(-1), my(-1), scroll(0), + active(0), hot(0), hotToBe(0), isHot(false), isActive(false), wentActive(false), + dragX(0), dragY(0), dragOrig(0), widgetX(0), widgetY(0), widgetW(100), + insideCurrentScroll(false), areaId(0), widgetId(0) + { + } + + bool left; + bool leftPressed, leftReleased; + int mx,my; + int scroll; + unsigned int active; + unsigned int hot; + unsigned int hotToBe; + bool isHot; + bool isActive; + bool wentActive; + int dragX, dragY; + float dragOrig; + int widgetX, widgetY, widgetW; + bool insideCurrentScroll; + + unsigned int areaId; + unsigned int widgetId; +}; + +static GuiState g_state; + +inline bool anyActive() +{ + return g_state.active != 0; +} + +inline bool isActive(unsigned int id) +{ + return g_state.active == id; +} + +inline bool isHot(unsigned int id) +{ + return g_state.hot == id; +} + +inline bool inRect(int x, int y, int w, int h, bool checkScroll = true) +{ + return (!checkScroll || g_state.insideCurrentScroll) && g_state.mx >= x && g_state.mx <= x+w && g_state.my >= y && g_state.my <= y+h; +} + +inline void clearInput() +{ + g_state.leftPressed = false; + g_state.leftReleased = false; + g_state.scroll = 0; +} + +inline void clearActive() +{ + g_state.active = 0; + // mark all UI for this frame as processed + clearInput(); +} + +inline void setActive(unsigned int id) +{ + g_state.active = id; + g_state.wentActive = true; +} + +inline void setHot(unsigned int id) +{ + g_state.hotToBe = id; +} + + +static bool buttonLogic(unsigned int id, bool over) +{ + bool res = false; + // process down + if (!anyActive()) + { + if (over) + setHot(id); + if (isHot(id) && g_state.leftPressed) + setActive(id); + } + + // if button is active, then react on left up + if (isActive(id)) + { + g_state.isActive = true; + if (over) + setHot(id); + if (g_state.leftReleased) + { + if (isHot(id)) + res = true; + clearActive(); + } + } + + if (isHot(id)) + g_state.isHot = true; + + return res; +} + +static void updateInput(int mx, int my, unsigned char mbut, int scroll) +{ + bool left = (mbut & IMGUI_MBUT_LEFT) != 0; + + g_state.mx = mx; + g_state.my = my; + g_state.leftPressed = !g_state.left && left; + g_state.leftReleased = g_state.left && !left; + g_state.left = left; + + g_state.scroll = scroll; +} + +void imguiBeginFrame(int mx, int my, unsigned char mbut, int scroll) +{ + updateInput(mx,my,mbut,scroll); + + g_state.hot = g_state.hotToBe; + g_state.hotToBe = 0; + + g_state.wentActive = false; + g_state.isActive = false; + g_state.isHot = false; + + g_state.widgetX = 0; + g_state.widgetY = 0; + g_state.widgetW = 0; + + g_state.areaId = 1; + g_state.widgetId = 1; + + resetGfxCmdQueue(); +} + +void imguiEndFrame() +{ + clearInput(); +} + +const imguiGfxCmd* imguiGetRenderQueue() +{ + return g_gfxCmdQueue; +} + +int imguiGetRenderQueueSize() +{ + return g_gfxCmdQueueSize; +} + + +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +static const int BUTTON_HEIGHT = 20; +static const int SLIDER_HEIGHT = 20; +static const int SLIDER_MARKER_WIDTH = 10; +static const int CHECK_SIZE = 8; +static const int DEFAULT_SPACING = 4; +static const int TEXT_HEIGHT = 8; +static const int SCROLL_AREA_PADDING = 6; +static const int INTEND_SIZE = 16; +static const int AREA_HEADER = 28; + +static int g_scrollTop = 0; +static int g_scrollBottom = 0; +static int g_scrollRight = 0; +static int g_scrollAreaTop = 0; +static int* g_scrollVal = 0; +static int g_focusTop = 0; +static int g_focusBottom = 0; +static unsigned int g_scrollId = 0; +static bool g_insideScrollArea = false; + +bool imguiBeginScrollArea(const char* name, int x, int y, int w, int h, int* scroll) +{ + g_state.areaId++; + g_state.widgetId = 0; + g_scrollId = (g_state.areaId<<16) | g_state.widgetId; + + g_state.widgetX = x + SCROLL_AREA_PADDING; + g_state.widgetY = y+h-AREA_HEADER + (*scroll); + g_state.widgetW = w - SCROLL_AREA_PADDING*4; + g_scrollTop = y-AREA_HEADER+h; + g_scrollBottom = y+SCROLL_AREA_PADDING; + g_scrollRight = x+w - SCROLL_AREA_PADDING*3; + g_scrollVal = scroll; + + g_scrollAreaTop = g_state.widgetY; + + g_focusTop = y-AREA_HEADER; + g_focusBottom = y-AREA_HEADER+h; + + g_insideScrollArea = inRect(x, y, w, h, false); + g_state.insideCurrentScroll = g_insideScrollArea; + + addGfxCmdRoundedRect((float)x, (float)y, (float)w, (float)h, 6, imguiRGBA(0,0,0,192)); + + addGfxCmdText(x+AREA_HEADER/2, y+h-AREA_HEADER/2-TEXT_HEIGHT/2, IMGUI_ALIGN_LEFT, name, imguiRGBA(255,255,255,128)); + + addGfxCmdScissor(x+SCROLL_AREA_PADDING, y+SCROLL_AREA_PADDING, w-SCROLL_AREA_PADDING*4, h-AREA_HEADER-SCROLL_AREA_PADDING); + + return g_insideScrollArea; +} + +void imguiEndScrollArea() +{ + // Disable scissoring. + addGfxCmdScissor(-1,-1,-1,-1); + + // Draw scroll bar + int x = g_scrollRight+SCROLL_AREA_PADDING/2; + int y = g_scrollBottom; + int w = SCROLL_AREA_PADDING*2; + int h = g_scrollTop - g_scrollBottom; + + int stop = g_scrollAreaTop; + int sbot = g_state.widgetY; + int sh = stop - sbot; // The scrollable area height. + + float barHeight = (float)h/(float)sh; + + if (barHeight < 1) + { + float barY = (float)(y - sbot)/(float)sh; + if (barY < 0) barY = 0; + if (barY > 1) barY = 1; + + // Handle scroll bar logic. + unsigned int hid = g_scrollId; + int hx = x; + int hy = y + (int)(barY*h); + int hw = w; + int hh = (int)(barHeight*h); + + const int range = h - (hh-1); + bool over = inRect(hx, hy, hw, hh); + buttonLogic(hid, over); + if (isActive(hid)) + { + float u = (float)(hy-y) / (float)range; + if (g_state.wentActive) + { + g_state.dragY = g_state.my; + g_state.dragOrig = u; + } + if (g_state.dragY != g_state.my) + { + u = g_state.dragOrig + (g_state.my - g_state.dragY) / (float)range; + if (u < 0) u = 0; + if (u > 1) u = 1; + *g_scrollVal = (int)((1-u) * (sh - h)); + } + } + + // BG + addGfxCmdRoundedRect((float)x, (float)y, (float)w, (float)h, (float)w/2-1, imguiRGBA(0,0,0,196)); + // Bar + if (isActive(hid)) + addGfxCmdRoundedRect((float)hx, (float)hy, (float)hw, (float)hh, (float)w/2-1, imguiRGBA(255,196,0,196)); + else + addGfxCmdRoundedRect((float)hx, (float)hy, (float)hw, (float)hh, (float)w/2-1, isHot(hid) ? imguiRGBA(255,196,0,96) : imguiRGBA(255,255,255,64)); + + // Handle mouse scrolling. + if (g_insideScrollArea) // && !anyActive()) + { + if (g_state.scroll) + { + *g_scrollVal += 20*g_state.scroll; + if (*g_scrollVal < 0) *g_scrollVal = 0; + if (*g_scrollVal > (sh - h)) *g_scrollVal = (sh - h); + } + } + } + g_state.insideCurrentScroll = false; +} + +bool imguiButton(const char* text, bool enabled) +{ + g_state.widgetId++; + unsigned int id = (g_state.areaId<<16) | g_state.widgetId; + + int x = g_state.widgetX; + int y = g_state.widgetY - BUTTON_HEIGHT; + int w = g_state.widgetW; + int h = BUTTON_HEIGHT; + g_state.widgetY -= BUTTON_HEIGHT + DEFAULT_SPACING; + + bool over = enabled && inRect(x, y, w, h); + bool res = buttonLogic(id, over); + + addGfxCmdRoundedRect((float)x, (float)y, (float)w, (float)h, (float)BUTTON_HEIGHT/2-1, imguiRGBA(128,128,128, isActive(id)?196:96)); + if (enabled) + addGfxCmdText(x+BUTTON_HEIGHT/2, y+BUTTON_HEIGHT/2-TEXT_HEIGHT/2, IMGUI_ALIGN_LEFT, text, isHot(id) ? imguiRGBA(255,196,0,255) : imguiRGBA(255,255,255,200)); + else + addGfxCmdText(x+BUTTON_HEIGHT/2, y+BUTTON_HEIGHT/2-TEXT_HEIGHT/2, IMGUI_ALIGN_LEFT, text, imguiRGBA(128,128,128,200)); + + return res; +} + +bool imguiItem(const char* text, bool enabled) +{ + g_state.widgetId++; + unsigned int id = (g_state.areaId<<16) | g_state.widgetId; + + int x = g_state.widgetX; + int y = g_state.widgetY - BUTTON_HEIGHT; + int w = g_state.widgetW; + int h = BUTTON_HEIGHT; + g_state.widgetY -= BUTTON_HEIGHT + DEFAULT_SPACING; + + bool over = enabled && inRect(x, y, w, h); + bool res = buttonLogic(id, over); + + if (isHot(id)) + addGfxCmdRoundedRect((float)x, (float)y, (float)w, (float)h, 2.0f, imguiRGBA(255,196,0,isActive(id)?196:96)); + + if (enabled) + addGfxCmdText(x+BUTTON_HEIGHT/2, y+BUTTON_HEIGHT/2-TEXT_HEIGHT/2, IMGUI_ALIGN_LEFT, text, imguiRGBA(255,255,255,200)); + else + addGfxCmdText(x+BUTTON_HEIGHT/2, y+BUTTON_HEIGHT/2-TEXT_HEIGHT/2, IMGUI_ALIGN_LEFT, text, imguiRGBA(128,128,128,200)); + + return res; +} + +bool imguiCheck(const char* text, bool checked, bool enabled) +{ + g_state.widgetId++; + unsigned int id = (g_state.areaId<<16) | g_state.widgetId; + + int x = g_state.widgetX; + int y = g_state.widgetY - BUTTON_HEIGHT; + int w = g_state.widgetW; + int h = BUTTON_HEIGHT; + g_state.widgetY -= BUTTON_HEIGHT + DEFAULT_SPACING; + + bool over = enabled && inRect(x, y, w, h); + bool res = buttonLogic(id, over); + + const int cx = x+BUTTON_HEIGHT/2-CHECK_SIZE/2; + const int cy = y+BUTTON_HEIGHT/2-CHECK_SIZE/2; + addGfxCmdRoundedRect((float)cx-3, (float)cy-3, (float)CHECK_SIZE+6, (float)CHECK_SIZE+6, 4, imguiRGBA(128,128,128, isActive(id)?196:96)); + if (checked) + { + if (enabled) + addGfxCmdRoundedRect((float)cx, (float)cy, (float)CHECK_SIZE, (float)CHECK_SIZE, (float)CHECK_SIZE/2-1, imguiRGBA(255,255,255,isActive(id)?255:200)); + else + addGfxCmdRoundedRect((float)cx, (float)cy, (float)CHECK_SIZE, (float)CHECK_SIZE, (float)CHECK_SIZE/2-1, imguiRGBA(128,128,128,200)); + } + + if (enabled) + addGfxCmdText(x+BUTTON_HEIGHT, y+BUTTON_HEIGHT/2-TEXT_HEIGHT/2, IMGUI_ALIGN_LEFT, text, isHot(id) ? imguiRGBA(255,196,0,255) : imguiRGBA(255,255,255,200)); + else + addGfxCmdText(x+BUTTON_HEIGHT, y+BUTTON_HEIGHT/2-TEXT_HEIGHT/2, IMGUI_ALIGN_LEFT, text, imguiRGBA(128,128,128,200)); + + return res; +} + +bool imguiCollapse(const char* text, const char* subtext, bool checked, bool enabled) +{ + g_state.widgetId++; + unsigned int id = (g_state.areaId<<16) | g_state.widgetId; + + int x = g_state.widgetX; + int y = g_state.widgetY - BUTTON_HEIGHT; + int w = g_state.widgetW; + int h = BUTTON_HEIGHT; + g_state.widgetY -= BUTTON_HEIGHT; // + DEFAULT_SPACING; + + const int cx = x+BUTTON_HEIGHT/2-CHECK_SIZE/2; + const int cy = y+BUTTON_HEIGHT/2-CHECK_SIZE/2; + + bool over = enabled && inRect(x, y, w, h); + bool res = buttonLogic(id, over); + + if (checked) + addGfxCmdTriangle(cx, cy, CHECK_SIZE, CHECK_SIZE, 2, imguiRGBA(255,255,255,isActive(id)?255:200)); + else + addGfxCmdTriangle(cx, cy, CHECK_SIZE, CHECK_SIZE, 1, imguiRGBA(255,255,255,isActive(id)?255:200)); + + if (enabled) + addGfxCmdText(x+BUTTON_HEIGHT, y+BUTTON_HEIGHT/2-TEXT_HEIGHT/2, IMGUI_ALIGN_LEFT, text, isHot(id) ? imguiRGBA(255,196,0,255) : imguiRGBA(255,255,255,200)); + else + addGfxCmdText(x+BUTTON_HEIGHT, y+BUTTON_HEIGHT/2-TEXT_HEIGHT/2, IMGUI_ALIGN_LEFT, text, imguiRGBA(128,128,128,200)); + + if (subtext) + addGfxCmdText(x+w-BUTTON_HEIGHT/2, y+BUTTON_HEIGHT/2-TEXT_HEIGHT/2, IMGUI_ALIGN_RIGHT, subtext, imguiRGBA(255,255,255,128)); + + return res; +} + +void imguiLabel(const char* text) +{ + int x = g_state.widgetX; + int y = g_state.widgetY - BUTTON_HEIGHT; + g_state.widgetY -= BUTTON_HEIGHT; + addGfxCmdText(x, y+BUTTON_HEIGHT/2-TEXT_HEIGHT/2, IMGUI_ALIGN_LEFT, text, imguiRGBA(255,255,255,255)); +} + +void imguiValue(const char* text) +{ + const int x = g_state.widgetX; + const int y = g_state.widgetY - BUTTON_HEIGHT; + const int w = g_state.widgetW; + g_state.widgetY -= BUTTON_HEIGHT; + + addGfxCmdText(x+w-BUTTON_HEIGHT/2, y+BUTTON_HEIGHT/2-TEXT_HEIGHT/2, IMGUI_ALIGN_RIGHT, text, imguiRGBA(255,255,255,200)); +} + +bool imguiSlider(const char* text, float* val, float vmin, float vmax, float vinc, bool enabled) +{ + g_state.widgetId++; + unsigned int id = (g_state.areaId<<16) | g_state.widgetId; + + int x = g_state.widgetX; + int y = g_state.widgetY - BUTTON_HEIGHT; + int w = g_state.widgetW; + int h = SLIDER_HEIGHT; + g_state.widgetY -= SLIDER_HEIGHT + DEFAULT_SPACING; + + addGfxCmdRoundedRect((float)x, (float)y, (float)w, (float)h, 4.0f, imguiRGBA(0,0,0,128)); + + const int range = w - SLIDER_MARKER_WIDTH; + + float u = (*val - vmin) / (vmax-vmin); + if (u < 0) u = 0; + if (u > 1) u = 1; + int m = (int)(u * range); + + bool over = enabled && inRect(x+m, y, SLIDER_MARKER_WIDTH, SLIDER_HEIGHT); + bool res = buttonLogic(id, over); + bool valChanged = false; + + if (isActive(id)) + { + if (g_state.wentActive) + { + g_state.dragX = g_state.mx; + g_state.dragOrig = u; + } + if (g_state.dragX != g_state.mx) + { + u = g_state.dragOrig + (float)(g_state.mx - g_state.dragX) / (float)range; + if (u < 0) u = 0; + if (u > 1) u = 1; + *val = vmin + u*(vmax-vmin); + *val = floorf(*val / vinc)*vinc; // Snap to vinc + m = (int)(u * range); + valChanged = true; + } + } + + if (isActive(id)) + addGfxCmdRoundedRect((float)(x+m), (float)y, (float)SLIDER_MARKER_WIDTH, (float)SLIDER_HEIGHT, 4.0f, imguiRGBA(255,255,255,255)); + else + addGfxCmdRoundedRect((float)(x+m), (float)y, (float)SLIDER_MARKER_WIDTH, (float)SLIDER_HEIGHT, 4.0f, isHot(id) ? imguiRGBA(255,196,0,128) : imguiRGBA(255,255,255,64)); + + // TODO: fix this, take a look at 'nicenum'. + int digits = (int)(ceilf(log10f(vinc))); + char fmt[16]; + snprintf(fmt, 16, "%%.%df", digits >= 0 ? 0 : -digits); + char msg[128]; + snprintf(msg, 128, fmt, *val); + + if (enabled) + { + addGfxCmdText(x+SLIDER_HEIGHT/2, y+SLIDER_HEIGHT/2-TEXT_HEIGHT/2, IMGUI_ALIGN_LEFT, text, isHot(id) ? imguiRGBA(255,196,0,255) : imguiRGBA(255,255,255,200)); + addGfxCmdText(x+w-SLIDER_HEIGHT/2, y+SLIDER_HEIGHT/2-TEXT_HEIGHT/2, IMGUI_ALIGN_RIGHT, msg, isHot(id) ? imguiRGBA(255,196,0,255) : imguiRGBA(255,255,255,200)); + } + else + { + addGfxCmdText(x+SLIDER_HEIGHT/2, y+SLIDER_HEIGHT/2-TEXT_HEIGHT/2, IMGUI_ALIGN_LEFT, text, imguiRGBA(128,128,128,200)); + addGfxCmdText(x+w-SLIDER_HEIGHT/2, y+SLIDER_HEIGHT/2-TEXT_HEIGHT/2, IMGUI_ALIGN_RIGHT, msg, imguiRGBA(128,128,128,200)); + } + + return res || valChanged; +} + + +void imguiIndent() +{ + g_state.widgetX += INTEND_SIZE; + g_state.widgetW -= INTEND_SIZE; +} + +void imguiUnindent() +{ + g_state.widgetX -= INTEND_SIZE; + g_state.widgetW += INTEND_SIZE; +} + +void imguiSeparator() +{ + g_state.widgetY -= DEFAULT_SPACING*3; +} + +void imguiSeparatorLine() +{ + int x = g_state.widgetX; + int y = g_state.widgetY - DEFAULT_SPACING*2; + int w = g_state.widgetW; + int h = 1; + g_state.widgetY -= DEFAULT_SPACING*4; + + addGfxCmdRect((float)x, (float)y, (float)w, (float)h, imguiRGBA(255,255,255,32)); +} + +void imguiDrawText(int x, int y, int align, const char* text, unsigned int color) +{ + addGfxCmdText(x, y, align, text, color); +} + +void imguiDrawLine(float x0, float y0, float x1, float y1, float r, unsigned int color) +{ + addGfxCmdLine(x0, y0, x1, y1, r, color); +} + +void imguiDrawRect(float x, float y, float w, float h, unsigned int color) +{ + addGfxCmdRect(x, y, w, h, color); +} + +void imguiDrawRoundedRect(float x, float y, float w, float h, float r, unsigned int color) +{ + addGfxCmdRoundedRect(x, y, w, h, r, color); +} + diff --git a/dep/recastnavigation/RecastDemo/Source/imguiRenderGL.cpp b/dep/recastnavigation/RecastDemo/Source/imguiRenderGL.cpp new file mode 100644 index 000000000..2dddffe07 --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Source/imguiRenderGL.cpp @@ -0,0 +1,480 @@ +// +// Copyright (c) 2009-2010 Mikko Mononen memon@inside.org +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. +// + +#define _USE_MATH_DEFINES +#include +#include "imgui.h" +#include "SDL.h" +#include "SDL_opengl.h" + +// Some math headers don't have PI defined. +static const float PI = 3.14159265f; + +void imguifree(void* ptr, void* userptr); +void* imguimalloc(size_t size, void* userptr); + +#define STBTT_malloc(x,y) imguimalloc(x,y) +#define STBTT_free(x,y) imguifree(x,y) +#define STB_TRUETYPE_IMPLEMENTATION +#include "stb_truetype.h" + +void imguifree(void* ptr, void* /*userptr*/) +{ + free(ptr); +} + +void* imguimalloc(size_t size, void* /*userptr*/) +{ + return malloc(size); +} + +static const unsigned TEMP_COORD_COUNT = 100; +static float g_tempCoords[TEMP_COORD_COUNT*2]; +static float g_tempNormals[TEMP_COORD_COUNT*2]; + +static const int CIRCLE_VERTS = 8*4; +static float g_circleVerts[CIRCLE_VERTS*2]; + +static stbtt_bakedchar g_cdata[96]; // ASCII 32..126 is 95 glyphs +static GLuint g_ftex = 0; + +inline unsigned int RGBA(unsigned char r, unsigned char g, unsigned char b, unsigned char a) +{ + return (r) | (g << 8) | (b << 16) | (a << 24); +} + +static void drawPolygon(const float* coords, unsigned numCoords, float r, unsigned int col) +{ + if (numCoords > TEMP_COORD_COUNT) numCoords = TEMP_COORD_COUNT; + + for (unsigned i = 0, j = numCoords-1; i < numCoords; j=i++) + { + const float* v0 = &coords[j*2]; + const float* v1 = &coords[i*2]; + float dx = v1[0] - v0[0]; + float dy = v1[1] - v0[1]; + float d = sqrtf(dx*dx+dy*dy); + if (d > 0) + { + d = 1.0f/d; + dx *= d; + dy *= d; + } + g_tempNormals[j*2+0] = dy; + g_tempNormals[j*2+1] = -dx; + } + + for (unsigned i = 0, j = numCoords-1; i < numCoords; j=i++) + { + float dlx0 = g_tempNormals[j*2+0]; + float dly0 = g_tempNormals[j*2+1]; + float dlx1 = g_tempNormals[i*2+0]; + float dly1 = g_tempNormals[i*2+1]; + float dmx = (dlx0 + dlx1) * 0.5f; + float dmy = (dly0 + dly1) * 0.5f; + float dmr2 = dmx*dmx + dmy*dmy; + if (dmr2 > 0.000001f) + { + float scale = 1.0f / dmr2; + if (scale > 10.0f) scale = 10.0f; + dmx *= scale; + dmy *= scale; + } + g_tempCoords[i*2+0] = coords[i*2+0]+dmx*r; + g_tempCoords[i*2+1] = coords[i*2+1]+dmy*r; + } + + unsigned int colTrans = RGBA(col&0xff, (col>>8)&0xff, (col>>16)&0xff, 0); + + glBegin(GL_TRIANGLES); + + glColor4ubv((GLubyte*)&col); + + for (unsigned i = 0, j = numCoords-1; i < numCoords; j=i++) + { + glVertex2fv(&coords[i*2]); + glVertex2fv(&coords[j*2]); + glColor4ubv((GLubyte*)&colTrans); + glVertex2fv(&g_tempCoords[j*2]); + + glVertex2fv(&g_tempCoords[j*2]); + glVertex2fv(&g_tempCoords[i*2]); + + glColor4ubv((GLubyte*)&col); + glVertex2fv(&coords[i*2]); + } + + glColor4ubv((GLubyte*)&col); + for (unsigned i = 2; i < numCoords; ++i) + { + glVertex2fv(&coords[0]); + glVertex2fv(&coords[(i-1)*2]); + glVertex2fv(&coords[i*2]); + } + + glEnd(); +} + +static void drawRect(float x, float y, float w, float h, float fth, unsigned int col) +{ + float verts[4*2] = + { + x+0.5f, y+0.5f, + x+w-0.5f, y+0.5f, + x+w-0.5f, y+h-0.5f, + x+0.5f, y+h-0.5f, + }; + drawPolygon(verts, 4, fth, col); +} + +/* +static void drawEllipse(float x, float y, float w, float h, float fth, unsigned int col) +{ + float verts[CIRCLE_VERTS*2]; + const float* cverts = g_circleVerts; + float* v = verts; + + for (int i = 0; i < CIRCLE_VERTS; ++i) + { + *v++ = x + cverts[i*2]*w; + *v++ = y + cverts[i*2+1]*h; + } + + drawPolygon(verts, CIRCLE_VERTS, fth, col); +} +*/ + +static void drawRoundedRect(float x, float y, float w, float h, float r, float fth, unsigned int col) +{ + const unsigned n = CIRCLE_VERTS/4; + float verts[(n+1)*4*2]; + const float* cverts = g_circleVerts; + float* v = verts; + + for (unsigned i = 0; i <= n; ++i) + { + *v++ = x+w-r + cverts[i*2]*r; + *v++ = y+h-r + cverts[i*2+1]*r; + } + + for (unsigned i = n; i <= n*2; ++i) + { + *v++ = x+r + cverts[i*2]*r; + *v++ = y+h-r + cverts[i*2+1]*r; + } + + for (unsigned i = n*2; i <= n*3; ++i) + { + *v++ = x+r + cverts[i*2]*r; + *v++ = y+r + cverts[i*2+1]*r; + } + + for (unsigned i = n*3; i < n*4; ++i) + { + *v++ = x+w-r + cverts[i*2]*r; + *v++ = y+r + cverts[i*2+1]*r; + } + *v++ = x+w-r + cverts[0]*r; + *v++ = y+r + cverts[1]*r; + + drawPolygon(verts, (n+1)*4, fth, col); +} + + +static void drawLine(float x0, float y0, float x1, float y1, float r, float fth, unsigned int col) +{ + float dx = x1-x0; + float dy = y1-y0; + float d = sqrtf(dx*dx+dy*dy); + if (d > 0.0001f) + { + d = 1.0f/d; + dx *= d; + dy *= d; + } + float nx = dy; + float ny = -dx; + float verts[4*2]; + r -= fth; + r *= 0.5f; + if (r < 0.01f) r = 0.01f; + dx *= r; + dy *= r; + nx *= r; + ny *= r; + + verts[0] = x0-dx-nx; + verts[1] = y0-dy-ny; + + verts[2] = x0-dx+nx; + verts[3] = y0-dy+ny; + + verts[4] = x1+dx+nx; + verts[5] = y1+dy+ny; + + verts[6] = x1+dx-nx; + verts[7] = y1+dy-ny; + + drawPolygon(verts, 4, fth, col); +} + + +bool imguiRenderGLInit(const char* fontpath) +{ + for (int i = 0; i < CIRCLE_VERTS; ++i) + { + float a = (float)i/(float)CIRCLE_VERTS * PI*2; + g_circleVerts[i*2+0] = cosf(a); + g_circleVerts[i*2+1] = sinf(a); + } + + // Load font. + FILE* fp = fopen(fontpath, "rb"); + if (!fp) return false; + fseek(fp, 0, SEEK_END); + int size = ftell(fp); + fseek(fp, 0, SEEK_SET); + + unsigned char* ttfBuffer = (unsigned char*)malloc(size); + if (!ttfBuffer) + { + fclose(fp); + return false; + } + + fread(ttfBuffer, 1, size, fp); + fclose(fp); + fp = 0; + + unsigned char* bmap = (unsigned char*)malloc(512*512); + if (!bmap) + { + free(ttfBuffer); + return false; + } + + stbtt_BakeFontBitmap(ttfBuffer,0, 15.0f, bmap,512,512, 32,96, g_cdata); + + // can free ttf_buffer at this point + glGenTextures(1, &g_ftex); + glBindTexture(GL_TEXTURE_2D, g_ftex); + glTexImage2D(GL_TEXTURE_2D, 0, GL_ALPHA, 512,512, 0, GL_ALPHA, GL_UNSIGNED_BYTE, bmap); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); + + free(ttfBuffer); + free(bmap); + + return true; +} + +void imguiRenderGLDestroy() +{ + if (g_ftex) + { + glDeleteTextures(1, &g_ftex); + g_ftex = 0; + } +} + +static void getBakedQuad(stbtt_bakedchar *chardata, int pw, int ph, int char_index, + float *xpos, float *ypos, stbtt_aligned_quad *q) +{ + stbtt_bakedchar *b = chardata + char_index; + int round_x = STBTT_ifloor(*xpos + b->xoff); + int round_y = STBTT_ifloor(*ypos - b->yoff); + + 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; + q->s1 = b->x1 / (float)ph; + q->t1 = b->y1 / (float)ph; + + *xpos += b->xadvance; +} + +static const float g_tabStops[4] = {150, 210, 270, 330}; + +static float getTextLength(stbtt_bakedchar *chardata, const char* text) +{ + float xpos = 0; + float len = 0; + while (*text) + { + int c = (unsigned char)*text; + if (c == '\t') + { + for (int i = 0; i < 4; ++i) + { + if (xpos < g_tabStops[i]) + { + xpos = g_tabStops[i]; + break; + } + } + } + else if (c >= 32 && c < 128) + { + stbtt_bakedchar *b = chardata + c-32; + int round_x = STBTT_ifloor((xpos + b->xoff) + 0.5); + len = round_x + b->x1 - b->x0 + 0.5f; + xpos += b->xadvance; + } + ++text; + } + return len; +} + +static void drawText(float x, float y, const char *text, int align, unsigned int col) +{ + if (!g_ftex) return; + if (!text) return; + + if (align == IMGUI_ALIGN_CENTER) + x -= getTextLength(g_cdata, text)/2; + else if (align == IMGUI_ALIGN_RIGHT) + x -= getTextLength(g_cdata, text); + + glColor4ub(col&0xff, (col>>8)&0xff, (col>>16)&0xff, (col>>24)&0xff); + + glEnable(GL_TEXTURE_2D); + + // assume orthographic projection with units = screen pixels, origin at top left + glBindTexture(GL_TEXTURE_2D, g_ftex); + + glBegin(GL_TRIANGLES); + + const float ox = x; + + while (*text) + { + int c = (unsigned char)*text; + if (c == '\t') + { + for (int i = 0; i < 4; ++i) + { + if (x < g_tabStops[i]+ox) + { + x = g_tabStops[i]+ox; + break; + } + } + } + else if (c >= 32 && c < 128) + { + stbtt_aligned_quad q; + getBakedQuad(g_cdata, 512,512, c-32, &x,&y,&q); + + glTexCoord2f(q.s0, q.t0); + glVertex2f(q.x0, q.y0); + glTexCoord2f(q.s1, q.t1); + glVertex2f(q.x1, q.y1); + glTexCoord2f(q.s1, q.t0); + glVertex2f(q.x1, q.y0); + + glTexCoord2f(q.s0, q.t0); + glVertex2f(q.x0, q.y0); + glTexCoord2f(q.s0, q.t1); + glVertex2f(q.x0, q.y1); + glTexCoord2f(q.s1, q.t1); + glVertex2f(q.x1, q.y1); + } + ++text; + } + + glEnd(); + glDisable(GL_TEXTURE_2D); +} + + +void imguiRenderGLDraw() +{ + const imguiGfxCmd* q = imguiGetRenderQueue(); + int nq = imguiGetRenderQueueSize(); + + const float s = 1.0f/8.0f; + + glDisable(GL_SCISSOR_TEST); + for (int i = 0; i < nq; ++i) + { + const imguiGfxCmd& cmd = q[i]; + if (cmd.type == IMGUI_GFXCMD_RECT) + { + if (cmd.rect.r == 0) + { + drawRect((float)cmd.rect.x*s+0.5f, (float)cmd.rect.y*s+0.5f, + (float)cmd.rect.w*s-1, (float)cmd.rect.h*s-1, + 1.0f, cmd.col); + } + else + { + drawRoundedRect((float)cmd.rect.x*s+0.5f, (float)cmd.rect.y*s+0.5f, + (float)cmd.rect.w*s-1, (float)cmd.rect.h*s-1, + (float)cmd.rect.r*s, 1.0f, cmd.col); + } + } + else if (cmd.type == IMGUI_GFXCMD_LINE) + { + drawLine(cmd.line.x0*s, cmd.line.y0*s, cmd.line.x1*s, cmd.line.y1*s, cmd.line.r*s, 1.0f, cmd.col); + } + else if (cmd.type == IMGUI_GFXCMD_TRIANGLE) + { + if (cmd.flags == 1) + { + const float verts[3*2] = + { + (float)cmd.rect.x*s+0.5f, (float)cmd.rect.y*s+0.5f, + (float)cmd.rect.x*s+0.5f+(float)cmd.rect.w*s-1, (float)cmd.rect.y*s+0.5f+(float)cmd.rect.h*s/2-0.5f, + (float)cmd.rect.x*s+0.5f, (float)cmd.rect.y*s+0.5f+(float)cmd.rect.h*s-1, + }; + drawPolygon(verts, 3, 1.0f, cmd.col); + } + if (cmd.flags == 2) + { + const float verts[3*2] = + { + (float)cmd.rect.x*s+0.5f, (float)cmd.rect.y*s+0.5f+(float)cmd.rect.h*s-1, + (float)cmd.rect.x*s+0.5f+(float)cmd.rect.w*s/2-0.5f, (float)cmd.rect.y*s+0.5f, + (float)cmd.rect.x*s+0.5f+(float)cmd.rect.w*s-1, (float)cmd.rect.y*s+0.5f+(float)cmd.rect.h*s-1, + }; + drawPolygon(verts, 3, 1.0f, cmd.col); + } + } + else if (cmd.type == IMGUI_GFXCMD_TEXT) + { + drawText(cmd.text.x, cmd.text.y, cmd.text.text, cmd.text.align, cmd.col); + } + else if (cmd.type == IMGUI_GFXCMD_SCISSOR) + { + if (cmd.flags) + { + glEnable(GL_SCISSOR_TEST); + glScissor(cmd.rect.x, cmd.rect.y, cmd.rect.w, cmd.rect.h); + } + else + { + glDisable(GL_SCISSOR_TEST); + } + } + } + glDisable(GL_SCISSOR_TEST); +} diff --git a/dep/recastnavigation/RecastDemo/Source/main.cpp b/dep/recastnavigation/RecastDemo/Source/main.cpp new file mode 100644 index 000000000..ba12e9e51 --- /dev/null +++ b/dep/recastnavigation/RecastDemo/Source/main.cpp @@ -0,0 +1,987 @@ +// +// Copyright (c) 2009-2010 Mikko Mononen memon@inside.org +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. +// + +#include +#define _USE_MATH_DEFINES +#include +#include "SDL.h" +#include "SDL_opengl.h" +#include "imgui.h" +#include "imguiRenderGL.h" +#include "Recast.h" +#include "RecastDebugDraw.h" +#include "InputGeom.h" +#include "TestCase.h" +#include "Filelist.h" +#include "SlideShow.h" + +#include "Sample_SoloMeshSimple.h" +#include "Sample_SoloMeshTiled.h" +#include "Sample_TileMesh.h" +#include "Sample_Debug.h" + +#ifdef WIN32 +# define snprintf _snprintf +#endif + +struct SampleItem +{ + Sample* (*create)(); + const char* name; +}; + +Sample* createSoloSimple() { return new Sample_SoloMeshSimple(); } +Sample* createSoloTiled() { return new Sample_SoloMeshTiled(); } +Sample* createTile() { return new Sample_TileMesh(); } +Sample* createDebug() { return new Sample_Debug(); } + +static SampleItem g_samples[] = +{ + { createSoloTiled, "Test Recast Params" }, + //{ createSoloSimple, "Solo Mesh Simple" }, + //{ createSoloTiled, "Solo Mesh Tiled" }, + //{ createTile, "Tile Mesh" }, + { createDebug, "Debug Generator Navmesh" }, +}; +static const int g_nsamples = sizeof(g_samples)/sizeof(SampleItem); + + +int main(int /*argc*/, char** /*argv*/) +{ + // Init SDL + if (SDL_Init(SDL_INIT_EVERYTHING) != 0) + { + printf("Could not initialise SDL\n"); + return -1; + } + + // Init OpenGL + SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1); + SDL_GL_SetAttribute(SDL_GL_DEPTH_SIZE, 24); + SDL_GL_SetAttribute(SDL_GL_RED_SIZE, 8); + SDL_GL_SetAttribute(SDL_GL_GREEN_SIZE, 8); + SDL_GL_SetAttribute(SDL_GL_BLUE_SIZE, 8); + SDL_GL_SetAttribute(SDL_GL_ALPHA_SIZE, 8); + + const SDL_VideoInfo* vi = SDL_GetVideoInfo(); + + bool presentationMode = false; + + int width, height; + SDL_Surface* screen = 0; + + if (presentationMode) + { + width = vi->current_w; + height = vi->current_h; + screen = SDL_SetVideoMode(width, height, 0, SDL_OPENGL|SDL_FULLSCREEN); + } + else + { + width = vi->current_w - 20; + height = vi->current_h - 80; + screen = SDL_SetVideoMode(width, height, 0, SDL_OPENGL); + } + + if (!screen) + { + printf("Could not initialise SDL opengl\n"); + return -1; + } + + SDL_WM_SetCaption("Recast Demo", 0); + + if (!imguiRenderGLInit("DroidSans.ttf")) + { + printf("Could not init GUI renderer.\n"); + SDL_Quit(); + return -1; + } + + float t = 0.0f; + float timeAcc = 0.0f; + Uint32 lastTime = SDL_GetTicks(); + int mx = 0, my = 0; + float rx = 45; + float ry = -45; + float moveW = 0, moveS = 0, moveA = 0, moveD = 0; + float camx = 0, camy = 0, camz = 0, camr = 1000; + float origrx = 0, origry = 0; + int origx = 0, origy = 0; + float scrollZoom = 0; + bool rotate = false; + bool movedDuringRotate = false; + float rays[3], raye[3]; + bool mouseOverMenu = false; + bool showMenu = !presentationMode; + bool showLog = false; + bool showDebugMode = true; + bool showTools = true; + bool showMaps = false; + bool showLevels = false; + bool showSample = false; + bool showTestCases = false; + + int propScroll = 0; + int logScroll = 0; + int toolsScroll = 0; + int debugScroll = 0; + + char sampleName[64] = "Choose Sample..."; + + FileList maps; + char mapName[128] = "Choose Map..."; + + FileList files; + char meshName[128] = "Choose Tile..."; + + float mpos[3] = {0,0,0}; + bool mposSet = false; + + SlideShow slideShow; + slideShow.init("slides/"); + + InputGeom* geom = 0; + Sample* sample = 0; + TestCase* test = 0; + + BuildContext ctx; + + glEnable(GL_CULL_FACE); + + float fogCol[4] = { 0.32f,0.25f,0.25f,1 }; + glEnable(GL_FOG); + glFogi(GL_FOG_MODE, GL_LINEAR); + glFogf(GL_FOG_START, camr*0.2f); + glFogf(GL_FOG_END, camr*1.25f); + glFogfv(GL_FOG_COLOR, fogCol); + + glDepthFunc(GL_LEQUAL); + + glEnable(GL_POINT_SMOOTH); + glEnable(GL_LINE_SMOOTH); + + bool done = false; + while(!done) + { + // Handle input events. + int mscroll = 0; + bool processHitTest = false; + bool processHitTestShift = false; + SDL_Event event; + + while (SDL_PollEvent(&event)) + { + switch (event.type) + { + case SDL_KEYDOWN: + // Handle any key presses here. + if (event.key.keysym.sym == SDLK_ESCAPE) + { + done = true; + } + else if (event.key.keysym.sym == SDLK_t) + { + showLevels = false; + showSample = false; + showTestCases = true; + scanDirectory("Tests", ".txt", files); + } + else if (event.key.keysym.sym == SDLK_TAB) + { + showMenu = !showMenu; + } + else if (event.key.keysym.sym == SDLK_SPACE) + { + if (sample) + sample->handleToggle(); + } + else if (event.key.keysym.sym == SDLK_1) + { + if (sample) + sample->handleStep(); + } + else if (event.key.keysym.sym == SDLK_9) + { + if (geom) + geom->save("geomset.txt"); + } + else if (event.key.keysym.sym == SDLK_0) + { + delete geom; + geom = new InputGeom; + if (!geom || !geom->load(&ctx, "geomset.txt")) + { + delete geom; + geom = 0; + + showLog = true; + logScroll = 0; + ctx.dumpLog("Geom load log %s:", meshName); + } + if (sample && geom) + { + sample->handleMeshChanged(geom); + } + + if (geom || sample) + { + const float* bmin = 0; + const float* bmax = 0; + if (sample) + { + bmin = sample->getBoundsMin(); + bmax = sample->getBoundsMax(); + } + else if (geom) + { + bmin = geom->getMeshBoundsMin(); + bmax = geom->getMeshBoundsMax(); + } + // Reset camera and fog to match the mesh bounds. + if (bmin && bmax) + { + camr = sqrtf(rcSqr(bmax[0]-bmin[0]) + + rcSqr(bmax[1]-bmin[1]) + + rcSqr(bmax[2]-bmin[2])) / 2; + camx = (bmax[0] + bmin[0]) / 2 + camr; + camy = (bmax[1] + bmin[1]) / 2 + camr; + camz = (bmax[2] + bmin[2]) / 2 + camr; + camr *= 3; + } + rx = 45; + ry = -45; + glFogf(GL_FOG_START, camr*0.2f); + glFogf(GL_FOG_END, camr*1.25f); + } + } + else if (event.key.keysym.sym == SDLK_RIGHT) + { + slideShow.nextSlide(); + } + else if (event.key.keysym.sym == SDLK_LEFT) + { + slideShow.prevSlide(); + } + break; + + case SDL_MOUSEBUTTONDOWN: + if (event.button.button == SDL_BUTTON_RIGHT) + { + if (!mouseOverMenu) + { + // Rotate view + rotate = true; + movedDuringRotate = false; + origx = mx; + origy = my; + origrx = rx; + origry = ry; + } + } + else if (event.button.button == SDL_BUTTON_WHEELUP) + { + if (mouseOverMenu) + mscroll--; + else + scrollZoom -= 1.0f; + } + else if (event.button.button == SDL_BUTTON_WHEELDOWN) + { + if (mouseOverMenu) + mscroll++; + else + scrollZoom += 1.0f; + } + break; + + case SDL_MOUSEBUTTONUP: + // Handle mouse clicks here. + if (event.button.button == SDL_BUTTON_RIGHT) + { + rotate = false; + if (!mouseOverMenu) + { + if (!movedDuringRotate) + { + processHitTest = true; + processHitTestShift = true; + } + } + } + else if (event.button.button == SDL_BUTTON_LEFT) + { + if (!mouseOverMenu) + { + processHitTest = true; + processHitTestShift = (SDL_GetModState() & KMOD_SHIFT) ? true : false; + } + } + + break; + + case SDL_MOUSEMOTION: + mx = event.motion.x; + my = height-1 - event.motion.y; + if (rotate) + { + int dx = mx - origx; + int dy = my - origy; + rx = origrx - dy*0.25f; + ry = origry + dx*0.25f; + if (dx*dx+dy*dy > 3*3) + movedDuringRotate = true; + } + break; + + case SDL_QUIT: + done = true; + break; + + default: + break; + } + } + + unsigned char mbut = 0; + if (SDL_GetMouseState(0,0) & SDL_BUTTON_LMASK) + mbut |= IMGUI_MBUT_LEFT; + if (SDL_GetMouseState(0,0) & SDL_BUTTON_RMASK) + mbut |= IMGUI_MBUT_RIGHT; + + Uint32 time = SDL_GetTicks(); + float dt = (time - lastTime) / 1000.0f; + lastTime = time; + + t += dt; + + + // Hit test mesh. + if (processHitTest && geom && sample) + { + float t; + TimeVal t0 = getPerfTime(); + bool hit = geom->raycastMesh(rays, raye, t); + TimeVal t1 = getPerfTime(); + + printf("raycast() %.4fms\n", getPerfDeltaTimeUsec(t0,t1)/1000.0f); + + if (hit) + { + if (SDL_GetModState() & KMOD_CTRL) + { + // Marker + mposSet = true; + mpos[0] = rays[0] + (raye[0] - rays[0])*t; + mpos[1] = rays[1] + (raye[1] - rays[1])*t; + mpos[2] = rays[2] + (raye[2] - rays[2])*t; + } + else + { + float pos[3]; + pos[0] = rays[0] + (raye[0] - rays[0])*t; + pos[1] = rays[1] + (raye[1] - rays[1])*t; + pos[2] = rays[2] + (raye[2] - rays[2])*t; + sample->handleClick(rays, pos, processHitTestShift); + } + } + else + { + if (SDL_GetModState() & KMOD_CTRL) + { + // Marker + mposSet = false; + } + } + } + + // Update sample simulation. + const float SIM_RATE = 20; + const float DELTA_TIME = 1.0f/SIM_RATE; + timeAcc = rcClamp(timeAcc+dt, -1.0f, 1.0f); + int simIter = 0; + while (timeAcc > DELTA_TIME) + { + timeAcc -= DELTA_TIME; + if (simIter < 5) + { + if (sample) + sample->handleUpdate(DELTA_TIME); + } + simIter++; + } + + // Update and render + glViewport(0, 0, width, height); + glClearColor(0.3f, 0.3f, 0.32f, 1.0f); + glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT); + glEnable(GL_BLEND); + glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + glDisable(GL_TEXTURE_2D); + + // Render 3d + glEnable(GL_DEPTH_TEST); + glMatrixMode(GL_PROJECTION); + glLoadIdentity(); + gluPerspective(50.0f, (float)width/(float)height, 1.0f, camr); + glMatrixMode(GL_MODELVIEW); + glLoadIdentity(); + glRotatef(rx,1,0,0); + glRotatef(ry,0,1,0); + glTranslatef(-camx, -camy, -camz); + + // Get hit ray position and direction. + GLdouble proj[16]; + GLdouble model[16]; + GLint view[4]; + glGetDoublev(GL_PROJECTION_MATRIX, proj); + glGetDoublev(GL_MODELVIEW_MATRIX, model); + glGetIntegerv(GL_VIEWPORT, view); + GLdouble x, y, z; + gluUnProject(mx, my, 0.0f, model, proj, view, &x, &y, &z); + rays[0] = (float)x; rays[1] = (float)y; rays[2] = (float)z; + gluUnProject(mx, my, 1.0f, model, proj, view, &x, &y, &z); + raye[0] = (float)x; raye[1] = (float)y; raye[2] = (float)z; + + // Handle keyboard movement. + Uint8* keystate = SDL_GetKeyState(NULL); + moveW = rcClamp(moveW + dt * 4 * (keystate[SDLK_w] ? 1 : -1), 0.0f, 1.0f); + moveS = rcClamp(moveS + dt * 4 * (keystate[SDLK_s] ? 1 : -1), 0.0f, 1.0f); + moveA = rcClamp(moveA + dt * 4 * (keystate[SDLK_a] ? 1 : -1), 0.0f, 1.0f); + moveD = rcClamp(moveD + dt * 4 * (keystate[SDLK_d] ? 1 : -1), 0.0f, 1.0f); + + float keybSpeed = 22.0f; + if (SDL_GetModState() & KMOD_SHIFT) + keybSpeed *= 4.0f; + + float movex = (moveD - moveA) * keybSpeed * dt; + float movey = (moveS - moveW) * keybSpeed * dt; + + movey += scrollZoom * 2.0f; + scrollZoom = 0; + + camx += movex * (float)model[0]; + camy += movex * (float)model[4]; + camz += movex * (float)model[8]; + + camx += movey * (float)model[2]; + camy += movey * (float)model[6]; + camz += movey * (float)model[10]; + + glEnable(GL_FOG); + + if (sample) + sample->handleRender(); + if (test) + test->handleRender(); + + glDisable(GL_FOG); + + // Render GUI + glDisable(GL_DEPTH_TEST); + glMatrixMode(GL_PROJECTION); + glLoadIdentity(); + gluOrtho2D(0, width, 0, height); + glMatrixMode(GL_MODELVIEW); + glLoadIdentity(); + + mouseOverMenu = false; + + imguiBeginFrame(mx,my,mbut,mscroll); + + if (sample) + { + sample->handleRenderOverlay((double*)proj, (double*)model, (int*)view); + } + if (test) + { + if (test->handleRenderOverlay((double*)proj, (double*)model, (int*)view)) + mouseOverMenu = true; + } + + // Help text. + if (showMenu) + { + const char msg[] = "W/S/A/D: Move RMB: Rotate LMB+SHIFT: Place Start LMB: Place End"; + imguiDrawText(width/2, height-20, IMGUI_ALIGN_CENTER, msg, imguiRGBA(255,255,255,128)); + } + + if (showMenu) + { + int propDiv = showDebugMode ? (int)(height*0.6f) : height; + + if (imguiBeginScrollArea("Properties", + width-250-10, 10+height-propDiv, 250, propDiv-20, &propScroll)) + mouseOverMenu = true; + + if (imguiCheck("Show Log", showLog)) + showLog = !showLog; + if (imguiCheck("Show Tools", showTools)) + showTools = !showTools; + if (imguiCheck("Show Debug Mode", showDebugMode)) + showDebugMode = !showDebugMode; + + imguiSeparator(); + imguiLabel("Sample"); + if (imguiButton(sampleName)) + { + if (showSample) + { + showSample = false; + } + else + { + showMaps = false; + showSample = true; + showLevels = false; + showTestCases = false; + } + } + + imguiSeparator(); + imguiLabel("Map"); + if (imguiButton(mapName, strncmp(sampleName, "Choose Sample...", 16))) + { + if (showMaps) + { + showMaps = false; + } + else + { + showMaps = true; + showSample = false; + showTestCases = false; + showLevels = false; + scanDirectory("Meshes", ".map", maps); + } + } + + imguiSeparator(); + imguiLabel("Tile"); + if (imguiButton(meshName, strncmp(mapName, "Choose Map...", 13))) + { + if (showLevels) + { + showLevels = false; + } + else + { + showMaps = false; + showSample = false; + showTestCases = false; + showLevels = true; + scanDirectory("Meshes", ".mesh", files); + } + } + if (geom) + { + char text[64]; + snprintf(text, 64, "Verts: %.1fk Tris: %.1fk", + geom->getMesh()->getVertCount()/1000.0f, + geom->getMesh()->getTriCount()/1000.0f); + imguiValue(text); + } + imguiSeparator(); + + if (geom && sample) + { + sample->handleSettings(); + + if (imguiButton("Build")) + { + ctx.resetLog(); + if (!sample->handleBuild()) + { + showLog = true; + logScroll = 0; + } + ctx.dumpLog("Build log %s:", meshName); + + // Clear test. + delete test; + test = 0; + } + + imguiSeparator(); + } + + imguiEndScrollArea(); + + if (showDebugMode) + { + if (imguiBeginScrollArea("Debug Mode", + width-250-10, 10, + 250, height-propDiv-10, &debugScroll)) + mouseOverMenu = true; + + if (sample) + sample->handleDebugMode(); + + imguiEndScrollArea(); + } + } + + // Sample selection dialog. + if (showSample) + { + static int levelScroll = 0; + if (imguiBeginScrollArea("Choose Sample", width-10-250-10-200, height-10-250, 200, 250, &levelScroll)) + mouseOverMenu = true; + + Sample* newSample = 0; + for (int i = 0; i < g_nsamples; ++i) + { + if (imguiItem(g_samples[i].name)) + { + newSample = g_samples[i].create(); + if (newSample) + strcpy(sampleName, g_samples[i].name); + } + } + if (newSample) + { + delete sample; + sample = newSample; + sample->setContext(&ctx); + if (geom && sample) + { + sample->handleMeshChanged(geom); + } + showSample = false; + } + + if (geom || sample) + { + const float* bmin = 0; + const float* bmax = 0; + if (sample) + { + bmin = sample->getBoundsMin(); + bmax = sample->getBoundsMax(); + } + else if (geom) + { + bmin = geom->getMeshBoundsMin(); + bmax = geom->getMeshBoundsMax(); + } + // Reset camera and fog to match the mesh bounds. + if (bmin && bmax) + { + camr = sqrtf(rcSqr(bmax[0]-bmin[0]) + + rcSqr(bmax[1]-bmin[1]) + + rcSqr(bmax[2]-bmin[2])) / 2; + camx = (bmax[0] + bmin[0]) / 2 + camr; + camy = (bmax[1] + bmin[1]) / 2 + camr; + camz = (bmax[2] + bmin[2]) / 2 + camr; + camr *= 3; + } + rx = 45; + ry = -45; + glFogf(GL_FOG_START, camr*0.2f); + glFogf(GL_FOG_END, camr*1.25f); + } + + imguiEndScrollArea(); + } + + // map selection dialog + if (showMaps) + { + static int scrolPos = 0; + if (imguiBeginScrollArea("Choose Map", width-10-250-10-200, height-10-450, 200, 450, &scrolPos)) + mouseOverMenu = true; + + int selectedMap = -1; + for (int i = 0; i < maps.size; ++i) + if (imguiItem(maps.files[i])) + selectedMap = i; + + if (selectedMap != -1) + { + strncpy(mapName, maps.files[selectedMap], sizeof(mapName)); + mapName[sizeof(mapName)-1] = '\0'; + showMaps = false; + + delete geom; + geom = NULL; + + if (sample) + sample->setMeshName(meshName); + } + } + + // Level selection dialog. + if (showLevels) + { + static int levelScroll = 0; + if (imguiBeginScrollArea("Choose Tile", width-10-250-10-200, height-10-450, 200, 450, &levelScroll)) + mouseOverMenu = true; + + int levelToLoad = -1; + for (int i = 0; i < files.size; ++i) + { + if (!strncmp(mapName, files.files[i], 3)) + { + if (imguiItem(files.files[i])) + levelToLoad = i; + } + } + + if (levelToLoad != -1) + { + strncpy(meshName, files.files[levelToLoad], sizeof(meshName)); + meshName[sizeof(meshName)-1] = '\0'; + showLevels = false; + + delete geom; + geom = 0; + + char path[256]; + strcpy(path, "Meshes/"); + strcat(path, meshName); + + geom = new InputGeom; + if (!geom || !geom->loadMesh(&ctx, path)) + { + delete geom; + geom = 0; + + showLog = true; + logScroll = 0; + ctx.dumpLog("Geom load log %s:", meshName); + } + if (sample && geom) + { + sample->handleMeshChanged(geom); + sample->setMeshName(meshName); + } + + if (geom || sample) + { + const float* bmin = 0; + const float* bmax = 0; + if (sample) + { + bmin = sample->getBoundsMin(); + bmax = sample->getBoundsMax(); + } + else if (geom) + { + bmin = geom->getMeshBoundsMin(); + bmax = geom->getMeshBoundsMax(); + } + // Reset camera and fog to match the mesh bounds. + if (bmin && bmax) + { + camr = sqrtf(rcSqr(bmax[0]-bmin[0]) + + rcSqr(bmax[1]-bmin[1]) + + rcSqr(bmax[2]-bmin[2])) / 2; + camx = (bmax[0] + bmin[0]) / 2 + camr; + camy = (bmax[1] + bmin[1]) / 2 + camr; + camz = (bmax[2] + bmin[2]) / 2 + camr; + camr *= 3; + } + rx = 45; + ry = -45; + glFogf(GL_FOG_START, camr*0.2f); + glFogf(GL_FOG_END, camr*1.25f); + } + } + + imguiEndScrollArea(); + + } + + // Test cases + if (showTestCases) + { + static int testScroll = 0; + if (imguiBeginScrollArea("Choose Test To Run", width-10-250-10-200, height-10-450, 200, 450, &testScroll)) + mouseOverMenu = true; + + int testToLoad = -1; + for (int i = 0; i < files.size; ++i) + { + if (imguiItem(files.files[i])) + testToLoad = i; + } + + if (testToLoad != -1) + { + char path[256]; + strcpy(path, "Tests/"); + strcat(path, files.files[testToLoad]); + test = new TestCase; + if (test) + { + // Load the test. + if (!test->load(path)) + { + delete test; + test = 0; + } + + // Create sample + Sample* newSample = 0; + for (int i = 0; i < g_nsamples; ++i) + { + if (strcmp(g_samples[i].name, test->getSampleName()) == 0) + { + newSample = g_samples[i].create(); + if (newSample) strcpy(sampleName, g_samples[i].name); + } + } + if (newSample) + { + delete sample; + sample = newSample; + sample->setContext(&ctx); + showSample = false; + } + + // Load geom. + strcpy(meshName, test->getGeomFileName()); + meshName[sizeof(meshName)-1] = '\0'; + + delete geom; + geom = 0; + + strcpy(path, "Meshes/"); + strcat(path, meshName); + + geom = new InputGeom; + if (!geom || !geom->loadMesh(&ctx, path)) + { + delete geom; + geom = 0; + + showLog = true; + logScroll = 0; + ctx.dumpLog("Geom load log %s:", meshName); + } + if (sample && geom) + { + sample->handleMeshChanged(geom); + } + + ctx.resetLog(); + if (sample && !sample->handleBuild()) + { + ctx.dumpLog("Build log %s:", meshName); + } + + if (geom || sample) + { + const float* bmin = 0; + const float* bmax = 0; + if (sample) + { + bmin = sample->getBoundsMin(); + bmax = sample->getBoundsMax(); + } + else if (geom) + { + bmin = geom->getMeshBoundsMin(); + bmax = geom->getMeshBoundsMax(); + } + // Reset camera and fog to match the mesh bounds. + if (bmin && bmax) + { + camr = sqrtf(rcSqr(bmax[0]-bmin[0]) + + rcSqr(bmax[1]-bmin[1]) + + rcSqr(bmax[2]-bmin[2])) / 2; + camx = (bmax[0] + bmin[0]) / 2 + camr; + camy = (bmax[1] + bmin[1]) / 2 + camr; + camz = (bmax[2] + bmin[2]) / 2 + camr; + camr *= 3; + } + rx = 45; + ry = -45; + glFogf(GL_FOG_START, camr*0.2f); + glFogf(GL_FOG_END, camr*1.25f); + } + + // Do the tests. + if (sample) + test->doTests(sample->getNavMesh(), sample->getNavMeshQuery()); + } + } + + imguiEndScrollArea(); + } + + + // Log + if (showLog && showMenu) + { + if (imguiBeginScrollArea("Log", 10, 10, width - 300, 200, &logScroll)) + mouseOverMenu = true; + for (int i = 0; i < ctx.getLogCount(); ++i) + imguiLabel(ctx.getLogText(i)); + imguiEndScrollArea(); + } + + // Tools + if (!showTestCases && showTools && showMenu && geom && sample) + { + if (imguiBeginScrollArea("Tools", 10, height - 10 - 350, 250, 350, &toolsScroll)) + mouseOverMenu = true; + + sample->handleTools(); + + imguiEndScrollArea(); + } + + slideShow.updateAndDraw(dt, (float)width, (float)height); + + // Marker + if (mposSet && gluProject((GLdouble)mpos[0], (GLdouble)mpos[1], (GLdouble)mpos[2], + model, proj, view, &x, &y, &z)) + { + // Draw marker circle + glLineWidth(5.0f); + glColor4ub(240,220,0,196); + glBegin(GL_LINE_LOOP); + const float r = 25.0f; + for (int i = 0; i < 20; ++i) + { + const float a = (float)i / 20.0f * RC_PI*2; + const float fx = (float)x + cosf(a)*r; + const float fy = (float)y + sinf(a)*r; + glVertex2f(fx,fy); + } + glEnd(); + glLineWidth(1.0f); + } + + imguiEndFrame(); + imguiRenderGLDraw(); + + glEnable(GL_DEPTH_TEST); + SDL_GL_SwapBuffers(); + } + + imguiRenderGLDestroy(); + + SDL_Quit(); + + delete sample; + delete geom; + + return 0; +} diff --git a/dep/recastnavigation/TODO.txt b/dep/recastnavigation/TODO.txt new file mode 100644 index 000000000..b911c0e47 --- /dev/null +++ b/dep/recastnavigation/TODO.txt @@ -0,0 +1,20 @@ +TODO/Roadmap + +Summer/Autumn 2009 + +- Off mesh links (jump links) +- Area annotations +- Embed extra data per polygon +- Height conforming navmesh + + +Autumn/Winter 2009/2010 + +- Detour path following +- More dynamic example with tile navmesh +- Faster small tile process + + +More info at http://digestingduck.blogspot.com/2009/07/recast-and-detour-roadmap.html + +- diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index a845060f4..6aaa0c18b 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "11901" + #define REVISION_NR "11902" #endif // __REVISION_NR_H__