311 Commits

Author SHA1 Message Date
Jakob Botsch Nielsen
fb49ccf83a Change ground and road colors slightly (#256)
Ground color is changed back to the previous default color, and the road
color is changed to a dark shade of brown that is a bit easier to
differentiate with normal input geometry.
2017-02-04 15:19:06 +01:00
Domenico Albani
03eb2f92f3 Make RecastDemo colors more meaningful (#254)
Implement a SampleDebugDraw which will color area types meaningfully, for example
color water as blue, grass as green and so on.
2017-02-02 20:27:43 +01:00
Jonathan Adamczewski
2bc06ef314 Change initializer list to match declaration order 2017-01-12 16:58:26 +00:00
Jonathan Adamczewski
34ab687e21 Add support for heightfield filter toggles in Sample_TempObstacles 2017-01-12 16:58:26 +00:00
Jonathan Adamczewski
12e8950bac Add toggles for heightfield filtering 2017-01-12 16:58:26 +00:00
Ben Hymers
a2e16b8e6c Set warnings as errors on Linux 2017-01-12 12:07:49 +00:00
Ben Hymers
f8c8beb3cb Fix some warnings by adding error checking to Sample_TempObstacles::loadAll (#245) 2017-01-12 12:53:39 +01:00
Jakob Botsch Nielsen
1445d05838 Use std::vector in NavMeshPruneTool 2016-07-13 05:37:37 +02:00
Jakob Botsch Nielsen
5d6312ab1e Mark start poly in NavMeshPruneTool
The start poly would not be pruned if it was the only poly on the
island.

Fix #216
2016-07-13 05:37:15 +02:00
Sander van Noort
b05e45492e Fix memory leak in LinearAllocator used by Sample_TempObstacles 2016-04-03 22:39:33 +02: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
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
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
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
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
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
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
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
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
Jakob Botsch Nielsen
a31da928ba Add settings storage to geometry sets
This adds the ability for geometry sets to store build settings that can
be automatically applied when they are loaded. This should allow sharing
of .gset files to demonstrate problems with certain settings on certain
files. It also allows people to diagnose problems more easily by being
able to dump their own triangle meshes and settings and load them in the
demo, with all of its visualization options. .gset files can be created
from the current mesh and settings by pressing the 9 key, which will
generate it in the same folder as the input mesh.

Also converts more of the demo to use STL.
2016-01-17 20:31:09 +01:00
Ben Hymers
a25b018be9 Merge pull request #76 from grahamboree/warnings
Removed a smattering of compiler warnings
2016-01-14 15:28:02 +00:00
Graham Pentheny
66c6060e95 Fix a bunch of compiler warnings
* Removed some unused vars
* Fixed some signed/unsigned comparison mismatch warnings
* Cast some int's to size_t when appropriate
* Removed some redundant casts
* silenced warnings about implicit conversions that lose precision
* changed origMousePos to an array of ints to match mousePos
2016-01-10 22:41:38 -05:00
Jakob Botsch Nielsen
09080b5272 Fix time measuring on Windows
The demo relied on the build context returning accumulated times in
microseconds. On Windows this was using QueryPerformanceCounter directly
which has a higher resolution, thus returning wrong measured times. We
now report the accumulated times in microseconds on all platforms.
2016-01-10 18:43:34 +01:00
Graham Pentheny
e5f9f21b30 Removed FileList class and replaced it with std::vector<std::string> in RecastDemo 2016-01-07 18:34:18 -05:00
Graham Pentheny
512ec1fdfd Unit testing framework.
* Tests live in a "Tests" folder alongside the other components.  Inside the "Tests" folder, tests are split into folders by the component they test.  For example, the example unit test of "rcVdot" (which is implmemented in Recast/Recast.h) lives in "Tests/Recast/Tests_Recast.h".
* Uses the Catch testing framework
* One example test of "rcVdot"
* Tests are run on Travis and Appveyor after every build.  Failing unit tests will fail the build in both case.
* Added instructions on running unit tests to the readme
2016-01-06 18:22:39 -05:00
Jakob Botsch Nielsen
7230dea2e3 Ensure SDL2.dll is copied for paths with spaces
The generated VS project would fail to copy the SDL2.dll file
if the solution or Bin path contained spaces.
2016-01-05 12:08:27 +01:00
Graham Pentheny
2eb3abfb60 Updated RecastDemo to SDL2
* Renamed a bunch of variables in main.cpp to be more descriptive.
* Removed unnecessary SDLMain.h and SDLMain.m OSX objective-c class as well as the plist, strings, xib and icns files, which are not needed.
* included cstdio in imguiRenderGL since SDL2 doesn't do it for us.
* Updated premake5 script to support SDL2 and to set the debug directory, as well as copy the SDL2.dll to the target directory on Windows.
* Updated readme with more descriptive, platform-specific demo project setup instructions
* Updated appveyor build script to build vs2015 as well.
* Updated Travis build script to build SDL2 from source, because they use Ubuntu 12.04 which doesn't have the libsdl2-dev package in its repositories.
2016-01-04 18:56:51 -05:00
Rafael Stahl
15025e8519 handle the case when allocSpan fails to allocate memory. adds bool return types to rcAddSpan, rcRasterizeTriangle and rcRasterizeTriangles 2015-12-18 16:41:02 +01:00
Ben Hymers
e558e98592 Add AppVeyor and Travis CI build scripts
Build scripts download SDL, download (or build) premake5, generate projects, then build, in several configurations and platforms

Project now builds with premake5 instead of premake4 to allow VS2015 project generation
Tweaked SDL directory dependency to work better with CI
Update README
2015-12-16 01:33:18 +00:00
grahamboree
45b36f4d75 Removed redundant dtSqrt function and replaced calls to it with dtMathSqrtf 2015-01-03 16:00:00 -05:00
grahamboree
0482a3104c Fixed potential memory leak deserializing an InputGeom. 2014-12-24 15:35:36 -05:00
grahamboree
ce4c63787b Fixed a potential memory leak when reading a mesh file. 2014-12-24 15:34:01 -05:00
grahamboree
91fbf05ec3 Uninitialized pointer in TempObstacleCreationTool 2014-12-24 15:32:50 -05:00
grahamboree
42afde6273 Fixed potential memory leak when loading test case files. 2014-12-24 15:29:47 -05:00
grahamboree
35ac315b70 Fixed potential memory leak when loading font file. 2014-12-24 15:22:23 -05:00
Mikko Mononen
65b844170f More verbose explanation of tile bounding box. 2014-12-18 12:07:12 +02:00
Mikko Mononen
0d48004dfb Merge pull request #29 from hgaiser/master
Add save/load functionality for TileCache
2014-12-13 13:50:38 +02:00
Mikko Mononen
56b6e1173d Merge pull request #58 from Kromster80/CopyPasteFix
Copy paste fix
2014-12-13 13:48:43 +02:00
Kromster80
dfed678d3d Fixed copy/paste bug 2014-11-28 18:40:53 +03:00
Kromster80
96ff08a255 Removed unnecessary assignments 2014-11-27 22:41:28 +03:00
axelrodR
8816e71535 Merge branch 'master' of https://github.com/memononen/recastnavigation 2014-06-19 17:04:14 +03:00
Mikko Mononen
3cb87f2432 Merge branch 'master' of https://github.com/memononen/recastnavigation 2014-06-13 13:25:07 +03:00
Mikko Mononen
a89bb843d7 Added new method to partition heighfield
- added layer based heighfield partitioning
- the method is a bit slower than monotone partitioning, but does not
suffer from the long thin ploys
- the method partitions the heighfield into non-overlapping areas, but
does not try to resolve holes
- improved contour hole merging so that it can properly handle all
kinds of holes
- improved polygon triangulation to handle overlapping segments
- improved small and long polygon detail mesh generation
- updated samples to include all 3 partition methods and little
documentation to help to choose between them
2014-06-13 13:25:01 +03:00
axelrodR
a246038b2a Merge branch 'master' of https://github.com/memononen/recastnavigation 2014-05-27 23:30:28 +03:00