Page 1 of 1

Patch for Ogre 1.8.0

PostPosted: 21 Sep 2012, 18:54
by Smilex
Here is the patch, which should make the code Ogre 1.8.0 compatible. It's a small change, but useful.
Note that I've only tested this on my machine, which runs Gentoo Linux, amd64.
Also, the patch does remove the code that loads the OpenDungeonsEditorToolBox.layout file, because it doesn't exist, and I'm using the most recent GIT and SVN versions of OpenDungeons. Feel free to look in the file called Gui.cpp, in the source/ folder, and uncomment the line that mentions that file.

EDIT: I'm not allowed to upload the patch to the forums. I assume it's because this is my first post on these forums, so for now just copy the paste of the file found at this link http://sprunge.us/cCHB
EDIT2: Ok, I have now been approved as legit user here, but I still can't upload the patch file, so the link is the only way to get it currently.

Re: Patch for Ogre 1.8.0

PostPosted: 22 Sep 2012, 19:50
by oln
Using this would cause compilation to fail with ogre 1.7 which is still the newest in the official repos for ubuntu (untill 12.10 in 3 weeks)/fedora/openSUSE. Though I don't know how many people here that would affect, so I suppose I could merge it in.

As for the layout file, I don't think it's actually being used, so it's probably fine to comment it out.

Re: Patch for Ogre 1.8.0

PostPosted: 22 Sep 2012, 20:15
by Smilex
Ok, then I made a mistake by merging the Ogre 1.8.0 changes into the development branch, should have kept it as a separate branch and then merge it in when everyone had talked about it. I hope it won't cause problems with patches in the future, I try to keep branches pretty separate.

Re: Patch for Ogre 1.8.0

PostPosted: 22 Sep 2012, 20:25
by charlie
You should branch the revision before you merged then (so have a legacy Ogre 1.7 branch if anybody wants to maintain it).

Re: Patch for Ogre 1.8.0

PostPosted: 22 Sep 2012, 20:43
by oln
Smilex {l Wrote}:Ok, then I made a mistake by merging the Ogre 1.8.0 changes into the development branch, should have kept it as a separate branch and then merge it in when everyone had talked about it. I hope it won't cause problems with patches in the future, I try to keep branches pretty separate.

Nah, it's probably okay, it's a fast thing to fix anyhow if anyone should have issues with it.

Re: Patch for Ogre 1.8.0

PostPosted: 22 Sep 2012, 21:24
by amuzen
You can support both versions of Ogre relatively easily with preprocessor hacks:

{l Code}: {l Select All Code}
#if OGRE_VERSION_MAJOR >= 1 && OGRE_VERSION_MINOR >= 8


I guess I was lucky because I only needed to do it in one place in LoS, but I think this patch is still short enough to make it a feasible approach until users have migrated. Of course, you could alternatively tell Ubuntu users to use the Ogre PPA, but it will give you some headaches if you distribute the game through your own PPA. Integrating the patch in some form is probably a good idea regardless because at least Arch has already dropped 1.7 completely, from what I have heard.

Re: Patch for Ogre 1.8.0

PostPosted: 22 Sep 2012, 21:47
by Smilex
And how is that going to work with the name changes from 1.7.0 to 1.8.0 ?
For example Ogre::Singleton<T>::ms_Singleton is now called msSingleton.