diff options
author | zybi <zybi@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2001-08-24 10:46:31 +0000 |
---|---|---|
committer | zybi <zybi@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2001-08-24 10:46:31 +0000 |
commit | 5a91214b593361aac7160fee4217c932e3fd5ad5 (patch) | |
tree | d47bb246091f25691cdbcbd21c0d679d9b06a513 /TOOLS | |
parent | 31bcbc3e5f3187b699fca5de75e8345759225433 (diff) | |
download | mpv-5a91214b593361aac7160fee4217c932e3fd5ad5.tar.bz2 mpv-5a91214b593361aac7160fee4217c932e3fd5ad5.tar.xz |
Resolved endianess issues.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@1678 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'TOOLS')
-rw-r--r-- | TOOLS/subfont-c/Makefile | 6 | ||||
-rw-r--r-- | TOOLS/subfont-c/README | 2 | ||||
-rw-r--r-- | TOOLS/subfont-c/subfont.c | 20 |
3 files changed, 12 insertions, 16 deletions
diff --git a/TOOLS/subfont-c/Makefile b/TOOLS/subfont-c/Makefile index 061f5d5c2c..bc8a0f3ce3 100644 --- a/TOOLS/subfont-c/Makefile +++ b/TOOLS/subfont-c/Makefile @@ -12,10 +12,10 @@ CFLAGS=$(OPTFLAGS) $(shell freetype-config --cflags) subfont: subfont.o -subfont.o: subfont.c Makefile +subfont.o: subfont.c Makefile ../../bswap.h -subfont.S: subfont.c - $(CC) $(CFLAGS) -S $^ -o $@ +subfont.S: subfont.c Makefile ../../bswap.h + $(CC) $(CFLAGS) -S $< -o $@ clean: rm -f subfont subfont.o core diff --git a/TOOLS/subfont-c/README b/TOOLS/subfont-c/README index 64d0402904..b1e65e0464 100644 --- a/TOOLS/subfont-c/README +++ b/TOOLS/subfont-c/README @@ -100,8 +100,6 @@ Notes: + Starting x position of each character and the bitmap width is aligned to multiple of 8 (required by mplayer). - + Currently subfont won't work on big-endian systems. I need help. - + My development platform is RedHat 7.1. FreeType versions tested are 2.0.1 through 2.0.4. diff --git a/TOOLS/subfont-c/subfont.c b/TOOLS/subfont-c/subfont.c index af469f16ce..74a24affaf 100644 --- a/TOOLS/subfont-c/subfont.c +++ b/TOOLS/subfont-c/subfont.c @@ -17,18 +17,18 @@ #ifndef OLD_FREETYPE2 - #include <ft2build.h> #include FT_FREETYPE_H #include FT_GLYPH_H - #else /* freetype 2.0.1 */ - #include <freetype/freetype.h> #include <freetype/ftglyph.h> - #endif + +#include "../../bswap.h" + + #ifndef DEBUG #define DEBUG 0 #endif @@ -418,14 +418,12 @@ FT_ULong decode_char(char c) { int outbytesleft = sizeof(FT_ULong); size_t count = iconv(cd, &inbuf, &inbytesleft, &outbuf, &outbytesleft); -// if (count==-1) o = 0; // not OK, at least my iconv() returns E2BIG for all - if (outbytesleft!=0) o = 0; - /* convert unicode BE -> LE */ - o = ((o>>24)&0xff) - | ((o>>8)&0xff00) - | ((o&0xff00)<<8) - | ((o&0xff)<<24); + /* convert unicode BigEndian -> MachineEndian */ + o = be2me_32(o); + + // if (count==-1) o = 0; // not OK, at least my iconv() returns E2BIG for all + if (outbytesleft!=0) o = 0; /* we don't want control characters */ if (o>=0x7f && o<0xa0) o = 0; |