From e207d2671c3db087f0ec1b9f6594f1746ca16fa7 Mon Sep 17 00:00:00 2001 From: tobigun Date: Fri, 23 Apr 2010 21:06:38 +0000 Subject: byte order of some C enums was incorrect git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@2286 b956fd51-792f-4845-bead-9b4dfca2ff2c --- src/lib/freetype/ftimage.inc | 60 ++++++++++++++++++++++++++++++++++++++------ 1 file changed, 53 insertions(+), 7 deletions(-) (limited to 'src/lib/freetype/ftimage.inc') diff --git a/src/lib/freetype/ftimage.inc b/src/lib/freetype/ftimage.inc index 9255c422..d16d52a2 100644 --- a/src/lib/freetype/ftimage.inc +++ b/src/lib/freetype/ftimage.inc @@ -452,6 +452,33 @@ const end; + (*************************************************************************) + (* *) + (* *) + (* FT_IMAGE_TAG *) + (* *) + (* *) + (* This macro converts four-letter tags to an unsigned long type. *) + (* *) + (* *) + (* Since many 16-bit compilers don't like 32-bit enumerations, you *) + (* should redefine this macro in case of problems to something like *) + (* this: *) + (* *) + (* { *) + (* #define FT_IMAGE_TAG( value, _x1, _x2, _x3, _x4 ) value *) + (* } *) + (* *) + (* to get a simple enumeration without assigning special numbers. *) + (* *) + { + #define FT_IMAGE_TAG( value, _x1, _x2, _x3, _x4 ) \ + value = ( ( (unsigned long)_x1 << 24 ) | \ + ( (unsigned long)_x2 << 16 ) | \ + ( (unsigned long)_x3 << 8 ) | \ + (unsigned long)_x4 ) + } + (*************************************************************************) (* *) (* *) @@ -490,15 +517,34 @@ const (* @FT_Outline, but FreeType isn't currently capable of rendering *) (* them correctly. *) (* *) - FT_Glyph_Format = array[0..3] of char; + // Note: enums are 32 bit on x86 AND x86_64 + FT_Glyph_Format = cuint32; // 32 bit enum of FT_IMAGE_TAG {$ELSE TYPE_DECL} const - FT_GLYPH_FORMAT_NONE: FT_Glyph_Format = (#0, #0, #0, #0 ); - - FT_GLYPH_FORMAT_COMPOSITE: FT_Glyph_Format = ('c', 'o', 'm', 'p' ); - FT_GLYPH_FORMAT_BITMAP: FT_Glyph_Format = ('b', 'i', 't', 's' ); - FT_GLYPH_FORMAT_OUTLINE: FT_Glyph_Format = ('o', 'u', 't', 'l' ); - FT_GLYPH_FORMAT_PLOTTER: FT_Glyph_Format = ('p', 'l', 'o', 't' ); + FT_GLYPH_FORMAT_NONE = (Ord(#0) shl 24) or + (Ord(#0) shl 16) or + (Ord(#0) shl 8) or + (Ord(#0) shl 0); + + FT_GLYPH_FORMAT_COMPOSITE = (Ord('c') shl 24) or + (Ord('o') shl 16) or + (Ord('m') shl 8) or + (Ord('p') shl 0); + + FT_GLYPH_FORMAT_BITMAP = (Ord('b') shl 24) or + (Ord('i') shl 16) or + (Ord('t') shl 8) or + (Ord('s') shl 0); + + FT_GLYPH_FORMAT_OUTLINE = (Ord('o') shl 24) or + (Ord('u') shl 16) or + (Ord('t') shl 8) or + (Ord('l') shl 0); + + FT_GLYPH_FORMAT_PLOTTER = (Ord('p') shl 24) or + (Ord('l') shl 16) or + (Ord('o') shl 8) or + (Ord('t') shl 0); {$ENDIF TYPE_DECL} -- cgit v1.2.3