From 1e7d8311ac5cafb34a8cc8220265148d48a8e7d1 Mon Sep 17 00:00:00 2001 From: jakob Date: Sun, 27 Oct 2024 11:27:54 +0100 Subject: [PATCH] [effect] Switch "Interferences" to use blend.h --- avs/vis_avs/e_interferences.cpp | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/avs/vis_avs/e_interferences.cpp b/avs/vis_avs/e_interferences.cpp index 54ffeec..c405c74 100644 --- a/avs/vis_avs/e_interferences.cpp +++ b/avs/vis_avs/e_interferences.cpp @@ -31,7 +31,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include "e_interferences.h" -#include "r_defs.h" +#include "blend.h" #include #include @@ -135,7 +135,7 @@ int E_Interferences::render(char[2][2][576], angle += angle_step; } - unsigned char* bt = g_blendtable[alpha]; + unsigned char* bt = lut_u8_multiply[alpha]; int* outp = fbout; for (y = 0; y < h; y++) { @@ -319,21 +319,13 @@ int E_Interferences::render(char[2][2][576], this->on_beat_fadeout = M_PI; } - int* p = framebuffer; - int* d = fbout; + auto src = (uint32_t*)fbout; + auto dest = (uint32_t*)framebuffer; switch (this->config.blend_mode) { default: case BLEND_SIMPLE_REPLACE: return 1; - case BLEND_SIMPLE_ADDITIVE: mmx_addblend_block(p, d, w * h); break; - case BLEND_SIMPLE_5050: { - int i = w * h; - while (i--) { - *p = BLEND_AVG(*p, *d); - p++; - d++; - } - break; - } + case BLEND_SIMPLE_ADDITIVE: blend_add(src, src, dest, w, h); break; + case BLEND_SIMPLE_5050: blend_5050(src, src, dest, w, h); break; } return 0; }