From 923805006857f7ae5626acd27ee549e4b2c636d0 Mon Sep 17 00:00:00 2001 From: curt Date: Mon, 19 Aug 2002 02:07:39 +0000 Subject: [PATCH] Add support for flipping the instrument panel vertically on screen (if we want to do a full screen panel on a device that is mounted upside down.) --- src/Cockpit/kr_87.cxx | 2 +- src/Cockpit/panel.cxx | 8 ++++++-- src/Cockpit/panel.hxx | 1 + src/Cockpit/steam.cxx | 2 +- 4 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/Cockpit/kr_87.cxx b/src/Cockpit/kr_87.cxx index 0cc2b4adf..a675f1adc 100644 --- a/src/Cockpit/kr_87.cxx +++ b/src/Cockpit/kr_87.cxx @@ -254,7 +254,7 @@ void FGKR_87::update( double dt ) { // Radio //////////////////////////////////////////////////////////////////////// - if ( on_off_vol_btn >= 0.01 ) { + if ( on_off_vol_btn >= 0.05 ) { // buttons if ( adf_btn == 0 ) { ant_mode = 1; diff --git a/src/Cockpit/panel.cxx b/src/Cockpit/panel.cxx index bf5a1c13f..0199dd178 100644 --- a/src/Cockpit/panel.cxx +++ b/src/Cockpit/panel.cxx @@ -272,6 +272,7 @@ FGPanel::update (double dt) _x_offset = fgGetInt("/sim/panel/x-offset"); _y_offset = fgGetInt("/sim/panel/y-offset"); _jitter = fgGetFloat("/sim/panel/jitter"); + _flipx = fgGetBool("/sim/panel/flip-x"); // Do nothing if the panel isn't visible. if ( !fgPanelVisible() ) { @@ -330,8 +331,11 @@ FGPanel::update (GLfloat winx, GLfloat winw, GLfloat winy, GLfloat winh) glMatrixMode(GL_PROJECTION); glPushMatrix(); glLoadIdentity(); - gluOrtho2D(winx, winx + winw, winy, winy + winh); /* right side up */ - // gluOrtho2D(winx + winw, winx, winy + winh, winy); /* up side down */ + if ( _flipx ) { + gluOrtho2D(winx + winw, winx, winy + winh, winy); /* up side down */ + } else { + gluOrtho2D(winx, winx + winw, winy, winy + winh); /* right side up */ + } glMatrixMode(GL_MODELVIEW); glPushMatrix(); diff --git a/src/Cockpit/panel.hxx b/src/Cockpit/panel.hxx index b038b828d..d0d1b9805 100644 --- a/src/Cockpit/panel.hxx +++ b/src/Cockpit/panel.hxx @@ -197,6 +197,7 @@ private: int _y_offset; int _view_height; float _jitter; + bool _flipx; const SGPropertyNode * _xsize_node; const SGPropertyNode * _ysize_node; diff --git a/src/Cockpit/steam.cxx b/src/Cockpit/steam.cxx index c947325ee..4bc4fe6e7 100644 --- a/src/Cockpit/steam.cxx +++ b/src/Cockpit/steam.cxx @@ -318,7 +318,7 @@ void FGSteam::_CatchUp() More subtle flaw is having it not move or a travel limit occasionally due to some dirt in the tube or on the ball. */ - d = - current_aircraft.fdm_state->get_A_Z_pilot(); + d = -current_aircraft.fdm_state->get_A_Z_pilot(); if ( d < 1 ) d = 1; set_lowpass ( & the_TC_rad, current_aircraft.fdm_state->get_A_Y_pilot () / d, -- 2.39.5