From 916d5010bd0afad823d10a2087ebb11c9456573d Mon Sep 17 00:00:00 2001 From: Alex Zolotarev Date: Mon, 28 Nov 2011 17:20:42 +0300 Subject: [PATCH] [android] Closed #426 - non working white/black listing for fonts --- platform/platform_android.cpp | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/platform/platform_android.cpp b/platform/platform_android.cpp index a2f383d9f5..a5d1ab1b1e 100644 --- a/platform/platform_android.cpp +++ b/platform/platform_android.cpp @@ -25,11 +25,9 @@ ModelReader * Platform::GetReader(string const & file) const if (IsFileExists(m_writableDir + file)) return new FileReader(ReadPathForFile(file), 10, 12); else - { // paths from GetFilesInDir will already contain "assets/" - if (file.find("assets/") != string::npos) - return new ZipFileReader(m_resourcesDir, file); - else - return new ZipFileReader(m_resourcesDir, "assets/" + file); + { + ASSERT_EQUAL(file.find("assets/"), string::npos, ("Do not use assets/, only file name")); + return new ZipFileReader(m_resourcesDir, "assets/" + file); } } @@ -48,7 +46,13 @@ void Platform::GetFilesInDir(string const & directory, string const & mask, File if (it->find(fixedMask) == string::npos) it = res.erase(it); else + { + // Remove assets/ prefix - clean files are needed for fonts white/blacklisting logic + static size_t const ASSETS_LENGTH = 7; + if (it->find("assets/") == 0) + it->erase(0, ASSETS_LENGTH); ++it; + } } } else