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

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

# Conflicts:
#	vehicle/Train.cpp
This commit is contained in:
jerrrrycho
2026-11-09 16:33:48 +01:00
6 changed files with 323 additions and 4 deletions

View File

@@ -11,6 +11,7 @@ http://mozilla.org/MPL/2.0/.
#include "utilities/Classes.h"
#include "audio/sound.h"
#include "vehicle/gaugescale.h"
enum class TGaugeAnimation {
// typ ruchu
@@ -82,6 +83,9 @@ public:
return ( static_cast<int>( type() ) & static_cast<int>( TGaugeType::toggle ) ) != 0; }
bool is_delayed() const {
return ( static_cast<int>( type() ) & static_cast<int>( TGaugeType::delayed ) ) != 0; }
// true if the gauge was given a non-uniform scale (scaletable:)
bool has_scaletable() const {
return false == m_scaletable.empty(); }
// members
TSubModel *SubModel { nullptr }; // McZapkie-310302: zeby mozna bylo sprawdzac czy zainicjowany poprawnie
TSubModel *SubModelOn { nullptr }; // optional submodel visible when the state input is set
@@ -91,11 +95,14 @@ private:
struct scratch_data {
std::optional< std::array<float, 6> > soundproofing;
bool duplicate { false }; // the definition is a duplicate submodel of the control defined before
std::vector<gauge_scale::point> scaletable; // as read, in the units of the config
};
// methods
// imports member data pair from the config file
bool
Load_mapping( cParser &Input, TGauge::scratch_data &Scratchpad );
static bool
Load_scaletable( cParser &Input, TGauge::scratch_data &Scratchpad );
float
GetScaledValue() const;
void
@@ -119,6 +126,8 @@ 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 };
std::vector<gauge_scale::point> m_scaletable; // optional non-uniform scale, sorted by value; replaces scale and offset
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ę