16
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-07-19 04:19:19 +02:00

build 180923. basic precipitation visualization system, minor bug fixes

This commit is contained in:
tmj-fstate
2018-09-23 19:13:33 +02:00
parent 2448e59dc8
commit e1b20a025a
19 changed files with 495 additions and 79 deletions

View File

@@ -37,9 +37,11 @@ state_serializer::deserialize( std::string const &Scenariofile ) {
// TODO: check first for presence of serialized binary files
// if this fails, fall back on the legacy text format
scene::scratch_data importscratchpad;
importscratchpad.name = Scenariofile;
if( Scenariofile != "$.scn" ) {
// compilation to binary file isn't supported for rainsted-created overrides
importscratchpad.binary.terrain = Region->deserialize( Scenariofile );
// NOTE: we postpone actual loading of the scene until we process time, season and weather data
importscratchpad.binary.terrain = Region->is_scene( Scenariofile ) ;
}
// NOTE: for the time being import from text format is a given, since we don't have full binary serialization
cParser scenarioparser( Scenariofile, cParser::buffer_FILE, Global.asCurrentSceneryPath, Global.bLoadTraction );
@@ -266,6 +268,12 @@ state_serializer::deserialize_firstinit( cParser &Input, scene::scratch_data &Sc
if( true == Scratchpad.initialized ) { return; }
if( true == Scratchpad.binary.terrain ) {
// at this stage it should be safe to import terrain from the binary scene file
// TBD: postpone loading furter and only load required blocks during the simulation?
Region->deserialize( Scratchpad.name );
}
simulation::Paths.InitTracks();
simulation::Traction.InitTraction();
simulation::Events.InitEvents();