mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2024-12-27 09:58:45 +01:00
revert r2797; endian issues are screwing up mask calculation
This commit is contained in:
parent
784906fde0
commit
17f27f3764
1 changed files with 7 additions and 7 deletions
|
@ -373,15 +373,15 @@ logBitmap( const BITMAP* bm, XP_U16 width, XP_U16 height )
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static XP_Bool
|
static XP_Bool
|
||||||
anyBitSet( const XP_U16* rowPtr, XP_S16 rowBits )
|
anyBitSet( const XP_U8* rowPtr, XP_S16 rowBits )
|
||||||
{
|
{
|
||||||
XP_Bool set = XP_FALSE;
|
XP_Bool set = XP_FALSE;
|
||||||
|
|
||||||
XP_ASSERT( ((int)rowPtr & 0x0001) == 0 ); /* ptr to word? */
|
XP_ASSERT( ((int)rowPtr & 0x0001) == 0 ); /* ptr to word? */
|
||||||
for ( ; rowBits > 0; rowBits -= 16, ++rowPtr ) {
|
for ( ; rowBits > 0; rowBits -= 8, ++rowPtr ) {
|
||||||
XP_U16 byt = *rowPtr;
|
XP_U8 byt = *rowPtr;
|
||||||
if ( rowBits < 16 ) {
|
if ( rowBits < 8 ) {
|
||||||
byt &= (0xFFFF << (16-rowBits));
|
byt &= (0xFF << (8-rowBits));
|
||||||
}
|
}
|
||||||
if ( 0 != byt ) {
|
if ( 0 != byt ) {
|
||||||
set = XP_TRUE;
|
set = XP_TRUE;
|
||||||
|
@ -418,7 +418,7 @@ ceMeasureGlyph( HDC hdc, HBITMAP bmp, wchar_t glyph,
|
||||||
XP_ASSERT( *rowPtr == 0x00 ); /* check polarity isn't reversed. For some
|
XP_ASSERT( *rowPtr == 0x00 ); /* check polarity isn't reversed. For some
|
||||||
obscure character this may fail. */
|
obscure character this may fail. */
|
||||||
for ( yy = 0; yy < minTopSeen; ++yy ) {
|
for ( yy = 0; yy < minTopSeen; ++yy ) {
|
||||||
if ( anyBitSet( (XP_U16*)rowPtr, size.cx ) ) {
|
if ( anyBitSet( rowPtr, size.cx ) ) {
|
||||||
*top = yy;
|
*top = yy;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -428,7 +428,7 @@ ceMeasureGlyph( HDC hdc, HBITMAP bmp, wchar_t glyph,
|
||||||
/* Extends lower than seen */
|
/* Extends lower than seen */
|
||||||
for ( yy = size.cy - 1, rowPtr = bminfo.bmBits + (bminfo.bmWidthBytes * yy);
|
for ( yy = size.cy - 1, rowPtr = bminfo.bmBits + (bminfo.bmWidthBytes * yy);
|
||||||
yy > maxBottomSeen; --yy, rowPtr -= bminfo.bmWidthBytes ) {
|
yy > maxBottomSeen; --yy, rowPtr -= bminfo.bmWidthBytes ) {
|
||||||
if ( anyBitSet( (XP_U16*)rowPtr, size.cx ) ) {
|
if ( anyBitSet( rowPtr, size.cx ) ) {
|
||||||
*bottom = yy;
|
*bottom = yy;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue