Re: [AD] Patch for two new entries to GFX_VTABLE

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


Bob wrote:

[snip]
Ok, I'll submit a replacement patch.


Here it is.


--
- Robert J Ohannessian
"Microsoft code is probably O(n^20)" (my CS prof)
http://pages.infinit.net/voidstar/
Index: include/allegro/gfx.h
===================================================================
RCS file: /cvsroot/alleg/allegro/include/allegro/gfx.h,v
retrieving revision 1.1
diff -u -b -r1.1 gfx.h
--- include/allegro/gfx.h	2001/11/06 16:06:47	1.1
+++ include/allegro/gfx.h	2001/11/11 14:39:28
@@ -169,8 +169,10 @@
    AL_METHOD(void, blit_to_self_forward, (struct BITMAP *source, struct BITMAP *dest, int source_x, int source_y, int dest_x, int dest_y, int width, int height));
    AL_METHOD(void, blit_to_self_backward, (struct BITMAP *source, struct BITMAP
 *dest, int source_x, int source_y, int dest_x, int dest_y, int width, int height));
+   AL_METHOD(void, blit_between_formats, (struct BITMAP *source, struct BITMAP *dest, int source_x, int source_y, int dest_x, int dest_y, int width, int height));
    AL_METHOD(void, masked_blit, (struct BITMAP *source, struct BITMAP *dest, int source_x, int source_y, int dest_x, int dest_y, int width, int height));
    AL_METHOD(void, clear_to_color, (struct BITMAP *bitmap, int color));
+   AL_METHOD(void, pivot_scaled_sprite_flip, (struct BITMAP *dest, struct BITMAP *source, int x, int y, int center_x, int center_y, int angle, int scale, int v_flip));
    AL_METHOD(void, draw_sprite_end, (void));
    AL_METHOD(void, blit_end, (void));
 } GFX_VTABLE;
Index: src/blit.c
===================================================================
RCS file: /cvsroot/alleg/allegro/src/blit.c,v
retrieving revision 1.9
diff -u -b -r1.9 blit.c
--- src/blit.c	2001/11/06 15:30:46	1.9
+++ src/blit.c	2001/11/11 14:39:32
@@ -785,9 +785,11 @@
 {
    BLIT_CLIP();
 
-   if (!(is_video_bitmap(dest) && is_video_bitmap(src)) && 
-       (src->vtable->color_depth != dest->vtable->color_depth)) {
+   if (src->vtable->color_depth != dest->vtable->color_depth) {
       /* need to do a color conversion */
+      if (dest->vtable->blit_between_formats)
+         dest->vtable->blit_between_formats(src, dest, s_x, s_y, d_x, d_y, w, h);
+      else
       blit_between_formats(src, dest, s_x, s_y, d_x, d_y, w, h);
    }
    else if (is_same_bitmap(src, dest)) {
Index: src/rotate.c
===================================================================
RCS file: /cvsroot/alleg/allegro/src/rotate.c,v
retrieving revision 1.9
diff -u -b -r1.9 rotate.c
--- src/rotate.c	2001/11/06 15:30:46	1.9
+++ src/rotate.c	2001/11/11 14:39:35
@@ -810,8 +810,14 @@
 			 int x, int y, int cx, int cy,
 			 fixed angle, fixed scale)
 {
+   if (bmp->vtable->pivot_scaled_sprite_flip) {
+      bmp->vtable->pivot_scaled_sprite_flip(bmp, sprite, x << 16, y << 16,
+			     cx << 16, cy << 16, angle, scale, FALSE);
+   }
+   else {
    _pivot_scaled_sprite_flip(bmp, sprite, x<<16, y<<16, cx<<16, cy<<16,
 			     angle, scale, FALSE);
+   }
 }
 
 
@@ -823,8 +829,14 @@
 		  int x, int y, int cx, int cy,
 		  fixed angle)
 {
+   if (bmp->vtable->pivot_scaled_sprite_flip) {
+      bmp->vtable->pivot_scaled_sprite_flip(bmp, sprite, x << 16, y << 16,
+			     cx << 16, cy << 16, angle, 0x10000, FALSE);
+   }
+   else {
    _pivot_scaled_sprite_flip(bmp, sprite, x<<16, y<<16, cx<<16, cy<<16,
 			     angle, 0x10000, FALSE);
+   }
 }
 
 
@@ -837,8 +849,14 @@
 				int x, int y, int cx, int cy,
 				fixed angle, fixed scale)
 {
+   if (bmp->vtable->pivot_scaled_sprite_flip) {
+      bmp->vtable->pivot_scaled_sprite_flip(bmp, sprite, x << 16, y << 16,
+			     cx << 16, cy << 16, angle, scale, TRUE);
+   }
+   else {
    _pivot_scaled_sprite_flip(bmp, sprite, x<<16, y<<16, cx<<16, cy<<16,
 			     angle, scale, TRUE);
+   }
 }
 
 
