16
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-07-18 01:59:19 +02:00

reformat: functions can be made static

This commit is contained in:
jerrrrycho
2026-07-04 06:09:04 +02:00
parent 1d0d1c015b
commit aeb800283c
66 changed files with 199 additions and 184 deletions

View File

@@ -27,7 +27,7 @@ class TPoKeys55
TPoKeys55();
~TPoKeys55();
bool Connect();
void Close();
static void Close();
bool Write(unsigned char c, unsigned char b3, unsigned char b4 = 0, unsigned char b5 = 0);
bool Read();
bool ReadLoop(int i);

View File

@@ -2569,9 +2569,9 @@ class TMoverParameters
void LoadFIZ_DimmerList(std::string const &Input);
void LoadFIZ_CompressorList(std::string const &Input);
void LoadFIZ_PowerParamsDecode(TPowerParameters &Powerparameters, std::string Prefix, std::string const &Input);
TPowerType LoadFIZ_PowerDecode(std::string const &Power);
TPowerSource LoadFIZ_SourceDecode(std::string const &Source);
TEngineType LoadFIZ_EngineDecode(std::string const &Engine);
static TPowerType LoadFIZ_PowerDecode(std::string const &Power);
static TPowerSource LoadFIZ_SourceDecode(std::string const &Source);
static TEngineType LoadFIZ_EngineDecode(std::string const &Engine);
bool readMPT0(std::string const &line);
bool readMPT(std::string const &line); // Q 20160717
bool readMPTElectricSeries(std::string const &line);

View File

@@ -210,7 +210,7 @@ class TNESt3 : public TBrake {
{}
void Init( double PP, double HPP, double LPP, double BP, int BDF ) /*override*/;
virtual double GetPF( double PP, double dt, double Vel ) /*override*/; // przeplyw miedzy komora wstepna i PG
void EStParams(double i_crc); // parametry charakterystyczne dla ESt
static void EStParams(double i_crc); // parametry charakterystyczne dla ESt
virtual double GetCRP() /*override*/;
void CheckState(double BCP, double &dV1); // glowny przyrzad rozrzadczy
void CheckReleaser(double dt); // odluzniacz

View File

@@ -582,7 +582,7 @@ class TESt : public TBrake
double GetPF(double PP, double dt, double Vel) /*override*/; // przeplyw miedzy komora wstepna i PG
/// <summary>Sets ESt-specific characteristic parameters (placeholder; used by some variants).</summary>
/// <param name="i_crc">Characteristic value.</param>
void EStParams(double i_crc); // parametry charakterystyczne dla ESt
static void EStParams(double i_crc); // parametry charakterystyczne dla ESt
/// <summary>Returns the control reservoir (ZS) pressure.</summary>
double GetCRP() /*override*/;
/// <summary>
@@ -877,7 +877,7 @@ class TCV1 : public TBrake
/// <param name="dV1">In/out brake pipe flow correction.</param>
void CheckState(double BCP, double &dV1);
/// <summary>Returns the ZS-filling slide valve opening factor for the given cylinder pressure.</summary>
double CVs(double BP);
static double CVs(double BP);
/// <summary>Returns the ZP-filling slide valve opening factor for the given cylinder pressure.</summary>
double BVs(double BCP);
/// <summary>Vents valve, brake and control reservoirs to zero.</summary>
@@ -1143,9 +1143,9 @@ class TFV4aM : public TDriverHandle
/// Returns the brake pipe pressure target interpolated from BPT[] for the given handle position.
/// </summary>
/// <param name="pos">Handle position.</param>
double LPP_RP(double pos);
static double LPP_RP(double pos);
/// <summary>Returns true if pos is within ±0.5 of i_pos (detent comparison).</summary>
bool EQ(double pos, double i_pos);
static bool EQ(double pos, double i_pos);
public:
/// <summary>Computes brake pipe flow for the FV4a/M handle (interpolated BPT, wave modelling, accelerator).</summary>
@@ -1193,9 +1193,9 @@ class TMHZ_EN57 : public TDriverHandle
static double const pos_table[11]; //= { -2, 10, -1, 0, 0, 2, 9, 10, 0, 0, 0 };
/// <summary>Returns the brake pipe pressure target for the given handle position (piecewise).</summary>
double LPP_RP(double pos);
static double LPP_RP(double pos);
/// <summary>Returns true if pos is within ±0.5 of i_pos.</summary>
bool EQ(double pos, double i_pos);
static bool EQ(double pos, double i_pos);
public:
/// <summary>Computes brake pipe flow for MHZ_EN57 (covers handle positions -1..10 with EP/pneumatic mix).</summary>
@@ -1249,7 +1249,7 @@ class TMHZ_K5P : public TDriverHandle
static double const pos_table[11]; //= { -2, 10, -1, 0, 0, 2, 9, 10, 0, 0, 0 };
/// <summary>Returns true if pos is within ±0.5 of i_pos.</summary>
bool EQ(double pos, double i_pos);
static bool EQ(double pos, double i_pos);
public:
/// <summary>Computes brake pipe flow for the K5P 5-position handle (release / cut-off / brake / emergency).</summary>
@@ -1302,7 +1302,7 @@ class TMHZ_6P : public TDriverHandle
static double const pos_table[11]; //= { -2, 10, -1, 0, 0, 2, 9, 10, 0, 0, 0 };
/// <summary>Returns true if pos is within ±0.5 of i_pos.</summary>
bool EQ(double pos, double i_pos);
static bool EQ(double pos, double i_pos);
public:
/// <summary>Computes brake pipe flow for the 6P handle.</summary>

View File

@@ -960,7 +960,7 @@ GLFWmonitor *eu07_application::find_monitor(const std::string &str) const
return nullptr;
}
std::string eu07_application::describe_monitor(GLFWmonitor *monitor) const
std::string eu07_application::describe_monitor(GLFWmonitor *monitor)
{
std::string name(glfwGetMonitorName(monitor));
std::replace(std::begin(name), std::end(name), ' ', '_');
@@ -973,7 +973,7 @@ std::string eu07_application::describe_monitor(GLFWmonitor *monitor) const
// private:
bool eu07_application::needs_ogl() const
bool eu07_application::needs_ogl()
{
return !Global.NvRenderer;
}

View File

@@ -66,14 +66,14 @@ public:
set_progress( float Progress = 0.f, float Subtaskprogress = 0.f );
void
set_tooltip( std::string const &Tooltip );
void
static void
set_cursor( int Mode );
void
set_cursor_pos( double Horizontal, double Vertical );
void queue_screenshot();
// input handlers
void on_key( int Key, int Scancode, int Action, int Mods );
void on_char( unsigned int Char );
static void on_char( unsigned int Char );
void on_cursor_pos( double Horizontal, double Vertical );
void on_mouse_button( int Button, int Action, int Mods );
void on_scroll( double Xoffset, double Yoffset );
@@ -83,9 +83,9 @@ public:
GLFWwindow *
window( int Windowindex = 0, bool visible = false, int width = 1, int height = 1, GLFWmonitor *monitor = nullptr, bool keep_ownership = true, bool share_ctx = true );
GLFWmonitor * find_monitor( const std::string &str ) const;
std::string describe_monitor( GLFWmonitor *monitor ) const;
static std::string describe_monitor( GLFWmonitor *monitor );
// generate network sync verification number
double
static double
generate_sync();
void
queue_quit(bool direct);
@@ -99,19 +99,19 @@ private:
using modeptr_array = std::array<std::shared_ptr<application_mode>, static_cast<std::size_t>( count_ )>;
using mode_stack = std::stack<mode>;
// methods
bool needs_ogl() const;
static bool needs_ogl();
void init_debug();
void init_console();
static void init_console();
void init_files();
int init_settings( int Argc, char *Argv[] );
int init_locale();
static int init_settings( int Argc, char *Argv[] );
static int init_locale();
int init_glfw();
void init_callbacks();
int init_ogl();
static int init_ogl();
int init_ui();
int init_gfx();
int init_audio();
int init_data();
static int init_audio();
static int init_data();
int init_modes();
bool init_network();
int run_crashgui();

View File

@@ -127,7 +127,7 @@ std::unordered_map<user_command, std::pair<user_command, user_command>> commandf
{user_command::batterydisable, {user_command::batterytoggle, user_command::none}},
};
std::pair<user_command, user_command> driver_mode::drivermode_input::command_fallback(user_command const Command) const
std::pair<user_command, user_command> driver_mode::drivermode_input::command_fallback(user_command const Command)
{
if (Command == user_command::none)

View File

@@ -85,8 +85,8 @@ private:
void poll();
std::string
binding_hints( std::pair<user_command, user_command> const &Commands ) const;
std::pair<user_command, user_command>
command_fallback( user_command Command ) const;
static std::pair<user_command, user_command>
command_fallback( user_command Command );
};
// methods

