diff --git a/source/glest_game/main/main.cpp b/source/glest_game/main/main.cpp index 66fbd700..dbb08443 100644 --- a/source/glest_game/main/main.cpp +++ b/source/glest_game/main/main.cpp @@ -2466,8 +2466,8 @@ int glestMain(int argc, char** argv) { if( haveSpecialOutputCommandLineOption == false || hasCommandArgument(argc, argv,GAME_ARGS[GAME_ARG_VERSION]) == true) { #ifdef USE_STREFLOP -# define STREFLOP_NO_DENORMALS - streflop_init(); +//# define STREFLOP_NO_DENORMALS +// streflop_init(); printf("%s, SVN: [%s], [STREFLOP]\n",getNetworkVersionString().c_str(),getSVNRevisionString().c_str()); #else printf("%s, SVN: [%s]\n",getNetworkVersionString().c_str(),getSVNRevisionString().c_str()); diff --git a/source/shared_lib/include/platform/sdl/platform_main.h b/source/shared_lib/include/platform/sdl/platform_main.h index 1d7a0a7d..d9784bd4 100644 --- a/source/shared_lib/include/platform/sdl/platform_main.h +++ b/source/shared_lib/include/platform/sdl/platform_main.h @@ -277,26 +277,53 @@ bool hasCommandArgument(int argc, char** argv,const string argName, int *foundIn return result; } -#define MAIN_FUNCTION(X) int main(int argc, char **argv) \ -{ \ - if(hasCommandArgument(argc, argv,string(GAME_ARGS[GAME_ARG_HELP])) == true || \ - hasCommandArgument(argc, argv,string(GAME_ARGS[GAME_ARG_VERSION])) == true || \ - hasCommandArgument(argc, argv,string(GAME_ARGS[GAME_ARG_SHOW_INI_SETTINGS])) == true || \ - hasCommandArgument(argc, argv,string(GAME_ARGS[GAME_ARG_MASTERSERVER_MODE])) == true) { \ - if(SDL_Init(SDL_INIT_TIMER | SDL_INIT_JOYSTICK) < 0) { \ - std::cerr << "Couldn't initialize SDL: " << SDL_GetError() << "\n"; \ - return 1; \ - } \ - } \ - else { \ - if(SDL_Init(SDL_INIT_EVERYTHING) < 0) { \ - std::cerr << "Couldn't initialize SDL: " << SDL_GetError() << "\n"; \ - return 1; \ - } \ - } \ - SDL_EnableUNICODE(1); \ - SDL_EnableKeyRepeat(SDL_DEFAULT_REPEAT_DELAY, SDL_DEFAULT_REPEAT_INTERVAL); \ - int result = X(argc, argv); \ +int mainSetup(int argc, char **argv) { + bool haveSpecialOutputCommandLineOption = false; + + if( hasCommandArgument(argc, argv,GAME_ARGS[GAME_ARG_OPENGL_INFO]) == true || + hasCommandArgument(argc, argv,GAME_ARGS[GAME_ARG_SDL_INFO]) == true || + hasCommandArgument(argc, argv,GAME_ARGS[GAME_ARG_LUA_INFO]) == true || + hasCommandArgument(argc, argv,GAME_ARGS[GAME_ARG_CURL_INFO]) == true || + hasCommandArgument(argc, argv,GAME_ARGS[GAME_ARG_VERSION]) == true || + hasCommandArgument(argc, argv,GAME_ARGS[GAME_ARG_SHOW_INI_SETTINGS]) == true || + hasCommandArgument(argc, argv,GAME_ARGS[GAME_ARG_VALIDATE_TECHTREES]) == true || + hasCommandArgument(argc, argv,GAME_ARGS[GAME_ARG_VALIDATE_FACTIONS]) == true || + hasCommandArgument(argc, argv,GAME_ARGS[GAME_ARG_VALIDATE_SCENARIO]) == true) { + haveSpecialOutputCommandLineOption = true; + } + + if( haveSpecialOutputCommandLineOption == false) { +#ifdef USE_STREFLOP +#define STREFLOP_NO_DENORMALS + streflop_init(); +#endif + } + + if(hasCommandArgument(argc, argv,string(GAME_ARGS[GAME_ARG_HELP])) == true || + hasCommandArgument(argc, argv,string(GAME_ARGS[GAME_ARG_VERSION])) == true || + hasCommandArgument(argc, argv,string(GAME_ARGS[GAME_ARG_SHOW_INI_SETTINGS])) == true || + hasCommandArgument(argc, argv,string(GAME_ARGS[GAME_ARG_MASTERSERVER_MODE])) == true) { + if(SDL_Init(SDL_INIT_TIMER | SDL_INIT_JOYSTICK) < 0) { + std::cerr << "Couldn't initialize SDL: " << SDL_GetError() << "\n"; + return 1; + } + } + else { + if(SDL_Init(SDL_INIT_EVERYTHING) < 0) { + std::cerr << "Couldn't initialize SDL: " << SDL_GetError() << "\n"; + return 1; + } + } + SDL_EnableUNICODE(1); + SDL_EnableKeyRepeat(SDL_DEFAULT_REPEAT_DELAY, SDL_DEFAULT_REPEAT_INTERVAL); + return 0; +} + +#define MAIN_FUNCTION(X) int main(int argc, char **argv) { \ + int result = mainSetup(argc,argv); \ + if(result == 0) { \ + result = X(argc, argv); \ + } \ return result; \ } diff --git a/source/shared_lib/sources/graphics/gl/font_textFTGL.cpp b/source/shared_lib/sources/graphics/gl/font_textFTGL.cpp index 67e79780..76fafdd0 100644 --- a/source/shared_lib/sources/graphics/gl/font_textFTGL.cpp +++ b/source/shared_lib/sources/graphics/gl/font_textFTGL.cpp @@ -40,6 +40,7 @@ int TextFTGL::faceResolution = 72; //==================================================================== TextFTGL::TextFTGL(FontTextHandlerType type) : Text(type) { + //throw runtime_error("FTGL!"); //setenv("MEGAGLEST_FONT","/usr/share/fonts/truetype/wqy/wqy-zenhei.ttc",0); //setenv("MEGAGLEST_FONT","/usr/share/fonts/truetype/arphic/uming.ttc",0); // Chinese //setenv("MEGAGLEST_FONT","/usr/share/fonts/truetype/arphic/ukai.ttc",0); // Chinese