From f509dd0db09a873f3f4065dea52d487cef3e122b Mon Sep 17 00:00:00 2001 From: Zeno Rogue Date: Wed, 29 May 2019 15:41:55 +0200 Subject: [PATCH] dual:: panning split only if cannot select with mouse --- control.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/control.cpp b/control.cpp index 5fdac158..a6af40bd 100644 --- a/control.cpp +++ b/control.cpp @@ -29,6 +29,10 @@ bool mousepressed = false; bool mousemoved = false; bool actonrelease = false; +bool mousepan, oldmousepan; +ld mouseaim_x, mouseaim_y; +ld mouseaim_sensitivity = 0.01; + int timetowait; #if CAP_SDLJOY @@ -247,7 +251,7 @@ typedef SDL_Event eventtype; bool smooth_scrolling = false; void handlePanning(int sym, int uni) { - if(dual::split([=] { handlePanning(sym, uni); })) return; + if(mousepan && dual::split([=] { handlePanning(sym, uni); })) return; if(DIM == 3) { if(sym == PSEUDOKEY_WHEELUP) View = cpush(2, -0.05*shiftmul) * View, didsomething = true, playermoved = false; if(sym == PSEUDOKEY_WHEELDOWN) View = cpush(2, 0.05*shiftmul) * View, didsomething = true, playermoved = false; @@ -511,10 +515,6 @@ void resize_screen_to(int x, int y) { setvideomode(); } -bool mousepan, oldmousepan; -ld mouseaim_x, mouseaim_y; -ld mouseaim_sensitivity = 0.01; - void mainloopiter() { DEBB(DF_GRAPH, ("main loop\n"));