[ Thread Index |
Date Index
| More lists.liballeg.org/allegro-developers Archives
]
Hi,
When blitting to a mode-X screen, it doesn't dither even if the dither
flag is set. This patch fixes it. Tested under djgpp.
--
Sven
Index: src/blit.c
===================================================================
RCS file: /cvsroot/alleg/allegro/src/blit.c,v
retrieving revision 1.11
diff -u -r1.11 blit.c
--- src/blit.c 12 Sep 2002 16:23:56 -0000 1.11
+++ src/blit.c 10 Oct 2003 20:26:13 -0000
@@ -622,14 +622,18 @@
int prev_drawmode = _drawing_mode;
_drawing_mode = DRAW_MODE_SOLID;
- for (y=0; y<h; y++) {
- for (x=0; x<w; x++) {
- c = getpixel(src, s_x+x, s_y+y);
- r = getr_depth(src_depth, c);
- g = getg_depth(src_depth, c);
- b = getb_depth(src_depth, c);
- c = makecol_depth(dest_depth, r, g, b);
- putpixel(dest, d_x+x, d_y+y, c);
+ if ((src_depth != 8) && (_color_conv & COLORCONV_DITHER_PAL))
+ dither_blit(src, dest, s_x, s_y, d_x, d_y, w, h);
+ else {
+ for (y=0; y<h; y++) {
+ for (x=0; x<w; x++) {
+ c = getpixel(src, s_x+x, s_y+y);
+ r = getr_depth(src_depth, c);
+ g = getg_depth(src_depth, c);
+ b = getb_depth(src_depth, c);
+ c = makecol_depth(dest_depth, r, g, b);
+ putpixel(dest, d_x+x, d_y+y, c);
+ }
}
}