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

unified simulation sound sources, gfx namespace for gfx code and structures

This commit is contained in:
tmj-fstate
2017-11-12 00:23:21 +01:00
parent 492c1342b1
commit 5226fca281
36 changed files with 1487 additions and 1433 deletions

View File

@@ -460,7 +460,10 @@ state_manager::deserialize_node( cParser &Input, scene::scratch_data &Scratchpad
auto *sound { deserialize_sound( Input, Scratchpad, nodedata ) };
if( false == simulation::Sounds.insert( sound ) ) {
#ifdef EU07_USE_OLD_SOUNDCODE
ErrorLog( "Bad scenario: sound node with duplicate name \"" + sound->m_name + "\" encountered in file \"" + Input.Name() + "\" (line " + std::to_string( inputline ) + ")" );
#else
#endif
}
simulation::Region->insert_sound( sound, Scratchpad );
}
@@ -830,7 +833,11 @@ state_manager::deserialize_dynamic( cParser &Input, scene::scratch_data &Scratch
return vehicle;
}
#ifdef EU07_USE_OLD_SOUNDCODE
TTextSound *
#else
sound_source *
#endif
state_manager::deserialize_sound( cParser &Input, scene::scratch_data &Scratchpad, scene::node_data const &Nodedata ) {
glm::dvec3 location;
@@ -842,9 +849,14 @@ state_manager::deserialize_sound( cParser &Input, scene::scratch_data &Scratchpa
// adjust location
location = transform( location, Scratchpad );
#ifdef EU07_USE_OLD_SOUNDCODE
auto const soundname { Input.getToken<std::string>() };
auto *sound = new TTextSound( soundname, Nodedata.range_max, location.x, location.y, location.z, false, false, Nodedata.range_min );
sound->name( Nodedata.name );
#else
auto *sound = new sound_source();
sound->deserialize( Input.getToken<std::string>(), sound_type::single );
#endif
skip_until( Input, "endsound" );