[ Thread Index |
Date Index
| More lists.liballeg.org/allegro-developers Archives
]
Attached is a small documentation fix that fixes a typo (we should really
have a way to look for these systematically) and corrects an error by
omission.
Also attached is a small datafile loader patch that prevents
create_bitmap_ex() from trying to create a temporary bitmap with less than
256 colours. The only place where this will actually happen is if you try
to load the Allegro 1.0 demo.dat, which is a fairly unlikely scenario.
However, Allegro used to just crash before in that case and with this fix
it can actually read the file correctly (well, hurray).
Evert
Index: src/datafile.c
===================================================================
RCS file: /cvsroot/alleg/allegro/src/datafile.c,v
retrieving revision 1.33
diff -u -r1.33 datafile.c
--- src/datafile.c 1 Feb 2005 13:12:06 -0000 1.33
+++ src/datafile.c 30 Apr 2005 09:20:07 -0000
@@ -126,7 +126,7 @@
w = pack_mgetw(f);
h = pack_mgetw(f);
- bmp = create_bitmap_ex(bits, w, h);
+ bmp = create_bitmap_ex(MAX(bits, 8), w, h);
if (!bmp) {
*allegro_errno = ENOMEM;
return NULL;
Index: docs/src/allegro._tx
===================================================================
RCS file: /cvsroot/alleg/allegro/docs/src/allegro._tx,v
retrieving revision 1.322
diff -u -r1.322 allegro._tx
--- docs/src/allegro._tx 24 Apr 2005 08:26:12 -0000 1.322
+++ docs/src/allegro._tx 30 Apr 2005 09:24:33 -0000
@@ -4536,7 +4536,7 @@
pixel). Example:
<codeblock>
/* Create screen sized bitmap in 32 bits per pixel. /*
- BITMAP *bmp = create_bitmap_x(32, SCREEN_W, SCREEN_H);
+ BITMAP *bmp = create_bitmap_ex(32, SCREEN_W, SCREEN_H);
if (!bmp)
abort_on_error("Couldn't create bitmap!");
/* Use the bitmap. */
@@ -6512,10 +6512,10 @@
@heading
Fonts
-Allegro provides routines for loading fonts from GRX format .fnt files, 8x8
-or 8x16 BIOS format .fnt files, and from bitmap images, or you can import a
-multiple-range Unicode font by writing a .txt script that specifies a number
-of different source files for each range of characters.
+Allegro provides routines for loading fonts directly from GRX format .fnt
+files, 8x8 or 8x16 BIOS format .fnt files, from bitmap images, from datafiles
+or you can import a multiple-range Unicode font by writing a .txt script that
+specifies a number of different source files for each range of characters.
By default, Allegro can only use bitmapped (non-scalable) fonts. If you want
to use TrueType fonts, you will need to use an add-on library which allows
@@ -6551,8 +6551,8 @@
@eref exfont
@shortdesc Loads a font from a file.
Loads a font from a file. At present, this supports loading fonts from
- a GRX format .fnt file, a 8x8 or 8x16 BIOS format .fnt file or any bitmap
- format that can be loaded by load_bitmap().
+ a GRX format .fnt file, a 8x8 or 8x16 BIOS format .fnt file, a datafile or
+ any bitmap format that can be loaded by load_bitmap().
If the font contains palette information, then the palette is returned in
the second parameter, which should be an array of 256 RGB structures