Reset observer when starting game
authorAndreas Eversberg <jolly@eversberg.eu>
Sun, 18 Nov 2018 07:00:27 +0000 (08:00 +0100)
committerAndreas Eversberg <jolly@eversberg.eu>
Sun, 18 Nov 2018 07:00:27 +0000 (08:00 +0100)
src/libovr/ovr.c
src/mercenary/main.c

index bfab6c4..880dad1 100755 (executable)
@@ -335,6 +335,8 @@ void begin_render_ovr(void)
                print_info("Failed to begin frame (error %d)\n", result);
 }
 
                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;
 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;
 
        /* reset to game's observer, if requrested by user */
        observer_x = x;
-       x += observer_x_reset;
        observer_y = y;
        observer_y = y;
-       y += observer_y_reset;
        observer_z = z;
        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);
        z += observer_z_reset;
 
        glRotatef(-roll / M_PI * 180.0,0,0,1);
index e62944b..e654f28 100644 (file)
@@ -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' + `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"
 #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"
                "        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"
                "\n"
                "Walking / Driving / Flying using Controller:\n"
                "        Use thumb stick on right controller, to move player / craft.\n"