mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-03-22 15:05:03 +01:00
maintenance: minor code tweaks
This commit is contained in:
@@ -37,7 +37,7 @@ TMdlContainer::LoadModel(std::string const &Name, bool const Dynamic) {
|
||||
}
|
||||
};
|
||||
|
||||
TModelsManager::modelcontainer_sequence TModelsManager::m_models { 1, {} };
|
||||
TModelsManager::modelcontainer_sequence TModelsManager::m_models { 1, TMdlContainer() };
|
||||
TModelsManager::stringmodelcontainerindex_map TModelsManager::m_modelsmap;
|
||||
|
||||
// wczytanie modelu do tablicy
|
||||
|
||||
2
Names.h
2
Names.h
@@ -35,7 +35,7 @@ public:
|
||||
if( true == mapping.second ) {
|
||||
return true;
|
||||
}
|
||||
// cell with this name already exists; update mapping to point to the new one, for backward compatibility
|
||||
// item with this name already exists; update mapping to point to the new one, for backward compatibility
|
||||
mapping.first->second = itemhandle;
|
||||
return false; }
|
||||
// locates item with specified name. returns pointer to the item, or nullptr
|
||||
|
||||
@@ -169,7 +169,7 @@ openal_source::sync_with( sound_properties const &State ) {
|
||||
|| ( false == is_in_range ) ) {
|
||||
// if the emitter is outside of its nominal hearing range or was outside of it during last check
|
||||
// adjust the volume to a suitable fraction of nominal value
|
||||
auto const fadedistance { sound_range * 0.75 };
|
||||
auto const fadedistance { sound_range * 0.75f };
|
||||
auto const rangefactor {
|
||||
interpolate(
|
||||
1.f, 0.f,
|
||||
|
||||
@@ -51,7 +51,7 @@ public:
|
||||
void
|
||||
bind( Type_ const *Modifier ) {
|
||||
m_valuechangemodifier = Modifier; }
|
||||
Type_ const &
|
||||
Type_
|
||||
value_change() const {
|
||||
return (
|
||||
m_valuechangemodifier == nullptr ?
|
||||
|
||||
@@ -123,7 +123,8 @@ basic_precipitation::update() {
|
||||
|
||||
m_camerapos = Global.pCamera.Pos;
|
||||
|
||||
// intercept sudden user-induced camera jumps
|
||||
// intercept sudden user-induced camera jumps...
|
||||
// ...from free fly mode change
|
||||
if( m_freeflymode != FreeFlyModeFlag ) {
|
||||
m_freeflymode = FreeFlyModeFlag;
|
||||
if( true == m_freeflymode ) {
|
||||
@@ -138,14 +139,17 @@ basic_precipitation::update() {
|
||||
}
|
||||
cameramove = glm::dvec3{ 0.0 };
|
||||
}
|
||||
// ...from jump between cab and window/mirror view
|
||||
if( m_windowopen != Global.CabWindowOpen ) {
|
||||
m_windowopen = Global.CabWindowOpen;
|
||||
cameramove = glm::dvec3{ 0.0 };
|
||||
}
|
||||
// ... from cab change
|
||||
if( ( simulation::Train != nullptr ) && ( simulation::Train->iCabn != m_activecab ) ) {
|
||||
m_activecab = simulation::Train->iCabn;
|
||||
cameramove = glm::dvec3{ 0.0 };
|
||||
}
|
||||
// ... from camera jump to another location
|
||||
if( glm::length( cameramove ) > 100.0 ) {
|
||||
cameramove = glm::dvec3{ 0.0 };
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user