diff --git a/include/gfx/gfx.h b/include/gfx/gfx.h index 0ca3260..62450aa 100644 --- a/include/gfx/gfx.h +++ b/include/gfx/gfx.h @@ -114,6 +114,7 @@ void gfx_blend(Texture *dst, int dx, int dy, Texture *src, int sx, int sy, int w void gfx_blend_amap(struct texture *dst, int dx, int dy, struct texture *src, int sx, int sy, int w, int h); void gfx_blend_amap_color(struct texture *dst, int dx, int dy, struct texture *src, int sx, int sy, int w, int h, int r, int g, int b); void gfx_blend_amap_alpha(struct texture *dst, int dx, int dy, struct texture *src, int sx, int sy, int w, int h, int a); +void gfx_blend_add_satur(Texture *dst, int dx, int dy, Texture *src, int sx, int sy, int w, int h); void gfx_blend_src_bright(Texture *dst, int dx, int dy, Texture *src, int sx, int sy, int w, int h, int a, int rate); void gfx_blend_amap_color_alpha(Texture *dst, int dx, int dy, Texture *src, int sx, int sy, int w, int h, int r, int g, int b, int a); void gfx_fill(struct texture *dst, int x, int y, int w, int h, int r, int g, int b); diff --git a/src/draw.c b/src/draw.c index 805158c..9eba807 100644 --- a/src/draw.c +++ b/src/draw.c @@ -360,6 +360,16 @@ void gfx_blend_src_bright(Texture *dst, int dx, int dy, Texture *src, int sx, in restore_blend_mode(); } +void gfx_blend_add_satur(Texture *dst, int dx, int dy, Texture *src, int sx, int sy, int w, int h) +{ + glBlendFuncSeparate(GL_SRC_ALPHA, GL_ONE, GL_ZERO, GL_ONE); + + struct copy_data data = COPY_DATA(dx, dy, sx, sy, w, h); + run_copy_shader(©_shader.s, dst, src, &data); + + restore_blend_mode(); +} + void gfx_blend_amap_color_alpha(Texture *dst, int dx, int dy, Texture *src, int sx, int sy, int w, int h, int r, int g, int b, int a) { glBlendFuncSeparate(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA, GL_DST_ALPHA, GL_ONE_MINUS_SRC_ALPHA); diff --git a/src/hll/DrawGraph.c b/src/hll/DrawGraph.c index bea93ac..d8fe50f 100644 --- a/src/hll/DrawGraph.c +++ b/src/hll/DrawGraph.c @@ -211,7 +211,11 @@ void DrawGraph_BlendSrcBright(int dst, int dx, int dy, int src, int sx, int sy, gfx_blend_src_bright(DTEX(dst), dx, dy, STEX(src), sx, sy, w, h, alpha, rate); } -//void DrawGraph_BlendAddSatur(int dst, int dx, int dy, int src, int sx, int sy, int w, int h); +void DrawGraph_BlendAddSatur(int dst, int dx, int dy, int src, int sx, int sy, int w, int h) +{ + gfx_blend_add_satur(DTEX(dst), dx, dy, STEX(src), sx, sy, w, h); +} + //void DrawGraph_BlendAMapSrcOnly(int dst, int dx, int dy, int src, int sx, int sy, int w, int h); void DrawGraph_BlendAMapColorAlpha(int dst, int dx, int dy, int src, int sx, int sy, int w, int h, int r, int g, int b, int a) @@ -351,7 +355,7 @@ HLL_LIBRARY(DrawGraph, HLL_EXPORT(CopyAMapMin, DrawGraph_CopyAMapMin), HLL_EXPORT(Blend, DrawGraph_Blend), HLL_EXPORT(BlendSrcBright, DrawGraph_BlendSrcBright), - //HLL_EXPORT(BlendAddSatur, DrawGraph_BlendAddSatur), + HLL_EXPORT(BlendAddSatur, DrawGraph_BlendAddSatur), HLL_EXPORT(BlendAMap, DrawGraph_BlendAMap), //HLL_EXPORT(BlendAMapSrcOnly, DrawGraph_BlendAMapSrcOnly), HLL_EXPORT(BlendAMapColor, DrawGraph_BlendAMapColor),