View File

@@ -48,7 +48,7 @@ protected:
private:
// methods
// sets visibility of the cursor
void
static void
set_cursor( bool Visible );
// render() subclass details
void

View File

@@ -84,23 +84,23 @@ private:
void update_section_engine( std::vector<text_line> &Output );
void update_section_ai( std::vector<text_line> &Output );
void update_section_scantable( std::vector<text_line> &Output );
void update_section_scenario( std::vector<text_line> &Output );
static void update_section_scenario( std::vector<text_line> &Output );
void update_section_eventqueue( std::vector<text_line> &Output );
void update_section_powergrid( std::vector<text_line> &Output );
static void update_section_powergrid( std::vector<text_line> &Output );
void update_section_camera( std::vector<text_line> &Output );
void update_section_renderer( std::vector<text_line> &Output );
static void update_section_renderer( std::vector<text_line> &Output );
#ifdef WITH_UART
void update_section_uart( std::vector<text_line> &Output );
static void update_section_uart( std::vector<text_line> &Output );
#endif
// section update helpers
std::string update_vehicle_coupler( int Side );
std::string update_vehicle_brake() const;
// renders provided lines, under specified collapsing header
bool render_section( std::string const &Header, std::vector<text_line> const &Lines );
bool render_section( std::vector<text_line> const &Lines );
static bool render_section( std::vector<text_line> const &Lines );
bool render_section_scenario();
bool render_section_eventqueue();
bool render_section_settings();
static bool render_section_settings();
bool render_section_developer();
// members
std::array<char, 1024> m_buffer;

View File

@@ -186,9 +186,9 @@ class editor_mode : public application_mode
bool m_stream_persist{true}; // save edited chunks to disk and load them back
// hierarchy management
void add_to_hierarchy(scene::basic_node *node);
void remove_from_hierarchy(scene::basic_node *node);
scene::basic_node* find_in_hierarchy(const std::string &uuid_str);
static void add_to_hierarchy(scene::basic_node *node);
static void remove_from_hierarchy(scene::basic_node *node);
static scene::basic_node* find_in_hierarchy(const std::string &uuid_str);
scene::basic_node* find_node_by_any(scene::basic_node *node_ptr, const std::string &uuid_str, const std::string &name);
// clear history/redo pointers that reference the given node (prevent dangling pointers)

View File

