Mercurial > hg > batmud > maputils
changeset 2079:f244c38b9d47
Minor cleanups.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Wed, 21 Aug 2019 15:00:15 +0300 |
parents | 6e8ecda15f84 |
children | 11bb8dc0a146 |
files | libmaputils.c |
diffstat | 1 files changed, 6 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/libmaputils.c Wed Aug 21 14:52:56 2019 +0300 +++ b/libmaputils.c Wed Aug 21 15:00:15 2019 +0300 @@ -320,11 +320,10 @@ char *muColorToCSSColor(char *buf, const size_t len, const int c) { - assert(c >= 0); - assert(c < nmapColors); + const MapColor *col = &mapColors[c]; snprintf(buf, len, "#%02x%02x%02x", - mapColors[c].cr, mapColors[c].cg, mapColors[c].cb); + col->cr, col->cg, col->cb); return buf; } @@ -430,11 +429,13 @@ for (int n = 0; n < nmapColors; n++) { + const MapColor *col = &mapColors[n]; + fprintf(outFile, " %s.%c { %s: #%02x%02x%02x;%s%s }\n", tagName, 'a'+n, propName ? propName : "color", - mapColors[n].cr, mapColors[n].cg, mapColors[n].cb, - mapColors[n].bold ? " font-weight: bold;" : "", + col->cr, col->cg, col->cb, + col->bold ? " font-weight: bold;" : "", extra ? extra : ""); } }