From: terencehill Date: Mon, 19 Dec 2011 22:20:17 +0000 (+0100) Subject: Small cleanup X-Git-Tag: xonotic-v0.8.1~12^2~62 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=9c60f9320ed9ff2c468c96e6837de9c164b15954;p=xonotic%2Fxonotic-data.pk3dir.git Small cleanup --- diff --git a/qcsrc/client/hud.qc b/qcsrc/client/hud.qc index 160a988db..aa857db1b 100644 --- a/qcsrc/client/hud.qc +++ b/qcsrc/client/hud.qc @@ -4902,28 +4902,27 @@ void HUD_ItemsTime(void) } float rows, columns, row, column; - vector itemstime_size; - + const float ASPECT_RATIO = 3; rows = mySize_y/mySize_x; - rows = bound(1, floor((sqrt(4 * (3/1) * rows * count + rows * rows) + rows + 0.5) / 2), count); - // ^^^ itemstime item aspect goes here + rows = bound(1, floor((sqrt(4 * ASPECT_RATIO * rows * count + rows * rows) + rows + 0.5) / 2), count); columns = ceil(count/rows); + vector itemstime_size; itemstime_size = eX * mySize_x*(1/columns) + eY * mySize_y*(1/rows); local noref vector offset; // fteqcc sucks float newSize; - if(itemstime_size_x/itemstime_size_y > 3) + if(itemstime_size_x/itemstime_size_y > ASPECT_RATIO) { - newSize = 3 * itemstime_size_y; + newSize = ASPECT_RATIO * itemstime_size_y; offset_x = itemstime_size_x - newSize; pos_x += offset_x/2; itemstime_size_x = newSize; } else { - newSize = 1/3 * itemstime_size_x; + newSize = 1/ASPECT_RATIO * itemstime_size_x; offset_y = itemstime_size_y - newSize; pos_y += offset_y/2; itemstime_size_y = newSize;