From 79bf71ce78a3e59ca74c3e6f3fbc60c78b33003a Mon Sep 17 00:00:00 2001 From: Zeno Rogue Date: Thu, 31 Dec 2020 18:34:00 +0100 Subject: [PATCH] shmup::vr:: shmup/racing controls for vr --- control.cpp | 2 +- shmup.cpp | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/control.cpp b/control.cpp index 48e0b843..b1370e71 100644 --- a/control.cpp +++ b/control.cpp @@ -800,7 +800,7 @@ EX void mainloopiter() { DEBB(DF_GRAPH, ("polling for events\n")); #if CAP_VR - if(vrhr::active()) { + if(vrhr::active() && !shmup::on) { static int lastticks = ticks; ld t = (ticks - lastticks) * shiftmul / 400; lastticks = ticks; diff --git a/shmup.cpp b/shmup.cpp index 3de18452..f8062c9a 100644 --- a/shmup.cpp +++ b/shmup.cpp @@ -781,6 +781,22 @@ void movePlayer(monster *m, int delta) { mdy = (mousey - yb) / (rad/2.); } #endif + + #if CAP_VR + if(vrhr::active()) { + if(GDIM == 3) { + mouseaim_x += vrhr::vraim_x * delta / 400; + mouseaim_y -= vrhr::vraim_y * delta / 400; + mdy -= vrhr::vrgo_y; + mdx += vrhr::vrgo_x; + } + else { + println(hlog, "2dim"); + mturn -= vrhr::vraim_x + vrhr::vrgo_x; + mgo += vrhr::vrgo_y + vrhr::vraim_y; + } + } + #endif if(actionspressed[b+pcOrbPower] && !lactionpressed[b+pcOrbPower] && mouseover && !m->dead) { cwt.at = m->base;