diff --git a/utils/fgpanel/.cvsignore b/utils/fgpanel/.cvsignore new file mode 100644 index 000000000..3397a7a41 --- /dev/null +++ b/utils/fgpanel/.cvsignore @@ -0,0 +1,4 @@ +.deps +Makefile +Makefile.in +fgpanel diff --git a/utils/fgpanel/FGFontCache.cxx b/utils/fgpanel/FGFontCache.cxx index 129e24743..19a1b3746 100644 --- a/utils/fgpanel/FGFontCache.cxx +++ b/utils/fgpanel/FGFontCache.cxx @@ -17,7 +17,12 @@ # include #endif -using namespace std; +#include "FGGLApplication.hxx" +#ifdef HAVE_WINDOWS_H +#include +#endif + + #include #include #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; } diff --git a/utils/fgpanel/FGFontCache.hxx b/utils/fgpanel/FGFontCache.hxx index 81202eee4..2fd03d8ed 100644 --- a/utils/fgpanel/FGFontCache.hxx +++ b/utils/fgpanel/FGFontCache.hxx @@ -14,6 +14,7 @@ // #ifndef __FGFONTCACHE_HXX #define __FGFONTCACHE_HXX +#include #include #include #include @@ -55,8 +56,8 @@ private: // Path to the font directory SGPath _path; - typedef map TexFontMap; - typedef map PuFontMap; + typedef std::map TexFontMap; + typedef std::map PuFontMap; TexFontMap _texFonts; PuFontMap _puFonts; diff --git a/utils/fgpanel/FGGLApplication.cxx b/utils/fgpanel/FGGLApplication.cxx index 5c52943b2..54550ad4b 100644 --- a/utils/fgpanel/FGGLApplication.cxx +++ b/utils/fgpanel/FGGLApplication.cxx @@ -15,9 +15,18 @@ // 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 + #include "FGGLApplication.hxx" -#include "GL/gl.h" -#include "GL/glut.h" +#ifdef HAVE_WINDOWS_H +#include +#define snprintf sprintf_s +#endif +#include +#include #include #include diff --git a/utils/fgpanel/FGPNGTextureLoader.cxx b/utils/fgpanel/FGPNGTextureLoader.cxx index 236792b57..1d18e4190 100644 --- a/utils/fgpanel/FGPNGTextureLoader.cxx +++ b/utils/fgpanel/FGPNGTextureLoader.cxx @@ -13,6 +13,13 @@ // 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 "FGPNGTextureLoader.hxx" #include diff --git a/utils/fgpanel/FGPanelApplication.cxx b/utils/fgpanel/FGPanelApplication.cxx index e01f20695..a57b8f6a3 100644 --- a/utils/fgpanel/FGPanelApplication.cxx +++ b/utils/fgpanel/FGPanelApplication.cxx @@ -15,6 +15,16 @@ // 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 "FGGLApplication.hxx" #include "FGPanelApplication.hxx" #include #include @@ -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. // diff --git a/utils/fgpanel/FGPanelApplication.hxx b/utils/fgpanel/FGPanelApplication.hxx index f2652ee3a..b67cc562b 100644 --- a/utils/fgpanel/FGPanelApplication.hxx +++ b/utils/fgpanel/FGPanelApplication.hxx @@ -21,6 +21,7 @@ #include "FGGLApplication.hxx" #include "FGPanelProtocol.hxx" +#include #include #include diff --git a/utils/fgpanel/FGPanelProtocol.cxx b/utils/fgpanel/FGPanelProtocol.cxx index 0743724c8..7efc849ed 100644 --- a/utils/fgpanel/FGPanelProtocol.cxx +++ b/utils/fgpanel/FGPanelProtocol.cxx @@ -15,6 +15,18 @@ // 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 + +#ifdef WIN32 +#define strtof strtod +#endif + #include "FGPanelProtocol.hxx" #include "ApplicationProperties.hxx" #include diff --git a/utils/fgpanel/FGPanelProtocol.hxx b/utils/fgpanel/FGPanelProtocol.hxx index 5b08daf7f..b23bf947f 100644 --- a/utils/fgpanel/FGPanelProtocol.hxx +++ b/utils/fgpanel/FGPanelProtocol.hxx @@ -17,6 +17,7 @@ // #ifndef __FGPANELPROTOCOL_HXX #define __FGPANELPROTOCOL_HXX +#include #include #include #include diff --git a/utils/fgpanel/FGRGBTextureLoader.cxx b/utils/fgpanel/FGRGBTextureLoader.cxx index faf136942..e9ef556ab 100644 --- a/utils/fgpanel/FGRGBTextureLoader.cxx +++ b/utils/fgpanel/FGRGBTextureLoader.cxx @@ -17,6 +17,14 @@ // 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 +#endif + +#ifdef HAVE_WINDOWS_H +#include +#endif + #include "FGRGBTextureLoader.hxx" #include #include diff --git a/utils/fgpanel/panel.cxx b/utils/fgpanel/panel.cxx index 89044997f..ff8cdc634 100644 --- a/utils/fgpanel/panel.cxx +++ b/utils/fgpanel/panel.cxx @@ -36,6 +36,7 @@ #include #include +#include #include #include "panel.hxx" diff --git a/utils/fgpanel/panel_io.cxx b/utils/fgpanel/panel_io.cxx index 9f5084cd3..d0bd6b358 100644 --- a/utils/fgpanel/panel_io.cxx +++ b/utils/fgpanel/panel_io.cxx @@ -29,6 +29,7 @@ #include // for strcmp() #include +#include #include #include #include