merge manul

This commit is contained in:
WLs50
2025-03-09 15:36:11 +01:00
parent a687f551a2
commit a5f6397eca
1211 changed files with 483542 additions and 58643 deletions

View File

@@ -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 :