build 181005. automatic switch trackbed generation

This commit is contained in:
tmj-fstate
2018-10-05 21:57:49 +02:00
parent 682514fe7b
commit 8b1a26632d
12 changed files with 879 additions and 784 deletions

View File

@@ -433,7 +433,16 @@ state_serializer::deserialize_node( cParser &Input, scene::scratch_data &Scratch
|| ( nodedata.type == "triangle_strip" )
|| ( nodedata.type == "triangle_fan" ) ) {
if( false == Scratchpad.binary.terrain ) {
auto const skip {
// all shapes will be loaded from the binary version of the file
( true == Scratchpad.binary.terrain )
// crude way to detect fixed switch trackbed geometry
|| ( ( true == Global.CreateSwitchTrackbeds )
&& ( Input.Name().size() >= 15 )
&& ( Input.Name().substr( 0, 11 ) == "scenery/zwr" )
&& ( Input.Name().substr( Input.Name().size() - 4 ) == ".inc" ) ) };
if( false == skip ) {
simulation::Region->insert(
scene::shape_node().import(
@@ -442,7 +451,6 @@ state_serializer::deserialize_node( cParser &Input, scene::scratch_data &Scratch
true );
}
else {
// all shapes were already loaded from the binary version of the file
skip_until( Input, "endtri" );
}
}