diff options
author | Andrei Karas <akaras@inbox.ru> | 2013-09-22 15:56:01 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2013-09-22 16:28:10 +0300 |
commit | fbad53d1a8cc89d07227165042cd55e7ed9c5dd2 (patch) | |
tree | 07a0105853e97088f1a091caecc3bb2fb4968c13 /src/gui | |
parent | 87b21ba61d7a8c322d658bd6b8d9f75b9e711263 (diff) | |
download | manaplus-fbad53d1a8cc89d07227165042cd55e7ed9c5dd2.tar.gz manaplus-fbad53d1a8cc89d07227165042cd55e7ed9c5dd2.tar.bz2 manaplus-fbad53d1a8cc89d07227165042cd55e7ed9c5dd2.tar.xz manaplus-fbad53d1a8cc89d07227165042cd55e7ed9c5dd2.zip |
add support in ADNROID+SDL2 for loading data from assets.
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/sdlfont.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/gui/sdlfont.cpp b/src/gui/sdlfont.cpp index eb05bea8d..07da298b2 100644 --- a/src/gui/sdlfont.cpp +++ b/src/gui/sdlfont.cpp @@ -35,6 +35,7 @@ #include "resources/surfaceimagehelper.h" #include "utils/paths.h" +#include "utils/physfsrwops.h" #include "utils/sdlcheckutils.h" #include <guichan/exception.hpp> @@ -397,8 +398,12 @@ SDLFont::~SDLFont() TTF_Font *SDLFont::openFont(const char *const name, const int size) { - return TTF_OpenFontIndex(ResourceManager::getInstance()->getPath( - name).c_str(), size, 0); + logger->log("font to open: %s", name); + ResourceManager *const resman = ResourceManager::getInstance(); + SDL_RWops *const rw = MPHYSFSRWOPS_openRead(name); + if (!rw) + return nullptr; + return TTF_OpenFontIndexRW(rw, 1, size, 0); } void SDLFont::loadFont(std::string filename, |