mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-03 02:15:43 -04:00
rename Configrc to Config.prc
This commit is contained in:
parent
2522d77d95
commit
ae9ef03e9b
@ -1,5 +1,5 @@
|
|||||||
#define INSTALL_CONFIG \
|
#define INSTALL_CONFIG \
|
||||||
Configrc.direct
|
_direct.prc
|
||||||
|
|
||||||
#if $[CTPROJS]
|
#if $[CTPROJS]
|
||||||
// These files only matter to ctattach users.
|
// These files only matter to ctattach users.
|
||||||
|
@ -1,6 +1,10 @@
|
|||||||
model-path $DMODELS
|
model-path $DMODELS
|
||||||
sound-path $DMODELS
|
sound-path $DMODELS
|
||||||
|
|
||||||
|
# Define a new egg object type. See the comments in _panda.prc about this.
|
||||||
|
|
||||||
egg-object-type-direct-widget <Scalar> collide-mask { 0x80000000 } <Collide> { Polyset descend }
|
egg-object-type-direct-widget <Scalar> collide-mask { 0x80000000 } <Collide> { Polyset descend }
|
||||||
|
|
||||||
|
# Define a new cull bin that will render on top of everything else.
|
||||||
|
|
||||||
cull-bin gui-popup 60 unsorted
|
cull-bin gui-popup 60 unsorted
|
@ -73,7 +73,7 @@ clear() {
|
|||||||
// Function: DCFile::read_all
|
// Function: DCFile::read_all
|
||||||
// Access: Published
|
// Access: Published
|
||||||
// Description: This special method reads all of the .dc files named
|
// Description: This special method reads all of the .dc files named
|
||||||
// by the "dc-file" Configrc variable, and loads them
|
// by the "dc-file" config.prc variable, and loads them
|
||||||
// into the DCFile namespace.
|
// into the DCFile namespace.
|
||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
bool DCFile::
|
bool DCFile::
|
||||||
@ -82,7 +82,7 @@ read_all() {
|
|||||||
config_express.GetAll("dc-file", dc_files);
|
config_express.GetAll("dc-file", dc_files);
|
||||||
|
|
||||||
if (dc_files.empty()) {
|
if (dc_files.empty()) {
|
||||||
cerr << "No files specified via dc-file Configrc variable!\n";
|
cerr << "No files specified via dc-file Config.prc variable!\n";
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -269,9 +269,9 @@ class ShowBase(DirectObject.DirectObject):
|
|||||||
import Transitions
|
import Transitions
|
||||||
self.transitions = Transitions.Transitions(self.loader)
|
self.transitions = Transitions.Transitions(self.loader)
|
||||||
|
|
||||||
# Start Tk and DIRECT if specified by Configrc
|
# Start Tk and DIRECT if specified by Config.prc
|
||||||
fTk = self.config.GetBool('want-tk', 0)
|
fTk = self.config.GetBool('want-tk', 0)
|
||||||
# Start DIRECT if specified in Configrc or in cluster mode
|
# Start DIRECT if specified in Config.prc or in cluster mode
|
||||||
fDirect = (self.config.GetBool('want-directtools', 0) or
|
fDirect = (self.config.GetBool('want-directtools', 0) or
|
||||||
(base.config.GetString("cluster-mode", '') != ''))
|
(base.config.GetString("cluster-mode", '') != ''))
|
||||||
# Set fWantTk to 0 to avoid starting Tk with this call
|
# Set fWantTk to 0 to avoid starting Tk with this call
|
||||||
@ -324,7 +324,11 @@ class ShowBase(DirectObject.DirectObject):
|
|||||||
selection.printPipeTypes()
|
selection.printPipeTypes()
|
||||||
self.pipe = selection.makeDefaultPipe()
|
self.pipe = selection.makeDefaultPipe()
|
||||||
if not self.pipe:
|
if not self.pipe:
|
||||||
self.notify.error("No graphics pipe is available! Check your Configrc!")
|
self.notify.error(
|
||||||
|
"No graphics pipe is available!\n"
|
||||||
|
"Your Config.prc file must name at least one valid panda display\n"
|
||||||
|
"library via load-display or aux-display.")
|
||||||
|
|
||||||
self.notify.info("Default graphics pipe is %s (%s)." % (self.pipe.getInterfaceName(), self.pipe.getType().getName()))
|
self.notify.info("Default graphics pipe is %s (%s)." % (self.pipe.getInterfaceName(), self.pipe.getType().getName()))
|
||||||
self.pipeList.append(self.pipe)
|
self.pipeList.append(self.pipe)
|
||||||
|
|
||||||
@ -939,7 +943,7 @@ class ShowBase(DirectObject.DirectObject):
|
|||||||
return Task.cont
|
return Task.cont
|
||||||
|
|
||||||
def createStats(self):
|
def createStats(self):
|
||||||
# You must specify a pstats-host in your configrc
|
# You must specify a pstats-host in your Config.prc
|
||||||
# The default is localhost
|
# The default is localhost
|
||||||
if self.wantStats:
|
if self.wantStats:
|
||||||
PStatClient.connect()
|
PStatClient.connect()
|
||||||
|
97
doc/INSTALL
97
doc/INSTALL
@ -432,9 +432,6 @@ After installing panda, you are almost ready to run the program
|
|||||||
"pview," which is a basic model viewer program that demonstrates some
|
"pview," which is a basic model viewer program that demonstrates some
|
||||||
Panda functionality. Successfully running pview proves that Panda is
|
Panda functionality. Successfully running pview proves that Panda is
|
||||||
installed and configured correctly (at least as a C++ library).
|
installed and configured correctly (at least as a C++ library).
|
||||||
However, you must set up a Configrc file to set your runtime
|
|
||||||
configuration options before you can run Panda and open up a graphics
|
|
||||||
window. See HOW TO RUN PANDA, below.
|
|
||||||
|
|
||||||
If you wish, you may also build direct. You only need to build this
|
If you wish, you may also build direct. You only need to build this
|
||||||
if you intend to use the Python interfaces.
|
if you intend to use the Python interfaces.
|
||||||
@ -631,9 +628,6 @@ After installing panda, you are almost ready to run the program
|
|||||||
"pview," which is a basic model viewer program that demonstrates some
|
"pview," which is a basic model viewer program that demonstrates some
|
||||||
Panda functionality. Successfully running pview proves that Panda is
|
Panda functionality. Successfully running pview proves that Panda is
|
||||||
now installed and configured correctly (at least as a C++ library).
|
now installed and configured correctly (at least as a C++ library).
|
||||||
However, you must set up a Configrc file to set your runtime
|
|
||||||
configuration options before you can run Panda and open up a graphics
|
|
||||||
window. See HOW TO RUN PANDA, below.
|
|
||||||
|
|
||||||
If you wish, you may also build direct. You only need to build this
|
If you wish, you may also build direct. You only need to build this
|
||||||
if you intend to use the Python interfaces.
|
if you intend to use the Python interfaces.
|
||||||
@ -664,68 +658,67 @@ to type rehash first if you use csh):
|
|||||||
|
|
||||||
pview
|
pview
|
||||||
|
|
||||||
The first time you run pview, if you have not yet created a Configrc
|
If you get an error about some shared library or libraries not being
|
||||||
file, you should see something like this:
|
found, check that your LD_LIBRARY_PATH setting (on Unix) or your PATH
|
||||||
|
(on Windows) includes the directory in which all of the Panda
|
||||||
Known pipe types:
|
|
||||||
No interactive pipe is available! Check your Configrc!
|
|
||||||
|
|
||||||
If you get instead an error about some shared library or libraries not
|
|
||||||
being found, check that your LD_LIBRARY_PATH setting (on Unix) or your
|
|
||||||
PATH (on Windows) includes the directory in which all of the Panda
|
|
||||||
libraries have been installed. (This is normally $INSTALL_DIR/lib, or
|
libraries have been installed. (This is normally $INSTALL_DIR/lib, or
|
||||||
whatever you set INSTALL_DIR to followed by "lib". On Unix, this
|
whatever you set INSTALL_DIR to followed by "lib". On Unix, this
|
||||||
defaults to /usr/local/panda/lib. If you have redefined
|
defaults to /usr/local/panda/lib. If you have redefined
|
||||||
INSTALL_LIB_DIR in your Config.pp, for instance to define Panda as a
|
INSTALL_LIB_DIR in your Config.pp, for instance to define Panda as a
|
||||||
native Python module, you should use that directory instead.)
|
native Python module, you should use that directory instead.)
|
||||||
|
|
||||||
If you do get the above error message, you will need to create a
|
If all goes well, pview should open up a window with a blue triangle.
|
||||||
Configrc file to indicate some run-time parameters. This is different
|
You can use the mouse to move the triangle around. You can also pass
|
||||||
from the Config.pp file you created above, which is only used by
|
on the command line the name of an egg or bam file, if you have one
|
||||||
ppremake to define compile-time parameters; the Configrc file is read
|
(look in the models directory for some sample egg files), and pview
|
||||||
every time Panda is started and it defines parameters that control
|
will load up and display the model.
|
||||||
run-time behavior.
|
|
||||||
|
|
||||||
Create a file called Configrc in the $INSTALL_DIR/etc directory. By
|
|
||||||
convention, your custom Configrc file should not have any extension,
|
|
||||||
not even the extension ".txt"; this differentiates it from the
|
|
||||||
standard Configrc files which are also installed into the
|
|
||||||
$INSTALL_DIR/etc file (and having no extension causes your file to be
|
|
||||||
sorted to the top of the list, so that your personal settings will
|
|
||||||
override those in the other files).
|
|
||||||
|
|
||||||
For now, add just the line:
|
There are several files in the $INSTALL_DIR/etc directory with the
|
||||||
|
filename extension .prc; these are Panda Runtime Configuration files.
|
||||||
|
These are different from the Config.pp file, which controls the way
|
||||||
|
Panda is compiled and is only used at build time. The prc files are
|
||||||
|
read in every time Panda is started and control the way Panda behaves
|
||||||
|
at runtime.
|
||||||
|
|
||||||
load-display pandagl
|
The system-defined prc files begin with the underscore character, so
|
||||||
|
that they sort to the top of the list and are read first (and so that
|
||||||
|
you may define one or more additional files that are read afterwards
|
||||||
|
and that will therefore override the values specified in these system
|
||||||
|
files).
|
||||||
|
|
||||||
Or, if you are on Windows and prefer to use DirectX instead of OpenGL,
|
We suggest creating a file in $INSTALL_DIR/etc called Config.prc,
|
||||||
add instead the line:
|
where you will put your own custom configuration options. For
|
||||||
|
instance, if you want to run using OpenGL instead of the Windows
|
||||||
|
default of DirectX9, you can add the line:
|
||||||
|
|
||||||
load-display pandadx8
|
load-display pandagl
|
||||||
|
|
||||||
Later you may add additional lines here to control the default
|
to your Config.prc file. If you choose not to do this at this time,
|
||||||
behavior of Panda in other ways. See the file Configrc in this
|
you can just leave this file empty for now; we do recommend creating
|
||||||
directory for more examples.
|
at least an empty Config.prc file as a placeholder into which you can
|
||||||
|
add your custom configuration options later.
|
||||||
|
|
||||||
Now try to run pview again. If all goes well, it should open up a
|
The complete list of available configuration options is very large and
|
||||||
window with a blue triangle. You can use the mouse to move the
|
is not fully documented; but there are other documents that list
|
||||||
triangle around. You can also pass the name of an egg file, if you
|
several particularly useful config variables. These are sometimes
|
||||||
have one (look in the models directory for some sample egg files), on
|
referred to as "Configrc" variables because an older Panda convention
|
||||||
the command line, and pview will load up and display the egg file.
|
named this file Configrc instead of Config.prc.
|
||||||
|
|
||||||
If you want to load the Configrc from other than the compiled-in
|
If you want to load Config.prc from other than the compiled-in default
|
||||||
default directory, set the environment variable:
|
directory of $INSTALL_DIR/etc, set the environment variable:
|
||||||
|
|
||||||
CONFIGRC_DIR=/my/home/directory
|
PRC_DIR=/my/home/directory
|
||||||
export CONFIGRC_DIR
|
export PRC_DIR
|
||||||
|
|
||||||
Where /my/home/directory is the name of your home directory (or
|
Where /my/home/directory is the name of your home directory (or
|
||||||
wherever you put the Configrc file). Note that if you redefine
|
wherever you put the Config.prc file). Note that if you redefine
|
||||||
CONFIGRC_DIR, you will no longer automatically load the standard
|
PRC_DIR, you will no longer automatically load the standard prc files
|
||||||
Configrc files that were installed into $INSTALL_DIR/etc. It is
|
that were installed into $INSTALL_DIR/etc (so you should consider
|
||||||
possible to configure Panda to search for Configrc files in more than
|
copying these files into the same directory). It is possible to
|
||||||
one directory, but that's a little more complicated and is outside the
|
configure Panda to search for prc files in more than one directory,
|
||||||
scope of this document.
|
but that's a little more complicated and is outside the scope of this
|
||||||
|
document.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -833,7 +826,7 @@ defined appropriately once you have become root.
|
|||||||
|
|
||||||
Testing the Python interface
|
Testing the Python interface
|
||||||
|
|
||||||
Assuming that you have already set up your Configrc file and tested
|
Assuming that you have already set up your Config.prc file and tested
|
||||||
that pview works, as described above in HOW TO RUN PANDA, you should
|
that pview works, as described above in HOW TO RUN PANDA, you should
|
||||||
now be ready to try to run Panda from within Python. Start up a
|
now be ready to try to run Panda from within Python. Start up a
|
||||||
Python shell and type the following command:
|
Python shell and type the following command:
|
||||||
|
@ -104,14 +104,16 @@
|
|||||||
// #define INSTALL_LIB_DIR /usr/lib/python2.2/site-packages
|
// #define INSTALL_LIB_DIR /usr/lib/python2.2/site-packages
|
||||||
|
|
||||||
|
|
||||||
// The Configrc file is used by Panda for runtime configuration.
|
// The PRC files are used by Panda for runtime configuration. Panda
|
||||||
// Panda will load up all files named Configrc* (with any and every
|
// will load up all files named *.prc in the directory specified by
|
||||||
// extension) in the directory specified by the CONFIGRC_DIR
|
// the PRC_DIR environment variable, or in the directory named here if
|
||||||
// environment variable, or in the directory named here if that
|
// that environment variable is undefined. Config files are loaded up
|
||||||
// environment variable is undefined. By default, we specify the
|
// in alphabetical order (sorted by ASCII value), and the
|
||||||
// install/etc dir, which is where the system-provided Configrc files
|
// alphabetically last files have precedence.
|
||||||
// get copied to.
|
|
||||||
#defer DEFAULT_CONFIGRC_DIR $[INSTALL_DIR]/etc
|
// By default, we specify the install/etc dir, which is where the
|
||||||
|
// system-provided PRC files get copied to.
|
||||||
|
#defer DEFAULT_PRC_DIR $[INSTALL_DIR]/etc
|
||||||
|
|
||||||
|
|
||||||
// What level of compiler optimization/debug symbols should we build?
|
// What level of compiler optimization/debug symbols should we build?
|
||||||
@ -459,9 +461,9 @@
|
|||||||
// specify one. Define it empty not to do this, saving a few
|
// specify one. Define it empty not to do this, saving a few
|
||||||
// kilobytes on the generated library. Sorry, you can't pick a
|
// kilobytes on the generated library. Sorry, you can't pick a
|
||||||
// particular font to be the default; it's hardcoded in the source
|
// particular font to be the default; it's hardcoded in the source
|
||||||
// (although you can use the text-default-font Configrc variable to
|
// (although you can use the text-default-font prc variable to specify
|
||||||
// specify a particular font file to load as the default, overriding
|
// a particular font file to load as the default, overriding the
|
||||||
// the compiled-in font).
|
// compiled-in font).
|
||||||
#define COMPILE_IN_DEFAULT_FONT 1
|
#define COMPILE_IN_DEFAULT_FONT 1
|
||||||
|
|
||||||
// Is Maya installed? This matters only to programs in PANDATOOL.
|
// Is Maya installed? This matters only to programs in PANDATOOL.
|
||||||
|
@ -185,9 +185,9 @@ $[cdefine LINK_IN_GL]
|
|||||||
$[cdefine LINK_IN_PHYSICS]
|
$[cdefine LINK_IN_PHYSICS]
|
||||||
|
|
||||||
/* The compiled-in default directory to look for the Configrc file, in
|
/* The compiled-in default directory to look for the Configrc file, in
|
||||||
the absence of the CONFIGRC_DIR environment variable set, and in
|
the absence of the PRC_DIR environment variable set, and in
|
||||||
the absence of anything specified via the configpath directive. */
|
the absence of anything specified via the configpath directive. */
|
||||||
# define DEFAULT_CONFIGRC_DIR "$[DEFAULT_CONFIGRC_DIR]"
|
# define DEFAULT_PRC_DIR "$[DEFAULT_PRC_DIR]"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -8,7 +8,9 @@
|
|||||||
#define SOURCES \
|
#define SOURCES \
|
||||||
configTable.I configTable.h \
|
configTable.I configTable.h \
|
||||||
config_dconfig.h config_notify.h config_setup.h \
|
config_dconfig.h config_notify.h config_setup.h \
|
||||||
dconfig.I dconfig.h notify.I \
|
dconfig.I dconfig.h \
|
||||||
|
globPattern.I globPattern.h \
|
||||||
|
notify.I \
|
||||||
notify.h notifyCategory.I \
|
notify.h notifyCategory.I \
|
||||||
notifyCategory.h notifyCategoryProxy.I notifyCategoryProxy.h \
|
notifyCategory.h notifyCategoryProxy.I notifyCategoryProxy.h \
|
||||||
notifySeverity.h serialization.I serialization.h \
|
notifySeverity.h serialization.I serialization.h \
|
||||||
@ -16,12 +18,15 @@
|
|||||||
|
|
||||||
#define INCLUDED_SOURCES \
|
#define INCLUDED_SOURCES \
|
||||||
configTable.cxx config_dconfig.cxx dconfig.cxx \
|
configTable.cxx config_dconfig.cxx dconfig.cxx \
|
||||||
config_notify.cxx notify.cxx notifyCategory.cxx \
|
config_notify.cxx \
|
||||||
|
globPattern.cxx \
|
||||||
|
notify.cxx notifyCategory.cxx \
|
||||||
notifySeverity.cxx symbolEnt.cxx
|
notifySeverity.cxx symbolEnt.cxx
|
||||||
|
|
||||||
#define INSTALL_HEADERS \
|
#define INSTALL_HEADERS \
|
||||||
configTable.I configTable.h config_dconfig.h config_setup.h \
|
configTable.I configTable.h config_dconfig.h config_setup.h \
|
||||||
dconfig.I dconfig.h \
|
dconfig.I dconfig.h \
|
||||||
|
globPattern.I globPattern.h \
|
||||||
notify.I notify.h notifyCategory.I \
|
notify.I notify.h notifyCategory.I \
|
||||||
notifyCategory.h notifyCategoryProxy.I notifyCategoryProxy.h \
|
notifyCategory.h notifyCategoryProxy.I notifyCategoryProxy.h \
|
||||||
notifySeverity.h serialization.I serialization.h symbolEnt.I \
|
notifySeverity.h serialization.I serialization.h symbolEnt.I \
|
||||||
|
@ -45,11 +45,8 @@ INLINE void ConfigTable::FileSepDefault() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
INLINE void ConfigTable::ConfigNameDefault() {
|
INLINE void ConfigTable::ConfigNameDefault() {
|
||||||
configname = "Configrc";
|
configname.push_back(GlobPattern("Configrc"));
|
||||||
}
|
configname.push_back(GlobPattern("*.prc"));
|
||||||
|
|
||||||
INLINE void ConfigTable::ConfigSuffixDefault() {
|
|
||||||
configsuffix = "*";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
INLINE void ConfigTable::ConfigArgsDefault() {
|
INLINE void ConfigTable::ConfigArgsDefault() {
|
||||||
|
@ -156,7 +156,7 @@ void ConfigTable::ReadConfigFile() {
|
|||||||
|
|
||||||
size_t p = 0;
|
size_t p = 0;
|
||||||
while (p < path.length()) {
|
while (p < path.length()) {
|
||||||
size_t q = path.find_first_of(" :", p);
|
size_t q = path.find_first_of(pathsep, p);
|
||||||
if (q == string::npos) {
|
if (q == string::npos) {
|
||||||
config_search.append_directory(Filename::from_os_specific(path.substr(p)));
|
config_search.append_directory(Filename::from_os_specific(path.substr(p)));
|
||||||
break;
|
break;
|
||||||
@ -179,47 +179,37 @@ void ConfigTable::ReadConfigFile() {
|
|||||||
|
|
||||||
DSearchPath::Results config_files;
|
DSearchPath::Results config_files;
|
||||||
|
|
||||||
if (!configsuffix.empty()) {
|
if (microconfig_cat->is_spam()) {
|
||||||
if (configsuffix == "*") {
|
microconfig_cat->spam() << "searching for files matching:\n";
|
||||||
// A configsuffix of "*" is a special case: this means to find
|
for (Globs::const_iterator gi = configname.begin();
|
||||||
// all files that begin with configname. We don't do full
|
gi != configname.end();
|
||||||
// globbing, though. We also make a special case for files
|
++gi) {
|
||||||
// ending in ~, which we always ignore (these are usually just
|
microconfig_cat->spam() << " " << (*gi) << endl;
|
||||||
// backup files).
|
}
|
||||||
if (microconfig_cat->is_spam())
|
}
|
||||||
microconfig_cat->spam() << "searching for files matching: "
|
|
||||||
<< (configname + configsuffix) << endl;
|
for (int di = 0; di < config_search.get_num_directories(); di++) {
|
||||||
for (int di = 0; di < config_search.get_num_directories(); di++) {
|
const Filename &directory = config_search.get_directory(di);
|
||||||
const Filename &directory = config_search.get_directory(di);
|
if (directory.is_directory()) {
|
||||||
if (directory.is_directory()) {
|
vector_string files;
|
||||||
vector_string files;
|
directory.scan_directory(files);
|
||||||
directory.scan_directory(files);
|
// Scan the files in alphabetical order, so that the
|
||||||
// Scan the files in reverse order to match Configrc overwrite
|
// alphabetically last file has precedence.
|
||||||
// rules, so that the alphabetically earliest file has
|
for (vector_string::iterator fi = files.begin();
|
||||||
// precedence.
|
fi != files.end();
|
||||||
for (vector_string::reverse_iterator fi = files.rbegin();
|
++fi) {
|
||||||
fi != files.rend();
|
bool matches = false;
|
||||||
++fi) {
|
for (Globs::const_iterator gi = configname.begin();
|
||||||
if ((*fi).substr(0, configname.length()) == configname &&
|
gi != configname.end() && !matches;
|
||||||
(*fi).substr((*fi).length() - 1) != string("~")) {
|
++gi) {
|
||||||
Filename file(directory, (*fi));
|
matches = (*gi).matches(*fi);
|
||||||
config_files.add_file(file);
|
}
|
||||||
}
|
if (matches) {
|
||||||
}
|
Filename file(directory, (*fi));
|
||||||
|
config_files.add_file(file);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
|
||||||
if (microconfig_cat->is_spam())
|
|
||||||
microconfig_cat->spam() << "aggregate config name is: "
|
|
||||||
<< (configname + configsuffix) << endl;
|
|
||||||
config_search.find_all_files(configname + configsuffix, config_files);
|
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
if (microconfig_cat->is_spam())
|
|
||||||
microconfig_cat->spam() << "searching for '" << configname << "'"
|
|
||||||
<< endl;
|
|
||||||
config_search.find_all_files(configname, config_files);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (microconfig_cat->is_spam())
|
if (microconfig_cat->is_spam())
|
||||||
@ -375,11 +365,11 @@ void ConfigTable::ParseArgs() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void ConfigTable::ConfigDirDefault() {
|
void ConfigTable::ConfigDirDefault() {
|
||||||
// The configdir default comes from $CONFIGRC_DIR, or from the
|
// The configdir default comes from $PRC_DIR, or from the
|
||||||
// compiled in DEFAULT_CONFIGRC_DIR if that's unspecified.
|
// compiled in DEFAULT_PRC_DIR if that's unspecified.
|
||||||
configdir = ExecutionEnvironment::get_environment_variable("CONFIGRC_DIR");
|
configdir = ExecutionEnvironment::get_environment_variable("PRC_DIR");
|
||||||
if (configdir.empty()) {
|
if (configdir.empty()) {
|
||||||
configdir = DEFAULT_CONFIGRC_DIR;
|
configdir = DEFAULT_PRC_DIR;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -410,7 +400,6 @@ void ConfigTable::MicroConfig() {
|
|||||||
bool psep = false;
|
bool psep = false;
|
||||||
bool fsep = false;
|
bool fsep = false;
|
||||||
bool cname = false;
|
bool cname = false;
|
||||||
bool csuff = false;
|
|
||||||
bool cargs = false;
|
bool cargs = false;
|
||||||
bool cpath = false;
|
bool cpath = false;
|
||||||
bool cdir = false;
|
bool cdir = false;
|
||||||
@ -478,22 +467,12 @@ void ConfigTable::MicroConfig() {
|
|||||||
<< "setting the file separator to '" << filesep << "'"
|
<< "setting the file separator to '" << filesep << "'"
|
||||||
<< endl;
|
<< endl;
|
||||||
} else if (tok == "configname") {
|
} else if (tok == "configname") {
|
||||||
configname = rest;
|
configname.push_back(GlobPattern(rest));
|
||||||
cname = true;
|
cname = true;
|
||||||
if (microconfig_cat->is_spam())
|
if (microconfig_cat->is_spam())
|
||||||
microconfig_cat->spam()
|
microconfig_cat->spam()
|
||||||
<< "got a microconfig configname directive, "
|
<< "got a microconfig configname directive, "
|
||||||
<< "setting the configfile name to '" << configname
|
<< "adding configname '" << rest << "'" << endl;
|
||||||
<< "'" << endl;
|
|
||||||
} else if (tok == "configsuffix") {
|
|
||||||
configsuffix = rest;
|
|
||||||
csuff = true;
|
|
||||||
if (microconfig_cat->is_spam())
|
|
||||||
microconfig_cat->spam()
|
|
||||||
<< "got a microconfig configsuffix directive, "
|
|
||||||
<< "setting the config file suffix to '"
|
|
||||||
<< configsuffix << "'"
|
|
||||||
<< endl;
|
|
||||||
} else if (tok == "configargs") {
|
} else if (tok == "configargs") {
|
||||||
configargs = rest;
|
configargs = rest;
|
||||||
cargs = true;
|
cargs = true;
|
||||||
@ -631,15 +610,7 @@ void ConfigTable::MicroConfig() {
|
|||||||
ConfigNameDefault();
|
ConfigNameDefault();
|
||||||
if (microconfig_cat->is_spam())
|
if (microconfig_cat->is_spam())
|
||||||
microconfig_cat->spam() << "no microconfig for configname, "
|
microconfig_cat->spam() << "no microconfig for configname, "
|
||||||
<< "setting to default '" << configname
|
<< "setting to default" << endl;
|
||||||
<< "'" << endl;
|
|
||||||
}
|
|
||||||
if (!csuff) {
|
|
||||||
ConfigSuffixDefault();
|
|
||||||
if (microconfig_cat->is_spam())
|
|
||||||
microconfig_cat->spam() << "no microconfig for configsuffix, "
|
|
||||||
<< "setting to default '" << configsuffix
|
|
||||||
<< "'" << endl;
|
|
||||||
}
|
}
|
||||||
if (!cargs) {
|
if (!cargs) {
|
||||||
ConfigArgsDefault();
|
ConfigArgsDefault();
|
||||||
|
@ -24,9 +24,10 @@
|
|||||||
#include "config_setup.h"
|
#include "config_setup.h"
|
||||||
#include "config_dconfig.h"
|
#include "config_dconfig.h"
|
||||||
#include "symbolEnt.h"
|
#include "symbolEnt.h"
|
||||||
|
#include "globPattern.h"
|
||||||
|
|
||||||
#include <vector>
|
#include "pvector.h"
|
||||||
#include <map>
|
#include "pmap.h"
|
||||||
|
|
||||||
namespace Config {
|
namespace Config {
|
||||||
|
|
||||||
@ -39,8 +40,10 @@ public:
|
|||||||
typedef vector_SymbolEnt Symbol;
|
typedef vector_SymbolEnt Symbol;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
typedef std::map<ConfigString, Symbol> SymbolTable;
|
typedef pmap<ConfigString, Symbol> SymbolTable;
|
||||||
typedef std::map<ConfigString, SymbolTable> TableMap;
|
typedef pmap<ConfigString, SymbolTable> TableMap;
|
||||||
|
typedef pvector<GlobPattern> Globs;
|
||||||
|
|
||||||
SymbolTable unqualified;
|
SymbolTable unqualified;
|
||||||
TableMap qualified;
|
TableMap qualified;
|
||||||
bool _initializing;
|
bool _initializing;
|
||||||
@ -50,8 +53,7 @@ private:
|
|||||||
bool readenvs;
|
bool readenvs;
|
||||||
ConfigString pathsep;
|
ConfigString pathsep;
|
||||||
ConfigString filesep;
|
ConfigString filesep;
|
||||||
ConfigString configname;
|
Globs configname;
|
||||||
ConfigString configsuffix;
|
|
||||||
ConfigString configargs;
|
ConfigString configargs;
|
||||||
ConfigString configpath;
|
ConfigString configpath;
|
||||||
ConfigString configdir;
|
ConfigString configdir;
|
||||||
@ -76,7 +78,6 @@ private:
|
|||||||
INLINE void PathSepDefault();
|
INLINE void PathSepDefault();
|
||||||
INLINE void FileSepDefault();
|
INLINE void FileSepDefault();
|
||||||
INLINE void ConfigNameDefault();
|
INLINE void ConfigNameDefault();
|
||||||
INLINE void ConfigSuffixDefault();
|
|
||||||
INLINE void ConfigArgsDefault();
|
INLINE void ConfigArgsDefault();
|
||||||
INLINE void ConfigPathDefault();
|
INLINE void ConfigPathDefault();
|
||||||
void ConfigDirDefault();
|
void ConfigDirDefault();
|
||||||
|
@ -1,9 +1,10 @@
|
|||||||
|
|
||||||
#include"config_dconfig.cxx"
|
#include "config_dconfig.cxx"
|
||||||
#include"config_notify.cxx"
|
#include "config_notify.cxx"
|
||||||
#include"dconfig.cxx"
|
#include "dconfig.cxx"
|
||||||
#include"configTable.cxx"
|
#include "globPattern.cxx"
|
||||||
#include"notify.cxx"
|
#include "configTable.cxx"
|
||||||
#include"notifyCategory.cxx"
|
#include "notify.cxx"
|
||||||
#include"notifySeverity.cxx"
|
#include "notifyCategory.cxx"
|
||||||
#include"symbolEnt.cxx"
|
#include "notifySeverity.cxx"
|
||||||
|
#include "symbolEnt.cxx"
|
||||||
|
@ -19,7 +19,7 @@
|
|||||||
#ifndef GLOBPATTERN_H
|
#ifndef GLOBPATTERN_H
|
||||||
#define GLOBPATTERN_H
|
#define GLOBPATTERN_H
|
||||||
|
|
||||||
#include "pandabase.h"
|
#include "dtoolbase.h"
|
||||||
#include "filename.h"
|
#include "filename.h"
|
||||||
#include "vector_string.h"
|
#include "vector_string.h"
|
||||||
|
|
||||||
@ -38,7 +38,7 @@
|
|||||||
// example, to scan a directory for all files matching a
|
// example, to scan a directory for all files matching a
|
||||||
// particular pattern.
|
// particular pattern.
|
||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
class EXPCL_PANDAEXPRESS GlobPattern {
|
class EXPCL_DTOOL GlobPattern {
|
||||||
public:
|
public:
|
||||||
INLINE GlobPattern(const string &pattern = string());
|
INLINE GlobPattern(const string &pattern = string());
|
||||||
INLINE GlobPattern(const GlobPattern ©);
|
INLINE GlobPattern(const GlobPattern ©);
|
@ -1,5 +0,0 @@
|
|||||||
# Let's set up a default window size of 800x600. The user can
|
|
||||||
# override this with a local ~/Configrc.
|
|
||||||
win-width 800
|
|
||||||
win-height 600
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
|||||||
|
|
||||||
#define INSTALL_CONFIG \
|
#define INSTALL_CONFIG \
|
||||||
panda.emacs panda.emacs.Xdefaults Configrc.panda
|
panda.emacs panda.emacs.Xdefaults _panda.prc
|
||||||
|
|
||||||
|
|
||||||
#if $[CTPROJS]
|
#if $[CTPROJS]
|
||||||
@ -8,3 +8,5 @@
|
|||||||
#define INSTALL_CONFIG $[INSTALL_CONFIG] panda.init
|
#define INSTALL_CONFIG $[INSTALL_CONFIG] panda.init
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
#include $[THISDIRPREFIX]_panda.prc.pp
|
||||||
|
58
panda/src/configfiles/_panda.prc.pp
Normal file
58
panda/src/configfiles/_panda.prc.pp
Normal file
@ -0,0 +1,58 @@
|
|||||||
|
//
|
||||||
|
// _panda.prc.pp
|
||||||
|
//
|
||||||
|
// This file defines the script to auto-generate _panda.prc at
|
||||||
|
// ppremake time. This is intended to fill in some of the default
|
||||||
|
// parameters, in particular the default display types.
|
||||||
|
//
|
||||||
|
|
||||||
|
#output _panda.prc
|
||||||
|
|
||||||
|
# Let's set up a default window size of 800x600. The user can
|
||||||
|
# override this in his or her personal prc file.
|
||||||
|
win-width 800
|
||||||
|
win-height 600
|
||||||
|
|
||||||
|
# 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.
|
||||||
|
|
||||||
|
#if $[HAVE_DX]
|
||||||
|
aux-display pandadx9
|
||||||
|
#endif
|
||||||
|
#if $[HAVE_GL]
|
||||||
|
aux-display pandagl
|
||||||
|
#endif
|
||||||
|
#if $[HAVE_DX]
|
||||||
|
aux-display pandadx8
|
||||||
|
aux-display pandadx7
|
||||||
|
#endif
|
||||||
|
|
||||||
|
# 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.
|
||||||
|
|
||||||
|
# Also see ptloader, which is built as part of pandatool; it allows
|
||||||
|
# files of more exotic types (like .flt, .mb, .lwo, and .dxf) to be
|
||||||
|
# loaded directly into Panda.
|
||||||
|
|
||||||
|
load-file-type egg pandaegg
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# The following lines define some handy object types to use within the
|
||||||
|
# egg syntax. This remaps <ObjectType> { 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 <Scalar> portal { 1 }
|
||||||
|
egg-object-type-polylight <Scalar> polylight { 1 }
|
||||||
|
|
||||||
|
#end _panda.prc
|
@ -146,7 +146,7 @@ SOURCE TREE AND INSTALL TREE HIERARCHY
|
|||||||
/usr/local/panda or something else. (On a Windows environment the
|
/usr/local/panda or something else. (On a Windows environment the
|
||||||
directory name /usr/local/panda may be inappropriate. It is up to
|
directory name /usr/local/panda may be inappropriate. It is up to
|
||||||
the user to specify a suitable directory name. We suggest
|
the user to specify a suitable directory name. We suggest
|
||||||
C:\panda.)
|
C:\Panda3d.)
|
||||||
|
|
||||||
Once dtool has been built and installed, the next step is to cd to
|
Once dtool has been built and installed, the next step is to cd to
|
||||||
the panda package, ppremake, and 'make' followed by 'make install',
|
the panda package, ppremake, and 'make' followed by 'make install',
|
||||||
@ -161,7 +161,7 @@ AN ALTERNATIVE INSTALL TREE PHILOSOPHY
|
|||||||
the outside developer who is primarily interested in taking the
|
the outside developer who is primarily interested in taking the
|
||||||
whole body of code as a complete piece, but we have different needs
|
whole body of code as a complete piece, but we have different needs
|
||||||
for our own in-house development. It is convenient to be able to
|
for our own in-house development. It is convenient to be able to
|
||||||
treat the individual packages separately; our in-house 'attach'
|
treat the individual packages separately; our in-house 'ctattach'
|
||||||
scripts (not included with the distribution) allow us to use one of
|
scripts (not included with the distribution) allow us to use one of
|
||||||
several automatically-built trees for development, or upon need, to
|
several automatically-built trees for development, or upon need, to
|
||||||
switch on-the-fly to using our own personally built tree.
|
switch on-the-fly to using our own personally built tree.
|
||||||
|
@ -25,7 +25,6 @@
|
|||||||
dcast.T dcast.h \
|
dcast.T dcast.h \
|
||||||
error_utils.h \
|
error_utils.h \
|
||||||
get_config_path.h \
|
get_config_path.h \
|
||||||
globPattern.I globPattern.h \
|
|
||||||
hashGeneratorBase.I hashGeneratorBase.h \
|
hashGeneratorBase.I hashGeneratorBase.h \
|
||||||
hashVal.I hashVal.h indent.I indent.h \
|
hashVal.I hashVal.h indent.I indent.h \
|
||||||
indirectLess.I indirectLess.h \
|
indirectLess.I indirectLess.h \
|
||||||
@ -82,7 +81,6 @@
|
|||||||
datagramIterator.cxx \
|
datagramIterator.cxx \
|
||||||
datagramSink.cxx dcast.cxx error_utils.cxx \
|
datagramSink.cxx dcast.cxx error_utils.cxx \
|
||||||
get_config_path.cxx \
|
get_config_path.cxx \
|
||||||
globPattern.cxx \
|
|
||||||
hashGeneratorBase.cxx hashVal.cxx indent.cxx \
|
hashGeneratorBase.cxx hashVal.cxx indent.cxx \
|
||||||
memoryInfo.cxx memoryUsage.cxx memoryUsagePointerCounts.cxx \
|
memoryInfo.cxx memoryUsage.cxx memoryUsagePointerCounts.cxx \
|
||||||
memoryUsagePointers.cxx multifile.cxx \
|
memoryUsagePointers.cxx multifile.cxx \
|
||||||
@ -128,7 +126,6 @@
|
|||||||
datagramIterator.I datagramIterator.h \
|
datagramIterator.I datagramIterator.h \
|
||||||
datagramSink.I datagramSink.h dcast.T dcast.h \
|
datagramSink.I datagramSink.h dcast.T dcast.h \
|
||||||
error_utils.h get_config_path.h \
|
error_utils.h get_config_path.h \
|
||||||
globPattern.I globPattern.h \
|
|
||||||
hashGeneratorBase.I \
|
hashGeneratorBase.I \
|
||||||
hashGeneratorBase.h hashVal.I hashVal.h \
|
hashGeneratorBase.h hashVal.I hashVal.h \
|
||||||
indent.I indent.h \
|
indent.I indent.h \
|
||||||
|
@ -15,7 +15,6 @@
|
|||||||
#include "dcast.cxx"
|
#include "dcast.cxx"
|
||||||
#include "error_utils.cxx"
|
#include "error_utils.cxx"
|
||||||
#include "get_config_path.cxx"
|
#include "get_config_path.cxx"
|
||||||
#include "globPattern.cxx"
|
|
||||||
#include "hashGeneratorBase.cxx"
|
#include "hashGeneratorBase.cxx"
|
||||||
#include "hashVal.cxx"
|
#include "hashVal.cxx"
|
||||||
#include "indent.cxx"
|
#include "indent.cxx"
|
||||||
|
@ -750,7 +750,9 @@ make_default_pipe() {
|
|||||||
_default_pipe = selection->make_default_pipe();
|
_default_pipe = selection->make_default_pipe();
|
||||||
|
|
||||||
if (_default_pipe == (GraphicsPipe*)NULL) {
|
if (_default_pipe == (GraphicsPipe*)NULL) {
|
||||||
nout << "No graphics pipe is available! Check your Configrc!\n";
|
nout << "No graphics pipe is available!\n"
|
||||||
|
<< "Your Config.prc file must name at least one valid panda display\n"
|
||||||
|
<< "library via load-display or aux-display.\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user