mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-03 02:15:43 -04:00
add async-load-delay
This commit is contained in:
parent
3e12bc0f65
commit
09dc4e3b84
@ -274,6 +274,16 @@ ConfigVariableBool flatten_geoms
|
|||||||
"only the NodePath interfaces; you may still make the lower-level "
|
"only the NodePath interfaces; you may still make the lower-level "
|
||||||
"SceneGraphReducer calls directly."));
|
"SceneGraphReducer calls directly."));
|
||||||
|
|
||||||
|
ConfigVariableDouble async_load_delay
|
||||||
|
("async-load-delay", 0.0,
|
||||||
|
PRC_DESC("If this is nonzero, it represents an artificial delay, "
|
||||||
|
"in seconds, that is imposed on every asynchronous load attempt "
|
||||||
|
"(within the thread). Its purpose is to help debug errors that "
|
||||||
|
"may occur when an asynchronous load is delayed. The "
|
||||||
|
"delay is per-model, and all aync loads will be queued "
|
||||||
|
"up behind the delay--it is as if the time it takes to read a "
|
||||||
|
"file is increased by this amount per read."));
|
||||||
|
|
||||||
ConfigVariableBool polylight_info
|
ConfigVariableBool polylight_info
|
||||||
("polylight-info", false,
|
("polylight-info", false,
|
||||||
PRC_DESC("Set this true to view some info statements regarding the polylight. "
|
PRC_DESC("Set this true to view some info statements regarding the polylight. "
|
||||||
|
@ -53,6 +53,7 @@ extern ConfigVariableInt max_collect_indices;
|
|||||||
extern ConfigVariableBool premunge_data;
|
extern ConfigVariableBool premunge_data;
|
||||||
extern ConfigVariableBool preserve_geom_nodes;
|
extern ConfigVariableBool preserve_geom_nodes;
|
||||||
extern ConfigVariableBool flatten_geoms;
|
extern ConfigVariableBool flatten_geoms;
|
||||||
|
extern ConfigVariableDouble async_load_delay;
|
||||||
|
|
||||||
extern ConfigVariableBool polylight_info;
|
extern ConfigVariableBool polylight_info;
|
||||||
extern ConfigVariableDouble lod_fade_time;
|
extern ConfigVariableDouble lod_fade_time;
|
||||||
|
@ -14,6 +14,7 @@
|
|||||||
|
|
||||||
#include "modelLoadRequest.h"
|
#include "modelLoadRequest.h"
|
||||||
#include "loader.h"
|
#include "loader.h"
|
||||||
|
#include "config_pgraph.h"
|
||||||
|
|
||||||
TypeHandle ModelLoadRequest::_type_handle;
|
TypeHandle ModelLoadRequest::_type_handle;
|
||||||
|
|
||||||
@ -24,6 +25,11 @@ TypeHandle ModelLoadRequest::_type_handle;
|
|||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
bool ModelLoadRequest::
|
bool ModelLoadRequest::
|
||||||
do_task() {
|
do_task() {
|
||||||
|
double delay = async_load_delay;
|
||||||
|
if (delay != 0.0) {
|
||||||
|
Thread::sleep(delay);
|
||||||
|
}
|
||||||
|
|
||||||
Loader *loader;
|
Loader *loader;
|
||||||
DCAST_INTO_R(loader, _manager, false);
|
DCAST_INTO_R(loader, _manager, false);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user