]> git.mxchange.org Git - flightgear.git/blobdiff - src/Cockpit/hud.cxx
Fix MSVC compilation
[flightgear.git] / src / Cockpit / hud.cxx
index 35513b45c60c503642cb750ded24820e3d280a00..f9b9f3a9749b9cac69fb896ef681d5ed2f79d22b 100644 (file)
 #include <simgear/compiler.h>
 #include <simgear/structure/exception.hxx>
 
-#include STL_STRING
-#include STL_FSTREAM
+#include <string>
+#include <fstream>
 
 #ifdef HAVE_CONFIG_H
 #  include <config.h>
 #endif
 
-#ifdef HAVE_WINDOWS_H
-#  include <windows.h>
-#endif
-
-#ifdef __BORLANDC__
-#  define exception c_exception
-#endif
-
 #include <math.h>
-
 #include <stdlib.h>
 #include <stdio.h>              // char related functions
 #include <string.h>             // strcmp()
 
-#include SG_GLU_H
-
 #include <simgear/constants.h>
 #include <simgear/debug/logstream.hxx>
 #include <simgear/misc/sg_path.hxx>
+#include <simgear/props/props_io.hxx>
+
+#include <osg/GLU>
 
 #include <Aircraft/aircraft.hxx>
 //#include <Autopilot/xmlauto.hxx>
 #include <GUI/new_gui.hxx>           // FGFontCache
 #include <Main/globals.hxx>
 #include <Scenery/scenery.hxx>
+#include <Airports/runways.hxx>
 
 #include "hud.hxx"
 
@@ -63,7 +56,7 @@ static HUD_Properties *HUDprop = 0;
 
 static char units[5];
 
-deque<instr_item *> HUD_deque;
+deque<SGSharedPtr<instr_item> > HUD_deque;
 
 fgTextList HUD_TextList;
 fgLineList HUD_LineList;
@@ -268,9 +261,11 @@ int fgHUDInit( fgAIRCRAFT * /* current_aircraft */ )
     }
 
     FGFontCache *fc = globals->get_fontcache();
-    HUD_Font = fc->getTexFont(fgGetString("/sim/hud/font/name", "Helvetica.txf"));
+    const char* fileName = fgGetString("/sim/hud/font/name", "Helvetica.txf");
+    HUD_Font = fc->getTexFont(fileName);
     if (!HUD_Font)
-        throw sg_throwable(string("/sim/hud/font/name is not a texture font"));
+        throw sg_io_exception("/sim/hud/font/name is not a texture font",
+                              sg_location(fileName));
 
     HUD_TextSize = fgGetFloat("/sim/hud/font/size", 10);
 
@@ -542,6 +537,7 @@ void fgTextList::draw()
     vector<fgText>::iterator lastString = List.end();
 
     glPushAttrib(GL_COLOR_BUFFER_BIT);
+    glEnable(GL_TEXTURE_2D);
     glEnable(GL_BLEND);
     if (HUDprop->isTransparent())
         glBlendFunc(GL_SRC_ALPHA, GL_ONE);