Re: [AD] proposal: draw_sprite_*_ex |
[ Thread Index |
Date Index
| More lists.liballeg.org/allegro-developers Archives
]
Peter Wang wrote:
I think having both VH and HV isn't worthwhile. I can imagine searching for
HV_FLIP in the source and getting confused because it only refers to VH_FLIP.
OK. Users who want it (like me) can define their own.
The asm code doesn't need to be removed immediately.
I don't like having the SVN broken so I won't commit the patch yet.
+#define MAKE_PP_BLENDER(c) (!_blender_func16 && (al_assert(__FILE__,__LINE__), 0), _blender_func16)
That's a bit ugly :-P
Yeah, took me 10 minutes to figure out what it does. And I'm still not
sure how it does. :) Just changed to _blender_func16.
+ tmp = dst->cl - dx;
+ sxbeg = ((tmp < 0) ? 0 : tmp);
You can use MAX().
Changed, but left the original code (where it was copied from) as it is.
--
Milan Mimica
http://sparklet.sf.net
Index: src/vtable24.c
===================================================================
--- src/vtable24.c (revision 9738)
+++ src/vtable24.c (working copy)
@@ -91,7 +91,11 @@
_soft_triangle3d,
_soft_triangle3d_f,
_soft_quad3d,
- _soft_quad3d_f
+ _soft_quad3d_f,
+ _linear_draw_sprite_ex24,
+ _linear_draw_sprite_h_flip_ex24,
+ _linear_draw_sprite_v_flip_ex24,
+ _linear_draw_sprite_vh_flip_ex24
};
Index: src/vtable16.c
===================================================================
--- src/vtable16.c (revision 9738)
+++ src/vtable16.c (working copy)
@@ -91,7 +91,11 @@
_soft_triangle3d,
_soft_triangle3d_f,
_soft_quad3d,
- _soft_quad3d_f
+ _soft_quad3d_f,
+ _linear_draw_sprite_ex16,
+ _linear_draw_sprite_h_flip_ex16,
+ _linear_draw_sprite_v_flip_ex16,
+ _linear_draw_sprite_vh_flip_ex16
};
Index: src/c/cdefs24.h
===================================================================
--- src/c/cdefs24.h (revision 9738)
+++ src/c/cdefs24.h (working copy)
@@ -24,6 +24,7 @@
#define PTR_PER_PIXEL 3
#define OFFSET_PIXEL_PTR(p,x) ((PIXEL_PTR) (p) + 3 * (x))
#define INC_PIXEL_PTR(p) ((p) += 3)
+#define INC_PIXEL_PTR_N(p,d) ((p) += 3 * d)
#define DEC_PIXEL_PTR(p) ((p) -= 3)
#define PUT_PIXEL(p,c) bmp_write24((uintptr_t) (p), (c))
@@ -48,6 +49,7 @@
#define DLS_BLENDER BLENDER_FUNC
#define MAKE_DLS_BLENDER(a) _blender_func24
#define DLS_BLEND(b,a,n) ((*(b))(_blender_col_24, (n), (a)))
+#define DLSX_BLEND(b,n) ((*(b))(_blender_col_24, (n), _blender_alpha))
/* Blender for RGBA sprites. */
#define RGBA_BLENDER BLENDER_FUNC
@@ -79,10 +81,14 @@
#define FUNC_LINEAR_VLINE _linear_vline24
#define FUNC_LINEAR_DRAW_SPRITE _linear_draw_sprite24
+#define FUNC_LINEAR_DRAW_SPRITE_EX _linear_draw_sprite_ex24
#define FUNC_LINEAR_DRAW_256_SPRITE _linear_draw_256_sprite24
#define FUNC_LINEAR_DRAW_SPRITE_V_FLIP _linear_draw_sprite_v_flip24
+#define FUNC_LINEAR_DRAW_SPRITE_V_FLIP_EX _linear_draw_sprite_v_flip_ex24
#define FUNC_LINEAR_DRAW_SPRITE_H_FLIP _linear_draw_sprite_h_flip24
+#define FUNC_LINEAR_DRAW_SPRITE_H_FLIP_EX _linear_draw_sprite_h_flip_ex24
#define FUNC_LINEAR_DRAW_SPRITE_VH_FLIP _linear_draw_sprite_vh_flip24
+#define FUNC_LINEAR_DRAW_SPRITE_VH_FLIP_EX _linear_draw_sprite_vh_flip_ex24
#define FUNC_LINEAR_DRAW_TRANS_SPRITE _linear_draw_trans_sprite24
#define FUNC_LINEAR_DRAW_TRANS_RGBA_SPRITE _linear_draw_trans_rgba_sprite24
#define FUNC_LINEAR_DRAW_LIT_SPRITE _linear_draw_lit_sprite24
Index: src/c/cdefs32.h
===================================================================
--- src/c/cdefs32.h (revision 9738)
+++ src/c/cdefs32.h (working copy)
@@ -24,6 +24,7 @@
#define PTR_PER_PIXEL 1
#define OFFSET_PIXEL_PTR(p,x) ((PIXEL_PTR) (p) + (x))
#define INC_PIXEL_PTR(p) ((p)++)
+#define INC_PIXEL_PTR_N(p,d) ((p) += d)
#define DEC_PIXEL_PTR(p) ((p)--)
#define PUT_PIXEL(p,c) bmp_write32((uintptr_t) (p), (c))
@@ -49,6 +50,7 @@
#define DLS_BLENDER BLENDER_FUNC
#define MAKE_DLS_BLENDER(a) _blender_func32
#define DLS_BLEND(b,a,n) ((*(b))(_blender_col_32, (n), (a)))
+#define DLSX_BLEND(b,n) ((*(b))(_blender_col_32, (n), _blender_alpha))
/* Blender for poly_scanline_*_lit. */
#define PS_BLENDER BLENDER_FUNC
@@ -75,10 +77,14 @@
#define FUNC_LINEAR_VLINE _linear_vline32
#define FUNC_LINEAR_DRAW_SPRITE _linear_draw_sprite32
+#define FUNC_LINEAR_DRAW_SPRITE_EX _linear_draw_sprite_ex32
#define FUNC_LINEAR_DRAW_256_SPRITE _linear_draw_256_sprite32
#define FUNC_LINEAR_DRAW_SPRITE_V_FLIP _linear_draw_sprite_v_flip32
+#define FUNC_LINEAR_DRAW_SPRITE_V_FLIP_EX _linear_draw_sprite_v_flip_ex32
#define FUNC_LINEAR_DRAW_SPRITE_H_FLIP _linear_draw_sprite_h_flip32
+#define FUNC_LINEAR_DRAW_SPRITE_H_FLIP_EX _linear_draw_sprite_h_flip_ex32
#define FUNC_LINEAR_DRAW_SPRITE_VH_FLIP _linear_draw_sprite_vh_flip32
+#define FUNC_LINEAR_DRAW_SPRITE_VH_FLIP_EX _linear_draw_sprite_vh_flip_ex32
#define FUNC_LINEAR_DRAW_TRANS_SPRITE _linear_draw_trans_sprite32
#define FUNC_LINEAR_DRAW_TRANS_RGBA_SPRITE _linear_draw_trans_rgba_sprite32
#define FUNC_LINEAR_DRAW_LIT_SPRITE _linear_draw_lit_sprite32
Index: src/c/cdefs15.h
===================================================================
--- src/c/cdefs15.h (revision 9738)
+++ src/c/cdefs15.h (working copy)
@@ -23,6 +23,7 @@
#define PIXEL_PTR unsigned short*
#define OFFSET_PIXEL_PTR(p,x) ((PIXEL_PTR) (p) + (x))
#define INC_PIXEL_PTR(p) ((p)++)
+#define INC_PIXEL_PTR_N(p,d) ((p) += d)
#define DEC_PIXEL_PTR(p) ((p)--)
#define PUT_PIXEL(p,c) bmp_write15((uintptr_t) (p), (c))
@@ -48,6 +49,7 @@
#define DLS_BLENDER BLENDER_FUNC
#define MAKE_DLS_BLENDER(a) _blender_func15
#define DLS_BLEND(b,a,n) ((*(b))(_blender_col_15, (n), (a)))
+#define DLSX_BLEND(b,n) ((*(b))(_blender_col_15, (n), _blender_alpha))
/* Blender for RGBA sprites. */
#define RGBA_BLENDER BLENDER_FUNC
@@ -79,10 +81,14 @@
#define FUNC_LINEAR_VLINE _linear_vline15
#define FUNC_LINEAR_DRAW_SPRITE _linear_draw_sprite15
+#define FUNC_LINEAR_DRAW_SPRITE_EX _linear_draw_sprite_ex15
#define FUNC_LINEAR_DRAW_256_SPRITE _linear_draw_256_sprite15
#define FUNC_LINEAR_DRAW_SPRITE_V_FLIP _linear_draw_sprite_v_flip15
+#define FUNC_LINEAR_DRAW_SPRITE_V_FLIP_EX _linear_draw_sprite_v_flip_ex15
#define FUNC_LINEAR_DRAW_SPRITE_H_FLIP _linear_draw_sprite_h_flip15
+#define FUNC_LINEAR_DRAW_SPRITE_H_FLIP_EX _linear_draw_sprite_h_flip_ex15
#define FUNC_LINEAR_DRAW_SPRITE_VH_FLIP _linear_draw_sprite_vh_flip15
+#define FUNC_LINEAR_DRAW_SPRITE_VH_FLIP_EX _linear_draw_sprite_vh_flip_ex15
#define FUNC_LINEAR_DRAW_TRANS_SPRITE _linear_draw_trans_sprite15
#define FUNC_LINEAR_DRAW_TRANS_RGBA_SPRITE _linear_draw_trans_rgba_sprite15
#define FUNC_LINEAR_DRAW_LIT_SPRITE _linear_draw_lit_sprite15
Index: src/c/cdefs16.h
===================================================================
--- src/c/cdefs16.h (revision 9738)
+++ src/c/cdefs16.h (working copy)
@@ -24,6 +24,7 @@
#define PTR_PER_PIXEL 1
#define OFFSET_PIXEL_PTR(p,x) ((PIXEL_PTR) (p) + (x))
#define INC_PIXEL_PTR(p) ((p)++)
+#define INC_PIXEL_PTR_N(p,d) ((p) += d)
#define DEC_PIXEL_PTR(p) ((p)--)
#define PUT_PIXEL(p,c) bmp_write16((uintptr_t) (p), (c))
@@ -49,6 +50,7 @@
#define DLS_BLENDER BLENDER_FUNC
#define MAKE_DLS_BLENDER(a) _blender_func16
#define DLS_BLEND(b,a,n) ((*(b))(_blender_col_16, (n), (a)))
+#define DLSX_BLEND(b,n) ((*(b))(_blender_col_16, (n), _blender_alpha))
/* Blender for RGBA sprites. */
#define RGBA_BLENDER BLENDER_FUNC
@@ -80,10 +82,14 @@
#define FUNC_LINEAR_VLINE _linear_vline16
#define FUNC_LINEAR_DRAW_SPRITE _linear_draw_sprite16
+#define FUNC_LINEAR_DRAW_SPRITE_EX _linear_draw_sprite_ex16
#define FUNC_LINEAR_DRAW_256_SPRITE _linear_draw_256_sprite16
#define FUNC_LINEAR_DRAW_SPRITE_V_FLIP _linear_draw_sprite_v_flip16
+#define FUNC_LINEAR_DRAW_SPRITE_V_FLIP_EX _linear_draw_sprite_v_flip_ex16
#define FUNC_LINEAR_DRAW_SPRITE_H_FLIP _linear_draw_sprite_h_flip16
+#define FUNC_LINEAR_DRAW_SPRITE_H_FLIP_EX _linear_draw_sprite_h_flip_ex16
#define FUNC_LINEAR_DRAW_SPRITE_VH_FLIP _linear_draw_sprite_vh_flip16
+#define FUNC_LINEAR_DRAW_SPRITE_VH_FLIP_EX _linear_draw_sprite_vh_flip_ex16
#define FUNC_LINEAR_DRAW_TRANS_SPRITE _linear_draw_trans_sprite16
#define FUNC_LINEAR_DRAW_TRANS_RGBA_SPRITE _linear_draw_trans_rgba_sprite16
#define FUNC_LINEAR_DRAW_LIT_SPRITE _linear_draw_lit_sprite16
Index: src/c/cspr.h
===================================================================
--- src/c/cspr.h (revision 9738)
+++ src/c/cspr.h (working copy)
@@ -18,6 +18,146 @@
#ifndef __bma_cspr_h
#define __bma_cspr_h
+
+/* _linear_draw_sprite_ex:
+ * Draws a masked sprite onto a linear bitmap at the specified dx, dy position,
+ * using drawing mode specified by 'mode' and flipping mode specified by
+ * 'flip'.
+ */
+void FUNC_LINEAR_DRAW_SPRITE_EX(BITMAP * dst, BITMAP * src, int dx, int dy,
+ int mode, int flip)
+{
+ int x, y, w, h;
+ int x_dir = 1, y_dir = 1;
+ int dxbeg, dybeg;
+ int sxbeg, sybeg;
+ DLS_BLENDER lit_blender;
+ DTS_BLENDER trans_blender;
+
+ ASSERT(dst);
+ ASSERT(src);
+
+ if (flip == DRAW_SPRITE_V_FLIP) {
+ y_dir = -1;
+ }
+ if (flip == DRAW_SPRITE_H_FLIP) {
+ x_dir = -1;
+ }
+ if (flip == DRAW_SPRITE_VH_FLIP) {
+ y_dir = -1;
+ x_dir = -1;
+ }
+
+ if (dst->clip) {
+ int tmp;
+
+ tmp = dst->cl - dx;
+ sxbeg = MAX(0, tmp);
+ dxbeg = sxbeg + dx;
+
+ tmp = dst->cr - dx;
+ w = MIN(src->w, tmp) - sxbeg;
+ if (w <= 0)
+ return;
+
+ if (flip == DRAW_SPRITE_H_FLIP || flip == DRAW_SPRITE_VH_FLIP) {
+ /* use backward drawing onto dst */
+ sxbeg = src->w - (sxbeg + w);
+ dxbeg += w - 1;
+ }
+
+ tmp = dst->ct - dy;
+ sybeg = MAX(0, tmp);
+ dybeg = sybeg + dy;
+
+ tmp = dst->cb - dy;
+ h = MIN(src->h, tmp) - sybeg;
+ if (h <= 0)
+ return;
+
+ if (flip == DRAW_SPRITE_V_FLIP || flip == DRAW_SPRITE_VH_FLIP) {
+ /* use backward drawing onto dst */
+ sybeg = src->h - (sybeg + h);
+ dybeg += h - 1;
+ }
+ }
+ else {
+ w = src->w;
+ h = src->h;
+ sxbeg = 0;
+ sybeg = 0;
+ dxbeg = dx;
+ if (flip == DRAW_SPRITE_H_FLIP || flip == DRAW_SPRITE_VH_FLIP) {
+ dxbeg = dx + w - 1;
+ }
+ dybeg = dy;
+ if (flip == DRAW_SPRITE_V_FLIP || flip == DRAW_SPRITE_VH_FLIP) {
+ dybeg = dy + h - 1;
+ }
+ }
+
+ lit_blender = MAKE_DLS_BLENDER(0);
+ trans_blender = MAKE_DTS_BLENDER();
+
+ if (dst->id & (BMP_ID_VIDEO | BMP_ID_SYSTEM)) {
+ bmp_select(dst);
+
+ for (y = 0; y < h; y++) {
+ PIXEL_PTR s = OFFSET_PIXEL_PTR(src->line[sybeg + y], sxbeg);
+
+ /* flipped if y_dir is -1 */
+ PIXEL_PTR d = OFFSET_PIXEL_PTR(bmp_write_line(dst, dybeg + y * y_dir), dxbeg);
+
+ /* d is incremented by x_dir, -1 if flipped */
+ for (x = w - 1; x >= 0; INC_PIXEL_PTR(s), INC_PIXEL_PTR_N(d,x_dir), x--) {
+ unsigned long c = GET_MEMORY_PIXEL(s);
+ if (!IS_SPRITE_MASK(src, c)) {
+ switch(mode) {
+ case DRAW_SPRITE_NORMAL: break;
+
+ case DRAW_SPRITE_LIT:
+ c = DLSX_BLEND(lit_blender, c);
+ break;
+
+ case DRAW_SPRITE_TRANS:
+ c = DTS_BLEND(trans_blender, GET_PIXEL(d), c);
+ break;
+ }
+ PUT_PIXEL(d, c);
+ }
+ }
+ }
+
+ bmp_unwrite_line(dst);
+ }
+ else {
+ for (y = 0; y < h; y++) {
+ PIXEL_PTR s = OFFSET_PIXEL_PTR(src->line[sybeg + y], sxbeg);
+ PIXEL_PTR d = OFFSET_PIXEL_PTR(bmp_write_line(dst, dybeg + y * y_dir), dxbeg);
+
+ for (x = w - 1; x >= 0; INC_PIXEL_PTR(s), INC_PIXEL_PTR_N(d,x_dir), x--) {
+ unsigned long c = GET_MEMORY_PIXEL(s);
+ if (!IS_SPRITE_MASK(src, c)) {
+ switch(mode) {
+ case DRAW_SPRITE_NORMAL: break;
+
+ case DRAW_SPRITE_LIT:
+ c = DLSX_BLEND(lit_blender, c);
+ break;
+
+ case DRAW_SPRITE_TRANS:
+ c = DTS_BLEND(trans_blender, GET_PIXEL(d), c);
+ break;
+ }
+ PUT_MEMORY_PIXEL(d, c);
+ }
+ }
+ }
+ }
+}
+
+
+
/* _linear_draw_sprite:
* Draws a sprite onto a linear bitmap at the specified x, y position,
* using a masked drawing mode where zero pixels are not output.
@@ -180,6 +320,114 @@
+/* _linear_draw_sprite_v_flip_ex:
+ * Draws a sprite to a linear bitmap, flipping vertically.
+ */
+void FUNC_LINEAR_DRAW_SPRITE_V_FLIP_EX(BITMAP *dst, BITMAP *src,
+ int dx, int dy, int mode)
+{
+ int x, y, w, h;
+ int dxbeg, dybeg;
+ int sxbeg, sybeg;
+ DLS_BLENDER lit_blender;
+ DTS_BLENDER trans_blender;
+
+ ASSERT(dst);
+ ASSERT(src);
+
+ if (dst->clip) {
+ int tmp;
+
+ tmp = dst->cl - dx;
+ sxbeg = MAX(0, tmp);
+ dxbeg = sxbeg + dx;
+
+ tmp = dst->cr - dx;
+ w = MIN(src->w, tmp) - sxbeg;
+ if (w <= 0)
+ return;
+
+ tmp = dst->ct - dy;
+ sybeg = MAX(0, tmp);
+ dybeg = sybeg + dy;
+
+ tmp = dst->cb - dy;
+ h = MIN(src->h, tmp) - sybeg;
+ if (h <= 0)
+ return;
+
+ /* use backward drawing onto dst */
+ sybeg = src->h - (sybeg + h);
+ dybeg += h - 1;
+ }
+ else {
+ w = src->w;
+ h = src->h;
+ sxbeg = 0;
+ sybeg = 0;
+ dxbeg = dx;
+ dybeg = dy + h - 1;
+ }
+
+ lit_blender = MAKE_DLS_BLENDER(0);
+ trans_blender = MAKE_DTS_BLENDER();
+
+ if (dst->id & (BMP_ID_VIDEO | BMP_ID_SYSTEM)) {
+ bmp_select(dst);
+
+ for (y = 0; y < h; y++) {
+ PIXEL_PTR s = OFFSET_PIXEL_PTR(src->line[sybeg + y], sxbeg);
+ PIXEL_PTR d = OFFSET_PIXEL_PTR(bmp_write_line(dst, dybeg - y), dxbeg);
+
+ for (x = w - 1; x >= 0; INC_PIXEL_PTR(s), INC_PIXEL_PTR(d), x--) {
+ unsigned long c = GET_MEMORY_PIXEL(s);
+ if (!IS_SPRITE_MASK(src, c)) {
+ switch(mode) {
+ case DRAW_SPRITE_NORMAL: break;
+
+ case DRAW_SPRITE_LIT:
+ c = DLSX_BLEND(lit_blender, c);
+ break;
+
+ case DRAW_SPRITE_TRANS:
+ c = DTS_BLEND(trans_blender, GET_PIXEL(d), c);
+ break;
+ }
+ PUT_PIXEL(d, c);
+ }
+ }
+ }
+
+ bmp_unwrite_line(dst);
+ }
+ else {
+ for (y = 0; y < h; y++) {
+ PIXEL_PTR s = OFFSET_PIXEL_PTR(src->line[sybeg + y], sxbeg);
+ PIXEL_PTR d = OFFSET_PIXEL_PTR(dst->line[dybeg - y], dxbeg);
+
+ for (x = w - 1; x >= 0; INC_PIXEL_PTR(s), INC_PIXEL_PTR(d), x--) {
+ unsigned long c = GET_MEMORY_PIXEL(s);
+ if (!IS_SPRITE_MASK(src, c)) {
+ switch(mode) {
+ case DRAW_SPRITE_NORMAL: break;
+
+ case DRAW_SPRITE_LIT:
+ c = DLSX_BLEND(lit_blender, c);
+ break;
+
+ case DRAW_SPRITE_TRANS:
+ c = DTS_BLEND(trans_blender, GET_PIXEL(d), c);
+ break;
+ }
+ PUT_MEMORY_PIXEL(d, c);
+ }
+ }
+ }
+ }
+}
+
+
+
/* _linear_draw_sprite_v_flip:
* Draws a sprite to a linear bitmap, flipping vertically.
*/
@@ -340,6 +588,228 @@
+/* _linear_draw_sprite_h_flip:
+ * Draws a sprite to a linear bitmap, flipping horizontally.
+ */
+void FUNC_LINEAR_DRAW_SPRITE_H_FLIP_EX(BITMAP *dst, BITMAP *src,
+ int dx, int dy, int mode)
+{
+
+ int x, y, w, h;
+ int dxbeg, dybeg;
+ int sxbeg, sybeg;
+ DLS_BLENDER lit_blender;
+ DTS_BLENDER trans_blender;
+
+ ASSERT(dst);
+ ASSERT(src);
+
+ if (dst->clip) {
+ int tmp;
+
+ tmp = dst->cl - dx;
+ sxbeg = MAX(0, tmp);
+ dxbeg = sxbeg + dx;
+
+ tmp = dst->cr - dx;
+ w = MIN(src->w, tmp) - sxbeg;
+ if (w <= 0)
+ return;
+
+ /* use backward drawing onto dst */
+ sxbeg = src->w - (sxbeg + w);
+ dxbeg += w - 1;
+
+ tmp = dst->ct - dy;
+ sybeg = MAX(0, tmp);
+ dybeg = sybeg + dy;
+
+ tmp = dst->cb - dy;
+ h = MIN(src->h, tmp) - sybeg;
+ if (h <= 0)
+ return;
+ }
+ else {
+ w = src->w;
+ h = src->h;
+ sxbeg = 0;
+ sybeg = 0;
+ dxbeg = dx + w - 1;
+ dybeg = dy;
+ }
+
+ lit_blender = MAKE_DLS_BLENDER(0);
+ trans_blender = MAKE_DTS_BLENDER();
+
+ if (dst->id & (BMP_ID_VIDEO | BMP_ID_SYSTEM)) {
+ bmp_select(dst);
+
+ for (y = 0; y < h; y++) {
+ PIXEL_PTR s = OFFSET_PIXEL_PTR(src->line[sybeg + y], sxbeg);
+ PIXEL_PTR d = OFFSET_PIXEL_PTR(bmp_write_line(dst, dybeg + y), dxbeg);
+
+ for (x = w - 1; x >= 0; INC_PIXEL_PTR(s), DEC_PIXEL_PTR(d), x--) {
+ unsigned long c = GET_MEMORY_PIXEL(s);
+ if (!IS_SPRITE_MASK(src, c)) {
+ switch(mode) {
+ case DRAW_SPRITE_NORMAL: break;
+
+ case DRAW_SPRITE_LIT:
+ c = DLSX_BLEND(lit_blender, c);
+ break;
+
+ case DRAW_SPRITE_TRANS:
+ c = DTS_BLEND(trans_blender, GET_PIXEL(d), c);
+ break;
+ }
+ PUT_PIXEL(d, c);
+ }
+ }
+ }
+
+ bmp_unwrite_line(dst);
+ }
+ else {
+ for (y = 0; y < h; y++) {
+ PIXEL_PTR s = OFFSET_PIXEL_PTR(src->line[sybeg + y], sxbeg);
+ PIXEL_PTR d = OFFSET_PIXEL_PTR(dst->line[dybeg + y], dxbeg);
+
+ for (x = w - 1; x >= 0; INC_PIXEL_PTR(s), DEC_PIXEL_PTR(d), x--) {
+ unsigned long c = GET_MEMORY_PIXEL(s);
+ if (!IS_SPRITE_MASK(src, c)) {
+ switch(mode) {
+ case DRAW_SPRITE_NORMAL: break;
+
+ case DRAW_SPRITE_LIT:
+ c = DLSX_BLEND(lit_blender, c);
+ break;
+
+ case DRAW_SPRITE_TRANS:
+ c = DTS_BLEND(trans_blender, GET_PIXEL(d), c);
+ break;
+ }
+ PUT_MEMORY_PIXEL(d, c);
+ }
+ }
+ }
+ }
+}
+
+
+
+/* _linear_draw_sprite_vh_flip_ex:
+ * Draws a sprite to a linear bitmap, flipping both vertically and
+ * horizontally.
+ */
+void FUNC_LINEAR_DRAW_SPRITE_VH_FLIP_EX(BITMAP *dst, BITMAP *src,
+ int dx, int dy, int mode)
+{
+ int x, y, w, h;
+ int dxbeg, dybeg;
+ int sxbeg, sybeg;
+ DLS_BLENDER lit_blender;
+ DTS_BLENDER trans_blender;
+
+ ASSERT(dst);
+ ASSERT(src);
+
+ if (dst->clip) {
+ int tmp;
+
+ tmp = dst->cl - dx;
+ sxbeg = MAX(0, tmp);
+ dxbeg = sxbeg + dx;
+
+ tmp = dst->cr - dx;
+ w = MIN(src->w, tmp) - sxbeg;
+ if (w <= 0)
+ return;
+
+ /* use backward drawing onto dst */
+ sxbeg = src->w - (sxbeg + w);
+ dxbeg += w - 1;
+
+ tmp = dst->ct - dy;
+ sybeg = MAX(0, tmp);
+ dybeg = sybeg + dy;
+
+ tmp = dst->cb - dy;
+ h = MIN(src->h, tmp) - sybeg;
+ if (h <= 0)
+ return;
+
+ /* use backward drawing onto dst */
+ sybeg = src->h - (sybeg + h);
+ dybeg += h - 1;
+ }
+ else {
+ w = src->w;
+ h = src->h;
+ sxbeg = 0;
+ sybeg = 0;
+ dxbeg = dx + w - 1;
+ dybeg = dy + h - 1;
+ }
+
+ lit_blender = MAKE_DLS_BLENDER(0);
+ trans_blender = MAKE_DTS_BLENDER();
+
+ if (dst->id & (BMP_ID_VIDEO | BMP_ID_SYSTEM)) {
+ bmp_select(dst);
+
+ for (y = 0; y < h; y++) {
+ PIXEL_PTR s = OFFSET_PIXEL_PTR(src->line[sybeg + y], sxbeg);
+ PIXEL_PTR d = OFFSET_PIXEL_PTR(bmp_write_line(dst, dybeg - y), dxbeg);
+
+ for (x = w - 1; x >= 0; INC_PIXEL_PTR(s), DEC_PIXEL_PTR(d), x--) {
+ unsigned long c = GET_MEMORY_PIXEL(s);
+ if (!IS_SPRITE_MASK(src, c)) {
+ switch(mode) {
+ case DRAW_SPRITE_NORMAL: break;
+
+ case DRAW_SPRITE_LIT:
+ c = DLSX_BLEND(lit_blender, c);
+ break;
+
+ case DRAW_SPRITE_TRANS:
+ c = DTS_BLEND(trans_blender, GET_PIXEL(d), c);
+ break;
+ }
+ PUT_PIXEL(d, c);
+ }
+ }
+ }
+
+ bmp_unwrite_line(dst);
+ }
+ else {
+ for (y = 0; y < h; y++) {
+ PIXEL_PTR s = OFFSET_PIXEL_PTR(src->line[sybeg + y], sxbeg);
+ PIXEL_PTR d = OFFSET_PIXEL_PTR(dst->line[dybeg - y], dxbeg);
+
+ for (x = w - 1; x >= 0; INC_PIXEL_PTR(s), DEC_PIXEL_PTR(d), x--) {
+ unsigned long c = GET_MEMORY_PIXEL(s);
+ if (!IS_SPRITE_MASK(src, c)) {
+ switch(mode) {
+ case DRAW_SPRITE_NORMAL: break;
+
+ case DRAW_SPRITE_LIT:
+ c = DLSX_BLEND(lit_blender, c);
+ break;
+
+ case DRAW_SPRITE_TRANS:
+ c = DTS_BLEND(trans_blender, GET_PIXEL(d), c);
+ break;
+ }
+ PUT_MEMORY_PIXEL(d, c);
+ }
+ }
+ }
+ }
+}
+
+
+
/* _linear_draw_sprite_vh_flip:
* Draws a sprite to a linear bitmap, flipping both vertically and horizontally.
*/
Index: src/c/cdefs8.h
===================================================================
--- src/c/cdefs8.h (revision 9738)
+++ src/c/cdefs8.h (working copy)
@@ -24,6 +24,7 @@
#define PTR_PER_PIXEL 1
#define OFFSET_PIXEL_PTR(p,x) ((PIXEL_PTR) (p) + (x))
#define INC_PIXEL_PTR(p) ((p)++)
+#define INC_PIXEL_PTR_N(p,d) ((p) += d)
#define DEC_PIXEL_PTR(p) ((p)--)
#define PUT_PIXEL(p,c) bmp_write8((uintptr_t) (p), (c))
@@ -49,6 +50,7 @@
#define DLS_BLENDER unsigned char*
#define MAKE_DLS_BLENDER(a) (color_map->data[(a) & 0xFF])
#define DLS_BLEND(b,a,c) ((b)[(c) & 0xFF])
+#define DLSX_BLEND(b,c) ((b)[(c) & 0xFF])
/* Blender for poly_scanline_*_lit. */
#define PS_BLENDER COLOR_MAP*
@@ -74,10 +76,14 @@
#define FUNC_LINEAR_VLINE _linear_vline8
#define FUNC_LINEAR_DRAW_SPRITE _linear_draw_sprite8
+#define FUNC_LINEAR_DRAW_SPRITE_EX _linear_draw_sprite_ex8
#define FUNC_LINEAR_DRAW_256_SPRITE _linear_draw_256_sprite8
#define FUNC_LINEAR_DRAW_SPRITE_V_FLIP _linear_draw_sprite_v_flip8
+#define FUNC_LINEAR_DRAW_SPRITE_V_FLIP_EX _linear_draw_sprite_v_flip_ex8
#define FUNC_LINEAR_DRAW_SPRITE_H_FLIP _linear_draw_sprite_h_flip8
+#define FUNC_LINEAR_DRAW_SPRITE_H_FLIP_EX _linear_draw_sprite_h_flip_ex8
#define FUNC_LINEAR_DRAW_SPRITE_VH_FLIP _linear_draw_sprite_vh_flip8
+#define FUNC_LINEAR_DRAW_SPRITE_VH_FLIP_EX _linear_draw_sprite_vh_flip_ex8
#define FUNC_LINEAR_DRAW_TRANS_SPRITE _linear_draw_trans_sprite8
#define FUNC_LINEAR_DRAW_TRANS_RGBA_SPRITE _linear_draw_trans_rgba_sprite8
#define FUNC_LINEAR_DRAW_LIT_SPRITE _linear_draw_lit_sprite8
Index: src/vtable8.c
===================================================================
--- src/vtable8.c (revision 9738)
+++ src/vtable8.c (working copy)
@@ -91,7 +91,11 @@
_soft_triangle3d,
_soft_triangle3d_f,
_soft_quad3d,
- _soft_quad3d_f
+ _soft_quad3d_f,
+ _linear_draw_sprite_ex8,
+ _linear_draw_sprite_h_flip_ex8,
+ _linear_draw_sprite_v_flip_ex8,
+ _linear_draw_sprite_vh_flip_ex8
};
Index: src/vtable32.c
===================================================================
--- src/vtable32.c (revision 9738)
+++ src/vtable32.c (working copy)
@@ -91,7 +91,11 @@
_soft_triangle3d,
_soft_triangle3d_f,
_soft_quad3d,
- _soft_quad3d_f
+ _soft_quad3d_f,
+ _linear_draw_sprite_ex32,
+ _linear_draw_sprite_h_flip_ex32,
+ _linear_draw_sprite_v_flip_ex32,
+ _linear_draw_sprite_vh_flip_ex32
};
Index: src/vtable15.c
===================================================================
--- src/vtable15.c (revision 9738)
+++ src/vtable15.c (working copy)
@@ -91,7 +91,11 @@
_soft_triangle3d,
_soft_triangle3d_f,
_soft_quad3d,
- _soft_quad3d_f
+ _soft_quad3d_f,
+ _linear_draw_sprite_ex16,
+ _linear_draw_sprite_h_flip_ex16,
+ _linear_draw_sprite_v_flip_ex16,
+ _linear_draw_sprite_vh_flip_ex16
};
Index: src/x/xvtable.c
===================================================================
--- src/x/xvtable.c (revision 9738)
+++ src/x/xvtable.c (working copy)
@@ -33,10 +33,14 @@
static void _xwin_hline(BITMAP *dst, int dx1, int dy, int dx2, int color);
static void _xwin_rectfill(BITMAP *dst, int dx1, int dy1, int dx2, int dy2, int color);
static void _xwin_draw_sprite(BITMAP *dst, BITMAP *src, int dx, int dy);
+static void _xwin_draw_sprite_ex(BITMAP *dst, BITMAP *src, int dx, int dy, int mode, int flip);
static void _xwin_draw_256_sprite(BITMAP *dst, BITMAP *src, int dx, int dy);
static void _xwin_draw_sprite_v_flip(BITMAP *dst, BITMAP *src, int dx, int dy);
+static void _xwin_draw_sprite_v_flip_ex(BITMAP *dst, BITMAP *src, int dx, int dy, int mode);
static void _xwin_draw_sprite_h_flip(BITMAP *dst, BITMAP *src, int dx, int dy);
+static void _xwin_draw_sprite_h_flip_ex(BITMAP *dst, BITMAP *src, int dx, int dy, int mode);
static void _xwin_draw_sprite_vh_flip(BITMAP *dst, BITMAP *src, int dx, int dy);
+static void _xwin_draw_sprite_vh_flip_ex(BITMAP *dst, BITMAP *src, int dx, int dy, int mode);
static void _xwin_draw_trans_sprite(BITMAP *dst, BITMAP *src, int dx, int dy);
static void _xwin_draw_trans_rgba_sprite(BITMAP *dst, BITMAP *src, int dx, int dy);
static void _xwin_draw_lit_sprite(BITMAP *dst, BITMAP *src, int dx, int dy, int color);
@@ -233,10 +237,14 @@
vtable->hfill = _xwin_hline;
vtable->rectfill = _xwin_rectfill;
vtable->draw_sprite = _xwin_draw_sprite;
+ vtable->draw_sprite_ex = _xwin_draw_sprite_ex;
vtable->draw_256_sprite = _xwin_draw_256_sprite;
vtable->draw_sprite_v_flip = _xwin_draw_sprite_v_flip;
+ vtable->draw_sprite_v_flip_ex = _xwin_draw_sprite_v_flip_ex;
vtable->draw_sprite_h_flip = _xwin_draw_sprite_h_flip;
+ vtable->draw_sprite_h_flip_ex = _xwin_draw_sprite_h_flip_ex;
vtable->draw_sprite_vh_flip = _xwin_draw_sprite_vh_flip;
+ vtable->draw_sprite_vh_flip_ex = _xwin_draw_sprite_vh_flip_ex;
vtable->draw_trans_sprite = _xwin_draw_trans_sprite;
vtable->draw_trans_rgba_sprite = _xwin_draw_trans_rgba_sprite;
vtable->draw_lit_sprite = _xwin_draw_lit_sprite;
@@ -569,8 +577,26 @@
_xwin_update_video_bitmap(dst, dxbeg, dybeg, w, h);
}
+/* _xwin_draw_sprite_ex:
+ * Wrapper for draw_sprite_ex.
+ */
+static void _xwin_draw_sprite_ex(BITMAP *dst, BITMAP *src, int dx, int dy, int mode, int flip)
+{
+ int dxbeg, dybeg, w, h;
+ if (_xwin_in_gfx_call) {
+ _xwin_vtable.draw_sprite_ex(dst, src, dx, dy, mode, flip);
+ return;
+ }
+ CLIP_BOX(dst, dxbeg, dybeg, w, h, dx, dy, src->w, src->h)
+
+ _xwin_in_gfx_call = 1;
+ _xwin_vtable.draw_sprite_ex(dst, src, dx, dy, mode, flip);
+ _xwin_in_gfx_call = 0;
+ _xwin_update_video_bitmap(dst, dxbeg, dybeg, w, h);
+}
+
/* _xwin_draw_256_sprite:
* Wrapper for draw_256_sprite.
*/
@@ -613,8 +639,28 @@
_xwin_update_video_bitmap(dst, dxbeg, dybeg, w, h);
}
+/* _xwin_draw_sprite_v_flip:
+ * Wrapper for draw_sprite_v_flip.
+ */
+static void _xwin_draw_sprite_v_flip_ex(BITMAP *dst, BITMAP *src, int dx, int dy, int mode)
+{
+ int dxbeg, dybeg, w, h;
+ if (_xwin_in_gfx_call) {
+ _xwin_vtable.draw_sprite_v_flip_ex(dst, src, dx, dy, mode);
+ return;
+ }
+ CLIP_BOX(dst, dxbeg, dybeg, w, h, dx, dy, src->w, src->h)
+
+ _xwin_in_gfx_call = 1;
+ _xwin_vtable.draw_sprite_v_flip_ex(dst, src, dx, dy, mode);
+ _xwin_in_gfx_call = 0;
+ _xwin_update_video_bitmap(dst, dxbeg, dybeg, w, h);
+}
+
+
+
/* _xwin_draw_sprite_h_flip:
* Wrapper for draw_sprite_h_flip.
*/
@@ -635,8 +681,26 @@
_xwin_update_video_bitmap(dst, dxbeg, dybeg, w, h);
}
+/* _xwin_draw_sprite_h_flip_ex:
+ * Wrapper for draw_sprite_h_flip_ex.
+ */
+static void _xwin_draw_sprite_h_flip_ex(BITMAP *dst, BITMAP *src, int dx, int dy, int mode)
+{
+ int dxbeg, dybeg, w, h;
+ if (_xwin_in_gfx_call) {
+ _xwin_vtable.draw_sprite_h_flip_ex(dst, src, dx, dy, mode);
+ return;
+ }
+ CLIP_BOX(dst, dxbeg, dybeg, w, h, dx, dy, src->w, src->h)
+
+ _xwin_in_gfx_call = 1;
+ _xwin_vtable.draw_sprite_h_flip_ex(dst, src, dx, dy, mode);
+ _xwin_in_gfx_call = 0;
+ _xwin_update_video_bitmap(dst, dxbeg, dybeg, w, h);
+}
+
/* _xwin_draw_sprite_vh_flip:
* Wrapper for draw_sprite_vh_flip.
*/
@@ -657,8 +721,26 @@
_xwin_update_video_bitmap(dst, dxbeg, dybeg, w, h);
}
+/* _xwin_draw_sprite_vh_flip_ex:
+ * Wrapper for draw_sprite_vh_flip_ex.
+ */
+static void _xwin_draw_sprite_vh_flip_ex(BITMAP *dst, BITMAP *src, int dx, int dy, int mode)
+{
+ int dxbeg, dybeg, w, h;
+ if (_xwin_in_gfx_call) {
+ _xwin_vtable.draw_sprite_vh_flip_ex(dst, src, dx, dy, mode);
+ return;
+ }
+ CLIP_BOX(dst, dxbeg, dybeg, w, h, dx, dy, src->w, src->h)
+
+ _xwin_in_gfx_call = 1;
+ _xwin_vtable.draw_sprite_vh_flip_ex(dst, src, dx, dy, mode);
+ _xwin_in_gfx_call = 0;
+ _xwin_update_video_bitmap(dst, dxbeg, dybeg, w, h);
+}
+
/* _xwin_draw_trans_sprite:
* Wrapper for draw_trans_sprite.
*/
Index: makefile.lst
===================================================================
--- makefile.lst (revision 9738)
+++ makefile.lst (working copy)
@@ -564,6 +564,7 @@
examples/exswitch.c \
examples/extimer.c \
examples/extrans.c \
+ examples/extrans2.c \
examples/extruec.c \
examples/exunicod.c \
examples/exupdate.c \
@@ -615,6 +616,7 @@
examples/exswitch \
examples/extimer \
examples/extrans \
+ examples/extrans2 \
examples/extruec \
examples/exunicod \
examples/exupdate \
Index: include/allegro/gfx.h
===================================================================
--- include/allegro/gfx.h (revision 9738)
+++ include/allegro/gfx.h (working copy)
@@ -37,7 +37,17 @@
#define GFX_AUTODETECT_WINDOWED 2
#define GFX_SAFE AL_ID('S','A','F','E')
+/* drawing modes for draw_sprite_ex() */
+#define DRAW_SPRITE_NORMAL 0
+#define DRAW_SPRITE_LIT 1
+#define DRAW_SPRITE_TRANS 2
+/* flipping modes for draw_sprite_ex() */
+#define DRAW_SPRITE_NO_FLIP 0x0
+#define DRAW_SPRITE_H_FLIP 0x1
+#define DRAW_SPRITE_V_FLIP 0x2
+#define DRAW_SPRITE_VH_FLIP 0x3
+
/* Blender mode defines, for the gfx_driver->set_blender_mode() function */
#define blender_mode_none 0
#define blender_mode_trans 1
@@ -214,6 +224,11 @@
AL_METHOD(void, triangle3d_f, (struct BITMAP *bmp, int type, struct BITMAP *texture, V3D_f *v1, V3D_f *v2, V3D_f *v3));
AL_METHOD(void, quad3d, (struct BITMAP *bmp, int type, struct BITMAP *texture, V3D *v1, V3D *v2, V3D *v3, V3D *v4));
AL_METHOD(void, quad3d_f, (struct BITMAP *bmp, int type, struct BITMAP *texture, V3D_f *v1, V3D_f *v2, V3D_f *v3, V3D_f *v4));
+
+ AL_METHOD(void, draw_sprite_ex, (struct BITMAP *bmp, struct BITMAP *sprite, int x, int y, int mode, int flip ));
+ AL_METHOD(void, draw_sprite_h_flip_ex, (struct BITMAP *bmp, struct BITMAP *sprite, int x, int y, int mode ));
+ AL_METHOD(void, draw_sprite_v_flip_ex, (struct BITMAP *bmp, struct BITMAP *sprite, int x, int y, int mode ));
+ AL_METHOD(void, draw_sprite_vh_flip_ex, (struct BITMAP *bmp, struct BITMAP *sprite, int x, int y, int mode ));
} GFX_VTABLE;
Index: include/allegro/internal/aintern.h
===================================================================
--- include/allegro/internal/aintern.h (revision 9738)
+++ include/allegro/internal/aintern.h (working copy)
@@ -530,9 +530,13 @@
AL_FUNC(void, _linear_vline8, (BITMAP *bmp, int x, int y_1, int y2, int color));
AL_FUNC(void, _linear_hline8, (BITMAP *bmp, int x1, int y, int x2, int color));
AL_FUNC(void, _linear_draw_sprite8, (BITMAP *bmp, BITMAP *sprite, int x, int y));
+AL_FUNC(void, _linear_draw_sprite_ex8, (BITMAP *bmp, BITMAP *sprite, int x, int y, int mode, int flip));
AL_FUNC(void, _linear_draw_sprite_v_flip8, (BITMAP *bmp, BITMAP *sprite, int x, int y));
+AL_FUNC(void, _linear_draw_sprite_v_flip_ex8, (BITMAP *bmp, BITMAP *sprite, int x, int y, int mode));
AL_FUNC(void, _linear_draw_sprite_h_flip8, (BITMAP *bmp, BITMAP *sprite, int x, int y));
+AL_FUNC(void, _linear_draw_sprite_h_flip_ex8, (BITMAP *bmp, BITMAP *sprite, int x, int y, int mode));
AL_FUNC(void, _linear_draw_sprite_vh_flip8, (BITMAP *bmp, BITMAP *sprite, int x, int y));
+AL_FUNC(void, _linear_draw_sprite_vh_flip_ex8, (BITMAP *bmp, BITMAP *sprite, int x, int y, int mode));
AL_FUNC(void, _linear_draw_trans_sprite8, (BITMAP *bmp, BITMAP *sprite, int x, int y));
AL_FUNC(void, _linear_draw_lit_sprite8, (BITMAP *bmp, BITMAP *sprite, int x, int y, int color));
AL_FUNC(void, _linear_draw_rle_sprite8, (BITMAP *bmp, AL_CONST struct RLE_SPRITE *sprite, int x, int y));
@@ -565,10 +569,14 @@
AL_FUNC(void, _linear_vline16, (BITMAP *bmp, int x, int y_1, int y2, int color));
AL_FUNC(void, _linear_hline16, (BITMAP *bmp, int x1, int y, int x2, int color));
AL_FUNC(void, _linear_draw_sprite16, (BITMAP *bmp, BITMAP *sprite, int x, int y));
+AL_FUNC(void, _linear_draw_sprite_ex16, (BITMAP *bmp, BITMAP *sprite, int x, int y, int mode, int flip));
AL_FUNC(void, _linear_draw_256_sprite16, (BITMAP *bmp, BITMAP *sprite, int x, int y));
AL_FUNC(void, _linear_draw_sprite_v_flip16, (BITMAP *bmp, BITMAP *sprite, int x, int y));
+AL_FUNC(void, _linear_draw_sprite_v_flip_ex16, (BITMAP *bmp, BITMAP *sprite, int x, int y, int mode));
AL_FUNC(void, _linear_draw_sprite_h_flip16, (BITMAP *bmp, BITMAP *sprite, int x, int y));
+AL_FUNC(void, _linear_draw_sprite_h_flip_ex16, (BITMAP *bmp, BITMAP *sprite, int x, int y, int mode));
AL_FUNC(void, _linear_draw_sprite_vh_flip16, (BITMAP *bmp, BITMAP *sprite, int x, int y));
+AL_FUNC(void, _linear_draw_sprite_vh_flip_ex16, (BITMAP *bmp, BITMAP *sprite, int x, int y, int mode));
AL_FUNC(void, _linear_draw_trans_sprite16, (BITMAP *bmp, BITMAP *sprite, int x, int y));
AL_FUNC(void, _linear_draw_trans_rgba_sprite16, (BITMAP *bmp, BITMAP *sprite, int x, int y));
AL_FUNC(void, _linear_draw_lit_sprite16, (BITMAP *bmp, BITMAP *sprite, int x, int y, int color));
@@ -592,10 +600,14 @@
AL_FUNC(void, _linear_vline24, (BITMAP *bmp, int x, int y_1, int y2, int color));
AL_FUNC(void, _linear_hline24, (BITMAP *bmp, int x1, int y, int x2, int color));
AL_FUNC(void, _linear_draw_sprite24, (BITMAP *bmp, BITMAP *sprite, int x, int y));
+AL_FUNC(void, _linear_draw_sprite_ex24, (BITMAP *bmp, BITMAP *sprite, int x, int y, int mode, int flip));
AL_FUNC(void, _linear_draw_256_sprite24, (BITMAP *bmp, BITMAP *sprite, int x, int y));
AL_FUNC(void, _linear_draw_sprite_v_flip24, (BITMAP *bmp, BITMAP *sprite, int x, int y));
+AL_FUNC(void, _linear_draw_sprite_v_flip_ex24, (BITMAP *bmp, BITMAP *sprite, int x, int y, int mode));
AL_FUNC(void, _linear_draw_sprite_h_flip24, (BITMAP *bmp, BITMAP *sprite, int x, int y));
+AL_FUNC(void, _linear_draw_sprite_h_flip_ex24, (BITMAP *bmp, BITMAP *sprite, int x, int y, int mode));
AL_FUNC(void, _linear_draw_sprite_vh_flip24, (BITMAP *bmp, BITMAP *sprite, int x, int y));
+AL_FUNC(void, _linear_draw_sprite_vh_flip_ex24, (BITMAP *bmp, BITMAP *sprite, int x, int y, int mode));
AL_FUNC(void, _linear_draw_trans_sprite24, (BITMAP *bmp, BITMAP *sprite, int x, int y));
AL_FUNC(void, _linear_draw_trans_rgba_sprite24, (BITMAP *bmp, BITMAP *sprite, int x, int y));
AL_FUNC(void, _linear_draw_lit_sprite24, (BITMAP *bmp, BITMAP *sprite, int x, int y, int color));
@@ -619,10 +631,14 @@
AL_FUNC(void, _linear_vline32, (BITMAP *bmp, int x, int y_1, int y2, int color));
AL_FUNC(void, _linear_hline32, (BITMAP *bmp, int x1, int y, int x2, int color));
AL_FUNC(void, _linear_draw_sprite32, (BITMAP *bmp, BITMAP *sprite, int x, int y));
+AL_FUNC(void, _linear_draw_sprite_ex32, (BITMAP *bmp, BITMAP *sprite, int x, int y, int mode, int flip));
AL_FUNC(void, _linear_draw_256_sprite32, (BITMAP *bmp, BITMAP *sprite, int x, int y));
AL_FUNC(void, _linear_draw_sprite_v_flip32, (BITMAP *bmp, BITMAP *sprite, int x, int y));
+AL_FUNC(void, _linear_draw_sprite_v_flip_ex32, (BITMAP *bmp, BITMAP *sprite, int x, int y, int mode));
AL_FUNC(void, _linear_draw_sprite_h_flip32, (BITMAP *bmp, BITMAP *sprite, int x, int y));
+AL_FUNC(void, _linear_draw_sprite_h_flip_ex32, (BITMAP *bmp, BITMAP *sprite, int x, int y, int mode));
AL_FUNC(void, _linear_draw_sprite_vh_flip32, (BITMAP *bmp, BITMAP *sprite, int x, int y));
+AL_FUNC(void, _linear_draw_sprite_vh_flip_ex32, (BITMAP *bmp, BITMAP *sprite, int x, int y, int mode));
AL_FUNC(void, _linear_draw_trans_sprite32, (BITMAP *bmp, BITMAP *sprite, int x, int y));
AL_FUNC(void, _linear_draw_lit_sprite32, (BITMAP *bmp, BITMAP *sprite, int x, int y, int color));
AL_FUNC(void, _linear_draw_rle_sprite32, (BITMAP *bmp, AL_CONST struct RLE_SPRITE *sprite, int x, int y));
Index: include/allegro/inline/draw.inl
===================================================================
--- include/allegro/inline/draw.inl (revision 9738)
+++ include/allegro/inline/draw.inl (working copy)
@@ -249,7 +249,16 @@
}
})
+AL_INLINE(void, draw_sprite_ex, (BITMAP *bmp, BITMAP *sprite, int x, int y, int mode, int flip),
+{
+ ASSERT(bmp);
+ ASSERT(sprite);
+ ASSERT(bmp->vtable->color_depth == sprite->vtable->color_depth);
+ bmp->vtable->draw_sprite_ex(bmp, sprite, x, y, mode, flip);
+})
+
+
AL_INLINE(void, draw_sprite_v_flip, (BITMAP *bmp, BITMAP *sprite, int x, int y),{
ASSERT(bmp);
ASSERT(sprite);
@@ -258,7 +267,14 @@
bmp->vtable->draw_sprite_v_flip(bmp, sprite, x, y);
})
+AL_INLINE(void, draw_sprite_v_flip_ex, (BITMAP *bmp, BITMAP *sprite, int x, int y, int mode),{
+ ASSERT(bmp);
+ ASSERT(sprite);
+ ASSERT(bmp->vtable->color_depth == sprite->vtable->color_depth);
+ bmp->vtable->draw_sprite_v_flip_ex(bmp, sprite, x, y, mode);
+})
+
AL_INLINE(void, draw_sprite_h_flip, (BITMAP *bmp, BITMAP *sprite, int x, int y),{
ASSERT(bmp);
ASSERT(sprite);
@@ -267,7 +283,14 @@
bmp->vtable->draw_sprite_h_flip(bmp, sprite, x, y);
})
+AL_INLINE(void, draw_sprite_h_flip_ex, (BITMAP *bmp, BITMAP *sprite, int x, int y, int mode ),{
+ ASSERT(bmp);
+ ASSERT(sprite);
+ ASSERT(bmp->vtable->color_depth == sprite->vtable->color_depth);
+ bmp->vtable->draw_sprite_h_flip_ex(bmp, sprite, x, y, mode);
+})
+
AL_INLINE(void, draw_sprite_vh_flip, (BITMAP *bmp, BITMAP *sprite, int x, int y),
{
ASSERT(bmp);
@@ -277,7 +300,15 @@
bmp->vtable->draw_sprite_vh_flip(bmp, sprite, x, y);
})
+AL_INLINE(void, draw_sprite_vh_flip_ex, (BITMAP *bmp, BITMAP *sprite, int x, int y, int mode),
+{
+ ASSERT(bmp);
+ ASSERT(sprite);
+ ASSERT(bmp->vtable->color_depth == sprite->vtable->color_depth);
+ bmp->vtable->draw_sprite_vh_flip_ex(bmp, sprite, x, y, mode);
+})
+
AL_INLINE(void, draw_trans_sprite, (BITMAP *bmp, BITMAP *sprite, int x, int y),
{
ASSERT(bmp);