mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-07-19 05:29:17 +02:00
Merge branch 'tmj-dev' into milek-dev
This commit is contained in:
@@ -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 );
|
||||
@@ -273,6 +275,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();
|
||||
|
||||
Reference in New Issue
Block a user