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




ShadowFlare [Wed, 29 Mar 2006 19:26:45 +0000 (19:26 +0000)]
22 files changed:
LoadStorm/Storm.cpp [new file with mode: 0644]
LoadStorm/Storm.h [new file with mode: 0644]
drawgrp/ReadMe.txt [new file with mode: 0644]
drawgrp/StdAfx.cpp [new file with mode: 0644]
drawgrp/StdAfx.h [new file with mode: 0644]
drawgrp/drawgrp.cpp [new file with mode: 0644]
drawgrp/drawgrp.vcproj [new file with mode: 0644]
drawgrp/drawgrp.vcproj.vspscc [new file with mode: 0644]
grpapi/grp_static.h [new file with mode: 0644]
grpapi/grpapi.cpp [new file with mode: 0644]
grpapi/grpapi.def [new file with mode: 0644]
grpapi/grpapi.h [new file with mode: 0644]
grpapi/grpapi.rc [new file with mode: 0644]
grpapi/grpapi.sln [new file with mode: 0644]
grpapi/grpapi.vcproj [new file with mode: 0644]
grpapi/grpapi.vcproj.vspscc [new file with mode: 0644]
grpapi/grpapi.vsscc [new file with mode: 0644]
grpapi/grpapi.vssscc [new file with mode: 0644]
grpapi/grpapi_no-lib.cpp [new file with mode: 0644]
grpapi/grpapi_no-lib.h [new file with mode: 0644]
grpapi/grplib.vcproj [new file with mode: 0644]
grpapi/grplib.vcproj.vspscc [new file with mode: 0644]

diff --git a/LoadStorm/Storm.cpp b/LoadStorm/Storm.cpp
new file mode 100644 (file)
index 0000000..264914d
--- /dev/null
@@ -0,0 +1,114 @@
+/*\r
+       Storm.cpp\r
+*/\r
+\r
+#include "storm.h"\r
+\r
+struct STORMMODULE {\r
+       STORMMODULE();\r
+       ~STORMMODULE();\r
+} Storm;\r
+\r
+HINSTANCE hStorm = 0;\r
+BOOL AlreadyLoaded = FALSE;\r
+\r
+// Storm Function Names\r
+funcSFileCloseArchive SFileCloseArchive = 0;\r
+funcSFileCloseFile SFileCloseFile = 0;\r
+funcSFileDestroy SFileDestroy = 0;\r
+funcSFileGetFileArchive SFileGetFileArchive = 0;\r
+funcSFileGetFileSize SFileGetFileSize = 0;\r
+funcSFileOpenArchive SFileOpenArchive = 0;\r
+funcSFileOpenFile SFileOpenFile = 0;\r
+funcSFileOpenFileEx SFileOpenFileEx = 0;\r
+funcSFileReadFile SFileReadFile = 0;\r
+funcSFileSetBasePath SFileSetBasePath = 0;\r
+funcSFileSetFilePointer SFileSetFilePointer = 0;\r
+funcSFileSetLocale SFileSetLocale = 0;\r
+funcSFileGetBasePath SFileGetBasePath = 0;\r
+funcSFileGetArchiveName SFileGetArchiveName = 0;\r
+funcSFileGetFileName SFileGetFileName = 0;\r
+\r
+STORMMODULE::STORMMODULE()\r
+{\r
+       if (hStorm!=0) return;\r
+       const char STORM_DLL[] = "Storm.dll";\r
+       hStorm = GetModuleHandle(STORM_DLL);\r
+       if (hStorm == NULL) hStorm = LoadLibrary(STORM_DLL);\r
+       else AlreadyLoaded=TRUE;\r
+\r
+       if (hStorm != NULL)\r
+       {\r
+               SFileCloseArchive = (funcSFileCloseArchive)GetProcAddress(hStorm, (LPCSTR)0xFC);\r
+               SFileCloseFile = (funcSFileCloseFile)GetProcAddress(hStorm, (LPCSTR)0xFD);\r
+               SFileDestroy = (funcSFileDestroy)GetProcAddress(hStorm, (LPCSTR)0x106);\r
+               SFileGetFileArchive = (funcSFileGetFileArchive)GetProcAddress(hStorm, (LPCSTR)0x108);\r
+               SFileGetFileSize = (funcSFileGetFileSize)GetProcAddress(hStorm, (LPCSTR)0x109);\r
+               SFileOpenArchive = (funcSFileOpenArchive)GetProcAddress(hStorm, (LPCSTR)0x10A);\r
+               SFileOpenFile = (funcSFileOpenFile)GetProcAddress(hStorm, (LPCSTR)0x10B);\r
+               SFileOpenFileEx = (funcSFileOpenFileEx)GetProcAddress(hStorm, (LPCSTR)0x10C);\r
+               SFileReadFile = (funcSFileReadFile)GetProcAddress(hStorm, (LPCSTR)0x10D);\r
+               SFileSetBasePath = (funcSFileSetBasePath)GetProcAddress(hStorm, (LPCSTR)0x10E);\r
+               SFileSetFilePointer = (funcSFileSetFilePointer)GetProcAddress(hStorm, (LPCSTR)0x10F);\r
+               SFileSetLocale = (funcSFileSetLocale)GetProcAddress(hStorm, (LPCSTR)0x110);\r
+               SFileGetBasePath = (funcSFileGetBasePath)GetProcAddress(hStorm, (LPCSTR)0x111);\r
+               SFileGetArchiveName = (funcSFileGetArchiveName)GetProcAddress(hStorm, (LPCSTR)0x113);\r
+               SFileGetFileName = (funcSFileGetFileName)GetProcAddress(hStorm, (LPCSTR)0x114);\r
+       }\r
+       if (SFileDestroy && !AlreadyLoaded) SFileDestroy();\r
+}\r
+\r
+STORMMODULE::~STORMMODULE()\r
+{\r
+       SFileCloseArchive = 0;\r
+       SFileCloseFile = 0;\r
+       SFileDestroy = 0;\r
+       SFileGetFileArchive = 0;\r
+       SFileGetFileSize = 0;\r
+       SFileOpenArchive = 0;\r
+       SFileOpenFile = 0;\r
+       SFileOpenFileEx = 0;\r
+       SFileReadFile = 0;\r
+       SFileSetBasePath = 0;\r
+       SFileSetFilePointer = 0;\r
+       SFileSetLocale = 0;\r
+       SFileGetBasePath = 0;\r
+       SFileGetArchiveName = 0;\r
+       SFileGetFileName = 0;\r
+\r
+       if (hStorm==0) return;\r
+\r
+       if (AlreadyLoaded==FALSE) FreeLibrary(hStorm);\r
+       hStorm = 0;\r
+}\r
+\r
+HINSTANCE LoadStorm(char * DllFileName)\r
+{\r
+       if (hStorm!=0) return 0;\r
+       hStorm = GetModuleHandle(DllFileName);\r
+       if (hStorm == NULL) hStorm = LoadLibrary(DllFileName);\r
+       else AlreadyLoaded=TRUE;\r
+\r
+       if (hStorm != NULL)\r
+       {\r
+               SFileCloseArchive = (funcSFileCloseArchive)GetProcAddress(hStorm, (LPCSTR)0xFC);\r
+               SFileCloseFile = (funcSFileCloseFile)GetProcAddress(hStorm, (LPCSTR)0xFD);\r
+               SFileDestroy = (funcSFileDestroy)GetProcAddress(hStorm, (LPCSTR)0x106);\r
+               SFileGetFileArchive = (funcSFileGetFileArchive)GetProcAddress(hStorm, (LPCSTR)0x108);\r
+               SFileGetFileSize = (funcSFileGetFileSize)GetProcAddress(hStorm, (LPCSTR)0x109);\r
+               SFileOpenArchive = (funcSFileOpenArchive)GetProcAddress(hStorm, (LPCSTR)0x10A);\r
+               SFileOpenFile = (funcSFileOpenFile)GetProcAddress(hStorm, (LPCSTR)0x10B);\r
+               SFileOpenFileEx = (funcSFileOpenFileEx)GetProcAddress(hStorm, (LPCSTR)0x10C);\r
+               SFileReadFile = (funcSFileReadFile)GetProcAddress(hStorm, (LPCSTR)0x10D);\r
+               SFileSetBasePath = (funcSFileSetBasePath)GetProcAddress(hStorm, (LPCSTR)0x10E);\r
+               SFileSetFilePointer = (funcSFileSetFilePointer)GetProcAddress(hStorm, (LPCSTR)0x10F);\r
+               SFileSetLocale = (funcSFileSetLocale)GetProcAddress(hStorm, (LPCSTR)0x110);\r
+               SFileGetBasePath = (funcSFileGetBasePath)GetProcAddress(hStorm, (LPCSTR)0x111);\r
+               SFileGetArchiveName = (funcSFileGetArchiveName)GetProcAddress(hStorm, (LPCSTR)0x113);\r
+               SFileGetFileName = (funcSFileGetFileName)GetProcAddress(hStorm, (LPCSTR)0x114);\r
+       }\r
+       if (SFileDestroy && !AlreadyLoaded) SFileDestroy();\r
+       if (AlreadyLoaded==TRUE) return 0;\r
+       return hStorm;\r
+}\r
+\r
diff --git a/LoadStorm/Storm.h b/LoadStorm/Storm.h
new file mode 100644 (file)
index 0000000..31a5eac
--- /dev/null
@@ -0,0 +1,59 @@
+#ifndef STORM_H_INCLUDED\r
+#define STORM_H_INCLUDED\r
+\r
+#include <windows.h>\r
+\r
+#ifdef __cplusplus\r
+extern "C" {\r
+#endif\r
+\r
+// This no longer needs to be called\r
+extern HINSTANCE LoadStorm(char * DllFileName);\r
+\r
+#define SFILE_OPEN_HARD_DISK_FILE 0x0000 //Open archive without regard to the drive type it resides on\r
+#define SFILE_OPEN_CD_ROM_FILE    0x0001 //Open the archive only if it is on a CD-ROM\r
+\r
+#define SFILE_SEARCH_CURRENT_ONLY 0x00 //Used with SFileOpenFileEx; only the archive with the handle specified will be searched for the file\r
+#define SFILE_SEARCH_ALL_OPEN     0x01 //SFileOpenFileEx will look through all open archives for the file\r
+\r
+#define MPQHANDLE HANDLE\r
+\r
+// Storm Function Prototypes\r
+typedef BOOL  (WINAPI* funcSFileOpenArchive)(LPCSTR lpFilename, DWORD dwPriority, DWORD dwFlags, MPQHANDLE *hMPQ);\r
+typedef BOOL  (WINAPI* funcSFileCloseArchive)(MPQHANDLE hMPQ);\r
+typedef BOOL  (WINAPI* funcSFileOpenFile)(LPCSTR lpFileName, MPQHANDLE *hFile);\r
+typedef BOOL  (WINAPI* funcSFileOpenFileEx)(MPQHANDLE hMPQ, LPCSTR lpFileName, DWORD dwSearchScope, MPQHANDLE *hFile);\r
+typedef BOOL  (WINAPI* funcSFileCloseFile)(MPQHANDLE hFile);\r
+typedef DWORD (WINAPI* funcSFileGetFileSize)(MPQHANDLE hFile, LPDWORD lpFileSizeHigh);\r
+typedef DWORD (WINAPI* funcSFileSetFilePointer)(MPQHANDLE hFile, long lDistanceToMove, PLONG lplDistanceToMoveHigh, DWORD dwMoveMethod);\r
+typedef BOOL  (WINAPI* funcSFileReadFile)(MPQHANDLE hFile,LPVOID lpBuffer,DWORD nNumberOfBytesToRead,LPDWORD lpNumberOfBytesRead,LPOVERLAPPED lpOverlapped);\r
+typedef LCID  (WINAPI* funcSFileSetLocale)(LCID nNewLocale);\r
+typedef BOOL  (WINAPI* funcSFileDestroy)();\r
+typedef BOOL  (WINAPI* funcSFileGetArchiveName)(MPQHANDLE hMPQ, LPCSTR lpBuffer, DWORD dwBufferLength);\r
+typedef BOOL  (WINAPI* funcSFileGetFileName)(MPQHANDLE hFile, LPCSTR lpBuffer, DWORD dwBufferLength);\r
+typedef BOOL  (WINAPI* funcSFileGetFileArchive)(MPQHANDLE hFile, MPQHANDLE *hMPQ);\r
+typedef BOOL  (WINAPI* funcSFileGetBasePath)(LPCSTR lpBuffer, DWORD dwBufferLength);\r
+typedef BOOL  (WINAPI* funcSFileSetBasePath)(LPCSTR lpNewBasePath);\r
+\r
+// Storm Function Names\r
+extern funcSFileCloseArchive SFileCloseArchive;\r
+extern funcSFileCloseFile SFileCloseFile;\r
+extern funcSFileDestroy SFileDestroy;\r
+extern funcSFileGetFileArchive SFileGetFileArchive;\r
+extern funcSFileGetFileSize SFileGetFileSize;\r
+extern funcSFileOpenArchive SFileOpenArchive;\r
+extern funcSFileOpenFile SFileOpenFile;\r
+extern funcSFileOpenFileEx SFileOpenFileEx;\r
+extern funcSFileReadFile SFileReadFile;\r
+extern funcSFileSetBasePath SFileSetBasePath;\r
+extern funcSFileSetFilePointer SFileSetFilePointer;\r
+extern funcSFileSetLocale SFileSetLocale;\r
+extern funcSFileGetBasePath SFileGetBasePath;\r
+extern funcSFileGetArchiveName SFileGetArchiveName;\r
+extern funcSFileGetFileName SFileGetFileName;\r
+\r
+#ifdef __cplusplus\r
+};  // extern "C" \r
+#endif\r
+\r
+#endif\r
diff --git a/drawgrp/ReadMe.txt b/drawgrp/ReadMe.txt
new file mode 100644 (file)
index 0000000..d071da0
--- /dev/null
@@ -0,0 +1,34 @@
+========================================================================\r
+       CONSOLE APPLICATION : drawgrp\r
+========================================================================\r
+\r
+\r
+AppWizard has created this drawgrp application for you.  \r
+\r
+This file contains a summary of what you will find in each of the files that\r
+make up your drawgrp application.\r
+\r
+drawgrp.dsp\r
+    This file (the project file) contains information at the project level and\r
+    is used to build a single project or subproject. Other users can share the\r
+    project (.dsp) file, but they should export the makefiles locally.\r
+\r
+drawgrp.cpp\r
+    This is the main application source file.\r
+\r
+\r
+/////////////////////////////////////////////////////////////////////////////\r
+Other standard files:\r
+\r
+StdAfx.h, StdAfx.cpp\r
+    These files are used to build a precompiled header (PCH) file\r
+    named drawgrp.pch and a precompiled types file named StdAfx.obj.\r
+\r
+\r
+/////////////////////////////////////////////////////////////////////////////\r
+Other notes:\r
+\r
+AppWizard uses "TODO:" to indicate parts of the source code you\r
+should add to or customize.\r
+\r
+/////////////////////////////////////////////////////////////////////////////\r
diff --git a/drawgrp/StdAfx.cpp b/drawgrp/StdAfx.cpp
new file mode 100644 (file)
index 0000000..a6251b8
--- /dev/null
@@ -0,0 +1,8 @@
+// stdafx.cpp : source file that includes just the standard includes\r
+//     drawgrp.pch will be the pre-compiled header\r
+//     stdafx.obj will contain the pre-compiled type information\r
+\r
+#include "stdafx.h"\r
+\r
+// TODO: reference any additional headers you need in STDAFX.H\r
+// and not in this file\r
diff --git a/drawgrp/StdAfx.h b/drawgrp/StdAfx.h
new file mode 100644 (file)
index 0000000..8ca678f
--- /dev/null
@@ -0,0 +1,22 @@
+// stdafx.h : include file for standard system include files,\r
+//  or project specific include files that are used frequently, but\r
+//      are changed infrequently\r
+//\r
+\r
+#if !defined(AFX_STDAFX_H__6C8ACA66_6D98_11D6_9E06_00A0C9199875__INCLUDED_)\r
+#define AFX_STDAFX_H__6C8ACA66_6D98_11D6_9E06_00A0C9199875__INCLUDED_\r
+\r
+#if _MSC_VER > 1000\r
+#pragma once\r
+#endif // _MSC_VER > 1000\r
+\r
+\r
+// TODO: reference additional headers your program requires here\r
+#include "..\\grpapi\\grpapi_no-lib.h"\r
+#include "..\\storm.h"\r
+#include <malloc.h>\r
+\r
+//{{AFX_INSERT_LOCATION}}\r
+// Microsoft Visual C++ will insert additional declarations immediately before the previous line.\r
+\r
+#endif // !defined(AFX_STDAFX_H__6C8ACA66_6D98_11D6_9E06_00A0C9199875__INCLUDED_)\r
diff --git a/drawgrp/drawgrp.cpp b/drawgrp/drawgrp.cpp
new file mode 100644 (file)
index 0000000..9adc351
--- /dev/null
@@ -0,0 +1,65 @@
+// drawgrp.cpp : Defines the entry point for the console application.\r
+//\r
+\r
+#include "stdafx.h"\r
+\r
+\r
+/*int qmain(int argc, char* argv[]);\r
+\r
+int main(int argc, char* argv[])\r
+{\r
+       HINSTANCE hStorm = LoadStorm("Storm.dll");\r
+       if (SFileDestroy!=0) SFileDestroy();\r
+       LoadGrpApi();\r
+       int RetVal = qmain(argc,argv);\r
+       FreeGrpApi();\r
+       if (hStorm!=0) FreeLibrary(hStorm);\r
+       return RetVal;\r
+}*/\r
+\r
+int main(int argc, char* argv[])\r
+{\r
+       HANDLE hMPQ=0,hMPQ2=0,hMPQ3=0;\r
+       DWORD *dwPalette = (DWORD *)_alloca(1024);\r
+       memset(dwPalette,0,1024);\r
+       if (SFileOpenArchive!=0) {\r
+               char *buffer = (char *)_alloca(13);\r
+               memcpy(buffer,"StarDat.mpq",12);\r
+               if (SFileOpenArchive(buffer,1000,0,&hMPQ)==0) return 0;\r
+               memcpy(buffer,"BrooDat.mpq",12);\r
+               SFileOpenArchive(buffer,2000,0,&hMPQ2);\r
+               memcpy(buffer,"Patch_rt.mpq",13);\r
+               SFileOpenArchive(buffer,3000,0,&hMPQ3);\r
+       }\r
+       LoadPalette("tileset\\Jungle.wpe",dwPalette);\r
+       HANDLE hGrp;\r
+       if (argc>1)\r
+               hGrp = LoadGrp(argv[1]);\r
+       else\r
+               hGrp = LoadGrp("unit\\zerg\\ultra.grp");\r
+       HDC hDC = GetDC(0);\r
+       GRPHEADER GrpInfo;\r
+       if (GetGrpInfo(hGrp,&GrpInfo)==0) {GrpInfo.nFrames=0;GrpInfo.wMaxWidth=0;GrpInfo.wMaxHeight=0;}\r
+       //for (DWORD j=0;j<16;j++){\r
+       /*for (WORD i=0;i<GrpInfo.nFrames;i++) {\r
+               DrawGrp(hGrp,hDC,0,0,i,dwPalette,ALPHA_BLEND,0x401020);\r
+       }*/\r
+       for (WORD i=8;i<400;i+=17) {\r
+               for (DWORD j=0;j<8;j++)\r
+               DrawGrp(hGrp,hDC,i,0,i % (17*8),dwPalette,ALPHA_BLEND,0x401020);\r
+       }\r
+       for (i=8;i<400;i+=17) {\r
+               for (DWORD j=0;j<8;j++)\r
+               DrawGrp(hGrp,hDC,400-i,0,i % (17*8),dwPalette,HORIZONTAL_FLIP|ALPHA_BLEND,0x401020);\r
+       }\r
+       //}\r
+       ReleaseDC(0,hDC);\r
+    DestroyGrp(hGrp);\r
+       if (SFileCloseArchive!=0) {\r
+               if (hMPQ3!=0) SFileCloseArchive(hMPQ3);\r
+               if (hMPQ2!=0) SFileCloseArchive(hMPQ2);\r
+               if (hMPQ!=0) SFileCloseArchive(hMPQ);\r
+       }\r
+       return 0;\r
+}\r
+\r
diff --git a/drawgrp/drawgrp.vcproj b/drawgrp/drawgrp.vcproj
new file mode 100644 (file)
index 0000000..a1e7158
--- /dev/null
@@ -0,0 +1,236 @@
+<?xml version="1.0" encoding="Windows-1252"?>\r
+<VisualStudioProject\r
+       ProjectType="Visual C++"\r
+       Version="7.10"\r
+       Name="drawgrp"\r
+       SccProjectName="&quot;$/grpapi.root/grpapi&quot;, FEAAAAAA"\r
+       SccAuxPath=""\r
+       SccLocalPath=".."\r
+       SccProvider="MSSCCI:Microsoft Visual SourceSafe">\r
+       <Platforms>\r
+               <Platform\r
+                       Name="Win32"/>\r
+       </Platforms>\r
+       <Configurations>\r
+               <Configuration\r
+                       Name="Release|Win32"\r
+                       OutputDirectory=".\Release"\r
+                       IntermediateDirectory=".\Release"\r
+                       ConfigurationType="1"\r
+                       UseOfMFC="0"\r
+                       ATLMinimizesCRunTimeLibraryUsage="FALSE"\r
+                       CharacterSet="2">\r
+                       <Tool\r
+                               Name="VCCLCompilerTool"\r
+                               Optimization="2"\r
+                               InlineFunctionExpansion="1"\r
+                               PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"\r
+                               StringPooling="TRUE"\r
+                               RuntimeLibrary="4"\r
+                               EnableFunctionLevelLinking="TRUE"\r
+                               PrecompiledHeaderFile=".\Release/drawgrp.pch"\r
+                               AssemblerListingLocation=".\Release/"\r
+                               ObjectFile=".\Release/"\r
+                               ProgramDataBaseFileName=".\Release/"\r
+                               WarningLevel="3"\r
+                               SuppressStartupBanner="TRUE"/>\r
+                       <Tool\r
+                               Name="VCCustomBuildTool"/>\r
+                       <Tool\r
+                               Name="VCLinkerTool"\r
+                               OutputFile=".\Release/drawgrp.exe"\r
+                               LinkIncremental="1"\r
+                               SuppressStartupBanner="TRUE"\r
+                               ProgramDatabaseFile=".\Release/drawgrp.pdb"\r
+                               SubSystem="1"\r
+                               TargetMachine="1"/>\r
+                       <Tool\r
+                               Name="VCMIDLTool"\r
+                               TypeLibraryName=".\Release/drawgrp.tlb"\r
+                               HeaderFileName=""/>\r
+                       <Tool\r
+                               Name="VCPostBuildEventTool"/>\r
+                       <Tool\r
+                               Name="VCPreBuildEventTool"/>\r
+                       <Tool\r
+                               Name="VCPreLinkEventTool"/>\r
+                       <Tool\r
+                               Name="VCResourceCompilerTool"\r
+                               PreprocessorDefinitions="NDEBUG"\r
+                               Culture="1033"/>\r
+                       <Tool\r
+                               Name="VCWebServiceProxyGeneratorTool"/>\r
+                       <Tool\r
+                               Name="VCXMLDataGeneratorTool"/>\r
+                       <Tool\r
+                               Name="VCWebDeploymentTool"/>\r
+                       <Tool\r
+                               Name="VCManagedWrapperGeneratorTool"/>\r
+                       <Tool\r
+                               Name="VCAuxiliaryManagedWrapperGeneratorTool"/>\r
+               </Configuration>\r
+               <Configuration\r
+                       Name="Debug|Win32"\r
+                       OutputDirectory=".\Debug"\r
+                       IntermediateDirectory=".\Debug"\r
+                       ConfigurationType="1"\r
+                       UseOfMFC="0"\r
+                       ATLMinimizesCRunTimeLibraryUsage="FALSE"\r
+                       CharacterSet="2">\r
+                       <Tool\r
+                               Name="VCCLCompilerTool"\r
+                               Optimization="0"\r
+                               PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"\r
+                               BasicRuntimeChecks="3"\r
+                               RuntimeLibrary="5"\r
+                               PrecompiledHeaderFile=".\Debug/drawgrp.pch"\r
+                               AssemblerListingLocation=".\Debug/"\r
+                               ObjectFile=".\Debug/"\r
+                               ProgramDataBaseFileName=".\Debug/"\r
+                               WarningLevel="3"\r
+                               SuppressStartupBanner="TRUE"\r
+                               DebugInformationFormat="4"/>\r
+                       <Tool\r
+                               Name="VCCustomBuildTool"/>\r
+                       <Tool\r
+                               Name="VCLinkerTool"\r
+                               OutputFile=".\Debug/drawgrp.exe"\r
+                               LinkIncremental="1"\r
+                               SuppressStartupBanner="TRUE"\r
+                               GenerateDebugInformation="TRUE"\r
+                               ProgramDatabaseFile=".\Debug/drawgrp.pdb"\r
+                               SubSystem="1"\r
+                               TargetMachine="1"/>\r
+                       <Tool\r
+                               Name="VCMIDLTool"\r
+                               TypeLibraryName=".\Debug/drawgrp.tlb"\r
+                               HeaderFileName=""/>\r
+                       <Tool\r
+                               Name="VCPostBuildEventTool"/>\r
+                       <Tool\r
+                               Name="VCPreBuildEventTool"/>\r
+                       <Tool\r
+                               Name="VCPreLinkEventTool"/>\r
+                       <Tool\r
+                               Name="VCResourceCompilerTool"\r
+                               PreprocessorDefinitions="_DEBUG"\r
+                               Culture="1033"/>\r
+                       <Tool\r
+                               Name="VCWebServiceProxyGeneratorTool"/>\r
+                       <Tool\r
+                               Name="VCXMLDataGeneratorTool"/>\r
+                       <Tool\r
+                               Name="VCWebDeploymentTool"/>\r
+                       <Tool\r
+                               Name="VCManagedWrapperGeneratorTool"/>\r
+                       <Tool\r
+                               Name="VCAuxiliaryManagedWrapperGeneratorTool"/>\r
+               </Configuration>\r
+       </Configurations>\r
+       <References>\r
+       </References>\r
+       <Files>\r
+               <Filter\r
+                       Name="Source Files"\r
+                       Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat">\r
+                       <File\r
+                               RelativePath="drawgrp.cpp">\r
+                               <FileConfiguration\r
+                                       Name="Release|Win32">\r
+                                       <Tool\r
+                                               Name="VCCLCompilerTool"\r
+                                               Optimization="2"\r
+                                               PreprocessorDefinitions=""/>\r
+                               </FileConfiguration>\r
+                               <FileConfiguration\r
+                                       Name="Debug|Win32">\r
+                                       <Tool\r
+                                               Name="VCCLCompilerTool"\r
+                                               Optimization="0"\r
+                                               PreprocessorDefinitions=""\r
+                                               BasicRuntimeChecks="3"/>\r
+                               </FileConfiguration>\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\grpapi\grpapi_no-lib.cpp">\r
+                               <FileConfiguration\r
+                                       Name="Release|Win32">\r
+                                       <Tool\r
+                                               Name="VCCLCompilerTool"\r
+                                               Optimization="2"\r
+                                               PreprocessorDefinitions=""/>\r
+                               </FileConfiguration>\r
+                               <FileConfiguration\r
+                                       Name="Debug|Win32">\r
+                                       <Tool\r
+                                               Name="VCCLCompilerTool"\r
+                                               Optimization="0"\r
+                                               PreprocessorDefinitions=""\r
+                                               BasicRuntimeChecks="3"/>\r
+                               </FileConfiguration>\r
+                       </File>\r
+                       <File\r
+                               RelativePath="StdAfx.cpp">\r
+                               <FileConfiguration\r
+                                       Name="Release|Win32">\r
+                                       <Tool\r
+                                               Name="VCCLCompilerTool"\r
+                                               Optimization="2"\r
+                                               PreprocessorDefinitions=""\r
+                                               UsePrecompiledHeader="1"\r
+                                               PrecompiledHeaderThrough="stdafx.h"/>\r
+                               </FileConfiguration>\r
+                               <FileConfiguration\r
+                                       Name="Debug|Win32">\r
+                                       <Tool\r
+                                               Name="VCCLCompilerTool"\r
+                                               Optimization="0"\r
+                                               PreprocessorDefinitions=""\r
+                                               BasicRuntimeChecks="3"\r
+                                               UsePrecompiledHeader="1"\r
+                                               PrecompiledHeaderThrough="stdafx.h"/>\r
+                               </FileConfiguration>\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\LoadStorm\Storm.cpp">\r
+                               <FileConfiguration\r
+                                       Name="Release|Win32">\r
+                                       <Tool\r
+                                               Name="VCCLCompilerTool"\r
+                                               Optimization="2"\r
+                                               PreprocessorDefinitions=""/>\r
+                               </FileConfiguration>\r
+                               <FileConfiguration\r
+                                       Name="Debug|Win32">\r
+                                       <Tool\r
+                                               Name="VCCLCompilerTool"\r
+                                               Optimization="0"\r
+                                               PreprocessorDefinitions=""\r
+                                               BasicRuntimeChecks="3"/>\r
+                               </FileConfiguration>\r
+                       </File>\r
+               </Filter>\r
+               <Filter\r
+                       Name="Header Files"\r
+                       Filter="h;hpp;hxx;hm;inl">\r
+                       <File\r
+                               RelativePath="..\grpapi\grpapi_no-lib.h">\r
+                       </File>\r
+                       <File\r
+                               RelativePath="StdAfx.h">\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\LoadStorm\Storm.h">\r
+                       </File>\r
+               </Filter>\r
+               <Filter\r
+                       Name="Resource Files"\r
+                       Filter="ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe">\r
+               </Filter>\r
+               <File\r
+                       RelativePath="ReadMe.txt">\r
+               </File>\r
+       </Files>\r
+       <Globals>\r
+       </Globals>\r
+</VisualStudioProject>\r
diff --git a/drawgrp/drawgrp.vcproj.vspscc b/drawgrp/drawgrp.vcproj.vspscc
new file mode 100644 (file)
index 0000000..5d67725
--- /dev/null
@@ -0,0 +1,10 @@
+""\r
+{\r
+"FILE_VERSION" = "9237"\r
+"ENLISTMENT_CHOICE" = "NEVER"\r
+"PROJECT_FILE_RELATIVE_PATH" = "relative:drawgrp"\r
+"NUMBER_OF_EXCLUDED_FILES" = "0"\r
+"ORIGINAL_PROJECT_FILE_PATH" = ""\r
+"NUMBER_OF_NESTED_PROJECTS" = "0"\r
+"SOURCE_CONTROL_SETTINGS_PROVIDER" = "PROJECT"\r
+}\r
diff --git a/grpapi/grp_static.h b/grpapi/grp_static.h
new file mode 100644 (file)
index 0000000..5e7cc77
--- /dev/null
@@ -0,0 +1,17 @@
+/*\r
+\r
+  ShadowFlare GRP Static Library. (c) ShadowFlare Software 2002\r
+\r
+*/\r
+\r
+#ifndef GRPLIB_INCLUDED\r
+#define GRPLIB_INCLUDED\r
+\r
+#ifndef GRPAPI_STATIC\r
+#define GRPAPI_STATIC\r
+#endif\r
+\r
+#include "grpapi.h"\r
+\r
+#endif\r
+\r
diff --git a/grpapi/grpapi.cpp b/grpapi/grpapi.cpp
new file mode 100644 (file)
index 0000000..f746120
--- /dev/null
@@ -0,0 +1,298 @@
+#include "grpapi.h"\r
+#include "..\\LoadStorm\\storm.h"\r
+#include <malloc.h>\r
+\r
+#ifdef GRPAPI_STATIC\r
+#define DllMain GrpMain\r
+\r
+#include "grp_static.h"\r
+\r
+struct GRPLIBMODULE {\r
+       GRPLIBMODULE();\r
+       ~GRPLIBMODULE();\r
+} GrpLib;\r
+\r
+BOOL APIENTRY DllMain(HINSTANCE hInstDLL, DWORD  ul_reason_for_call, LPVOID lpReserved);\r
+\r
+GRPLIBMODULE::GRPLIBMODULE()\r
+{\r
+       GrpMain(0,DLL_PROCESS_ATTACH,0);\r
+}\r
+\r
+GRPLIBMODULE::~GRPLIBMODULE()\r
+{\r
+       GrpMain(0,DLL_PROCESS_DETACH,0);\r
+}\r
+\r
+#endif\r
+\r
+typedef struct {\r
+       BYTE Left;\r
+       BYTE Top;\r
+       BYTE Width;\r
+       BYTE Height;\r
+       DWORD Offset;\r
+} FRAMEHEADER;\r
+\r
+void __inline SetPix(HDC hDC, int X, int Y, COLORREF clrColor, DWORD dwFlags, DWORD dwAlpha);\r
+\r
+extern HINSTANCE hStorm;\r
+\r
+BOOL APIENTRY DllMain( HINSTANCE hInstDLL, \r
+                       DWORD  ul_reason_for_call, \r
+                       LPVOID lpReserved\r
+                                        )\r
+{\r
+    switch (ul_reason_for_call)\r
+       {\r
+               case DLL_PROCESS_ATTACH:\r
+                       break;\r
+               case DLL_THREAD_ATTACH:\r
+                       break;\r
+               case DLL_THREAD_DETACH:\r
+                       break;\r
+               case DLL_PROCESS_DETACH:\r
+                       break;\r
+    }\r
+\r
+    return TRUE;\r
+}\r
+\r
+BOOL GRPAPI WINAPI LoadGrpApi()\r
+{\r
+       if (hStorm==0) return FALSE;\r
+       else return TRUE;\r
+}\r
+\r
+void GRPAPI WINAPI FreeGrpApi()\r
+{\r
+}\r
+\r
+BOOL GRPAPI WINAPI LoadPalette(LPCSTR lpFileName, DWORD *dwPaletteBuffer)\r
+{\r
+       if (lpFileName==0 || dwPaletteBuffer==0) return FALSE;\r
+       HANDLE hFile;\r
+       if (SFileOpenFileEx!=0 && SFileGetFileSize!=0\r
+        && SFileSetFilePointer!=0 && SFileReadFile!=0\r
+        && SFileCloseFile!=0) {\r
+               if (SFileOpenFileEx(0,lpFileName,1,&hFile)==0) return FALSE;\r
+               DWORD fsz = SFileGetFileSize(hFile,0);\r
+               SFileSetFilePointer(hFile,0,0,FILE_BEGIN);\r
+               if (fsz>=1024) {\r
+                       memset(dwPaletteBuffer,0,1024);\r
+                       SFileReadFile(hFile,dwPaletteBuffer,1024,0,0);\r
+               }\r
+               else if (fsz==768) {\r
+                       char *buffer = (char *)_alloca(768);\r
+                       memset(buffer,0,768);\r
+                       SFileReadFile(hFile,buffer,768,0,0);\r
+                       for (DWORD i=0;i<256;i++) {\r
+                               memcpy(&dwPaletteBuffer[i],buffer+i*3,3);\r
+                               *(((char *)&dwPaletteBuffer[i])+3) = 0;\r
+                       }\r
+               }\r
+               else {\r
+                       memset(dwPaletteBuffer,0,1024);\r
+                       SFileReadFile(hFile,dwPaletteBuffer,fsz,0,0);\r
+               }\r
+               SFileCloseFile(hFile);\r
+       }\r
+       else {\r
+               hFile = CreateFile(lpFileName,GENERIC_READ,FILE_SHARE_READ,0,OPEN_EXISTING,0,0);\r
+               if (hFile==INVALID_HANDLE_VALUE) return FALSE;\r
+               DWORD fsz = GetFileSize(hFile,0),tsz;\r
+               SetFilePointer(hFile,0,0,FILE_BEGIN);\r
+               if (fsz>=1024) {\r
+                       memset(dwPaletteBuffer,0,1024);\r
+                       ReadFile(hFile,dwPaletteBuffer,1024,&tsz,0);\r
+               }\r
+               else if (fsz==768) {\r
+                       char *buffer = (char *)_alloca(768);\r
+                       memset(buffer,0,768);\r
+                       ReadFile(hFile,buffer,768,&tsz,0);\r
+                       for (DWORD i=0;i<256;i++) {\r
+                               memcpy(&dwPaletteBuffer[i],buffer+i*3,3);\r
+                               *(((char *)&dwPaletteBuffer[i])+3) = 0;\r
+                       }\r
+               }\r
+               else {\r
+                       memset(dwPaletteBuffer,0,1024);\r
+                       ReadFile(hFile,dwPaletteBuffer,fsz,&tsz,0);\r
+               }\r
+               CloseHandle(hFile);\r
+       }\r
+       return TRUE;\r
+}\r
+\r
+HANDLE GRPAPI WINAPI LoadGrp(LPCSTR lpFileName)\r
+{\r
+       if (lpFileName==0) return (HANDLE)-1;\r
+       HANDLE hFile;\r
+       char *GrpFile;\r
+       if (SFileOpenFileEx!=0 && SFileGetFileSize!=0\r
+        && SFileSetFilePointer!=0 && SFileReadFile!=0\r
+        && SFileCloseFile!=0) {\r
+               if (SFileOpenFileEx(0,lpFileName,1,&hFile)==0) return (HANDLE)-1;\r
+               DWORD fsz = SFileGetFileSize(hFile,0);\r
+               if (fsz<6) {\r
+                       SFileCloseFile(hFile);\r
+                       return (HANDLE)-1;\r
+               }\r
+               GrpFile = (char *)VirtualAlloc(0,fsz,MEM_COMMIT,PAGE_READWRITE);\r
+               if (GrpFile!=0) {\r
+                       SFileSetFilePointer(hFile,0,0,FILE_BEGIN);\r
+                       SFileReadFile(hFile,GrpFile,fsz,0,0);\r
+               }\r
+               else GrpFile=(char *)-1;\r
+               SFileCloseFile(hFile);\r
+       }\r
+       else {\r
+               hFile = CreateFile(lpFileName,GENERIC_READ,FILE_SHARE_READ,0,OPEN_EXISTING,0,0);\r
+               if (hFile==INVALID_HANDLE_VALUE) return (HANDLE)-1;\r
+               DWORD fsz = GetFileSize(hFile,0),tsz;\r
+               if (fsz<6) {\r
+                       CloseHandle(hFile);\r
+                       return (HANDLE)-1;\r
+               }\r
+               GrpFile = (char *)VirtualAlloc(0,fsz,MEM_COMMIT,PAGE_READWRITE);\r
+               if (GrpFile!=0) {\r
+                       SetFilePointer(hFile,0,0,FILE_BEGIN);\r
+                       ReadFile(hFile,GrpFile,fsz,&tsz,0);\r
+               }\r
+               else GrpFile=(char *)-1;\r
+               CloseHandle(hFile);\r
+       }\r
+       return (HANDLE)GrpFile;\r
+}\r
+\r
+BOOL GRPAPI WINAPI DestroyGrp(HANDLE hGrp)\r
+{\r
+       if (hGrp==0 || hGrp==INVALID_HANDLE_VALUE) return FALSE;\r
+       VirtualFree(hGrp,0,MEM_RELEASE);\r
+       return TRUE;\r
+}\r
+\r
+BOOL GRPAPI WINAPI DrawGrp(HANDLE hGrp, HDC hdcDest, int nXDest, int nYDest, WORD nFrame, DWORD *dwPalette, DWORD dwFlags, DWORD dwAlpha)\r
+{\r
+       if (hGrp==0 || hGrp==INVALID_HANDLE_VALUE || hdcDest==0 || dwPalette==0) return FALSE;\r
+       GRPHEADER *GrpFile = (GRPHEADER *)hGrp;\r
+       nFrame %= GrpFile->nFrames;\r
+       FRAMEHEADER *GrpFrame = &((FRAMEHEADER *)(((char *)GrpFile)+6))[nFrame];\r
+       DWORD Right,Bottom;\r
+       if (dwFlags&HORIZONTAL_FLIP) Right = nXDest+GrpFile->wMaxWidth-1-GrpFrame->Left;\r
+       if (dwFlags&VERTICAL_FLIP) Bottom = nYDest+GrpFile->wMaxHeight-1-GrpFrame->Top;\r
+       nXDest += GrpFrame->Left;\r
+       nYDest += GrpFrame->Top;\r
+       WORD *GrpOffsets = ((WORD *)(((char *)GrpFile)+GrpFrame->Offset));\r
+       for (DWORD y=0;y<GrpFrame->Height;y++) {\r
+               BYTE *RowData = ((BYTE *)(((char *)GrpOffsets)+GrpOffsets[y]));\r
+               WORD x=0,ofs=0;\r
+               while (x<GrpFrame->Width) {\r
+                       if (RowData[ofs]<=64) {\r
+                               if ((dwFlags&HORIZONTAL_FLIP)==0 && (dwFlags&VERTICAL_FLIP)==0) {\r
+                                       for (WORD i=1;i<=RowData[ofs] && x<GrpFrame->Width;i++) {\r
+                                               SetPix(hdcDest,nXDest+x,nYDest+y,dwPalette[RowData[ofs+i]],dwFlags,dwAlpha);\r
+                                               x++;\r
+                                       }\r
+                               }\r
+                               else if (dwFlags&HORIZONTAL_FLIP && (dwFlags&VERTICAL_FLIP)==0) {\r
+                                       for (WORD i=1;i<=RowData[ofs] && x<GrpFrame->Width;i++) {\r
+                                               SetPix(hdcDest,Right-x,nYDest+y,dwPalette[RowData[ofs+i]],dwFlags,dwAlpha);\r
+                                               x++;\r
+                                       }\r
+                               }\r
+                               else if ((dwFlags&HORIZONTAL_FLIP)==0 && dwFlags&VERTICAL_FLIP) {\r
+                                       for (WORD i=1;i<=RowData[ofs] && x<GrpFrame->Width;i++) {\r
+                                               SetPix(hdcDest,nXDest+x,Bottom-y,dwPalette[RowData[ofs+i]],dwFlags,dwAlpha);\r
+                                               x++;\r
+                                       }\r
+                               }\r
+                               else {\r
+                                       for (WORD i=1;i<=RowData[ofs] && x<GrpFrame->Width;i++) {\r
+                                               SetPix(hdcDest,Right-x,Bottom-y,dwPalette[RowData[ofs+i]],dwFlags,dwAlpha);\r
+                                               x++;\r
+                                       }\r
+                               }\r
+                               ofs+=RowData[ofs]+1;\r
+                       }\r
+                       else if (RowData[ofs]<=128) {\r
+                               if ((dwFlags&HORIZONTAL_FLIP)==0 && (dwFlags&VERTICAL_FLIP)==0) {\r
+                                       for (WORD i=0;i<RowData[ofs]-64 && x<GrpFrame->Width;i++) {\r
+                                               SetPix(hdcDest,nXDest+x,nYDest+y,dwPalette[RowData[ofs+1]],dwFlags,dwAlpha);\r
+                                               x++;\r
+                                       }\r
+                               }\r
+                               else if (dwFlags&HORIZONTAL_FLIP && (dwFlags&VERTICAL_FLIP)==0) {\r
+                                       for (WORD i=0;i<RowData[ofs]-64 && x<GrpFrame->Width;i++) {\r
+                                               SetPix(hdcDest,Right-x,nYDest+y,dwPalette[RowData[ofs+1]],dwFlags,dwAlpha);\r
+                                               x++;\r
+                                       }\r
+                               }\r
+                               else if ((dwFlags&HORIZONTAL_FLIP)==0 && dwFlags&VERTICAL_FLIP) {\r
+                                       for (WORD i=0;i<RowData[ofs]-64 && x<GrpFrame->Width;i++) {\r
+                                               SetPix(hdcDest,nXDest+x,Bottom-y,dwPalette[RowData[ofs+1]],dwFlags,dwAlpha);\r
+                                               x++;\r
+                                       }\r
+                               }\r
+                               else {\r
+                                       for (WORD i=0;i<RowData[ofs]-64 && x<GrpFrame->Width;i++) {\r
+                                               SetPix(hdcDest,Right-x,Bottom-y,dwPalette[RowData[ofs+1]],dwFlags,dwAlpha);\r
+                                               x++;\r
+                                       }\r
+                               }\r
+                               ofs+=2;\r
+                       }\r
+                       else {\r
+                               x+=RowData[ofs]-128;\r
+                               ofs++;\r
+                       }\r
+               }\r
+       }\r
+       return TRUE;\r
+}\r
+\r
+BOOL GRPAPI WINAPI GetGrpInfo(HANDLE hGrp, GRPHEADER *GrpInfo)\r
+{\r
+       if (hGrp==0 || hGrp==INVALID_HANDLE_VALUE || GrpInfo==0) return FALSE;\r
+       memcpy(GrpInfo,hGrp,6);\r
+       return TRUE;\r
+}\r
+\r
+void __inline SetPix(HDC hDC, int X, int Y, COLORREF clrColor, DWORD dwFlags, DWORD dwAlpha)\r
+{\r
+       if (dwFlags&SHADOW_COLOR) {\r
+               ((BYTE *)&clrColor)[0] = ((BYTE *)&dwFlags)[1];\r
+               ((BYTE *)&clrColor)[1] = ((BYTE *)&dwFlags)[2];\r
+               ((BYTE *)&clrColor)[2] = ((BYTE *)&dwFlags)[3];\r
+               ((BYTE *)&clrColor)[3] = 0;\r
+       }\r
+       if (dwFlags&ALPHA_BLEND) {\r
+               DWORD dwColor = GetPixel(hDC,X,Y);\r
+\r
+               // Old alpha\r
+               /*((BYTE *)&dwColor)[0]*=1-((float)((BYTE *)&dwAlpha)[0]/256);\r
+               ((BYTE *)&dwColor)[1]*=1-((float)((BYTE *)&dwAlpha)[1]/256);\r
+               ((BYTE *)&dwColor)[2]*=1-((float)((BYTE *)&dwAlpha)[2]/256);\r
+               ((BYTE *)&clrColor)[0]*=(float)((BYTE *)&dwAlpha)[0]/256;\r
+               ((BYTE *)&clrColor)[1]*=(float)((BYTE *)&dwAlpha)[1]/256;\r
+               ((BYTE *)&clrColor)[2]*=(float)((BYTE *)&dwAlpha)[2]/256;\r
+               ((BYTE *)&clrColor)[0]+=((BYTE *)&dwColor)[0];\r
+               ((BYTE *)&clrColor)[1]+=((BYTE *)&dwColor)[1];\r
+               ((BYTE *)&clrColor)[2]+=((BYTE *)&dwColor)[2];*/\r
+\r
+               /* blendedcolor =\r
+                    ( ( forecolor * ( 1 - alpha ) ) >> 8 )\r
+                  + ( ( backcolor * ( 256 - alpha ) ) >> 8 ) */\r
+               ((BYTE *)&clrColor)[0] =\r
+                       ( ( ((BYTE *)&clrColor)[0] * ( ((BYTE *)&dwAlpha)[0] + 1 ) ) >> 8 )\r
+                       + ( ( ((BYTE *)&dwColor)[0] * ( 256 - ((BYTE *)&dwAlpha)[0] ) ) >> 8 );\r
+               ((BYTE *)&clrColor)[1] =\r
+                       ( ( ((BYTE *)&clrColor)[1] * ( ((BYTE *)&dwAlpha)[1] + 1 ) ) >> 8 )\r
+                       + ( ( ((BYTE *)&dwColor)[1] * ( 256 - ((BYTE *)&dwAlpha)[1] ) ) >> 8 );\r
+               ((BYTE *)&clrColor)[2] =\r
+                       ( ( ((BYTE *)&clrColor)[2] * ( ((BYTE *)&dwAlpha)[2] + 1 ) ) >> 8 )\r
+                       + ( ( ((BYTE *)&dwColor)[2] * ( 256 - ((BYTE *)&dwAlpha)[2] ) ) >> 8 );\r
+       }\r
+       SetPixelV(hDC,X,Y,clrColor);\r
+}\r
+\r
diff --git a/grpapi/grpapi.def b/grpapi/grpapi.def
new file mode 100644 (file)
index 0000000..db8056e
--- /dev/null
@@ -0,0 +1,8 @@
+EXPORTS\r
+       LoadPalette   @1\r
+       LoadGrp       @2\r
+       DestroyGrp    @3\r
+       DrawGrp       @4\r
+       GetGrpInfo    @5\r
+       LoadGrpApi    @6\r
+       FreeGrpApi    @7\r
diff --git a/grpapi/grpapi.h b/grpapi/grpapi.h
new file mode 100644 (file)
index 0000000..8fc78cb
--- /dev/null
@@ -0,0 +1,67 @@
+/*\r
+\r
+  ShadowFlare GRP Library. (c) ShadowFlare Software 2002\r
+\r
+  Any comments or suggestions are accepted at blakflare@hotmail.com (ShadowFlare)\r
+*/\r
+\r
+#ifndef GRPAPI_INCLUDED\r
+#define GRPAPI_INCLUDED\r
+\r
+#include <windows.h>\r
+\r
+#ifndef GRPAPI_STATIC\r
+\r
+#ifdef GRPAPI_EXPORTS\r
+#define GRPAPI __declspec(dllexport)\r
+#else\r
+#define GRPAPI __declspec(dllimport)\r
+#endif\r
+\r
+#else\r
+#define GRPAPI\r
+#endif\r
+\r
+#ifdef __cplusplus\r
+extern "C" {\r
+#endif\r
+\r
+typedef struct {\r
+       WORD nFrames;\r
+       WORD wMaxWidth;\r
+       WORD wMaxHeight;\r
+} GRPHEADER;\r
+\r
+#define HORIZONTAL_FLIP 0x00000001 // Flips the graphic horizontally\r
+#define VERTICAL_FLIP   0x00000002 // Flips the graphic vertically\r
+#define SHADOW_COLOR    0x00000004 // Causes the graphic to be drawn in one color\r
+                                   // Second byte of flags is the red component of\r
+                                   // the shadow's color, third byte is green,\r
+                                   // fourth byte is blue; like this:\r
+                                   // SHADOW_COLOR|0xBBGGRR00\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
+\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
+// or a file not in an archive\r
+BOOL   GRPAPI WINAPI LoadPalette(LPCSTR lpFileName, DWORD *dwPaletteBuffer);\r
+HANDLE GRPAPI WINAPI LoadGrp(LPCSTR lpFileName);\r
+BOOL   GRPAPI WINAPI DestroyGrp(HANDLE hGrp);\r
+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
+// These no longer need to be called\r
+BOOL   GRPAPI WINAPI LoadGrpApi();\r
+void   GRPAPI WINAPI FreeGrpApi();\r
+\r
+#ifdef __cplusplus\r
+};  // extern "C" \r
+#endif\r
+\r
+#endif\r
+\r
diff --git a/grpapi/grpapi.rc b/grpapi/grpapi.rc
new file mode 100644 (file)
index 0000000..7a3ae1c
--- /dev/null
@@ -0,0 +1,110 @@
+//Microsoft Developer Studio generated resource script.\r
+//\r
+#include "resource.h"\r
+\r
+#define APSTUDIO_READONLY_SYMBOLS\r
+/////////////////////////////////////////////////////////////////////////////\r
+//\r
+// Generated from the TEXTINCLUDE 2 resource.\r
+//\r
+#include "afxres.h"\r
+\r
+/////////////////////////////////////////////////////////////////////////////\r
+#undef APSTUDIO_READONLY_SYMBOLS\r
+\r
+/////////////////////////////////////////////////////////////////////////////\r
+// English (U.S.) resources\r
+\r
+#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)\r
+#ifdef _WIN32\r
+LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US\r
+#pragma code_page(1252)\r
+#endif //_WIN32\r
+\r
+#ifdef APSTUDIO_INVOKED\r
+/////////////////////////////////////////////////////////////////////////////\r
+//\r
+// TEXTINCLUDE\r
+//\r
+\r
+1 TEXTINCLUDE DISCARDABLE \r
+BEGIN\r
+    "resource.h\0"\r
+END\r
+\r
+2 TEXTINCLUDE DISCARDABLE \r
+BEGIN\r
+    "#include ""afxres.h""\r\n"\r
+    "\0"\r
+END\r
+\r
+3 TEXTINCLUDE DISCARDABLE \r
+BEGIN\r
+    "\r\n"\r
+    "\0"\r
+END\r
+\r
+#endif    // APSTUDIO_INVOKED\r
+\r
+\r
+#ifndef _MAC\r
+/////////////////////////////////////////////////////////////////////////////\r
+//\r
+// Version\r
+//\r
+\r
+VS_VERSION_INFO VERSIONINFO\r
+ FILEVERSION 1,0,0,1\r
+ PRODUCTVERSION 1,0,0,1\r
+ FILEFLAGSMASK 0x3fL\r
+#ifdef _DEBUG\r
+ FILEFLAGS 0x1L\r
+#else\r
+ FILEFLAGS 0x0L\r
+#endif\r
+ FILEOS 0x40004L\r
+ FILETYPE 0x2L\r
+ FILESUBTYPE 0x0L\r
+BEGIN\r
+    BLOCK "StringFileInfo"\r
+    BEGIN\r
+        BLOCK "040904b0"\r
+        BEGIN\r
+            VALUE "CompanyName", "ShadowFlare Software\0"\r
+                       #ifdef _DEBUG\r
+             VALUE "FileDescription", "ShadowFlare GRP Library (debug build)\0"\r
+                       #else\r
+             VALUE "FileDescription", "ShadowFlare GRP Library\0"\r
+                       #endif\r
+            VALUE "FileVersion", "1.00\0"\r
+            VALUE "InternalName", "grpapi\0"\r
+            VALUE "LegalCopyright", "Copyright © ShadowFlare Software 2002\0"\r
+            VALUE "OriginalFilename", "grpapi.dll\0"\r
+            VALUE "ProductName", "GRP Library\0"\r
+            VALUE "ProductVersion", "1, 0, 0, 1\0"\r
+                       VALUE "Web Address", "http://shadowflare.ancillaediting.net/\0"\r
+        END\r
+    END\r
+    BLOCK "VarFileInfo"\r
+    BEGIN\r
+        VALUE "Translation", 0x409, 1200\r
+    END\r
+END\r
+\r
+#endif    // !_MAC\r
+\r
+#endif    // English (U.S.) resources\r
+/////////////////////////////////////////////////////////////////////////////\r
+\r
+\r
+\r
+#ifndef APSTUDIO_INVOKED\r
+/////////////////////////////////////////////////////////////////////////////\r
+//\r
+// Generated from the TEXTINCLUDE 3 resource.\r
+//\r
+\r
+\r
+/////////////////////////////////////////////////////////////////////////////\r
+#endif    // not APSTUDIO_INVOKED\r
+\r
diff --git a/grpapi/grpapi.sln b/grpapi/grpapi.sln
new file mode 100644 (file)
index 0000000..4aa5309
--- /dev/null
@@ -0,0 +1,58 @@
+Microsoft Visual Studio Solution File, Format Version 8.00\r
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "drawgrp", "..\drawgrp\drawgrp.vcproj", "{10729DB2-5CEA-41BA-9C6F-B47BE5A3C242}"\r
+       ProjectSection(ProjectDependencies) = postProject\r
+       EndProjectSection\r
+EndProject\r
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "grpapi", "grpapi.vcproj", "{08812E9C-7F03-4DCB-8828-F3BDB0728EC7}"\r
+       ProjectSection(ProjectDependencies) = postProject\r
+       EndProjectSection\r
+EndProject\r
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "grplib", "grplib.vcproj", "{66127C6F-39DA-4B7A-9856-789ED0139DCB}"\r
+       ProjectSection(ProjectDependencies) = postProject\r
+       EndProjectSection\r
+EndProject\r
+Global\r
+       GlobalSection(SourceCodeControl) = preSolution\r
+               SccNumberOfProjects = 4\r
+               SccProjectName0 = \u0022$/grpapi.root/grpapi\u0022,\u0020FEAAAAAA\r
+               SccLocalPath0 = ..\r
+               SccProvider0 = MSSCCI:Microsoft\u0020Visual\u0020SourceSafe\r
+               CanCheckoutShared = false\r
+               SccProjectFilePathRelativizedFromConnection0 = grpapi\\\r
+               SolutionUniqueID = {C7ACFA83-726F-4F2A-93F1-58F59B9D32B9}\r
+               SccProjectUniqueName1 = ..\\drawgrp\\drawgrp.vcproj\r
+               SccLocalPath1 = ..\r
+               CanCheckoutShared = false\r
+               SccProjectFilePathRelativizedFromConnection1 = drawgrp\\\r
+               SccProjectUniqueName2 = grpapi.vcproj\r
+               SccLocalPath2 = ..\r
+               CanCheckoutShared = false\r
+               SccProjectFilePathRelativizedFromConnection2 = grpapi\\\r
+               SccProjectUniqueName3 = grplib.vcproj\r
+               SccLocalPath3 = ..\r
+               CanCheckoutShared = false\r
+               SccProjectFilePathRelativizedFromConnection3 = grpapi\\\r
+       EndGlobalSection\r
+       GlobalSection(SolutionConfiguration) = preSolution\r
+               Debug = Debug\r
+               Release = Release\r
+       EndGlobalSection\r
+       GlobalSection(ProjectConfiguration) = postSolution\r
+               {10729DB2-5CEA-41BA-9C6F-B47BE5A3C242}.Debug.ActiveCfg = Debug|Win32\r
+               {10729DB2-5CEA-41BA-9C6F-B47BE5A3C242}.Debug.Build.0 = Debug|Win32\r
+               {10729DB2-5CEA-41BA-9C6F-B47BE5A3C242}.Release.ActiveCfg = Release|Win32\r
+               {10729DB2-5CEA-41BA-9C6F-B47BE5A3C242}.Release.Build.0 = Release|Win32\r
+               {08812E9C-7F03-4DCB-8828-F3BDB0728EC7}.Debug.ActiveCfg = Debug|Win32\r
+               {08812E9C-7F03-4DCB-8828-F3BDB0728EC7}.Debug.Build.0 = Debug|Win32\r
+               {08812E9C-7F03-4DCB-8828-F3BDB0728EC7}.Release.ActiveCfg = Release|Win32\r
+               {08812E9C-7F03-4DCB-8828-F3BDB0728EC7}.Release.Build.0 = Release|Win32\r
+               {66127C6F-39DA-4B7A-9856-789ED0139DCB}.Debug.ActiveCfg = Debug|Win32\r
+               {66127C6F-39DA-4B7A-9856-789ED0139DCB}.Debug.Build.0 = Debug|Win32\r
+               {66127C6F-39DA-4B7A-9856-789ED0139DCB}.Release.ActiveCfg = Release|Win32\r
+               {66127C6F-39DA-4B7A-9856-789ED0139DCB}.Release.Build.0 = Release|Win32\r
+       EndGlobalSection\r
+       GlobalSection(ExtensibilityGlobals) = postSolution\r
+       EndGlobalSection\r
+       GlobalSection(ExtensibilityAddIns) = postSolution\r
+       EndGlobalSection\r
+EndGlobal\r
diff --git a/grpapi/grpapi.vcproj b/grpapi/grpapi.vcproj
new file mode 100644 (file)
index 0000000..11fbbd9
--- /dev/null
@@ -0,0 +1,208 @@
+<?xml version="1.0" encoding="Windows-1252"?>\r
+<VisualStudioProject\r
+       ProjectType="Visual C++"\r
+       Version="7.10"\r
+       Name="grpapi"\r
+       SccProjectName="&quot;$/grpapi.root/grpapi&quot;, FEAAAAAA"\r
+       SccAuxPath=""\r
+       SccLocalPath=".."\r
+       SccProvider="MSSCCI:Microsoft Visual SourceSafe">\r
+       <Platforms>\r
+               <Platform\r
+                       Name="Win32"/>\r
+       </Platforms>\r
+       <Configurations>\r
+               <Configuration\r
+                       Name="Debug|Win32"\r
+                       OutputDirectory=".\Debug"\r
+                       IntermediateDirectory=".\Debug"\r
+                       ConfigurationType="2"\r
+                       UseOfMFC="0"\r
+                       ATLMinimizesCRunTimeLibraryUsage="FALSE"\r
+                       CharacterSet="2">\r
+                       <Tool\r
+                               Name="VCCLCompilerTool"\r
+                               Optimization="0"\r
+                               PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;GRPAPI_EXPORTS"\r
+                               BasicRuntimeChecks="3"\r
+                               RuntimeLibrary="1"\r
+                               UsePrecompiledHeader="2"\r
+                               PrecompiledHeaderFile=".\Debug/grpapi.pch"\r
+                               AssemblerListingLocation=".\Debug/"\r
+                               ObjectFile=".\Debug/"\r
+                               ProgramDataBaseFileName=".\Debug/"\r
+                               WarningLevel="3"\r
+                               SuppressStartupBanner="TRUE"\r
+                               DebugInformationFormat="4"/>\r
+                       <Tool\r
+                               Name="VCCustomBuildTool"/>\r
+                       <Tool\r
+                               Name="VCLinkerTool"\r
+                               OutputFile=".\Debug/grpapi.dll"\r
+                               LinkIncremental="1"\r
+                               SuppressStartupBanner="TRUE"\r
+                               ModuleDefinitionFile=".\grpapi.def"\r
+                               GenerateDebugInformation="TRUE"\r
+                               ProgramDatabaseFile=".\Debug/grpapi.pdb"\r
+                               ImportLibrary=".\Debug/grpapi.lib"\r
+                               TargetMachine="1"/>\r
+                       <Tool\r
+                               Name="VCMIDLTool"\r
+                               PreprocessorDefinitions="_DEBUG"\r
+                               MkTypLibCompatible="TRUE"\r
+                               SuppressStartupBanner="TRUE"\r
+                               TargetEnvironment="1"\r
+                               TypeLibraryName=".\Debug/grpapi.tlb"\r
+                               HeaderFileName=""/>\r
+                       <Tool\r
+                               Name="VCPostBuildEventTool"/>\r
+                       <Tool\r
+                               Name="VCPreBuildEventTool"/>\r
+                       <Tool\r
+                               Name="VCPreLinkEventTool"/>\r
+                       <Tool\r
+                               Name="VCResourceCompilerTool"\r
+                               PreprocessorDefinitions="_DEBUG"\r
+                               Culture="1033"/>\r
+                       <Tool\r
+                               Name="VCWebServiceProxyGeneratorTool"/>\r
+                       <Tool\r
+                               Name="VCXMLDataGeneratorTool"/>\r
+                       <Tool\r
+                               Name="VCWebDeploymentTool"/>\r
+                       <Tool\r
+                               Name="VCManagedWrapperGeneratorTool"/>\r
+                       <Tool\r
+                               Name="VCAuxiliaryManagedWrapperGeneratorTool"/>\r
+               </Configuration>\r
+               <Configuration\r
+                       Name="Release|Win32"\r
+                       OutputDirectory=".\Release"\r
+                       IntermediateDirectory=".\Release"\r
+                       ConfigurationType="2"\r
+                       UseOfMFC="0"\r
+                       ATLMinimizesCRunTimeLibraryUsage="FALSE"\r
+                       CharacterSet="2">\r
+                       <Tool\r
+                               Name="VCCLCompilerTool"\r
+                               Optimization="2"\r
+                               InlineFunctionExpansion="1"\r
+                               PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;GRPAPI_EXPORTS"\r
+                               StringPooling="TRUE"\r
+                               RuntimeLibrary="0"\r
+                               EnableFunctionLevelLinking="TRUE"\r
+                               UsePrecompiledHeader="2"\r
+                               PrecompiledHeaderFile=".\Release/grpapi.pch"\r
+                               AssemblerListingLocation=".\Release/"\r
+                               ObjectFile=".\Release/"\r
+                               ProgramDataBaseFileName=".\Release/"\r
+                               WarningLevel="3"\r
+                               SuppressStartupBanner="TRUE"/>\r
+                       <Tool\r
+                               Name="VCCustomBuildTool"/>\r
+                       <Tool\r
+                               Name="VCLinkerTool"\r
+                               OutputFile=".\Release/grpapi.dll"\r
+                               LinkIncremental="1"\r
+                               SuppressStartupBanner="TRUE"\r
+                               ModuleDefinitionFile=".\grpapi.def"\r
+                               ProgramDatabaseFile=".\Release/grpapi.pdb"\r
+                               ImportLibrary=".\Release/grpapi.lib"\r
+                               TargetMachine="1"/>\r
+                       <Tool\r
+                               Name="VCMIDLTool"\r
+                               PreprocessorDefinitions="NDEBUG"\r
+                               MkTypLibCompatible="TRUE"\r
+                               SuppressStartupBanner="TRUE"\r
+                               TargetEnvironment="1"\r
+                               TypeLibraryName=".\Release/grpapi.tlb"\r
+                               HeaderFileName=""/>\r
+                       <Tool\r
+                               Name="VCPostBuildEventTool"/>\r
+                       <Tool\r
+                               Name="VCPreBuildEventTool"/>\r
+                       <Tool\r
+                               Name="VCPreLinkEventTool"/>\r
+                       <Tool\r
+                               Name="VCResourceCompilerTool"\r
+                               PreprocessorDefinitions="NDEBUG"\r
+                               Culture="1033"/>\r
+                       <Tool\r
+                               Name="VCWebServiceProxyGeneratorTool"/>\r
+                       <Tool\r
+                               Name="VCXMLDataGeneratorTool"/>\r
+                       <Tool\r
+                               Name="VCWebDeploymentTool"/>\r
+                       <Tool\r
+                               Name="VCManagedWrapperGeneratorTool"/>\r
+                       <Tool\r
+                               Name="VCAuxiliaryManagedWrapperGeneratorTool"/>\r
+               </Configuration>\r
+       </Configurations>\r
+       <References>\r
+       </References>\r
+       <Files>\r
+               <Filter\r
+                       Name="Source Files"\r
+                       Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat">\r
+                       <File\r
+                               RelativePath="grpapi.cpp">\r
+                               <FileConfiguration\r
+                                       Name="Debug|Win32">\r
+                                       <Tool\r
+                                               Name="VCCLCompilerTool"\r
+                                               Optimization="0"\r
+                                               PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_MBCS;_USRDLL;GRPAPI_EXPORTS;$(NoInherit)"\r
+                                               BasicRuntimeChecks="3"/>\r
+                               </FileConfiguration>\r
+                               <FileConfiguration\r
+                                       Name="Release|Win32">\r
+                                       <Tool\r
+                                               Name="VCCLCompilerTool"\r
+                                               Optimization="2"\r
+                                               PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_MBCS;_USRDLL;GRPAPI_EXPORTS;$(NoInherit)"/>\r
+                               </FileConfiguration>\r
+                       </File>\r
+                       <File\r
+                               RelativePath="grpapi.def">\r
+                       </File>\r
+                       <File\r
+                               RelativePath="grpapi.rc">\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\LoadStorm\Storm.cpp">\r
+                               <FileConfiguration\r
+                                       Name="Debug|Win32">\r
+                                       <Tool\r
+                                               Name="VCCLCompilerTool"\r
+                                               Optimization="0"\r
+                                               PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_MBCS;_USRDLL;GRPAPI_EXPORTS;$(NoInherit)"\r
+                                               BasicRuntimeChecks="3"/>\r
+                               </FileConfiguration>\r
+                               <FileConfiguration\r
+                                       Name="Release|Win32">\r
+                                       <Tool\r
+                                               Name="VCCLCompilerTool"\r
+                                               Optimization="2"\r
+                                               PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_MBCS;_USRDLL;GRPAPI_EXPORTS;$(NoInherit)"/>\r
+                               </FileConfiguration>\r
+                       </File>\r
+               </Filter>\r
+               <Filter\r
+                       Name="Header Files"\r
+                       Filter="h;hpp;hxx;hm;inl">\r
+                       <File\r
+                               RelativePath="grpapi.h">\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\LoadStorm\Storm.h">\r
+                       </File>\r
+               </Filter>\r
+               <Filter\r
+                       Name="Resource Files"\r
+                       Filter="ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe">\r
+               </Filter>\r
+       </Files>\r
+       <Globals>\r
+       </Globals>\r
+</VisualStudioProject>\r
diff --git a/grpapi/grpapi.vcproj.vspscc b/grpapi/grpapi.vcproj.vspscc
new file mode 100644 (file)
index 0000000..055d30a
--- /dev/null
@@ -0,0 +1,10 @@
+""\r
+{\r
+"FILE_VERSION" = "9237"\r
+"ENLISTMENT_CHOICE" = "NEVER"\r
+"PROJECT_FILE_RELATIVE_PATH" = "relative:grpapi"\r
+"NUMBER_OF_EXCLUDED_FILES" = "0"\r
+"ORIGINAL_PROJECT_FILE_PATH" = ""\r
+"NUMBER_OF_NESTED_PROJECTS" = "0"\r
+"SOURCE_CONTROL_SETTINGS_PROVIDER" = "PROJECT"\r
+}\r
diff --git a/grpapi/grpapi.vsscc b/grpapi/grpapi.vsscc
new file mode 100644 (file)
index 0000000..85ef98b
Binary files /dev/null and b/grpapi/grpapi.vsscc differ
diff --git a/grpapi/grpapi.vssscc b/grpapi/grpapi.vssscc
new file mode 100644 (file)
index 0000000..055d30a
--- /dev/null
@@ -0,0 +1,10 @@
+""\r
+{\r
+"FILE_VERSION" = "9237"\r
+"ENLISTMENT_CHOICE" = "NEVER"\r
+"PROJECT_FILE_RELATIVE_PATH" = "relative:grpapi"\r
+"NUMBER_OF_EXCLUDED_FILES" = "0"\r
+"ORIGINAL_PROJECT_FILE_PATH" = ""\r
+"NUMBER_OF_NESTED_PROJECTS" = "0"\r
+"SOURCE_CONTROL_SETTINGS_PROVIDER" = "PROJECT"\r
+}\r
diff --git a/grpapi/grpapi_no-lib.cpp b/grpapi/grpapi_no-lib.cpp
new file mode 100644 (file)
index 0000000..a183155
--- /dev/null
@@ -0,0 +1,56 @@
+#include "grpapi_no-lib.h"\r
+\r
+struct GRPAPIMODULE {\r
+       GRPAPIMODULE();\r
+       ~GRPAPIMODULE();\r
+} GrpApi;\r
+\r
+HINSTANCE hGrpApi = 0;\r
+\r
+funcLoadPalette LoadPalette = 0;\r
+funcLoadGrp LoadGrp = 0;\r
+funcDestroyGrp DestroyGrp = 0;\r
+funcDrawGrp DrawGrp = 0;\r
+funcGetGrpInfo GetGrpInfo = 0;\r
+funcLoadGrpApi LoadGrpApi = 0;\r
+funcFreeGrpApi FreeGrpApi = 0;\r
+\r
+GRPAPIMODULE::GRPAPIMODULE()\r
+{\r
+       if (hGrpApi!=0) return;\r
+       hGrpApi = LoadLibrary("grpapi.dll");\r
+\r
+       if (hGrpApi!=0) {\r
+               LoadPalette = (funcLoadPalette)GetProcAddress(hGrpApi,"LoadPalette");\r
+               LoadGrp = (funcLoadGrp)GetProcAddress(hGrpApi,"LoadGrp");\r
+               DestroyGrp = (funcDestroyGrp)GetProcAddress(hGrpApi,"DestroyGrp");\r
+               DrawGrp = (funcDrawGrp)GetProcAddress(hGrpApi,"DrawGrp");\r
+               GetGrpInfo = (funcGetGrpInfo)GetProcAddress(hGrpApi,"GetGrpInfo");\r
+               LoadGrpApi = (funcLoadGrpApi)GetProcAddress(hGrpApi,"LoadGrpApi");\r
+               FreeGrpApi = (funcFreeGrpApi)GetProcAddress(hGrpApi,"FreeGrpApi");\r
+       }\r
+}\r
+\r
+GRPAPIMODULE::~GRPAPIMODULE()\r
+{\r
+       LoadPalette = 0;\r
+       LoadGrp = 0;\r
+       DestroyGrp = 0;\r
+       DrawGrp = 0;\r
+       GetGrpInfo = 0;\r
+       LoadGrpApi = 0;\r
+       FreeGrpApi = 0;\r
+\r
+       if (hGrpApi==0) return;\r
+       FreeLibrary(hGrpApi);\r
+       hGrpApi = 0;\r
+}\r
+\r
+void LoadGrpApiLib()\r
+{\r
+}\r
+\r
+void FreeGrpApiLib()\r
+{\r
+}\r
+\r
diff --git a/grpapi/grpapi_no-lib.h b/grpapi/grpapi_no-lib.h
new file mode 100644 (file)
index 0000000..a252519
--- /dev/null
@@ -0,0 +1,72 @@
+/*\r
+\r
+  ShadowFlare GRP Library. (c) ShadowFlare Software 2002\r
+\r
+  Any comments or suggestions are accepted at blakflare@hotmail.com (ShadowFlare)\r
+*/\r
+\r
+#ifndef GRPAPI_INCLUDED\r
+#define GRPAPI_INCLUDED\r
+\r
+#include <windows.h>\r
+\r
+#ifdef GRPAPI_EXPORTS\r
+#define GRPAPI __declspec(dllexport)\r
+#else\r
+#define GRPAPI __declspec(dllimport)\r
+#endif\r
+\r
+#ifdef __cplusplus\r
+extern "C" {\r
+#endif\r
+\r
+// These no longer need to be called\r
+extern void LoadGrpApiLib();\r
+extern void FreeGrpApiLib();\r
+\r
+typedef struct {\r
+       WORD nFrames;\r
+       WORD wMaxWidth;\r
+       WORD wMaxHeight;\r
+} GRPHEADER;\r
+\r
+#define HORIZONTAL_FLIP 0x00000001 // Flips the graphic horizontally\r
+#define VERTICAL_FLIP   0x00000002 // Flips the graphic vertically\r
+#define SHADOW_COLOR    0x00000004 // Causes the graphic to be drawn in one color\r
+                                   // Second byte of flags is the red component of\r
+                                   // the shadow's color, third byte is green,\r
+                                   // fourth byte is blue; like this:\r
+                                   // SHADOW_COLOR|0xBBGGRR00\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
+\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
+// or a file not in an archive\r
+typedef BOOL   (WINAPI* funcLoadPalette)(LPCSTR lpFileName, DWORD *dwPaletteBuffer);\r
+typedef HANDLE (WINAPI* funcLoadGrp)(LPCSTR lpFileName);\r
+typedef BOOL   (WINAPI* funcDestroyGrp)(HANDLE hGrp);\r
+typedef BOOL   (WINAPI* funcDrawGrp)(HANDLE hGrp, HDC hdcDest, int nXDest, int nYDest, WORD nFrame, DWORD *dwPalette, DWORD dwFlags, DWORD dwAlpha);\r
+typedef BOOL   (WINAPI* funcGetGrpInfo)(HANDLE hGrp, GRPHEADER *GrpInfo);\r
+extern funcLoadPalette LoadPalette;\r
+extern funcLoadGrp LoadGrp;\r
+extern funcDestroyGrp DestroyGrp;\r
+extern funcDrawGrp DrawGrp;\r
+extern funcGetGrpInfo GetGrpInfo;\r
+\r
+// These no longer need to be called\r
+typedef BOOL   (WINAPI* funcLoadGrpApi)();\r
+typedef void   (WINAPI* funcFreeGrpApi)();\r
+extern funcLoadGrpApi LoadGrpApi;\r
+extern funcFreeGrpApi FreeGrpApi;\r
+\r
+#ifdef __cplusplus\r
+};  // extern "C" \r
+#endif\r
+\r
+#endif\r
+\r
diff --git a/grpapi/grplib.vcproj b/grpapi/grplib.vcproj
new file mode 100644 (file)
index 0000000..f48df3e
--- /dev/null
@@ -0,0 +1,174 @@
+<?xml version="1.0" encoding="Windows-1252"?>\r
+<VisualStudioProject\r
+       ProjectType="Visual C++"\r
+       Version="7.10"\r
+       Name="grplib"\r
+       SccProjectName="&quot;$/grpapi.root/grpapi&quot;, FEAAAAAA"\r
+       SccAuxPath=""\r
+       SccLocalPath=".."\r
+       SccProvider="MSSCCI:Microsoft Visual SourceSafe">\r
+       <Platforms>\r
+               <Platform\r
+                       Name="Win32"/>\r
+       </Platforms>\r
+       <Configurations>\r
+               <Configuration\r
+                       Name="Debug|Win32"\r
+                       OutputDirectory=".\grplib___Win32_Debug"\r
+                       IntermediateDirectory=".\Debug"\r
+                       ConfigurationType="4"\r
+                       UseOfMFC="0"\r
+                       ATLMinimizesCRunTimeLibraryUsage="FALSE"\r
+                       CharacterSet="2">\r
+                       <Tool\r
+                               Name="VCCLCompilerTool"\r
+                               Optimization="0"\r
+                               PreprocessorDefinitions="WIN32;_DEBUG;_LIB;GRPAPI_STATIC"\r
+                               BasicRuntimeChecks="3"\r
+                               RuntimeLibrary="5"\r
+                               UsePrecompiledHeader="2"\r
+                               PrecompiledHeaderFile=".\Debug/grplib.pch"\r
+                               AssemblerListingLocation=".\Debug/"\r
+                               ObjectFile=".\Debug/"\r
+                               ProgramDataBaseFileName=".\Debug/"\r
+                               WarningLevel="3"\r
+                               SuppressStartupBanner="TRUE"\r
+                               DebugInformationFormat="4"/>\r
+                       <Tool\r
+                               Name="VCCustomBuildTool"/>\r
+                       <Tool\r
+                               Name="VCLibrarianTool"\r
+                               OutputFile="Debug\grp_static.lib"\r
+                               SuppressStartupBanner="TRUE"/>\r
+                       <Tool\r
+                               Name="VCMIDLTool"/>\r
+                       <Tool\r
+                               Name="VCPostBuildEventTool"/>\r
+                       <Tool\r
+                               Name="VCPreBuildEventTool"/>\r
+                       <Tool\r
+                               Name="VCPreLinkEventTool"/>\r
+                       <Tool\r
+                               Name="VCResourceCompilerTool"\r
+                               PreprocessorDefinitions="_DEBUG"\r
+                               Culture="1033"/>\r
+                       <Tool\r
+                               Name="VCWebServiceProxyGeneratorTool"/>\r
+                       <Tool\r
+                               Name="VCXMLDataGeneratorTool"/>\r
+                       <Tool\r
+                               Name="VCManagedWrapperGeneratorTool"/>\r
+                       <Tool\r
+                               Name="VCAuxiliaryManagedWrapperGeneratorTool"/>\r
+               </Configuration>\r
+               <Configuration\r
+                       Name="Release|Win32"\r
+                       OutputDirectory=".\Release"\r
+                       IntermediateDirectory=".\grplib___Win32_Release"\r
+                       ConfigurationType="4"\r
+                       UseOfMFC="0"\r
+                       ATLMinimizesCRunTimeLibraryUsage="FALSE"\r
+                       CharacterSet="2">\r
+                       <Tool\r
+                               Name="VCCLCompilerTool"\r
+                               Optimization="2"\r
+                               InlineFunctionExpansion="1"\r
+                               PreprocessorDefinitions="WIN32;NDEBUG;_LIB;GRPAPI_STATIC"\r
+                               StringPooling="TRUE"\r
+                               RuntimeLibrary="4"\r
+                               EnableFunctionLevelLinking="TRUE"\r
+                               UsePrecompiledHeader="2"\r
+                               PrecompiledHeaderFile=".\grplib___Win32_Release/grplib.pch"\r
+                               AssemblerListingLocation=".\grplib___Win32_Release/"\r
+                               ObjectFile=".\grplib___Win32_Release/"\r
+                               ProgramDataBaseFileName=".\grplib___Win32_Release/"\r
+                               WarningLevel="3"\r
+                               SuppressStartupBanner="TRUE"/>\r
+                       <Tool\r
+                               Name="VCCustomBuildTool"/>\r
+                       <Tool\r
+                               Name="VCLibrarianTool"\r
+                               OutputFile="Release\grp_static.lib"\r
+                               SuppressStartupBanner="TRUE"/>\r
+                       <Tool\r
+                               Name="VCMIDLTool"/>\r
+                       <Tool\r
+                               Name="VCPostBuildEventTool"/>\r
+                       <Tool\r
+                               Name="VCPreBuildEventTool"/>\r
+                       <Tool\r
+                               Name="VCPreLinkEventTool"/>\r
+                       <Tool\r
+                               Name="VCResourceCompilerTool"\r
+                               PreprocessorDefinitions="NDEBUG"\r
+                               Culture="1033"/>\r
+                       <Tool\r
+                               Name="VCWebServiceProxyGeneratorTool"/>\r
+                       <Tool\r
+                               Name="VCXMLDataGeneratorTool"/>\r
+                       <Tool\r
+                               Name="VCManagedWrapperGeneratorTool"/>\r
+                       <Tool\r
+                               Name="VCAuxiliaryManagedWrapperGeneratorTool"/>\r
+               </Configuration>\r
+       </Configurations>\r
+       <References>\r
+       </References>\r
+       <Files>\r
+               <Filter\r
+                       Name="Source Files"\r
+                       Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat">\r
+                       <File\r
+                               RelativePath="grpapi.cpp">\r
+                               <FileConfiguration\r
+                                       Name="Debug|Win32">\r
+                                       <Tool\r
+                                               Name="VCCLCompilerTool"\r
+                                               Optimization="0"\r
+                                               PreprocessorDefinitions=""\r
+                                               BasicRuntimeChecks="3"/>\r
+                               </FileConfiguration>\r
+                               <FileConfiguration\r
+                                       Name="Release|Win32">\r
+                                       <Tool\r
+                                               Name="VCCLCompilerTool"\r
+                                               Optimization="2"\r
+                                               PreprocessorDefinitions=""/>\r
+                               </FileConfiguration>\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\LoadStorm\Storm.cpp">\r
+                               <FileConfiguration\r
+                                       Name="Debug|Win32">\r
+                                       <Tool\r
+                                               Name="VCCLCompilerTool"\r
+                                               Optimization="0"\r
+                                               PreprocessorDefinitions=""\r
+                                               BasicRuntimeChecks="3"/>\r
+                               </FileConfiguration>\r
+                               <FileConfiguration\r
+                                       Name="Release|Win32">\r
+                                       <Tool\r
+                                               Name="VCCLCompilerTool"\r
+                                               Optimization="2"\r
+                                               PreprocessorDefinitions=""/>\r
+                               </FileConfiguration>\r
+                       </File>\r
+               </Filter>\r
+               <Filter\r
+                       Name="Header Files"\r
+                       Filter="h;hpp;hxx;hm;inl">\r
+                       <File\r
+                               RelativePath="grp_static.h">\r
+                       </File>\r
+                       <File\r
+                               RelativePath="grpapi.h">\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\LoadStorm\Storm.h">\r
+                       </File>\r
+               </Filter>\r
+       </Files>\r
+       <Globals>\r
+       </Globals>\r
+</VisualStudioProject>\r
diff --git a/grpapi/grplib.vcproj.vspscc b/grpapi/grplib.vcproj.vspscc
new file mode 100644 (file)
index 0000000..055d30a
--- /dev/null
@@ -0,0 +1,10 @@
+""\r
+{\r
+"FILE_VERSION" = "9237"\r
+"ENLISTMENT_CHOICE" = "NEVER"\r
+"PROJECT_FILE_RELATIVE_PATH" = "relative:grpapi"\r
+"NUMBER_OF_EXCLUDED_FILES" = "0"\r
+"ORIGINAL_PROJECT_FILE_PATH" = ""\r
+"NUMBER_OF_NESTED_PROJECTS" = "0"\r
+"SOURCE_CONTROL_SETTINGS_PROVIDER" = "PROJECT"\r
+}\r