diff --git a/source/glest_game/game/chat_manager.cpp b/source/glest_game/game/chat_manager.cpp index dbc9d374..24090d99 100644 --- a/source/glest_game/game/chat_manager.cpp +++ b/source/glest_game/game/chat_manager.cpp @@ -232,7 +232,7 @@ void ChatManager::keyPress(SDL_KeyboardEvent c) { } text += buf; - printf("text length = %d\n",text.length()); + //printf("text length = %d\n",text.length()); SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d] [%d] szCharText [%s]\n",__FILE__,__FUNCTION__,__LINE__, key,text.c_str()); diff --git a/source/glest_game/menu/menu_state_custom_game.cpp b/source/glest_game/menu/menu_state_custom_game.cpp index 3aab0252..0944c1e3 100644 --- a/source/glest_game/menu/menu_state_custom_game.cpp +++ b/source/glest_game/menu/menu_state_custom_game.cpp @@ -1299,10 +1299,12 @@ void MenuStateCustomGame::PlayNow(bool saveGame) { Lang &lang= Lang::getInstance(); char szMsg[1024]=""; if(lang.hasString("NetworkSlotUnassignedErrorUI") == true) { - sprintf(szMsg,lang.get("NetworkSlotUnassignedErrorUI").c_str()); + //sprintf(szMsg,lang.get("NetworkSlotUnassignedErrorUI").c_str()); + strcpy(szMsg,lang.get("NetworkSlotUnassignedErrorUI").c_str()); } else { - sprintf(szMsg,"Cannot start game.\nSome player(s) are not in a network game slot!"); + //sprintf(szMsg,"Cannot start game.\nSome player(s) are not in a network game slot!"); + strcpy(szMsg,"Cannot start game.\nSome player(s) are not in a network game slot!"); } showMessageBox(szMsg, "", false); @@ -1311,10 +1313,12 @@ void MenuStateCustomGame::PlayNow(bool saveGame) { for(unsigned int j = 0; j < languageList.size(); ++j) { char szMsg[1024]=""; if(lang.hasString("NetworkSlotUnassignedError",languageList[j]) == true) { - sprintf(szMsg,lang.get("NetworkSlotUnassignedError").c_str()); + //sprintf(szMsg,lang.get("NetworkSlotUnassignedError").c_str()); + strcpy(szMsg,lang.get("NetworkSlotUnassignedError").c_str()); } else { - sprintf(szMsg,"Cannot start game, some player(s) are not in a network game slot!"); + //sprintf(szMsg,"Cannot start game, some player(s) are not in a network game slot!"); + strcpy(szMsg,"Cannot start game, some player(s) are not in a network game slot!"); } serverInterface->sendTextMessage(szMsg,-1, true,languageList[j]); diff --git a/source/shared_lib/include/util/string_utils.h b/source/shared_lib/include/util/string_utils.h index 1f000609..5637bb08 100644 --- a/source/shared_lib/include/util/string_utils.h +++ b/source/shared_lib/include/util/string_utils.h @@ -25,13 +25,6 @@ # include #include "types.h" -/*! -** \brief Force the Use of the Boost functions -*/ -# define TA3D_USE_BOOST 0 - - - //! \name Macros for Shared::Util::String //@{ diff --git a/source/shared_lib/sources/graphics/font.cpp b/source/shared_lib/sources/graphics/font.cpp index 81a5be9c..2fea1e0e 100644 --- a/source/shared_lib/sources/graphics/font.cpp +++ b/source/shared_lib/sources/graphics/font.cpp @@ -40,9 +40,9 @@ bool Font::fontIsRightToLeft = false; // This value is used to scale the font text rendering // in 3D render mode -float Font::scaleFontValue = 0.80; +float Font::scaleFontValue = 0.80f; // This value is used for centering font text vertically (height) -float Font::scaleFontValueCenterHFactor = 4.0; +float Font::scaleFontValueCenterHFactor = 4.0f; //float Font::scaleFontValue = 1.0; //float Font::scaleFontValueCenterHFactor = 4.0; diff --git a/source/shared_lib/sources/graphics/gl/font_textFTGL.cpp b/source/shared_lib/sources/graphics/gl/font_textFTGL.cpp index 48a18b67..aa58e569 100644 --- a/source/shared_lib/sources/graphics/gl/font_textFTGL.cpp +++ b/source/shared_lib/sources/graphics/gl/font_textFTGL.cpp @@ -234,6 +234,7 @@ void TextFTGL::Render(const char* str, const int len) { if(len != 0) { //printf("FTGL Render [%s] facesize = %d\n",str,ftFont->FaceSize()); assertGl(); + ftFont->Render(str, len); //assertGl(); GLenum error = glGetError(); diff --git a/source/shared_lib/sources/util/string_utils.cpp b/source/shared_lib/sources/util/string_utils.cpp index 9401c4e0..0f7d39e9 100644 --- a/source/shared_lib/sources/util/string_utils.cpp +++ b/source/shared_lib/sources/util/string_utils.cpp @@ -18,21 +18,12 @@ //#include "../stdafx.h" #include "string_utils.h" -#if TA3D_USE_BOOST == 1 -# include -# include -# include -#else -# include -#endif +#include #include -//#include "../logs/logs.h" - namespace Shared { namespace Util { - #if TA3D_USE_BOOST != 1 namespace { int stdLowerCase (int c) @@ -45,7 +36,6 @@ namespace Shared { namespace Util { return toupper(c); } } - #endif String& String::operator << (const wchar_t* v) @@ -66,22 +56,14 @@ namespace Shared { namespace Util { String& String::toLower() { - #if TA3D_USE_BOOST == 1 - boost::to_lower(*this); - #else std::transform (this->begin(), this->end(), this->begin(), stdLowerCase); - #endif return *this; } String& String::toUpper() { - #if TA3D_USE_BOOST == 1 - boost::to_upper(*this); - #else std::transform (this->begin(), this->end(), this->begin(), stdUpperCase); - #endif return *this; } @@ -120,15 +102,6 @@ namespace Shared { namespace Util { // Empty the container if (emptyBefore) out.clear(); - #if TA3D_USE_BOOST == 1 - // TODO : Avoid string duplication - // Split - std::vector v; - boost::algorithm::split(v, *this, boost::is_any_of(separators.c_str())); - // Copying - for(std::vector::const_iterator i = v.begin(); i != v.end(); ++i) - out.push_back(*i); - #else // TODO This method should be rewritten for better performance String s(*this); while (!s.empty()) @@ -145,7 +118,6 @@ namespace Shared { namespace Util { s = s.substr(i + 1, s.size() - i - 1); } } - #endif } void @@ -154,15 +126,6 @@ namespace Shared { namespace Util { // Empty the container if (emptyBefore) out.clear(); - #if TA3D_USE_BOOST == 1 - // TODO : Avoid string duplication - // Split - std::vector v; - boost::algorithm::split(v, *this, boost::is_any_of(separators.c_str())); - // Copying - for(std::vector::const_iterator i = v.begin(); i != v.end(); ++i) - out.push_back(*i); - #else // TODO This method should be rewritten for better performance String s(*this); while (!s.empty()) @@ -179,7 +142,6 @@ namespace Shared { namespace Util { s = s.substr(i + 1, s.size() - i - 1); } } - #endif }