fixed smooth movement in modes other than sm::NORMAL

This commit is contained in:
Zeno Rogue 2022-05-06 19:12:02 +02:00
parent 0c2c32c126
commit 6fe07c389c
4 changed files with 6 additions and 5 deletions

View File

@ -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.;

View File

@ -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

View File

@ -1321,7 +1321,7 @@ EX namespace mapeditor {
EX set<int> 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;

View File

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