1
0
forked from 0ad/0ad

Fix compilation of Atlas on UNICODE BUILDS

Patch by: @madpilot
Tested by: nwtour
Differential Revision: https://code.wildfiregames.com/D1593
This was SVN commit r24970.
This commit is contained in:
Stan 2021-03-01 23:32:23 +00:00
parent f3aedf88a6
commit ac72fb4486
2 changed files with 11 additions and 11 deletions

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2019 Wildfire Games.
/* Copyright (C) 2021 Wildfire Games.
* This file is part of 0 A.D.
*
* 0 A.D. is free software: you can redistribute it and/or modify
@ -166,11 +166,11 @@ void MapDialog::OnListBox(wxCommandEvent& evt)
else
{
wxString filePath = GetSelectedFilePath();
AtlasMessage::qVFSFileExists fileExistsQuery(filePath.wc_str());
AtlasMessage::qVFSFileExists fileExistsQuery(filePath.ToStdWstring());
fileExistsQuery.Post();
if (!filePath.IsEmpty() && fileExistsQuery.exists)
{
AtlasMessage::qVFSFileRealPath pathQuery(filePath.wc_str());
AtlasMessage::qVFSFileRealPath pathQuery(filePath.ToStdWstring());
pathQuery.Post();
wxDynamicCast(FindWindow(ID_MapDialogFilename), wxTextCtrl)->ChangeValue(*pathQuery.realPath);
}
@ -221,7 +221,7 @@ void MapDialog::OpenFile()
if (filePath.empty())
return;
AtlasMessage::qVFSFileExists qry(filePath.wc_str());
AtlasMessage::qVFSFileExists qry(filePath.ToStdWstring());
qry.Post();
if (!qry.exists)
return;
@ -236,7 +236,7 @@ void MapDialog::SaveFile()
return;
// TODO: this test would work better outside the VFS
AtlasMessage::qVFSFileExists qry(filePath.wc_str());
AtlasMessage::qVFSFileExists qry(filePath.ToStdWstring());
qry.Post();
if (qry.exists)
{

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2020 Wildfire Games.
/* Copyright (C) 2021 Wildfire Games.
* This file is part of 0 A.D.
*
* 0 A.D. is free software: you can redistribute it and/or modify
@ -748,7 +748,7 @@ bool ScenarioEditor::OpenFile(const wxString& name, const wxString& filename)
wxBusyInfo busy(_("Loading ") + name);
wxBusyCursor busyc;
AtlasMessage::qVFSFileExists qry(filename.wc_str());
AtlasMessage::qVFSFileExists qry(filename.ToStdWstring());
qry.Post();
if (!qry.exists)
return false;
@ -758,7 +758,7 @@ bool ScenarioEditor::OpenFile(const wxString& name, const wxString& filename)
m_ToolManager.SetCurrentTool(_T(""));
// TODO: clear the undo buffer, etc
std::wstring map(filename.wc_str());
std::wstring map(filename.ToStdWstring());
POST_MESSAGE(LoadMap, (map));
SetOpenFilename(name);
@ -811,7 +811,7 @@ void ScenarioEditor::OnImportHeightmap(wxCommandEvent& WXUNUSED(event))
OpenFile(_T(""), _T("maps/scenarios/_default.xml"));
std::wstring image(dlg.GetPath().wc_str());
std::wstring image(dlg.GetPath().ToStdWstring());
POST_MESSAGE(ImportHeightmap, (image));
// TODO: Make this a non-undoable command
@ -855,7 +855,7 @@ void ScenarioEditor::OnSave(wxCommandEvent& event)
// the preview units.)
m_ToolManager.SetCurrentTool(_T(""));
std::wstring map(m_OpenFilename.wc_str());
std::wstring map(m_OpenFilename.ToStdWstring());
POST_MESSAGE(SaveMap, (map));
// Wait for it to finish saving
@ -877,7 +877,7 @@ void ScenarioEditor::OnSaveAs(wxCommandEvent& WXUNUSED(event))
m_ToolManager.SetCurrentTool(_T(""));
std::wstring map(filePath.wc_str());
std::wstring map(filePath.ToStdWstring());
POST_MESSAGE(SaveMap, (map));
SetOpenFilename(filePath);