16
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-07-19 14: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

@@ -125,11 +125,13 @@ basic_cell::update_sounds() {
// sounds
auto const deltatime = Timer::GetDeltaRenderTime();
for( auto *sound : m_sounds ) {
#ifdef EU07_USE_OLD_SOUNDCODE
if( ( sound->GetStatus() & DSBSTATUS_PLAYING ) == DSBPLAY_LOOPING ) {
sound->Play( 1, DSBPLAY_LOOPING, true, sound->vSoundPosition );
sound->AdjFreq( 1.0, deltatime );
}
#else
#endif
}
// TBD, TODO: move to sound renderer
for( auto *path : m_paths ) {
@@ -348,7 +350,11 @@ basic_cell::insert( TAnimModel *Instance ) {
// adds provided sound instance to the cell
void
#ifdef EU07_USE_OLD_SOUNDCODE
basic_cell::insert( TTextSound *Sound ) {
#else
basic_cell::insert( sound_source *Sound ) {
#endif
m_active = true;
@@ -514,7 +520,7 @@ basic_cell::center( glm::dvec3 Center ) {
// generates renderable version of held non-instanced geometry
void
basic_cell::create_geometry( geometrybank_handle const &Bank ) {
basic_cell::create_geometry( gfx::geometrybank_handle const &Bank ) {
if( false == m_active ) { return; } // nothing to do here
@@ -1171,8 +1177,13 @@ basic_region::insert_instance( TAnimModel *Instance, scratch_data &Scratchpad )
// inserts provided sound in the region
void
#ifdef EU07_USE_OLD_SOUNDCODE
basic_region::insert_sound( TTextSound *Sound, scratch_data &Scratchpad ) {
#else
basic_region::insert_sound( sound_source *Sound, scratch_data &Scratchpad ) {
#endif
#ifdef EU07_USE_OLD_SOUNDCODE
// NOTE: bounding area isn't present/filled until track class and wrapper refactoring is done
auto location = Sound->location();
@@ -1184,6 +1195,8 @@ basic_region::insert_sound( TTextSound *Sound, scratch_data &Scratchpad ) {
// tracks are guaranteed to hava a name so we can skip the check
ErrorLog( "Bad scenario: sound node \"" + Sound->name() + "\" placed in location outside region bounds (" + to_string( location ) + ")" );
}
#else
#endif
}
// inserts provided event launcher in the region