18
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-11-22 02:05:01 +01:00

Merge remote-tracking branch 'origin/master' into feat/persistent-odometer-store

# Conflicts:
#	vehicle/Gauge.h
This commit is contained in:
jerrrrycho
2026-11-09 15:33:03 +01:00
145 changed files with 7404 additions and 608 deletions

View File

@@ -55,6 +55,9 @@ public:
void AssignBool(bool *bValue);
void UpdateValue();
void AssignState( bool const *State );
// copies of the control animated along with it, from its definitions marked duplicate: yes
std::vector<TGauge> const &mirrors() const {
return m_mirrors; }
// the value shown is value * scale + offset
float offset() const {
return m_offset; }
@@ -65,6 +68,9 @@ public:
// returns offset of submodel associated with the button from the model centre
glm::vec3 model_offset() const;
TGaugeType type() const;
// whether the definition of the control declared its type, rather than left it at the default
bool type_declared() const {
return m_typedeclared; }
inline
bool is_push() const {
return ( static_cast<int>( type() ) & static_cast<int>( TGaugeType::push ) ) != 0; }
@@ -81,6 +87,7 @@ private:
// types
struct scratch_data {
std::optional< std::array<float, 6> > soundproofing;
bool duplicate { false }; // the definition is a duplicate submodel of the control defined before
};
// methods
// imports member data pair from the config file
@@ -90,10 +97,17 @@ private:
GetScaledValue() const;
void
UpdateAnimation( TSubModel *Submodel ) const;
// shows the default or the active state submodel as the state says
void
UpdateVisibility() const;
// the copy of this control's submodels and animation, without its sounds and bindings
TGauge
MirrorCopy() const;
// members
TGaugeAnimation m_animation { TGaugeAnimation::gt_Unknown }; // typ ruchu
TGaugeType m_type { TGaugeType::toggle }; // switch type
bool m_typedeclared { false }; // the type was given with type: in the definition
float m_friction { 0.f }; // hamowanie przy zliżaniu się do zadanej wartości
float m_targetvalue { 0.f }; // wartość docelowa
float m_value { 0.f }; // wartość obecna
@@ -102,7 +116,7 @@ private:
float m_endscale { -1.f }; // scale applied to the value at the end of accepted value range
float m_endvalue { -1.f }; // end value of accepted value range
bool m_interpolatescale { false };
char m_datatype; // typ zmiennej parametru: f-float, d-double, i-int
char m_datatype { '\0' }; // typ zmiennej parametru: f-float, d-double, i-int, b-bool; none until one is assigned
union {
// wskaźnik na parametr pokazywany przez animację
float *fData;
@@ -119,6 +133,8 @@ private:
sound_source m_soundfxincrease { m_soundtemplate }; // sound associated with increasing control's value
sound_source m_soundfxdecrease { m_soundtemplate }; // sound associated with decreasing control's value
std::map<int, sound_source> m_soundfxvalues; // sounds associated with specific values
TModel3d const *m_sourcemodel { nullptr }; // the 3d model the submodel was found in by Load()
std::vector<TGauge> m_mirrors; // duplicate submodels of the control (duplicate: yes), animated along with it
};