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

build 180804. configurable command bindings for scroll wheel, minor bug fixes

This commit is contained in:
tmj-fstate
2018-08-04 12:34:51 +02:00
parent ec1a625c12
commit cf7b9652e0
14 changed files with 180 additions and 49 deletions

View File

@@ -60,11 +60,13 @@ driver_mode::drivermode_input::init() {
// initialize input devices
auto result = (
keyboard.init()
&& mouse.init()
&& gamepad.init() );
&& mouse.init() );
if( true == Global.InputGamepad ) {
gamepad.init();
}
if( true == Global.uart_conf.enable ) {
uart = std::make_unique<uart_input>();
result = ( result && uart->init() );
uart->init();
}
#ifdef _WIN32
Console::On(); // włączenie konsoli
@@ -231,8 +233,6 @@ driver_mode::update() {
simulation::is_ready = true;
m_input.poll();
return true;
}
@@ -381,10 +381,13 @@ driver_mode::on_mouse_button( int const Button, int const Action, int const Mods
void
driver_mode::on_scroll( double const Xoffset, double const Yoffset ) {
if( Global.ctrlState ) {
// ctrl + scroll wheel adjusts fov
Global.FieldOfView = clamp( static_cast<float>( Global.FieldOfView - Yoffset * 20.0 / Timer::subsystem.gfx_total.average() ), 15.0f, 75.0f );
}
m_input.mouse.scroll( Xoffset, Yoffset );
}
void
driver_mode::on_event_poll() {
m_input.poll();
}
void