From 49e2ecea634f2232952c8fa5672faa3412a71d8f Mon Sep 17 00:00:00 2001 From: Ykkrosh Date: Thu, 22 Jan 2015 20:31:30 +0000 Subject: [PATCH] Automatically convert all CLogger format strings from wchar_t* to char*. Done with: ag -ls 'LOG(MESSAGE|MESSAGERENDER|WARNING|ERROR)' source | xargs sed -i 's/LOG\(MESSAGE\|MESSAGERENDER\|WARNING\|ERROR\)(L/LOG\1(/g' This was SVN commit r16183. --- source/graphics/ColladaManager.cpp | 32 ++++---- source/graphics/FontManager.cpp | 6 +- source/graphics/LOSTexture.cpp | 4 +- source/graphics/MapGenerator.cpp | 22 ++--- source/graphics/MapReader.cpp | 14 ++-- source/graphics/MapWriter.cpp | 4 +- source/graphics/MeshManager.cpp | 4 +- source/graphics/Model.cpp | 2 +- source/graphics/ModelAbstract.cpp | 4 +- source/graphics/ObjectBase.cpp | 4 +- source/graphics/ObjectEntry.cpp | 12 +-- source/graphics/ObjectManager.cpp | 2 +- source/graphics/ParticleEmitterType.cpp | 2 +- source/graphics/ShaderManager.cpp | 8 +- source/graphics/ShaderProgram.cpp | 18 ++-- source/graphics/ShaderProgramFFP.cpp | 2 +- source/graphics/SkeletonAnimManager.cpp | 8 +- source/graphics/TerrainTextureEntry.cpp | 4 +- source/graphics/TerrainTextureManager.cpp | 6 +- source/graphics/TextureConverter.cpp | 26 +++--- source/graphics/TextureManager.cpp | 10 +-- .../scripting/JSInterface_GameView.cpp | 4 +- source/gui/CGUI.cpp | 82 +++++++++---------- source/gui/CGUIScrollBarVertical.cpp | 2 +- source/gui/COList.cpp | 6 +- source/gui/GUIManager.cpp | 20 ++--- source/gui/GUIRenderer.cpp | 4 +- source/gui/GUITooltip.cpp | 10 +-- source/gui/GUIbase.cpp | 6 +- source/gui/GUItext.cpp | 34 ++++---- source/gui/GUIutil.cpp | 22 ++--- source/gui/IGUIObject.cpp | 2 +- source/gui/scripting/ScriptFunctions.cpp | 12 +-- source/i18n/L10n.cpp | 14 ++-- .../lib/sysdep/os/linux/dir_watch_inotify.cpp | 4 +- source/lobby/XmppClient.cpp | 8 +- source/main.cpp | 2 +- source/network/NetClient.cpp | 8 +- source/network/NetFileTransfer.cpp | 18 ++-- source/network/NetHost.cpp | 6 +- source/network/NetMessage.cpp | 6 +- source/network/NetServer.cpp | 42 +++++----- source/network/NetSession.cpp | 6 +- source/network/NetTurnManager.cpp | 12 +-- source/ps/CStrIntern.cpp | 2 +- source/ps/ConfigDB.cpp | 26 +++--- source/ps/DllLoader.cpp | 6 +- source/ps/FileIo.cpp | 2 +- source/ps/Filesystem.cpp | 2 +- source/ps/GameSetup/Config.cpp | 4 +- source/ps/GameSetup/GameSetup.cpp | 26 +++--- source/ps/GameSetup/HWDetect.cpp | 2 +- source/ps/GameSetup/Paths.cpp | 2 +- source/ps/Hotkey.cpp | 2 +- source/ps/Joystick.cpp | 10 +-- source/ps/Overlay.cpp | 8 +- source/ps/Preprocessor.cpp | 4 +- source/ps/PreprocessorWrapper.cpp | 4 +- source/ps/ProfileViewer.cpp | 4 +- source/ps/Profiler2.cpp | 10 +-- source/ps/SavedGame.cpp | 2 +- source/ps/TemplateLoader.cpp | 26 +++--- source/ps/Util.cpp | 4 +- source/ps/VideoMode.cpp | 18 ++-- source/ps/World.cpp | 2 +- source/ps/XML/RelaxNG.cpp | 10 +-- source/ps/XML/XMLWriter.cpp | 2 +- source/ps/XML/Xeromyces.cpp | 10 +-- source/ps/scripting/JSInterface_ConfigDB.cpp | 2 +- source/ps/scripting/JSInterface_Console.cpp | 2 +- source/ps/scripting/JSInterface_VFS.cpp | 2 +- source/renderer/DecalRData.cpp | 4 +- source/renderer/ModelRenderer.cpp | 2 +- source/renderer/PatchRData.cpp | 2 +- source/renderer/PostprocManager.cpp | 8 +- source/renderer/Renderer.cpp | 12 +-- source/renderer/ShadowMap.cpp | 4 +- source/renderer/SkyManager.cpp | 4 +- source/renderer/TerrainRenderer.cpp | 2 +- source/renderer/VertexBufferManager.cpp | 2 +- source/renderer/WaterManager.cpp | 6 +- source/scriptinterface/DebuggingServer.cpp | 4 +- source/scriptinterface/ScriptInterface.cpp | 36 ++++---- source/scriptinterface/ThreadDebugger.cpp | 8 +- source/simulation2/Simulation2.cpp | 14 ++-- .../simulation2/components/CCmpAIManager.cpp | 36 ++++---- .../components/CCmpCommandQueue.cpp | 4 +- .../components/CCmpObstruction.cpp | 6 +- .../simulation2/components/CCmpPathfinder.cpp | 4 +- .../simulation2/components/CCmpPosition.cpp | 24 +++--- .../components/CCmpProjectileManager.cpp | 2 +- .../components/CCmpRallyPointRenderer.cpp | 2 +- .../components/CCmpRangeManager.cpp | 16 ++-- .../components/CCmpTemplateManager.cpp | 4 +- .../simulation2/components/CCmpUnitMotion.cpp | 2 +- .../components/CCmpVisualActor.cpp | 6 +- .../simulation2/components/ICmpVisibility.cpp | 2 +- .../scripting/EngineScriptConversions.cpp | 2 +- .../scripting/MessageTypeConversions.cpp | 22 ++--- .../simulation2/scripting/ScriptComponent.cpp | 6 +- .../simulation2/scripting/ScriptComponent.h | 4 +- .../serialization/BinarySerializer.cpp | 6 +- .../simulation2/system/ComponentManager.cpp | 18 ++-- .../system/ComponentManagerSerialization.cpp | 8 +- source/simulation2/system/ParamNode.cpp | 2 +- source/soundmanager/SoundManager.cpp | 10 +-- source/soundmanager/data/SoundData.cpp | 2 +- source/soundmanager/items/CSoundBase.cpp | 2 +- source/soundmanager/scripting/SoundGroup.cpp | 4 +- source/tools/atlas/GameInterface/GameLoop.cpp | 2 +- .../GameInterface/Handlers/MapHandlers.cpp | 8 +- .../GameInterface/Handlers/ObjectHandlers.cpp | 2 +- 112 files changed, 516 insertions(+), 516 deletions(-) diff --git a/source/graphics/ColladaManager.cpp b/source/graphics/ColladaManager.cpp index 35552e1f72..c6176d202a 100644 --- a/source/graphics/ColladaManager.cpp +++ b/source/graphics/ColladaManager.cpp @@ -42,11 +42,11 @@ namespace VfsPath* path = static_cast(cb_data); if (severity == LOG_INFO) - LOGMESSAGE(L"%ls: %hs", path->string().c_str(), text); + LOGMESSAGE("%ls: %hs", path->string().c_str(), text); else if (severity == LOG_WARNING) - LOGWARNING(L"%ls: %hs", path->string().c_str(), text); + LOGWARNING("%ls: %hs", path->string().c_str(), text); else - LOGERROR(L"%ls: %hs", path->string().c_str(), text); + LOGERROR("%ls: %hs", path->string().c_str(), text); } void ColladaOutput(void* cb_data, const char* data, unsigned int length) @@ -99,21 +99,21 @@ public: if (!dll.IsLoaded() && !TryLoadDLL()) return ERR::FAIL; - LOGMESSAGE(L"Hotloading skeleton definitions from '%ls'", path.string().c_str()); + LOGMESSAGE("Hotloading skeleton definitions from '%ls'", path.string().c_str()); // Set the filename for the logger to report set_logger(ColladaLog, const_cast(static_cast(&path))); CVFSFile skeletonFile; if (skeletonFile.Load(m_VFS, path) != PSRETURN_OK) { - LOGERROR(L"Failed to read skeleton defintions from '%ls'", path.string().c_str()); + LOGERROR("Failed to read skeleton defintions from '%ls'", path.string().c_str()); return ERR::FAIL; } int ok = set_skeleton_definitions((const char*)skeletonFile.GetBuffer(), (int)skeletonFile.GetBufferSize()); if (ok < 0) { - LOGERROR(L"Failed to load skeleton definitions from '%ls'", path.string().c_str()); + LOGERROR("Failed to load skeleton definitions from '%ls'", path.string().c_str()); return ERR::FAIL; } @@ -189,7 +189,7 @@ public: { if (!dll.LoadDLL()) { - LOGERROR(L"Failed to load COLLADA conversion DLL"); + LOGERROR("Failed to load COLLADA conversion DLL"); return false; } @@ -202,7 +202,7 @@ public: } catch (PSERROR_DllLoader&) { - LOGERROR(L"Failed to load symbols from COLLADA conversion DLL"); + LOGERROR("Failed to load symbols from COLLADA conversion DLL"); dll.Unload(); return false; } @@ -214,28 +214,28 @@ public: VfsPaths pathnames; if (vfs::GetPathnames(m_VFS, L"art/skeletons/", L"*.xml", pathnames) < 0) { - LOGERROR(L"No skeleton definition files present"); + LOGERROR("No skeleton definition files present"); return false; } bool loaded = false; for (VfsPaths::const_iterator it = pathnames.begin(); it != pathnames.end(); ++it) { - LOGMESSAGE(L"Loading skeleton definitions from '%ls'", it->string().c_str()); + LOGMESSAGE("Loading skeleton definitions from '%ls'", it->string().c_str()); // Set the filename for the logger to report set_logger(ColladaLog, const_cast(static_cast(&(*it)))); CVFSFile skeletonFile; if (skeletonFile.Load(m_VFS, *it) != PSRETURN_OK) { - LOGERROR(L"Failed to read skeleton defintions from '%ls'", it->string().c_str()); + LOGERROR("Failed to read skeleton defintions from '%ls'", it->string().c_str()); continue; } int ok = set_skeleton_definitions((const char*)skeletonFile.GetBuffer(), (int)skeletonFile.GetBufferSize()); if (ok < 0) { - LOGERROR(L"Failed to load skeleton definitions from '%ls'", it->string().c_str()); + LOGERROR("Failed to load skeleton definitions from '%ls'", it->string().c_str()); continue; } @@ -243,7 +243,7 @@ public: } if (!loaded) - LOGERROR(L"Failed to load any skeleton definitions"); + LOGERROR("Failed to load any skeleton definitions"); return loaded; } @@ -267,7 +267,7 @@ public: VfsPaths paths; if (vfs::GetPathnames(m_VFS, L"art/skeletons/", L"*.xml", paths) != INFO::OK) { - LOGWARNING(L"Failed to load skeleton definitions"); + LOGWARNING("Failed to load skeleton definitions"); return; } @@ -287,7 +287,7 @@ public: // should never happen, unless there really is a problem if (m_VFS->GetFileInfo(*it, &fileInfo) != INFO::OK) { - LOGERROR(L"Failed to stat '%ls' for DAE caching", it->string().c_str()); + LOGERROR("Failed to stat '%ls' for DAE caching", it->string().c_str()); } else { @@ -298,7 +298,7 @@ public: // Check if we were able to load any skeleton files if (m_skeletonHashes.empty()) - LOGERROR(L"Failed to stat any skeleton definitions for DAE caching"); + LOGERROR("Failed to stat any skeleton definitions for DAE caching"); // We can continue, something else will break if we try loading a skeletal model m_skeletonHashInvalidated = false; diff --git a/source/graphics/FontManager.cpp b/source/graphics/FontManager.cpp index c7180cecb1..c88fac2478 100644 --- a/source/graphics/FontManager.cpp +++ b/source/graphics/FontManager.cpp @@ -59,7 +59,7 @@ bool CFontManager::ReadFont(CFont* font, CStrIntern fontName) const VfsPath fntName(fontName.string() + ".fnt"); if (g_VFS->LoadFile(path / fntName, buf, size) < 0) { - LOGERROR(L"Failed to open font file %ls", (path / fntName).string().c_str()); + LOGERROR("Failed to open font file %ls", (path / fntName).string().c_str()); return false; } std::istringstream FNTStream(std::string((const char*)buf.get(), size)); @@ -68,7 +68,7 @@ bool CFontManager::ReadFont(CFont* font, CStrIntern fontName) FNTStream >> Version; if (Version != 101) // Make sure this is from a recent version of the font builder { - LOGERROR(L"Font %hs has invalid version", fontName.c_str()); + LOGERROR("Font %hs has invalid version", fontName.c_str()); return 0; } @@ -102,7 +102,7 @@ bool CFontManager::ReadFont(CFont* font, CStrIntern fontName) if (Codepoint < 0 || Codepoint > 0xFFFF) { - LOGWARNING(L"Font %hs has invalid codepoint 0x%x", fontName.c_str(), Codepoint); + LOGWARNING("Font %hs has invalid codepoint 0x%x", fontName.c_str(), Codepoint); continue; } diff --git a/source/graphics/LOSTexture.cpp b/source/graphics/LOSTexture.cpp index 2bde7bbf1a..ce6e13637a 100644 --- a/source/graphics/LOSTexture.cpp +++ b/source/graphics/LOSTexture.cpp @@ -82,7 +82,7 @@ bool CLOSTexture::CreateShader() if (!m_ShaderInitialized) { - LOGERROR(L"Failed to load SmoothLOS shader, disabling."); + LOGERROR("Failed to load SmoothLOS shader, disabling."); g_Renderer.m_Options.m_SmoothLOS = false; return false; } @@ -163,7 +163,7 @@ void CLOSTexture::InterpolateLOS() GLenum status = pglCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT); if (status != GL_FRAMEBUFFER_COMPLETE_EXT) { - LOGWARNING(L"LOS framebuffer object incomplete: 0x%04X", status); + LOGWARNING("LOS framebuffer object incomplete: 0x%04X", status); } m_smoothShader->BeginPass(); diff --git a/source/graphics/MapGenerator.cpp b/source/graphics/MapGenerator.cpp index 780ca790ec..2e7a14d9ca 100644 --- a/source/graphics/MapGenerator.cpp +++ b/source/graphics/MapGenerator.cpp @@ -111,7 +111,7 @@ bool CMapGeneratorWorker::Run() JS::RootedValue settingsVal(cx); if (!m_ScriptInterface->ParseJSON(m_Settings, &settingsVal) && settingsVal.isUndefined()) { - LOGERROR(L"CMapGeneratorWorker::Run: Failed to parse settings"); + LOGERROR("CMapGeneratorWorker::Run: Failed to parse settings"); return false; } @@ -119,7 +119,7 @@ bool CMapGeneratorWorker::Run() u32 seed; if (!m_ScriptInterface->GetProperty(settingsVal, "Seed", seed)) { // No seed specified - LOGWARNING(L"CMapGeneratorWorker::Run: No seed value specified - using 0"); + LOGWARNING("CMapGeneratorWorker::Run: No seed value specified - using 0"); seed = 0; } @@ -129,15 +129,15 @@ bool CMapGeneratorWorker::Run() JS::RootedValue global(cx, m_ScriptInterface->GetGlobalObject()); if (!m_ScriptInterface->SetProperty(global, "g_MapSettings", settingsVal)) { - LOGERROR(L"CMapGeneratorWorker::Run: Failed to define g_MapSettings"); + LOGERROR("CMapGeneratorWorker::Run: Failed to define g_MapSettings"); return false; } // Load RMS - LOGMESSAGE(L"Loading RMS '%ls'", m_ScriptPath.string().c_str()); + LOGMESSAGE("Loading RMS '%ls'", m_ScriptPath.string().c_str()); if (!m_ScriptInterface->LoadGlobalScriptFile(m_ScriptPath)) { - LOGERROR(L"CMapGeneratorWorker::Run: Failed to load RMS '%ls'", m_ScriptPath.string().c_str()); + LOGERROR("CMapGeneratorWorker::Run: Failed to load RMS '%ls'", m_ScriptPath.string().c_str()); return false; } @@ -210,7 +210,7 @@ std::vector CMapGeneratorWorker::GetCivData(ScriptInterface::CxPriv PSRETURN ret = file.Load(g_VFS, *it); if (ret != PSRETURN_OK) { - LOGERROR(L"CMapGeneratorWorker::GetCivData: Failed to load file '%ls': %hs", path.string().c_str(), GetErrorString(ret)); + LOGERROR("CMapGeneratorWorker::GetCivData: Failed to load file '%ls': %hs", path.string().c_str(), GetErrorString(ret)); } else { @@ -222,7 +222,7 @@ std::vector CMapGeneratorWorker::GetCivData(ScriptInterface::CxPriv { // Some error reading directory wchar_t error[200]; - LOGERROR(L"CMapGeneratorWorker::GetCivData: Error reading directory '%ls': %ls", path.string().c_str(), StatusDescription(ret, error, ARRAY_SIZE(error))); + LOGERROR("CMapGeneratorWorker::GetCivData: Error reading directory '%ls': %ls", path.string().c_str(), StatusDescription(ret, error, ARRAY_SIZE(error))); } return data; @@ -234,7 +234,7 @@ CParamNode CMapGeneratorWorker::GetTemplate(ScriptInterface::CxPrivate* pCxPriva CMapGeneratorWorker* self = static_cast(pCxPrivate->pCBData); const CParamNode& templateRoot = self->m_TemplateLoader.GetTemplateFileData(templateName).GetChild("Entity"); if (!templateRoot.IsOk()) - LOGERROR(L"Invalid template found for '%hs'", templateName.c_str()); + LOGERROR("Invalid template found for '%hs'", templateName.c_str()); return templateRoot; } @@ -271,11 +271,11 @@ bool CMapGeneratorWorker::LoadScripts(const std::wstring& libraryName) { for (VfsPaths::iterator it = pathnames.begin(); it != pathnames.end(); ++it) { - LOGMESSAGE(L"Loading map generator script '%ls'", it->string().c_str()); + LOGMESSAGE("Loading map generator script '%ls'", it->string().c_str()); if (!m_ScriptInterface->LoadGlobalScriptFile(*it)) { - LOGERROR(L"CMapGeneratorWorker::LoadScripts: Failed to load script '%ls'", it->string().c_str()); + LOGERROR("CMapGeneratorWorker::LoadScripts: Failed to load script '%ls'", it->string().c_str()); return false; } } @@ -284,7 +284,7 @@ bool CMapGeneratorWorker::LoadScripts(const std::wstring& libraryName) { // Some error reading directory wchar_t error[200]; - LOGERROR(L"CMapGeneratorWorker::LoadScripts: Error reading scripts in directory '%ls': %ls", path.string().c_str(), StatusDescription(ret, error, ARRAY_SIZE(error))); + LOGERROR("CMapGeneratorWorker::LoadScripts: Error reading scripts in directory '%ls': %ls", path.string().c_str(), StatusDescription(ret, error, ARRAY_SIZE(error))); return false; } diff --git a/source/graphics/MapReader.cpp b/source/graphics/MapReader.cpp index 090b70e47d..c6dccd012f 100644 --- a/source/graphics/MapReader.cpp +++ b/source/graphics/MapReader.cpp @@ -1052,7 +1052,7 @@ int CXMLReader::ReadEntities(XMBElement parent, double end_time) entity_id_t player = cmpPlayerManager->GetPlayerByID(PlayerID); if (ent == INVALID_ENTITY || player == INVALID_ENTITY) { // Don't add entities with invalid player IDs - LOGERROR(L"Failed to load entity template '%ls'", TemplateName.c_str()); + LOGERROR("Failed to load entity template '%ls'", TemplateName.c_str()); } else { @@ -1332,7 +1332,7 @@ int CMapReader::ParseTerrain() // an error here should stop the loading process #define GET_TERRAIN_PROPERTY(val, prop, out)\ if (!pSimulation2->GetScriptInterface().GetProperty(val, #prop, out))\ - { LOGERROR(L"CMapReader::ParseTerrain() failed to get '%hs' property", #prop);\ + { LOGERROR("CMapReader::ParseTerrain() failed to get '%hs' property", #prop);\ throw PSERROR_Game_World_MapLoadFailed("Error parsing terrain data.\nCheck application log for details"); } JS::RootedValue tmpMapData(cx, m_MapData.get()); // TODO: Check if this temporary root can be removed after SpiderMonkey 31 upgrade @@ -1411,7 +1411,7 @@ int CMapReader::ParseEntities() std::vector entities; if (!pSimulation2->GetScriptInterface().GetProperty(tmpMapData, "entities", entities)) - LOGWARNING(L"CMapReader::ParseEntities() failed to get 'entities' property"); + LOGWARNING("CMapReader::ParseEntities() failed to get 'entities' property"); CSimulation2& sim = *pSimulation2; CmpPtr cmpPlayerManager(sim, SYSTEM_ENTITY); @@ -1430,7 +1430,7 @@ int CMapReader::ParseEntities() entity_id_t player = cmpPlayerManager->GetPlayerByID(currEnt.playerID); if (ent == INVALID_ENTITY || player == INVALID_ENTITY) { // Don't add entities with invalid player IDs - LOGERROR(L"Failed to load entity template '%ls'", currEnt.templateName.c_str()); + LOGERROR("Failed to load entity template '%ls'", currEnt.templateName.c_str()); } else { @@ -1476,14 +1476,14 @@ int CMapReader::ParseEnvironment() #define GET_ENVIRONMENT_PROPERTY(val, prop, out)\ if (!pSimulation2->GetScriptInterface().GetProperty(val, #prop, out))\ - LOGWARNING(L"CMapReader::ParseEnvironment() failed to get '%hs' property", #prop); + LOGWARNING("CMapReader::ParseEnvironment() failed to get '%hs' property", #prop); JS::RootedValue envObj(cx); GET_ENVIRONMENT_PROPERTY(tmpMapData, Environment, &envObj) if (envObj.isUndefined()) { - LOGWARNING(L"CMapReader::ParseEnvironment(): Environment settings not found"); + LOGWARNING("CMapReader::ParseEnvironment(): Environment settings not found"); return 0; } @@ -1581,7 +1581,7 @@ int CMapReader::ParseCamera() #define GET_CAMERA_PROPERTY(val, prop, out)\ if (!pSimulation2->GetScriptInterface().GetProperty(val, #prop, out))\ - LOGWARNING(L"CMapReader::ParseCamera() failed to get '%hs' property", #prop); + LOGWARNING("CMapReader::ParseCamera() failed to get '%hs' property", #prop); JS::RootedValue tmpMapData(cx, m_MapData.get()); // TODO: Check if this temporary root can be removed after SpiderMonkey 31 upgrade JS::RootedValue cameraObj(cx); diff --git a/source/graphics/MapWriter.cpp b/source/graphics/MapWriter.cpp index 6b0044344f..be1c7786ce 100644 --- a/source/graphics/MapWriter.cpp +++ b/source/graphics/MapWriter.cpp @@ -71,7 +71,7 @@ void CMapWriter::SaveMap(const VfsPath& pathname, CTerrain* pTerrain, } catch (PSERROR_File_WriteFailed&) { - LOGERROR(L"Failed to write map '%ls'", pathname.string().c_str()); + LOGERROR("Failed to write map '%ls'", pathname.string().c_str()); return; } @@ -447,5 +447,5 @@ void CMapWriter::WriteXML(const VfsPath& filename, } } if (!XML_StoreVFS(g_VFS, filename)) - LOGERROR(L"Failed to write map '%ls'", filename.string().c_str()); + LOGERROR("Failed to write map '%ls'", filename.string().c_str()); } diff --git a/source/graphics/MeshManager.cpp b/source/graphics/MeshManager.cpp index 0a827d0922..3f0fda9db9 100644 --- a/source/graphics/MeshManager.cpp +++ b/source/graphics/MeshManager.cpp @@ -53,7 +53,7 @@ CModelDefPtr CMeshManager::GetMesh(const VfsPath& pathname) if (pmdFilename.empty()) { - LOGERROR(L"Could not load mesh '%ls'", pathname.string().c_str()); + LOGERROR("Could not load mesh '%ls'", pathname.string().c_str()); return CModelDefPtr(); } @@ -65,7 +65,7 @@ CModelDefPtr CMeshManager::GetMesh(const VfsPath& pathname) } catch (PSERROR_File&) { - LOGERROR(L"Could not load mesh '%ls'", pmdFilename.string().c_str()); + LOGERROR("Could not load mesh '%ls'", pmdFilename.string().c_str()); return CModelDefPtr(); } } diff --git a/source/graphics/Model.cpp b/source/graphics/Model.cpp index 127bbd5894..c4bb532d80 100644 --- a/source/graphics/Model.cpp +++ b/source/graphics/Model.cpp @@ -473,7 +473,7 @@ bool CModel::SetAnimation(CSkeletonAnim* anim, bool once) if (anim->m_AnimDef && anim->m_AnimDef->GetNumKeys() != m_pModelDef->GetNumBones()) { // mismatch between model's skeleton and animation's skeleton - LOGERROR(L"Mismatch between model's skeleton and animation's skeleton (%lu model bones != %lu animation keys)", + LOGERROR("Mismatch between model's skeleton and animation's skeleton (%lu model bones != %lu animation keys)", (unsigned long)m_pModelDef->GetNumBones(), (unsigned long)anim->m_AnimDef->GetNumKeys()); return false; } diff --git a/source/graphics/ModelAbstract.cpp b/source/graphics/ModelAbstract.cpp index aa56125cb7..769de5dc65 100644 --- a/source/graphics/ModelAbstract.cpp +++ b/source/graphics/ModelAbstract.cpp @@ -57,13 +57,13 @@ void CModelAbstract::CalcSelectionBox() { // TODO: unimplemented m_SelectionBox.SetEmpty(); - LOGWARNING(L"[ModelAbstract] TODO: Cylinder selection boxes are not yet implemented. Use BOX or BOUNDS selection shapes instead."); + LOGWARNING("[ModelAbstract] TODO: Cylinder selection boxes are not yet implemented. Use BOX or BOUNDS selection shapes instead."); } break; default: { m_SelectionBox.SetEmpty(); - //LOGWARNING(L"[ModelAbstract] Unrecognized selection shape type: %ld", m_CustomSelectionShape->m_Type); + //LOGWARNING("[ModelAbstract] Unrecognized selection shape type: %ld", m_CustomSelectionShape->m_Type); debug_warn("[ModelAbstract] Unrecognized selection shape type"); } break; diff --git a/source/graphics/ObjectBase.cpp b/source/graphics/ObjectBase.cpp index f55ff9ab00..2270005dc9 100644 --- a/source/graphics/ObjectBase.cpp +++ b/source/graphics/ObjectBase.cpp @@ -90,7 +90,7 @@ bool CObjectBase::Load(const VfsPath& pathname) if (root.GetNodeName() != el_actor) { - LOGERROR(L"Invalid actor format (unrecognised root element '%hs')", XeroFile.GetElementString(root.GetNodeName()).c_str()); + LOGERROR("Invalid actor format (unrecognised root element '%hs')", XeroFile.GetElementString(root.GetNodeName()).c_str()); return false; } @@ -266,7 +266,7 @@ bool CObjectBase::Load(const VfsPath& pathname) if (currentGroup->size() == 0) { - LOGERROR(L"Actor group has zero variants ('%ls')", pathname.string().c_str()); + LOGERROR("Actor group has zero variants ('%ls')", pathname.string().c_str()); } ++currentGroup; diff --git a/source/graphics/ObjectEntry.cpp b/source/graphics/ObjectEntry.cpp index 16b4e4834e..d9838dcd06 100644 --- a/source/graphics/ObjectEntry.cpp +++ b/source/graphics/ObjectEntry.cpp @@ -73,7 +73,7 @@ bool CObjectEntry::BuildVariation(const std::vector >& selections str << variation.color; int r, g, b; if (! (str >> r >> g >> b)) // Any trailing data is ignored - LOGERROR(L"Actor '%ls' has invalid RGB colour '%hs'", m_Base->m_ShortName.c_str(), variation.color.c_str()); + LOGERROR("Actor '%ls' has invalid RGB colour '%hs'", m_Base->m_ShortName.c_str(), variation.color.c_str()); else m_Color = CColor(r/255.0f, g/255.0f, b/255.0f, 1.0f); } @@ -119,7 +119,7 @@ bool CObjectEntry::BuildVariation(const std::vector >& selections CModelDefPtr modeldef (objectManager.GetMeshManager().GetMesh(m_ModelName)); if (!modeldef) { - LOGERROR(L"CObjectEntry::BuildVariation(): Model %ls failed to load", m_ModelName.string().c_str()); + LOGERROR("CObjectEntry::BuildVariation(): Model %ls failed to load", m_ModelName.string().c_str()); return false; } @@ -133,7 +133,7 @@ bool CObjectEntry::BuildVariation(const std::vector >& selections if (m_Samplers.size() == 0) { - LOGERROR(L"Actor '%ls' has no textures.", m_Base->m_ShortName.c_str()); + LOGERROR("Actor '%ls' has no textures.", m_Base->m_ShortName.c_str()); } std::vector::iterator samp; @@ -190,7 +190,7 @@ bool CObjectEntry::BuildVariation(const std::vector >& selections { // start up idling if (!model->SetAnimation(GetRandomAnimation("idle"))) - LOGERROR(L"Failed to set idle animation in model \"%ls\"", m_ModelName.string().c_str()); + LOGERROR("Failed to set idle animation in model \"%ls\"", m_ModelName.string().c_str()); } // build props - TODO, RC - need to fix up bounds here @@ -209,7 +209,7 @@ bool CObjectEntry::BuildVariation(const std::vector >& selections CObjectEntry* oe = objectManager.FindObjectVariation(prop.m_ModelName.c_str(), selections); if (!oe) { - LOGERROR(L"Failed to build prop model \"%ls\" on actor \"%ls\"", prop.m_ModelName.c_str(), m_Base->m_ShortName.c_str()); + LOGERROR("Failed to build prop model \"%ls\" on actor \"%ls\"", prop.m_ModelName.c_str(), m_Base->m_ShortName.c_str()); continue; } @@ -240,7 +240,7 @@ bool CObjectEntry::BuildVariation(const std::vector >& selections propmodel->ToCModel()->SetAnimation(oe->GetRandomAnimation("idle")); } else - LOGERROR(L"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()); + 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()); } // setup flags diff --git a/source/graphics/ObjectManager.cpp b/source/graphics/ObjectManager.cpp index b8bd6b8b41..8101364143 100644 --- a/source/graphics/ObjectManager.cpp +++ b/source/graphics/ObjectManager.cpp @@ -96,7 +96,7 @@ CObjectBase* CObjectManager::FindObjectBase(const CStrW& objectname) else delete obj; - LOGERROR(L"CObjectManager::FindObjectBase(): Cannot find object '%ls'", objectname.c_str()); + LOGERROR("CObjectManager::FindObjectBase(): Cannot find object '%ls'", objectname.c_str()); return 0; } diff --git a/source/graphics/ParticleEmitterType.cpp b/source/graphics/ParticleEmitterType.cpp index 657feed7a3..7ecd4030e8 100644 --- a/source/graphics/ParticleEmitterType.cpp +++ b/source/graphics/ParticleEmitterType.cpp @@ -329,7 +329,7 @@ int CParticleEmitterType::GetVariableID(const std::string& name) if (name == "color.r") return VAR_COLOR_R; if (name == "color.g") return VAR_COLOR_G; if (name == "color.b") return VAR_COLOR_B; - LOGWARNING(L"Particle sets unknown variable '%hs'", name.c_str()); + LOGWARNING("Particle sets unknown variable '%hs'", name.c_str()); return -1; } diff --git a/source/graphics/ShaderManager.cpp b/source/graphics/ShaderManager.cpp index 929123c9ac..dcb3f1ce60 100644 --- a/source/graphics/ShaderManager.cpp +++ b/source/graphics/ShaderManager.cpp @@ -49,11 +49,11 @@ CShaderManager::CShaderManager() TIMER_ACCRUE(tc_ShaderValidation); CVFSFile grammar; if (grammar.Load(g_VFS, L"shaders/program.rng") != PSRETURN_OK) - LOGERROR(L"Failed to read grammar shaders/program.rng"); + LOGERROR("Failed to read grammar shaders/program.rng"); else { if (!m_Validator.LoadGrammar(grammar.GetAsString())) - LOGERROR(L"Failed to load grammar shaders/program.rng"); + LOGERROR("Failed to load grammar shaders/program.rng"); } } #endif @@ -77,7 +77,7 @@ CShaderProgramPtr CShaderManager::LoadProgram(const char* name, const CShaderDef CShaderProgramPtr program; if (!NewProgram(name, defines, program)) { - LOGERROR(L"Failed to load shader '%hs'", name); + LOGERROR("Failed to load shader '%hs'", name); program = CShaderProgramPtr(); } @@ -378,7 +378,7 @@ CShaderTechniquePtr CShaderManager::LoadEffect(CStrIntern name, const CShaderDef CShaderTechniquePtr tech(new CShaderTechnique()); if (!NewEffect(name.c_str(), defines, tech)) { - LOGERROR(L"Failed to load effect '%hs'", name.c_str()); + LOGERROR("Failed to load effect '%hs'", name.c_str()); tech = CShaderTechniquePtr(); } diff --git a/source/graphics/ShaderProgram.cpp b/source/graphics/ShaderProgram.cpp index 817ff41d73..82e7140af1 100644 --- a/source/graphics/ShaderProgram.cpp +++ b/source/graphics/ShaderProgram.cpp @@ -71,7 +71,7 @@ public: glGetIntegerv(GL_PROGRAM_ERROR_POSITION_ARB, &errPos); int errLine = std::count(code.begin(), code.begin() + std::min((int)code.length(), errPos + 1), '\n') + 1; char* errStr = (char*)glGetString(GL_PROGRAM_ERROR_STRING_ARB); - LOGERROR(L"Failed to compile %hs program '%ls' (line %d):\n%hs", targetName, file.string().c_str(), errLine, errStr); + LOGERROR("Failed to compile %hs program '%ls' (line %d):\n%hs", targetName, file.string().c_str(), errLine, errStr); return false; } @@ -310,9 +310,9 @@ public: pglGetShaderInfoLog(shader, length, NULL, infolog); if (ok) - LOGMESSAGE(L"Info when compiling shader '%ls':\n%hs", file.string().c_str(), infolog); + LOGMESSAGE("Info when compiling shader '%ls':\n%hs", file.string().c_str(), infolog); else - LOGERROR(L"Failed to compile shader '%ls':\n%hs", file.string().c_str(), infolog); + LOGERROR("Failed to compile shader '%ls':\n%hs", file.string().c_str(), infolog); delete[] infolog; } @@ -357,9 +357,9 @@ public: pglGetProgramInfoLog(m_Program, length, NULL, infolog); if (ok) - LOGMESSAGE(L"Info when linking program '%ls'+'%ls':\n%hs", m_VertexFile.string().c_str(), m_FragmentFile.string().c_str(), infolog); + LOGMESSAGE("Info when linking program '%ls'+'%ls':\n%hs", m_VertexFile.string().c_str(), m_FragmentFile.string().c_str(), infolog); else - LOGERROR(L"Failed to link program '%ls'+'%ls':\n%hs", m_VertexFile.string().c_str(), m_FragmentFile.string().c_str(), infolog); + LOGERROR("Failed to link program '%ls'+'%ls':\n%hs", m_VertexFile.string().c_str(), m_FragmentFile.string().c_str(), infolog); delete[] infolog; } @@ -561,7 +561,7 @@ public: else if (id.second == GL_FLOAT_VEC4) pglUniform4fARB(id.first, v0, v1, v2, v3); else - LOGERROR(L"CShaderProgramGLSL::Uniform(): Invalid uniform type (expected float, vec2, vec3, vec4)"); + LOGERROR("CShaderProgramGLSL::Uniform(): Invalid uniform type (expected float, vec2, vec3, vec4)"); } } @@ -572,7 +572,7 @@ public: if (id.second == GL_FLOAT_MAT4) pglUniformMatrix4fvARB(id.first, 1, GL_FALSE, &v._11); else - LOGERROR(L"CShaderProgramGLSL::Uniform(): Invalid uniform type (expected mat4)"); + LOGERROR("CShaderProgramGLSL::Uniform(): Invalid uniform type (expected mat4)"); } } @@ -583,7 +583,7 @@ public: if (id.second == GL_FLOAT_MAT4) pglUniformMatrix4fvARB(id.first, count, GL_FALSE, &v->_11); else - LOGERROR(L"CShaderProgramGLSL::Uniform(): Invalid uniform type (expected mat4)"); + LOGERROR("CShaderProgramGLSL::Uniform(): Invalid uniform type (expected mat4)"); } } @@ -663,7 +663,7 @@ CShaderProgram::CShaderProgram(int streamflags) const std::map& UNUSED(vertexIndexes), const std::map& UNUSED(fragmentIndexes), int UNUSED(streamflags)) { - LOGERROR(L"CShaderProgram::ConstructARB: '%ls'+'%ls': ARB shaders not supported on this device", + LOGERROR("CShaderProgram::ConstructARB: '%ls'+'%ls': ARB shaders not supported on this device", vertexFile.string().c_str(), fragmentFile.string().c_str()); return NULL; } diff --git a/source/graphics/ShaderProgramFFP.cpp b/source/graphics/ShaderProgramFFP.cpp index a3ec42bbb0..771bdd54ac 100644 --- a/source/graphics/ShaderProgramFFP.cpp +++ b/source/graphics/ShaderProgramFFP.cpp @@ -1159,7 +1159,7 @@ public: if (id == "model_solid_tex") return new CShaderProgramFFP_ModelSolidTex(defines); - LOGERROR(L"CShaderProgram::ConstructFFP: '%hs': Invalid id", id.c_str()); + LOGERROR("CShaderProgram::ConstructFFP: '%hs': Invalid id", id.c_str()); debug_warn(L"CShaderProgram::ConstructFFP: Invalid id"); return NULL; } diff --git a/source/graphics/SkeletonAnimManager.cpp b/source/graphics/SkeletonAnimManager.cpp index 80bb3367e5..2d99118215 100644 --- a/source/graphics/SkeletonAnimManager.cpp +++ b/source/graphics/SkeletonAnimManager.cpp @@ -65,7 +65,7 @@ CSkeletonAnimDef* CSkeletonAnimManager::GetAnimation(const VfsPath& pathname) if (psaFilename.empty()) { - LOGERROR(L"Could not load animation '%ls'", pathname.string().c_str()); + LOGERROR("Could not load animation '%ls'", pathname.string().c_str()); def = NULL; } else @@ -76,14 +76,14 @@ CSkeletonAnimDef* CSkeletonAnimManager::GetAnimation(const VfsPath& pathname) } catch (PSERROR_File&) { - LOGERROR(L"Could not load animation '%ls'", psaFilename.string().c_str()); + LOGERROR("Could not load animation '%ls'", psaFilename.string().c_str()); } } if (def) - LOGMESSAGE(L"CSkeletonAnimManager::GetAnimation(%ls): Loaded successfully", pathname.string().c_str()); + LOGMESSAGE("CSkeletonAnimManager::GetAnimation(%ls): Loaded successfully", pathname.string().c_str()); else - LOGERROR(L"CSkeletonAnimManager::GetAnimation(%ls): Failed loading, marked file as bad", pathname.string().c_str()); + LOGERROR("CSkeletonAnimManager::GetAnimation(%ls): Failed loading, marked file as bad", pathname.string().c_str()); // Add to map 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 7429dce27c..a15b043edb 100644 --- a/source/graphics/TerrainTextureEntry.cpp +++ b/source/graphics/TerrainTextureEntry.cpp @@ -47,7 +47,7 @@ CTerrainTextureEntry::CTerrainTextureEntry(CTerrainPropertiesPtr properties, con CXeromyces XeroFile; if (XeroFile.Load(g_VFS, path) != PSRETURN_OK) { - LOGERROR(L"Terrain xml not found (%hs)", path.string().c_str()); + LOGERROR("Terrain xml not found (%hs)", path.string().c_str()); return; } @@ -70,7 +70,7 @@ CTerrainTextureEntry::CTerrainTextureEntry(CTerrainPropertiesPtr properties, con if (root.GetNodeName() != el_terrain) { - LOGERROR(L"Invalid terrain format (unrecognised root element '%hs')", XeroFile.GetElementString(root.GetNodeName()).c_str()); + LOGERROR("Invalid terrain format (unrecognised root element '%hs')", XeroFile.GetElementString(root.GetNodeName()).c_str()); return; } diff --git a/source/graphics/TerrainTextureManager.cpp b/source/graphics/TerrainTextureManager.cpp index 5913c105b6..7add3d5589 100644 --- a/source/graphics/TerrainTextureManager.cpp +++ b/source/graphics/TerrainTextureManager.cpp @@ -89,7 +89,7 @@ CTerrainTextureEntry* CTerrainTextureManager::FindTexture(const CStr& tag_) return m_TextureEntries[i]; } - LOGWARNING(L"CTerrainTextureManager: Couldn't find terrain %hs", tag.c_str()); + LOGWARNING("CTerrainTextureManager: Couldn't find terrain %hs", tag.c_str()); return 0; } @@ -141,7 +141,7 @@ void CTerrainTextureManager::LoadTextures(const CTerrainPropertiesPtr& props, co void CTerrainTextureManager::RecurseDirectory(const CTerrainPropertiesPtr& parentProps, const VfsPath& path) { - //LOGMESSAGE(L"CTextureManager::RecurseDirectory(%ls)", path.string().c_str()); + //LOGMESSAGE("CTextureManager::RecurseDirectory(%ls)", path.string().c_str()); CTerrainPropertiesPtr props; @@ -153,7 +153,7 @@ void CTerrainTextureManager::RecurseDirectory(const CTerrainPropertiesPtr& paren // No terrains.xml, or read failures -> use parent props (i.e. if (!props) { - LOGMESSAGE(L"CTerrainTextureManager::RecurseDirectory(%ls): no terrains.xml (or errors while loading) - using parent properties", path.string().c_str()); + LOGMESSAGE("CTerrainTextureManager::RecurseDirectory(%ls): no terrains.xml (or errors while loading) - using parent properties", path.string().c_str()); props = parentProps; } diff --git a/source/graphics/TextureConverter.cpp b/source/graphics/TextureConverter.cpp index aadca03a90..a855587ca4 100644 --- a/source/graphics/TextureConverter.cpp +++ b/source/graphics/TextureConverter.cpp @@ -120,7 +120,7 @@ CTextureConverter::SettingsFile* CTextureConverter::LoadSettings(const VfsPath& if (root.GetNodeName() != el_textures) { - LOGERROR(L"Invalid texture settings file \"%ls\" (unrecognised root element)", path.string().c_str()); + LOGERROR("Invalid texture settings file \"%ls\" (unrecognised root element)", path.string().c_str()); return NULL; } @@ -152,7 +152,7 @@ CTextureConverter::SettingsFile* CTextureConverter::LoadSettings(const VfsPath& else if (v == "alpha") p.settings.format = FMT_ALPHA; else - LOGERROR(L"Invalid attribute value ", v.c_str()); + LOGERROR("Invalid attribute value ", v.c_str()); } else if (attr.Name == at_mipmap) { @@ -162,7 +162,7 @@ CTextureConverter::SettingsFile* CTextureConverter::LoadSettings(const VfsPath& else if (v == "false") p.settings.mipmap = MIP_FALSE; else - LOGERROR(L"Invalid attribute value ", v.c_str()); + LOGERROR("Invalid attribute value ", v.c_str()); } else if (attr.Name == at_normal) { @@ -172,7 +172,7 @@ CTextureConverter::SettingsFile* CTextureConverter::LoadSettings(const VfsPath& else if (v == "false") p.settings.normal = NORMAL_FALSE; else - LOGERROR(L"Invalid attribute value ", v.c_str()); + LOGERROR("Invalid attribute value ", v.c_str()); } else if (attr.Name == at_alpha) { @@ -184,7 +184,7 @@ CTextureConverter::SettingsFile* CTextureConverter::LoadSettings(const VfsPath& else if (v == "transparency") p.settings.alpha = ALPHA_TRANSPARENCY; else - LOGERROR(L"Invalid attribute value ", v.c_str()); + LOGERROR("Invalid attribute value ", v.c_str()); } else if (attr.Name == at_filter) { @@ -196,7 +196,7 @@ CTextureConverter::SettingsFile* CTextureConverter::LoadSettings(const VfsPath& else if (v == "kaiser") p.settings.filter = FILTER_KAISER; else - LOGERROR(L"Invalid attribute value ", v.c_str()); + LOGERROR("Invalid attribute value ", v.c_str()); } else if (attr.Name == at_kaiserwidth) { @@ -212,7 +212,7 @@ CTextureConverter::SettingsFile* CTextureConverter::LoadSettings(const VfsPath& } else { - LOGERROR(L"Invalid attribute name ", XeroFile.GetAttributeString(attr.Name).c_str()); + LOGERROR("Invalid attribute name ", XeroFile.GetAttributeString(attr.Name).c_str()); } } @@ -326,14 +326,14 @@ bool CTextureConverter::ConvertTexture(const CTexturePtr& texture, const VfsPath size_t fileSize; if (m_VFS->LoadFile(src, file, fileSize) < 0) { - LOGERROR(L"Failed to load texture \"%ls\"", src.string().c_str()); + LOGERROR("Failed to load texture \"%ls\"", src.string().c_str()); return false; } Tex tex; if (tex.decode(file, fileSize) < 0) { - LOGERROR(L"Failed to decode texture \"%ls\"", src.string().c_str()); + LOGERROR("Failed to decode texture \"%ls\"", src.string().c_str()); return false; } @@ -345,7 +345,7 @@ bool CTextureConverter::ConvertTexture(const CTexturePtr& texture, const VfsPath // Convert to uncompressed 8-bit with no mipmaps if (tex.transform_to((tex.m_Flags | TEX_GREY) & ~(TEX_DXT | TEX_MIPMAPS | TEX_ALPHA)) < 0) { - LOGERROR(L"Failed to transform texture \"%ls\"", src.string().c_str()); + LOGERROR("Failed to transform texture \"%ls\"", src.string().c_str()); return false; } } @@ -356,14 +356,14 @@ bool CTextureConverter::ConvertTexture(const CTexturePtr& texture, const VfsPath // (plain_transform doesn't know how to construct the alpha channel) if (tex.m_Flags & TEX_GREY) { - LOGERROR(L"Failed to convert grayscale texture \"%ls\" - only RGB textures are currently supported", src.string().c_str()); + LOGERROR("Failed to convert grayscale texture \"%ls\" - only RGB textures are currently supported", src.string().c_str()); return false; } // Convert to uncompressed BGRA with no mipmaps if (tex.transform_to((tex.m_Flags | TEX_BGR | TEX_ALPHA) & ~(TEX_DXT | TEX_MIPMAPS)) < 0) { - LOGERROR(L"Failed to transform texture \"%ls\"", src.string().c_str()); + LOGERROR("Failed to transform texture \"%ls\"", src.string().c_str()); return false; } } @@ -482,7 +482,7 @@ bool CTextureConverter::ConvertTexture(const CTexturePtr& texture, const VfsPath return true; #else - LOGERROR(L"Failed to convert texture \"%ls\" (NVTT not available)", src.string().c_str()); + LOGERROR("Failed to convert texture \"%ls\" (NVTT not available)", src.string().c_str()); return false; #endif } diff --git a/source/graphics/TextureManager.cpp b/source/graphics/TextureManager.cpp index bfccc8ba95..33eff6487e 100644 --- a/source/graphics/TextureManager.cpp +++ b/source/graphics/TextureManager.cpp @@ -178,7 +178,7 @@ public: Handle h = ogl_tex_load(m_VFS, path, RES_UNIQUE); if (h <= 0) { - LOGERROR(L"Texture failed to load; \"%ls\"", texture->m_Properties.m_Path.string().c_str()); + LOGERROR("Texture failed to load; \"%ls\"", texture->m_Properties.m_Path.string().c_str()); // Replace with error texture to make it obvious texture->SetHandle(m_ErrorHandle); @@ -218,7 +218,7 @@ public: // Upload to GL if (!m_DisableGL && ogl_tex_upload(h, texture->m_Properties.m_Format) < 0) { - LOGERROR(L"Texture failed to upload: \"%ls\"", texture->m_Properties.m_Path.string().c_str()); + LOGERROR("Texture failed to upload: \"%ls\"", texture->m_Properties.m_Path.string().c_str()); ogl_tex_free(h); @@ -277,7 +277,7 @@ public: // No source file or archive cache was found, so we can't load the // real texture at all - return the error texture instead - LOGERROR(L"CCacheLoader failed to find archived or source file for: \"%ls\"", texture->m_Properties.m_Path.string().c_str()); + LOGERROR("CCacheLoader failed to find archived or source file for: \"%ls\"", texture->m_Properties.m_Path.string().c_str()); texture->SetHandle(m_ErrorHandle); return true; } @@ -299,7 +299,7 @@ public: PrepareCacheKey(texture, hash, version); VfsPath looseCachePath = m_CacheLoader.LooseCachePath(sourcePath, hash, version); -// LOGWARNING(L"Converting texture \"%ls\"", srcPath.c_str()); +// LOGWARNING("Converting texture \"%ls\"", srcPath.c_str()); CTextureConverter::Settings settings = GetConverterSettings(texture); @@ -345,7 +345,7 @@ public: } else { - LOGERROR(L"Texture failed to convert: \"%ls\"", texture->m_Properties.m_Path.string().c_str()); + LOGERROR("Texture failed to convert: \"%ls\"", texture->m_Properties.m_Path.string().c_str()); texture->SetHandle(m_ErrorHandle); } texture->m_State = CTexture::LOADED; diff --git a/source/graphics/scripting/JSInterface_GameView.cpp b/source/graphics/scripting/JSInterface_GameView.cpp index b5c0b130ad..22e1c7f12e 100644 --- a/source/graphics/scripting/JSInterface_GameView.cpp +++ b/source/graphics/scripting/JSInterface_GameView.cpp @@ -28,7 +28,7 @@ bool JSI_GameView::Get##NAME##Enabled(ScriptInterface::CxPrivate* UNUSED(pCxPriv { \ if (!g_Game || !g_Game->GetView()) \ { \ - LOGERROR(L"Trying to get a setting from GameView when it's not initialized!"); \ + LOGERROR("Trying to get a setting from GameView when it's not initialized!"); \ return false; \ } \ return g_Game->GetView()->Get##NAME##Enabled(); \ @@ -38,7 +38,7 @@ void JSI_GameView::Set##NAME##Enabled(ScriptInterface::CxPrivate* UNUSED(pCxPriv { \ if (!g_Game || !g_Game->GetView()) \ { \ - LOGERROR(L"Trying to set a setting of GameView when it's not initialized!"); \ + LOGERROR("Trying to set a setting of GameView when it's not initialized!"); \ return; \ } \ g_Game->GetView()->Set##NAME##Enabled(Enabled); \ diff --git a/source/gui/CGUI.cpp b/source/gui/CGUI.cpp index 51e33f8c71..e32395b40f 100644 --- a/source/gui/CGUI.cpp +++ b/source/gui/CGUI.cpp @@ -380,7 +380,7 @@ void CGUI::Draw() } catch (PSERROR_GUI& e) { - LOGERROR(L"GUI draw error: %hs", e.what()); + LOGERROR("GUI draw error: %hs", e.what()); } } @@ -969,7 +969,7 @@ void CGUI::LoadXmlFile(const VfsPath& Filename, boost::unordered_set& P } catch (PSERROR_GUI& e) { - LOGERROR(L"Errors loading GUI file %ls (%u)", Filename.string().c_str(), e.getCode()); + LOGERROR("Errors loading GUI file %ls (%u)", Filename.string().c_str(), e.getCode()); return; } } @@ -1091,7 +1091,7 @@ void CGUI::Xeromyces_ReadObject(XMBElement Element, CXeromyces* pFile, IGUIObjec if (!object) { // Report error that object was unsuccessfully loaded - LOGERROR(L"GUI: Unrecognized object type \"%hs\"", type.c_str()); + LOGERROR("GUI: Unrecognized object type \"%hs\"", type.c_str()); return; } @@ -1133,7 +1133,7 @@ void CGUI::Xeromyces_ReadObject(XMBElement Element, CXeromyces* pFile, IGUIObjec { // additional check if (m_Styles.count(argStyle) == 0) - LOGERROR(L"GUI: Trying to use style '%hs' that doesn't exist.", argStyle.c_str()); + LOGERROR("GUI: Trying to use style '%hs' that doesn't exist.", argStyle.c_str()); else object->LoadStyle(*this, argStyle); } @@ -1185,7 +1185,7 @@ void CGUI::Xeromyces_ReadObject(XMBElement Element, CXeromyces* pFile, IGUIObjec // Try setting the value if (object->SetSetting(pFile->GetAttributeString(attr.Name), attr.Value.FromUTF8(), true) != PSRETURN_OK) { - LOGERROR(L"GUI: (object: %hs) Can't set \"%hs\" to \"%ls\"", object->GetPresentableName().c_str(), pFile->GetAttributeString(attr.Name).c_str(), attr.Value.FromUTF8().c_str()); + LOGERROR("GUI: (object: %hs) Can't set \"%hs\" to \"%ls\"", object->GetPresentableName().c_str(), pFile->GetAttributeString(attr.Name).c_str(), attr.Value.FromUTF8().c_str()); // This is not a fatal error } @@ -1248,7 +1248,7 @@ void CGUI::Xeromyces_ReadObject(XMBElement Element, CXeromyces* pFile, IGUIObjec CVFSFile scriptfile; if (scriptfile.Load(g_VFS, filename) != PSRETURN_OK) { - LOGERROR(L"Error opening GUI script action file '%ls'", filename.c_str()); + LOGERROR("Error opening GUI script action file '%ls'", filename.c_str()); throw PSERROR_GUI_JSOpenFailed(); } @@ -1293,7 +1293,7 @@ void CGUI::Xeromyces_ReadObject(XMBElement Element, CXeromyces* pFile, IGUIObjec CStr attributeName(child.GetAttributes().GetNamedItem(attr_id)); // Read the attribute name. if (attributeName.empty()) { - LOGERROR(L"GUI: ‘translatableAttribute’ XML element with empty ‘id’ XML attribute found. (object: %hs)", object->GetPresentableName().c_str()); + LOGERROR("GUI: ‘translatableAttribute’ XML element with empty ‘id’ XML attribute found. (object: %hs)", object->GetPresentableName().c_str()); continue; } @@ -1320,7 +1320,7 @@ void CGUI::Xeromyces_ReadObject(XMBElement Element, CXeromyces* pFile, IGUIObjec CStr attributeName(child.GetAttributes().GetNamedItem(attr_id)); // Read the attribute name. if (attributeName.empty()) { - LOGERROR(L"GUI: ‘attribute’ XML element with empty ‘id’ XML attribute found. (object: %hs)", object->GetPresentableName().c_str()); + LOGERROR("GUI: ‘attribute’ XML element with empty ‘id’ XML attribute found. (object: %hs)", object->GetPresentableName().c_str()); continue; } @@ -1348,21 +1348,21 @@ void CGUI::Xeromyces_ReadObject(XMBElement Element, CXeromyces* pFile, IGUIObjec if (!filename.empty()) { if (!directory.empty()) - LOGWARNING(L"GUI: Include element found with file name (%ls) and directory name (%ls). Only the file will be processed.", filename.c_str(), directory.c_str()); + LOGWARNING("GUI: Include element found with file name (%ls) and directory name (%ls). Only the file will be processed.", filename.c_str(), directory.c_str()); Paths.insert(filename); CXeromyces XeroIncluded; if (XeroIncluded.Load(g_VFS, filename) != PSRETURN_OK) { - LOGERROR(L"GUI: Error reading included XML: '%ls'", filename.c_str()); + LOGERROR("GUI: Error reading included XML: '%ls'", filename.c_str()); continue; } XMBElement node = XeroIncluded.GetRoot(); if (node.GetNodeName() != XeroIncluded.GetElementID("object")) { - LOGERROR(L"GUI: Error reading included XML: '%ls', root element must have be of type 'object'.", filename.c_str()); + LOGERROR("GUI: Error reading included XML: '%ls', root element must have be of type 'object'.", filename.c_str()); continue; } Xeromyces_ReadObject(node, &XeroIncluded, object, NameSubst, Paths, nesting_depth+1); @@ -1379,14 +1379,14 @@ void CGUI::Xeromyces_ReadObject(XMBElement Element, CXeromyces* pFile, IGUIObjec CXeromyces XeroIncluded; if (XeroIncluded.Load(g_VFS, *it) != PSRETURN_OK) { - LOGERROR(L"GUI: Error reading included XML: '%ls'", (*it).string().c_str()); + LOGERROR("GUI: Error reading included XML: '%ls'", (*it).string().c_str()); continue; } XMBElement node = XeroIncluded.GetRoot(); if (node.GetNodeName() != XeroIncluded.GetElementID("object")) { - LOGERROR(L"GUI: Error reading included XML: '%ls', root element must have be of type 'object'.", (*it).string().c_str()); + LOGERROR("GUI: Error reading included XML: '%ls', root element must have be of type 'object'.", (*it).string().c_str()); continue; } Xeromyces_ReadObject(node, &XeroIncluded, object, NameSubst, Paths, nesting_depth+1); @@ -1394,14 +1394,14 @@ void CGUI::Xeromyces_ReadObject(XMBElement Element, CXeromyces* pFile, IGUIObjec } else - LOGERROR(L"GUI: 'include' XML element must have valid 'file' or 'directory' attribute found. (object %hs)", object->GetPresentableName().c_str()); + LOGERROR("GUI: 'include' XML element must have valid 'file' or 'directory' attribute found. (object %hs)", object->GetPresentableName().c_str()); } else { // Try making the object read the tag. if (!object->HandleAdditionalChildren(child, pFile)) { - LOGERROR(L"GUI: (object: %hs) Reading unknown children for its type", object->GetPresentableName().c_str()); + LOGERROR("GUI: (object: %hs) Reading unknown children for its type", object->GetPresentableName().c_str()); } } } @@ -1442,7 +1442,7 @@ void CGUI::Xeromyces_ReadObject(XMBElement Element, CXeromyces* pFile, IGUIObjec } catch (PSERROR_GUI& e) { - LOGERROR(L"GUI error: %hs", e.what()); + LOGERROR("GUI error: %hs", e.what()); } } @@ -1491,7 +1491,7 @@ void CGUI::Xeromyces_ReadScript(XMBElement Element, CXeromyces* pFile, boost::un } catch (PSERROR_Scripting& e) { - LOGERROR(L"GUI: Error executing script %ls: %hs", file.c_str(), e.what()); + LOGERROR("GUI: Error executing script %ls: %hs", file.c_str(), e.what()); } } @@ -1512,7 +1512,7 @@ void CGUI::Xeromyces_ReadScript(XMBElement Element, CXeromyces* pFile, boost::un } catch (PSERROR_Scripting& e) { - LOGERROR(L"GUI: Error executing script %ls: %hs", (*it).string().c_str(), e.what()); + LOGERROR("GUI: Error executing script %ls: %hs", (*it).string().c_str(), e.what()); } } } @@ -1527,7 +1527,7 @@ void CGUI::Xeromyces_ReadScript(XMBElement Element, CXeromyces* pFile, boost::un } catch (PSERROR_Scripting& e) { - LOGERROR(L"GUI: Error executing inline script: %hs", e.what()); + LOGERROR("GUI: Error executing inline script: %hs", e.what()); } } @@ -1547,7 +1547,7 @@ void CGUI::Xeromyces_ReadSprite(XMBElement Element, CXeromyces* pFile) name = Element.GetAttributes().GetNamedItem( pFile->GetAttributeID("name") ); if (m_Sprites.find(name) != m_Sprites.end()) - LOGWARNING(L"GUI sprite name '%hs' used more than once; first definition will be discarded", name.c_str()); + LOGWARNING("GUI sprite name '%hs' used more than once; first definition will be discarded", name.c_str()); // // Read Children (the images) @@ -1573,7 +1573,7 @@ void CGUI::Xeromyces_ReadSprite(XMBElement Element, CXeromyces* pFile) { if (effects) { - LOGERROR(L"GUI must not have more than one "); + LOGERROR("GUI must not have more than one "); } else { @@ -1636,7 +1636,7 @@ void CGUI::Xeromyces_ReadImage(XMBElement Element, CXeromyces* pFile, CGUISprite { CClientArea ca; if (!GUI::ParseString(attr_value, ca)) - LOGERROR(L"GUI: Error parsing '%hs' (\"%ls\")", attr_name.c_str(), attr_value.c_str()); + LOGERROR("GUI: Error parsing '%hs' (\"%ls\")", attr_name.c_str(), attr_value.c_str()); else Image->m_Size = ca; } else @@ -1644,7 +1644,7 @@ void CGUI::Xeromyces_ReadImage(XMBElement Element, CXeromyces* pFile, CGUISprite { CClientArea ca; if (!GUI::ParseString(attr_value, ca)) - LOGERROR(L"GUI: Error parsing '%hs' (\"%ls\")", attr_name.c_str(), attr_value.c_str()); + LOGERROR("GUI: Error parsing '%hs' (\"%ls\")", attr_name.c_str(), attr_value.c_str()); else Image->m_TextureSize = ca; } else @@ -1652,7 +1652,7 @@ void CGUI::Xeromyces_ReadImage(XMBElement Element, CXeromyces* pFile, CGUISprite { CRect rect; if (!GUI::ParseString(attr_value, rect)) - LOGERROR(L"GUI: Error parsing '%hs' (\"%ls\")", attr_name.c_str(), attr_value.c_str()); + LOGERROR("GUI: Error parsing '%hs' (\"%ls\")", attr_name.c_str(), attr_value.c_str()); else Image->m_TexturePlacementInFile = rect; } else @@ -1660,7 +1660,7 @@ void CGUI::Xeromyces_ReadImage(XMBElement Element, CXeromyces* pFile, CGUISprite { CSize size; if (!GUI::ParseString(attr_value, size)) - LOGERROR(L"GUI: Error parsing '%hs' (\"%ls\")", attr_name.c_str(), attr_value.c_str()); + LOGERROR("GUI: Error parsing '%hs' (\"%ls\")", attr_name.c_str(), attr_value.c_str()); else Image->m_CellSize = size; } else @@ -1668,7 +1668,7 @@ void CGUI::Xeromyces_ReadImage(XMBElement Element, CXeromyces* pFile, CGUISprite { float val; if (!GUI::ParseString(attr_value, val)) - LOGERROR(L"GUI: Error parsing '%hs' (\"%ls\")", attr_name.c_str(), attr_value.c_str()); + LOGERROR("GUI: Error parsing '%hs' (\"%ls\")", attr_name.c_str(), attr_value.c_str()); else Image->m_FixedHAspectRatio = val; } else @@ -1676,7 +1676,7 @@ void CGUI::Xeromyces_ReadImage(XMBElement Element, CXeromyces* pFile, CGUISprite { bool b; if (!GUI::ParseString(attr_value, b)) - LOGERROR(L"GUI: Error parsing '%hs' (\"%ls\")", attr_name.c_str(), attr_value.c_str()); + LOGERROR("GUI: Error parsing '%hs' (\"%ls\")", attr_name.c_str(), attr_value.c_str()); else Image->m_RoundCoordinates = b; } else @@ -1689,14 +1689,14 @@ void CGUI::Xeromyces_ReadImage(XMBElement Element, CXeromyces* pFile, CGUISprite else if (attr_value == L"clamp_to_edge") Image->m_WrapMode = GL_CLAMP_TO_EDGE; else - LOGERROR(L"GUI: Error parsing '%hs' (\"%ls\")", attr_name.c_str(), attr_value.c_str()); + LOGERROR("GUI: Error parsing '%hs' (\"%ls\")", attr_name.c_str(), attr_value.c_str()); } else if (attr_name == "z_level") { float z_level; if (!GUI::ParseString(attr_value, z_level)) - LOGERROR(L"GUI: Error parsing '%hs' (\"%ls\")", attr_name.c_str(), attr_value.c_str()); + LOGERROR("GUI: Error parsing '%hs' (\"%ls\")", attr_name.c_str(), attr_value.c_str()); else Image->m_DeltaZ = z_level/100.f; } else @@ -1704,7 +1704,7 @@ void CGUI::Xeromyces_ReadImage(XMBElement Element, CXeromyces* pFile, CGUISprite { CColor color; if (!GUI::ParseString(attr_value, color)) - LOGERROR(L"GUI: Error parsing '%hs' (\"%ls\")", attr_name.c_str(), attr_value.c_str()); + LOGERROR("GUI: Error parsing '%hs' (\"%ls\")", attr_name.c_str(), attr_value.c_str()); else Image->m_BackColor = color; } else @@ -1712,7 +1712,7 @@ void CGUI::Xeromyces_ReadImage(XMBElement Element, CXeromyces* pFile, CGUISprite { CColor color; if (!GUI::ParseString(attr_value, color)) - LOGERROR(L"GUI: Error parsing '%hs' (\"%ls\")", attr_name.c_str(), attr_value.c_str()); + LOGERROR("GUI: Error parsing '%hs' (\"%ls\")", attr_name.c_str(), attr_value.c_str()); else Image->m_BorderColor = color; } else @@ -1720,7 +1720,7 @@ void CGUI::Xeromyces_ReadImage(XMBElement Element, CXeromyces* pFile, CGUISprite { bool b; if (!GUI::ParseString(attr_value, b)) - LOGERROR(L"GUI: Error parsing '%hs' (\"%ls\")", attr_name.c_str(), attr_value.c_str()); + LOGERROR("GUI: Error parsing '%hs' (\"%ls\")", attr_name.c_str(), attr_value.c_str()); else Image->m_Border = b; } else @@ -1739,7 +1739,7 @@ void CGUI::Xeromyces_ReadImage(XMBElement Element, CXeromyces* pFile, CGUISprite { if (Image->m_Effects) { - LOGERROR(L"GUI must not have more than one "); + LOGERROR("GUI must not have more than one "); } else { @@ -1773,7 +1773,7 @@ void CGUI::Xeromyces_ReadEffects(XMBElement Element, CXeromyces* pFile, SGUIImag { CColor color; if (!GUI::ParseColor(attr_value, color, 0)) - LOGERROR(L"GUI: Error parsing '%hs' (\"%ls\")", attr_name.c_str(), attr_value.c_str()); + LOGERROR("GUI: Error parsing '%hs' (\"%ls\")", attr_name.c_str(), attr_value.c_str()); else effects.m_AddColor = color; } else if (attr_name == "grayscale") @@ -1853,7 +1853,7 @@ void CGUI::Xeromyces_ReadScrollBarStyle(XMBElement Element, CXeromyces* pFile) { bool b; if (!GUI::ParseString(attr_value.FromUTF8(), b)) - LOGERROR(L"GUI: Error parsing '%hs' (\"%hs\")", attr_name.c_str(), attr_value.c_str()); + LOGERROR("GUI: Error parsing '%hs' (\"%hs\")", attr_name.c_str(), attr_value.c_str()); else scrollbar.m_UseEdgeButtons = b; } @@ -1861,7 +1861,7 @@ void CGUI::Xeromyces_ReadScrollBarStyle(XMBElement Element, CXeromyces* pFile) { float f; if (!GUI::ParseString(attr_value.FromUTF8(), f)) - LOGERROR(L"GUI: Error parsing '%hs' (\"%hs\")", attr_name.c_str(), attr_value.c_str()); + LOGERROR("GUI: Error parsing '%hs' (\"%hs\")", attr_name.c_str(), attr_value.c_str()); else scrollbar.m_Width = f; } @@ -1870,7 +1870,7 @@ void CGUI::Xeromyces_ReadScrollBarStyle(XMBElement Element, CXeromyces* pFile) { float f; if (!GUI::ParseString(attr_value.FromUTF8(), f)) - LOGERROR(L"GUI: Error parsing '%hs' (\"%hs\")", attr_name.c_str(), attr_value.c_str()); + LOGERROR("GUI: Error parsing '%hs' (\"%hs\")", attr_name.c_str(), attr_value.c_str()); else scrollbar.m_MinimumBarSize = f; } @@ -1879,7 +1879,7 @@ void CGUI::Xeromyces_ReadScrollBarStyle(XMBElement Element, CXeromyces* pFile) { float f; if (!GUI::ParseString(attr_value.FromUTF8(), f)) - LOGERROR(L"GUI: Error parsing '%hs' (\"%hs\")", attr_name.c_str(), attr_value.c_str()); + LOGERROR("GUI: Error parsing '%hs' (\"%hs\")", attr_name.c_str(), attr_value.c_str()); else scrollbar.m_MaximumBarSize = f; } @@ -1952,7 +1952,7 @@ void CGUI::Xeromyces_ReadIcon(XMBElement Element, CXeromyces* pFile) { CSize size; if (!GUI::ParseString(attr_value.FromUTF8(), size)) - LOGERROR(L"Error parsing '%hs' (\"%hs\") inside .", attr_name.c_str(), attr_value.c_str()); + LOGERROR("Error parsing '%hs' (\"%hs\") inside .", attr_name.c_str(), attr_value.c_str()); else icon.m_Size = size; } @@ -1960,7 +1960,7 @@ void CGUI::Xeromyces_ReadIcon(XMBElement Element, CXeromyces* pFile) { int cell_id; if (!GUI::ParseString(attr_value.FromUTF8(), cell_id)) - LOGERROR(L"GUI: Error parsing '%hs' (\"%hs\") inside .", attr_name.c_str(), attr_value.c_str()); + LOGERROR("GUI: Error parsing '%hs' (\"%hs\") inside .", attr_name.c_str(), attr_value.c_str()); else icon.m_CellID = cell_id; } @@ -2013,7 +2013,7 @@ void CGUI::Xeromyces_ReadColor(XMBElement Element, CXeromyces* pFile) // Try setting color to value if (!color.ParseString(value)) { - LOGERROR(L"GUI: Unable to create custom color '%hs'. Invalid color syntax.", name.c_str()); + LOGERROR("GUI: Unable to create custom color '%hs'. Invalid color syntax.", name.c_str()); } else { diff --git a/source/gui/CGUIScrollBarVertical.cpp b/source/gui/CGUIScrollBarVertical.cpp index 4e0efe60fe..4c5c6eb8c8 100644 --- a/source/gui/CGUIScrollBarVertical.cpp +++ b/source/gui/CGUIScrollBarVertical.cpp @@ -51,7 +51,7 @@ void CGUIScrollBarVertical::Draw() { if (!GetStyle()) { - LOGWARNING(L"Attempt to draw scrollbar without a style."); + LOGWARNING("Attempt to draw scrollbar without a style."); return; } diff --git a/source/gui/COList.cpp b/source/gui/COList.cpp index 09ff828b72..633ca91db5 100644 --- a/source/gui/COList.cpp +++ b/source/gui/COList.cpp @@ -158,7 +158,7 @@ bool COList::HandleAdditionalChildren(const XMBElement& child, CXeromyces* pFile { CColor color; if (!GUI::ParseString(attr_value.FromUTF8(), color)) - LOGERROR(L"GUI: Error parsing '%hs' (\"%ls\")", attr_name.c_str(), attr_value.c_str()); + LOGERROR("GUI: Error parsing '%hs' (\"%ls\")", attr_name.c_str(), attr_value.c_str()); else oDef.m_TextColor = color; } else if (attr_name == "id") @@ -169,7 +169,7 @@ bool COList::HandleAdditionalChildren(const XMBElement& child, CXeromyces* pFile { float width; if (!GUI::ParseString(attr_value.FromUTF8(), width)) - LOGERROR(L"GUI: Error parsing '%hs' (\"%ls\")", attr_name.c_str(), attr_value.c_str()); + LOGERROR("GUI: Error parsing '%hs' (\"%ls\")", attr_name.c_str(), attr_value.c_str()); else { // Check if it's a relative value, and save as decimal if so. @@ -215,7 +215,7 @@ bool COList::HandleAdditionalChildren(const XMBElement& child, CXeromyces* pFile } else // Ignore. { - LOGERROR(L"GUI: translatable attribute in olist def that isn't a heading. (object: %hs)", this->GetPresentableName().c_str()); + LOGERROR("GUI: translatable attribute in olist def that isn't a heading. (object: %hs)", this->GetPresentableName().c_str()); } } } diff --git a/source/gui/GUIManager.cpp b/source/gui/GUIManager.cpp index d0999c7798..992088dcad 100644 --- a/source/gui/GUIManager.cpp +++ b/source/gui/GUIManager.cpp @@ -117,27 +117,27 @@ void CGUIManager::PopPageCB(shared_ptr args) scriptInterface->ReadStructuredClone(initDataClone, &initDataVal); else { - LOGERROR(L"Called PopPageCB when initData (which should contain the callback function name) isn't set!"); + LOGERROR("Called PopPageCB when initData (which should contain the callback function name) isn't set!"); return; } if (!scriptInterface->HasProperty(initDataVal, "callback")) { - LOGERROR(L"Called PopPageCB when the callback function name isn't set!"); + LOGERROR("Called PopPageCB when the callback function name isn't set!"); return; } std::string callback; if (!scriptInterface->GetProperty(initDataVal, "callback", callback)) { - LOGERROR(L"Failed to get the callback property as a string from initData in PopPageCB!"); + LOGERROR("Failed to get the callback property as a string from initData in PopPageCB!"); return; } JS::RootedValue global(cx, scriptInterface->GetGlobalObject()); if (!scriptInterface->HasProperty(global, callback.c_str())) { - LOGERROR(L"The specified callback function %hs does not exist in the page %ls", callback.c_str(), m_PageStack.back().name.c_str()); + LOGERROR("The specified callback function %hs does not exist in the page %ls", callback.c_str(), m_PageStack.back().name.c_str()); return; } @@ -146,7 +146,7 @@ void CGUIManager::PopPageCB(shared_ptr args) scriptInterface->ReadStructuredClone(args, &argVal); if (!scriptInterface->CallFunctionVoid(global, callback.c_str(), argVal)) { - LOGERROR(L"Failed to call the callback function %hs in the page %ls", callback.c_str(), m_PageStack.back().name.c_str()); + LOGERROR("Failed to call the callback function %hs in the page %ls", callback.c_str(), m_PageStack.back().name.c_str()); return; } } @@ -204,7 +204,7 @@ void CGUIManager::LoadPage(SGUIPage& page) if (root.GetNodeName() != elmt_page) { - LOGERROR(L"GUI page '%ls' must have root element ", page.name.c_str()); + LOGERROR("GUI page '%ls' must have root element ", page.name.c_str()); return; } @@ -212,7 +212,7 @@ void CGUIManager::LoadPage(SGUIPage& page) { if (node.GetNodeName() != elmt_include) { - LOGERROR(L"GUI page '%ls' must only have elements inside ", page.name.c_str()); + LOGERROR("GUI page '%ls' must only have elements inside ", page.name.c_str()); continue; } @@ -252,7 +252,7 @@ void CGUIManager::LoadPage(SGUIPage& page) hotloadDataVal) ) { - LOGERROR(L"GUI page '%ls': Failed to call init() function", page.name.c_str()); + LOGERROR("GUI page '%ls': Failed to call init() function", page.name.c_str()); } m_CurrentGUI = oldGUI; @@ -264,7 +264,7 @@ Status CGUIManager::ReloadChangedFile(const VfsPath& path) { if (it->inputs.count(path)) { - LOGMESSAGE(L"GUI file '%ls' changed - reloading page '%ls'", path.string().c_str(), it->name.c_str()); + LOGMESSAGE("GUI file '%ls' changed - reloading page '%ls'", path.string().c_str(), it->name.c_str()); LoadPage(*it); // TODO: this can crash if LoadPage runs an init script which modifies the page stack and breaks our iterators } @@ -407,7 +407,7 @@ const CParamNode& CGUIManager::GetTemplate(const std::string& templateName) { const CParamNode& templateRoot = m_TemplateLoader.GetTemplateFileData(templateName).GetChild("Entity"); if (!templateRoot.IsOk()) - LOGERROR(L"Invalid template found for '%hs'", templateName.c_str()); + LOGERROR("Invalid template found for '%hs'", templateName.c_str()); return templateRoot; } diff --git a/source/gui/GUIRenderer.cpp b/source/gui/GUIRenderer.cpp index 75b133aa1f..ebeed7ff5b 100644 --- a/source/gui/GUIRenderer.cpp +++ b/source/gui/GUIRenderer.cpp @@ -144,7 +144,7 @@ void GUIRenderer::UpdateDrawCallCache(DrawCalls &Calls, const CStr& SpriteName, // Check colour is valid if (!GUI::ParseString(value, color)) { - LOGERROR(L"GUI: Error parsing sprite 'colour' (\"%ls\")", value.c_str()); + LOGERROR("GUI: Error parsing sprite 'colour' (\"%ls\")", value.c_str()); return; } @@ -167,7 +167,7 @@ void GUIRenderer::UpdateDrawCallCache(DrawCalls &Calls, const CStr& SpriteName, else { // Otherwise, just complain and give up: - LOGERROR(L"Trying to use a sprite that doesn't exist (\"%hs\").", SpriteName.c_str()); + LOGERROR("Trying to use a sprite that doesn't exist (\"%hs\").", SpriteName.c_str()); return; } } diff --git a/source/gui/GUITooltip.cpp b/source/gui/GUITooltip.cpp index c560885edb..c18f59a63c 100644 --- a/source/gui/GUITooltip.cpp +++ b/source/gui/GUITooltip.cpp @@ -149,7 +149,7 @@ void GUITooltip::ShowTooltip(IGUIObject* obj, CPos pos, const CStr& style, CGUI* IGUIObject* tooltipobj = gui->FindObjectByName("__tooltip_"+style); if (! tooltipobj) { - LOGERROR(L"Cannot find tooltip named '%hs'", style.c_str()); + LOGERROR("Cannot find tooltip named '%hs'", style.c_str()); return; } @@ -162,7 +162,7 @@ void GUITooltip::ShowTooltip(IGUIObject* obj, CPos pos, const CStr& style, CGUI* usedobj = gui->FindObjectByName(usedObjectName); if (! usedobj) { - LOGERROR(L"Cannot find object named '%hs' used by tooltip '%hs'", usedObjectName.c_str(), style.c_str()); + LOGERROR("Cannot find object named '%hs' used by tooltip '%hs'", usedObjectName.c_str(), style.c_str()); return; } @@ -213,7 +213,7 @@ void GUITooltip::HideTooltip(const CStr& style, CGUI* gui) IGUIObject* tooltipobj = gui->FindObjectByName("__tooltip_"+style); if (! tooltipobj) { - LOGERROR(L"Cannot find tooltip named '%hs'", style.c_str()); + LOGERROR("Cannot find tooltip named '%hs'", style.c_str()); return; } @@ -224,7 +224,7 @@ void GUITooltip::HideTooltip(const CStr& style, CGUI* gui) IGUIObject* usedobj = gui->FindObjectByName(usedObjectName); if (! usedobj) { - LOGERROR(L"Cannot find object named '%hs' used by tooltip '%hs'", usedObjectName.c_str(), style.c_str()); + LOGERROR("Cannot find object named '%hs' used by tooltip '%hs'", usedObjectName.c_str(), style.c_str()); return; } @@ -254,7 +254,7 @@ static int GetTooltipDelay(CStr& style, CGUI* gui) IGUIObject* tooltipobj = gui->FindObjectByName("__tooltip_"+style); if (! tooltipobj) { - LOGERROR(L"Cannot find tooltip object named '%hs'", style.c_str()); + LOGERROR("Cannot find tooltip object named '%hs'", style.c_str()); return delay; } GUI::GetSetting(tooltipobj, "delay", delay); diff --git a/source/gui/GUIbase.cpp b/source/gui/GUIbase.cpp index 491c2ecd0f..effb583009 100644 --- a/source/gui/GUIbase.cpp +++ b/source/gui/GUIbase.cpp @@ -113,19 +113,19 @@ bool CClientArea::SetClientArea(const CStr& Value) coord++; break; default: - LOGWARNING(L"ClientArea definitions may only contain numerics. Your input: '%hs'", Value.c_str()); + LOGWARNING("ClientArea definitions may only contain numerics. Your input: '%hs'", Value.c_str()); return false; } if (coord > 3) { - LOGWARNING(L"Too many CClientArea parameters (4 max). Your input: '%hs'", Value.c_str()); + LOGWARNING("Too many CClientArea parameters (4 max). Your input: '%hs'", Value.c_str()); return false; } } if (coord < 3) { - LOGWARNING(L"Too few CClientArea parameters (4 min). Your input: '%hs'", Value.c_str()); + LOGWARNING("Too few CClientArea parameters (4 min). Your input: '%hs'", Value.c_str()); return false; } diff --git a/source/gui/GUItext.cpp b/source/gui/GUItext.cpp index 69d9f479fe..8b5f594bda 100644 --- a/source/gui/GUItext.cpp +++ b/source/gui/GUItext.cpp @@ -109,7 +109,7 @@ void CGUIString::GenerateTextCall(const CGUI *pGUI, if (!pGUI->IconExists(path)) { if (pObject) - LOGERROR(L"Trying to use an icon, imgleft or imgright-tag with an undefined icon (\"%hs\").", path.c_str()); + LOGERROR("Trying to use an icon, imgleft or imgright-tag with an undefined icon (\"%hs\").", path.c_str()); continue; } @@ -158,7 +158,7 @@ void CGUIString::GenerateTextCall(const CGUI *pGUI, CSize displacement; // Parse the value if (!GUI::ParseString(tagAttrib.value, displacement)) - LOGERROR(L"Error parsing 'displace' value for tag [ICON]"); + LOGERROR("Error parsing 'displace' value for tag [ICON]"); else SpriteCall.m_Area += displacement; } @@ -182,7 +182,7 @@ void CGUIString::GenerateTextCall(const CGUI *pGUI, } break; default: - LOGERROR(L"Encountered unexpected tag applied to text"); + LOGERROR("Encountered unexpected tag applied to text"); break; } } @@ -207,14 +207,14 @@ void CGUIString::GenerateTextCall(const CGUI *pGUI, if (!GUI::ParseString(it2->m_TagValue, TextCall.m_Color) && pObject) - LOGERROR(L"Error parsing the value of a [color]-tag in GUI text when reading object \"%hs\".", pObject->GetPresentableName().c_str()); + LOGERROR("Error parsing the value of a [color]-tag in GUI text when reading object \"%hs\".", pObject->GetPresentableName().c_str()); break; case CGUIString::TextChunk::Tag::TAG_FONT: // TODO Gee: (2004-08-15) Check if Font exists? TextCall.m_Font = CStrIntern(utf8_from_wstring(it2->m_TagValue)); break; default: - LOGERROR(L"Encountered unexpected tag applied to text"); + LOGERROR("Encountered unexpected tag applied to text"); break; } } @@ -306,7 +306,7 @@ void CGUIString::SetValue(const CStrW& str) closing = false; if (++p == l) { - LOGERROR(L"Partial tag at end of string '%ls'", str.c_str()); + LOGERROR("Partial tag at end of string '%ls'", str.c_str()); break; } if (str[p] == L'/') @@ -314,12 +314,12 @@ void CGUIString::SetValue(const CStrW& str) closing = true; if (tags.empty()) { - LOGERROR(L"Encountered closing tag without having any open tags. At %d in '%ls'", p, str.c_str()); + LOGERROR("Encountered closing tag without having any open tags. At %d in '%ls'", p, str.c_str()); break; } if (++p == l) { - LOGERROR(L"Partial closing tag at end of string '%ls'", str.c_str()); + LOGERROR("Partial closing tag at end of string '%ls'", str.c_str()); break; } } @@ -332,7 +332,7 @@ void CGUIString::SetValue(const CStrW& str) { case L' ': if (closing) // We still parse them to make error handling cleaner - LOGERROR(L"Closing tags do not support parameters (at pos %d '%ls')", p, str.c_str()); + LOGERROR("Closing tags do not support parameters (at pos %d '%ls')", p, str.c_str()); // parse something="something else" for (++p; p < l && str[p] != L'='; ++p) @@ -340,23 +340,23 @@ void CGUIString::SetValue(const CStrW& str) if (p == l) { - LOGERROR(L"Parameter without value at pos %d '%ls'", p, str.c_str()); + LOGERROR("Parameter without value at pos %d '%ls'", p, str.c_str()); break; } // fall-through case L'=': // parse a quoted parameter if (closing) // We still parse them to make error handling cleaner - LOGERROR(L"Closing tags do not support parameters (at pos %d '%ls')", p, str.c_str()); + LOGERROR("Closing tags do not support parameters (at pos %d '%ls')", p, str.c_str()); if (++p == l) { - LOGERROR(L"Expected parameter, got end of string '%ls'", str.c_str()); + LOGERROR("Expected parameter, got end of string '%ls'", str.c_str()); break; } if (str[p] != L'"') { - LOGERROR(L"Unquoted parameters are not supported (at pos %d '%ls')", p, str.c_str()); + LOGERROR("Unquoted parameters are not supported (at pos %d '%ls')", p, str.c_str()); break; } for (++p; p < l && str[p] != L'"'; ++p) @@ -366,7 +366,7 @@ void CGUIString::SetValue(const CStrW& str) case L'\\': if (++p == l) { - LOGERROR(L"Escape character at end of string '%ls'", str.c_str()); + LOGERROR("Escape character at end of string '%ls'", str.c_str()); break; } // NOTE: We do not support \n in tag parameters @@ -392,7 +392,7 @@ void CGUIString::SetValue(const CStrW& str) if (!tag_.SetTagType(tag)) { - LOGERROR(L"Invalid tag '%ls' at %d in '%ls'", tag.c_str(), p, str.c_str()); + LOGERROR("Invalid tag '%ls' at %d in '%ls'", tag.c_str(), p, str.c_str()); break; } if (!closing) @@ -415,7 +415,7 @@ void CGUIString::SetValue(const CStrW& str) { if (tag != tags.back()) { - LOGERROR(L"Closing tag '%ls' does not match last opened tag '%ls' at %d in '%ls'", tag.c_str(), tags.back().c_str(), p, str.c_str()); + LOGERROR("Closing tag '%ls' does not match last opened tag '%ls' at %d in '%ls'", tag.c_str(), tags.back().c_str(), p, str.c_str()); break; } @@ -426,7 +426,7 @@ void CGUIString::SetValue(const CStrW& str) case L'\\': if (++p == l) { - LOGERROR(L"Escape character at end of string '%ls'", str.c_str()); + LOGERROR("Escape character at end of string '%ls'", str.c_str()); break; } if (str[p] == L'n') diff --git a/source/gui/GUIutil.cpp b/source/gui/GUIutil.cpp index 009c7023f1..15f0da487a 100644 --- a/source/gui/GUIutil.cpp +++ b/source/gui/GUIutil.cpp @@ -69,20 +69,20 @@ bool __ParseString(const CStrW& Value, CRect &Output) { if (stream.eof()) { - LOGWARNING(L"Too few CRect parameters (min %i). Your input: '%hs'", NUM_COORDS, Value.ToUTF8().c_str()); + LOGWARNING("Too few CRect parameters (min %i). Your input: '%hs'", NUM_COORDS, Value.ToUTF8().c_str()); return false; } stream >> coords[i]; if ((stream.rdstate() & std::wstringstream::failbit) != 0) { - LOGWARNING(L"Unable to parse CRect parameters. Your input: '%hs'", Value.ToUTF8().c_str()); + LOGWARNING("Unable to parse CRect parameters. Your input: '%hs'", Value.ToUTF8().c_str()); return false; } } if (!stream.eof()) { - LOGWARNING(L"Too many CRect parameters (max %i). Your input: '%hs'", NUM_COORDS, Value.ToUTF8().c_str()); + LOGWARNING("Too many CRect parameters (max %i). Your input: '%hs'", NUM_COORDS, Value.ToUTF8().c_str()); return false; } @@ -134,13 +134,13 @@ bool __ParseString(const CStrW& Value, CSize &Output) { if (stream.eof()) { - LOGWARNING(L"Too few CSize parameters (min %i). Your input: '%hs'", NUM_COORDS, Value.ToUTF8().c_str()); + LOGWARNING("Too few CSize parameters (min %i). Your input: '%hs'", NUM_COORDS, Value.ToUTF8().c_str()); return false; } stream >> coords[i]; if ((stream.rdstate() & std::wstringstream::failbit) != 0) { - LOGWARNING(L"Unable to parse CSize parameters. Your input: '%hs'", Value.ToUTF8().c_str()); + LOGWARNING("Unable to parse CSize parameters. Your input: '%hs'", Value.ToUTF8().c_str()); return false; } } @@ -150,7 +150,7 @@ bool __ParseString(const CStrW& Value, CSize &Output) if (!stream.eof()) { - LOGWARNING(L"Too many CSize parameters (max %i). Your input: '%hs'", NUM_COORDS, Value.ToUTF8().c_str()); + LOGWARNING("Too many CSize parameters (max %i). Your input: '%hs'", NUM_COORDS, Value.ToUTF8().c_str()); return false; } @@ -169,13 +169,13 @@ bool __ParseString(const CStrW& Value, CPos &Output) { if (stream.eof()) { - LOGWARNING(L"Too few CPos parameters (min %i). Your input: '%hs'", NUM_COORDS, Value.ToUTF8().c_str()); + LOGWARNING("Too few CPos parameters (min %i). Your input: '%hs'", NUM_COORDS, Value.ToUTF8().c_str()); return false; } stream >> coords[i]; if ((stream.rdstate() & std::wstringstream::failbit) != 0) { - LOGWARNING(L"Unable to parse CPos parameters. Your input: '%hs'", Value.ToUTF8().c_str()); + LOGWARNING("Unable to parse CPos parameters. Your input: '%hs'", Value.ToUTF8().c_str()); return false; } } @@ -185,7 +185,7 @@ bool __ParseString(const CStrW& Value, CPos &Output) if (!stream.eof()) { - LOGWARNING(L"Too many CPos parameters (max %i). Your input: '%hs'", NUM_COORDS, Value.ToUTF8().c_str()); + LOGWARNING("Too many CPos parameters (max %i). Your input: '%hs'", NUM_COORDS, Value.ToUTF8().c_str()); return false; } @@ -339,7 +339,7 @@ PSRETURN GUI::GetSettingPointer(const IGUIObject *pObject, const CStr& Settin std::map::const_iterator it = pObject->m_Settings.find(Setting); if (it == pObject->m_Settings.end()) { - LOGWARNING(L"setting %hs was not found on object %hs", + LOGWARNING("setting %hs was not found on object %hs", Setting.c_str(), pObject->GetPresentableName().c_str()); return PSRETURN_GUI_InvalidSetting; @@ -388,7 +388,7 @@ PSRETURN GUI::SetSetting(IGUIObject *pObject, const CStr& Setting, if (!pObject->SettingExists(Setting)) { - LOGWARNING(L"setting %hs was not found on object %hs", + LOGWARNING("setting %hs was not found on object %hs", Setting.c_str(), pObject->GetPresentableName().c_str()); return PSRETURN_GUI_InvalidSetting; diff --git a/source/gui/IGUIObject.cpp b/source/gui/IGUIObject.cpp index d32cb28743..62e93e57c3 100644 --- a/source/gui/IGUIObject.cpp +++ b/source/gui/IGUIObject.cpp @@ -561,7 +561,7 @@ bool IGUIObject::IsRootObject() const PSRETURN IGUIObject::LogInvalidSettings(const CStr8 &Setting) const { - LOGWARNING(L"IGUIObject: setting %hs was not found on an object", + LOGWARNING("IGUIObject: setting %hs was not found on an object", Setting.c_str()); return PSRETURN_GUI_InvalidSetting; } diff --git a/source/gui/scripting/ScriptFunctions.cpp b/source/gui/scripting/ScriptFunctions.cpp index 1f7f3091df..bc6881a830 100644 --- a/source/gui/scripting/ScriptFunctions.cpp +++ b/source/gui/scripting/ScriptFunctions.cpp @@ -308,7 +308,7 @@ void SaveGame(ScriptInterface::CxPrivate* pCxPrivate, std::wstring filename, std shared_ptr GUIMetadataClone = pCxPrivate->pScriptInterface->WriteStructuredClone(GUIMetadata); if (SavedGames::Save(filename, description, *g_Game->GetSimulation2(), GUIMetadataClone, g_Game->GetPlayerID()) < 0) - LOGERROR(L"Failed to save game"); + LOGERROR("Failed to save game"); } void SaveGamePrefix(ScriptInterface::CxPrivate* pCxPrivate, std::wstring prefix, std::wstring description, CScriptVal GUIMetadata1) @@ -320,7 +320,7 @@ void SaveGamePrefix(ScriptInterface::CxPrivate* pCxPrivate, std::wstring prefix, shared_ptr GUIMetadataClone = pCxPrivate->pScriptInterface->WriteStructuredClone(GUIMetadata); if (SavedGames::SavePrefix(prefix, description, *g_Game->GetSimulation2(), GUIMetadataClone, g_Game->GetPlayerID()) < 0) - LOGERROR(L"Failed to save game"); + LOGERROR("Failed to save game"); } void SetNetworkGameAttributes(ScriptInterface::CxPrivate* pCxPrivate, CScriptVal attribs1) @@ -630,7 +630,7 @@ void SetTurnLength(ScriptInterface::CxPrivate* UNUSED(pCxPrivate), int length) if (g_NetServer) g_NetServer->SetTurnLength(length); else - LOGERROR(L"Only network host can change turn length"); + LOGERROR("Only network host can change turn length"); } // Focus the game camera on a given position. @@ -676,7 +676,7 @@ void DumpTerrainMipmap(ScriptInterface::CxPrivate* UNUSED(pCxPrivate)) g_Game->GetWorld()->GetTerrain()->GetHeightMipmap().DumpToDisk(filename); OsPath realPath; g_VFS->GetRealPath(filename, realPath); - LOGMESSAGERENDER(L"Terrain mipmap written to '%ls'", realPath.string().c_str()); + LOGMESSAGERENDER("Terrain mipmap written to '%ls'", realPath.string().c_str()); } void EnableTimeWarpRecording(ScriptInterface::CxPrivate* UNUSED(pCxPrivate), unsigned int numTurns) @@ -906,7 +906,7 @@ void StartJsTimer(ScriptInterface::CxPrivate* pCxPrivate, unsigned int slot) ONCE(InitJsTimers(*(pCxPrivate->pScriptInterface))); if (slot >= MAX_JS_TIMERS) - LOGERROR(L"Exceeded the maximum number of timer slots for scripts!"); + LOGERROR("Exceeded the maximum number of timer slots for scripts!"); js_start_times[slot].SetFromTimer(); } @@ -914,7 +914,7 @@ void StartJsTimer(ScriptInterface::CxPrivate* pCxPrivate, unsigned int slot) void StopJsTimer(ScriptInterface::CxPrivate* UNUSED(pCxPrivate), unsigned int slot) { if (slot >= MAX_JS_TIMERS) - LOGERROR(L"Exceeded the maximum number of timer slots for scripts!"); + LOGERROR("Exceeded the maximum number of timer slots for scripts!"); TimerUnit now; now.SetFromTimer(); diff --git a/source/i18n/L10n.cpp b/source/i18n/L10n.cpp index 2fe301cfed..b5f840e9a1 100644 --- a/source/i18n/L10n.cpp +++ b/source/i18n/L10n.cpp @@ -203,7 +203,7 @@ void L10n::GetDictionaryLocale(const std::string& configLocaleString, Locale& ou return; } else - LOGWARNING(L"The configured locale is not valid or no translations are available. Falling back to another locale."); + LOGWARNING("The configured locale is not valid or no translations are available. Falling back to another locale."); } Locale systemLocale = Locale::getDefault(); @@ -408,14 +408,14 @@ std::string L10n::FormatMillisecondsIntoDateString(const UDate& milliseconds, co UnicodeString unicodeFormat = UnicodeString::fromUTF8(formatString.c_str()); SimpleDateFormat* dateFormat = new SimpleDateFormat(unicodeFormat, status); if (U_FAILURE(status)) - LOGERROR(L"Error creating SimpleDateFormat: %hs", u_errorName(status)); + LOGERROR("Error creating SimpleDateFormat: %hs", u_errorName(status)); const TimeZone* timeZone = TimeZone::getGMT(); status = U_ZERO_ERROR; Calendar* calendar = Calendar::createInstance(*timeZone, currentLocale, status); if (U_FAILURE(status)) - LOGERROR(L"Error creating calendar: %hs", u_errorName(status)); + LOGERROR("Error creating calendar: %hs", u_errorName(status)); dateFormat->adoptCalendar(calendar); dateFormat->format(milliseconds, dateString); @@ -470,12 +470,12 @@ Status L10n::ReloadChangedFile(const VfsPath& path) if (path.string().rfind(dictName) == std::string::npos) return INFO::OK; - LOGMESSAGE(L"Hotloading translations from '%ls'", path.string().c_str()); + LOGMESSAGE("Hotloading translations from '%ls'", path.string().c_str()); CVFSFile file; if (file.Load(g_VFS, path) != PSRETURN_OK) { - LOGERROR(L"Failed to read translations from '%ls'", path.string().c_str()); + LOGERROR("Failed to read translations from '%ls'", path.string().c_str()); return ERR::FAIL; } @@ -505,7 +505,7 @@ void L10n::LoadDictionaryForCurrentLocale() std::wstring dictName = GetFallbackToAvailableDictLocale(currentLocale); if (vfs::GetPathnames(g_VFS, L"l10n/", dictName.append(L".*.po").c_str(), filenames) < 0) { - LOGERROR(L"No files for the dictionary found, but at this point the input should already be validated!"); + LOGERROR("No files for the dictionary found, but at this point the input should already be validated!"); return; } } @@ -569,7 +569,7 @@ void L10n::ReadPoIntoDictionary(const std::string& poContent, tinygettext::Dicti } catch(std::exception& e) { - LOGERROR(L"[Localization] Exception while reading virtual PO file: %hs", e.what()); + LOGERROR("[Localization] Exception while reading virtual PO file: %hs", e.what()); } } diff --git a/source/lib/sysdep/os/linux/dir_watch_inotify.cpp b/source/lib/sysdep/os/linux/dir_watch_inotify.cpp index 52bd7027a6..93c5ad2d80 100644 --- a/source/lib/sysdep/os/linux/dir_watch_inotify.cpp +++ b/source/lib/sysdep/os/linux/dir_watch_inotify.cpp @@ -188,7 +188,7 @@ Status dir_watch_Add(const OsPath& path, PDirWatch& dirWatch) // Check for error ? int err = errno; initialized = -1; - LOGERROR(L"Error initializing inotify file descriptor; hotloading will be disabled, errno=%d", err); + LOGERROR("Error initializing inotify file descriptor; hotloading will be disabled, errno=%d", err); errno = err; return StatusFromErrno(); // NOWARN } @@ -198,7 +198,7 @@ Status dir_watch_Add(const OsPath& path, PDirWatch& dirWatch) if (ret != 0) { initialized = -1; - LOGERROR(L"Error creating inotify event loop thread; hotloading will be disabled, err=%d", ret); + LOGERROR("Error creating inotify event loop thread; hotloading will be disabled, err=%d", ret); errno = ret; return StatusFromErrno(); // NOWARN } diff --git a/source/lobby/XmppClient.cpp b/source/lobby/XmppClient.cpp index 4b454e0a11..a09bfb9397 100644 --- a/source/lobby/XmppClient.cpp +++ b/source/lobby/XmppClient.cpp @@ -749,7 +749,7 @@ bool XmppClient::handleIq(const glooxwrapper::IQ& iq) { CreateSimpleMessage("system", g_L10n.Translate("unknown subtype (see logs)"), "error"); std::string tag = tag_name(iq); - LOGMESSAGE(L"unknown subtype '%hs'", tag.c_str()); + LOGMESSAGE("unknown subtype '%hs'", tag.c_str()); } return true; @@ -896,7 +896,7 @@ void XmppClient::SetPresence(const std::string& presence) else IF("offline", Unavailable); // The others are not to be set #undef IF - else LOGERROR(L"Unknown presence '%hs'", presence.c_str()); + else LOGERROR("Unknown presence '%hs'", presence.c_str()); } /** @@ -952,7 +952,7 @@ void XmppClient::GetPresenceString(const gloox::Presence::PresenceType p, std::s CASE(Error, "error"); CASE(Invalid, "invalid"); default: - LOGERROR(L"Unknown presence type '%d'", (int)p); + LOGERROR("Unknown presence type '%d'", (int)p); break; #undef CASE } @@ -975,7 +975,7 @@ void XmppClient::GetRoleString(const gloox::MUCRoomRole r, std::string& role) co CASE(RoleModerator, "moderator"); CASE(RoleInvalid, "invalid"); default: - LOGERROR(L"Unknown role type '%d'", (int)r); + LOGERROR("Unknown role type '%d'", (int)r); break; #undef CASE } diff --git a/source/main.cpp b/source/main.cpp index 4d90e76533..051e2f9ab4 100644 --- a/source/main.cpp +++ b/source/main.cpp @@ -159,7 +159,7 @@ static InReaction MainInputHandler(const SDL_Event_* ev) // Fullscreen toggling is broken on OS X w/ SDL 1.2, see http://trac.wildfiregames.com/ticket/741 g_VideoMode.ToggleFullscreen(); #else - LOGWARNING(L"Toggling fullscreen and resizing are disabled on OS X due to a known bug. Please use the config file to change display settings."); + LOGWARNING("Toggling fullscreen and resizing are disabled on OS X due to a known bug. Please use the config file to change display settings."); #endif return IN_HANDLED; } diff --git a/source/network/NetClient.cpp b/source/network/NetClient.cpp index 8062cc8b24..bc5aa66834 100644 --- a/source/network/NetClient.cpp +++ b/source/network/NetClient.cpp @@ -304,7 +304,7 @@ bool CNetClient::HandleMessage(CNetMessage* message) std::stringstream stream; - LOGMESSAGERENDER(L"Serializing game at turn %u for rejoining player", m_ClientTurnManager->GetCurrentTurn()); + LOGMESSAGERENDER("Serializing game at turn %u for rejoining player", m_ClientTurnManager->GetCurrentTurn()); u32 turn = to_le32(m_ClientTurnManager->GetCurrentTurn()); stream.write((char*)&turn, sizeof(turn)); @@ -324,7 +324,7 @@ bool CNetClient::HandleMessage(CNetMessage* message) // Update FSM bool ok = Update(message->GetType(), message); if (!ok) - LOGERROR(L"Net client: Error running FSM update (type=%d state=%d)", (int)message->GetType(), (int)GetCurrState()); + LOGERROR("Net client: Error running FSM update (type=%d state=%d)", (int)message->GetType(), (int)GetCurrState()); return ok; } @@ -347,7 +347,7 @@ void CNetClient::LoadFinished() stream.read((char*)&turn, sizeof(turn)); turn = to_le32(turn); - LOGMESSAGE(L"Rejoining client deserializing state at turn %u\n", turn); + LOGMESSAGE("Rejoining client deserializing state at turn %u\n", turn); bool ok = m_Game->GetSimulation2()->DeserializeState(stream); ENSURE(ok); @@ -428,7 +428,7 @@ bool CNetClient::OnAuthenticate(void* context, CFsmEvent* event) CAuthenticateResultMessage* message = (CAuthenticateResultMessage*)event->GetParamRef(); - LOGMESSAGE(L"Net: Authentication result: host=%u, %ls", message->m_HostID, message->m_Message.c_str()); + LOGMESSAGE("Net: Authentication result: host=%u, %ls", message->m_HostID, message->m_Message.c_str()); bool isRejoining = (message->m_Code == ARC_OK_REJOINING); diff --git a/source/network/NetFileTransfer.cpp b/source/network/NetFileTransfer.cpp index 02805e3358..1bf4da922d 100644 --- a/source/network/NetFileTransfer.cpp +++ b/source/network/NetFileTransfer.cpp @@ -15,13 +15,13 @@ Status CNetFileTransferer::HandleMessageReceive(const CNetMessage* message) if (m_FileReceiveTasks.find(respMessage->m_RequestID) == m_FileReceiveTasks.end()) { - LOGERROR(L"Net transfer: Unsolicited file transfer response (id=%d)", (int)respMessage->m_RequestID); + LOGERROR("Net transfer: Unsolicited file transfer response (id=%d)", (int)respMessage->m_RequestID); return ERR::FAIL; } if (respMessage->m_Length == 0 || respMessage->m_Length > MAX_FILE_TRANSFER_SIZE) { - LOGERROR(L"Net transfer: Invalid size for file transfer response (length=%d)", (int)respMessage->m_Length); + LOGERROR("Net transfer: Invalid size for file transfer response (length=%d)", (int)respMessage->m_Length); return ERR::FAIL; } @@ -30,7 +30,7 @@ Status CNetFileTransferer::HandleMessageReceive(const CNetMessage* message) task->m_Length = respMessage->m_Length; task->m_Buffer.reserve(respMessage->m_Length); - LOGMESSAGERENDER(L"Downloading data over network (%d KB) - please wait...", (int)(task->m_Length/1024)); + LOGMESSAGERENDER("Downloading data over network (%d KB) - please wait...", (int)(task->m_Length/1024)); m_LastProgressReportTime = timer_Time(); return INFO::OK; @@ -41,7 +41,7 @@ Status CNetFileTransferer::HandleMessageReceive(const CNetMessage* message) if (m_FileReceiveTasks.find(dataMessage->m_RequestID) == m_FileReceiveTasks.end()) { - LOGERROR(L"Net transfer: Unsolicited file transfer data (id=%d)", (int)dataMessage->m_RequestID); + LOGERROR("Net transfer: Unsolicited file transfer data (id=%d)", (int)dataMessage->m_RequestID); return ERR::FAIL; } @@ -51,7 +51,7 @@ Status CNetFileTransferer::HandleMessageReceive(const CNetMessage* message) if (task->m_Buffer.size() > task->m_Length) { - LOGERROR(L"Net transfer: Invalid size for file transfer data (length=%d actual=%d)", (int)task->m_Length, (int)task->m_Buffer.size()); + LOGERROR("Net transfer: Invalid size for file transfer data (length=%d actual=%d)", (int)task->m_Length, (int)task->m_Buffer.size()); return ERR::FAIL; } @@ -62,7 +62,7 @@ Status CNetFileTransferer::HandleMessageReceive(const CNetMessage* message) if (task->m_Buffer.size() == task->m_Length) { - LOGMESSAGERENDER(L"Download completed"); + LOGMESSAGERENDER("Download completed"); task->OnComplete(); m_FileReceiveTasks.erase(dataMessage->m_RequestID); @@ -75,7 +75,7 @@ Status CNetFileTransferer::HandleMessageReceive(const CNetMessage* message) double t = timer_Time(); if (t > m_LastProgressReportTime + 0.5) { - LOGMESSAGERENDER(L"Downloading data: %.1f%% of %d KB", 100.f*task->m_Buffer.size()/task->m_Length, (int)(task->m_Length/1024)); + LOGMESSAGERENDER("Downloading data: %.1f%% of %d KB", 100.f*task->m_Buffer.size()/task->m_Length, (int)(task->m_Length/1024)); m_LastProgressReportTime = t; } @@ -87,7 +87,7 @@ Status CNetFileTransferer::HandleMessageReceive(const CNetMessage* message) if (m_FileSendTasks.find(ackMessage->m_RequestID) == m_FileSendTasks.end()) { - LOGERROR(L"Net transfer: Unsolicited file transfer ack (id=%d)", (int)ackMessage->m_RequestID); + LOGERROR("Net transfer: Unsolicited file transfer ack (id=%d)", (int)ackMessage->m_RequestID); return ERR::FAIL; } @@ -95,7 +95,7 @@ Status CNetFileTransferer::HandleMessageReceive(const CNetMessage* message) if (ackMessage->m_NumPackets > task.packetsInFlight) { - LOGERROR(L"Net transfer: Invalid num packets for file transfer ack (num=%d inflight=%d)", + LOGERROR("Net transfer: Invalid num packets for file transfer ack (num=%d inflight=%d)", (int)ackMessage->m_NumPackets, (int)task.packetsInFlight); return ERR::FAIL; } diff --git a/source/network/NetHost.cpp b/source/network/NetHost.cpp index 7d0d68219f..1f14daf6f0 100644 --- a/source/network/NetHost.cpp +++ b/source/network/NetHost.cpp @@ -29,12 +29,12 @@ bool CNetHost::SendMessage(const CNetMessage* message, ENetPeer* peer, const cha if (!packet) return false; - LOGMESSAGE(L"Net: Sending message %hs of size %lu to %hs", message->ToString().c_str(), (unsigned long)packet->dataLength, peerName); + LOGMESSAGE("Net: Sending message %hs of size %lu to %hs", message->ToString().c_str(), (unsigned long)packet->dataLength, peerName); // Let ENet send the message to peer if (enet_peer_send(peer, DEFAULT_CHANNEL, packet) < 0) { - LOGERROR(L"Net: Failed to send packet to peer"); + LOGERROR("Net: Failed to send packet to peer"); return false; } @@ -62,7 +62,7 @@ ENetPacket* CNetHost::CreatePacket(const CNetMessage* message) // Create a reliable packet ENetPacket* packet = enet_packet_create(&buffer[0], size, ENET_PACKET_FLAG_RELIABLE); if (!packet) - LOGERROR(L"Net: Failed to construct packet"); + LOGERROR("Net: Failed to construct packet"); return packet; } diff --git a/source/network/NetMessage.cpp b/source/network/NetMessage.cpp index d2c3be2045..daa892c279 100644 --- a/source/network/NetMessage.cpp +++ b/source/network/NetMessage.cpp @@ -54,7 +54,7 @@ const u8* CNetMessage::Deserialize(const u8* pStart, const u8* pEnd) { if (pStart + 3 > pEnd) { - LOGERROR(L"CNetMessage: Corrupt packet (smaller than header)"); + LOGERROR("CNetMessage: Corrupt packet (smaller than header)"); return NULL; } @@ -68,7 +68,7 @@ const u8* CNetMessage::Deserialize(const u8* pStart, const u8* pEnd) if (pStart + size != pEnd) { - LOGERROR(L"CNetMessage: Corrupt packet (incorrect size)"); + LOGERROR("CNetMessage: Corrupt packet (incorrect size)"); return NULL; } @@ -184,7 +184,7 @@ CNetMessage* CNetMessageFactory::CreateMessage(const void* pData, break; default: - LOGERROR(L"CNetMessageFactory::CreateMessage(): Unknown message type '%d' received", header.GetType()); + LOGERROR("CNetMessageFactory::CreateMessage(): Unknown message type '%d' received", header.GetType()); break; } diff --git a/source/network/NetServer.cpp b/source/network/NetServer.cpp index bcf904d13a..ca4850428a 100644 --- a/source/network/NetServer.cpp +++ b/source/network/NetServer.cpp @@ -94,7 +94,7 @@ public: if (!session) { - LOGMESSAGE(L"Net server: rejoining client disconnected before we sent to it"); + LOGMESSAGE("Net server: rejoining client disconnected before we sent to it"); return; } @@ -177,7 +177,7 @@ bool CNetServerWorker::SetupConnection() m_Host = enet_host_create(&addr, MAX_CLIENTS, CHANNEL_COUNT, 0, 0); if (!m_Host) { - LOGERROR(L"Net server: enet_host_create failed"); + LOGERROR("Net server: enet_host_create failed"); return false; } @@ -224,7 +224,7 @@ void* CNetServerWorker::SetupUPnP(void*) std::string rootDescURL; CFG_GET_VAL("network.upnprootdescurl", rootDescURL); if (!rootDescURL.empty()) - LOGMESSAGE(L"Net server: attempting to use cached root descriptor URL: %hs", rootDescURL.c_str()); + LOGMESSAGE("Net server: attempting to use cached root descriptor URL: %hs", rootDescURL.c_str()); int ret = 0; bool allocatedUrls = false; @@ -232,7 +232,7 @@ void* CNetServerWorker::SetupUPnP(void*) // Try a cached URL first if (!rootDescURL.empty() && UPNP_GetIGDFromUrl(rootDescURL.c_str(), &urls, &data, internalIPAddress, sizeof(internalIPAddress))) { - LOGMESSAGE(L"Net server: using cached IGD = %hs", urls.controlURL); + LOGMESSAGE("Net server: using cached IGD = %hs", urls.controlURL); ret = 1; } // No cached URL, or it did not respond. Try getting a valid UPnP device for 10 seconds. @@ -243,23 +243,23 @@ void* CNetServerWorker::SetupUPnP(void*) } else { - LOGMESSAGE(L"Net server: upnpDiscover failed and no working cached URL."); + LOGMESSAGE("Net server: upnpDiscover failed and no working cached URL."); return NULL; } switch (ret) { case 0: - LOGMESSAGE(L"Net server: No IGD found"); + LOGMESSAGE("Net server: No IGD found"); break; case 1: - LOGMESSAGE(L"Net server: found valid IGD = %hs", urls.controlURL); + LOGMESSAGE("Net server: found valid IGD = %hs", urls.controlURL); break; case 2: - LOGMESSAGE(L"Net server: found a valid, not connected IGD = %hs, will try to continue anyway", urls.controlURL); + LOGMESSAGE("Net server: found a valid, not connected IGD = %hs, will try to continue anyway", urls.controlURL); break; case 3: - LOGMESSAGE(L"Net server: found a UPnP device unrecognized as IGD = %hs, will try to continue anyway", urls.controlURL); + LOGMESSAGE("Net server: found a UPnP device unrecognized as IGD = %hs, will try to continue anyway", urls.controlURL); break; default: debug_warn(L"Unrecognized return value from UPNP_GetValidIGD"); @@ -269,17 +269,17 @@ void* CNetServerWorker::SetupUPnP(void*) ret = UPNP_GetExternalIPAddress(urls.controlURL, data.first.servicetype, externalIPAddress); if (ret != UPNPCOMMAND_SUCCESS) { - LOGMESSAGE(L"Net server: GetExternalIPAddress failed with code %d (%hs)", ret, strupnperror(ret)); + LOGMESSAGE("Net server: GetExternalIPAddress failed with code %d (%hs)", ret, strupnperror(ret)); return NULL; } - LOGMESSAGE(L"Net server: ExternalIPAddress = %hs", externalIPAddress); + LOGMESSAGE("Net server: ExternalIPAddress = %hs", externalIPAddress); // Try to setup port forwarding. ret = UPNP_AddPortMapping(urls.controlURL, data.first.servicetype, psPort, psPort, internalIPAddress, description, protocall, 0, leaseDuration); if (ret != UPNPCOMMAND_SUCCESS) { - LOGMESSAGE(L"Net server: AddPortMapping(%hs, %hs, %hs) failed with code %d (%hs)", + LOGMESSAGE("Net server: AddPortMapping(%hs, %hs, %hs) failed with code %d (%hs)", psPort, psPort, internalIPAddress, ret, strupnperror(ret)); return NULL; } @@ -296,17 +296,17 @@ void* CNetServerWorker::SetupUPnP(void*) if (ret != UPNPCOMMAND_SUCCESS) { - LOGMESSAGE(L"Net server: GetSpecificPortMappingEntry() failed with code %d (%hs)", ret, strupnperror(ret)); + LOGMESSAGE("Net server: GetSpecificPortMappingEntry() failed with code %d (%hs)", ret, strupnperror(ret)); return NULL; } - LOGMESSAGE(L"Net server: External %hs:%hs %hs is redirected to internal %hs:%hs (duration=%hs)", + LOGMESSAGE("Net server: External %hs:%hs %hs is redirected to internal %hs:%hs (duration=%hs)", externalIPAddress, psPort, protocall, intClient, intPort, duration); // Cache root descriptor URL to try to avoid discovery next time. g_ConfigDB.SetValueString(CFG_USER, "network.upnprootdescurl", urls.controlURL); g_ConfigDB.WriteFile(CFG_USER); - LOGMESSAGE(L"Net server: cached UPnP root descriptor URL as %hs", urls.controlURL); + LOGMESSAGE("Net server: cached UPnP root descriptor URL as %hs", urls.controlURL); // Make sure everything is properly freed. if (allocatedUrls) @@ -451,7 +451,7 @@ bool CNetServerWorker::RunStep() int status = enet_host_service(m_Host, &event, HOST_SERVICE_TIMEOUT); if (status < 0) { - LOGERROR(L"CNetServerWorker: enet_host_service failed (%d)", status); + LOGERROR("CNetServerWorker: enet_host_service failed (%d)", status); // TODO: notify game that the server has shut down return false; } @@ -471,7 +471,7 @@ bool CNetServerWorker::RunStep() // Report the client address char hostname[256] = "(error)"; enet_address_get_host_ip(&event.peer->address, hostname, ARRAY_SIZE(hostname)); - LOGMESSAGE(L"Net server: Received connection from %hs:%u", hostname, (unsigned int)event.peer->address.port); + LOGMESSAGE("Net server: Received connection from %hs:%u", hostname, (unsigned int)event.peer->address.port); // Set up a session object for this peer @@ -496,7 +496,7 @@ bool CNetServerWorker::RunStep() CNetServerSession* session = static_cast(event.peer->data); if (session) { - LOGMESSAGE(L"Net server: Disconnected %hs", DebugName(session).c_str()); + LOGMESSAGE("Net server: Disconnected %hs", DebugName(session).c_str()); // Remove the session first, so we won't send player-update messages to it // when updating the FSM @@ -522,7 +522,7 @@ bool CNetServerWorker::RunStep() CNetMessage* msg = CNetMessageFactory::CreateMessage(event.packet->data, event.packet->dataLength, GetScriptInterface()); if (msg) { - LOGMESSAGE(L"Net server: Received message %hs of size %lu from %hs", msg->ToString().c_str(), (unsigned long)msg->GetSerializedLength(), DebugName(session).c_str()); + LOGMESSAGE("Net server: Received message %hs of size %lu from %hs", msg->ToString().c_str(), (unsigned long)msg->GetSerializedLength(), DebugName(session).c_str()); HandleMessageReceive(msg, session); @@ -566,7 +566,7 @@ void CNetServerWorker::HandleMessageReceive(const CNetMessage* message, CNetServ // Update FSM bool ok = session->Update(message->GetType(), (void*)message); if (!ok) - LOGERROR(L"Net server: Error running FSM update (type=%d state=%d)", (int)message->GetType(), (int)session->GetCurrState()); + LOGERROR("Net server: Error running FSM update (type=%d state=%d)", (int)message->GetType(), (int)session->GetCurrState()); } void CNetServerWorker::SetupSession(CNetServerSession* session) @@ -810,7 +810,7 @@ bool CNetServerWorker::OnAuthenticate(void* context, CFsmEvent* event) // Players who weren't already in the game are not allowed to join now that it's started if (!isRejoining) { - LOGMESSAGE(L"Refused connection after game start from not-previously-known user \"%ls\"", username.c_str()); + LOGMESSAGE("Refused connection after game start from not-previously-known user \"%ls\"", username.c_str()); session->Disconnect(NDR_SERVER_ALREADY_IN_GAME); return true; } diff --git a/source/network/NetSession.cpp b/source/network/NetSession.cpp index 6bdaa57db5..cadf277c58 100644 --- a/source/network/NetSession.cpp +++ b/source/network/NetSession.cpp @@ -112,7 +112,7 @@ void CNetClientSession::Poll() // Report the server address char hostname[256] = "(error)"; enet_address_get_host_ip(&event.peer->address, hostname, ARRAY_SIZE(hostname)); - LOGMESSAGE(L"Net client: Connected to %hs:%u", hostname, (unsigned int)event.peer->address.port); + LOGMESSAGE("Net client: Connected to %hs:%u", hostname, (unsigned int)event.peer->address.port); m_Client.HandleConnect(); @@ -123,7 +123,7 @@ void CNetClientSession::Poll() { ENSURE(event.peer == m_Server); - LOGMESSAGE(L"Net client: Disconnected"); + LOGMESSAGE("Net client: Disconnected"); m_Client.HandleDisconnect(event.data); return; } @@ -133,7 +133,7 @@ void CNetClientSession::Poll() CNetMessage* msg = CNetMessageFactory::CreateMessage(event.packet->data, event.packet->dataLength, m_Client.GetScriptInterface()); if (msg) { - LOGMESSAGE(L"Net client: Received message %hs of size %lu from server", msg->ToString().c_str(), (unsigned long)msg->GetSerializedLength()); + LOGMESSAGE("Net client: Received message %hs of size %lu from server", msg->ToString().c_str(), (unsigned long)msg->GetSerializedLength()); m_Client.HandleMessage(msg); diff --git a/source/network/NetTurnManager.cpp b/source/network/NetTurnManager.cpp index 70059ecb5c..2b9ade2c03 100644 --- a/source/network/NetTurnManager.cpp +++ b/source/network/NetTurnManager.cpp @@ -244,7 +244,7 @@ void CNetTurnManager::OnSyncError(u32 turn, const std::string& expectedHash) if (g_GUI) g_GUI->DisplayMessageBox(600, 350, L"Sync error", msg.str()); else - LOGERROR(L"%ls", msg.str().c_str()); + LOGERROR("%ls", msg.str().c_str()); } void CNetTurnManager::Interpolate(float simFrameLength, float realFrameLength) @@ -327,7 +327,7 @@ void CNetTurnManager::QuickSave() bool ok = m_Simulation2.SerializeState(stream); if (!ok) { - LOGERROR(L"Failed to quicksave game"); + LOGERROR("Failed to quicksave game"); return; } @@ -337,7 +337,7 @@ void CNetTurnManager::QuickSave() else m_QuickSaveMetadata = std::string(); - LOGMESSAGERENDER(L"Quicksaved game"); + LOGMESSAGERENDER("Quicksaved game"); } @@ -347,7 +347,7 @@ void CNetTurnManager::QuickLoad() if (m_QuickSaveState.empty()) { - LOGERROR(L"Cannot quickload game - no game was quicksaved"); + LOGERROR("Cannot quickload game - no game was quicksaved"); return; } @@ -355,14 +355,14 @@ void CNetTurnManager::QuickLoad() bool ok = m_Simulation2.DeserializeState(stream); if (!ok) { - LOGERROR(L"Failed to quickload game"); + LOGERROR("Failed to quickload game"); return; } if (g_GUI && !m_QuickSaveMetadata.empty()) g_GUI->RestoreSavedGameData(m_QuickSaveMetadata); - LOGMESSAGERENDER(L"Quickloaded game"); + LOGMESSAGERENDER("Quickloaded game"); // See RewindTimeWarp ResetState(0, 1); diff --git a/source/ps/CStrIntern.cpp b/source/ps/CStrIntern.cpp index 53a5098694..6d87a4c924 100644 --- a/source/ps/CStrIntern.cpp +++ b/source/ps/CStrIntern.cpp @@ -30,7 +30,7 @@ public: CStrInternInternals(const char* str, size_t len) : data(str, str+len), hash(fnv_hash(str, len)) { -// LOGWARNING(L"New interned string '%hs'", data.c_str()); +// LOGWARNING("New interned string '%hs'", data.c_str()); } bool operator==(const CStrInternInternals& b) const diff --git a/source/ps/ConfigDB.cpp b/source/ps/ConfigDB.cpp index 11ce79ea0c..17b4838cde 100644 --- a/source/ps/ConfigDB.cpp +++ b/source/ps/ConfigDB.cpp @@ -214,15 +214,15 @@ bool CConfigDB::Reload(EConfigNamespace ns) // Handle missing files quietly if (g_VFS->GetFileInfo(m_ConfigFile[ns], NULL) < 0) { - LOGMESSAGE(L"Cannot find config file \"%ls\" - ignoring", m_ConfigFile[ns].string().c_str()); + LOGMESSAGE("Cannot find config file \"%ls\" - ignoring", m_ConfigFile[ns].string().c_str()); return false; } - LOGMESSAGE(L"Loading config file \"%ls\"", m_ConfigFile[ns].string().c_str()); + LOGMESSAGE("Loading config file \"%ls\"", m_ConfigFile[ns].string().c_str()); Status ret = g_VFS->LoadFile(m_ConfigFile[ns], buffer, buflen); if (ret != INFO::OK) { - LOGERROR(L"CConfigDB::Reload(): vfs_load for \"%ls\" failed: return was %lld", m_ConfigFile[ns].string().c_str(), (long long)ret); + LOGERROR("CConfigDB::Reload(): vfs_load for \"%ls\" failed: return was %lld", m_ConfigFile[ns].string().c_str(), (long long)ret); return false; } } @@ -256,18 +256,18 @@ bool CConfigDB::Reload(EConfigNamespace ns) if (pos == filebufend || *pos == '\n') { - LOGERROR(L"Config header with missing close tag encountered on line %d in '%ls'", line, m_ConfigFile[ns].string().c_str()); + LOGERROR("Config header with missing close tag encountered on line %d in '%ls'", line, m_ConfigFile[ns].string().c_str()); header.clear(); ++line; continue; } - LOGMESSAGE(L"Found config header '%hs'", header.c_str()); + LOGMESSAGE("Found config header '%hs'", header.c_str()); header.push_back('.'); while (++pos < filebufend && *pos != '\n' && *pos != ';') if (*pos != ' ' && *pos != '\r') { - LOGERROR(L"Config settings on the same line as a header on line %d in '%ls'", line, m_ConfigFile[ns].string().c_str()); + LOGERROR("Config settings on the same line as a header on line %d in '%ls'", line, m_ConfigFile[ns].string().c_str()); break; } while (pos < filebufend && *pos != '\n') @@ -288,7 +288,7 @@ bool CConfigDB::Reload(EConfigNamespace ns) { if (*pos == '\\' && ++pos == filebufend) { - LOGERROR(L"Escape character at end of input (line %d in '%ls')", line, m_ConfigFile[ns].string().c_str()); + LOGERROR("Escape character at end of input (line %d in '%ls')", line, m_ConfigFile[ns].string().c_str()); break; } @@ -316,7 +316,7 @@ bool CConfigDB::Reload(EConfigNamespace ns) } } if (quoted) // We ignore the invalid parameter - LOGERROR(L"Unmatched quote while parsing config file '%ls' on line %d", m_ConfigFile[ns].string().c_str(), line); + LOGERROR("Unmatched quote while parsing config file '%ls' on line %d", m_ConfigFile[ns].string().c_str(), line); else if (!value.empty()) values.push_back(value); value.clear(); @@ -337,18 +337,18 @@ bool CConfigDB::Reload(EConfigNamespace ns) CStr key(header + name); newMap[key] = values; if (key == "lobby.password") - LOGMESSAGE(L"Loaded config string \"%hs\"", key.c_str()); + LOGMESSAGE("Loaded config string \"%hs\"", key.c_str()); else { std::string vals; for (size_t i = 0; i < newMap[key].size() - 1; ++i) vals += "\"" + EscapeString(newMap[key][i]) + "\", "; vals += "\"" + EscapeString(newMap[key][values.size()-1]) + "\""; - LOGMESSAGE(L"Loaded config string \"%hs\" = %hs", key.c_str(), vals.c_str()); + LOGMESSAGE("Loaded config string \"%hs\" = %hs", key.c_str(), vals.c_str()); } } else if (!name.empty()) - LOGERROR(L"Encountered config setting '%hs' without value while parsing '%ls' on line %d", name.c_str(), m_ConfigFile[ns].string().c_str(), line); + LOGERROR("Encountered config setting '%hs' without value while parsing '%ls' on line %d", name.c_str(), m_ConfigFile[ns].string().c_str(), line); name.clear(); values.clear(); @@ -356,7 +356,7 @@ bool CConfigDB::Reload(EConfigNamespace ns) } if (!name.empty()) - LOGERROR(L"Config file does not have a new line after the last config setting '%hs'", name.c_str()); + LOGERROR("Config file does not have a new line after the last config setting '%hs'", name.c_str()); m_Map[ns].swap(newMap); @@ -393,7 +393,7 @@ bool CConfigDB::WriteFile(EConfigNamespace ns, const VfsPath& path) Status ret = g_VFS->CreateFile(path, buf, len); if (ret < 0) { - LOGERROR(L"CConfigDB::WriteFile(): CreateFile \"%ls\" failed (error: %d)", path.string().c_str(), (int)ret); + LOGERROR("CConfigDB::WriteFile(): CreateFile \"%ls\" failed (error: %d)", path.string().c_str(), (int)ret); return false; } diff --git a/source/ps/DllLoader.cpp b/source/ps/DllLoader.cpp index ad120fb542..758ba81896 100644 --- a/source/ps/DllLoader.cpp +++ b/source/ps/DllLoader.cpp @@ -196,13 +196,13 @@ void DllLoader::LogLoadError(const char* errors) switch (m_LoadErrorLogMethod) { case CLogger::Normal: - LOGMESSAGE(L"DllLoader: %hs", errors); + LOGMESSAGE("DllLoader: %hs", errors); break; case CLogger::Warning: - LOGWARNING(L"DllLoader: %hs", errors); + LOGWARNING("DllLoader: %hs", errors); break; case CLogger::Error: - LOGERROR(L"DllLoader: %hs", errors); + LOGERROR("DllLoader: %hs", errors); break; } } diff --git a/source/ps/FileIo.cpp b/source/ps/FileIo.cpp index e06d339863..c345da7098 100644 --- a/source/ps/FileIo.cpp +++ b/source/ps/FileIo.cpp @@ -69,7 +69,7 @@ void CFilePacker::Write(const VfsPath& filename) const Status st = g_VFS->CreateFile(filename, m_writeBuffer.Data(), m_writeBuffer.Size()); if (st < 0) { - LOGERROR(L"Failed to write file '%ls' with status '%lld'", filename.string().c_str(), (long long)st); + LOGERROR("Failed to write file '%ls' with status '%lld'", filename.string().c_str(), (long long)st); throw PSERROR_File_WriteFailed(); } } diff --git a/source/ps/Filesystem.cpp b/source/ps/Filesystem.cpp index de0ba9ef53..d273ce59b2 100644 --- a/source/ps/Filesystem.cpp +++ b/source/ps/Filesystem.cpp @@ -124,7 +124,7 @@ PSRETURN CVFSFile::Load(const PIVFS& vfs, const VfsPath& filename, bool log /* = if (ret != INFO::OK) { if (log) - LOGERROR(L"CVFSFile: file %ls couldn't be opened (vfs_load: %lld)", filename.string().c_str(), (long long)ret); + LOGERROR("CVFSFile: file %ls couldn't be opened (vfs_load: %lld)", filename.string().c_str(), (long long)ret); m_Buffer.reset(); m_BufferSize = 0; return PSRETURN_CVFSFile_LoadFailed; diff --git a/source/ps/GameSetup/Config.cpp b/source/ps/GameSetup/Config.cpp index 0f18291ff8..67fc7b22de 100644 --- a/source/ps/GameSetup/Config.cpp +++ b/source/ps/GameSetup/Config.cpp @@ -131,11 +131,11 @@ static void LoadGlobals() CFG_GET_VAL("profiler2.script.enable", g_ScriptProfilingEnabled); if (g_JSDebuggerEnabled) - LOGERROR(L"JS debugger temporarily disabled during the SpiderMonkey upgrade (check trac ticket #2348 for details)"); + LOGERROR("JS debugger temporarily disabled during the SpiderMonkey upgrade (check trac ticket #2348 for details)"); // Script Debugging and profiling does not make sense together because of the hooks // that reduce performance a lot - and it wasn't tested if it even works together. if (g_JSDebuggerEnabled && g_ScriptProfilingEnabled) - LOGERROR(L"Enabling both script profiling and script debugging is not supported!"); + LOGERROR("Enabling both script profiling and script debugging is not supported!"); } diff --git a/source/ps/GameSetup/GameSetup.cpp b/source/ps/GameSetup/GameSetup.cpp index 37096481de..dac6867b31 100644 --- a/source/ps/GameSetup/GameSetup.cpp +++ b/source/ps/GameSetup/GameSetup.cpp @@ -293,7 +293,7 @@ void Render() #warning TODO: cursors for Android #else if (cursor_draw(g_VFS, cursorName.c_str(), g_mouse_x, g_yres-g_mouse_y, forceGL) < 0) - LOGWARNING(L"Failed to draw cursor '%ls'", cursorName.c_str()); + LOGWARNING("Failed to draw cursor '%ls'", cursorName.c_str()); #endif #if CONFIG2_GLES @@ -656,7 +656,7 @@ static void InitSDL() if(SDL_Init(SDL_INIT_VIDEO|SDL_INIT_TIMER|SDL_INIT_NOPARACHUTE) < 0) { - LOGERROR(L"SDL library initialization failed: %hs", SDL_GetError()); + LOGERROR("SDL library initialization failed: %hs", SDL_GetError()); throw PSERROR_System_SDLInitFailed(); } atexit(SDL_Quit); @@ -814,21 +814,21 @@ static void FixLocales() } catch (std::runtime_error&) { - LOGWARNING(L"Invalid locale settings"); + LOGWARNING("Invalid locale settings"); for (size_t i = 0; i < ARRAY_SIZE(LocaleEnvVars); i++) { if (char* envval = getenv(LocaleEnvVars[i])) - LOGWARNING(L" %hs=\"%hs\"", LocaleEnvVars[i], envval); + LOGWARNING(" %hs=\"%hs\"", LocaleEnvVars[i], envval); else - LOGWARNING(L" %hs=\"(unset)\"", LocaleEnvVars[i]); + LOGWARNING(" %hs=\"(unset)\"", LocaleEnvVars[i]); } // We should set LC_ALL since it overrides LANG if (setenv("LC_ALL", std::locale::classic().name().c_str(), 1)) debug_warn(L"Invalid locale settings, and unable to set LC_ALL env variable."); else - LOGWARNING(L"Setting LC_ALL env variable to: %hs", getenv("LC_ALL")); + LOGWARNING("Setting LC_ALL env variable to: %hs", getenv("LC_ALL")); } } #else @@ -1132,7 +1132,7 @@ CStr8 LoadSettingsOfScenarioMap(const VfsPath &mapPath) if (INFO::OK != loadResult) { - LOGERROR(L"LoadSettingsOfScenarioMap: Unable to load map file '%ls'", mapPath.string().c_str()); + LOGERROR("LoadSettingsOfScenarioMap: Unable to load map file '%ls'", mapPath.string().c_str()); throw PSERROR_Game_World_MapLoadFailed("Unable to load map file, check the path for typos."); } XMBElement mapElement = mapFile.GetRoot(); @@ -1246,7 +1246,7 @@ bool Autostart(const CmdLineArgs& args) else { // Problem with JSON file - LOGERROR(L"Autostart: Error reading random map script '%ls'", scriptPath.c_str()); + LOGERROR("Autostart: Error reading random map script '%ls'", scriptPath.c_str()); throw PSERROR_Game_World_MapLoadFailed("Error reading random map script.\nCheck application log for details."); } @@ -1301,7 +1301,7 @@ bool Autostart(const CmdLineArgs& args) } else { - LOGERROR(L"Autostart: Unrecognized map type '%ls'", mapDirectory.c_str()); + LOGERROR("Autostart: Unrecognized map type '%ls'", mapDirectory.c_str()); throw PSERROR_Game_World_MapLoadFailed("Unrecognized map type.\nConsult readme.txt for the currently supported types."); } scriptInterface.SetProperty(attrs, "mapType", mapType); @@ -1336,7 +1336,7 @@ bool Autostart(const CmdLineArgs& args) if (mapDirectory == L"scenarios" || mapDirectory == L"skirmishes") { // playerID is certainly bigger than this map player number - LOGWARNING(L"Autostart: Invalid player %d in autostart-ai option", playerID); + LOGWARNING("Autostart: Invalid player %d in autostart-ai option", playerID); continue; } scriptInterface.Eval("({})", &player); @@ -1363,7 +1363,7 @@ bool Autostart(const CmdLineArgs& args) if (mapDirectory == L"scenarios" || mapDirectory == L"skirmishes") { // playerID is certainly bigger than this map player number - LOGWARNING(L"Autostart: Invalid player %d in autostart-aidiff option", playerID); + LOGWARNING("Autostart: Invalid player %d in autostart-aidiff option", playerID); continue; } scriptInterface.Eval("({})", &player); @@ -1391,7 +1391,7 @@ bool Autostart(const CmdLineArgs& args) if (mapDirectory == L"skirmishes") { // playerID is certainly bigger than this map player number - LOGWARNING(L"Autostart: Invalid player %d in autostart-civ option", playerID); + LOGWARNING("Autostart: Invalid player %d in autostart-civ option", playerID); continue; } scriptInterface.Eval("({})", &player); @@ -1403,7 +1403,7 @@ bool Autostart(const CmdLineArgs& args) } } else - LOGWARNING(L"Autostart: Option 'autostart-civ' is invalid for scenarios"); + LOGWARNING("Autostart: Option 'autostart-civ' is invalid for scenarios"); } // Add player data to map settings diff --git a/source/ps/GameSetup/HWDetect.cpp b/source/ps/GameSetup/HWDetect.cpp index 4d7668aeaf..97276f7e34 100644 --- a/source/ps/GameSetup/HWDetect.cpp +++ b/source/ps/GameSetup/HWDetect.cpp @@ -203,7 +203,7 @@ void RunHardwareDetection() CVFSFile file; if (file.Load(g_VFS, scriptName) != PSRETURN_OK) { - LOGERROR(L"Failed to load hardware detection script"); + LOGERROR("Failed to load hardware detection script"); return; } diff --git a/source/ps/GameSetup/Paths.cpp b/source/ps/GameSetup/Paths.cpp index 7d9883e42e..aeeca957be 100644 --- a/source/ps/GameSetup/Paths.cpp +++ b/source/ps/GameSetup/Paths.cpp @@ -172,7 +172,7 @@ Paths::Paths(const CmdLineArgs& args) // make sure it's valid if(!FileExists(pathname)) { - LOGERROR(L"Cannot find executable (expected at '%ls')", pathname.string().c_str()); + LOGERROR("Cannot find executable (expected at '%ls')", pathname.string().c_str()); WARN_IF_ERR(StatusFromErrno()); } diff --git a/source/ps/Hotkey.cpp b/source/ps/Hotkey.cpp index 22ceeba593..cd7730b484 100644 --- a/source/ps/Hotkey.cpp +++ b/source/ps/Hotkey.cpp @@ -83,7 +83,7 @@ static void LoadConfigBindings() int mapping = FindKeyCode(*it); if (!mapping) { - LOGWARNING(L"Hotkey mapping used invalid key '%hs'", hotkey.c_str()); + LOGWARNING("Hotkey mapping used invalid key '%hs'", hotkey.c_str()); continue; } diff --git a/source/ps/Joystick.cpp b/source/ps/Joystick.cpp index 295062045f..3fa207a90e 100644 --- a/source/ps/Joystick.cpp +++ b/source/ps/Joystick.cpp @@ -41,13 +41,13 @@ void CJoystick::Initialise() if (SDL_InitSubSystem(SDL_INIT_JOYSTICK) < 0) { - LOGERROR(L"CJoystick::Initialise failed to initialise joysticks (\"%hs\")", SDL_GetError()); + LOGERROR("CJoystick::Initialise failed to initialise joysticks (\"%hs\")", SDL_GetError()); return; } int numJoysticks = SDL_NumJoysticks(); - LOGMESSAGE(L"Found %d joystick(s)", numJoysticks); + LOGMESSAGE("Found %d joystick(s)", numJoysticks); for (int i = 0; i < numJoysticks; ++i) { @@ -55,14 +55,14 @@ void CJoystick::Initialise() SDL_Joystick* stick = SDL_JoystickOpen(i); if (!stick) { - LOGERROR(L"CJoystick::Initialise failed to open joystick %d (\"%hs\")", i, SDL_GetError()); + LOGERROR("CJoystick::Initialise failed to open joystick %d (\"%hs\")", i, SDL_GetError()); continue; } const char* name = SDL_JoystickName(stick); #else // SDL 1.2 const char* name = SDL_JoystickName(i); #endif - LOGMESSAGE(L"Joystick %d: %hs", i, name); + LOGMESSAGE("Joystick %d: %hs", i, name); #if SDL_VERSION_ATLEAST(2, 0, 0) SDL_JoystickClose(stick); #endif @@ -75,7 +75,7 @@ void CJoystick::Initialise() // Always pick the first joystick, and assume that's the right one m_Joystick = SDL_JoystickOpen(0); if (!m_Joystick) - LOGERROR(L"CJoystick::Initialise failed to open joystick (\"%hs\")", SDL_GetError()); + LOGERROR("CJoystick::Initialise failed to open joystick (\"%hs\")", SDL_GetError()); } } diff --git a/source/ps/Overlay.cpp b/source/ps/Overlay.cpp index f09d3d28e5..a7e90aa775 100644 --- a/source/ps/Overlay.cpp +++ b/source/ps/Overlay.cpp @@ -48,24 +48,24 @@ bool CColor::ParseString(const CStr8& Value, int DefaultAlpha) stream >> values[i]; if ((stream.rdstate() & std::stringstream::failbit) != 0) { - LOGWARNING(L"Unable to parse CColor parameters. Your input: '%hs'", Value.c_str()); + LOGWARNING("Unable to parse CColor parameters. Your input: '%hs'", Value.c_str()); return false; } if (values[i] < 0 || values[i] > 255) { - LOGWARNING(L"Invalid value (<0 or >255) when parsing CColor parameters. Your input: '%hs'", Value.c_str()); + LOGWARNING("Invalid value (<0 or >255) when parsing CColor parameters. Your input: '%hs'", Value.c_str()); return false; } } if (i < 3) { - LOGWARNING(L"Not enough parameters when parsing as CColor. Your input: '%hs'", Value.c_str()); + LOGWARNING("Not enough parameters when parsing as CColor. Your input: '%hs'", Value.c_str()); return false; } if (!stream.eof()) { - LOGWARNING(L"Too many parameters when parsing as CColor. Your input: '%hs'", Value.c_str()); + LOGWARNING("Too many parameters when parsing as CColor. Your input: '%hs'", Value.c_str()); return false; } diff --git a/source/ps/Preprocessor.cpp b/source/ps/Preprocessor.cpp index d7c228df39..782142391c 100644 --- a/source/ps/Preprocessor.cpp +++ b/source/ps/Preprocessor.cpp @@ -231,10 +231,10 @@ static void DefaultError (void *iData, int iLine, const char *iError, { (void)iData; if (iToken) - LOGERROR(L"Preprocessor error: line %d: %hs: '%.*hs'\n", + LOGERROR("Preprocessor error: line %d: %hs: '%.*hs'\n", iLine, iError, int (iTokenLen), iToken); else - LOGERROR(L"Preprocessor error: line %d: %hs\n", iLine, iError); + LOGERROR("Preprocessor error: line %d: %hs\n", iLine, iError); } //---------------------------------------------------------------------------// diff --git a/source/ps/PreprocessorWrapper.cpp b/source/ps/PreprocessorWrapper.cpp index 720edb17a7..096d2848ae 100644 --- a/source/ps/PreprocessorWrapper.cpp +++ b/source/ps/PreprocessorWrapper.cpp @@ -51,7 +51,7 @@ bool CPreprocessorWrapper::TestConditional(const CStr& expr) if (!output) { - LOGERROR(L"Failed to parse conditional expression '%hs'", expr.c_str()); + LOGERROR("Failed to parse conditional expression '%hs'", expr.c_str()); return false; } @@ -72,7 +72,7 @@ CStr CPreprocessorWrapper::Preprocess(const CStr& input) if (!output) { - LOGERROR(L"Shader preprocessing failed"); + LOGERROR("Shader preprocessing failed"); return ""; } diff --git a/source/ps/ProfileViewer.cpp b/source/ps/ProfileViewer.cpp index e976e9071b..fe6fdab7a6 100644 --- a/source/ps/ProfileViewer.cpp +++ b/source/ps/ProfileViewer.cpp @@ -570,12 +570,12 @@ void CProfileViewer::SaveToFile() if (m->outputStream.fail()) { - LOGERROR(L"Failed to open profile log file"); + LOGERROR("Failed to open profile log file"); return; } else { - LOGMESSAGERENDER(L"Profiler snapshot saved to '%ls'", path.string().c_str()); + LOGMESSAGERENDER("Profiler snapshot saved to '%ls'", path.string().c_str()); } } diff --git a/source/ps/Profiler2.cpp b/source/ps/Profiler2.cpp index ae49b0c8ff..d989e4296f 100644 --- a/source/ps/Profiler2.cpp +++ b/source/ps/Profiler2.cpp @@ -126,7 +126,7 @@ static void* MgCallback(mg_event event, struct mg_connection *conn, const struct case MG_EVENT_LOG: // Called by Mongoose's cry() - LOGERROR(L"Mongoose error: %hs", request_info->log_message); + LOGERROR("Mongoose error: %hs", request_info->log_message); return NULL; case MG_INIT_SSL: @@ -157,7 +157,7 @@ void CProfiler2::InitialiseGPU() void CProfiler2::EnableHTTP() { ENSURE(m_Initialised); - LOGMESSAGERENDER(L"Starting profiler2 HTTP server"); + LOGMESSAGERENDER("Starting profiler2 HTTP server"); // Ignore multiple enablings if (m_MgContext) @@ -177,20 +177,20 @@ void CProfiler2::EnableGPU() ENSURE(m_Initialised); if (!m_GPU) { - LOGMESSAGERENDER(L"Starting profiler2 GPU mode"); + LOGMESSAGERENDER("Starting profiler2 GPU mode"); InitialiseGPU(); } } void CProfiler2::ShutdownGPU() { - LOGMESSAGERENDER(L"Shutting down profiler2 GPU mode"); + LOGMESSAGERENDER("Shutting down profiler2 GPU mode"); SAFE_DELETE(m_GPU); } void CProfiler2::ShutDownHTTP() { - LOGMESSAGERENDER(L"Shutting down profiler2 HTTP server"); + LOGMESSAGERENDER("Shutting down profiler2 HTTP server"); if (m_MgContext) { mg_stop(m_MgContext); diff --git a/source/ps/SavedGame.cpp b/source/ps/SavedGame.cpp index 007dcb23d1..7bc32af969 100644 --- a/source/ps/SavedGame.cpp +++ b/source/ps/SavedGame.cpp @@ -244,7 +244,7 @@ std::vector SavedGames::GetSavedGames(ScriptInterface& scriptI if (!archiveReader) { // Triggered by e.g. the file being open in another program - LOGWARNING(L"Failed to read saved game '%ls'", realPath.string().c_str()); + LOGWARNING("Failed to read saved game '%ls'", realPath.string().c_str()); continue; // skip this file } diff --git a/source/ps/TemplateLoader.cpp b/source/ps/TemplateLoader.cpp index 30f34ceac8..5c499e55c7 100644 --- a/source/ps/TemplateLoader.cpp +++ b/source/ps/TemplateLoader.cpp @@ -39,7 +39,7 @@ bool CTemplateLoader::LoadTemplateFile(const std::string& templateName, int dept // Handle infinite loops more gracefully than running out of stack space and crashing if (depth > 100) { - LOGERROR(L"Probable infinite inheritance loop in entity template '%hs'", templateName.c_str()); + LOGERROR("Probable infinite inheritance loop in entity template '%hs'", templateName.c_str()); return false; } @@ -57,7 +57,7 @@ bool CTemplateLoader::LoadTemplateFile(const std::string& templateName, int dept std::string baseName = templateName.substr(8); if (!LoadTemplateFile(baseName, depth+1)) { - LOGERROR(L"Failed to load entity template '%hs'", baseName.c_str()); + LOGERROR("Failed to load entity template '%hs'", baseName.c_str()); return false; } // Copy a subset to the requested template @@ -72,7 +72,7 @@ bool CTemplateLoader::LoadTemplateFile(const std::string& templateName, int dept std::string baseName = templateName.substr(7); if (!LoadTemplateFile(baseName, depth+1)) { - LOGERROR(L"Failed to load entity template '%hs'", baseName.c_str()); + LOGERROR("Failed to load entity template '%hs'", baseName.c_str()); return false; } // Copy a subset to the requested template @@ -87,7 +87,7 @@ bool CTemplateLoader::LoadTemplateFile(const std::string& templateName, int dept std::string baseName = templateName.substr(7); if (!LoadTemplateFile(baseName, depth+1)) { - LOGERROR(L"Failed to load entity template '%hs'", baseName.c_str()); + LOGERROR("Failed to load entity template '%hs'", baseName.c_str()); return false; } // Copy a subset to the requested template @@ -102,7 +102,7 @@ bool CTemplateLoader::LoadTemplateFile(const std::string& templateName, int dept std::string baseName = templateName.substr(11); if (!LoadTemplateFile(baseName, depth+1)) { - LOGERROR(L"Failed to load entity template '%hs'", baseName.c_str()); + LOGERROR("Failed to load entity template '%hs'", baseName.c_str()); return false; } // Copy a subset to the requested template @@ -117,7 +117,7 @@ bool CTemplateLoader::LoadTemplateFile(const std::string& templateName, int dept std::string baseName = templateName.substr(13); if (!LoadTemplateFile(baseName, depth+1)) { - LOGERROR(L"Failed to load entity template '%hs'", baseName.c_str()); + LOGERROR("Failed to load entity template '%hs'", baseName.c_str()); return false; } // Copy a subset to the requested template @@ -132,7 +132,7 @@ bool CTemplateLoader::LoadTemplateFile(const std::string& templateName, int dept std::string baseName = templateName.substr(9); if (!LoadTemplateFile(baseName, depth+1)) { - LOGERROR(L"Failed to load entity template '%hs'", baseName.c_str()); + LOGERROR("Failed to load entity template '%hs'", baseName.c_str()); return false; } // Copy a subset to the requested template @@ -155,14 +155,14 @@ bool CTemplateLoader::LoadTemplateFile(const std::string& templateName, int dept // To prevent needless complexity in template design, we don't allow |-separated strings as parents if (parentName.find('|') != parentName.npos) { - LOGERROR(L"Invalid parent '%hs' in entity template '%hs'", parentName.c_str(), templateName.c_str()); + LOGERROR("Invalid parent '%hs' in entity template '%hs'", parentName.c_str(), templateName.c_str()); return false; } // Ensure the parent is loaded if (!LoadTemplateFile(parentName, depth+1)) { - LOGERROR(L"Failed to load parent '%hs' of entity template '%hs'", parentName.c_str(), templateName.c_str()); + LOGERROR("Failed to load parent '%hs' of entity template '%hs'", parentName.c_str(), templateName.c_str()); return false; } @@ -272,7 +272,7 @@ std::vector CTemplateLoader::FindPlaceableTemplates(const std::stri } if (templatesType != SIMULATION_TEMPLATES && templatesType != ACTOR_TEMPLATES && templatesType != ALL_TEMPLATES) - LOGERROR(L"Undefined template type (valid: all, simulation, actor)"); + LOGERROR("Undefined template type (valid: all, simulation, actor)"); return templates; } @@ -304,7 +304,7 @@ std::vector CTemplateLoader::FindTemplates(const std::string& path, } if (templatesType != SIMULATION_TEMPLATES && templatesType != ACTOR_TEMPLATES && templatesType != ALL_TEMPLATES) - LOGERROR(L"Undefined template type (valid: all, simulation, actor)"); + LOGERROR("Undefined template type (valid: all, simulation, actor)"); return templates; } @@ -314,7 +314,7 @@ const CParamNode& CTemplateLoader::GetTemplateFileData(const std::string& templa // Load the template if necessary if (!LoadTemplateFile(templateName, 0)) { - LOGERROR(L"Failed to load entity template '%hs'", templateName.c_str()); + LOGERROR("Failed to load entity template '%hs'", templateName.c_str()); return NULL_NODE; } @@ -327,7 +327,7 @@ void CTemplateLoader::ConstructTemplateActor(const std::string& actorName, CPara const char* templateName = "special/actor"; if (!LoadTemplateFile(templateName, 0)) { - LOGERROR(L"Failed to load entity template '%hs'", templateName); + LOGERROR("Failed to load entity template '%hs'", templateName); return; } diff --git a/source/ps/Util.cpp b/source/ps/Util.cpp index 3817112e4b..62f28977e2 100644 --- a/source/ps/Util.cpp +++ b/source/ps/Util.cpp @@ -244,7 +244,7 @@ void WriteScreenshot(const VfsPath& extension) LOGMESSAGERENDER(wstring_from_utf8(g_L10n.Translate("Screenshot written to '%ls'")).c_str(), realPath.string().c_str()); } else - LOGERROR(L"Error writing screenshot to '%ls'", filename.string().c_str()); + LOGERROR("Error writing screenshot to '%ls'", filename.string().c_str()); } @@ -377,7 +377,7 @@ void WriteBigScreenshot(const VfsPath& extension, int tiles) LOGMESSAGERENDER(wstring_from_utf8(g_L10n.Translate("Screenshot written to '%ls'")).c_str(), realPath.string().c_str()); } else - LOGERROR(L"Error writing screenshot to '%ls'", filename.string().c_str()); + LOGERROR("Error writing screenshot to '%ls'", filename.string().c_str()); free(tile_data); } diff --git a/source/ps/VideoMode.cpp b/source/ps/VideoMode.cpp index 7ff6870e9d..626ca221dc 100644 --- a/source/ps/VideoMode.cpp +++ b/source/ps/VideoMode.cpp @@ -88,7 +88,7 @@ bool CVideoMode::SetVideoMode(int w, int h, int bpp, bool fullscreen) // If fullscreen fails, try windowed mode if (fullscreen) { - LOGWARNING(L"Failed to set the video mode to fullscreen for the chosen resolution " + LOGWARNING("Failed to set the video mode to fullscreen for the chosen resolution " L"%dx%d:%d (\"%hs\"), falling back to windowed mode", w, h, bpp, SDL_GetError()); // Using default size for the window for now, as the attempted setting @@ -97,7 +97,7 @@ bool CVideoMode::SetVideoMode(int w, int h, int bpp, bool fullscreen) } else { - LOGERROR(L"SetVideoMode failed in SDL_CreateWindow: %dx%d:%d %d (\"%hs\")", + LOGERROR("SetVideoMode failed in SDL_CreateWindow: %dx%d:%d %d (\"%hs\")", w, h, bpp, fullscreen ? 1 : 0, SDL_GetError()); return false; } @@ -105,7 +105,7 @@ bool CVideoMode::SetVideoMode(int w, int h, int bpp, bool fullscreen) if (SDL_SetWindowDisplayMode(m_Window, NULL) < 0) { - LOGERROR(L"SetVideoMode failed in SDL_SetWindowDisplayMode: %dx%d:%d %d (\"%hs\")", + LOGERROR("SetVideoMode failed in SDL_SetWindowDisplayMode: %dx%d:%d %d (\"%hs\")", w, h, bpp, fullscreen ? 1 : 0, SDL_GetError()); return false; } @@ -113,7 +113,7 @@ bool CVideoMode::SetVideoMode(int w, int h, int bpp, bool fullscreen) SDL_GLContext context = SDL_GL_CreateContext(m_Window); if (!context) { - LOGERROR(L"SetVideoMode failed in SDL_GL_CreateContext: %dx%d:%d %d (\"%hs\")", + LOGERROR("SetVideoMode failed in SDL_GL_CreateContext: %dx%d:%d %d (\"%hs\")", w, h, bpp, fullscreen ? 1 : 0, SDL_GetError()); return false; } @@ -132,7 +132,7 @@ bool CVideoMode::SetVideoMode(int w, int h, int bpp, bool fullscreen) if (SDL_SetWindowFullscreen(m_Window, flags) < 0) { - LOGERROR(L"SetVideoMode failed in SDL_SetWindowFullscreen: %dx%d:%d %d (\"%hs\")", + LOGERROR("SetVideoMode failed in SDL_SetWindowFullscreen: %dx%d:%d %d (\"%hs\")", w, h, bpp, fullscreen ? 1 : 0, SDL_GetError()); return false; } @@ -172,7 +172,7 @@ bool CVideoMode::SetVideoMode(int w, int h, int bpp, bool fullscreen) // If fullscreen fails, try windowed mode if (fullscreen) { - LOGWARNING(L"Failed to set the video mode to fullscreen for the chosen resolution " + LOGWARNING("Failed to set the video mode to fullscreen for the chosen resolution " L"%dx%d:%d (\"%hs\"), falling back to windowed mode", w, h, bpp, SDL_GetError()); // Using default size for the window for now, as the attempted setting @@ -181,7 +181,7 @@ bool CVideoMode::SetVideoMode(int w, int h, int bpp, bool fullscreen) } else { - LOGERROR(L"SetVideoMode failed: %dx%d:%d %d (\"%hs\")", + LOGERROR("SetVideoMode failed: %dx%d:%d %d (\"%hs\")", w, h, bpp, fullscreen ? 1 : 0, SDL_GetError()); return false; } @@ -294,7 +294,7 @@ bool CVideoMode::InitSDL() u16 ramp[256]; SDL_CalculateGammaRamp(g_Gamma, ramp); if (SDL_SetWindowGammaRamp(m_Window, ramp, ramp, ramp) < 0) - LOGWARNING(L"SDL_SetWindowGammaRamp failed"); + LOGWARNING("SDL_SetWindowGammaRamp failed"); #else # if OS_MACOSX // Workaround for crash on Mavericks, see http://trac.wildfiregames.com/ticket/2272 @@ -304,7 +304,7 @@ bool CVideoMode::InitSDL() { # endif if (SDL_SetGamma(g_Gamma, g_Gamma, g_Gamma) < 0) - LOGWARNING(L"SDL_SetGamma failed"); + LOGWARNING("SDL_SetGamma failed"); # if OS_MACOSX } # endif diff --git a/source/ps/World.cpp b/source/ps/World.cpp index 879825ddfa..12de4d08b6 100644 --- a/source/ps/World.cpp +++ b/source/ps/World.cpp @@ -89,7 +89,7 @@ void CWorld::RegisterInit(const CStrW& mapFile, const CScriptValRooted& settings catch (PSERROR_File& err) { delete reader; - LOGERROR(L"Failed to load map %ls: %hs", mapfilename.string().c_str(), err.what()); + LOGERROR("Failed to load map %ls: %hs", mapfilename.string().c_str(), err.what()); throw PSERROR_Game_World_MapLoadFailed("Failed to load map.\nCheck application log for details."); } } diff --git a/source/ps/XML/RelaxNG.cpp b/source/ps/XML/RelaxNG.cpp index 8a63869d5b..57d63449e4 100644 --- a/source/ps/XML/RelaxNG.cpp +++ b/source/ps/XML/RelaxNG.cpp @@ -46,7 +46,7 @@ public: xmlRelaxNGFreeParserCtxt(ctxt); if (m_Schema == NULL) - LOGERROR(L"RelaxNGValidator: Failed to compile schema"); + LOGERROR("RelaxNGValidator: Failed to compile schema"); } ~RelaxNGSchema() @@ -108,14 +108,14 @@ bool RelaxNGValidator::ValidateEncoded(const std::wstring& filename, const std:: if (!m_Schema) { - LOGERROR(L"RelaxNGValidator: No grammar loaded"); + LOGERROR("RelaxNGValidator: No grammar loaded"); return false; } xmlDocPtr doc = xmlReadMemory(document.c_str(), (int)document.size(), utf8_from_wstring(filename).c_str(), NULL, XML_PARSE_NONET); if (doc == NULL) { - LOGERROR(L"RelaxNGValidator: Failed to parse document"); + LOGERROR("RelaxNGValidator: Failed to parse document"); return false; } @@ -130,12 +130,12 @@ bool RelaxNGValidator::ValidateEncoded(const std::wstring& filename, const std:: } else if (ret > 0) { - LOGERROR(L"RelaxNGValidator: Validation failed"); + LOGERROR("RelaxNGValidator: Validation failed"); return false; } else { - LOGERROR(L"RelaxNGValidator: Internal error %d", ret); + LOGERROR("RelaxNGValidator: Internal error %d", ret); return false; } } diff --git a/source/ps/XML/XMLWriter.cpp b/source/ps/XML/XMLWriter.cpp index e77ce171ec..ea99187fac 100644 --- a/source/ps/XML/XMLWriter.cpp +++ b/source/ps/XML/XMLWriter.cpp @@ -102,7 +102,7 @@ bool XMLWriter_File::StoreVFS(const PIVFS& vfs, const VfsPath& pathname) Status ret = vfs->CreateFile(pathname, data, size); if (ret < 0) { - LOGERROR(L"Error saving XML data through VFS: %lld '%ls'", (long long)ret, pathname.string().c_str()); + LOGERROR("Error saving XML data through VFS: %lld '%ls'", (long long)ret, pathname.string().c_str()); return false; } return true; diff --git a/source/ps/XML/Xeromyces.cpp b/source/ps/XML/Xeromyces.cpp index e7b2e57cdf..61fd869e87 100644 --- a/source/ps/XML/Xeromyces.cpp +++ b/source/ps/XML/Xeromyces.cpp @@ -38,7 +38,7 @@ static void errorHandler(void* UNUSED(userData), xmlErrorPtr error) if (message.length() > 0 && message[message.length()-1] == '\n') message.erase(message.length()-1); - LOGERROR(L"CXeromyces: Parse %ls: %hs:%d: %hs", + LOGERROR("CXeromyces: Parse %ls: %hs:%d: %hs", error->level == XML_ERR_WARNING ? L"warning" : L"error", error->file, error->line, message.c_str()); // TODO: The (non-fatal) warnings and errors don't get stored in the XMB, @@ -89,7 +89,7 @@ PSRETURN CXeromyces::Load(const PIVFS& vfs, const VfsPath& filename) // No source file or archive cache was found, so we can't load the // XML file at all - LOGERROR(L"CCacheLoader failed to find archived or source file for: \"%ls\"", filename.string().c_str()); + LOGERROR("CCacheLoader failed to find archived or source file for: \"%ls\"", filename.string().c_str()); return PSRETURN_Xeromyces_XMLOpenFailed; } @@ -111,7 +111,7 @@ PSRETURN CXeromyces::ConvertFile(const PIVFS& vfs, const VfsPath& filename, cons CVFSFile input; if (input.Load(vfs, filename)) { - LOGERROR(L"CXeromyces: Failed to open XML file %ls", filename.string().c_str()); + LOGERROR("CXeromyces: Failed to open XML file %ls", filename.string().c_str()); return PSRETURN_Xeromyces_XMLOpenFailed; } @@ -120,7 +120,7 @@ PSRETURN CXeromyces::ConvertFile(const PIVFS& vfs, const VfsPath& filename, cons filename8.c_str(), NULL, XML_PARSE_NONET|XML_PARSE_NOCDATA); if (! doc) { - LOGERROR(L"CXeromyces: Failed to parse XML file %ls", filename.string().c_str()); + LOGERROR("CXeromyces: Failed to parse XML file %ls", filename.string().c_str()); return PSRETURN_Xeromyces_XMLParseError; } @@ -167,7 +167,7 @@ PSRETURN CXeromyces::LoadString(const char* xml) xmlDocPtr doc = xmlReadMemory(xml, (int)strlen(xml), "", NULL, XML_PARSE_NONET|XML_PARSE_NOCDATA); if (! doc) { - LOGERROR(L"CXeromyces: Failed to parse XML string"); + LOGERROR("CXeromyces: Failed to parse XML string"); return PSRETURN_Xeromyces_XMLParseError; } diff --git a/source/ps/scripting/JSInterface_ConfigDB.cpp b/source/ps/scripting/JSInterface_ConfigDB.cpp index 43c6a4d8a6..319db0e743 100644 --- a/source/ps/scripting/JSInterface_ConfigDB.cpp +++ b/source/ps/scripting/JSInterface_ConfigDB.cpp @@ -35,7 +35,7 @@ bool JSI_ConfigDB::GetConfigNamespace(std::wstring cfgNsString, EConfigNamespace cfgNs = CFG_MOD; else { - LOGERROR(L"Invalid namespace name passed to the ConfigDB!"); + LOGERROR("Invalid namespace name passed to the ConfigDB!"); cfgNs = CFG_DEFAULT; return false; } diff --git a/source/ps/scripting/JSInterface_Console.cpp b/source/ps/scripting/JSInterface_Console.cpp index bc7ab85e43..d65d9a920e 100644 --- a/source/ps/scripting/JSInterface_Console.cpp +++ b/source/ps/scripting/JSInterface_Console.cpp @@ -26,7 +26,7 @@ bool JSI_Console::CheckGlobalInitialized() { if (!g_Console) { - LOGERROR(L"Trying to access the console when it's not initialized!"); + LOGERROR("Trying to access the console when it's not initialized!"); return false; } return true; diff --git a/source/ps/scripting/JSInterface_VFS.cpp b/source/ps/scripting/JSInterface_VFS.cpp index ccc804b8ec..bf74daf12c 100644 --- a/source/ps/scripting/JSInterface_VFS.cpp +++ b/source/ps/scripting/JSInterface_VFS.cpp @@ -36,7 +36,7 @@ }\ /* unknown failure. We output an error message. */\ else if (err < 0)\ - LOGERROR(L"Unknown failure in VFS %i", err ); + LOGERROR("Unknown failure in VFS %i", err ); /* else: success */ diff --git a/source/renderer/DecalRData.cpp b/source/renderer/DecalRData.cpp index 0c85902ad7..62c565b4bb 100644 --- a/source/renderer/DecalRData.cpp +++ b/source/renderer/DecalRData.cpp @@ -84,7 +84,7 @@ void CDecalRData::RenderDecals(std::vector& decals, const CShaderD if (material.GetShaderEffect().length() == 0) { - LOGERROR(L"Terrain renderer failed to load shader effect.\n"); + LOGERROR("Terrain renderer failed to load shader effect.\n"); continue; } @@ -98,7 +98,7 @@ void CDecalRData::RenderDecals(std::vector& decals, const CShaderD if (!techBase) { - LOGERROR(L"Terrain renderer failed to load shader effect (%hs)\n", + LOGERROR("Terrain renderer failed to load shader effect (%hs)\n", material.GetShaderEffect().string().c_str()); continue; } diff --git a/source/renderer/ModelRenderer.cpp b/source/renderer/ModelRenderer.cpp index 3737f6104d..03e621a7ec 100644 --- a/source/renderer/ModelRenderer.cpp +++ b/source/renderer/ModelRenderer.cpp @@ -98,7 +98,7 @@ void ModelRenderer::BuildPositionAndNormals( // some broken situations if (numVertices && vertices[0].m_Blend.m_Bone[0] == 0xff) { - LOGERROR(L"Model %ls is boned with unboned animation", mdef->GetName().string().c_str()); + LOGERROR("Model %ls is boned with unboned animation", mdef->GetName().string().c_str()); return; } diff --git a/source/renderer/PatchRData.cpp b/source/renderer/PatchRData.cpp index c8c5553840..2604567cbc 100644 --- a/source/renderer/PatchRData.cpp +++ b/source/renderer/PatchRData.cpp @@ -766,7 +766,7 @@ void CPatchRData::RenderBases(const std::vector& patches, const CS { if (itt->first->GetMaterial().GetShaderEffect().length() == 0) { - LOGERROR(L"Terrain renderer failed to load shader effect.\n"); + LOGERROR("Terrain renderer failed to load shader effect.\n"); continue; } diff --git a/source/renderer/PostprocManager.cpp b/source/renderer/PostprocManager.cpp index 0dadb89d4a..4d4bf7b614 100644 --- a/source/renderer/PostprocManager.cpp +++ b/source/renderer/PostprocManager.cpp @@ -159,7 +159,7 @@ void CPostprocManager::RecreateBuffers() GLenum status = pglCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT); if (status != GL_FRAMEBUFFER_COMPLETE_EXT) { - LOGWARNING(L"Framebuffer object incomplete (A): 0x%04X", status); + LOGWARNING("Framebuffer object incomplete (A): 0x%04X", status); } pglGenFramebuffersEXT(1, &m_PongFbo); @@ -174,7 +174,7 @@ void CPostprocManager::RecreateBuffers() status = pglCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT); if (status != GL_FRAMEBUFFER_COMPLETE_EXT) { - LOGWARNING(L"Framebuffer object incomplete (B): 0x%04X", status); + LOGWARNING("Framebuffer object incomplete (B): 0x%04X", status); } pglGenFramebuffersEXT(1, &m_BloomFbo); @@ -187,7 +187,7 @@ void CPostprocManager::RecreateBuffers() status = pglCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT); if (status != GL_FRAMEBUFFER_COMPLETE_EXT) { - LOGWARNING(L"Framebuffer object incomplete (B): 0x%04X", status); + LOGWARNING("Framebuffer object incomplete (B): 0x%04X", status); } */ @@ -519,7 +519,7 @@ std::vector CPostprocManager::GetPostEffects() VfsPaths pathnames; if(vfs::GetPathnames(g_VFS, path, 0, pathnames) < 0) - LOGERROR(L"Error finding Post effects in '%ls'", path.string().c_str()); + LOGERROR("Error finding Post effects in '%ls'", path.string().c_str()); for(size_t i = 0; i < pathnames.size(); i++) { diff --git a/source/renderer/Renderer.cpp b/source/renderer/Renderer.cpp index 404d90a953..398c331d9b 100644 --- a/source/renderer/Renderer.cpp +++ b/source/renderer/Renderer.cpp @@ -636,11 +636,11 @@ bool CRenderer::Open(int width, int height) GLint bits; glGetIntegerv(GL_DEPTH_BITS,&bits); - LOGMESSAGE(L"CRenderer::Open: depth bits %d",bits); + LOGMESSAGE("CRenderer::Open: depth bits %d",bits); glGetIntegerv(GL_STENCIL_BITS,&bits); - LOGMESSAGE(L"CRenderer::Open: stencil bits %d",bits); + LOGMESSAGE("CRenderer::Open: stencil bits %d",bits); glGetIntegerv(GL_ALPHA_BITS,&bits); - LOGMESSAGE(L"CRenderer::Open: alpha bits %d",bits); + LOGMESSAGE("CRenderer::Open: alpha bits %d",bits); // Validate the currently selected render path SetRenderPath(m_Options.m_RenderPath); @@ -808,7 +808,7 @@ void CRenderer::SetRenderPath(RenderPath rp) { if (!(m_Caps.m_ARBProgram || (m_Caps.m_VertexShader && m_Caps.m_FragmentShader && m_Options.m_PreferGLSL))) { - LOGWARNING(L"Falling back to fixed function\n"); + LOGWARNING("Falling back to fixed function\n"); rp = RP_FIXED; } } @@ -843,7 +843,7 @@ CRenderer::RenderPath CRenderer::GetRenderPathByName(const CStr& name) if (name == "default") return RP_DEFAULT; - LOGWARNING(L"Unknown render path name '%hs', assuming 'default'", name.c_str()); + LOGWARNING("Unknown render path name '%hs', assuming 'default'", name.c_str()); return RP_DEFAULT; } @@ -1629,7 +1629,7 @@ void CRenderer::EndFrame() int err = glGetError(); if (err) { - ONCE(LOGERROR(L"CRenderer::EndFrame: GL errors %i occurred", err)); + ONCE(LOGERROR("CRenderer::EndFrame: GL errors %i occurred", err)); } } } diff --git a/source/renderer/ShadowMap.cpp b/source/renderer/ShadowMap.cpp index f776175714..e23e5558e9 100644 --- a/source/renderer/ShadowMap.cpp +++ b/source/renderer/ShadowMap.cpp @@ -406,7 +406,7 @@ void ShadowMapInternals::CreateTexture() default: formatname = "DEPTH_COMPONENT"; break; } - LOGMESSAGE(L"Creating shadow texture (size %dx%d) (format = %hs)", + LOGMESSAGE("Creating shadow texture (size %dx%d) (format = %hs)", Width, Height, formatname); @@ -494,7 +494,7 @@ void ShadowMapInternals::CreateTexture() if (status != GL_FRAMEBUFFER_COMPLETE_EXT) { - LOGWARNING(L"Framebuffer object incomplete: 0x%04X", status); + LOGWARNING("Framebuffer object incomplete: 0x%04X", status); // Disable shadow rendering (but let the user try again if they want) g_Renderer.m_Options.m_Shadows = false; diff --git a/source/renderer/SkyManager.cpp b/source/renderer/SkyManager.cpp index e0368e7f8c..013edbd192 100644 --- a/source/renderer/SkyManager.cpp +++ b/source/renderer/SkyManager.cpp @@ -126,7 +126,7 @@ void SkyManager::LoadSkyTextures() if (g_VFS->LoadFile(path2, file, fileSize) < 0) { glDeleteTextures(1, &m_SkyCubeMap); - LOGERROR(L"Error creating sky cubemap."); + LOGERROR("Error creating sky cubemap."); return; } } @@ -207,7 +207,7 @@ std::vector SkyManager::GetSkySets() const DirectoryNames subdirectories; if(g_VFS->GetDirectoryEntries(path, 0, &subdirectories) < 0) { - LOGERROR(L"Error opening directory '%ls'", path.string().c_str()); + LOGERROR("Error opening directory '%ls'", path.string().c_str()); return std::vector(1, GetSkySet()); // just return what we currently have } diff --git a/source/renderer/TerrainRenderer.cpp b/source/renderer/TerrainRenderer.cpp index 4f6d9bc72d..026f49b6ed 100644 --- a/source/renderer/TerrainRenderer.cpp +++ b/source/renderer/TerrainRenderer.cpp @@ -653,7 +653,7 @@ bool TerrainRenderer::RenderFancyWater(const CShaderDefines& context, int cullGr if (!m->fancyWaterShader) { - LOGERROR(L"Failed to load water shader. Falling back to fixed pipeline water.\n"); + LOGERROR("Failed to load water shader. Falling back to fixed pipeline water.\n"); WaterMgr->m_RenderWater = false; return false; } diff --git a/source/renderer/VertexBufferManager.cpp b/source/renderer/VertexBufferManager.cpp index d9ada2f5e8..3911efacc1 100644 --- a/source/renderer/VertexBufferManager.cpp +++ b/source/renderer/VertexBufferManager.cpp @@ -87,7 +87,7 @@ CVertexBuffer::VBChunk* CVertexBufferManager::Allocate(size_t vertexSize, size_t if (!result) { - LOGERROR(L"Failed to create VBOs (%lu*%lu)", (unsigned long)vertexSize, (unsigned long)numVertices); + LOGERROR("Failed to create VBOs (%lu*%lu)", (unsigned long)vertexSize, (unsigned long)numVertices); } return result; diff --git a/source/renderer/WaterManager.cpp b/source/renderer/WaterManager.cpp index aa660167a8..2e48d34cd7 100644 --- a/source/renderer/WaterManager.cpp +++ b/source/renderer/WaterManager.cpp @@ -326,7 +326,7 @@ int WaterManager::LoadWaterTextures() GLenum status = pglCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT); if (status != GL_FRAMEBUFFER_COMPLETE_EXT) { - LOGWARNING(L"Reflection framebuffer object incomplete: 0x%04X", status); + LOGWARNING("Reflection framebuffer object incomplete: 0x%04X", status); g_Renderer.m_Options.m_WaterReflection = false; } @@ -341,7 +341,7 @@ int WaterManager::LoadWaterTextures() status = pglCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT); if (status != GL_FRAMEBUFFER_COMPLETE_EXT) { - LOGWARNING(L"Refraction framebuffer object incomplete: 0x%04X", status); + LOGWARNING("Refraction framebuffer object incomplete: 0x%04X", status); g_Renderer.m_Options.m_WaterRefraction = false; } @@ -356,7 +356,7 @@ int WaterManager::LoadWaterTextures() status = pglCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT); if (status != GL_FRAMEBUFFER_COMPLETE_EXT) { - LOGWARNING(L"Fancy Effects framebuffer object incomplete: 0x%04X", status); + LOGWARNING("Fancy Effects framebuffer object incomplete: 0x%04X", status); g_Renderer.m_Options.m_WaterRefraction = false; } diff --git a/source/scriptinterface/DebuggingServer.cpp b/source/scriptinterface/DebuggingServer.cpp index fa484b034d..1b8b9bfb4a 100644 --- a/source/scriptinterface/DebuggingServer.cpp +++ b/source/scriptinterface/DebuggingServer.cpp @@ -94,7 +94,7 @@ CDebuggingServer::CDebuggingServer() : m_SettingBreakOnException = true; EnableHTTP(); - LOGWARNING(L"Javascript debugging webserver enabled."); + LOGWARNING("Javascript debugging webserver enabled."); } CDebuggingServer::~CDebuggingServer() @@ -396,7 +396,7 @@ void* CDebuggingServer::MgDebuggingServerCallback(mg_event event, struct mg_conn case MG_EVENT_LOG: // Called by Mongoose's cry() - LOGERROR(L"Mongoose error: %hs", request_info->log_message); + LOGERROR("Mongoose error: %hs", request_info->log_message); return NULL; case MG_INIT_SSL: diff --git a/source/scriptinterface/ScriptInterface.cpp b/source/scriptinterface/ScriptInterface.cpp index d87ab68280..aaba59ad57 100644 --- a/source/scriptinterface/ScriptInterface.cpp +++ b/source/scriptinterface/ScriptInterface.cpp @@ -126,9 +126,9 @@ void ErrorReporter(JSContext* cx, const char* message, JSErrorReport* report) } if (isWarning) - LOGWARNING(L"%hs", msg.str().c_str()); + LOGWARNING("%hs", msg.str().c_str()); else - LOGERROR(L"%hs", msg.str().c_str()); + LOGERROR("%hs", msg.str().c_str()); // When running under Valgrind, print more information in the error message // VALGRIND_PRINTF_BACKTRACE("->"); @@ -163,7 +163,7 @@ JSBool logmsg(JSContext* cx, uint argc, jsval* vp) std::wstring str; if (!ScriptInterface::FromJSVal(cx, args.handleAt(0), str)) return JS_FALSE; - LOGMESSAGE(L"%ls", str.c_str()); + LOGMESSAGE("%ls", str.c_str()); args.rval().setUndefined(); return JS_TRUE; } @@ -180,7 +180,7 @@ JSBool warn(JSContext* cx, uint argc, jsval* vp) std::wstring str; if (!ScriptInterface::FromJSVal(cx, args.handleAt(0), str)) return JS_FALSE; - LOGWARNING(L"%ls", str.c_str()); + LOGWARNING("%ls", str.c_str()); args.rval().setUndefined(); return JS_TRUE; } @@ -197,7 +197,7 @@ JSBool error(JSContext* cx, uint argc, jsval* vp) std::wstring str; if (!ScriptInterface::FromJSVal(cx, args.handleAt(0), str)) return JS_FALSE; - LOGERROR(L"%ls", str.c_str()); + LOGERROR("%ls", str.c_str()); args.rval().setUndefined(); return JS_TRUE; } @@ -420,7 +420,7 @@ ScriptInterface::ScriptInterface(const char* nativeScopeName, const char* debugN if (g_JSDebuggerEnabled && g_DebuggingServer != NULL) { if(!JS_SetDebugMode(GetContext(), true)) - LOGERROR(L"Failed to set Spidermonkey to debug mode!"); + LOGERROR("Failed to set Spidermonkey to debug mode!"); else g_DebuggingServer->RegisterScriptinterface(debugName, this); } */ @@ -478,7 +478,7 @@ bool ScriptInterface::LoadGlobalScripts() { if (!LoadGlobalScriptFile(*it)) { - LOGERROR(L"LoadGlobalScripts: Failed to load script %ls", it->string().c_str()); + LOGERROR("LoadGlobalScripts: Failed to load script %ls", it->string().c_str()); return false; } } @@ -507,7 +507,7 @@ bool ScriptInterface::ReplaceNondeterministicRNG(boost::rand48& rng) } } - LOGERROR(L"ReplaceNondeterministicRNG: failed to replace Math.random"); + LOGERROR("ReplaceNondeterministicRNG: failed to replace Math.random"); return false; } @@ -543,7 +543,7 @@ void ScriptInterface::CallConstructor(JS::HandleValue ctor, JS::AutoValueVector& JSAutoRequest rq(m->m_cx); if (!ctor.isObject()) { - LOGERROR(L"CallConstructor: ctor is not an object"); + LOGERROR("CallConstructor: ctor is not an object"); out.setNull(); return; } @@ -750,7 +750,7 @@ bool ScriptInterface::EnumeratePropertyNamesWithPrefix(JS::HandleValue objVal, c if (!objVal.isObjectOrNull()) { - LOGERROR(L"EnumeratePropertyNamesWithPrefix expected object type!"); + LOGERROR("EnumeratePropertyNamesWithPrefix expected object type!"); return false; } @@ -866,7 +866,7 @@ bool ScriptInterface::LoadGlobalScriptFile(const VfsPath& path) JSAutoRequest rq(m->m_cx); if (!VfsFileExists(path)) { - LOGERROR(L"File '%ls' does not exist", path.string().c_str()); + LOGERROR("File '%ls' does not exist", path.string().c_str()); return false; } @@ -876,7 +876,7 @@ bool ScriptInterface::LoadGlobalScriptFile(const VfsPath& path) if (ret != PSRETURN_OK) { - LOGERROR(L"Failed to load file '%ls': %hs", path.string().c_str(), GetErrorString(ret)); + LOGERROR("Failed to load file '%ls': %hs", path.string().c_str(), GetErrorString(ret)); return false; } @@ -926,7 +926,7 @@ bool ScriptInterface::ParseJSON(const std::string& string_utf8, JS::MutableHandl if (JS_ParseJSON(m->m_cx, reinterpret_cast(string.c_str()), (u32)string.size(), out)) return true; - LOGERROR(L"JS_ParseJSON failed!"); + LOGERROR("JS_ParseJSON failed!"); if (!JS_IsExceptionPending(m->m_cx)) return false; @@ -946,7 +946,7 @@ bool ScriptInterface::ParseJSON(const std::string& string_utf8, JS::MutableHandl std::wstring error; ScriptInterface::FromJSVal(m->m_cx, rval, error); - LOGERROR(L"%ls", error.c_str()); + LOGERROR("%ls", error.c_str()); return false; } @@ -954,7 +954,7 @@ void ScriptInterface::ReadJSONFile(const VfsPath& path, JS::MutableHandleValue o { if (!VfsFileExists(path)) { - LOGERROR(L"File '%ls' does not exist", path.string().c_str()); + LOGERROR("File '%ls' does not exist", path.string().c_str()); return; } @@ -964,14 +964,14 @@ void ScriptInterface::ReadJSONFile(const VfsPath& path, JS::MutableHandleValue o if (ret != PSRETURN_OK) { - LOGERROR(L"Failed to load file '%ls': %hs", path.string().c_str(), GetErrorString(ret)); + LOGERROR("Failed to load file '%ls': %hs", path.string().c_str(), GetErrorString(ret)); return; } std::string content(file.DecodeUTF8()); // assume it's UTF-8 if (!ParseJSON(content, out)) - LOGERROR(L"Failed to parse '%ls'", path.string().c_str()); + LOGERROR("Failed to parse '%ls'", path.string().c_str()); } struct Stringifier @@ -1011,7 +1011,7 @@ std::string ScriptInterface::StringifyJSON(JS::MutableHandleValue obj, bool inde if (!JS_Stringify(m->m_cx, obj.address(), NULL, indentVal, &Stringifier::callback, &str)) { JS_ClearPendingException(m->m_cx); - LOGERROR(L"StringifyJSON failed"); + LOGERROR("StringifyJSON failed"); return std::string(); } diff --git a/source/scriptinterface/ThreadDebugger.cpp b/source/scriptinterface/ThreadDebugger.cpp index e9eebbc4ae..a320f020a2 100644 --- a/source/scriptinterface/ThreadDebugger.cpp +++ b/source/scriptinterface/ThreadDebugger.cpp @@ -493,7 +493,7 @@ JSTrapStatus CThreadDebugger::BreakHandler(JSContext* cx, JSScript* script, jsby *m->m_pLastBreakFrame = JS_FrameIterator(m->m_pScriptInterface->GetContext(), &iter); if (!JS_SetSingleStepMode(cx, script, true)) - LOGERROR(L"JS_SetSingleStepMode returned false!"); // TODO: When can this happen? + LOGERROR("JS_SetSingleStepMode returned false!"); // TODO: When can this happen? else { if (nextDbgCmd == DBG_CMD_SINGLESTEP) @@ -516,7 +516,7 @@ JSTrapStatus CThreadDebugger::BreakHandler(JSContext* cx, JSScript* script, jsby else if (nextDbgCmd == DBG_CMD_CONTINUE) { if (!JS_SetSingleStepMode(cx, script, true)) - LOGERROR(L"JS_SetSingleStepMode returned false!"); // TODO: When can this happen? + LOGERROR("JS_SetSingleStepMode returned false!"); // TODO: When can this happen? else { // Setup a handler to check for break-requests from the DebuggingServer regularly @@ -846,7 +846,7 @@ std::string CThreadDebugger::StringifyCyclicJSON(jsval obj, bool indent) JSObject* replacer = JS_GetFunctionObject(fun); if (!JS_Stringify(m->m_pScriptInterface->GetContext(), &obj, replacer, indent ? INT_TO_JSVAL(2) : JSVAL_VOID, &CyclicRefWorkaround::Stringifier::callback, &str)) { - LOGERROR(L"StringifyJSON failed"); + LOGERROR("StringifyJSON failed"); jsval exec; jsval execString; if (JS_GetPendingException(m->m_pScriptInterface->GetContext(), &exec)) @@ -858,7 +858,7 @@ std::string CThreadDebugger::StringifyCyclicJSON(jsval obj, bool indent) if (JSVAL_IS_STRING(execString)) { std::string strExec = JS_EncodeString(m->m_pScriptInterface->GetContext(), JSVAL_TO_STRING(execString)); - LOGERROR(L"Error: %hs", strExec.c_str()); + LOGERROR("Error: %hs", strExec.c_str()); } } diff --git a/source/simulation2/Simulation2.cpp b/source/simulation2/Simulation2.cpp index 4e5a366f68..7db1fae6c1 100644 --- a/source/simulation2/Simulation2.cpp +++ b/source/simulation2/Simulation2.cpp @@ -187,7 +187,7 @@ bool CSimulation2Impl::LoadScripts(CComponentManager& componentManager, std::set VfsPath filename = *it; if (loadedScripts) loadedScripts->insert(filename); - LOGMESSAGE(L"Loading simulation script '%ls'", filename.string().c_str()); + LOGMESSAGE("Loading simulation script '%ls'", filename.string().c_str()); if (!componentManager.LoadScript(filename)) ok = false; } @@ -204,7 +204,7 @@ bool CSimulation2Impl::LoadTriggerScripts(CComponentManager& componentManager, J for (u32 i = 0; i < scriptNames.size(); ++i) { std::string scriptName = "maps/" + scriptNames[i]; - LOGMESSAGE(L"Loading trigger script '%hs'", scriptName.c_str()); + LOGMESSAGE("Loading trigger script '%hs'", scriptName.c_str()); if (!componentManager.LoadScript(scriptName.data())) ok = false; } @@ -224,7 +224,7 @@ Status CSimulation2Impl::ReloadChangedFile(const VfsPath& path) if (!VfsFileExists(path)) return INFO::OK; - LOGMESSAGE(L"Reloading simulation script '%ls'", path.string().c_str()); + LOGMESSAGE("Reloading simulation script '%ls'", path.string().c_str()); if (!m_ComponentManager.LoadScript(path, true)) return ERR::FAIL; @@ -828,7 +828,7 @@ static std::vector GetJSONData(const VfsPath& path) { // Some error reading directory wchar_t error[200]; - LOGERROR(L"Error reading directory '%ls': %ls", path.string().c_str(), StatusDescription(ret, error, ARRAY_SIZE(error))); + LOGERROR("Error reading directory '%ls': %ls", path.string().c_str(), StatusDescription(ret, error, ARRAY_SIZE(error))); return std::vector(); } @@ -840,7 +840,7 @@ static std::vector GetJSONData(const VfsPath& path) PSRETURN ret = file.Load(g_VFS, *it); if (ret != PSRETURN_OK) { - LOGERROR(L"GetJSONData: Failed to load file '%ls': %hs", path.string().c_str(), GetErrorString(ret)); + LOGERROR("GetJSONData: Failed to load file '%ls': %hs", path.string().c_str(), GetErrorString(ret)); continue; } @@ -864,7 +864,7 @@ static std::string ReadJSON(const VfsPath& path) { if (!VfsFileExists(path)) { - LOGERROR(L"File '%ls' does not exist", path.string().c_str()); + LOGERROR("File '%ls' does not exist", path.string().c_str()); return std::string(); } @@ -873,7 +873,7 @@ static std::string ReadJSON(const VfsPath& path) PSRETURN ret = file.Load(g_VFS, path); if (ret != PSRETURN_OK) { - LOGERROR(L"Failed to load file '%ls': %hs", path.string().c_str(), GetErrorString(ret)); + LOGERROR("Failed to load file '%ls': %hs", path.string().c_str(), GetErrorString(ret)); return std::string(); } diff --git a/source/simulation2/components/CCmpAIManager.cpp b/source/simulation2/components/CCmpAIManager.cpp index ac1c5424ab..dab13d4535 100644 --- a/source/simulation2/components/CCmpAIManager.cpp +++ b/source/simulation2/components/CCmpAIManager.cpp @@ -104,7 +104,7 @@ private: m_Worker.LoadMetadata(path, &metadata); if (metadata.isUndefined()) { - LOGERROR(L"Failed to create AI player: can't find %ls", path.string().c_str()); + LOGERROR("Failed to create AI player: can't find %ls", path.string().c_str()); return false; } @@ -116,7 +116,7 @@ private: JS::RootedValue ctor(cx); if (!m_ScriptInterface->HasProperty(metadata, "moduleName")) { - LOGERROR(L"Failed to create AI player: %ls: missing 'moduleName'", path.string().c_str()); + LOGERROR("Failed to create AI player: %ls: missing 'moduleName'", path.string().c_str()); return false; } @@ -124,13 +124,13 @@ private: if (!m_ScriptInterface->GetProperty(global, moduleName.c_str(), &objectWithConstructor) || objectWithConstructor.isUndefined()) { - LOGERROR(L"Failed to create AI player: %ls: can't find the module that should contain the constructor: '%hs'", path.string().c_str(), moduleName.c_str()); + 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()); return false; } if (!m_ScriptInterface->GetProperty(metadata, "constructor", constructor)) { - LOGERROR(L"Failed to create AI player: %ls: missing 'constructor'", path.string().c_str()); + LOGERROR("Failed to create AI player: %ls: missing 'constructor'", path.string().c_str()); return false; } @@ -138,7 +138,7 @@ private: if (!m_ScriptInterface->GetProperty(objectWithConstructor, constructor.c_str(), &ctor) || ctor.isNull()) { - LOGERROR(L"Failed to create AI player: %ls: can't find constructor '%hs'", path.string().c_str(), constructor.c_str()); + LOGERROR("Failed to create AI player: %ls: can't find constructor '%hs'", path.string().c_str(), constructor.c_str()); return false; } @@ -160,7 +160,7 @@ private: if (obj.isNull()) { - LOGERROR(L"Failed to create AI player: %ls: error calling constructor '%hs'", path.string().c_str(), constructor.c_str()); + LOGERROR("Failed to create AI player: %ls: error calling constructor '%hs'", path.string().c_str(), constructor.c_str()); return false; } @@ -261,7 +261,7 @@ public: VfsPaths pathnames; if (vfs::GetPathnames(g_VFS, L"simulation/ai/" + moduleName + L"/", L"*.js", pathnames) < 0) { - LOGERROR(L"Failed to load AI scripts for module %ls", moduleName.c_str()); + LOGERROR("Failed to load AI scripts for module %ls", moduleName.c_str()); return false; } @@ -269,7 +269,7 @@ public: { if (!m_ScriptInterface->LoadGlobalScriptFile(*it)) { - LOGERROR(L"Failed to load script %ls", it->string().c_str()); + LOGERROR("Failed to load script %ls", it->string().c_str()); return false; } } @@ -308,7 +308,7 @@ public: } } - LOGERROR(L"Invalid playerid in PostCommand!"); + LOGERROR("Invalid playerid in PostCommand!"); } // The next two ought to be implmeneted someday but for now as it returns "null" it can't static void DumpHeap(ScriptInterface::CxPrivate* pCxPrivate) @@ -391,14 +391,14 @@ public: JS::RootedValue ctor(cx); if (!m_ScriptInterface->GetProperty(global, "API3", &AIModule) || AIModule.isUndefined()) { - LOGERROR(L"Failed to create shared AI component: %ls: can't find module '%hs'", path.string().c_str(), "API3"); + LOGERROR("Failed to create shared AI component: %ls: can't find module '%hs'", path.string().c_str(), "API3"); return false; } if (!m_ScriptInterface->GetProperty(AIModule, "SharedScript", &ctor) || ctor.isUndefined()) { - LOGERROR(L"Failed to create shared AI component: %ls: can't find constructor '%hs'", path.string().c_str(), "SharedScript"); + LOGERROR("Failed to create shared AI component: %ls: can't find constructor '%hs'", path.string().c_str(), "SharedScript"); return false; } @@ -440,7 +440,7 @@ public: if (tmpSharedAIObj.isNull()) { - LOGERROR(L"Failed to create shared AI component: %ls: error calling constructor '%hs'", path.string().c_str(), "SharedScript"); + LOGERROR("Failed to create shared AI component: %ls: error calling constructor '%hs'", path.string().c_str(), "SharedScript"); return false; } @@ -617,7 +617,7 @@ public: JS::RootedValue sharedData(cx); JS::RootedValue tmpSharedAIObj(cx, m_SharedAIObj.get()); // TODO: Check if this temporary root can be removed after SpiderMonkey 31 upgrade if (!m_ScriptInterface->CallFunction(tmpSharedAIObj, "Serialize", &sharedData)) - LOGERROR(L"AI shared script Serialize call failed"); + LOGERROR("AI shared script Serialize call failed"); serializer.ScriptVal("sharedData", &sharedData); } for (size_t i = 0; i < m_Players.size(); ++i) @@ -640,7 +640,7 @@ public: { JS::RootedValue scriptData(cx); if (!m_ScriptInterface->CallFunction(tmpPlayerObj, "Serialize", &scriptData)) - LOGERROR(L"AI script Serialize call failed"); + LOGERROR("AI script Serialize call failed"); serializer.ScriptVal("data", &scriptData); } else @@ -681,7 +681,7 @@ public: JS::RootedValue tmpSharedAIObj(cx, m_SharedAIObj.get()); // TODO: Check if this temporary root can be removed after SpiderMonkey 31 deserializer.ScriptVal("sharedData", &sharedData); if (!m_ScriptInterface->CallFunctionVoid(tmpSharedAIObj, "Deserialize", sharedData)) - LOGERROR(L"AI shared script Deserialize call failed"); + LOGERROR("AI shared script Deserialize call failed"); } for (size_t i = 0; i < numAis; ++i) @@ -720,11 +720,11 @@ public: if (m_Players[i]->m_UseSharedComponent) { if (!m_ScriptInterface->CallFunctionVoid(tmpPlayerObj, "Deserialize", scriptData, m_SharedAIObj)) - LOGERROR(L"AI script Deserialize call failed"); + LOGERROR("AI script Deserialize call failed"); } else if (!m_ScriptInterface->CallFunctionVoid(tmpPlayerObj, "Deserialize", scriptData)) { - LOGERROR(L"AI script deserialize() call failed"); + LOGERROR("AI script deserialize() call failed"); } } else @@ -748,7 +748,7 @@ public: std::pair::iterator, bool> ret1 = m_SerializablePrototypes.insert(std::make_pair(obj, name)); std::pair::iterator, bool> ret2 = m_DeserializablePrototypes.insert(std::make_pair(name, obj)); if (!ret1.second || !ret2.second) - LOGERROR(L"RegisterSerializablePrototype called with same prototype multiple times: p=%p n='%ls'", obj, name.c_str()); + LOGERROR("RegisterSerializablePrototype called with same prototype multiple times: p=%p n='%ls'", obj, name.c_str()); } private: diff --git a/source/simulation2/components/CCmpCommandQueue.cpp b/source/simulation2/components/CCmpCommandQueue.cpp index 3b3b0c62e9..c66ef5dcd9 100644 --- a/source/simulation2/components/CCmpCommandQueue.cpp +++ b/source/simulation2/components/CCmpCommandQueue.cpp @@ -119,14 +119,14 @@ public: { bool ok = scriptInterface.CallFunctionVoid(global, "ProcessCommand", localCommands[i].player, localCommands[i].data); if (!ok) - LOGERROR(L"Failed to call ProcessCommand() global script function"); + LOGERROR("Failed to call ProcessCommand() global script function"); } for (size_t i = 0; i < commands.size(); ++i) { bool ok = scriptInterface.CallFunctionVoid(global, "ProcessCommand", commands[i].player, commands[i].data); if (!ok) - LOGERROR(L"Failed to call ProcessCommand() global script function"); + LOGERROR("Failed to call ProcessCommand() global script function"); } } }; diff --git a/source/simulation2/components/CCmpObstruction.cpp b/source/simulation2/components/CCmpObstruction.cpp index 638d804a40..37afbcddf0 100644 --- a/source/simulation2/components/CCmpObstruction.cpp +++ b/source/simulation2/components/CCmpObstruction.cpp @@ -515,7 +515,7 @@ public: // required precondition to use SkipControlGroupsRequireFlagObstructionFilter if (m_ControlGroup == INVALID_ENTITY) { - LOGERROR(L"[CmpObstruction] Cannot test for foundation obstructions; primary control group must be valid"); + LOGERROR("[CmpObstruction] Cannot test for foundation obstructions; primary control group must be valid"); return FOUNDATION_CHECK_FAIL_ERROR; } @@ -552,7 +552,7 @@ public: // required precondition to use SkipControlGroupsRequireFlagObstructionFilter if (m_ControlGroup == INVALID_ENTITY) { - LOGERROR(L"[CmpObstruction] Cannot test for foundation obstructions; primary control group must be valid"); + LOGERROR("[CmpObstruction] Cannot test for foundation obstructions; primary control group must be valid"); return false; } @@ -586,7 +586,7 @@ public: // required precondition to use SkipControlGroupsRequireFlagObstructionFilter if (m_ControlGroup == INVALID_ENTITY) { - LOGERROR(L"[CmpObstruction] Cannot test for unit or structure obstructions; primary control group must be valid"); + LOGERROR("[CmpObstruction] Cannot test for unit or structure obstructions; primary control group must be valid"); return ret; } diff --git a/source/simulation2/components/CCmpPathfinder.cpp b/source/simulation2/components/CCmpPathfinder.cpp index b2a321cf88..2fe21f64e6 100644 --- a/source/simulation2/components/CCmpPathfinder.cpp +++ b/source/simulation2/components/CCmpPathfinder.cpp @@ -254,7 +254,7 @@ ICmpPathfinder::pass_class_t CCmpPathfinder::GetPassabilityClass(const std::stri { if (m_PassClassMasks.find(name) == m_PassClassMasks.end()) { - LOGERROR(L"Invalid passability class name '%hs'", name.c_str()); + LOGERROR("Invalid passability class name '%hs'", name.c_str()); return 0; } @@ -270,7 +270,7 @@ ICmpPathfinder::cost_class_t CCmpPathfinder::GetCostClass(const std::string& nam { if (m_UnitCostClassTags.find(name) == m_UnitCostClassTags.end()) { - LOGERROR(L"Invalid unit cost class name '%hs'", name.c_str()); + LOGERROR("Invalid unit cost class name '%hs'", name.c_str()); return m_UnitCostClassTags["default"]; } diff --git a/source/simulation2/components/CCmpPosition.cpp b/source/simulation2/components/CCmpPosition.cpp index 51004b4246..d5838b7177 100644 --- a/source/simulation2/components/CCmpPosition.cpp +++ b/source/simulation2/components/CCmpPosition.cpp @@ -271,7 +271,7 @@ public: CmpPtr cmpPosition(GetSimContext(), m_TurretParent); if (!cmpPosition) { - LOGERROR(L"Turret with parent without position component"); + LOGERROR("Turret with parent without position component"); return; } if (!cmpPosition->IsInWorld()) @@ -482,7 +482,7 @@ public: { if (!m_InWorld) { - LOGERROR(L"CCmpPosition::GetPosition called on entity when IsInWorld is false"); + LOGERROR("CCmpPosition::GetPosition called on entity when IsInWorld is false"); return CFixedVector3D(); } @@ -493,7 +493,7 @@ public: { if (!m_InWorld) { - LOGERROR(L"CCmpPosition::GetPosition2D called on entity when IsInWorld is false"); + LOGERROR("CCmpPosition::GetPosition2D called on entity when IsInWorld is false"); return CFixedVector2D(); } @@ -504,7 +504,7 @@ public: { if (!m_InWorld) { - LOGERROR(L"CCmpPosition::GetPreviousPosition called on entity when IsInWorld is false"); + LOGERROR("CCmpPosition::GetPreviousPosition called on entity when IsInWorld is false"); return CFixedVector3D(); } @@ -515,7 +515,7 @@ public: { if (!m_InWorld) { - LOGERROR(L"CCmpPosition::GetPreviousPosition2D called on entity when IsInWorld is false"); + LOGERROR("CCmpPosition::GetPreviousPosition2D called on entity when IsInWorld is false"); return CFixedVector2D(); } @@ -589,7 +589,7 @@ public: { if (!m_InWorld) { - LOGERROR(L"CCmpPosition::GetDistanceTravelled called on entity when IsInWorld is false"); + LOGERROR("CCmpPosition::GetDistanceTravelled called on entity when IsInWorld is false"); return fixed::Zero(); } @@ -630,7 +630,7 @@ public: { if (!m_InWorld) { - LOGERROR(L"CCmpPosition::GetInterpolatedPosition2D called on entity when IsInWorld is false"); + LOGERROR("CCmpPosition::GetInterpolatedPosition2D called on entity when IsInWorld is false"); return; } @@ -647,14 +647,14 @@ public: CmpPtr cmpPosition(GetSimContext(), m_TurretParent); if (!cmpPosition) { - LOGERROR(L"Turret with parent without position component"); + LOGERROR("Turret with parent without position component"); CMatrix3D m; m.SetIdentity(); return m; } if (!cmpPosition->IsInWorld()) { - LOGERROR(L"CCmpPosition::GetInterpolatedTransform called on turret entity when IsInWorld is false"); + LOGERROR("CCmpPosition::GetInterpolatedTransform called on turret entity when IsInWorld is false"); CMatrix3D m; m.SetIdentity(); return m; @@ -670,7 +670,7 @@ public: } if (!m_InWorld) { - LOGERROR(L"CCmpPosition::GetInterpolatedTransform called on entity when IsInWorld is false"); + LOGERROR("CCmpPosition::GetInterpolatedTransform called on entity when IsInWorld is false"); CMatrix3D m; m.SetIdentity(); return m; @@ -925,7 +925,7 @@ private: { if (!m_InWorld) { - LOGERROR(L"CCmpPosition::UpdateXZRotation called on entity when IsInWorld is false"); + LOGERROR("CCmpPosition::UpdateXZRotation called on entity when IsInWorld is false"); return; } @@ -940,7 +940,7 @@ private: CmpPtr cmpTerrain(GetSystemEntity()); if (!cmpTerrain || !cmpTerrain->IsLoaded()) { - LOGERROR(L"Terrain not loaded"); + LOGERROR("Terrain not loaded"); return; } diff --git a/source/simulation2/components/CCmpProjectileManager.cpp b/source/simulation2/components/CCmpProjectileManager.cpp index 3b243a75a6..0b61a2ae21 100644 --- a/source/simulation2/components/CCmpProjectileManager.cpp +++ b/source/simulation2/components/CCmpProjectileManager.cpp @@ -175,7 +175,7 @@ uint32_t CCmpProjectileManager::LaunchProjectile(entity_id_t source, CFixedVecto { // If the actor was actually loaded, complain that it doesn't have a projectile if (!cmpSourceVisual->GetActorShortName().empty()) - LOGERROR(L"Unit with actor '%ls' launched a projectile but has no actor on 'projectile' attachpoint", cmpSourceVisual->GetActorShortName().c_str()); + LOGERROR("Unit with actor '%ls' launched a projectile but has no actor on 'projectile' attachpoint", cmpSourceVisual->GetActorShortName().c_str()); return 0; } diff --git a/source/simulation2/components/CCmpRallyPointRenderer.cpp b/source/simulation2/components/CCmpRallyPointRenderer.cpp index a5258fe617..e686c402f5 100644 --- a/source/simulation2/components/CCmpRallyPointRenderer.cpp +++ b/source/simulation2/components/CCmpRallyPointRenderer.cpp @@ -521,7 +521,7 @@ void CCmpRallyPointRenderer::UpdateMarkers() // the marker entity should be valid at this point, otherwise something went wrong trying to allocate it if (m_MarkerEntityIds[i] == INVALID_ENTITY) - LOGERROR(L"Failed to create rally point marker entity"); + LOGERROR("Failed to create rally point marker entity"); CmpPtr markerCmpPosition(GetSimContext(), m_MarkerEntityIds[i]); if (markerCmpPosition) diff --git a/source/simulation2/components/CCmpRangeManager.cpp b/source/simulation2/components/CCmpRangeManager.cpp index f2c3202d6a..ffc0a9429e 100644 --- a/source/simulation2/components/CCmpRangeManager.cpp +++ b/source/simulation2/components/CCmpRangeManager.cpp @@ -748,7 +748,7 @@ public: { if (m_Queries.find(tag) == m_Queries.end()) { - LOGERROR(L"CCmpRangeManager: DestroyActiveQuery called with invalid tag %u", tag); + LOGERROR("CCmpRangeManager: DestroyActiveQuery called with invalid tag %u", tag); return; } @@ -760,7 +760,7 @@ public: std::map::iterator it = m_Queries.find(tag); if (it == m_Queries.end()) { - LOGERROR(L"CCmpRangeManager: EnableActiveQuery called with invalid tag %u", tag); + LOGERROR("CCmpRangeManager: EnableActiveQuery called with invalid tag %u", tag); return; } @@ -773,7 +773,7 @@ public: std::map::iterator it = m_Queries.find(tag); if (it == m_Queries.end()) { - LOGERROR(L"CCmpRangeManager: DisableActiveQuery called with invalid tag %u", tag); + LOGERROR("CCmpRangeManager: DisableActiveQuery called with invalid tag %u", tag); return; } @@ -830,7 +830,7 @@ public: std::map::iterator it = m_Queries.find(tag); if (it == m_Queries.end()) { - LOGERROR(L"CCmpRangeManager: ResetActiveQuery called with invalid tag %u", tag); + LOGERROR("CCmpRangeManager: ResetActiveQuery called with invalid tag %u", tag); return r; } @@ -1166,11 +1166,11 @@ public: { // Min range must be non-negative if (minRange < entity_pos_t::Zero()) - LOGWARNING(L"CCmpRangeManager: Invalid min range %f in query for entity %u", minRange.ToDouble(), source); + LOGWARNING("CCmpRangeManager: Invalid min range %f in query for entity %u", minRange.ToDouble(), source); // Max range must be non-negative, or else -1 if (maxRange < entity_pos_t::Zero() && maxRange != entity_pos_t::FromInt(-1)) - LOGWARNING(L"CCmpRangeManager: Invalid max range %f in query for entity %u", maxRange.ToDouble(), source); + LOGWARNING("CCmpRangeManager: Invalid max range %f in query for entity %u", maxRange.ToDouble(), source); Query q; q.enabled = false; @@ -1347,7 +1347,7 @@ public: if (identifier == "injured") return 2; - LOGWARNING(L"CCmpRangeManager: Invalid flag identifier %hs", identifier.c_str()); + LOGWARNING("CCmpRangeManager: Invalid flag identifier %hs", identifier.c_str()); return 0; } @@ -1364,7 +1364,7 @@ public: // We don't have a flag set if (flag == 0) { - LOGWARNING(L"CCmpRangeManager: Invalid flag identifier %hs for entity %u", identifier.c_str(), ent); + LOGWARNING("CCmpRangeManager: Invalid flag identifier %hs for entity %u", identifier.c_str(), ent); return; } diff --git a/source/simulation2/components/CCmpTemplateManager.cpp b/source/simulation2/components/CCmpTemplateManager.cpp index ffb3cd82ce..192cd7724a 100644 --- a/source/simulation2/components/CCmpTemplateManager.cpp +++ b/source/simulation2/components/CCmpTemplateManager.cpp @@ -187,7 +187,7 @@ const CParamNode* CCmpTemplateManager::GetTemplate(std::string templateName) // Show error on the first failure to validate the template if (!m_TemplateSchemaValidity[templateName]) - LOGERROR(L"Failed to validate entity template '%hs'", templateName.c_str()); + LOGERROR("Failed to validate entity template '%hs'", templateName.c_str()); } // Refuse to return invalid templates if (!m_TemplateSchemaValidity[templateName]) @@ -198,7 +198,7 @@ const CParamNode* CCmpTemplateManager::GetTemplate(std::string templateName) if (!templateRoot.IsOk()) { // The validator should never let this happen - LOGERROR(L"Invalid root element in entity template '%hs'", templateName.c_str()); + LOGERROR("Invalid root element in entity template '%hs'", templateName.c_str()); return NULL; } diff --git a/source/simulation2/components/CCmpUnitMotion.cpp b/source/simulation2/components/CCmpUnitMotion.cpp index 6a4ebdab66..d24eb12386 100644 --- a/source/simulation2/components/CCmpUnitMotion.cpp +++ b/source/simulation2/components/CCmpUnitMotion.cpp @@ -814,7 +814,7 @@ void CCmpUnitMotion::PathResult(u32 ticket, const ICmpPathfinder::Path& path) } else { - LOGWARNING(L"unexpected PathResult (%u %d %d)", GetEntityId(), m_State, m_PathState); + LOGWARNING("unexpected PathResult (%u %d %d)", GetEntityId(), m_State, m_PathState); } } diff --git a/source/simulation2/components/CCmpVisualActor.cpp b/source/simulation2/components/CCmpVisualActor.cpp index 52c189bf02..0e4a003c61 100644 --- a/source/simulation2/components/CCmpVisualActor.cpp +++ b/source/simulation2/components/CCmpVisualActor.cpp @@ -655,7 +655,7 @@ void CCmpVisualActor::InitSelectionShapeDescriptor(const CParamNode& paramNode) } else { - LOGERROR(L"[VisualActor] Cannot apply footprint-based SelectionShape; Footprint component not initialized."); + LOGERROR("[VisualActor] Cannot apply footprint-based SelectionShape; Footprint component not initialized."); } } else if (shapeNode.GetChild("Box").IsOk()) @@ -669,12 +669,12 @@ void CCmpVisualActor::InitSelectionShapeDescriptor(const CParamNode& paramNode) } else if (shapeNode.GetChild("Cylinder").IsOk()) { - LOGWARNING(L"[VisualActor] TODO: Cylinder selection shapes are not yet implemented; defaulting to recursive bounding boxes"); + LOGWARNING("[VisualActor] TODO: Cylinder selection shapes are not yet implemented; defaulting to recursive bounding boxes"); } else { // shouldn't happen by virtue of validation against schema - LOGERROR(L"[VisualActor] No selection shape specified"); + LOGERROR("[VisualActor] No selection shape specified"); } } diff --git a/source/simulation2/components/ICmpVisibility.cpp b/source/simulation2/components/ICmpVisibility.cpp index f597605b80..b700f875ac 100644 --- a/source/simulation2/components/ICmpVisibility.cpp +++ b/source/simulation2/components/ICmpVisibility.cpp @@ -43,7 +43,7 @@ public: case ICmpRangeManager::VIS_VISIBLE: return ICmpRangeManager::VIS_VISIBLE; default: - LOGERROR(L"Received the invalid visibility value %d from the Visibility scripted component!", visibility); + LOGERROR("Received the invalid visibility value %d from the Visibility scripted component!", visibility); return ICmpRangeManager::VIS_HIDDEN; } } diff --git a/source/simulation2/scripting/EngineScriptConversions.cpp b/source/simulation2/scripting/EngineScriptConversions.cpp index 2f907a3e54..baeffc6262 100644 --- a/source/simulation2/scripting/EngineScriptConversions.cpp +++ b/source/simulation2/scripting/EngineScriptConversions.cpp @@ -55,7 +55,7 @@ template<> void ScriptInterface::ToJSVal(JSContext* cx, JS::Mutable if (!val->NewJSObject(*ScriptInterface::GetScriptInterfaceAndCBData(cx)->pScriptInterface, &obj)) { // Report as an error, since scripts really shouldn't try to use unscriptable interfaces - LOGERROR(L"IComponent does not have a scriptable interface"); + LOGERROR("IComponent does not have a scriptable interface"); ret.setUndefined(); return; } diff --git a/source/simulation2/scripting/MessageTypeConversions.cpp b/source/simulation2/scripting/MessageTypeConversions.cpp index d6a909dc9f..2adb6fe77d 100644 --- a/source/simulation2/scripting/MessageTypeConversions.cpp +++ b/source/simulation2/scripting/MessageTypeConversions.cpp @@ -119,13 +119,13 @@ CMessage* CMessageInterpolate::FromJSVal(ScriptInterface& scriptInterface, JS::H JS::Value CMessageRenderSubmit::ToJSVal(ScriptInterface& UNUSED(scriptInterface)) const { - LOGWARNING(L"CMessageRenderSubmit::ToJSVal not implemented"); + LOGWARNING("CMessageRenderSubmit::ToJSVal not implemented"); return JS::UndefinedValue(); } CMessage* CMessageRenderSubmit::FromJSVal(ScriptInterface& UNUSED(scriptInterface), JS::HandleValue UNUSED(val)) { - LOGWARNING(L"CMessageRenderSubmit::FromJSVal not implemented"); + LOGWARNING("CMessageRenderSubmit::FromJSVal not implemented"); return NULL; } @@ -133,13 +133,13 @@ CMessage* CMessageRenderSubmit::FromJSVal(ScriptInterface& UNUSED(scriptInterfac JS::Value CMessageProgressiveLoad::ToJSVal(ScriptInterface& UNUSED(scriptInterface)) const { - LOGWARNING(L"CMessageProgressiveLoad::ToJSVal not implemented"); + LOGWARNING("CMessageProgressiveLoad::ToJSVal not implemented"); return JS::UndefinedValue(); } CMessage* CMessageProgressiveLoad::FromJSVal(ScriptInterface& UNUSED(scriptInterface), JS::HandleValue UNUSED(val)) { - LOGWARNING(L"CMessageProgressiveLoad::FromJSVal not implemented"); + LOGWARNING("CMessageProgressiveLoad::FromJSVal not implemented"); return NULL; } @@ -147,13 +147,13 @@ CMessage* CMessageProgressiveLoad::FromJSVal(ScriptInterface& UNUSED(scriptInter JS::Value CMessageDeserialized::ToJSVal(ScriptInterface& UNUSED(scriptInterface)) const { - LOGWARNING(L"CMessageDeserialized::ToJSVal not implemented"); + LOGWARNING("CMessageDeserialized::ToJSVal not implemented"); return JS::UndefinedValue(); } CMessage* CMessageDeserialized::FromJSVal(ScriptInterface& UNUSED(scriptInterface), JS::HandleValue UNUSED(val)) { - LOGWARNING(L"CMessageDeserialized::FromJSVal not implemented"); + LOGWARNING("CMessageDeserialized::FromJSVal not implemented"); return NULL; } @@ -237,13 +237,13 @@ CMessage* CMessagePositionChanged::FromJSVal(ScriptInterface& scriptInterface, J JS::Value CMessageInterpolatedPositionChanged::ToJSVal(ScriptInterface& UNUSED(scriptInterface)) const { - LOGWARNING(L"CMessageInterpolatedPositionChanged::ToJSVal not implemented"); + LOGWARNING("CMessageInterpolatedPositionChanged::ToJSVal not implemented"); return JS::UndefinedValue(); } CMessage* CMessageInterpolatedPositionChanged::FromJSVal(ScriptInterface& UNUSED(scriptInterface), JS::HandleValue UNUSED(val)) { - LOGWARNING(L"CMessageInterpolatedPositionChanged::FromJSVal not implemented"); + LOGWARNING("CMessageInterpolatedPositionChanged::FromJSVal not implemented"); return NULL; } @@ -379,7 +379,7 @@ JS::Value CMessageRangeUpdate::ToJSVal(ScriptInterface& scriptInterface) const CMessage* CMessageRangeUpdate::FromJSVal(ScriptInterface& UNUSED(scriptInterface), JS::HandleValue UNUSED(val)) { - LOGWARNING(L"CMessageRangeUpdate::FromJSVal not implemented"); + LOGWARNING("CMessageRangeUpdate::FromJSVal not implemented"); return NULL; } @@ -387,13 +387,13 @@ CMessage* CMessageRangeUpdate::FromJSVal(ScriptInterface& UNUSED(scriptInterface JS::Value CMessagePathResult::ToJSVal(ScriptInterface& UNUSED(scriptInterface)) const { - LOGWARNING(L"CMessagePathResult::ToJSVal not implemented"); + LOGWARNING("CMessagePathResult::ToJSVal not implemented"); return JS::UndefinedValue(); } CMessage* CMessagePathResult::FromJSVal(ScriptInterface& UNUSED(scriptInterface), JS::HandleValue UNUSED(val)) { - LOGWARNING(L"CMessagePathResult::FromJSVal not implemented"); + LOGWARNING("CMessagePathResult::FromJSVal not implemented"); return NULL; } diff --git a/source/simulation2/scripting/ScriptComponent.cpp b/source/simulation2/scripting/ScriptComponent.cpp index f3ada5bd4d..1df5b450a2 100644 --- a/source/simulation2/scripting/ScriptComponent.cpp +++ b/source/simulation2/scripting/ScriptComponent.cpp @@ -73,7 +73,7 @@ void CComponentTypeScript::HandleMessage(const CMessage& msg, bool global) JS::RootedValue tmpInstance(cx, m_Instance.get()); // TODO: Check if this temporary root can be removed after SpiderMonkey 31 upgrade if (!m_ScriptInterface.CallFunctionVoid(tmpInstance, name, msgVal)) - LOGERROR(L"Script message handler %hs failed", name); + LOGERROR("Script message handler %hs failed", name); } void CComponentTypeScript::Serialize(ISerializer& serialize) @@ -92,7 +92,7 @@ void CComponentTypeScript::Serialize(ISerializer& serialize) { JS::RootedValue val(cx); if (!m_ScriptInterface.CallFunction(tmpInstance, "Serialize", &val)) - LOGERROR(L"Script Serialize call failed"); + LOGERROR("Script Serialize call failed"); serialize.ScriptVal("object", &val); } else @@ -118,7 +118,7 @@ void CComponentTypeScript::Deserialize(const CParamNode& paramNode, IDeserialize deserialize.ScriptVal("object", &val); if (!m_ScriptInterface.CallFunctionVoid(tmpInstance, "Deserialize", val)) - LOGERROR(L"Script Deserialize call failed"); + LOGERROR("Script Deserialize call failed"); } else { diff --git a/source/simulation2/scripting/ScriptComponent.h b/source/simulation2/scripting/ScriptComponent.h index 035013c514..a772756e10 100644 --- a/source/simulation2/scripting/ScriptComponent.h +++ b/source/simulation2/scripting/ScriptComponent.h @@ -64,7 +64,7 @@ public: R ret; \ if (m_ScriptInterface.CallFunction(tmpInstance, funcname BOOST_PP_ENUM_TRAILING_PARAMS(i, a), ret)) \ return ret; \ - LOGERROR(L"Error calling component script function %hs", funcname); \ + LOGERROR("Error calling component script function %hs", funcname); \ return R(); \ } \ BOOST_PP_IF(i, template<, ) BOOST_PP_ENUM_PARAMS(i, typename T) BOOST_PP_IF(i, >, ) \ @@ -75,7 +75,7 @@ public: JS::RootedValue tmpInstance(cx, m_Instance.get()); \ if (m_ScriptInterface.CallFunctionVoid(tmpInstance, funcname BOOST_PP_ENUM_TRAILING_PARAMS(i, a))) \ return; \ - LOGERROR(L"Error calling component script function %hs", funcname); \ + LOGERROR("Error calling component script function %hs", funcname); \ } BOOST_PP_REPEAT(SCRIPT_INTERFACE_MAX_ARGS, OVERLOADS, ~) #undef OVERLOADS diff --git a/source/simulation2/serialization/BinarySerializer.cpp b/source/simulation2/serialization/BinarySerializer.cpp index 9cc61ac698..cf3d222d90 100644 --- a/source/simulation2/serialization/BinarySerializer.cpp +++ b/source/simulation2/serialization/BinarySerializer.cpp @@ -49,7 +49,7 @@ static u8 GetArrayType(JSArrayBufferViewType arrayType) case js::ArrayBufferView::TYPE_UINT8_CLAMPED: return SCRIPT_TYPED_ARRAY_UINT8_CLAMPED; default: - LOGERROR(L"Cannot serialize unrecognized typed array view: %d", arrayType); + LOGERROR("Cannot serialize unrecognized typed array view: %d", arrayType); throw PSERROR_Serialize_InvalidScriptValue(); } } @@ -258,7 +258,7 @@ void CBinarySerializerScriptImpl::HandleScriptVal(JS::HandleValue val) else { // Unrecognized class - LOGERROR(L"Cannot serialise JS objects with unrecognized class '%hs'", jsclass->name); + LOGERROR("Cannot serialise JS objects with unrecognized class '%hs'", jsclass->name); throw PSERROR_Serialize_InvalidScriptValue(); } } @@ -317,7 +317,7 @@ void CBinarySerializerScriptImpl::HandleScriptVal(JS::HandleValue val) } } - LOGERROR(L"Cannot serialise JS objects of type 'function': %ls", funcname.c_str()); + LOGERROR("Cannot serialise JS objects of type 'function': %ls", funcname.c_str()); throw PSERROR_Serialize_InvalidScriptValue(); } case JSTYPE_STRING: diff --git a/source/simulation2/system/ComponentManager.cpp b/source/simulation2/system/ComponentManager.cpp index 3e8aef7ac9..ac4045caa4 100644 --- a/source/simulation2/system/ComponentManager.cpp +++ b/source/simulation2/system/ComponentManager.cpp @@ -429,7 +429,7 @@ std::vector CComponentManager::Script_GetComponentsWithInterface(Sc CMessage* CComponentManager::ConstructMessage(int mtid, JS::HandleValue data) { if (mtid == MT__Invalid || mtid > (int)m_MessageTypeIdsByName.size()) // (IDs start at 1 so use '>' here) - LOGERROR(L"PostMessage with invalid message type ID '%d'", mtid); + LOGERROR("PostMessage with invalid message type ID '%d'", mtid); if (mtid < MT__LastNative) { @@ -672,11 +672,11 @@ CComponentManager::ComponentTypeId CComponentManager::GetScriptWrapper(Interface for (; iiit != m_InterfaceIdsByName.end(); ++iiit) if (iiit->second == iid) { - LOGERROR(L"No script wrapper found for interface id %d '%hs'", iid, iiit->first.c_str()); + LOGERROR("No script wrapper found for interface id %d '%hs'", iid, iiit->first.c_str()); return CID__Invalid; } - LOGERROR(L"No script wrapper found for interface id %d", iid); + LOGERROR("No script wrapper found for interface id %d", iid); return CID__Invalid; } @@ -753,7 +753,7 @@ IComponent* CComponentManager::ConstructComponent(CEntityHandle ent, ComponentTy std::map::const_iterator it = m_ComponentTypesById.find(cid); if (it == m_ComponentTypesById.end()) { - LOGERROR(L"Invalid component id %d", cid); + LOGERROR("Invalid component id %d", cid); return NULL; } @@ -764,7 +764,7 @@ IComponent* CComponentManager::ConstructComponent(CEntityHandle ent, ComponentTy boost::unordered_map& emap1 = m_ComponentsByInterface[ct.iid]; if (emap1.find(ent.GetId()) != emap1.end()) { - LOGERROR(L"Multiple components for interface %d", ct.iid); + LOGERROR("Multiple components for interface %d", ct.iid); return NULL; } @@ -780,7 +780,7 @@ IComponent* CComponentManager::ConstructComponent(CEntityHandle ent, ComponentTy m_ScriptInterface.CallConstructor(tmpCtor, argv, &obj); if (obj.isNull()) { - LOGERROR(L"Script component constructor failed"); + LOGERROR("Script component constructor failed"); return NULL; } } @@ -887,13 +887,13 @@ entity_id_t CComponentManager::AddEntity(const std::wstring& templateName, entit CComponentManager::ComponentTypeId cid = LookupCID(it->first); if (cid == CID__Invalid) { - LOGERROR(L"Unrecognised component type name '%hs' in entity template '%ls'", it->first.c_str(), templateName.c_str()); + LOGERROR("Unrecognised component type name '%hs' in entity template '%ls'", it->first.c_str(), templateName.c_str()); return INVALID_ENTITY; } if (!AddComponent(handle, cid, it->second)) { - LOGERROR(L"Failed to construct component type name '%hs' in entity template '%ls'", it->first.c_str(), templateName.c_str()); + LOGERROR("Failed to construct component type name '%hs' in entity template '%ls'", it->first.c_str(), templateName.c_str()); return INVALID_ENTITY; } // TODO: maybe we should delete already-constructed components if one of them fails? @@ -1226,7 +1226,7 @@ std::vector CComponentManager::Script_FindJSONFiles(ScriptInterface { // Some error reading directory wchar_t error[200]; - LOGERROR(L"Error reading directory '%ls': %ls", cbData.path.string().c_str(), StatusDescription(ret, error, ARRAY_SIZE(error))); + LOGERROR("Error reading directory '%ls': %ls", cbData.path.string().c_str(), StatusDescription(ret, error, ARRAY_SIZE(error))); } return cbData.templates; diff --git a/source/simulation2/system/ComponentManagerSerialization.cpp b/source/simulation2/system/ComponentManagerSerialization.cpp index 78b2cd3fd6..1dd09397b5 100644 --- a/source/simulation2/system/ComponentManagerSerialization.cpp +++ b/source/simulation2/system/ComponentManagerSerialization.cpp @@ -322,7 +322,7 @@ bool CComponentManager::DeserializeState(std::istream& stream) ComponentTypeId ctid = LookupCID(ctname); if (ctid == CID__Invalid) { - LOGERROR(L"Deserialization saw unrecognised component type '%hs'", ctname.c_str()); + LOGERROR("Deserialization saw unrecognised component type '%hs'", ctname.c_str()); return false; } @@ -349,7 +349,7 @@ bool CComponentManager::DeserializeState(std::istream& stream) ComponentTypeId ctid = LookupCID(ctname); if (ctid == CID__Invalid) { - LOGERROR(L"Deserialization saw unrecognised component type '%hs'", ctname.c_str()); + LOGERROR("Deserialization saw unrecognised component type '%hs'", ctname.c_str()); return false; } @@ -379,7 +379,7 @@ bool CComponentManager::DeserializeState(std::istream& stream) if (stream.peek() != EOF) { - LOGERROR(L"Deserialization didn't reach EOF"); + LOGERROR("Deserialization didn't reach EOF"); return false; } @@ -391,7 +391,7 @@ bool CComponentManager::DeserializeState(std::istream& stream) } catch (PSERROR_Deserialize& e) { - LOGERROR(L"Deserialization failed: %hs", e.what()); + LOGERROR("Deserialization failed: %hs", e.what()); return false; } } diff --git a/source/simulation2/system/ParamNode.cpp b/source/simulation2/system/ParamNode.cpp index f966004b10..0c5016abca 100644 --- a/source/simulation2/system/ParamNode.cpp +++ b/source/simulation2/system/ParamNode.cpp @@ -123,7 +123,7 @@ void CParamNode::ApplyLayer(const XMBFile& xmb, const XMBElement& element, const if (tokenIt != tokens.end()) tokens.erase(tokenIt); else - LOGWARNING(L"[ParamNode] Could not remove token '%ls' from node '%hs'%ls; not present in list nor inherited (possible typo?)", + LOGWARNING("[ParamNode] Could not remove token '%ls' from node '%hs'%ls; not present in list nor inherited (possible typo?)", newTokens[i].substr(1).c_str(), name.c_str(), sourceIdentifier ? (L" in '" + std::wstring(sourceIdentifier) + L"'").c_str() : L""); } else diff --git a/source/soundmanager/SoundManager.cpp b/source/soundmanager/SoundManager.cpp index daa6f3eae1..c3977bfbda 100644 --- a/source/soundmanager/SoundManager.cpp +++ b/source/soundmanager/SoundManager.cpp @@ -204,7 +204,7 @@ void ISoundManager::CloseGame() void CSoundManager::al_ReportError(ALenum err, const char* caller, int line) { - LOGERROR(L"OpenAL error: %hs; called from %hs (line %d)\n", alGetString(err), caller, line); + LOGERROR("OpenAL error: %hs; called from %hs (line %d)\n", alGetString(err), caller, line); } void CSoundManager::al_check(const char* caller, int line) @@ -216,7 +216,7 @@ void CSoundManager::al_check(const char* caller, int line) Status CSoundManager::ReloadChangedFiles(const VfsPath& UNUSED(path)) { -// LOGERROR(L"GUI file '%ls' changed - reloading page", path.string().c_str()); +// LOGERROR("GUI file '%ls' changed - reloading page", path.string().c_str()); return INFO::OK; } @@ -338,7 +338,7 @@ Status CSoundManager::AlcInit() } else { - LOGERROR(L"error in gensource = %d", err); + LOGERROR("error in gensource = %d", err); } delete[] sourceList; } @@ -354,7 +354,7 @@ Status CSoundManager::AlcInit() debug_printf(L"Sound: AlcInit success, using %hs\n", dev_name); else { - LOGERROR(L"Sound: AlcInit failed, m_Device=%p m_Context=%p dev_name=%hs err=%x\n", m_Device, m_Context, dev_name, err); + LOGERROR("Sound: AlcInit failed, m_Device=%p m_Context=%p dev_name=%hs err=%x\n", m_Device, m_Context, dev_name, err); // FIXME Hack to get around exclusive access to the sound device #if OS_UNIX @@ -654,7 +654,7 @@ void CSoundManager::PlayAsGroup(const VfsPath& groupPath, CVector3D sourcePos, e group = new CSoundGroup(); if (!group->LoadSoundGroup(L"audio/" + groupPath.string())) { - LOGERROR(L"Failed to load sound group '%ls'", groupPath.string().c_str()); + LOGERROR("Failed to load sound group '%ls'", groupPath.string().c_str()); delete group; group = NULL; } diff --git a/source/soundmanager/data/SoundData.cpp b/source/soundmanager/data/SoundData.cpp index e3f6173a68..65647d4e1c 100644 --- a/source/soundmanager/data/SoundData.cpp +++ b/source/soundmanager/data/SoundData.cpp @@ -107,7 +107,7 @@ CSoundData* CSoundData::SoundDataFromOgg(const VfsPath& itemPath) } else { - LOGERROR(L"could not initialize ogg data at %ls", itemPath.string().c_str()); + LOGERROR("could not initialize ogg data at %ls", itemPath.string().c_str()); delete oggAnswer; } diff --git a/source/soundmanager/items/CSoundBase.cpp b/source/soundmanager/items/CSoundBase.cpp index e7dce372cb..8486114412 100644 --- a/source/soundmanager/items/CSoundBase.cpp +++ b/source/soundmanager/items/CSoundBase.cpp @@ -112,7 +112,7 @@ bool CSoundBase::InitOpenAL() } else { -// LOGERROR(L"Source not allocated by SoundManager\n", 0); +// LOGERROR("Source not allocated by SoundManager\n", 0); } return false; } diff --git a/source/soundmanager/scripting/SoundGroup.cpp b/source/soundmanager/scripting/SoundGroup.cpp index 2969e2ecf9..373b382885 100644 --- a/source/soundmanager/scripting/SoundGroup.cpp +++ b/source/soundmanager/scripting/SoundGroup.cpp @@ -227,7 +227,7 @@ static void HandleError(const CStrW& message, const VfsPath& pathname, Status er { if (err == ERR::AGAIN) return; // open failed because sound is disabled (don't log this) - LOGERROR(L"%ls: pathname=%ls, error=%ls", message.c_str(), pathname.string().c_str(), ErrorString(err)); + LOGERROR("%ls: pathname=%ls, error=%ls", message.c_str(), pathname.string().c_str(), ErrorString(err)); } void CSoundGroup::PlayNext(const CVector3D& position, entity_id_t source) @@ -320,7 +320,7 @@ bool CSoundGroup::LoadSoundGroup(const VfsPath& pathnameXML) if (root.GetNodeName() != el_soundgroup) { - LOGERROR(L"Invalid SoundGroup format (unrecognised root element '%hs')", XeroFile.GetElementString(root.GetNodeName()).c_str()); + LOGERROR("Invalid SoundGroup format (unrecognised root element '%hs')", XeroFile.GetElementString(root.GetNodeName()).c_str()); return false; } diff --git a/source/tools/atlas/GameInterface/GameLoop.cpp b/source/tools/atlas/GameInterface/GameLoop.cpp index cc2fa20a7f..4943f6bd5e 100644 --- a/source/tools/atlas/GameInterface/GameLoop.cpp +++ b/source/tools/atlas/GameInterface/GameLoop.cpp @@ -178,7 +178,7 @@ static void* RunEngine(void* data) debug_warn(L"Unrecognised message"); // CLogger might not be initialised, but this error will be sent // to the debug output window anyway so people can still see it - LOGERROR(L"Unrecognised message (%hs)", name.c_str()); + LOGERROR("Unrecognised message (%hs)", name.c_str()); } if (msg->GetType() == IMessage::Query) diff --git a/source/tools/atlas/GameInterface/Handlers/MapHandlers.cpp b/source/tools/atlas/GameInterface/Handlers/MapHandlers.cpp index 38060eea2f..9a7c2e790a 100644 --- a/source/tools/atlas/GameInterface/Handlers/MapHandlers.cpp +++ b/source/tools/atlas/GameInterface/Handlers/MapHandlers.cpp @@ -176,7 +176,7 @@ MESSAGEHANDLER(ImportHeightmap) File file; if (file.Open(src, O_RDONLY) < 0) { - LOGERROR(L"Failed to load heightmap."); + LOGERROR("Failed to load heightmap."); return; } @@ -187,7 +187,7 @@ MESSAGEHANDLER(ImportHeightmap) if (read(file.Descriptor(), fileData.get(), fileSize) < 0) { - LOGERROR(L"Failed to read heightmap image."); + LOGERROR("Failed to read heightmap image."); file.Close(); return; } @@ -198,14 +198,14 @@ MESSAGEHANDLER(ImportHeightmap) Tex tex; if (tex.decode(fileData, fileSize) < 0) { - LOGERROR(L"Failed to decode heightmap."); + LOGERROR("Failed to decode heightmap."); return; } // Convert to uncompressed BGRA with no mipmaps if (tex.transform_to((tex.m_Flags | TEX_BGR | TEX_ALPHA) & ~(TEX_DXT | TEX_MIPMAPS)) < 0) { - LOGERROR(L"Failed to transform heightmap."); + LOGERROR("Failed to transform heightmap."); return; } diff --git a/source/tools/atlas/GameInterface/Handlers/ObjectHandlers.cpp b/source/tools/atlas/GameInterface/Handlers/ObjectHandlers.cpp index be0fc314c4..553008c27e 100644 --- a/source/tools/atlas/GameInterface/Handlers/ObjectHandlers.cpp +++ b/source/tools/atlas/GameInterface/Handlers/ObjectHandlers.cpp @@ -930,7 +930,7 @@ BEGIN_COMMAND(DeleteObjects) entity_id_t ent = sim.AddEntity(oldObjects[i].templateName.FromUTF8(), oldObjects[i].entityID); if (ent == INVALID_ENTITY) { - LOGERROR(L"Failed to load entity template '%hs'", oldObjects[i].templateName.c_str()); + LOGERROR("Failed to load entity template '%hs'", oldObjects[i].templateName.c_str()); } else {