propblems with GLX_icon.png

Problems and solutions for installing or running FreeOrion, including discussion of bugs if needed before posting a bug report. For problems building from source, post in Compile.

Moderators: Oberlus, Oberlus

Post Reply
Message
Author
OlliL
Space Floater
Posts: 28
Joined: Wed Apr 08, 2009 6:04 pm

propblems with GLX_icon.png

#1 Post by OlliL » Sat Jan 09, 2010 8:43 am

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?

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

Re: propblems with GLX_icon.png

#2 Post by Geoff the Medio » Sat Jan 09, 2010 8:06 pm

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.

OlliL
Space Floater
Posts: 28
Joined: Wed Apr 08, 2009 6:04 pm

Re: propblems with GLX_icon.png

#3 Post by OlliL » Sun Jan 10, 2010 10:09 am

Ok, but this resources.cfg is not loaded in chmain.c so it is not respected when the Rendering system gets initialized.....

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

Re: propblems with GLX_icon.png

#4 Post by Geoff the Medio » Sun Jan 10, 2010 11:07 am

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

OlliL
Space Floater
Posts: 28
Joined: Wed Apr 08, 2009 6:04 pm

Re: propblems with GLX_icon.png

#5 Post by OlliL » Sun Jan 10, 2010 3:41 pm

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

OlliL
Space Floater
Posts: 28
Joined: Wed Apr 08, 2009 6:04 pm

Re: propblems with GLX_icon.png

#6 Post by OlliL » Sun Jan 10, 2010 5:03 pm

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

User avatar
OndrejR
Space Dragon
Posts: 339
Joined: Thu Oct 02, 2008 11:00 pm
Location: Slovakia

Re: propblems with GLX_icon.png

#7 Post by OndrejR » Sun Nov 28, 2010 1:15 pm

Also on linux I have same problem as is on BSD.

Post Reply