]> git.mxchange.org Git - flightgear.git/commitdiff
let fgpanel compile under vc90
authorTorsten Dreyer <Torsten@t3r.de>
Fri, 27 May 2011 18:53:16 +0000 (20:53 +0200)
committerTorsten Dreyer <Torsten@t3r.de>
Fri, 27 May 2011 18:53:16 +0000 (20:53 +0200)
12 files changed:
utils/fgpanel/.cvsignore [new file with mode: 0644]
utils/fgpanel/FGFontCache.cxx
utils/fgpanel/FGFontCache.hxx
utils/fgpanel/FGGLApplication.cxx
utils/fgpanel/FGPNGTextureLoader.cxx
utils/fgpanel/FGPanelApplication.cxx
utils/fgpanel/FGPanelApplication.hxx
utils/fgpanel/FGPanelProtocol.cxx
utils/fgpanel/FGPanelProtocol.hxx
utils/fgpanel/FGRGBTextureLoader.cxx
utils/fgpanel/panel.cxx
utils/fgpanel/panel_io.cxx

diff --git a/utils/fgpanel/.cvsignore b/utils/fgpanel/.cvsignore
new file mode 100644 (file)
index 0000000..3397a7a
--- /dev/null
@@ -0,0 +1,4 @@
+.deps
+Makefile
+Makefile.in
+fgpanel
index 129e247435ef86d79cad76839650fe1afef349d3..19a1b37460cc5fcc04880ea3407e2cab67369432 100644 (file)
 #  include <config.h>
 #endif
 
-using namespace std;
+#include "FGGLApplication.hxx"
+#ifdef HAVE_WINDOWS_H
+#include <windows.h>
+#endif
+
+
 #include <map>
 #include <algorithm>
 #include "ApplicationProperties.hxx"
