Patch: Move PagedGeometry and OpenSteer to top level

Programmers discuss here anything related to FreeOrion programming. Primarily for the developers to discuss.

Moderator: Committer

Message
Author
User avatar
adrian_broher
Programmer
Posts: 1156
Joined: Fri Mar 01, 2013 9:52 am
Location: Germany

Patch: Move PagedGeometry and OpenSteer to top level

#1 Post by adrian_broher »

Hello fo-devs,

I would like to propose that the Ogre PagedGeometry plugin code and the OpenSteer library should be moved out of their current location to the top level directory of the project. Also the code layout of both projects should be changed in a way that matches the upstream release code layout. This would:

* Allow easier updates of both libraries by simply dropping in a upstream release in the corresponding folder and a bit of patching.
* Separate fo code from external dependencies. It would be a bit easier to understand for contributers what is fo code and what is not.
* Put the layout of PagedGeometry and OpenSteer in line with other dependencies like log4cpp or OIS.
* In the long term make it simpler to use system libraries instead of the bundled ones (Packaging policies of Linux distributions usually don't allow bundled libraries).
Last edited by adrian_broher on Fri Mar 22, 2013 4:36 pm, edited 1 time in total.

User avatar
Geoff the Medio
Programming, Design, Admin
Posts: 13603
Joined: Wed Oct 08, 2003 1:33 am
Location: Munich

Re: Move PagedGeometry and OpenSteer to top level

#2 Post by Geoff the Medio »

For OpenSteer, I don't think it should be treated anything like an external dependency for which a system library could be used; its purpose is predicting motions of combat objects, which needs to be done consistently on the server and clients, so all versions need to use the same code. Effectively it is FO code, as it's built into the binary from specific and consistent code. Edit: even though it hasn't been updated in 2 years... /Edit

That said, I don't have any strong objections to moving the code for both to the top level, like log4cpp or OIS.

User avatar
adrian_broher
Programmer
Posts: 1156
Joined: Fri Mar 01, 2013 9:52 am
Location: Germany

Re: Move PagedGeometry and OpenSteer to top level

#3 Post by adrian_broher »

I've moved the OpenSteer and PagedGeometry libs to the top directory.

The attached patches should be applied in the order:
1) OpenSteer
2) PagedGeometry

The msvc patches are optional and untested (just a sed substitute run) and should update the msvc projects accordingly. I can't test those. Same goes for the the Xcode project files. I can't change those without Xcode.

To fix the project files the 'OpenSteer/include' and the 'PagedGeometry/include' directory needs to added to the default search path. Also the old cpp files need to be removed from the project and added from their new location.

User avatar
adrian_broher
Programmer
Posts: 1156
Joined: Fri Mar 01, 2013 9:52 am
Location: Germany

Re: Move PagedGeometry and OpenSteer to top level

#4 Post by adrian_broher »

Part 2 of the patches.

User avatar
adrian_broher
Programmer
Posts: 1156
Joined: Fri Mar 01, 2013 9:52 am
Location: Germany

Re: Patch: Move PagedGeometry and OpenSteer to top level

#5 Post by adrian_broher »

The above patches are outdated.

Attached you will find updated patches. I dropped the msvc patches because the merging those was an awful experience.

User avatar
Geoff the Medio
Programming, Design, Admin
Posts: 13603
Joined: Wed Oct 08, 2003 1:33 am
Location: Munich

Re: Patch: Move PagedGeometry and OpenSteer to top level

#6 Post by Geoff the Medio »

If you're moving files around in future, make patches as SVN diffs, not git diffs. I applied the PagedGeometry patch, and there are a bunch of files that moved, but about half aren't marked as added to the repository... It seems random which are or aren't.

Did you just move the PagedGeometry directory, or did any of its contents change?

Edit: Looks like you also subdivided the PagedGeometry stuff into source and include. This is inconsistent with the existing directory structure of the files library, and of its own internal includes, which appear to assume the .cpp and .h are in the same location.

User avatar
adrian_broher
Programmer
Posts: 1156
Joined: Fri Mar 01, 2013 9:52 am
Location: Germany

Re: Patch: Move PagedGeometry and OpenSteer to top level

#7 Post by adrian_broher »

