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

refactor: change typedef, nullptr, scoped_lock and others

This commit is contained in:
jerrrrycho
2026-09-27 19:31:00 +02:00
parent 8fbb482350
commit b8c9724ca3
42 changed files with 186 additions and 186 deletions

View File

@@ -7036,7 +7036,7 @@ void TDynamicObject::LoadMMediaFile( std::string const &TypeName, std::string co
m_powertrainsounds.position( enginelocation );
// other engine compartment sounds
auto const nullvector { glm::vec3() };
std::vector<sound_source *> enginesounds = {
std::vector enginesounds = {
&sConverter, &sBRVent, &sCompressor, &sCompressorIdle, &sSmallCompressor, &sHeater, &m_batterysound
};
for( auto sound : enginesounds ) {
@@ -8054,7 +8054,7 @@ void
TDynamicObject::powertrain_sounds::position( glm::vec3 const Location ) {
auto const nullvector { glm::vec3() };
std::vector<sound_source *> enginesounds = {
std::vector enginesounds = {
&inverter,
&motor_relay, &dsbWejscie_na_bezoporow, &motor_parallel, &motor_shuntfield, &rsWentylator,
&engine, &engine_ignition, &engine_shutdown, &engine_revving, &engine_turbo, &oil_pump, &fuel_pump, &water_pump, &water_heater, &radiator_fan, &radiator_fan_aux,

View File

@@ -43,7 +43,7 @@ int const ANIM_TYPES = 10; // Ra: ilość typów animacji
class TAnim;
//typedef void(__closure *TUpdate)(TAnim *pAnim); // typ funkcji aktualizującej położenie submodeli
typedef std::function<void(TAnim *)> TUpdate; // __closure is Borland-specific extension
using TUpdate = std::function<void(TAnim *)>; // __closure is Borland-specific extension
// McZapkie-250202
int const MaxAxles = 16; // ABu 280105: zmienione z 8 na 16

View File

@@ -76,7 +76,7 @@ void TGauge::Init(TSubModel *Submodel, TSubModel *Submodelon, TGaugeAnimation Ty
auto const nulloffset { glm::vec3{} };
auto const offset { model_offset() };
{
std::vector<sound_source *> soundfxs = {
std::vector soundfxs = {
&m_soundfxincrease,
&m_soundfxdecrease,
&m_soundfxon,

View File

@@ -59,7 +59,7 @@ private:
};
class control_mapper {
typedef std::unordered_map< TSubModel const *, std::string> submodelstring_map;
using submodelstring_map = std::unordered_map< TSubModel const *, std::string>;
submodelstring_map m_controlnames;
using stringset = std::unordered_set<std::string>;
stringset m_names; // names of registered controls
@@ -142,7 +142,7 @@ class TTrain {
bool deserialize_mapping( cParser &Input );
};
typedef std::vector<screen_entry> screenentry_sequence;
using screenentry_sequence = std::vector<screen_entry>;
// methods
bool CabChange(int iDirection);
@@ -181,8 +181,8 @@ class TTrain {
private:
// types
typedef void( *command_handler )( TTrain *Train, command_data const &Command );
typedef std::unordered_map<user_command, command_handler> commandhandler_map;
using command_handler = void (*)( TTrain *Train, command_data const &Command );
using commandhandler_map = std::unordered_map<user_command, command_handler>;
// methods
// clears state of all cabin controls
void clear_cab_controls();