YiMingFu / recastnavigation

Automatically exported from code.google.com/p/recastnavigation
zlib License
0 stars 0 forks source link

Linux patch #11

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
I had to hack Recast a bit to get it to work on Linux.

You can see a screenshot of Recast in action on Linux here:
http://www.ogre3d.org/forums/viewtopic.php?f=16&p=356024#p356023

I made a very simple CMake script, which you can grab off of the post I
linked to.
Should work on all platforms.

I had to fix some scoping issues - jump crosses initialization of variable
blah_blah (GCC is very picky).
I simply added some curly braces, or moved declaration of the variables to
the start of the function.
Some case sensitivity fixes.

And then a very dirty hack. ->
qsort is implemented differently on all three platforms.. :(
OSX version is BSD, and the glibc guys decided to change the parameters.
As I couldn't figure out how to convert the function call, I just defined
it out.
Should still work on the Mac.
The demo runs without it, but I am sure it blows up somewhere.. :)

I would be glad if you could apply the patch - I know a lot of people
anxious to try Recast on Linux.

Cheers
and thank you for the amazing library!

Original issue reported on code.google.com by jacmoe...@gmail.com on 12 Sep 2009 at 8:43

GoogleCodeExporter commented 8 years ago
Oops - I always forget to attach.. :P
The patch is made in Linux - if you want a TortoiseSVN variant, just yell.

Original comment by jacmoe...@gmail.com on 12 Sep 2009 at 8:44

GoogleCodeExporter commented 8 years ago
My plan is to allow switching to an Ogre3D based rendering back-end through a 
flag in
the CMake build script.
When it's ready, I'll upload my Ogre3D debug render module.
Also, the CMake build script will be updated to create libs out of Recast and 
Detour
so that the build script can be used in peoples apps easily.
I am doing this because Recast will go into a plugin for Ogitor - a scenebuilder
application for Ogre3D -> www.ogitor.org. :)

Original comment by jacmoe...@gmail.com on 12 Sep 2009 at 10:35

GoogleCodeExporter commented 8 years ago
Looks like I did some really nasty hacks in RecastDemo/Source/imguiRenderGL.cpp 
:P
I'll make an updated patch with better fixes.

Original comment by jacmoe...@gmail.com on 12 Sep 2009 at 11:32

GoogleCodeExporter commented 8 years ago
Updated patch attached. (made in Linux).

Original comment by jacmoe...@gmail.com on 12 Sep 2009 at 11:48

Attachments:

GoogleCodeExporter commented 8 years ago
Do you know what is the preferred way to check if something is compiling on 
linux (or
to check the difference between bsd and linux)? The qsort issues is really 
stupid.

I had some other person to report some linux compile fixes too. I hope to get 
them
out soon. I'll take a look at your patch too.

If you know how to implement performance timer on linux, I'd be happy to 
include that
too :)

Original comment by memono...@gmail.com on 12 Sep 2009 at 2:16

GoogleCodeExporter commented 8 years ago
High resolution timing is almost equal on the Mac and on Linux:

http://stackoverflow.com/questions/538609/high-resolution-timer-with-c-and-linux

Actually, Ogre uses pretty much that. ->
https://ogre.svn.sourceforge.net/svnroot/ogre/trunk/OgreMain/include/GLX/OgreTim
erImp.h
https://ogre.svn.sourceforge.net/svnroot/ogre/trunk/OgreMain/src/GLX/OgreTimer.c
pp

About checking for Linux compatibility, CMake helps out a great deal here:
Just generate MinGW makefiles and try it on your Windows box.
If you get one of the unofficial MinGW's (GCC 4) you should get a pretty good 
picture
of what GCC (and glibc) likes.

But, as Ogitor is going to make use of Recast, and it runs on all three 
platforms,
you can be sure we will tell you if we find any platform issues in the code. :)

Original comment by jacmoe...@gmail.com on 12 Sep 2009 at 4:04

GoogleCodeExporter commented 8 years ago
Pretty much all the problems regarding compiling on Linux should be gone now in 
the
SVN revision 61. There is no make file for Linux yet, tough.

Original comment by memono...@gmail.com on 1 Oct 2009 at 8:39