From 2e82b2850f4f1733a929875fc9c1501313a0ee01 Mon Sep 17 00:00:00 2001 From: Josh Yelon Date: Mon, 28 Feb 2005 15:38:54 +0000 Subject: [PATCH] Fixes for Config.prc stuff --- doc/makepanda/makepanda.py | 167 ++++++++++++++++++++++++++++++++++- doc/makepanda/maketarball.py | 4 +- 2 files changed, 168 insertions(+), 3 deletions(-) diff --git a/doc/makepanda/makepanda.py b/doc/makepanda/makepanda.py index f9c766b7ee..2c40bda04c 100755 --- a/doc/makepanda/makepanda.py +++ b/doc/makepanda/makepanda.py @@ -1690,11 +1690,174 @@ ConditionalWriteFile(PREFIX+'/include/dtool_config.h',conf) ########################################################################################## # -# Copy the config file into the build +# Generate the PRC files into the ETC directory. # ########################################################################################## -CopyFile(PREFIX+'/etc/', 'doc/Config.prc') +CONFAUTOPRC=""" +########################################################### +### ### +### Panda3D Configuration File - Auto-Generated Portion ### +### ### +### Editing this file is not recommended. Most of these ### +### directives can be overriden in Config.prc ### +### ### +########################################################### + +# Define the display types that have been compiled in. Panda will +# pick one of these by going through the list in this order until one +# is found that works, unless the user specifically requests a +# particular display type with the load-display directive. + +aux-display pandadx9 +aux-display pandagl +aux-display pandadx8 +aux-display pandadx7 + +# The egg loader is handy to have available by default. This allows +# clients to load egg files. (The bam loader is built-in so bam files +# are always loadable). + +# By qualifying with the extension "egg", we indicate the egg loader +# should be made available only if you explicitly name a file with an +# .egg extension. + +load-file-type egg pandaegg + +# The following lines define some handy object types to use within the +# egg syntax. This remaps { name } into whatever egg +# syntax is given by egg-object-type-name, which makes a handy +# abbreviation for modeling packages (like Maya) to insert +# sophisticated egg syntax into the generated egg file, using a single +# object type string. + +egg-object-type-portal portal { 1 } +egg-object-type-polylight polylight { 1 } +egg-object-type-seq24 { 1 } fps { 24 } +egg-object-type-seq12 { 1 } fps { 12 } +egg-object-type-indexed indexed { 1 } + +# These are just shortcuts to define the Model and DCS flags, which +# indicate nodes that should not be flattened out of the hierarchy +# during the conversion process. DCS goes one step further and +# indicates that the node's transform is important and should be +# preserved (DCS stands for Dynamic Coordinate System). + +egg-object-type-model { 1 } +egg-object-type-dcs { 1 } + +# The following define various kinds of collision geometry. These +# mark the geometry at this level and below as invisible collision +# polygons, which can be used by Panda's collision system to detect +# collisions more optimally than regular visible polygons. + +egg-object-type-barrier { Polyset descend } +egg-object-type-sphere { Sphere descend } +egg-object-type-invsphere { InvSphere descend } +egg-object-type-tube { Tube descend } + +# As above, but these are flagged to be "intangible", so that they +# will trigger an event but not stop an object from passing through. + +egg-object-type-trigger { Polyset descend intangible } +egg-object-type-trigger-sphere { Sphere descend intangible } + +# "bubble" puts an invisible bubble around an object, but does not +# otherwise remove the geometry. + +egg-object-type-bubble { Sphere keep descend } + +# "ghost" turns off the normal collide bit that is set on visible +# geometry by default, so that if you are using visible geometry for +# collisions, this particular geometry will not be part of those +# collisions--it is ghostlike. + +egg-object-type-ghost collide-mask { 0 } + +# This module allows direct loading of formats like .flt, .mb, or .dxf + +load-file-type ptloader + +# Define a new egg object type. See the comments in _panda.prc about this. + +egg-object-type-direct-widget collide-mask { 0x80000000 } { Polyset descend } + +# Define a new cull bin that will render on top of everything else. + +cull-bin gui-popup 60 unsorted +""" + +CONFIGPRC=""" +########################################################### +### ### +### Panda3D Configuration File - User-Editable Portion ### +### ### +########################################################### + +# Uncomment one of the following lines to choose whether you should +# run using OpenGL or DirectX rendering. + +#load-display pandagl +#load-display pandadx8 + +# These control the placement and size of the default rendering window. + +win-origin 100 0 +win-size 800 600 + +# Uncomment this line if you want to run Panda fullscreen instead of +# in a window. + +fullscreen #f + +# If you don't object to running OpenGL in software leave the keyword +# "software" in the following line, otherwise remove it to force +# hardware only. + +framebuffer-mode rgba double-buffer depth multisample hardware software + +# These control the amount of output Panda gives for some various +# categories. The severity levels, in order, are "spam", "debug", +# "info", "warning", and "fatal"; the default is "info". Uncomment +# one (or define a new one for the particular category you wish to +# change) to control this output. + +notify-level warning + +# These specify where model files may be loaded from. You probably +# want to set this to a sensible path for yourself. $THIS_PRC_DIR is +# a special variable that indicates the same directory as this +# particular Config.prc file. + +model-path . +model-path $THIS_PRC_DIR/.. +sound-path . +sound-path $THIS_PRC_DIR/.. +texture-path . +texture-path $THIS_PRC_DIR/.. + +# This enable the automatic creation of a TK window when running +# Direct. + +want-directtools #f +want-tk #f + +# This enables simple networked programs to easily provide a DC file + +dc-file sample.dc + +# Enable audio using the FMod audio library by default: + +audio-library-name fmod_audio +""" + +if (sys.platform != "win32"): + CONFAUTOPRC = CONFAUTOPRC.replace("aux-display pandadx9","") + CONFAUTOPRC = CONFAUTOPRC.replace("aux-display pandadx8","") + CONFAUTOPRC = CONFAUTOPRC.replace("aux-display pandadx7","") + +ConditionalWriteFile(PREFIX + "/etc/Confauto.prc", CONFAUTOPRC) +ConditionalWriteFile(PREFIX + "/etc/Config.prc", CONFIGPRC) ########################################################################################## # diff --git a/doc/makepanda/maketarball.py b/doc/makepanda/maketarball.py index 250d7e22f7..c4f034c27a 100755 --- a/doc/makepanda/maketarball.py +++ b/doc/makepanda/maketarball.py @@ -109,8 +109,9 @@ mkdir -p $RPM_BUILD_ROOT/usr/lib/$PYTHONV/lib-dynload mkdir -p $RPM_BUILD_ROOT/etc/ld.so.conf.d mkdir -p $RPM_BUILD_ROOT/usr/bin -sed -e 's@$THIS_PRC_DIR/[.][.]@/usr/share/panda3d@' < doc/Config.prc > $RPM_BUILD_ROOT/etc/Config.prc +sed -e 's@$THIS_PRC_DIR/[.][.]@/usr/share/panda3d@' < built/etc/Config.prc > $RPM_BUILD_ROOT/etc/Config.prc +cp built/etc/Confauto.prc $RPM_BUILD_ROOT/etc/Confauto.prc cp --recursive built/lib $RPM_BUILD_ROOT/usr/lib/panda3d cp --recursive built/include $RPM_BUILD_ROOT/usr/include/panda3d cp --recursive direct $RPM_BUILD_ROOT/usr/lib/$PYTHONV/direct @@ -146,6 +147,7 @@ done rm -rf $RPM_BUILD_ROOT %files %defattr(-,root,root) +/etc/Confauto.prc /etc/Config.prc /usr/share/panda3d /etc/ld.so.conf.d/panda3d.conf