Page 1 of 1

propblems with GLX_icon.png

Posted: Sat Jan 09, 2010 8:43 am
by OlliL
Hi,

I'm running freeorion 3318 on FreeBSD with Ogre3D 1.6.5.
When I try to start freeorion it dumps core with:

terminate called after throwing an instance of 'Ogre::FileNotFoundException'
what(): OGRE EXCEPTION(6:FileNotFoundException): Cannot locate resource
GLX_icon.png in resource group General or any other group. in
ResourceGroupManager::openResource at OgreResourceGroupManager.cpp (line
763)
Abort trap: 6 (core dumped)

I know this is an Ogre3D problem but why isn't freeorion delivering a GLX_icon.png and a resources.cfg + loading it?
I saw that other games using ogre3d doing this.

When I remove the GLX_icon.png loading stuff from Ogre3D then freeorion starts so I guess this can be easily fixed by just delivering this png and having a recources.cfg pointing to it?

Re: propblems with GLX_icon.png

Posted: Sat Jan 09, 2010 8:06 pm
by Geoff the Medio
There is a resources.cfg in the default/data/art/combat directory.

Why there isn't a GLX_icon.png or another resources.cfg that references it, I'm not sure, but I'd guess it's because it's not needed with OGRE 1.6.1, which the SVN version of FreeOrion was developed with.

Re: propblems with GLX_icon.png

Posted: Sun Jan 10, 2010 10:09 am
by OlliL
Ok, but this resources.cfg is not loaded in chmain.c so it is not respected when the Rendering system gets initialized.....

Re: propblems with GLX_icon.png

Posted: Sun Jan 10, 2010 11:07 am
by Geoff the Medio
OlliL wrote:Ok, but this resources.cfg is not loaded in chmain.c so it is not respected when the Rendering system gets initialized.....
And apparently it doesn't need to be present or loaded when building with OGRE 1.6.1.

Edit: Based on reading some OGRE forum topics about GLX_icon.png, the error messages about it not being present shouldn't matter, and it should be possible to run even if the file isn't present. /Edit

Re: propblems with GLX_icon.png

Posted: Sun Jan 10, 2010 3:41 pm
by OlliL
Yeah I know, I saw those posts also (did hours of googeling - believe me ;)), but with freeorion it isn't. As I already wrote in my initial post: When I remove the GLX_icon.png loading from ogre freeorion works fine. Do I place it back, freeorion dumps core. I don't know what freeorion does differently then other games, maybe it defines a harder error checking or whatever. But in freeorion's case it raises an exception and freeorion dumps core.

You see in my initial post clearly that it does matter for freeorion.....

Edit: Hm... or are you trying to say that it's my fault and up to me because I'm not using ogre 1.6.1 but 1.6.5 instead? Sorry, but the version which is in my packaging system is 1.6.5 so I'm kinda bound to that version. And it should be compatible to 1.6.1, shouldn't it?

Edit2: The loadIcon Code and the Code around the GLX_icon.png code has not changed from ogre 1.6.1 and 1.6.5

Re: propblems with GLX_icon.png

Posted: Sun Jan 10, 2010 5:03 pm
by OlliL
I've now patched freeorion myself. I've used this patch file and the resources.cfg below. I'm using the GLX_icon.png from the ogre source.

Code: Select all

--- client/human/chmain.cpp.orig    2010-01-10 17:21:20.000000000 +0100
+++ client/human/chmain.cpp    2010-01-10 17:18:12.000000000 +0100
@@ -22,6 +22,7 @@
 #include <OgreRoot.h>
 #include <OgreSceneManager.h>
 #include <OgreViewport.h>
+#include <OgreConfigFile.h>
 
 #include <boost/lexical_cast.hpp>
 #include <boost/format.hpp>
@@ -172,6 +173,24 @@
 
         root = new Root((GetRootDataDir() / "ogre_plugins.cfg").string());
 
+        Ogre::ConfigFile cf;
+        cf.load((GetRootDataDir() / "resources.cfg").file_string());
+
+        // Go through all sections & settings in the file
+        Ogre::ConfigFile::SectionIterator section_it = cf.getSectionIterator();
+        while (section_it.hasMoreElements()) {
+            Ogre::String section_name = section_it.peekNextKey();
+            Ogre::ConfigFile::SettingsMultiMap *settings = section_it.getNext();
+            for (Ogre::ConfigFile::SettingsMultiMap::iterator it = settings->begin();
+                 it != settings->end();
+                 ++it) {
+                Ogre::String type_name = it->first, path_name = it->second;
+                Ogre::ResourceGroupManager::getSingleton().addResourceLocation(
+                    (ClientUI::ArtDir() / path_name).file_string(),
+                    type_name, section_name);
+            }
+        }
+
 #if defined(OGRE_STATIC_LIB)
         cg_plugin = new Ogre::CgPlugin;
         octree_plugin = new Ogre::OctreePlugin;
 

Code: Select all

[General]
FileSystem=.

The resources.cfg gets installed to "/usr/local/share/freeorion" and GLX_icon.png gets installed to "/usr/local/share/freeorion/default/data/art".

Now freeorion loads without raising an FileNotFoundException + Core Dump

Re: propblems with GLX_icon.png

Posted: Sun Nov 28, 2010 1:15 pm
by OndrejR
Also on linux I have same problem as is on BSD.