mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-04 02:42:49 -04:00
*** empty log message ***
This commit is contained in:
parent
d9b3cf736c
commit
d107478789
@ -590,6 +590,7 @@ ConfigTable* ConfigTable::Instance(void) {
|
|||||||
_instance = new ConfigTable;
|
_instance = new ConfigTable;
|
||||||
_instance->GetData();
|
_instance->GetData();
|
||||||
_instance->_initializing = false;
|
_instance->_initializing = false;
|
||||||
|
Notify::ptr()->config_initialized();
|
||||||
}
|
}
|
||||||
return _instance;
|
return _instance;
|
||||||
}
|
}
|
||||||
|
@ -7,6 +7,8 @@
|
|||||||
#include "config_notify.h"
|
#include "config_notify.h"
|
||||||
#include "dconfig.h"
|
#include "dconfig.h"
|
||||||
|
|
||||||
|
#include <filename.h>
|
||||||
|
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
|
|
||||||
Notify *Notify::_global_ptr = (Notify *)NULL;
|
Notify *Notify::_global_ptr = (Notify *)NULL;
|
||||||
@ -436,3 +438,36 @@ string_severity(const string &str) {
|
|||||||
return NS_unspecified;
|
return NS_unspecified;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////
|
||||||
|
// Function: Notify::config_initialized
|
||||||
|
// Access: Public
|
||||||
|
// Description: Intended to be called only by Config, this is a
|
||||||
|
// callback that indicated to Notify when Config has
|
||||||
|
// done initializing and Notify can safely set up some
|
||||||
|
// internal state variables that depend on Config
|
||||||
|
// variables.
|
||||||
|
////////////////////////////////////////////////////////////////////
|
||||||
|
void Notify::
|
||||||
|
config_initialized() {
|
||||||
|
static bool already_initialized = false;
|
||||||
|
if (already_initialized) {
|
||||||
|
nout << "Notify::config_initialized() called more than once.\n";
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
already_initialized = true;
|
||||||
|
|
||||||
|
if (_ostream_ptr == &cerr) {
|
||||||
|
Filename notify_output = config_notify.GetString("notify-output", "");
|
||||||
|
if (!notify_output.empty()) {
|
||||||
|
notify_output.set_text();
|
||||||
|
ofstream *out = new ofstream;
|
||||||
|
if (!notify_output.open_write(*out)) {
|
||||||
|
nout << "Unable to open file " << notify_output << " for output.\n";
|
||||||
|
delete out;
|
||||||
|
} else {
|
||||||
|
set_ostream_ptr(out, true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -61,6 +61,7 @@ PUBLISHED:
|
|||||||
static void write_string(const string &str);
|
static void write_string(const string &str);
|
||||||
static Notify *ptr();
|
static Notify *ptr();
|
||||||
|
|
||||||
|
public:
|
||||||
static long get_literal_flag();
|
static long get_literal_flag();
|
||||||
|
|
||||||
bool assert_failure(const char *expression, int line,
|
bool assert_failure(const char *expression, int line,
|
||||||
@ -68,6 +69,8 @@ PUBLISHED:
|
|||||||
|
|
||||||
static NotifySeverity string_severity(const string &string);
|
static NotifySeverity string_severity(const string &string);
|
||||||
|
|
||||||
|
void config_initialized();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
ostream *_ostream_ptr;
|
ostream *_ostream_ptr;
|
||||||
bool _owns_ostream_ptr;
|
bool _owns_ostream_ptr;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user