@@ -93,7 +98,7 @@ inline bool FGFontCache::FntParamsLess::operator()(const FntParams& f1,
 struct FGFontCache::fnt *
 FGFontCache::getfnt(const char *name, float size, float slant)
 {
-    string fontName(name);
+    std::string fontName(name);
     FntParams fntParams(fontName, size, slant);
     PuFontMap::iterator i = _puFonts.find(fntParams);
     if (i != _puFonts.end())
@@ -183,7 +188,7 @@ FGFontCache::getfntpath(const char *name)
 
 bool FGFontCache::initializeFonts()
 {
-    static string fontext("txf");
+    static std::string fontext("txf");
     init();
     ulDir* fontdir = ulOpenDir(_path.c_str());
     if (!fontdir)
@@ -195,7 +200,7 @@ bool FGFontCache::initializeFonts()
         if (path.extension() == fontext) {
             fntTexFont* f = new fntTexFont;
             if (f->load((char *)path.c_str()))
-                _texFonts[string(dirEntry->d_name)] = f;
+                _texFonts[std::string(dirEntry->d_name)] = f;
             else
                 delete f;
         }
index 81202eee4e17add92d1aa43803565358d3a88a9a..2fd03d8ed4f7f051933dfe386b3c5fa8cb7ce2c2 100644 (file)
@@ -14,6 +14,7 @@
 //
 #ifndef __FGFONTCACHE_HXX
 #define __FGFONTCACHE_HXX
+#include <simgear/math/SGMath.hxx>
 #include <simgear/misc/sg_path.hxx>
 #include <simgear/props/props.hxx>
 #include <plib/pu.h>
@@ -55,8 +56,8 @@ private:
     // Path to the font directory
     SGPath _path;
 
-    typedef map<const string, fntTexFont*> TexFontMap;
-    typedef map<const FntParams, fnt*, FntParamsLess> PuFontMap;
+    typedef std::map<const std::string, fntTexFont*> TexFontMap;
+    typedef std::map<const FntParams, fnt*, FntParamsLess> PuFontMap;
     TexFontMap _texFonts;
     PuFontMap _puFonts;
 
index 5c52943b2c8a87734d32e816c400e4733a4bc438..54550ad4bc722f1a4286c0c08dbab085afe102b3 100644 (file)
 //  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 <config.h>
+#endif
+
 #include "FGGLApplication.hxx"
-#include "GL/gl.h"
-#include "GL/glut.h"
+#ifdef HAVE_WINDOWS_H
+#include <windows.h>
+#define snprintf sprintf_s\r
+#endif
+#include <GL/gl.h>
+#include <GL/glut.h>
 
 #include <iostream>
 #include <exception>
index 236792b57360cbf90fffd819f276f513bab9ec57..1d18e4190041290a93063b3ac7e27811dbf899d6 100644 (file)
 //  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 <config.h>
+#endif
+
+#ifdef HAVE_WINDOWS_H
+#include <windows.h>
+#endif
 #include "FGPNGTextureLoader.hxx"
 
 #include <GL/glu.h>
index e01f206951fc6259635fd9247daa6c81378183c5..a57b8f6a3879009bb9d732cdf8fc9de5e9ab8eb6 100644 (file)
 //  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 <config.h>
+#endif
+
+#ifdef HAVE_WINDOWS_H
+#include <windows.h>
+#endif
+
+#include "FGGLApplication.hxx"
 #include "FGPanelApplication.hxx"
 #include <GL/gl.h>
 #include <GL/glut.h>
@@ -131,7 +141,7 @@ void FGPanelApplication::Init()
 {
   glAlphaFunc(GL_GREATER, 0.1);
   glutSetCursor( GLUT_CURSOR_NONE );
-  ApplicationProperties::fontCache.initializeFonts();  
+  ApplicationProperties::fontCache.initializeFonts();
 }
 
 void FGPanelApplication::Reshape( int width, int height )
@@ -172,8 +182,7 @@ void FGPanelApplication::Key( unsigned char key, int x, int y )
 {
   switch( key ) {
     case 0x1b:
-      if( gameMode ) glutLeaveGameMode();
-      else           glutDestroyWindow( windowId );
+      exit(0);
       break;
   }
 }
@@ -226,7 +235,11 @@ double FGPanelApplication::Sleep()
     double elapsed_us = (current_time_stamp - last_time_stamp).toUSecs();
     if ( elapsed_us < frame_us ) {
       double requested_us = frame_us - elapsed_us;
+#ifdef _WIN32
+      ::Sleep ((int)(requested_us / 1000.0)) ;
+#else
       usleep ( (useconds_t)(requested_us ) ) ;
+#endif
     }
     // busy wait timing loop.
     //
index f2652ee3a9106cdabbd7f38e8271fc67586ba207..b67cc562b4435ee0e9ce20b911e73a3395922ad9 100644 (file)
@@ -21,6 +21,7 @@
 #include "FGGLApplication.hxx"
 #include "FGPanelProtocol.hxx"
 
+#include <simgear/math/SGMath.hxx>
 #include <simgear/structure/subsystem_mgr.hxx>
 #include <simgear/props/props.hxx>
 
index 0743724c856ed1462416dcde7a8f1e1571eb07be..7efc849ed31144fdb505bf0d2a5c6eefa3776813 100644 (file)
 //  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 <config.h>
+#endif
+
+#ifdef HAVE_WINDOWS_H
+#include <windows.h>
+#endif
+
+#ifdef WIN32
+#define strtof strtod
+#endif
+
 #include "FGPanelProtocol.hxx"
 #include "ApplicationProperties.hxx"
 #include <simgear/io/sg_socket.hxx>
index 5b08daf7fe93c461cbab0cc82bc0a989b656e261..b23bf947f44ef7a0befc36647da1eef00464caae 100644 (file)
@@ -17,6 +17,7 @@
 //
 #ifndef __FGPANELPROTOCOL_HXX
 #define __FGPANELPROTOCOL_HXX
+#include <simgear/math/SGMath.hxx>
 #include <simgear/structure/subsystem_mgr.hxx>
 #include <simgear/props/props.hxx>
 #include <simgear/io/iochannel.hxx>
index faf136942c4c48f310f15b69fb0fc1ca35912037..e9ef556abbbcfa062e405f7dfd706353b63dd587 100644 (file)
 // Reader for sgi's .rgb format.
 // specification can be found at http://local.wasp.uwa.edu.au/~pbourke/dataformats/sgirgb/sgiversion.html
 
+#ifdef HAVE_CONFIG_H
+#  include <config.h>
+#endif
+
+#ifdef HAVE_WINDOWS_H
+#include <windows.h>
+#endif
+
 #include "FGRGBTextureLoader.hxx"
 #include <GL/gl.h>
 #include <GL/glu.h>
index 89044997f1d680ffa23d8693393e82461ee9c88a..ff8cdc6347958f5fff150cddc3d75f011fe3e811 100644 (file)
@@ -36,6 +36,7 @@
 #include <plib/fnt.h>
 
 #include <simgear/debug/logstream.hxx>
+#include <simgear/math/SGMath.hxx>
 #include <simgear/misc/sg_path.hxx>
 
 #include "panel.hxx"
index 9f5084cd38437146f3614f63ecad2681472256f3..d0bd6b3585e8f163c47d5948f5cf66c1adb7d88f 100644 (file)
@@ -29,6 +29,7 @@
 #include <string.h>            // for strcmp()
 
 #include <simgear/compiler.h>
+#include <simgear/math/SGMath.hxx>
 #include <simgear/structure/exception.hxx>
 #include <simgear/debug/logstream.hxx>
 #include <simgear/misc/sg_path.hxx>