-/* NetHack 3.7 tilemap.c $NHDT-Date: 1639622363 2021/12/16 02:39:23 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.63 $ */
+/* NetHack 3.7 tilemap.c $NHDT-Date: 1640987372 2021/12/31 21:49:32 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.64 $ */
/* Copyright (c) 2016 by Michael Allison */
/* NetHack may be freely redistributed. See license for details. */
"dark", "noxious", "muddy", "wet", "magical", "fiery", "frosty",
};
-const char *zap_texts[] = { "missile", "fire", "frost", "sleep",
- "death", "lightning", "poison gas", "acid" };
+const char *zap_texts[] = {
+ "missile", "fire", "frost", "sleep",
+ "death", "lightning", "poison gas", "acid",
+};
-enum tilesrc {monsters_file, objects_file, other_file, generated};
-const char *tilesrc_texts[] = { "monsters.txt", "objects.txt", "other.txt", "generated" };
+enum tilesrc { monsters_file, objects_file, other_file, generated };
+const char *tilesrc_texts[] = {
+ "monsters.txt", "objects.txt", "other.txt", "generated",
+};
struct tilemap_t {
short tilenum;
}
/* go beyond NUMMONS to cover off the invisible tile at the
end of monsters.txt so that the tile mapping matches things
- the .bmp file (for example) */
+ in the .bmp file (for example) */
file_entry = 0;
#if defined(OBTAIN_TILEMAP)
add_tileref(tilenum, NO_GLYPH, monsters_file, file_entry,
#if defined(OBTAIN_TILEMAP)
for (i = 0; i < MAX_GLYPH; ++i) {
- Fprintf(tilemap_file, "glyph[%04d] [%04d] %-80s\n", i, tilemap[i].tilenum,
- tilemap[i].name);
+ Fprintf(tilemap_file, "glyph[%04d] [%04d] %-80s\n",
+ i, tilemap[i].tilenum, tilemap[i].name);
}
dump_tilerefs(tilemap_file);
fclose(tilemap_file);
Fprintf(ofp,
"/* This file is automatically generated. Do not edit. */\n");
Fprintf(ofp, "\n#include \"hack.h\"\n");
+ Fprintf(ofp, "\n#ifdef USE_TILES\n");
Fprintf(ofp, "\nint total_tiles_used = %d,\n", laststatuetile + 1);
Fprintf(ofp, "%sTile_corr = %d,\n", indent, TILE_corr); /* X11 references it */
Fprintf(ofp, "%sTile_stone = %d,\n", indent, TILE_stone);
Fprintf(ofp, "%sTile_unexplored = %d;\n\n", indent, TILE_unexplored);
- Fprintf(ofp, "/* glyph, ttychar, { color, symidx, ovidx, glyphflags, tileidx} */\n");
+ Fprintf(ofp,
+ "/* glyph, ttychar, { color, symidx, ovidx, glyphflags, tileidx} */\n");
Fprintf(ofp, "const glyph_info nul_glyphinfo = { \n");
Fprintf(ofp, "%sNO_GLYPH, ' ',\n", indent);
Fprintf(ofp, "%s%s{ /* glyph_map */\n", indent, indent);
Fprintf(ofp, "%s%s%sNO_COLOR, SYM_UNEXPLORED + SYM_OFF_X,\n",
- indent, indent, indent);
- Fprintf(ofp, "%s%s%sMG_UNEXPL, %d\n", indent, indent, indent, TILE_unexplored);
+ indent, indent, indent);
+ Fprintf(ofp, "%s%s%sMG_UNEXPL, %d\n", indent, indent, indent,
+ TILE_unexplored);
Fprintf(ofp, "%s%s}\n", indent, indent);
Fprintf(ofp, "};\n");
Fprintf(ofp, "\nglyph_map glyphmap[MAX_GLYPH] = {\n");
tilemap[i].name);
}
Fprintf(ofp, "};\n");
+ Fprintf(ofp, "\n#endif /* USE_TILES */\n");
Fprintf(ofp, "\n/*tile.c*/\n");
(void) fclose(ofp);