From f723c4d8d6d8c1224ca31243c183791bdb8d25d9 Mon Sep 17 00:00:00 2001 From: rdb Date: Wed, 1 Jul 2009 14:09:23 +0000 Subject: [PATCH] Move model cache to $USER_APPDATA, and enable it on linux --- makepanda/config.in | 10 ++++++++-- makepanda/makepanda.py | 6 +++--- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/makepanda/config.in b/makepanda/config.in index 22becea6d9..d6e03dab54 100755 --- a/makepanda/config.in +++ b/makepanda/config.in @@ -5,11 +5,17 @@ ########################################################### # Uncomment one of the following lines to choose whether you should -# run using OpenGL or DirectX rendering. +# run using OpenGL, DirectX or TinyPanda (software) rendering. +# There can only be one load-display line, but you can use +# multiple aux-display lines to specify fallback modules. +# When the module indicated by load-display fails, it will fall +# back to the next display module indicated by aux-display, +# when that fails, the next aux-display line, and so on. load-display pandagl #load-display pandadx9 #load-display pandadx8 +#load-display tinydisplay # These control the placement and size of the default rendering window. @@ -81,7 +87,7 @@ hardware-animated-vertices #f # Enable the model-cache, but only for models, not textures. -model-cache-dir $THIS_PRC_DIR/../modelcache +model-cache-dir $USER_APPDATA/.panda3d/cache model-cache-textures #f # This option specifies the default profiles for Cg shaders. diff --git a/makepanda/makepanda.py b/makepanda/makepanda.py index cd1ebeb5b2..c5e7ed0c6c 100755 --- a/makepanda/makepanda.py +++ b/makepanda/makepanda.py @@ -1120,10 +1120,11 @@ if (os.path.isfile("makepanda/myconfig.in")): else: configprc=ReadFile("makepanda/config.in") -if (sys.platform != "win32"): +if (sys.platform == "win32"): + confautoprc = confautoprc.replace(".panda3d","Panda3D-%s" % VERSION) +else: confautoprc = confautoprc.replace("aux-display pandadx9","") confautoprc = confautoprc.replace("aux-display pandadx8","") - confautoprc = confautoprc.replace("aux-display pandadx7","") # OpenAL is not yet working well on OSX for us, so let's do this for now. if (sys.platform == "darwin"): @@ -3817,7 +3818,6 @@ def MakeInstallerOSX(): oscmd("mkdir -p Panda3D-tpl-rw/Panda3D/%s/lib/direct" % VERSION) oscmd("ln -s /usr/bin/python Panda3D-tpl-rw/Panda3D/%s/bin/ppython" % VERSION) oscmd("sed -e 's@\\$1@%s@' < direct/src/directscripts/profilepaths-osx.command >> Panda3D-tpl-rw/panda3dpaths.command" % VERSION) - oscmd("sed -e 's@model-cache-@# model-cache-@' -e 's@$THIS_PRC_DIR/[.][.]@/Applications/Panda3D/%s@' < %s/etc/Config.prc > Panda3D-tpl-rw/Panda3D/%s/etc/Config.prc" % (VERSION, GetOutputDir(), VERSION)) # Append the plugin-path to the Config.prc. f = open("Panda3D-tpl-rw/Panda3D/%s/etc/Config.prc" % VERSION, "a") f.write("\nplugin-path /Applications/Panda3D/%s/lib\n" % VERSION)