dual:: panning split only if cannot select with mouse

This commit is contained in:
Zeno Rogue 2019-05-29 15:41:55 +02:00
parent 69e76b550c
commit f509dd0db0
1 changed files with 5 additions and 5 deletions

View File

@ -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"));