16
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-07-21 14:49:19 +02:00

refactored mouse input processor, tweaks to mouse input support, fix for diesel engine compressor, added progress bar label

This commit is contained in:
tmj-fstate
2017-07-10 19:36:23 +02:00
parent 9a008ecff5
commit 16718d53bb
15 changed files with 520 additions and 343 deletions

View File

@@ -27,11 +27,7 @@ public:
bool
key( int const Key, int const Action );
void
mouse( double const Mousex, double const Mousey );
void
mouse( int const Button, int const Action );
void
poll();
poll() {}
private:
// types
@@ -49,18 +45,6 @@ private:
typedef std::vector<command_setup> commandsetup_sequence;
typedef std::unordered_map<int, user_command> usercommand_map;
struct mouse_commands {
user_command left;
user_command right;
mouse_commands( user_command const Left, user_command const Right ):
left(Left), right(Right)
{}
};
typedef std::unordered_map<std::string, mouse_commands> controlcommands_map;
struct bindings_cache {
int forward{ -1 };
@@ -82,13 +66,9 @@ private:
// members
commandsetup_sequence m_commands;
usercommand_map m_bindings;
controlcommands_map m_mousecommands;
user_command m_mousecommandleft { user_command::none }; // last if any command issued with mouse
user_command m_mousecommandright { user_command::none };
command_relay m_relay;
bool m_shift{ false };
bool m_ctrl{ false };
double m_updateaccumulator { 0.0 };
bindings_cache m_bindingscache;
std::array<char, GLFW_KEY_LAST + 1> m_keys;
};