Author Topic: loading scenariom, findAll and macosx  (Read 1691 times)

GeoVah

  • Guest
loading scenariom, findAll and macosx
« on: 21 September 2010, 14:01:19 »
It seems there is something different with the GLOB API under macosx.
I need to apply this patch in order to load scenario which does'nt contains loading screen:

Index: /Users/GeoVah/Dev/megaglest_clean/source/shared_lib/sources/platform/common/platform_common.cpp
===================================================================
--- /Users/GeoVah/Dev/megaglest_clean/source/shared_lib/sources/platform/common/platform_common.cpp   (revision 1015)
+++ /Users/GeoVah/Dev/megaglest_clean/source/shared_lib/sources/platform/common/platform_common.cpp   (working copy)
@@ -235,7 +235,7 @@
    glob_t globbuf;
 
    int res = glob(mypath.c_str(), 0, 0, &globbuf);
-   if(res < 0) {
+   if(res < 0 && errorOnNotFound) {
       std::stringstream msg;
       msg << "Couldn't scan directory '" << mypath << "': " << strerror(errno);
       throw runtime_error(msg.str());

Which seems not so strange to emit the error only if the argument errorOnNotFound is set to true :)

m0ellemeister

  • Guest
Re: loading scenariom, findAll and macosx
« Reply #1 on: 21 September 2010, 19:35:52 »
I ran into same trouble on FreeBSD. To work around this issue, i've copied another loading screen image to the directory where it was missing. But it's ugly to have to same loading screen for all scenarios ;-)

Tonight i'm going to apply your diff to my copy of the SVN source and will test it on my FreeBSD box.

GeoVah

  • Guest
Re: loading scenariom, findAll and macosx
« Reply #2 on: 21 September 2010, 22:16:05 »
If you have different issues, please send me a private message, i think i should have the same problem on macosx and thus i'm thinking my fix should also work with you :)
[edit : you could find a real patch here : http://fforjan.free.fr/MegaGlest/patch_1015/findAll.diff since the one in the first comment is a hack, when glob return 0 we should do nothing]
« Last Edit: 22 September 2010, 12:12:47 by GeoVah »

m0ellemeister

  • Guest
Re: loading scenariom, findAll and macosx
« Reply #3 on: 24 September 2010, 17:39:13 »
i've applied your patch to my copy of the svn code r1015 and i had no more crashes when i was trying to load a scenario wihtout a loading screen image. Great work  :thumbup:

 

anything