summaryrefslogtreecommitdiff
path: root/src/gui/sdlfont.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2013-09-22 15:56:01 +0300
committerAndrei Karas <akaras@inbox.ru>2013-09-22 16:28:10 +0300
commitfbad53d1a8cc89d07227165042cd55e7ed9c5dd2 (patch)
tree07a0105853e97088f1a091caecc3bb2fb4968c13 /src/gui/sdlfont.cpp
parent87b21ba61d7a8c322d658bd6b8d9f75b9e711263 (diff)
downloadmanaverse-fbad53d1a8cc89d07227165042cd55e7ed9c5dd2.tar.gz
manaverse-fbad53d1a8cc89d07227165042cd55e7ed9c5dd2.tar.bz2
manaverse-fbad53d1a8cc89d07227165042cd55e7ed9c5dd2.tar.xz
manaverse-fbad53d1a8cc89d07227165042cd55e7ed9c5dd2.zip
add support in ADNROID+SDL2 for loading data from assets.
Diffstat (limited to 'src/gui/sdlfont.cpp')
-rw-r--r--src/gui/sdlfont.cpp9
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,