Ticket #3011: 0010-Automatically-convert-most-path.string-.c_str-to-pat.patch

File 0010-Automatically-convert-most-path.string-.c_str-to-pat.patch, 48.6 KB (added by Philip Taylor, 9 years ago)
  • source/graphics/ColladaManager.cpp

    From 30a25a3c3d1dabde851cba9086baaa2cf1160f61 Mon Sep 17 00:00:00 2001
    From: Philip Taylor <philip@zaynar.co.uk>
    Date: Tue, 20 Jan 2015 23:16:17 +0000
    Subject: [PATCH 10/13] Automatically convert most path.string().c_str() to
     path.string8()
    
    Done with:
    
      ag -l 'LOG.*string\(\).c_str\(\)' source | xargs perl -pi -e'1 while s/(LOG.*string)\(\)\.c_str\(\)/${1}8()/g'
    ---
     source/graphics/ColladaManager.cpp              | 20 ++++++++++----------
     source/graphics/FontManager.cpp                 |  2 +-
     source/graphics/MapGenerator.cpp                | 14 +++++++-------
     source/graphics/MapWriter.cpp                   |  4 ++--
     source/graphics/MeshManager.cpp                 |  4 ++--
     source/graphics/ObjectBase.cpp                  |  2 +-
     source/graphics/ObjectEntry.cpp                 |  6 +++---
     source/graphics/ShaderProgram.cpp               | 10 +++++-----
     source/graphics/SkeletonAnimManager.cpp         |  8 ++++----
     source/graphics/TerrainTextureEntry.cpp         |  2 +-
     source/graphics/TerrainTextureManager.cpp       |  4 ++--
     source/graphics/TextureConverter.cpp            | 14 +++++++-------
     source/graphics/TextureManager.cpp              |  8 ++++----
     source/gui/CGUI.cpp                             |  8 ++++----
     source/gui/GUIManager.cpp                       |  2 +-
     source/gui/scripting/ScriptFunctions.cpp        |  2 +-
     source/i18n/L10n.cpp                            |  4 ++--
     source/ps/ConfigDB.cpp                          | 18 +++++++++---------
     source/ps/FileIo.cpp                            |  2 +-
     source/ps/Filesystem.cpp                        |  2 +-
     source/ps/GameSetup/GameSetup.cpp               |  2 +-
     source/ps/GameSetup/Paths.cpp                   |  2 +-
     source/ps/ProfileViewer.cpp                     |  2 +-
     source/ps/SavedGame.cpp                         |  4 ++--
     source/ps/Util.cpp                              |  8 ++++----
     source/ps/World.cpp                             |  2 +-
     source/ps/XML/XMLWriter.cpp                     |  2 +-
     source/ps/XML/Xeromyces.cpp                     |  6 +++---
     source/renderer/ModelRenderer.cpp               |  2 +-
     source/renderer/PostprocManager.cpp             |  2 +-
     source/renderer/SkyManager.cpp                  |  2 +-
     source/scriptinterface/ScriptInterface.cpp      | 12 ++++++------
     source/simulation2/Simulation2.cpp              | 12 ++++++------
     source/simulation2/components/CCmpAIManager.cpp | 20 ++++++++++----------
     source/simulation2/system/ComponentManager.cpp  |  2 +-
     source/soundmanager/SoundManager.cpp            |  4 ++--
     source/soundmanager/data/SoundData.cpp          |  2 +-
     source/soundmanager/scripting/SoundGroup.cpp    |  4 ++--
     38 files changed, 113 insertions(+), 113 deletions(-)
    
    diff --git a/source/graphics/ColladaManager.cpp b/source/graphics/ColladaManager.cpp
    index c6176d2..5309789 100644
    a b namespace  
    4242        VfsPath* path = static_cast<VfsPath*>(cb_data);
    4343
    4444        if (severity == LOG_INFO)
    45             LOGMESSAGE("%ls: %hs", path->string().c_str(), text);
     45            LOGMESSAGE("%ls: %hs", path->string8(), text);
    4646        else if (severity == LOG_WARNING)
    47             LOGWARNING("%ls: %hs", path->string().c_str(), text);
     47            LOGWARNING("%ls: %hs", path->string8(), text);
    4848        else
    49             LOGERROR("%ls: %hs", path->string().c_str(), text);
     49            LOGERROR("%ls: %hs", path->string8(), text);
    5050    }
    5151
    5252    void ColladaOutput(void* cb_data, const char* data, unsigned int length)
    public:  
    9999        if (!dll.IsLoaded() && !TryLoadDLL())
    100100            return ERR::FAIL;   
    101101
    102         LOGMESSAGE("Hotloading skeleton definitions from '%ls'", path.string().c_str());
     102        LOGMESSAGE("Hotloading skeleton definitions from '%ls'", path.string8());
    103103        // Set the filename for the logger to report
    104104        set_logger(ColladaLog, const_cast<void*>(static_cast<const void*>(&path)));
    105105
    106106        CVFSFile skeletonFile;
    107107        if (skeletonFile.Load(m_VFS, path) != PSRETURN_OK)
    108108        {
    109             LOGERROR("Failed to read skeleton defintions from '%ls'", path.string().c_str());
     109            LOGERROR("Failed to read skeleton defintions from '%ls'", path.string8());
    110110            return ERR::FAIL;
    111111        }
    112112
    113113        int ok = set_skeleton_definitions((const char*)skeletonFile.GetBuffer(), (int)skeletonFile.GetBufferSize());
    114114        if (ok < 0)
    115115        {
    116             LOGERROR("Failed to load skeleton definitions from '%ls'", path.string().c_str());
     116            LOGERROR("Failed to load skeleton definitions from '%ls'", path.string8());
    117117            return ERR::FAIL;
    118118        }
    119119
    public:  
    221221        bool loaded = false;
    222222        for (VfsPaths::const_iterator it = pathnames.begin(); it != pathnames.end(); ++it)
    223223        {
    224             LOGMESSAGE("Loading skeleton definitions from '%ls'", it->string().c_str());
     224            LOGMESSAGE("Loading skeleton definitions from '%ls'", it->string8());
    225225            // Set the filename for the logger to report
    226226            set_logger(ColladaLog, const_cast<void*>(static_cast<const void*>(&(*it))));
    227227
    228228            CVFSFile skeletonFile;
    229229            if (skeletonFile.Load(m_VFS, *it) != PSRETURN_OK)
    230230            {
    231                 LOGERROR("Failed to read skeleton defintions from '%ls'", it->string().c_str());
     231                LOGERROR("Failed to read skeleton defintions from '%ls'", it->string8());
    232232                continue;
    233233            }
    234234
    235235            int ok = set_skeleton_definitions((const char*)skeletonFile.GetBuffer(), (int)skeletonFile.GetBufferSize());
    236236            if (ok < 0)
    237237            {
    238                 LOGERROR("Failed to load skeleton definitions from '%ls'", it->string().c_str());
     238                LOGERROR("Failed to load skeleton definitions from '%ls'", it->string8());
    239239                continue;
    240240            }
    241241
    public:  
    287287                //  should never happen, unless there really is a problem
    288288                if (m_VFS->GetFileInfo(*it, &fileInfo) != INFO::OK)
    289289                {
    290                     LOGERROR("Failed to stat '%ls' for DAE caching", it->string().c_str());
     290                    LOGERROR("Failed to stat '%ls' for DAE caching", it->string8());
    291291                }
    292292                else
    293293                {
  • source/graphics/FontManager.cpp

    diff --git a/source/graphics/FontManager.cpp b/source/graphics/FontManager.cpp
    index c88fac2..a6e14b3 100644
    a b bool CFontManager::ReadFont(CFont* font, CStrIntern fontName)  
    5959    const VfsPath fntName(fontName.string() + ".fnt");
    6060    if (g_VFS->LoadFile(path / fntName, buf, size) < 0)
    6161    {
    62         LOGERROR("Failed to open font file %ls", (path / fntName).string().c_str());
     62        LOGERROR("Failed to open font file %ls", (path / fntName).string8());
    6363        return false;
    6464    }
    6565    std::istringstream FNTStream(std::string((const char*)buf.get(), size));
  • source/graphics/MapGenerator.cpp

    diff --git a/source/graphics/MapGenerator.cpp b/source/graphics/MapGenerator.cpp
    index 2e7a14d..366592e 100644
    a b bool CMapGeneratorWorker::Run()  
    134134    }
    135135
    136136    // Load RMS
    137     LOGMESSAGE("Loading RMS '%ls'", m_ScriptPath.string().c_str());
     137    LOGMESSAGE("Loading RMS '%ls'", m_ScriptPath.string8());
    138138    if (!m_ScriptInterface->LoadGlobalScriptFile(m_ScriptPath))
    139139    {
    140         LOGERROR("CMapGeneratorWorker::Run: Failed to load RMS '%ls'", m_ScriptPath.string().c_str());
     140        LOGERROR("CMapGeneratorWorker::Run: Failed to load RMS '%ls'", m_ScriptPath.string8());
    141141        return false;
    142142    }
    143143
    std::vector<std::string> CMapGeneratorWorker::GetCivData(ScriptInterface::CxPriv  
    210210            PSRETURN ret = file.Load(g_VFS, *it);
    211211            if (ret != PSRETURN_OK)
    212212            {
    213                 LOGERROR("CMapGeneratorWorker::GetCivData: Failed to load file '%ls': %hs", path.string().c_str(), GetErrorString(ret));
     213                LOGERROR("CMapGeneratorWorker::GetCivData: Failed to load file '%ls': %hs", path.string8(), GetErrorString(ret));
    214214            }
    215215            else
    216216            {
    std::vector<std::string> CMapGeneratorWorker::GetCivData(ScriptInterface::CxPriv  
    222222    {
    223223        // Some error reading directory
    224224        wchar_t error[200];
    225         LOGERROR("CMapGeneratorWorker::GetCivData: Error reading directory '%ls': %ls", path.string().c_str(), StatusDescription(ret, error, ARRAY_SIZE(error)));
     225        LOGERROR("CMapGeneratorWorker::GetCivData: Error reading directory '%ls': %ls", path.string8(), StatusDescription(ret, error, ARRAY_SIZE(error)));
    226226    }
    227227
    228228    return data;
    bool CMapGeneratorWorker::LoadScripts(const std::wstring& libraryName)  
    271271    {
    272272        for (VfsPaths::iterator it = pathnames.begin(); it != pathnames.end(); ++it)
    273273        {
    274             LOGMESSAGE("Loading map generator script '%ls'", it->string().c_str());
     274            LOGMESSAGE("Loading map generator script '%ls'", it->string8());
    275275
    276276            if (!m_ScriptInterface->LoadGlobalScriptFile(*it))
    277277            {
    278                 LOGERROR("CMapGeneratorWorker::LoadScripts: Failed to load script '%ls'", it->string().c_str());
     278                LOGERROR("CMapGeneratorWorker::LoadScripts: Failed to load script '%ls'", it->string8());
    279279                return false;
    280280            }
    281281        }
    bool CMapGeneratorWorker::LoadScripts(const std::wstring& libraryName)  
    284284    {
    285285        // Some error reading directory
    286286        wchar_t error[200];
    287         LOGERROR("CMapGeneratorWorker::LoadScripts: Error reading scripts in directory '%ls': %ls", path.string().c_str(), StatusDescription(ret, error, ARRAY_SIZE(error)));
     287        LOGERROR("CMapGeneratorWorker::LoadScripts: Error reading scripts in directory '%ls': %ls", path.string8(), StatusDescription(ret, error, ARRAY_SIZE(error)));
    288288        return false;
    289289    }
    290290
  • source/graphics/MapWriter.cpp

    diff --git a/source/graphics/MapWriter.cpp b/source/graphics/MapWriter.cpp
    index be1c778..8ea3c38 100644
    a b void CMapWriter::SaveMap(const VfsPath& pathname, CTerrain* pTerrain,  
    7171    }
    7272    catch (PSERROR_File_WriteFailed&)
    7373    {
    74         LOGERROR("Failed to write map '%ls'", pathname.string().c_str());
     74        LOGERROR("Failed to write map '%ls'", pathname.string8());
    7575        return;
    7676    }
    7777
    void CMapWriter::WriteXML(const VfsPath& filename,  
    447447        }
    448448    }
    449449    if (!XML_StoreVFS(g_VFS, filename))
    450         LOGERROR("Failed to write map '%ls'", filename.string().c_str());
     450        LOGERROR("Failed to write map '%ls'", filename.string8());
    451451}
  • source/graphics/MeshManager.cpp

    diff --git a/source/graphics/MeshManager.cpp b/source/graphics/MeshManager.cpp
    index 3f0fda9..1a7ed6b 100644
    a b CModelDefPtr CMeshManager::GetMesh(const VfsPath& pathname)  
    5353
    5454    if (pmdFilename.empty())
    5555    {
    56         LOGERROR("Could not load mesh '%ls'", pathname.string().c_str());
     56        LOGERROR("Could not load mesh '%ls'", pathname.string8());
    5757        return CModelDefPtr();
    5858    }
    5959
    CModelDefPtr CMeshManager::GetMesh(const VfsPath& pathname)  
    6565    }
    6666    catch (PSERROR_File&)
    6767    {
    68         LOGERROR("Could not load mesh '%ls'", pmdFilename.string().c_str());
     68        LOGERROR("Could not load mesh '%ls'", pmdFilename.string8());
    6969        return CModelDefPtr();
    7070    }
    7171}
  • source/graphics/ObjectBase.cpp

    diff --git a/source/graphics/ObjectBase.cpp b/source/graphics/ObjectBase.cpp
    index 2270005..28bc016 100644
    a b bool CObjectBase::Load(const VfsPath& pathname)  
    266266
    267267            if (currentGroup->size() == 0)
    268268            {
    269                 LOGERROR("Actor group has zero variants ('%ls')", pathname.string().c_str());
     269                LOGERROR("Actor group has zero variants ('%ls')", pathname.string8());
    270270            }
    271271
    272272            ++currentGroup;
  • source/graphics/ObjectEntry.cpp

    diff --git a/source/graphics/ObjectEntry.cpp b/source/graphics/ObjectEntry.cpp
    index d9838dc..a11463a 100644
    a b bool CObjectEntry::BuildVariation(const std::vector<std::set<CStr> >& selections  
    119119    CModelDefPtr modeldef (objectManager.GetMeshManager().GetMesh(m_ModelName));
    120120    if (!modeldef)
    121121    {
    122         LOGERROR("CObjectEntry::BuildVariation(): Model %ls failed to load", m_ModelName.string().c_str());
     122        LOGERROR("CObjectEntry::BuildVariation(): Model %ls failed to load", m_ModelName.string8());
    123123        return false;
    124124    }
    125125
    bool CObjectEntry::BuildVariation(const std::vector<std::set<CStr> >& selections  
    190190    {
    191191        // start up idling
    192192        if (!model->SetAnimation(GetRandomAnimation("idle")))
    193             LOGERROR("Failed to set idle animation in model \"%ls\"", m_ModelName.string().c_str());
     193            LOGERROR("Failed to set idle animation in model \"%ls\"", m_ModelName.string8());
    194194    }
    195195
    196196    // build props - TODO, RC - need to fix up bounds here
    bool CObjectEntry::BuildVariation(const std::vector<std::set<CStr> >& selections  
    240240                propmodel->ToCModel()->SetAnimation(oe->GetRandomAnimation("idle"));
    241241        }
    242242        else
    243             LOGERROR("Failed to find matching prop point called \"%hs\" in model \"%ls\" for actor \"%ls\"", ppn.c_str(), m_ModelName.string().c_str(), m_Base->m_ShortName.c_str());
     243            LOGERROR("Failed to find matching prop point called \"%hs\" in model \"%ls\" for actor \"%ls\"", ppn.c_str(), m_ModelName.string8(), m_Base->m_ShortName.c_str());
    244244    }
    245245
    246246    // setup flags
  • source/graphics/ShaderProgram.cpp

    diff --git a/source/graphics/ShaderProgram.cpp b/source/graphics/ShaderProgram.cpp
    index 82e7140..3d8f3c2 100644
    a b public:  
    7171            glGetIntegerv(GL_PROGRAM_ERROR_POSITION_ARB, &errPos);
    7272            int errLine = std::count(code.begin(), code.begin() + std::min((int)code.length(), errPos + 1), '\n') + 1;
    7373            char* errStr = (char*)glGetString(GL_PROGRAM_ERROR_STRING_ARB);
    74             LOGERROR("Failed to compile %hs program '%ls' (line %d):\n%hs", targetName, file.string().c_str(), errLine, errStr);
     74            LOGERROR("Failed to compile %hs program '%ls' (line %d):\n%hs", targetName, file.string8(), errLine, errStr);
    7575            return false;
    7676        }
    7777
    public:  
    310310            pglGetShaderInfoLog(shader, length, NULL, infolog);
    311311
    312312            if (ok)
    313                 LOGMESSAGE("Info when compiling shader '%ls':\n%hs", file.string().c_str(), infolog);
     313                LOGMESSAGE("Info when compiling shader '%ls':\n%hs", file.string8(), infolog);
    314314            else
    315                 LOGERROR("Failed to compile shader '%ls':\n%hs", file.string().c_str(), infolog);
     315                LOGERROR("Failed to compile shader '%ls':\n%hs", file.string8(), infolog);
    316316
    317317            delete[] infolog;
    318318        }
    public:  
    357357            pglGetProgramInfoLog(m_Program, length, NULL, infolog);
    358358
    359359            if (ok)
    360                 LOGMESSAGE("Info when linking program '%ls'+'%ls':\n%hs", m_VertexFile.string().c_str(), m_FragmentFile.string().c_str(), infolog);
     360                LOGMESSAGE("Info when linking program '%ls'+'%ls':\n%hs", m_VertexFile.string8(), m_FragmentFile.string8(), infolog);
    361361            else
    362                 LOGERROR("Failed to link program '%ls'+'%ls':\n%hs", m_VertexFile.string().c_str(), m_FragmentFile.string().c_str(), infolog);
     362                LOGERROR("Failed to link program '%ls'+'%ls':\n%hs", m_VertexFile.string8(), m_FragmentFile.string8(), infolog);
    363363           
    364364            delete[] infolog;
    365365        }
  • source/graphics/SkeletonAnimManager.cpp

    diff --git a/source/graphics/SkeletonAnimManager.cpp b/source/graphics/SkeletonAnimManager.cpp
    index 2d99118..9872c16 100644
    a b CSkeletonAnimDef* CSkeletonAnimManager::GetAnimation(const VfsPath& pathname)  
    6565
    6666    if (psaFilename.empty())
    6767    {
    68         LOGERROR("Could not load animation '%ls'", pathname.string().c_str());
     68        LOGERROR("Could not load animation '%ls'", pathname.string8());
    6969        def = NULL;
    7070    }
    7171    else
    CSkeletonAnimDef* CSkeletonAnimManager::GetAnimation(const VfsPath& pathname)  
    7676        }
    7777        catch (PSERROR_File&)
    7878        {
    79             LOGERROR("Could not load animation '%ls'", psaFilename.string().c_str());
     79            LOGERROR("Could not load animation '%ls'", psaFilename.string8());
    8080        }
    8181    }
    8282
    8383    if (def)
    84         LOGMESSAGE("CSkeletonAnimManager::GetAnimation(%ls): Loaded successfully", pathname.string().c_str());
     84        LOGMESSAGE("CSkeletonAnimManager::GetAnimation(%ls): Loaded successfully", pathname.string8());
    8585    else
    86         LOGERROR("CSkeletonAnimManager::GetAnimation(%ls): Failed loading, marked file as bad", pathname.string().c_str());
     86        LOGERROR("CSkeletonAnimManager::GetAnimation(%ls): Failed loading, marked file as bad", pathname.string8());
    8787
    8888    // Add to map
    8989    m_Animations[name] = def; // NULL if failed to load - we won't try loading it again
  • source/graphics/TerrainTextureEntry.cpp

    diff --git a/source/graphics/TerrainTextureEntry.cpp b/source/graphics/TerrainTextureEntry.cpp
    index bef2216..94930d8 100644
    a b CTerrainTextureEntry::CTerrainTextureEntry(CTerrainPropertiesPtr properties, con  
    4747    CXeromyces XeroFile;
    4848    if (XeroFile.Load(g_VFS, path) != PSRETURN_OK)
    4949    {
    50         LOGERROR("Terrain xml not found (%hs)", path.string().c_str());
     50        LOGERROR("Terrain xml not found (%hs)", path.string8());
    5151        return;
    5252    }
    5353
  • source/graphics/TerrainTextureManager.cpp

    diff --git a/source/graphics/TerrainTextureManager.cpp b/source/graphics/TerrainTextureManager.cpp
    index 7add3d5..8429c69 100644
    a b void CTerrainTextureManager::LoadTextures(const CTerrainPropertiesPtr& props, co  
    141141
    142142void CTerrainTextureManager::RecurseDirectory(const CTerrainPropertiesPtr& parentProps, const VfsPath& path)
    143143{
    144     //LOGMESSAGE("CTextureManager::RecurseDirectory(%ls)", path.string().c_str());
     144    //LOGMESSAGE("CTextureManager::RecurseDirectory(%ls)", path.string8());
    145145
    146146    CTerrainPropertiesPtr props;
    147147
    void CTerrainTextureManager::RecurseDirectory(const CTerrainPropertiesPtr& paren  
    153153    // No terrains.xml, or read failures -> use parent props (i.e.
    154154    if (!props)
    155155    {
    156         LOGMESSAGE("CTerrainTextureManager::RecurseDirectory(%ls): no terrains.xml (or errors while loading) - using parent properties", path.string().c_str());
     156        LOGMESSAGE("CTerrainTextureManager::RecurseDirectory(%ls): no terrains.xml (or errors while loading) - using parent properties", path.string8());
    157157        props = parentProps;
    158158    }
    159159
  • source/graphics/TextureConverter.cpp

    diff --git a/source/graphics/TextureConverter.cpp b/source/graphics/TextureConverter.cpp
    index a855587..9c52652 100644
    a b CTextureConverter::SettingsFile* CTextureConverter::LoadSettings(const VfsPath&  
    120120
    121121    if (root.GetNodeName() != el_textures)
    122122    {
    123         LOGERROR("Invalid texture settings file \"%ls\" (unrecognised root element)", path.string().c_str());
     123        LOGERROR("Invalid texture settings file \"%ls\" (unrecognised root element)", path.string8());
    124124        return NULL;
    125125    }
    126126
    bool CTextureConverter::ConvertTexture(const CTexturePtr& texture, const VfsPath  
    326326    size_t fileSize;
    327327    if (m_VFS->LoadFile(src, file, fileSize) < 0)
    328328    {
    329         LOGERROR("Failed to load texture \"%ls\"", src.string().c_str());
     329        LOGERROR("Failed to load texture \"%ls\"", src.string8());
    330330        return false;
    331331    }
    332332
    333333    Tex tex;
    334334    if (tex.decode(file, fileSize) < 0)
    335335    {
    336         LOGERROR("Failed to decode texture \"%ls\"", src.string().c_str());
     336        LOGERROR("Failed to decode texture \"%ls\"", src.string8());
    337337        return false;
    338338    }
    339339
    bool CTextureConverter::ConvertTexture(const CTexturePtr& texture, const VfsPath  
    345345        // Convert to uncompressed 8-bit with no mipmaps
    346346        if (tex.transform_to((tex.m_Flags | TEX_GREY) & ~(TEX_DXT | TEX_MIPMAPS | TEX_ALPHA)) < 0)
    347347        {
    348             LOGERROR("Failed to transform texture \"%ls\"", src.string().c_str());
     348            LOGERROR("Failed to transform texture \"%ls\"", src.string8());
    349349            return false;
    350350        }
    351351    }
    bool CTextureConverter::ConvertTexture(const CTexturePtr& texture, const VfsPath  
    356356        // (plain_transform doesn't know how to construct the alpha channel)
    357357        if (tex.m_Flags & TEX_GREY)
    358358        {
    359             LOGERROR("Failed to convert grayscale texture \"%ls\" - only RGB textures are currently supported", src.string().c_str());
     359            LOGERROR("Failed to convert grayscale texture \"%ls\" - only RGB textures are currently supported", src.string8());
    360360            return false;
    361361        }
    362362
    363363        // Convert to uncompressed BGRA with no mipmaps
    364364        if (tex.transform_to((tex.m_Flags | TEX_BGR | TEX_ALPHA) & ~(TEX_DXT | TEX_MIPMAPS)) < 0)
    365365        {
    366             LOGERROR("Failed to transform texture \"%ls\"", src.string().c_str());
     366            LOGERROR("Failed to transform texture \"%ls\"", src.string8());
    367367            return false;
    368368        }
    369369    }
    bool CTextureConverter::ConvertTexture(const CTexturePtr& texture, const VfsPath  
    482482    return true;
    483483
    484484#else
    485     LOGERROR("Failed to convert texture \"%ls\" (NVTT not available)", src.string().c_str());
     485    LOGERROR("Failed to convert texture \"%ls\" (NVTT not available)", src.string8());
    486486    return false;
    487487#endif
    488488}
  • source/graphics/TextureManager.cpp

    diff --git a/source/graphics/TextureManager.cpp b/source/graphics/TextureManager.cpp
    index 33eff64..eb08e0d 100644
    a b public:  
    178178        Handle h = ogl_tex_load(m_VFS, path, RES_UNIQUE);
    179179        if (h <= 0)
    180180        {
    181             LOGERROR("Texture failed to load; \"%ls\"", texture->m_Properties.m_Path.string().c_str());
     181            LOGERROR("Texture failed to load; \"%ls\"", texture->m_Properties.m_Path.string8());
    182182
    183183            // Replace with error texture to make it obvious
    184184            texture->SetHandle(m_ErrorHandle);
    public:  
    218218        // Upload to GL
    219219        if (!m_DisableGL && ogl_tex_upload(h, texture->m_Properties.m_Format) < 0)
    220220        {
    221             LOGERROR("Texture failed to upload: \"%ls\"", texture->m_Properties.m_Path.string().c_str());
     221            LOGERROR("Texture failed to upload: \"%ls\"", texture->m_Properties.m_Path.string8());
    222222
    223223            ogl_tex_free(h);
    224224
    public:  
    277277
    278278            // No source file or archive cache was found, so we can't load the
    279279            // real texture at all - return the error texture instead
    280             LOGERROR("CCacheLoader failed to find archived or source file for: \"%ls\"", texture->m_Properties.m_Path.string().c_str());
     280            LOGERROR("CCacheLoader failed to find archived or source file for: \"%ls\"", texture->m_Properties.m_Path.string8());
    281281            texture->SetHandle(m_ErrorHandle);
    282282            return true;
    283283        }
    public:  
    345345                }
    346346                else
    347347                {
    348                     LOGERROR("Texture failed to convert: \"%ls\"", texture->m_Properties.m_Path.string().c_str());
     348                    LOGERROR("Texture failed to convert: \"%ls\"", texture->m_Properties.m_Path.string8());
    349349                    texture->SetHandle(m_ErrorHandle);
    350350                }
    351351                texture->m_State = CTexture::LOADED;
  • source/gui/CGUI.cpp

    diff --git a/source/gui/CGUI.cpp b/source/gui/CGUI.cpp
    index e32395b..f2a1c28 100644
    a b void CGUI::LoadXmlFile(const VfsPath& Filename, boost::unordered_set<VfsPath>& P  
    969969    }
    970970    catch (PSERROR_GUI& e)
    971971    {
    972         LOGERROR("Errors loading GUI file %ls (%u)", Filename.string().c_str(), e.getCode());
     972        LOGERROR("Errors loading GUI file %ls (%u)", Filename.string8(), e.getCode());
    973973        return;
    974974    }
    975975}
    void CGUI::Xeromyces_ReadObject(XMBElement Element, CXeromyces* pFile, IGUIObjec  
    13791379                    CXeromyces XeroIncluded;
    13801380                    if (XeroIncluded.Load(g_VFS, *it) != PSRETURN_OK)
    13811381                    {
    1382                         LOGERROR("GUI: Error reading included XML: '%ls'", (*it).string().c_str());
     1382                        LOGERROR("GUI: Error reading included XML: '%ls'", (*it).string8());
    13831383                        continue;
    13841384                    }
    13851385
    13861386                    XMBElement node = XeroIncluded.GetRoot();
    13871387                    if (node.GetNodeName() != XeroIncluded.GetElementID("object"))
    13881388                    {
    1389                         LOGERROR("GUI: Error reading included XML: '%ls', root element must have be of type 'object'.", (*it).string().c_str());
     1389                        LOGERROR("GUI: Error reading included XML: '%ls', root element must have be of type 'object'.", (*it).string8());
    13901390                        continue;
    13911391                    }
    13921392                    Xeromyces_ReadObject(node, &XeroIncluded, object, NameSubst, Paths, nesting_depth+1);
    void CGUI::Xeromyces_ReadScript(XMBElement Element, CXeromyces* pFile, boost::un  
    15121512                }
    15131513                catch (PSERROR_Scripting& e)
    15141514                {
    1515                     LOGERROR("GUI: Error executing script %ls: %hs", (*it).string().c_str(), e.what());
     1515                    LOGERROR("GUI: Error executing script %ls: %hs", (*it).string8(), e.what());
    15161516                }
    15171517            }
    15181518        }
  • source/gui/GUIManager.cpp

    diff --git a/source/gui/GUIManager.cpp b/source/gui/GUIManager.cpp
    index 992088d..a77c97d 100644
    a b Status CGUIManager::ReloadChangedFile(const VfsPath& path)  
    264264    {
    265265        if (it->inputs.count(path))
    266266        {
    267             LOGMESSAGE("GUI file '%ls' changed - reloading page '%ls'", path.string().c_str(), it->name.c_str());
     267            LOGMESSAGE("GUI file '%ls' changed - reloading page '%ls'", path.string8(), it->name.c_str());
    268268            LoadPage(*it);
    269269            // TODO: this can crash if LoadPage runs an init script which modifies the page stack and breaks our iterators
    270270        }
  • source/gui/scripting/ScriptFunctions.cpp

    diff --git a/source/gui/scripting/ScriptFunctions.cpp b/source/gui/scripting/ScriptFunctions.cpp
    index bc6881a..5df3f0c 100644
    a b void DumpTerrainMipmap(ScriptInterface::CxPrivate* UNUSED(pCxPrivate))  
    676676    g_Game->GetWorld()->GetTerrain()->GetHeightMipmap().DumpToDisk(filename);
    677677    OsPath realPath;
    678678    g_VFS->GetRealPath(filename, realPath);
    679     LOGMESSAGERENDER("Terrain mipmap written to '%ls'", realPath.string().c_str());
     679    LOGMESSAGERENDER("Terrain mipmap written to '%ls'", realPath.string8());
    680680}
    681681
    682682void EnableTimeWarpRecording(ScriptInterface::CxPrivate* UNUSED(pCxPrivate), unsigned int numTurns)
  • source/i18n/L10n.cpp

    diff --git a/source/i18n/L10n.cpp b/source/i18n/L10n.cpp
    index 6f109e3..97bf604 100644
    a b Status L10n::ReloadChangedFile(const VfsPath& path)  
    470470    if (path.string().rfind(dictName) == std::string::npos)
    471471        return INFO::OK;
    472472
    473     LOGMESSAGE("Hotloading translations from '%ls'", path.string().c_str());
     473    LOGMESSAGE("Hotloading translations from '%ls'", path.string8());
    474474
    475475    CVFSFile file;
    476476    if (file.Load(g_VFS, path) != PSRETURN_OK)
    477477    {
    478         LOGERROR("Failed to read translations from '%ls'", path.string().c_str());
     478        LOGERROR("Failed to read translations from '%ls'", path.string8());
    479479        return ERR::FAIL;
    480480    }
    481481
  • source/ps/ConfigDB.cpp

    diff --git a/source/ps/ConfigDB.cpp b/source/ps/ConfigDB.cpp
    index 17b4838..9ab102c 100644
    a b bool CConfigDB::Reload(EConfigNamespace ns)  
    214214        // Handle missing files quietly
    215215        if (g_VFS->GetFileInfo(m_ConfigFile[ns], NULL) < 0)
    216216        {
    217             LOGMESSAGE("Cannot find config file \"%ls\" - ignoring", m_ConfigFile[ns].string().c_str());
     217            LOGMESSAGE("Cannot find config file \"%ls\" - ignoring", m_ConfigFile[ns].string8());
    218218            return false;
    219219        }
    220220
    221         LOGMESSAGE("Loading config file \"%ls\"", m_ConfigFile[ns].string().c_str());
     221        LOGMESSAGE("Loading config file \"%ls\"", m_ConfigFile[ns].string8());
    222222        Status ret = g_VFS->LoadFile(m_ConfigFile[ns], buffer, buflen);
    223223        if (ret != INFO::OK)
    224224        {
    225             LOGERROR("CConfigDB::Reload(): vfs_load for \"%ls\" failed: return was %lld", m_ConfigFile[ns].string().c_str(), (long long)ret);
     225            LOGERROR("CConfigDB::Reload(): vfs_load for \"%ls\" failed: return was %lld", m_ConfigFile[ns].string8(), (long long)ret);
    226226            return false;
    227227        }
    228228    }
    bool CConfigDB::Reload(EConfigNamespace ns)  
    256256
    257257            if (pos == filebufend || *pos == '\n')
    258258            {
    259                 LOGERROR("Config header with missing close tag encountered on line %d in '%ls'", line, m_ConfigFile[ns].string().c_str());
     259                LOGERROR("Config header with missing close tag encountered on line %d in '%ls'", line, m_ConfigFile[ns].string8());
    260260                header.clear();
    261261                ++line;
    262262                continue;
    bool CConfigDB::Reload(EConfigNamespace ns)  
    267267            while (++pos < filebufend && *pos != '\n' && *pos != ';')
    268268                if (*pos != ' ' && *pos != '\r')
    269269                {
    270                     LOGERROR("Config settings on the same line as a header on line %d in '%ls'", line, m_ConfigFile[ns].string().c_str());
     270                    LOGERROR("Config settings on the same line as a header on line %d in '%ls'", line, m_ConfigFile[ns].string8());
    271271                    break;
    272272                }
    273273            while (pos < filebufend && *pos != '\n')
    bool CConfigDB::Reload(EConfigNamespace ns)  
    288288                    {
    289289                        if (*pos == '\\' && ++pos == filebufend)
    290290                        {
    291                             LOGERROR("Escape character at end of input (line %d in '%ls')", line, m_ConfigFile[ns].string().c_str());
     291                            LOGERROR("Escape character at end of input (line %d in '%ls')", line, m_ConfigFile[ns].string8());
    292292                            break;
    293293                        }
    294294
    bool CConfigDB::Reload(EConfigNamespace ns)  
    316316                }
    317317            }
    318318            if (quoted) // We ignore the invalid parameter
    319                 LOGERROR("Unmatched quote while parsing config file '%ls' on line %d", m_ConfigFile[ns].string().c_str(), line);
     319                LOGERROR("Unmatched quote while parsing config file '%ls' on line %d", m_ConfigFile[ns].string8(), line);
    320320            else if (!value.empty())
    321321                values.push_back(value);
    322322            value.clear();
    bool CConfigDB::Reload(EConfigNamespace ns)  
    348348            }
    349349        }
    350350        else if (!name.empty())
    351             LOGERROR("Encountered config setting '%hs' without value while parsing '%ls' on line %d", name.c_str(), m_ConfigFile[ns].string().c_str(), line);
     351            LOGERROR("Encountered config setting '%hs' without value while parsing '%ls' on line %d", name.c_str(), m_ConfigFile[ns].string8(), line);
    352352
    353353        name.clear();
    354354        values.clear();
    bool CConfigDB::WriteFile(EConfigNamespace ns, const VfsPath& path)  
    393393    Status ret = g_VFS->CreateFile(path, buf, len);
    394394    if (ret < 0)
    395395    {
    396         LOGERROR("CConfigDB::WriteFile(): CreateFile \"%ls\" failed (error: %d)", path.string().c_str(), (int)ret);
     396        LOGERROR("CConfigDB::WriteFile(): CreateFile \"%ls\" failed (error: %d)", path.string8(), (int)ret);
    397397        return false;
    398398    }
    399399
  • source/ps/FileIo.cpp

    diff --git a/source/ps/FileIo.cpp b/source/ps/FileIo.cpp
    index c345da7..8ffa31b 100644
    a b void CFilePacker::Write(const VfsPath& filename)  
    6969    const Status st = g_VFS->CreateFile(filename, m_writeBuffer.Data(), m_writeBuffer.Size());
    7070    if (st < 0)
    7171    {
    72         LOGERROR("Failed to write file '%ls' with status '%lld'", filename.string().c_str(), (long long)st);
     72        LOGERROR("Failed to write file '%ls' with status '%lld'", filename.string8(), (long long)st);
    7373        throw PSERROR_File_WriteFailed();
    7474    }
    7575}
  • source/ps/Filesystem.cpp

    diff --git a/source/ps/Filesystem.cpp b/source/ps/Filesystem.cpp
    index d273ce5..1c5a446 100644
    a b PSRETURN CVFSFile::Load(const PIVFS& vfs, const VfsPath& filename, bool log /* =  
    124124    if (ret != INFO::OK)
    125125    {
    126126        if (log)
    127             LOGERROR("CVFSFile: file %ls couldn't be opened (vfs_load: %lld)", filename.string().c_str(), (long long)ret);
     127            LOGERROR("CVFSFile: file %ls couldn't be opened (vfs_load: %lld)", filename.string8(), (long long)ret);
    128128        m_Buffer.reset();
    129129        m_BufferSize = 0;
    130130        return PSRETURN_CVFSFile_LoadFailed;
  • source/ps/GameSetup/GameSetup.cpp

    diff --git a/source/ps/GameSetup/GameSetup.cpp b/source/ps/GameSetup/GameSetup.cpp
    index dac6867..13bd34e 100644
    a b CStr8 LoadSettingsOfScenarioMap(const VfsPath &mapPath)  
    11321132
    11331133    if (INFO::OK != loadResult)
    11341134    {
    1135         LOGERROR("LoadSettingsOfScenarioMap: Unable to load map file '%ls'", mapPath.string().c_str());
     1135        LOGERROR("LoadSettingsOfScenarioMap: Unable to load map file '%ls'", mapPath.string8());
    11361136        throw PSERROR_Game_World_MapLoadFailed("Unable to load map file, check the path for typos.");
    11371137    }
    11381138    XMBElement mapElement = mapFile.GetRoot();
  • source/ps/GameSetup/Paths.cpp

    diff --git a/source/ps/GameSetup/Paths.cpp b/source/ps/GameSetup/Paths.cpp
    index aeeca95..db53c54 100644
    a b Paths::Paths(const CmdLineArgs& args)  
    172172    // make sure it's valid
    173173    if(!FileExists(pathname))
    174174    {
    175         LOGERROR("Cannot find executable (expected at '%ls')", pathname.string().c_str());
     175        LOGERROR("Cannot find executable (expected at '%ls')", pathname.string8());
    176176        WARN_IF_ERR(StatusFromErrno());
    177177    }
    178178
  • source/ps/ProfileViewer.cpp

    diff --git a/source/ps/ProfileViewer.cpp b/source/ps/ProfileViewer.cpp
    index fe6fdab..2551a02 100644
    a b void CProfileViewer::SaveToFile()  
    575575        }
    576576        else
    577577        {
    578             LOGMESSAGERENDER("Profiler snapshot saved to '%ls'", path.string().c_str());
     578            LOGMESSAGERENDER("Profiler snapshot saved to '%ls'", path.string8());
    579579        }
    580580    }
    581581
  • source/ps/SavedGame.cpp

    diff --git a/source/ps/SavedGame.cpp b/source/ps/SavedGame.cpp
    index 5869595..a1c5855 100644
    a b Status SavedGames::Save(const std::wstring& name, const std::wstring& descriptio  
    126126
    127127    OsPath realPath;
    128128    WARN_RETURN_STATUS_IF_ERR(g_VFS->GetRealPath(filename, realPath));
    129     LOGMESSAGERENDER(g_L10n.Translate("Saved game to '%ls'"), realPath.string().c_str());
     129    LOGMESSAGERENDER(g_L10n.Translate("Saved game to '%ls'"), realPath.string8());
    130130
    131131    return INFO::OK;
    132132}
    std::vector<CScriptValRooted> SavedGames::GetSavedGames(ScriptInterface& scriptI  
    244244        if (!archiveReader)
    245245        {
    246246            // Triggered by e.g. the file being open in another program
    247             LOGWARNING("Failed to read saved game '%ls'", realPath.string().c_str());
     247            LOGWARNING("Failed to read saved game '%ls'", realPath.string8());
    248248            continue; // skip this file
    249249        }
    250250
  • source/ps/Util.cpp

    diff --git a/source/ps/Util.cpp b/source/ps/Util.cpp
    index fc07b38..8e66339 100644
    a b void WriteScreenshot(const VfsPath& extension)  
    241241    {
    242242        OsPath realPath;
    243243        g_VFS->GetRealPath(filename, realPath);
    244         LOGMESSAGERENDER(g_L10n.Translate("Screenshot written to '%ls'"), realPath.string().c_str());
     244        LOGMESSAGERENDER(g_L10n.Translate("Screenshot written to '%ls'"), realPath.string8());
    245245    }
    246246    else
    247         LOGERROR("Error writing screenshot to '%ls'", filename.string().c_str());
     247        LOGERROR("Error writing screenshot to '%ls'", filename.string8());
    248248}
    249249
    250250
    void WriteBigScreenshot(const VfsPath& extension, int tiles)  
    374374    {
    375375        OsPath realPath;
    376376        g_VFS->GetRealPath(filename, realPath);
    377         LOGMESSAGERENDER(g_L10n.Translate("Screenshot written to '%ls'"), realPath.string().c_str());
     377        LOGMESSAGERENDER(g_L10n.Translate("Screenshot written to '%ls'"), realPath.string8());
    378378    }
    379379    else
    380         LOGERROR("Error writing screenshot to '%ls'", filename.string().c_str());
     380        LOGERROR("Error writing screenshot to '%ls'", filename.string8());
    381381
    382382    free(tile_data);
    383383}
  • source/ps/World.cpp

    diff --git a/source/ps/World.cpp b/source/ps/World.cpp
    index 12de4d0..60a4b66 100644
    a b void CWorld::RegisterInit(const CStrW& mapFile, const CScriptValRooted& settings  
    8989        catch (PSERROR_File& err)
    9090        {
    9191            delete reader;
    92             LOGERROR("Failed to load map %ls: %hs", mapfilename.string().c_str(), err.what());
     92            LOGERROR("Failed to load map %ls: %hs", mapfilename.string8(), err.what());
    9393            throw PSERROR_Game_World_MapLoadFailed("Failed to load map.\nCheck application log for details.");
    9494        }
    9595    }
  • source/ps/XML/XMLWriter.cpp

    diff --git a/source/ps/XML/XMLWriter.cpp b/source/ps/XML/XMLWriter.cpp
    index ea99187..b104c67 100644
    a b bool XMLWriter_File::StoreVFS(const PIVFS& vfs, const VfsPath& pathname)  
    102102    Status ret = vfs->CreateFile(pathname, data, size);
    103103    if (ret < 0)
    104104    {
    105         LOGERROR("Error saving XML data through VFS: %lld '%ls'", (long long)ret, pathname.string().c_str());
     105        LOGERROR("Error saving XML data through VFS: %lld '%ls'", (long long)ret, pathname.string8());
    106106        return false;
    107107    }
    108108    return true;
  • source/ps/XML/Xeromyces.cpp

    diff --git a/source/ps/XML/Xeromyces.cpp b/source/ps/XML/Xeromyces.cpp
    index 61fd869..d4aea8d 100644
    a b PSRETURN CXeromyces::Load(const PIVFS& vfs, const VfsPath& filename)  
    8989
    9090        // No source file or archive cache was found, so we can't load the
    9191        // XML file at all
    92         LOGERROR("CCacheLoader failed to find archived or source file for: \"%ls\"", filename.string().c_str());
     92        LOGERROR("CCacheLoader failed to find archived or source file for: \"%ls\"", filename.string8());
    9393        return PSRETURN_Xeromyces_XMLOpenFailed;
    9494    }
    9595
    PSRETURN CXeromyces::ConvertFile(const PIVFS& vfs, const VfsPath& filename, cons  
    111111    CVFSFile input;
    112112    if (input.Load(vfs, filename))
    113113    {
    114         LOGERROR("CXeromyces: Failed to open XML file %ls", filename.string().c_str());
     114        LOGERROR("CXeromyces: Failed to open XML file %ls", filename.string8());
    115115        return PSRETURN_Xeromyces_XMLOpenFailed;
    116116    }
    117117
    PSRETURN CXeromyces::ConvertFile(const PIVFS& vfs, const VfsPath& filename, cons  
    120120        filename8.c_str(), NULL, XML_PARSE_NONET|XML_PARSE_NOCDATA);
    121121    if (! doc)
    122122    {
    123         LOGERROR("CXeromyces: Failed to parse XML file %ls", filename.string().c_str());
     123        LOGERROR("CXeromyces: Failed to parse XML file %ls", filename.string8());
    124124        return PSRETURN_Xeromyces_XMLParseError;
    125125    }
    126126
  • source/renderer/ModelRenderer.cpp

    diff --git a/source/renderer/ModelRenderer.cpp b/source/renderer/ModelRenderer.cpp
    index 03e621a..6c13815 100644
    a b void ModelRenderer::BuildPositionAndNormals(  
    9898        // some broken situations
    9999        if (numVertices && vertices[0].m_Blend.m_Bone[0] == 0xff)
    100100        {
    101             LOGERROR("Model %ls is boned with unboned animation", mdef->GetName().string().c_str());
     101            LOGERROR("Model %ls is boned with unboned animation", mdef->GetName().string8());
    102102            return;
    103103        }
    104104
  • source/renderer/PostprocManager.cpp

    diff --git a/source/renderer/PostprocManager.cpp b/source/renderer/PostprocManager.cpp
    index 4d4bf7b..becfb1c 100644
    a b std::vector<CStrW> CPostprocManager::GetPostEffects()  
    519519   
    520520    VfsPaths pathnames;
    521521    if(vfs::GetPathnames(g_VFS, path, 0, pathnames) < 0)
    522         LOGERROR("Error finding Post effects in '%ls'", path.string().c_str());
     522        LOGERROR("Error finding Post effects in '%ls'", path.string8());
    523523
    524524    for(size_t i = 0; i < pathnames.size(); i++)
    525525    {
  • source/renderer/SkyManager.cpp

    diff --git a/source/renderer/SkyManager.cpp b/source/renderer/SkyManager.cpp
    index 013edbd..49b6def 100644
    a b std::vector<CStrW> SkyManager::GetSkySets() const  
    207207    DirectoryNames subdirectories;
    208208    if(g_VFS->GetDirectoryEntries(path, 0, &subdirectories) < 0)
    209209    {
    210         LOGERROR("Error opening directory '%ls'", path.string().c_str());
     210        LOGERROR("Error opening directory '%ls'", path.string8());
    211211        return std::vector<CStrW>(1, GetSkySet()); // just return what we currently have
    212212    }
    213213
  • source/scriptinterface/ScriptInterface.cpp

    diff --git a/source/scriptinterface/ScriptInterface.cpp b/source/scriptinterface/ScriptInterface.cpp
    index aaba59a..31fa302 100644
    a b bool ScriptInterface::LoadGlobalScripts()  
    478478    {
    479479        if (!LoadGlobalScriptFile(*it))
    480480        {
    481             LOGERROR("LoadGlobalScripts: Failed to load script %ls", it->string().c_str());
     481            LOGERROR("LoadGlobalScripts: Failed to load script %ls", it->string8());
    482482            return false;
    483483        }
    484484    }
    bool ScriptInterface::LoadGlobalScriptFile(const VfsPath& path)  
    866866    JSAutoRequest rq(m->m_cx);
    867867    if (!VfsFileExists(path))
    868868    {
    869         LOGERROR("File '%ls' does not exist", path.string().c_str());
     869        LOGERROR("File '%ls' does not exist", path.string8());
    870870        return false;
    871871    }
    872872
    bool ScriptInterface::LoadGlobalScriptFile(const VfsPath& path)  
    876876
    877877    if (ret != PSRETURN_OK)
    878878    {
    879         LOGERROR("Failed to load file '%ls': %hs", path.string().c_str(), GetErrorString(ret));
     879        LOGERROR("Failed to load file '%ls': %hs", path.string8(), GetErrorString(ret));
    880880        return false;
    881881    }
    882882
    void ScriptInterface::ReadJSONFile(const VfsPath& path, JS::MutableHandleValue o  
    954954{
    955955    if (!VfsFileExists(path))
    956956    {
    957         LOGERROR("File '%ls' does not exist", path.string().c_str());
     957        LOGERROR("File '%ls' does not exist", path.string8());
    958958        return;
    959959    }
    960960
    void ScriptInterface::ReadJSONFile(const VfsPath& path, JS::MutableHandleValue o  
    964964
    965965    if (ret != PSRETURN_OK)
    966966    {
    967         LOGERROR("Failed to load file '%ls': %hs", path.string().c_str(), GetErrorString(ret));
     967        LOGERROR("Failed to load file '%ls': %hs", path.string8(), GetErrorString(ret));
    968968        return;
    969969    }
    970970
    971971    std::string content(file.DecodeUTF8()); // assume it's UTF-8
    972972
    973973    if (!ParseJSON(content, out))
    974         LOGERROR("Failed to parse '%ls'", path.string().c_str());
     974        LOGERROR("Failed to parse '%ls'", path.string8());
    975975}
    976976
    977977struct Stringifier
  • source/simulation2/Simulation2.cpp

    diff --git a/source/simulation2/Simulation2.cpp b/source/simulation2/Simulation2.cpp
    index 7db1fae..8573fe8 100644
    a b bool CSimulation2Impl::LoadScripts(CComponentManager& componentManager, std::set  
    187187        VfsPath filename = *it;
    188188        if (loadedScripts)
    189189            loadedScripts->insert(filename);
    190         LOGMESSAGE("Loading simulation script '%ls'", filename.string().c_str());
     190        LOGMESSAGE("Loading simulation script '%ls'", filename.string8());
    191191        if (!componentManager.LoadScript(filename))
    192192            ok = false;
    193193    }
    Status CSimulation2Impl::ReloadChangedFile(const VfsPath& path)  
    224224    if (!VfsFileExists(path))
    225225        return INFO::OK;
    226226
    227     LOGMESSAGE("Reloading simulation script '%ls'", path.string().c_str());
     227    LOGMESSAGE("Reloading simulation script '%ls'", path.string8());
    228228    if (!m_ComponentManager.LoadScript(path, true))
    229229        return ERR::FAIL;
    230230
    static std::vector<std::string> GetJSONData(const VfsPath& path)  
    828828    {
    829829        // Some error reading directory
    830830        wchar_t error[200];
    831         LOGERROR("Error reading directory '%ls': %ls", path.string().c_str(), StatusDescription(ret, error, ARRAY_SIZE(error)));
     831        LOGERROR("Error reading directory '%ls': %ls", path.string8(), StatusDescription(ret, error, ARRAY_SIZE(error)));
    832832        return std::vector<std::string>();
    833833    }
    834834
    static std::vector<std::string> GetJSONData(const VfsPath& path)  
    840840        PSRETURN ret = file.Load(g_VFS, *it);
    841841        if (ret != PSRETURN_OK)
    842842        {
    843             LOGERROR("GetJSONData: Failed to load file '%ls': %hs", path.string().c_str(), GetErrorString(ret));
     843            LOGERROR("GetJSONData: Failed to load file '%ls': %hs", path.string8(), GetErrorString(ret));
    844844            continue;
    845845        }
    846846
    static std::string ReadJSON(const VfsPath& path)  
    864864{
    865865    if (!VfsFileExists(path))
    866866    {
    867         LOGERROR("File '%ls' does not exist", path.string().c_str());
     867        LOGERROR("File '%ls' does not exist", path.string8());
    868868        return std::string();
    869869    }
    870870
    static std::string ReadJSON(const VfsPath& path)  
    873873    PSRETURN ret = file.Load(g_VFS, path);
    874874    if (ret != PSRETURN_OK)
    875875    {
    876         LOGERROR("Failed to load file '%ls': %hs", path.string().c_str(), GetErrorString(ret));
     876        LOGERROR("Failed to load file '%ls': %hs", path.string8(), GetErrorString(ret));
    877877        return std::string();
    878878    }
    879879
  • source/simulation2/components/CCmpAIManager.cpp

    diff --git a/source/simulation2/components/CCmpAIManager.cpp b/source/simulation2/components/CCmpAIManager.cpp
    index dab13d4..9efb936 100644
    a b private:  
    104104            m_Worker.LoadMetadata(path, &metadata);
    105105            if (metadata.isUndefined())
    106106            {
    107                 LOGERROR("Failed to create AI player: can't find %ls", path.string().c_str());
     107                LOGERROR("Failed to create AI player: can't find %ls", path.string8());
    108108                return false;
    109109            }
    110110
    private:  
    116116            JS::RootedValue ctor(cx);
    117117            if (!m_ScriptInterface->HasProperty(metadata, "moduleName"))
    118118            {
    119                 LOGERROR("Failed to create AI player: %ls: missing 'moduleName'", path.string().c_str());
     119                LOGERROR("Failed to create AI player: %ls: missing 'moduleName'", path.string8());
    120120                return false;
    121121            }
    122122
    private:  
    124124            if (!m_ScriptInterface->GetProperty(global, moduleName.c_str(), &objectWithConstructor)
    125125                || objectWithConstructor.isUndefined())
    126126            {
    127                 LOGERROR("Failed to create AI player: %ls: can't find the module that should contain the constructor: '%hs'", path.string().c_str(), moduleName.c_str());
     127                LOGERROR("Failed to create AI player: %ls: can't find the module that should contain the constructor: '%hs'", path.string8(), moduleName.c_str());
    128128                return false;
    129129            }
    130130
    131131            if (!m_ScriptInterface->GetProperty(metadata, "constructor", constructor))
    132132            {
    133                 LOGERROR("Failed to create AI player: %ls: missing 'constructor'", path.string().c_str());
     133                LOGERROR("Failed to create AI player: %ls: missing 'constructor'", path.string8());
    134134                return false;
    135135            }
    136136
    private:  
    138138            if (!m_ScriptInterface->GetProperty(objectWithConstructor, constructor.c_str(), &ctor)
    139139                || ctor.isNull())
    140140            {
    141                 LOGERROR("Failed to create AI player: %ls: can't find constructor '%hs'", path.string().c_str(), constructor.c_str());
     141                LOGERROR("Failed to create AI player: %ls: can't find constructor '%hs'", path.string8(), constructor.c_str());
    142142                return false;
    143143            }
    144144
    private:  
    160160
    161161            if (obj.isNull())
    162162            {
    163                 LOGERROR("Failed to create AI player: %ls: error calling constructor '%hs'", path.string().c_str(), constructor.c_str());
     163                LOGERROR("Failed to create AI player: %ls: error calling constructor '%hs'", path.string8(), constructor.c_str());
    164164                return false;
    165165            }
    166166
    public:  
    269269        {
    270270            if (!m_ScriptInterface->LoadGlobalScriptFile(*it))
    271271            {
    272                 LOGERROR("Failed to load script %ls", it->string().c_str());
     272                LOGERROR("Failed to load script %ls", it->string8());
    273273                return false;
    274274            }
    275275        }
    public:  
    391391        JS::RootedValue ctor(cx);
    392392        if (!m_ScriptInterface->GetProperty(global, "API3", &AIModule) || AIModule.isUndefined())
    393393        {
    394             LOGERROR("Failed to create shared AI component: %ls: can't find module '%hs'", path.string().c_str(), "API3");
     394            LOGERROR("Failed to create shared AI component: %ls: can't find module '%hs'", path.string8(), "API3");
    395395            return false;
    396396        }
    397397       
    398398        if (!m_ScriptInterface->GetProperty(AIModule, "SharedScript", &ctor)
    399399            || ctor.isUndefined())
    400400        {
    401             LOGERROR("Failed to create shared AI component: %ls: can't find constructor '%hs'", path.string().c_str(), "SharedScript");
     401            LOGERROR("Failed to create shared AI component: %ls: can't find constructor '%hs'", path.string8(), "SharedScript");
    402402            return false;
    403403        }
    404404       
    public:  
    440440       
    441441        if (tmpSharedAIObj.isNull())
    442442        {
    443             LOGERROR("Failed to create shared AI component: %ls: error calling constructor '%hs'", path.string().c_str(), "SharedScript");
     443            LOGERROR("Failed to create shared AI component: %ls: error calling constructor '%hs'", path.string8(), "SharedScript");
    444444            return false;
    445445        }
    446446       
  • source/simulation2/system/ComponentManager.cpp

    diff --git a/source/simulation2/system/ComponentManager.cpp b/source/simulation2/system/ComponentManager.cpp
    index ac4045c..86dae1f 100644
    a b std::vector<std::string> CComponentManager::Script_FindJSONFiles(ScriptInterface  
    12261226    {
    12271227        // Some error reading directory
    12281228        wchar_t error[200];
    1229         LOGERROR("Error reading directory '%ls': %ls", cbData.path.string().c_str(), StatusDescription(ret, error, ARRAY_SIZE(error)));
     1229        LOGERROR("Error reading directory '%ls': %ls", cbData.path.string8(), StatusDescription(ret, error, ARRAY_SIZE(error)));
    12301230    }
    12311231   
    12321232    return cbData.templates;
  • source/soundmanager/SoundManager.cpp

    diff --git a/source/soundmanager/SoundManager.cpp b/source/soundmanager/SoundManager.cpp
    index c3977bf..1fe169f 100644
    a b void CSoundManager::al_check(const char* caller, int line)  
    216216
    217217Status CSoundManager::ReloadChangedFiles(const VfsPath& UNUSED(path))
    218218{
    219 //  LOGERROR("GUI file '%ls' changed - reloading page", path.string().c_str());
     219//  LOGERROR("GUI file '%ls' changed - reloading page", path.string8());
    220220
    221221    return INFO::OK;
    222222}
    void CSoundManager::PlayAsGroup(const VfsPath& groupPath, CVector3D sourcePos, e  
    654654        group = new CSoundGroup();
    655655        if (!group->LoadSoundGroup(L"audio/" + groupPath.string()))
    656656        {
    657             LOGERROR("Failed to load sound group '%ls'", groupPath.string().c_str());
     657            LOGERROR("Failed to load sound group '%ls'", groupPath.string8());
    658658            delete group;
    659659            group = NULL;
    660660        }
  • source/soundmanager/data/SoundData.cpp

    diff --git a/source/soundmanager/data/SoundData.cpp b/source/soundmanager/data/SoundData.cpp
    index 65647d4..22a8dd0 100644
    a b CSoundData* CSoundData::SoundDataFromOgg(const VfsPath& itemPath)  
    107107    }
    108108    else
    109109    {
    110         LOGERROR("could not initialize ogg data at %ls", itemPath.string().c_str());
     110        LOGERROR("could not initialize ogg data at %ls", itemPath.string8());
    111111        delete oggAnswer;
    112112    }
    113113
  • source/soundmanager/scripting/SoundGroup.cpp

    diff --git a/source/soundmanager/scripting/SoundGroup.cpp b/source/soundmanager/scripting/SoundGroup.cpp
    index 762b513..ebd9bc0 100644
    a b void CSoundGroup::UploadPropertiesAndPlay(size_t theIndex, const CVector3D& posi  
    197197            itemRollOff = 0;
    198198       
    199199        if ( sndData->IsStereo() )
    200             LOGWARNING( "OpenAL: stereo sounds can't be positioned: %ls", sndData->GetFileName()->string().c_str() );
     200            LOGWARNING( "OpenAL: stereo sounds can't be positioned: %ls", sndData->GetFileName()->string8() );
    201201
    202202        hSound->SetLocation(CVector3D((sndDist * sin(offSet)), 0, - sndDist * cos(offSet)));
    203203        hSound->SetRollOff(itemRollOff);
    static void HandleError(const CStrW& message, const VfsPath& pathname, Status er  
    227227{
    228228    if (err == ERR::AGAIN)
    229229        return; // open failed because sound is disabled (don't log this)
    230     LOGERROR("%ls: pathname=%ls, error=%ls", message.c_str(), pathname.string().c_str(), ErrorString(err));
     230    LOGERROR("%ls: pathname=%ls, error=%ls", message.c_str(), pathname.string8(), ErrorString(err));
    231231}
    232232
    233233void CSoundGroup::PlayNext(const CVector3D& position, entity_id_t source)