669 Commits

Author SHA1 Message Date
Graham Pentheny
c464d91fe8 Updated some old documentation (#209) 2016-06-08 11:06:01 -04:00
Jakob Botsch Nielsen
8628710178 Take area costs into account in Dijkstra searches (#208)
findPolysAroundCircle and findPolysAroundShape were only using distances
to compute the costs. This was inconsistent with other APIs that
performed cost-based searches and accepted filters as parameters.
2016-05-24 17:54:03 +02:00
Jakob Botsch Nielsen
12569b5cf6 Append results correctly in Dijkstra searches (#205)
This changes the Dijkstra searches in findPolysAroundCircle and
findPolysAroundShape to append the results when we visit nodes in the
main loop. The algorithm guarantees that we will never visit them again
after this, so at this point we are guaranteed that we cannot find a
better path.

Previously results would be appended the first time we saw a polygon
which meant later improvements on the paths to those polygons would not
be reflected in the results.

Fix #204
2016-05-18 13:01:41 -04:00
tfabretti
16bea738b8 Fixed a links issue due to offmesh connections
When creating the tile's links, offmesh connections inside the tile were
added twice, leading to the array of links being full and not being able
to store the links computed after (portals between tiles).
2016-05-02 20:59:51 +02:00
Jakob Botsch Nielsen
36183edb55 Add upToDate param for dtTileCache::update (#203)
This changes dtTileCache::update to add an optional parameter that
indicates whether the tile cache is up to date. This is useful to
determine whether calling the function again would do anything.
2016-04-25 20:27:14 +02:00
Sander van Noort
b05e45492e Fix memory leak in LinearAllocator used by Sample_TempObstacles 2016-04-03 22:39:33 +02:00
Graham Pentheny
d7187028b2 Merge pull request #199 from grahamboree/eof_newline
Added eof newlines.
2016-03-30 14:31:25 -04:00
Graham Pentheny
95658e7b6c Added eof newlines. Fixes #198 2016-03-30 13:48:05 -04:00
Graham Pentheny
7470e62460 Merge pull request #188 from grahamboree/unit_tests
Unit tests for a good number of core Recast functions.
2016-03-29 12:35:53 -04:00
grahamboree
c9bacf3c9c Unit tests for a good number of Recast functions.
These are by no means complete coverage of the functions they test, but are at least a start.  For consistency, all floating point comparisons use Approx(), regardless of whether they need to or not.

Removed unnecessary C++11 unique_ptr stuff, now that rcHeightfield has a constructor and destructor.
2016-03-29 01:04:51 -04:00
Graham Pentheny
69895b4d7a Merge pull request #196 from grahamboree/rcHeightfield_ctor
Added Constructor and Destructor to rcHeightfield
2016-03-26 15:51:03 -04:00
grahamboree
61dbce80e9 Added Constructor and Destructor to rcHeightfield. 2016-03-20 18:42:14 -04:00
Ben Hymers
d9c6fc58ce Remove redundant double assignment 2016-03-15 08:02:28 +00:00
Ben Hymers
3eb9c808c1 Fix many cases of return values from ftell and fseek being ignored
These could lead to undefined behaviour if e.g. a negative value from ftell
was used to allocate memory.

Also store result of ftell in a long;
The result may previously have been truncated on some platforms
2016-03-15 08:02:06 +00:00
Ben Hymers
632ae709d7 Fix unused parameter warning in Contrib/stb_truetype.h 2016-03-15 07:56:57 +00:00
Ben Hymers
e344fe8295 Remove dead code in rcBuildRegions
The code is checking for an invalid region ID, after setting it to a valid value
2016-03-15 07:56:57 +00:00
Ben Hymers
3a0140c2ac Initialise dtTileCache::m_reqs on construction 2016-03-15 07:56:56 +00:00
Ben Hymers
58bd564438 Initialise BuildContext::m_messages to null pointers
Fixes warning reported by Coverity Scan
2016-03-15 07:56:56 +00:00
Ben Hymers
e4791becd5 Fix Coverity warning about odd null check in TempObstacleHilightTool
m_sample was being checked for null after being used, which looks like a
null dereference, though actually if m_sample becomes null, the tool will
be deactivated anyway. Regardless, this code looks more sensible.
2016-03-14 10:22:31 +00:00
Ben Hymers
222fa1ee6f Fix possible out of bounds array access in Detour closest point functions
These were reported by Coverity Scan. They're extremely unlikely but still
possible - if all edges of a poly are FLT_MAX or further away from the
input point, a negative index may be used to access the verts array of a
poly.

The fix is to arbitrarily pick the first edge as the closest in case all
are tied as being very far away.
2016-03-14 10:22:31 +00:00
Ben Hymers
299ed08087 Fix leaking file handles in Sample_TileMesh::loadAll after various failures
Leaks were reported by Coverity Scan
2016-03-14 10:22:31 +00:00
Ben Hymers
e1f297e4bf Fix memory leak in Contrib/stb_truetype.h, stbtt_GetGlyphBitmapSubpixel
Leak was reported by Coverity Scan

Issue reported to stb project here:
https://github.com/nothings/stb/issues/251
2016-03-14 10:22:31 +00:00
Ben Hymers
2f382134d4 Remove dead assignments to status value in findStraightPath
Add comments explaining why the return values are ignored
Clarify the status return value logic in appendVertex
2016-03-14 09:03:41 +00:00
Ben Hymers
8f16b7de2f Remove dead assignments
Credit to @rafzi in PR #93
2016-03-14 09:03:40 +00:00
Ben Hymers
c208fd332c Minor typo and style changes 2016-03-14 09:03:40 +00:00
Ben Hymers
40a88dae73 Fix blank assignments while advancing through buffer, using new dtGetThenAdvanceBufferPointer 2016-03-14 09:03:39 +00:00
Ben Hymers
d7d58b98d9 Fix ReSharper warnings: remove unused methods 2016-02-26 08:41:17 +00:00
Ben Hymers
a2730f9fdd Fix warnings; initialise all uninitialised class members 2016-02-26 08:40:53 +00:00
Graham Pentheny
511eeabe9f Merge pull request #187 from hymerman/demo-test-fix
Fix crashes and odd behaviour in RecastDemo tests
2016-02-23 12:42:56 -05:00
Ben Hymers
f44e151556 Fix crashes and odd behaviour in RecastDemo on geometry load failure
Would crash if selecting a test with geometry then a test with missing geometry
Would use the previous sample type if selecting a sample that doesn't exist in the list
Two of the test cases had an incorrect sample name
2016-02-22 22:24:48 +00:00
Graham Pentheny
cc35cd8126 Merge pull request #186 from hymerman/filelist-crash-fix
Fix Win64 when populating input file list
2016-02-22 11:23:09 -05:00
Jakob Botsch Nielsen
09afa02f4a Fail when too many nodes are requested
dtNavMeshQuery now fails initialization if too many nodes are requested
in the node pool. This could cause wrong paths and infinite loops to
happen if the node indices started overflowing dtNodeIndex or
dtNode::pidx.

Fix #178
2016-02-22 08:45:24 +00:00
Ben Hymers
7babde3103 Fix Win64 when populating input file list
As identified by @b-desconocido, _findfirst has a return type of intptr_t;
this was previously being truncated to long.

Fix #185
2016-02-20 15:46:22 +00:00
Graham Pentheny
0f8ebe285e Merge pull request #183 from hymerman/stb_truetype_upgrade
Update stb_truetype to latest version
2016-02-17 11:01:53 -05:00
Graham Pentheny
baa1a5a858 Merge pull request #184 from hymerman/slideshow-removal
Remove SlideShow, and stb_image
2016-02-17 11:00:52 -05:00
Ben Hymers
13edcb54ce Update stb_truetype to latest version 2016-02-17 13:16:59 +00:00
Ben Hymers
aac9ae6e11 Remove SlideShow, and stb_image 2016-02-17 13:14:34 +00:00
Jakob Botsch Nielsen
8378805d35 Merge pull request #180 from Janiels/more-text-and-warnings
Fix warnings and increase demo text pool size
2016-02-16 13:20:47 +01:00
Jakob Botsch Nielsen
e30a6635a2 Fix warnings and increase demo text pool size
Fix three warnings added in fc5df2c, and increase the text pool size in
the demo. This would frequently be overflowed, even just by building
with the default settings and expanding the log.
2016-02-16 10:27:18 +01:00
Ben Hymers
1f97552d02 Merge pull request #177 from hymerman/contributing-screenshots
Add note to CONTRIBUTING doc to mention screenshots and debug draw
2016-02-15 21:31:38 +00:00
Ben Hymers
5098d88ee8 Add note to CONTRIBUTING doc to mention screenshots and debug draw interface 2016-02-14 20:08:58 +00:00
Jakob Botsch Nielsen
8259fe6763 Merge pull request #176 from hymerman/contributing-doc
Add CONTRIBUTING.md
2016-02-09 18:59:00 +01:00
Ben Hymers
f0c09d7583 Add CONTRIBUTING.md
Contains a first pass of contributing guidelines and code of conduct

Fix #174
2016-02-09 17:52:55 +00:00
Ben Hymers
0a9e36d91b Merge pull request #175 from Janiels/fix-107
Add API to query polygons in batches
2016-01-27 15:18:04 +00:00
Jakob Botsch Nielsen
fc5df2c6fd Add API to query polygons in batches
This adds a version of queryPolygon that takes an interface which is
passed batches of polygons in the search area. This new API is then used
from the old queryPolygons to collect polygons, and from findNearestRef
to find the nearest poly in an arbitrarily sized area. Previously
findNearestPoly had an arbitrary poly limit of 128 which could cause it
to return potentially wrong results.

Fix #107
2016-01-25 23:25:48 +01:00
Graham Pentheny
6ee79b25a8 Merge pull request #169 from wbierman/master
Detect, log and fail in the event of an overflow of region ids in watershed partitioning
2016-01-21 13:21:03 -05:00
Bill Bierman
e49017ac63 Detect, log and fail in the event of an overflow of region ids in watershed partitioning 2016-01-21 07:07:40 -10:00
Ben Hymers
41de583d97 Merge pull request #166 from grahamboree/rule_of_three
Fixed rule of 3 violations
2016-01-21 15:20:59 +00:00
Graham Pentheny
b7a83e0afb Fixed rule of 3 violations in many places.
* Added virtual qualifier to a few destructors in subclasses.
* Removed a few empty destructors that didn't need to be explicitly defined.
* Fixed a few typos
* Removed unnecessary empty virtual destructors in some classes with parent's who derrived from a class with a virtual destructor
2016-01-20 11:57:32 -05:00
Graham Pentheny
43a3a0104a Merge pull request #165 from wbierman/master
Change if to else-if to avoid unnecessary comparison
2016-01-19 17:08:03 -05:00