Mercurial > hg > dmlib
diff tools/ppl.c @ 730:3d813c81f33c
More work on resources API.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Sun, 21 Apr 2013 19:29:00 +0300 |
parents | d9888292f971 |
children | ab645f4cb8fa |
line wrap: on
line diff
--- a/tools/ppl.c Sun Apr 21 18:34:13 2013 +0300 +++ b/tools/ppl.c Sun Apr 21 19:29:00 2013 +0300 @@ -581,11 +581,10 @@ return 1; } - if ((file = dmf_create_stdio(optFilename, "rb")) == NULL) + if ((result = dmf_create_stdio(optFilename, "rb", &file)) != DMERR_OK) { - int err = dmGetErrno(); dmError("Error opening file '%s', %d: (%s)\n", - optFilename, err, dmErrorStr(err)); + optFilename, result, dmErrorStr(result)); return 1; } @@ -634,11 +633,11 @@ } // Get font -// file = dmf_create_stdio("fnsmall.fnt", "rb"); - file = dmf_create_memio(NULL, "pplfont.fnt", engineSetupFont, sizeof(engineSetupFont)); - if (file == NULL) + result = dmf_create_memio(NULL, "pplfont.fnt", engineSetupFont, sizeof(engineSetupFont), &file); + if (result != DMERR_OK) { - dmError("Error opening font file 'pplfont.fnt'.\n"); + dmError("Error opening font file 'pplfont.fnt', #%d: %s\n", + result, dmErrorStr(result)); goto error_exit; } result = dmLoadBitmapFont(file, &font);