Current News Archived News Search News Discussion Forum Old Forum Install Programs More Downloads... Troubleshooting Source Code Format Specs. Misc. Information Non-SF Stuff Links Small banner for links to this site: |
diff --git a/grpapi/grpapi.cpp b/grpapi/grpapi.cpp
--- a/grpapi/grpapi.cpp
+++ b/grpapi/grpapi.cpp
WORD *lpRowOffsets;\r
WORD *lpRowSizes;\r
LPBYTE *lpRowData;\r
+ DWORD Size;\r
} FRAMEDATA;\r
\r
GETPIXELPROC MyGetPixel = GetPixel;\r
SETPIXELPROC MySetPixel = (SETPIXELPROC)SetPixelV;\r
\r
void __inline SetPix(HDC hDC, int X, int Y, COLORREF clrColor, DWORD *dwPalette, DWORD dwFlags, DWORD dwAlpha);\r
-void EncodeFrameData(signed short *lpImageData, WORD nFrame, GRPHEADER *lpGrpHeader, FRAMEHEADER *lpFrameHeader, FRAMEDATA *lpFrameData);\r
-BOOL VerifyRow(signed short *lpRawRow, int nWidth, LPBYTE lpEncRow, int nSize);\r
+void EncodeFrameData(signed short *lpImageData, WORD nFrame, GRPHEADER *lpGrpHeader, FRAMEHEADER *lpFrameHeader, FRAMEDATA *lpFrameData, BOOL bNoCompress);\r
+BOOL VerifyRow(signed short *lpRawRow, int nWidth, LPBYTE lpEncRow, int nSize, BOOL bNoCompress);\r
\r
extern HINSTANCE hStorm;\r
\r
{\r
}\r
\r
+/*\r
+HANDLE hProcessHeap = NULL;\r
+\r
+void * SFAlloc(size_t nSize)\r
+{\r
+ if (!hProcessHeap) hProcessHeap = GetProcessHeap();\r
+ if (hProcessHeap) return HeapAlloc(hProcessHeap, 0, nSize);\r
+ else return NULL;\r
+}\r
+\r
+void SFFree(void *lpMem)\r
+{\r
+ if (!hProcessHeap) hProcessHeap = GetProcessHeap();\r
+ if (hProcessHeap) HeapFree(hProcessHeap, 0, lpMem);\r
+}\r
+*/\r
+\r
BOOL GRPAPI WINAPI SetMpqDll(LPCSTR lpDllFileName)\r
{\r
if (LoadStorm((char *)lpDllFileName)) return TRUE;\r
@@ -206,23 +224,33 @@ BOOL GRPAPI WINAPI DrawGrp(HANDLE hGrp, HDC hdcDest, int nXDest, int nYDest, WOR
BYTE *GrpRaw = (BYTE *)GrpOffsets;\r
BYTE *RowData;\r
WORD x,ofs;\r
- DWORD y;\r
+ DWORD y, nMaxOffset = 0;\r
WORD i;\r
- int j;\r
- if (nFrame + 1 < GrpFile->nFrames) {\r
- for (i = 0; i + 1 < GrpFile->nFrames; i++) {\r
- j = GrpFrames[i].Offset - GrpFrame->Offset;\r
- if (j > 0 && j < FrameSize)\r
- FrameSize = j;\r
- }\r
+ int j, nFirstNonBlankFrame = 0;\r
+ for (i = 0; i < GrpFile->nFrames; i++) {\r
+ j = GrpFrames[i].Offset - GrpFrame->Offset;\r
+ if (j > 0 && j < FrameSize)\r
+ FrameSize = j;\r
+ if (GrpFrames[i].Offset > nMaxOffset)\r
+ nMaxOffset = GrpFrames[i].Offset;\r
}\r
- if (FrameSize == 0xFFFFFF) {\r
- for (i = 0; i + 1 < GrpFile->nFrames; i++) {\r
- j = GrpFrames[i].Offset - GrpFrames[0].Offset;\r
+ if (FrameSize == 0xFFFFFF || FrameSize == GrpFrame->Width * GrpFrame->Height) {\r
+ FrameSize = 0xFFFFFF;\r
+ for (i = 0; i < GrpFile->nFrames; i++) {\r
+ if (GrpFrames[i].Width != 0 && GrpFrames[i].Height != 0 && GrpFrames[i].Offset != GrpFrame->Offset && GrpFrames[i].Offset != nMaxOffset) {\r
+ nFirstNonBlankFrame = i;\r
+ break;\r
+ }\r
+ }\r
+ if (i == GrpFile->nFrames)\r
+ nFirstNonBlankFrame = nFrame;\r
+\r
+ for (i = 0; i < GrpFile->nFrames; i++) {\r
+ j = GrpFrames[i].Offset - GrpFrames[nFirstNonBlankFrame].Offset;\r
if (j > 0 && j < FrameSize)\r
FrameSize = j;\r
}\r
- if (FrameSize == GrpFrames[0].Width * GrpFrames[0].Height)\r
+ if (FrameSize == GrpFrames[nFirstNonBlankFrame].Width * GrpFrames[nFirstNonBlankFrame].Height)\r
FrameSize = GrpFrame->Width * GrpFrame->Height;\r
}\r
if (!(dwFlags&HORIZONTAL_FLIP) && !(dwFlags&VERTICAL_FLIP)) {\r
return TRUE;\r
}\r
\r
+BOOL GRPAPI WINAPI GetGrpFrameInfo(HANDLE hGrp, WORD nFrame, DWORD *nLeft, DWORD *nTop, DWORD *nWidth, DWORD *nHeight)\r
+{\r
+ if (!hGrp || hGrp==INVALID_HANDLE_VALUE) return FALSE;\r
+ FRAMEHEADER *GrpFrame = &((FRAMEHEADER *)(((char *)hGrp)+6))[nFrame];\r
+\r
+ if (nLeft) *nLeft = GrpFrame->Left;\r
+ if (nTop) *nTop = GrpFrame->Top;\r
+ if (nWidth) *nWidth = GrpFrame->Width;\r
+ if (nHeight) *nHeight = GrpFrame->Height;\r
+\r
+ return TRUE;\r
+}\r
+\r
void GRPAPI WINAPI SetFunctionGetPixel(GETPIXELPROC lpGetPixelProc)\r
{\r
if (!lpGetPixelProc)\r
@@ -455,6 +496,7 @@ HANDLE GRPAPI WINAPI CreateGrp(signed short *lpImageData, WORD nFrames, WORD wMa
GrpHeader.wMaxHeight = wMaxHeight;\r
lpFrameHeaders = (FRAMEHEADER *)malloc(nFrames * sizeof(FRAMEHEADER));\r
lpFrameData = (FRAMEDATA *)malloc(nFrames * sizeof(FRAMEDATA));\r
+ nLastOffset = sizeof(GRPHEADER) + nFrames * sizeof(FRAMEHEADER);\r
\r
for (i = 0; i < nFrames; i++) {\r
// Search for duplicate frames\r
@@ -471,12 +513,7 @@ HANDLE GRPAPI WINAPI CreateGrp(signed short *lpImageData, WORD nFrames, WORD wMa
continue;\r
}\r
\r
- if (i == 0) {\r
- lpFrameHeaders[i].Offset = sizeof(GRPHEADER) + nFrames * sizeof(FRAMEHEADER);\r
- }\r
- else {\r
- lpFrameHeaders[i].Offset = nLastOffset;\r
- }\r
+ lpFrameHeaders[i].Offset = nLastOffset;\r
\r
// Scan frame to find dimensions of used part\r
x1 = y1 = 0x10000;\r
@@ -491,26 +528,19 @@ HANDLE GRPAPI WINAPI CreateGrp(signed short *lpImageData, WORD nFrames, WORD wMa
}\r
}\r
}\r
+ x2 = x2 - x1 + 1;\r
+ y2 = y2 - y1 + 1;\r
+ if ((WORD)x1 > 255) x1 = 255;\r
+ if ((WORD)y1 > 255) y1 = 255;\r
+ if ((WORD)x2 > 255) x2 = 255;\r
+ if ((WORD)y2 > 255) y2 = 255;\r
lpFrameHeaders[i].Left = x1;\r
lpFrameHeaders[i].Top = y1;\r
- lpFrameHeaders[i].Width = x2 - x1 + 1;\r
- lpFrameHeaders[i].Height = y2 - y1 + 1;\r
-\r
- if (!bNoCompress) {\r
- EncodeFrameData(lpImageData, i, &GrpHeader, &lpFrameHeaders[i], &lpFrameData[i]);\r
+ lpFrameHeaders[i].Width = x2;\r
+ lpFrameHeaders[i].Height = y2;\r
\r
- y = lpFrameHeaders[i].Height;\r
- if (y > 0) {\r
- y--;\r
- nLastOffset = lpFrameHeaders[i].Offset + lpFrameData[i].lpRowOffsets[y] + lpFrameData[i].lpRowSizes[y];\r
- }\r
- else {\r
- nLastOffset = lpFrameHeaders[i].Offset;\r
- }\r
- }\r
- else {\r
- nLastOffset = lpFrameHeaders[i].Offset + lpFrameHeaders[i].Width * lpFrameHeaders[i].Height;\r
- }\r
+ EncodeFrameData(lpImageData, i, &GrpHeader, &lpFrameHeaders[i], &lpFrameData[i], bNoCompress);\r
+ nLastOffset = lpFrameHeaders[i].Offset + lpFrameData[i].Size;\r
}\r
\r
lpGrpData = (LPBYTE)malloc(nLastOffset);\r
@@ -521,28 +551,19 @@ HANDLE GRPAPI WINAPI CreateGrp(signed short *lpImageData, WORD nFrames, WORD wMa
\r
for (i = 0; i < nFrames; i++) {\r
if (lpFrameData[i].lpRowOffsets) {\r
- if (!bNoCompress) {\r
+ if (!bNoCompress)\r
memcpy(lpGrpData + lpFrameHeaders[i].Offset, lpFrameData[i].lpRowOffsets, lpFrameHeaders[i].Height * sizeof(WORD));\r
\r
- for (y = 0; y < lpFrameHeaders[i].Height; y++) {\r
- if (lpFrameData[i].lpRowData[y]) {\r
- memcpy(lpGrpData + lpFrameHeaders[i].Offset + lpFrameData[i].lpRowOffsets[y], lpFrameData[i].lpRowData[y], lpFrameData[i].lpRowSizes[y]);\r
- free(lpFrameData[i].lpRowData[y]);\r
- }\r
- }\r
-\r
- free(lpFrameData[i].lpRowOffsets);\r
- free(lpFrameData[i].lpRowSizes);\r
- free(lpFrameData[i].lpRowData);\r
- }\r
- else {\r
- for (y = 0; y < lpFrameHeaders[i].Height; y++) {\r
- for (x = 0; x < lpFrameHeaders[i].Width; x++) {\r
- lpGrpData[lpFrameHeaders[i].Offset + y * lpFrameHeaders[i].Width + x] =\r
- lpImageData[i * wMaxWidth * wMaxHeight + (lpFrameHeaders[i].Top + y) * wMaxWidth + lpFrameHeaders[i].Left + x];\r
- }\r
+ for (y = 0; y < lpFrameHeaders[i].Height; y++) {\r
+ if (lpFrameData[i].lpRowData[y]) {\r
+ memcpy(lpGrpData + lpFrameHeaders[i].Offset + lpFrameData[i].lpRowOffsets[y], lpFrameData[i].lpRowData[y], lpFrameData[i].lpRowSizes[y]);\r
+ free(lpFrameData[i].lpRowData[y]);\r
}\r
}\r
+\r
+ free(lpFrameData[i].lpRowOffsets);\r
+ free(lpFrameData[i].lpRowSizes);\r
+ free(lpFrameData[i].lpRowData);\r
}\r
}\r
\r
@@ -553,113 +574,122 @@ HANDLE GRPAPI WINAPI CreateGrp(signed short *lpImageData, WORD nFrames, WORD wMa
return (HANDLE)lpGrpData;\r
}\r
\r
-void EncodeFrameData(signed short *lpImageData, WORD nFrame, GRPHEADER *lpGrpHeader, FRAMEHEADER *lpFrameHeader, FRAMEDATA *lpFrameData)\r
+void EncodeFrameData(signed short *lpImageData, WORD nFrame, GRPHEADER *lpGrpHeader, FRAMEHEADER *lpFrameHeader, FRAMEDATA *lpFrameData, BOOL bNoCompress)\r
{\r
int x, y, i, j, nBufPos, nRepeat;\r
LPBYTE lpRowBuf;\r
- WORD nLastOffset;\r
+ WORD nLastOffset = 0;\r
\r
lpFrameData->lpRowOffsets = (WORD *)malloc(lpFrameHeader->Height * sizeof(WORD));\r
lpFrameData->lpRowSizes = (WORD *)malloc(lpFrameHeader->Height * sizeof(WORD));\r
lpFrameData->lpRowData = (LPBYTE *)malloc(lpFrameHeader->Height * sizeof(LPBYTE));\r
lpRowBuf = (LPBYTE)malloc(lpFrameHeader->Width * 2);\r
\r
+ if (!bNoCompress)\r
+ nLastOffset = lpFrameHeader->Height * sizeof(WORD);\r
+\r
for (y = 0; y < lpFrameHeader->Height; y++) {\r
i = nFrame * lpGrpHeader->wMaxWidth * lpGrpHeader->wMaxHeight + (lpFrameHeader->Top + y) * lpGrpHeader->wMaxWidth;\r
\r
- /* Fails verification when using this. Bug in encoder or decoder? Doesn't provide much benefit.\r
- // Search for duplicate rows (experimental)\r
- for (x = 0; x < y; x++) {\r
- j = nFrame * lpGrpHeader->wMaxWidth * lpGrpHeader->wMaxHeight + (lpFrameHeader->Top + x) * lpGrpHeader->wMaxWidth;\r
- if (memcmp(&lpImageData[i+lpFrameHeader->Left],\r
- &lpImageData[j+lpFrameHeader->Left],\r
- lpGrpHeader->wMaxWidth * sizeof(short)) == 0)\r
- break;\r
- }\r
+ if (!bNoCompress) {\r
+ // Search for duplicate rows\r
+ for (x = 0; x < y; x++) {\r
+ j = nFrame * lpGrpHeader->wMaxWidth * lpGrpHeader->wMaxHeight + (lpFrameHeader->Top + x) * lpGrpHeader->wMaxWidth;\r
+ if (memcmp(&lpImageData[i+lpFrameHeader->Left],\r
+ &lpImageData[j+lpFrameHeader->Left],\r
+ lpGrpHeader->wMaxWidth * sizeof(short)) == 0)\r
+ break;\r
+ }\r
\r
- if (x < y) {\r
- lpFrameData->lpRowOffsets[y] = lpFrameData->lpRowOffsets[x];\r
- lpFrameData->lpRowSizes[y] = 0;\r
- lpFrameData->lpRowData[y] = 0;\r
+ if (x < y) {\r
+ lpFrameData->lpRowOffsets[y] = lpFrameData->lpRowOffsets[x];\r
+ lpFrameData->lpRowSizes[y] = 0;\r
+ lpFrameData->lpRowData[y] = 0;\r
\r
#ifdef _DEBUG\r
- if (!VerifyRow(&lpImageData[i+lpFrameHeader->Left], lpFrameHeader->Width, lpFrameData->lpRowData[x], lpFrameData->lpRowSizes[x])) {\r
- nBufPos = nBufPos;\r
- }\r
+ if (!VerifyRow(&lpImageData[i+lpFrameHeader->Left], lpFrameHeader->Width, lpFrameData->lpRowData[x], lpFrameData->lpRowSizes[x], bNoCompress)) {\r
+ nBufPos = nBufPos;\r
+ }\r
#endif\r
\r
- continue;\r
+ continue;\r
+ }\r
}\r
- */\r
\r
nBufPos = 0;\r
if (lpFrameHeader->Width > 0) {\r
for (x = lpFrameHeader->Left; x < lpFrameHeader->Left + lpFrameHeader->Width; x++) {\r
- if (x < lpFrameHeader->Left + lpFrameHeader->Width - 1) {\r
- if (lpImageData[i+x] < 0) {\r
- lpRowBuf[nBufPos] = 0x80;\r
- for (; lpImageData[i+x] < 0 && x < lpFrameHeader->Left + lpFrameHeader->Width && lpRowBuf[nBufPos] < 0xFF; x++) {\r
- lpRowBuf[nBufPos]++;\r
+ if (!bNoCompress) {\r
+ if (x < lpFrameHeader->Left + lpFrameHeader->Width - 1) {\r
+ if (lpImageData[i+x] < 0) {\r
+ lpRowBuf[nBufPos] = 0x80;\r
+ for (; lpImageData[i+x] < 0 && x < lpFrameHeader->Left + lpFrameHeader->Width && lpRowBuf[nBufPos] < 0xFF; x++) {\r
+ lpRowBuf[nBufPos]++;\r
+ }\r
+ x--;\r
+ if (nLastOffset + nBufPos + 1 <= 0xFFFF)\r
+ nBufPos++;\r
+ continue;\r
}\r
- x--;\r
- nBufPos++;\r
- continue;\r
- }\r
\r
- // Count repeating pixels, nRepeat = number of pixels - 1, ignore if there are less than 4 duplicates\r
- for (nRepeat = 0; lpImageData[i+x+nRepeat] == lpImageData[i+x+nRepeat+1] && x+nRepeat < lpFrameHeader->Left + lpFrameHeader->Width - 1 && nRepeat < 0x3E; nRepeat++) {}\r
+ // Count repeating pixels, nRepeat = number of pixels - 1, ignore if there are less than 4 duplicates\r
+ for (nRepeat = 0; lpImageData[i+x+nRepeat] == lpImageData[i+x+nRepeat+1] && x+nRepeat < lpFrameHeader->Left + lpFrameHeader->Width - 1 && nRepeat < 0x3E; nRepeat++) {}\r
\r
- if (nRepeat > 2) {\r
- lpRowBuf[nBufPos] = 0x41 + nRepeat;\r
- lpRowBuf[nBufPos+1] = (BYTE)lpImageData[i+x];\r
- x += nRepeat;\r
- nBufPos += 2;\r
+ if (nRepeat > 2) {\r
+ lpRowBuf[nBufPos] = 0x41 + nRepeat;\r
+ lpRowBuf[nBufPos+1] = (BYTE)(lpImageData[i+x]);\r
+ x += nRepeat;\r
+ if (nLastOffset + nBufPos + 2 <= 0xFFFF)\r
+ nBufPos += 2;\r
+ }\r
+ else {\r
+ lpRowBuf[nBufPos] = 0;\r
+ for (; lpImageData[i+x] >= 0 && x < lpFrameHeader->Left + lpFrameHeader->Width && lpRowBuf[nBufPos] < 0x3F; x++) {\r
+ // Count repeating pixels, ignore if there are less than 4 duplicates\r
+ for (nRepeat = 0; lpImageData[i+x+nRepeat] == lpImageData[i+x+nRepeat+1] && x+nRepeat < lpFrameHeader->Left + lpFrameHeader->Width - 1 && nRepeat < 3; nRepeat++) {}\r
+ if (nRepeat > 2) break;\r
+\r
+ lpRowBuf[nBufPos]++;\r
+ lpRowBuf[nBufPos+lpRowBuf[nBufPos]] = (BYTE)(lpImageData[i+x]);\r
+ }\r
+ if (lpImageData[i+x] >= 0 && x == lpFrameHeader->Left + lpFrameHeader->Width - 1 && lpRowBuf[nBufPos] < 0x3F) {\r
+ lpRowBuf[nBufPos]++;\r
+ lpRowBuf[nBufPos+lpRowBuf[nBufPos]] = (BYTE)(lpImageData[i+x]);\r
+ }\r
+ x--;\r
+ if (nLastOffset + nBufPos + 1 + lpRowBuf[nBufPos] <= 0xFFFF)\r
+ nBufPos += 1 + lpRowBuf[nBufPos];\r
+ }\r
}\r
else {\r
- lpRowBuf[nBufPos] = 0;\r
- for (; lpImageData[i+x] >= 0 && x < lpFrameHeader->Left + lpFrameHeader->Width && lpRowBuf[nBufPos] < 0x3F; x++) {\r
- // Count repeating pixels, ignore if there are less than 4 duplicates\r
- for (nRepeat = 0; lpImageData[i+x+nRepeat] == lpImageData[i+x+nRepeat+1] && x+nRepeat < lpFrameHeader->Left + lpFrameHeader->Width - 1 && nRepeat < 3; nRepeat++) {}\r
- if (nRepeat > 2) break;\r
-\r
- lpRowBuf[nBufPos]++;\r
- lpRowBuf[nBufPos+lpRowBuf[nBufPos]] = (BYTE)lpImageData[i+x];\r
+ if (lpImageData[i+x] < 0) {\r
+ lpRowBuf[nBufPos] = 0x81;\r
+ if (nLastOffset + nBufPos + 1 <= 0xFFFF)\r
+ nBufPos++;\r
}\r
- if (lpImageData[i+x] >= 0 && x == lpFrameHeader->Left + lpFrameHeader->Width - 1 && lpRowBuf[nBufPos] < 0x3F) {\r
- lpRowBuf[nBufPos]++;\r
- lpRowBuf[nBufPos+lpRowBuf[nBufPos]] = (BYTE)lpImageData[i+x];\r
+ else {\r
+ lpRowBuf[nBufPos] = 1;\r
+ lpRowBuf[nBufPos+1] = (BYTE)(lpImageData[i+x]);\r
+ if (nLastOffset + nBufPos + 2 <= 0xFFFF)\r
+ nBufPos += 2;\r
}\r
- x--;\r
- nBufPos += 1 + lpRowBuf[nBufPos];\r
}\r
}\r
else {\r
- if (lpImageData[i+x] < 0) {\r
- lpRowBuf[nBufPos] = 0x81;\r
+ lpRowBuf[nBufPos] = (BYTE)(lpImageData[i+x]);\r
+ if (nLastOffset + nBufPos + 1 <= 0xFFFF)\r
nBufPos++;\r
- }\r
- else {\r
- lpRowBuf[nBufPos] = 1;\r
- lpRowBuf[nBufPos+1] = (BYTE)lpImageData[i+x];\r
- nBufPos += 2;\r
- }\r
}\r
}\r
}\r
\r
#ifdef _DEBUG\r
- if (!VerifyRow(&lpImageData[i+lpFrameHeader->Left], lpFrameHeader->Width, lpRowBuf, nBufPos)) {\r
+ if (!VerifyRow(&lpImageData[i+lpFrameHeader->Left], lpFrameHeader->Width, lpRowBuf, nBufPos, bNoCompress)) {\r
nBufPos = nBufPos;\r
}\r
#endif\r
\r
- if (y == 0) {\r
- lpFrameData->lpRowOffsets[y] = lpFrameHeader->Height * sizeof(WORD);\r
- }\r
- else {\r
- lpFrameData->lpRowOffsets[y] = nLastOffset;\r
- }\r
-\r
+ lpFrameData->lpRowOffsets[y] = nLastOffset;\r
nLastOffset = lpFrameData->lpRowOffsets[y] + nBufPos;\r
\r
lpFrameData->lpRowSizes[y] = nBufPos;\r
@@ -667,35 +697,44 @@ void EncodeFrameData(signed short *lpImageData, WORD nFrame, GRPHEADER *lpGrpHea
memcpy(lpFrameData->lpRowData[y], lpRowBuf, nBufPos);\r
}\r
\r
+ lpFrameData->Size = nLastOffset;\r
+\r
free(lpRowBuf);\r
}\r
\r
#ifdef _DEBUG\r
-BOOL VerifyRow(signed short *lpRawRow, int nWidth, LPBYTE lpEncRow, int nSize)\r
+BOOL VerifyRow(signed short *lpRawRow, int nWidth, LPBYTE lpEncRow, int nSize, BOOL bNoCompress)\r
{\r
int i,x=0,ofs=0;\r
while (x < nWidth && ofs < nSize) {\r
- if (!(lpEncRow[ofs] & 0x80)) {\r
- if (!(lpEncRow[ofs] & 0x40)) {\r
- for (i=1;i<=lpEncRow[ofs] && x<nWidth;i++) {\r
- if (lpEncRow[ofs+i] != (BYTE)lpRawRow[x]) return FALSE;\r
- x++;\r
+ if (!bNoCompress) {\r
+ if (!(lpEncRow[ofs] & 0x80)) {\r
+ if (!(lpEncRow[ofs] & 0x40)) {\r
+ for (i=1;i<=lpEncRow[ofs] && x<nWidth;i++) {\r
+ if (lpEncRow[ofs+i] != (BYTE)lpRawRow[x]) return FALSE;\r
+ x++;\r
+ }\r
+ ofs+=lpEncRow[ofs]+1;\r
+ }\r
+ else {\r
+ for (i=0;i<lpEncRow[ofs]-64 && x<nWidth;i++) {\r
+ if (lpEncRow[ofs+1] != (BYTE)lpRawRow[x]) return FALSE;\r
+ x++;\r
+ }\r
+ ofs+=2;\r
}\r
- ofs+=lpEncRow[ofs]+1;\r
}\r
else {\r
- for (i=0;i<lpEncRow[ofs]-64 && x<nWidth;i++) {\r
- if (lpEncRow[ofs+1] != (BYTE)lpRawRow[x]) return FALSE;\r
- x++;\r
+ for (i=0;i<lpEncRow[ofs]-128 && x<nWidth;i++) {\r
+ if (lpRawRow[x] >= 0) return FALSE;\r
}\r
- ofs+=2;\r
+ x+=lpEncRow[ofs]-128;\r
+ ofs++;\r
}\r
}\r
else {\r
- for (i=0;i<lpEncRow[ofs]-128 && x<nWidth;i++) {\r
- if (lpRawRow[x] >= 0) return FALSE;\r
- }\r
- x+=lpEncRow[ofs]-128;\r
+ if (lpEncRow[ofs] != (BYTE)lpRawRow[x]) return FALSE;\r
+ x++;\r
ofs++;\r
}\r
}\r
|