diff --git a/readme.txt b/readme.txt index c4d53e6..0a48c0c 100644 --- a/readme.txt +++ b/readme.txt @@ -49,6 +49,9 @@ Release notes: The problem isn't really fixed, but it will no longer corrupt your game text. + Compiler: better messages when adding resource files to an + .aastory file, on both success and failure + Backend: styles are now properly reset after printing a progress bar inside a div on Z-machine. (Previously it would reset to unstyled text, even if the div was bold or italic.) diff --git a/src/backend_aa.c b/src/backend_aa.c index e251365..2449027 100644 --- a/src/backend_aa.c +++ b/src/backend_aa.c @@ -176,7 +176,7 @@ static uint8_t resolve_aachar(uint32_t uchar) { } if(i >= 128) { - report(LVL_ERR, 0, "Too many distinct unicode characters in the text."); + report(LVL_ERR, 0, "Too many distinct Unicode characters in the text."); exit(1); } @@ -3547,6 +3547,14 @@ static void chunks_file(FILE *f, struct program *prg, char *resdir) { exit(1); } size = (uint32_t) st.st_size; + if(size == 0) { + report( + LVL_ERR, + prg->resources[i].line, + "Resource file \"%s\" is empty", + path); + exit(1); + } buf = malloc(size); if(1 != fread(buf, size, 1, datafile)) { report( @@ -3565,6 +3573,8 @@ static void chunks_file(FILE *f, struct program *prg, char *resdir) { if(pad) fputc(0, f); free(buf); free(pathbuf); + + report(LVL_DEBUG, 0, "Added resource file %s (%d bytes)", prg->resources[i].stem, size); } } }