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

Merge branch 'milek-dev' into gfx-work

This commit is contained in:
milek7
2018-10-10 19:33:08 +02:00
49 changed files with 1697 additions and 1026 deletions

View File

@@ -35,9 +35,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 );
@@ -277,6 +279,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();