Browse Source

Move model cache to $USER_APPDATA, and enable it on linux

rdb 16 years ago
parent
commit
f723c4d8d6
2 changed files with 11 additions and 5 deletions
  1. 8 2
      makepanda/config.in
  2. 3 3
      makepanda/makepanda.py

+ 8 - 2
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.

+ 3 - 3
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)