Author Topic: libglest suggestion [trivial]  (Read 1355 times)

mike.rooke

  • Guest
libglest suggestion [trivial]
« on: 22 April 2008, 19:31:09 »
Hello,

If anyone is using Eclipse + subclipse or a similar IDE to develop glest, you're probably aware that it likes to put a local .svn directory in all subdirectory that are mirrored on the SVN repo.

This conflicts with how glest loads its media; in the /maps, /tilesets etc. directories, it assumes every directory except "." and ".." contain stuff, and barfs if they don't ("throw runtime_error(...)").

There are two ways to resolve this:  don't get game media from the SVN server, tell the IDE not to write these directories, or as I suggest, libglest should ignore "/.*" directories anyway.

Hence, my rather trivial change:

for win32:

Ln 183: shared_lib\sources\platform\win32\platform_util.cpp:

if(!(strcmp(".", fi.name)==0 || strcmp("..", fi.name)==0)){

to
 
if(!(('.'==fi.name[0]) || strcmp("..", fi.name)==0 )){

I tested this and it seems to work.  

for sdl:

Ln 147: shared_lib\sources\platform\sdl\platform_util.cpp:

something like:
results.push_back(begin);

to

if(begin[0]!='.') {results.push_back(begin);}

might work, though I haven't tested that.

Apologies in advance for not putting this in the right forum directory and clogging the forums with something not terribly important.  I found this useful, so I thought someone else might.

-Mike
« Last Edit: 1 January 1970, 00:00:00 by mike.rooke »

hailstone

  • GAE Team
  • Battle Machine
  • ********
  • Posts: 1,568
    • View Profile
(No subject)
« Reply #1 on: 23 April 2008, 12:53:11 »
Looks good, although, I think Linux ignores the .svn directories anyway since I have them there and Glest doesn't complain. Welcome to the forum too.
« Last Edit: 1 January 1970, 00:00:00 by hailstone »
Glest Advanced Engine - Admin/Programmer
https://sourceforge.net/projects/glestae/