From 8053230c69e5a6cd602a8938758f2c85011b8085 Mon Sep 17 00:00:00 2001 From: terencehill Date: Sat, 27 May 2017 13:11:13 +0200 Subject: [PATCH] Allow const folding in drawpic_aspect macro, which is called many times per frame in the hud --- qcsrc/client/miscfunctions.qh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/qcsrc/client/miscfunctions.qh b/qcsrc/client/miscfunctions.qh index 62de4565e..cbb0e071d 100644 --- a/qcsrc/client/miscfunctions.qh +++ b/qcsrc/client/miscfunctions.qh @@ -119,12 +119,12 @@ string _drawpic_picpath; _drawpic_oldsz = _drawpic_sz.x;\ _drawpic_sz.x = _drawpic_sz.y * _drawpic_imgaspect;\ if(_drawpic_sz.x)\ - drawpic(pos + eX * (_drawpic_oldsz - _drawpic_sz.x) * 0.5, pic, _drawpic_sz, color, theAlpha, drawflag);\ + drawpic(pos + eX * 0.5 * (_drawpic_oldsz - _drawpic_sz.x), pic, _drawpic_sz, color, theAlpha, drawflag);\ } else {\ _drawpic_oldsz = _drawpic_sz.y;\ _drawpic_sz.y = _drawpic_sz.x / _drawpic_imgaspect;\ if(_drawpic_sz.y)\ - drawpic(pos + eY * (_drawpic_oldsz - _drawpic_sz.y) * 0.5, pic, _drawpic_sz, color, theAlpha, drawflag);\ + drawpic(pos + eY * 0.5 * (_drawpic_oldsz - _drawpic_sz.y), pic, _drawpic_sz, color, theAlpha, drawflag);\ }\ }\ } MACRO_END -- 2.39.2