-
From 30a25a3c3d1dabde851cba9086baaa2cf1160f61 Mon Sep 17 00:00:00 2001
From: Philip Taylor <philip@zaynar.co.uk>
Date: Tue, 20 Jan 2015 23:16:17 +0000
Subject: [PATCH 10/13] Automatically convert most path.string().c_str() to
path.string8()
Done with:
ag -l 'LOG.*string\(\).c_str\(\)' source | xargs perl -pi -e'1 while s/(LOG.*string)\(\)\.c_str\(\)/${1}8()/g'
---
source/graphics/ColladaManager.cpp | 20 ++++++++++----------
source/graphics/FontManager.cpp | 2 +-
source/graphics/MapGenerator.cpp | 14 +++++++-------
source/graphics/MapWriter.cpp | 4 ++--
source/graphics/MeshManager.cpp | 4 ++--
source/graphics/ObjectBase.cpp | 2 +-
source/graphics/ObjectEntry.cpp | 6 +++---
source/graphics/ShaderProgram.cpp | 10 +++++-----
source/graphics/SkeletonAnimManager.cpp | 8 ++++----
source/graphics/TerrainTextureEntry.cpp | 2 +-
source/graphics/TerrainTextureManager.cpp | 4 ++--
source/graphics/TextureConverter.cpp | 14 +++++++-------
source/graphics/TextureManager.cpp | 8 ++++----
source/gui/CGUI.cpp | 8 ++++----
source/gui/GUIManager.cpp | 2 +-
source/gui/scripting/ScriptFunctions.cpp | 2 +-
source/i18n/L10n.cpp | 4 ++--
source/ps/ConfigDB.cpp | 18 +++++++++---------
source/ps/FileIo.cpp | 2 +-
source/ps/Filesystem.cpp | 2 +-
source/ps/GameSetup/GameSetup.cpp | 2 +-
source/ps/GameSetup/Paths.cpp | 2 +-
source/ps/ProfileViewer.cpp | 2 +-
source/ps/SavedGame.cpp | 4 ++--
source/ps/Util.cpp | 8 ++++----
source/ps/World.cpp | 2 +-
source/ps/XML/XMLWriter.cpp | 2 +-
source/ps/XML/Xeromyces.cpp | 6 +++---
source/renderer/ModelRenderer.cpp | 2 +-
source/renderer/PostprocManager.cpp | 2 +-
source/renderer/SkyManager.cpp | 2 +-
source/scriptinterface/ScriptInterface.cpp | 12 ++++++------
source/simulation2/Simulation2.cpp | 12 ++++++------
source/simulation2/components/CCmpAIManager.cpp | 20 ++++++++++----------
source/simulation2/system/ComponentManager.cpp | 2 +-
source/soundmanager/SoundManager.cpp | 4 ++--
source/soundmanager/data/SoundData.cpp | 2 +-
source/soundmanager/scripting/SoundGroup.cpp | 4 ++--
38 files changed, 113 insertions(+), 113 deletions(-)
diff --git a/source/graphics/ColladaManager.cpp b/source/graphics/ColladaManager.cpp
index c6176d2..5309789 100644
a
|
b
|
namespace
|
42 | 42 | VfsPath* path = static_cast<VfsPath*>(cb_data); |
43 | 43 | |
44 | 44 | if (severity == LOG_INFO) |
45 | | LOGMESSAGE("%ls: %hs", path->string().c_str(), text); |
| 45 | LOGMESSAGE("%ls: %hs", path->string8(), text); |
46 | 46 | else if (severity == LOG_WARNING) |
47 | | LOGWARNING("%ls: %hs", path->string().c_str(), text); |
| 47 | LOGWARNING("%ls: %hs", path->string8(), text); |
48 | 48 | else |
49 | | LOGERROR("%ls: %hs", path->string().c_str(), text); |
| 49 | LOGERROR("%ls: %hs", path->string8(), text); |
50 | 50 | } |
51 | 51 | |
52 | 52 | void ColladaOutput(void* cb_data, const char* data, unsigned int length) |
… |
… |
public:
|
99 | 99 | if (!dll.IsLoaded() && !TryLoadDLL()) |
100 | 100 | return ERR::FAIL; |
101 | 101 | |
102 | | LOGMESSAGE("Hotloading skeleton definitions from '%ls'", path.string().c_str()); |
| 102 | LOGMESSAGE("Hotloading skeleton definitions from '%ls'", path.string8()); |
103 | 103 | // Set the filename for the logger to report |
104 | 104 | set_logger(ColladaLog, const_cast<void*>(static_cast<const void*>(&path))); |
105 | 105 | |
106 | 106 | CVFSFile skeletonFile; |
107 | 107 | if (skeletonFile.Load(m_VFS, path) != PSRETURN_OK) |
108 | 108 | { |
109 | | LOGERROR("Failed to read skeleton defintions from '%ls'", path.string().c_str()); |
| 109 | LOGERROR("Failed to read skeleton defintions from '%ls'", path.string8()); |
110 | 110 | return ERR::FAIL; |
111 | 111 | } |
112 | 112 | |
113 | 113 | int ok = set_skeleton_definitions((const char*)skeletonFile.GetBuffer(), (int)skeletonFile.GetBufferSize()); |
114 | 114 | if (ok < 0) |
115 | 115 | { |
116 | | LOGERROR("Failed to load skeleton definitions from '%ls'", path.string().c_str()); |
| 116 | LOGERROR("Failed to load skeleton definitions from '%ls'", path.string8()); |
117 | 117 | return ERR::FAIL; |
118 | 118 | } |
119 | 119 | |
… |
… |
public:
|
221 | 221 | bool loaded = false; |
222 | 222 | for (VfsPaths::const_iterator it = pathnames.begin(); it != pathnames.end(); ++it) |
223 | 223 | { |
224 | | LOGMESSAGE("Loading skeleton definitions from '%ls'", it->string().c_str()); |
| 224 | LOGMESSAGE("Loading skeleton definitions from '%ls'", it->string8()); |
225 | 225 | // Set the filename for the logger to report |
226 | 226 | set_logger(ColladaLog, const_cast<void*>(static_cast<const void*>(&(*it)))); |
227 | 227 | |
228 | 228 | CVFSFile skeletonFile; |
229 | 229 | if (skeletonFile.Load(m_VFS, *it) != PSRETURN_OK) |
230 | 230 | { |
231 | | LOGERROR("Failed to read skeleton defintions from '%ls'", it->string().c_str()); |
| 231 | LOGERROR("Failed to read skeleton defintions from '%ls'", it->string8()); |
232 | 232 | continue; |
233 | 233 | } |
234 | 234 | |
235 | 235 | int ok = set_skeleton_definitions((const char*)skeletonFile.GetBuffer(), (int)skeletonFile.GetBufferSize()); |
236 | 236 | if (ok < 0) |
237 | 237 | { |
238 | | LOGERROR("Failed to load skeleton definitions from '%ls'", it->string().c_str()); |
| 238 | LOGERROR("Failed to load skeleton definitions from '%ls'", it->string8()); |
239 | 239 | continue; |
240 | 240 | } |
241 | 241 | |
… |
… |
public:
|
287 | 287 | // should never happen, unless there really is a problem |
288 | 288 | if (m_VFS->GetFileInfo(*it, &fileInfo) != INFO::OK) |
289 | 289 | { |
290 | | LOGERROR("Failed to stat '%ls' for DAE caching", it->string().c_str()); |
| 290 | LOGERROR("Failed to stat '%ls' for DAE caching", it->string8()); |
291 | 291 | } |
292 | 292 | else |
293 | 293 | { |
-
diff --git a/source/graphics/FontManager.cpp b/source/graphics/FontManager.cpp
index c88fac2..a6e14b3 100644
a
|
b
|
bool CFontManager::ReadFont(CFont* font, CStrIntern fontName)
|
59 | 59 | const VfsPath fntName(fontName.string() + ".fnt"); |
60 | 60 | if (g_VFS->LoadFile(path / fntName, buf, size) < 0) |
61 | 61 | { |
62 | | LOGERROR("Failed to open font file %ls", (path / fntName).string().c_str()); |
| 62 | LOGERROR("Failed to open font file %ls", (path / fntName).string8()); |
63 | 63 | return false; |
64 | 64 | } |
65 | 65 | std::istringstream FNTStream(std::string((const char*)buf.get(), size)); |
-
diff --git a/source/graphics/MapGenerator.cpp b/source/graphics/MapGenerator.cpp
index 2e7a14d..366592e 100644
a
|
b
|
bool CMapGeneratorWorker::Run()
|
134 | 134 | } |
135 | 135 | |
136 | 136 | // Load RMS |
137 | | LOGMESSAGE("Loading RMS '%ls'", m_ScriptPath.string().c_str()); |
| 137 | LOGMESSAGE("Loading RMS '%ls'", m_ScriptPath.string8()); |
138 | 138 | if (!m_ScriptInterface->LoadGlobalScriptFile(m_ScriptPath)) |
139 | 139 | { |
140 | | LOGERROR("CMapGeneratorWorker::Run: Failed to load RMS '%ls'", m_ScriptPath.string().c_str()); |
| 140 | LOGERROR("CMapGeneratorWorker::Run: Failed to load RMS '%ls'", m_ScriptPath.string8()); |
141 | 141 | return false; |
142 | 142 | } |
143 | 143 | |
… |
… |
std::vector<std::string> CMapGeneratorWorker::GetCivData(ScriptInterface::CxPriv
|
210 | 210 | PSRETURN ret = file.Load(g_VFS, *it); |
211 | 211 | if (ret != PSRETURN_OK) |
212 | 212 | { |
213 | | LOGERROR("CMapGeneratorWorker::GetCivData: Failed to load file '%ls': %hs", path.string().c_str(), GetErrorString(ret)); |
| 213 | LOGERROR("CMapGeneratorWorker::GetCivData: Failed to load file '%ls': %hs", path.string8(), GetErrorString(ret)); |
214 | 214 | } |
215 | 215 | else |
216 | 216 | { |
… |
… |
std::vector<std::string> CMapGeneratorWorker::GetCivData(ScriptInterface::CxPriv
|
222 | 222 | { |
223 | 223 | // Some error reading directory |
224 | 224 | wchar_t error[200]; |
225 | | LOGERROR("CMapGeneratorWorker::GetCivData: Error reading directory '%ls': %ls", path.string().c_str(), StatusDescription(ret, error, ARRAY_SIZE(error))); |
| 225 | LOGERROR("CMapGeneratorWorker::GetCivData: Error reading directory '%ls': %ls", path.string8(), StatusDescription(ret, error, ARRAY_SIZE(error))); |
226 | 226 | } |
227 | 227 | |
228 | 228 | return data; |
… |
… |
bool CMapGeneratorWorker::LoadScripts(const std::wstring& libraryName)
|
271 | 271 | { |
272 | 272 | for (VfsPaths::iterator it = pathnames.begin(); it != pathnames.end(); ++it) |
273 | 273 | { |
274 | | LOGMESSAGE("Loading map generator script '%ls'", it->string().c_str()); |
| 274 | LOGMESSAGE("Loading map generator script '%ls'", it->string8()); |
275 | 275 | |
276 | 276 | if (!m_ScriptInterface->LoadGlobalScriptFile(*it)) |
277 | 277 | { |
278 | | LOGERROR("CMapGeneratorWorker::LoadScripts: Failed to load script '%ls'", it->string().c_str()); |
| 278 | LOGERROR("CMapGeneratorWorker::LoadScripts: Failed to load script '%ls'", it->string8()); |
279 | 279 | return false; |
280 | 280 | } |
281 | 281 | } |
… |
… |
bool CMapGeneratorWorker::LoadScripts(const std::wstring& libraryName)
|
284 | 284 | { |
285 | 285 | // Some error reading directory |
286 | 286 | wchar_t error[200]; |
287 | | LOGERROR("CMapGeneratorWorker::LoadScripts: Error reading scripts in directory '%ls': %ls", path.string().c_str(), StatusDescription(ret, error, ARRAY_SIZE(error))); |
| 287 | LOGERROR("CMapGeneratorWorker::LoadScripts: Error reading scripts in directory '%ls': %ls", path.string8(), StatusDescription(ret, error, ARRAY_SIZE(error))); |
288 | 288 | return false; |
289 | 289 | } |
290 | 290 | |
-
diff --git a/source/graphics/MapWriter.cpp b/source/graphics/MapWriter.cpp
index be1c778..8ea3c38 100644
a
|
b
|
void CMapWriter::SaveMap(const VfsPath& pathname, CTerrain* pTerrain,
|
71 | 71 | } |
72 | 72 | catch (PSERROR_File_WriteFailed&) |
73 | 73 | { |
74 | | LOGERROR("Failed to write map '%ls'", pathname.string().c_str()); |
| 74 | LOGERROR("Failed to write map '%ls'", pathname.string8()); |
75 | 75 | return; |
76 | 76 | } |
77 | 77 | |
… |
… |
void CMapWriter::WriteXML(const VfsPath& filename,
|
447 | 447 | } |
448 | 448 | } |
449 | 449 | if (!XML_StoreVFS(g_VFS, filename)) |
450 | | LOGERROR("Failed to write map '%ls'", filename.string().c_str()); |
| 450 | LOGERROR("Failed to write map '%ls'", filename.string8()); |
451 | 451 | } |
-
diff --git a/source/graphics/MeshManager.cpp b/source/graphics/MeshManager.cpp
index 3f0fda9..1a7ed6b 100644
a
|
b
|
CModelDefPtr CMeshManager::GetMesh(const VfsPath& pathname)
|
53 | 53 | |
54 | 54 | if (pmdFilename.empty()) |
55 | 55 | { |
56 | | LOGERROR("Could not load mesh '%ls'", pathname.string().c_str()); |
| 56 | LOGERROR("Could not load mesh '%ls'", pathname.string8()); |
57 | 57 | return CModelDefPtr(); |
58 | 58 | } |
59 | 59 | |
… |
… |
CModelDefPtr CMeshManager::GetMesh(const VfsPath& pathname)
|
65 | 65 | } |
66 | 66 | catch (PSERROR_File&) |
67 | 67 | { |
68 | | LOGERROR("Could not load mesh '%ls'", pmdFilename.string().c_str()); |
| 68 | LOGERROR("Could not load mesh '%ls'", pmdFilename.string8()); |
69 | 69 | return CModelDefPtr(); |
70 | 70 | } |
71 | 71 | } |
-
diff --git a/source/graphics/ObjectBase.cpp b/source/graphics/ObjectBase.cpp
index 2270005..28bc016 100644
a
|
b
|
bool CObjectBase::Load(const VfsPath& pathname)
|
266 | 266 | |
267 | 267 | if (currentGroup->size() == 0) |
268 | 268 | { |
269 | | LOGERROR("Actor group has zero variants ('%ls')", pathname.string().c_str()); |
| 269 | LOGERROR("Actor group has zero variants ('%ls')", pathname.string8()); |
270 | 270 | } |
271 | 271 | |
272 | 272 | ++currentGroup; |
-
diff --git a/source/graphics/ObjectEntry.cpp b/source/graphics/ObjectEntry.cpp
index d9838dc..a11463a 100644
a
|
b
|
bool CObjectEntry::BuildVariation(const std::vector<std::set<CStr> >& selections
|
119 | 119 | CModelDefPtr modeldef (objectManager.GetMeshManager().GetMesh(m_ModelName)); |
120 | 120 | if (!modeldef) |
121 | 121 | { |
122 | | LOGERROR("CObjectEntry::BuildVariation(): Model %ls failed to load", m_ModelName.string().c_str()); |
| 122 | LOGERROR("CObjectEntry::BuildVariation(): Model %ls failed to load", m_ModelName.string8()); |
123 | 123 | return false; |
124 | 124 | } |
125 | 125 | |
… |
… |
bool CObjectEntry::BuildVariation(const std::vector<std::set<CStr> >& selections
|
190 | 190 | { |
191 | 191 | // start up idling |
192 | 192 | if (!model->SetAnimation(GetRandomAnimation("idle"))) |
193 | | LOGERROR("Failed to set idle animation in model \"%ls\"", m_ModelName.string().c_str()); |
| 193 | LOGERROR("Failed to set idle animation in model \"%ls\"", m_ModelName.string8()); |
194 | 194 | } |
195 | 195 | |
196 | 196 | // build props - TODO, RC - need to fix up bounds here |
… |
… |
bool CObjectEntry::BuildVariation(const std::vector<std::set<CStr> >& selections
|
240 | 240 | propmodel->ToCModel()->SetAnimation(oe->GetRandomAnimation("idle")); |
241 | 241 | } |
242 | 242 | else |
243 | | LOGERROR("Failed to find matching prop point called \"%hs\" in model \"%ls\" for actor \"%ls\"", ppn.c_str(), m_ModelName.string().c_str(), m_Base->m_ShortName.c_str()); |
| 243 | LOGERROR("Failed to find matching prop point called \"%hs\" in model \"%ls\" for actor \"%ls\"", ppn.c_str(), m_ModelName.string8(), m_Base->m_ShortName.c_str()); |
244 | 244 | } |
245 | 245 | |
246 | 246 | // setup flags |
-
diff --git a/source/graphics/ShaderProgram.cpp b/source/graphics/ShaderProgram.cpp
index 82e7140..3d8f3c2 100644
a
|
b
|
public:
|
71 | 71 | glGetIntegerv(GL_PROGRAM_ERROR_POSITION_ARB, &errPos); |
72 | 72 | int errLine = std::count(code.begin(), code.begin() + std::min((int)code.length(), errPos + 1), '\n') + 1; |
73 | 73 | char* errStr = (char*)glGetString(GL_PROGRAM_ERROR_STRING_ARB); |
74 | | LOGERROR("Failed to compile %hs program '%ls' (line %d):\n%hs", targetName, file.string().c_str(), errLine, errStr); |
| 74 | LOGERROR("Failed to compile %hs program '%ls' (line %d):\n%hs", targetName, file.string8(), errLine, errStr); |
75 | 75 | return false; |
76 | 76 | } |
77 | 77 | |
… |
… |
public:
|
310 | 310 | pglGetShaderInfoLog(shader, length, NULL, infolog); |
311 | 311 | |
312 | 312 | if (ok) |
313 | | LOGMESSAGE("Info when compiling shader '%ls':\n%hs", file.string().c_str(), infolog); |
| 313 | LOGMESSAGE("Info when compiling shader '%ls':\n%hs", file.string8(), infolog); |
314 | 314 | else |
315 | | LOGERROR("Failed to compile shader '%ls':\n%hs", file.string().c_str(), infolog); |
| 315 | LOGERROR("Failed to compile shader '%ls':\n%hs", file.string8(), infolog); |
316 | 316 | |
317 | 317 | delete[] infolog; |
318 | 318 | } |
… |
… |
public:
|
357 | 357 | pglGetProgramInfoLog(m_Program, length, NULL, infolog); |
358 | 358 | |
359 | 359 | if (ok) |
360 | | LOGMESSAGE("Info when linking program '%ls'+'%ls':\n%hs", m_VertexFile.string().c_str(), m_FragmentFile.string().c_str(), infolog); |
| 360 | LOGMESSAGE("Info when linking program '%ls'+'%ls':\n%hs", m_VertexFile.string8(), m_FragmentFile.string8(), infolog); |
361 | 361 | else |
362 | | LOGERROR("Failed to link program '%ls'+'%ls':\n%hs", m_VertexFile.string().c_str(), m_FragmentFile.string().c_str(), infolog); |
| 362 | LOGERROR("Failed to link program '%ls'+'%ls':\n%hs", m_VertexFile.string8(), m_FragmentFile.string8(), infolog); |
363 | 363 | |
364 | 364 | delete[] infolog; |
365 | 365 | } |
-
diff --git a/source/graphics/SkeletonAnimManager.cpp b/source/graphics/SkeletonAnimManager.cpp
index 2d99118..9872c16 100644
a
|
b
|
CSkeletonAnimDef* CSkeletonAnimManager::GetAnimation(const VfsPath& pathname)
|
65 | 65 | |
66 | 66 | if (psaFilename.empty()) |
67 | 67 | { |
68 | | LOGERROR("Could not load animation '%ls'", pathname.string().c_str()); |
| 68 | LOGERROR("Could not load animation '%ls'", pathname.string8()); |
69 | 69 | def = NULL; |
70 | 70 | } |
71 | 71 | else |
… |
… |
CSkeletonAnimDef* CSkeletonAnimManager::GetAnimation(const VfsPath& pathname)
|
76 | 76 | } |
77 | 77 | catch (PSERROR_File&) |
78 | 78 | { |
79 | | LOGERROR("Could not load animation '%ls'", psaFilename.string().c_str()); |
| 79 | LOGERROR("Could not load animation '%ls'", psaFilename.string8()); |
80 | 80 | } |
81 | 81 | } |
82 | 82 | |
83 | 83 | if (def) |
84 | | LOGMESSAGE("CSkeletonAnimManager::GetAnimation(%ls): Loaded successfully", pathname.string().c_str()); |
| 84 | LOGMESSAGE("CSkeletonAnimManager::GetAnimation(%ls): Loaded successfully", pathname.string8()); |
85 | 85 | else |
86 | | LOGERROR("CSkeletonAnimManager::GetAnimation(%ls): Failed loading, marked file as bad", pathname.string().c_str()); |
| 86 | LOGERROR("CSkeletonAnimManager::GetAnimation(%ls): Failed loading, marked file as bad", pathname.string8()); |
87 | 87 | |
88 | 88 | // Add to map |
89 | 89 | m_Animations[name] = def; // NULL if failed to load - we won't try loading it again |
-
diff --git a/source/graphics/TerrainTextureEntry.cpp b/source/graphics/TerrainTextureEntry.cpp
index bef2216..94930d8 100644
a
|
b
|
CTerrainTextureEntry::CTerrainTextureEntry(CTerrainPropertiesPtr properties, con
|
47 | 47 | CXeromyces XeroFile; |
48 | 48 | if (XeroFile.Load(g_VFS, path) != PSRETURN_OK) |
49 | 49 | { |
50 | | LOGERROR("Terrain xml not found (%hs)", path.string().c_str()); |
| 50 | LOGERROR("Terrain xml not found (%hs)", path.string8()); |
51 | 51 | return; |
52 | 52 | } |
53 | 53 | |
-
diff --git a/source/graphics/TerrainTextureManager.cpp b/source/graphics/TerrainTextureManager.cpp
index 7add3d5..8429c69 100644
a
|
b
|
void CTerrainTextureManager::LoadTextures(const CTerrainPropertiesPtr& props, co
|
141 | 141 | |
142 | 142 | void CTerrainTextureManager::RecurseDirectory(const CTerrainPropertiesPtr& parentProps, const VfsPath& path) |
143 | 143 | { |
144 | | //LOGMESSAGE("CTextureManager::RecurseDirectory(%ls)", path.string().c_str()); |
| 144 | //LOGMESSAGE("CTextureManager::RecurseDirectory(%ls)", path.string8()); |
145 | 145 | |
146 | 146 | CTerrainPropertiesPtr props; |
147 | 147 | |
… |
… |
void CTerrainTextureManager::RecurseDirectory(const CTerrainPropertiesPtr& paren
|
153 | 153 | // No terrains.xml, or read failures -> use parent props (i.e. |
154 | 154 | if (!props) |
155 | 155 | { |
156 | | LOGMESSAGE("CTerrainTextureManager::RecurseDirectory(%ls): no terrains.xml (or errors while loading) - using parent properties", path.string().c_str()); |
| 156 | LOGMESSAGE("CTerrainTextureManager::RecurseDirectory(%ls): no terrains.xml (or errors while loading) - using parent properties", path.string8()); |
157 | 157 | props = parentProps; |
158 | 158 | } |
159 | 159 | |
-
diff --git a/source/graphics/TextureConverter.cpp b/source/graphics/TextureConverter.cpp
index a855587..9c52652 100644
a
|
b
|
CTextureConverter::SettingsFile* CTextureConverter::LoadSettings(const VfsPath&
|
120 | 120 | |
121 | 121 | if (root.GetNodeName() != el_textures) |
122 | 122 | { |
123 | | LOGERROR("Invalid texture settings file \"%ls\" (unrecognised root element)", path.string().c_str()); |
| 123 | LOGERROR("Invalid texture settings file \"%ls\" (unrecognised root element)", path.string8()); |
124 | 124 | return NULL; |
125 | 125 | } |
126 | 126 | |
… |
… |
bool CTextureConverter::ConvertTexture(const CTexturePtr& texture, const VfsPath
|
326 | 326 | size_t fileSize; |
327 | 327 | if (m_VFS->LoadFile(src, file, fileSize) < 0) |
328 | 328 | { |
329 | | LOGERROR("Failed to load texture \"%ls\"", src.string().c_str()); |
| 329 | LOGERROR("Failed to load texture \"%ls\"", src.string8()); |
330 | 330 | return false; |
331 | 331 | } |
332 | 332 | |
333 | 333 | Tex tex; |
334 | 334 | if (tex.decode(file, fileSize) < 0) |
335 | 335 | { |
336 | | LOGERROR("Failed to decode texture \"%ls\"", src.string().c_str()); |
| 336 | LOGERROR("Failed to decode texture \"%ls\"", src.string8()); |
337 | 337 | return false; |
338 | 338 | } |
339 | 339 | |
… |
… |
bool CTextureConverter::ConvertTexture(const CTexturePtr& texture, const VfsPath
|
345 | 345 | // Convert to uncompressed 8-bit with no mipmaps |
346 | 346 | if (tex.transform_to((tex.m_Flags | TEX_GREY) & ~(TEX_DXT | TEX_MIPMAPS | TEX_ALPHA)) < 0) |
347 | 347 | { |
348 | | LOGERROR("Failed to transform texture \"%ls\"", src.string().c_str()); |
| 348 | LOGERROR("Failed to transform texture \"%ls\"", src.string8()); |
349 | 349 | return false; |
350 | 350 | } |
351 | 351 | } |
… |
… |
bool CTextureConverter::ConvertTexture(const CTexturePtr& texture, const VfsPath
|
356 | 356 | // (plain_transform doesn't know how to construct the alpha channel) |
357 | 357 | if (tex.m_Flags & TEX_GREY) |
358 | 358 | { |
359 | | LOGERROR("Failed to convert grayscale texture \"%ls\" - only RGB textures are currently supported", src.string().c_str()); |
| 359 | LOGERROR("Failed to convert grayscale texture \"%ls\" - only RGB textures are currently supported", src.string8()); |
360 | 360 | return false; |
361 | 361 | } |
362 | 362 | |
363 | 363 | // Convert to uncompressed BGRA with no mipmaps |
364 | 364 | if (tex.transform_to((tex.m_Flags | TEX_BGR | TEX_ALPHA) & ~(TEX_DXT | TEX_MIPMAPS)) < 0) |
365 | 365 | { |
366 | | LOGERROR("Failed to transform texture \"%ls\"", src.string().c_str()); |
| 366 | LOGERROR("Failed to transform texture \"%ls\"", src.string8()); |
367 | 367 | return false; |
368 | 368 | } |
369 | 369 | } |
… |
… |
bool CTextureConverter::ConvertTexture(const CTexturePtr& texture, const VfsPath
|
482 | 482 | return true; |
483 | 483 | |
484 | 484 | #else |
485 | | LOGERROR("Failed to convert texture \"%ls\" (NVTT not available)", src.string().c_str()); |
| 485 | LOGERROR("Failed to convert texture \"%ls\" (NVTT not available)", src.string8()); |
486 | 486 | return false; |
487 | 487 | #endif |
488 | 488 | } |
-
diff --git a/source/graphics/TextureManager.cpp b/source/graphics/TextureManager.cpp
index 33eff64..eb08e0d 100644
a
|
b
|
public:
|
178 | 178 | Handle h = ogl_tex_load(m_VFS, path, RES_UNIQUE); |
179 | 179 | if (h <= 0) |
180 | 180 | { |
181 | | LOGERROR("Texture failed to load; \"%ls\"", texture->m_Properties.m_Path.string().c_str()); |
| 181 | LOGERROR("Texture failed to load; \"%ls\"", texture->m_Properties.m_Path.string8()); |
182 | 182 | |
183 | 183 | // Replace with error texture to make it obvious |
184 | 184 | texture->SetHandle(m_ErrorHandle); |
… |
… |
public:
|
218 | 218 | // Upload to GL |
219 | 219 | if (!m_DisableGL && ogl_tex_upload(h, texture->m_Properties.m_Format) < 0) |
220 | 220 | { |
221 | | LOGERROR("Texture failed to upload: \"%ls\"", texture->m_Properties.m_Path.string().c_str()); |
| 221 | LOGERROR("Texture failed to upload: \"%ls\"", texture->m_Properties.m_Path.string8()); |
222 | 222 | |
223 | 223 | ogl_tex_free(h); |
224 | 224 | |
… |
… |
public:
|
277 | 277 | |
278 | 278 | // No source file or archive cache was found, so we can't load the |
279 | 279 | // real texture at all - return the error texture instead |
280 | | LOGERROR("CCacheLoader failed to find archived or source file for: \"%ls\"", texture->m_Properties.m_Path.string().c_str()); |
| 280 | LOGERROR("CCacheLoader failed to find archived or source file for: \"%ls\"", texture->m_Properties.m_Path.string8()); |
281 | 281 | texture->SetHandle(m_ErrorHandle); |
282 | 282 | return true; |
283 | 283 | } |
… |
… |
public:
|
345 | 345 | } |
346 | 346 | else |
347 | 347 | { |
348 | | LOGERROR("Texture failed to convert: \"%ls\"", texture->m_Properties.m_Path.string().c_str()); |
| 348 | LOGERROR("Texture failed to convert: \"%ls\"", texture->m_Properties.m_Path.string8()); |
349 | 349 | texture->SetHandle(m_ErrorHandle); |
350 | 350 | } |
351 | 351 | texture->m_State = CTexture::LOADED; |
-
diff --git a/source/gui/CGUI.cpp b/source/gui/CGUI.cpp
index e32395b..f2a1c28 100644
a
|
b
|
void CGUI::LoadXmlFile(const VfsPath& Filename, boost::unordered_set<VfsPath>& P
|
969 | 969 | } |
970 | 970 | catch (PSERROR_GUI& e) |
971 | 971 | { |
972 | | LOGERROR("Errors loading GUI file %ls (%u)", Filename.string().c_str(), e.getCode()); |
| 972 | LOGERROR("Errors loading GUI file %ls (%u)", Filename.string8(), e.getCode()); |
973 | 973 | return; |
974 | 974 | } |
975 | 975 | } |
… |
… |
void CGUI::Xeromyces_ReadObject(XMBElement Element, CXeromyces* pFile, IGUIObjec
|
1379 | 1379 | CXeromyces XeroIncluded; |
1380 | 1380 | if (XeroIncluded.Load(g_VFS, *it) != PSRETURN_OK) |
1381 | 1381 | { |
1382 | | LOGERROR("GUI: Error reading included XML: '%ls'", (*it).string().c_str()); |
| 1382 | LOGERROR("GUI: Error reading included XML: '%ls'", (*it).string8()); |
1383 | 1383 | continue; |
1384 | 1384 | } |
1385 | 1385 | |
1386 | 1386 | XMBElement node = XeroIncluded.GetRoot(); |
1387 | 1387 | if (node.GetNodeName() != XeroIncluded.GetElementID("object")) |
1388 | 1388 | { |
1389 | | LOGERROR("GUI: Error reading included XML: '%ls', root element must have be of type 'object'.", (*it).string().c_str()); |
| 1389 | LOGERROR("GUI: Error reading included XML: '%ls', root element must have be of type 'object'.", (*it).string8()); |
1390 | 1390 | continue; |
1391 | 1391 | } |
1392 | 1392 | Xeromyces_ReadObject(node, &XeroIncluded, object, NameSubst, Paths, nesting_depth+1); |
… |
… |
void CGUI::Xeromyces_ReadScript(XMBElement Element, CXeromyces* pFile, boost::un
|
1512 | 1512 | } |
1513 | 1513 | catch (PSERROR_Scripting& e) |
1514 | 1514 | { |
1515 | | LOGERROR("GUI: Error executing script %ls: %hs", (*it).string().c_str(), e.what()); |
| 1515 | LOGERROR("GUI: Error executing script %ls: %hs", (*it).string8(), e.what()); |
1516 | 1516 | } |
1517 | 1517 | } |
1518 | 1518 | } |
-
diff --git a/source/gui/GUIManager.cpp b/source/gui/GUIManager.cpp
index 992088d..a77c97d 100644
a
|
b
|
Status CGUIManager::ReloadChangedFile(const VfsPath& path)
|
264 | 264 | { |
265 | 265 | if (it->inputs.count(path)) |
266 | 266 | { |
267 | | LOGMESSAGE("GUI file '%ls' changed - reloading page '%ls'", path.string().c_str(), it->name.c_str()); |
| 267 | LOGMESSAGE("GUI file '%ls' changed - reloading page '%ls'", path.string8(), it->name.c_str()); |
268 | 268 | LoadPage(*it); |
269 | 269 | // TODO: this can crash if LoadPage runs an init script which modifies the page stack and breaks our iterators |
270 | 270 | } |
-
diff --git a/source/gui/scripting/ScriptFunctions.cpp b/source/gui/scripting/ScriptFunctions.cpp
index bc6881a..5df3f0c 100644
a
|
b
|
void DumpTerrainMipmap(ScriptInterface::CxPrivate* UNUSED(pCxPrivate))
|
676 | 676 | g_Game->GetWorld()->GetTerrain()->GetHeightMipmap().DumpToDisk(filename); |
677 | 677 | OsPath realPath; |
678 | 678 | g_VFS->GetRealPath(filename, realPath); |
679 | | LOGMESSAGERENDER("Terrain mipmap written to '%ls'", realPath.string().c_str()); |
| 679 | LOGMESSAGERENDER("Terrain mipmap written to '%ls'", realPath.string8()); |
680 | 680 | } |
681 | 681 | |
682 | 682 | void EnableTimeWarpRecording(ScriptInterface::CxPrivate* UNUSED(pCxPrivate), unsigned int numTurns) |
-
diff --git a/source/i18n/L10n.cpp b/source/i18n/L10n.cpp
index 6f109e3..97bf604 100644
a
|
b
|
Status L10n::ReloadChangedFile(const VfsPath& path)
|
470 | 470 | if (path.string().rfind(dictName) == std::string::npos) |
471 | 471 | return INFO::OK; |
472 | 472 | |
473 | | LOGMESSAGE("Hotloading translations from '%ls'", path.string().c_str()); |
| 473 | LOGMESSAGE("Hotloading translations from '%ls'", path.string8()); |
474 | 474 | |
475 | 475 | CVFSFile file; |
476 | 476 | if (file.Load(g_VFS, path) != PSRETURN_OK) |
477 | 477 | { |
478 | | LOGERROR("Failed to read translations from '%ls'", path.string().c_str()); |
| 478 | LOGERROR("Failed to read translations from '%ls'", path.string8()); |
479 | 479 | return ERR::FAIL; |
480 | 480 | } |
481 | 481 | |
-
diff --git a/source/ps/ConfigDB.cpp b/source/ps/ConfigDB.cpp
index 17b4838..9ab102c 100644
a
|
b
|
bool CConfigDB::Reload(EConfigNamespace ns)
|
214 | 214 | // Handle missing files quietly |
215 | 215 | if (g_VFS->GetFileInfo(m_ConfigFile[ns], NULL) < 0) |
216 | 216 | { |
217 | | LOGMESSAGE("Cannot find config file \"%ls\" - ignoring", m_ConfigFile[ns].string().c_str()); |
| 217 | LOGMESSAGE("Cannot find config file \"%ls\" - ignoring", m_ConfigFile[ns].string8()); |
218 | 218 | return false; |
219 | 219 | } |
220 | 220 | |
221 | | LOGMESSAGE("Loading config file \"%ls\"", m_ConfigFile[ns].string().c_str()); |
| 221 | LOGMESSAGE("Loading config file \"%ls\"", m_ConfigFile[ns].string8()); |
222 | 222 | Status ret = g_VFS->LoadFile(m_ConfigFile[ns], buffer, buflen); |
223 | 223 | if (ret != INFO::OK) |
224 | 224 | { |
225 | | LOGERROR("CConfigDB::Reload(): vfs_load for \"%ls\" failed: return was %lld", m_ConfigFile[ns].string().c_str(), (long long)ret); |
| 225 | LOGERROR("CConfigDB::Reload(): vfs_load for \"%ls\" failed: return was %lld", m_ConfigFile[ns].string8(), (long long)ret); |
226 | 226 | return false; |
227 | 227 | } |
228 | 228 | } |
… |
… |
bool CConfigDB::Reload(EConfigNamespace ns)
|
256 | 256 | |
257 | 257 | if (pos == filebufend || *pos == '\n') |
258 | 258 | { |
259 | | LOGERROR("Config header with missing close tag encountered on line %d in '%ls'", line, m_ConfigFile[ns].string().c_str()); |
| 259 | LOGERROR("Config header with missing close tag encountered on line %d in '%ls'", line, m_ConfigFile[ns].string8()); |
260 | 260 | header.clear(); |
261 | 261 | ++line; |
262 | 262 | continue; |
… |
… |
bool CConfigDB::Reload(EConfigNamespace ns)
|
267 | 267 | while (++pos < filebufend && *pos != '\n' && *pos != ';') |
268 | 268 | if (*pos != ' ' && *pos != '\r') |
269 | 269 | { |
270 | | LOGERROR("Config settings on the same line as a header on line %d in '%ls'", line, m_ConfigFile[ns].string().c_str()); |
| 270 | LOGERROR("Config settings on the same line as a header on line %d in '%ls'", line, m_ConfigFile[ns].string8()); |
271 | 271 | break; |
272 | 272 | } |
273 | 273 | while (pos < filebufend && *pos != '\n') |
… |
… |
bool CConfigDB::Reload(EConfigNamespace ns)
|
288 | 288 | { |
289 | 289 | if (*pos == '\\' && ++pos == filebufend) |
290 | 290 | { |
291 | | LOGERROR("Escape character at end of input (line %d in '%ls')", line, m_ConfigFile[ns].string().c_str()); |
| 291 | LOGERROR("Escape character at end of input (line %d in '%ls')", line, m_ConfigFile[ns].string8()); |
292 | 292 | break; |
293 | 293 | } |
294 | 294 | |
… |
… |
bool CConfigDB::Reload(EConfigNamespace ns)
|
316 | 316 | } |
317 | 317 | } |
318 | 318 | if (quoted) // We ignore the invalid parameter |
319 | | LOGERROR("Unmatched quote while parsing config file '%ls' on line %d", m_ConfigFile[ns].string().c_str(), line); |
| 319 | LOGERROR("Unmatched quote while parsing config file '%ls' on line %d", m_ConfigFile[ns].string8(), line); |
320 | 320 | else if (!value.empty()) |
321 | 321 | values.push_back(value); |
322 | 322 | value.clear(); |
… |
… |
bool CConfigDB::Reload(EConfigNamespace ns)
|
348 | 348 | } |
349 | 349 | } |
350 | 350 | else if (!name.empty()) |
351 | | LOGERROR("Encountered config setting '%hs' without value while parsing '%ls' on line %d", name.c_str(), m_ConfigFile[ns].string().c_str(), line); |
| 351 | LOGERROR("Encountered config setting '%hs' without value while parsing '%ls' on line %d", name.c_str(), m_ConfigFile[ns].string8(), line); |
352 | 352 | |
353 | 353 | name.clear(); |
354 | 354 | values.clear(); |
… |
… |
bool CConfigDB::WriteFile(EConfigNamespace ns, const VfsPath& path)
|
393 | 393 | Status ret = g_VFS->CreateFile(path, buf, len); |
394 | 394 | if (ret < 0) |
395 | 395 | { |
396 | | LOGERROR("CConfigDB::WriteFile(): CreateFile \"%ls\" failed (error: %d)", path.string().c_str(), (int)ret); |
| 396 | LOGERROR("CConfigDB::WriteFile(): CreateFile \"%ls\" failed (error: %d)", path.string8(), (int)ret); |
397 | 397 | return false; |
398 | 398 | } |
399 | 399 | |
-
diff --git a/source/ps/FileIo.cpp b/source/ps/FileIo.cpp
index c345da7..8ffa31b 100644
a
|
b
|
void CFilePacker::Write(const VfsPath& filename)
|
69 | 69 | const Status st = g_VFS->CreateFile(filename, m_writeBuffer.Data(), m_writeBuffer.Size()); |
70 | 70 | if (st < 0) |
71 | 71 | { |
72 | | LOGERROR("Failed to write file '%ls' with status '%lld'", filename.string().c_str(), (long long)st); |
| 72 | LOGERROR("Failed to write file '%ls' with status '%lld'", filename.string8(), (long long)st); |
73 | 73 | throw PSERROR_File_WriteFailed(); |
74 | 74 | } |
75 | 75 | } |
-
diff --git a/source/ps/Filesystem.cpp b/source/ps/Filesystem.cpp
index d273ce5..1c5a446 100644
a
|
b
|
PSRETURN CVFSFile::Load(const PIVFS& vfs, const VfsPath& filename, bool log /* =
|
124 | 124 | if (ret != INFO::OK) |
125 | 125 | { |
126 | 126 | if (log) |
127 | | LOGERROR("CVFSFile: file %ls couldn't be opened (vfs_load: %lld)", filename.string().c_str(), (long long)ret); |
| 127 | LOGERROR("CVFSFile: file %ls couldn't be opened (vfs_load: %lld)", filename.string8(), (long long)ret); |
128 | 128 | m_Buffer.reset(); |
129 | 129 | m_BufferSize = 0; |
130 | 130 | return PSRETURN_CVFSFile_LoadFailed; |
-
diff --git a/source/ps/GameSetup/GameSetup.cpp b/source/ps/GameSetup/GameSetup.cpp
index dac6867..13bd34e 100644
a
|
b
|
CStr8 LoadSettingsOfScenarioMap(const VfsPath &mapPath)
|
1132 | 1132 | |
1133 | 1133 | if (INFO::OK != loadResult) |
1134 | 1134 | { |
1135 | | LOGERROR("LoadSettingsOfScenarioMap: Unable to load map file '%ls'", mapPath.string().c_str()); |
| 1135 | LOGERROR("LoadSettingsOfScenarioMap: Unable to load map file '%ls'", mapPath.string8()); |
1136 | 1136 | throw PSERROR_Game_World_MapLoadFailed("Unable to load map file, check the path for typos."); |
1137 | 1137 | } |
1138 | 1138 | XMBElement mapElement = mapFile.GetRoot(); |
-
diff --git a/source/ps/GameSetup/Paths.cpp b/source/ps/GameSetup/Paths.cpp
index aeeca95..db53c54 100644
a
|
b
|
Paths::Paths(const CmdLineArgs& args)
|
172 | 172 | // make sure it's valid |
173 | 173 | if(!FileExists(pathname)) |
174 | 174 | { |
175 | | LOGERROR("Cannot find executable (expected at '%ls')", pathname.string().c_str()); |
| 175 | LOGERROR("Cannot find executable (expected at '%ls')", pathname.string8()); |
176 | 176 | WARN_IF_ERR(StatusFromErrno()); |
177 | 177 | } |
178 | 178 | |
-
diff --git a/source/ps/ProfileViewer.cpp b/source/ps/ProfileViewer.cpp
index fe6fdab..2551a02 100644
a
|
b
|
void CProfileViewer::SaveToFile()
|
575 | 575 | } |
576 | 576 | else |
577 | 577 | { |
578 | | LOGMESSAGERENDER("Profiler snapshot saved to '%ls'", path.string().c_str()); |
| 578 | LOGMESSAGERENDER("Profiler snapshot saved to '%ls'", path.string8()); |
579 | 579 | } |
580 | 580 | } |
581 | 581 | |
-
diff --git a/source/ps/SavedGame.cpp b/source/ps/SavedGame.cpp
index 5869595..a1c5855 100644
a
|
b
|
Status SavedGames::Save(const std::wstring& name, const std::wstring& descriptio
|
126 | 126 | |
127 | 127 | OsPath realPath; |
128 | 128 | WARN_RETURN_STATUS_IF_ERR(g_VFS->GetRealPath(filename, realPath)); |
129 | | LOGMESSAGERENDER(g_L10n.Translate("Saved game to '%ls'"), realPath.string().c_str()); |
| 129 | LOGMESSAGERENDER(g_L10n.Translate("Saved game to '%ls'"), realPath.string8()); |
130 | 130 | |
131 | 131 | return INFO::OK; |
132 | 132 | } |
… |
… |
std::vector<CScriptValRooted> SavedGames::GetSavedGames(ScriptInterface& scriptI
|
244 | 244 | if (!archiveReader) |
245 | 245 | { |
246 | 246 | // Triggered by e.g. the file being open in another program |
247 | | LOGWARNING("Failed to read saved game '%ls'", realPath.string().c_str()); |
| 247 | LOGWARNING("Failed to read saved game '%ls'", realPath.string8()); |
248 | 248 | continue; // skip this file |
249 | 249 | } |
250 | 250 | |
-
diff --git a/source/ps/Util.cpp b/source/ps/Util.cpp
index fc07b38..8e66339 100644
a
|
b
|
void WriteScreenshot(const VfsPath& extension)
|
241 | 241 | { |
242 | 242 | OsPath realPath; |
243 | 243 | g_VFS->GetRealPath(filename, realPath); |
244 | | LOGMESSAGERENDER(g_L10n.Translate("Screenshot written to '%ls'"), realPath.string().c_str()); |
| 244 | LOGMESSAGERENDER(g_L10n.Translate("Screenshot written to '%ls'"), realPath.string8()); |
245 | 245 | } |
246 | 246 | else |
247 | | LOGERROR("Error writing screenshot to '%ls'", filename.string().c_str()); |
| 247 | LOGERROR("Error writing screenshot to '%ls'", filename.string8()); |
248 | 248 | } |
249 | 249 | |
250 | 250 | |
… |
… |
void WriteBigScreenshot(const VfsPath& extension, int tiles)
|
374 | 374 | { |
375 | 375 | OsPath realPath; |
376 | 376 | g_VFS->GetRealPath(filename, realPath); |
377 | | LOGMESSAGERENDER(g_L10n.Translate("Screenshot written to '%ls'"), realPath.string().c_str()); |
| 377 | LOGMESSAGERENDER(g_L10n.Translate("Screenshot written to '%ls'"), realPath.string8()); |
378 | 378 | } |
379 | 379 | else |
380 | | LOGERROR("Error writing screenshot to '%ls'", filename.string().c_str()); |
| 380 | LOGERROR("Error writing screenshot to '%ls'", filename.string8()); |
381 | 381 | |
382 | 382 | free(tile_data); |
383 | 383 | } |
-
diff --git a/source/ps/World.cpp b/source/ps/World.cpp
index 12de4d0..60a4b66 100644
a
|
b
|
void CWorld::RegisterInit(const CStrW& mapFile, const CScriptValRooted& settings
|
89 | 89 | catch (PSERROR_File& err) |
90 | 90 | { |
91 | 91 | delete reader; |
92 | | LOGERROR("Failed to load map %ls: %hs", mapfilename.string().c_str(), err.what()); |
| 92 | LOGERROR("Failed to load map %ls: %hs", mapfilename.string8(), err.what()); |
93 | 93 | throw PSERROR_Game_World_MapLoadFailed("Failed to load map.\nCheck application log for details."); |
94 | 94 | } |
95 | 95 | } |
-
diff --git a/source/ps/XML/XMLWriter.cpp b/source/ps/XML/XMLWriter.cpp
index ea99187..b104c67 100644
a
|
b
|
bool XMLWriter_File::StoreVFS(const PIVFS& vfs, const VfsPath& pathname)
|
102 | 102 | Status ret = vfs->CreateFile(pathname, data, size); |
103 | 103 | if (ret < 0) |
104 | 104 | { |
105 | | LOGERROR("Error saving XML data through VFS: %lld '%ls'", (long long)ret, pathname.string().c_str()); |
| 105 | LOGERROR("Error saving XML data through VFS: %lld '%ls'", (long long)ret, pathname.string8()); |
106 | 106 | return false; |
107 | 107 | } |
108 | 108 | return true; |
-
diff --git a/source/ps/XML/Xeromyces.cpp b/source/ps/XML/Xeromyces.cpp
index 61fd869..d4aea8d 100644
a
|
b
|
PSRETURN CXeromyces::Load(const PIVFS& vfs, const VfsPath& filename)
|
89 | 89 | |
90 | 90 | // No source file or archive cache was found, so we can't load the |
91 | 91 | // XML file at all |
92 | | LOGERROR("CCacheLoader failed to find archived or source file for: \"%ls\"", filename.string().c_str()); |
| 92 | LOGERROR("CCacheLoader failed to find archived or source file for: \"%ls\"", filename.string8()); |
93 | 93 | return PSRETURN_Xeromyces_XMLOpenFailed; |
94 | 94 | } |
95 | 95 | |
… |
… |
PSRETURN CXeromyces::ConvertFile(const PIVFS& vfs, const VfsPath& filename, cons
|
111 | 111 | CVFSFile input; |
112 | 112 | if (input.Load(vfs, filename)) |
113 | 113 | { |
114 | | LOGERROR("CXeromyces: Failed to open XML file %ls", filename.string().c_str()); |
| 114 | LOGERROR("CXeromyces: Failed to open XML file %ls", filename.string8()); |
115 | 115 | return PSRETURN_Xeromyces_XMLOpenFailed; |
116 | 116 | } |
117 | 117 | |
… |
… |
PSRETURN CXeromyces::ConvertFile(const PIVFS& vfs, const VfsPath& filename, cons
|
120 | 120 | filename8.c_str(), NULL, XML_PARSE_NONET|XML_PARSE_NOCDATA); |
121 | 121 | if (! doc) |
122 | 122 | { |
123 | | LOGERROR("CXeromyces: Failed to parse XML file %ls", filename.string().c_str()); |
| 123 | LOGERROR("CXeromyces: Failed to parse XML file %ls", filename.string8()); |
124 | 124 | return PSRETURN_Xeromyces_XMLParseError; |
125 | 125 | } |
126 | 126 | |
-
diff --git a/source/renderer/ModelRenderer.cpp b/source/renderer/ModelRenderer.cpp
index 03e621a..6c13815 100644
a
|
b
|
void ModelRenderer::BuildPositionAndNormals(
|
98 | 98 | // some broken situations |
99 | 99 | if (numVertices && vertices[0].m_Blend.m_Bone[0] == 0xff) |
100 | 100 | { |
101 | | LOGERROR("Model %ls is boned with unboned animation", mdef->GetName().string().c_str()); |
| 101 | LOGERROR("Model %ls is boned with unboned animation", mdef->GetName().string8()); |
102 | 102 | return; |
103 | 103 | } |
104 | 104 | |
-
diff --git a/source/renderer/PostprocManager.cpp b/source/renderer/PostprocManager.cpp
index 4d4bf7b..becfb1c 100644
a
|
b
|
std::vector<CStrW> CPostprocManager::GetPostEffects()
|
519 | 519 | |
520 | 520 | VfsPaths pathnames; |
521 | 521 | if(vfs::GetPathnames(g_VFS, path, 0, pathnames) < 0) |
522 | | LOGERROR("Error finding Post effects in '%ls'", path.string().c_str()); |
| 522 | LOGERROR("Error finding Post effects in '%ls'", path.string8()); |
523 | 523 | |
524 | 524 | for(size_t i = 0; i < pathnames.size(); i++) |
525 | 525 | { |
-
diff --git a/source/renderer/SkyManager.cpp b/source/renderer/SkyManager.cpp
index 013edbd..49b6def 100644
a
|
b
|
std::vector<CStrW> SkyManager::GetSkySets() const
|
207 | 207 | DirectoryNames subdirectories; |
208 | 208 | if(g_VFS->GetDirectoryEntries(path, 0, &subdirectories) < 0) |
209 | 209 | { |
210 | | LOGERROR("Error opening directory '%ls'", path.string().c_str()); |
| 210 | LOGERROR("Error opening directory '%ls'", path.string8()); |
211 | 211 | return std::vector<CStrW>(1, GetSkySet()); // just return what we currently have |
212 | 212 | } |
213 | 213 | |
-
diff --git a/source/scriptinterface/ScriptInterface.cpp b/source/scriptinterface/ScriptInterface.cpp
index aaba59a..31fa302 100644
a
|
b
|
bool ScriptInterface::LoadGlobalScripts()
|
478 | 478 | { |
479 | 479 | if (!LoadGlobalScriptFile(*it)) |
480 | 480 | { |
481 | | LOGERROR("LoadGlobalScripts: Failed to load script %ls", it->string().c_str()); |
| 481 | LOGERROR("LoadGlobalScripts: Failed to load script %ls", it->string8()); |
482 | 482 | return false; |
483 | 483 | } |
484 | 484 | } |
… |
… |
bool ScriptInterface::LoadGlobalScriptFile(const VfsPath& path)
|
866 | 866 | JSAutoRequest rq(m->m_cx); |
867 | 867 | if (!VfsFileExists(path)) |
868 | 868 | { |
869 | | LOGERROR("File '%ls' does not exist", path.string().c_str()); |
| 869 | LOGERROR("File '%ls' does not exist", path.string8()); |
870 | 870 | return false; |
871 | 871 | } |
872 | 872 | |
… |
… |
bool ScriptInterface::LoadGlobalScriptFile(const VfsPath& path)
|
876 | 876 | |
877 | 877 | if (ret != PSRETURN_OK) |
878 | 878 | { |
879 | | LOGERROR("Failed to load file '%ls': %hs", path.string().c_str(), GetErrorString(ret)); |
| 879 | LOGERROR("Failed to load file '%ls': %hs", path.string8(), GetErrorString(ret)); |
880 | 880 | return false; |
881 | 881 | } |
882 | 882 | |
… |
… |
void ScriptInterface::ReadJSONFile(const VfsPath& path, JS::MutableHandleValue o
|
954 | 954 | { |
955 | 955 | if (!VfsFileExists(path)) |
956 | 956 | { |
957 | | LOGERROR("File '%ls' does not exist", path.string().c_str()); |
| 957 | LOGERROR("File '%ls' does not exist", path.string8()); |
958 | 958 | return; |
959 | 959 | } |
960 | 960 | |
… |
… |
void ScriptInterface::ReadJSONFile(const VfsPath& path, JS::MutableHandleValue o
|
964 | 964 | |
965 | 965 | if (ret != PSRETURN_OK) |
966 | 966 | { |
967 | | LOGERROR("Failed to load file '%ls': %hs", path.string().c_str(), GetErrorString(ret)); |
| 967 | LOGERROR("Failed to load file '%ls': %hs", path.string8(), GetErrorString(ret)); |
968 | 968 | return; |
969 | 969 | } |
970 | 970 | |
971 | 971 | std::string content(file.DecodeUTF8()); // assume it's UTF-8 |
972 | 972 | |
973 | 973 | if (!ParseJSON(content, out)) |
974 | | LOGERROR("Failed to parse '%ls'", path.string().c_str()); |
| 974 | LOGERROR("Failed to parse '%ls'", path.string8()); |
975 | 975 | } |
976 | 976 | |
977 | 977 | struct Stringifier |
-
diff --git a/source/simulation2/Simulation2.cpp b/source/simulation2/Simulation2.cpp
index 7db1fae..8573fe8 100644
a
|
b
|
bool CSimulation2Impl::LoadScripts(CComponentManager& componentManager, std::set
|
187 | 187 | VfsPath filename = *it; |
188 | 188 | if (loadedScripts) |
189 | 189 | loadedScripts->insert(filename); |
190 | | LOGMESSAGE("Loading simulation script '%ls'", filename.string().c_str()); |
| 190 | LOGMESSAGE("Loading simulation script '%ls'", filename.string8()); |
191 | 191 | if (!componentManager.LoadScript(filename)) |
192 | 192 | ok = false; |
193 | 193 | } |
… |
… |
Status CSimulation2Impl::ReloadChangedFile(const VfsPath& path)
|
224 | 224 | if (!VfsFileExists(path)) |
225 | 225 | return INFO::OK; |
226 | 226 | |
227 | | LOGMESSAGE("Reloading simulation script '%ls'", path.string().c_str()); |
| 227 | LOGMESSAGE("Reloading simulation script '%ls'", path.string8()); |
228 | 228 | if (!m_ComponentManager.LoadScript(path, true)) |
229 | 229 | return ERR::FAIL; |
230 | 230 | |
… |
… |
static std::vector<std::string> GetJSONData(const VfsPath& path)
|
828 | 828 | { |
829 | 829 | // Some error reading directory |
830 | 830 | wchar_t error[200]; |
831 | | LOGERROR("Error reading directory '%ls': %ls", path.string().c_str(), StatusDescription(ret, error, ARRAY_SIZE(error))); |
| 831 | LOGERROR("Error reading directory '%ls': %ls", path.string8(), StatusDescription(ret, error, ARRAY_SIZE(error))); |
832 | 832 | return std::vector<std::string>(); |
833 | 833 | } |
834 | 834 | |
… |
… |
static std::vector<std::string> GetJSONData(const VfsPath& path)
|
840 | 840 | PSRETURN ret = file.Load(g_VFS, *it); |
841 | 841 | if (ret != PSRETURN_OK) |
842 | 842 | { |
843 | | LOGERROR("GetJSONData: Failed to load file '%ls': %hs", path.string().c_str(), GetErrorString(ret)); |
| 843 | LOGERROR("GetJSONData: Failed to load file '%ls': %hs", path.string8(), GetErrorString(ret)); |
844 | 844 | continue; |
845 | 845 | } |
846 | 846 | |
… |
… |
static std::string ReadJSON(const VfsPath& path)
|
864 | 864 | { |
865 | 865 | if (!VfsFileExists(path)) |
866 | 866 | { |
867 | | LOGERROR("File '%ls' does not exist", path.string().c_str()); |
| 867 | LOGERROR("File '%ls' does not exist", path.string8()); |
868 | 868 | return std::string(); |
869 | 869 | } |
870 | 870 | |
… |
… |
static std::string ReadJSON(const VfsPath& path)
|
873 | 873 | PSRETURN ret = file.Load(g_VFS, path); |
874 | 874 | if (ret != PSRETURN_OK) |
875 | 875 | { |
876 | | LOGERROR("Failed to load file '%ls': %hs", path.string().c_str(), GetErrorString(ret)); |
| 876 | LOGERROR("Failed to load file '%ls': %hs", path.string8(), GetErrorString(ret)); |
877 | 877 | return std::string(); |
878 | 878 | } |
879 | 879 | |
-
diff --git a/source/simulation2/components/CCmpAIManager.cpp b/source/simulation2/components/CCmpAIManager.cpp
index dab13d4..9efb936 100644
a
|
b
|
private:
|
104 | 104 | m_Worker.LoadMetadata(path, &metadata); |
105 | 105 | if (metadata.isUndefined()) |
106 | 106 | { |
107 | | LOGERROR("Failed to create AI player: can't find %ls", path.string().c_str()); |
| 107 | LOGERROR("Failed to create AI player: can't find %ls", path.string8()); |
108 | 108 | return false; |
109 | 109 | } |
110 | 110 | |
… |
… |
private:
|
116 | 116 | JS::RootedValue ctor(cx); |
117 | 117 | if (!m_ScriptInterface->HasProperty(metadata, "moduleName")) |
118 | 118 | { |
119 | | LOGERROR("Failed to create AI player: %ls: missing 'moduleName'", path.string().c_str()); |
| 119 | LOGERROR("Failed to create AI player: %ls: missing 'moduleName'", path.string8()); |
120 | 120 | return false; |
121 | 121 | } |
122 | 122 | |
… |
… |
private:
|
124 | 124 | if (!m_ScriptInterface->GetProperty(global, moduleName.c_str(), &objectWithConstructor) |
125 | 125 | || objectWithConstructor.isUndefined()) |
126 | 126 | { |
127 | | LOGERROR("Failed to create AI player: %ls: can't find the module that should contain the constructor: '%hs'", path.string().c_str(), moduleName.c_str()); |
| 127 | LOGERROR("Failed to create AI player: %ls: can't find the module that should contain the constructor: '%hs'", path.string8(), moduleName.c_str()); |
128 | 128 | return false; |
129 | 129 | } |
130 | 130 | |
131 | 131 | if (!m_ScriptInterface->GetProperty(metadata, "constructor", constructor)) |
132 | 132 | { |
133 | | LOGERROR("Failed to create AI player: %ls: missing 'constructor'", path.string().c_str()); |
| 133 | LOGERROR("Failed to create AI player: %ls: missing 'constructor'", path.string8()); |
134 | 134 | return false; |
135 | 135 | } |
136 | 136 | |
… |
… |
private:
|
138 | 138 | if (!m_ScriptInterface->GetProperty(objectWithConstructor, constructor.c_str(), &ctor) |
139 | 139 | || ctor.isNull()) |
140 | 140 | { |
141 | | LOGERROR("Failed to create AI player: %ls: can't find constructor '%hs'", path.string().c_str(), constructor.c_str()); |
| 141 | LOGERROR("Failed to create AI player: %ls: can't find constructor '%hs'", path.string8(), constructor.c_str()); |
142 | 142 | return false; |
143 | 143 | } |
144 | 144 | |
… |
… |
private:
|
160 | 160 | |
161 | 161 | if (obj.isNull()) |
162 | 162 | { |
163 | | LOGERROR("Failed to create AI player: %ls: error calling constructor '%hs'", path.string().c_str(), constructor.c_str()); |
| 163 | LOGERROR("Failed to create AI player: %ls: error calling constructor '%hs'", path.string8(), constructor.c_str()); |
164 | 164 | return false; |
165 | 165 | } |
166 | 166 | |
… |
… |
public:
|
269 | 269 | { |
270 | 270 | if (!m_ScriptInterface->LoadGlobalScriptFile(*it)) |
271 | 271 | { |
272 | | LOGERROR("Failed to load script %ls", it->string().c_str()); |
| 272 | LOGERROR("Failed to load script %ls", it->string8()); |
273 | 273 | return false; |
274 | 274 | } |
275 | 275 | } |
… |
… |
public:
|
391 | 391 | JS::RootedValue ctor(cx); |
392 | 392 | if (!m_ScriptInterface->GetProperty(global, "API3", &AIModule) || AIModule.isUndefined()) |
393 | 393 | { |
394 | | LOGERROR("Failed to create shared AI component: %ls: can't find module '%hs'", path.string().c_str(), "API3"); |
| 394 | LOGERROR("Failed to create shared AI component: %ls: can't find module '%hs'", path.string8(), "API3"); |
395 | 395 | return false; |
396 | 396 | } |
397 | 397 | |
398 | 398 | if (!m_ScriptInterface->GetProperty(AIModule, "SharedScript", &ctor) |
399 | 399 | || ctor.isUndefined()) |
400 | 400 | { |
401 | | LOGERROR("Failed to create shared AI component: %ls: can't find constructor '%hs'", path.string().c_str(), "SharedScript"); |
| 401 | LOGERROR("Failed to create shared AI component: %ls: can't find constructor '%hs'", path.string8(), "SharedScript"); |
402 | 402 | return false; |
403 | 403 | } |
404 | 404 | |
… |
… |
public:
|
440 | 440 | |
441 | 441 | if (tmpSharedAIObj.isNull()) |
442 | 442 | { |
443 | | LOGERROR("Failed to create shared AI component: %ls: error calling constructor '%hs'", path.string().c_str(), "SharedScript"); |
| 443 | LOGERROR("Failed to create shared AI component: %ls: error calling constructor '%hs'", path.string8(), "SharedScript"); |
444 | 444 | return false; |
445 | 445 | } |
446 | 446 | |
-
diff --git a/source/simulation2/system/ComponentManager.cpp b/source/simulation2/system/ComponentManager.cpp
index ac4045c..86dae1f 100644
a
|
b
|
std::vector<std::string> CComponentManager::Script_FindJSONFiles(ScriptInterface
|
1226 | 1226 | { |
1227 | 1227 | // Some error reading directory |
1228 | 1228 | wchar_t error[200]; |
1229 | | LOGERROR("Error reading directory '%ls': %ls", cbData.path.string().c_str(), StatusDescription(ret, error, ARRAY_SIZE(error))); |
| 1229 | LOGERROR("Error reading directory '%ls': %ls", cbData.path.string8(), StatusDescription(ret, error, ARRAY_SIZE(error))); |
1230 | 1230 | } |
1231 | 1231 | |
1232 | 1232 | return cbData.templates; |
-
diff --git a/source/soundmanager/SoundManager.cpp b/source/soundmanager/SoundManager.cpp
index c3977bf..1fe169f 100644
a
|
b
|
void CSoundManager::al_check(const char* caller, int line)
|
216 | 216 | |
217 | 217 | Status CSoundManager::ReloadChangedFiles(const VfsPath& UNUSED(path)) |
218 | 218 | { |
219 | | // LOGERROR("GUI file '%ls' changed - reloading page", path.string().c_str()); |
| 219 | // LOGERROR("GUI file '%ls' changed - reloading page", path.string8()); |
220 | 220 | |
221 | 221 | return INFO::OK; |
222 | 222 | } |
… |
… |
void CSoundManager::PlayAsGroup(const VfsPath& groupPath, CVector3D sourcePos, e
|
654 | 654 | group = new CSoundGroup(); |
655 | 655 | if (!group->LoadSoundGroup(L"audio/" + groupPath.string())) |
656 | 656 | { |
657 | | LOGERROR("Failed to load sound group '%ls'", groupPath.string().c_str()); |
| 657 | LOGERROR("Failed to load sound group '%ls'", groupPath.string8()); |
658 | 658 | delete group; |
659 | 659 | group = NULL; |
660 | 660 | } |
-
diff --git a/source/soundmanager/data/SoundData.cpp b/source/soundmanager/data/SoundData.cpp
index 65647d4..22a8dd0 100644
a
|
b
|
CSoundData* CSoundData::SoundDataFromOgg(const VfsPath& itemPath)
|
107 | 107 | } |
108 | 108 | else |
109 | 109 | { |
110 | | LOGERROR("could not initialize ogg data at %ls", itemPath.string().c_str()); |
| 110 | LOGERROR("could not initialize ogg data at %ls", itemPath.string8()); |
111 | 111 | delete oggAnswer; |
112 | 112 | } |
113 | 113 | |
-
diff --git a/source/soundmanager/scripting/SoundGroup.cpp b/source/soundmanager/scripting/SoundGroup.cpp
index 762b513..ebd9bc0 100644
a
|
b
|
void CSoundGroup::UploadPropertiesAndPlay(size_t theIndex, const CVector3D& posi
|
197 | 197 | itemRollOff = 0; |
198 | 198 | |
199 | 199 | if ( sndData->IsStereo() ) |
200 | | LOGWARNING( "OpenAL: stereo sounds can't be positioned: %ls", sndData->GetFileName()->string().c_str() ); |
| 200 | LOGWARNING( "OpenAL: stereo sounds can't be positioned: %ls", sndData->GetFileName()->string8() ); |
201 | 201 | |
202 | 202 | hSound->SetLocation(CVector3D((sndDist * sin(offSet)), 0, - sndDist * cos(offSet))); |
203 | 203 | hSound->SetRollOff(itemRollOff); |
… |
… |
static void HandleError(const CStrW& message, const VfsPath& pathname, Status er
|
227 | 227 | { |
228 | 228 | if (err == ERR::AGAIN) |
229 | 229 | return; // open failed because sound is disabled (don't log this) |
230 | | LOGERROR("%ls: pathname=%ls, error=%ls", message.c_str(), pathname.string().c_str(), ErrorString(err)); |
| 230 | LOGERROR("%ls: pathname=%ls, error=%ls", message.c_str(), pathname.string8(), ErrorString(err)); |
231 | 231 | } |
232 | 232 | |
233 | 233 | void CSoundGroup::PlayNext(const CVector3D& position, entity_id_t source) |