mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-05 11:28:17 -04:00
fix static init loop
This commit is contained in:
parent
8b0461fadd
commit
d7ec4a0fce
@ -20,7 +20,7 @@
|
|||||||
|
|
||||||
ModelPool *ModelPool::_global_ptr = (ModelPool *)NULL;
|
ModelPool *ModelPool::_global_ptr = (ModelPool *)NULL;
|
||||||
|
|
||||||
static Loader model_loader;
|
static Loader *model_loader = NULL;
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
// Function: ModelPool::write
|
// Function: ModelPool::write
|
||||||
@ -73,7 +73,10 @@ ns_load_model(const string &filename, const LoaderOptions &options) {
|
|||||||
new_options.set_flags((new_options.get_flags() | LoaderOptions::LF_no_ram_cache) &
|
new_options.set_flags((new_options.get_flags() | LoaderOptions::LF_no_ram_cache) &
|
||||||
~(LoaderOptions::LF_search | LoaderOptions::LF_report_errors));
|
~(LoaderOptions::LF_search | LoaderOptions::LF_report_errors));
|
||||||
|
|
||||||
PT(PandaNode) panda_node = model_loader.load_sync(filename, new_options);
|
if (model_loader == (Loader *)NULL) {
|
||||||
|
model_loader = new Loader("ModelPool", 0);
|
||||||
|
}
|
||||||
|
PT(PandaNode) panda_node = model_loader->load_sync(filename, new_options);
|
||||||
PT(ModelRoot) node;
|
PT(ModelRoot) node;
|
||||||
|
|
||||||
if (panda_node.is_null()) {
|
if (panda_node.is_null()) {
|
||||||
|
@ -24,7 +24,7 @@
|
|||||||
|
|
||||||
FontPool *FontPool::_global_ptr = (FontPool *)NULL;
|
FontPool *FontPool::_global_ptr = (FontPool *)NULL;
|
||||||
|
|
||||||
static Loader model_loader;
|
static Loader *model_loader = NULL;
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
// Function: FontPool::write
|
// Function: FontPool::write
|
||||||
@ -94,7 +94,10 @@ ns_load_font(const string &str) {
|
|||||||
|
|
||||||
string extension = filename.get_extension();
|
string extension = filename.get_extension();
|
||||||
if (extension.empty() || extension == "egg" || extension == "bam") {
|
if (extension.empty() || extension == "egg" || extension == "bam") {
|
||||||
PT(PandaNode) node = model_loader.load_sync(filename);
|
if (model_loader == (Loader *)NULL) {
|
||||||
|
model_loader = new Loader("FontPool", 0);
|
||||||
|
}
|
||||||
|
PT(PandaNode) node = model_loader->load_sync(filename);
|
||||||
if (node != (PandaNode *)NULL) {
|
if (node != (PandaNode *)NULL) {
|
||||||
// It is a model. Elevate all the priorities by 1, and make a
|
// It is a model. Elevate all the priorities by 1, and make a
|
||||||
// font out of it.
|
// font out of it.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user