X-Git-Url: https://sfsrealm.hopto.org/projects/gitweb.cgi?a=blobdiff_plain;f=grpapi%2Fgrpapi.h;h=5bdbe94344e7a490b9b1f416a7836adfdbca74bb;hb=553c8149075edf3d6ec191b3cb93c6361ec66a1a;hp=501253d4478f3d16ad0ef0a42be79cac64b25f97;hpb=8531f378333f02b781a0dc8d28014b89729e100a;p=grpapi.git diff --git a/grpapi/grpapi.h b/grpapi/grpapi.h index 501253d..5bdbe94 100644 --- a/grpapi/grpapi.h +++ b/grpapi/grpapi.h @@ -62,6 +62,24 @@ HANDLE GRPAPI WINAPI LoadGrp(LPCSTR lpFileName); BOOL GRPAPI WINAPI DestroyGrp(HANDLE hGrp); BOOL GRPAPI WINAPI DrawGrp(HANDLE hGrp, HDC hdcDest, int nXDest, int nYDest, WORD nFrame, DWORD *dwPalette, DWORD dwFlags, DWORD dwAlpha); BOOL GRPAPI WINAPI GetGrpInfo(HANDLE hGrp, GRPHEADER *GrpInfo); +BOOL GRPAPI WINAPI GetGrpFrameInfo(HANDLE hGrp, WORD nFrame, DWORD *nLeft, DWORD *nTop, DWORD *nWidth, DWORD *nHeight); + +// A pointer to the raw image data to encode should be passed to lpImageData. The size of +// the buffer containing the data should be nFrames * wMaxWidth * wMaxHeight * sizeof(short) +// and the values should be arranged row by row of the frame, with the top row first. +// After all the rows of a frame have been put into the buffer, the rows of the next frame +// go after it. For transparent pixels, they should be set to -1. All other pixels should +// have the high order byte set to zero, meaning that they should not be negative and the +// values should not exceed 255 (0xFF). The values used for the colors are indexes into the +// color palette. +// Pass TRUE to bNoCompress if you need an uncompressed GRP. +// Pass a pointer to a DWORD value to nGrpSize to receive the size in bytes of the resulting encoded GRP. +// The return value of this function is actually a pointer to the GRP data. This is what your +// program should save to a file. The size of this buffer is the value received by nGrpSize. +// When your program is done with the returned buffer, it should call DestroyGrp on the +// buffer that was returned by this function to free up the memory from it. +// The pointer returned by this function can also be directly used by DrawGrp or GetGrpInfo. +HANDLE GRPAPI WINAPI CreateGrp(signed short *lpImageData, WORD nFrames, WORD wMaxWidth, WORD wMaxHeight, BOOL bNoCompress, DWORD *nGrpSize); typedef COLORREF (WINAPI* GETPIXELPROC)( HDC hDC, // same value as hdcDest from DrawGrp, @@ -81,7 +99,7 @@ typedef void (WINAPI* SETPIXELPROC)( // Call these to have DrawGrp use custom functions for reading and drawing pixels // so that you can have it read from and write to a buffer, for example. -void GRPAPI WINAPI SetFunctionGetPixel(GETPIXELPROC lpGetPixelProc); +void GRPAPI WINAPI SetFunctionGetPixel(GETPIXELPROC lpGetPixelProc); // Only used with ALPHA_BLEND void GRPAPI WINAPI SetFunctionSetPixel(SETPIXELPROC lpSetPixelProc); // Call this to make a different Storm.dll-compatible MPQ library be used (like SFMPQ). @@ -96,4 +114,3 @@ void GRPAPI WINAPI FreeGrpApi(); #endif #endif -