mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-03-22 15:05:03 +01:00
Merge branch 'tmj-dev' into milek-dev
This commit is contained in:
17
Gauge.cpp
17
Gauge.cpp
@@ -21,6 +21,13 @@ http://mozilla.org/MPL/2.0/.
|
||||
#include "Logs.h"
|
||||
#include "renderer.h"
|
||||
|
||||
TGauge::TGauge( sound_source const &Soundtemplate ) :
|
||||
m_soundtemplate( Soundtemplate )
|
||||
{
|
||||
m_soundfxincrease = m_soundtemplate;
|
||||
m_soundfxdecrease = m_soundtemplate;
|
||||
}
|
||||
|
||||
void TGauge::Init(TSubModel *Submodel, TGaugeType Type, float Scale, float Offset, float Friction, float Value, float const Endvalue, float const Endscale, bool const Interpolatescale )
|
||||
{ // ustawienie parametrów animacji submodelu
|
||||
SubModel = Submodel;
|
||||
@@ -172,7 +179,7 @@ TGauge::Load_mapping( cParser &Input ) {
|
||||
if( indexstart != std::string::npos ) {
|
||||
m_soundfxvalues.emplace(
|
||||
std::stoi( key.substr( indexstart, indexend - indexstart ) ),
|
||||
sound_source( sound_placement::internal, EU07_SOUND_CABCONTROLSCUTOFFRANGE ).deserialize( Input, sound_type::single ) );
|
||||
sound_source( m_soundtemplate ).deserialize( Input, sound_type::single ) );
|
||||
}
|
||||
}
|
||||
return true; // return value marks a key: value pair was extracted, nothing about whether it's recognized
|
||||
@@ -333,13 +340,15 @@ void TGauge::UpdateValue()
|
||||
switch (m_datatype)
|
||||
{ // to nie jest zbyt optymalne, można by zrobić osobne funkcje
|
||||
case 'f':
|
||||
m_targetvalue = (*fData);
|
||||
UpdateValue( *fData );
|
||||
break;
|
||||
case 'd':
|
||||
m_targetvalue = (*dData);
|
||||
UpdateValue( *dData );
|
||||
break;
|
||||
case 'i':
|
||||
m_targetvalue = (*iData);
|
||||
UpdateValue( *iData );
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user