@@ -850,8 +868,14 @@
 			 int x, int y, int cx, int cy,
 			 fixed angle)
 {
+   if (bmp->vtable->pivot_scaled_sprite_flip) {
+      bmp->vtable->pivot_scaled_sprite_flip(bmp, sprite, x << 16, y << 16,
+			     cx << 16, cy << 16, angle, 0x10000, TRUE);
+   }
+   else {
    _pivot_scaled_sprite_flip(bmp, sprite, x<<16, y<<16, cx<<16, cy<<16,
 			     angle, 0x10000, TRUE);
+   }
 }
 
 
@@ -870,11 +894,20 @@
 				       fixed x, fixed y,
 				       fixed angle, fixed scale, int v_flip)
 {
+   if (bmp->vtable->pivot_scaled_sprite_flip) {
+      bmp->vtable->pivot_scaled_sprite_flip(bmp, sprite,
+			     x + (sprite->w * scale) / 2,
+			     y + (sprite->h * scale) / 2,
+			     sprite->w << 15, sprite->h << 15,
+			     angle, scale, v_flip);
+   }
+   else {
    _pivot_scaled_sprite_flip(bmp, sprite,
 			     x + (sprite->w * scale) / 2,
 			     y + (sprite->h * scale) / 2,
 			     sprite->w << 15, sprite->h << 15,
 			     angle, scale, v_flip);
+   }
 }
 
 
Index: src/vtable15.c
===================================================================
RCS file: /cvsroot/alleg/allegro/src/vtable15.c,v
retrieving revision 1.3
diff -u -b -r1.3 vtable15.c
--- src/vtable15.c	2001/11/06 15:30:46	1.3
+++ src/vtable15.c	2001/11/11 14:39:35
@@ -67,8 +67,10 @@
    _linear_blit16,
    _linear_blit16,
    _linear_blit_backward16,
+   NULL,                   /* AL_METHOD(void, blit_between_formats, (BITMAP *source, BITMAP *dest, int source_x, int source_y, int dest_x, int dest_y, int width, int height)) */
    _linear_masked_blit16,
    _linear_clear_to_color16,
+   NULL,                   /* AL_METHOD(void, pivot_scaled_sprite_flip(BITMAP *dest, BITMAP *source, fixed x, fixed y, fixed center_x, fixed center_y, fixed angle, fixed scale, int v_flip)) */
    _linear_draw_sprite16_end,
    _linear_blit16_end
 };
Index: src/vtable16.c
===================================================================
RCS file: /cvsroot/alleg/allegro/src/vtable16.c,v
retrieving revision 1.3
diff -u -b -r1.3 vtable16.c
--- src/vtable16.c	2001/11/06 15:30:46	1.3
+++ src/vtable16.c	2001/11/11 14:39:35
@@ -67,8 +67,10 @@
    _linear_blit16,
    _linear_blit16,
    _linear_blit_backward16,
+   NULL,                   /* AL_METHOD(void, blit_between_formats, (BITMAP *source, BITMAP *dest, int source_x, int source_y, int dest_x, int dest_y, int width, int height)) */
    _linear_masked_blit16,
    _linear_clear_to_color16,
+   NULL,                   /* AL_METHOD(void, pivot_scaled_sprite_flip(BITMAP *dest, BITMAP *source, fixed x, fixed y, fixed center_x, fixed center_y, fixed angle, fixed scale, int v_flip)) */
    _linear_draw_sprite16_end,
    _linear_blit16_end
 };
