From 6fe07c389c02d8a97f20cd3194eb4af5938c85f3 Mon Sep 17 00:00:00 2001 From: Zeno Rogue Date: Fri, 6 May 2022 19:12:02 +0200 Subject: [PATCH] fixed smooth movement in modes other than sm::NORMAL --- control.cpp | 4 ++-- graph.cpp | 1 + mapeditor.cpp | 4 ++-- rug.cpp | 2 +- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/control.cpp b/control.cpp index 8c312d85..b124bf54 100644 --- a/control.cpp +++ b/control.cpp @@ -735,7 +735,7 @@ EX void mainloopiter() { } mousepan = cmode & sm::NORMAL; - if((cmode & (sm::DRAW | sm::MAP)) && !hiliteclick) mousepan = true; + if((cmode & sm::PANNING) && !hiliteclick) mousepan = true; if(cmode & sm::SHOWCURSOR) mousepan = false; mousepan = mousepan && mouseaiming(false) && mouseaim_sensitivity; if(mousepan != oldmousepan) { @@ -900,7 +900,7 @@ EX void mainloopiter() { #endif } - if(smooth_scrolling && !shmup::on && (cmode & sm::NORMAL)) { + if(smooth_scrolling && !shmup::on && (cmode & (sm::NORMAL | sm::PANNING))) { rug::using_rugview urv; auto& lastticks = sc_ticks; ld t = (ticks - lastticks) * shiftmul / 1000.; diff --git a/graph.cpp b/graph.cpp index 9d992a55..bc9313a3 100644 --- a/graph.cpp +++ b/graph.cpp @@ -5490,6 +5490,7 @@ namespace sm { static const int HEXEDIT = (1<<17); static const int VR_MENU = (1<<18); // always show the menu in VR static const int SHOWCURSOR = (1<<19); // despite MAP/DRAW always show the cursor, no panning + static const int PANNING = (1<<20); // smooth scrolling works } #endif diff --git a/mapeditor.cpp b/mapeditor.cpp index b2db3899..8c3d1710 100644 --- a/mapeditor.cpp +++ b/mapeditor.cpp @@ -1321,7 +1321,7 @@ EX namespace mapeditor { EX set affected_id; EX void showMapEditor() { - cmode = sm::MAP; + cmode = sm::MAP | sm::PANNING; gamescreen(0); int fs = editor_fsize(); @@ -2001,7 +2001,7 @@ EX namespace mapeditor { EX void showDrawEditor() { #if CAP_POLY - cmode = sm::DRAW; + cmode = sm::DRAW | sm::PANNING; gamescreen(0); drawGrid(); if(callhandlers(false, hooks_prestats)) return; diff --git a/rug.cpp b/rug.cpp index 80c99683..bfbe4800 100644 --- a/rug.cpp +++ b/rug.cpp @@ -1539,7 +1539,7 @@ EX void rug_geometry_choice() { } EX void show() { - cmode = sm::SIDE | sm::MAYDARK; + cmode = sm::SIDE | sm::MAYDARK | sm::PANNING; gamescreen(0); dialog::init(XLAT("hypersian rug mode"), iinf[itPalace].color, 150, 100);