//
// 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., 675 Mass Ave, Cambridge, MA 02139, USA.
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
-#include <simgear/misc/props.hxx>
+#ifdef HAVE_WINDOWS_H
+# include <windows.h>
+#endif
+
+#include <simgear/compiler.h>
+
+#include SG_GLU_H
+
+#include <simgear/props/props.hxx>
#include <Include/general.hxx>
#include <Main/fg_props.hxx>
FGATCDisplay::FGATCDisplay() {
rep_msg = false;
change_msg_flag = false;
- dsp_offset1 = 0;
- dsp_offset2 = 0;
+ dsp_offset1 = 0.0;
+ dsp_offset2 = 0.0;
}
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) {
+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
//cout << "Stopping single message\n";
msgList_itr = msgList.erase(msgList_itr);
} else if(m.counter > m.start_count) {
- guiFnt.drawString( m.msg.c_str(),
- (iwidth - (m.msg.size() * 8))/2,
- //iwidth/2,
- (iheight - 40) ); // TODO - relate the distance in that the string is rendered to the string length.
+ 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;
}
}
-void FGATCDisplay::RegisterSingleMessage(string msg, double delay) {
+void FGATCDisplay::RegisterSingleMessage(const string& msg, double delay) {
+/**/ return;
+ //cout << msg << '\n';
atcMessage m;
m.msg = msg;
m.repeating = false;
//cout << "Single message registered\n";
}
-void FGATCDisplay::RegisterRepeatingMessage(string msg) {
+void FGATCDisplay::RegisterRepeatingMessage(const string& msg) {
+/**/ return;
rep_msg = true;
rep_msg_str = msg;
return;
}
-void FGATCDisplay::ChangeRepeatingMessage(string newmsg) {
+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;