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
273 if(t->monst != nil){273 if(t->monst != nil){
274 m = t->monst;274 m = t->monst;
275 hp = m->hp, maxhp = m->maxhp;275 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);
277 if(hp > (maxhp/4)*3)277 if(hp > (maxhp/4)*3)
278 c = ui.cols[CGREEN];278 c = ui.cols[CGREEN];
279 else if(hp > maxhp/2)279 else if(hp > maxhp/2)
@@ -352,7 +352,7 @@ drawui(Rectangle r) · 72 unmodified lines
352 p.x += sw;352 p.x += sw;
353 353
354 hp = player->hp, maxhp = player->maxhp;354 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);
356 if(hp > (maxhp/4)*3)356 if(hp > (maxhp/4)*3)
357 c = ui.cols[CGREEN];357 c = ui.cols[CGREEN];
358 else if(hp > maxhp/2)358 else if(hp > maxhp/2)