forked from mirrors/0ad
Automatically replace %hs/%ls with %s in CLogger format strings.
Everything is char* now, so we don't need to mess around with different string types. Done with: ag -ls 'LOG(MESSAGE|MESSAGERENDER|WARNING|ERROR)' source | xargs perl -pi -e'1 while s/(LOG(MESSAGE|MESSAGERENDER|WARNING|ERROR).*)%[hl]s/$1%s/g' This was SVN commit r16187.
This commit is contained in:
@@ -42,11 +42,11 @@ namespace
|
||||
VfsPath* path = static_cast<VfsPath*>(cb_data);
|
||||
|
||||
if (severity == LOG_INFO)
|
||||
LOGMESSAGE("%ls: %hs", path->string8(), text);
|
||||
LOGMESSAGE("%s: %s", path->string8(), text);
|
||||
else if (severity == LOG_WARNING)
|
||||
LOGWARNING("%ls: %hs", path->string8(), text);
|
||||
LOGWARNING("%s: %s", path->string8(), text);
|
||||
else
|
||||
LOGERROR("%ls: %hs", path->string8(), text);
|
||||
LOGERROR("%s: %s", path->string8(), 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("Hotloading skeleton definitions from '%ls'", path.string8());
|
||||
LOGMESSAGE("Hotloading skeleton definitions from '%s'", path.string8());
|
||||
// Set the filename for the logger to report
|
||||
set_logger(ColladaLog, const_cast<void*>(static_cast<const void*>(&path)));
|
||||
|
||||
CVFSFile skeletonFile;
|
||||
if (skeletonFile.Load(m_VFS, path) != PSRETURN_OK)
|
||||
{
|
||||
LOGERROR("Failed to read skeleton defintions from '%ls'", path.string8());
|
||||
LOGERROR("Failed to read skeleton defintions from '%s'", path.string8());
|
||||
return ERR::FAIL;
|
||||
}
|
||||
|
||||
int ok = set_skeleton_definitions((const char*)skeletonFile.GetBuffer(), (int)skeletonFile.GetBufferSize());
|
||||
if (ok < 0)
|
||||
{
|
||||
LOGERROR("Failed to load skeleton definitions from '%ls'", path.string8());
|
||||
LOGERROR("Failed to load skeleton definitions from '%s'", path.string8());
|
||||
return ERR::FAIL;
|
||||
}
|
||||
|
||||
@@ -221,21 +221,21 @@ public:
|
||||
bool loaded = false;
|
||||
for (VfsPaths::const_iterator it = pathnames.begin(); it != pathnames.end(); ++it)
|
||||
{
|
||||
LOGMESSAGE("Loading skeleton definitions from '%ls'", it->string8());
|
||||
LOGMESSAGE("Loading skeleton definitions from '%s'", it->string8());
|
||||
// Set the filename for the logger to report
|
||||
set_logger(ColladaLog, const_cast<void*>(static_cast<const void*>(&(*it))));
|
||||
|
||||
CVFSFile skeletonFile;
|
||||
if (skeletonFile.Load(m_VFS, *it) != PSRETURN_OK)
|
||||
{
|
||||
LOGERROR("Failed to read skeleton defintions from '%ls'", it->string8());
|
||||
LOGERROR("Failed to read skeleton defintions from '%s'", it->string8());
|
||||
continue;
|
||||
}
|
||||
|
||||
int ok = set_skeleton_definitions((const char*)skeletonFile.GetBuffer(), (int)skeletonFile.GetBufferSize());
|
||||
if (ok < 0)
|
||||
{
|
||||
LOGERROR("Failed to load skeleton definitions from '%ls'", it->string8());
|
||||
LOGERROR("Failed to load skeleton definitions from '%s'", it->string8());
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -287,7 +287,7 @@ public:
|
||||
// should never happen, unless there really is a problem
|
||||
if (m_VFS->GetFileInfo(*it, &fileInfo) != INFO::OK)
|
||||
{
|
||||
LOGERROR("Failed to stat '%ls' for DAE caching", it->string8());
|
||||
LOGERROR("Failed to stat '%s' for DAE caching", it->string8());
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -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("Failed to open font file %ls", (path / fntName).string8());
|
||||
LOGERROR("Failed to open font file %s", (path / fntName).string8());
|
||||
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("Font %hs has invalid version", fontName.c_str());
|
||||
LOGERROR("Font %s 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("Font %hs has invalid codepoint 0x%x", fontName.c_str(), Codepoint);
|
||||
LOGWARNING("Font %s has invalid codepoint 0x%x", fontName.c_str(), Codepoint);
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
@@ -134,10 +134,10 @@ bool CMapGeneratorWorker::Run()
|
||||
}
|
||||
|
||||
// Load RMS
|
||||
LOGMESSAGE("Loading RMS '%ls'", m_ScriptPath.string8());
|
||||
LOGMESSAGE("Loading RMS '%s'", m_ScriptPath.string8());
|
||||
if (!m_ScriptInterface->LoadGlobalScriptFile(m_ScriptPath))
|
||||
{
|
||||
LOGERROR("CMapGeneratorWorker::Run: Failed to load RMS '%ls'", m_ScriptPath.string8());
|
||||
LOGERROR("CMapGeneratorWorker::Run: Failed to load RMS '%s'", m_ScriptPath.string8());
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -210,7 +210,7 @@ std::vector<std::string> CMapGeneratorWorker::GetCivData(ScriptInterface::CxPriv
|
||||
PSRETURN ret = file.Load(g_VFS, *it);
|
||||
if (ret != PSRETURN_OK)
|
||||
{
|
||||
LOGERROR("CMapGeneratorWorker::GetCivData: Failed to load file '%ls': %hs", path.string8(), GetErrorString(ret));
|
||||
LOGERROR("CMapGeneratorWorker::GetCivData: Failed to load file '%s': %s", path.string8(), GetErrorString(ret));
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -222,7 +222,7 @@ std::vector<std::string> CMapGeneratorWorker::GetCivData(ScriptInterface::CxPriv
|
||||
{
|
||||
// Some error reading directory
|
||||
wchar_t error[200];
|
||||
LOGERROR("CMapGeneratorWorker::GetCivData: Error reading directory '%ls': %ls", path.string8(), StatusDescription(ret, error, ARRAY_SIZE(error)));
|
||||
LOGERROR("CMapGeneratorWorker::GetCivData: Error reading directory '%s': %s", path.string8(), StatusDescription(ret, error, ARRAY_SIZE(error)));
|
||||
}
|
||||
|
||||
return data;
|
||||
@@ -234,7 +234,7 @@ CParamNode CMapGeneratorWorker::GetTemplate(ScriptInterface::CxPrivate* pCxPriva
|
||||
CMapGeneratorWorker* self = static_cast<CMapGeneratorWorker*>(pCxPrivate->pCBData);
|
||||
const CParamNode& templateRoot = self->m_TemplateLoader.GetTemplateFileData(templateName).GetChild("Entity");
|
||||
if (!templateRoot.IsOk())
|
||||
LOGERROR("Invalid template found for '%hs'", templateName.c_str());
|
||||
LOGERROR("Invalid template found for '%s'", 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("Loading map generator script '%ls'", it->string8());
|
||||
LOGMESSAGE("Loading map generator script '%s'", it->string8());
|
||||
|
||||
if (!m_ScriptInterface->LoadGlobalScriptFile(*it))
|
||||
{
|
||||
LOGERROR("CMapGeneratorWorker::LoadScripts: Failed to load script '%ls'", it->string8());
|
||||
LOGERROR("CMapGeneratorWorker::LoadScripts: Failed to load script '%s'", it->string8());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -284,7 +284,7 @@ bool CMapGeneratorWorker::LoadScripts(const std::wstring& libraryName)
|
||||
{
|
||||
// Some error reading directory
|
||||
wchar_t error[200];
|
||||
LOGERROR("CMapGeneratorWorker::LoadScripts: Error reading scripts in directory '%ls': %ls", path.string8(), StatusDescription(ret, error, ARRAY_SIZE(error)));
|
||||
LOGERROR("CMapGeneratorWorker::LoadScripts: Error reading scripts in directory '%s': %s", path.string8(), StatusDescription(ret, error, ARRAY_SIZE(error)));
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -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("Failed to load entity template '%ls'", TemplateName.c_str());
|
||||
LOGERROR("Failed to load entity template '%s'", 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("CMapReader::ParseTerrain() failed to get '%hs' property", #prop);\
|
||||
{ LOGERROR("CMapReader::ParseTerrain() failed to get '%s' 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
|
||||
@@ -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("Failed to load entity template '%ls'", currEnt.templateName.c_str());
|
||||
LOGERROR("Failed to load entity template '%s'", currEnt.templateName.c_str());
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1476,7 +1476,7 @@ int CMapReader::ParseEnvironment()
|
||||
|
||||
#define GET_ENVIRONMENT_PROPERTY(val, prop, out)\
|
||||
if (!pSimulation2->GetScriptInterface().GetProperty(val, #prop, out))\
|
||||
LOGWARNING("CMapReader::ParseEnvironment() failed to get '%hs' property", #prop);
|
||||
LOGWARNING("CMapReader::ParseEnvironment() failed to get '%s' property", #prop);
|
||||
|
||||
JS::RootedValue envObj(cx);
|
||||
GET_ENVIRONMENT_PROPERTY(tmpMapData, Environment, &envObj)
|
||||
@@ -1581,7 +1581,7 @@ int CMapReader::ParseCamera()
|
||||
|
||||
#define GET_CAMERA_PROPERTY(val, prop, out)\
|
||||
if (!pSimulation2->GetScriptInterface().GetProperty(val, #prop, out))\
|
||||
LOGWARNING("CMapReader::ParseCamera() failed to get '%hs' property", #prop);
|
||||
LOGWARNING("CMapReader::ParseCamera() failed to get '%s' 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);
|
||||
|
||||
@@ -71,7 +71,7 @@ void CMapWriter::SaveMap(const VfsPath& pathname, CTerrain* pTerrain,
|
||||
}
|
||||
catch (PSERROR_File_WriteFailed&)
|
||||
{
|
||||
LOGERROR("Failed to write map '%ls'", pathname.string8());
|
||||
LOGERROR("Failed to write map '%s'", pathname.string8());
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -447,5 +447,5 @@ void CMapWriter::WriteXML(const VfsPath& filename,
|
||||
}
|
||||
}
|
||||
if (!XML_StoreVFS(g_VFS, filename))
|
||||
LOGERROR("Failed to write map '%ls'", filename.string8());
|
||||
LOGERROR("Failed to write map '%s'", filename.string8());
|
||||
}
|
||||
|
||||
@@ -53,7 +53,7 @@ CModelDefPtr CMeshManager::GetMesh(const VfsPath& pathname)
|
||||
|
||||
if (pmdFilename.empty())
|
||||
{
|
||||
LOGERROR("Could not load mesh '%ls'", pathname.string8());
|
||||
LOGERROR("Could not load mesh '%s'", pathname.string8());
|
||||
return CModelDefPtr();
|
||||
}
|
||||
|
||||
@@ -65,7 +65,7 @@ CModelDefPtr CMeshManager::GetMesh(const VfsPath& pathname)
|
||||
}
|
||||
catch (PSERROR_File&)
|
||||
{
|
||||
LOGERROR("Could not load mesh '%ls'", pmdFilename.string8());
|
||||
LOGERROR("Could not load mesh '%s'", pmdFilename.string8());
|
||||
return CModelDefPtr();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -90,7 +90,7 @@ bool CObjectBase::Load(const VfsPath& pathname)
|
||||
|
||||
if (root.GetNodeName() != el_actor)
|
||||
{
|
||||
LOGERROR("Invalid actor format (unrecognised root element '%hs')", XeroFile.GetElementString(root.GetNodeName()).c_str());
|
||||
LOGERROR("Invalid actor format (unrecognised root element '%s')", XeroFile.GetElementString(root.GetNodeName()).c_str());
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -266,7 +266,7 @@ bool CObjectBase::Load(const VfsPath& pathname)
|
||||
|
||||
if (currentGroup->size() == 0)
|
||||
{
|
||||
LOGERROR("Actor group has zero variants ('%ls')", pathname.string8());
|
||||
LOGERROR("Actor group has zero variants ('%s')", pathname.string8());
|
||||
}
|
||||
|
||||
++currentGroup;
|
||||
|
||||
@@ -73,7 +73,7 @@ bool CObjectEntry::BuildVariation(const std::vector<std::set<CStr> >& selections
|
||||
str << variation.color;
|
||||
int r, g, b;
|
||||
if (! (str >> r >> g >> b)) // Any trailing data is ignored
|
||||
LOGERROR("Actor '%ls' has invalid RGB colour '%hs'", m_Base->m_ShortName.c_str(), variation.color.c_str());
|
||||
LOGERROR("Actor '%s' has invalid RGB colour '%s'", 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<std::set<CStr> >& selections
|
||||
CModelDefPtr modeldef (objectManager.GetMeshManager().GetMesh(m_ModelName));
|
||||
if (!modeldef)
|
||||
{
|
||||
LOGERROR("CObjectEntry::BuildVariation(): Model %ls failed to load", m_ModelName.string8());
|
||||
LOGERROR("CObjectEntry::BuildVariation(): Model %s failed to load", m_ModelName.string8());
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -133,7 +133,7 @@ bool CObjectEntry::BuildVariation(const std::vector<std::set<CStr> >& selections
|
||||
|
||||
if (m_Samplers.size() == 0)
|
||||
{
|
||||
LOGERROR("Actor '%ls' has no textures.", m_Base->m_ShortName.c_str());
|
||||
LOGERROR("Actor '%s' has no textures.", m_Base->m_ShortName.c_str());
|
||||
}
|
||||
|
||||
std::vector<CObjectBase::Samp>::iterator samp;
|
||||
@@ -190,7 +190,7 @@ bool CObjectEntry::BuildVariation(const std::vector<std::set<CStr> >& selections
|
||||
{
|
||||
// start up idling
|
||||
if (!model->SetAnimation(GetRandomAnimation("idle")))
|
||||
LOGERROR("Failed to set idle animation in model \"%ls\"", m_ModelName.string8());
|
||||
LOGERROR("Failed to set idle animation in model \"%s\"", m_ModelName.string8());
|
||||
}
|
||||
|
||||
// build props - TODO, RC - need to fix up bounds here
|
||||
@@ -209,7 +209,7 @@ bool CObjectEntry::BuildVariation(const std::vector<std::set<CStr> >& selections
|
||||
CObjectEntry* oe = objectManager.FindObjectVariation(prop.m_ModelName.c_str(), selections);
|
||||
if (!oe)
|
||||
{
|
||||
LOGERROR("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 \"%s\" on actor \"%s\"", prop.m_ModelName.c_str(), m_Base->m_ShortName.c_str());
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -240,7 +240,7 @@ bool CObjectEntry::BuildVariation(const std::vector<std::set<CStr> >& selections
|
||||
propmodel->ToCModel()->SetAnimation(oe->GetRandomAnimation("idle"));
|
||||
}
|
||||
else
|
||||
LOGERROR("Failed to find matching prop point called \"%hs\" in model \"%ls\" for actor \"%ls\"", ppn.c_str(), m_ModelName.string8(), m_Base->m_ShortName.c_str());
|
||||
LOGERROR("Failed to find matching prop point called \"%s\" in model \"%s\" for actor \"%s\"", ppn.c_str(), m_ModelName.string8(), m_Base->m_ShortName.c_str());
|
||||
}
|
||||
|
||||
// setup flags
|
||||
|
||||
@@ -96,7 +96,7 @@ CObjectBase* CObjectManager::FindObjectBase(const CStrW& objectname)
|
||||
else
|
||||
delete obj;
|
||||
|
||||
LOGERROR("CObjectManager::FindObjectBase(): Cannot find object '%ls'", objectname.c_str());
|
||||
LOGERROR("CObjectManager::FindObjectBase(): Cannot find object '%s'", objectname.c_str());
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -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("Particle sets unknown variable '%hs'", name.c_str());
|
||||
LOGWARNING("Particle sets unknown variable '%s'", name.c_str());
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
@@ -77,7 +77,7 @@ CShaderProgramPtr CShaderManager::LoadProgram(const char* name, const CShaderDef
|
||||
CShaderProgramPtr program;
|
||||
if (!NewProgram(name, defines, program))
|
||||
{
|
||||
LOGERROR("Failed to load shader '%hs'", name);
|
||||
LOGERROR("Failed to load shader '%s'", 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("Failed to load effect '%hs'", name.c_str());
|
||||
LOGERROR("Failed to load effect '%s'", name.c_str());
|
||||
tech = CShaderTechniquePtr();
|
||||
}
|
||||
|
||||
|
||||
@@ -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("Failed to compile %hs program '%ls' (line %d):\n%hs", targetName, file.string8(), errLine, errStr);
|
||||
LOGERROR("Failed to compile %s program '%s' (line %d):\n%s", targetName, file.string8(), errLine, errStr);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -310,9 +310,9 @@ public:
|
||||
pglGetShaderInfoLog(shader, length, NULL, infolog);
|
||||
|
||||
if (ok)
|
||||
LOGMESSAGE("Info when compiling shader '%ls':\n%hs", file.string8(), infolog);
|
||||
LOGMESSAGE("Info when compiling shader '%s':\n%s", file.string8(), infolog);
|
||||
else
|
||||
LOGERROR("Failed to compile shader '%ls':\n%hs", file.string8(), infolog);
|
||||
LOGERROR("Failed to compile shader '%s':\n%s", file.string8(), infolog);
|
||||
|
||||
delete[] infolog;
|
||||
}
|
||||
@@ -357,9 +357,9 @@ public:
|
||||
pglGetProgramInfoLog(m_Program, length, NULL, infolog);
|
||||
|
||||
if (ok)
|
||||
LOGMESSAGE("Info when linking program '%ls'+'%ls':\n%hs", m_VertexFile.string8(), m_FragmentFile.string8(), infolog);
|
||||
LOGMESSAGE("Info when linking program '%s'+'%s':\n%s", m_VertexFile.string8(), m_FragmentFile.string8(), infolog);
|
||||
else
|
||||
LOGERROR("Failed to link program '%ls'+'%ls':\n%hs", m_VertexFile.string8(), m_FragmentFile.string8(), infolog);
|
||||
LOGERROR("Failed to link program '%s'+'%s':\n%s", m_VertexFile.string8(), m_FragmentFile.string8(), infolog);
|
||||
|
||||
delete[] infolog;
|
||||
}
|
||||
@@ -663,7 +663,7 @@ CShaderProgram::CShaderProgram(int streamflags)
|
||||
const std::map<CStrIntern, int>& UNUSED(vertexIndexes), const std::map<CStrIntern, frag_index_pair_t>& UNUSED(fragmentIndexes),
|
||||
int UNUSED(streamflags))
|
||||
{
|
||||
LOGERROR("CShaderProgram::ConstructARB: '%ls'+'%ls': ARB shaders not supported on this device",
|
||||
LOGERROR("CShaderProgram::ConstructARB: '%s'+'%s': ARB shaders not supported on this device",
|
||||
vertexFile.string().c_str(), fragmentFile.string().c_str());
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -1159,7 +1159,7 @@ public:
|
||||
if (id == "model_solid_tex")
|
||||
return new CShaderProgramFFP_ModelSolidTex(defines);
|
||||
|
||||
LOGERROR("CShaderProgram::ConstructFFP: '%hs': Invalid id", id.c_str());
|
||||
LOGERROR("CShaderProgram::ConstructFFP: '%s': Invalid id", id.c_str());
|
||||
debug_warn(L"CShaderProgram::ConstructFFP: Invalid id");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -65,7 +65,7 @@ CSkeletonAnimDef* CSkeletonAnimManager::GetAnimation(const VfsPath& pathname)
|
||||
|
||||
if (psaFilename.empty())
|
||||
{
|
||||
LOGERROR("Could not load animation '%ls'", pathname.string8());
|
||||
LOGERROR("Could not load animation '%s'", pathname.string8());
|
||||
def = NULL;
|
||||
}
|
||||
else
|
||||
@@ -76,14 +76,14 @@ CSkeletonAnimDef* CSkeletonAnimManager::GetAnimation(const VfsPath& pathname)
|
||||
}
|
||||
catch (PSERROR_File&)
|
||||
{
|
||||
LOGERROR("Could not load animation '%ls'", psaFilename.string8());
|
||||
LOGERROR("Could not load animation '%s'", psaFilename.string8());
|
||||
}
|
||||
}
|
||||
|
||||
if (def)
|
||||
LOGMESSAGE("CSkeletonAnimManager::GetAnimation(%ls): Loaded successfully", pathname.string8());
|
||||
LOGMESSAGE("CSkeletonAnimManager::GetAnimation(%s): Loaded successfully", pathname.string8());
|
||||
else
|
||||
LOGERROR("CSkeletonAnimManager::GetAnimation(%ls): Failed loading, marked file as bad", pathname.string8());
|
||||
LOGERROR("CSkeletonAnimManager::GetAnimation(%s): Failed loading, marked file as bad", pathname.string8());
|
||||
|
||||
// Add to map
|
||||
m_Animations[name] = def; // NULL if failed to load - we won't try loading it again
|
||||
|
||||
@@ -55,7 +55,7 @@ CTerrainPropertiesPtr CTerrainProperties::FromXML(const CTerrainPropertiesPtr& p
|
||||
// Check that we've got the right kind of xml document
|
||||
if (rootName != "Terrains")
|
||||
{
|
||||
LOGERROR("TerrainProperties: Loading %ls: Root node is not terrains (found \"%hs\")",
|
||||
LOGERROR("TerrainProperties: Loading %s: Root node is not terrains (found \"%s\")",
|
||||
pathname.string().c_str(),
|
||||
rootName.c_str());
|
||||
return CTerrainPropertiesPtr();
|
||||
@@ -79,7 +79,7 @@ CTerrainPropertiesPtr CTerrainProperties::FromXML(const CTerrainPropertiesPtr& p
|
||||
}
|
||||
else
|
||||
{
|
||||
LOGWARNING("TerrainProperties: Loading %ls: Unexpected node %hs\n",
|
||||
LOGWARNING("TerrainProperties: Loading %s: Unexpected node %s\n",
|
||||
pathname.string().c_str(),
|
||||
XeroFile.GetElementString(child.GetNodeName()).c_str());
|
||||
// Keep reading - typos shouldn't be showstoppers
|
||||
|
||||
@@ -47,7 +47,7 @@ CTerrainTextureEntry::CTerrainTextureEntry(CTerrainPropertiesPtr properties, con
|
||||
CXeromyces XeroFile;
|
||||
if (XeroFile.Load(g_VFS, path) != PSRETURN_OK)
|
||||
{
|
||||
LOGERROR("Terrain xml not found (%hs)", path.string8());
|
||||
LOGERROR("Terrain xml not found (%s)", path.string8());
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -70,7 +70,7 @@ CTerrainTextureEntry::CTerrainTextureEntry(CTerrainPropertiesPtr properties, con
|
||||
|
||||
if (root.GetNodeName() != el_terrain)
|
||||
{
|
||||
LOGERROR("Invalid terrain format (unrecognised root element '%hs')", XeroFile.GetElementString(root.GetNodeName()).c_str());
|
||||
LOGERROR("Invalid terrain format (unrecognised root element '%s')", XeroFile.GetElementString(root.GetNodeName()).c_str());
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -89,7 +89,7 @@ CTerrainTextureEntry* CTerrainTextureManager::FindTexture(const CStr& tag_)
|
||||
return m_TextureEntries[i];
|
||||
}
|
||||
|
||||
LOGWARNING("CTerrainTextureManager: Couldn't find terrain %hs", tag.c_str());
|
||||
LOGWARNING("CTerrainTextureManager: Couldn't find terrain %s", 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("CTextureManager::RecurseDirectory(%ls)", path.string8());
|
||||
//LOGMESSAGE("CTextureManager::RecurseDirectory(%s)", path.string8());
|
||||
|
||||
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("CTerrainTextureManager::RecurseDirectory(%ls): no terrains.xml (or errors while loading) - using parent properties", path.string8());
|
||||
LOGMESSAGE("CTerrainTextureManager::RecurseDirectory(%s): no terrains.xml (or errors while loading) - using parent properties", path.string8());
|
||||
props = parentProps;
|
||||
}
|
||||
|
||||
|
||||
@@ -120,7 +120,7 @@ CTextureConverter::SettingsFile* CTextureConverter::LoadSettings(const VfsPath&
|
||||
|
||||
if (root.GetNodeName() != el_textures)
|
||||
{
|
||||
LOGERROR("Invalid texture settings file \"%ls\" (unrecognised root element)", path.string8());
|
||||
LOGERROR("Invalid texture settings file \"%s\" (unrecognised root element)", path.string8());
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -152,7 +152,7 @@ CTextureConverter::SettingsFile* CTextureConverter::LoadSettings(const VfsPath&
|
||||
else if (v == "alpha")
|
||||
p.settings.format = FMT_ALPHA;
|
||||
else
|
||||
LOGERROR("Invalid attribute value <file format='%hs'>", v.c_str());
|
||||
LOGERROR("Invalid attribute value <file format='%s'>", 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("Invalid attribute value <file mipmap='%hs'>", v.c_str());
|
||||
LOGERROR("Invalid attribute value <file mipmap='%s'>", 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("Invalid attribute value <file normal='%hs'>", v.c_str());
|
||||
LOGERROR("Invalid attribute value <file normal='%s'>", 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("Invalid attribute value <file alpha='%hs'>", v.c_str());
|
||||
LOGERROR("Invalid attribute value <file alpha='%s'>", 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("Invalid attribute value <file filter='%hs'>", v.c_str());
|
||||
LOGERROR("Invalid attribute value <file filter='%s'>", v.c_str());
|
||||
}
|
||||
else if (attr.Name == at_kaiserwidth)
|
||||
{
|
||||
@@ -212,7 +212,7 @@ CTextureConverter::SettingsFile* CTextureConverter::LoadSettings(const VfsPath&
|
||||
}
|
||||
else
|
||||
{
|
||||
LOGERROR("Invalid attribute name <file %hs='...'>", XeroFile.GetAttributeString(attr.Name).c_str());
|
||||
LOGERROR("Invalid attribute name <file %s='...'>", 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("Failed to load texture \"%ls\"", src.string8());
|
||||
LOGERROR("Failed to load texture \"%s\"", src.string8());
|
||||
return false;
|
||||
}
|
||||
|
||||
Tex tex;
|
||||
if (tex.decode(file, fileSize) < 0)
|
||||
{
|
||||
LOGERROR("Failed to decode texture \"%ls\"", src.string8());
|
||||
LOGERROR("Failed to decode texture \"%s\"", src.string8());
|
||||
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("Failed to transform texture \"%ls\"", src.string8());
|
||||
LOGERROR("Failed to transform texture \"%s\"", src.string8());
|
||||
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("Failed to convert grayscale texture \"%ls\" - only RGB textures are currently supported", src.string8());
|
||||
LOGERROR("Failed to convert grayscale texture \"%s\" - only RGB textures are currently supported", src.string8());
|
||||
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("Failed to transform texture \"%ls\"", src.string8());
|
||||
LOGERROR("Failed to transform texture \"%s\"", src.string8());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -482,7 +482,7 @@ bool CTextureConverter::ConvertTexture(const CTexturePtr& texture, const VfsPath
|
||||
return true;
|
||||
|
||||
#else
|
||||
LOGERROR("Failed to convert texture \"%ls\" (NVTT not available)", src.string8());
|
||||
LOGERROR("Failed to convert texture \"%s\" (NVTT not available)", src.string8());
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -178,7 +178,7 @@ public:
|
||||
Handle h = ogl_tex_load(m_VFS, path, RES_UNIQUE);
|
||||
if (h <= 0)
|
||||
{
|
||||
LOGERROR("Texture failed to load; \"%ls\"", texture->m_Properties.m_Path.string8());
|
||||
LOGERROR("Texture failed to load; \"%s\"", texture->m_Properties.m_Path.string8());
|
||||
|
||||
// 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("Texture failed to upload: \"%ls\"", texture->m_Properties.m_Path.string8());
|
||||
LOGERROR("Texture failed to upload: \"%s\"", texture->m_Properties.m_Path.string8());
|
||||
|
||||
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("CCacheLoader failed to find archived or source file for: \"%ls\"", texture->m_Properties.m_Path.string8());
|
||||
LOGERROR("CCacheLoader failed to find archived or source file for: \"%s\"", texture->m_Properties.m_Path.string8());
|
||||
texture->SetHandle(m_ErrorHandle);
|
||||
return true;
|
||||
}
|
||||
@@ -299,7 +299,7 @@ public:
|
||||
PrepareCacheKey(texture, hash, version);
|
||||
VfsPath looseCachePath = m_CacheLoader.LooseCachePath(sourcePath, hash, version);
|
||||
|
||||
// LOGWARNING("Converting texture \"%ls\"", srcPath.c_str());
|
||||
// LOGWARNING("Converting texture \"%s\"", srcPath.c_str());
|
||||
|
||||
CTextureConverter::Settings settings = GetConverterSettings(texture);
|
||||
|
||||
@@ -345,7 +345,7 @@ public:
|
||||
}
|
||||
else
|
||||
{
|
||||
LOGERROR("Texture failed to convert: \"%ls\"", texture->m_Properties.m_Path.string8());
|
||||
LOGERROR("Texture failed to convert: \"%s\"", texture->m_Properties.m_Path.string8());
|
||||
texture->SetHandle(m_ErrorHandle);
|
||||
}
|
||||
texture->m_State = CTexture::LOADED;
|
||||
|
||||
+39
-39
@@ -380,7 +380,7 @@ void CGUI::Draw()
|
||||
}
|
||||
catch (PSERROR_GUI& e)
|
||||
{
|
||||
LOGERROR("GUI draw error: %hs", e.what());
|
||||
LOGERROR("GUI draw error: %s", e.what());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -969,7 +969,7 @@ void CGUI::LoadXmlFile(const VfsPath& Filename, boost::unordered_set<VfsPath>& P
|
||||
}
|
||||
catch (PSERROR_GUI& e)
|
||||
{
|
||||
LOGERROR("Errors loading GUI file %ls (%u)", Filename.string8(), e.getCode());
|
||||
LOGERROR("Errors loading GUI file %s (%u)", Filename.string8(), 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("GUI: Unrecognized object type \"%hs\"", type.c_str());
|
||||
LOGERROR("GUI: Unrecognized object type \"%s\"", 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("GUI: Trying to use style '%hs' that doesn't exist.", argStyle.c_str());
|
||||
LOGERROR("GUI: Trying to use style '%s' 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("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: %s) Can't set \"%s\" to \"%s\"", 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("Error opening GUI script action file '%ls'", filename.c_str());
|
||||
LOGERROR("Error opening GUI script action file '%s'", 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("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: %s)", 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("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: %s)", 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("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 (%s) and directory name (%s). 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("GUI: Error reading included XML: '%ls'", filename.c_str());
|
||||
LOGERROR("GUI: Error reading included XML: '%s'", filename.c_str());
|
||||
continue;
|
||||
}
|
||||
|
||||
XMBElement node = XeroIncluded.GetRoot();
|
||||
if (node.GetNodeName() != XeroIncluded.GetElementID("object"))
|
||||
{
|
||||
LOGERROR("GUI: Error reading included XML: '%ls', root element must have be of type 'object'.", filename.c_str());
|
||||
LOGERROR("GUI: Error reading included XML: '%s', 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("GUI: Error reading included XML: '%ls'", (*it).string8());
|
||||
LOGERROR("GUI: Error reading included XML: '%s'", (*it).string8());
|
||||
continue;
|
||||
}
|
||||
|
||||
XMBElement node = XeroIncluded.GetRoot();
|
||||
if (node.GetNodeName() != XeroIncluded.GetElementID("object"))
|
||||
{
|
||||
LOGERROR("GUI: Error reading included XML: '%ls', root element must have be of type 'object'.", (*it).string8());
|
||||
LOGERROR("GUI: Error reading included XML: '%s', root element must have be of type 'object'.", (*it).string8());
|
||||
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("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 %s)", object->GetPresentableName().c_str());
|
||||
}
|
||||
else
|
||||
{
|
||||
// Try making the object read the tag.
|
||||
if (!object->HandleAdditionalChildren(child, pFile))
|
||||
{
|
||||
LOGERROR("GUI: (object: %hs) Reading unknown children for its type", object->GetPresentableName().c_str());
|
||||
LOGERROR("GUI: (object: %s) 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("GUI error: %hs", e.what());
|
||||
LOGERROR("GUI error: %s", e.what());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1491,7 +1491,7 @@ void CGUI::Xeromyces_ReadScript(XMBElement Element, CXeromyces* pFile, boost::un
|
||||
}
|
||||
catch (PSERROR_Scripting& e)
|
||||
{
|
||||
LOGERROR("GUI: Error executing script %ls: %hs", file.c_str(), e.what());
|
||||
LOGERROR("GUI: Error executing script %s: %s", file.c_str(), e.what());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1512,7 +1512,7 @@ void CGUI::Xeromyces_ReadScript(XMBElement Element, CXeromyces* pFile, boost::un
|
||||
}
|
||||
catch (PSERROR_Scripting& e)
|
||||
{
|
||||
LOGERROR("GUI: Error executing script %ls: %hs", (*it).string8(), e.what());
|
||||
LOGERROR("GUI: Error executing script %s: %s", (*it).string8(), e.what());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1527,7 +1527,7 @@ void CGUI::Xeromyces_ReadScript(XMBElement Element, CXeromyces* pFile, boost::un
|
||||
}
|
||||
catch (PSERROR_Scripting& e)
|
||||
{
|
||||
LOGERROR("GUI: Error executing inline script: %hs", e.what());
|
||||
LOGERROR("GUI: Error executing inline script: %s", 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("GUI sprite name '%hs' used more than once; first definition will be discarded", name.c_str());
|
||||
LOGWARNING("GUI sprite name '%s' used more than once; first definition will be discarded", name.c_str());
|
||||
|
||||
//
|
||||
// Read Children (the images)
|
||||
@@ -1636,7 +1636,7 @@ void CGUI::Xeromyces_ReadImage(XMBElement Element, CXeromyces* pFile, CGUISprite
|
||||
{
|
||||
CClientArea ca;
|
||||
if (!GUI<CClientArea>::ParseString(attr_value, ca))
|
||||
LOGERROR("GUI: Error parsing '%hs' (\"%ls\")", attr_name.c_str(), attr_value.c_str());
|
||||
LOGERROR("GUI: Error parsing '%s' (\"%s\")", 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<CClientArea>::ParseString(attr_value, ca))
|
||||
LOGERROR("GUI: Error parsing '%hs' (\"%ls\")", attr_name.c_str(), attr_value.c_str());
|
||||
LOGERROR("GUI: Error parsing '%s' (\"%s\")", 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<CRect>::ParseString(attr_value, rect))
|
||||
LOGERROR("GUI: Error parsing '%hs' (\"%ls\")", attr_name.c_str(), attr_value.c_str());
|
||||
LOGERROR("GUI: Error parsing '%s' (\"%s\")", 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<CSize>::ParseString(attr_value, size))
|
||||
LOGERROR("GUI: Error parsing '%hs' (\"%ls\")", attr_name.c_str(), attr_value.c_str());
|
||||
LOGERROR("GUI: Error parsing '%s' (\"%s\")", 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<float>::ParseString(attr_value, val))
|
||||
LOGERROR("GUI: Error parsing '%hs' (\"%ls\")", attr_name.c_str(), attr_value.c_str());
|
||||
LOGERROR("GUI: Error parsing '%s' (\"%s\")", 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<bool>::ParseString(attr_value, b))
|
||||
LOGERROR("GUI: Error parsing '%hs' (\"%ls\")", attr_name.c_str(), attr_value.c_str());
|
||||
LOGERROR("GUI: Error parsing '%s' (\"%s\")", 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("GUI: Error parsing '%hs' (\"%ls\")", attr_name.c_str(), attr_value.c_str());
|
||||
LOGERROR("GUI: Error parsing '%s' (\"%s\")", attr_name.c_str(), attr_value.c_str());
|
||||
}
|
||||
else
|
||||
if (attr_name == "z_level")
|
||||
{
|
||||
float z_level;
|
||||
if (!GUI<float>::ParseString(attr_value, z_level))
|
||||
LOGERROR("GUI: Error parsing '%hs' (\"%ls\")", attr_name.c_str(), attr_value.c_str());
|
||||
LOGERROR("GUI: Error parsing '%s' (\"%s\")", 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<CColor>::ParseString(attr_value, color))
|
||||
LOGERROR("GUI: Error parsing '%hs' (\"%ls\")", attr_name.c_str(), attr_value.c_str());
|
||||
LOGERROR("GUI: Error parsing '%s' (\"%s\")", 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<CColor>::ParseString(attr_value, color))
|
||||
LOGERROR("GUI: Error parsing '%hs' (\"%ls\")", attr_name.c_str(), attr_value.c_str());
|
||||
LOGERROR("GUI: Error parsing '%s' (\"%s\")", 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<bool>::ParseString(attr_value, b))
|
||||
LOGERROR("GUI: Error parsing '%hs' (\"%ls\")", attr_name.c_str(), attr_value.c_str());
|
||||
LOGERROR("GUI: Error parsing '%s' (\"%s\")", attr_name.c_str(), attr_value.c_str());
|
||||
else Image->m_Border = b;
|
||||
}
|
||||
else
|
||||
@@ -1773,7 +1773,7 @@ void CGUI::Xeromyces_ReadEffects(XMBElement Element, CXeromyces* pFile, SGUIImag
|
||||
{
|
||||
CColor color;
|
||||
if (!GUI<int>::ParseColor(attr_value, color, 0))
|
||||
LOGERROR("GUI: Error parsing '%hs' (\"%ls\")", attr_name.c_str(), attr_value.c_str());
|
||||
LOGERROR("GUI: Error parsing '%s' (\"%s\")", 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<bool>::ParseString(attr_value.FromUTF8(), b))
|
||||
LOGERROR("GUI: Error parsing '%hs' (\"%hs\")", attr_name.c_str(), attr_value.c_str());
|
||||
LOGERROR("GUI: Error parsing '%s' (\"%s\")", 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<float>::ParseString(attr_value.FromUTF8(), f))
|
||||
LOGERROR("GUI: Error parsing '%hs' (\"%hs\")", attr_name.c_str(), attr_value.c_str());
|
||||
LOGERROR("GUI: Error parsing '%s' (\"%s\")", 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<float>::ParseString(attr_value.FromUTF8(), f))
|
||||
LOGERROR("GUI: Error parsing '%hs' (\"%hs\")", attr_name.c_str(), attr_value.c_str());
|
||||
LOGERROR("GUI: Error parsing '%s' (\"%s\")", 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<float>::ParseString(attr_value.FromUTF8(), f))
|
||||
LOGERROR("GUI: Error parsing '%hs' (\"%hs\")", attr_name.c_str(), attr_value.c_str());
|
||||
LOGERROR("GUI: Error parsing '%s' (\"%s\")", 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<CSize>::ParseString(attr_value.FromUTF8(), size))
|
||||
LOGERROR("Error parsing '%hs' (\"%hs\") inside <icon>.", attr_name.c_str(), attr_value.c_str());
|
||||
LOGERROR("Error parsing '%s' (\"%s\") inside <icon>.", 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<int>::ParseString(attr_value.FromUTF8(), cell_id))
|
||||
LOGERROR("GUI: Error parsing '%hs' (\"%hs\") inside <icon>.", attr_name.c_str(), attr_value.c_str());
|
||||
LOGERROR("GUI: Error parsing '%s' (\"%s\") inside <icon>.", 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("GUI: Unable to create custom color '%hs'. Invalid color syntax.", name.c_str());
|
||||
LOGERROR("GUI: Unable to create custom color '%s'. Invalid color syntax.", name.c_str());
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -158,7 +158,7 @@ bool COList::HandleAdditionalChildren(const XMBElement& child, CXeromyces* pFile
|
||||
{
|
||||
CColor color;
|
||||
if (!GUI<CColor>::ParseString(attr_value.FromUTF8(), color))
|
||||
LOGERROR("GUI: Error parsing '%hs' (\"%ls\")", attr_name.c_str(), attr_value.c_str());
|
||||
LOGERROR("GUI: Error parsing '%s' (\"%s\")", 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<float>::ParseString(attr_value.FromUTF8(), width))
|
||||
LOGERROR("GUI: Error parsing '%hs' (\"%ls\")", attr_name.c_str(), attr_value.c_str());
|
||||
LOGERROR("GUI: Error parsing '%s' (\"%s\")", 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("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: %s)", this->GetPresentableName().c_str());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -137,7 +137,7 @@ void CGUIManager::PopPageCB(shared_ptr<ScriptInterface::StructuredClone> args)
|
||||
JS::RootedValue global(cx, scriptInterface->GetGlobalObject());
|
||||
if (!scriptInterface->HasProperty(global, callback.c_str()))
|
||||
{
|
||||
LOGERROR("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 %s does not exist in the page %s", callback.c_str(), m_PageStack.back().name.c_str());
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -146,7 +146,7 @@ void CGUIManager::PopPageCB(shared_ptr<ScriptInterface::StructuredClone> args)
|
||||
scriptInterface->ReadStructuredClone(args, &argVal);
|
||||
if (!scriptInterface->CallFunctionVoid(global, callback.c_str(), argVal))
|
||||
{
|
||||
LOGERROR("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 %s in the page %s", 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("GUI page '%ls' must have root element <page>", page.name.c_str());
|
||||
LOGERROR("GUI page '%s' must have root element <page>", page.name.c_str());
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -212,7 +212,7 @@ void CGUIManager::LoadPage(SGUIPage& page)
|
||||
{
|
||||
if (node.GetNodeName() != elmt_include)
|
||||
{
|
||||
LOGERROR("GUI page '%ls' must only have <include> elements inside <page>", page.name.c_str());
|
||||
LOGERROR("GUI page '%s' must only have <include> elements inside <page>", page.name.c_str());
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -252,7 +252,7 @@ void CGUIManager::LoadPage(SGUIPage& page)
|
||||
hotloadDataVal)
|
||||
)
|
||||
{
|
||||
LOGERROR("GUI page '%ls': Failed to call init() function", page.name.c_str());
|
||||
LOGERROR("GUI page '%s': 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("GUI file '%ls' changed - reloading page '%ls'", path.string8(), it->name.c_str());
|
||||
LOGMESSAGE("GUI file '%s' changed - reloading page '%s'", path.string8(), 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("Invalid template found for '%hs'", templateName.c_str());
|
||||
LOGERROR("Invalid template found for '%s'", templateName.c_str());
|
||||
|
||||
return templateRoot;
|
||||
}
|
||||
|
||||
@@ -144,7 +144,7 @@ void GUIRenderer::UpdateDrawCallCache(DrawCalls &Calls, const CStr& SpriteName,
|
||||
// Check colour is valid
|
||||
if (!GUI<CColor>::ParseString(value, color))
|
||||
{
|
||||
LOGERROR("GUI: Error parsing sprite 'colour' (\"%ls\")", value.c_str());
|
||||
LOGERROR("GUI: Error parsing sprite 'colour' (\"%s\")", value.c_str());
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -167,7 +167,7 @@ void GUIRenderer::UpdateDrawCallCache(DrawCalls &Calls, const CStr& SpriteName,
|
||||
else
|
||||
{
|
||||
// Otherwise, just complain and give up:
|
||||
LOGERROR("Trying to use a sprite that doesn't exist (\"%hs\").", SpriteName.c_str());
|
||||
LOGERROR("Trying to use a sprite that doesn't exist (\"%s\").", SpriteName.c_str());
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -149,7 +149,7 @@ void GUITooltip::ShowTooltip(IGUIObject* obj, CPos pos, const CStr& style, CGUI*
|
||||
IGUIObject* tooltipobj = gui->FindObjectByName("__tooltip_"+style);
|
||||
if (! tooltipobj)
|
||||
{
|
||||
LOGERROR("Cannot find tooltip named '%hs'", style.c_str());
|
||||
LOGERROR("Cannot find tooltip named '%s'", 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("Cannot find object named '%hs' used by tooltip '%hs'", usedObjectName.c_str(), style.c_str());
|
||||
LOGERROR("Cannot find object named '%s' used by tooltip '%s'", 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("Cannot find tooltip named '%hs'", style.c_str());
|
||||
LOGERROR("Cannot find tooltip named '%s'", style.c_str());
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -224,7 +224,7 @@ void GUITooltip::HideTooltip(const CStr& style, CGUI* gui)
|
||||
IGUIObject* usedobj = gui->FindObjectByName(usedObjectName);
|
||||
if (! usedobj)
|
||||
{
|
||||
LOGERROR("Cannot find object named '%hs' used by tooltip '%hs'", usedObjectName.c_str(), style.c_str());
|
||||
LOGERROR("Cannot find object named '%s' used by tooltip '%s'", 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("Cannot find tooltip object named '%hs'", style.c_str());
|
||||
LOGERROR("Cannot find tooltip object named '%s'", style.c_str());
|
||||
return delay;
|
||||
}
|
||||
GUI<int>::GetSetting(tooltipobj, "delay", delay);
|
||||
|
||||
@@ -113,19 +113,19 @@ bool CClientArea::SetClientArea(const CStr& Value)
|
||||
coord++;
|
||||
break;
|
||||
default:
|
||||
LOGWARNING("ClientArea definitions may only contain numerics. Your input: '%hs'", Value.c_str());
|
||||
LOGWARNING("ClientArea definitions may only contain numerics. Your input: '%s'", Value.c_str());
|
||||
return false;
|
||||
}
|
||||
if (coord > 3)
|
||||
{
|
||||
LOGWARNING("Too many CClientArea parameters (4 max). Your input: '%hs'", Value.c_str());
|
||||
LOGWARNING("Too many CClientArea parameters (4 max). Your input: '%s'", Value.c_str());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (coord < 3)
|
||||
{
|
||||
LOGWARNING("Too few CClientArea parameters (4 min). Your input: '%hs'", Value.c_str());
|
||||
LOGWARNING("Too few CClientArea parameters (4 min). Your input: '%s'", Value.c_str());
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
+14
-14
@@ -109,7 +109,7 @@ void CGUIString::GenerateTextCall(const CGUI *pGUI,
|
||||
if (!pGUI->IconExists(path))
|
||||
{
|
||||
if (pObject)
|
||||
LOGERROR("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 (\"%s\").", path.c_str());
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -207,7 +207,7 @@ void CGUIString::GenerateTextCall(const CGUI *pGUI,
|
||||
|
||||
if (!GUI<CColor>::ParseString(it2->m_TagValue, TextCall.m_Color)
|
||||
&& pObject)
|
||||
LOGERROR("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 \"%s\".", pObject->GetPresentableName().c_str());
|
||||
break;
|
||||
case CGUIString::TextChunk::Tag::TAG_FONT:
|
||||
// TODO Gee: (2004-08-15) Check if Font exists?
|
||||
@@ -306,7 +306,7 @@ void CGUIString::SetValue(const CStrW& str)
|
||||
closing = false;
|
||||
if (++p == l)
|
||||
{
|
||||
LOGERROR("Partial tag at end of string '%ls'", str.c_str());
|
||||
LOGERROR("Partial tag at end of string '%s'", str.c_str());
|
||||
break;
|
||||
}
|
||||
if (str[p] == L'/')
|
||||
@@ -314,12 +314,12 @@ void CGUIString::SetValue(const CStrW& str)
|
||||
closing = true;
|
||||
if (tags.empty())
|
||||
{
|
||||
LOGERROR("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 '%s'", p, str.c_str());
|
||||
break;
|
||||
}
|
||||
if (++p == l)
|
||||
{
|
||||
LOGERROR("Partial closing tag at end of string '%ls'", str.c_str());
|
||||
LOGERROR("Partial closing tag at end of string '%s'", 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("Closing tags do not support parameters (at pos %d '%ls')", p, str.c_str());
|
||||
LOGERROR("Closing tags do not support parameters (at pos %d '%s')", 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("Parameter without value at pos %d '%ls'", p, str.c_str());
|
||||
LOGERROR("Parameter without value at pos %d '%s'", 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("Closing tags do not support parameters (at pos %d '%ls')", p, str.c_str());
|
||||
LOGERROR("Closing tags do not support parameters (at pos %d '%s')", p, str.c_str());
|
||||
|
||||
if (++p == l)
|
||||
{
|
||||
LOGERROR("Expected parameter, got end of string '%ls'", str.c_str());
|
||||
LOGERROR("Expected parameter, got end of string '%s'", str.c_str());
|
||||
break;
|
||||
}
|
||||
if (str[p] != L'"')
|
||||
{
|
||||
LOGERROR("Unquoted parameters are not supported (at pos %d '%ls')", p, str.c_str());
|
||||
LOGERROR("Unquoted parameters are not supported (at pos %d '%s')", 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("Escape character at end of string '%ls'", str.c_str());
|
||||
LOGERROR("Escape character at end of string '%s'", 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("Invalid tag '%ls' at %d in '%ls'", tag.c_str(), p, str.c_str());
|
||||
LOGERROR("Invalid tag '%s' at %d in '%s'", 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("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 '%s' does not match last opened tag '%s' at %d in '%s'", 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("Escape character at end of string '%ls'", str.c_str());
|
||||
LOGERROR("Escape character at end of string '%s'", str.c_str());
|
||||
break;
|
||||
}
|
||||
if (str[p] == L'n')
|
||||
|
||||
+11
-11
@@ -69,20 +69,20 @@ bool __ParseString<CRect>(const CStrW& Value, CRect &Output)
|
||||
{
|
||||
if (stream.eof())
|
||||
{
|
||||
LOGWARNING("Too few CRect parameters (min %i). Your input: '%hs'", NUM_COORDS, Value.ToUTF8().c_str());
|
||||
LOGWARNING("Too few CRect parameters (min %i). Your input: '%s'", NUM_COORDS, Value.ToUTF8().c_str());
|
||||
return false;
|
||||
}
|
||||
stream >> coords[i];
|
||||
if ((stream.rdstate() & std::wstringstream::failbit) != 0)
|
||||
{
|
||||
LOGWARNING("Unable to parse CRect parameters. Your input: '%hs'", Value.ToUTF8().c_str());
|
||||
LOGWARNING("Unable to parse CRect parameters. Your input: '%s'", Value.ToUTF8().c_str());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (!stream.eof())
|
||||
{
|
||||
LOGWARNING("Too many CRect parameters (max %i). Your input: '%hs'", NUM_COORDS, Value.ToUTF8().c_str());
|
||||
LOGWARNING("Too many CRect parameters (max %i). Your input: '%s'", NUM_COORDS, Value.ToUTF8().c_str());
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -134,13 +134,13 @@ bool __ParseString<CSize>(const CStrW& Value, CSize &Output)
|
||||
{
|
||||
if (stream.eof())
|
||||
{
|
||||
LOGWARNING("Too few CSize parameters (min %i). Your input: '%hs'", NUM_COORDS, Value.ToUTF8().c_str());
|
||||
LOGWARNING("Too few CSize parameters (min %i). Your input: '%s'", NUM_COORDS, Value.ToUTF8().c_str());
|
||||
return false;
|
||||
}
|
||||
stream >> coords[i];
|
||||
if ((stream.rdstate() & std::wstringstream::failbit) != 0)
|
||||
{
|
||||
LOGWARNING("Unable to parse CSize parameters. Your input: '%hs'", Value.ToUTF8().c_str());
|
||||
LOGWARNING("Unable to parse CSize parameters. Your input: '%s'", Value.ToUTF8().c_str());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -150,7 +150,7 @@ bool __ParseString<CSize>(const CStrW& Value, CSize &Output)
|
||||
|
||||
if (!stream.eof())
|
||||
{
|
||||
LOGWARNING("Too many CSize parameters (max %i). Your input: '%hs'", NUM_COORDS, Value.ToUTF8().c_str());
|
||||
LOGWARNING("Too many CSize parameters (max %i). Your input: '%s'", NUM_COORDS, Value.ToUTF8().c_str());
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -169,13 +169,13 @@ bool __ParseString<CPos>(const CStrW& Value, CPos &Output)
|
||||
{
|
||||
if (stream.eof())
|
||||
{
|
||||
LOGWARNING("Too few CPos parameters (min %i). Your input: '%hs'", NUM_COORDS, Value.ToUTF8().c_str());
|
||||
LOGWARNING("Too few CPos parameters (min %i). Your input: '%s'", NUM_COORDS, Value.ToUTF8().c_str());
|
||||
return false;
|
||||
}
|
||||
stream >> coords[i];
|
||||
if ((stream.rdstate() & std::wstringstream::failbit) != 0)
|
||||
{
|
||||
LOGWARNING("Unable to parse CPos parameters. Your input: '%hs'", Value.ToUTF8().c_str());
|
||||
LOGWARNING("Unable to parse CPos parameters. Your input: '%s'", Value.ToUTF8().c_str());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -185,7 +185,7 @@ bool __ParseString<CPos>(const CStrW& Value, CPos &Output)
|
||||
|
||||
if (!stream.eof())
|
||||
{
|
||||
LOGWARNING("Too many CPos parameters (max %i). Your input: '%hs'", NUM_COORDS, Value.ToUTF8().c_str());
|
||||
LOGWARNING("Too many CPos parameters (max %i). Your input: '%s'", NUM_COORDS, Value.ToUTF8().c_str());
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -339,7 +339,7 @@ PSRETURN GUI<T>::GetSettingPointer(const IGUIObject *pObject, const CStr& Settin
|
||||
std::map<CStr, SGUISetting>::const_iterator it = pObject->m_Settings.find(Setting);
|
||||
if (it == pObject->m_Settings.end())
|
||||
{
|
||||
LOGWARNING("setting %hs was not found on object %hs",
|
||||
LOGWARNING("setting %s was not found on object %s",
|
||||
Setting.c_str(),
|
||||
pObject->GetPresentableName().c_str());
|
||||
return PSRETURN_GUI_InvalidSetting;
|
||||
@@ -388,7 +388,7 @@ PSRETURN GUI<T>::SetSetting(IGUIObject *pObject, const CStr& Setting,
|
||||
|
||||
if (!pObject->SettingExists(Setting))
|
||||
{
|
||||
LOGWARNING("setting %hs was not found on object %hs",
|
||||
LOGWARNING("setting %s was not found on object %s",
|
||||
Setting.c_str(),
|
||||
pObject->GetPresentableName().c_str());
|
||||
return PSRETURN_GUI_InvalidSetting;
|
||||
|
||||
@@ -561,7 +561,7 @@ bool IGUIObject::IsRootObject() const
|
||||
|
||||
PSRETURN IGUIObject::LogInvalidSettings(const CStr8 &Setting) const
|
||||
{
|
||||
LOGWARNING("IGUIObject: setting %hs was not found on an object",
|
||||
LOGWARNING("IGUIObject: setting %s was not found on an object",
|
||||
Setting.c_str());
|
||||
return PSRETURN_GUI_InvalidSetting;
|
||||
}
|
||||
|
||||
@@ -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("Terrain mipmap written to '%ls'", realPath.string8());
|
||||
LOGMESSAGERENDER("Terrain mipmap written to '%s'", realPath.string8());
|
||||
}
|
||||
|
||||
void EnableTimeWarpRecording(ScriptInterface::CxPrivate* UNUSED(pCxPrivate), unsigned int numTurns)
|
||||
|
||||
@@ -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("Error creating SimpleDateFormat: %hs", u_errorName(status));
|
||||
LOGERROR("Error creating SimpleDateFormat: %s", u_errorName(status));
|
||||
|
||||
const TimeZone* timeZone = TimeZone::getGMT();
|
||||
|
||||
status = U_ZERO_ERROR;
|
||||
Calendar* calendar = Calendar::createInstance(*timeZone, currentLocale, status);
|
||||
if (U_FAILURE(status))
|
||||
LOGERROR("Error creating calendar: %hs", u_errorName(status));
|
||||
LOGERROR("Error creating calendar: %s", 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("Hotloading translations from '%ls'", path.string8());
|
||||
LOGMESSAGE("Hotloading translations from '%s'", path.string8());
|
||||
|
||||
CVFSFile file;
|
||||
if (file.Load(g_VFS, path) != PSRETURN_OK)
|
||||
{
|
||||
LOGERROR("Failed to read translations from '%ls'", path.string8());
|
||||
LOGERROR("Failed to read translations from '%s'", path.string8());
|
||||
return ERR::FAIL;
|
||||
}
|
||||
|
||||
@@ -569,7 +569,7 @@ void L10n::ReadPoIntoDictionary(const std::string& poContent, tinygettext::Dicti
|
||||
}
|
||||
catch(std::exception& e)
|
||||
{
|
||||
LOGERROR("[Localization] Exception while reading virtual PO file: %hs", e.what());
|
||||
LOGERROR("[Localization] Exception while reading virtual PO file: %s", e.what());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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("unknown subtype '%hs'", tag.c_str());
|
||||
LOGMESSAGE("unknown subtype '%s'", 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("Unknown presence '%hs'", presence.c_str());
|
||||
else LOGERROR("Unknown presence '%s'", presence.c_str());
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -428,7 +428,7 @@ bool CNetClient::OnAuthenticate(void* context, CFsmEvent* event)
|
||||
|
||||
CAuthenticateResultMessage* message = (CAuthenticateResultMessage*)event->GetParamRef();
|
||||
|
||||
LOGMESSAGE("Net: Authentication result: host=%u, %ls", message->m_HostID, message->m_Message.c_str());
|
||||
LOGMESSAGE("Net: Authentication result: host=%u, %s", message->m_HostID, message->m_Message.c_str());
|
||||
|
||||
bool isRejoining = (message->m_Code == ARC_OK_REJOINING);
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@ bool CNetHost::SendMessage(const CNetMessage* message, ENetPeer* peer, const cha
|
||||
if (!packet)
|
||||
return false;
|
||||
|
||||
LOGMESSAGE("Net: Sending message %hs of size %lu to %hs", message->ToString().c_str(), (unsigned long)packet->dataLength, peerName);
|
||||
LOGMESSAGE("Net: Sending message %s of size %lu to %s", 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)
|
||||
|
||||
@@ -224,7 +224,7 @@ void* CNetServerWorker::SetupUPnP(void*)
|
||||
std::string rootDescURL;
|
||||
CFG_GET_VAL("network.upnprootdescurl", rootDescURL);
|
||||
if (!rootDescURL.empty())
|
||||
LOGMESSAGE("Net server: attempting to use cached root descriptor URL: %hs", rootDescURL.c_str());
|
||||
LOGMESSAGE("Net server: attempting to use cached root descriptor URL: %s", 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("Net server: using cached IGD = %hs", urls.controlURL);
|
||||
LOGMESSAGE("Net server: using cached IGD = %s", urls.controlURL);
|
||||
ret = 1;
|
||||
}
|
||||
// No cached URL, or it did not respond. Try getting a valid UPnP device for 10 seconds.
|
||||
@@ -253,13 +253,13 @@ void* CNetServerWorker::SetupUPnP(void*)
|
||||
LOGMESSAGE("Net server: No IGD found");
|
||||
break;
|
||||
case 1:
|
||||
LOGMESSAGE("Net server: found valid IGD = %hs", urls.controlURL);
|
||||
LOGMESSAGE("Net server: found valid IGD = %s", urls.controlURL);
|
||||
break;
|
||||
case 2:
|
||||
LOGMESSAGE("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 = %s, will try to continue anyway", urls.controlURL);
|
||||
break;
|
||||
case 3:
|
||||
LOGMESSAGE("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 = %s, 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("Net server: GetExternalIPAddress failed with code %d (%hs)", ret, strupnperror(ret));
|
||||
LOGMESSAGE("Net server: GetExternalIPAddress failed with code %d (%s)", ret, strupnperror(ret));
|
||||
return NULL;
|
||||
}
|
||||
LOGMESSAGE("Net server: ExternalIPAddress = %hs", externalIPAddress);
|
||||
LOGMESSAGE("Net server: ExternalIPAddress = %s", 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("Net server: AddPortMapping(%hs, %hs, %hs) failed with code %d (%hs)",
|
||||
LOGMESSAGE("Net server: AddPortMapping(%s, %s, %s) failed with code %d (%s)",
|
||||
psPort, psPort, internalIPAddress, ret, strupnperror(ret));
|
||||
return NULL;
|
||||
}
|
||||
@@ -296,17 +296,17 @@ void* CNetServerWorker::SetupUPnP(void*)
|
||||
|
||||
if (ret != UPNPCOMMAND_SUCCESS)
|
||||
{
|
||||
LOGMESSAGE("Net server: GetSpecificPortMappingEntry() failed with code %d (%hs)", ret, strupnperror(ret));
|
||||
LOGMESSAGE("Net server: GetSpecificPortMappingEntry() failed with code %d (%s)", ret, strupnperror(ret));
|
||||
return NULL;
|
||||
}
|
||||
|
||||
LOGMESSAGE("Net server: External %hs:%hs %hs is redirected to internal %hs:%hs (duration=%hs)",
|
||||
LOGMESSAGE("Net server: External %s:%s %s is redirected to internal %s:%s (duration=%s)",
|
||||
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("Net server: cached UPnP root descriptor URL as %hs", urls.controlURL);
|
||||
LOGMESSAGE("Net server: cached UPnP root descriptor URL as %s", urls.controlURL);
|
||||
|
||||
// Make sure everything is properly freed.
|
||||
if (allocatedUrls)
|
||||
@@ -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("Net server: Received connection from %hs:%u", hostname, (unsigned int)event.peer->address.port);
|
||||
LOGMESSAGE("Net server: Received connection from %s:%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<CNetServerSession*>(event.peer->data);
|
||||
if (session)
|
||||
{
|
||||
LOGMESSAGE("Net server: Disconnected %hs", DebugName(session).c_str());
|
||||
LOGMESSAGE("Net server: Disconnected %s", 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("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 %s of size %lu from %s", msg->ToString().c_str(), (unsigned long)msg->GetSerializedLength(), DebugName(session).c_str());
|
||||
|
||||
HandleMessageReceive(msg, 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("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 \"%s\"", username.c_str());
|
||||
session->Disconnect(NDR_SERVER_ALREADY_IN_GAME);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -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("Net client: Connected to %hs:%u", hostname, (unsigned int)event.peer->address.port);
|
||||
LOGMESSAGE("Net client: Connected to %s:%u", hostname, (unsigned int)event.peer->address.port);
|
||||
|
||||
m_Client.HandleConnect();
|
||||
|
||||
@@ -133,7 +133,7 @@ void CNetClientSession::Poll()
|
||||
CNetMessage* msg = CNetMessageFactory::CreateMessage(event.packet->data, event.packet->dataLength, m_Client.GetScriptInterface());
|
||||
if (msg)
|
||||
{
|
||||
LOGMESSAGE("Net client: Received message %hs of size %lu from server", msg->ToString().c_str(), (unsigned long)msg->GetSerializedLength());
|
||||
LOGMESSAGE("Net client: Received message %s of size %lu from server", msg->ToString().c_str(), (unsigned long)msg->GetSerializedLength());
|
||||
|
||||
m_Client.HandleMessage(msg);
|
||||
|
||||
|
||||
@@ -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("%ls", msg.str().c_str());
|
||||
LOGERROR("%s", msg.str().c_str());
|
||||
}
|
||||
|
||||
void CNetTurnManager::Interpolate(float simFrameLength, float realFrameLength)
|
||||
|
||||
@@ -30,7 +30,7 @@ public:
|
||||
CStrInternInternals(const char* str, size_t len)
|
||||
: data(str, str+len), hash(fnv_hash(str, len))
|
||||
{
|
||||
// LOGWARNING("New interned string '%hs'", data.c_str());
|
||||
// LOGWARNING("New interned string '%s'", data.c_str());
|
||||
}
|
||||
|
||||
bool operator==(const CStrInternInternals& b) const
|
||||
|
||||
+13
-13
@@ -214,15 +214,15 @@ bool CConfigDB::Reload(EConfigNamespace ns)
|
||||
// Handle missing files quietly
|
||||
if (g_VFS->GetFileInfo(m_ConfigFile[ns], NULL) < 0)
|
||||
{
|
||||
LOGMESSAGE("Cannot find config file \"%ls\" - ignoring", m_ConfigFile[ns].string8());
|
||||
LOGMESSAGE("Cannot find config file \"%s\" - ignoring", m_ConfigFile[ns].string8());
|
||||
return false;
|
||||
}
|
||||
|
||||
LOGMESSAGE("Loading config file \"%ls\"", m_ConfigFile[ns].string8());
|
||||
LOGMESSAGE("Loading config file \"%s\"", m_ConfigFile[ns].string8());
|
||||
Status ret = g_VFS->LoadFile(m_ConfigFile[ns], buffer, buflen);
|
||||
if (ret != INFO::OK)
|
||||
{
|
||||
LOGERROR("CConfigDB::Reload(): vfs_load for \"%ls\" failed: return was %lld", m_ConfigFile[ns].string8(), (long long)ret);
|
||||
LOGERROR("CConfigDB::Reload(): vfs_load for \"%s\" failed: return was %lld", m_ConfigFile[ns].string8(), (long long)ret);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -256,18 +256,18 @@ bool CConfigDB::Reload(EConfigNamespace ns)
|
||||
|
||||
if (pos == filebufend || *pos == '\n')
|
||||
{
|
||||
LOGERROR("Config header with missing close tag encountered on line %d in '%ls'", line, m_ConfigFile[ns].string8());
|
||||
LOGERROR("Config header with missing close tag encountered on line %d in '%s'", line, m_ConfigFile[ns].string8());
|
||||
header.clear();
|
||||
++line;
|
||||
continue;
|
||||
}
|
||||
|
||||
LOGMESSAGE("Found config header '%hs'", header.c_str());
|
||||
LOGMESSAGE("Found config header '%s'", header.c_str());
|
||||
header.push_back('.');
|
||||
while (++pos < filebufend && *pos != '\n' && *pos != ';')
|
||||
if (*pos != ' ' && *pos != '\r')
|
||||
{
|
||||
LOGERROR("Config settings on the same line as a header on line %d in '%ls'", line, m_ConfigFile[ns].string8());
|
||||
LOGERROR("Config settings on the same line as a header on line %d in '%s'", line, m_ConfigFile[ns].string8());
|
||||
break;
|
||||
}
|
||||
while (pos < filebufend && *pos != '\n')
|
||||
@@ -288,7 +288,7 @@ bool CConfigDB::Reload(EConfigNamespace ns)
|
||||
{
|
||||
if (*pos == '\\' && ++pos == filebufend)
|
||||
{
|
||||
LOGERROR("Escape character at end of input (line %d in '%ls')", line, m_ConfigFile[ns].string8());
|
||||
LOGERROR("Escape character at end of input (line %d in '%s')", line, m_ConfigFile[ns].string8());
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -316,7 +316,7 @@ bool CConfigDB::Reload(EConfigNamespace ns)
|
||||
}
|
||||
}
|
||||
if (quoted) // We ignore the invalid parameter
|
||||
LOGERROR("Unmatched quote while parsing config file '%ls' on line %d", m_ConfigFile[ns].string8(), line);
|
||||
LOGERROR("Unmatched quote while parsing config file '%s' on line %d", m_ConfigFile[ns].string8(), 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("Loaded config string \"%hs\"", key.c_str());
|
||||
LOGMESSAGE("Loaded config string \"%s\"", 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("Loaded config string \"%hs\" = %hs", key.c_str(), vals.c_str());
|
||||
LOGMESSAGE("Loaded config string \"%s\" = %s", key.c_str(), vals.c_str());
|
||||
}
|
||||
}
|
||||
else if (!name.empty())
|
||||
LOGERROR("Encountered config setting '%hs' without value while parsing '%ls' on line %d", name.c_str(), m_ConfigFile[ns].string8(), line);
|
||||
LOGERROR("Encountered config setting '%s' without value while parsing '%s' on line %d", name.c_str(), m_ConfigFile[ns].string8(), line);
|
||||
|
||||
name.clear();
|
||||
values.clear();
|
||||
@@ -356,7 +356,7 @@ bool CConfigDB::Reload(EConfigNamespace ns)
|
||||
}
|
||||
|
||||
if (!name.empty())
|
||||
LOGERROR("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 '%s'", 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("CConfigDB::WriteFile(): CreateFile \"%ls\" failed (error: %d)", path.string8(), (int)ret);
|
||||
LOGERROR("CConfigDB::WriteFile(): CreateFile \"%s\" failed (error: %d)", path.string8(), (int)ret);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -196,13 +196,13 @@ void DllLoader::LogLoadError(const char* errors)
|
||||
switch (m_LoadErrorLogMethod)
|
||||
{
|
||||
case CLogger::Normal:
|
||||
LOGMESSAGE("DllLoader: %hs", errors);
|
||||
LOGMESSAGE("DllLoader: %s", errors);
|
||||
break;
|
||||
case CLogger::Warning:
|
||||
LOGWARNING("DllLoader: %hs", errors);
|
||||
LOGWARNING("DllLoader: %s", errors);
|
||||
break;
|
||||
case CLogger::Error:
|
||||
LOGERROR("DllLoader: %hs", errors);
|
||||
LOGERROR("DllLoader: %s", errors);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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("Failed to write file '%ls' with status '%lld'", filename.string8(), (long long)st);
|
||||
LOGERROR("Failed to write file '%s' with status '%lld'", filename.string8(), (long long)st);
|
||||
throw PSERROR_File_WriteFailed();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -124,7 +124,7 @@ PSRETURN CVFSFile::Load(const PIVFS& vfs, const VfsPath& filename, bool log /* =
|
||||
if (ret != INFO::OK)
|
||||
{
|
||||
if (log)
|
||||
LOGERROR("CVFSFile: file %ls couldn't be opened (vfs_load: %lld)", filename.string8(), (long long)ret);
|
||||
LOGERROR("CVFSFile: file %s couldn't be opened (vfs_load: %lld)", filename.string8(), (long long)ret);
|
||||
m_Buffer.reset();
|
||||
m_BufferSize = 0;
|
||||
return PSRETURN_CVFSFile_LoadFailed;
|
||||
|
||||
@@ -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("Failed to draw cursor '%ls'", cursorName.c_str());
|
||||
LOGWARNING("Failed to draw cursor '%s'", 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("SDL library initialization failed: %hs", SDL_GetError());
|
||||
LOGERROR("SDL library initialization failed: %s", SDL_GetError());
|
||||
throw PSERROR_System_SDLInitFailed();
|
||||
}
|
||||
atexit(SDL_Quit);
|
||||
@@ -819,16 +819,16 @@ static void FixLocales()
|
||||
for (size_t i = 0; i < ARRAY_SIZE(LocaleEnvVars); i++)
|
||||
{
|
||||
if (char* envval = getenv(LocaleEnvVars[i]))
|
||||
LOGWARNING(" %hs=\"%hs\"", LocaleEnvVars[i], envval);
|
||||
LOGWARNING(" %s=\"%s\"", LocaleEnvVars[i], envval);
|
||||
else
|
||||
LOGWARNING(" %hs=\"(unset)\"", LocaleEnvVars[i]);
|
||||
LOGWARNING(" %s=\"(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("Setting LC_ALL env variable to: %hs", getenv("LC_ALL"));
|
||||
LOGWARNING("Setting LC_ALL env variable to: %s", getenv("LC_ALL"));
|
||||
}
|
||||
}
|
||||
#else
|
||||
@@ -1132,7 +1132,7 @@ CStr8 LoadSettingsOfScenarioMap(const VfsPath &mapPath)
|
||||
|
||||
if (INFO::OK != loadResult)
|
||||
{
|
||||
LOGERROR("LoadSettingsOfScenarioMap: Unable to load map file '%ls'", mapPath.string8());
|
||||
LOGERROR("LoadSettingsOfScenarioMap: Unable to load map file '%s'", mapPath.string8());
|
||||
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("Autostart: Error reading random map script '%ls'", scriptPath.c_str());
|
||||
LOGERROR("Autostart: Error reading random map script '%s'", 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("Autostart: Unrecognized map type '%ls'", mapDirectory.c_str());
|
||||
LOGERROR("Autostart: Unrecognized map type '%s'", mapDirectory.c_str());
|
||||
throw PSERROR_Game_World_MapLoadFailed("Unrecognized map type.\nConsult readme.txt for the currently supported types.");
|
||||
}
|
||||
scriptInterface.SetProperty(attrs, "mapType", mapType);
|
||||
|
||||
@@ -172,7 +172,7 @@ Paths::Paths(const CmdLineArgs& args)
|
||||
// make sure it's valid
|
||||
if(!FileExists(pathname))
|
||||
{
|
||||
LOGERROR("Cannot find executable (expected at '%ls')", pathname.string8());
|
||||
LOGERROR("Cannot find executable (expected at '%s')", pathname.string8());
|
||||
WARN_IF_ERR(StatusFromErrno());
|
||||
}
|
||||
|
||||
|
||||
@@ -83,7 +83,7 @@ static void LoadConfigBindings()
|
||||
int mapping = FindKeyCode(*it);
|
||||
if (!mapping)
|
||||
{
|
||||
LOGWARNING("Hotkey mapping used invalid key '%hs'", hotkey.c_str());
|
||||
LOGWARNING("Hotkey mapping used invalid key '%s'", hotkey.c_str());
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
@@ -41,7 +41,7 @@ void CJoystick::Initialise()
|
||||
|
||||
if (SDL_InitSubSystem(SDL_INIT_JOYSTICK) < 0)
|
||||
{
|
||||
LOGERROR("CJoystick::Initialise failed to initialise joysticks (\"%hs\")", SDL_GetError());
|
||||
LOGERROR("CJoystick::Initialise failed to initialise joysticks (\"%s\")", SDL_GetError());
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -55,14 +55,14 @@ void CJoystick::Initialise()
|
||||
SDL_Joystick* stick = SDL_JoystickOpen(i);
|
||||
if (!stick)
|
||||
{
|
||||
LOGERROR("CJoystick::Initialise failed to open joystick %d (\"%hs\")", i, SDL_GetError());
|
||||
LOGERROR("CJoystick::Initialise failed to open joystick %d (\"%s\")", i, SDL_GetError());
|
||||
continue;
|
||||
}
|
||||
const char* name = SDL_JoystickName(stick);
|
||||
#else // SDL 1.2
|
||||
const char* name = SDL_JoystickName(i);
|
||||
#endif
|
||||
LOGMESSAGE("Joystick %d: %hs", i, name);
|
||||
LOGMESSAGE("Joystick %d: %s", 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("CJoystick::Initialise failed to open joystick (\"%hs\")", SDL_GetError());
|
||||
LOGERROR("CJoystick::Initialise failed to open joystick (\"%s\")", SDL_GetError());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -48,24 +48,24 @@ bool CColor::ParseString(const CStr8& Value, int DefaultAlpha)
|
||||
stream >> values[i];
|
||||
if ((stream.rdstate() & std::stringstream::failbit) != 0)
|
||||
{
|
||||
LOGWARNING("Unable to parse CColor parameters. Your input: '%hs'", Value.c_str());
|
||||
LOGWARNING("Unable to parse CColor parameters. Your input: '%s'", Value.c_str());
|
||||
return false;
|
||||
}
|
||||
if (values[i] < 0 || values[i] > 255)
|
||||
{
|
||||
LOGWARNING("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: '%s'", Value.c_str());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (i < 3)
|
||||
{
|
||||
LOGWARNING("Not enough parameters when parsing as CColor. Your input: '%hs'", Value.c_str());
|
||||
LOGWARNING("Not enough parameters when parsing as CColor. Your input: '%s'", Value.c_str());
|
||||
return false;
|
||||
}
|
||||
if (!stream.eof())
|
||||
{
|
||||
LOGWARNING("Too many parameters when parsing as CColor. Your input: '%hs'", Value.c_str());
|
||||
LOGWARNING("Too many parameters when parsing as CColor. Your input: '%s'", Value.c_str());
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -231,10 +231,10 @@ static void DefaultError (void *iData, int iLine, const char *iError,
|
||||
{
|
||||
(void)iData;
|
||||
if (iToken)
|
||||
LOGERROR("Preprocessor error: line %d: %hs: '%.*hs'\n",
|
||||
LOGERROR("Preprocessor error: line %d: %s: '%.*hs'\n",
|
||||
iLine, iError, int (iTokenLen), iToken);
|
||||
else
|
||||
LOGERROR("Preprocessor error: line %d: %hs\n", iLine, iError);
|
||||
LOGERROR("Preprocessor error: line %d: %s\n", iLine, iError);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------//
|
||||
|
||||
@@ -51,7 +51,7 @@ bool CPreprocessorWrapper::TestConditional(const CStr& expr)
|
||||
|
||||
if (!output)
|
||||
{
|
||||
LOGERROR("Failed to parse conditional expression '%hs'", expr.c_str());
|
||||
LOGERROR("Failed to parse conditional expression '%s'", expr.c_str());
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -575,7 +575,7 @@ void CProfileViewer::SaveToFile()
|
||||
}
|
||||
else
|
||||
{
|
||||
LOGMESSAGERENDER("Profiler snapshot saved to '%ls'", path.string8());
|
||||
LOGMESSAGERENDER("Profiler snapshot saved to '%s'", path.string8());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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("Mongoose error: %hs", request_info->log_message);
|
||||
LOGERROR("Mongoose error: %s", request_info->log_message);
|
||||
return NULL;
|
||||
|
||||
case MG_INIT_SSL:
|
||||
|
||||
@@ -126,7 +126,7 @@ Status SavedGames::Save(const std::wstring& name, const std::wstring& descriptio
|
||||
|
||||
OsPath realPath;
|
||||
WARN_RETURN_STATUS_IF_ERR(g_VFS->GetRealPath(filename, realPath));
|
||||
LOGMESSAGERENDER(g_L10n.Translate("Saved game to '%ls'"), realPath.string8());
|
||||
LOGMESSAGERENDER(g_L10n.Translate("Saved game to '%s'"), realPath.string8());
|
||||
|
||||
return INFO::OK;
|
||||
}
|
||||
@@ -244,7 +244,7 @@ std::vector<CScriptValRooted> SavedGames::GetSavedGames(ScriptInterface& scriptI
|
||||
if (!archiveReader)
|
||||
{
|
||||
// Triggered by e.g. the file being open in another program
|
||||
LOGWARNING("Failed to read saved game '%ls'", realPath.string8());
|
||||
LOGWARNING("Failed to read saved game '%s'", realPath.string8());
|
||||
continue; // skip this file
|
||||
}
|
||||
|
||||
|
||||
@@ -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("Probable infinite inheritance loop in entity template '%hs'", templateName.c_str());
|
||||
LOGERROR("Probable infinite inheritance loop in entity template '%s'", 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("Failed to load entity template '%hs'", baseName.c_str());
|
||||
LOGERROR("Failed to load entity template '%s'", 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("Failed to load entity template '%hs'", baseName.c_str());
|
||||
LOGERROR("Failed to load entity template '%s'", 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("Failed to load entity template '%hs'", baseName.c_str());
|
||||
LOGERROR("Failed to load entity template '%s'", 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("Failed to load entity template '%hs'", baseName.c_str());
|
||||
LOGERROR("Failed to load entity template '%s'", 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("Failed to load entity template '%hs'", baseName.c_str());
|
||||
LOGERROR("Failed to load entity template '%s'", 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("Failed to load entity template '%hs'", baseName.c_str());
|
||||
LOGERROR("Failed to load entity template '%s'", 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("Invalid parent '%hs' in entity template '%hs'", parentName.c_str(), templateName.c_str());
|
||||
LOGERROR("Invalid parent '%s' in entity template '%s'", parentName.c_str(), templateName.c_str());
|
||||
return false;
|
||||
}
|
||||
|
||||
// Ensure the parent is loaded
|
||||
if (!LoadTemplateFile(parentName, depth+1))
|
||||
{
|
||||
LOGERROR("Failed to load parent '%hs' of entity template '%hs'", parentName.c_str(), templateName.c_str());
|
||||
LOGERROR("Failed to load parent '%s' of entity template '%s'", parentName.c_str(), templateName.c_str());
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -314,7 +314,7 @@ const CParamNode& CTemplateLoader::GetTemplateFileData(const std::string& templa
|
||||
// Load the template if necessary
|
||||
if (!LoadTemplateFile(templateName, 0))
|
||||
{
|
||||
LOGERROR("Failed to load entity template '%hs'", templateName.c_str());
|
||||
LOGERROR("Failed to load entity template '%s'", 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("Failed to load entity template '%hs'", templateName);
|
||||
LOGERROR("Failed to load entity template '%s'", templateName);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
+4
-4
@@ -241,10 +241,10 @@ void WriteScreenshot(const VfsPath& extension)
|
||||
{
|
||||
OsPath realPath;
|
||||
g_VFS->GetRealPath(filename, realPath);
|
||||
LOGMESSAGERENDER(g_L10n.Translate("Screenshot written to '%ls'"), realPath.string8());
|
||||
LOGMESSAGERENDER(g_L10n.Translate("Screenshot written to '%s'"), realPath.string8());
|
||||
}
|
||||
else
|
||||
LOGERROR("Error writing screenshot to '%ls'", filename.string8());
|
||||
LOGERROR("Error writing screenshot to '%s'", filename.string8());
|
||||
}
|
||||
|
||||
|
||||
@@ -374,10 +374,10 @@ void WriteBigScreenshot(const VfsPath& extension, int tiles)
|
||||
{
|
||||
OsPath realPath;
|
||||
g_VFS->GetRealPath(filename, realPath);
|
||||
LOGMESSAGERENDER(g_L10n.Translate("Screenshot written to '%ls'"), realPath.string8());
|
||||
LOGMESSAGERENDER(g_L10n.Translate("Screenshot written to '%s'"), realPath.string8());
|
||||
}
|
||||
else
|
||||
LOGERROR("Error writing screenshot to '%ls'", filename.string8());
|
||||
LOGERROR("Error writing screenshot to '%s'", filename.string8());
|
||||
|
||||
free(tile_data);
|
||||
}
|
||||
|
||||
@@ -97,7 +97,7 @@ bool CVideoMode::SetVideoMode(int w, int h, int bpp, bool fullscreen)
|
||||
}
|
||||
else
|
||||
{
|
||||
LOGERROR("SetVideoMode failed in SDL_CreateWindow: %dx%d:%d %d (\"%hs\")",
|
||||
LOGERROR("SetVideoMode failed in SDL_CreateWindow: %dx%d:%d %d (\"%s\")",
|
||||
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("SetVideoMode failed in SDL_SetWindowDisplayMode: %dx%d:%d %d (\"%hs\")",
|
||||
LOGERROR("SetVideoMode failed in SDL_SetWindowDisplayMode: %dx%d:%d %d (\"%s\")",
|
||||
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("SetVideoMode failed in SDL_GL_CreateContext: %dx%d:%d %d (\"%hs\")",
|
||||
LOGERROR("SetVideoMode failed in SDL_GL_CreateContext: %dx%d:%d %d (\"%s\")",
|
||||
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("SetVideoMode failed in SDL_SetWindowFullscreen: %dx%d:%d %d (\"%hs\")",
|
||||
LOGERROR("SetVideoMode failed in SDL_SetWindowFullscreen: %dx%d:%d %d (\"%s\")",
|
||||
w, h, bpp, fullscreen ? 1 : 0, SDL_GetError());
|
||||
return false;
|
||||
}
|
||||
@@ -181,7 +181,7 @@ bool CVideoMode::SetVideoMode(int w, int h, int bpp, bool fullscreen)
|
||||
}
|
||||
else
|
||||
{
|
||||
LOGERROR("SetVideoMode failed: %dx%d:%d %d (\"%hs\")",
|
||||
LOGERROR("SetVideoMode failed: %dx%d:%d %d (\"%s\")",
|
||||
w, h, bpp, fullscreen ? 1 : 0, SDL_GetError());
|
||||
return false;
|
||||
}
|
||||
|
||||
+1
-1
@@ -89,7 +89,7 @@ void CWorld::RegisterInit(const CStrW& mapFile, const CScriptValRooted& settings
|
||||
catch (PSERROR_File& err)
|
||||
{
|
||||
delete reader;
|
||||
LOGERROR("Failed to load map %ls: %hs", mapfilename.string8(), err.what());
|
||||
LOGERROR("Failed to load map %s: %s", mapfilename.string8(), err.what());
|
||||
throw PSERROR_Game_World_MapLoadFailed("Failed to load map.\nCheck application log for details.");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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("Error saving XML data through VFS: %lld '%ls'", (long long)ret, pathname.string8());
|
||||
LOGERROR("Error saving XML data through VFS: %lld '%s'", (long long)ret, pathname.string8());
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
||||
@@ -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("CXeromyces: Parse %ls: %hs:%d: %hs",
|
||||
LOGERROR("CXeromyces: Parse %s: %s:%d: %s",
|
||||
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("CCacheLoader failed to find archived or source file for: \"%ls\"", filename.string8());
|
||||
LOGERROR("CCacheLoader failed to find archived or source file for: \"%s\"", filename.string8());
|
||||
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("CXeromyces: Failed to open XML file %ls", filename.string8());
|
||||
LOGERROR("CXeromyces: Failed to open XML file %s", filename.string8());
|
||||
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("CXeromyces: Failed to parse XML file %ls", filename.string8());
|
||||
LOGERROR("CXeromyces: Failed to parse XML file %s", filename.string8());
|
||||
return PSRETURN_Xeromyces_XMLParseError;
|
||||
}
|
||||
|
||||
|
||||
@@ -98,7 +98,7 @@ void CDecalRData::RenderDecals(std::vector<CDecalRData*>& decals, const CShaderD
|
||||
|
||||
if (!techBase)
|
||||
{
|
||||
LOGERROR("Terrain renderer failed to load shader effect (%hs)\n",
|
||||
LOGERROR("Terrain renderer failed to load shader effect (%s)\n",
|
||||
material.GetShaderEffect().string().c_str());
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -98,7 +98,7 @@ void ModelRenderer::BuildPositionAndNormals(
|
||||
// some broken situations
|
||||
if (numVertices && vertices[0].m_Blend.m_Bone[0] == 0xff)
|
||||
{
|
||||
LOGERROR("Model %ls is boned with unboned animation", mdef->GetName().string8());
|
||||
LOGERROR("Model %s is boned with unboned animation", mdef->GetName().string8());
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -519,7 +519,7 @@ std::vector<CStrW> CPostprocManager::GetPostEffects()
|
||||
|
||||
VfsPaths pathnames;
|
||||
if(vfs::GetPathnames(g_VFS, path, 0, pathnames) < 0)
|
||||
LOGERROR("Error finding Post effects in '%ls'", path.string8());
|
||||
LOGERROR("Error finding Post effects in '%s'", path.string8());
|
||||
|
||||
for(size_t i = 0; i < pathnames.size(); i++)
|
||||
{
|
||||
|
||||
@@ -843,7 +843,7 @@ CRenderer::RenderPath CRenderer::GetRenderPathByName(const CStr& name)
|
||||
if (name == "default")
|
||||
return RP_DEFAULT;
|
||||
|
||||
LOGWARNING("Unknown render path name '%hs', assuming 'default'", name.c_str());
|
||||
LOGWARNING("Unknown render path name '%s', assuming 'default'", name.c_str());
|
||||
return RP_DEFAULT;
|
||||
}
|
||||
|
||||
|
||||
@@ -406,7 +406,7 @@ void ShadowMapInternals::CreateTexture()
|
||||
default: formatname = "DEPTH_COMPONENT"; break;
|
||||
}
|
||||
|
||||
LOGMESSAGE("Creating shadow texture (size %dx%d) (format = %hs)",
|
||||
LOGMESSAGE("Creating shadow texture (size %dx%d) (format = %s)",
|
||||
Width, Height, formatname);
|
||||
|
||||
|
||||
|
||||
@@ -207,7 +207,7 @@ std::vector<CStrW> SkyManager::GetSkySets() const
|
||||
DirectoryNames subdirectories;
|
||||
if(g_VFS->GetDirectoryEntries(path, 0, &subdirectories) < 0)
|
||||
{
|
||||
LOGERROR("Error opening directory '%ls'", path.string8());
|
||||
LOGERROR("Error opening directory '%s'", path.string8());
|
||||
return std::vector<CStrW>(1, GetSkySet()); // just return what we currently have
|
||||
}
|
||||
|
||||
|
||||
@@ -396,7 +396,7 @@ void* CDebuggingServer::MgDebuggingServerCallback(mg_event event, struct mg_conn
|
||||
|
||||
case MG_EVENT_LOG:
|
||||
// Called by Mongoose's cry()
|
||||
LOGERROR("Mongoose error: %hs", request_info->log_message);
|
||||
LOGERROR("Mongoose error: %s", request_info->log_message);
|
||||
return NULL;
|
||||
|
||||
case MG_INIT_SSL:
|
||||
|
||||
@@ -126,9 +126,9 @@ void ErrorReporter(JSContext* cx, const char* message, JSErrorReport* report)
|
||||
}
|
||||
|
||||
if (isWarning)
|
||||
LOGWARNING("%hs", msg.str().c_str());
|
||||
LOGWARNING("%s", msg.str().c_str());
|
||||
else
|
||||
LOGERROR("%hs", msg.str().c_str());
|
||||
LOGERROR("%s", 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("%ls", str.c_str());
|
||||
LOGMESSAGE("%s", 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("%ls", str.c_str());
|
||||
LOGWARNING("%s", 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("%ls", str.c_str());
|
||||
LOGERROR("%s", str.c_str());
|
||||
args.rval().setUndefined();
|
||||
return JS_TRUE;
|
||||
}
|
||||
@@ -478,7 +478,7 @@ bool ScriptInterface::LoadGlobalScripts()
|
||||
{
|
||||
if (!LoadGlobalScriptFile(*it))
|
||||
{
|
||||
LOGERROR("LoadGlobalScripts: Failed to load script %ls", it->string8());
|
||||
LOGERROR("LoadGlobalScripts: Failed to load script %s", it->string8());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -866,7 +866,7 @@ bool ScriptInterface::LoadGlobalScriptFile(const VfsPath& path)
|
||||
JSAutoRequest rq(m->m_cx);
|
||||
if (!VfsFileExists(path))
|
||||
{
|
||||
LOGERROR("File '%ls' does not exist", path.string8());
|
||||
LOGERROR("File '%s' does not exist", path.string8());
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -876,7 +876,7 @@ bool ScriptInterface::LoadGlobalScriptFile(const VfsPath& path)
|
||||
|
||||
if (ret != PSRETURN_OK)
|
||||
{
|
||||
LOGERROR("Failed to load file '%ls': %hs", path.string8(), GetErrorString(ret));
|
||||
LOGERROR("Failed to load file '%s': %s", path.string8(), GetErrorString(ret));
|
||||
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("%ls", error.c_str());
|
||||
LOGERROR("%s", error.c_str());
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -954,7 +954,7 @@ void ScriptInterface::ReadJSONFile(const VfsPath& path, JS::MutableHandleValue o
|
||||
{
|
||||
if (!VfsFileExists(path))
|
||||
{
|
||||
LOGERROR("File '%ls' does not exist", path.string8());
|
||||
LOGERROR("File '%s' does not exist", path.string8());
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -964,14 +964,14 @@ void ScriptInterface::ReadJSONFile(const VfsPath& path, JS::MutableHandleValue o
|
||||
|
||||
if (ret != PSRETURN_OK)
|
||||
{
|
||||
LOGERROR("Failed to load file '%ls': %hs", path.string8(), GetErrorString(ret));
|
||||
LOGERROR("Failed to load file '%s': %s", path.string8(), GetErrorString(ret));
|
||||
return;
|
||||
}
|
||||
|
||||
std::string content(file.DecodeUTF8()); // assume it's UTF-8
|
||||
|
||||
if (!ParseJSON(content, out))
|
||||
LOGERROR("Failed to parse '%ls'", path.string8());
|
||||
LOGERROR("Failed to parse '%s'", path.string8());
|
||||
}
|
||||
|
||||
struct Stringifier
|
||||
|
||||
@@ -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("Error: %hs", strExec.c_str());
|
||||
LOGERROR("Error: %s", strExec.c_str());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -187,7 +187,7 @@ bool CSimulation2Impl::LoadScripts(CComponentManager& componentManager, std::set
|
||||
VfsPath filename = *it;
|
||||
if (loadedScripts)
|
||||
loadedScripts->insert(filename);
|
||||
LOGMESSAGE("Loading simulation script '%ls'", filename.string8());
|
||||
LOGMESSAGE("Loading simulation script '%s'", filename.string8());
|
||||
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("Loading trigger script '%hs'", scriptName.c_str());
|
||||
LOGMESSAGE("Loading trigger script '%s'", 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("Reloading simulation script '%ls'", path.string8());
|
||||
LOGMESSAGE("Reloading simulation script '%s'", path.string8());
|
||||
if (!m_ComponentManager.LoadScript(path, true))
|
||||
return ERR::FAIL;
|
||||
|
||||
@@ -828,7 +828,7 @@ static std::vector<std::string> GetJSONData(const VfsPath& path)
|
||||
{
|
||||
// Some error reading directory
|
||||
wchar_t error[200];
|
||||
LOGERROR("Error reading directory '%ls': %ls", path.string8(), StatusDescription(ret, error, ARRAY_SIZE(error)));
|
||||
LOGERROR("Error reading directory '%s': %s", path.string8(), StatusDescription(ret, error, ARRAY_SIZE(error)));
|
||||
return std::vector<std::string>();
|
||||
}
|
||||
|
||||
@@ -840,7 +840,7 @@ static std::vector<std::string> GetJSONData(const VfsPath& path)
|
||||
PSRETURN ret = file.Load(g_VFS, *it);
|
||||
if (ret != PSRETURN_OK)
|
||||
{
|
||||
LOGERROR("GetJSONData: Failed to load file '%ls': %hs", path.string8(), GetErrorString(ret));
|
||||
LOGERROR("GetJSONData: Failed to load file '%s': %s", path.string8(), GetErrorString(ret));
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -864,7 +864,7 @@ static std::string ReadJSON(const VfsPath& path)
|
||||
{
|
||||
if (!VfsFileExists(path))
|
||||
{
|
||||
LOGERROR("File '%ls' does not exist", path.string8());
|
||||
LOGERROR("File '%s' does not exist", path.string8());
|
||||
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("Failed to load file '%ls': %hs", path.string8(), GetErrorString(ret));
|
||||
LOGERROR("Failed to load file '%s': %s", path.string8(), GetErrorString(ret));
|
||||
return std::string();
|
||||
}
|
||||
|
||||
|
||||
@@ -104,7 +104,7 @@ private:
|
||||
m_Worker.LoadMetadata(path, &metadata);
|
||||
if (metadata.isUndefined())
|
||||
{
|
||||
LOGERROR("Failed to create AI player: can't find %ls", path.string8());
|
||||
LOGERROR("Failed to create AI player: can't find %s", path.string8());
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -116,7 +116,7 @@ private:
|
||||
JS::RootedValue ctor(cx);
|
||||
if (!m_ScriptInterface->HasProperty(metadata, "moduleName"))
|
||||
{
|
||||
LOGERROR("Failed to create AI player: %ls: missing 'moduleName'", path.string8());
|
||||
LOGERROR("Failed to create AI player: %s: missing 'moduleName'", path.string8());
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -124,13 +124,13 @@ private:
|
||||
if (!m_ScriptInterface->GetProperty(global, moduleName.c_str(), &objectWithConstructor)
|
||||
|| objectWithConstructor.isUndefined())
|
||||
{
|
||||
LOGERROR("Failed to create AI player: %ls: can't find the module that should contain the constructor: '%hs'", path.string8(), moduleName.c_str());
|
||||
LOGERROR("Failed to create AI player: %s: can't find the module that should contain the constructor: '%s'", path.string8(), moduleName.c_str());
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!m_ScriptInterface->GetProperty(metadata, "constructor", constructor))
|
||||
{
|
||||
LOGERROR("Failed to create AI player: %ls: missing 'constructor'", path.string8());
|
||||
LOGERROR("Failed to create AI player: %s: missing 'constructor'", path.string8());
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -138,7 +138,7 @@ private:
|
||||
if (!m_ScriptInterface->GetProperty(objectWithConstructor, constructor.c_str(), &ctor)
|
||||
|| ctor.isNull())
|
||||
{
|
||||
LOGERROR("Failed to create AI player: %ls: can't find constructor '%hs'", path.string8(), constructor.c_str());
|
||||
LOGERROR("Failed to create AI player: %s: can't find constructor '%s'", path.string8(), constructor.c_str());
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -160,7 +160,7 @@ private:
|
||||
|
||||
if (obj.isNull())
|
||||
{
|
||||
LOGERROR("Failed to create AI player: %ls: error calling constructor '%hs'", path.string8(), constructor.c_str());
|
||||
LOGERROR("Failed to create AI player: %s: error calling constructor '%s'", path.string8(), 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("Failed to load AI scripts for module %ls", moduleName.c_str());
|
||||
LOGERROR("Failed to load AI scripts for module %s", moduleName.c_str());
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -269,7 +269,7 @@ public:
|
||||
{
|
||||
if (!m_ScriptInterface->LoadGlobalScriptFile(*it))
|
||||
{
|
||||
LOGERROR("Failed to load script %ls", it->string8());
|
||||
LOGERROR("Failed to load script %s", it->string8());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -391,14 +391,14 @@ public:
|
||||
JS::RootedValue ctor(cx);
|
||||
if (!m_ScriptInterface->GetProperty(global, "API3", &AIModule) || AIModule.isUndefined())
|
||||
{
|
||||
LOGERROR("Failed to create shared AI component: %ls: can't find module '%hs'", path.string8(), "API3");
|
||||
LOGERROR("Failed to create shared AI component: %s: can't find module '%s'", path.string8(), "API3");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!m_ScriptInterface->GetProperty(AIModule, "SharedScript", &ctor)
|
||||
|| ctor.isUndefined())
|
||||
{
|
||||
LOGERROR("Failed to create shared AI component: %ls: can't find constructor '%hs'", path.string8(), "SharedScript");
|
||||
LOGERROR("Failed to create shared AI component: %s: can't find constructor '%s'", path.string8(), "SharedScript");
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -440,7 +440,7 @@ public:
|
||||
|
||||
if (tmpSharedAIObj.isNull())
|
||||
{
|
||||
LOGERROR("Failed to create shared AI component: %ls: error calling constructor '%hs'", path.string8(), "SharedScript");
|
||||
LOGERROR("Failed to create shared AI component: %s: error calling constructor '%s'", path.string8(), "SharedScript");
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -748,7 +748,7 @@ public:
|
||||
std::pair<std::map<JSObject*, std::wstring>::iterator, bool> ret1 = m_SerializablePrototypes.insert(std::make_pair(obj, name));
|
||||
std::pair<std::map<std::wstring, JSObject*>::iterator, bool> ret2 = m_DeserializablePrototypes.insert(std::make_pair(name, obj));
|
||||
if (!ret1.second || !ret2.second)
|
||||
LOGERROR("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='%s'", obj, name.c_str());
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
@@ -254,7 +254,7 @@ ICmpPathfinder::pass_class_t CCmpPathfinder::GetPassabilityClass(const std::stri
|
||||
{
|
||||
if (m_PassClassMasks.find(name) == m_PassClassMasks.end())
|
||||
{
|
||||
LOGERROR("Invalid passability class name '%hs'", name.c_str());
|
||||
LOGERROR("Invalid passability class name '%s'", 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("Invalid unit cost class name '%hs'", name.c_str());
|
||||
LOGERROR("Invalid unit cost class name '%s'", name.c_str());
|
||||
return m_UnitCostClassTags["default"];
|
||||
}
|
||||
|
||||
|
||||
@@ -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("Unit with actor '%ls' launched a projectile but has no actor on 'projectile' attachpoint", cmpSourceVisual->GetActorShortName().c_str());
|
||||
LOGERROR("Unit with actor '%s' launched a projectile but has no actor on 'projectile' attachpoint", cmpSourceVisual->GetActorShortName().c_str());
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -1347,7 +1347,7 @@ public:
|
||||
if (identifier == "injured")
|
||||
return 2;
|
||||
|
||||
LOGWARNING("CCmpRangeManager: Invalid flag identifier %hs", identifier.c_str());
|
||||
LOGWARNING("CCmpRangeManager: Invalid flag identifier %s", identifier.c_str());
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -1364,7 +1364,7 @@ public:
|
||||
// We don't have a flag set
|
||||
if (flag == 0)
|
||||
{
|
||||
LOGWARNING("CCmpRangeManager: Invalid flag identifier %hs for entity %u", identifier.c_str(), ent);
|
||||
LOGWARNING("CCmpRangeManager: Invalid flag identifier %s for entity %u", identifier.c_str(), ent);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -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("Failed to validate entity template '%hs'", templateName.c_str());
|
||||
LOGERROR("Failed to validate entity template '%s'", 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("Invalid root element in entity template '%hs'", templateName.c_str());
|
||||
LOGERROR("Invalid root element in entity template '%s'", templateName.c_str());
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
@@ -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("Script message handler %hs failed", name);
|
||||
LOGERROR("Script message handler %s failed", name);
|
||||
}
|
||||
|
||||
void CComponentTypeScript::Serialize(ISerializer& serialize)
|
||||
|
||||
@@ -64,7 +64,7 @@ public:
|
||||
R ret; \
|
||||
if (m_ScriptInterface.CallFunction(tmpInstance, funcname BOOST_PP_ENUM_TRAILING_PARAMS(i, a), ret)) \
|
||||
return ret; \
|
||||
LOGERROR("Error calling component script function %hs", funcname); \
|
||||
LOGERROR("Error calling component script function %s", 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("Error calling component script function %hs", funcname); \
|
||||
LOGERROR("Error calling component script function %s", funcname); \
|
||||
}
|
||||
BOOST_PP_REPEAT(SCRIPT_INTERFACE_MAX_ARGS, OVERLOADS, ~)
|
||||
#undef OVERLOADS
|
||||
|
||||
@@ -258,7 +258,7 @@ void CBinarySerializerScriptImpl::HandleScriptVal(JS::HandleValue val)
|
||||
else
|
||||
{
|
||||
// Unrecognized class
|
||||
LOGERROR("Cannot serialise JS objects with unrecognized class '%hs'", jsclass->name);
|
||||
LOGERROR("Cannot serialise JS objects with unrecognized class '%s'", jsclass->name);
|
||||
throw PSERROR_Serialize_InvalidScriptValue();
|
||||
}
|
||||
}
|
||||
@@ -317,7 +317,7 @@ void CBinarySerializerScriptImpl::HandleScriptVal(JS::HandleValue val)
|
||||
}
|
||||
}
|
||||
|
||||
LOGERROR("Cannot serialise JS objects of type 'function': %ls", funcname.c_str());
|
||||
LOGERROR("Cannot serialise JS objects of type 'function': %s", funcname.c_str());
|
||||
throw PSERROR_Serialize_InvalidScriptValue();
|
||||
}
|
||||
case JSTYPE_STRING:
|
||||
|
||||
@@ -672,7 +672,7 @@ CComponentManager::ComponentTypeId CComponentManager::GetScriptWrapper(Interface
|
||||
for (; iiit != m_InterfaceIdsByName.end(); ++iiit)
|
||||
if (iiit->second == iid)
|
||||
{
|
||||
LOGERROR("No script wrapper found for interface id %d '%hs'", iid, iiit->first.c_str());
|
||||
LOGERROR("No script wrapper found for interface id %d '%s'", iid, iiit->first.c_str());
|
||||
return CID__Invalid;
|
||||
}
|
||||
|
||||
@@ -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("Unrecognised component type name '%hs' in entity template '%ls'", it->first.c_str(), templateName.c_str());
|
||||
LOGERROR("Unrecognised component type name '%s' in entity template '%s'", it->first.c_str(), templateName.c_str());
|
||||
return INVALID_ENTITY;
|
||||
}
|
||||
|
||||
if (!AddComponent(handle, cid, it->second))
|
||||
{
|
||||
LOGERROR("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 '%s' in entity template '%s'", 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<std::string> CComponentManager::Script_FindJSONFiles(ScriptInterface
|
||||
{
|
||||
// Some error reading directory
|
||||
wchar_t error[200];
|
||||
LOGERROR("Error reading directory '%ls': %ls", cbData.path.string8(), StatusDescription(ret, error, ARRAY_SIZE(error)));
|
||||
LOGERROR("Error reading directory '%s': %s", cbData.path.string8(), StatusDescription(ret, error, ARRAY_SIZE(error)));
|
||||
}
|
||||
|
||||
return cbData.templates;
|
||||
|
||||
@@ -322,7 +322,7 @@ bool CComponentManager::DeserializeState(std::istream& stream)
|
||||
ComponentTypeId ctid = LookupCID(ctname);
|
||||
if (ctid == CID__Invalid)
|
||||
{
|
||||
LOGERROR("Deserialization saw unrecognised component type '%hs'", ctname.c_str());
|
||||
LOGERROR("Deserialization saw unrecognised component type '%s'", ctname.c_str());
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -349,7 +349,7 @@ bool CComponentManager::DeserializeState(std::istream& stream)
|
||||
ComponentTypeId ctid = LookupCID(ctname);
|
||||
if (ctid == CID__Invalid)
|
||||
{
|
||||
LOGERROR("Deserialization saw unrecognised component type '%hs'", ctname.c_str());
|
||||
LOGERROR("Deserialization saw unrecognised component type '%s'", ctname.c_str());
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -391,7 +391,7 @@ bool CComponentManager::DeserializeState(std::istream& stream)
|
||||
}
|
||||
catch (PSERROR_Deserialize& e)
|
||||
{
|
||||
LOGERROR("Deserialization failed: %hs", e.what());
|
||||
LOGERROR("Deserialization failed: %s", e.what());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -123,7 +123,7 @@ void CParamNode::ApplyLayer(const XMBFile& xmb, const XMBElement& element, const
|
||||
if (tokenIt != tokens.end())
|
||||
tokens.erase(tokenIt);
|
||||
else
|
||||
LOGWARNING("[ParamNode] Could not remove token '%ls' from node '%hs'%ls; not present in list nor inherited (possible typo?)",
|
||||
LOGWARNING("[ParamNode] Could not remove token '%s' from node '%s'%s; 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
|
||||
|
||||
@@ -204,7 +204,7 @@ void ISoundManager::CloseGame()
|
||||
|
||||
void CSoundManager::al_ReportError(ALenum err, const char* caller, int line)
|
||||
{
|
||||
LOGERROR("OpenAL error: %hs; called from %hs (line %d)\n", alGetString(err), caller, line);
|
||||
LOGERROR("OpenAL error: %s; called from %s (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("GUI file '%ls' changed - reloading page", path.string8());
|
||||
// LOGERROR("GUI file '%s' changed - reloading page", path.string8());
|
||||
|
||||
return INFO::OK;
|
||||
}
|
||||
@@ -354,7 +354,7 @@ Status CSoundManager::AlcInit()
|
||||
debug_printf(L"Sound: AlcInit success, using %hs\n", dev_name);
|
||||
else
|
||||
{
|
||||
LOGERROR("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=%s 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("Failed to load sound group '%ls'", groupPath.string8());
|
||||
LOGERROR("Failed to load sound group '%s'", groupPath.string8());
|
||||
delete group;
|
||||
group = NULL;
|
||||
}
|
||||
|
||||
@@ -107,7 +107,7 @@ CSoundData* CSoundData::SoundDataFromOgg(const VfsPath& itemPath)
|
||||
}
|
||||
else
|
||||
{
|
||||
LOGERROR("could not initialize ogg data at %ls", itemPath.string8());
|
||||
LOGERROR("could not initialize ogg data at %s", itemPath.string8());
|
||||
delete oggAnswer;
|
||||
}
|
||||
|
||||
|
||||
@@ -197,7 +197,7 @@ void CSoundGroup::UploadPropertiesAndPlay(size_t theIndex, const CVector3D& posi
|
||||
itemRollOff = 0;
|
||||
|
||||
if ( sndData->IsStereo() )
|
||||
LOGWARNING( "OpenAL: stereo sounds can't be positioned: %ls", sndData->GetFileName()->string8() );
|
||||
LOGWARNING( "OpenAL: stereo sounds can't be positioned: %s", sndData->GetFileName()->string8() );
|
||||
|
||||
hSound->SetLocation(CVector3D((sndDist * sin(offSet)), 0, - sndDist * cos(offSet)));
|
||||
hSound->SetRollOff(itemRollOff);
|
||||
@@ -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("%ls: pathname=%ls, error=%ls", message.c_str(), pathname.string8(), ErrorString(err));
|
||||
LOGERROR("%s: pathname=%s, error=%s", message.c_str(), pathname.string8(), 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("Invalid SoundGroup format (unrecognised root element '%hs')", XeroFile.GetElementString(root.GetNodeName()).c_str());
|
||||
LOGERROR("Invalid SoundGroup format (unrecognised root element '%s')", XeroFile.GetElementString(root.GetNodeName()).c_str());
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -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("Unrecognised message (%hs)", name.c_str());
|
||||
LOGERROR("Unrecognised message (%s)", name.c_str());
|
||||
}
|
||||
|
||||
if (msg->GetType() == IMessage::Query)
|
||||
|
||||
@@ -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("Failed to load entity template '%hs'", oldObjects[i].templateName.c_str());
|
||||
LOGERROR("Failed to load entity template '%s'", oldObjects[i].templateName.c_str());
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user