mirror of
https://github.com/kichikuou/system3-sdl2.git
synced 2026-10-14 01:59:14 +03:00
Do not use SDL_RWFromFile on Windows
It does not work in the MSVC build of SDL2 (although it works in Mingw-w64's SDL2 package). Fixes #11.
This commit is contained in:
+2
-7
@@ -63,14 +63,9 @@ AGS::AGS(NACT* parent, const Config& config) : nact(parent), dirty(false)
|
||||
// フォント
|
||||
TTF_Init();
|
||||
if (!config.font_file.empty()) {
|
||||
// We cannot use SDL_RWFromFile() here because it does not resolve
|
||||
// relative paths using the current directory on Android.
|
||||
FILE *fp = fopen(config.font_file.c_str(), "rb");
|
||||
if (!fp)
|
||||
parent->fatal("Cannot open font file %s", config.font_file.c_str());
|
||||
rw_font = SDL_RWFromFP(fp, SDL_TRUE);
|
||||
rw_font = open_file(config.font_file.c_str());
|
||||
if (!rw_font)
|
||||
parent->fatal("Cannot load font file %s: %s", config.font_file.c_str(), SDL_GetError());
|
||||
parent->fatal("Cannot open font file %s", config.font_file.c_str());
|
||||
} else {
|
||||
rw_font = open_resource(FONT_RESOURCE_NAME, "fonts");
|
||||
if (!rw_font)
|
||||
|
||||
Reference in New Issue
Block a user