X-Git-Url: https://sfsrealm.hopto.org/projects/gitweb.cgi?a=blobdiff_plain;f=grpapi%2Fgrpapi_no-lib.cpp;h=71018b74311909b82f1eb2698530baddd2e75a69;hb=09d0556c7d76e364defc92cdee8fc41b808432ba;hp=a183155d1d65d98a70cd7829edaf88faa1005891;hpb=14362b19599627313cd243bdbc404dc2087d4422;p=grpapi.git diff --git a/grpapi/grpapi_no-lib.cpp b/grpapi/grpapi_no-lib.cpp index a183155..71018b7 100644 --- a/grpapi/grpapi_no-lib.cpp +++ b/grpapi/grpapi_no-lib.cpp @@ -1,56 +1,70 @@ -#include "grpapi_no-lib.h" - -struct GRPAPIMODULE { - GRPAPIMODULE(); - ~GRPAPIMODULE(); -} GrpApi; - -HINSTANCE hGrpApi = 0; - -funcLoadPalette LoadPalette = 0; -funcLoadGrp LoadGrp = 0; -funcDestroyGrp DestroyGrp = 0; -funcDrawGrp DrawGrp = 0; -funcGetGrpInfo GetGrpInfo = 0; -funcLoadGrpApi LoadGrpApi = 0; -funcFreeGrpApi FreeGrpApi = 0; - -GRPAPIMODULE::GRPAPIMODULE() -{ - if (hGrpApi!=0) return; - hGrpApi = LoadLibrary("grpapi.dll"); - - if (hGrpApi!=0) { - LoadPalette = (funcLoadPalette)GetProcAddress(hGrpApi,"LoadPalette"); - LoadGrp = (funcLoadGrp)GetProcAddress(hGrpApi,"LoadGrp"); - DestroyGrp = (funcDestroyGrp)GetProcAddress(hGrpApi,"DestroyGrp"); - DrawGrp = (funcDrawGrp)GetProcAddress(hGrpApi,"DrawGrp"); - GetGrpInfo = (funcGetGrpInfo)GetProcAddress(hGrpApi,"GetGrpInfo"); - LoadGrpApi = (funcLoadGrpApi)GetProcAddress(hGrpApi,"LoadGrpApi"); - FreeGrpApi = (funcFreeGrpApi)GetProcAddress(hGrpApi,"FreeGrpApi"); - } -} - -GRPAPIMODULE::~GRPAPIMODULE() -{ - LoadPalette = 0; - LoadGrp = 0; - DestroyGrp = 0; - DrawGrp = 0; - GetGrpInfo = 0; - LoadGrpApi = 0; - FreeGrpApi = 0; - - if (hGrpApi==0) return; - FreeLibrary(hGrpApi); - hGrpApi = 0; -} - -void LoadGrpApiLib() -{ -} - -void FreeGrpApiLib() -{ -} - +#include "grpapi_no-lib.h" + +struct GRPAPIMODULE { + GRPAPIMODULE(); + ~GRPAPIMODULE(); +} GrpApi; + +HINSTANCE hGrpApi = 0; + +funcLoadPalette LoadPalette = 0; +funcLoadGrp LoadGrp = 0; +funcDestroyGrp DestroyGrp = 0; +funcDrawGrp DrawGrp = 0; +funcGetGrpInfo GetGrpInfo = 0; +funcGetGrpFrameInfo GetGrpFrameInfo = 0; +funcCreateGrp CreateGrp = 0; +funcSetFunctionGetPixel SetFunctionGetPixel = 0; +funcSetFunctionSetPixel SetFunctionSetPixel = 0; +funcSetMpqDll SetMpqDll = 0; +funcLoadGrpApi LoadGrpApi = 0; +funcFreeGrpApi FreeGrpApi = 0; + +GRPAPIMODULE::GRPAPIMODULE() +{ + if (hGrpApi!=0) return; + hGrpApi = LoadLibrary("grpapi.dll"); + + if (hGrpApi!=0) { + LoadPalette = (funcLoadPalette)GetProcAddress(hGrpApi,"LoadPalette"); + LoadGrp = (funcLoadGrp)GetProcAddress(hGrpApi,"LoadGrp"); + DestroyGrp = (funcDestroyGrp)GetProcAddress(hGrpApi,"DestroyGrp"); + DrawGrp = (funcDrawGrp)GetProcAddress(hGrpApi,"DrawGrp"); + GetGrpInfo = (funcGetGrpInfo)GetProcAddress(hGrpApi,"GetGrpInfo"); + GetGrpFrameInfo = (funcGetGrpFrameInfo)GetProcAddress(hGrpApi,"GetGrpFrameInfo"); + CreateGrp = (funcCreateGrp)GetProcAddress(hGrpApi,"CreateGrp"); + SetFunctionGetPixel = (funcSetFunctionGetPixel)GetProcAddress(hGrpApi,"SetFunctionGetPixel"); + SetFunctionSetPixel = (funcSetFunctionSetPixel)GetProcAddress(hGrpApi,"SetFunctionSetPixel"); + SetMpqDll = (funcSetMpqDll)GetProcAddress(hGrpApi,"SetMpqDll"); + LoadGrpApi = (funcLoadGrpApi)GetProcAddress(hGrpApi,"LoadGrpApi"); + FreeGrpApi = (funcFreeGrpApi)GetProcAddress(hGrpApi,"FreeGrpApi"); + } +} + +GRPAPIMODULE::~GRPAPIMODULE() +{ + LoadPalette = 0; + LoadGrp = 0; + DestroyGrp = 0; + DrawGrp = 0; + GetGrpInfo = 0; + GetGrpFrameInfo = 0; + CreateGrp = 0; + SetFunctionGetPixel = 0; + SetFunctionSetPixel = 0; + SetMpqDll = 0; + LoadGrpApi = 0; + FreeGrpApi = 0; + + if (hGrpApi==0) return; + FreeLibrary(hGrpApi); + hGrpApi = 0; +} + +void LoadGrpApiLib() +{ +} + +void FreeGrpApiLib() +{ +}