diff -urN --exclude=CVS --exclude=Makefile --exclude=Makefile.in --exclude=autom4te.cache --exclude=aclocal.m4 --exclude=configure --exclude=config.status --exclude=borland --exclude=config.log --exclude=.deps scorched/autogen.sh scorched-cvs/autogen.sh --- scorched/autogen.sh 2003-08-03 23:57:10.000000000 +0200 +++ scorched-cvs/autogen.sh 2005-09-29 17:28:35.000000000 +0200 @@ -2,4 +2,4 @@ aclocal automake --foreign autoconf -./configure $* +#./configure $* diff -urN --exclude=CVS --exclude=Makefile --exclude=Makefile.in --exclude=autom4te.cache --exclude=aclocal.m4 --exclude=configure --exclude=config.status --exclude=borland --exclude=config.log --exclude=.deps scorched/src/3dsparse/MSModelFactory.cpp scorched-cvs/src/3dsparse/MSModelFactory.cpp --- scorched/src/3dsparse/MSModelFactory.cpp 2005-04-12 00:19:08.000000000 +0200 +++ scorched-cvs/src/3dsparse/MSModelFactory.cpp 2005-09-22 17:14:27.000000000 +0200 @@ -304,7 +304,7 @@ if (textureName[1]) // as the string starts with a " { mesh->setTextureName(fullTextureName); - if (!fileExists(fullTextureName)) + if (!DefinesUtil::fileExists(fullTextureName)) { returnError(fileName, formatString("Failed to find texture \"%s\"", @@ -314,7 +314,7 @@ if (textureNameAlpha[1]) { mesh->setATextureName(fullTextureAlphaName); - if (!fileExists(fullTextureAlphaName)) + if (!DefinesUtil::fileExists(fullTextureAlphaName)) { returnError(fileName, formatString("Failed to find alpha texture \"%s\"", diff -urN --exclude=CVS --exclude=Makefile --exclude=Makefile.in --exclude=autom4te.cache --exclude=aclocal.m4 --exclude=configure --exclude=config.status --exclude=borland --exclude=config.log --exclude=.deps scorched/src/3dsparse/ModelID.cpp scorched-cvs/src/3dsparse/ModelID.cpp --- scorched/src/3dsparse/ModelID.cpp 2005-04-12 00:19:08.000000000 +0200 +++ scorched-cvs/src/3dsparse/ModelID.cpp 2005-09-22 17:14:27.000000000 +0200 @@ -76,7 +76,7 @@ const char *meshNameContent = meshNode->getContent(); static char meshName[1024]; sprintf(meshName, "%s/%s", directory, meshNameContent); - if (!::wxFileExists(getDataFile(meshName))) + if (!DefinesUtil::fileExists(getDataFile(meshName))) { dialogMessage("Scorched Models", "Mesh file \"%s\"does not exist", @@ -90,7 +90,7 @@ if (strcmp(skinNameContent, "none") != 0) { sprintf(skinName, "%s/%s", directory, skinNameContent); - if (!::wxFileExists(getDataFile(skinName))) + if (!DefinesUtil::fileExists(getDataFile(skinName))) { dialogMessage("Scorched Models", "Skin file \"%s\" does not exist", @@ -112,7 +112,7 @@ static char meshName[1024]; sprintf(meshName, "%s/%s", directory, meshNameContent); - if (!::wxFileExists(getDataFile(meshName))) + if (!DefinesUtil::fileExists(getDataFile(meshName))) { dialogMessage("Scorched Models", "Mesh file \"%s\"does not exist", diff -urN --exclude=CVS --exclude=Makefile --exclude=Makefile.in --exclude=autom4te.cache --exclude=aclocal.m4 --exclude=configure --exclude=config.status --exclude=borland --exclude=config.log --exclude=.deps scorched/src/GLEXT/GLGif.cpp scorched-cvs/src/GLEXT/GLGif.cpp --- scorched/src/GLEXT/GLGif.cpp 2005-07-13 14:51:49.000000000 +0200 +++ scorched-cvs/src/GLEXT/GLGif.cpp 2005-09-22 17:14:27.000000000 +0200 @@ -47,7 +47,7 @@ bool GLGif::loadFromFile(const char * filename) { - wxString file(filename); + wxString file(filename, wxConvUTF8); wxFileInputStream ifStream(file); if (!ifStream.Ok()) return false; return loadFromStream(&ifStream); diff -urN --exclude=CVS --exclude=Makefile --exclude=Makefile.in --exclude=autom4te.cache --exclude=aclocal.m4 --exclude=configure --exclude=config.status --exclude=borland --exclude=config.log --exclude=.deps scorched/src/GLEXT/GLState.h scorched-cvs/src/GLEXT/GLState.h --- scorched/src/GLEXT/GLState.h 2005-06-07 23:50:43.000000000 +0200 +++ scorched-cvs/src/GLEXT/GLState.h 2005-09-18 11:59:33.000000000 +0200 @@ -27,6 +27,7 @@ #define AFX_GLSTATE_H__32B0E2D0_566D_4438_94E4_B12FE82430B1__INCLUDED_ #define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers +#undef __MACH__ #include #include diff -urN --exclude=CVS --exclude=Makefile --exclude=Makefile.in --exclude=autom4te.cache --exclude=aclocal.m4 --exclude=configure --exclude=config.status --exclude=borland --exclude=config.log --exclude=.deps scorched/src/GLW/GLWPlanView.cpp scorched-cvs/src/GLW/GLWPlanView.cpp --- scorched/src/GLW/GLWPlanView.cpp 2005-07-11 01:41:56.000000000 +0200 +++ scorched-cvs/src/GLW/GLWPlanView.cpp 2005-09-22 17:14:27.000000000 +0200 @@ -244,7 +244,9 @@ // Draw a line pointing where the current tank is looking glBegin(GL_LINES); glVertex2f(0.0f, 0.0f); - glVertex2f(getFastSin(rot) * 0.07f, getFastCos(rot) * 0.07f); + glVertex2f( + DefinesUtil::getFastSin(rot) * 0.07f, + DefinesUtil::getFastCos(rot) * 0.07f); glEnd(); glPopMatrix(); diff -urN --exclude=CVS --exclude=Makefile --exclude=Makefile.in --exclude=autom4te.cache --exclude=aclocal.m4 --exclude=configure --exclude=config.status --exclude=borland --exclude=config.log --exclude=.deps scorched/src/actions/Explosion.cpp scorched-cvs/src/actions/Explosion.cpp --- scorched/src/actions/Explosion.cpp 2005-08-20 22:17:58.000000000 +0200 +++ scorched-cvs/src/actions/Explosion.cpp 2005-09-18 12:39:34.000000000 +0200 @@ -197,8 +197,6 @@ if (0 != strcmp(weapon_->getParent()->getName(), "Death's Head") || // Ooo nasty RAND < 0.2f) { - Logger::log("Death..."); - context_->actionController->addAction( new SpriteAction( new ExplosionNukeRenderer(position_, weapon_->getSize() - 2.0f))); diff -urN --exclude=CVS --exclude=Makefile --exclude=Makefile.in --exclude=autom4te.cache --exclude=aclocal.m4 --exclude=configure --exclude=config.status --exclude=borland --exclude=config.log --exclude=.deps scorched/src/actions/TankResign.cpp scorched-cvs/src/actions/TankResign.cpp --- scorched/src/actions/TankResign.cpp 2005-04-05 00:35:23.000000000 +0200 +++ scorched-cvs/src/actions/TankResign.cpp 2005-09-18 12:39:34.000000000 +0200 @@ -23,6 +23,7 @@ #include #include #include +#include #include REGISTER_ACTION_SOURCE(TankResign); @@ -60,8 +61,10 @@ if (!context_->serverMode || OptionsParam::instance()->getDedicatedServer()) { - Logger::log( - "\"%s\" resigned from round", tank->getName()); + LoggerInfo info(LoggerInfo::TypeDeath, + formatString("\"%s\" resigned from round", tank->getName())); + info.setPlayerId(playerId_); + Logger::log(info); } } } diff -urN --exclude=CVS --exclude=Makefile --exclude=Makefile.in --exclude=autom4te.cache --exclude=aclocal.m4 --exclude=configure --exclude=config.status --exclude=borland --exclude=config.log --exclude=.deps scorched/src/client/ClientConnectionAcceptHandler.cpp scorched-cvs/src/client/ClientConnectionAcceptHandler.cpp --- scorched/src/client/ClientConnectionAcceptHandler.cpp 2005-06-27 02:55:47.000000000 +0200 +++ scorched-cvs/src/client/ClientConnectionAcceptHandler.cpp 2005-09-22 17:14:28.000000000 +0200 @@ -109,7 +109,7 @@ } // Set the mod - setDataFileMod( + DefinesUtil::setDataFileMod( ScorchedClient::instance()->getOptionsGame().getMod()); // Load any mod files we currently have for the mod diff -urN --exclude=CVS --exclude=Makefile --exclude=Makefile.in --exclude=autom4te.cache --exclude=aclocal.m4 --exclude=configure --exclude=config.status --exclude=borland --exclude=config.log --exclude=.deps scorched/src/client/ClientKeepAliveSender.cpp scorched-cvs/src/client/ClientKeepAliveSender.cpp --- scorched/src/client/ClientKeepAliveSender.cpp 2005-04-03 14:46:43.000000000 +0200 +++ scorched-cvs/src/client/ClientKeepAliveSender.cpp 2005-09-18 12:39:34.000000000 +0200 @@ -56,7 +56,7 @@ ScorchedClient::instance()->getOptionsGame().getKeepAliveTime(); unsigned int theTime = (unsigned int) time(0); - if (theTime - lastSendTime_ > sendTime) + if (theTime - lastSendTime_ >= sendTime) { ComsKeepAliveMessage message; ComsMessageSender::sendToServer(message); diff -urN --exclude=CVS --exclude=Makefile --exclude=Makefile.in --exclude=autom4te.cache --exclude=aclocal.m4 --exclude=configure --exclude=config.status --exclude=borland --exclude=config.log --exclude=.deps scorched/src/client/ClientRmPlayerHandler.cpp scorched-cvs/src/client/ClientRmPlayerHandler.cpp --- scorched/src/client/ClientRmPlayerHandler.cpp 2005-04-05 00:35:23.000000000 +0200 +++ scorched-cvs/src/client/ClientRmPlayerHandler.cpp 2005-09-18 12:39:34.000000000 +0200 @@ -61,12 +61,6 @@ { Logger::log( "Failed to find player to remove"); } - else - { - // Print out info about removed tank - Logger::log( "Player disconnected \"%s\"", - tank->getName()); - } delete tank; return true; diff -urN --exclude=CVS --exclude=Makefile --exclude=Makefile.in --exclude=autom4te.cache --exclude=aclocal.m4 --exclude=configure --exclude=config.status --exclude=borland --exclude=config.log --exclude=.deps scorched/src/client/ClientSave.cpp scorched-cvs/src/client/ClientSave.cpp --- scorched/src/client/ClientSave.cpp 2005-08-20 22:17:58.000000000 +0200 +++ scorched-cvs/src/client/ClientSave.cpp 2005-09-22 17:14:28.000000000 +0200 @@ -112,7 +112,9 @@ if (0 != strcmp(version.c_str(), ScorchedProtocolVersion)) { dialogMessage("LoadGame", - "ERROR: Saved file version %s does not match game version %s", + "ERROR: Saved file version does not match game version.\n" + "Saved version : %s\n" + "Current version : %s\n", version.c_str(), ScorchedProtocolVersion); return false; diff -urN --exclude=CVS --exclude=Makefile --exclude=Makefile.in --exclude=autom4te.cache --exclude=aclocal.m4 --exclude=configure --exclude=config.status --exclude=borland --exclude=config.log --exclude=.deps scorched/src/client/TargetCamera.cpp scorched-cvs/src/client/TargetCamera.cpp --- scorched/src/client/TargetCamera.cpp 2005-07-11 01:41:56.000000000 +0200 +++ scorched-cvs/src/client/TargetCamera.cpp 2005-09-22 17:14:28.000000000 +0200 @@ -304,8 +304,8 @@ case CamTank: { Vector newPos( - getFastSin(currentRotation) * 8.0f, - getFastCos(currentRotation) * 8.0f, + DefinesUtil::getFastSin(currentRotation) * 8.0f, + DefinesUtil::getFastCos(currentRotation) * 8.0f, 0.0f); Vector newPos2 = position - newPos; @@ -329,8 +329,8 @@ case CamBehind: { Vector newPos( - getFastSin(currentRotation) * 25.0f, - getFastCos(currentRotation) * 25.0f, + DefinesUtil::getFastSin(currentRotation) * 25.0f, + DefinesUtil::getFastCos(currentRotation) * 25.0f, 0.0f); Vector newPos2 = position - newPos; @@ -341,8 +341,8 @@ case CamLeftFar: { Vector newPos( - getFastSin(currentRotation) * 65.0f, - getFastCos(currentRotation) * 65.0f, + DefinesUtil::getFastSin(currentRotation) * 65.0f, + DefinesUtil::getFastCos(currentRotation) * 65.0f, 0.0f); Vector newPos2 = position - newPos; @@ -353,8 +353,8 @@ case CamRightFar: { Vector newPos( - getFastSin(currentRotation) * 65.0f, - getFastCos(currentRotation) * 65.0f, + DefinesUtil::getFastSin(currentRotation) * 65.0f, + DefinesUtil::getFastCos(currentRotation) * 65.0f, 0.0f); Vector newPos2 = position - newPos; @@ -365,8 +365,8 @@ case CamLeft: { Vector newPos( - getFastSin(currentRotation) * 10.0f, - getFastCos(currentRotation) * 10.0f, + DefinesUtil::getFastSin(currentRotation) * 10.0f, + DefinesUtil::getFastCos(currentRotation) * 10.0f, 0.0f); Vector newPos2 = position - newPos; @@ -377,8 +377,8 @@ case CamRight: { Vector newPos( - getFastSin(currentRotation) * 10.0f, - getFastCos(currentRotation) * 10.0f, + DefinesUtil::getFastSin(currentRotation) * 10.0f, + DefinesUtil::getFastCos(currentRotation) * 10.0f, 0.0f); Vector newPos2 = position - newPos; diff -urN --exclude=CVS --exclude=Makefile --exclude=Makefile.in --exclude=autom4te.cache --exclude=aclocal.m4 --exclude=configure --exclude=config.status --exclude=borland --exclude=config.log --exclude=.deps scorched/src/common/Defines.cpp scorched-cvs/src/common/Defines.cpp --- scorched/src/common/Defines.cpp 2005-08-20 22:17:58.000000000 +0200 +++ scorched-cvs/src/common/Defines.cpp 2005-09-24 12:52:42.000000000 +0200 @@ -36,20 +36,34 @@ extern bool wxWindowInit; -void setSettingsDir(const char *dir) +void DefinesUtil::setSettingsDir(const char *dir) { settingsDir = dir; } -bool fileExists(const char *file) +void DefinesUtil::fileDos2Unix(char *file) { - return ::wxFileExists(file); + for (char *f=file; *f; f++) + { + if (*f == '\\') *f = '/'; + } } -bool dirExists(const char *file) +bool DefinesUtil::dirMake(const char *file) { - bool result = ::wxDirExists(file); - return result; + ::wxMkdir(wxString(file, wxConvUTF8), 0755); + return true; +} + +bool DefinesUtil::fileExists(const char *file) +{ + return ::wxFileExists(wxString(file, wxConvUTF8)); +} + +bool DefinesUtil::dirExists(const char *file) +{ + bool result = ::wxDirExists(wxString(file, wxConvUTF8)); + return result; } void dialogMessage(const char *header, const char *fmt, ...) @@ -66,8 +80,8 @@ #else if (wxWindowInit) { - wxString wxText(text); - wxString wxHeader(header); + wxString wxText(text, wxConvUTF8); + wxString wxHeader(header, wxConvUTF8); ::wxMessageBox(wxText, wxHeader, wxOK | wxCENTRE); } else @@ -118,14 +132,14 @@ exit(64); } -void setDataFileMod(const char *mod) +void DefinesUtil::setDataFileMod(const char *mod) { delete [] dataModFile; dataModFile = new char[strlen(mod) + 1]; strcpy(dataModFile, mod); } -const char *getDataFileMod() +const char *DefinesUtil::getDataFileMod() { return (dataModFile?dataModFile:"none"); } @@ -149,16 +163,16 @@ vsprintf(filename, file, ap); va_end(ap); - sprintf(buffer, getModFile("%s/%s", getDataFileMod(), filename)); - ::wxDos2UnixFilename(buffer); - if (::wxFileExists(buffer)) return buffer; - - sprintf(buffer, getGlobalModFile("%s/%s", getDataFileMod(), filename)); - ::wxDos2UnixFilename(buffer); - if (::wxFileExists(buffer)) return buffer; + sprintf(buffer, getModFile("%s/%s", DefinesUtil::getDataFileMod(), filename)); + DefinesUtil::fileDos2Unix(buffer); + if (DefinesUtil::fileExists(buffer)) return buffer; + + sprintf(buffer, getGlobalModFile("%s/%s", DefinesUtil::getDataFileMod(), filename)); + DefinesUtil::fileDos2Unix(buffer); + if (DefinesUtil::fileExists(buffer)) return buffer; sprintf(buffer, S3D_DATADIR "/%s", filename); - ::wxDos2UnixFilename(buffer); + DefinesUtil::fileDos2Unix(buffer); return buffer; } @@ -172,7 +186,7 @@ va_end(ap); const char *dataFileName = getDataFile(filename); - if (!::fileExists(dataFileName)) + if (!DefinesUtil::fileExists(dataFileName)) { if (0 == strstr(filename, "none")) { @@ -194,7 +208,7 @@ vsprintf(filename, file, ap); va_end(ap); sprintf(buffer, S3D_DOCDIR "/%s", filename); - ::wxDos2UnixFilename(buffer); + DefinesUtil::fileDos2Unix(buffer); return buffer; } @@ -206,16 +220,19 @@ vsprintf(filename, file, ap); va_end(ap); - static wxString homeDir; + static std::string homeDir; if (!homeDir.c_str()[0]) { homeDir = S3D_DATADIR; - if (dirExists(::wxGetHomeDir())) homeDir = ::wxGetHomeDir(); + if (::wxDirExists(::wxGetHomeDir())) + { + homeDir = (const char *) wxString(::wxGetHomeDir()).mb_str(wxConvUTF8); + } } static char buffer[1024]; sprintf(buffer, "%s/%s", homeDir.c_str(), filename); - ::wxDos2UnixFilename(buffer); + DefinesUtil::fileDos2Unix(buffer); return buffer; } @@ -228,14 +245,14 @@ vsprintf(filename, file, ap); va_end(ap); - static wxString homeDir; + static std::string homeDir; if (!homeDir.c_str()[0]) { const char *homeDirStr = getHomeFile("/%s", settingsDir.c_str()); - if (!dirExists(homeDirStr)) + if (!DefinesUtil::dirExists(homeDirStr)) { - if (!::wxMkdir(homeDirStr, 0755)) + if (!DefinesUtil::dirMake(homeDirStr)) { homeDirStr = getHomeFile(""); } @@ -245,7 +262,7 @@ static char buffer[1024]; sprintf(buffer, "%s/%s", homeDir.c_str(), filename); - ::wxDos2UnixFilename(buffer); + DefinesUtil::fileDos2Unix(buffer); return buffer; } @@ -257,14 +274,14 @@ va_start(ap, file); vsprintf(filename, file, ap); va_end(ap); - + const char *homeDirStr = getSettingsFile(""); - wxString newDir(wxString(homeDirStr) + wxString("/logs")); - if (dirExists(newDir)) homeDirStr = newDir.c_str(); - else if (::wxMkdir(newDir, 0755)) homeDirStr = newDir.c_str(); - + std::string newDir(std::string(homeDirStr) + std::string("/logs")); + if (DefinesUtil::dirExists(newDir.c_str())) homeDirStr = newDir.c_str(); + else if (DefinesUtil::dirMake(newDir.c_str())) homeDirStr = newDir.c_str(); + sprintf(buffer, "%s/%s", homeDirStr, filename); - ::wxDos2UnixFilename(buffer); + DefinesUtil::fileDos2Unix(buffer); return buffer; } @@ -278,12 +295,12 @@ static char buffer[1024]; const char *homeDirStr = getSettingsFile(""); - wxString newDir(wxString(homeDirStr) + wxString("/saves")); - if (dirExists(newDir)) homeDirStr = newDir.c_str(); - else if (::wxMkdir(newDir, 0755)) homeDirStr = newDir.c_str(); - + std::string newDir(std::string(homeDirStr) + std::string("/saves")); + if (DefinesUtil::dirExists(newDir.c_str())) homeDirStr = newDir.c_str(); + else if (DefinesUtil::dirMake(newDir.c_str())) homeDirStr = newDir.c_str(); + sprintf(buffer, "%s/%s", homeDirStr, filename); - ::wxDos2UnixFilename(buffer); + DefinesUtil::fileDos2Unix(buffer); return buffer; } @@ -295,20 +312,20 @@ vsprintf(filename, file, ap); va_end(ap); - static wxString modDir; + static std::string modDir; if (!modDir.c_str()[0]) { const char *homeDirStr = getSettingsFile(""); - wxString newDir(wxString(homeDirStr) + wxString("/mods")); - if (dirExists(newDir)) homeDirStr = newDir.c_str(); - else if (::wxMkdir(newDir, 0755)) homeDirStr = newDir.c_str(); + std::string newDir(std::string(homeDirStr) + std::string("/mods")); + if (DefinesUtil::dirExists(newDir.c_str())) homeDirStr = newDir.c_str(); + else if (DefinesUtil::dirMake(newDir.c_str())) homeDirStr = newDir.c_str(); modDir = homeDirStr; } static char buffer[1024]; sprintf(buffer, "%s/%s", modDir.c_str(), filename); - ::wxDos2UnixFilename(buffer); + DefinesUtil::fileDos2Unix(buffer); return buffer; } @@ -322,7 +339,7 @@ static char buffer[1024]; sprintf(buffer, S3D_DATADIR "/data/globalmods/%s", filename); - ::wxDos2UnixFilename(buffer); + DefinesUtil::fileDos2Unix(buffer); return buffer; } @@ -342,7 +359,7 @@ } } -float getFastSin(float angle) +float DefinesUtil::getFastSin(float angle) { if (!calculatedFast) calculateFast(); if (angle < 0.0f) @@ -352,7 +369,7 @@ return fastSin[(int(angle * 100)) % 628]; } -float getFastCos(float angle) +float DefinesUtil::getFastCos(float angle) { if (!calculatedFast) calculateFast(); if (angle < 0.0f) @@ -362,7 +379,7 @@ return fastCos[(int(angle * 100)) % 628]; } -char *my_stristr(const char *x, const char *y) +char *DefinesUtil::my_stristr(const char *x, const char *y) { std::string newX(x); std::string newY(y); @@ -374,3 +391,4 @@ return (char *)(x + (result - newX.c_str())); } + diff -urN --exclude=CVS --exclude=Makefile --exclude=Makefile.in --exclude=autom4te.cache --exclude=aclocal.m4 --exclude=configure --exclude=config.status --exclude=borland --exclude=config.log --exclude=.deps scorched/src/common/Defines.h scorched-cvs/src/common/Defines.h --- scorched/src/common/Defines.h 2005-08-14 21:11:42.000000000 +0200 +++ scorched-cvs/src/common/Defines.h 2005-09-22 17:14:28.000000000 +0200 @@ -44,13 +44,21 @@ extern const char *formatString(const char *format, ...); extern const char *formatStringList(const char *format, va_list ap); +namespace DefinesUtil +{ +extern float getFastSin(float angle); +extern float getFastCos(float angle); +extern char *my_stristr(const char *x, const char *y); extern void setSettingsDir(const char *dir); extern void setDataFileMod(const char *mod); extern const char *getDataFileMod(); -extern bool checkDataFile(const char *file, ...); +extern void fileDos2Unix(char *file); extern bool fileExists(const char *file); extern bool dirExists(const char *file); +extern bool dirMake(const char *file); +}; +extern bool checkDataFile(const char *file, ...); extern const char *getDataFile(const char *file, ...); extern const char *getDocFile(const char *file, ...); extern const char *getLogFile(const char *file, ...); @@ -64,10 +72,6 @@ #define MAX(x,y) ((x)>(y)?(x):(y)) #define MIN(x,y) ((x)<(y)?(x):(y)) -extern float getFastSin(float angle); -extern float getFastCos(float angle); -extern char *my_stristr(const char *x, const char *y); - #ifdef NO_FLOAT_MATH #define sinf(x) ((float)sin(x)) @@ -81,7 +85,7 @@ #define powf(x,y) ((float)pow(x,y)) #define floorf(x) ((float)floor(x)) -#endif +#endif // NO_FLOAT_MATH extern unsigned int ScorchedPort; extern char *ScorchedVersion; diff -urN --exclude=CVS --exclude=Makefile --exclude=Makefile.in --exclude=autom4te.cache --exclude=aclocal.m4 --exclude=configure --exclude=config.status --exclude=borland --exclude=config.log --exclude=.deps scorched/src/common/Keyboard.cpp scorched-cvs/src/common/Keyboard.cpp --- scorched/src/common/Keyboard.cpp 2004-11-05 17:48:12.000000000 +0100 +++ scorched-cvs/src/common/Keyboard.cpp 2005-09-22 17:14:28.000000000 +0200 @@ -170,7 +170,7 @@ std::map usedKeyMap_; const char *fileName = getSettingsFile("keys.xml"); - if (::wxFileExists(fileName) && !loadDefaults) + if (DefinesUtil::fileExists(fileName) && !loadDefaults) { if (!loadKeyFile(fileName, usedKeyMap_)) return false; } diff -urN --exclude=CVS --exclude=Makefile --exclude=Makefile.in --exclude=autom4te.cache --exclude=aclocal.m4 --exclude=configure --exclude=config.status --exclude=borland --exclude=config.log --exclude=.deps scorched/src/common/StatsLoggerFile.cpp scorched-cvs/src/common/StatsLoggerFile.cpp --- scorched/src/common/StatsLoggerFile.cpp 2005-07-25 20:30:58.000000000 +0200 +++ scorched-cvs/src/common/StatsLoggerFile.cpp 2005-09-22 17:14:28.000000000 +0200 @@ -317,7 +317,7 @@ if (nl) *nl = '\0'; char message[1024]; - sprintf(message, "weaponkilled \"%s\" [%s]", weapon->getParent()->getName()); + sprintf(message, "weaponkilled \"%s\"", weapon->getParent()->getName()); LoggerInfo info(LoggerInfo::TypeNormal, message, time); statsLogger_->logMessage(info); } diff -urN --exclude=CVS --exclude=Makefile --exclude=Makefile.in --exclude=autom4te.cache --exclude=aclocal.m4 --exclude=configure --exclude=config.status --exclude=borland --exclude=config.log --exclude=.deps scorched/src/dialogs/HelpButtonDialog.cpp scorched-cvs/src/dialogs/HelpButtonDialog.cpp --- scorched/src/dialogs/HelpButtonDialog.cpp 2005-05-20 22:19:59.000000000 +0200 +++ scorched-cvs/src/dialogs/HelpButtonDialog.cpp 2005-09-18 11:59:33.000000000 +0200 @@ -19,6 +19,7 @@ //////////////////////////////////////////////////////////////////////////////// #include +#include #include #include #include @@ -107,7 +108,8 @@ skipRest = true; if (x > x_ + 32) { - runScorched3D("-starthelp"); + showHtmlHelpDialog(); + //runScorched3D("-starthelp"); } else { diff -urN --exclude=CVS --exclude=Makefile --exclude=Makefile.in --exclude=autom4te.cache --exclude=aclocal.m4 --exclude=configure --exclude=config.status --exclude=borland --exclude=config.log --exclude=.deps scorched/src/dialogs/ProgressDialog.cpp scorched-cvs/src/dialogs/ProgressDialog.cpp --- scorched/src/dialogs/ProgressDialog.cpp 2005-04-03 14:46:43.000000000 +0200 +++ scorched-cvs/src/dialogs/ProgressDialog.cpp 2005-09-18 12:39:34.000000000 +0200 @@ -168,6 +168,8 @@ progressLabel_->setText(op); progress_->setCurrent(percentage); + //for (int i=0; i<100000000; i++); + if ((timeDelay > 0.25f) || (percentage > 99.0f)) { diff -urN --exclude=CVS --exclude=Makefile --exclude=Makefile.in --exclude=autom4te.cache --exclude=aclocal.m4 --exclude=configure --exclude=config.status --exclude=borland --exclude=config.log --exclude=.deps scorched/src/engine/ModFileEntry.cpp scorched-cvs/src/engine/ModFileEntry.cpp --- scorched/src/engine/ModFileEntry.cpp 2005-06-05 23:54:01.000000000 +0200 +++ scorched-cvs/src/engine/ModFileEntry.cpp 2005-09-22 17:14:28.000000000 +0200 @@ -83,7 +83,7 @@ *dir = '\0'; const char *needdir = getModFile("%s/%s", modName, fileName); - if (!::wxDirExists(needdir)) ::wxMkdir(needdir); + if (!DefinesUtil::dirExists(needdir)) DefinesUtil::dirMake(needdir); *dir = '/'; dir++; } diff -urN --exclude=CVS --exclude=Makefile --exclude=Makefile.in --exclude=autom4te.cache --exclude=aclocal.m4 --exclude=configure --exclude=config.status --exclude=borland --exclude=config.log --exclude=.deps scorched/src/engine/ModFiles.cpp scorched-cvs/src/engine/ModFiles.cpp --- scorched/src/engine/ModFiles.cpp 2005-08-12 16:20:11.000000000 +0200 +++ scorched-cvs/src/engine/ModFiles.cpp 2005-09-22 17:14:28.000000000 +0200 @@ -83,20 +83,20 @@ { // Get and check the user mod directory exists const char *modDir = getModFile(mod); - if (::wxDirExists(modDir)) + if (DefinesUtil::dirExists(modDir)) { if (!loadModDir(modDir, mod)) return false; } else { - if (createDir) ::wxMkdir(modDir); + if (createDir) DefinesUtil::dirMake(modDir); } } { // Get and check global mod directory const char *modDir = getGlobalModFile(mod); - if (::wxDirExists(modDir)) + if (DefinesUtil::dirExists(modDir)) { if (!loadModDir(modDir, mod)) return false; } @@ -148,16 +148,15 @@ { // Load all files contained in this directory wxArrayString files; - wxDir::GetAllFiles(modDir, &files); + wxDir::GetAllFiles(wxString(modDir, wxConvUTF8), &files); wxString *strings = files.GetStringArray(); for (int i=0; i<(int) files.Count(); i++) { // Get the name of the current file wxString ¤t = strings[i]; - const char *fullFileName = current.c_str(); // Load the file - if (!loadModFile(fullFileName, modDir, mod)) + if (!loadModFile(current.mb_str(wxConvUTF8), modDir, mod)) { return false; } @@ -179,7 +178,7 @@ // name of the directory that contains it int modDirLen = strlen(modDir); shortFileName += modDirLen; - ::wxDos2UnixFilename((char *) shortFileName); + DefinesUtil::fileDos2Unix((char *) shortFileName); while (shortFileName[0] == '/') shortFileName++; // Check that all files are lower case @@ -219,9 +218,9 @@ bool ModFiles::writeModFiles(const char *mod) { const char *modDir = getModFile(mod); - if (!::wxDirExists(modDir)) + if (!DefinesUtil::dirExists(modDir)) { - ::wxMkdir(modDir); + DefinesUtil::dirMake(modDir); } std::map::iterator itor; @@ -379,14 +378,14 @@ bool ModDirs::loadModDir(const char *dirName) { - wxDir dir(dirName); + wxDir dir(wxString(dirName, wxConvUTF8)); if (dir.IsOpened()) { wxString filename; - bool cont = dir.GetFirst(&filename, "", wxDIR_DIRS); + bool cont = dir.GetFirst(&filename, wxT(""), wxDIR_DIRS); while (cont) { - if (!loadModFile(filename.c_str())) return false; + if (!loadModFile(filename.mb_str(wxConvUTF8))) return false; cont = dir.GetNext(&filename); } } diff -urN --exclude=CVS --exclude=Makefile --exclude=Makefile.in --exclude=autom4te.cache --exclude=aclocal.m4 --exclude=configure --exclude=config.status --exclude=borland --exclude=config.log --exclude=.deps scorched/src/engine/ParticleEmitter.cpp scorched-cvs/src/engine/ParticleEmitter.cpp --- scorched/src/engine/ParticleEmitter.cpp 2005-07-11 01:41:56.000000000 +0200 +++ scorched-cvs/src/engine/ParticleEmitter.cpp 2005-09-22 17:14:28.000000000 +0200 @@ -232,8 +232,8 @@ Vector velocity; float ang = RAND * 2.0f * 3.14f; float speed = 45.0f; - velocity[0] = getFastSin(ang) * speed; - velocity[1] = getFastCos(ang) * speed; + velocity[0] = DefinesUtil::getFastSin(ang) * speed; + velocity[1] = DefinesUtil::getFastCos(ang) * speed; velocity[2] = 0.0f; particle->texture_ = &ExplosionTextures::instance()->particleTexture; @@ -257,8 +257,8 @@ float direction = RAND * 3.14f * 2.0f; float speed = RAND * 25.0f + 5.0f; float height = RAND * 25.0f + 15.0f; - Vector velocity(getFastSin(direction) * speed, - getFastCos(direction) * speed, height); + Vector velocity(DefinesUtil::getFastSin(direction) * speed, + DefinesUtil::getFastCos(direction) * speed, height); if (RAND > 0.5f) { diff -urN --exclude=CVS --exclude=Makefile --exclude=Makefile.in --exclude=autom4te.cache --exclude=aclocal.m4 --exclude=configure --exclude=config.status --exclude=borland --exclude=config.log --exclude=.deps scorched/src/engine/ParticleRenderer.cpp scorched-cvs/src/engine/ParticleRenderer.cpp --- scorched/src/engine/ParticleRenderer.cpp 2005-08-20 22:17:58.000000000 +0200 +++ scorched-cvs/src/engine/ParticleRenderer.cpp 2005-09-22 17:14:28.000000000 +0200 @@ -188,20 +188,26 @@ particle.shadow_ = false; particle.position_[0] = oldPosition[0]; - particle.position_[1] = oldPosition[1] + getFastSin(renderer->getCloudRotation() + 2.0f) * 2.0f; - particle.position_[2] = oldPosition[2] + getFastCos(renderer->getCloudRotation() + 2.0f) * 2.0f; + particle.position_[1] = oldPosition[1] + + DefinesUtil::getFastSin(renderer->getCloudRotation() + 2.0f) * 2.0f; + particle.position_[2] = oldPosition[2] + + DefinesUtil::getFastCos(renderer->getCloudRotation() + 2.0f) * 2.0f; ParticleRendererQuads::getInstance()->renderParticle(particle); particle.shadow_ = false; particle.position_[0] = oldPosition[0]; - particle.position_[1] = oldPosition[1] + getFastSin(renderer->getCloudRotation() + 4.0f) * 2.0f; - particle.position_[2] = oldPosition[2] + getFastCos(renderer->getCloudRotation() + 4.0f) * 2.0f; + particle.position_[1] = oldPosition[1] + + DefinesUtil::getFastSin(renderer->getCloudRotation() + 4.0f) * 2.0f; + particle.position_[2] = oldPosition[2] + + DefinesUtil::getFastCos(renderer->getCloudRotation() + 4.0f) * 2.0f; ParticleRendererQuads::getInstance()->renderParticle(particle); particle.shadow_ = shadow; particle.position_[0] = oldPosition[0]; - particle.position_[1] = oldPosition[1] + getFastSin(renderer->getCloudRotation()) * 2.0f; - particle.position_[2] = oldPosition[2] + getFastCos(renderer->getCloudRotation()) * 2.0f; + particle.position_[1] = oldPosition[1] + + DefinesUtil::getFastSin(renderer->getCloudRotation()) * 2.0f; + particle.position_[2] = oldPosition[2] + + DefinesUtil::getFastCos(renderer->getCloudRotation()) * 2.0f; ParticleRendererQuads::getInstance()->renderParticle(particle); particle.position_ = oldPosition; diff -urN --exclude=CVS --exclude=Makefile --exclude=Makefile.in --exclude=autom4te.cache --exclude=aclocal.m4 --exclude=configure --exclude=config.status --exclude=borland --exclude=config.log --exclude=.deps scorched/src/scorched/Display.cpp scorched-cvs/src/scorched/Display.cpp --- scorched/src/scorched/Display.cpp 2005-08-02 21:52:12.000000000 +0200 +++ scorched-cvs/src/scorched/Display.cpp 2005-09-22 17:14:28.000000000 +0200 @@ -24,23 +24,23 @@ { { // Display settings - wxStaticBox *displayBox = new wxStaticBox(parent, -1, "Display"); + wxStaticBox *displayBox = new wxStaticBox(parent, -1, wxT("Display")); wxStaticBoxSizer *displaySizer = new wxStaticBoxSizer(displayBox, wxVERTICAL); wxFlexGridSizer *displaySizer2 = new wxFlexGridSizer(2, 3, 5, 5); - wxStaticText *resText = new wxStaticText(parent, -1, "Resolution :"); + wxStaticText *resText = new wxStaticText(parent, -1, wxT("Resolution :")); IDC_DISPLAY_CTRL = new wxComboBox(parent, -1, - "", + wxT(""), wxDefaultPosition, wxSize(315, -1), 0, 0, wxCB_READONLY); IDC_FULLSCREEN_CTRL = - new wxCheckBox(parent, -1, "Full Screen"); + new wxCheckBox(parent, -1, wxT("Full Screen")); IDC_MORERES_CTRL = - new wxCheckBox(parent, ID_MORERES, "More Resolutions"); + new wxCheckBox(parent, ID_MORERES, wxT("More Resolutions")); displaySizer2->Add(resText, 0, wxALIGN_CENTER_VERTICAL); displaySizer2->Add(IDC_DISPLAY_CTRL, 0); displaySizer2->Add(IDC_FULLSCREEN_CTRL, 0, wxALIGN_CENTRE_VERTICAL); - wxStaticText *brightText = new wxStaticText(parent, -1, "Brightness :"); + wxStaticText *brightText = new wxStaticText(parent, -1, wxT("Brightness :")); IDC_SLIDER1_CTRL = new wxSlider(parent, -1, 0,0,0, @@ -52,13 +52,13 @@ displaySizer->Add(displaySizer2, 0); wxFlexGridSizer *displaySizer3 = new wxFlexGridSizer(1, 6, 5, 5); - IDC_TINYDIALOGS_CTRL = new wxRadioButton(parent, -1, "Tiny", + IDC_TINYDIALOGS_CTRL = new wxRadioButton(parent, -1, wxT("Tiny"), wxDefaultPosition, wxDefaultSize, wxRB_GROUP); - IDC_SMALLDIALOGS_CTRL = new wxRadioButton(parent, -1, "Small"); - IDC_MEDIUMDIALOGS_CTRL = new wxRadioButton(parent, -1, "Medium"); - IDC_LARGEDIALOGS_CTRL = new wxRadioButton(parent, -1, "Large"); - IDC_HUGEDIALOGS_CTRL = new wxRadioButton(parent, -1, "Huge"); - displaySizer3->Add(new wxStaticText(parent, -1, "Dialog/Font Sizes :")); + IDC_SMALLDIALOGS_CTRL = new wxRadioButton(parent, -1, wxT("Small")); + IDC_MEDIUMDIALOGS_CTRL = new wxRadioButton(parent, -1, wxT("Medium")); + IDC_LARGEDIALOGS_CTRL = new wxRadioButton(parent, -1, wxT("Large")); + IDC_HUGEDIALOGS_CTRL = new wxRadioButton(parent, -1, wxT("Huge")); + displaySizer3->Add(new wxStaticText(parent, -1, wxT("Dialog/Font Sizes :"))); displaySizer3->Add(IDC_TINYDIALOGS_CTRL); displaySizer3->Add(IDC_SMALLDIALOGS_CTRL); displaySizer3->Add(IDC_MEDIUMDIALOGS_CTRL); @@ -70,17 +70,17 @@ { // Sound settings - wxStaticBox *soundBox = new wxStaticBox(parent, -1, "Sound"); + wxStaticBox *soundBox = new wxStaticBox(parent, -1, wxT("Sound")); wxStaticBoxSizer *soundSizerMain = new wxStaticBoxSizer(soundBox, wxVERTICAL); wxBoxSizer *soundSizer1 = new wxBoxSizer(wxHORIZONTAL); wxGridSizer *soundSizer2 = new wxGridSizer(3, 3, 10, 10); - wxStaticText *volumeText = new wxStaticText(parent, -1, "Volume :"); + wxStaticText *volumeText = new wxStaticText(parent, -1, wxT("Volume :")); IDC_NOAMBIENTSOUND_CTRL = - new wxCheckBox(parent, -1, "No Ambient Sound"); + new wxCheckBox(parent, -1, wxT("No Ambient Sound")); IDC_NOBOIDSOUND_CTRL = - new wxCheckBox(parent, -1, "No Bird Sound"); + new wxCheckBox(parent, -1, wxT("No Bird Sound")); IDC_NOSOUND_CTRL = - new wxCheckBox(parent, -1, "No Sound"); + new wxCheckBox(parent, -1, wxT("No Sound")); IDC_VOLUME_CTRL = new wxSlider(parent, -1, 0,0,0, @@ -88,13 +88,13 @@ wxSL_HORIZONTAL | wxSL_AUTOTICKS); IDC_SOUNDCHANNELS_CTRL = new wxComboBox(parent, -1, - "", - wxDefaultPosition, wxSize(40, -1), + wxT(""), + wxDefaultPosition, wxSize(55, -1), 0, 0, wxCB_READONLY); soundSizer1->Add(volumeText, 0, wxRIGHT, 10); soundSizer1->Add(IDC_VOLUME_CTRL, 0, wxRIGHT, 10); soundSizer1->Add(IDC_SOUNDCHANNELS_CTRL, 0, wxRIGHT, 5); - soundSizer1->Add(new wxStaticText(parent, -1, "Channels"), 0, wxALIGN_CENTRE_VERTICAL); + soundSizer1->Add(new wxStaticText(parent, -1, wxT("Channels")), 0, wxALIGN_CENTRE_VERTICAL); soundSizer2->Add(IDC_NOSOUND_CTRL, 0, wxRIGHT, 10); soundSizer2->Add(IDC_NOAMBIENTSOUND_CTRL, 0, wxRIGHT, 5); soundSizer2->Add(IDC_NOBOIDSOUND_CTRL, 0, wxRIGHT, 5); @@ -106,44 +106,35 @@ { // Misc switches wxStaticBox *miscBox = new wxStaticBox(parent, -1, - "Misc. Options"); + wxT("Misc. Options")); wxStaticBoxSizer *miscSizer = new wxStaticBoxSizer(miscBox, wxHORIZONTAL); wxGridSizer *miscSizer2 = new wxGridSizer(3, 3, 10, 10); IDC_INVERT_CTRL = - new wxCheckBox(parent, -1, "Invert key elevation", - wxDefaultPosition, wxSize((int) 150, (int) -1)); + new wxCheckBox(parent, -1, wxT("Invert key elevation")); miscSizer2->Add(IDC_INVERT_CTRL, 0); IDC_INVERTMOUSE_CTRL = - new wxCheckBox(parent, -1, "Invert mouse elevation", - wxDefaultPosition, wxSize((int) 150, (int) -1)); + new wxCheckBox(parent, -1, wxT("Invert mouse elevation")); miscSizer2->Add(IDC_INVERTMOUSE_CTRL, 0); IDC_SWAPYAXIS_CTRL = - new wxCheckBox(parent, -1, "Invert mouse y axis (OS X)", - wxDefaultPosition, wxSize((int) 150, (int) -1)); + new wxCheckBox(parent, -1, wxT("Invert mouse y axis (OS X)")); miscSizer2->Add(IDC_SWAPYAXIS_CTRL, 0); IDC_TIMER_CTRL = - new wxCheckBox(parent, -1, "Show frames per second", - wxDefaultPosition, wxSize((int) 150, (int) -1)); + new wxCheckBox(parent, -1, wxT("Show frames per second")); miscSizer2->Add(IDC_TIMER_CTRL, 0); IDC_TOOLTIP_CTRL = - new wxCheckBox(parent, -1, "Show ToolTips", - wxDefaultPosition, wxSize((int) 150, (int) -1)); + new wxCheckBox(parent, -1, wxT("Show ToolTips")); miscSizer2->Add(IDC_TOOLTIP_CTRL, 0); IDC_SMOUSE_CTRL = - new wxCheckBox(parent, -1, "Software Mouse", - wxDefaultPosition, wxSize((int) 150, (int) -1)); + new wxCheckBox(parent, -1, wxT("Software Mouse")); miscSizer2->Add(IDC_SMOUSE_CTRL, 0); IDC_VALIDATESERVER_CTRL = - new wxCheckBox(parent, -1, "Validate Server Ip", - wxDefaultPosition, wxSize((int) 150, (int) -1)); + new wxCheckBox(parent, -1, wxT("Validate Server Ip")); miscSizer2->Add(IDC_VALIDATESERVER_CTRL, 0); IDC_SIDESCROLL_CTRL = - new wxCheckBox(parent, -1, "Side Scrolling", - wxDefaultPosition, wxSize((int) 150, (int) -1)); + new wxCheckBox(parent, -1, wxT("Side Scrolling")); miscSizer2->Add(IDC_SIDESCROLL_CTRL, 0); IDC_LOGGING_CTRL = - new wxCheckBox(parent, -1, "Client Logging", - wxDefaultPosition, wxSize((int) 150, (int) -1)); + new wxCheckBox(parent, -1, wxT("Client Logging")); miscSizer2->Add(IDC_LOGGING_CTRL, 0); miscSizer->Add(miscSizer2, 0, wxGROW); sizer->Add(miscSizer, 0, wxGROW | wxLEFT | wxRIGHT | wxTOP, 5); @@ -152,8 +143,8 @@ { // Load settings wxBoxSizer *loadSizer = new wxBoxSizer(wxHORIZONTAL); - IDC_LOADDEFAULTS_CTRL = new wxButton(parent, ID_LOADDEFAULTS, "Restore Defaults"); - IDC_LOADSAFE_CTRL = new wxButton(parent, ID_LOADSAFE, "Safe Options"); + IDC_LOADDEFAULTS_CTRL = new wxButton(parent, ID_LOADDEFAULTS, wxT("Restore Defaults")); + IDC_LOADSAFE_CTRL = new wxButton(parent, ID_LOADSAFE, wxT("Safe Options")); loadSizer->Add(IDC_LOADDEFAULTS_CTRL, 0, wxALL, 10); loadSizer->Add(IDC_LOADSAFE_CTRL, 0, wxALL, 10); sizer->Add(loadSizer, 0, wxALIGN_CENTER); @@ -163,136 +154,114 @@ static void createTroubleControls(wxWindow *parent, wxSizer *sizer) { // Texture sizes (small med large) - wxStaticBox *textureBox = new wxStaticBox(parent, -1, "Level of Detail settings"); + wxStaticBox *textureBox = new wxStaticBox(parent, -1, wxT("Level of Detail settings")); wxStaticBoxSizer *textureSizer = new wxStaticBoxSizer(textureBox, wxHORIZONTAL); wxGridSizer *textureSizer2 = new wxGridSizer(3, 4, 10, 10); - wxStaticText *texSizeText = new wxStaticText(parent, -1, "Texture Sizes :"); + wxStaticText *texSizeText = new wxStaticText(parent, -1, wxT("Texture Sizes :")); textureSizer2->Add(texSizeText, 0, wxALIGN_CENTER_VERTICAL); - IDC_SMALLTEX_CTRL = new wxRadioButton(parent, -1, "Small (3dfx/faster)", wxDefaultPosition, wxDefaultSize, wxRB_GROUP); + IDC_SMALLTEX_CTRL = new wxRadioButton(parent, -1, wxT("Small (3dfx/faster)"), wxDefaultPosition, wxDefaultSize, wxRB_GROUP); textureSizer2->Add(IDC_SMALLTEX_CTRL, 0); - IDC_MEDIUMTEX_CTRL = new wxRadioButton(parent, -1, "Medium"); + IDC_MEDIUMTEX_CTRL = new wxRadioButton(parent, -1, wxT("Medium")); textureSizer2->Add(IDC_MEDIUMTEX_CTRL, 0); - IDC_LARGETEX_CTRL = new wxRadioButton(parent, -1, "Large (slower)"); + IDC_LARGETEX_CTRL = new wxRadioButton(parent, -1, wxT("Large (slower)")); textureSizer2->Add(IDC_LARGETEX_CTRL, 0); - wxStaticText *tankSizeText = new wxStaticText(parent, -1, "Tank Detail :"); + wxStaticText *tankSizeText = new wxStaticText(parent, -1, wxT("Tank Detail :")); textureSizer2->Add(tankSizeText, 0, wxALIGN_CENTER_VERTICAL); - IDC_LOWTANK_CTRL = new wxRadioButton(parent, -1, "Low (faster)", wxDefaultPosition, wxDefaultSize, wxRB_GROUP); + IDC_LOWTANK_CTRL = new wxRadioButton(parent, -1, wxT("Low (faster)"), wxDefaultPosition, wxDefaultSize, wxRB_GROUP); textureSizer2->Add(IDC_LOWTANK_CTRL, 0); - IDC_MEDIUMTANK_CTRL = new wxRadioButton(parent, -1, "Medium"); + IDC_MEDIUMTANK_CTRL = new wxRadioButton(parent, -1, wxT("Medium")); textureSizer2->Add(IDC_MEDIUMTANK_CTRL, 0); - IDC_HIGHTANK_CTRL = new wxRadioButton(parent, -1, "Max (slower)"); + IDC_HIGHTANK_CTRL = new wxRadioButton(parent, -1, wxT("Max (slower)")); textureSizer2->Add(IDC_HIGHTANK_CTRL, 0); - wxStaticText *effectSizeText = new wxStaticText(parent, -1, "Effects Detail :"); + wxStaticText *effectSizeText = new wxStaticText(parent, -1, wxT("Effects Detail :")); textureSizer2->Add(effectSizeText, 0, wxALIGN_CENTER_VERTICAL); - IDC_LOWEFFECTS_CTRL = new wxRadioButton(parent, -1, "Low (faster)", wxDefaultPosition, wxDefaultSize, wxRB_GROUP); + IDC_LOWEFFECTS_CTRL = new wxRadioButton(parent, -1, wxT("Low (faster)"), wxDefaultPosition, wxDefaultSize, wxRB_GROUP); textureSizer2->Add(IDC_LOWEFFECTS_CTRL, 0); - IDC_MEDIUMEFFECTS_CTRL = new wxRadioButton(parent, -1, "Medium"); + IDC_MEDIUMEFFECTS_CTRL = new wxRadioButton(parent, -1, wxT("Medium")); textureSizer2->Add(IDC_MEDIUMEFFECTS_CTRL, 0); - IDC_HIGHEFFECTS_CTRL = new wxRadioButton(parent, -1, "High (slower)"); + IDC_HIGHEFFECTS_CTRL = new wxRadioButton(parent, -1, wxT("High (slower)")); textureSizer2->Add(IDC_HIGHEFFECTS_CTRL, 0); textureSizer->Add(textureSizer2, 0, wxGROW); sizer->Add(textureSizer, 0, wxGROW | wxLEFT | wxRIGHT | wxTOP, 5); // Detail switches wxStaticBox *detailBox = new wxStaticBox(parent, -1, - "Detail (Turn off to speed up the game)"); + wxT("Detail (Turn off to speed up the game)")); wxStaticBoxSizer *detailSizer = new wxStaticBoxSizer(detailBox, wxHORIZONTAL); wxGridSizer *detailSizer2 = new wxGridSizer(3, 3, 10, 10); IDC_SINGLESKYLAYER_CTRL = - new wxCheckBox(parent, -1, "Single sky layer", - wxDefaultPosition, wxSize((int) 150, (int) -1)); + new wxCheckBox(parent, -1, wxT("Single sky layer")); detailSizer2->Add(IDC_SINGLESKYLAYER_CTRL, 0); IDC_NOSKYANI_CTRL = - new wxCheckBox(parent, -1, "Don't animate sky", - wxDefaultPosition, wxSize((int) 150, (int) -1)); + new wxCheckBox(parent, -1, wxT("Don't animate sky")); detailSizer2->Add(IDC_NOSKYANI_CTRL, 0); IDC_NOWATERANI_CTRL = - new wxCheckBox(parent, -1, "Draw simplistic water", - wxDefaultPosition, wxSize((int) 150, (int) -1)); + new wxCheckBox(parent, -1, wxT("Draw simplistic water")); detailSizer2->Add(IDC_NOWATERANI_CTRL, 0); IDC_NOWATER_CTRL = - new wxCheckBox(parent, -1, "Don't draw water", - wxDefaultPosition, wxSize((int) 150, (int) -1)); + new wxCheckBox(parent, -1, wxT("Don't draw water")); detailSizer2->Add(IDC_NOWATER_CTRL, 0); IDC_NOSURROUND_CTRL = - new wxCheckBox(parent, -1, "Don't draw surround", - wxDefaultPosition, wxSize((int) 150, (int) -1)); + new wxCheckBox(parent, -1, wxT("Don't draw surround")); detailSizer2->Add(IDC_NOSURROUND_CTRL, 0); IDC_NODETAILTEX_CTRL = - new wxCheckBox(parent, -1, "Don't use detail textures", - wxDefaultPosition, wxSize((int) 150, (int) -1)); + new wxCheckBox(parent, -1, wxT("Don't use detail textures")); detailSizer2->Add(IDC_NODETAILTEX_CTRL, 0); IDC_NOSKINS_CTRL = - new wxCheckBox(parent, -1, "No tank skins", - wxDefaultPosition, wxSize((int) 150, (int) -1)); + new wxCheckBox(parent, -1, wxT("No tank skins")); detailSizer2->Add(IDC_NOSKINS_CTRL, 0); IDC_NOBOIDS_CTRL = - new wxCheckBox(parent, -1, "No birds", - wxDefaultPosition, wxSize((int) 150, (int) -1)); + new wxCheckBox(parent, -1, wxT("No birds")); detailSizer2->Add(IDC_NOBOIDS_CTRL, 0); IDC_NOTREES_CTRL = - new wxCheckBox(parent, -1, "No trees", - wxDefaultPosition, wxSize((int) 150, (int) -1)); + new wxCheckBox(parent, -1, wxT("No trees")); detailSizer2->Add(IDC_NOTREES_CTRL, 0); IDC_NOPRECIPITATION_CTRL = - new wxCheckBox(parent, -1, "No precipitation", - wxDefaultPosition, wxSize((int) 150, (int) -1)); + new wxCheckBox(parent, -1, wxT("No precipitation")); detailSizer2->Add(IDC_NOPRECIPITATION_CTRL, 0); IDC_NODEPTHSORT_CTRL = - new wxCheckBox(parent, -1, "No sprite depth sorting", - wxDefaultPosition, wxSize((int) 150, (int) -1)); + new wxCheckBox(parent, -1, wxT("No sprite depth sorting")); detailSizer2->Add(IDC_NODEPTHSORT_CTRL, 0); IDC_NOWAVES_CTRL = - new wxCheckBox(parent, -1, "No waves at shore", - wxDefaultPosition, wxSize((int) 150, (int) -1)); + new wxCheckBox(parent, -1, wxT("No waves at shore")); detailSizer2->Add(IDC_NOWAVES_CTRL, 0); detailSizer->Add(detailSizer2, 0, wxGROW); sizer->Add(detailSizer, 0, wxGROW | wxLEFT | wxRIGHT | wxTOP, 5); // Troubleshooting switches wxStaticBox *troubleBox = new wxStaticBox(parent, -1, - "Trouble shooting (Turn off if Scorched crashes)"); + wxT("Trouble shooting (Turn off if Scorched crashes)")); wxStaticBoxSizer *troubleSizer = new wxStaticBoxSizer(troubleBox, wxHORIZONTAL); wxGridSizer *troubleSizer2 = new wxGridSizer(3, 3, 10, 10); IDC_NOEXT_CTRL = - new wxCheckBox(parent, -1, "No GL Extensions", - wxDefaultPosition, wxSize((int) 150, (int) -1)); + new wxCheckBox(parent, -1, wxT("No GL Extensions")); troubleSizer2->Add(IDC_NOEXT_CTRL, 0); IDC_NOMULTITEX_CTRL = - new wxCheckBox(parent, -1, "No multi texture", - wxDefaultPosition, wxSize((int) 150, (int) -1)); + new wxCheckBox(parent, -1, wxT("No multi texture")); troubleSizer2->Add(IDC_NOMULTITEX_CTRL, 0); IDC_NOLANDSCAPESCORCH_CTRL = - new wxCheckBox(parent, -1, "No TexSubImaging", - wxDefaultPosition, wxSize((int) 150, (int) -1)); + new wxCheckBox(parent, -1, wxT("No TexSubImaging")); troubleSizer2->Add(IDC_NOLANDSCAPESCORCH_CTRL, 0); IDC_NOCOMPILEDARRAYS_CTRL = - new wxCheckBox(parent, -1, "No compiled arrays", - wxDefaultPosition, wxSize((int) 150, (int) -1)); + new wxCheckBox(parent, -1, wxT("No compiled arrays")); troubleSizer2->Add(IDC_NOCOMPILEDARRAYS_CTRL, 0); IDC_NOENVCOMBINE_CTRL = - new wxCheckBox(parent, -1, "No combined textures", - wxDefaultPosition, wxSize((int) 150, (int) -1)); + new wxCheckBox(parent, -1, wxT("No combined textures")); troubleSizer2->Add(IDC_NOENVCOMBINE_CTRL, 0); IDC_NOCUBEMAP_CTRL = - new wxCheckBox(parent, -1, "No cube map textures", - wxDefaultPosition, wxSize((int) 150, (int) -1)); + new wxCheckBox(parent, -1, wxT("No cube map textures")); troubleSizer2->Add(IDC_NOCUBEMAP_CTRL, 0); IDC_NOMIPMAPS_CTRL = - new wxCheckBox(parent, -1, "No HW mip maps", - wxDefaultPosition, wxSize((int) 150, (int) -1)); + new wxCheckBox(parent, -1, wxT("No HW mip maps")); troubleSizer2->Add(IDC_NOMIPMAPS_CTRL, 0); IDC_FULLCLEAR_CTRL = - new wxCheckBox(parent, -1, "Full Clear", - wxDefaultPosition, wxSize((int) 150, (int) -1)); + new wxCheckBox(parent, -1, wxT("Full Clear")); troubleSizer2->Add(IDC_FULLCLEAR_CTRL, 0); IDC_NOSPHEREMAP_CTRL = - new wxCheckBox(parent, -1, "No sphere map textures", - wxDefaultPosition, wxSize((int) 150, (int) -1)); + new wxCheckBox(parent, -1, wxT("No sphere map textures")); troubleSizer2->Add(IDC_NOSPHEREMAP_CTRL, 0); IDC_NOVBO_CTRL = - new wxCheckBox(parent, -1, "No VBO", - wxDefaultPosition, wxSize((int) 150, (int) -1)); + new wxCheckBox(parent, -1, wxT("No VBO")); troubleSizer2->Add(IDC_NOVBO_CTRL, 0); troubleSizer->Add(troubleSizer2, 0, wxGROW); @@ -304,7 +273,7 @@ { // User name edit box wxStaticBox *userNameBox = new wxStaticBox(parent, -1, - "Online User Name"); + wxT("Online User Name")); wxStaticBoxSizer *userNameSizer = new wxStaticBoxSizer(userNameBox, wxVERTICAL); IDC_USERNAME_CTRL = new wxTextCtrl(parent, -1, wxString(), wxDefaultPosition, wxSize(300, -1)); userNameSizer->Add(IDC_USERNAME_CTRL, 0, wxALIGN_CENTER); @@ -314,7 +283,7 @@ { // TankModel edit box wxStaticBox *tankModelBox = new wxStaticBox(parent, -1, - "Online Tank Model"); + wxT("Online Tank Model")); wxStaticBoxSizer *tankModelSizer = new wxStaticBoxSizer(tankModelBox, wxVERTICAL); IDC_TANKMODEL_CTRL = new wxTextCtrl(parent, -1, wxString(), wxDefaultPosition, wxSize(300, -1)); tankModelSizer->Add(IDC_TANKMODEL_CTRL, 0, wxALIGN_CENTER); @@ -326,13 +295,13 @@ // User id edit box wxStaticBox *userBox = new wxStaticBox(parent, -1, - "User ID (Uniquely identifies this player for stats, not generated from any user information.)"); + wxT("User ID (Uniquely identifies this player for stats, not generated from any user information.)")); wxStaticBoxSizer *userSizer = new wxStaticBoxSizer(userBox, wxVERTICAL); IDC_USERID_CTRL = new wxGrid(parent, -1, wxDefaultPosition, wxDefaultSize); IDC_USERID_CTRL->CreateGrid(idStore.getIds().size(), 3); - IDC_USERID_CTRL->SetColLabelValue(0,"Published Ip"); - IDC_USERID_CTRL->SetColLabelValue(1, "Current Ip"); - IDC_USERID_CTRL->SetColLabelValue(2, "Unique Id"); + IDC_USERID_CTRL->SetColLabelValue(0, wxT("Published Ip")); + IDC_USERID_CTRL->SetColLabelValue(1, wxT("Current Ip")); + IDC_USERID_CTRL->SetColLabelValue(2, wxT("Unique Id")); IDC_USERID_CTRL->SetColLabelSize(20); IDC_USERID_CTRL->SetRowLabelSize(0); int pos = 0; @@ -342,9 +311,9 @@ itor++, pos++) { UniqueIdStore::Entry &entry = *itor; - IDC_USERID_CTRL->SetCellValue(pos, 0, entry.published.c_str()); - IDC_USERID_CTRL->SetCellValue(pos, 1, NetInterface::getIpName(entry.ip)); - IDC_USERID_CTRL->SetCellValue(pos, 2, entry.id.c_str()); + IDC_USERID_CTRL->SetCellValue(pos, 0, wxString(entry.published.c_str(), wxConvUTF8)); + IDC_USERID_CTRL->SetCellValue(pos, 1, wxString(NetInterface::getIpName(entry.ip), wxConvUTF8)); + IDC_USERID_CTRL->SetCellValue(pos, 2, wxString(entry.id.c_str(), wxConvUTF8)); IDC_USERID_CTRL->SetReadOnly(pos, 0); IDC_USERID_CTRL->SetReadOnly(pos, 1); } @@ -408,22 +377,24 @@ lastGroup = key->getGroup(); for (unsigned int i=0; i<5; i++) { - sizer->Add(new wxStaticText(scrolledWindow, -1, ""), 0, wxALIGN_LEFT); + sizer->Add(new wxStaticText( + scrolledWindow, -1, wxString("", wxConvUTF8)), 0, wxALIGN_LEFT); } } // Add the key name - wxStaticText *text = new wxStaticText(scrolledWindow, -1, key->getTitle()); - text->SetToolTip(key->getDescription()); + wxStaticText *text = new wxStaticText( + scrolledWindow, -1, wxString(key->getTitle(), wxConvUTF8)); + text->SetToolTip(wxString(key->getDescription(), wxConvUTF8)); sizer->Add(text, 0, wxALIGN_LEFT); // Add the keys for (unsigned int i=0; i<4; i++) { - wxButton *button = new wxButton(scrolledWindow, ID_KEY, "", + wxButton *button = new wxButton(scrolledWindow, ID_KEY, wxT(""), wxDefaultPosition, wxSize(120, -1)); button->SetRefData(new KeyButtonData(key->getName(), i)); - button->SetToolTip(key->getDescription()); + button->SetToolTip(wxString(key->getDescription(), wxConvUTF8)); sizer->Add(button, 0, wxLEFT | wxALIGN_CENTER, 5); keyboardKeyList.push_back(button); } @@ -438,7 +409,7 @@ topsizer->Add(scrolledWindow, 1, wxGROW | wxALL | wxALIGN_CENTER, 2); // Add the load default keys button - IDC_LOADKEYDEFAULTS_CTRL = new wxButton(parent, ID_KEYDEFAULTS, "Load Default Keys"); + IDC_LOADKEYDEFAULTS_CTRL = new wxButton(parent, ID_KEYDEFAULTS, wxT("Load Default Keys")); topsizer->Add(IDC_LOADKEYDEFAULTS_CTRL, 0, wxCENTER | wxALL, 2); } @@ -454,14 +425,14 @@ itor != dirs.getDirs().end(); itor++) { - modbox->Append(wxString((*itor).c_str())); + modbox->Append(wxString((*itor).c_str(), wxConvUTF8)); } } } static void createModsControls(wxWindow *parent, wxSizer *topsizer) { - wxStaticBox *modsBox = new wxStaticBox(parent, -1, "Mods"); + wxStaticBox *modsBox = new wxStaticBox(parent, -1, wxT("Mods")); wxStaticBoxSizer *modsSizer = new wxStaticBoxSizer(modsBox, wxVERTICAL); modbox = new wxListBox(parent, -1, @@ -470,8 +441,8 @@ modsSizer->Add(modbox, 0, wxALIGN_CENTER | wxALL, 5); wxBoxSizer *buttonSizer = new wxBoxSizer(wxHORIZONTAL); - wxButton *exportBut = new wxButton(parent, ID_EXPORT, "Export"); - wxButton *importBut = new wxButton(parent, ID_IMPORT, "Import"); + wxButton *exportBut = new wxButton(parent, ID_EXPORT, wxT("Export")); + wxButton *importBut = new wxButton(parent, ID_IMPORT, wxT("Import")); buttonSizer->Add(exportBut, 0, wxRIGHT, 5); buttonSizer->Add(importBut, 0, wxLEFT, 5); modsSizer->Add(buttonSizer, 0, wxALIGN_CENTER); diff -urN --exclude=CVS --exclude=Makefile --exclude=Makefile.in --exclude=autom4te.cache --exclude=aclocal.m4 --exclude=configure --exclude=config.status --exclude=borland --exclude=config.log --exclude=.deps scorched/src/scorched/DisplayDialog.cpp scorched-cvs/src/scorched/DisplayDialog.cpp --- scorched/src/scorched/DisplayDialog.cpp 2005-08-02 21:52:12.000000000 +0200 +++ scorched-cvs/src/scorched/DisplayDialog.cpp 2005-09-22 17:14:28.000000000 +0200 @@ -82,7 +82,7 @@ END_EVENT_TABLE() DisplayFrame::DisplayFrame() : - wxDialog(getMainDialog(), -1, wxString(scorched3dAppName)) + wxDialog(getMainDialog(), -1, wxString(scorched3dAppName, wxConvUTF8)) { #ifdef _WIN32 // Set the frame's icon @@ -99,7 +99,7 @@ // Main Panel mainPanel_ = new wxPanel(book_, -1); - book_->AddPage(mainPanel_, "Main"); + book_->AddPage(mainPanel_, wxT("Main")); wxSizer *mainPanelSizer = new wxBoxSizer(wxVERTICAL); createMainControls(mainPanel_, mainPanelSizer); mainPanel_->SetAutoLayout(TRUE); @@ -109,7 +109,7 @@ troublePanel_ = new wxPanel(book_, -1); wxSizer *troublePanelSizer = new wxBoxSizer(wxVERTICAL); createTroubleControls(troublePanel_, troublePanelSizer); - book_->AddPage(troublePanel_, "Troubleshooting / Detail"); + book_->AddPage(troublePanel_, wxT("Troubleshooting / Detail")); troublePanel_->SetAutoLayout(TRUE); troublePanel_->SetSizer(troublePanelSizer); @@ -117,7 +117,7 @@ keysPanel_ = new wxPanel(book_, -1); wxSizer *keysPanelSizer = new wxBoxSizer(wxVERTICAL); createKeysControls(keysPanel_, keysPanelSizer); - book_->AddPage(keysPanel_, "Keys"); + book_->AddPage(keysPanel_, wxT("Keys")); keysPanel_->SetAutoLayout(TRUE); #if wxCHECK_VERSION(2,6,0) keysPanel_->SetSizer(keysPanelSizer); @@ -132,7 +132,7 @@ identPanel_ = new wxPanel(book_, -1); wxSizer *identPanelSizer = new wxBoxSizer(wxVERTICAL); createIdentControls(identPanel_, identPanelSizer); - book_->AddPage(identPanel_, "Identity"); + book_->AddPage(identPanel_, wxT("Identity")); identPanel_->SetAutoLayout(TRUE); identPanel_->SetSizer(identPanelSizer); @@ -140,7 +140,7 @@ modsPanel_ = new wxPanel(book_, -1); wxSizer *modsPanelSizer = new wxBoxSizer(wxVERTICAL); createModsControls(modsPanel_, modsPanelSizer); - book_->AddPage(modsPanel_, "Mods"); + book_->AddPage(modsPanel_, wxT("Mods")); modsPanel_->SetAutoLayout(TRUE); modsPanel_->SetSizer(modsPanelSizer); @@ -149,8 +149,8 @@ // Ok and cancel boxes wxBoxSizer *buttonSizer = new wxBoxSizer(wxHORIZONTAL); - IDOK_CTRL = new wxButton(this, wxID_OK, "Ok"); - IDCANCEL_CTRL = new wxButton(this, wxID_CANCEL, "Cancel"); + IDOK_CTRL = new wxButton(this, wxID_OK, wxT("Ok")); + IDCANCEL_CTRL = new wxButton(this, wxID_CANCEL, wxT("Cancel")); buttonSizer->Add(IDCANCEL_CTRL, 0, wxRIGHT, 5); buttonSizer->Add(IDOK_CTRL, 0, wxLEFT, 5); topsizer->Add(buttonSizer, 0, wxALIGN_RIGHT | wxRIGHT | wxBOTTOM, 10); @@ -268,7 +268,7 @@ if (strcmp(stateName, "NONE") == 0) sprintf(buffer, "%s", keyName); else sprintf(buffer, "<%s> %s", stateName, keyName); } - button->SetLabel(buffer); + button->SetLabel(wxString(buffer, wxConvUTF8)); } } @@ -284,104 +284,106 @@ void DisplayFrame::refreshScreen() { IDC_FULLCLEAR_CTRL->SetValue(OptionsDisplay::instance()->getFullClear()); - IDC_FULLCLEAR_CTRL->SetToolTip(OptionsDisplay::instance()->getFullClearToolTip()); + IDC_FULLCLEAR_CTRL->SetToolTip(wxString(OptionsDisplay::instance()->getFullClearToolTip(), wxConvUTF8)); IDC_NOEXT_CTRL->SetValue(OptionsDisplay::instance()->getNoGLExt()); - IDC_NOEXT_CTRL->SetToolTip(OptionsDisplay::instance()->getNoGLExtToolTip()); + IDC_NOEXT_CTRL->SetToolTip(wxString(OptionsDisplay::instance()->getNoGLExtToolTip(), wxConvUTF8)); IDC_NOLANDSCAPESCORCH_CTRL->SetValue(OptionsDisplay::instance()->getNoGLTexSubImage()); - IDC_NOLANDSCAPESCORCH_CTRL->SetToolTip(OptionsDisplay::instance()->getNoGLTexSubImageToolTip()); + IDC_NOLANDSCAPESCORCH_CTRL->SetToolTip(wxString(OptionsDisplay::instance()->getNoGLTexSubImageToolTip(), wxConvUTF8)); IDC_NOMULTITEX_CTRL->SetValue(OptionsDisplay::instance()->getNoGLMultiTex()); - IDC_NOMULTITEX_CTRL->SetToolTip(OptionsDisplay::instance()->getNoGLMultiTexToolTip()); + IDC_NOMULTITEX_CTRL->SetToolTip(wxString(OptionsDisplay::instance()->getNoGLMultiTexToolTip(), wxConvUTF8)); IDC_NOCOMPILEDARRAYS_CTRL->SetValue(OptionsDisplay::instance()->getNoGLCompiledArrays()); - IDC_NOCOMPILEDARRAYS_CTRL->SetToolTip(OptionsDisplay::instance()->getNoGLCompiledArraysToolTip()); + IDC_NOCOMPILEDARRAYS_CTRL->SetToolTip(wxString(OptionsDisplay::instance()->getNoGLCompiledArraysToolTip(), wxConvUTF8)); IDC_NOENVCOMBINE_CTRL->SetValue(OptionsDisplay::instance()->getNoGLEnvCombine()); - IDC_NOENVCOMBINE_CTRL->SetToolTip(OptionsDisplay::instance()->getNoGLEnvCombineToolTip()); + IDC_NOENVCOMBINE_CTRL->SetToolTip(wxString(OptionsDisplay::instance()->getNoGLEnvCombineToolTip(), wxConvUTF8)); IDC_NOCUBEMAP_CTRL->SetValue(OptionsDisplay::instance()->getNoGLCubeMap()); - IDC_NOCUBEMAP_CTRL->SetToolTip(OptionsDisplay::instance()->getNoGLCubeMapToolTip()); + IDC_NOCUBEMAP_CTRL->SetToolTip(wxString(OptionsDisplay::instance()->getNoGLCubeMapToolTip(), wxConvUTF8)); IDC_NOSPHEREMAP_CTRL->SetValue(OptionsDisplay::instance()->getNoGLSphereMap()); - IDC_NOSPHEREMAP_CTRL->SetToolTip(OptionsDisplay::instance()->getNoGLSphereMapToolTip()); + IDC_NOSPHEREMAP_CTRL->SetToolTip(wxString(OptionsDisplay::instance()->getNoGLSphereMapToolTip(), wxConvUTF8)); IDC_NOVBO_CTRL->SetValue(OptionsDisplay::instance()->getNoVBO()); - IDC_NOVBO_CTRL->SetToolTip(OptionsDisplay::instance()->getNoVBOToolTip()); + IDC_NOVBO_CTRL->SetToolTip(wxString(OptionsDisplay::instance()->getNoVBOToolTip(), wxConvUTF8)); IDC_NOMIPMAPS_CTRL->SetValue(OptionsDisplay::instance()->getNoGLHardwareMipmaps()); - IDC_NOMIPMAPS_CTRL->SetToolTip(OptionsDisplay::instance()->getNoGLHardwareMipmapsToolTip()); + IDC_NOMIPMAPS_CTRL->SetToolTip(wxString(OptionsDisplay::instance()->getNoGLHardwareMipmapsToolTip(), wxConvUTF8)); IDC_NOSOUND_CTRL->SetValue(OptionsDisplay::instance()->getNoSound()); - IDC_NOSOUND_CTRL->SetToolTip(OptionsDisplay::instance()->getNoSoundToolTip()); + IDC_NOSOUND_CTRL->SetToolTip(wxString(OptionsDisplay::instance()->getNoSoundToolTip(), wxConvUTF8)); IDC_NOAMBIENTSOUND_CTRL->SetValue(OptionsDisplay::instance()->getNoAmbientSound()); - IDC_NOAMBIENTSOUND_CTRL->SetToolTip(OptionsDisplay::instance()->getNoAmbientSoundToolTip()); + IDC_NOAMBIENTSOUND_CTRL->SetToolTip(wxString(OptionsDisplay::instance()->getNoAmbientSoundToolTip(), wxConvUTF8)); IDC_NOBOIDSOUND_CTRL->SetValue(OptionsDisplay::instance()->getNoBoidSound()); - IDC_NOBOIDSOUND_CTRL->SetToolTip(OptionsDisplay::instance()->getNoBoidSoundToolTip()); + IDC_NOBOIDSOUND_CTRL->SetToolTip(wxString(OptionsDisplay::instance()->getNoBoidSoundToolTip(), wxConvUTF8)); IDC_NOSKINS_CTRL->SetValue(OptionsDisplay::instance()->getNoSkins()); - IDC_NOSKINS_CTRL->SetToolTip(OptionsDisplay::instance()->getNoSkinsToolTip()); + IDC_NOSKINS_CTRL->SetToolTip(wxString(OptionsDisplay::instance()->getNoSkinsToolTip(), wxConvUTF8)); IDC_FULLSCREEN_CTRL->SetValue(OptionsDisplay::instance()->getFullScreen()); - IDC_FULLSCREEN_CTRL->SetToolTip(OptionsDisplay::instance()->getFullScreenToolTip()); + IDC_FULLSCREEN_CTRL->SetToolTip(wxString(OptionsDisplay::instance()->getFullScreenToolTip(), wxConvUTF8)); IDC_SINGLESKYLAYER_CTRL->SetValue(OptionsDisplay::instance()->getNoSkyLayers()); - IDC_SINGLESKYLAYER_CTRL->SetToolTip(OptionsDisplay::instance()->getNoSkyLayersToolTip()); + IDC_SINGLESKYLAYER_CTRL->SetToolTip(wxString(OptionsDisplay::instance()->getNoSkyLayersToolTip(), wxConvUTF8)); IDC_NOSKYANI_CTRL->SetValue(OptionsDisplay::instance()->getNoSkyMovement()); - IDC_NOSKYANI_CTRL->SetToolTip(OptionsDisplay::instance()->getNoSkyMovementToolTip()); + IDC_NOSKYANI_CTRL->SetToolTip(wxString(OptionsDisplay::instance()->getNoSkyMovementToolTip(), wxConvUTF8)); IDC_NOWATERANI_CTRL->SetValue(OptionsDisplay::instance()->getNoWaterMovement()); - IDC_NOWATERANI_CTRL->SetToolTip(OptionsDisplay::instance()->getNoWaterMovementToolTip()); + IDC_NOWATERANI_CTRL->SetToolTip(wxString(OptionsDisplay::instance()->getNoWaterMovementToolTip(), wxConvUTF8)); IDC_NOWATER_CTRL->SetValue(!OptionsDisplay::instance()->getDrawWater()); - IDC_NOWATER_CTRL->SetToolTip(OptionsDisplay::instance()->getDrawWaterToolTip()); + IDC_NOWATER_CTRL->SetToolTip(wxString(OptionsDisplay::instance()->getDrawWaterToolTip(), wxConvUTF8)); IDC_NOSURROUND_CTRL->SetValue(!OptionsDisplay::instance()->getDrawSurround()); - IDC_NOSURROUND_CTRL->SetToolTip(OptionsDisplay::instance()->getDrawSurroundToolTip()); + IDC_NOSURROUND_CTRL->SetToolTip(wxString(OptionsDisplay::instance()->getDrawSurroundToolTip(), wxConvUTF8)); IDC_NOTREES_CTRL->SetValue(OptionsDisplay::instance()->getNoTrees()); - IDC_NOTREES_CTRL->SetToolTip(OptionsDisplay::instance()->getNoTreesToolTip()); + IDC_NOTREES_CTRL->SetToolTip(wxString(OptionsDisplay::instance()->getNoTreesToolTip(), wxConvUTF8)); IDC_NOPRECIPITATION_CTRL->SetValue(OptionsDisplay::instance()->getNoPrecipitation()); - IDC_NOPRECIPITATION_CTRL->SetToolTip(OptionsDisplay::instance()->getNoPrecipitationToolTip()); + IDC_NOPRECIPITATION_CTRL->SetToolTip(wxString(OptionsDisplay::instance()->getNoPrecipitationToolTip(), wxConvUTF8)); IDC_NOWAVES_CTRL->SetValue(OptionsDisplay::instance()->getNoWaves()); - IDC_NOWAVES_CTRL->SetToolTip(OptionsDisplay::instance()->getNoWavesToolTip()); + IDC_NOWAVES_CTRL->SetToolTip(wxString(OptionsDisplay::instance()->getNoWavesToolTip(), wxConvUTF8)); IDC_NODEPTHSORT_CTRL->SetValue(OptionsDisplay::instance()->getNoDepthSorting()); - IDC_NODEPTHSORT_CTRL->SetToolTip(OptionsDisplay::instance()->getNoDepthSortingToolTip()); + IDC_NODEPTHSORT_CTRL->SetToolTip(wxString(OptionsDisplay::instance()->getNoDepthSortingToolTip(), wxConvUTF8)); IDC_INVERT_CTRL->SetValue(OptionsDisplay::instance()->getInvertElevation()); - IDC_INVERT_CTRL->SetToolTip(OptionsDisplay::instance()->getInvertElevationToolTip()); + IDC_INVERT_CTRL->SetToolTip(wxString(OptionsDisplay::instance()->getInvertElevationToolTip(), wxConvUTF8)); IDC_INVERTMOUSE_CTRL->SetValue(OptionsDisplay::instance()->getInvertMouse()); - IDC_INVERTMOUSE_CTRL->SetToolTip(OptionsDisplay::instance()->getInvertMouseToolTip()); + IDC_INVERTMOUSE_CTRL->SetToolTip(wxString(OptionsDisplay::instance()->getInvertMouseToolTip(), wxConvUTF8)); IDC_SMOUSE_CTRL->SetValue(OptionsDisplay::instance()->getSoftwareMouse()); - IDC_SMOUSE_CTRL->SetToolTip(OptionsDisplay::instance()->getSoftwareMouseToolTip()); + IDC_SMOUSE_CTRL->SetToolTip(wxString(OptionsDisplay::instance()->getSoftwareMouseToolTip(), wxConvUTF8)); IDC_TOOLTIP_CTRL->SetValue(OptionsDisplay::instance()->getShowContextHelp()); - IDC_TOOLTIP_CTRL->SetToolTip(OptionsDisplay::instance()->getShowContextHelpToolTip()); + IDC_TOOLTIP_CTRL->SetToolTip(wxString(OptionsDisplay::instance()->getShowContextHelpToolTip(), wxConvUTF8)); IDC_TIMER_CTRL->SetValue(OptionsDisplay::instance()->getFrameTimer()); - IDC_TIMER_CTRL->SetToolTip(OptionsDisplay::instance()->getFrameTimerToolTip()); + IDC_TIMER_CTRL->SetToolTip(wxString(OptionsDisplay::instance()->getFrameTimerToolTip(), wxConvUTF8)); IDC_SIDESCROLL_CTRL->SetValue(OptionsDisplay::instance()->getSideScroll()); - IDC_SIDESCROLL_CTRL->SetToolTip(OptionsDisplay::instance()->getSideScrollToolTip()); + IDC_SIDESCROLL_CTRL->SetToolTip(wxString(OptionsDisplay::instance()->getSideScrollToolTip(), wxConvUTF8)); IDC_VALIDATESERVER_CTRL->SetValue(OptionsDisplay::instance()->getValidateServerIp()); - IDC_VALIDATESERVER_CTRL->SetToolTip(OptionsDisplay::instance()->getValidateServerIpToolTip()); + IDC_VALIDATESERVER_CTRL->SetToolTip(wxString(OptionsDisplay::instance()->getValidateServerIpToolTip(), wxConvUTF8)); IDC_SLIDER1_CTRL->SetRange(3, 40); IDC_SLIDER1_CTRL->SetValue(OptionsDisplay::instance()->getBrightness()); - IDC_SLIDER1_CTRL->SetToolTip(OptionsDisplay::instance()->getBrightnessToolTip()); + IDC_SLIDER1_CTRL->SetToolTip(wxString(OptionsDisplay::instance()->getBrightnessToolTip(), wxConvUTF8)); IDC_VOLUME_CTRL->SetRange(0, 128); IDC_VOLUME_CTRL->SetValue(OptionsDisplay::instance()->getSoundVolume()); - IDC_VOLUME_CTRL->SetToolTip(OptionsDisplay::instance()->getSoundVolumeToolTip()); - IDC_USERNAME_CTRL->SetValue(OptionsDisplay::instance()->getOnlineUserName()); - IDC_USERNAME_CTRL->SetToolTip(OptionsDisplay::instance()->getOnlineUserNameToolTip()); - IDC_TANKMODEL_CTRL->SetValue(OptionsDisplay::instance()->getOnlineTankModel()); - IDC_TANKMODEL_CTRL->SetToolTip(OptionsDisplay::instance()->getOnlineTankModelToolTip()); - IDC_HOSTDESC_CTRL->SetValue(OptionsDisplay::instance()->getHostDescription()); - IDC_HOSTDESC_CTRL->SetToolTip(OptionsDisplay::instance()->getHostDescriptionToolTip()); + IDC_VOLUME_CTRL->SetToolTip(wxString(OptionsDisplay::instance()->getSoundVolumeToolTip(), wxConvUTF8)); + IDC_USERNAME_CTRL->SetValue(wxString(OptionsDisplay::instance()->getOnlineUserName(), wxConvUTF8)); + IDC_USERNAME_CTRL->SetToolTip(wxString(OptionsDisplay::instance()->getOnlineUserNameToolTip(), wxConvUTF8)); + IDC_TANKMODEL_CTRL->SetValue(wxString(OptionsDisplay::instance()->getOnlineTankModel(), wxConvUTF8)); + IDC_TANKMODEL_CTRL->SetToolTip(wxString(OptionsDisplay::instance()->getOnlineTankModelToolTip(), wxConvUTF8)); + IDC_HOSTDESC_CTRL->SetValue(wxString(OptionsDisplay::instance()->getHostDescription(), wxConvUTF8)); + IDC_HOSTDESC_CTRL->SetToolTip(wxString(OptionsDisplay::instance()->getHostDescriptionToolTip(), wxConvUTF8)); IDC_NODETAILTEX_CTRL->SetValue(!OptionsDisplay::instance()->getDetailTexture()); - IDC_NODETAILTEX_CTRL->SetToolTip(OptionsDisplay::instance()->getDetailTextureToolTip()); + IDC_NODETAILTEX_CTRL->SetToolTip(wxString(OptionsDisplay::instance()->getDetailTextureToolTip(), wxConvUTF8)); IDC_NOBOIDS_CTRL->SetValue(OptionsDisplay::instance()->getNoBOIDS()); - IDC_NOBOIDS_CTRL->SetToolTip(OptionsDisplay::instance()->getNoBOIDSToolTip()); + IDC_NOBOIDS_CTRL->SetToolTip(wxString(OptionsDisplay::instance()->getNoBOIDSToolTip(), wxConvUTF8)); IDC_MORERES_CTRL->SetValue(OptionsDisplay::instance()->getMoreRes()); - IDC_MORERES_CTRL->SetToolTip(OptionsDisplay::instance()->getMoreResToolTip()); + IDC_MORERES_CTRL->SetToolTip(wxString(OptionsDisplay::instance()->getMoreResToolTip(), wxConvUTF8)); IDC_SWAPYAXIS_CTRL->SetValue(OptionsDisplay::instance()->getSwapYAxis()); - IDC_SWAPYAXIS_CTRL->SetToolTip(OptionsDisplay::instance()->getSwapYAxisToolTip()); + IDC_SWAPYAXIS_CTRL->SetToolTip(wxString(OptionsDisplay::instance()->getSwapYAxisToolTip(), wxConvUTF8)); IDC_LOGGING_CTRL->SetValue(OptionsDisplay::instance()->getClientLogToFile()); - IDC_LOGGING_CTRL->SetToolTip(OptionsDisplay::instance()->getClientLogToFileToolTip()); + IDC_LOGGING_CTRL->SetToolTip(wxString(OptionsDisplay::instance()->getClientLogToFileToolTip(), wxConvUTF8)); for (int i=2; i<=64; i+=2) { - IDC_SOUNDCHANNELS_CTRL->Append(formatString("%i", i)); + IDC_SOUNDCHANNELS_CTRL->Append( + wxString(formatString("%i", i), wxConvUTF8)); } IDC_SOUNDCHANNELS_CTRL->SetValue( - formatString("%i", OptionsDisplay::instance()->getSoundChannels())); + wxString(formatString("%i", OptionsDisplay::instance()->getSoundChannels()), + wxConvUTF8)); refreshResolutions(); - IDC_TINYDIALOGS_CTRL->SetToolTip(OptionsDisplay::instance()->getDialogSizeToolTip()); - IDC_SMALLDIALOGS_CTRL->SetToolTip(OptionsDisplay::instance()->getDialogSizeToolTip()); - IDC_MEDIUMDIALOGS_CTRL->SetToolTip(OptionsDisplay::instance()->getDialogSizeToolTip()); - IDC_LARGEDIALOGS_CTRL->SetToolTip(OptionsDisplay::instance()->getDialogSizeToolTip()); - IDC_HUGEDIALOGS_CTRL->SetToolTip(OptionsDisplay::instance()->getDialogSizeToolTip()); + IDC_TINYDIALOGS_CTRL->SetToolTip(wxString(OptionsDisplay::instance()->getDialogSizeToolTip(), wxConvUTF8)); + IDC_SMALLDIALOGS_CTRL->SetToolTip(wxString(OptionsDisplay::instance()->getDialogSizeToolTip(), wxConvUTF8)); + IDC_MEDIUMDIALOGS_CTRL->SetToolTip(wxString(OptionsDisplay::instance()->getDialogSizeToolTip(), wxConvUTF8)); + IDC_LARGEDIALOGS_CTRL->SetToolTip(wxString(OptionsDisplay::instance()->getDialogSizeToolTip(), wxConvUTF8)); + IDC_HUGEDIALOGS_CTRL->SetToolTip(wxString(OptionsDisplay::instance()->getDialogSizeToolTip(), wxConvUTF8)); switch (OptionsDisplay::instance()->getDialogSize()) { case 0: @@ -401,9 +403,9 @@ break; } - IDC_SMALLTEX_CTRL->SetToolTip(OptionsDisplay::instance()->getTexSizeToolTip()); - IDC_MEDIUMTEX_CTRL->SetToolTip(OptionsDisplay::instance()->getTexSizeToolTip()); - IDC_LARGETEX_CTRL->SetToolTip(OptionsDisplay::instance()->getTexSizeToolTip()); + IDC_SMALLTEX_CTRL->SetToolTip(wxString(OptionsDisplay::instance()->getTexSizeToolTip(), wxConvUTF8)); + IDC_MEDIUMTEX_CTRL->SetToolTip(wxString(OptionsDisplay::instance()->getTexSizeToolTip(), wxConvUTF8)); + IDC_LARGETEX_CTRL->SetToolTip(wxString(OptionsDisplay::instance()->getTexSizeToolTip(), wxConvUTF8)); switch (OptionsDisplay::instance()->getTexSize()) { case 0: @@ -417,9 +419,9 @@ break; }; - IDC_LOWEFFECTS_CTRL->SetToolTip(OptionsDisplay::instance()->getEffectsDetailToolTip()); - IDC_MEDIUMEFFECTS_CTRL->SetToolTip(OptionsDisplay::instance()->getEffectsDetailToolTip()); - IDC_HIGHEFFECTS_CTRL->SetToolTip(OptionsDisplay::instance()->getEffectsDetailToolTip()); + IDC_LOWEFFECTS_CTRL->SetToolTip(wxString(OptionsDisplay::instance()->getEffectsDetailToolTip(), wxConvUTF8)); + IDC_MEDIUMEFFECTS_CTRL->SetToolTip(wxString(OptionsDisplay::instance()->getEffectsDetailToolTip(), wxConvUTF8)); + IDC_HIGHEFFECTS_CTRL->SetToolTip(wxString(OptionsDisplay::instance()->getEffectsDetailToolTip(), wxConvUTF8)); switch (OptionsDisplay::instance()->getEffectsDetail()) { case 0: @@ -433,9 +435,9 @@ break; }; - IDC_LOWTANK_CTRL->SetToolTip(OptionsDisplay::instance()->getTankDetailToolTip()); - IDC_MEDIUMTANK_CTRL->SetToolTip(OptionsDisplay::instance()->getTankDetailToolTip()); - IDC_HIGHTANK_CTRL->SetToolTip(OptionsDisplay::instance()->getTankDetailToolTip()); + IDC_LOWTANK_CTRL->SetToolTip(wxString(OptionsDisplay::instance()->getTankDetailToolTip(), wxConvUTF8)); + IDC_MEDIUMTANK_CTRL->SetToolTip(wxString(OptionsDisplay::instance()->getTankDetailToolTip(), wxConvUTF8)); + IDC_HIGHTANK_CTRL->SetToolTip(wxString(OptionsDisplay::instance()->getTankDetailToolTip(), wxConvUTF8)); switch (OptionsDisplay::instance()->getTankDetail()) { case 0: @@ -471,7 +473,7 @@ std::string newDisplay(string); if (displaySet.find(newDisplay) == displaySet.end()) { - IDC_DISPLAY_CTRL->Append(string); + IDC_DISPLAY_CTRL->Append(wxString(string, wxConvUTF8)); displaySet.insert(newDisplay); } } @@ -487,7 +489,7 @@ std::string newDisplay(extraModes[i]); if (displaySet.find(newDisplay) == displaySet.end()) { - IDC_DISPLAY_CTRL->Append(newDisplay.c_str()); + IDC_DISPLAY_CTRL->Append(wxString(newDisplay.c_str(), wxConvUTF8)); displaySet.insert(newDisplay); } } @@ -496,7 +498,7 @@ sprintf(string, "%i x %i", OptionsDisplay::instance()->getScreenWidth(), OptionsDisplay::instance()->getScreenHeight()); - IDC_DISPLAY_CTRL->SetValue(string); + IDC_DISPLAY_CTRL->SetValue(wxString(string, wxConvUTF8)); } bool DisplayFrame::TransferDataFromWindow() @@ -514,7 +516,7 @@ OptionsDisplay::instance()->setNoSound(IDC_NOSOUND_CTRL->GetValue()); OptionsDisplay::instance()->setNoAmbientSound(IDC_NOAMBIENTSOUND_CTRL->GetValue()); OptionsDisplay::instance()->setNoBoidSound(IDC_NOBOIDSOUND_CTRL->GetValue()); - OptionsDisplay::instance()->setSoundChannels(atoi(IDC_SOUNDCHANNELS_CTRL->GetValue())); + OptionsDisplay::instance()->setSoundChannels(atoi(IDC_SOUNDCHANNELS_CTRL->GetValue().mb_str(wxConvUTF8))); OptionsDisplay::instance()->setNoSkins(IDC_NOSKINS_CTRL->GetValue()); OptionsDisplay::instance()->setNoTrees(IDC_NOTREES_CTRL->GetValue()); OptionsDisplay::instance()->setNoPrecipitation(IDC_NOPRECIPITATION_CTRL->GetValue()); @@ -535,9 +537,9 @@ OptionsDisplay::instance()->setFrameTimer(IDC_TIMER_CTRL->GetValue()); OptionsDisplay::instance()->setSideScroll(IDC_SIDESCROLL_CTRL->GetValue()); OptionsDisplay::instance()->setValidateServerIp(IDC_VALIDATESERVER_CTRL->GetValue()); - OptionsDisplay::instance()->setOnlineUserName(IDC_USERNAME_CTRL->GetValue()); - OptionsDisplay::instance()->setOnlineTankModel(IDC_TANKMODEL_CTRL->GetValue()); - OptionsDisplay::instance()->setHostDescription(IDC_HOSTDESC_CTRL->GetValue()); + OptionsDisplay::instance()->setOnlineUserName(IDC_USERNAME_CTRL->GetValue().mb_str(wxConvUTF8)); + OptionsDisplay::instance()->setOnlineTankModel(IDC_TANKMODEL_CTRL->GetValue().mb_str(wxConvUTF8)); + OptionsDisplay::instance()->setHostDescription(IDC_HOSTDESC_CTRL->GetValue().mb_str(wxConvUTF8)); OptionsDisplay::instance()->setDetailTexture(!IDC_NODETAILTEX_CTRL->GetValue()); OptionsDisplay::instance()->setNoBOIDS(IDC_NOBOIDS_CTRL->GetValue()); OptionsDisplay::instance()->setMoreRes(IDC_MORERES_CTRL->GetValue()); @@ -546,7 +548,7 @@ wxString buffer = IDC_DISPLAY_CTRL->GetValue(); int windowWidth, windowHeight; - if (sscanf(buffer.c_str(), + if (sscanf(buffer.mb_str(wxConvUTF8), "%i x %i", &windowWidth, &windowHeight) == 2) @@ -591,47 +593,49 @@ int selectionNo = modbox->GetSelection(); if (selectionNo < 0) return; wxString selection = modbox->GetString(selectionNo); - if (!selection.c_str()[0]) return; + if (selection.empty()) return; - wxString file = ::wxFileSelector("Please choose the export file to save", - getSettingsFile(""), // default path - formatString("%s.s3m", selection.c_str()), // default filename - "", // default extension - "*.s3m", - wxSAVE); + wxString file = ::wxFileSelector(wxT("Please choose the export file to save"), + wxString(getSettingsFile(""), wxConvUTF8), // default path + wxString(formatString("%s.s3m", (const char *) selection.mb_str(wxConvUTF8)), wxConvUTF8), // default filename + wxT(""), // default extension + wxT("*.s3m"), + wxSAVE); if (file.empty()) return; ModFiles files; - if (!files.loadModFiles(selection.c_str(), false)) + if (!files.loadModFiles(selection.mb_str(wxConvUTF8), false)) { - dialogMessage("Import Mod", "Failed to load mod"); + dialogMessage("Export Mod", "Failed to load mod files"); return; } - if (!files.exportModFiles(selection.c_str(), file.c_str())) + if (!files.exportModFiles( + selection.mb_str(wxConvUTF8), + file.mb_str(wxConvUTF8))) { - dialogMessage("Import Mod", "Failed to write mod"); + dialogMessage("Export Mod", "Failed to write mod export file"); return; } } void DisplayFrame::onImportMod(wxCommandEvent &event) { - wxString file = ::wxFileSelector("Please choose the import file to open", - getSettingsFile(""), // default path - "", // default filename - "", // default extension - "*.s3m", - wxOPEN | wxFILE_MUST_EXIST); + wxString file = ::wxFileSelector(wxT("Please choose the import file to open"), + wxString(getSettingsFile(""),wxConvUTF8), // default path + wxT(""), // default filename + wxT(""), // default extension + wxT("*.s3m"), + wxOPEN | wxFILE_MUST_EXIST); if (file.empty()) return; ModFiles files; const char *mod = 0; - if (!files.importModFiles(&mod, file.c_str())) + if (!files.importModFiles(&mod, file.mb_str(wxConvUTF8))) { - dialogMessage("Export Mod", "Failed to read mod"); + dialogMessage("Import Mod", "Failed to read mod export file"); return; } if (!files.writeModFiles(mod)) { - dialogMessage("Export Mod", "Failed to save mod"); + dialogMessage("Import Mod", "Failed to write mod files"); return; } updateModList(); diff -urN --exclude=CVS --exclude=Makefile --exclude=Makefile.in --exclude=autom4te.cache --exclude=aclocal.m4 --exclude=configure --exclude=config.status --exclude=borland --exclude=config.log --exclude=.deps scorched/src/scorched/HtmlHelpDialog.cpp scorched-cvs/src/scorched/HtmlHelpDialog.cpp --- scorched/src/scorched/HtmlHelpDialog.cpp 2004-12-20 16:06:06.000000000 +0100 +++ scorched-cvs/src/scorched/HtmlHelpDialog.cpp 2005-09-22 17:14:28.000000000 +0200 @@ -62,7 +62,7 @@ END_EVENT_TABLE() HelpFrame::HelpFrame() : - wxFrame(getMainDialog(), -1, wxString(scorched3dAppName), + wxFrame(getMainDialog(), -1, wxString(scorched3dAppName, wxConvUTF8), wxDefaultPosition, wxDefaultSize, wxSTAY_ON_TOP | wxCAPTION | wxSYSTEM_MENU | wxMINIMIZE_BOX | wxMAXIMIZE_BOX | wxTHICK_FRAME) { @@ -82,13 +82,13 @@ // Ok Button wxBoxSizer *buttonSizer2 = new wxBoxSizer(wxHORIZONTAL); - wxButton *IDBACK_CTRL = new wxButton(this, ID_BUTTON_BACK, "<< Back", + wxButton *IDBACK_CTRL = new wxButton(this, ID_BUTTON_BACK, wxT("<< Back"), wxDefaultPosition, wxSize(-1, 18)); buttonSizer2->Add(IDBACK_CTRL, 0, wxALL, 3); - wxButton *IDHOME_CTRL = new wxButton(this, ID_BUTTON_HOME, "Home", + wxButton *IDHOME_CTRL = new wxButton(this, ID_BUTTON_HOME, wxT("Home"), wxDefaultPosition, wxSize(-1, 18)); buttonSizer2->Add(IDHOME_CTRL, 0, wxALL, 3); - wxButton *IDFORWARD_CTRL = new wxButton(this, ID_BUTTON_FORWARD, "Forward >>", + wxButton *IDFORWARD_CTRL = new wxButton(this, ID_BUTTON_FORWARD, wxT("Forward >>"), wxDefaultPosition, wxSize(-1, 18)); buttonSizer2->Add(IDFORWARD_CTRL, 0, wxALL, 3); topsizer->Add(buttonSizer2, 0, wxALIGN_CENTER); @@ -102,7 +102,7 @@ // Ok Button wxBoxSizer *buttonSizer = new wxBoxSizer(wxHORIZONTAL); - wxButton *IDOK_CTRL = new wxButton(this, ID_BUTTON_OK, "Close", + wxButton *IDOK_CTRL = new wxButton(this, ID_BUTTON_OK, wxT("Close"), wxDefaultPosition, wxSize(-1, 18)); IDOK_CTRL->SetDefault(); buttonSizer->Add(IDOK_CTRL, 0, wxALL, 3); @@ -137,11 +137,14 @@ void HelpFrame::onHome(wxCommandEvent &event) { html_->HistoryClear(); - html_->LoadPage(getDocFile("documentation/html/index.html")); + html_->LoadPage(wxString(getDocFile("documentation/html/index.html"), wxConvUTF8)); } void showHtmlHelpDialog() { - HelpFrame *frame = new HelpFrame(); - frame->Show(); + // For the moment just show the documentation in the default web browser + showURL(getDocFile("documentation/html/index.html")); + + //HelpFrame *frame = new HelpFrame(); + //frame->Show(); } diff -urN --exclude=CVS --exclude=Makefile --exclude=Makefile.in --exclude=autom4te.cache --exclude=aclocal.m4 --exclude=configure --exclude=config.status --exclude=borland --exclude=config.log --exclude=.deps scorched/src/scorched/KeyDialog.cpp scorched-cvs/src/scorched/KeyDialog.cpp --- scorched/src/scorched/KeyDialog.cpp 2004-11-01 20:15:43.000000000 +0100 +++ scorched-cvs/src/scorched/KeyDialog.cpp 2005-09-22 17:14:28.000000000 +0200 @@ -41,7 +41,8 @@ { wxBoxSizer *topsizer = new wxBoxSizer(wxVERTICAL); - wxStaticText *text = new wxStaticText(this, -1, "Press a key to bind to this function"); + wxStaticText *text = + new wxStaticText(this, -1, wxT("Press a key to bind to this function")); topsizer->Add(text, 0, wxALIGN_CENTER | wxALL, 5); SetSizer(topsizer); // use the sizer for layout @@ -114,7 +115,7 @@ END_EVENT_TABLE() KeyFrame::KeyFrame(wxDialog *dialog) : - wxDialog(dialog, -1, wxString(scorched3dAppName), + wxDialog(dialog, -1, wxString(scorched3dAppName, wxConvUTF8), wxDefaultPosition, wxSize(190, 50), wxSIMPLE_BORDER ) { #ifdef _WIN32 diff -urN --exclude=CVS --exclude=Makefile --exclude=Makefile.in --exclude=autom4te.cache --exclude=aclocal.m4 --exclude=configure --exclude=config.status --exclude=borland --exclude=config.log --exclude=.deps scorched/src/scorched/ListDialog.cpp scorched-cvs/src/scorched/ListDialog.cpp --- scorched/src/scorched/ListDialog.cpp 2004-11-29 19:09:04.000000000 +0100 +++ scorched-cvs/src/scorched/ListDialog.cpp 2005-09-22 17:14:28.000000000 +0200 @@ -22,7 +22,7 @@ #include ListDialog::ListDialog(wxWindow *parent, const char *title) : - wxDialog(parent, -1, wxString(title), + wxDialog(parent, -1, wxString(title, wxConvUTF8), wxDefaultPosition, wxDefaultSize) { #ifdef _WIN32 @@ -36,7 +36,7 @@ topsizer->Add(list_, 0, wxALL, 10); wxBoxSizer *buttonSizer = new wxBoxSizer(wxHORIZONTAL); - buttonSizer->Add(new wxButton(this, wxID_OK, "Ok"), 0, wxALL, 10); + buttonSizer->Add(new wxButton(this, wxID_OK, wxT("Ok")), 0, wxALL, 10); topsizer->Add(buttonSizer, 0, wxALIGN_RIGHT); SetSizer(topsizer); @@ -47,6 +47,6 @@ void ListDialog::addItem(const char *item) { - list_->Append(item); + list_->Append(wxString(item, wxConvUTF8)); } diff -urN --exclude=CVS --exclude=Makefile --exclude=Makefile.in --exclude=autom4te.cache --exclude=aclocal.m4 --exclude=configure --exclude=config.status --exclude=borland --exclude=config.log --exclude=.deps scorched/src/scorched/MainDialog.cpp scorched-cvs/src/scorched/MainDialog.cpp --- scorched/src/scorched/MainDialog.cpp 2005-01-31 01:24:46.000000000 +0100 +++ scorched-cvs/src/scorched/MainDialog.cpp 2005-09-22 17:14:28.000000000 +0200 @@ -63,7 +63,7 @@ int buttonId) { wxBitmap scorchedBitmap; - if (scorchedBitmap.LoadFile(fileName, + if (scorchedBitmap.LoadFile(wxString(fileName, wxConvUTF8), wxBITMAP_TYPE_BMP) && scorchedBitmap.Ok()) { @@ -85,7 +85,7 @@ } static SDL_mutex *messageMutex_ = 0; -static wxString messageString_; +static std::string messageString_; static int exitCode_ = 0; class ScorchedProcess : public wxProcess @@ -113,7 +113,7 @@ { wxTextInputStream tis(*GetInputStream()); wxString line = tis.ReadLine(); - messageString_.append(line); + messageString_.append((const char *) line.mb_str(wxConvUTF8)); messageString_.append("\n"); } SDL_UnlockMutex(messageMutex_); @@ -128,9 +128,13 @@ #ifdef _WIN32 WinExec(formatString("explorer %s", url) ,SW_SHOWDEFAULT); #else +#ifdef __DARWIN__ + system(formatString("open %s", url)); +#else system(formatString("mozilla %s", url)); dialogMessage("Web site location", "%s", url); -#endif +#endif // __DARWIN__ +#endif // _WIN32 } void runScorched3D(const char *fmt, ...) @@ -146,7 +150,7 @@ sprintf(path, "%s %s", exeName, text); ScorchedProcess *process = new ScorchedProcess(); - long result = ::wxExecute(path, wxEXEC_ASYNC, process); + long result = ::wxExecute(wxString(path, wxConvUTF8), wxEXEC_ASYNC, process); if (result == 0) { delete process; @@ -168,20 +172,20 @@ wxButton *button = 0; wxBitmap bitmap; const char *bitmapFile = getDataFile(bitmapName); - if (bitmap.LoadFile(bitmapFile, wxBITMAP_TYPE_BMP) && + if (bitmap.LoadFile(wxString(bitmapFile, wxConvUTF8), wxBITMAP_TYPE_BMP) && bitmap.Ok()) { button = new wxBitmapButton(parent, id, bitmap); } else { - button = new wxButton(parent, id, "Select"); + button = new wxButton(parent, id, wxT("Select")); } if (data) button->SetRefData(data); wxStaticText *staticText = new wxStaticText( parent, -1, - text); + wxString(text, wxConvUTF8)); sizer->Add(button, 0, wxRIGHT, 5); sizer->Add(staticText, 0, wxALIGN_CENTER_VERTICAL | wxLEFT, 5); @@ -222,13 +226,15 @@ END_EVENT_TABLE() MainFrame::MainFrame() : - wxFrame((wxFrame *)NULL, -1, scorched3dAppName, wxDefaultPosition, wxDefaultSize, + wxFrame((wxFrame *)NULL, -1, wxString(scorched3dAppName, wxConvUTF8), + wxDefaultPosition, wxDefaultSize, wxMINIMIZE_BOX | wxCAPTION) { if (!messageMutex_) messageMutex_ = SDL_CreateMutex(); // Set the frame's icon - wxIcon icon(getDataFile("data/windows/tank2.ico"), wxBITMAP_TYPE_ICO); + wxString iconName(getDataFile("data/windows/tank2.ico"), wxConvUTF8); + wxIcon icon(iconName, wxBITMAP_TYPE_ICO); SetIcon(icon); // Set the backbround color to be that of the default @@ -308,7 +314,7 @@ wxBoxSizer *buttonSizer = new wxBoxSizer(wxHORIZONTAL); { wxBitmap scorchedBitmap; - if (scorchedBitmap.LoadFile(getDataFile("data/windows/donate.bmp"), + if (scorchedBitmap.LoadFile(wxString(getDataFile("data/windows/donate.bmp"), wxConvUTF8), wxBITMAP_TYPE_BMP) && scorchedBitmap.Ok()) { @@ -318,7 +324,7 @@ } } buttonSizer->Add(new wxBoxSizer(wxHORIZONTAL), 1, wxGROW); - buttonSizer->Add(new wxButton(this, wxID_CANCEL, "Quit"), 0, + buttonSizer->Add(new wxButton(this, wxID_CANCEL, wxT("Quit")), 0, wxALIGN_RIGHT | wxALIGN_BOTTOM | wxALL, 10); topsizer->Add(buttonSizer, 1, wxGROW); @@ -335,7 +341,7 @@ void MainFrame::onTimer(wxTimerEvent &event) { - wxString newString; + std::string newString; SDL_LockMutex(messageMutex_); if (!messageString_.empty()) { @@ -359,8 +365,8 @@ "the very latest drivers\n" "for your graphics card."); int answer = ::wxMessageBox( - newString, - "Scorched3D Abnormal Termination", + wxString(newString.c_str(), wxConvUTF8), + wxT("Scorched3D Abnormal Termination"), wxYES_NO | wxICON_ERROR); if (answer == wxYES) { @@ -371,8 +377,8 @@ else { ::wxMessageBox( - newString, - "Scorched3D Termination", + wxString(newString.c_str(), wxConvUTF8), + wxT("Scorched3D Termination"), wxICON_ERROR); } } diff -urN --exclude=CVS --exclude=Makefile --exclude=Makefile.in --exclude=autom4te.cache --exclude=aclocal.m4 --exclude=configure --exclude=config.status --exclude=borland --exclude=config.log --exclude=.deps scorched/src/scorched/NetDialog.cpp scorched-cvs/src/scorched/NetDialog.cpp --- scorched/src/scorched/NetDialog.cpp 2005-07-24 21:34:00.000000000 +0200 +++ scorched-cvs/src/scorched/NetDialog.cpp 2005-09-23 15:16:43.000000000 +0200 @@ -40,8 +40,6 @@ return false; } - if (0 == strcmp(version.c_str(), "37")) return false; - return true; } @@ -128,10 +126,10 @@ std::string maxclients = ServerBrowser::instance()->getServerList(). getEntryValue(item, "maxplayers"); - static char text[256]; + char text[256]; sprintf(text, "%s/%s", clients.c_str(), maxclients.c_str()); - return text; + return wxString(text, wxConvUTF8); } case 3: name = "round"; break; case 4: name = "mod"; break; @@ -140,9 +138,9 @@ case 7: name = "os"; break; case 8: name = "address"; break; } - return ServerBrowser::instance()->getServerList().getEntryValue(item, name); + return wxString(ServerBrowser::instance()->getServerList().getEntryValue(item, name), wxConvUTF8); } - return ""; + return wxT(""); } BEGIN_EVENT_TABLE(NetListControl, wxListCtrl) @@ -197,7 +195,7 @@ END_EVENT_TABLE() NetLanFrame::NetLanFrame() : - wxDialog(getMainDialog(), -1, scorched3dAppName, + wxDialog(getMainDialog(), -1, wxString(scorched3dAppName, wxConvUTF8), wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER | wxMAXIMIZE_BOX) { @@ -246,9 +244,9 @@ wxString password = IDC_EDIT_PASSWORD_CTRL->GetValue(); wxString username = IDC_EDIT_NAME_CTRL->GetValue(); + std::string host = (const char *) value.mb_str(wxConvUTF8); std::string hostPart; - const char *host = value.c_str(); - char *colon = strchr(host, ':'); + char *colon = strchr(host.c_str(), ':'); if (colon) { *colon = '\0'; @@ -260,7 +258,7 @@ hostPart = host; } - if (password.c_str()[0] && username.c_str()[0]) + if (!password.empty() && !username.empty()) { IPaddress officialaddress; IPaddress thisaddress; @@ -269,11 +267,11 @@ { if (officialaddress.host != thisaddress.host) { - wxString wxText("Warning: You are about to send username and password\n" - "information to a non-official server.\n" - "\n" - "Do you wish to continue?"); - wxString wxHeader("Scorched3D"); + wxString wxText(wxT("Warning: You are about to send username and password\n") + wxT("information to a non-official server.\n") + wxT("\n") + wxT("Do you wish to continue?")); + wxString wxHeader(wxT("Scorched3D")); int answer = ::wxMessageBox(wxText, wxHeader, wxYES_NO | wxCENTRE); if (answer != wxYES) return; } @@ -293,13 +291,13 @@ void NetLanFrame::onClearButton(wxCommandEvent &event) { - IDC_EDIT_SERVER_CTRL->SetValue(""); + IDC_EDIT_SERVER_CTRL->SetValue(wxT("")); onServerChanged(event); } void NetLanFrame::onClearPasswordButton(wxCommandEvent &event) { - IDC_EDIT_PASSWORD_CTRL->SetValue(""); + IDC_EDIT_PASSWORD_CTRL->SetValue(wxT("")); } void NetLanFrame::onSelectServer(wxListEvent &event) @@ -335,7 +333,7 @@ version.c_str(), protocolVersion.c_str(), ScorchedVersion, ScorchedProtocolVersion); } - IDC_EDIT_SERVER_CTRL->SetValue(text.c_str()); + IDC_EDIT_SERVER_CTRL->SetValue(wxString(text.c_str(), wxConvUTF8)); int noplayers = atoi(ServerBrowser::instance()->getServerList().getEntryValue(item, "noplayers")); @@ -344,27 +342,27 @@ static char tmp[128]; sprintf(tmp, "pn%i", i); long index = IDC_PLAYER_LIST_CTRL->InsertItem(0, - ServerBrowser::instance()->getServerList().getEntryValue(item, tmp)); + wxString(ServerBrowser::instance()->getServerList().getEntryValue(item, tmp), wxConvUTF8)); sprintf(tmp, "ps%i", i); IDC_PLAYER_LIST_CTRL-> SetItem(index, 1, - ServerBrowser::instance()->getServerList().getEntryValue(item, tmp)); + wxString(ServerBrowser::instance()->getServerList().getEntryValue(item, tmp), wxConvUTF8)); sprintf(tmp, "pt%i", i); IDC_PLAYER_LIST_CTRL-> SetItem(index, 2, - ServerBrowser::instance()->getServerList().getEntryValue(item, tmp)); + wxString(ServerBrowser::instance()->getServerList().getEntryValue(item, tmp), wxConvUTF8)); sprintf(tmp, "pm%i", i); IDC_PLAYER_LIST_CTRL-> SetItem(index, 3, - ServerBrowser::instance()->getServerList().getEntryValue(item, tmp)); + wxString(ServerBrowser::instance()->getServerList().getEntryValue(item, tmp), wxConvUTF8)); sprintf(tmp, "pr%i", i); IDC_PLAYER_LIST_CTRL-> SetItem(index, 4, - ServerBrowser::instance()->getServerList().getEntryValue(item, tmp)); + wxString(ServerBrowser::instance()->getServerList().getEntryValue(item, tmp), wxConvUTF8)); } wxCommandEvent event; @@ -388,7 +386,7 @@ void NetLanFrame::onServerChanged(wxCommandEvent &event) { wxString value = IDC_EDIT_SERVER_CTRL->GetValue(); - bool enabled = (value.c_str()[0] != '\0'); + bool enabled = !value.empty(); IDOK_CTRL->Enable(enabled); IDOK_CTRL->SetDefault(); } @@ -419,11 +417,11 @@ { // Set the ok button to disabled IDC_EDIT_SERVER_CTRL->SetValue( - OptionsParam::instance()->getConnect()); + wxString(OptionsParam::instance()->getConnect(), wxConvUTF8)); IDC_EDIT_NAME_CTRL->SetValue( - OptionsParam::instance()->getUserName()); + wxString(OptionsParam::instance()->getUserName(), wxConvUTF8)); IDC_EDIT_PASSWORD_CTRL->SetValue( - OptionsParam::instance()->getPassword()); + wxString(OptionsParam::instance()->getPassword(), wxConvUTF8)); // Setup the server list control struct ListItem @@ -446,7 +444,7 @@ { IDC_SERVER_LIST_CTRL->InsertColumn( i, - mainListItems[i].name, + wxString(mainListItems[i].name, wxConvUTF8), wxLIST_FORMAT_LEFT, mainListItems[i].size); } @@ -464,7 +462,7 @@ { IDC_PLAYER_LIST_CTRL->InsertColumn( i, - playerListItems[i].name, + wxString(playerListItems[i].name, wxConvUTF8), wxLIST_FORMAT_LEFT, playerListItems[i].size); } @@ -482,7 +480,7 @@ void NetListControl::onDClickServer(wxMouseEvent& event) { wxString value = IDC_EDIT_SERVER_CTRL->GetValue(); - bool enabled = (value.c_str()[0] != '\0'); + bool enabled = !value.empty(); if (enabled) { NetLanFrame *parent = (NetLanFrame *) GetParent(); @@ -500,17 +498,17 @@ wxString username = IDC_EDIT_NAME_CTRL->GetValue(); char buffer[1024]; - sprintf(buffer, "-connect \"%s\"", value.c_str()); + sprintf(buffer, "-connect \"%s\"", (const char *) value.mb_str(wxConvUTF8)); - if (password.c_str()[0]) + if (!password.empty()) { strcat(buffer, " -password "); - strcat(buffer, password.c_str()); + strcat(buffer, password.mb_str(wxConvUTF8)); } - if (username.c_str()[0]) + if (!username.empty()) { strcat(buffer, " -username "); - strcat(buffer, username.c_str()); + strcat(buffer, username.mb_str(wxConvUTF8)); } runScorched3D(buffer); } diff -urN --exclude=CVS --exclude=Makefile --exclude=Makefile.in --exclude=autom4te.cache --exclude=aclocal.m4 --exclude=configure --exclude=config.status --exclude=borland --exclude=config.log --exclude=.deps scorched/src/scorched/NetLan.cpp scorched-cvs/src/scorched/NetLan.cpp --- scorched/src/scorched/NetLan.cpp 2005-07-24 21:34:00.000000000 +0200 +++ scorched-cvs/src/scorched/NetLan.cpp 2005-09-22 17:14:28.000000000 +0200 @@ -21,66 +21,88 @@ #include "NetLan-def.cpp" #include +static void createImageMap() +{ + wxBitmap questionBitmap; + questionBitmap.LoadFile( + wxString(getDataFile("data/windows/question.gif"), wxConvUTF8), + wxBITMAP_TYPE_GIF); + wxBitmap okBitmap; + okBitmap.LoadFile( + wxString(getDataFile("data/windows/ok.gif"), wxConvUTF8), + wxBITMAP_TYPE_GIF); + wxBitmap warnBitmap; + warnBitmap.LoadFile( + wxString(getDataFile("data/windows/warn.gif"), wxConvUTF8), + wxBITMAP_TYPE_GIF); + wxBitmap exlaimBitmap; + exlaimBitmap.LoadFile( + wxString(getDataFile("data/windows/exclaim.gif"), wxConvUTF8), + wxBITMAP_TYPE_GIF); + if (!netLanImageList) + { + netLanImageList = new wxImageList(16, 16, TRUE); + netLanImageList->Add(questionBitmap); + netLanImageList->Add(okBitmap); + netLanImageList->Add(warnBitmap); + netLanImageList->Add(exlaimBitmap); + } +} + static void createControlsPre(wxWindow *parent, wxSizer *sizer) { + createImageMap(); + wxBitmap maskBitmap; maskBitmap.LoadFile( - getDataFile("data/windows/mask.bmp"), + wxString(getDataFile("data/windows/mask.bmp"), wxConvUTF8), wxBITMAP_TYPE_BMP); wxBitmap questionBitmap; questionBitmap.LoadFile( - getDataFile("data/windows/question.gif"), + wxString(getDataFile("data/windows/question.gif"), wxConvUTF8), wxBITMAP_TYPE_GIF); wxBitmap okBitmap; okBitmap.LoadFile( - getDataFile("data/windows/ok.gif"), + wxString(getDataFile("data/windows/ok.gif"), wxConvUTF8), wxBITMAP_TYPE_GIF); wxBitmap warnBitmap; warnBitmap.LoadFile( - getDataFile("data/windows/warn.gif"), + wxString(getDataFile("data/windows/warn.gif"), wxConvUTF8), wxBITMAP_TYPE_GIF); wxBitmap exlaimBitmap; exlaimBitmap.LoadFile( - getDataFile("data/windows/exclaim.gif"), + wxString(getDataFile("data/windows/exclaim.gif"), wxConvUTF8), wxBITMAP_TYPE_GIF); - if (!netLanImageList) - { - netLanImageList = new wxImageList(16, 16, TRUE); - netLanImageList->Add(questionBitmap, maskBitmap); - netLanImageList->Add(okBitmap, maskBitmap); - netLanImageList->Add(warnBitmap, maskBitmap); - netLanImageList->Add(exlaimBitmap, maskBitmap); - } // Name/password wxGridSizer *nameSizer = new wxFlexGridSizer(3, 3, 5, 5); wxStaticText *nameText = - new wxStaticText(parent, -1, "Connect To Name/IP : "); + new wxStaticText(parent, -1, wxT("Connect To Name/IP : ")); wxStaticText *userNameText = - new wxStaticText(parent, -1, "User Name (Optional) : "); + new wxStaticText(parent, -1, wxT("User Name (Optional) : ")); wxStaticText *passText = - new wxStaticText(parent, -1, "Password (Optional) : "); + new wxStaticText(parent, -1, wxT("Password (Optional) : ")); IDC_EDIT_SERVER_CTRL = new wxTextCtrl(parent, IDC_EDIT_SERVER, - "", wxDefaultPosition, wxSize(285, -1)); + wxT(""), wxDefaultPosition, wxSize(285, -1)); IDC_EDIT_NAME_CTRL = new wxTextCtrl(parent, IDC_EDIT_NAME, - "", wxDefaultPosition, wxSize(285, -1), 0); + wxT(""), wxDefaultPosition, wxSize(285, -1), 0); IDC_EDIT_PASSWORD_CTRL = new wxTextCtrl(parent, IDC_EDIT_PASSWORD, - "", wxDefaultPosition, wxSize(285, -1), wxTE_PASSWORD); + wxT(""), wxDefaultPosition, wxSize(285, -1), wxTE_PASSWORD); IDC_CLEAR_CTRL = new wxButton(parent, IDC_CLEAR, - "Clear", + wxT("Clear"), wxDefaultPosition, wxSize(-1, 20)); IDC_CLEAR_NAME_CTRL = new wxButton(parent, IDC_CLEAR_NAME, - "Clear", + wxT("Clear"), wxDefaultPosition, wxSize(-1, 20)); IDC_CLEAR_PASSWORD_CTRL = new wxButton(parent, IDC_CLEAR_PASSWORD, - "Clear", + wxT("Clear"), wxDefaultPosition, wxSize(-1, 20)); nameSizer->Add(nameText, 0, wxALIGN_CENTER_VERTICAL); nameSizer->Add(IDC_EDIT_SERVER_CTRL, 0, 0); @@ -96,13 +118,13 @@ // Key wxFlexGridSizer *keySizer = new wxFlexGridSizer(1, 8, 5, 5); keySizer->Add(new wxStaticBitmap(parent, -1, questionBitmap)); - keySizer->Add(new wxStaticText(parent, -1, "State unknown"), 0, wxRIGHT, 10); + keySizer->Add(new wxStaticText(parent, -1, wxT("State unknown")), 0, wxRIGHT, 10); keySizer->Add(new wxStaticBitmap(parent, -1, okBitmap)); - keySizer->Add(new wxStaticText(parent, -1, "Game in progress"), 0, wxRIGHT, 10); + keySizer->Add(new wxStaticText(parent, -1, wxT("Game in progress")), 0, wxRIGHT, 10); keySizer->Add(new wxStaticBitmap(parent, -1, warnBitmap)); - keySizer->Add(new wxStaticText(parent, -1, "No game in progress"), 0, wxRIGHT, 10); + keySizer->Add(new wxStaticText(parent, -1, wxT("No game in progress")), 0, wxRIGHT, 10); keySizer->Add(new wxStaticBitmap(parent, -1, exlaimBitmap)); - keySizer->Add(new wxStaticText(parent, -1, "Cannot join")); + keySizer->Add(new wxStaticText(parent, -1, wxT("Cannot join"))); sizer->Add(keySizer, 0, wxALIGN_CENTER | wxALL, 5); } @@ -112,17 +134,17 @@ // Lan/Internet refresh wxBoxSizer *refreshButtonSizer = new wxBoxSizer(wxHORIZONTAL); IDC_BUTTON_LAN_CTRL = - new wxButton(parent, IDC_BUTTON_LAN, "Refresh LAN Games"); + new wxButton(parent, IDC_BUTTON_LAN, wxT("Refresh LAN Games")); IDC_BUTTON_NET_CTRL = - new wxButton(parent, IDC_BUTTON_NET, "Refresh Internet Games"); + new wxButton(parent, IDC_BUTTON_NET, wxT("Refresh Internet Games")); refreshButtonSizer->Add(IDC_BUTTON_LAN_CTRL, 0, wxALL, 5); refreshButtonSizer->Add(IDC_BUTTON_NET_CTRL, 0, wxALL, 5); sizer->Add(refreshButtonSizer, 0, wxALIGN_RIGHT); // Ok and cancel boxes wxBoxSizer *buttonSizer = new wxBoxSizer(wxHORIZONTAL); - IDOK_CTRL = new wxButton(parent, IDC_BUTTON_JOIN, "Join Game"); - IDCANCEL_CTRL = new wxButton(parent, wxID_CANCEL, "Cancel"); + IDOK_CTRL = new wxButton(parent, IDC_BUTTON_JOIN, wxT("Join Game")); + IDCANCEL_CTRL = new wxButton(parent, wxID_CANCEL, wxT("Cancel")); buttonSizer->Add(IDCANCEL_CTRL, 0, wxALL, 5); buttonSizer->Add(IDOK_CTRL, 0, wxALL, 5); sizer->Add(buttonSizer, 0, wxALIGN_RIGHT); diff -urN --exclude=CVS --exclude=Makefile --exclude=Makefile.in --exclude=autom4te.cache --exclude=aclocal.m4 --exclude=configure --exclude=config.status --exclude=borland --exclude=config.log --exclude=.deps scorched/src/scorched/ServerDialog.cpp scorched-cvs/src/scorched/ServerDialog.cpp --- scorched/src/scorched/ServerDialog.cpp 2005-06-20 02:35:08.000000000 +0200 +++ scorched-cvs/src/scorched/ServerDialog.cpp 2005-09-23 15:16:44.000000000 +0200 @@ -119,7 +119,7 @@ switch (column) { case 0: - return (char *) tank->getName(); + return wxString((char *) tank->getName(), wxConvUTF8); break; case 1: { @@ -129,44 +129,44 @@ result = tank->getTankAI()->getName(); } - return result; + return wxString(result, wxConvUTF8); } break; case 2: { - static char buffer[256]; + char buffer[256]; sprintf(buffer, "dest=%i ip=%s id=%i", tank->getDestinationId(), NetInterface::getIpName(tank->getIpAddress()), tank->getPlayerId()); - return buffer; + return wxString(buffer, wxConvUTF8); } break; case 3: - return (char *) tank->getScore().getTimePlayedString(); + return wxString((char *) tank->getScore().getTimePlayedString(), wxConvUTF8); break; case 4: - return (char *) tank->getScore().getScoreString(); + return wxString((char *) tank->getScore().getScoreString(), wxConvUTF8); break; case 5: - return (char *) tank->getState().getStateString(); + return wxString((char *) tank->getState().getStateString(), wxConvUTF8); break; case 6: - if (tank->getTeam() == 0) return "None"; - else if (tank->getTeam() == 1) return "Red"; - else if (tank->getTeam() == 2) return "Blue"; - else if (tank->getTeam() == 3) return "Green"; - else if (tank->getTeam() == 4) return "Yellow"; + if (tank->getTeam() == 0) return wxT("None"); + else if (tank->getTeam() == 1) return wxT("Red"); + else if (tank->getTeam() == 2) return wxT("Blue"); + else if (tank->getTeam() == 3) return wxT("Green"); + else if (tank->getTeam() == 4) return wxT("Yellow"); break; case 7: - return tank->getHostDesc(); + return wxString(tank->getHostDesc(), wxConvUTF8); break; case 8: - return tank->getScore().getStatsRank(); + return wxString(tank->getScore().getStatsRank(), wxConvUTF8); break; } } - return ""; + return wxT(""); } class ServerLogListControl : public wxListCtrl @@ -198,9 +198,9 @@ { if ((item != -1) && (item < (long) ServerLog::instance()->getEntries().size())) { - return ServerLog::instance()->getEntries()[item].text.c_str(); + return wxString(ServerLog::instance()->getEntries()[item].text.c_str(), wxConvUTF8); } - return ""; + return wxT(""); } class ServerFrame: public wxFrame @@ -294,7 +294,7 @@ END_EVENT_TABLE() ServerFrame::ServerFrame(const char *name) : - wxFrame(NULL, -1, name, wxPoint(0,0), wxSize(630, 470)) + wxFrame(NULL, -1, wxString(name, wxConvUTF8), wxPoint(0,0), wxSize(630, 470)) { CentreOnScreen(); @@ -345,7 +345,7 @@ { playerList_->InsertColumn( i, - playerListItems[i].name, + wxString(playerListItems[i].name, wxConvUTF8), wxLIST_FORMAT_LEFT, playerListItems[i].size); } @@ -357,40 +357,40 @@ { logList_->InsertColumn( i, - mainListItems[i].name, + wxString(mainListItems[i].name, wxConvUTF8), wxLIST_FORMAT_LEFT, mainListItems[i].size); } // Add menu items wxMenu *menuFile = new wxMenu; - menuFile->Append(IDC_MENU_COMSMESSAGELOGGING, "Toggle Coms Messa&ge logging"); - menuFile->Append(IDC_MENU_STATELOGGING, "Toggle S&tate Logging"); + menuFile->Append(IDC_MENU_COMSMESSAGELOGGING, wxT("Toggle Coms Messa&ge logging")); + menuFile->Append(IDC_MENU_STATELOGGING, wxT("Toggle S&tate Logging")); menuFile->AppendSeparator(); - menuFile->Append(IDC_MENU_EXIT, "E&xit"); + menuFile->Append(IDC_MENU_EXIT, wxT("E&xit")); wxMenu *menuOptions = new wxMenu; - menuOptions->Append(IDC_MENU_SHOWOPTIONS, "&Display Options"); - menuOptions->Append(IDC_MENU_EDITOPTIONS, "&Edit Options"); - menuOptions->Append(IDC_MENU_LOADOPTIONS, "&Load Options"); - menuOptions->Append(IDC_MENU_SAVEOPTIONS, "&Save Options"); + menuOptions->Append(IDC_MENU_SHOWOPTIONS, wxT("&Display Options")); + menuOptions->Append(IDC_MENU_EDITOPTIONS, wxT("&Edit Options")); + menuOptions->Append(IDC_MENU_LOADOPTIONS, wxT("&Load Options")); + menuOptions->Append(IDC_MENU_SAVEOPTIONS, wxT("&Save Options")); menuOptions->AppendSeparator(); - menuOptions->Append(IDC_MENU_SHOWMODFILES, "Show &Mod Files"); + menuOptions->Append(IDC_MENU_SHOWMODFILES, wxT("Show &Mod Files")); wxMenu *menuAdmin = new wxMenu; - menuAdmin->Append(IDC_MENU_PLAYERKICK, "Kick selected players"); - menuAdmin->Append(IDC_MENU_PLAYERBAN, "Ban selected players"); - menuAdmin->Append(IDC_MENU_PLAYERPERMMUTE, "Perminantly mutes selected players"); - menuAdmin->Append(IDC_MENU_PLAYERUNPERMMUTE, "Un-perminantly mutes selected players"); - menuAdmin->Append(IDC_MENU_PLAYERSLAP25, "Slap selected players (25 pts)"); - menuAdmin->Append(IDC_MENU_PLAYERMUTE, "Mute selected players"); - menuAdmin->Append(IDC_MENU_PLAYERUNMUTE, "Unmute selected players"); + menuAdmin->Append(IDC_MENU_PLAYERKICK, wxT("Kick selected players")); + menuAdmin->Append(IDC_MENU_PLAYERBAN, wxT("Ban selected players")); + menuAdmin->Append(IDC_MENU_PLAYERPERMMUTE, wxT("Perminantly mutes selected players")); + menuAdmin->Append(IDC_MENU_PLAYERUNPERMMUTE, wxT("Un-perminantly mutes selected players")); + menuAdmin->Append(IDC_MENU_PLAYERSLAP25, wxT("Slap selected players (25 pts)")); + menuAdmin->Append(IDC_MENU_PLAYERMUTE, wxT("Mute selected players")); + menuAdmin->Append(IDC_MENU_PLAYERUNMUTE, wxT("Unmute selected players")); menuAdmin->AppendSeparator(); - menuAdmin->Append(IDC_MENU_SHOWBANNED, "Show &Banned Users"); + menuAdmin->Append(IDC_MENU_SHOWBANNED, wxT("Show &Banned Users")); wxMenu *menuChat = new wxMenu; - menuChat->Append(IDC_MENU_PLAYERTALK, "Talk to selected players"); - menuChat->Append(IDC_MENU_PLAYERTALKALL, "Talk to all players"); + menuChat->Append(IDC_MENU_PLAYERTALK, wxT("Talk to selected players")); + menuChat->Append(IDC_MENU_PLAYERTALKALL, wxT("Talk to all players")); wxMenu *menuAddPlayer = new wxMenu; int aicount = 0; @@ -403,20 +403,20 @@ TankAI *ai = (*aiitor); char buffer[256]; sprintf(buffer, "Add %s", ai->getName()); - menuAddPlayer->Append(IDC_MENU_PLAYERADD_1 + aicount, buffer); + menuAddPlayer->Append(IDC_MENU_PLAYERADD_1 + aicount, wxString(buffer, wxConvUTF8)); } wxMenu *menuPlayer = new wxMenu; - menuPlayer->Append(IDC_MENU_STARTNEWGAME, "Start a new game"); - menuPlayer->Append(IDC_MENU_PLAYERKILLALL, "Kill all players"); - menuPlayer->Append(IDC_MENU_PLAYERADD, "Add a new player", menuAddPlayer); + menuPlayer->Append(IDC_MENU_STARTNEWGAME, wxT("Start a new game")); + menuPlayer->Append(IDC_MENU_PLAYERKILLALL, wxT("Kill all players")); + menuPlayer->Append(IDC_MENU_PLAYERADD, wxT("Add a new player"), menuAddPlayer); wxMenuBar *menuBar = new wxMenuBar; - menuBar->Append(menuFile, "&File"); - menuBar->Append(menuOptions, "&Options"); - menuBar->Append(menuAdmin, "&Admin"); - menuBar->Append(menuChat, "&Chat"); - menuBar->Append(menuPlayer, "&Players"); + menuBar->Append(menuFile, wxT("&File")); + menuBar->Append(menuOptions, wxT("&Options")); + menuBar->Append(menuAdmin, wxT("&Admin")); + menuBar->Append(menuChat, wxT("&Chat")); + menuBar->Append(menuPlayer, wxT("&Players")); SetMenuBar( menuBar ); #ifdef __WXMSW__ @@ -537,21 +537,22 @@ ScorchedServer::instance()->getTankContainer().getPlayingTanks(); sprintf(buffer, "%i/%i Players", tanks.size(), ScorchedServer::instance()->getOptionsGame().getNoMaxPlayers()); - frame->statusBar_->SetStatusText(buffer, 0); + frame->statusBar_->SetStatusText(wxString(buffer, wxConvUTF8), 0); frame->statusBar_->SetStatusText( - (ServerTooFewPlayersStimulus::instance()->acceptStateChange(0, 0, 0.0f)?"Not Playing":"Playing"), 1); + (ServerTooFewPlayersStimulus::instance()->acceptStateChange(0, 0, 0.0f)? + wxT("Not Playing"):wxT("Playing")), 1); sprintf(buffer, "Round %i/%i, %i/%i Moves", ScorchedServer::instance()->getOptionsTransient().getCurrentRoundNo(), ScorchedServer::instance()->getOptionsGame().getNoRounds(), ScorchedServer::instance()->getOptionsTransient().getCurrentGameNo(), ScorchedServer::instance()->getOptionsGame().getNoMaxRoundTurns()); - frame->statusBar_->SetStatusText(buffer, 2); + frame->statusBar_->SetStatusText(wxString(buffer, wxConvUTF8), 2); sprintf(buffer, "BI:%i BO:%i P:%i C:%i", NetInterface::getBytesIn(), NetInterface::getBytesOut(), NetInterface::getPings(), NetInterface::getConnects()); - frame->statusBar_->SetStatusText(buffer, 3); + frame->statusBar_->SetStatusText(wxString(buffer, wxConvUTF8), 3); } void ServerFrame::onKillAll(wxCommandEvent &event) @@ -567,19 +568,19 @@ void ServerFrame::onPlayerTalkAll(wxCommandEvent &event) { wxTextEntryDialog entryDialog( - frame, "Message to players"); + frame, wxT("Message to players")); if (entryDialog.ShowModal() == wxID_OK) { Logger::log( "Says \"%s\"", entryDialog.GetValue().GetData()); - ServerCommon::sendString(0, entryDialog.GetValue()); + ServerCommon::sendString(0, entryDialog.GetValue().mb_str(wxConvUTF8)); } } void ServerFrame::onPlayerTalk(wxCommandEvent &event) { wxTextEntryDialog entryDialog( - frame, "Message to players"); + frame, wxT("Message to players")); if (entryDialog.ShowModal() == wxID_OK) { Logger::log( "Says \"%s\"", @@ -598,7 +599,8 @@ ScorchedServer::instance()->getTankContainer().getTankByPos((unsigned int) item); if (!tank->getTankAI()) { - ServerCommon::sendString(tank->getDestinationId(), entryDialog.GetValue()); + ServerCommon::sendString(tank->getDestinationId(), + entryDialog.GetValue().mb_str(wxConvUTF8)); } } } @@ -730,16 +732,17 @@ void ServerFrame::onLoadOptions(wxCommandEvent &event) { - wxString file = ::wxFileSelector("Please choose the options file to open", - getSettingsFile(""), // default path - "server.xml", // default filename - "", // default extension - "*.xml", + wxString file = ::wxFileSelector(wxT("Please choose the options file to open"), + wxString(getSettingsFile(""), wxConvUTF8), // default path + wxT("server.xml"), // default filename + wxT(""), // default extension + wxT("*.xml"), wxOPEN | wxFILE_MUST_EXIST); if (!file.empty()) { + std::string fileName = (const char *) file.mb_str(wxConvUTF8); if(ScorchedServer::instance()->getOptionsGame().getChangedOptions(). - readOptionsFromFile((char *) file.c_str())) + readOptionsFromFile((char *) fileName.c_str())) { dialogMessage("Server", "These changes will only take place at the start of the next round (map).\n" @@ -750,16 +753,17 @@ void ServerFrame::onSaveOptions(wxCommandEvent &event) { - wxString file = ::wxFileSelector("Please choose the options file to save", - getSettingsFile(""), // default path - "server.xml", // default filename - "", // default extension - "*.xml", + wxString file = ::wxFileSelector(wxT("Please choose the options file to save"), + wxString(getSettingsFile(""), wxConvUTF8), // default path + wxT("server.xml"), // default filename + wxT(""), // default extension + wxT("*.xml"), wxSAVE); if (!file.empty()) { + std::string fileName = (const char *) file.mb_str(wxConvUTF8); ScorchedServer::instance()->getOptionsGame().getChangedOptions(). - writeOptionsToFile((char *) file.c_str()); + readOptionsFromFile((char *) fileName.c_str()); } } diff -urN --exclude=CVS --exclude=Makefile --exclude=Makefile.in --exclude=autom4te.cache --exclude=aclocal.m4 --exclude=configure --exclude=config.status --exclude=borland --exclude=config.log --exclude=.deps scorched/src/scorched/ServerS.cpp scorched-cvs/src/scorched/ServerS.cpp --- scorched/src/scorched/ServerS.cpp 2005-06-09 02:16:53.000000000 +0200 +++ scorched-cvs/src/scorched/ServerS.cpp 2005-09-22 17:14:28.000000000 +0200 @@ -24,91 +24,91 @@ wxSizer *sizer) { wxStaticBox *servernameBox = - new wxStaticBox(parent, -1, "Server Settings"); + new wxStaticBox(parent, -1, wxT("Server Settings")); wxStaticBoxSizer *servernameSizer = new wxStaticBoxSizer(servernameBox, wxVERTICAL); wxFlexGridSizer *servernameSizer2 = new wxFlexGridSizer(4, 2, 5, 5); IDC_SERVER_NAME_CTRL = new wxTextCtrl(parent, IDC_SERVER_NAME, - "", + wxT(""), wxDefaultPosition, wxSize((int) 226.5, -1)); - servernameSizer2->Add(new wxStaticText(parent, -1, "Server Name :"), + servernameSizer2->Add(new wxStaticText(parent, -1, wxT("Server Name :")), 0, wxALIGN_CENTER_VERTICAL); servernameSizer2->Add(IDC_SERVER_NAME_CTRL); IDC_SERVER_PORT_CTRL = new wxTextCtrl(parent, -1, - "", + wxT(""), wxDefaultPosition, wxSize((int) 72, -1)); - servernameSizer2->Add(new wxStaticText(parent, -1, "Port Number :"), + servernameSizer2->Add(new wxStaticText(parent, -1, wxT("Port Number :")), 0, wxALIGN_CENTER_VERTICAL); servernameSizer2->Add(IDC_SERVER_PORT_CTRL); IDC_SERVERMANAGEMENT_PORT_CTRL = new wxTextCtrl(parent, -1, - "", + wxT(""), wxDefaultPosition, wxSize((int) 72, -1)); - servernameSizer2->Add(new wxStaticText(parent, -1, "Management Port Number :"), + servernameSizer2->Add(new wxStaticText(parent, -1, wxT("Management Port Number :")), 0, wxALIGN_CENTER_VERTICAL); servernameSizer2->Add(IDC_SERVERMANAGEMENT_PORT_CTRL); servernameSizer->Add(servernameSizer2); - IDC_PUBLISHIP_CTRL_TEXT = new wxStaticText(parent, -1, "Published IP :"); + IDC_PUBLISHIP_CTRL_TEXT = new wxStaticText(parent, -1, wxT("Published IP :")); servernameSizer2->Add(IDC_PUBLISHIP_CTRL_TEXT, 0, wxALIGN_CENTER_VERTICAL); wxSizer *hori = new wxBoxSizer(wxHORIZONTAL); IDC_PUBLISHIP_CTRL = new wxTextCtrl(parent, IDC_PUBLISHIP, - "", + wxT(""), wxDefaultPosition, wxSize((int) 150, -1)); hori->Add(IDC_PUBLISHIP_CTRL); IDOK_PUBLISHAUTO_CTRL = new wxButton(parent, IDC_PUBLISHAUTO, - "AutoDetect"); + wxT("AutoDetect")); hori->Add(IDOK_PUBLISHAUTO_CTRL); servernameSizer2->Add(hori); IDC_PUBLISH_CTRL = new wxCheckBox(parent, IDC_PUBLISH, - "Allow ALL other internet users to see and use this server"); + wxT("Allow ALL other internet users to see and use this server")); servernameSizer->Add(IDC_PUBLISH_CTRL, 0, wxTOP, 5); IDC_ALLOWSAME_CTRL = new wxCheckBox(parent, -1, - "Allow multiple clients from same machine to use this server"); + wxT("Allow multiple clients from same machine to use this server")); servernameSizer->Add(IDC_ALLOWSAME_CTRL, 0, wxTOP, 5); IDC_ALLOWSAMEID_CTRL = new wxCheckBox(parent, -1, - "Allow multiple clients with the same unique id to use this server"); + wxT("Allow multiple clients with the same unique id to use this server")); servernameSizer->Add(IDC_ALLOWSAMEID_CTRL, 0, wxTOP, 5); sizer->Add(servernameSizer, 0, wxALL, 5); wxStaticBox *modBox = - new wxStaticBox(parent, -1, "Mod Settings"); + new wxStaticBox(parent, -1, wxT("Mod Settings")); wxStaticBoxSizer *modSizer = new wxStaticBoxSizer(modBox, wxHORIZONTAL); modSizer->Add(new wxStaticText(parent, -1, - "Use Mod :"), 0, wxALL, 5); + wxT("Use Mod :")), 0, wxALL, 5); IDC_SERVER_MOD_CTRL = new wxComboBox(parent, -1, - "", + wxT(""), wxDefaultPosition, wxDefaultSize, 0, 0, wxCB_READONLY); modSizer->Add(IDC_SERVER_MOD_CTRL, 0, wxALL, 5); sizer->Add(modSizer, 0, wxGROW | wxALIGN_RIGHT | wxALL, 5); wxStaticBox *advBox = - new wxStaticBox(parent, -1, "Advanced Settings"); + new wxStaticBox(parent, -1, wxT("Advanced Settings")); wxStaticBoxSizer *advSizer = new wxStaticBoxSizer(advBox, wxVERTICAL); IDC_BUTTON_SETTINGS_CTRL = new wxButton(parent, IDC_BUTTON_SETTINGS, - "Edit Advanced Settings"); + wxT("Edit Advanced Settings")); advSizer->Add(IDC_BUTTON_SETTINGS_CTRL, 0, wxALL, 5); sizer->Add(advSizer, 0, wxGROW | wxALL, 5); // Ok and cancel boxes wxBoxSizer *buttonSizer = new wxBoxSizer(wxHORIZONTAL); - IDOK_CTRL = new wxButton(parent, wxID_OK, "Start Server"); - IDCANCEL_CTRL = new wxButton(parent, wxID_CANCEL, "Cancel"); + IDOK_CTRL = new wxButton(parent, wxID_OK, wxT("Start Server")); + IDCANCEL_CTRL = new wxButton(parent, wxID_CANCEL, wxT("Cancel")); buttonSizer->Add(IDCANCEL_CTRL, 0, wxALL, 10); buttonSizer->Add(IDOK_CTRL, 0, wxALL, 10); sizer->Add(buttonSizer, 0, wxALIGN_RIGHT); diff -urN --exclude=CVS --exclude=Makefile --exclude=Makefile.in --exclude=autom4te.cache --exclude=aclocal.m4 --exclude=configure --exclude=config.status --exclude=borland --exclude=config.log --exclude=.deps scorched/src/scorched/ServerSDialog.cpp scorched-cvs/src/scorched/ServerSDialog.cpp --- scorched/src/scorched/ServerSDialog.cpp 2005-06-09 02:16:53.000000000 +0200 +++ scorched-cvs/src/scorched/ServerSDialog.cpp 2005-09-22 17:14:28.000000000 +0200 @@ -54,7 +54,7 @@ END_EVENT_TABLE() ServerSFrame::ServerSFrame(OptionsGame &options) : - wxDialog(getMainDialog(), -1, scorched3dAppName, + wxDialog(getMainDialog(), -1, wxString(scorched3dAppName, wxConvUTF8), wxDefaultPosition, wxDefaultSize), options_(options) { @@ -80,7 +80,7 @@ void ServerSFrame::onPublishAutoButton(wxCommandEvent &event) { - IDC_PUBLISHIP_CTRL->SetValue("AutoDetect"); + IDC_PUBLISHIP_CTRL->SetValue(wxT("AutoDetect")); } void ServerSFrame::onSettingsButton(wxCommandEvent &event) @@ -92,20 +92,31 @@ bool ServerSFrame::TransferDataToWindow() { - IDC_SERVER_PORT_CTRL->SetValue(formatString("%i", options_.getPortNo())); - IDC_SERVER_PORT_CTRL->SetToolTip(options_.getPortNoToolTip()); - IDC_SERVERMANAGEMENT_PORT_CTRL->SetValue(formatString("%i", options_.getManagementPortNo())); - IDC_SERVERMANAGEMENT_PORT_CTRL->SetToolTip(options_.getManagementPortNoToolTip()); - IDC_SERVER_NAME_CTRL->SetValue(options_.getServerName()); - IDC_SERVER_NAME_CTRL->SetToolTip(options_.getServerNameToolTip()); + IDC_SERVER_PORT_CTRL->SetValue( + wxString(formatString("%i", options_.getPortNo()), wxConvUTF8)); + IDC_SERVER_PORT_CTRL->SetToolTip( + wxString(options_.getPortNoToolTip(), wxConvUTF8)); + IDC_SERVERMANAGEMENT_PORT_CTRL->SetValue( + wxString(formatString("%i", options_.getManagementPortNo()), wxConvUTF8)); + IDC_SERVERMANAGEMENT_PORT_CTRL->SetToolTip( + wxString(options_.getManagementPortNoToolTip(), wxConvUTF8)); + IDC_SERVER_NAME_CTRL->SetValue( + wxString(options_.getServerName(), wxConvUTF8)); + IDC_SERVER_NAME_CTRL->SetToolTip( + wxString(options_.getServerNameToolTip(), wxConvUTF8)); IDC_PUBLISH_CTRL->SetValue(options_.getPublishServer()); - IDC_PUBLISH_CTRL->SetToolTip(options_.getPublishServerToolTip()); - IDC_PUBLISHIP_CTRL->SetValue(options_.getPublishAddress()); - IDC_PUBLISHIP_CTRL->SetToolTip(options_.getPublishAddressToolTip()); + IDC_PUBLISH_CTRL->SetToolTip( + wxString(options_.getPublishServerToolTip(), wxConvUTF8)); + IDC_PUBLISHIP_CTRL->SetValue( + wxString(options_.getPublishAddress(), wxConvUTF8)); + IDC_PUBLISHIP_CTRL->SetToolTip( + wxString(options_.getPublishAddressToolTip(), wxConvUTF8)); IDC_ALLOWSAME_CTRL->SetValue(options_.getAllowSameIP()); - IDC_ALLOWSAME_CTRL->SetToolTip(options_.getAllowSameIPToolTip()); + IDC_ALLOWSAME_CTRL->SetToolTip( + wxString(options_.getAllowSameIPToolTip(), wxConvUTF8)); IDC_ALLOWSAMEID_CTRL->SetValue(options_.getAllowSameUniqueId()); - IDC_ALLOWSAMEID_CTRL->SetToolTip(options_.getAllowSameUniqueIdToolTip()); + IDC_ALLOWSAMEID_CTRL->SetToolTip( + wxString(options_.getAllowSameUniqueIdToolTip(), wxConvUTF8)); ModDirs modDirs; if (!modDirs.loadModDirs()) dialogExit("ModFiles", "Failed to load mod files"); @@ -114,37 +125,37 @@ itor != modDirs.getDirs().end(); itor++) { - IDC_SERVER_MOD_CTRL->Append((*itor).c_str()); + IDC_SERVER_MOD_CTRL->Append(wxString((*itor).c_str(), wxConvUTF8)); } - if (IDC_SERVER_MOD_CTRL->FindString(options_.getMod()) != -1) - IDC_SERVER_MOD_CTRL->SetValue(options_.getMod()); + if (IDC_SERVER_MOD_CTRL->FindString(wxString(options_.getMod(), wxConvUTF8)) != -1) + IDC_SERVER_MOD_CTRL->SetValue(wxString(options_.getMod(), wxConvUTF8)); else - IDC_SERVER_MOD_CTRL->SetValue("none"); + IDC_SERVER_MOD_CTRL->SetValue(wxT("none")); IDC_SERVER_MOD_CTRL->SetToolTip( - wxString("The Scorched3D mod to use for this game.")); + wxString("The Scorched3D mod to use for this game.", wxConvUTF8)); return true; } bool ServerSFrame::TransferDataFromWindow() { - options_.setPortNo(atoi(IDC_SERVER_PORT_CTRL->GetValue())); - options_.setManagementPortNo(atoi(IDC_SERVERMANAGEMENT_PORT_CTRL->GetValue())); - options_.setServerName(IDC_SERVER_NAME_CTRL->GetValue()); + options_.setPortNo(atoi(IDC_SERVER_PORT_CTRL->GetValue().mb_str(wxConvUTF8))); + options_.setManagementPortNo(atoi(IDC_SERVERMANAGEMENT_PORT_CTRL->GetValue().mb_str(wxConvUTF8))); + options_.setServerName(IDC_SERVER_NAME_CTRL->GetValue().mb_str(wxConvUTF8)); options_.setPublishServer(IDC_PUBLISH_CTRL->GetValue()); - options_.setPublishAddress(IDC_PUBLISHIP_CTRL->GetValue()); + options_.setPublishAddress(IDC_PUBLISHIP_CTRL->GetValue().mb_str(wxConvUTF8)); options_.setAllowSameIP(IDC_ALLOWSAME_CTRL->GetValue()); options_.setAllowSameUniqueId(IDC_ALLOWSAMEID_CTRL->GetValue()); - options_.setMod(IDC_SERVER_MOD_CTRL->GetValue()); + options_.setMod(IDC_SERVER_MOD_CTRL->GetValue().mb_str(wxConvUTF8)); return true; } bool showServerSDialog() { OptionsGame tmpOptions; - wxString serverFileSrc = getDataFile("data/server.xml"); - wxString serverFileDest = getSettingsFile("server.xml"); - if (::wxFileExists(serverFileDest)) + std::string serverFileSrc = getDataFile("data/server.xml"); + std::string serverFileDest = getSettingsFile("server.xml"); + if (DefinesUtil::fileExists(serverFileDest.c_str())) { tmpOptions.readOptionsFromFile((char *) serverFileDest.c_str()); } diff -urN --exclude=CVS --exclude=Makefile --exclude=Makefile.in --exclude=autom4te.cache --exclude=aclocal.m4 --exclude=configure --exclude=config.status --exclude=borland --exclude=config.log --exclude=.deps scorched/src/scorched/SettingsDialog.cpp scorched-cvs/src/scorched/SettingsDialog.cpp --- scorched/src/scorched/SettingsDialog.cpp 2005-06-01 19:23:08.000000000 +0200 +++ scorched-cvs/src/scorched/SettingsDialog.cpp 2005-09-22 17:14:28.000000000 +0200 @@ -95,13 +95,13 @@ END_EVENT_TABLE() SettingsFrame::SettingsFrame(bool server, OptionsGame &context) : - wxDialog(getMainDialog(), -1, scorched3dAppName, + wxDialog(getMainDialog(), -1, wxString(scorched3dAppName,wxConvUTF8), wxDefaultPosition, wxDefaultSize), context_(context) { #ifdef _WIN32 // Set the frame's icon - wxIcon icon(getDataFile("data/windows/tank2.ico"), wxBITMAP_TYPE_ICO); + wxIcon icon(wxString(getDataFile("data/windows/tank2.ico"), wxConvUTF8), wxBITMAP_TYPE_ICO); SetIcon(icon); #endif @@ -113,7 +113,7 @@ wxNotebookSizer *nbs = new wxNotebookSizer(book_); mainPanel_ = new wxPanel(book_, -1); - book_->AddPage(mainPanel_, "Main"); + book_->AddPage(mainPanel_, wxT("Main")); wxSizer *mainPanelSizer = new wxBoxSizer(wxVERTICAL); SettingsMain::createControls(mainPanel_, mainPanelSizer); mainPanel_->SetAutoLayout(TRUE); @@ -122,14 +122,14 @@ ecoPanel_ = new wxPanel(book_, -1); wxSizer *ecoPanelSizer = new wxBoxSizer(wxVERTICAL); SettingsEco::createControls(ecoPanel_, ecoPanelSizer); - book_->AddPage(ecoPanel_, "Eco"); + book_->AddPage(ecoPanel_, wxT("Eco")); ecoPanel_->SetAutoLayout(TRUE); ecoPanel_->SetSizer(ecoPanelSizer); envPanel_ = new wxPanel(book_, -1); wxSizer *envPanelSizer = new wxBoxSizer(wxVERTICAL); SettingsEnv::createControls(envPanel_, envPanelSizer); - book_->AddPage(envPanel_, "Env"); + book_->AddPage(envPanel_, wxT("Env")); envPanel_->SetAutoLayout(TRUE); envPanel_->SetSizer(envPanelSizer); @@ -142,7 +142,7 @@ playersPanel_ = new wxPanel(book_, -1); wxSizer *playersPanelSizer = new wxBoxSizer(wxVERTICAL); SettingsPlayers::createControls(playersPanel_, playersPanelSizer); - book_->AddPage(playersPanel_, "Players"); + book_->AddPage(playersPanel_, wxT("Players")); playersPanel_->SetAutoLayout(TRUE); playersPanel_->SetSizer(playersPanelSizer); } @@ -151,14 +151,14 @@ motdPanel_ = new wxPanel(book_, -1); wxSizer *motdPanelSizer = new wxBoxSizer(wxVERTICAL); SettingsMOTD::createControls(motdPanel_, motdPanelSizer); - book_->AddPage(motdPanel_, "MOTD"); + book_->AddPage(motdPanel_, wxT("MOTD")); motdPanel_->SetAutoLayout(TRUE); motdPanel_->SetSizer(motdPanelSizer); landPanel_ = new wxPanel(book_, -1); wxSizer *landPanelSizer = new wxBoxSizer(wxVERTICAL); SettingsLand::createControls(landPanel_, landPanelSizer); - book_->AddPage(landPanel_, "Land"); + book_->AddPage(landPanel_, wxT("Land")); landPanel_->SetAutoLayout(TRUE); #if wxCHECK_VERSION(2,6,0) landPanel_->SetSizer(landPanelSizer); @@ -173,8 +173,8 @@ // Ok and cancel boxes wxBoxSizer *buttonSizer = new wxBoxSizer(wxHORIZONTAL); - wxButton *okButton = new wxButton(this, wxID_OK, "Ok"); - wxButton *cancelButton = new wxButton(this, wxID_CANCEL, "Cancel"); + wxButton *okButton = new wxButton(this, wxID_OK, wxT("Ok")); + wxButton *cancelButton = new wxButton(this, wxID_CANCEL, wxT("Cancel")); buttonSizer->Add(cancelButton, 0, wxALL, 10); buttonSizer->Add(okButton, 0, wxALL, 10); topsizer->Add(buttonSizer, 0, wxALIGN_RIGHT); @@ -219,7 +219,7 @@ void SettingsFrame::setupPlayers() { int maxPlayers = 10; - sscanf(SettingsPlayers::IDC_SERVER_MAX_PLAYERS_CTRL->GetValue(), "%i", &maxPlayers); + sscanf(SettingsPlayers::IDC_SERVER_MAX_PLAYERS_CTRL->GetValue().mb_str(wxConvUTF8), "%i", &maxPlayers); context_.setNoMaxPlayers(maxPlayers); for (int i=0; i<24; i++) @@ -235,9 +235,9 @@ if (playersPanel_) { SettingsPlayers::IDC_EDIT3_CTRL-> - SetValue(context_.getBotNamePrefix()); + SetValue(wxString(context_.getBotNamePrefix(), wxConvUTF8)); SettingsPlayers::IDC_EDIT3_CTRL->SetToolTip( - wxString("The text prefixed onto any player that is a bot.")); + wxString("The text prefixed onto any player that is a bot.", wxConvUTF8)); // Min max players are rounds combos char buffer[25]; @@ -249,32 +249,32 @@ if (i > 1) { - SettingsPlayers::IDC_SERVER_MIN_PLAYERS_CTRL->Append(string); - SettingsPlayers::IDC_SERVER_REMOVEBOT_PLAYERS_CTRL->Append(string); + SettingsPlayers::IDC_SERVER_MIN_PLAYERS_CTRL->Append(wxString(string, wxConvUTF8)); + SettingsPlayers::IDC_SERVER_REMOVEBOT_PLAYERS_CTRL->Append(wxString(string, wxConvUTF8)); } - SettingsPlayers::IDC_SERVER_MAX_PLAYERS_CTRL->Append(string); + SettingsPlayers::IDC_SERVER_MAX_PLAYERS_CTRL->Append(wxString(string, wxConvUTF8)); } - SettingsPlayers::IDC_SERVER_REMOVEBOT_PLAYERS_CTRL->Append("0"); + SettingsPlayers::IDC_SERVER_REMOVEBOT_PLAYERS_CTRL->Append(wxT("0")); sprintf(buffer, "%i", context_.getNoMinPlayers()); - SettingsPlayers::IDC_SERVER_MIN_PLAYERS_CTRL->SetValue(buffer); + SettingsPlayers::IDC_SERVER_MIN_PLAYERS_CTRL->SetValue(wxString(buffer, wxConvUTF8)); SettingsPlayers::IDC_SERVER_MIN_PLAYERS_CTRL->SetToolTip( - wxString("The number of players that must be on the server before a game starts.")); + wxString("The number of players that must be on the server before a game starts.", wxConvUTF8)); sprintf(buffer, "%i", context_.getNoMaxPlayers()); - SettingsPlayers::IDC_SERVER_MAX_PLAYERS_CTRL->SetValue(buffer); + SettingsPlayers::IDC_SERVER_MAX_PLAYERS_CTRL->SetValue(wxString(buffer, wxConvUTF8)); SettingsPlayers::IDC_SERVER_MAX_PLAYERS_CTRL->SetToolTip( - wxString("The maximum number of players that can be on the server.")); + wxString("The maximum number of players that can be on the server.", wxConvUTF8)); sprintf(buffer, "%i", context_.getRemoveBotsAtPlayers()); - SettingsPlayers::IDC_SERVER_REMOVEBOT_PLAYERS_CTRL->SetValue(buffer); + SettingsPlayers::IDC_SERVER_REMOVEBOT_PLAYERS_CTRL->SetValue(wxString(buffer, wxConvUTF8)); SettingsPlayers::IDC_SERVER_REMOVEBOT_PLAYERS_CTRL->SetToolTip( - wxString("The number of players to allow before remvoing bots.")); + wxString("The number of players to allow before remvoing bots.", wxConvUTF8)); SettingsPlayers::IDC_SERVER_RESIDUAL_CTRL->SetValue( context_.getResidualPlayers()); SettingsPlayers::IDC_SERVER_RESIDUAL_CTRL->SetToolTip( - wxString("Players re-connect with the same money and weapons.")); + wxString("Players re-connect with the same money and weapons.", wxConvUTF8)); // Reload the AIs in case a new mod has been loaded SettingsPlayers::tankAIStore.clearAIs(); @@ -292,11 +292,12 @@ itor++) { TankAI *ai = *itor; - SettingsPlayers::IDC_COMBO_PTYPE_CTRL[i]->Append(ai->getName()); + SettingsPlayers::IDC_COMBO_PTYPE_CTRL[i]->Append( + wxString(ai->getName(), wxConvUTF8)); } - SettingsPlayers::IDC_COMBO_PTYPE_CTRL[i]->Append("Human"); + SettingsPlayers::IDC_COMBO_PTYPE_CTRL[i]->Append(wxT("Human")); SettingsPlayers::IDC_COMBO_PTYPE_CTRL[i]->SetValue( - context_.getPlayerType(i)); + wxString(context_.getPlayerType(i), wxConvUTF8)); } setupPlayers(); } @@ -317,7 +318,7 @@ SettingsLand::IDC_CYCLEMAPS_CTRL->SetValue( context_.getCycleMaps()); SettingsLand::IDC_CYCLEMAPS_CTRL->SetToolTip( - wxString(context_.getCycleMapsToolTip())); + wxString(context_.getCycleMapsToolTip(), wxConvUTF8)); } // Eco @@ -328,143 +329,143 @@ for (i=50; i>=1; i-=1) { sprintf(buffer, "%i", i); - SettingsEco::IDC_BUYONROUND_CTRL->Append(buffer); + SettingsEco::IDC_BUYONROUND_CTRL->Append(wxString(buffer, wxConvUTF8)); } sprintf(buffer, "%i", context_.getBuyOnRound()); - SettingsEco::IDC_BUYONROUND_CTRL->SetValue(buffer); + SettingsEco::IDC_BUYONROUND_CTRL->SetValue(wxString(buffer, wxConvUTF8)); SettingsEco::IDC_BUYONROUND_CTRL->SetToolTip( - wxString("Players will be allowed to buy more weapons on this round.")); + wxString("Players will be allowed to buy more weapons on this round.", wxConvUTF8)); // Economy - SettingsEco::IDC_ECONOMY_CTRL->Append("EconomyFreeMarket"); - SettingsEco::IDC_ECONOMY_CTRL->Append("EconomyNone"); - SettingsEco::IDC_ECONOMY_CTRL->SetValue(context_.getEconomy()); + SettingsEco::IDC_ECONOMY_CTRL->Append(wxT("EconomyFreeMarket")); + SettingsEco::IDC_ECONOMY_CTRL->Append(wxT("EconomyNone")); + SettingsEco::IDC_ECONOMY_CTRL->SetValue(wxString(context_.getEconomy(), wxConvUTF8)); SettingsEco::IDC_ECONOMY_CTRL->SetToolTip( - wxString("Economic factors for weapon prices")); + wxString("Economic factors for weapon prices", wxConvUTF8)); // Money per hit for (i=2000; i>=0; i-=50) { sprintf(buffer, "%i", i); - SettingsEco::IDC_MONEYPERHIT_CTRL->Append(buffer); - SettingsEco::IDC_MONEYPERKILL_CTRL->Append(buffer); + SettingsEco::IDC_MONEYPERHIT_CTRL->Append(wxString(buffer, wxConvUTF8)); + SettingsEco::IDC_MONEYPERKILL_CTRL->Append(wxString(buffer, wxConvUTF8)); } sprintf(buffer, "%i", context_.getMoneyWonPerHitPoint()); - SettingsEco::IDC_MONEYPERHIT_CTRL->SetValue(buffer); + SettingsEco::IDC_MONEYPERHIT_CTRL->SetValue(wxString(buffer, wxConvUTF8)); SettingsEco::IDC_MONEYPERHIT_CTRL->SetToolTip( wxString("The money awarded for HITTING another tank.\n" "This is multiplied by the weapons arms level\n" - "and health points removed (if switched on).")); + "and health points removed (if switched on).", wxConvUTF8)); sprintf(buffer, "%i", context_.getMoneyWonPerKillPoint()); - SettingsEco::IDC_MONEYPERKILL_CTRL->SetValue(buffer); + SettingsEco::IDC_MONEYPERKILL_CTRL->SetValue(wxString(buffer, wxConvUTF8)); SettingsEco::IDC_MONEYPERKILL_CTRL->SetToolTip( wxString("The money awarded for KILLING another tank.\n" "This is multiplied by the weapons arms level\n" - "and health points removed (if switched on).")); + "and health points removed (if switched on).", wxConvUTF8)); SettingsEco::IDC_MONEYPERHEALTH_CTRL->SetValue( context_.getMoneyPerHealthPoint()); SettingsEco::IDC_MONEYPERHEALTH_CTRL->SetToolTip( - wxString("Switchs on money being awarded by health points removed")); + wxString("Switchs on money being awarded by health points removed", wxConvUTF8)); // Start Money for (i=250000; i>=0; i-=5000) { sprintf(buffer, "%i", i); - SettingsEco::IDC_STARTMONEY_CTRL->Append(buffer); - SettingsEco::IDC_MONEYPERROUND_CTRL->Append(buffer); - SettingsEco::IDC_MONEYROUND_CTRL->Append(buffer); + SettingsEco::IDC_STARTMONEY_CTRL->Append(wxString(buffer, wxConvUTF8)); + SettingsEco::IDC_MONEYPERROUND_CTRL->Append(wxString(buffer, wxConvUTF8)); + SettingsEco::IDC_MONEYROUND_CTRL->Append(wxString(buffer, wxConvUTF8)); } sprintf(buffer, "%i", context_.getStartMoney()); - SettingsEco::IDC_STARTMONEY_CTRL->SetValue(buffer); + SettingsEco::IDC_STARTMONEY_CTRL->SetValue(wxString(buffer, wxConvUTF8)); SettingsEco::IDC_STARTMONEY_CTRL->SetToolTip( - wxString("The money each tank will start the game with.")); + wxString("The money each tank will start the game with.", wxConvUTF8)); sprintf(buffer, "%i", context_.getMoneyWonForRound()); - SettingsEco::IDC_MONEYPERROUND_CTRL->SetValue(buffer); + SettingsEco::IDC_MONEYPERROUND_CTRL->SetValue(wxString(buffer, wxConvUTF8)); SettingsEco::IDC_MONEYPERROUND_CTRL->SetToolTip( - wxString("The money awarded to the last tank surviving a round.")); + wxString("The money awarded to the last tank surviving a round.", wxConvUTF8)); sprintf(buffer, "%i", context_.getMoneyPerRound()); - SettingsEco::IDC_MONEYROUND_CTRL->SetValue(buffer); + SettingsEco::IDC_MONEYROUND_CTRL->SetValue(wxString(buffer, wxConvUTF8)); SettingsEco::IDC_MONEYROUND_CTRL->SetToolTip( - wxString("The money given to every tank at the end of each round.")); + wxString("The money given to every tank at the end of each round.", wxConvUTF8)); // Interest for (i=100; i>=0; i-=5) { sprintf(buffer, "%i", i); - SettingsEco::IDC_INTEREST_CTRL->Append(buffer); + SettingsEco::IDC_INTEREST_CTRL->Append(wxString(buffer, wxConvUTF8)); } sprintf(buffer, "%i", context_.getInterest()); - SettingsEco::IDC_INTEREST_CTRL->SetValue(buffer); + SettingsEco::IDC_INTEREST_CTRL->SetValue(wxString(buffer, wxConvUTF8)); SettingsEco::IDC_INTEREST_CTRL->SetToolTip( - wxString("The amount of monetary interest gained at the end of each round.")); + wxString("The amount of monetary interest gained at the end of each round.", wxConvUTF8)); // Interest - SettingsEco::IDC_SCOREMODE_CTRL->Append("Most Wins"); - SettingsEco::IDC_SCOREMODE_CTRL->Append("Most Kills"); - SettingsEco::IDC_SCOREMODE_CTRL->Append("Most Money"); + SettingsEco::IDC_SCOREMODE_CTRL->Append(wxT("Most Wins")); + SettingsEco::IDC_SCOREMODE_CTRL->Append(wxT("Most Kills")); + SettingsEco::IDC_SCOREMODE_CTRL->Append(wxT("Most Money")); SettingsEco::IDC_SCOREMODE_CTRL->SetSelection( (int) context_.getScoreType()); SettingsEco::IDC_SCOREMODE_CTRL->SetToolTip( - wxString("The ranking that determines the winner.")); + wxString("The ranking that determines the winner.", wxConvUTF8)); } // Env { // Wind force - SettingsEnv::IDC_COMBO_FORCE_CTRL->Append("Random", + SettingsEnv::IDC_COMBO_FORCE_CTRL->Append(wxT("Random"), (void *) (OptionsGame::WindRandom)); for (int i=0; i<=5; i++) { char buffer[25]; sprintf(buffer, "Force %i%s", i, ((i==0)?" (No Wind)":"")); SettingsEnv::IDC_COMBO_FORCE_CTRL->Append( - buffer, (void *) (i+1)); + wxString(buffer, wxConvUTF8), (void *) (i+1)); } - SettingsEnv::IDC_COMBO_FORCE_CTRL->Append("Breezy (Force 0->2)", + SettingsEnv::IDC_COMBO_FORCE_CTRL->Append(wxT("Breezy (Force 0->2)"), (void *) (OptionsGame::WindBreezy)); - SettingsEnv::IDC_COMBO_FORCE_CTRL->Append("Gale (Force 3->5)", + SettingsEnv::IDC_COMBO_FORCE_CTRL->Append(wxT("Gale (Force 3->5)"), (void *) (OptionsGame::WindGale)); SettingsEnv::IDC_COMBO_FORCE_CTRL->SetSelection( context_.getWindForce()); SettingsEnv::IDC_COMBO_FORCE_CTRL->SetToolTip( - wxString("The force of the wind.")); + wxString("The force of the wind.", wxConvUTF8)); // Wind changes - SettingsEnv::IDC_COMBO_WINDCHANGES_CTRL->Append("On Round", + SettingsEnv::IDC_COMBO_WINDCHANGES_CTRL->Append(wxT("On Round"), (void *) OptionsGame::WindOnRound); - SettingsEnv::IDC_COMBO_WINDCHANGES_CTRL->Append("On Move", + SettingsEnv::IDC_COMBO_WINDCHANGES_CTRL->Append(wxT("On Move"), (void *) OptionsGame::WindOnMove); SettingsEnv::IDC_COMBO_WINDCHANGES_CTRL->SetSelection( context_.getWindType()); SettingsEnv::IDC_COMBO_WINDCHANGES_CTRL->SetToolTip( - wxString("Specifies when the wind is allowed to change direction.")); + wxString("Specifies when the wind is allowed to change direction.", wxConvUTF8)); // Wall type - SettingsEnv::IDC_COMBO_WALLTYPE_CTRL->Append("Random", + SettingsEnv::IDC_COMBO_WALLTYPE_CTRL->Append(wxT("Random"), (void *) OptionsGame::WallRandom); - SettingsEnv::IDC_COMBO_WALLTYPE_CTRL->Append("Concrete", + SettingsEnv::IDC_COMBO_WALLTYPE_CTRL->Append(wxT("Concrete"), (void *) OptionsGame::WallConcrete); - SettingsEnv::IDC_COMBO_WALLTYPE_CTRL->Append("Bouncy", + SettingsEnv::IDC_COMBO_WALLTYPE_CTRL->Append(wxT("Bouncy"), (void *) OptionsGame::WallBouncy); - SettingsEnv::IDC_COMBO_WALLTYPE_CTRL->Append("Wrap", + SettingsEnv::IDC_COMBO_WALLTYPE_CTRL->Append(wxT("Wrap"), (void *) OptionsGame::WallWrapAround); SettingsEnv::IDC_COMBO_WALLTYPE_CTRL->SetSelection( context_.getWallType()); SettingsEnv::IDC_COMBO_WALLTYPE_CTRL->SetToolTip( - wxString("Specifies the behaviour of the walls that surround the island.")); + wxString("Specifies the behaviour of the walls that surround the island.", wxConvUTF8)); // Weapon Scale - SettingsEnv::IDC_COMBO_WEAPONSCALE_CTRL->Append("Small", + SettingsEnv::IDC_COMBO_WEAPONSCALE_CTRL->Append(wxT("Small"), (void *) OptionsGame::ScaleSmall); - SettingsEnv::IDC_COMBO_WEAPONSCALE_CTRL->Append("Medium", + SettingsEnv::IDC_COMBO_WEAPONSCALE_CTRL->Append(wxT("Medium"), (void *) OptionsGame::ScaleMedium); - SettingsEnv::IDC_COMBO_WEAPONSCALE_CTRL->Append("Large", + SettingsEnv::IDC_COMBO_WEAPONSCALE_CTRL->Append(wxT("Large"), (void *) OptionsGame::ScaleLarge); SettingsEnv::IDC_COMBO_WEAPONSCALE_CTRL->SetSelection( context_.getWeapScale()); SettingsEnv::IDC_COMBO_WEAPONSCALE_CTRL->SetToolTip( - wxString("Specifies the size of the blast radius for explosive weapons.")); + wxString("Specifies the size of the blast radius for explosive weapons.", wxConvUTF8)); // Weapon Scale for (int i=0; i<=20; i++) @@ -473,185 +474,185 @@ sprintf(buffer, "%i", i, i); if (i<=10) { - SettingsEnv::IDC_COMBO_STARTARMSLEVEL_CTRL->Append(buffer, (void *) i); - SettingsEnv::IDC_COMBO_ENDARMSLEVEL_CTRL->Append(buffer, (void *) i); + SettingsEnv::IDC_COMBO_STARTARMSLEVEL_CTRL->Append(wxString(buffer, wxConvUTF8), (void *) i); + SettingsEnv::IDC_COMBO_ENDARMSLEVEL_CTRL->Append(wxString(buffer, wxConvUTF8), (void *) i); } - SettingsEnv::IDC_COMBO_CLIMBINGDISTANCE_CTRL->Append(buffer, (void *) i); - SettingsEnv::IDC_COMBO_FALLINGDISTANCE_CTRL->Append(buffer, (void *) i); + SettingsEnv::IDC_COMBO_CLIMBINGDISTANCE_CTRL->Append(wxString(buffer, wxConvUTF8), (void *) i); + SettingsEnv::IDC_COMBO_FALLINGDISTANCE_CTRL->Append(wxString(buffer, wxConvUTF8), (void *) i); } SettingsEnv::IDC_COMBO_STARTARMSLEVEL_CTRL->SetSelection( context_.getStartArmsLevel()); SettingsEnv::IDC_COMBO_STARTARMSLEVEL_CTRL->SetToolTip( - wxString("Specifies the most powerful weapon that will be available to buy from round 0.")); + wxString("Specifies the most powerful weapon that will be available to buy from round 0.", wxConvUTF8)); SettingsEnv::IDC_COMBO_ENDARMSLEVEL_CTRL->SetSelection( context_.getEndArmsLevel()); SettingsEnv::IDC_COMBO_ENDARMSLEVEL_CTRL->SetToolTip( - wxString("Specifies the most powerful weapon that will be available to buy in the final round.")); + wxString("Specifies the most powerful weapon that will be available to buy in the final round.", wxConvUTF8)); SettingsEnv::IDC_COMBO_FALLINGDISTANCE_CTRL->SetSelection( context_.getMinFallingDistance()); SettingsEnv::IDC_COMBO_FALLINGDISTANCE_CTRL->SetToolTip( - wxString("Specifies the largest fall without taking damage.")); + wxString("Specifies the largest fall without taking damage.", wxConvUTF8)); SettingsEnv::IDC_COMBO_CLIMBINGDISTANCE_CTRL->SetSelection( context_.getMaxClimbingDistance()); SettingsEnv::IDC_COMBO_CLIMBINGDISTANCE_CTRL->SetToolTip( - wxString("Specifies the largest distance the tank can climb in one step.")); + wxString("Specifies the largest distance the tank can climb in one step.", wxConvUTF8)); SettingsEnv::IDC_GIVEALLWEAPONS_CTRL->SetValue( context_.getGiveAllWeapons()); SettingsEnv::IDC_GIVEALLWEAPONS_CTRL->SetToolTip( - wxString("Gives everyone an infinite number of all the weapons.")); + wxString("Gives everyone an infinite number of all the weapons.", wxConvUTF8)); // Resign Mode - SettingsEnv::IDC_RESIGNENDROUND_CTRL->Append("Round Start", + SettingsEnv::IDC_RESIGNENDROUND_CTRL->Append(wxT("Round Start"), (void *) OptionsGame::ResignStart); - SettingsEnv::IDC_RESIGNENDROUND_CTRL->Append("Round End", + SettingsEnv::IDC_RESIGNENDROUND_CTRL->Append(wxT("Round End"), (void *) OptionsGame::ResignEnd); - SettingsEnv::IDC_RESIGNENDROUND_CTRL->Append("Round Start or End (Due to Health)", + SettingsEnv::IDC_RESIGNENDROUND_CTRL->Append(wxT("Round Start or End (Due to Health)"), (void *) OptionsGame::ResignDueToHealth); SettingsEnv::IDC_RESIGNENDROUND_CTRL->SetSelection( context_.getResignMode()); SettingsEnv::IDC_RESIGNENDROUND_CTRL->SetToolTip( - wxString("During which part of the round players resign.")); + wxString("During which part of the round players resign.", wxConvUTF8)); // Movement restriction Mode - SettingsEnv::IDC_MOVEMENTRESTRICTION_CTRL->Append("None", + SettingsEnv::IDC_MOVEMENTRESTRICTION_CTRL->Append(wxT("None"), (void *) OptionsGame::MovementRestrictionNone); - SettingsEnv::IDC_MOVEMENTRESTRICTION_CTRL->Append("Land Only", + SettingsEnv::IDC_MOVEMENTRESTRICTION_CTRL->Append(wxT("Land Only"), (void *) OptionsGame::MovementRestrictionLand); - SettingsEnv::IDC_MOVEMENTRESTRICTION_CTRL->Append("Land Or Above Only", + SettingsEnv::IDC_MOVEMENTRESTRICTION_CTRL->Append(wxT("Land Or Above Only"), (void *) OptionsGame::MovementRestrictionLandOrAbove); SettingsEnv::IDC_MOVEMENTRESTRICTION_CTRL->SetSelection( context_.getMovementRestriction()); SettingsEnv::IDC_MOVEMENTRESTRICTION_CTRL->SetToolTip( - wxString("Any restrictions to tank movement")); + wxString("Any restrictions to tank movement", wxConvUTF8)); } // MOTD { SettingsMOTD::IDC_MOTD_CTRL->SetValue( - context_.getMOTD()); + wxString(context_.getMOTD(), wxConvUTF8)); SettingsMOTD::IDC_MOTD_CTRL->SetToolTip( - wxString("The Message Of The Day.")); + wxString("The Message Of The Day.", wxConvUTF8)); } // Main { // Teams ballance - SettingsMain::IDC_TEAMBALLANCE_CTRL->Append("None", + SettingsMain::IDC_TEAMBALLANCE_CTRL->Append(wxT("None"), (void *) OptionsGame::TeamBallanceNone); - SettingsMain::IDC_TEAMBALLANCE_CTRL->Append("Auto", + SettingsMain::IDC_TEAMBALLANCE_CTRL->Append(wxT("Auto"), (void *) OptionsGame::TeamBallanceAuto); - SettingsMain::IDC_TEAMBALLANCE_CTRL->Append("BotsVs", + SettingsMain::IDC_TEAMBALLANCE_CTRL->Append(wxT("BotsVs"), (void *) OptionsGame::TeamBallanceBotsVs); - SettingsMain::IDC_TEAMBALLANCE_CTRL->Append("AutoByScore", + SettingsMain::IDC_TEAMBALLANCE_CTRL->Append(wxT("AutoByScore"), (void *) OptionsGame::TeamBallanceAutoByScore); SettingsMain::IDC_TEAMBALLANCE_CTRL->SetSelection( context_.getTeamBallance()); SettingsMain::IDC_TEAMBALLANCE_CTRL->SetToolTip( - wxString("The mode that players are moved between teams to ballance them.")); + wxString("The mode that players are moved between teams to ballance them.", wxConvUTF8)); // Teams combo - SettingsMain::IDC_TEAMS_CTRL->Append("None"); + SettingsMain::IDC_TEAMS_CTRL->Append(wxT("None")); int i; char string[256]; for (i=2; i<=4; i++) { sprintf(string, "%i", i); - SettingsMain::IDC_TEAMS_CTRL->Append(string); + SettingsMain::IDC_TEAMS_CTRL->Append(wxString(string, wxConvUTF8)); } SettingsMain::IDC_TEAMS_CTRL->SetSelection( context_.getTeams() - 1); SettingsMain::IDC_TEAMS_CTRL->SetToolTip( - wxString("The number of teams that will play in this game.")); + wxString("The number of teams that will play in this game.", wxConvUTF8)); // Rounds combo for (i=1; i<50; i++) { sprintf(string, "%i", i); - SettingsMain::IDC_SERVER_ROUNDS_CTRL->Append(string); + SettingsMain::IDC_SERVER_ROUNDS_CTRL->Append(wxString(string, wxConvUTF8)); } SettingsMain::IDC_SERVER_ROUNDS_CTRL->SetSelection( context_.getNoRounds() - 1); SettingsMain::IDC_SERVER_ROUNDS_CTRL->SetToolTip( - wxString("The number of rounds that will be played in this game.")); + wxString("The number of rounds that will be played in this game.", wxConvUTF8)); // Shots combo for (i=0; i<50; i++) { sprintf(string, "%i", i); - SettingsMain::IDC_NOSHOTS_CTRL->Append(string); + SettingsMain::IDC_NOSHOTS_CTRL->Append(wxString(string, wxConvUTF8)); } SettingsMain::IDC_NOSHOTS_CTRL->SetSelection( context_.getNoMaxRoundTurns()); SettingsMain::IDC_NOSHOTS_CTRL->SetToolTip( - wxString("The maximum number of turns that will be played in each round (0 = infinite).")); + wxString("The maximum number of turns that will be played in each round (0 = infinite).", wxConvUTF8)); // Type combo - SettingsMain::IDC_TYPE_CTRL->Append("Simultaneous", + SettingsMain::IDC_TYPE_CTRL->Append(wxT("Simultaneous"), (void *) OptionsGame::TurnSimultaneous); - SettingsMain::IDC_TYPE_CTRL->Append("Sequential (Loser First)", + SettingsMain::IDC_TYPE_CTRL->Append(wxT("Sequential (Loser First)"), (void *) OptionsGame::TurnSequentialLooserFirst); - SettingsMain::IDC_TYPE_CTRL->Append("Sequential (Random Order)", + SettingsMain::IDC_TYPE_CTRL->Append(wxT("Sequential (Random Order)"), (void *) OptionsGame::TurnSequentialRandom); SettingsMain::IDC_TYPE_CTRL->SetSelection( context_.getTurnType()); SettingsMain::IDC_TYPE_CTRL->SetToolTip( - wxString("Specifies the order of play.")); + wxString("Specifies the order of play.", wxConvUTF8)); // The waiting time for (i=0; i<=90; i+=5) { sprintf(string, "%i Seconds", i); if (i==0) sprintf(string, "%i (Infinite)", i); - SettingsMain::IDC_SHOT_TIME_CTRL->Append(string); - SettingsMain::IDC_BUYING_TIME_CTRL->Append(string); - SettingsMain::IDC_START_TIME_CTRL->Append(string); - SettingsMain::IDC_IDLE_SHOTTIME_CTRL->Append(string); - SettingsMain::IDC_IDLE_TIME_CTRL->Append(string); - SettingsMain::IDC_KEEPALIVE_TIME_CTRL->Append(string); + SettingsMain::IDC_SHOT_TIME_CTRL->Append(wxString(string, wxConvUTF8)); + SettingsMain::IDC_BUYING_TIME_CTRL->Append(wxString(string, wxConvUTF8)); + SettingsMain::IDC_START_TIME_CTRL->Append(wxString(string, wxConvUTF8)); + SettingsMain::IDC_IDLE_SHOTTIME_CTRL->Append(wxString(string, wxConvUTF8)); + SettingsMain::IDC_IDLE_TIME_CTRL->Append(wxString(string, wxConvUTF8)); + SettingsMain::IDC_KEEPALIVE_TIME_CTRL->Append(wxString(string, wxConvUTF8)); } SettingsMain::IDC_KEEPALIVE_TIME_CTRL->SetSelection( context_.getKeepAliveTimeoutTime()/5); SettingsMain::IDC_KEEPALIVE_TIME_CTRL->SetToolTip( - wxString(context_.getKeepAliveTimeoutTimeToolTip())); + wxString(context_.getKeepAliveTimeoutTimeToolTip(), wxConvUTF8)); SettingsMain::IDC_START_TIME_CTRL->SetSelection( context_.getStartTime()/5); SettingsMain::IDC_START_TIME_CTRL->SetToolTip( - wxString("The time to wait before starting a new game.")); + wxString("The time to wait before starting a new game.", wxConvUTF8)); SettingsMain::IDC_SHOT_TIME_CTRL->SetSelection( context_.getShotTime()/5); SettingsMain::IDC_SHOT_TIME_CTRL->SetToolTip( - wxString("The maximum amount of time allowed for each player to make a move.")); + wxString("The maximum amount of time allowed for each player to make a move.", wxConvUTF8)); SettingsMain::IDC_BUYING_TIME_CTRL->SetSelection( context_.getBuyingTime()/5); SettingsMain::IDC_BUYING_TIME_CTRL->SetToolTip( - wxString("The maximum amount of time allowed for each player to buy accessories.")); + wxString("The maximum amount of time allowed for each player to buy accessories.", wxConvUTF8)); SettingsMain::IDC_IDLE_TIME_CTRL->SetSelection( context_.getIdleKickTime()/5); SettingsMain::IDC_IDLE_TIME_CTRL->SetToolTip( - wxString("The amount of time to wait for a client to respond after level loading before kicking it.")); + wxString("The amount of time to wait for a client to respond after level loading before kicking it.", wxConvUTF8)); SettingsMain::IDC_IDLE_SHOTTIME_CTRL->SetSelection( context_.getIdleShotKickTime()/5); SettingsMain::IDC_IDLE_SHOTTIME_CTRL->SetToolTip( - wxString("The amount of time to wait for a client to respond after shots before kicking it.")); + wxString("The amount of time to wait for a client to respond after shots before kicking it.", wxConvUTF8)); // Download speed for (i=0; i<=250000; i+=5000) { sprintf(string, "%i bytes/sec", i); if (i==0) sprintf(string, "%i (No download)", i); - SettingsMain::IDC_DOWNLOAD_SPEED_CTRL->Append(string); + SettingsMain::IDC_DOWNLOAD_SPEED_CTRL->Append(wxString(string, wxConvUTF8)); } SettingsMain::IDC_DOWNLOAD_SPEED_CTRL->SetSelection( context_.getModDownloadSpeed()/5000); SettingsMain::IDC_DOWNLOAD_SPEED_CTRL->SetToolTip( - wxString(context_.getModDownloadSpeedToolTip())); + wxString(context_.getModDownloadSpeedToolTip(), wxConvUTF8)); // Password SettingsMain::IDC_SERVER_PASSWORD_CTRL->SetValue( - context_.getServerPassword()); + wxString(context_.getServerPassword(), wxConvUTF8)); SettingsMain::IDC_SERVER_PASSWORD_CTRL->SetToolTip( - context_.getServerPasswordToolTip()); + wxString(context_.getServerPasswordToolTip(), wxConvUTF8)); // Turn on/off settings if server or client SettingsMain::IDC_SERVER_PASSWORD_CTRL->Show(playersPanel_ != 0); @@ -667,17 +668,17 @@ if (playersPanel_) { context_.setBotNamePrefix( - SettingsPlayers::IDC_EDIT3_CTRL->GetValue()); + SettingsPlayers::IDC_EDIT3_CTRL->GetValue().mb_str(wxConvUTF8)); // Read min + max players int minPlayers = 2; - sscanf(SettingsPlayers::IDC_SERVER_MIN_PLAYERS_CTRL->GetValue(), + sscanf(SettingsPlayers::IDC_SERVER_MIN_PLAYERS_CTRL->GetValue().mb_str(wxConvUTF8), "%i", &minPlayers); int maxPlayers = 10; - sscanf(SettingsPlayers::IDC_SERVER_MAX_PLAYERS_CTRL->GetValue(), + sscanf(SettingsPlayers::IDC_SERVER_MAX_PLAYERS_CTRL->GetValue().mb_str(wxConvUTF8), "%i", &maxPlayers); int maxBotPlayers = 10; - sscanf(SettingsPlayers::IDC_SERVER_REMOVEBOT_PLAYERS_CTRL->GetValue(), + sscanf(SettingsPlayers::IDC_SERVER_REMOVEBOT_PLAYERS_CTRL->GetValue().mb_str(wxConvUTF8), "%i", &maxBotPlayers); context_.setRemoveBotsAtPlayers(maxBotPlayers); @@ -690,7 +691,7 @@ for (int i=0; i<24; i++) { context_.setPlayerType(i, - SettingsPlayers::IDC_COMBO_PTYPE_CTRL[i]->GetValue()); + SettingsPlayers::IDC_COMBO_PTYPE_CTRL[i]->GetValue().mb_str(wxConvUTF8)); } } @@ -724,13 +725,13 @@ int startMoney = 2; int interest = 2; - sscanf(SettingsEco::IDC_BUYONROUND_CTRL->GetValue(), "%i", &buyonround); - sscanf(SettingsEco::IDC_MONEYPERHIT_CTRL->GetValue(), "%i", &moneyperhit); - sscanf(SettingsEco::IDC_MONEYPERKILL_CTRL->GetValue(), "%i", &moneyperkill); - sscanf(SettingsEco::IDC_MONEYPERROUND_CTRL->GetValue(), "%i", &moneyperround); - sscanf(SettingsEco::IDC_MONEYROUND_CTRL->GetValue(), "%i", &moneyround); - sscanf(SettingsEco::IDC_STARTMONEY_CTRL->GetValue(), "%i", &startMoney); - sscanf(SettingsEco::IDC_INTEREST_CTRL->GetValue(), "%i", &interest); + sscanf(SettingsEco::IDC_BUYONROUND_CTRL->GetValue().mb_str(wxConvUTF8), "%i", &buyonround); + sscanf(SettingsEco::IDC_MONEYPERHIT_CTRL->GetValue().mb_str(wxConvUTF8), "%i", &moneyperhit); + sscanf(SettingsEco::IDC_MONEYPERKILL_CTRL->GetValue().mb_str(wxConvUTF8), "%i", &moneyperkill); + sscanf(SettingsEco::IDC_MONEYPERROUND_CTRL->GetValue().mb_str(wxConvUTF8), "%i", &moneyperround); + sscanf(SettingsEco::IDC_MONEYROUND_CTRL->GetValue().mb_str(wxConvUTF8), "%i", &moneyround); + sscanf(SettingsEco::IDC_STARTMONEY_CTRL->GetValue().mb_str(wxConvUTF8), "%i", &startMoney); + sscanf(SettingsEco::IDC_INTEREST_CTRL->GetValue().mb_str(wxConvUTF8), "%i", &interest); context_.setScoreType( (OptionsGame::ScoreType) SettingsEco::IDC_SCOREMODE_CTRL->GetSelection()); @@ -742,7 +743,7 @@ context_.setMoneyWonPerHitPoint(moneyperhit); context_.setMoneyWonPerKillPoint(moneyperkill); context_.setMoneyPerHealthPoint(SettingsEco::IDC_MONEYPERHEALTH_CTRL->GetValue()); - context_.setEconomy(SettingsEco::IDC_ECONOMY_CTRL->GetValue()); + context_.setEconomy(SettingsEco::IDC_ECONOMY_CTRL->GetValue().mb_str(wxConvUTF8)); } // Env @@ -792,7 +793,7 @@ // MOTD { context_.setMOTD( - SettingsMOTD::IDC_MOTD_CTRL->GetValue()); + SettingsMOTD::IDC_MOTD_CTRL->GetValue().mb_str(wxConvUTF8)); } // Main @@ -816,15 +817,15 @@ SettingsMain::IDC_TEAMBALLANCE_CTRL->GetSelection())); context_.setTeams((int) SettingsMain::IDC_TEAMS_CTRL->GetSelection() + 1); - sscanf(SettingsMain::IDC_NOSHOTS_CTRL->GetValue(), "%i", &maxRoundTurns); - sscanf(SettingsMain::IDC_SERVER_ROUNDS_CTRL->GetValue(), "%i", &noRounds); - sscanf(SettingsMain::IDC_SHOT_TIME_CTRL->GetValue(), "%i", &shotTime); - sscanf(SettingsMain::IDC_BUYING_TIME_CTRL->GetValue(), "%i", &buyingTime); - sscanf(SettingsMain::IDC_START_TIME_CTRL->GetValue(), "%i", &startTime); - sscanf(SettingsMain::IDC_IDLE_TIME_CTRL->GetValue(), "%i", &idleTime); - sscanf(SettingsMain::IDC_IDLE_SHOTTIME_CTRL->GetValue(), "%i", &idleShotTime); - sscanf(SettingsMain::IDC_DOWNLOAD_SPEED_CTRL->GetValue(), "%i", &downloadSpeed); - sscanf(SettingsMain::IDC_KEEPALIVE_TIME_CTRL->GetValue(), "%i", &keepAliveTime); + sscanf(SettingsMain::IDC_NOSHOTS_CTRL->GetValue().mb_str(wxConvUTF8), "%i", &maxRoundTurns); + sscanf(SettingsMain::IDC_SERVER_ROUNDS_CTRL->GetValue().mb_str(wxConvUTF8), "%i", &noRounds); + sscanf(SettingsMain::IDC_SHOT_TIME_CTRL->GetValue().mb_str(wxConvUTF8), "%i", &shotTime); + sscanf(SettingsMain::IDC_BUYING_TIME_CTRL->GetValue().mb_str(wxConvUTF8), "%i", &buyingTime); + sscanf(SettingsMain::IDC_START_TIME_CTRL->GetValue().mb_str(wxConvUTF8), "%i", &startTime); + sscanf(SettingsMain::IDC_IDLE_TIME_CTRL->GetValue().mb_str(wxConvUTF8), "%i", &idleTime); + sscanf(SettingsMain::IDC_IDLE_SHOTTIME_CTRL->GetValue().mb_str(wxConvUTF8), "%i", &idleShotTime); + sscanf(SettingsMain::IDC_DOWNLOAD_SPEED_CTRL->GetValue().mb_str(wxConvUTF8), "%i", &downloadSpeed); + sscanf(SettingsMain::IDC_KEEPALIVE_TIME_CTRL->GetValue().mb_str(wxConvUTF8), "%i", &keepAliveTime); context_.setNoRounds(noRounds); context_.setShotTime(shotTime); @@ -837,7 +838,7 @@ context_.setModDownloadSpeed(downloadSpeed); context_.setServerPassword( - SettingsMain::IDC_SERVER_PASSWORD_CTRL->GetValue()); + SettingsMain::IDC_SERVER_PASSWORD_CTRL->GetValue().mb_str(wxConvUTF8)); } return true; @@ -846,15 +847,15 @@ bool showSettingsDialog(bool server, OptionsGame &context) { // Set the current mod - std::string modValue = getDataFileMod(); - setDataFileMod(context.getMod()); + std::string modValue = DefinesUtil::getDataFileMod(); + DefinesUtil::setDataFileMod(context.getMod()); // Show the settings SettingsFrame frame(server, context); bool result = (frame.ShowModal() == wxID_OK); // Reset the mod - setDataFileMod(modValue.c_str()); + DefinesUtil::setDataFileMod(modValue.c_str()); return result; } diff -urN --exclude=CVS --exclude=Makefile --exclude=Makefile.in --exclude=autom4te.cache --exclude=aclocal.m4 --exclude=configure --exclude=config.status --exclude=borland --exclude=config.log --exclude=.deps scorched/src/scorched/SettingsEco.cpp scorched-cvs/src/scorched/SettingsEco.cpp --- scorched/src/scorched/SettingsEco.cpp 2005-02-10 19:35:23.000000000 +0100 +++ scorched-cvs/src/scorched/SettingsEco.cpp 2005-09-22 17:14:28.000000000 +0200 @@ -26,79 +26,79 @@ topsizer->Add(sizer, 0, wxALL | wxALIGN_CENTER, 10); sizer->Add(new wxStaticText(parent, -1, - "Start Money :"), 0, wxALIGN_CENTER); + wxT("Start Money :")), 0, wxALIGN_CENTER); sizer->Add(IDC_STARTMONEY_CTRL = new wxComboBox(parent, IDC_STARTMONEY, - "", + wxT(""), wxDefaultPosition, wxDefaultSize, 0, 0, wxCB_READONLY), 0, wxALIGN_CENTER); sizer->Add(new wxStaticText(parent, -1, - "Percentage Interest :"), 0, wxALIGN_CENTER); + wxT("Percentage Interest :")), 0, wxALIGN_CENTER); sizer->Add(IDC_INTEREST_CTRL = new wxComboBox(parent, IDC_INTEREST, - "", + wxT(""), wxDefaultPosition, wxDefaultSize, 0, 0, wxCB_READONLY), 0, wxALIGN_CENTER); sizer->Add(new wxStaticText(parent, -1, - "Buy On Round :"), 0, wxALIGN_CENTER); + wxT("Buy On Round :")), 0, wxALIGN_CENTER); sizer->Add(IDC_BUYONROUND_CTRL = new wxComboBox(parent, IDC_BUYONROUND, - "", + wxT(""), wxDefaultPosition, wxDefaultSize, 0, 0, wxCB_READONLY), 0, wxALIGN_CENTER); sizer->Add(new wxStaticText(parent, -1, - "Money Per hit Point :"), 0, wxALIGN_CENTER); + wxT("Money Per hit Point :")), 0, wxALIGN_CENTER); sizer->Add(IDC_MONEYPERHIT_CTRL = new wxComboBox(parent, IDC_MONEYPERHIT, - "", + wxT(""), wxDefaultPosition, wxDefaultSize, 0, 0, wxCB_READONLY), 0, wxALIGN_CENTER); sizer->Add(new wxStaticText(parent, -1, - "Money Per kill Point :"), 0, wxALIGN_CENTER); + wxT("Money Per kill Point :")), 0, wxALIGN_CENTER); sizer->Add(IDC_MONEYPERKILL_CTRL = new wxComboBox(parent, IDC_MONEYPERKILL, - "", + wxT(""), wxDefaultPosition, wxDefaultSize, 0, 0, wxCB_READONLY), 0, wxALIGN_CENTER); sizer->Add(new wxStaticText(parent, -1, - "Money Per Round Won :"), 0, wxALIGN_CENTER); + wxT("Money Per Round Won :")), 0, wxALIGN_CENTER); sizer->Add(IDC_MONEYPERROUND_CTRL = new wxComboBox(parent, -1, - "", + wxT(""), wxDefaultPosition, wxDefaultSize, 0, 0, wxCB_READONLY), 0, wxALIGN_CENTER); sizer->Add(new wxStaticText(parent, -1, - "Money Per Round :"), 0, wxALIGN_CENTER); + wxT("Money Per Round :")), 0, wxALIGN_CENTER); sizer->Add(IDC_MONEYROUND_CTRL = new wxComboBox(parent, -1, - "", + wxT(""), wxDefaultPosition, wxDefaultSize, 0, 0, wxCB_READONLY), 0, wxALIGN_CENTER); sizer->Add(new wxStaticText(parent, -1, - "Scoring Mode :"), 0, wxALIGN_CENTER); + wxT("Scoring Mode :")), 0, wxALIGN_CENTER); sizer->Add(IDC_SCOREMODE_CTRL = new wxComboBox(parent, IDC_SCOREMODE, - "", + wxT(""), wxDefaultPosition, wxDefaultSize, 0, 0, wxCB_READONLY), 0, wxALIGN_CENTER); sizer->Add(new wxStaticText(parent, -1, - "Economy :"), 0, wxALIGN_CENTER); + wxT("Economy :")), 0, wxALIGN_CENTER); sizer->Add(IDC_ECONOMY_CTRL = new wxComboBox(parent, IDC_ECONOMY, - "", + wxT(""), wxDefaultPosition, wxDefaultSize, 0, 0, wxCB_READONLY), 0, wxALIGN_CENTER); topsizer->Add(IDC_MONEYPERHEALTH_CTRL = new wxCheckBox(parent, IDC_MONEYPERHEALTH, - "Money Awarded by Health Taken"), 0, wxALIGN_CENTER); + wxT("Money Awarded by Health Taken")), 0, wxALIGN_CENTER); } diff -urN --exclude=CVS --exclude=Makefile --exclude=Makefile.in --exclude=autom4te.cache --exclude=aclocal.m4 --exclude=configure --exclude=config.status --exclude=borland --exclude=config.log --exclude=.deps scorched/src/scorched/SettingsEnv.cpp scorched-cvs/src/scorched/SettingsEnv.cpp --- scorched/src/scorched/SettingsEnv.cpp 2005-02-25 00:20:50.000000000 +0100 +++ scorched-cvs/src/scorched/SettingsEnv.cpp 2005-09-22 17:14:28.000000000 +0200 @@ -26,82 +26,82 @@ topsizer->Add(sizer, 0, wxALL | wxALIGN_CENTER, 10); sizer->Add(new wxStaticText(parent, -1, - "Wind Force :"), 0, wxALIGN_CENTER); + wxT("Wind Force :")), 0, wxALIGN_CENTER); sizer->Add(IDC_COMBO_FORCE_CTRL = new wxComboBox(parent, IDC_COMBO_FORCE, - "", + wxT(""), wxDefaultPosition, wxDefaultSize, 0, 0, wxCB_READONLY), 0, wxALIGN_CENTER); sizer->Add(new wxStaticText(parent, -1, - "Wind Changes :"), 0, wxALIGN_CENTER); + wxT("Wind Changes :")), 0, wxALIGN_CENTER); sizer->Add(IDC_COMBO_WINDCHANGES_CTRL = new wxComboBox(parent, IDC_COMBO_WINDCHANGES, - "", + wxT(""), wxDefaultPosition, wxDefaultSize, 0, 0, wxCB_READONLY), 0, wxALIGN_CENTER); sizer->Add(new wxStaticText(parent, -1, - "Wall Type :"), 0, wxALIGN_CENTER); + wxT("Wall Type :")), 0, wxALIGN_CENTER); sizer->Add(IDC_COMBO_WALLTYPE_CTRL = new wxComboBox(parent, IDC_COMBO_WALLTYPE, - "", + wxT(""), wxDefaultPosition, wxDefaultSize, 0, 0, wxCB_READONLY), 0, wxALIGN_CENTER); sizer->Add(new wxStaticText(parent, -1, - "Weapon Scale :"), 0, wxALIGN_CENTER); + wxT("Weapon Scale :")), 0, wxALIGN_CENTER); sizer->Add(IDC_COMBO_WEAPONSCALE_CTRL = new wxComboBox(parent, IDC_COMBO_WEAPONSCALE, - "", + wxT(""), wxDefaultPosition, wxDefaultSize, 0, 0, wxCB_READONLY), 0, wxALIGN_CENTER); sizer->Add(new wxStaticText(parent, -1, - "Arms Level (Start Round):"), 0, wxALIGN_CENTER); + wxT("Arms Level (Start Round):")), 0, wxALIGN_CENTER); sizer->Add(IDC_COMBO_STARTARMSLEVEL_CTRL = new wxComboBox(parent, IDC_COMBO_STARTARMSLEVEL, - "", + wxT(""), wxDefaultPosition, wxDefaultSize, 0, 0, wxCB_READONLY), 0, wxALIGN_CENTER); sizer->Add(new wxStaticText(parent, -1, - "Arms Level (End Round):"), 0, wxALIGN_CENTER); + wxT("Arms Level (End Round):")), 0, wxALIGN_CENTER); sizer->Add(IDC_COMBO_ENDARMSLEVEL_CTRL = new wxComboBox(parent, IDC_COMBO_ENDARMSLEVEL, - "", + wxT(""), wxDefaultPosition, wxDefaultSize, 0, 0, wxCB_READONLY), 0, wxALIGN_CENTER); sizer->Add(new wxStaticText(parent, -1, - "Falling Distance"), 0, wxALIGN_CENTER); + wxT("Falling Distance")), 0, wxALIGN_CENTER); sizer->Add(IDC_COMBO_FALLINGDISTANCE_CTRL = new wxComboBox(parent, -1, - "", + wxT(""), wxDefaultPosition, wxDefaultSize, 0, 0, wxCB_READONLY), 0, wxALIGN_CENTER); sizer->Add(new wxStaticText(parent, -1, - "Climbing Distance"), 0, wxALIGN_CENTER); + wxT("Climbing Distance")), 0, wxALIGN_CENTER); sizer->Add(IDC_COMBO_CLIMBINGDISTANCE_CTRL = new wxComboBox(parent, -1, - "", + wxT(""), wxDefaultPosition, wxDefaultSize, 0, 0, wxCB_READONLY), 0, wxALIGN_CENTER); sizer->Add(new wxStaticText(parent, -1, - "Resign Mode"), 0, wxALIGN_CENTER); + wxT("Resign Mode")), 0, wxALIGN_CENTER); sizer->Add(IDC_RESIGNENDROUND_CTRL = new wxComboBox(parent, -1, - "", + wxT(""), wxDefaultPosition, wxDefaultSize, 0, 0, wxCB_READONLY), 0, wxALIGN_CENTER); sizer->Add(new wxStaticText(parent, -1, - "Movement Restrictions"), 0, wxALIGN_CENTER); + wxT("Movement Restrictions")), 0, wxALIGN_CENTER); sizer->Add(IDC_MOVEMENTRESTRICTION_CTRL = new wxComboBox(parent, -1, - "", + wxT(""), wxDefaultPosition, wxDefaultSize, 0, 0, wxCB_READONLY), 0, wxALIGN_CENTER); topsizer->Add(IDC_GIVEALLWEAPONS_CTRL = new wxCheckBox(parent, -1, - "Give all weapons", + wxT("Give all weapons"), wxDefaultPosition, wxDefaultSize), 0, wxALIGN_CENTER); } diff -urN --exclude=CVS --exclude=Makefile --exclude=Makefile.in --exclude=autom4te.cache --exclude=aclocal.m4 --exclude=configure --exclude=config.status --exclude=borland --exclude=config.log --exclude=.deps scorched/src/scorched/SettingsLand.cpp scorched-cvs/src/scorched/SettingsLand.cpp --- scorched/src/scorched/SettingsLand.cpp 2005-02-10 21:11:13.000000000 +0100 +++ scorched-cvs/src/scorched/SettingsLand.cpp 2005-09-22 17:14:28.000000000 +0200 @@ -32,7 +32,7 @@ wxScrolledWindow *scrolledWindow = new wxScrolledWindow(parent, -1, wxDefaultPosition, wxSize(225, 200)); - wxSizer *sizer = new wxFlexGridSizer(2, 2); + wxSizer *sizer = new wxFlexGridSizer(3, 3); int i = 0; std::list &defns = landscapeDefinitions.getAllLandscapes(); @@ -45,21 +45,21 @@ wxBoxSizer *boxSizer = new wxBoxSizer(wxVERTICAL); const char *fileName = getDataFile("data/landscapes/%s", dfn.picture.c_str()); - if (!::wxFileExists(fileName)) + if (!::wxFileExists(wxString(fileName, wxConvUTF8))) { fileName = getDataFile("data/landscapes/picture-none.bmp"); } wxImage image; - if (image.LoadFile(fileName, wxBITMAP_TYPE_BMP)) + if (image.LoadFile(wxString(fileName, wxConvUTF8), wxBITMAP_TYPE_BMP)) { wxBitmap bitmap(image); wxStaticBitmap *staticBmp = new wxStaticBitmap(scrolledWindow, -1, bitmap); - staticBmp->SetToolTip(wxString(dfn.description.c_str())); + staticBmp->SetToolTip(wxString(dfn.description.c_str(), wxConvUTF8)); boxSizer->Add(staticBmp, 0, wxALL, 2); } - landscapes[i] = new wxCheckBox(scrolledWindow, -1, dfn.name.c_str()); + landscapes[i] = new wxCheckBox(scrolledWindow, -1, wxString(dfn.name.c_str(), wxConvUTF8)); boxSizer->Add(landscapes[i]); sizer->Add(boxSizer, 0, wxALL, 5); @@ -72,12 +72,12 @@ (minSize.GetWidth() + 10) / 10, (minSize.GetHeight() + 10) / 10); topsizer->Add(scrolledWindow, 1, wxGROW | wxALL, 10); - IDC_CYCLEMAPS_CTRL = new wxCheckBox(parent, IDC_CYCLEMAPS, "Linearly cycle maps"); + IDC_CYCLEMAPS_CTRL = new wxCheckBox(parent, IDC_CYCLEMAPS, wxT("Linearly cycle maps")); topsizer->Add(IDC_CYCLEMAPS_CTRL, 0, wxALIGN_CENTER); wxBoxSizer *buttonSizer = new wxBoxSizer(wxHORIZONTAL); - IDC_SELECTALL_CTRL = new wxButton(parent, IDC_SELECTALL, "Select All"); - IDC_DESELECTALL_CTRL = new wxButton(parent, IDC_DESELECTALL, "Deselect All"); + IDC_SELECTALL_CTRL = new wxButton(parent, IDC_SELECTALL, wxT("Select All")); + IDC_DESELECTALL_CTRL = new wxButton(parent, IDC_DESELECTALL, wxT("Deselect All")); buttonSizer->Add(IDC_SELECTALL_CTRL, 0, wxALL, 10); buttonSizer->Add(IDC_DESELECTALL_CTRL, 0, wxALL, 10); topsizer->Add(buttonSizer, 0, wxALIGN_CENTER); diff -urN --exclude=CVS --exclude=Makefile --exclude=Makefile.in --exclude=autom4te.cache --exclude=aclocal.m4 --exclude=configure --exclude=config.status --exclude=borland --exclude=config.log --exclude=.deps scorched/src/scorched/SettingsMOTD.cpp scorched-cvs/src/scorched/SettingsMOTD.cpp --- scorched/src/scorched/SettingsMOTD.cpp 2004-11-11 04:00:37.000000000 +0100 +++ scorched-cvs/src/scorched/SettingsMOTD.cpp 2005-09-22 17:14:28.000000000 +0200 @@ -22,7 +22,7 @@ static void createControls(wxWindow *parent, wxSizer *topsizer) { - IDC_MOTD_CTRL = new wxTextCtrl(parent, -1, "", + IDC_MOTD_CTRL = new wxTextCtrl(parent, -1, wxT(""), wxDefaultPosition, wxSize(200, 100), wxTE_MULTILINE); topsizer->Add(IDC_MOTD_CTRL, 1, wxGROW | wxALL, 10); } diff -urN --exclude=CVS --exclude=Makefile --exclude=Makefile.in --exclude=autom4te.cache --exclude=aclocal.m4 --exclude=configure --exclude=config.status --exclude=borland --exclude=config.log --exclude=.deps scorched/src/scorched/SettingsMain.cpp scorched-cvs/src/scorched/SettingsMain.cpp --- scorched/src/scorched/SettingsMain.cpp 2005-04-03 14:46:43.000000000 +0200 +++ scorched-cvs/src/scorched/SettingsMain.cpp 2005-09-22 17:14:28.000000000 +0200 @@ -27,132 +27,132 @@ IDC_TEAMS_CTRL_TEXT = new wxStaticText(parent, -1, - "Number Teams :"); + wxT("Number Teams :")); sizer->Add(IDC_TEAMS_CTRL_TEXT, 0, wxALIGN_CENTER); IDC_TEAMS_CTRL = new wxComboBox(parent, IDC_TEAMS, - "", + wxT(""), wxDefaultPosition, wxDefaultSize, 0, 0, wxCB_READONLY); sizer->Add(IDC_TEAMS_CTRL, 0, wxALIGN_CENTER); sizer->Add(new wxStaticText(parent, -1, - "Team Ballance"), 0, wxALIGN_CENTER); + wxT("Team Ballance")), 0, wxALIGN_CENTER); sizer->Add(IDC_TEAMBALLANCE_CTRL = new wxComboBox(parent, -1, - "", + wxT(""), wxDefaultPosition, wxDefaultSize, 0, 0, wxCB_READONLY), 0, wxALIGN_CENTER); IDC_TYPE_CTRL_TEXT = new wxStaticText(parent, -1, - "Game Type :"); + wxT("Game Type :")); sizer->Add(IDC_TYPE_CTRL_TEXT, 0, wxALIGN_CENTER); IDC_TYPE_CTRL = new wxComboBox(parent, IDC_GAME_TYPE, - "", + wxT(""), wxDefaultPosition, wxDefaultSize, 0, 0, wxCB_READONLY); sizer->Add(IDC_TYPE_CTRL, 0, wxALIGN_CENTER); IDC_SERVER_ROUNDS_CTRL_TEXT = new wxStaticText(parent, -1, - "Number Rounds :"); + wxT("Number Rounds :")); sizer->Add(IDC_SERVER_ROUNDS_CTRL_TEXT, 0, wxALIGN_CENTER); IDC_SERVER_ROUNDS_CTRL = new wxComboBox(parent, IDC_SERVER_ROUNDS, - "", + wxT(""), wxDefaultPosition, wxDefaultSize, 0, 0, wxCB_READONLY); sizer->Add(IDC_SERVER_ROUNDS_CTRL, 0, wxALIGN_CENTER); IDC_NOSHOTS_CTRL_TEXT = new wxStaticText(parent, -1, - "Number Turns :"); + wxT("Number Turns :")); sizer->Add(IDC_NOSHOTS_CTRL_TEXT, 0, wxALIGN_CENTER); IDC_NOSHOTS_CTRL = new wxComboBox(parent, IDC_NOSHOTS, - "", + wxT(""), wxDefaultPosition, wxDefaultSize, 0, 0, wxCB_READONLY); sizer->Add(IDC_NOSHOTS_CTRL, 0, wxALIGN_CENTER); sizer->Add(new wxStaticText(parent, -1, - "Keep Alive Time :"), 0, wxALIGN_CENTER); + wxT("Keep Alive Time :")), 0, wxALIGN_CENTER); IDC_KEEPALIVE_TIME_CTRL = new wxComboBox(parent, -1, - "", + wxT(""), wxDefaultPosition, wxDefaultSize, 0, 0, wxCB_READONLY); sizer->Add(IDC_KEEPALIVE_TIME_CTRL, 0, wxALIGN_CENTER); IDC_START_TIME_CTRL_TEXT = new wxStaticText(parent, -1, - "Start Time :"); + wxT("Start Time :")); sizer->Add(IDC_START_TIME_CTRL_TEXT, 0, wxALIGN_CENTER); IDC_START_TIME_CTRL = new wxComboBox(parent, IDC_START_TIME, - "", + wxT(""), wxDefaultPosition, wxDefaultSize, 0, 0, wxCB_READONLY); sizer->Add(IDC_START_TIME_CTRL, 0, wxALIGN_CENTER); IDC_SHOT_TIME_CTRL_TEXT = new wxStaticText(parent, -1, - "Shot Time :"); + wxT("Shot Time :")); sizer->Add(IDC_SHOT_TIME_CTRL_TEXT, 0, wxALIGN_CENTER); IDC_SHOT_TIME_CTRL = new wxComboBox(parent, IDC_SHOT_TIME, - "", + wxT(""), wxDefaultPosition, wxDefaultSize, 0, 0, wxCB_READONLY); sizer->Add(IDC_SHOT_TIME_CTRL, 0, wxALIGN_CENTER); IDC_BUYING_TIME_CTRL_TEXT = new wxStaticText(parent, -1, - "Buying Time :"); + wxT("Buying Time :")); sizer->Add(IDC_BUYING_TIME_CTRL_TEXT, 0, wxALIGN_CENTER); IDC_BUYING_TIME_CTRL = new wxComboBox(parent, IDC_SHOT_TIME, - "", + wxT(""), wxDefaultPosition, wxDefaultSize, 0, 0, wxCB_READONLY); sizer->Add(IDC_BUYING_TIME_CTRL, 0, wxALIGN_CENTER); IDC_IDLE_TIME_CTRL_TEXT = new wxStaticText(parent, -1, - "Level Idle Time :"); + wxT("Level Idle Time :")); sizer->Add(IDC_IDLE_TIME_CTRL_TEXT, 0, wxALIGN_CENTER); IDC_IDLE_TIME_CTRL = new wxComboBox(parent, IDC_IDLE_TIME, - "", + wxT(""), wxDefaultPosition, wxDefaultSize, 0, 0, wxCB_READONLY); sizer->Add(IDC_IDLE_TIME_CTRL, 0, wxALIGN_CENTER); IDC_IDLE_SHOTTIME_CTRL_TEXT = new wxStaticText(parent, -1, - "Shot Idle Time :"); + wxT("Shot Idle Time :")); sizer->Add(IDC_IDLE_SHOTTIME_CTRL_TEXT, 0, wxALIGN_CENTER); IDC_IDLE_SHOTTIME_CTRL = new wxComboBox(parent, IDC_IDLE_SHOTTIME, - "", + wxT(""), wxDefaultPosition, wxDefaultSize, 0, 0, wxCB_READONLY); sizer->Add(IDC_IDLE_SHOTTIME_CTRL, 0, wxALIGN_CENTER); sizer->Add(new wxStaticText(parent, -1, - "Mod Download Speed :"), 0, wxALIGN_CENTER); + wxT("Mod Download Speed :")), 0, wxALIGN_CENTER); IDC_DOWNLOAD_SPEED_CTRL = new wxComboBox(parent, -1, - "", + wxT(""), wxDefaultPosition, wxDefaultSize, 0, 0, wxCB_READONLY); sizer->Add(IDC_DOWNLOAD_SPEED_CTRL, 0, wxALIGN_CENTER); IDC_SERVER_PASSWORD_CTRL_TEXT = - new wxStaticText(parent, -1, "Password :"); + new wxStaticText(parent, -1, wxT("Password :")); sizer->Add(IDC_SERVER_PASSWORD_CTRL_TEXT, 0, wxALIGN_CENTER); IDC_SERVER_PASSWORD_CTRL = new wxTextCtrl(parent, -1, - "", + wxT(""), wxDefaultPosition, wxSize((int) 132, -1), wxTE_PASSWORD); sizer->Add(IDC_SERVER_PASSWORD_CTRL, 0, wxALIGN_CENTER); } diff -urN --exclude=CVS --exclude=Makefile --exclude=Makefile.in --exclude=autom4te.cache --exclude=aclocal.m4 --exclude=configure --exclude=config.status --exclude=borland --exclude=config.log --exclude=.deps scorched/src/scorched/SettingsPlayers.cpp scorched-cvs/src/scorched/SettingsPlayers.cpp --- scorched/src/scorched/SettingsPlayers.cpp 2005-02-10 19:35:23.000000000 +0100 +++ scorched-cvs/src/scorched/SettingsPlayers.cpp 2005-09-22 17:14:28.000000000 +0200 @@ -26,32 +26,32 @@ topsizer->Add(buttonSizer, 0, wxALIGN_CENTER | wxTOP, 10); buttonSizer->Add(new wxStaticText(parent, -1, - "Min Players :"), 0, wxALIGN_CENTER | wxRIGHT | wxLEFT, 5); + wxT("Min Players :")), 0, wxALIGN_CENTER | wxRIGHT | wxLEFT, 5); buttonSizer->Add(IDC_SERVER_MIN_PLAYERS_CTRL = new wxComboBox(parent, -1, - "", + wxT(""), wxDefaultPosition, wxDefaultSize, 0, 0, wxCB_READONLY), 0, wxALIGN_CENTER); buttonSizer->Add(new wxStaticText(parent, -1, - "Max Players :"), 0, wxALIGN_CENTER | wxRIGHT | wxLEFT, 5); + wxT("Max Players :")), 0, wxALIGN_CENTER | wxRIGHT | wxLEFT, 5); buttonSizer->Add(IDC_SERVER_MAX_PLAYERS_CTRL = new wxComboBox(parent, IDC_SERVER_MAX_PLAYERS, - "", + wxT(""), wxDefaultPosition, wxDefaultSize, 0, 0, wxCB_READONLY), 0, wxALIGN_CENTER); wxBoxSizer *buttonSizer2 = new wxBoxSizer(wxHORIZONTAL); topsizer->Add(buttonSizer2, 0, wxALIGN_CENTER | wxTOP, 10); buttonSizer2->Add(new wxStaticText(parent, -1, - "Remove bots after players :"), 0, wxALIGN_CENTER | wxRIGHT | wxLEFT, 5); + wxT("Remove bots after players :")), 0, wxALIGN_CENTER | wxRIGHT | wxLEFT, 5); buttonSizer2->Add(IDC_SERVER_REMOVEBOT_PLAYERS_CTRL = new wxComboBox(parent, -1, - "", + wxT(""), wxDefaultPosition, wxDefaultSize, 0, 0, wxCB_READONLY), 0, wxALIGN_CENTER); IDC_SERVER_RESIDUAL_CTRL = new wxCheckBox(parent, -1, - "Players are persistent for game"); + wxT("Players are persistent for game")); topsizer->Add(IDC_SERVER_RESIDUAL_CTRL, 0, wxALIGN_CENTER | wxTOP, 10); wxSizer *sizer = new wxGridSizer(3, 3); @@ -63,10 +63,10 @@ sprintf(buffer, "%i", (i+1)); wxBoxSizer *playerSizer = new wxBoxSizer(wxHORIZONTAL); - playerSizer->Add(new wxStaticText(parent, -1, buffer)); + playerSizer->Add(new wxStaticText(parent, -1, wxString(buffer, wxConvUTF8))); playerSizer->Add(IDC_COMBO_PTYPE_CTRL[i] = new wxComboBox(parent, -1, - "", + wxT(""), wxDefaultPosition, wxDefaultSize, 0, 0, wxCB_READONLY)); sizer->Add(playerSizer, 0, wxALIGN_RIGHT | wxALL, 2); @@ -75,10 +75,10 @@ wxBoxSizer *botSizer = new wxBoxSizer(wxHORIZONTAL); topsizer->Add(botSizer, 0, wxALIGN_CENTER | wxALL, 10); botSizer->Add(new wxStaticText(parent, -1, - "Bot Name Prefix :"), 0, wxALIGN_CENTER | wxRIGHT | wxLEFT, 5); + wxT("Bot Name Prefix :")), 0, wxALIGN_CENTER | wxRIGHT | wxLEFT, 5); botSizer->Add(IDC_EDIT3_CTRL = new wxTextCtrl(parent, -1, - "", + wxT(""), wxDefaultPosition, wxSize((int) 214.5, (int) 21)), 0, wxALIGN_CENTER); } diff -urN --exclude=CVS --exclude=Makefile --exclude=Makefile.in --exclude=autom4te.cache --exclude=aclocal.m4 --exclude=configure --exclude=config.status --exclude=borland --exclude=config.log --exclude=.deps scorched/src/scorched/SingleChoiceDialog.cpp scorched-cvs/src/scorched/SingleChoiceDialog.cpp --- scorched/src/scorched/SingleChoiceDialog.cpp 2005-02-01 22:47:41.000000000 +0100 +++ scorched-cvs/src/scorched/SingleChoiceDialog.cpp 2005-09-22 17:14:28.000000000 +0200 @@ -75,7 +75,7 @@ END_EVENT_TABLE() SingleChoiceFrame::SingleChoiceFrame(const char *mod) : - wxDialog(getMainDialog(), -1, scorched3dAppName, + wxDialog(getMainDialog(), -1, wxString(scorched3dAppName, wxConvUTF8), wxDefaultPosition, wxDefaultSize) { // Create the positioning sizer @@ -86,7 +86,7 @@ wxIcon icon(getDataFile("data/windows/tank2.ico"), wxBITMAP_TYPE_ICO); SetIcon(icon); #endif - setDataFileMod(mod); + DefinesUtil::setDataFileMod(mod); addTitleToWindow(this, topsizer, getDataFile("data/windows/scorched.bmp"), @@ -111,13 +111,14 @@ desc, icon, this, gridsizer, refData); } - setDataFileMod("none"); + DefinesUtil::setDataFileMod("none"); topsizer->Add(gridsizer, 0, wxALIGN_CENTER | wxALL, 5); // Quit button wxBoxSizer *buttonSizer = new wxBoxSizer(wxHORIZONTAL); - buttonSizer->Add(new wxButton(this, wxID_CANCEL, "Close"), 0, wxALL, 5); + buttonSizer->Add(new wxButton(this, wxID_CANCEL, + wxT("Close")), 0, wxALL, 5); topsizer->Add(buttonSizer, 0, wxALIGN_RIGHT); // use the sizer for layout diff -urN --exclude=CVS --exclude=Makefile --exclude=Makefile.in --exclude=autom4te.cache --exclude=aclocal.m4 --exclude=configure --exclude=config.status --exclude=borland --exclude=config.log --exclude=.deps scorched/src/scorched/SingleDialog.cpp scorched-cvs/src/scorched/SingleDialog.cpp --- scorched/src/scorched/SingleDialog.cpp 2005-02-01 22:47:41.000000000 +0100 +++ scorched-cvs/src/scorched/SingleDialog.cpp 2005-09-22 17:14:28.000000000 +0200 @@ -87,7 +87,7 @@ END_EVENT_TABLE() SingleFrame::SingleFrame() : - wxDialog(getMainDialog(), -1, scorched3dAppName, + wxDialog(getMainDialog(), -1, wxString(scorched3dAppName, wxConvUTF8), wxDefaultPosition, wxDefaultSize) { // Create the positioning sizer @@ -117,9 +117,9 @@ { const char *modName = (*itor).c_str(); - setDataFileMod(modName); + DefinesUtil::setDataFileMod(modName); std::string modGamesFile = getDataFile("data/singlegames.xml"); - setDataFileMod("none"); + DefinesUtil::setDataFileMod("none"); if (noModGamesFile == modGamesFile && 0 != strcmp(modName, "none")) continue; @@ -143,7 +143,8 @@ // Quit button wxBoxSizer *buttonSizer = new wxBoxSizer(wxHORIZONTAL); - buttonSizer->Add(new wxButton(this, wxID_CANCEL, "Close"), 0, wxALL, 5); + buttonSizer->Add( + new wxButton(this, wxID_CANCEL, wxT("Close")), 0, wxALL, 5); topsizer->Add(buttonSizer, 0, wxALIGN_RIGHT); // use the sizer for layout @@ -158,7 +159,7 @@ const char *mod, wxSizer *sizer) { - setDataFileMod(mod); + DefinesUtil::setDataFileMod(mod); SingleGames games; if (!games.parse(getDataFile("data/singlegames.xml"))) @@ -169,21 +170,21 @@ (char *) games.icon.c_str(), this, sizer, refData); - setDataFileMod("none"); + DefinesUtil::setDataFileMod("none"); } void SingleFrame::onLoadButton(wxCommandEvent &event) { - wxString file = ::wxFileSelector("Please choose the saved game to load", - getSaveFile(""), // default path - "", // default filename - "", // default extension - "*.s3d", - wxOPEN | wxFILE_MUST_EXIST); + wxString file = ::wxFileSelector(wxT("Please choose the saved game to load"), + wxString(getSaveFile(""), wxConvUTF8), // default path + wxT(""), // default filename + wxT(""), // default extension + wxT("*.s3d"), + wxOPEN | wxFILE_MUST_EXIST); if (!file.empty()) { EndModal(wxID_OK); - runScorched3D("-loadsave \"%s\"", file.c_str()); + runScorched3D("-loadsave \"%s\"", (const char *) file.mb_str(wxConvUTF8)); } } diff -urN --exclude=CVS --exclude=Makefile --exclude=Makefile.in --exclude=autom4te.cache --exclude=aclocal.m4 --exclude=configure --exclude=config.status --exclude=borland --exclude=config.log --exclude=.deps scorched/src/scorched/SingleS.cpp scorched-cvs/src/scorched/SingleS.cpp --- scorched/src/scorched/SingleS.cpp 2005-02-10 19:35:23.000000000 +0100 +++ scorched-cvs/src/scorched/SingleS.cpp 2005-09-22 17:14:28.000000000 +0200 @@ -24,49 +24,49 @@ wxSizer *sizer) { wxStaticBox *clientnameBox = - new wxStaticBox(parent, -1, "Client Settings"); + new wxStaticBox(parent, -1, wxT("Client Settings")); wxStaticBoxSizer *clientnameSizer = new wxStaticBoxSizer(clientnameBox, wxHORIZONTAL); IDC_CLIENT_PLAYERS_CTRL_TEXT = new wxStaticText(parent, -1, - "Number Players :"); + wxT("Number Players :")); clientnameSizer->Add(IDC_CLIENT_PLAYERS_CTRL_TEXT, 0, wxALIGN_CENTER); IDC_CLIENT_PLAYERS_CTRL = new wxComboBox(parent, -1, - "", + wxT(""), wxDefaultPosition, wxDefaultSize, 0, 0, wxCB_READONLY); clientnameSizer->Add(IDC_CLIENT_PLAYERS_CTRL, 0, wxALIGN_CENTER); sizer->Add(clientnameSizer, 0, wxALL, 5); wxStaticBox *modBox = - new wxStaticBox(parent, -1, "Mod Settings"); + new wxStaticBox(parent, -1, wxT("Mod Settings")); wxStaticBoxSizer *modSizer = new wxStaticBoxSizer(modBox, wxHORIZONTAL); modSizer->Add(new wxStaticText(parent, -1, - "Use Mod :"), 0, wxALL, 5); + wxT("Use Mod :")), 0, wxALL, 5); IDC_CLIENT_MOD_CTRL = new wxComboBox(parent, -1, - "", + wxT(""), wxDefaultPosition, wxDefaultSize, 0, 0, wxCB_READONLY); modSizer->Add(IDC_CLIENT_MOD_CTRL, 0, wxALL, 5); sizer->Add(modSizer, 0, wxGROW | wxALIGN_RIGHT | wxALL, 5); wxStaticBox *advBox = - new wxStaticBox(parent, -1, "Advanced Settings"); + new wxStaticBox(parent, -1, wxT("Advanced Settings")); wxStaticBoxSizer *advSizer = new wxStaticBoxSizer(advBox, wxVERTICAL); IDC_BUTTON_SETTINGS_CTRL = new wxButton(parent, IDC_BUTTON_SETTINGS, - "Edit Advanced Settings"); + wxT("Edit Advanced Settings")); advSizer->Add(IDC_BUTTON_SETTINGS_CTRL, 0, wxALL, 5); sizer->Add(advSizer, 0, wxGROW | wxALL, 5); // Ok and cancel boxes wxBoxSizer *buttonSizer = new wxBoxSizer(wxHORIZONTAL); - IDOK_CTRL = new wxButton(parent, wxID_OK, "Start Client"); - IDCANCEL_CTRL = new wxButton(parent, wxID_CANCEL, "Cancel"); + IDOK_CTRL = new wxButton(parent, wxID_OK, wxT("Start Client")); + IDCANCEL_CTRL = new wxButton(parent, wxID_CANCEL, wxT("Cancel")); buttonSizer->Add(IDCANCEL_CTRL, 0, wxALL, 10); buttonSizer->Add(IDOK_CTRL, 0, wxALL, 10); sizer->Add(buttonSizer, 0, wxALIGN_RIGHT); diff -urN --exclude=CVS --exclude=Makefile --exclude=Makefile.in --exclude=autom4te.cache --exclude=aclocal.m4 --exclude=configure --exclude=config.status --exclude=borland --exclude=config.log --exclude=.deps scorched/src/scorched/SingleSDialog.cpp scorched-cvs/src/scorched/SingleSDialog.cpp --- scorched/src/scorched/SingleSDialog.cpp 2005-02-01 22:47:41.000000000 +0100 +++ scorched-cvs/src/scorched/SingleSDialog.cpp 2005-09-22 17:14:28.000000000 +0200 @@ -51,13 +51,13 @@ END_EVENT_TABLE() SingleSFrame::SingleSFrame(OptionsGame &options) : - wxDialog(getMainDialog(), -1, scorched3dAppName, + wxDialog(getMainDialog(), -1, wxString(scorched3dAppName, wxConvUTF8), wxDefaultPosition, wxDefaultSize), options_(options) { #ifdef _WIN32 // Set the frame's icon - wxIcon icon(getDataFile("data/windows/tank2.ico"), wxBITMAP_TYPE_ICO); + wxIcon icon(wxString(getDataFile("data/windows/tank2.ico"), wxConvUTF8), wxBITMAP_TYPE_ICO); SetIcon(icon); #endif @@ -90,13 +90,13 @@ { char string[20]; sprintf(string, "%i", i); - IDC_CLIENT_PLAYERS_CTRL->Append(string); + IDC_CLIENT_PLAYERS_CTRL->Append(wxString(string, wxConvUTF8)); } sprintf(string, "%i", options_.getNoMaxPlayers()); - IDC_CLIENT_PLAYERS_CTRL->SetValue(string); + IDC_CLIENT_PLAYERS_CTRL->SetValue(wxString(string, wxConvUTF8)); IDC_CLIENT_PLAYERS_CTRL->SetToolTip( - wxString("The number of players that will play in this game.\n" - "This number should include computer players")); + wxString(wxT("The number of players that will play in this game.\n") + wxT("This number should include computer players"))); ModDirs modDirs; if (!modDirs.loadModDirs()) dialogExit("ModFiles", "Failed to load mod files"); @@ -105,15 +105,15 @@ itor != modDirs.getDirs().end(); itor++) { - IDC_CLIENT_MOD_CTRL->Append((*itor).c_str()); + IDC_CLIENT_MOD_CTRL->Append(wxString((*itor).c_str(), wxConvUTF8)); } - if (IDC_CLIENT_MOD_CTRL->FindString(options_.getMod()) != -1) - IDC_CLIENT_MOD_CTRL->SetValue(options_.getMod()); + if (IDC_CLIENT_MOD_CTRL->FindString(wxString(options_.getMod(), wxConvUTF8)) != -1) + IDC_CLIENT_MOD_CTRL->SetValue(wxString(options_.getMod(), wxConvUTF8)); else - IDC_CLIENT_MOD_CTRL->SetValue("none"); + IDC_CLIENT_MOD_CTRL->SetValue(wxT("none")); IDC_CLIENT_MOD_CTRL->SetToolTip( - wxString("The Scorched3D mod to use for this game.")); + wxString("The Scorched3D mod to use for this game.", wxConvUTF8)); return true; } @@ -121,10 +121,10 @@ bool SingleSFrame::TransferDataFromWindow() { int noPlayers = 2; - sscanf(IDC_CLIENT_PLAYERS_CTRL->GetValue(), "%i", &noPlayers); + sscanf(IDC_CLIENT_PLAYERS_CTRL->GetValue().mb_str(wxConvUTF8), "%i", &noPlayers); options_.setNoMaxPlayers(noPlayers); options_.setNoMinPlayers(noPlayers); - options_.setMod(IDC_CLIENT_MOD_CTRL->GetValue()); + options_.setMod(IDC_CLIENT_MOD_CTRL->GetValue().mb_str(wxConvUTF8)); return true; } @@ -132,9 +132,9 @@ bool showSingleSDialog() { OptionsGame tmpOptions; - wxString customFilePathSrc = getDataFile("data/singlecustom.xml"); - wxString customFilePathDest = getSettingsFile("singlecustom.xml"); - if (::wxFileExists(customFilePathDest)) + std::string customFilePathSrc = getDataFile("data/singlecustom.xml"); + std::string customFilePathDest = getSettingsFile("singlecustom.xml"); + if (DefinesUtil::fileExists(customFilePathDest.c_str())) { tmpOptions.readOptionsFromFile((char *) customFilePathDest.c_str()); } diff -urN --exclude=CVS --exclude=Makefile --exclude=Makefile.in --exclude=autom4te.cache --exclude=aclocal.m4 --exclude=configure --exclude=config.status --exclude=borland --exclude=config.log --exclude=.deps scorched/src/scorched/main.cpp scorched-cvs/src/scorched/main.cpp --- scorched/src/scorched/main.cpp 2005-06-29 01:14:29.000000000 +0200 +++ scorched-cvs/src/scorched/main.cpp 2005-09-22 17:14:28.000000000 +0200 @@ -57,7 +57,7 @@ aParser.addEntry("-allowexceptions", &allowExceptions, "Allows any program exceptions to be thrown (core dumps)"); if (!aParser.parse(argc, argv)) return false; - setSettingsDir(OptionsParam::instance()->getSettingsDir()); + DefinesUtil::setSettingsDir(OptionsParam::instance()->getSettingsDir()); // Read display options from a file // **This NEEDS to be after the arg parser** @@ -70,12 +70,12 @@ if (!OptionsDisplay::instance()->getHostDescription()[0]) { wxString osDesc = ::wxGetOsDescription(); - OptionsDisplay::instance()->setHostDescription(osDesc.c_str()); + OptionsDisplay::instance()->setHostDescription(osDesc.mb_str(wxConvUTF8)); wxString userName = ::wxGetUserName(); - if (userName.c_str()[0]) + if (!userName.empty()) { - OptionsDisplay::instance()->setOnlineUserName(userName.c_str()); + OptionsDisplay::instance()->setOnlineUserName(userName.mb_str(wxConvUTF8)); } } @@ -88,9 +88,9 @@ ScorchedProtocolVersion)) { // The version has changed move the current mod directories - if (!dirExists(getSettingsFile("/oldmods"))) + if (!DefinesUtil::dirExists(getSettingsFile("/oldmods"))) { - ::wxMkdir(getSettingsFile("/oldmods"), 0755); + DefinesUtil::dirMake(getSettingsFile("/oldmods")); } ModDirs dirs; dirs.loadModDirs(); @@ -102,9 +102,10 @@ const char *modDir = (*itor).c_str(); std::string src = getModFile(modDir); std::string dest = getSettingsFile("/oldmods/%s-%u", modDir, time(0)); - if (dirExists(src.c_str())) + if (DefinesUtil::dirExists(src.c_str())) { - if (::wxRenameFile(src.c_str(), dest.c_str())) + if (::wxRenameFile(wxString(src.c_str(), wxConvUTF8), + wxString(dest.c_str(), wxConvUTF8))) { dialogMessage("Scorched3D", "Mod directory\n" @@ -155,21 +156,47 @@ FILE *checkfile = fopen(getDataFile("data/autoexec.xml"), "r"); if (!checkfile) { - dialogExit( - scorched3dAppName, - "Error: This game requires the Scorched3D data directory to run.\n" - "Your machine does not appear to have the Scorched3D data directory in\n" - "the required location.\n" - "The data directory is set to \"%s\" which does not exist.\n\n" - "If Scorched3D does not run please re-install Scorched3D.", - getDataFile("data")); + // Perhaps we can get the directory from the executables path name + char path[1024]; + strcpy(path, argv[0]); + char *sep = strrchr(path, '/'); + if (sep) + { + // Change into this new direcotry + *sep = '\0'; +#ifdef _WIN32 + SetCurrentDirectory(path); +#else + chdir(path); +#endif // _WIN32 + } + + // Now try again for the correct directory + checkfile = fopen(getDataFile("data/autoexec.xml"), "r"); + if (!checkfile) + { +#ifdef _WIN32 + GetCurrentDirectory(sizeof(path), path); +#else + getcwd(path, sizeof(path)); +#endif // _WIN32 + dialogExit( + scorched3dAppName, + "Error: This game requires the Scorched3D data directory to run.\n" + "Your machine does not appear to have the Scorched3D data directory in\n" + "the required location.\n" + "The data directory is set to \"%s\" which does not exist.\n" + "(Current working directory %s)\n\n" + "If Scorched3D does not run please re-install Scorched3D.", + getDataFile("data"), path); + } } else fclose(checkfile); #ifdef _WIN32 // For borland compilers disable floating point exceptions. _control87(MCW_EM,MCW_EM); -#endif +#endif // _WIN32 #ifndef _WIN32 // Tells Linux not to issue a sig pipe when writting to a closed socket @@ -199,7 +226,7 @@ case OptionsParam::ActionRunServer: // Load the server settings file - if (!::wxFileExists(OptionsParam::instance()->getServerFile())) + if (!DefinesUtil::fileExists(OptionsParam::instance()->getServerFile())) { dialogExit(scorched3dAppName, "Server file \"%s\" does not exist.", @@ -263,7 +290,7 @@ if (OptionsParam::instance()->getClientFile()[0]) { // If not load the client settings file - if (!::wxFileExists(OptionsParam::instance()->getClientFile())) + if (!DefinesUtil::fileExists(OptionsParam::instance()->getClientFile())) { dialogExit(scorched3dAppName, "Client file \"%s\" does not exist.", @@ -275,7 +302,7 @@ else { // Or the client saved game - if (!::wxFileExists(OptionsParam::instance()->getSaveFile())) + if (!DefinesUtil::fileExists(OptionsParam::instance()->getSaveFile())) { dialogExit(scorched3dAppName, "Client save file \"%s\" does not exist.", diff -urN --exclude=CVS --exclude=Makefile --exclude=Makefile.in --exclude=autom4te.cache --exclude=aclocal.m4 --exclude=configure --exclude=config.status --exclude=borland --exclude=config.log --exclude=.deps scorched/src/server/ServerAddPlayerHandler.cpp scorched-cvs/src/server/ServerAddPlayerHandler.cpp --- scorched/src/server/ServerAddPlayerHandler.cpp 2005-08-14 21:11:42.000000000 +0200 +++ scorched-cvs/src/server/ServerAddPlayerHandler.cpp 2005-09-22 17:14:28.000000000 +0200 @@ -114,8 +114,12 @@ Logger::log( "Player playing dest=\"%i\" id=\"%i\" \"%s\"->\"%s\"", tank->getDestinationId(), tank->getPlayerId(), tank->getName(), name.c_str()); - ServerCommon::sendString(0, "Player playing \"%s\"->\"%s\"", - tank->getName(), name.c_str()); + + if (name != tank->getName()) + { + ServerCommon::sendString(0, "Player changed name \"%s\"->\"%s\"", + tank->getName(), name.c_str()); + } } } @@ -154,7 +158,14 @@ ServerCommon::sendString(0, "Welcome back %s, you are ranked %s", tank->getName(), rank); } + + if (tank->getState().getSpectator()) + { + ServerCommon::sendString(0, "Player playing \"%s\"", + tank->getName()); + } } + tank->getState().setSpectator(false); // Choose a team (if applicable) @@ -192,7 +203,7 @@ // Ensure this name does not have the bot name in it const char *botPrefix = ScorchedServer::instance()->getOptionsGame().getBotNamePrefix(); - char *botPrefixPos = my_stristr(sentname.c_str(), botPrefix); + char *botPrefixPos = DefinesUtil::my_stristr(sentname.c_str(), botPrefix); if (botPrefixPos) { for (int i=0; i<(int) strlen(botPrefix); i++, botPrefixPos++) diff -urN --exclude=CVS --exclude=Makefile --exclude=Makefile.in --exclude=autom4te.cache --exclude=aclocal.m4 --exclude=configure --exclude=config.status --exclude=borland --exclude=config.log --exclude=.deps scorched/src/server/ServerAuthHandlerPrefered.cpp scorched-cvs/src/server/ServerAuthHandlerPrefered.cpp --- scorched/src/server/ServerAuthHandlerPrefered.cpp 2005-07-24 21:34:01.000000000 +0200 +++ scorched-cvs/src/server/ServerAuthHandlerPrefered.cpp 2005-09-22 17:14:28.000000000 +0200 @@ -101,9 +101,9 @@ const char *filename = getSettingsFile("preferedplayers-%i.xml", ScorchedServer::instance()->getOptionsGame().getPortNo()); - if (!::wxFileExists(filename)) return true; + if (!::DefinesUtil::fileExists(filename)) return true; - time_t fileTime = ::wxFileModificationTime(filename); + time_t fileTime = ::wxFileModificationTime(wxString(filename, wxConvUTF8)); if (fileTime == lastReadTime_) return true; XMLFile file; diff -urN --exclude=CVS --exclude=Makefile --exclude=Makefile.in --exclude=autom4te.cache --exclude=aclocal.m4 --exclude=configure --exclude=config.status --exclude=borland --exclude=config.log --exclude=.deps scorched/src/server/ServerBanned.cpp scorched-cvs/src/server/ServerBanned.cpp --- scorched/src/server/ServerBanned.cpp 2005-07-24 21:34:01.000000000 +0200 +++ scorched-cvs/src/server/ServerBanned.cpp 2005-09-22 17:14:28.000000000 +0200 @@ -41,9 +41,9 @@ const char *filename = getSettingsFile("banned-%i.xml", ScorchedServer::instance()->getOptionsGame().getPortNo()); - if (!::wxFileExists(filename)) return true; + if (!DefinesUtil::fileExists(filename)) return true; - time_t fileTime = ::wxFileModificationTime(filename); + time_t fileTime = ::wxFileModificationTime(wxString(filename, wxConvUTF8)); if (!force && fileTime == lastReadTime_) return true; XMLFile file; diff -urN --exclude=CVS --exclude=Makefile --exclude=Makefile.in --exclude=autom4te.cache --exclude=aclocal.m4 --exclude=configure --exclude=config.status --exclude=borland --exclude=config.log --exclude=.deps scorched/src/server/ServerBrowserInfo.cpp scorched-cvs/src/server/ServerBrowserInfo.cpp --- scorched/src/server/ServerBrowserInfo.cpp 2005-08-08 11:37:24.000000000 +0200 +++ scorched-cvs/src/server/ServerBrowserInfo.cpp 2005-09-22 17:14:28.000000000 +0200 @@ -166,7 +166,7 @@ reply.push_back(addTag("round", formatString("%i/%i", ScorchedServer::instance()->getOptionsTransient().getCurrentRoundNo(), ScorchedServer::instance()->getOptionsGame().getNoRounds()))); - reply.push_back(addTag("os", osDesc.c_str())); + reply.push_back(addTag("os", osDesc.mb_str(wxConvUTF8))); } void ServerBrowserInfo::processInfoMessage(std::list &reply) diff -urN --exclude=CVS --exclude=Makefile --exclude=Makefile.in --exclude=autom4te.cache --exclude=aclocal.m4 --exclude=configure --exclude=config.status --exclude=borland --exclude=config.log --exclude=.deps scorched/src/server/ServerMain.cpp scorched-cvs/src/server/ServerMain.cpp --- scorched/src/server/ServerMain.cpp 2005-06-20 02:35:08.000000000 +0200 +++ scorched-cvs/src/server/ServerMain.cpp 2005-09-22 17:14:28.000000000 +0200 @@ -121,7 +121,7 @@ ServerDefenseHandler::instance(); // Set the mod - setDataFileMod( + DefinesUtil::setDataFileMod( ScorchedServer::instance()->getOptionsGame().getMod()); // Load mod diff -urN --exclude=CVS --exclude=Makefile --exclude=Makefile.in --exclude=autom4te.cache --exclude=aclocal.m4 --exclude=configure --exclude=config.status --exclude=borland --exclude=config.log --exclude=.deps scorched/src/server/ServerMessageHandler.cpp scorched-cvs/src/server/ServerMessageHandler.cpp --- scorched/src/server/ServerMessageHandler.cpp 2005-06-20 02:35:08.000000000 +0200 +++ scorched-cvs/src/server/ServerMessageHandler.cpp 2005-09-18 12:39:34.000000000 +0200 @@ -115,6 +115,8 @@ "Player disconnected dest=\"%i\" id=\"%i\" name=\"%s\"", tank->getDestinationId(), tankId, tank->getName()); + ServerCommon::sendString(0, "Player disconnected \"%s\"", + tank->getName()); StatsLogger::instance()->tankDisconnected(tank); diff -urN --exclude=CVS --exclude=Makefile --exclude=Makefile.in --exclude=autom4te.cache --exclude=aclocal.m4 --exclude=configure --exclude=config.status --exclude=borland --exclude=config.log --exclude=.deps scorched/src/server/ServerTextFilter.cpp scorched-cvs/src/server/ServerTextFilter.cpp --- scorched/src/server/ServerTextFilter.cpp 2005-08-14 21:11:42.000000000 +0200 +++ scorched-cvs/src/server/ServerTextFilter.cpp 2005-09-22 17:14:28.000000000 +0200 @@ -86,7 +86,7 @@ for (witor = words_.begin(); witor != words_.end(); witor++) { const char *word = (*witor).c_str(); - char *pos = my_stristr(text, word); + char *pos = DefinesUtil::my_stristr(text, word); if (pos) { // If they do then * out the word @@ -149,9 +149,9 @@ const char *filename = getSettingsFile("filter-%i.txt", ScorchedServer::instance()->getOptionsGame().getPortNo()); - if (!::wxFileExists(filename)) return; + if (!::DefinesUtil::fileExists(filename)) return; - time_t fileTime = ::wxFileModificationTime(filename); + time_t fileTime = ::wxFileModificationTime(wxString(filename, wxConvUTF8)); if (fileTime == lastReadTime_) return; FileLines lines; diff -urN --exclude=CVS --exclude=Makefile --exclude=Makefile.in --exclude=autom4te.cache --exclude=aclocal.m4 --exclude=configure --exclude=config.status --exclude=borland --exclude=config.log --exclude=.deps scorched/src/server/ServerTimedMessage.cpp scorched-cvs/src/server/ServerTimedMessage.cpp --- scorched/src/server/ServerTimedMessage.cpp 2005-06-20 02:35:08.000000000 +0200 +++ scorched-cvs/src/server/ServerTimedMessage.cpp 2005-09-22 17:14:28.000000000 +0200 @@ -76,9 +76,9 @@ const char *filename = getSettingsFile("messages-%i.xml", ScorchedServer::instance()->getOptionsGame().getPortNo()); - if (!::wxFileExists(filename)) return true; + if (!DefinesUtil::fileExists(filename)) return true; - time_t fileTime = ::wxFileModificationTime(filename); + time_t fileTime = ::wxFileModificationTime(wxString(filename, wxConvUTF8)); if (fileTime == lastReadTime_) return true; XMLFile file; diff -urN --exclude=CVS --exclude=Makefile --exclude=Makefile.in --exclude=autom4te.cache --exclude=aclocal.m4 --exclude=configure --exclude=config.status --exclude=borland --exclude=config.log --exclude=.deps scorched/src/sound/Sound.cpp scorched-cvs/src/sound/Sound.cpp --- scorched/src/sound/Sound.cpp 2005-08-10 14:39:31.000000000 +0200 +++ scorched-cvs/src/sound/Sound.cpp 2005-09-18 11:59:33.000000000 +0200 @@ -86,6 +86,11 @@ instance_ = 0; } +static char *checkString(char *x) +{ + return (char *)(x?x:"null"); +} + bool Sound::init(int channels) { ALCdevice *soundDevice = alcOpenDevice(0); @@ -113,16 +118,20 @@ alDistanceModel(AL_INVERSE_DISTANCE); GLConsole::instance()->addLine(false, "AL_VENDOR:"); - GLConsole::instance()->addLine(false, (char *) alGetString(AL_VENDOR)); + GLConsole::instance()->addLine(false, + checkString((char *) alGetString(AL_VENDOR))); GLConsole::instance()->addLine(false, "AL_VERSION:"); - GLConsole::instance()->addLine(false, (char *) alGetString(AL_VERSION)); + GLConsole::instance()->addLine(false, + checkString((char *) alGetString(AL_VERSION))); GLConsole::instance()->addLine(false, "AL_RENDERER:"); - GLConsole::instance()->addLine(false, (char *) alGetString(AL_RENDERER)); + GLConsole::instance()->addLine(false, + checkString((char *) alGetString(AL_RENDERER))); GLConsole::instance()->addLine(false, "AL_EXTENSIONS:"); - GLConsole::instance()->addLine(false, (char *) alGetString(AL_EXTENSIONS)); + GLConsole::instance()->addLine(false, + checkString((char *) alGetString(AL_EXTENSIONS))); GLConsole::instance()->addLine(false, "ALC_DEVICE_SPECIFIER:"); - GLConsole::instance()->addLine(false, (char *) - alcGetString(soundDevice, ALC_DEVICE_SPECIFIER)); + GLConsole::instance()->addLine(false, + checkString((char *) alcGetString(soundDevice, ALC_DEVICE_SPECIFIER))); // Create all sound channels for (int i=1; i<=OptionsDisplay::instance()->getSoundChannels(); i++) diff -urN --exclude=CVS --exclude=Makefile --exclude=Makefile.in --exclude=autom4te.cache --exclude=aclocal.m4 --exclude=configure --exclude=config.status --exclude=borland --exclude=config.log --exclude=.deps scorched/src/sound/SoundBuffer.cpp scorched-cvs/src/sound/SoundBuffer.cpp --- scorched/src/sound/SoundBuffer.cpp 2005-07-18 00:27:13.000000000 +0200 +++ scorched-cvs/src/sound/SoundBuffer.cpp 2005-09-18 11:59:33.000000000 +0200 @@ -55,7 +55,13 @@ ALsizei size; ALsizei freq; ALboolean loop; + +#ifdef __DARWIN__ + alutLoadWAVFile((ALbyte*) wavFileName,&format,&data,&size,&freq); +#else alutLoadWAVFile((ALbyte*) wavFileName,&format,&data,&size,&freq,&loop); +#endif + if ((error_ = alGetError()) != AL_NO_ERROR) { return false; diff -urN --exclude=CVS --exclude=Makefile --exclude=Makefile.in --exclude=autom4te.cache --exclude=aclocal.m4 --exclude=configure --exclude=config.status --exclude=borland --exclude=config.log --exclude=.deps scorched/src/sprites/ExplosionNukeRenderer.cpp scorched-cvs/src/sprites/ExplosionNukeRenderer.cpp --- scorched/src/sprites/ExplosionNukeRenderer.cpp 2005-07-11 01:41:56.000000000 +0200 +++ scorched-cvs/src/sprites/ExplosionNukeRenderer.cpp 2005-09-22 17:14:28.000000000 +0200 @@ -38,8 +38,8 @@ float width = RAND * 0.5f + 1.0f; cloudRotation_ = RAND * 360.0f; - rotation_[0] = getFastSin(rot) * width; - rotation_[1] = getFastCos(rot) * width; + rotation_[0] = DefinesUtil::getFastSin(rot) * width; + rotation_[1] = DefinesUtil::getFastCos(rot) * width; } ExplosionNukeRendererEntry::~ExplosionNukeRendererEntry() diff -urN --exclude=CVS --exclude=Makefile --exclude=Makefile.in --exclude=autom4te.cache --exclude=aclocal.m4 --exclude=configure --exclude=config.status --exclude=borland --exclude=config.log --exclude=.deps scorched/src/sprites/ExplosionTextures.cpp scorched-cvs/src/sprites/ExplosionTextures.cpp --- scorched/src/sprites/ExplosionTextures.cpp 2004-11-22 22:30:40.000000000 +0100 +++ scorched-cvs/src/sprites/ExplosionTextures.cpp 2005-09-22 17:14:28.000000000 +0200 @@ -194,7 +194,7 @@ } const char *fileName = getDataFile(name); - if (fileExists(fileName)) + if (DefinesUtil::fileExists(fileName)) { GLBitmap *map = new GLBitmap; if (map->loadFromFile(fileName, false)) diff -urN --exclude=CVS --exclude=Makefile --exclude=Makefile.in --exclude=autom4te.cache --exclude=aclocal.m4 --exclude=configure --exclude=config.status --exclude=borland --exclude=config.log --exclude=.deps scorched/src/tankgraph/MissileMesh.cpp scorched-cvs/src/tankgraph/MissileMesh.cpp --- scorched/src/tankgraph/MissileMesh.cpp 2005-07-11 01:41:56.000000000 +0200 +++ scorched-cvs/src/tankgraph/MissileMesh.cpp 2005-09-22 17:14:28.000000000 +0200 @@ -103,11 +103,19 @@ Vector &fpos = (*flareItor); float newX = fpos[0]; - float newY = (fpos[1] * getFastCos(angYZRad)) - (fpos[2] * getFastSin(angYZRad)); - float newZ = (fpos[1] * getFastSin(angYZRad)) + (fpos[2] * getFastCos(angYZRad)); + float newY = + (fpos[1] * DefinesUtil::getFastCos(angYZRad)) - + (fpos[2] * DefinesUtil::getFastSin(angYZRad)); + float newZ = + (fpos[1] * DefinesUtil::getFastSin(angYZRad)) + + (fpos[2] * DefinesUtil::getFastCos(angYZRad)); - float newX2 = (newX * getFastCos(angXYRad)) - (newY * getFastSin(angXYRad)); - float newY2 = (newX * getFastSin(angXYRad)) + (newY * getFastCos(angXYRad)); + float newX2 = + (newX * DefinesUtil::getFastCos(angXYRad)) - + (newY * DefinesUtil::getFastSin(angXYRad)); + float newY2 = + (newX * DefinesUtil::getFastSin(angXYRad)) + + (newY * DefinesUtil::getFastCos(angXYRad)); float newZ2 = newZ; Vector newPos; diff -urN --exclude=CVS --exclude=Makefile --exclude=Makefile.in --exclude=autom4te.cache --exclude=aclocal.m4 --exclude=configure --exclude=config.status --exclude=borland --exclude=config.log --exclude=.deps scorched/src/weapons/WeaponTeleport.cpp scorched-cvs/src/weapons/WeaponTeleport.cpp --- scorched/src/weapons/WeaponTeleport.cpp 2005-06-11 18:53:41.000000000 +0200 +++ scorched-cvs/src/weapons/WeaponTeleport.cpp 2005-09-22 17:14:28.000000000 +0200 @@ -65,8 +65,8 @@ bool found = false; while (!found) { - position[0] = RAND * 255.0f; - position[1] = RAND * 255.0f; + position[0] = RAND * 235.0f + 10.0f; + position[1] = RAND * 235.0f + 10.0f; float height = context.landscapeMaps->getHMap().getInterpHeight( position[0], position[1]); if (height > allowedHeight) break;