From 16a2bb0118b609a69843bdd0bcd0dc28e2f4be6d Mon Sep 17 00:00:00 2001 From: frohlich Date: Wed, 9 May 2007 20:41:08 +0000 Subject: [PATCH] Modified Files: src/ATC/AIPlane.cxx src/ATC/ATC.cxx src/ATC/ATCDialog.cxx src/ATC/ATCmgr.cxx src/ATC/Makefile.am src/ATC/approach.cxx src/ATC/atis.cxx src/ATC/ground.cxx src/ATC/tower.cxx src/GUI/mouse.cxx src/Main/Makefile.am src/Main/fg_init.cxx src/Main/fg_props.cxx src/Main/globals.cxx src/Main/globals.hxx src/Main/main.cxx src/Main/renderer.cxx src/Model/acmodel.cxx src/Scenery/scenery.cxx src/Scenery/scenery.hxx src/Scenery/tilemgr.cxx src/Scenery/tilemgr.hxx Removed Files: src/ATC/ATCdisplay.cxx src/ATC/ATCdisplay.hxx: Remove unused functions and the disabled ATC display. --- src/ATC/AIPlane.cxx | 4 - src/ATC/ATC.cxx | 11 -- src/ATC/ATCDialog.cxx | 2 - src/ATC/ATCdisplay.cxx | 249 ---------------------------------------- src/ATC/ATCdisplay.hxx | 96 ---------------- src/ATC/ATCmgr.cxx | 1 - src/ATC/Makefile.am | 1 - src/ATC/approach.cxx | 2 - src/ATC/atis.cxx | 2 - src/ATC/ground.cxx | 3 - src/ATC/tower.cxx | 7 -- src/GUI/mouse.cxx | 152 ------------------------ src/Main/fg_init.cxx | 9 -- src/Main/fg_props.cxx | 1 - src/Main/globals.cxx | 1 - src/Main/globals.hxx | 7 -- src/Main/main.cxx | 2 - src/Main/renderer.cxx | 7 -- src/Model/acmodel.cxx | 2 +- src/Scenery/tilemgr.cxx | 8 -- src/Scenery/tilemgr.hxx | 7 -- 21 files changed, 1 insertion(+), 573 deletions(-) delete mode 100644 src/ATC/ATCdisplay.cxx delete mode 100644 src/ATC/ATCdisplay.hxx diff --git a/src/ATC/AIPlane.cxx b/src/ATC/AIPlane.cxx index 8158a0088..84006294d 100644 --- a/src/ATC/AIPlane.cxx +++ b/src/ATC/AIPlane.cxx @@ -29,7 +29,6 @@ SG_USING_STD(string); #include "AIPlane.hxx" -#include "ATCdisplay.hxx" FGAIPlane::FGAIPlane() { leg = LEG_UNKNOWN; @@ -210,7 +209,6 @@ void FGAIPlane::Render(const string& refname, bool repeating) { pending_transmission[i] = ' '; } } - globals->get_ATC_display()->RegisterSingleMessage(pending_transmission, 0.0); } playing = true; } @@ -224,8 +222,6 @@ void FGAIPlane::NoRender(const string& refname) { globals->get_soundmgr()->stop(refname); globals->get_soundmgr()->remove(refname); #endif - } else { - globals->get_ATC_display()->CancelRepeatingMessage(); } playing = false; } diff --git a/src/ATC/ATC.cxx b/src/ATC/ATC.cxx index c0352fa59..2bc321805 100644 --- a/src/ATC/ATC.cxx +++ b/src/ATC/ATC.cxx @@ -29,7 +29,6 @@ #include
#include "ATC.hxx" -#include "ATCdisplay.hxx" FGATC::FGATC() { freqClear = true; @@ -109,8 +108,6 @@ void FGATC::Update(double dt) { if(_display) { //Render(pending_transmission, ident, false); Render(pending_transmission); - // At the moment Render only works for ATIS - //globals->get_ATC_display()->RegisterSingleMessage(pending_transmission); } // Run the callback regardless of whether on same freq as user or not. //cout << "_callback_code = " << _callback_code << '\n'; @@ -185,7 +182,6 @@ void FGATC::ImmediateTransmit(int callback_code) { //Render(pending_transmission, ident, false); Render(pending_transmission); // At the moment Render doesn't work except for ATIS - //globals->get_ATC_display()->RegisterSingleMessage(pending_transmission); } if(callback_code) { ProcessCallback(callback_code); @@ -258,11 +254,6 @@ void FGATC::Render(string& msg, const string& refname, bool repeating) { msg[i] = ' '; } } - if(repeating) { - globals->get_ATC_display()->RegisterRepeatingMessage(msg); - } else { - globals->get_ATC_display()->RegisterSingleMessage(msg); - } } _playing = true; } @@ -276,8 +267,6 @@ void FGATC::NoRender(const string& refname) { globals->get_soundmgr()->stop(refname); globals->get_soundmgr()->remove(refname); #endif - } else { - globals->get_ATC_display()->CancelRepeatingMessage(); } _playing = false; } diff --git a/src/ATC/ATCDialog.cxx b/src/ATC/ATCDialog.cxx index 3119ae336..ab54a3f7b 100644 --- a/src/ATC/ATCDialog.cxx +++ b/src/ATC/ATCDialog.cxx @@ -33,7 +33,6 @@ #include "ATCDialog.hxx" #include "ATC.hxx" #include "ATCmgr.hxx" -#include "ATCdisplay.hxx" #include "commlist.hxx" #include "ATCutils.hxx" #include @@ -274,7 +273,6 @@ void FGATCDialog::PopupCallback(int num) { string pilot = atcptr->GenText(a.transmission, a.callback_code); fgSetString("/sim/messages/pilot", pilot.c_str()); // This is the user's speech getting displayed. - globals->get_ATC_display()->RegisterSingleMessage(pilot); _callbackPending = true; _callbackTimer = 0.0; _callbackWait = 5.0; diff --git a/src/ATC/ATCdisplay.cxx b/src/ATC/ATCdisplay.cxx deleted file mode 100644 index e554a4d78..000000000 --- a/src/ATC/ATCdisplay.cxx +++ /dev/null @@ -1,249 +0,0 @@ -// ATCdisplay.cxx - routines to display ATC output - graphically for now -// -// Written by David Luff, started October 2001. -// -// Copyright (C) 2001 David C Luff - david.luff@nottingham.ac.uk -// -// This program is free software; you can redistribute it and/or -// modify it under the terms of the GNU General Public License as -// published by the Free Software Foundation; either version 2 of the -// License, or (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, but -// WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program; if not, write to the Free Software -// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - -#ifdef HAVE_CONFIG_H -# include -#endif - -#ifdef HAVE_WINDOWS_H -# include -#endif - -#include - -#include SG_GLU_H - -#include - -#include -#include
-#include - -#include "ATCdisplay.hxx" - - -// Constructor -FGATCDisplay::FGATCDisplay() { - rep_msg = false; - change_msg_flag = false; - dsp_offset1 = 0.0; - dsp_offset2 = 0.0; -} - - -// Destructor -FGATCDisplay::~FGATCDisplay() { -} - -void FGATCDisplay::init() { -} - -void FGATCDisplay::bind() { -} - -void FGATCDisplay::unbind() { -} - -void FGATCDisplay::update(double dt) -{ - std::cout << "OSGFIXME" << std::endl; -} - -// update - this actually draws the visuals and should be called from the main Flightgear rendering loop. -void FGATCDisplay::update(double dt, osg::State& state) { - - // These strings are used for temporary storage of the transmission string in order - // that the string we view only changes when the next repetition starts scrolling - // even though the master string (rep_msg_str) may change at any time. - static string msg1 = ""; - static string msg2 = ""; - - if( rep_msg || msgList.size() ) { - //cout << "In FGATC::update()" << endl; - SGPropertyNode *xsize_node = fgGetNode("/sim/startup/xsize"); - SGPropertyNode *ysize_node = fgGetNode("/sim/startup/ysize"); - int iwidth = xsize_node->getIntValue(); - int iheight = ysize_node->getIntValue(); - - glMatrixMode( GL_PROJECTION ); - glPushMatrix(); - glLoadIdentity(); - gluOrtho2D( 0, iwidth, 0, iheight ); - glMatrixMode( GL_MODELVIEW ); - glPushMatrix(); - glLoadIdentity(); - - glDisable( GL_DEPTH_TEST ); - glDisable( GL_LIGHTING ); - - glColor3f( 0.9, 0.4, 0.2 ); - - float fps = general.get_frame_rate(); - - if(rep_msg) { - //cout << "dsp_offset1 = " << dsp_offset1 << " dsp_offset2 = " << dsp_offset2 << endl; - if(dsp_offset1 == 0) { - msg1 = rep_msg_str; - } - if(dsp_offset2 == 0) { - msg2 = rep_msg_str; - } - // Check for the situation where one offset is negative and the message is changed - if(change_msg_flag) { - if(dsp_offset1 < 0) { - msg1 = rep_msg_str; - } else if(dsp_offset2 < 0) { - msg2 = rep_msg_str; - } - change_msg_flag = false; - } - - // guiFnt.drawString( rep_msg_str.c_str(), - // int(iwidth - guiFnt.getStringWidth(buf) - 10 - (int)dsp_offset), - // (iheight - 20) ); - guiFnt.drawString( msg1.c_str(), - int(iwidth - 10 - dsp_offset1), - (iheight - 20) ); - guiFnt.drawString( msg2.c_str(), - int(iwidth - 10 - dsp_offset2), - (iheight - 20) ); - - // Try to scroll at a frame rate independent speed - // 40 pixels/second looks about right for now - if(dsp_offset1 >= dsp_offset2) { - dsp_offset1+=(40.0/fps); - dsp_offset2 = dsp_offset1 - (rep_msg_str.size() * 10) - 100; - if(dsp_offset1 > (iwidth + (rep_msg_str.size() * 10))) - dsp_offset1 = 0; - } else { - dsp_offset2+=(40.0/fps); - dsp_offset1 = dsp_offset2 - (rep_msg_str.size() * 10) - 100; - if(dsp_offset2 > (iwidth + (rep_msg_str.size() * 10))) - dsp_offset2 = 0; - } - - } - - if(msgList.size()) { - //cout << "Attempting to render single message\n"; - // We have at least one non-repeating message to process - if(fgGetBool("/ATC/display/scroll-single-messages")) { // Scroll single messages across the screen. - msgList_itr = msgList.begin(); - int i = 0; - while(msgList_itr != msgList.end()) { - atcMessage m = *msgList_itr; - //cout << "m.counter = " << m.counter << '\n'; - if(m.dsp_offset > (iwidth + (m.msg.size() * 10))) { - //cout << "Stopping single message\n"; - msgList_itr = msgList.erase(msgList_itr); - } else if(m.counter > m.start_count) { - //cout << "Drawing single message\n"; - guiFnt.drawString( m.msg.c_str(), - int(iwidth - 10 - m.dsp_offset), - (iheight - 40) ); - m.counter += dt; - m.dsp_offset += (80.0/fps); - msgList[i] = m; - ++msgList_itr; - ++i; - } else { - //cout << "Not yet started single message\n"; - m.counter += dt; - msgList[i] = m; - ++msgList_itr; - ++i; - } - } - } else { // Display single messages for a short period of time. - msgList_itr = msgList.begin(); - int i = 0; - while(msgList_itr != msgList.end()) { - atcMessage m = *msgList_itr; - //cout << "m.counter = " << m.counter << '\n'; - if(m.counter > m.stop_count) { - //cout << "Stopping single message\n"; - msgList_itr = msgList.erase(msgList_itr); - } else if(m.counter > m.start_count) { - int pin = (((int)m.msg.size() * 8) >= iwidth ? 5 : (iwidth - (m.msg.size() * 8))/2); - //cout << m.msg << '\n'; - //cout << "pin = " << pin << ", iwidth = " << iwidth << ", msg.size = " << m.msg.size() << '\n'; - guiFnt.drawString( m.msg.c_str(), pin, (iheight - 40) ); - m.counter += dt; - msgList[i] = m; - ++msgList_itr; - ++i; - } else { - m.counter += dt; - msgList[i] = m; - ++msgList_itr; - ++i; - } - } - } - } - glEnable( GL_DEPTH_TEST ); - glEnable( GL_LIGHTING ); - glMatrixMode( GL_PROJECTION ); - glPopMatrix(); - glMatrixMode( GL_MODELVIEW ); - glPopMatrix(); - } -} - -void FGATCDisplay::RegisterSingleMessage(const string& msg, double delay) { -/**/ return; - //cout << msg << '\n'; - atcMessage m; - m.msg = msg; - m.repeating = false; - m.counter = 0.0; - m.start_count = delay; - m.stop_count = m.start_count + 5.0; // Display for 5ish seconds for now - this might have to change eg. be related to length of message in future - //cout << "m.stop_count = " << m.stop_count << '\n'; - m.id = 0; - m.dsp_offset = 0.0; - - msgList.push_back(m); - //cout << "Single message registered\n"; -} - -void FGATCDisplay::RegisterRepeatingMessage(const string& msg) { -/**/ return; - rep_msg = true; - rep_msg_str = msg; - return; -} - -void FGATCDisplay::ChangeRepeatingMessage(const string& newmsg) { -/**/ return; - rep_msg_str = newmsg; - change_msg_flag = true; - return; -} - -void FGATCDisplay::CancelRepeatingMessage() { -/**/ return; - rep_msg = false; - rep_msg_str = ""; - dsp_offset1 = 0; - dsp_offset2 = 0; - return; -} - diff --git a/src/ATC/ATCdisplay.hxx b/src/ATC/ATCdisplay.hxx deleted file mode 100644 index bf94d0acd..000000000 --- a/src/ATC/ATCdisplay.hxx +++ /dev/null @@ -1,96 +0,0 @@ -// ATCdisplay.hxx - class to manage the graphical display of ATC messages. -// - The idea is to separate the display of ATC messages from their -// - generation so that the generation may come from any source. -// -// Written by David Luff, started October 2001. -// -// Copyright (C) 2001 David C Luff - david.luff@nottingham.ac.uk -// -// This program is free software; you can redistribute it and/or -// modify it under the terms of the GNU General Public License as -// published by the Free Software Foundation; either version 2 of the -// License, or (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, but -// WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program; if not, write to the Free Software -// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - -#ifndef _FG_ATC_DISPLAY_HXX -#define _FG_ATC_DISPLAY_HXX - -#ifdef HAVE_CONFIG_H -# include -#endif - -#include -#include - -#include -#include - -SG_USING_STD(vector); -SG_USING_STD(string); - -struct atcMessage { - string msg; - bool repeating; - double counter; // count of how many seconds since the message was registered - double start_count; // value of counter at which display should start (seconds) - double stop_count; // value of counter at which display should stop (seconds) - int id; - double dsp_offset; -}; - -// ASSUMPTION - with two radios the list won't be long so we don't need to map the id's -typedef vector atcMessageList; -typedef atcMessageList::iterator atcMessageListIterator; - -class FGATCDisplay : public SGSubsystem -{ - -private: - bool rep_msg; // Flag to indicate there is a repeating transmission to display - bool change_msg_flag; // Flag to indicate that the repeating message has changed - double dsp_offset1; // Used to set the correct position of scrolling display - double dsp_offset2; - string rep_msg_str; // The repeating transmission to play - atcMessageList msgList; - atcMessageListIterator msgList_itr; - -public: - FGATCDisplay(); - ~FGATCDisplay(); - - void init(); - - void bind(); - - void unbind(); - - // Display any registered messages - void update(double dt, osg::State&); - void update(double dt); - - // Register a single message for display after a delay of delay seconds - // Will automatically stop displaying after a suitable interval. - void RegisterSingleMessage(const string& msg, double delay = 0.0); - - // For now we will assume only one repeating message at once - // This is not really robust - - // Register a continuously repeating message - void RegisterRepeatingMessage(const string& msg); - - // Change a repeating message - assume that the message changes after the string has finished for now - void ChangeRepeatingMessage(const string& newmsg); - - // Cancel the current repeating message - void CancelRepeatingMessage(); -}; - -#endif // _FG_ATC_DISPLAY_HXX diff --git a/src/ATC/ATCmgr.cxx b/src/ATC/ATCmgr.cxx index c06c64382..bbf99dfa6 100644 --- a/src/ATC/ATCmgr.cxx +++ b/src/ATC/ATCmgr.cxx @@ -28,7 +28,6 @@ #include "ATCmgr.hxx" #include "commlist.hxx" -#include "ATCdisplay.hxx" #include "ATCDialog.hxx" #include "ATCutils.hxx" #include "transmissionlist.hxx" diff --git a/src/ATC/Makefile.am b/src/ATC/Makefile.am index 2107b12cf..c560d1643 100644 --- a/src/ATC/Makefile.am +++ b/src/ATC/Makefile.am @@ -8,7 +8,6 @@ libATC_a_SOURCES = \ ground.hxx ground.cxx \ commlist.hxx commlist.cxx \ ATCDialog.hxx ATCDialog.cxx \ - ATCdisplay.hxx ATCdisplay.cxx \ ATCVoice.hxx ATCVoice.cxx \ ATCmgr.hxx ATCmgr.cxx \ ATCutils.hxx ATCutils.cxx \ diff --git a/src/ATC/approach.cxx b/src/ATC/approach.cxx index a0c2c504d..44784abf1 100644 --- a/src/ATC/approach.cxx +++ b/src/ATC/approach.cxx @@ -25,7 +25,6 @@ #include "approach.hxx" #include "transmission.hxx" #include "transmissionlist.hxx" -#include "ATCdisplay.hxx" #include "ATCDialog.hxx" #include @@ -756,6 +755,5 @@ int FGApproach::RemovePlane() { void FGApproach::set_message(const string &msg) { fgSetString("/sim/messages/approach", msg.c_str()); - globals->get_ATC_display()->RegisterSingleMessage( msg, 0 ); } diff --git a/src/ATC/atis.cxx b/src/ATC/atis.cxx index c4caefdd6..0957d18ac 100644 --- a/src/ATC/atis.cxx +++ b/src/ATC/atis.cxx @@ -45,7 +45,6 @@ SG_USING_STD(cout); #include "atis.hxx" #include "commlist.hxx" -#include "ATCdisplay.hxx" #include "ATCutils.hxx" #include "ATCmgr.hxx" @@ -70,7 +69,6 @@ void FGATIS::Update(double dt) { if(_displaying) { // Check if we need to update the message // - basically every hour and if the weather changes significantly at the station - //globals->get_ATC_display()->ChangeRepeatingMessage(transmission); } else { // We need to get and display the message UpdateTransmission(); diff --git a/src/ATC/ground.cxx b/src/ATC/ground.cxx index 1a1948383..4adfa9958 100644 --- a/src/ATC/ground.cxx +++ b/src/ATC/ground.cxx @@ -33,7 +33,6 @@ #include STL_FSTREAM #include "ground.hxx" -#include "ATCdisplay.hxx" #include "ATCutils.hxx" #include "AILocalTraffic.hxx" #include "ATCmgr.hxx" @@ -321,7 +320,6 @@ void FGGround::Update(double dt) { trns += ConvertRwyNumToSpokenString(activeRwy); if(_display) { fgSetString("/sim/messages/ground", trns.c_str()); - globals->get_ATC_display()->RegisterSingleMessage(trns, 0); } g->planePtr->RegisterTransmission(1); // cleared to taxi g->clearanceCounter = 0.0; @@ -340,7 +338,6 @@ void FGGround::Update(double dt) { trns += buf; if(_display) { fgSetString("/sim/messages/ground", trns.c_str()); - globals->get_ATC_display()->RegisterSingleMessage(trns, 0); } g->planePtr->RegisterTransmission(2); // contact tower delete *ground_traffic_itr; diff --git a/src/ATC/tower.cxx b/src/ATC/tower.cxx index cdeb18548..0b71c11ef 100644 --- a/src/ATC/tower.cxx +++ b/src/ATC/tower.cxx @@ -34,7 +34,6 @@ #include #include "tower.hxx" -#include "ATCdisplay.hxx" #include "ATCmgr.hxx" #include "ATCutils.hxx" #include "ATCDialog.hxx" @@ -507,7 +506,6 @@ void FGTower::Respond() { } trns += ConvertRwyNumToSpokenString(activeRwy); if(_display) { - //globals->get_ATC_display()->RegisterSingleMessage(trns, 0); pending_transmission = trns; Transmit(); } else { @@ -545,7 +543,6 @@ void FGTower::Respond() { string trns = t->plane.callsign; trns += " hold position"; if(_display) { - //globals->get_ATC_display()->RegisterSingleMessage(trns, 0); pending_transmission = trns; Transmit(); } @@ -585,7 +582,6 @@ void FGTower::Respond() { t->clearedToLand = false; } if(_display && disp) { - //globals->get_ATC_display()->RegisterSingleMessage(trns); pending_transmission = trns; Transmit(); } @@ -682,7 +678,6 @@ void FGTower::ProcessDownwindReport(TowerPlaneRec* t) { } } if(_display) { - //globals->get_ATC_display()->RegisterSingleMessage(trns); pending_transmission = trns; Transmit(); } @@ -716,7 +711,6 @@ void FGTower::ProcessRunwayVacatedReport(TowerPlaneRec* t) { } //cout << "trns = " << trns << '\n'; if(_display) { - //globals->get_ATC_display()->RegisterSingleMessage(trns); pending_transmission = trns; Transmit(); } @@ -829,7 +823,6 @@ void FGTower::ClearHoldingPlane(TowerPlaneRec* t) { timeSinceLastDeparture = 0.0; } if(_display) { - //globals->get_ATC_display()->RegisterSingleMessage(trns, 0); pending_transmission = trns; Transmit(); } diff --git a/src/GUI/mouse.cxx b/src/GUI/mouse.cxx index d60786623..29e1df262 100644 --- a/src/GUI/mouse.cxx +++ b/src/GUI/mouse.cxx @@ -73,34 +73,11 @@ SG_USING_STD(cout); Mouse stuff ---------------------------------------------------------------------*/ -static int _mX = 0; -static int _mY = 0; -static int _savedX = 0; -static int _savedY = 0; -static int last_buttons = 0 ; static int mouse_active = 0; -static int mouse_joystick_control = 0; - -//static time_t mouse_off_time; -//static int mouse_timed_out; - -// to allow returning to previous view -// on second left click in MOUSE_VIEW mode -// This has file scope so that it can be reset -// if the little rodent is moved NHV -static int _mVtoggle = 0; static int MOUSE_XSIZE = 0; static int MOUSE_YSIZE = 0; -// uncomment this for view to exactly follow mouse in MOUSE_VIEW mode -// else smooth out the view panning to .01 radian per frame -// see view_offset smoothing mechanism in main.cxx -#define NO_SMOOTH_MOUSE_VIEW - -// uncomment following to -#define RESET_VIEW_ON_LEAVING_MOUSE_VIEW - /* -------------------------------------------------------------------- Support for mouse as control yoke (david@megginson.com) @@ -123,115 +100,12 @@ TODO: allow differential braking (this will be useful if FlightGear MouseMode mouse_mode = MOUSE_POINTER; -static double aileron_sensitivity = 1.0/500.0; -static double elevator_sensitivity = 1.0/500.0; -static double brake_sensitivity = 1.0/250.0; -static double throttle_sensitivity = 1.0/250.0; -static double rudder_sensitivity = 1.0/500.0; -static double trim_sensitivity = 1.0/1000.0; - void guiInitMouse(int width, int height) { MOUSE_XSIZE = width; MOUSE_YSIZE = height; } -static inline int guiGetMouseButton(void) -{ - return last_buttons; -} - -static inline void guiGetMouse(int *x, int *y) -{ - *x = _mX; - *y = _mY; -}; - -static inline int left_button( void ) { - return( last_buttons & (1 << MOUSE_BUTTON_LEFT) ); -} - -static inline int middle_button( void ) { - return( last_buttons & (1 << MOUSE_BUTTON_MIDDLE) ); -} - -static inline int right_button( void ) { - return( last_buttons & (1 << MOUSE_BUTTON_RIGHT) ); -} - -static inline void set_goal_view_offset( float offset ) -{ - globals->get_current_view()->setGoalHeadingOffset_deg(offset * SGD_RADIANS_TO_DEGREES); -} - -static inline void set_view_offset( float offset ) -{ - globals->get_current_view()->setHeadingOffset_deg(offset * SGD_RADIANS_TO_DEGREES); -} - -static inline void set_goal_view_tilt( float tilt ) -{ - globals->get_current_view()->setGoalPitchOffset_deg(tilt); -} - -static inline void set_view_tilt( float tilt ) -{ - globals->get_current_view()->setPitchOffset_deg(tilt); -} - -static inline float get_view_offset() { - return globals->get_current_view()->getHeadingOffset_deg() * SGD_DEGREES_TO_RADIANS; -} - -static inline float get_goal_view_offset() { - return globals->get_current_view()->getGoalHeadingOffset_deg() * SGD_DEGREES_TO_RADIANS; -} - -static inline void move_brake(float offset) { - globals->get_controls()->move_brake_left(offset); - globals->get_controls()->move_brake_right(offset); -} - -static inline void move_throttle(float offset) { - globals->get_controls()->move_throttle(FGControls::ALL_ENGINES, offset); -} - -static inline void move_rudder(float offset) { - globals->get_controls()->move_rudder(offset); -} - -static inline void move_elevator_trim(float offset) { - globals->get_controls()->move_elevator_trim(offset); -} - -static inline void move_aileron(float offset) { - globals->get_controls()->move_aileron(offset); -} - -static inline void move_elevator(float offset) { - globals->get_controls()->move_elevator(offset); -} - -static inline float get_aileron() { - return globals->get_controls()->get_aileron(); -} - -static inline float get_elevator() { - return globals->get_controls()->get_elevator(); -} - -static inline bool AP_HeadingEnabled() { - static const SGPropertyNode *heading_enabled - = fgGetNode("/autopilot/locks/heading"); - return ( strcmp( heading_enabled->getStringValue(), "" ) != 0 ); -} - -static inline bool AP_AltitudeEnabled() { - static const SGPropertyNode *altitude_enabled - = fgGetNode("/autopilot/locks/altitude"); - return ( strcmp( altitude_enabled->getStringValue(), "" ) != 0 ); -} - void TurnCursorOn( void ) { mouse_active = ~0; @@ -288,29 +162,3 @@ void maybeToggleMouse( void ) #endif // #ifdef WIN32 } -//#define TRANSLATE_HUD -// temporary hack until pitch_offset is added to view pipeline -void fgTranslateHud( void ) { -#ifdef TRANSLATE_HUD - if(mouse_mode == MOUSE_VIEW) { - - int ww = MOUSE_XSIZE; - int wh = MOUSE_YSIZE; - - float y = 4*(_mY-(wh/2));// * ((wh/SGD_PI)*SG_RADIANS_TO_DEGREES); - - float x = get_view_offset() * SG_RADIANS_TO_DEGREES; - - if( x < -180 ) x += 360; - else if( x > 180 ) x -= 360; - - x *= ww/90.0; - // x *= ww/180.0; - // x *= ww/360.0; - - // glTranslatef( x*ww/640, y*wh/480, 0 ); - glTranslatef( x*640/ww, y*480/wh, 0 ); - } -#endif // TRANSLATE_HUD -} - diff --git a/src/Main/fg_init.cxx b/src/Main/fg_init.cxx index d50e4f7ab..d05d07bc8 100644 --- a/src/Main/fg_init.cxx +++ b/src/Main/fg_init.cxx @@ -67,7 +67,6 @@ #include #include #include -#include #include #include #include @@ -1718,14 +1717,6 @@ bool fgInitSubsystems() { globals->add_subsystem("voice", new FGVoiceMgr); #endif - //////////////////////////////////////////////////////////////////// - // Initialise ATC display system - //////////////////////////////////////////////////////////////////// - - SG_LOG(SG_GENERAL, SG_INFO, " ATC Display"); - globals->set_ATC_display(new FGATCDisplay); - globals->get_ATC_display()->init(); - //////////////////////////////////////////////////////////////////// // Initialise the ATC Manager //////////////////////////////////////////////////////////////////// diff --git a/src/Main/fg_props.cxx b/src/Main/fg_props.cxx index aed7cbf0f..30c298edb 100644 --- a/src/Main/fg_props.cxx +++ b/src/Main/fg_props.cxx @@ -35,7 +35,6 @@ #include STL_IOSTREAM -#include #include #include