From 2b4040fdade750dac1087e397e15172195ba970f Mon Sep 17 00:00:00 2001 From: Andreas Eversberg Date: Sun, 18 Nov 2018 08:00:27 +0100 Subject: [PATCH] Reset observer when starting game --- src/libovr/ovr.c | 10 ++++++++-- src/mercenary/main.c | 4 ++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/libovr/ovr.c b/src/libovr/ovr.c index bfab6c4..880dad1 100755 --- a/src/libovr/ovr.c +++ b/src/libovr/ovr.c @@ -335,6 +335,8 @@ void begin_render_ovr(void) print_info("Failed to begin frame (error %d)\n", result); } +static int initial_observer_reset = 1; + void begin_render_ovr_eye(int eye, double *camera_x, double *camera_y, double *camera_z) { int curIndex; @@ -365,10 +367,14 @@ void begin_render_ovr_eye(int eye, double *camera_x, double *camera_y, double *c /* reset to game's observer, if requrested by user */ observer_x = x; - x += observer_x_reset; observer_y = y; - y += observer_y_reset; observer_z = z; + if (initial_observer_reset) { + initial_observer_reset = 0; + reset_observer_ovr(); + } + x += observer_x_reset; + y += observer_y_reset; z += observer_z_reset; glRotatef(-roll / M_PI * 180.0,0,0,1); diff --git a/src/mercenary/main.c b/src/mercenary/main.c index e62944b..e654f28 100644 --- a/src/mercenary/main.c +++ b/src/mercenary/main.c @@ -1443,7 +1443,7 @@ int main(int argc, char *argv[]) " Press `CTRL' + `I' to skip intro (approaching to Eris).\n" " Press `CTRL' + `1' or `2' to insert or `0' to remove mission disk.\n" #ifdef HAVE_OVR - " Press `CTRL' + `O' (or both triggers) to reset observer position.\n" + " Press `CTRL' + `O' to reset observer position.\n" #endif "\n" "Answer to a Question:\n" @@ -1488,7 +1488,7 @@ int main(int argc, char *argv[]) " To have a virtual keyboard, point below benson (control pannel).\n" " Point to a key on keyboard. The key will highlight.\n" " Pull `Trigger' on right controller to enter the highlighted key.\n" - " Press thumb stick on left controller to reset observer position.\n" + " Press thumb stick on right controller to reset observer position.\n" "\n" "Walking / Driving / Flying using Controller:\n" " Use thumb stick on right controller, to move player / craft.\n" -- 2.13.6