mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-07-23 20:19:19 +02:00
refactor: create paths namespace instead of global variables
This commit is contained in:
@@ -4541,7 +4541,7 @@ bool TController::PutCommand( std::string NewCommand, double NewValue1, double N
|
||||
// NewCommand = Global.asCurrentSceneryPath + NewCommand;
|
||||
auto lookup =
|
||||
FileExists(
|
||||
{ Global.asCurrentSceneryPath + NewCommand, szSoundPath + NewCommand },
|
||||
{ Global.asCurrentSceneryPath + NewCommand, paths::sounds + NewCommand },
|
||||
{ ".ogg", ".flac", ".wav" } );
|
||||
if( false == lookup.first.empty() ) {
|
||||
// wczytanie dźwięku odjazdu podawanego bezpośrenido
|
||||
@@ -4552,7 +4552,7 @@ bool TController::PutCommand( std::string NewCommand, double NewValue1, double N
|
||||
NewCommand += "radio";
|
||||
lookup =
|
||||
FileExists(
|
||||
{ Global.asCurrentSceneryPath + NewCommand, szSoundPath + NewCommand },
|
||||
{ Global.asCurrentSceneryPath + NewCommand, paths::sounds + NewCommand },
|
||||
{ ".ogg", ".flac", ".wav" } );
|
||||
if( false == lookup.first.empty() ) {
|
||||
// wczytanie dźwięku odjazdu w wersji radiowej (słychać tylko w kabinie)
|
||||
|
||||
@@ -63,7 +63,7 @@ TextureTest( std::string const &Name ) {
|
||||
|
||||
auto const lookup {
|
||||
FileExists(
|
||||
{ Global.asCurrentTexturePath + Name, Name, szTexturePath + Name },
|
||||
{ Global.asCurrentTexturePath + Name, Name, paths::textures + Name },
|
||||
{ ".mat", ".dds", ".tga", ".ktx", ".png", ".bmp", ".jpg", ".tex" } ) };
|
||||
|
||||
return ( lookup.first + lookup.second );
|
||||
@@ -1982,7 +1982,7 @@ TDynamicObject::Init(std::string Name, // nazwa pojazdu, np. "EU07-424"
|
||||
)
|
||||
{ // Ustawienie początkowe pojazdu
|
||||
iDirection = (Reversed ? 0 : 1); // Ra: 0, jeśli ma być wstawiony jako obrócony tyłem
|
||||
asBaseDir = szDynamicPath + BaseDir + "/"; // McZapkie-310302
|
||||
asBaseDir = paths::dynamic + BaseDir + "/"; // McZapkie-310302
|
||||
asName = Name;
|
||||
std::string asAnimName; // zmienna robocza do wyszukiwania osi i wózków
|
||||
// Ra: zmieniamy znaczenie obsady na jednoliterowe, żeby dosadzić kierownika
|
||||
@@ -3011,7 +3011,7 @@ void TDynamicObject::LoadUpdate() {
|
||||
// update bindings between lowpoly sections and potential load chunks placed inside them
|
||||
update_load_sections();
|
||||
// z powrotem defaultowa sciezka do tekstur
|
||||
Global.asCurrentTexturePath = std::string( szTexturePath );
|
||||
Global.asCurrentTexturePath = std::string( paths::textures );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5337,7 +5337,7 @@ void TDynamicObject::LoadMMediaFile( std::string const &TypeName, std::string co
|
||||
if (ReplacableSkin != "none") {
|
||||
m_materialdata.assign( ReplacableSkin );
|
||||
}
|
||||
Global.asCurrentTexturePath = szTexturePath; // z powrotem defaultowa sciezka do tekstur
|
||||
Global.asCurrentTexturePath = paths::textures; // z powrotem defaultowa sciezka do tekstur
|
||||
do {
|
||||
token = "";
|
||||
parser.getTokens(); parser >> token;
|
||||
@@ -6011,7 +6011,7 @@ void TDynamicObject::LoadMMediaFile( std::string const &TypeName, std::string co
|
||||
mdLoad = LoadMMediaFile_mdload( MoverParameters->LoadType.name );
|
||||
|
||||
// z powrotem defaultowa sciezka do tekstur
|
||||
Global.asCurrentTexturePath = std::string( szTexturePath );
|
||||
Global.asCurrentTexturePath = std::string( paths::textures );
|
||||
}
|
||||
|
||||
} // models
|
||||
@@ -7148,7 +7148,7 @@ void TDynamicObject::LoadMMediaFile( std::string const &TypeName, std::string co
|
||||
attachment->Init();
|
||||
}
|
||||
|
||||
Global.asCurrentTexturePath = szTexturePath; // kiedyś uproszczone wnętrze mieszało tekstury nieba
|
||||
Global.asCurrentTexturePath = paths::textures; // kiedyś uproszczone wnętrze mieszało tekstury nieba
|
||||
Global.asCurrentDynamicPath = "";
|
||||
|
||||
// position sound emitters which weren't defined in the config file
|
||||
|
||||
@@ -9311,7 +9311,7 @@ bool TTrain::InitializeCab(int NewCabNo, std::string const &asFileName)
|
||||
TModel3d *kabina = TModelsManager::GetModel(DynamicObject->asBaseDir + token, true, true,
|
||||
(Global.network_servers.empty() && !Global.network_client) ? 0 : id());
|
||||
// z powrotem defaultowa sciezka do tekstur
|
||||
Global.asCurrentTexturePath = szTexturePath;
|
||||
Global.asCurrentTexturePath = paths::textures;
|
||||
// if (DynamicObject->mdKabina!=k)
|
||||
if (kabina != nullptr)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user