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

serial port input devices communication module replacement

This commit is contained in:
tmj-fstate
2018-02-06 03:03:19 +01:00
parent e8bb25454e
commit 8b74939460
19 changed files with 712 additions and 406 deletions

View File

@@ -42,6 +42,7 @@ mouse_input::move( double Mousex, double Mousey ) {
reinterpret_cast<std::uint64_t const &>( Mousex ),
reinterpret_cast<std::uint64_t const &>( Mousey ),
GLFW_PRESS,
command_hint::none,
// as we haven't yet implemented either item id system or multiplayer, the 'local' controlled vehicle and entity have temporary ids of 0
// TODO: pass correct entity id once the missing systems are in place
0 );
@@ -60,6 +61,7 @@ mouse_input::move( double Mousex, double Mousey ) {
reinterpret_cast<std::uint64_t const &>( viewoffset.x ),
reinterpret_cast<std::uint64_t const &>( viewoffset.y ),
GLFW_PRESS,
command_hint::none,
// as we haven't yet implemented either item id system or multiplayer, the 'local' controlled vehicle and entity have temporary ids of 0
// TODO: pass correct entity id once the missing systems are in place
0 );
@@ -102,7 +104,7 @@ mouse_input::button( int const Button, int const Action ) {
// NOTE: basic keyboard controls don't have any parameters
// as we haven't yet implemented either item id system or multiplayer, the 'local' controlled vehicle and entity have temporary ids of 0
// TODO: pass correct entity id once the missing systems are in place
m_relay.post( mousecommand, 0, 0, Action, 0 );
m_relay.post( mousecommand, 0, 0, Action, command_hint::none, 0 );
mousecommand = user_command::none;
}
else {
@@ -141,7 +143,7 @@ mouse_input::button( int const Button, int const Action ) {
// NOTE: basic keyboard controls don't have any parameters
// as we haven't yet implemented either item id system or multiplayer, the 'local' controlled vehicle and entity have temporary ids of 0
// TODO: pass correct entity id once the missing systems are in place
m_relay.post( mousecommand, 0, 0, Action, 0 );
m_relay.post( mousecommand, 0, 0, Action, command_hint::none, 0 );
m_updateaccumulator = -0.25; // prevent potential command repeat right after issuing one
switch( mousecommand ) {
@@ -192,13 +194,13 @@ mouse_input::poll() {
// NOTE: basic keyboard controls don't have any parameters
// as we haven't yet implemented either item id system or multiplayer, the 'local' controlled vehicle and entity have temporary ids of 0
// TODO: pass correct entity id once the missing systems are in place
m_relay.post( m_mousecommandleft, 0, 0, GLFW_REPEAT, 0 );
m_relay.post( m_mousecommandleft, 0, 0, GLFW_REPEAT, command_hint::none, 0 );
}
if( m_mousecommandright != user_command::none ) {
// NOTE: basic keyboard controls don't have any parameters
// as we haven't yet implemented either item id system or multiplayer, the 'local' controlled vehicle and entity have temporary ids of 0
// TODO: pass correct entity id once the missing systems are in place
m_relay.post( m_mousecommandright, 0, 0, GLFW_REPEAT, 0 );
m_relay.post( m_mousecommandright, 0, 0, GLFW_REPEAT, command_hint::none, 0 );
}
m_updateaccumulator -= updaterate;
}