Author: tkreuzer Date: Sat Oct 6 14:35:52 2012 New Revision: 57497
URL: http://svn.reactos.org/svn/reactos?rev=57497&view=rev Log: [BMFD] - Remove a pointless check (CID 731583) - Add a comment - Simplify code
Modified: trunk/reactos/win32ss/drivers/font/bmfd/font.c trunk/reactos/win32ss/drivers/font/bmfd/glyph.c
Modified: trunk/reactos/win32ss/drivers/font/bmfd/font.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/drivers/font/bmfd/f... ============================================================================== --- trunk/reactos/win32ss/drivers/font/bmfd/font.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/drivers/font/bmfd/font.c [iso-8859-1] Sat Oct 6 14:35:52 2012 @@ -65,7 +65,7 @@ pface->wA = GETVAL(pFontInfo->dfAspace); pface->wB = GETVAL(pFontInfo->dfBspace); pface->wC = GETVAL(pFontInfo->dfCspace); - pface->pCharTable = pface->pFontInfo->dfCharTable; + pface->pCharTable = pFontInfo->dfCharTable; pface->cjEntrySize = sizeof(GLYPHENTRY30); } else @@ -74,7 +74,7 @@ pface->wA = 0; pface->wB = 0; pface->wC = 0; - pface->pCharTable = &pface->pFontInfo->dfReserved + 1; + pface->pCharTable = &pFontInfo->dfReserved + 1; pface->cjEntrySize = sizeof(GLYPHENTRY20); }
Modified: trunk/reactos/win32ss/drivers/font/bmfd/glyph.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/drivers/font/bmfd/g... ============================================================================== --- trunk/reactos/win32ss/drivers/font/bmfd/glyph.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/drivers/font/bmfd/glyph.c [iso-8859-1] Sat Oct 6 14:35:52 2012 @@ -80,18 +80,15 @@ ULONG cjSize) { PBMFD_FACE pface = pfont->pface; - PGLYPHENTRY pge = (PGLYPHENTRY)(pface->pCharTable + hg); + PGLYPHENTRY pge; ULONG xSrc, ySrc, cxSrc, cySrc; ULONG xDst, yDst, cxDst, cyDst; ULONG xScale, yScale; ULONG ulGlyphOffset, cjDstRow, color; PVOID pvSrc0, pvDst0;
- if (!pge) - { - DbgPrint("no glyph handle given!\n"); - return FD_ERROR; - } + /* The glyph handle is the byte offset to the glyph in the table */ + pge = (PGLYPHENTRY)(pface->pCharTable + hg);
/* Get the bitmap offset depending on file version */ if (pface->ulVersion >= 0x300) @@ -151,7 +148,7 @@ /* Verify that the buffer is big enough */ if (cjSize < FIELD_OFFSET(GLYPHBITS, aj) + cyDst * cjDstRow) { - DbgPrint("Buffer too small (%ld), %ld,%ld\n", + DbgPrint("Buffer too small (%ld), %ld,%ld\n", cjSize, cxSrc, cySrc); return FD_ERROR; } @@ -245,7 +242,7 @@ }
pFontInfo = pfont->pface->pFontInfo; - + xScale = pfont->xScale; yScale = pfont->yScale;
@@ -329,7 +326,7 @@ PBMFD_FACE pface = &pfile->aface[pfo->iFace - 1]; PBMFD_FONT pfont= BmfdGetFontInstance(pfo, pface);
- DbgPrint("BmfdQueryFontData(pfo=%p, iMode=%ld, hg=%p, pgd=%p, pv=%p, cjSize=%ld)\n", + DbgPrint("BmfdQueryFontData(pfo=%p, iMode=%ld, hg=%p, pgd=%p, pv=%p, cjSize=%ld)\n", pfo, iMode, hg, pgd, pv, cjSize); // __debugbreak();
@@ -340,7 +337,7 @@
case QFD_MAXEXTENTS: /* 3 */ return BmfdQueryMaxExtents(pfont, pv, cjSize); - + /* we support nothing else */ default: return FD_ERROR;