Implement DrawGraph.BlendAddSatur

This commit is contained in:
Nunuhara Cabbage
2022-05-02 15:38:53 -07:00
parent d482e165d6
commit 0fc5442e42
3 changed files with 17 additions and 2 deletions
+1
View File
@@ -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);
+10
View File
@@ -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(&copy_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);
+6 -2
View File
@@ -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),