Add logging in font loading

dev-time-step
krzys-h 2016-02-18 18:07:29 +01:00
parent 1b21c387bb
commit 0256b1aa39
2 changed files with 4 additions and 1 deletions

View File

@ -29,6 +29,8 @@
CSDLMemoryWrapper::CSDLMemoryWrapper(const std::string& filename)
: m_rwops(nullptr)
{
GetLogger()->Trace("Opening SDL memory wrapper for file '%s'\n", filename.c_str());
if (!PHYSFS_isInit())
{
GetLogger()->Error("PHYSFS not initialized!\n");

View File

@ -983,9 +983,10 @@ CachedFont* CText::GetOrOpenFont(FontType font, float size)
auto file = CResourceManager::GetSDLMemoryHandler(mf->fileName);
if (!file->IsOpen())
{
m_error = std::string("Unable to open file");
m_error = std::string("Unable to open file '") + mf->fileName + "' (font size = " + StrUtils::ToString<float>(size) + ")";
return nullptr;
}
GetLogger()->Debug("Loaded font file %s (font size = %.1f)\n", mf->fileName.c_str(), size);
auto newFont = MakeUnique<CachedFont>(std::move(file), pointSize);
if (newFont->font == nullptr)