From: terencehill Date: Sat, 1 Dec 2018 19:19:08 +0000 (+0100) Subject: Optimize 2 macros X-Git-Tag: xonotic-v0.8.5~1708 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=5105f6fe0679d7e2e77bcbfc86501997f51c6a23;p=xonotic%2Fxonotic-data.pk3dir.git Optimize 2 macros --- diff --git a/qcsrc/client/view.qc b/qcsrc/client/view.qc index ffab46236..5172731ff 100644 --- a/qcsrc/client/view.qc +++ b/qcsrc/client/view.qc @@ -1357,20 +1357,21 @@ void HUD_Crosshair(entity this) #define CROSSHAIR_DO_BLUR(M,sz,wcross_name,wcross_alpha) \ MACRO_BEGIN { \ + vector scaled_sz = sz * wcross_size; \ if(wcross_blur > 0) \ { \ for(i = -2; i <= 2; ++i) \ for(j = -2; j <= 2; ++j) \ - M(i,j,sz,wcross_name,wcross_alpha*0.04); \ + M(i,j,sz,scaled_sz,wcross_name,wcross_alpha*0.04); \ } \ else \ { \ - M(0,0,sz,wcross_name,wcross_alpha); \ + M(0,0,sz,scaled_sz,wcross_name,wcross_alpha); \ } \ } MACRO_END -#define CROSSHAIR_DRAW_SINGLE(i,j,sz,wcross_name,wcross_alpha) \ - drawpic(wcross_origin - ('0.5 0 0' * (sz * wcross_size.x + i * wcross_blur) + '0 0.5 0' * (sz * wcross_size.y + j * wcross_blur)), wcross_name, sz * wcross_size, wcross_color, wcross_alpha, DRAWFLAG_NORMAL) +#define CROSSHAIR_DRAW_SINGLE(i,j,sz,scaled_sz,wcross_name,wcross_alpha) \ + drawpic(wcross_origin - ('0.5 0 0' * (scaled_sz.x + i * wcross_blur) + '0 0.5 0' * (scaled_sz.y + j * wcross_blur)), wcross_name, scaled_sz, wcross_color, wcross_alpha, DRAWFLAG_NORMAL) #define CROSSHAIR_DRAW(sz,wcross_name,wcross_alpha) \ CROSSHAIR_DO_BLUR(CROSSHAIR_DRAW_SINGLE,sz,wcross_name,wcross_alpha) diff --git a/qcsrc/lib/yenc.qh b/qcsrc/lib/yenc.qh index a8389e240..dce6e9c9d 100644 --- a/qcsrc/lib/yenc.qh +++ b/qcsrc/lib/yenc.qh @@ -34,9 +34,7 @@ if (conv <= 0) { \ ret = -1; \ } else { \ - bool esc = false; \ if (conv == '=') { \ - esc = true; \ conv = STRING_ITERATOR_GET(stringiter); \ conv -= 64; \ } \