mirror of
https://github.com/nunuhara/xsystem4.git
synced 2026-09-22 23:18:01 +03:00
Implement DrawGraph.BrightDestOnly
This commit is contained in:
@@ -137,6 +137,7 @@ void gfx_screen_da_daxsa(Texture *dst, int dx, int dy, Texture *src, int sx, int
|
||||
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_blend_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_bright_dest_only(Texture *dst, int x, int y, int w, int h, int rate);
|
||||
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_stretch_blend(struct texture *dst, int dx, int dy, int dw, int dh, struct texture *src, int sx, int sy, int sw, int sh, int a);
|
||||
|
||||
+12
@@ -650,6 +650,18 @@ void gfx_sub_da_daxsa(struct texture *dst, int dx, int dy, struct texture *src,
|
||||
restore_blend_mode();
|
||||
}
|
||||
|
||||
void gfx_bright_dest_only(Texture *dst, int x, int y, int w, int h, int rate)
|
||||
{
|
||||
GLfloat f_rate = rate / 255.0;
|
||||
glBlendFuncSeparate(GL_ZERO, GL_CONSTANT_COLOR, GL_ZERO, GL_ONE);
|
||||
glBlendColor(f_rate, f_rate, f_rate, 1.0);
|
||||
|
||||
struct copy_data data = COPY_DATA(x, y, 0, 0, w, h);
|
||||
run_copy_shader(©_shader.s, dst, NULL, &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
@@ -221,7 +221,11 @@ static void DrawGraph_SubDA_DAxSA(int dst, int dx, int dy, int src, int sx, int
|
||||
gfx_sub_da_daxsa(DTEX(dst), dx, dy, STEX(src), sx, sy, w, h);
|
||||
}
|
||||
|
||||
//void DrawGraph_BrightDestOnly(int dst, int x, int y, int w, int h, int rate);
|
||||
static void DrawGraph_BrightDestOnly(int dst, int x, int y, int w, int h, int rate)
|
||||
{
|
||||
gfx_bright_dest_only(DTEX(dst), x, y, w, h, 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);
|
||||
|
||||
@@ -433,7 +437,7 @@ HLL_LIBRARY(DrawGraph,
|
||||
HLL_EXPORT(SpriteCopyAMap, DrawGraph_SpriteCopyAMap),
|
||||
HLL_EXPORT(BlendDA_DAxSA, DrawGraph_BlendDA_DAxSA),
|
||||
HLL_EXPORT(SubDA_DAxSA, DrawGraph_SubDA_DAxSA),
|
||||
//HLL_EXPORT(BrightDestOnly, DrawGraph_BrightDestOnly),
|
||||
HLL_EXPORT(BrightDestOnly, DrawGraph_BrightDestOnly),
|
||||
//HLL_EXPORT(CopyTextureWrap, DrawGraph_CopyTextureWrap),
|
||||
//HLL_EXPORT(CopyTextureWrapAlpha, DrawGraph_CopyTextureWrapAlpha),
|
||||
HLL_EXPORT(CopyStretch, DrawGraph_CopyStretch),
|
||||
|
||||
Reference in New Issue
Block a user