mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-07-22 13:59:19 +02:00
switch trackbed value export, erased vehicles sound fix
This commit is contained in:
@@ -2156,6 +2156,15 @@ TTrack::export_as_text_( std::ostream &Output ) const {
|
|||||||
if( fVerticalRadius != 0.f ) {
|
if( fVerticalRadius != 0.f ) {
|
||||||
Output << "vradius " << fVerticalRadius << ' ';
|
Output << "vradius " << fVerticalRadius << ' ';
|
||||||
}
|
}
|
||||||
|
if( ( eType == tt_Switch )
|
||||||
|
&& ( SwitchExtension->m_material3 != null_handle ) ) {
|
||||||
|
auto texturefile { GfxRenderer.Material( m_material2 ).name };
|
||||||
|
if( texturefile.find( szTexturePath ) == 0 ) {
|
||||||
|
// don't include 'textures/' in the path
|
||||||
|
texturefile.erase( 0, std::string{ szTexturePath }.size() );
|
||||||
|
}
|
||||||
|
Output << "trackbed " << texturefile << ' ';
|
||||||
|
}
|
||||||
// footer
|
// footer
|
||||||
Output
|
Output
|
||||||
<< "endtrack"
|
<< "endtrack"
|
||||||
|
|||||||
1
Track.h
1
Track.h
@@ -167,6 +167,7 @@ private:
|
|||||||
float fTexSlope = 0.9f;
|
float fTexSlope = 0.9f;
|
||||||
|
|
||||||
glm::dvec3 m_origin;
|
glm::dvec3 m_origin;
|
||||||
|
// TODO: store material names as strings, for lossless serialization and export
|
||||||
material_handle m_material1 = 0; // tekstura szyn albo nawierzchni
|
material_handle m_material1 = 0; // tekstura szyn albo nawierzchni
|
||||||
material_handle m_material2 = 0; // tekstura automatycznej podsypki albo pobocza
|
material_handle m_material2 = 0; // tekstura automatycznej podsypki albo pobocza
|
||||||
using geometryhandle_sequence = std::vector<gfx::geometry_handle>;
|
using geometryhandle_sequence = std::vector<gfx::geometry_handle>;
|
||||||
|
|||||||
@@ -476,6 +476,13 @@ sound_source::stop( bool const Skipend ) {
|
|||||||
void
|
void
|
||||||
sound_source::update( audio::openal_source &Source ) {
|
sound_source::update( audio::openal_source &Source ) {
|
||||||
|
|
||||||
|
if( ( m_owner != nullptr )
|
||||||
|
&& ( false == m_owner->bEnabled ) ) {
|
||||||
|
// terminate the sound if the owner is gone
|
||||||
|
// TBD, TODO: replace with a listener pattern to receive vehicle removal and cab change events and such?
|
||||||
|
m_stop = true;
|
||||||
|
}
|
||||||
|
|
||||||
if( sound( sound_id::main ).buffer != null_handle ) {
|
if( sound( sound_id::main ).buffer != null_handle ) {
|
||||||
// basic variant: single main sound, with optional bookends
|
// basic variant: single main sound, with optional bookends
|
||||||
update_basic( Source );
|
update_basic( Source );
|
||||||
|
|||||||
Reference in New Issue
Block a user