History

dont use floating point format specifiers. they are slow.

mischief committed 11 years ago

Commit 58efabe1 parent bb4bad31 file · +2 −2Browse files

Unified · Split

ui.c+2−2
@@ -273,7 +273,7 @@ drawlevel(Level *l, Tileset *ts, Rectangle r) · 272 unmodified lines
273273 if(t->monst != nil){
274274 m = t->monst;
275275 hp = m->hp, maxhp = m->maxhp;
276− snprint(buf, sizeof(buf), "%.0f/%.0f HP", hp, maxhp);
276+ snprint(buf, sizeof(buf), "%d/%d HP", (int)hp, (int)maxhp);
277277 if(hp > (maxhp/4)*3)
278278 c = ui.cols[CGREEN];
279279 else if(hp > maxhp/2)
@@ -352,7 +352,7 @@ drawui(Rectangle r) · 72 unmodified lines
352352 p.x += sw;
353353
354354 hp = player->hp, maxhp = player->maxhp;
355− snprint(buf, sizeof(buf), "HP:%.0f/%.0f", hp, maxhp);
355+ snprint(buf, sizeof(buf), "HP:%d/%d", (int)hp, (int)maxhp);
356356 if(hp > (maxhp/4)*3)
357357 c = ui.cols[CGREEN];
358358 else if(hp > maxhp/2)