Geoff the Medio wrote:If you're moving files around in future, make patches as SVN diffs, not git diffs. I applied the PagedGeometry patch, and there are a bunch of files that moved, but about half aren't marked as added to the repository... It seems random which are or aren't.
I wasn't aware that svn and git have various small syntax differences for added source files. I have found a solution for that that I will use in future.
Geoff the Medio wrote:Did you just move the PagedGeometry directory, or did any of its contents change? Edit: Looks like you also subdivided the PagedGeometry stuff into source and include.
I changed the code layout in a way that it reflects the upstream release package. See opening comment.
Geoff the Medio wrote:This is inconsistent with the existing directory structure of the files library, and of its own internal includes, which appear to assume the .cpp and .h are in the same location.
This is not correct. upstream separates sources and public includes the same way. Instead of Mixing the headers and sources the 'include' dir is added as Additional Include Directories as Visual Studio would call it.

User avatar
Geoff the Medio
Programming, Design, Admin
Posts: 13603
Joined: Wed Oct 08, 2003 1:33 am
Location: Munich

Re: Patch: Move PagedGeometry and OpenSteer to top level

#8 Post by Geoff the Medio »

adrian_broher wrote:upstream separates sources and public includes the same way. Instead of Mixing the headers and sources the 'include' dir is added as Additional Include Directories as Visual Studio would call it.
Hmm... OK.

I've added the latest version of the PagedGeometry code from the google code site to the FreeOrion SVN. Can you make a reduced patch that just modifies the project files / CMakeLists.txt files, and I'll delete the previously-existing code in the same commit?

Edit: Apparently I completely failed at downloading the code, and instead committed the webpage code instead.

User avatar
adrian_broher
Programmer
Posts: 1156
Joined: Fri Mar 01, 2013 9:52 am
Location: Germany

Re: Patch: Move PagedGeometry and OpenSteer to top level

#9 Post by adrian_broher »

It seems like you've added the google code listing to repository instead of the actual code?

You probably wanted this instead:

http://code.google.com/p/ogre-paged/dow ... p&can=2&q=

User avatar
Vezzra
Release Manager, Design
Posts: 6100
Joined: Wed Nov 16, 2011 12:56 pm
Location: Sol III

Re: Patch: Move PagedGeometry and OpenSteer to top level

#10 Post by Vezzra »

Assuming that this isn't some kind of urgent modification, can we put that off until after April 20th? Because it looks like I'll have to apply these changes to the Xcode project too to be able to compile, and I don't really have the time for that ATM...

User avatar
Geoff the Medio
Programming, Design, Admin
Posts: 13603
Joined: Wed Oct 08, 2003 1:33 am
Location: Munich

Re: Patch: Move PagedGeometry and OpenSteer to top level

#11 Post by Geoff the Medio »

adrian_broher wrote:It seems like you've added the google code listing to repository instead of the actual code?
Yes, I noticed.
No, I was trying to get the latest version in the repository. There's no simple download tarball like is available with the sourceforge SVN viewer, so I was attempting to download each file individually (since I didn't want to have to set up a mercurial client just to get these files).

edit: Apparently there is no way to download code directly from the mercurial google code web interface? This is rather annoying.

User avatar
adrian_broher
Programmer
Posts: 1156
Joined: Fri Mar 01, 2013 9:52 am
Location: Germany

Re: Patch: Move PagedGeometry and OpenSteer to top level

#12 Post by adrian_broher »

The attached zip contains the includes and sources from head. Fetched with `$ wget -r --no-parent -A.cpp -A.h http://ogre-paged.googlecode.com/hg/`.
Vezzra wrote:Because it looks like I'll have to apply these changes to the Xcode project too to be able to compile, and I don't really have the time for that ATM
I will take a look at updating the xcode files.

User avatar
Vezzra
Release Manager, Design
Posts: 6100
Joined: Wed Nov 16, 2011 12:56 pm
Location: Sol III

Re: Patch: Move PagedGeometry and OpenSteer to top level

#13 Post by Vezzra »

adrian_broher wrote:I will take a look at updating the xcode files.
Thx! :D

So I assume you're on OSX?

User avatar
adrian_broher
Programmer
Posts: 1156
Joined: Fri Mar 01, 2013 9:52 am
Location: Germany

Re: Patch: Move PagedGeometry and OpenSteer to top level

#14 Post by adrian_broher »

Vezzra wrote:So I assume you're on OSX?
No thanks, I use Fedora Linux. Better assume that I use a virtual machine.

User avatar
Vezzra
Release Manager, Design
Posts: 6100
Joined: Wed Nov 16, 2011 12:56 pm
Location: Sol III

Re: Patch: Move PagedGeometry and OpenSteer to top level

#15 Post by Vezzra »

adrian_broher wrote:No thanks, I use Fedora Linux. Better assume that I use a virtual machine.
Oh, I see :lol:

Too bad, another OSX dev around would've been cool...

Post Reply