option to write floats as ints when possible

omit the ".0" in values like "3.0"
This commit is contained in:
ac-stef
2015-05-18 14:59:41 +02:00
parent e5fc8b35a2
commit c4e1155dcc
3 changed files with 14 additions and 15 deletions
+2 -4
View File
@@ -542,8 +542,7 @@ const char *gettextureslot(int i)
if(slots.inrange(i))
{
Slot &s = slots[i];
defformatstring(d)("%d", int(s.orgscale));
formatstring(res)("texture %s \"%s\"", s.orgscale == int(s.orgscale) ? d : floatstr(s.orgscale), s.name);
formatstring(res)("texture %s \"%s\"", floatstr(s.orgscale, true), s.name);
return res;
}
else return NULL;
@@ -1071,8 +1070,7 @@ void edittextureslot(int *n, char *scale, char *name) // edit slot parameters !=
unsavededits++;
hdr.flags |= MHF_AUTOMAPCONFIG; // requires automapcfg
}
defformatstring(d)("%d", int(s.orgscale));
formatstring(res)("%s \"%s\"", s.orgscale == int(s.orgscale) ? d : floatstr(s.orgscale), s.name);
formatstring(res)("%s \"%s\"", floatstr(s.orgscale, true), s.name);
}
result(res);
}