Re: [AD] fix for export of color fonts in datfont.c

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


In reply to Laurence Withers <lwithers@xxxxxxxxxx>:
>Anyway, to be consistent, I've rewritten Elias's patch so that it grabs
>the current palette and uses that.

And here's the patch :-)
--- /djgpp/allegro/tools/plugins/datfont.c	Mon Dec  3 16:14:46 2001
+++ allegro/tools/plugins/datfont.c	Tue Jan 15 08:43:24 2002
@@ -274,7 +274,7 @@
 
         while(cf) {
             for(i = cf->begin; i < cf->end; i++) {
-                textprintf(bmp, f, 1 + w * (max & 15), 1 + h * (max / 16), 1, "%c", i);
+                textprintf(bmp, f, 1 + w * (max & 15), 1 + h * (max / 16), -1, "%c", i);
                 max++;
             }
 
@@ -282,13 +282,7 @@
         }
     }
 
-    pal[0].r = pal[0].b = 63;
-    pal[0].g = 0;
-
-    for(i = 1; i < 255; i++) pal[i].r = pal[i].g = pal[i].b = ((i - 1) * 63) / 253;
-
-    pal[255].r = pal[255].g = 63;
-    pal[255].b = 0;
+    get_palette(pal);
 
     save_bitmap(filename, bmp, pal);
     destroy_bitmap(bmp);
Bye for now,
-- 
Laurence Withers, lwithers@xxxxxxxxxx
                http://www.lwithers.demon.co.uk/

Attachment: signature.asc
Description: PGP signature



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