mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-07-19 22:39:18 +02:00
reformat: functions can be made static
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -48,7 +48,7 @@ protected:
|
||||
private:
|
||||
// methods
|
||||
// sets visibility of the cursor
|
||||
void
|
||||
static void
|
||||
set_cursor( bool Visible );
|
||||
// render() subclass details
|
||||
void
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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)};
|
||||
|
||||
@@ -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];
|
||||
|
||||
@@ -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 );
|
||||
|
||||
Reference in New Issue
Block a user