Page 1 of 1

Linux gzdoom wad cache folder

Posted: Sun Aug 08, 2010 21:16
by GuntherDW
I didn't know what revision to put in the topic title because I've just noticed this bug.

When gzdoom is run under Linux, instead of using the home folder, it just creates the folder '~' in the current directory, and stores everything in there.

This is from the latest build I have, but this one has been in there for quite some time.
I've checked back a couple revisions (which I compiled of course), and the oldest revision I could find which has this behaviour is r736.

Code: Select all

guntherdw@lisa /GuntherDW/src/svn/gzdoom % cd build.r864/
guntherdw@lisa /GuntherDW/src/svn/gzdoom/build.r864 % find \~
~
~/.gzdoom
~/.gzdoom/cache
~/.gzdoom/cache/urban_sl.zip
~/.gzdoom/cache/urban_sl.zip/urban_sl.wad:MAP01.gzc
~/.gzdoom/cache/urban_sl.zip/urban_sl.wad:TITLEMAP.gzc
~/.gzdoom/cache/AV.WAD
~/.gzdoom/cache/AV.WAD/MAP11.gzc
~/.gzdoom/cache/viscerus.pk3
~/.gzdoom/cache/viscerus.pk3/maps%map06.wad.gzc
It's just the cache files, everything else, configs to savegames and screenshots are correctly placed into the user home folder.

It should be easy to fix this, I'll check if I can't create a patch myself.

Code: Select all

Index: src/gl/data/gl_nodes.cpp
===================================================================
--- src/gl/data/gl_nodes.cpp	(revision 866)
+++ src/gl/data/gl_nodes.cpp	(working copy)
@@ -960,6 +960,7 @@
 			unsigned int startTime, endTime;
 
 			startTime = I_FPSTime ();
+
 			TArray<FNodeBuilder::FPolyStart> polyspots, anchors;
 			P_GetPolySpots (map, polyspots, anchors);
 			FNodeBuilder::FLevel leveldata =
@@ -1025,6 +1026,7 @@
 		path += "gzdoom/cache";
 	#else
 		path = HOME_DIR"/cache";
+		path = NicePath(path);
 	#endif
 	
 	FString lumpname = Wads.GetLumpFullPath(map->lumpnum);
@@ -1034,6 +1036,7 @@
 
 	lumpname.ReplaceChars('/', '%');
 	path << '/' << lumpname.Right(lumpname.Len() - separator - 1) << ".gzc";
+	Printf("cache file : %s\n", path.GetChars());
 	return path;
 }
 
It doesn't seem to save the cache files for now, but the path now looks correct.

Re: Linux gzdoom wad cache folder

Posted: Sun Aug 08, 2010 22:16
by Gez
GuntherDW wrote:It doesn't seem to save the cache files for now, but the path now looks correct.
Uh, what do you mean by that? If it cannot save the cache files with your patch, then there's a bug in it.

Re: Linux gzdoom wad cache folder

Posted: Sun Aug 08, 2010 22:21
by GuntherDW
I've also put some printf's in the create and check folder.
It passes the checkcachednodes function, but doesn't seem to pass CreateCachedNodes.

Or at least not far enough for the Printf?

And by "correct" I mean that it tells me the path is correct (/home/guntherdw/.gzdoom/cache/...... in my case).

Re: Linux gzdoom wad cache folder

Posted: Mon Aug 09, 2010 13:53
by Gez
Well, I've nicepathed CreateCacheName. Not sure what more I can do.

Re: Linux gzdoom wad cache folder

Posted: Fri Aug 13, 2010 15:20
by Gez
No additional feedback so I'm chalking that one as being solved.

Re: Linux gzdoom wad cache folder

Posted: Fri Aug 13, 2010 15:52
by GuntherDW
Yup, it's saving it in the correct folder now.