Index: src/vtable24.c
===================================================================
RCS file: /cvsroot/alleg/allegro/src/vtable24.c,v
retrieving revision 1.3
diff -u -b -r1.3 vtable24.c
--- src/vtable24.c	2001/11/06 15:30:46	1.3
+++ src/vtable24.c	2001/11/11 14:39:35
@@ -67,8 +67,10 @@
    _linear_blit24,
    _linear_blit24,
    _linear_blit_backward24,
+   NULL,                   /* AL_METHOD(void, blit_between_formats, (BITMAP *source, BITMAP *dest, int source_x, int source_y, int dest_x, int dest_y, int width, int height)) */
    _linear_masked_blit24,
    _linear_clear_to_color24,
+   NULL,                   /* AL_METHOD(void, pivot_scaled_sprite_flip(BITMAP *dest, BITMAP *source, fixed x, fixed y, fixed center_x, fixed center_y, fixed angle, fixed scale, int v_flip)) */
    _linear_draw_sprite24_end,
    _linear_blit24_end
 };
Index: src/vtable32.c
===================================================================
RCS file: /cvsroot/alleg/allegro/src/vtable32.c,v
retrieving revision 1.3
diff -u -b -r1.3 vtable32.c
--- src/vtable32.c	2001/11/06 15:30:46	1.3
+++ src/vtable32.c	2001/11/11 14:39:35
@@ -67,8 +67,10 @@
    _linear_blit32,
    _linear_blit32,
    _linear_blit_backward32,
+   NULL,                   /* AL_METHOD(void, blit_between_formats, (BITMAP *source, BITMAP *dest, int source_x, int source_y, int dest_x, int dest_y, int width, int height)) */
    _linear_masked_blit32,
    _linear_clear_to_color32,
+   NULL,                   /* AL_METHOD(void, pivot_scaled_sprite_flip(BITMAP *dest, BITMAP *source, fixed x, fixed y, fixed center_x, fixed center_y, fixed angle, fixed scale, int v_flip)) */
    _linear_draw_sprite32_end,
    _linear_blit32_end
 };
Index: src/vtable8.c
===================================================================
RCS file: /cvsroot/alleg/allegro/src/vtable8.c,v
retrieving revision 1.3
diff -u -b -r1.3 vtable8.c
--- src/vtable8.c	2001/11/06 15:30:46	1.3
+++ src/vtable8.c	2001/11/11 14:39:36
@@ -67,8 +67,10 @@
    _linear_blit8,
    _linear_blit8,
    _linear_blit_backward8,
+   NULL,                   /* AL_METHOD(void, blit_between_formats, (BITMAP *source, BITMAP *dest, int source_x, int source_y, int dest_x, int dest_y, int width, int height)) */
    _linear_masked_blit8,
    _linear_clear_to_color8,
+   NULL,                   /* AL_METHOD(void, pivot_scaled_sprite_flip(BITMAP *dest, BITMAP *source, fixed x, fixed y, fixed center_x, fixed center_y, fixed angle, fixed scale, int v_flip)) */
    _linear_draw_sprite8_end,
    _linear_blit8_end
 };
Index: src/misc/modex.c
===================================================================
RCS file: /cvsroot/alleg/allegro/src/misc/modex.c,v
retrieving revision 1.18
diff -u -b -r1.18 modex.c
--- src/misc/modex.c	2001/11/06 17:16:40	1.18
+++ src/misc/modex.c	2001/11/11 14:39:40
@@ -83,8 +83,10 @@
    _x_blit,
    _x_blit_forward,
    _x_blit_backward,
+   NULL,                   /* AL_METHOD(void, blit_between_formats, (BITMAP *source, BITMAP *dest, int source_x, int source_y, int dest_x, int dest_y, int width, int height)) */
    _x_masked_blit,
    _x_clear_to_color,
+   NULL,                   /* AL_METHOD(void, pivot_scaled_sprite_flip(BITMAP *dest, BITMAP *source, fixed x, fixed y, fixed center_x, fixed center_y, fixed angle, fixed scale, int v_flip)) */
    _x_draw_sprite_end,
    _x_blit_from_memory_end
 };



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/