- code cleanup (removing / commenting uneeded items)

This commit is contained in:
Mark Vejvoda
2011-10-17 20:56:11 +00:00
parent d07e5ef859
commit 26afb589a3
6 changed files with 13 additions and 53 deletions

View File

@@ -232,7 +232,7 @@ void ChatManager::keyPress(SDL_KeyboardEvent c) {
} }
text += buf; 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()); SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d] [%d] szCharText [%s]\n",__FILE__,__FUNCTION__,__LINE__, key,text.c_str());

View File

@@ -1299,10 +1299,12 @@ void MenuStateCustomGame::PlayNow(bool saveGame) {
Lang &lang= Lang::getInstance(); Lang &lang= Lang::getInstance();
char szMsg[1024]=""; char szMsg[1024]="";
if(lang.hasString("NetworkSlotUnassignedErrorUI") == true) { 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 { 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); showMessageBox(szMsg, "", false);
@@ -1311,10 +1313,12 @@ void MenuStateCustomGame::PlayNow(bool saveGame) {
for(unsigned int j = 0; j < languageList.size(); ++j) { for(unsigned int j = 0; j < languageList.size(); ++j) {
char szMsg[1024]=""; char szMsg[1024]="";
if(lang.hasString("NetworkSlotUnassignedError",languageList[j]) == true) { 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 { 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]); serverInterface->sendTextMessage(szMsg,-1, true,languageList[j]);

View File

@@ -25,13 +25,6 @@
# include <string> # include <string>
#include "types.h" #include "types.h"
/*!
** \brief Force the Use of the Boost functions
*/
# define TA3D_USE_BOOST 0
//! \name Macros for Shared::Util::String //! \name Macros for Shared::Util::String
//@{ //@{

View File

@@ -40,9 +40,9 @@ bool Font::fontIsRightToLeft = false;
// This value is used to scale the font text rendering // This value is used to scale the font text rendering
// in 3D render mode // in 3D render mode
float Font::scaleFontValue = 0.80; float Font::scaleFontValue = 0.80f;
// This value is used for centering font text vertically (height) // 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::scaleFontValue = 1.0;
//float Font::scaleFontValueCenterHFactor = 4.0; //float Font::scaleFontValueCenterHFactor = 4.0;

View File

@@ -234,6 +234,7 @@ void TextFTGL::Render(const char* str, const int len) {
if(len != 0) { if(len != 0) {
//printf("FTGL Render [%s] facesize = %d\n",str,ftFont->FaceSize()); //printf("FTGL Render [%s] facesize = %d\n",str,ftFont->FaceSize());
assertGl(); assertGl();
ftFont->Render(str, len); ftFont->Render(str, len);
//assertGl(); //assertGl();
GLenum error = glGetError(); GLenum error = glGetError();

View File

@@ -18,21 +18,12 @@
//#include "../stdafx.h" //#include "../stdafx.h"
#include "string_utils.h" #include "string_utils.h"
#if TA3D_USE_BOOST == 1 #include <algorithm>
# include <boost/algorithm/string.hpp>
# include <boost/algorithm/string/trim.hpp>
# include <boost/algorithm/string/split.hpp>
#else
# include <algorithm>
#endif
#include <assert.h> #include <assert.h>
//#include "../logs/logs.h"
namespace Shared { namespace Util { namespace Shared { namespace Util {
#if TA3D_USE_BOOST != 1
namespace namespace
{ {
int stdLowerCase (int c) int stdLowerCase (int c)
@@ -45,7 +36,6 @@ namespace Shared { namespace Util {
return toupper(c); return toupper(c);
} }
} }
#endif
String& String&
String::operator << (const wchar_t* v) String::operator << (const wchar_t* v)
@@ -66,22 +56,14 @@ namespace Shared { namespace Util {
String& String&
String::toLower() String::toLower()
{ {
#if TA3D_USE_BOOST == 1
boost::to_lower(*this);
#else
std::transform (this->begin(), this->end(), this->begin(), stdLowerCase); std::transform (this->begin(), this->end(), this->begin(), stdLowerCase);
#endif
return *this; return *this;
} }
String& String&
String::toUpper() String::toUpper()
{ {
#if TA3D_USE_BOOST == 1
boost::to_upper(*this);
#else
std::transform (this->begin(), this->end(), this->begin(), stdUpperCase); std::transform (this->begin(), this->end(), this->begin(), stdUpperCase);
#endif
return *this; return *this;
} }
@@ -120,15 +102,6 @@ namespace Shared { namespace Util {
// Empty the container // Empty the container
if (emptyBefore) if (emptyBefore)
out.clear(); out.clear();
#if TA3D_USE_BOOST == 1
// TODO : Avoid string duplication
// Split
std::vector<std::string> v;
boost::algorithm::split(v, *this, boost::is_any_of(separators.c_str()));
// Copying
for(std::vector<std::string>::const_iterator i = v.begin(); i != v.end(); ++i)
out.push_back(*i);
#else
// TODO This method should be rewritten for better performance // TODO This method should be rewritten for better performance
String s(*this); String s(*this);
while (!s.empty()) while (!s.empty())
@@ -145,7 +118,6 @@ namespace Shared { namespace Util {
s = s.substr(i + 1, s.size() - i - 1); s = s.substr(i + 1, s.size() - i - 1);
} }
} }
#endif
} }
void void
@@ -154,15 +126,6 @@ namespace Shared { namespace Util {
// Empty the container // Empty the container
if (emptyBefore) if (emptyBefore)
out.clear(); out.clear();
#if TA3D_USE_BOOST == 1
// TODO : Avoid string duplication
// Split
std::vector<std::string> v;
boost::algorithm::split(v, *this, boost::is_any_of(separators.c_str()));
// Copying
for(std::vector<std::string>::const_iterator i = v.begin(); i != v.end(); ++i)
out.push_back(*i);
#else
// TODO This method should be rewritten for better performance // TODO This method should be rewritten for better performance
String s(*this); String s(*this);
while (!s.empty()) while (!s.empty())
@@ -179,7 +142,6 @@ namespace Shared { namespace Util {
s = s.substr(i + 1, s.size() - i - 1); s = s.substr(i + 1, s.size() - i - 1);
} }
} }
#endif
} }