From: terencehill Date: Sat, 27 May 2017 11:11:13 +0000 (+0200) Subject: Allow const folding in drawpic_aspect macro, which is called many times per frame... X-Git-Tag: xonotic-v0.8.5~2752 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=8053230c69e5a6cd602a8938758f2c85011b8085;p=xonotic%2Fxonotic-data.pk3dir.git Allow const folding in drawpic_aspect macro, which is called many times per frame in the hud --- 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