From 24f0f1b7070e2caa1d691c91d1b4bb48a682a20e Mon Sep 17 00:00:00 2001 From: Zeno Rogue Date: Wed, 8 Apr 2020 00:39:16 +0200 Subject: [PATCH] smooth_scrolling feature did not work correctly in non-isotropic geometries --- control.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/control.cpp b/control.cpp index d52032fc..add772e7 100644 --- a/control.cpp +++ b/control.cpp @@ -702,28 +702,28 @@ EX void mainloopiter() { lastticks = ticks; Uint8 *keystate = SDL_GetKeyState(NULL); if(keystate[SDLK_END] && GDIM == 3 && DEFAULTNOR(SDLK_END)) - View = cpush(2, -t) * View, didsomething = true, playermoved = false; + shift_view(ctangent(2, -t)), didsomething = true, playermoved = false; if(keystate[SDLK_HOME] && GDIM == 3 && DEFAULTNOR(SDLK_HOME)) - View = cpush(2, t) * View, didsomething = true, playermoved = false; + shift_view(ctangent(2, t)), didsomething = true, playermoved = false; if(keystate[SDLK_RIGHT] && DEFAULTNOR(SDLK_RIGHT)) - View = (GDIM == 2 ? xpush(-t) : cspin(0, 2, -t)) * View, didsomething = true, playermoved = playermoved && GDIM == 3; + rotate_view(GDIM == 2 ? xpush(-t) : cspin(0, 2, -t)), didsomething = true, playermoved = playermoved && GDIM == 3; if(keystate[SDLK_LEFT] && DEFAULTNOR(SDLK_LEFT)) - View = (GDIM == 2 ? xpush(t) : cspin(0, 2, t)) * View, didsomething = true, playermoved = playermoved && GDIM == 3; + rotate_view(GDIM == 2 ? xpush(t) : cspin(0, 2, t)), didsomething = true, playermoved = playermoved && GDIM == 3; if(keystate[SDLK_UP] && DEFAULTNOR(SDLK_UP)) - View = (GDIM == 2 ? ypush(t) : cspin(1, 2, t)) * View, didsomething = true, playermoved = playermoved && GDIM == 3; + rotate_view(GDIM == 2 ? ypush(t) : cspin(1, 2, t)), didsomething = true, playermoved = playermoved && GDIM == 3; if(keystate[SDLK_DOWN] && DEFAULTNOR(SDLK_DOWN)) - View = (GDIM == 2 ? ypush(-t) : cspin(1, 2, -t)) * View, didsomething = true, playermoved = playermoved && GDIM == 3; + rotate_view(GDIM == 2 ? ypush(-t) : cspin(1, 2, -t)), didsomething = true, playermoved = playermoved && GDIM == 3; if(keystate[SDLK_PAGEUP] && DEFAULTNOR(SDLK_PAGEUP)) { if(history::on) models::rotation+=t; else - View = spin(t) * View, didsomething = true; + rotate_view(spin(t)), didsomething = true; } if(keystate[SDLK_PAGEDOWN] && DEFAULTNOR(SDLK_PAGEDOWN)) { if(history::on) models::rotation-=t; else - View = spin(-t) * View, didsomething = true; + rotate_view(spin(-t)), didsomething = true; } }