243 Commits

Author SHA1 Message Date
Graham Pentheny
0d1cbd3d67 Don't explicitly create a GL context since SDL_CreateWindowAndRenderer does it internally.
Having two GL contexts causes rendering problems on Ubuntu.  Fixes #521
2022-10-25 23:18:11 -04:00
Prin_E
5a870d427e Fixed RecastDemo crash in macOS 10.11+
* Set hints to always use OpenGL render driver (instead of Metal driver)
* Compile error fix in Xcode 13
2022-03-20 15:33:19 -04:00
Kyeongho Park
24230e8e8d
Bugfix/chunkytrimesh subdivide maxnodes (#451)
* minor redundant: dir

* bugfix: ChunkyTriMesh nodes array: out of bounds
2020-11-17 11:46:52 +01:00
Jakob Botsch Nielsen
8db2f62d7a Fix compiler error due to memset on type with non-trivial constructors
Fix #446
2020-10-30 11:31:53 +01:00
Jarrett
56dbf4c482 Allow 64 bit windows builds (#301) 2018-10-16 00:02:51 +02:00
Zeno Ahn
9f9efe943e Removed unnecessary comment 2018-09-02 15:03:41 +02:00
Jakob Botsch Nielsen
6e36a351c2 Remove unused code causing warning 2018-06-16 17:04:54 +02:00
Jakob Botsch Nielsen
5d4186046c Mark a fall-through with a comment
Fix #283
2018-01-05 13:06:06 +01:00
Aurelien Rainone
4988ecbaf0 RecastDemo: add Load & Save buttons for SoloMesh Sample, and fix warnings (#258)
* Implement saveAll loadAll for Sample_SoloMesh

 - Solo mesh sample is loaded and saved as a tiled mesh containing
   an unique tile, so as to remain compatible with tiled mesh
 - navmesh is saved to/loaded from `solo_navmesh.bin` binary file
 - add and connect the corresponding 'Save/Load' GUI elements

* Fix `implit-fallthrough` gcc warnings

On linux with gcc 7.2.0+ and all warnings treated as errors,
implicit fallthroughs in case statements are considered as errors.
If the comment just below the next `case` or `default` matches
various strings, one of which is `falls through` the fallthrough
is then considered explicit.
2018-01-05 12:38:53 +01:00
chenshungen
bda59b7c62 Fixed load .gset file error (#293) 2018-01-05 12:33:33 +01:00
Liam Mitchell
0004bf4a23 No cast in SampleInterfaces BuildContext::doStopTimer (#299)
Removed int cast because it led to loss of time data.

Fixes #289
2018-01-05 12:20:58 +01:00
aymarfisherman
7cca61dc41 Renamed all instances of 'extents' to 'halfExtents' (#279) 2017-08-20 17:05:51 +02:00
Geoyeob Kim
46654531e4 Fix 'dtRandomPointInConvexPoly()' returning a garbage value if s == 1.0f. (#271) 2017-05-15 16:26:35 +02:00
Domenico Albani
ef3ea40f7a Add more camera movement key bindings (#259)
Q/E and Page up/page down to move vertically.
Arrow keys in addition to WASD to move normally.
2017-02-06 02:09:49 +01:00
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
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
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
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
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
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
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