MCPcopy Create free account
hub / github.com/WolfireGames/overgrowth / LiveUpdate

Function LiveUpdate

Source/Main/engine.cpp:463–514  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

461}
462
463static void LiveUpdate(SceneGraph* scenegraph, AssetManager* asset_manager, ScriptableUI* scriptable_ui) {
464 Input* input = Input::Instance();
465 Graphics* graphics = Graphics::Instance();
466 Engine* engine = Engine::Instance();
467
468 if (config.PrimarySourceModified()) {
469 config.Load(config.GetPrimaryPath());
470 engine->SetGameSpeed(config["global_time_scale_mult"].toNumber<float>(), true);
471 input->SetFromConfig(config);
472 graphics->SetFromConfig(config, true);
473 ActiveCameras::Get()->SetAutoCamera(config["auto_camera"].toNumber<bool>());
474 graphics->InitScreen();
475 DebugDrawAux::Instance()->visible_sound_spheres = config["visible_sound_spheres"].toNumber<bool>();
476 engine->GetSound()->SetMusicVolume(config["music_volume"].toNumber<float>());
477 engine->GetSound()->SetMasterVolume(config["master_volume"].toNumber<float>());
478 }
479
480 ModLoading::Instance().Reload();
481 AssetPreload::Instance().Reload();
482
483 Textures::Instance()->Reload();
484 if (scenegraph) {
485 if (scenegraph->sky) {
486 scenegraph->sky->Reload();
487 scenegraph->sky->LightingChanged(scenegraph->terrain_object_ != NULL);
488 }
489 }
490
491 asset_manager->Reload<Attack>();
492 asset_manager->Reload<Reaction>();
493 asset_manager->Reload<SyncedAnimationGroup>();
494 asset_manager->Reload<Animation>();
495 asset_manager->Reload<SoundGroup>();
496 asset_manager->Reload<ParticleType>();
497 asset_manager->Reload<Material>();
498 asset_manager->Reload<Character>();
499 asset_manager->Reload<Animation>();
500 asset_manager->Reload<Item>();
501
502 if (scenegraph) {
503 scenegraph->SendMessageToAllObjects(OBJECT_MSG::RELOAD);
504 scenegraph->level->LiveUpdateCheck();
505 scenegraph->particle_system->script_context_.Reload();
506 }
507 if (scriptable_ui) {
508 scriptable_ui->Reload();
509 }
510 AnimationRetargeter::Instance()->Reload();
511 Shaders::Instance()->Reload();
512
513 ReloadImGui();
514}
515
516const char* CStrEngineStateType(const EngineStateType& state) {
517 switch (state) {

Callers 1

UpdateMethod · 0.85

Calls 15

ReloadImGuiFunction · 0.85
PrimarySourceModifiedMethod · 0.80
GetPrimaryPathMethod · 0.80
SetGameSpeedMethod · 0.80
SetAutoCameraMethod · 0.80
InitScreenMethod · 0.80
GetSoundMethod · 0.80
LightingChangedMethod · 0.80
LiveUpdateCheckMethod · 0.80
GetFunction · 0.50
LoadMethod · 0.45

Tested by

no test coverage detected