mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-03-22 15:05:03 +01:00
SBT Include
This commit is contained in:
@@ -98,6 +98,7 @@ state_serializer::deserialize_begin( std::string const &Scenariofile ) {
|
||||
{ "test", &state_serializer::deserialize_test },
|
||||
{ "time", &state_serializer::deserialize_time },
|
||||
{ "trainset", &state_serializer::deserialize_trainset },
|
||||
{ "terrain", &state_serializer::deserialize_terrain },
|
||||
{ "endtrainset", &state_serializer::deserialize_endtrainset } };
|
||||
|
||||
for( auto &function : functionlist ) {
|
||||
@@ -361,7 +362,15 @@ state_serializer::deserialize_firstinit( cParser &Input, scene::scratch_data &Sc
|
||||
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 );
|
||||
if (false == Scratchpad.binary.terrain_included)
|
||||
{
|
||||
Region->deserialize(Scratchpad.name);
|
||||
}
|
||||
else
|
||||
{
|
||||
Region->deserialize(Scratchpad.terrain_name);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
simulation::Paths.InitTracks();
|
||||
@@ -734,6 +743,26 @@ state_serializer::deserialize_trainset( cParser &Input, scene::scratch_data &Scr
|
||||
>> Scratchpad.trainset.velocity;
|
||||
}
|
||||
|
||||
void
|
||||
state_serializer::deserialize_terrain(cParser &Input, scene::scratch_data &Scratchpad)
|
||||
{
|
||||
std::string line;
|
||||
Input.getTokens(1);
|
||||
Input >> line;
|
||||
if ((true == Global.file_binary_terrain) && (true == ends_with(line, ".sbt")))
|
||||
{
|
||||
|
||||
WriteLog("SBT included");
|
||||
Global.file_binary_terrain_state = true;
|
||||
Scratchpad.binary.terrain_included = true;
|
||||
Scratchpad.terrain_name = line;
|
||||
WriteLog("SBT present");
|
||||
}
|
||||
|
||||
skip_until(Input, "endterrain");
|
||||
|
||||
}
|
||||
|
||||
void
|
||||
state_serializer::deserialize_endtrainset( cParser &Input, scene::scratch_data &Scratchpad ) {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user