maintenance: minor code tweaks

This commit is contained in:
tmj-fstate
2019-08-20 12:40:55 +02:00
parent 4dddf2dc45
commit 07d43956af
6 changed files with 11 additions and 7 deletions

View File

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

View File

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

View File

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

View File

@@ -51,7 +51,7 @@ public:
void
bind( Type_ const *Modifier ) {
m_valuechangemodifier = Modifier; }
Type_ const &
Type_
value_change() const {
return (
m_valuechangemodifier == nullptr ?

View File

@@ -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 };
}

View File

@@ -29,12 +29,12 @@
#include <strsafe.h>
#endif
// stl
#define _USE_MATH_DEFINES
#include <cmath>
#include <cstddef>
#include <cstdlib>
#include <cstdio>
#include <cassert>
#define _USE_MATH_DEFINES
#include <cmath>
#include <cstdint>
#include <iostream>
#include <iomanip>