]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Allow const folding in drawpic_aspect macro, which is called many times per frame...
authorterencehill <piuntn@gmail.com>
Sat, 27 May 2017 11:11:13 +0000 (13:11 +0200)
committerterencehill <piuntn@gmail.com>
Sat, 27 May 2017 11:11:13 +0000 (13:11 +0200)
qcsrc/client/miscfunctions.qh

index 62de4565e53bff2549a9b361f063ab0791c7004b..cbb0e071dfb87f8eca4e210be493db8e69d95bc1 100644 (file)
@@ -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