MCPcopy Create free account
hub / github.com/demoth/jake2 / InitFilesystem

Method InitFilesystem

qcommon/src/main/java/jake2/qcommon/filesystem/FS.java:768–804  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

766 * InitFilesystem
767 */
768 public static void InitFilesystem() {
769 Cmd.AddCommand("path", (List<String> args) -> Path_f());
770 Cmd.AddCommand("link", FS::Link_f);
771 Cmd.AddCommand("dir", FS::Dir_f);
772 Cmd.AddCommand("ls", FS::Dir_f);
773
774 // by default all saves, screenshots etc go to ~/.jake2/baseq2
775 // overridden by 'game' cvar, i.e xatrix saves to go ~/.jake2/xatrix
776 setWriteDir(Globals.BASEQ2, false);
777
778 FS.AddGameDirectory(fs_userdir, false);
779
780 //
781 // basedir <path>
782 // allows the game to run from outside the data tree
783 //
784 fs_basedir = Cvar.getInstance().Get("basedir", ".", CVAR_NOSET);
785
786 //
787 // cddir <path>
788 // Logically concatenates the cddir after the basedir for
789 // allows the game to run from outside the data tree
790 //
791
792 setCDDir();
793
794 //
795 // start up with baseq2 by default
796 //
797 AddGameDirectory(fs_basedir.string + '/' + Globals.BASEQ2, false);
798
799 // check for game override
800 fs_gamedirvar = Cvar.getInstance().Get("game", "", CVAR_LATCH | CVAR_SERVERINFO);
801
802 if (!fs_gamedirvar.string.isEmpty())
803 SetGamedir(fs_gamedirvar.string);
804 }
805
806 /**
807 * set baseq2 directory

Callers 4

setupMethod · 0.95
InitMethod · 0.95
mainMethod · 0.95
mainMethod · 0.95

Calls 8

AddCommandMethod · 0.95
Path_fMethod · 0.95
setWriteDirMethod · 0.95
AddGameDirectoryMethod · 0.95
getInstanceMethod · 0.95
setCDDirMethod · 0.95
SetGamedirMethod · 0.95
GetMethod · 0.80

Tested by 2

setupMethod · 0.76
mainMethod · 0.76