@@ -599,7 +599,7 @@ const std::string *nodebank_panel::get_active_template()
return m_selectedtemplate.get();
}
std::string nodebank_panel::generate_node_label(std::string Input) const
std::string nodebank_panel::generate_node_label(std::string Input)
{
auto tokenizer{cParser(Input)};

View File

@@ -93,7 +93,7 @@ class nodebank_panel : public ui_panel
private:
// methods:
std::string generate_node_label(std::string Input) const;
static std::string generate_node_label(std::string Input);
// members:
std::vector<std::pair<std::string, std::shared_ptr<std::string>>> m_nodebank;
char m_nodesearch[128];

View File

@@ -98,7 +98,7 @@ public:
static void render_internal();
// begins new UI frame
// (this is separate from render() to allow for debug GUI outside of proper UI framework)
void begin_ui_frame();
static void begin_ui_frame();
static void begin_ui_frame_internal();
//
static void set_cursor( int Mode );

View File

@@ -182,7 +182,8 @@ buffer_manager::find_buffer( std::string const &Buffername ) const {
}
std::string
buffer_manager::find_file( std::string const &Filename ) const {
buffer_manager::find_file( std::string const &Filename )
{
auto const lookup {
FileExists(

View File

@@ -69,8 +69,8 @@ private:
buffer_handle
find_buffer( std::string const &Buffername ) const;
// checks whether specified file exists. returns: name of the located file, or empty string.
std::string
find_file( std::string const &Filename ) const;
static std::string
find_file( std::string const &Filename );
// members
buffer_sequence m_buffers;
index_map m_buffermappings;

View File

@@ -306,7 +306,8 @@ cMoon::phase() {
// normalize values to range 0...1
float
cMoon::normalize( const float Value ) const {
cMoon::normalize( const float Value )
{
float value = Value - floor( Value );
if( value < 0.f ) { ++value; }

View File

@@ -12,7 +12,7 @@ public:
// methods:
void init();
void update( bool Includephase = false );
void render();
static void render();
// returns vector pointing at the sun
glm::vec3 getDirection() const;
// returns current elevation above horizon
@@ -50,7 +50,7 @@ protected:
void irradiance();
void phase();
// helper, normalize values to range 0...1
float normalize(float Value ) const;
static float normalize(float Value );
// members:

View File

@@ -59,9 +59,9 @@ private:
static float m_zenithymatrix[ 3 ][ 4 ];
// coloring
void GetPerez( float *Perez, float Distribution[ 5 ][ 2 ], float Turbidity );
float GetZenith( float Zenithmatrix[ 3 ][ 4 ], float Theta, float Turbidity );
float PerezFunctionO1( float Perezcoeffs[ 5 ], float Thetasun, float Zenithval );
float PerezFunctionO2( float Perezcoeffs[ 5 ], float Icostheta, float Gamma, float Cosgamma2, float Zenithval );
static void GetPerez( float *Perez, float Distribution[ 5 ][ 2 ], float Turbidity );
static float GetZenith( float Zenithmatrix[ 3 ][ 4 ], float Theta, float Turbidity );
static float PerezFunctionO1( float Perezcoeffs[ 5 ], float Thetasun, float Zenithval );
static float PerezFunctionO2( float Perezcoeffs[ 5 ], float Icostheta, float Gamma, float Cosgamma2, float Zenithval );
};

View File

@@ -14,7 +14,7 @@ public:
// methods:
void init();
void update();
void render();
static void render();
/*
// returns location of the sun in the 3d scene
glm::vec3 getPosition();

View File

@@ -22,7 +22,7 @@ private:
thread_local static query* active_queries[6];
protected:
GLenum glenum_target(targets target);
static GLenum glenum_target(targets target);
public:
query(targets target);

View File

@@ -73,7 +73,7 @@ namespace gl
void parse_texture_entries(std::string &str);
void parse_param_entries(std::string &str);
std::string read_file(const std::string &filename);
static std::string read_file(const std::string &filename);
static std::unordered_map<std::string, components_e> components_mapping;
static std::unordered_map<std::string, defaultparam_e> defaultparams_mapping;

View File

@@ -2148,14 +2148,14 @@ struct ImFontAtlas
// Helpers to retrieve list of common Unicode ranges (2 value per range, values are inclusive, zero-terminated list)
// NB: Make sure that your string are UTF-8 and NOT in your local code page. In C++11, you can create UTF-8 string literal using the u8"Hello world" syntax. See FAQ for details.
// NB: Consider using ImFontGlyphRangesBuilder to build glyph ranges from textual data.
IMGUI_API const ImWchar* GetGlyphRangesDefault(); // Basic Latin, Extended Latin
IMGUI_API const ImWchar* GetGlyphRangesKorean(); // Default + Korean characters
IMGUI_API const ImWchar* GetGlyphRangesJapanese(); // Default + Hiragana, Katakana, Half-Width, Selection of 1946 Ideographs
IMGUI_API const ImWchar* GetGlyphRangesChineseFull(); // Default + Half-Width + Japanese Hiragana/Katakana + full set of about 21000 CJK Unified Ideographs
IMGUI_API const ImWchar* GetGlyphRangesChineseSimplifiedCommon();// Default + Half-Width + Japanese Hiragana/Katakana + set of 2500 CJK Unified Ideographs for common simplified Chinese
IMGUI_API const ImWchar* GetGlyphRangesCyrillic(); // Default + about 400 Cyrillic characters
IMGUI_API const ImWchar* GetGlyphRangesThai(); // Default + Thai characters
IMGUI_API const ImWchar* GetGlyphRangesVietnamese(); // Default + Vietnamese characters
IMGUI_API static const ImWchar* GetGlyphRangesDefault(); // Basic Latin, Extended Latin
IMGUI_API static const ImWchar* GetGlyphRangesKorean(); // Default + Korean characters
IMGUI_API static const ImWchar* GetGlyphRangesJapanese(); // Default + Hiragana, Katakana, Half-Width, Selection of 1946 Ideographs
IMGUI_API static const ImWchar* GetGlyphRangesChineseFull(); // Default + Half-Width + Japanese Hiragana/Katakana + full set of about 21000 CJK Unified Ideographs
IMGUI_API static const ImWchar* GetGlyphRangesChineseSimplifiedCommon();// Default + Half-Width + Japanese Hiragana/Katakana + set of 2500 CJK Unified Ideographs for common simplified Chinese
IMGUI_API static const ImWchar* GetGlyphRangesCyrillic(); // Default + about 400 Cyrillic characters
IMGUI_API static const ImWchar* GetGlyphRangesThai(); // Default + Thai characters
IMGUI_API static const ImWchar* GetGlyphRangesVietnamese(); // Default + Vietnamese characters
//-------------------------------------------
// [BETA] Custom Rectangles/Glyphs API

View File

@@ -877,7 +877,8 @@ void command_queue::push_commands(const commands_map &commands) {
void
command_relay::post(user_command const Command, double const Param1, double const Param2,
int const Action, uint16_t Recipient, glm::vec3 Position, const std::string *Payload) const {
int const Action, uint16_t Recipient, glm::vec3 Position, const std::string *Payload)
{
auto const &command = simulation::Commands_descriptions[ static_cast<std::size_t>( Command ) ];

View File

@@ -468,7 +468,7 @@ public:
void
update();
// checks if given command must be scheduled on server
bool
static bool
is_network_target(uint32_t Recipient);
// pops commands from intercept queue
@@ -527,9 +527,9 @@ class command_relay {
public:
// methods
// posts specified command for the specified recipient
void
static void
post(user_command Command, double Param1, double Param2,
int Action, uint16_t Recipient, glm::vec3 Position = glm::vec3(0.0f) , const std::string *Payload = nullptr) const;
int Action, uint16_t Recipient, glm::vec3 Position = glm::vec3(0.0f) , const std::string *Payload = nullptr);
private:
// types
// members

View File

@@ -89,7 +89,7 @@ private:
void
default_bindings();
// potentially replaces supplied command with a more relevant one
user_command
static user_command
adjust_command( user_command Command );
// members

View File

@@ -18,7 +18,7 @@ public:
editormouse_input() = default;
// methods
bool
static bool
init();
void
position( double Horizontal, double Vertical );

View File

@@ -77,7 +77,7 @@ private:
using inputaxis_sequence = std::vector<input_axis>;
// methods
bool recall_bindings();
void bind( std::vector< std::reference_wrapper<user_command> > &Targets, cParser &Input, std::unordered_map<std::string, user_command> const &Translator, std::string Point );
static void bind( std::vector< std::reference_wrapper<user_command> > &Targets, cParser &Input, std::unordered_map<std::string, user_command> const &Translator, std::string Point );
void on_button( int Button, int Action );
void process_axes();

View File

@@ -323,7 +323,8 @@ keyboard_input::key( int const Key, int const Action ) {
}
int
keyboard_input::key( int const Key ) const {
keyboard_input::key( int const Key )
{
return input::keys[ Key ];
}

View File

@@ -51,8 +51,8 @@ public:
init() { return true; }
bool
key( int Key, int Action );
int
key( int Key ) const;
static int
key( int Key );
void
poll();
user_command const

View File

@@ -61,12 +61,12 @@ private:
void draw_launch_box();
void draw_trainset_box();
bool launch_simulation();
void add_replace_entry(const trainset_desc &trainset);
void draw_summary_tooltip(const dynamic_desc &dyn_desc);
static void add_replace_entry(const trainset_desc &trainset);
static void draw_summary_tooltip(const dynamic_desc &dyn_desc);
void open_link(const std::string &link);
static void open_link(const std::string &link);
void draw_trainset(trainset_desc &trainset);
void draw_droptarget(trainset_desc &trainset, int position);
static void draw_droptarget(trainset_desc &trainset, int position);
void purge_selected_trainset();
};
} // namespace ui

View File

@@ -87,7 +87,7 @@ private:
void parse_texture_rule(const std::string &target, const std::string &param);
void parse_texture_info(const std::string &target, const std::string &param, std::shared_ptr<skin_meta> meta);
std::shared_ptr<skin_meta> parse_meta(const std::string &str);
static std::shared_ptr<skin_meta> parse_meta(const std::string &str);
std::shared_ptr<vehicle_desc> get_vehicle(const std::string &name);
vehicle_type ctx_type = vehicle_type::unknown;

View File

@@ -14,7 +14,7 @@ class vehiclepicker_panel : public ui_panel
void render_contents() override;
private:
bool selectable_image(const char *desc, bool selected, const deferred_image *image, const skin_set *pickable = nullptr);
static bool selectable_image(const char *desc, bool selected, const deferred_image *image, const skin_set *pickable = nullptr);
vehicle_type selected_type = vehicle_type::none;
std::shared_ptr<const vehicle_desc> selected_vehicle;
@@ -59,7 +59,7 @@ private:
int number;
};
std::vector<search_info> parse_search_query(const std::string &str);
bool skin_filter(const skin_set *skin, std::vector<search_info> &info_list);
static std::vector<search_info> parse_search_query(const std::string &str);
static bool skin_filter(const skin_set *skin, std::vector<search_info> &info_list);
};
} // namespace ui

View File

@@ -267,7 +267,8 @@ bool TAnimModel::Init(std::string const &asName, std::string const &asReplacable
}
bool
TAnimModel::is_keyword( std::string const &Token ) const {
TAnimModel::is_keyword( std::string const &Token )
{
return Token == "endmodel"
|| Token == "lights"

View File

@@ -171,7 +171,7 @@ public:
// export() subclass details, sends basic content of the class in legacy (text) format to provided stream
void export_as_text_( std::ostream &Output ) const;
// checks whether provided token is a legacy (text) format keyword
bool is_keyword( std::string const &Token ) const;
static bool is_keyword( std::string const &Token );
// members
std::shared_ptr<TAnimContainer> pRoot; // pojemniki sterujące, tylko dla aniomowanych submodeli

View File

@@ -100,7 +100,7 @@ struct opengl_texture : public ITexture {
public:
// methods
void make_request();
void load_PNG();
static void load_PNG();
void load_DDS();
void load_KTX();
void load_TEX();
@@ -143,7 +143,7 @@ public:
~texture_manager() { delete_textures(); }
// activates specified texture unit
void
static void
unit( GLint Textureunit );
// creates texture object out of data stored in specified file
texture_handle

View File

@@ -32,7 +32,7 @@ namespace network::tcp
std::string m_header_buffer;
std::string m_body_buffer;
void write_message(const message &msg, std::ostream &stream);
static void write_message(const message &msg, std::ostream &stream);
void send_data(std::shared_ptr<std::string> buffer);
void read_header();
void handle_header(const asio::error_code &err, size_t bytes_transferred);

View File

@@ -18,7 +18,7 @@ struct opengl33_light : public basic_light {
float factor;
void apply_intensity(float Factor = 1.0f);
void apply_angle();
static void apply_angle();
opengl33_light &operator=(basic_light const &Right) {
basic_light::operator=(Right);

View File

@@ -254,15 +254,15 @@ class opengl33_renderer : public gfx_renderer {
typedef std::vector<opengl33_light> opengllight_array;
// methods
std::unique_ptr<gl::program> make_shader(std::string v, std::string f);
static std::unique_ptr<gl::program> make_shader(std::string v, std::string f);
bool Init_caps();
void setup_pass(viewport_config &Viewport, renderpass_config &Config, rendermode Mode, float Znear = 0.f, float Zfar = 1.f, bool Ignoredebug = false);
void setup_matrices();
void setup_drawing(bool Alpha = false);
void setup_shadow_unbind_map();
static void setup_shadow_unbind_map();
void setup_shadow_bind_map();
void setup_shadow_color( glm::vec4 const &Shadowcolor );
void setup_env_map(gl::cubemap *tex);
static void setup_env_map(gl::cubemap *tex);
void setup_environment_light(TEnvironmentType Environment = e_flat);
void setup_sunlight_intensity( float Factor = 1.f);
// runs jobs needed to generate graphics for specified render pass
@@ -310,8 +310,8 @@ class opengl33_renderer : public gfx_renderer {
bool Render_Alpha(TModel3d *Model, material_data const *Material, float Squaredistance);
void Render_Alpha(TSubModel *Submodel);
void Update_Lights(light_array &Lights);
glm::vec3 pick_color(std::size_t Index);
std::size_t pick_index(glm::ivec3 const &Color);
static glm::vec3 pick_color(std::size_t Index);
static std::size_t pick_index(glm::ivec3 const &Color);
bool init_viewport(viewport_config &vp);
@@ -394,10 +394,10 @@ class opengl33_renderer : public gfx_renderer {
double m_precipitationrotation;
glm::mat4 perspective_projection_raw(float fovy, float aspect, float znear, float zfar);
glm::mat4 perspective_projection(const viewport_proj_config &c, float n, float f, glm::mat4 &frustum);
glm::mat4 ortho_projection(float left, float right, float bottom, float top, float z_near, float z_far);
glm::mat4 ortho_frustumtest_projection(float left, float right, float bottom, float top, float z_near, float z_far);
static glm::mat4 perspective_projection_raw(float fovy, float aspect, float znear, float zfar);
static glm::mat4 perspective_projection(const viewport_proj_config &c, float n, float f, glm::mat4 &frustum);
static glm::mat4 ortho_projection(float left, float right, float bottom, float top, float z_near, float z_far);
static glm::mat4 ortho_frustumtest_projection(float left, float right, float bottom, float top, float z_near, float z_far);
std::vector<std::function<void(TSubModel const *, glm::vec2)>> m_control_pick_requests;
std::vector<std::function<void(scene::basic_node *)>> m_node_pick_requests;

View File

@@ -273,9 +273,9 @@ private:
Update_Lights( light_array &Lights );
bool
Init_caps();
glm::vec3
static glm::vec3
pick_color( std::size_t Index );
std::size_t
static std::size_t
pick_index( glm::ivec3 const &Color );
// members

View File

@@ -1093,7 +1093,8 @@ basic_region::update_traction( TDynamicObject *Vehicle, int const Pantographinde
// checks whether specified file is a valid region data file
bool
basic_region::is_scene( std::string const &Scenariofile ) const {
basic_region::is_scene( std::string const &Scenariofile )
{
auto filename { Scenariofile };
while( filename[ 0 ] == '$' ) {

View File

@@ -213,7 +213,7 @@ public:
using eventlauncher_sequence = std::vector<TEventLauncher *>;
using memorycell_sequence = std::vector<TMemCell *>;
// methods
void
static void
launch_event(TEventLauncher *Launcher, bool local_only);
void
enclose_area( basic_node *Node );
@@ -387,8 +387,8 @@ public:
void
update_sounds();
// checks whether specified file is a valid region data file
bool
is_scene( std::string const &Scenariofile ) const;
static bool
is_scene( std::string const &Scenariofile );
// stores content of the class in file with specified name
void
serialize( std::string const &Scenariofile ) const;
@@ -475,7 +475,7 @@ public:
// methods
// checks whether specified point is within boundaries of the region
bool
static bool
point_inside( glm::dvec3 const &Location );
// legacy method, trims provided shape to fit into a section. adds trimmed part at the end of provided list, returns true if changes were made
static

View File

@@ -45,17 +45,17 @@ private:
translate_node( basic_node *Node, glm::dvec3 const &Location );
void
translate_node( basic_node *Node, float Offset );
void
static void
translate_instance( TAnimModel *Instance, glm::dvec3 const &Location );
void
static void
translate_instance( TAnimModel *Instance, float Offset );
void
static void
translate_memorycell( TMemCell *Memorycell, glm::dvec3 const &Location );
void
static void
translate_memorycell( TMemCell *Memorycell, float Offset );
void
rotate_node( basic_node *Node, glm::vec3 const &Angle );
void
static void
rotate_instance( TAnimModel *Instance, glm::vec3 const &Angle );
};

View File

@@ -64,7 +64,7 @@ private:
// creates handle for a new group
group_handle
create_handle();
bool
static bool
assign_cross_switch(map::track_switch&sw, std::string &sw_name, const std::string &id, size_t idx);
// members
group_map m_groupmap; // map of established node groups

View File

@@ -81,7 +81,7 @@ class render_task
// methods
void run();
void upload();
void cancel();
static void cancel();
auto target() const -> std::shared_ptr<python_rt>
{
return m_target;
@@ -110,19 +110,19 @@ class python_taskqueue
python_taskqueue() = default;
// methods
// initializes the module. returns true on success
auto init() -> bool;
static auto init() -> bool;
// shuts down the module
void exit();
static void exit();
// adds specified task along with provided collection of data to the work queue. returns true on success
auto insert(task_request const &Task) -> bool;
static auto insert(task_request const &Task) -> bool;
// executes python script stored in specified file. returns true on success
auto run_file(std::string const &File, std::string const &Path = "") -> bool;
static auto run_file(std::string const &File, std::string const &Path = "") -> bool;
// acquires the python gil and sets the main thread as current
void acquire_lock();
static void acquire_lock();
// releases the python gil and swaps the main thread out
void release_lock();
static void release_lock();
void update();
static void update();
private:
// types

View File

@@ -380,7 +380,7 @@ basic_controller::log_error( std::string const &Error, int const Line ) const {
}
auto
basic_controller::guess_element_type_from_name( std::string const &Name ) const -> basic_element::type_e {
basic_controller::guess_element_type_from_name( std::string const &Name ) -> basic_element::type_e {
auto const name { split_string_and_number( Name ) };

View File

@@ -104,8 +104,8 @@ private:
// runs one cycle of current program. returns: error code or 0 if there's no error
auto run() -> int;
void log_error( std::string const &Error, int Line = -1 ) const;
auto guess_element_type_from_name( std::string const &Name ) const->basic_element::type_e;
auto inverse( int const Value ) const -> int {
static auto guess_element_type_from_name( std::string const &Name ) -> basic_element::type_e;
static auto inverse( int const Value ) -> int {
return Value == 0 ? 1 : 0; }
// element access
auto element( element_handle const Element ) const -> basic_element const {

View File

@@ -25,17 +25,17 @@ class state_manager {
public:
// methods
void
static void
init_scripting_interface();
// legacy method, calculates changes in simulation state over specified time
void
static void
update( double Deltatime, int Iterationcount );
void
static void
update_clocks();
void
update_scripting_interface();
// process input commands
void
static void
process_commands();
// create model from node string
TAnimModel *
@@ -44,10 +44,10 @@ public:
TEventLauncher *
create_eventlauncher(const std::string &src, const std::string &name, const glm::dvec3 &position);
// delete TAnimModel instance
void
static void
delete_model(TAnimModel *model);
// delete TEventLauncher instance
void
static void
delete_eventlauncher(TEventLauncher *launcher);
// starts deserialization from specified file, returns context pointer on success, throws otherwise
std::shared_ptr<deserializer_state>

View File

@@ -38,7 +38,7 @@ public:
// calculates current season of the year based on set simulation date
void compute_season( int Yearday );
// calculates current weather
void compute_weather();
static void compute_weather();
// data access
auto const &
sun() const {

View File

@@ -1281,7 +1281,8 @@ state_serializer::export_as_text(std::string const &Scenariofile) const {
}
void
state_serializer::export_nodes_to_stream(std::ostream &scmfile, bool Dirty) const {
state_serializer::export_nodes_to_stream(std::ostream &scmfile, bool Dirty)
{
// groups
scmfile << "// groups\n";
scene::Groups.export_as_text( scmfile, Dirty );

View File

@@ -49,33 +49,33 @@ public:
private:
// methods
// restores class data from provided stream
void deserialize_area( cParser &Input, scene::scratch_data &Scratchpad );
void deserialize_isolated( cParser &Input, scene::scratch_data &Scratchpad );
void deserialize_assignment( cParser &Input, scene::scratch_data &Scratchpad );
void deserialize_atmo( cParser &Input, scene::scratch_data &Scratchpad );
void deserialize_camera( cParser &Input, scene::scratch_data &Scratchpad );
void deserialize_config( cParser &Input, scene::scratch_data &Scratchpad );
static void deserialize_area( cParser &Input, scene::scratch_data &Scratchpad );
static void deserialize_isolated( cParser &Input, scene::scratch_data &Scratchpad );
static void deserialize_assignment( cParser &Input, scene::scratch_data &Scratchpad );
static void deserialize_atmo( cParser &Input, scene::scratch_data &Scratchpad );
static void deserialize_camera( cParser &Input, scene::scratch_data &Scratchpad );
static void deserialize_config( cParser &Input, scene::scratch_data &Scratchpad );
void deserialize_description( cParser &Input, scene::scratch_data &Scratchpad );
void deserialize_event( cParser &Input, scene::scratch_data &Scratchpad );
void deserialize_lua( cParser &Input, scene::scratch_data &Scratchpad );
static void deserialize_lua( cParser &Input, scene::scratch_data &Scratchpad );
void deserialize_firstinit( cParser &Input, scene::scratch_data &Scratchpad );
void deserialize_group( cParser &Input, scene::scratch_data &Scratchpad );
void deserialize_endgroup( cParser &Input, scene::scratch_data &Scratchpad );
static void deserialize_group( cParser &Input, scene::scratch_data &Scratchpad );
static void deserialize_endgroup( cParser &Input, scene::scratch_data &Scratchpad );
void deserialize_light( cParser &Input, scene::scratch_data &Scratchpad );
void deserialize_node( cParser &Input, scene::scratch_data &Scratchpad );
void deserialize_origin( cParser &Input, scene::scratch_data &Scratchpad );
void deserialize_endorigin( cParser &Input, scene::scratch_data &Scratchpad );
void deserialize_scale( cParser &Input, scene::scratch_data &Scratchpad );
void deserialize_endscale( cParser &Input, scene::scratch_data &Scratchpad );
void deserialize_rotate( cParser &Input, scene::scratch_data &Scratchpad );
static void deserialize_origin( cParser &Input, scene::scratch_data &Scratchpad );
static void deserialize_endorigin( cParser &Input, scene::scratch_data &Scratchpad );
static void deserialize_scale( cParser &Input, scene::scratch_data &Scratchpad );
static void deserialize_endscale( cParser &Input, scene::scratch_data &Scratchpad );
static void deserialize_rotate( cParser &Input, scene::scratch_data &Scratchpad );
void deserialize_sky( cParser &Input, scene::scratch_data &Scratchpad );
void deserialize_test( cParser &Input, scene::scratch_data &Scratchpad );
void deserialize_time( cParser &Input, scene::scratch_data &Scratchpad );
void deserialize_trainset( cParser &Input, scene::scratch_data &Scratchpad );
void deserialize_terrain( cParser &Input, scene::scratch_data &Scratchpad );
void deserialize_editorterrain( cParser &Input, scene::scratch_data &Scratchpad );
void deserialize_endtrainset( cParser &Input, scene::scratch_data &Scratchpad );
TTrack * deserialize_path( cParser &Input, scene::scratch_data &Scratchpad, scene::node_data const &Nodedata );
static void deserialize_endtrainset( cParser &Input, scene::scratch_data &Scratchpad );
static TTrack * deserialize_path( cParser &Input, scene::scratch_data &Scratchpad, scene::node_data const &Nodedata );
TTraction * deserialize_traction( cParser &Input, scene::scratch_data &Scratchpad, scene::node_data const &Nodedata );
TTractionPowerSource * deserialize_tractionpowersource( cParser &Input, scene::scratch_data &Scratchpad, scene::node_data const &Nodedata );
TMemCell * deserialize_memorycell( cParser &Input, scene::scratch_data &Scratchpad, scene::node_data const &Nodedata );
@@ -83,12 +83,12 @@ private:
TAnimModel * deserialize_model( cParser &Input, scene::scratch_data &Scratchpad, scene::node_data const &Nodedata );
TDynamicObject * deserialize_dynamic( cParser &Input, scene::scratch_data &Scratchpad, scene::node_data const &Nodedata );
sound_source * deserialize_sound( cParser &Input, scene::scratch_data &Scratchpad, scene::node_data const &Nodedata );
void init_time();
static void init_time();
// skips content of stream until specified token
void skip_until( cParser &Input, std::string const &Token );
static void skip_until( cParser &Input, std::string const &Token );
// transforms provided location by specifed rotation and offset
glm::dvec3 transform( glm::dvec3 Location, scene::scratch_data const &Scratchpad );
void export_nodes_to_stream( std::ostream &, bool Dirty ) const;
static glm::dvec3 transform( glm::dvec3 Location, scene::scratch_data const &Scratchpad );
static void export_nodes_to_stream( std::ostream &, bool Dirty );
};
} // simulation

View File

@@ -194,7 +194,8 @@ void scenario_time::set_time(int yearday, int minute) {
// calculates day of week for provided date
int
scenario_time::day_of_week( int const Day, int const Month, int const Year ) const {
scenario_time::day_of_week( int const Day, int const Month, int const Year )
{
// using Zeller's congruence, http://en.wikipedia.org/wiki/Zeller%27s_congruence
int const q = Day;
@@ -234,7 +235,8 @@ scenario_time::day_of_month( int const Week, int const Weekday, int const Month,
// returns number of days between specified days of week
int
scenario_time::weekdays( int const First, int const Second ) const {
scenario_time::weekdays( int const First, int const Second )
{
if( Second >= First ) { return Second - First; }
else { return 7 - First + Second; }
@@ -249,7 +251,8 @@ scenario_time::convert_transition_time( SYSTEMTIME &Time ) const {
}
bool
scenario_time::is_leap( int const Year ) const {
scenario_time::is_leap( int const Year )
{
return Year % 4 == 0 && (Year % 100 != 0 || Year % 400 == 0);

View File

@@ -56,17 +56,17 @@ private:
int
year_day( int Day, int Month, int Year ) const;
// calculates day of week for provided date
int
day_of_week( int Day, int Month, int Year ) const;
static int
day_of_week( int Day, int Month, int Year );
// calculates day of month for specified weekday of specified month of the year
int
day_of_month( int Week, int Weekday, int Month, int Year ) const;
// returns number of days between specified days of week
int
weekdays( int First, int Second ) const;
static int
weekdays( int First, int Second );
// returns true if specified year is a leap year, false otherwise
bool
is_leap( int Year ) const;
static bool
is_leap( int Year );
SYSTEMTIME m_time;
double m_milliseconds{ 0.0 };

View File

@@ -5,7 +5,7 @@ class headtrack
int joy_id = -1;
void find_joy();
float get_axis(const float *data, int count, int axis, float mul);
static float get_axis(const float *data, int count, int axis, float mul);
public:
headtrack();

View File

@@ -23,7 +23,7 @@ public:
private:
bool parse_translation(std::istream &stream);
std::string parse_c_literal(const std::string &str);
static std::string parse_c_literal(const std::string &str);
std::unordered_map<std::string, std::string> lang_mapping;
std::unordered_map<const void*, const void*> pointer_cache;

View File

@@ -452,7 +452,7 @@ void TController::TableClear()
eSignSkip = nullptr; // nic nie pomijamy
};
std::vector<basic_event *> TController::CheckTrackEvent( TTrack *Track, double const fDirection ) const
std::vector<basic_event *> TController::CheckTrackEvent( TTrack *Track, double const fDirection )
{ // sprawdzanie eventów na podanym torze do podstawowego skanowania
std::vector<basic_event *> events;
auto const &eventsequence { ( fDirection > 0 ? Track->m_events2 : Track->m_events1 ) };
@@ -1918,7 +1918,8 @@ TController::~TController()
};
// zamiana kodu rozkazu na opis
std::string TController::Order2Str(TOrders Order) const {
std::string TController::Order2Str(TOrders Order)
{
if( (Order & Change_direction) != 0
&& Order != Change_direction ) {

View File

@@ -471,7 +471,7 @@ private:
void OrdersInit( double fVel );
void OrdersClear();
void OrdersDump( std::string Neworder, bool Verbose = true );
std::string Order2Str( TOrders Order ) const;
static std::string Order2Str( TOrders Order );
// members
std::string m_assignment;
glm::dvec3 vCommandLocation; // polozenie wskaznika, sygnalizatora lub innego obiektu do ktorego odnosi sie komenda // NOTE: not used
@@ -488,7 +488,7 @@ public:
} //jak jedzie do tyłu to trzeba uwzględniać, że distance jest ujemna
private:
// Ra: metody obsługujące skanowanie toru
std::vector<basic_event *> CheckTrackEvent( TTrack *Track, double fDirection ) const;
static std::vector<basic_event *> CheckTrackEvent( TTrack *Track, double fDirection );
bool TableAddNew();
bool TableNotFound( basic_event const *Event, double Distance ) const;
void TableTraceRoute( double fDistance, TDynamicObject *pVehicle );
@@ -511,7 +511,7 @@ private:
int TableDirection() { return iTableDirection; }
// Ra: stare funkcje skanujące, używane do szukania sygnalizatora z tyłu
bool IsOccupiedByAnotherConsist( TTrack *Track, double Distance );
basic_event *CheckTrackEventBackward( double fDirection, TTrack *Track, TDynamicObject *Vehicle, int Eventdirection = 1, end End = rear );
static basic_event *CheckTrackEventBackward( double fDirection, TTrack *Track, TDynamicObject *Vehicle, int Eventdirection = 1, end End = rear );
TTrack *BackwardTraceRoute( double &fDistance, double &fDirection, TDynamicObject *Vehicle, basic_event *&Event, int Eventdirection = 1, end End = rear, bool Untiloccupied = true );
void SetProximityVelocity( double dist, double vel, glm::dvec3 const *pos );
TCommandType BackwardScan( double Range );

View File

@@ -206,7 +206,7 @@ public:
int iAxleFirst; // numer pierwszej osi w kierunku ruchu (oś wiążąca pojazd z torem i wyzwalająca eventy)
float fAxleDist; // rozstaw wózków albo osi do liczenia proporcji zacienienia
glm::vec3 modelRot; // obrot pudła względem świata - do przeanalizowania, czy potrzebne!!!
TDynamicObject * ABuFindNearestObject(glm::vec3 pos, TTrack *Track, TDynamicObject *MyPointer, int &CouplNr );
static TDynamicObject * ABuFindNearestObject(glm::vec3 pos, TTrack *Track, TDynamicObject *MyPointer, int &CouplNr );
glm::dvec3 m_future_movement;
glm::dvec3 m_future_wheels_angle;
@@ -290,7 +290,7 @@ private:
void UpdateDoorRotate(TAnim *pAnim); // animacja drzwi - obrót
void UpdateDoorFold(TAnim *pAnim); // animacja drzwi - składanie
void UpdateDoorPlug(TAnim *pAnim); // animacja drzwi - odskokowo-przesuwne
void UpdatePant(TAnim *pAnim); // animacja pantografu
static void UpdatePant(TAnim *pAnim); // animacja pantografu
void UpdatePlatformTranslate(TAnim *pAnim); // doorstep animation, shift
void UpdatePlatformRotate(TAnim *pAnim); // doorstep animation, rotate
void UpdateMirror(TAnim *pAnim); // mirror animation
@@ -460,7 +460,7 @@ private:
// methods
void ABuLittleUpdate(double ObjSqrDist);
void ABuBogies();
void ABuModelRoll();
static void ABuModelRoll();
void TurnOff();
// update state of load exchange operation
void update_exchange( double Deltatime );
@@ -869,7 +869,7 @@ public:
void
update( double dt, int iter );
// legacy method, checks for presence and height of traction wire for specified vehicle
void
static void
update_traction( TDynamicObject *Vehicle );
// legacy method, sends list of vehicles over network
void

View File

@@ -214,7 +214,8 @@ class TTrain {
void update_sounds_runningnoise( sound_source &Sound );
void update_sounds_resonancenoise( sound_source &Sound );
void update_sounds_radio();
end cab_to_end( int const End ) const {
static end cab_to_end( int const End )
{
return End == 2 ? rear : front; }
end cab_to_end() const {
return cab_to_end( iCabn ); }

View File

@@ -123,9 +123,9 @@ class map_panel : public ui_panel
float zoom = 1.0f / 1000.0f;
enum { MODE_MANUAL = 0, MODE_CAMERA, MODE_VEHICLE } mode = MODE_MANUAL;
float get_vehicle_rotation();
static float get_vehicle_rotation();
void render_map_texture(glm::mat4 transform, glm::vec2 surface_size);
void render_labels(glm::mat4 transform, ImVec2 origin, glm::vec2 surface_size);
static void render_labels(glm::mat4 transform, ImVec2 origin, glm::vec2 surface_size);
bool init_done = false;

View File

@@ -13,7 +13,7 @@ class vehicleparams_panel : public ui_panel
command_relay m_relay;
texture_handle vehicle_mini;
void draw_infobutton(const char *str, ImVec2 pos = ImVec2(-1.0f, -1.0f), ImVec4 color = ImVec4(1.0f, 1.0f, 0.0f, 1.0f));
static void draw_infobutton(const char *str, ImVec2 pos = ImVec2(-1.0f, -1.0f), ImVec4 color = ImVec4(1.0f, 1.0f, 0.0f, 1.0f));
void draw_mini(const TMoverParameters &mover);
public:
vehicleparams_panel(const std::string &vehicle);

View File

@@ -829,7 +829,8 @@ putvalues_event::export_as_text_( std::ostream &Output ) const {
//determines whether provided input should be passed to consist owner
bool
putvalues_event::is_command_for_owner( input_data const &Input ) const {
putvalues_event::is_command_for_owner( input_data const &Input )
{
if (Input.data_text.starts_with("Load=") || Input.data_text.starts_with("UnLoad=")) {
return false;

View File

@@ -278,8 +278,8 @@ private:
void run_() override;
// export_as_text() subclass details
void export_as_text_( std::ostream &Output ) const override;
//determines whether provided input should be passed to consist owner
bool is_command_for_owner( input_data const &Input ) const;
// determines whether provided input should be passed to consist owner
static bool is_command_for_owner( input_data const &Input );
};

View File

@@ -3594,7 +3594,8 @@ path_table::TrackBusyList() const {
// legacy method, sends list of occupied path sections over network
void
path_table::IsolatedBusyList() const {
path_table::IsolatedBusyList()
{
// wysłanie informacji o wszystkich odcinkach izolowanych
TIsolated *Current;
for( Current = TIsolated::Root(); Current; Current = Current->Next() ) {
@@ -3607,7 +3608,8 @@ path_table::IsolatedBusyList() const {
// legacy method, sends state of specified path section over network
void
path_table::IsolatedBusy( std::string const &Name ) const {
path_table::IsolatedBusy( std::string const &Name )
{
// wysłanie informacji o odcinku izolowanym (t)
// Ra 2014-06: do wyszukania użyć drzewka nazw
TIsolated *Current;

View File

@@ -274,8 +274,8 @@ public:
void Load(cParser *parser, glm::dvec3 const &pOrigin);
bool AssignEvents();
bool AssignForcedEvents(basic_event *NewEventPlus, basic_event *NewEventMinus);
void QueueEvents( event_sequence const &Events, TDynamicObject const *Owner );
void QueueEvents( event_sequence const &Events, TDynamicObject const *Owner, double Delaylimit );
static void QueueEvents( event_sequence const &Events, TDynamicObject const *Owner );
static void QueueEvents( event_sequence const &Events, TDynamicObject const *Owner, double Delaylimit );
bool CheckDynamicObject(TDynamicObject *Dynamic);
bool AddDynamicObject(TDynamicObject *Dynamic);
bool RemoveDynamicObject(TDynamicObject *Dynamic);
@@ -381,11 +381,11 @@ public:
void
TrackBusyList() const;
// legacy method, sends list of occupied path sections over network
void
IsolatedBusyList() const;
static void
IsolatedBusyList();
// legacy method, sends state of specified path section over network
void
IsolatedBusy( std::string const &Name ) const;
static void
IsolatedBusy( std::string const &Name );
};
//---------------------------------------------------------------------------

View File

@@ -17,7 +17,7 @@ class basic_station {
public:
// methods
// exchanges load with consist attached to specified vehicle, operating on specified schedule; returns: time needed for exchange, in seconds
double
static double
update_load( TDynamicObject *First, Mtable::TTrainParameters &Schedule, int Platform );
};