diff options
| author | KonAki <konaki@anokonaki.org> | 2026-10-15 05:43:54 +0800 |
|---|---|---|
| committer | KonAki <konaki@anokonaki.org> | 2026-10-15 05:43:54 +0800 |
| commit | dcdff7cbf60eb04546c9174ae12c067bc6b4a405 (patch) | |
| tree | e2c0c08876a3a7632d5b32e233185f23cbb51dc1 | |
| parent | 8f7ddcba35ca1c3478fd0baad756f8031b5d5a3c (diff) | |
say when the output folder is missing
| -rw-r--r-- | tools/mzmap.c | 12 | ||||
| -rw-r--r-- | tools/mzscript.c | 6 |
2 files changed, 9 insertions, 9 deletions
diff --git a/tools/mzmap.c b/tools/mzmap.c index fae8221..18dd623 100644 --- a/tools/mzmap.c +++ b/tools/mzmap.c @@ -257,7 +257,7 @@ static int writeMap(const char *folder, const char *outFolder, const char *name, snprintf(path, sizeof path, "%s/%s_map%03d.inc", outFolder, name, id); f = fopen(path, "wb"); if (!f) { - fprintf(stderr, "cannot write %s\n", path); + fprintf(stderr, "cannot write %s (does the output folder exist?)\n", path); kon_jsonFree(json); return -1; } @@ -341,7 +341,7 @@ static int writeMap(const char *folder, const char *outFolder, const char *name, else fputs("NULL, 0\n};\n", f); if (ferror(f) || fclose(f) != 0) { - fprintf(stderr, "cannot write %s\n", path); + fprintf(stderr, "cannot write %s (does the output folder exist?)\n", path); kon_jsonFree(json); return -1; } @@ -435,7 +435,7 @@ int main(int argc, char **argv) snprintf(path, sizeof path, "%s/%s_maps.c", outFolder, name); f = fopen(path, "wb"); if (!f) { - fprintf(stderr, "cannot write %s\n", path); + fprintf(stderr, "cannot write %s (does the output folder exist?)\n", path); return 1; } fprintf(f, "/* written by mzmap, the maps, tilesets and start settings of the game */\n\n#include \"%s_maps.h\"\n\n#include <stddef.h>\n\n", name); @@ -488,7 +488,7 @@ int main(int argc, char **argv) fprintf(f, "const kon_rmSystem_t %s_system = {\"\", 0, 0, 0, NULL, 0, 0, 0, 0, 0, {0, 0, 0}};\n", name); } if (ferror(f) || fclose(f) != 0) { - fprintf(stderr, "cannot write %s\n", path); + fprintf(stderr, "cannot write %s (does the output folder exist?)\n", path); return 1; } @@ -497,7 +497,7 @@ int main(int argc, char **argv) snprintf(path, sizeof path, "%s/%s_maps.h", outFolder, name); f = fopen(path, "wb"); if (!f) { - fprintf(stderr, "cannot write %s\n", path); + fprintf(stderr, "cannot write %s (does the output folder exist?)\n", path); return 1; } fprintf(f, "/* written by mzmap */\n\n#ifndef %s_MAPS_H\n#define %s_MAPS_H\n\n#include \"konrmmap.h\"\n\n", upper, upper); @@ -506,7 +506,7 @@ int main(int argc, char **argv) fprintf(f, "/* index by the id the game uses, NULL when there is none */\nextern const kon_rmMap_t *const %s_maps[%d];\nextern const kon_rmTileset_t *const %s_tilesets[%d];\nextern const kon_rmSystem_t %s_system;\n\n", name, highestMap + 1, name, highestSet + 1, name); fprintf(f, "#ifdef __cplusplus\n}\n#endif\n#endif\n"); if (ferror(f) || fclose(f) != 0) { - fprintf(stderr, "cannot write %s\n", path); + fprintf(stderr, "cannot write %s (does the output folder exist?)\n", path); return 1; } diff --git a/tools/mzscript.c b/tools/mzscript.c index 38b2f6d..a0d48d6 100644 --- a/tools/mzscript.c +++ b/tools/mzscript.c @@ -771,7 +771,7 @@ static int writeSpeakers(const char *prefix, const char *name, int scratchSwitch snprintf(path, sizeof path, "%s_speakers.h", prefix); f = fopen(path, "wb"); if (!f) { - fprintf(stderr, "cannot write %s\n", path); + fprintf(stderr, "cannot write %s (does the output folder exist?)\n", path); return 1; } fprintf(f, "/* made by mzscript, don't edit */\n\n#ifndef %s_SPEAKERS_H\n#define %s_SPEAKERS_H\n\n", upper, upper); @@ -786,7 +786,7 @@ static int writeSpeakers(const char *prefix, const char *name, int scratchSwitch snprintf(path, sizeof path, "%s_speakers.c", prefix); f = fopen(path, "wb"); if (!f) { - fprintf(stderr, "cannot write %s\n", path); + fprintf(stderr, "cannot write %s (does the output folder exist?)\n", path); return 1; } fprintf(f, "/* made by mzscript, don't edit */\n\n#include \"%s_speakers.h\"\n\n", base); @@ -908,7 +908,7 @@ int main(int argc, char **argv) snprintf(path, sizeof path, "%s.kons", prefix); f = fopen(path, "wb"); if (!f || fwrite(out.p, 1, out.n, f) != out.n || fclose(f) != 0) { - fprintf(stderr, "cannot write %s\n", path); + fprintf(stderr, "cannot write %s (does the output folder exist?)\n", path); return 1; } } |
