diff options
author | Andrei Karas <akaras@inbox.ru> | 2013-09-27 23:32:38 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2013-09-27 23:32:38 +0300 |
commit | 74cb5bcd686590f9ec1fc409118ca34db7ebd579 (patch) | |
tree | 38479109864253b22dec84571eb0284100c6e901 /src | |
parent | 4102bb248ed5f5efcd81d317a876318c91bad4d6 (diff) | |
download | mv-74cb5bcd686590f9ec1fc409118ca34db7ebd579.tar.gz mv-74cb5bcd686590f9ec1fc409118ca34db7ebd579.tar.bz2 mv-74cb5bcd686590f9ec1fc409118ca34db7ebd579.tar.xz mv-74cb5bcd686590f9ec1fc409118ca34db7ebd579.zip |
Fix fonts loading on windows.
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/sdlfont.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/gui/sdlfont.cpp b/src/gui/sdlfont.cpp index 13749895a..f316b46d6 100644 --- a/src/gui/sdlfont.cpp +++ b/src/gui/sdlfont.cpp @@ -31,6 +31,9 @@ #include "resources/image.h" #include "resources/imagehelper.h" +#ifdef WIN32 +#include "resources/resourcemanager.h" +#endif #include "resources/surfaceimagehelper.h" #include "utils/paths.h" @@ -395,11 +398,15 @@ SDLFont::~SDLFont() TTF_Font *SDLFont::openFont(const char *const name, const int size) { - logger->log("font to open: %s", name); +#ifdef WIN32 + return TTF_OpenFontIndex(ResourceManager::getInstance()->getPath( + name).c_str(), size, 0); +#else SDL_RWops *const rw = MPHYSFSRWOPS_openRead(name); if (!rw) return nullptr; return TTF_OpenFontIndexRW(rw, 1, size, 0); +#endif } void SDLFont::loadFont(std::string filename, |