mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-07-18 00:49:19 +02: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;
|
TModelsManager::stringmodelcontainerindex_map TModelsManager::m_modelsmap;
|
||||||
|
|
||||||
// wczytanie modelu do tablicy
|
// wczytanie modelu do tablicy
|
||||||
|
|||||||
2
Names.h
2
Names.h
@@ -35,7 +35,7 @@ public:
|
|||||||
if( true == mapping.second ) {
|
if( true == mapping.second ) {
|
||||||
return true;
|
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;
|
mapping.first->second = itemhandle;
|
||||||
return false; }
|
return false; }
|
||||||
// locates item with specified name. returns pointer to the item, or nullptr
|
// 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 ) ) {
|
|| ( false == is_in_range ) ) {
|
||||||
// if the emitter is outside of its nominal hearing range or was outside of it during last check
|
// 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
|
// 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 {
|
auto const rangefactor {
|
||||||
interpolate(
|
interpolate(
|
||||||
1.f, 0.f,
|
1.f, 0.f,
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ public:
|
|||||||
void
|
void
|
||||||
bind( Type_ const *Modifier ) {
|
bind( Type_ const *Modifier ) {
|
||||||
m_valuechangemodifier = Modifier; }
|
m_valuechangemodifier = Modifier; }
|
||||||
Type_ const &
|
Type_
|
||||||
value_change() const {
|
value_change() const {
|
||||||
return (
|
return (
|
||||||
m_valuechangemodifier == nullptr ?
|
m_valuechangemodifier == nullptr ?
|
||||||
|
|||||||
@@ -123,7 +123,8 @@ basic_precipitation::update() {
|
|||||||
|
|
||||||
m_camerapos = Global.pCamera.Pos;
|
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 ) {
|
if( m_freeflymode != FreeFlyModeFlag ) {
|
||||||
m_freeflymode = FreeFlyModeFlag;
|
m_freeflymode = FreeFlyModeFlag;
|
||||||
if( true == m_freeflymode ) {
|
if( true == m_freeflymode ) {
|
||||||
@@ -138,14 +139,17 @@ basic_precipitation::update() {
|
|||||||
}
|
}
|
||||||
cameramove = glm::dvec3{ 0.0 };
|
cameramove = glm::dvec3{ 0.0 };
|
||||||
}
|
}
|
||||||
|
// ...from jump between cab and window/mirror view
|
||||||
if( m_windowopen != Global.CabWindowOpen ) {
|
if( m_windowopen != Global.CabWindowOpen ) {
|
||||||
m_windowopen = Global.CabWindowOpen;
|
m_windowopen = Global.CabWindowOpen;
|
||||||
cameramove = glm::dvec3{ 0.0 };
|
cameramove = glm::dvec3{ 0.0 };
|
||||||
}
|
}
|
||||||
|
// ... from cab change
|
||||||
if( ( simulation::Train != nullptr ) && ( simulation::Train->iCabn != m_activecab ) ) {
|
if( ( simulation::Train != nullptr ) && ( simulation::Train->iCabn != m_activecab ) ) {
|
||||||
m_activecab = simulation::Train->iCabn;
|
m_activecab = simulation::Train->iCabn;
|
||||||
cameramove = glm::dvec3{ 0.0 };
|
cameramove = glm::dvec3{ 0.0 };
|
||||||
}
|
}
|
||||||
|
// ... from camera jump to another location
|
||||||
if( glm::length( cameramove ) > 100.0 ) {
|
if( glm::length( cameramove ) > 100.0 ) {
|
||||||
cameramove = glm::dvec3{ 0.0 };
|
cameramove = glm::dvec3{ 0.0 };
|
||||||
}
|
}
|
||||||
|
|||||||
4
stdafx.h
4
stdafx.h
@@ -29,12 +29,12 @@
|
|||||||
#include <strsafe.h>
|
#include <strsafe.h>
|
||||||
#endif
|
#endif
|
||||||
// stl
|
// stl
|
||||||
|
#define _USE_MATH_DEFINES
|
||||||
|
#include <cmath>
|
||||||
#include <cstddef>
|
#include <cstddef>
|
||||||
#include <cstdlib>
|
#include <cstdlib>
|
||||||
#include <cstdio>
|
#include <cstdio>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
#define _USE_MATH_DEFINES
|
|
||||||
#include <cmath>
|
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <iomanip>
|
#include <iomanip>
|
||||||
|
|||||||
Reference in New Issue
Block a user