mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-03-20 12:50:57 +00:00
Test PR of lazy load of ghosts and scene streaming
For now scene streaming only affects how subscenes are loaded. If you try it on everything in a scene expect issues as the namespaces are not linked up at that point. This is a TEST! Do not merge! If you do you will open up a gate to an alternate reality where all that you believe will cease to exist in an endless void of darkness.
This commit is contained in:
parent
23e30e801f
commit
eecc2bdaee
17 changed files with 298 additions and 37 deletions
|
|
@ -25,6 +25,13 @@ IMPLEMENT_CALLBACK(SubScene, onLoaded, void, (), (),
|
|||
IMPLEMENT_CALLBACK(SubScene, onUnloaded, void, (), (),
|
||||
"@brief Called when a subScene has been unloaded and has game mode implications.\n\n");
|
||||
|
||||
namespace Sim
|
||||
{
|
||||
// Defined in simManager.cpp
|
||||
extern SceneStreaming* sgStreamingInstance;
|
||||
}
|
||||
|
||||
|
||||
SubScene::SubScene() :
|
||||
mSubSceneAssetId(StringTable->EmptyString()),
|
||||
mGameModesNames(StringTable->EmptyString()),
|
||||
|
|
@ -360,10 +367,12 @@ void SubScene::_loadFile(bool addFileNotify)
|
|||
|
||||
String evalCmd = String::ToString("exec(\"%s\");", mSubSceneAsset->getLevelPath());
|
||||
|
||||
Sim::sgStreamingInstance->smStreaming = true;
|
||||
String instantGroup = Con::getVariable("InstantGroup");
|
||||
Con::setIntVariable("InstantGroup", this->getId());
|
||||
Con::evaluate((const char*)evalCmd.c_str(), false, mSubSceneAsset->getLevelPath());
|
||||
Con::setVariable("InstantGroup", instantGroup.c_str());
|
||||
Sim::sgStreamingInstance->smStreaming = false;
|
||||
|
||||
if (addFileNotify)
|
||||
Torque::FS::AddChangeNotification(mSubSceneAsset->getLevelPath(), this, &SubScene::_onFileChanged);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue