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




index 2f48cef..ca5262c 100644 (file)
@@ -39,12 +39,20 @@ typedef struct {
                                    // the shadow's color, third byte is green,\r
                                    // fourth byte is blue; like this:\r
                                    // SHADOW_COLOR|0xBBGGRR00\r
+                                   // This can be accomplished by using the left shift\r
+                                   // operator like this:  SHADOW_COLOR|(color << 8)\r
 #define ALPHA_BLEND     0x00000008 // Blends the graphic with what it is being drawn over.\r
                                    // The dwAlpha parameter will only be used when this\r
                                    // flag is specified.  dwAlpha is an RGB value\r
                                    // (0xBBGGRR).\r
                                    // Note: Because of the extra calculations required,\r
                                    // alpha blended graphics take longer to draw\r
+#define USE_INDEX       0x00000010 // Only valid when used with a custom SetPixel function.\r
+                                   // This flag cannot be used in combination with\r
+                                   // ALPHA_BLEND or SHADOW_COLOR\r
+                                   // When this flag is used, the index to a color in the\r
+                                   // palette will be passed to your custom SetPixel\r
+                                   // function instead of the actual color.\r
 \r
 // Palette is an array of 256 DWORD's\r
 // For LoadPalette and LoadGrp, lpFileName may be a file in an open mpq archive\r
@@ -55,6 +63,23 @@ 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);\r
 BOOL   GRPAPI WINAPI GetGrpInfo(HANDLE hGrp, GRPHEADER *GrpInfo);\r
 \r
+// A pointer to the raw image data to encode should be passed to lpImageData.  The size of\r
+// the buffer containing the data should be nFrames * wMaxWidth * wMaxHeight * sizeof(short)\r
+// and the values should be arranged row by row of the frame, with the top row first.\r
+// After all the rows of a frame have been put into the buffer, the rows of the next frame\r
+// go after it.  For transparent pixels, they should be set to -1.  All other pixels should\r
+// have the high order byte set to zero, meaning that they should not be negative and the\r
+// values should not exceed 255 (0xFF).  The values used for the colors are indexes into the\r
+// color palette.\r
+// Pass TRUE to bNoCompress if you need an uncompressed GRP.\r
+// Pass a pointer to a DWORD value to nGrpSize to receive the size in bytes of the resulting encoded GRP.\r
+// The return value of this function is actually a pointer to the GRP data.  This is what your\r
+// program should save to a file.  The size of this buffer is the value received by nGrpSize.\r
+// When your program is done with the returned buffer, it should call DestroyGrp on the\r
+// buffer that was returned by this function to free up the memory from it.\r
+// The pointer returned by this function can also be directly used by DrawGrp or GetGrpInfo.\r
+HANDLE GRPAPI WINAPI CreateGrp(signed short *lpImageData, WORD nFrames, WORD wMaxWidth, WORD wMaxHeight, BOOL bNoCompress, DWORD *nGrpSize);\r
+\r
 typedef COLORREF (WINAPI* GETPIXELPROC)(\r
   HDC hDC, // same value as hdcDest from DrawGrp,\r
               // does not need to be used as an HDC,\r
@@ -73,7 +98,7 @@ typedef void (WINAPI* SETPIXELPROC)(
 \r
 // Call these to have DrawGrp use custom functions for reading and drawing pixels\r
 // so that you can have it read from and write to a buffer, for example.\r
-void GRPAPI WINAPI SetFunctionGetPixel(GETPIXELPROC lpGetPixelProc);\r
+void GRPAPI WINAPI SetFunctionGetPixel(GETPIXELPROC lpGetPixelProc); // Only used with ALPHA_BLEND\r
 void GRPAPI WINAPI SetFunctionSetPixel(SETPIXELPROC lpSetPixelProc);\r
 \r
 // Call this to make a different Storm.dll-compatible MPQ library be used (like SFMPQ).\r
@@ -88,4 +113,3 @@ void   GRPAPI WINAPI FreeGrpApi();
 #endif\r
 \r
 #endif\r
-\r