Implement DrawGraph.BlendAMapAlpha

This commit is contained in:
Nunuhara Cabbage
2019-12-09 15:08:30 -08:00
parent 0d0f89ad33
commit 91c84e9988
5 changed files with 15 additions and 1 deletions
+1 -1
View File
@@ -50,7 +50,7 @@ hll_unimplemented(DrawGraph, BlendAMapColor);
//void BlendAMapColorAlpha(int nDest, int nDx, int nDy, int nSrc, int nSx, int nSy, int nWidth, int nHeight, int nR, int nG, int nB, int nAlpha)
hll_unimplemented(DrawGraph, BlendAMapColorAlpha);
//void BlendAMapAlpha(int nDest, int nDx, int nDy, int nSrc, int nSx, int nSy, int nWidth, int nHeight, int nAlpha)
hll_unimplemented(DrawGraph, BlendAMapAlpha);
hll_defun_inline(BlendAMapAlpha, (DrawGraph_BlendAMapAlpha(a[0].i, a[1].i, a[2].i, a[3].i, a[4].i, a[5].i, a[6].i, a[7].i, a[8].i), 0));
//void BlendAMapBright(int nDest, int nDx, int nDy, int nSrc, int nSx, int nSy, int nWidth, int nHeight, int nRate)
hll_unimplemented(DrawGraph, BlendAMapBright);
//void BlendAMapAlphaSrcBright(int nDest, int nDx, int nDy, int nSrc, int nSx, int nSy, int nWidth, int nHeight, int nAlpha, int nRate)
+1
View File
@@ -78,6 +78,7 @@ void DrawGraph_CopyAMapMax(int dno, int dx, int dy, int sno, int sx, int sy, int
void DrawGraph_CopyAMapMin(int dno, int dx, int dy, int sno, int sx, int sy, int w, int h);
void DrawGraph_BlendAMap(int dno, int dx, int dy, int sno, int sx, int sy, int w, int h);
void DrawGraph_BlendAMapAlpha(int dno, int dx, int dy, int sno, int sx, int sy, int w, int h, int alpha);
void DrawGraph_Fill(int sp_no, int x, int y, int w, int h, int r, int g, int b);
void DrawGraph_FillAMap(int sp_no, int x, int y, int w, int h, int a);
+5
View File
@@ -567,6 +567,11 @@ void DrawGraph_BlendAMap(int dno, int dx, int dy, int sno, int sx, int sy, int w
sdl_blend_amap(get_surface(dno)->cg, dx, dy, get_surface(sno)->cg, sx, sy, w, h);
}
void DrawGraph_BlendAMapAlpha(int dno, int dx, int dy, int sno, int sx, int sy, int w, int h, int alpha)
{
sdl_blend_amap_alpha(get_surface(dno)->cg, dx, dy, get_surface(sno)->cg, sx, sy, w, h, alpha);
}
void DrawGraph_Fill(int sp_no, int x, int y, int w, int h, int r, int g, int b)
{
sdl_fill(get_surface(sp_no)->cg, x, y, w, h, r, g, b);
+1
View File
@@ -52,6 +52,7 @@ void sdl_copy_use_amap_border(struct cg *dst, int dx, int dy, struct cg *src, in
void sdl_copy_amap_max(struct cg *dst, int dx, int dy, struct cg *src, int sx, int sy, int w, int h);
void sdl_copy_amap_min(struct cg *dst, int dx, int dy, struct cg *src, int sx, int sy, int w, int h);
void sdl_blend_amap(struct cg *dst, int dx, int dy, struct cg *src, int sx, int sy, int w, int h);
void sdl_blend_amap_alpha(struct cg *dst, int dx, int dy, struct cg *src, int sx, int sy, int w, int h, int alpha);
void sdl_fill(struct cg *dst, int x, int y, int w, int h, int r, int g, int b);
void sdl_fill_alpha_color(struct cg *dst, int x, int y, int w, int h, int r, int g, int b, int a);
void sdl_fill_amap(struct cg *dst, int x, int y, int w, int h, int a);
+7
View File
@@ -310,6 +310,13 @@ void sdl_blend_amap(struct cg *dst, int dx, int dy, struct cg *src, int sx, int
sdl_cg_blit(dst, dx, dy, src->s, sx, sy, w, h);
}
void sdl_blend_amap_alpha(struct cg *dst, int dx, int dy, struct cg *src, int sx, int sy, int w, int h, int alpha)
{
SDL_SetSurfaceAlphaMod(src->s, alpha);
sdl_cg_blit(dst, dx, dy, src->s, sx, sy, w, h);
SDL_SetSurfaceAlphaMod(src->s, 255);
}
static void sdl_pixop_fill_rgb(uint32_t *p, uint32_t c)
{
PIXEL_SET_A(&c, PIXEL_A(*p));