17
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-10-17 20:19:20 +02:00

feat(loading): optional background loading: sound files decoded by worker threads (sound.asyncload), data of dds textures read by worker threads (gfx.textures.streaming), gl textures of vehicles farther than a multiple of the draw range released (gfx.textures.releasedistance); all off by default

This commit is contained in:
2026-10-08 16:17:46 +02:00
parent 516aa19cb5
commit 28b4e57133
12 changed files with 683 additions and 23 deletions

View File

@@ -19,6 +19,7 @@ http://mozilla.org/MPL/2.0/.
#include "rendering/renderer.h"
#include "utilities/Logs.h"
#include "utilities/translation.h"
#include "audio/audiorenderer.h"
scenarioloader_mode::scenarioloader_mode() {
m_userinterface = std::make_shared<scenarioloader_ui>();
@@ -58,6 +59,8 @@ bool scenarioloader_mode::update() {
// the loading state holds the scenario file open, which on some systems keeps the file from being replaced
// when the scenery is saved in the editor. it'd also get in the way of another load
state.reset();
// sound files decoded in the background are all ready before the simulation starts
audio::renderer.complete_buffers();
WriteLog( "Scenario loading time: " + std::to_string( std::chrono::duration_cast<std::chrono::seconds>( std::chrono::system_clock::now() - timestart ).count() ) + " seconds" );
// TODO: implement and use next mode cue