mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-03-22 15:05:03 +01:00
merge manul
This commit is contained in:
20
Track.cpp
20
Track.cpp
@@ -607,13 +607,13 @@ void TTrack::Load(cParser *parser, glm::dvec3 const &pOrigin)
|
||||
else if (iCategoryFlag & 2)
|
||||
if (m_material1 && fTexLength)
|
||||
{ // dla drogi trzeba ustalić proporcje boków nawierzchni
|
||||
auto const &texture1 { GfxRenderer->Texture( GfxRenderer->Material( m_material1 ).textures[0] ) };
|
||||
if( texture1.height() > 0 ) {
|
||||
fTexRatio1 = static_cast<float>( texture1.width() ) / static_cast<float>( texture1.height() ); // proporcja boków
|
||||
auto const &texture1 { GfxRenderer->Texture( GfxRenderer->Material( m_material1 )->GetTexture(0) ) };
|
||||
if( texture1.get_height() > 0 ) {
|
||||
fTexRatio1 = static_cast<float>( texture1.get_width() ) / static_cast<float>( texture1.get_height() ); // proporcja boków
|
||||
}
|
||||
auto const &texture2 { GfxRenderer->Texture( GfxRenderer->Material( m_material2 ).textures[0] ) };
|
||||
if( texture2.height() > 0 ) {
|
||||
fTexRatio2 = static_cast<float>( texture2.width() ) / static_cast<float>( texture2.height() ); // proporcja boków
|
||||
auto const &texture2 { GfxRenderer->Texture( GfxRenderer->Material( m_material2 )->GetTexture(0) ) };
|
||||
if( texture2.get_height() > 0 ) {
|
||||
fTexRatio2 = static_cast<float>( texture2.get_width() ) / static_cast<float>( texture2.get_height() ); // proporcja boków
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -2258,7 +2258,7 @@ TTrack::export_as_text_( std::ostream &Output ) const {
|
||||
// texture parameters are supplied only if the path is set as visible
|
||||
auto texturefile { (
|
||||
m_material1 != null_handle ?
|
||||
GfxRenderer->Material( m_material1 ).name :
|
||||
GfxRenderer->Material( m_material1 )->GetName() :
|
||||
"none" ) };
|
||||
if( texturefile.find( szTexturePath ) == 0 ) {
|
||||
// don't include 'textures/' in the path
|
||||
@@ -2270,7 +2270,7 @@ TTrack::export_as_text_( std::ostream &Output ) const {
|
||||
|
||||
texturefile = (
|
||||
m_material2 != null_handle ?
|
||||
GfxRenderer->Material( m_material2 ).name :
|
||||
GfxRenderer->Material( m_material2 )->GetName() :
|
||||
"none" );
|
||||
if( texturefile.find( szTexturePath ) == 0 ) {
|
||||
// don't include 'textures/' in the path
|
||||
@@ -2344,7 +2344,7 @@ TTrack::export_as_text_( std::ostream &Output ) const {
|
||||
}
|
||||
if( ( eType == tt_Switch )
|
||||
&& ( SwitchExtension->m_material3 != null_handle ) ) {
|
||||
auto texturefile { GfxRenderer->Material( m_material2 ).name };
|
||||
auto texturefile { GfxRenderer->Material( m_material2 )->GetName() };
|
||||
if( texturefile.find( szTexturePath ) == 0 ) {
|
||||
// don't include 'textures/' in the path
|
||||
texturefile.erase( 0, std::string{ szTexturePath }.size() );
|
||||
@@ -2467,7 +2467,7 @@ TTrack::texture_length( material_handle const Material ) {
|
||||
if( Material == null_handle ) {
|
||||
return fTexLength;
|
||||
}
|
||||
auto const texturelength { GfxRenderer->Material( Material ).size.y };
|
||||
auto const texturelength { GfxRenderer->Material( Material )->GetSize().y };
|
||||
return (
|
||||
texturelength < 0.f ?
|
||||
fTexLength :
|
||||
|
||||
Reference in New Issue
Block a user