Implement DrawGraph.SubDA_DAxSA

Used in ほいっぷハニー.
This commit is contained in:
Nunuhara Cabbage
2021-04-22 20:25:47 -07:00
parent 51a3712270
commit ffc08d40f0
3 changed files with 17 additions and 2 deletions
+1
View File
@@ -111,6 +111,7 @@ void gfx_fill(struct texture *dst, int x, int y, int w, int h, int r, int g, int
void gfx_fill_alpha_color(struct texture *dst, int x, int y, int w, int h, int r, int g, int b, int a);
void gfx_fill_amap(struct texture *dst, int x, int y, int w, int h, int a);
void gfx_add_da_daxsa(struct texture *dst, int dx, int dy, struct texture *src, int sx, int sy, int w, int h);
void gfx_sub_da_daxsa(struct texture *dst, int dx, int dy, struct texture *src, int sx, int sy, int w, int h);
void gfx_copy_stretch(struct texture *dst, int dx, int dy, int dw, int dh, struct texture *src, int sx, int sy, int sw, int sh);
void gfx_copy_stretch_amap(struct texture *dst, int dx, int dy, int dw, int dh, struct texture *src, int sx, int sy, int sw, int sh);
void gfx_copy_rot_zoom(Texture *dst, Texture *src, int sx, int sy, int w, int h, float rotate, float mag);
+10
View File
@@ -345,6 +345,16 @@ void gfx_add_da_daxsa(Texture *dst, int dx, int dy, Texture *src, int sx, int sy
restore_blend_mode();
}
void gfx_sub_da_daxsa(struct texture *dst, int dx, int dy, struct texture *src, int sx, int sy, int w, int h)
{
glBlendFuncSeparate(GL_ZERO, GL_ONE, GL_ONE_MINUS_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
struct copy_data data = COPY_DATA(dx, dy, sx, sy, w, h);
run_copy_shader(&copy_shader.s, dst, src, &data);
restore_blend_mode();
}
// FIXME: DrawGraph.dll does some really strange clipping on the src/dst rectangles
// before drawing. This implementation does what you would normally expect
// a stretch function to do when passed negative (x,y) coordinates.
+6 -2
View File
@@ -102,6 +102,11 @@ static void DrawGraph_AddDA_DAxSA(int dst, int dx, int dy, int src, int sx, int
gfx_add_da_daxsa(DTEX(dst), dx, dy, STEX(src), sx, sy, w, h);
}
void DrawGraph_SubDA_DAxSA(int dst, int dx, int dy, int src, int sx, int sy, int w, int h)
{
gfx_sub_da_daxsa(DTEX(dst), dx, dy, STEX(src), sx, sy, w, h);
}
static void DrawGraph_CopyStretch(int dst, int dx, int dy, int dw, int dh, int src, int sx, int sy, int sw, int sh)
{
gfx_copy_stretch(DTEX(dst), dx, dy, dw, dh, STEX(src), sx, sy, sw, sh);
@@ -191,7 +196,6 @@ static void DrawGraph_SetFontName(struct string *text)
//void DrawGraph_ScreenDA_DAxSA(int dst, int dx, int dy, int src, int sx, int sy, int w, int h);
//void DrawGraph_SpriteCopyAMap(int dst, int dx, int dy, int src, int sx, int sy, int w, int h, int key);
//void DrawGraph_BlendDA_DAxSA, int dst, int dx, int dy, int src, int sx, int sy, int w, int h);
//void DrawGraph_SubDA_DAxSA, int dst, int dx, int dy, int src, int sx, int sy, int w, int h);
//void DrawGraph_BrightDestOnly(int dst, int x, int y, int w, int h, int rate);
//void DrawGraph_CopyTextureWrap(int dst, int dx, int dy, int dw, int dh, int src, int sx, int sy, int sw, int sh, int u, int v);
//void DrawGraph_CopyTextureWrapAlpha(int dst, int dx, int dy, int dw, int dh, int src, int sx, int sy, int sw, int sh, int u, int v, int alpha);
@@ -261,7 +265,7 @@ HLL_LIBRARY(DrawGraph,
HLL_EXPORT(AddDA_DAxSA, DrawGraph_AddDA_DAxSA),
//HLL_EXPORT(SpriteCopyAMap, DrawGraph_SpriteCopyAMap),
//HLL_EXPORT(BlendDA_DAxSA, DrawGraph_BlendDA_DAxSA),
//HLL_EXPORT(SubDA_DAxSA, DrawGraph_SubDA_DAxSA),
HLL_EXPORT(SubDA_DAxSA, DrawGraph_SubDA_DAxSA),
//HLL_EXPORT(BrightDestOnly, DrawGraph_BrightDestOnly),
//HLL_EXPORT(CopyTextureWrap, DrawGraph_CopyTextureWrap),
//HLL_EXPORT(CopyTextureWrapAlpha, DrawGraph_CopyTextureWrapAlpha),