allow panda3d -P from a background shell on mac

This commit is contained in:
David Rose 2010-01-15 05:07:01 +00:00
parent 5420ab049e
commit 87baa4aab4
3 changed files with 15 additions and 3 deletions

View File

@ -16,6 +16,7 @@
#include "p3dEmbed.h"
#include "load_plugin.h"
#include "find_root_dir.h"
////////////////////////////////////////////////////////////////////
// Function: P3DEmbed::Constructor
@ -24,6 +25,9 @@
////////////////////////////////////////////////////////////////////
P3DEmbed::
P3DEmbed(bool console_environment) : Panda3DBase(console_environment) {
// Since the Pand3DBase constructor no longer assigns _root_dir, we
// have to do it here.
_root_dir = find_root_dir();
}
////////////////////////////////////////////////////////////////////

View File

@ -15,8 +15,7 @@
#include "panda3d.h"
#include "load_plugin.h"
#include "p3d_plugin_config.h"
//#include "panda3dBase.cxx"
#include "find_root_dir.h"
// We can include this header file to get the DTOOL_PLATFORM
// definition, even though we don't link with dtool.
@ -300,6 +299,9 @@ run_command_line(int argc, char *argv[]) {
////////////////////////////////////////////////////////////////////
bool Panda3D::
post_arg_processing() {
// Now is a good time to assign _root_dir.
_root_dir = find_root_dir();
// Set host_url_prefix to end with a slash.
_host_url_prefix = _host_url;
if (!_host_url_prefix.empty() && _host_url_prefix[_host_url_prefix.length() - 1] != '/') {

View File

@ -44,7 +44,13 @@ Panda3DBase::
Panda3DBase(bool console_environment) {
_console_environment = console_environment;
_root_dir = find_root_dir();
// We can't assign _root_dir immediately, because it requires a
// low-level Mac call that will balk if we're not logged in to the
// console, which will prevent scripts from using "panda3d -P" to
// find the platform and whatnot. Instead, we'll assign it after
// we've processed the command line.
//_root_dir = find_root_dir();
_reporting_download = false;
_enable_security = false;