Re: [AD] [BUG] textprintf in 24 bpp

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


Bertrand Coconnier <bcoconni@xxxxxxxxxx> writes:

> I have found a bug that occurs when Allegro is compiled without ASM
> support (./configure --disable-asm) : if you try to print a text with a
> colored font using textprintf on a 24 bpp BITMAP then the result is
> wrong...

Try the following patch.  I have not tested it, but I'm sure it should
fix this problem.

--- old/allegro/src/c/cspr.h	Thu Jun 21 02:31:10 2001
+++ new/allegro/src/c/cspr.h	Sat Dec 15 23:06:36 2001
@@ -144,7 +144,7 @@
 	 unsigned char *s = 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--) {
+	 for (x = w - 1; x >= 0; s++, INC_PIXEL_PTR(d), x--) {
 	    unsigned long c = *s;
 	    if (c != 0) {
 	       c = table[c];
@@ -160,7 +160,7 @@
 	 unsigned char *s = 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--) {
+	 for (x = w - 1; x >= 0; s++, INC_PIXEL_PTR(d), x--) {
 	    unsigned long c = *s;
 	    if (c != 0) {
 	       c = table[c];


-- 
Michael Bukin



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