From: terencehill Date: Mon, 2 Feb 2015 16:45:38 +0000 (+0100) Subject: Weapons panel: better way to enlarge weapon_size to match desired aspect X-Git-Tag: xonotic-v0.8.1~129^2~3 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=73779b91155c24aa9df8612c9d3d83da47ce70bb;p=xonotic%2Fxonotic-data.pk3dir.git Weapons panel: better way to enlarge weapon_size to match desired aspect --- diff --git a/qcsrc/client/hud.qc b/qcsrc/client/hud.qc index 7517775da..9bc90d49f 100644 --- a/qcsrc/client/hud.qc +++ b/qcsrc/client/hud.qc @@ -535,13 +535,14 @@ void HUD_Weapons(void) weapon_size_y = old_panel_size_y / rows; // reduce rows and columns as needed - float columns_save = columns; columns = ceil(weapon_count / rows); rows = ceil(weapon_count / columns); - // enlarge weapon_size to match desired aspect ratio in order to capitalize on panel space - if(columns < columns_save) - weapon_size_x = min(old_panel_size_x / columns, aspect * weapon_size_y); + // NOTE: although weapons should aways look the same even if onlyowned is disabled, + // we enlarge them a bit when possible to better match the desired aspect ratio + // as they look much better + weapon_size_x = min(old_panel_size_x / columns, aspect * weapon_size_y); + weapon_size_y = min(old_panel_size_y / rows, weapon_size_x / aspect); // reduce size of the panel panel_size_x = columns * weapon_size_x;