Skip to content
Snippets Groups Projects
Commit bde8f23a authored by dg's avatar dg
Browse files

Error reporting on bad font load

git-svn-id: http://svn.net-core.org/repos/t-engine4@5087 51575b47-30f0-44d4-a5cc-537603b46e54
parent a952c28e
No related branches found
No related tags found
No related merge requests found
......@@ -377,7 +377,18 @@ static int sdl_new_font(lua_State *L)
TTF_Font **f = (TTF_Font**)lua_newuserdata(L, sizeof(TTF_Font*));
auxiliar_setclass(L, "sdl{font}", -1);
*f = TTF_OpenFontRW(PHYSFSRWOPS_openRead(name), TRUE, size);
SDL_RWops *src = PHYSFSRWOPS_openRead(name);
if (!src)
{
return luaL_error(L, "could not load font: %s (%d)", name, size);
}
*f = TTF_OpenFontRW(src, TRUE, size);
if (!*f)
{
return luaL_error(L, "could not load font: %s (%d)", name, size);
}
return 1;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment