- bugfixes from windows unicode work to compile in Linux
This commit is contained in:
parent
1085f24c6f
commit
adb7ec4a6a
|
@ -235,13 +235,15 @@ void IntField::createControl(wxWindow *parent, wxSizer *sizer){
|
||||||
|
|
||||||
void IntField::updateValue(){
|
void IntField::updateValue(){
|
||||||
//#if defined(__MINGW32__)
|
//#if defined(__MINGW32__)
|
||||||
const wxWX2MBbuf tmp_buf = wxConvCurrent->cWX2MB(wxFNCONV(textCtrl->GetValue()));
|
#ifdef WIN32
|
||||||
value = tmp_buf;
|
const wxWX2MBbuf tmp_buf = wxConvCurrent->cWX2MB(wxFNCONV(textCtrl->GetValue()));
|
||||||
|
value = tmp_buf;
|
||||||
|
|
||||||
#ifdef WIN32
|
std::auto_ptr<wchar_t> wstr(Ansi2WideString(value.c_str()));
|
||||||
std::auto_ptr<wchar_t> wstr(Ansi2WideString(value.c_str()));
|
value = utf8_encode(wstr.get());
|
||||||
value = utf8_encode(wstr.get());
|
#else
|
||||||
#endif
|
value= (const char*)wxFNCONV(textCtrl->GetValue());
|
||||||
|
#endif
|
||||||
|
|
||||||
//#else
|
//#else
|
||||||
//value= (const char*)wxFNCONV(textCtrl->GetValue());
|
//value= (const char*)wxFNCONV(textCtrl->GetValue());
|
||||||
|
@ -274,12 +276,15 @@ void FloatField::createControl(wxWindow *parent, wxSizer *sizer){
|
||||||
void FloatField::updateValue(){
|
void FloatField::updateValue(){
|
||||||
|
|
||||||
//#if defined(__MINGW32__)
|
//#if defined(__MINGW32__)
|
||||||
const wxWX2MBbuf tmp_buf = wxConvCurrent->cWX2MB(wxFNCONV(textCtrl->GetValue()));
|
#ifdef WIN32
|
||||||
value = tmp_buf;
|
const wxWX2MBbuf tmp_buf = wxConvCurrent->cWX2MB(wxFNCONV(textCtrl->GetValue()));
|
||||||
#ifdef WIN32
|
value = tmp_buf;
|
||||||
std::auto_ptr<wchar_t> wstr(Ansi2WideString(value.c_str()));
|
|
||||||
value = utf8_encode(wstr.get());
|
std::auto_ptr<wchar_t> wstr(Ansi2WideString(value.c_str()));
|
||||||
#endif
|
value = utf8_encode(wstr.get());
|
||||||
|
#else
|
||||||
|
value= (const char*)wxFNCONV(textCtrl->GetValue());
|
||||||
|
#endif
|
||||||
|
|
||||||
//#else
|
//#else
|
||||||
// value= (const char*)wxFNCONV(textCtrl->GetValue());
|
// value= (const char*)wxFNCONV(textCtrl->GetValue());
|
||||||
|
@ -313,12 +318,15 @@ void StringField::createControl(wxWindow *parent, wxSizer *sizer){
|
||||||
void StringField::updateValue(){
|
void StringField::updateValue(){
|
||||||
|
|
||||||
//#if defined(__MINGW32__)
|
//#if defined(__MINGW32__)
|
||||||
const wxWX2MBbuf tmp_buf = wxConvCurrent->cWX2MB(wxFNCONV(textCtrl->GetValue()));
|
#ifdef WIN32
|
||||||
value = tmp_buf;
|
const wxWX2MBbuf tmp_buf = wxConvCurrent->cWX2MB(wxFNCONV(textCtrl->GetValue()));
|
||||||
#ifdef WIN32
|
value = tmp_buf;
|
||||||
std::auto_ptr<wchar_t> wstr(Ansi2WideString(value.c_str()));
|
|
||||||
value = utf8_encode(wstr.get());
|
std::auto_ptr<wchar_t> wstr(Ansi2WideString(value.c_str()));
|
||||||
#endif
|
value = utf8_encode(wstr.get());
|
||||||
|
#else
|
||||||
|
value= (const char*)wxFNCONV(textCtrl->GetValue());
|
||||||
|
#endif
|
||||||
|
|
||||||
//#else
|
//#else
|
||||||
// value= (const char*)wxFNCONV(textCtrl->GetValue());
|
// value= (const char*)wxFNCONV(textCtrl->GetValue());
|
||||||
|
@ -348,13 +356,16 @@ void EnumField::createControl(wxWindow *parent, wxSizer *sizer){
|
||||||
|
|
||||||
void EnumField::updateValue(){
|
void EnumField::updateValue(){
|
||||||
//#if defined(__MINGW32__)
|
//#if defined(__MINGW32__)
|
||||||
const wxWX2MBbuf tmp_buf = wxConvCurrent->cWX2MB(wxFNCONV(comboBox->GetValue()));
|
|
||||||
value = tmp_buf;
|
|
||||||
|
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
std::auto_ptr<wchar_t> wstr(Ansi2WideString(value.c_str()));
|
const wxWX2MBbuf tmp_buf = wxConvCurrent->cWX2MB(wxFNCONV(comboBox->GetValue()));
|
||||||
value = utf8_encode(wstr.get());
|
value = tmp_buf;
|
||||||
#endif
|
|
||||||
|
std::auto_ptr<wchar_t> wstr(Ansi2WideString(value.c_str()));
|
||||||
|
value = utf8_encode(wstr.get());
|
||||||
|
#else
|
||||||
|
value= (const char*)wxFNCONV(comboBox->GetValue());
|
||||||
|
#endif
|
||||||
|
|
||||||
//#else
|
//#else
|
||||||
// value= (const char*)wxFNCONV(comboBox->GetValue());
|
// value= (const char*)wxFNCONV(comboBox->GetValue());
|
||||||
|
@ -428,13 +439,16 @@ void FloatRangeField::createControl(wxWindow *parent, wxSizer *sizer){
|
||||||
|
|
||||||
void FloatRangeField::updateValue(){
|
void FloatRangeField::updateValue(){
|
||||||
//#if defined(__MINGW32__)
|
//#if defined(__MINGW32__)
|
||||||
const wxWX2MBbuf tmp_buf = wxConvCurrent->cWX2MB(wxFNCONV(textCtrl->GetValue()));
|
|
||||||
value = tmp_buf;
|
|
||||||
|
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
std::auto_ptr<wchar_t> wstr(Ansi2WideString(value.c_str()));
|
const wxWX2MBbuf tmp_buf = wxConvCurrent->cWX2MB(wxFNCONV(textCtrl->GetValue()));
|
||||||
value = utf8_encode(wstr.get());
|
value = tmp_buf;
|
||||||
#endif
|
|
||||||
|
std::auto_ptr<wchar_t> wstr(Ansi2WideString(value.c_str()));
|
||||||
|
value = utf8_encode(wstr.get());
|
||||||
|
#else
|
||||||
|
value= (const char*)wxFNCONV(textCtrl->GetValue());
|
||||||
|
#endif
|
||||||
|
|
||||||
//#else
|
//#else
|
||||||
// value= (const char*)wxFNCONV(textCtrl->GetValue());
|
// value= (const char*)wxFNCONV(textCtrl->GetValue());
|
||||||
|
|
|
@ -213,12 +213,15 @@ bool App::OnInit(){
|
||||||
string appPath = "";
|
string appPath = "";
|
||||||
wxString exe_path = wxStandardPaths::Get().GetExecutablePath();
|
wxString exe_path = wxStandardPaths::Get().GetExecutablePath();
|
||||||
|
|
||||||
|
#ifdef WIN32
|
||||||
const wxWX2MBbuf tmp_buf = wxConvCurrent->cWX2MB(wxFNCONV(exe_path));
|
const wxWX2MBbuf tmp_buf = wxConvCurrent->cWX2MB(wxFNCONV(exe_path));
|
||||||
appPath = tmp_buf;
|
appPath = tmp_buf;
|
||||||
#ifdef WIN32
|
|
||||||
std::auto_ptr<wchar_t> wstr(Ansi2WideString(appPath.c_str()));
|
std::auto_ptr<wchar_t> wstr(Ansi2WideString(appPath.c_str()));
|
||||||
appPath = utf8_encode(wstr.get());
|
appPath = utf8_encode(wstr.get());
|
||||||
#endif
|
#else
|
||||||
|
appPath = wxFNCONV(exe_path);
|
||||||
|
#endif
|
||||||
|
|
||||||
//#if defined(__MINGW32__)
|
//#if defined(__MINGW32__)
|
||||||
// const wxWX2MBbuf tmp_buf = wxConvCurrent->cWX2MB(wxFNCONV(exe_path));
|
// const wxWX2MBbuf tmp_buf = wxConvCurrent->cWX2MB(wxFNCONV(exe_path));
|
||||||
|
|
|
@ -14,6 +14,10 @@
|
||||||
#include "game_constants.h"
|
#include "game_constants.h"
|
||||||
#include <wx/stdpaths.h>
|
#include <wx/stdpaths.h>
|
||||||
#include <platform_util.h>
|
#include <platform_util.h>
|
||||||
|
#ifndef WIN32
|
||||||
|
#include <errno.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
//#include <wx/filename.h>
|
//#include <wx/filename.h>
|
||||||
|
|
||||||
#ifndef WIN32
|
#ifndef WIN32
|
||||||
|
@ -670,12 +674,16 @@ void MainWindow::onMenuFileLoad(wxCommandEvent &event){
|
||||||
|
|
||||||
if(fileDialog->ShowModal()==wxID_OK){
|
if(fileDialog->ShowModal()==wxID_OK){
|
||||||
modelPathList.clear();
|
modelPathList.clear();
|
||||||
|
string file = "";
|
||||||
|
#ifdef WIN32
|
||||||
const wxWX2MBbuf tmp_buf = wxConvCurrent->cWX2MB(fileDialog->GetPath());
|
const wxWX2MBbuf tmp_buf = wxConvCurrent->cWX2MB(fileDialog->GetPath());
|
||||||
string file = tmp_buf;
|
file = tmp_buf;
|
||||||
#ifdef WIN32
|
|
||||||
std::auto_ptr<wchar_t> wstr(Ansi2WideString(file.c_str()));
|
std::auto_ptr<wchar_t> wstr(Ansi2WideString(file.c_str()));
|
||||||
file = utf8_encode(wstr.get());
|
file = utf8_encode(wstr.get());
|
||||||
#endif
|
#else
|
||||||
|
file = (const char*)wxFNCONV(fileDialog->GetPath().c_str());
|
||||||
|
#endif
|
||||||
|
|
||||||
//loadModel((const char*)wxFNCONV(fileDialog->GetPath().c_str()));
|
//loadModel((const char*)wxFNCONV(fileDialog->GetPath().c_str()));
|
||||||
loadModel(file);
|
loadModel(file);
|
||||||
|
@ -702,12 +710,15 @@ void MainWindow::onMenuFileLoadParticleXML(wxCommandEvent &event){
|
||||||
|
|
||||||
if(fileDialog->ShowModal()==wxID_OK){
|
if(fileDialog->ShowModal()==wxID_OK){
|
||||||
//string path = (const char*)wxFNCONV(fileDialog->GetPath().c_str());
|
//string path = (const char*)wxFNCONV(fileDialog->GetPath().c_str());
|
||||||
|
string file = "";
|
||||||
|
#ifdef WIN32
|
||||||
const wxWX2MBbuf tmp_buf = wxConvCurrent->cWX2MB(fileDialog->GetPath());
|
const wxWX2MBbuf tmp_buf = wxConvCurrent->cWX2MB(fileDialog->GetPath());
|
||||||
string file = tmp_buf;
|
file = tmp_buf;
|
||||||
#ifdef WIN32
|
|
||||||
std::auto_ptr<wchar_t> wstr(Ansi2WideString(file.c_str()));
|
std::auto_ptr<wchar_t> wstr(Ansi2WideString(file.c_str()));
|
||||||
file = utf8_encode(wstr.get());
|
file = utf8_encode(wstr.get());
|
||||||
#endif
|
#else
|
||||||
|
file = (const char*)wxFNCONV(fileDialog->GetPath().c_str());
|
||||||
|
#endif
|
||||||
|
|
||||||
loadParticle(file);
|
loadParticle(file);
|
||||||
}
|
}
|
||||||
|
@ -733,12 +744,15 @@ void MainWindow::onMenuFileLoadProjectileParticleXML(wxCommandEvent &event){
|
||||||
|
|
||||||
if(fileDialog->ShowModal()==wxID_OK){
|
if(fileDialog->ShowModal()==wxID_OK){
|
||||||
//string path = (const char*)wxFNCONV(fileDialog->GetPath().c_str());
|
//string path = (const char*)wxFNCONV(fileDialog->GetPath().c_str());
|
||||||
|
string file = "";
|
||||||
|
#ifdef WIN32
|
||||||
const wxWX2MBbuf tmp_buf = wxConvCurrent->cWX2MB(fileDialog->GetPath());
|
const wxWX2MBbuf tmp_buf = wxConvCurrent->cWX2MB(fileDialog->GetPath());
|
||||||
string file = tmp_buf;
|
file = tmp_buf;
|
||||||
#ifdef WIN32
|
|
||||||
std::auto_ptr<wchar_t> wstr(Ansi2WideString(file.c_str()));
|
std::auto_ptr<wchar_t> wstr(Ansi2WideString(file.c_str()));
|
||||||
file = utf8_encode(wstr.get());
|
file = utf8_encode(wstr.get());
|
||||||
#endif
|
#else
|
||||||
|
file = (const char*)wxFNCONV(fileDialog->GetPath().c_str());
|
||||||
|
#endif
|
||||||
|
|
||||||
loadProjectileParticle(file);
|
loadProjectileParticle(file);
|
||||||
}
|
}
|
||||||
|
@ -764,12 +778,16 @@ void MainWindow::onMenuFileLoadSplashParticleXML(wxCommandEvent &event){
|
||||||
|
|
||||||
if(fileDialog->ShowModal()==wxID_OK){
|
if(fileDialog->ShowModal()==wxID_OK){
|
||||||
//string path = (const char*)wxFNCONV(fileDialog->GetPath().c_str());
|
//string path = (const char*)wxFNCONV(fileDialog->GetPath().c_str());
|
||||||
|
string file = "";
|
||||||
|
#ifdef WIN32
|
||||||
const wxWX2MBbuf tmp_buf = wxConvCurrent->cWX2MB(fileDialog->GetPath());
|
const wxWX2MBbuf tmp_buf = wxConvCurrent->cWX2MB(fileDialog->GetPath());
|
||||||
string file = tmp_buf;
|
file = tmp_buf;
|
||||||
#ifdef WIN32
|
|
||||||
std::auto_ptr<wchar_t> wstr(Ansi2WideString(file.c_str()));
|
std::auto_ptr<wchar_t> wstr(Ansi2WideString(file.c_str()));
|
||||||
file = utf8_encode(wstr.get());
|
file = utf8_encode(wstr.get());
|
||||||
#endif
|
#else
|
||||||
|
file = (const char*)wxFNCONV(fileDialog->GetPath().c_str());
|
||||||
|
#endif
|
||||||
|
|
||||||
loadSplashParticle(file);
|
loadSplashParticle(file);
|
||||||
}
|
}
|
||||||
|
@ -2190,12 +2208,14 @@ bool App::OnInit() {
|
||||||
if(argc == 2 && argv[1][0] != '-') {
|
if(argc == 2 && argv[1][0] != '-') {
|
||||||
|
|
||||||
//#if defined(__MINGW32__)
|
//#if defined(__MINGW32__)
|
||||||
|
#ifdef WIN32
|
||||||
const wxWX2MBbuf tmp_buf = wxConvCurrent->cWX2MB(wxFNCONV(argv[1]));
|
const wxWX2MBbuf tmp_buf = wxConvCurrent->cWX2MB(wxFNCONV(argv[1]));
|
||||||
modelPath = tmp_buf;
|
modelPath = tmp_buf;
|
||||||
#ifdef WIN32
|
|
||||||
std::auto_ptr<wchar_t> wstr(Ansi2WideString(modelPath.c_str()));
|
std::auto_ptr<wchar_t> wstr(Ansi2WideString(modelPath.c_str()));
|
||||||
modelPath = utf8_encode(wstr.get());
|
modelPath = utf8_encode(wstr.get());
|
||||||
#endif
|
#else
|
||||||
|
modelPath = wxFNCONV(argv[1]);
|
||||||
|
#endif
|
||||||
|
|
||||||
//#else
|
//#else
|
||||||
// modelPath = wxFNCONV(argv[1]);
|
// modelPath = wxFNCONV(argv[1]);
|
||||||
|
@ -2219,12 +2239,15 @@ bool App::OnInit() {
|
||||||
//exe_path += path_separator;
|
//exe_path += path_separator;
|
||||||
|
|
||||||
//#if defined(__MINGW32__)
|
//#if defined(__MINGW32__)
|
||||||
const wxWX2MBbuf tmp_buf = wxConvCurrent->cWX2MB(wxFNCONV(exe_path));
|
#ifdef WIN32
|
||||||
appPath = tmp_buf;
|
const wxWX2MBbuf tmp_buf = wxConvCurrent->cWX2MB(wxFNCONV(exe_path));
|
||||||
#ifdef WIN32
|
appPath = tmp_buf;
|
||||||
std::auto_ptr<wchar_t> wstr(Ansi2WideString(appPath.c_str()));
|
|
||||||
appPath = utf8_encode(wstr.get());
|
std::auto_ptr<wchar_t> wstr(Ansi2WideString(appPath.c_str()));
|
||||||
#endif
|
appPath = utf8_encode(wstr.get());
|
||||||
|
#else
|
||||||
|
appPath = wxFNCONV(exe_path);
|
||||||
|
#endif
|
||||||
|
|
||||||
//#else
|
//#else
|
||||||
// appPath = wxFNCONV(exe_path);
|
// appPath = wxFNCONV(exe_path);
|
||||||
|
|
|
@ -2531,6 +2531,21 @@ int glestMain(int argc, char** argv) {
|
||||||
|
|
||||||
lang.loadStrings(language);
|
lang.loadStrings(language);
|
||||||
|
|
||||||
|
if( lang.hasString("FONT_CHARCOUNT") &&
|
||||||
|
lang.hasString("FONT_TYPENAME") &&
|
||||||
|
lang.hasString("FONT_CHARSET")) {
|
||||||
|
// 256 for English
|
||||||
|
// 30000 for Chinese
|
||||||
|
Font::charCount = strToInt(lang.get("FONT_CHARCOUNT"));
|
||||||
|
Font::fontTypeName = lang.get("FONT_TYPENAME");
|
||||||
|
// Example values:
|
||||||
|
// DEFAULT_CHARSET (English) = 1
|
||||||
|
// GB2312_CHARSET (Chinese) = 134
|
||||||
|
Shared::Platform::charSet = strToInt(lang.get("FONT_CHARSET"));
|
||||||
|
}
|
||||||
|
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d] Font::charCount = %d, Font::fontTypeName [%s] Shared::Platform::charSet = %d\n",__FILE__,__FUNCTION__,__LINE__,Font::charCount,Font::fontTypeName.c_str(),Shared::Platform::charSet);
|
||||||
|
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("Using Font::charCount = %d, Font::fontTypeName [%s] Shared::Platform::charSet = %d\n",Font::charCount,Font::fontTypeName.c_str(),Shared::Platform::charSet);
|
||||||
|
|
||||||
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
|
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
|
||||||
|
|
||||||
if(hasCommandArgument(argc, argv,GAME_ARGS[GAME_ARG_SHOW_MAP_CRC]) == true) {
|
if(hasCommandArgument(argc, argv,GAME_ARGS[GAME_ARG_SHOW_MAP_CRC]) == true) {
|
||||||
|
|
|
@ -18,6 +18,9 @@
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include"platform_util.h"
|
#include"platform_util.h"
|
||||||
#include <wx/stdpaths.h>
|
#include <wx/stdpaths.h>
|
||||||
|
#ifndef WIN32
|
||||||
|
#include <errno.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
using namespace Shared::Util;
|
using namespace Shared::Util;
|
||||||
using namespace Shared::PlatformCommon;
|
using namespace Shared::PlatformCommon;
|
||||||
|
@ -580,11 +583,14 @@ void MainWindow::onMenuFileLoad(wxCommandEvent &event) {
|
||||||
fileDialog->SetMessage(wxT("Select Glestmap to load"));
|
fileDialog->SetMessage(wxT("Select Glestmap to load"));
|
||||||
fileDialog->SetWildcard(wxT("Glest&Mega Map (*.gbm *.mgm)|*.gbm;*.mgm|Glest Map (*.gbm)|*.gbm|Mega Map (*.mgm)|*.mgm"));
|
fileDialog->SetWildcard(wxT("Glest&Mega Map (*.gbm *.mgm)|*.gbm;*.mgm|Glest Map (*.gbm)|*.gbm|Mega Map (*.mgm)|*.mgm"));
|
||||||
if (fileDialog->ShowModal() == wxID_OK) {
|
if (fileDialog->ShowModal() == wxID_OK) {
|
||||||
|
#ifdef WIN32
|
||||||
const wxWX2MBbuf tmp_buf = wxConvCurrent->cWX2MB(wxFNCONV(fileDialog->GetPath()));
|
const wxWX2MBbuf tmp_buf = wxConvCurrent->cWX2MB(wxFNCONV(fileDialog->GetPath()));
|
||||||
currentFile = tmp_buf;
|
currentFile = tmp_buf;
|
||||||
#ifdef WIN32
|
|
||||||
std::auto_ptr<wchar_t> wstr(Ansi2WideString(currentFile.c_str()));
|
std::auto_ptr<wchar_t> wstr(Ansi2WideString(currentFile.c_str()));
|
||||||
currentFile = utf8_encode(wstr.get());
|
currentFile = utf8_encode(wstr.get());
|
||||||
|
#else
|
||||||
|
currentFile = fileDialog->GetPath().ToAscii();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
program->loadMap(currentFile);
|
program->loadMap(currentFile);
|
||||||
|
@ -645,11 +651,14 @@ void MainWindow::onMenuFileSaveAs(wxCommandEvent &event) {
|
||||||
|
|
||||||
fd.SetWildcard(wxT("Glest Map (*.gbm)|*.gbm|MegaGlest Map (*.mgm)|*.mgm"));
|
fd.SetWildcard(wxT("Glest Map (*.gbm)|*.gbm|MegaGlest Map (*.mgm)|*.mgm"));
|
||||||
if (fd.ShowModal() == wxID_OK) {
|
if (fd.ShowModal() == wxID_OK) {
|
||||||
|
#ifdef WIN32
|
||||||
const wxWX2MBbuf tmp_buf = wxConvCurrent->cWX2MB(wxFNCONV(fd.GetPath()));
|
const wxWX2MBbuf tmp_buf = wxConvCurrent->cWX2MB(wxFNCONV(fd.GetPath()));
|
||||||
currentFile = tmp_buf;
|
currentFile = tmp_buf;
|
||||||
#ifdef WIN32
|
|
||||||
std::auto_ptr<wchar_t> wstr(Ansi2WideString(currentFile.c_str()));
|
std::auto_ptr<wchar_t> wstr(Ansi2WideString(currentFile.c_str()));
|
||||||
currentFile = utf8_encode(wstr.get());
|
currentFile = utf8_encode(wstr.get());
|
||||||
|
#else
|
||||||
|
currentFile = fd.GetPath().ToAscii();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
fileDialog->SetPath(fd.GetPath());
|
fileDialog->SetPath(fd.GetPath());
|
||||||
|
@ -1402,8 +1411,12 @@ bool SimpleDialog::show(const string &title, bool wide) {
|
||||||
if(m_returnCode==wxID_CANCEL) return false; // don't change values if canceled
|
if(m_returnCode==wxID_CANCEL) return false; // don't change values if canceled
|
||||||
|
|
||||||
for (unsigned int i = 0; i < texts.size(); ++i) {
|
for (unsigned int i = 0; i < texts.size(); ++i) {
|
||||||
|
#ifdef WIN32
|
||||||
const wxWX2MBbuf tmp_buf = wxConvCurrent->cWX2MB(wxFNCONV(texts[i]->GetValue()));
|
const wxWX2MBbuf tmp_buf = wxConvCurrent->cWX2MB(wxFNCONV(texts[i]->GetValue()));
|
||||||
values[i].second = tmp_buf;
|
values[i].second = tmp_buf;
|
||||||
|
#else
|
||||||
|
values[i].second = texts[i]->GetValue().ToAscii();
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -1452,12 +1465,15 @@ bool App::OnInit() {
|
||||||
|
|
||||||
string appPath = "";
|
string appPath = "";
|
||||||
//#if defined(__MINGW32__)
|
//#if defined(__MINGW32__)
|
||||||
const wxWX2MBbuf tmp_buf = wxConvCurrent->cWX2MB(wxFNCONV(exe_path));
|
|
||||||
appPath = tmp_buf;
|
|
||||||
|
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
std::auto_ptr<wchar_t> wstr(Ansi2WideString(appPath.c_str()));
|
const wxWX2MBbuf tmp_buf = wxConvCurrent->cWX2MB(wxFNCONV(exe_path));
|
||||||
appPath = utf8_encode(wstr.get());
|
appPath = tmp_buf;
|
||||||
|
|
||||||
|
std::auto_ptr<wchar_t> wstr(Ansi2WideString(appPath.c_str()));
|
||||||
|
appPath = utf8_encode(wstr.get());
|
||||||
|
#else
|
||||||
|
appPath = wxFNCONV(exe_path);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
//#else
|
//#else
|
||||||
|
|
|
@ -18,6 +18,10 @@
|
||||||
#include "platform_util.h"
|
#include "platform_util.h"
|
||||||
#include "conversion.h"
|
#include "conversion.h"
|
||||||
|
|
||||||
|
#ifndef WIN32
|
||||||
|
#include <errno.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
using namespace Shared::Util;
|
using namespace Shared::Util;
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
|
|
|
@ -65,6 +65,7 @@ void Properties::load(const string &path, bool clearCurrentProperties) {
|
||||||
while(!fileStream.eof()){
|
while(!fileStream.eof()){
|
||||||
fileStream.getline(lineBuffer, maxLine);
|
fileStream.getline(lineBuffer, maxLine);
|
||||||
lineBuffer[maxLine-1]='\0';
|
lineBuffer[maxLine-1]='\0';
|
||||||
|
//printf("\n[%s]\n",lineBuffer);
|
||||||
|
|
||||||
//process line if it it not a comment
|
//process line if it it not a comment
|
||||||
if(lineBuffer[0]!=';'){
|
if(lineBuffer[0]!=';'){
|
||||||
|
|
|
@ -30,6 +30,10 @@
|
||||||
#include "conversion.h"
|
#include "conversion.h"
|
||||||
#include "simple_threads.h"
|
#include "simple_threads.h"
|
||||||
#include "platform_util.h"
|
#include "platform_util.h"
|
||||||
|
#ifndef WIN32
|
||||||
|
#include <errno.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "leak_dumper.h"
|
#include "leak_dumper.h"
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
Loading…
Reference in New Issue