From 4b0cbeebcd3a55eb2671b35b68e896e5e79dcb1d Mon Sep 17 00:00:00 2001 From: Zeno Rogue Date: Mon, 12 Feb 2018 12:49:47 +0100 Subject: [PATCH] fixed -rugon, added -ruggo for automatic movement in rug --- rug.cpp | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/rug.cpp b/rug.cpp index 4e950913..ceb58ac9 100644 --- a/rug.cpp +++ b/rug.cpp @@ -37,6 +37,7 @@ bool renderonce = false; bool rendernogl = false; int texturesize = 1024; ld scale = 1; +ld ruggo = 0; ld err_zero = 1e-3, err_zero_current, current_total_error; @@ -1349,13 +1350,16 @@ void actDraw() { last_orientation = next_orientation; } #endif - - #if CAP_HOLDKEYS - Uint8 *keystate = SDL_GetKeyState(NULL); + int qm = 0; double alpha = (ticks - lastticks) / 1000.0; lastticks = ticks; + if(ruggo) move_forward(ruggo * alpha); + + #if CAP_HOLDKEYS + Uint8 *keystate = SDL_GetKeyState(NULL); + transmatrix t = Id; auto perform_finger = [=] () { @@ -1669,6 +1673,10 @@ int rugArgs() { rug_perspective = true; } + else if(argis("-rugauto")) { + shift(); ruggo = argf(); + } + else if(argis("-rugorth")) { rug_perspective = false; } @@ -1686,7 +1694,9 @@ int rugArgs() { } else if(argis("-rugon")) { - PHASE(3); rug::init(); + PHASE(3); + calcparam(); + rug::init(); } #if CAP_ODS