library lazHCEffects; {$mode delphi}{$H+} uses Classes { you can add units after this } ,uHCDefines ,mainform, uHCGCI, uHCGlobals, uHCTypeDefs, uHCEventHelpers ,uLazGUIGlobals ,Windows ,Forms ,ShellAPI ,SysUtils ,Types ,Dialogs, Interfaces, Controls; const DLLVERN = 3; DLLVERINTN = 34; var frmMain: TfrmMain; // ALE 20130819 stock HC Effects HCEffect00: THCEffectVoid; HCEffect01: THCEffectShort; HCEffect02: THCEffectVoid; // ALE 20130819 there is no stock HCEffect03: THCEffectVoid; HCEffect04: THCEffectVoid; HCEffect05: THCEffectVoid; HCEffect06: THCEffectVoid; // ALE 20130819 there is no stock HCEffect07: THCEffectVoid; HCEffect08: THCEffectVoid; HCEffect09: THCEffectVoid; HCEffect10: THCEffectVoid; HCEffect11: THCEffectVoid; HCEffect12: THCEffectVoid; HCEffect13: THCEffectVoid; HCEffect14: THCEffectVoid; HCEffect15: THCEffectVoid; HCEffect16: THCEffectVoid; HCEffect17: THCEffectShort; HCEffect18: THCEffectVoid; HCEffect19: THCEffectVoid; HCEffect20: THCEffectVoid; HCEffect21: THCEffectVoid; {*** Return DLL internal version, i.e. revision 5 of my DLL ***} function DLLVer():word;export;cdecl; begin result := DLLVERN; end; {*** Return DLL interface version, i.e. revision 1 of my HCE interface spec ***} function DLLVerInt():word;export;cdecl; begin result := DLLVERINTN; end; {*** Return DLL description, 255 characters max ***} function DLLDesc():PAnsiChar;export;cdecl; begin result := 'lazarus DLL that runs the stock HC Effects by Tony Eischens'; end; {*** Free DLL ***} procedure DLLFree();export;cdecl; begin // Do any cleanup here, this is the end frmMain.Free; end; {*** Init DLL ***} procedure DLLInit(hwndHC: HWND; pathHC: PAnsiChar; verHC: PAnsiChar; verSaveGame: longword; funcRefs: PHCDLL_FUNC_REF; PGEClosing: Pointer; PDLLBusy: Pointer; verInterface: longword; srandSeed: longword; harpoon_uuid_session: PAnsiChar; hclicense_dt_expire: Int64; hclicense_licensee: PAnsiChar; usblicense_desc: PAnsiChar; RESRSRStructureVersion: ulong; AnnexVersion: ushort); export; cdecl; var funcTmp: PHCDLL_FUNC_REF; //strFuncs: String; begin // here we initialize globals and such for the life of the DLL Application.Initialize; // ALE 20120410 Freezes HC Application.Run; uLazGUIGlobals.PGEClosing:=PGEClosing; uLazGUIGlobals.PDLLBusy:=PDLLBusy; frmMain := TfrmMain.Create(nil); frmMain.ParentWindow := hwndHC; frmMain.Caption := 'lazarus HC Effects Export DLL v' + IntToStr(DLLVERN) + ', ExportDLL Interface v' + IntToStr(DLLVERINTN); frmMain.memDLLInit.Lines.Add('lazarus GUI Export DLL v' + IntToStr(DLLVERN)); frmMain.memDLLInit.Lines.Add('ExportDLL Interface v' + IntToStr(DLLVERINTN)); frmMain.memDLLInit.Lines.Add('hwndHC = 0x' + IntToHex(hwndHC, 8)); frmMain.memDLLInit.Lines.Add('pathHC = ' + pathHC); frmMain.memDLLInit.Lines.Add('verHC = ' + verHC); frmMain.memDLLInit.Lines.Add('verSaveGame = 0x' + IntToHex(verSaveGame, 8)); funcTmp := funcRefs; //strFuncs := ''; while (funcTmp <> nil) do begin //strFuncs := strFuncs + #10 + Format('0x%p %s', [funcTmp^.funcPtr, funcTmp^.funcName]); if (funcTmp^.funcName = 'Effect00') then HCEffect00 := funcTmp^.funcPtr else if (funcTmp^.funcName = 'Effect01') then HCEffect01 := funcTmp^.funcPtr else if (funcTmp^.funcName = 'Effect02') then HCEffect02 := funcTmp^.funcPtr else if (funcTmp^.funcName = 'Effect04') then HCEffect04 := funcTmp^.funcPtr else if (funcTmp^.funcName = 'Effect05') then HCEffect05 := funcTmp^.funcPtr else if (funcTmp^.funcName = 'Effect06') then HCEffect06 := funcTmp^.funcPtr else if (funcTmp^.funcName = 'Effect08') then HCEffect08 := funcTmp^.funcPtr else if (funcTmp^.funcName = 'Effect09') then HCEffect09 := funcTmp^.funcPtr else if (funcTmp^.funcName = 'Effect10') then HCEffect10 := funcTmp^.funcPtr else if (funcTmp^.funcName = 'Effect11') then HCEffect11 := funcTmp^.funcPtr else if (funcTmp^.funcName = 'Effect12') then HCEffect12 := funcTmp^.funcPtr else if (funcTmp^.funcName = 'Effect13') then HCEffect13 := funcTmp^.funcPtr else if (funcTmp^.funcName = 'Effect14') then HCEffect14 := funcTmp^.funcPtr else if (funcTmp^.funcName = 'Effect15') then HCEffect15 := funcTmp^.funcPtr else if (funcTmp^.funcName = 'Effect16') then HCEffect16 := funcTmp^.funcPtr else if (funcTmp^.funcName = 'Effect17') then HCEffect17 := funcTmp^.funcPtr else if (funcTmp^.funcName = 'Effect18') then HCEffect18 := funcTmp^.funcPtr else if (funcTmp^.funcName = 'Effect19') then HCEffect19 := funcTmp^.funcPtr else if (funcTmp^.funcName = 'Effect20') then HCEffect20 := funcTmp^.funcPtr else if (funcTmp^.funcName = 'Effect21') then HCEffect21 := funcTmp^.funcPtr; funcTmp := funcTmp^.next; end; //ShowMessage(strFuncs); frmMain.Show; end; // ALE 20130819 MoveUnits function Effect00():short;export;cdecl; var intItem: Integer; begin intItem := frmMain.cbxEffect00.ItemIndex; if (intItem = 2) then begin // ALE 20130819 call HC stock from the DLL if (@HCEffect00 <> nil) then HCEffect00(); result := CTRUE; end else if (intItem = 1) then begin // ALE 20130819 skip the effect result := CTRUE; end else begin // ALE 20130819 use HC stock result := CFALSE; end; end; function Effect01():short;export;cdecl; var intItem: Integer; begin intItem := frmMain.cbxEffect01.ItemIndex; if (intItem = 2) then begin // ALE 20130819 call HC stock from the DLL if (@HCEffect01 <> nil) then HCEffect01(CFALSE); result := CTRUE; end else if (intItem = 1) then begin // ALE 20130819 skip the effect result := CTRUE; end else begin // ALE 20130819 use HC stock result := CFALSE; end; end; function Effect02():short;export;cdecl; var intItem: Integer; begin intItem := frmMain.cbxEffect02.ItemIndex; if (intItem = 2) then begin // ALE 20130819 call HC stock from the DLL if (@HCEffect02 <> nil) then HCEffect02(); result := CTRUE; end else if (intItem = 1) then begin // ALE 20130819 skip the effect result := CTRUE; end else begin // ALE 20130819 use HC stock result := CFALSE; end; end; function Effect03():short;export;cdecl; var intItem: Integer; begin // ALE 20130819 there is no stock HCEffect03() intItem := frmMain.cbxEffect03.ItemIndex; if (intItem = 1) then begin // ALE 20130819 skip the effect result := CTRUE; end else begin // ALE 20130819 use HC stock result := CFALSE; end; end; function Effect04():short;export;cdecl; var intItem: Integer; begin intItem := frmMain.cbxEffect04.ItemIndex; if (intItem = 2) then begin // ALE 20130819 call HC stock from the DLL if (@HCEffect04 <> nil) then HCEffect04(); result := CTRUE; end else if (intItem = 1) then begin // ALE 20130819 skip the effect result := CTRUE; end else begin // ALE 20130819 use HC stock result := CFALSE; end; end; function Effect05():short;export;cdecl; var intItem: Integer; begin intItem := frmMain.cbxEffect05.ItemIndex; if (intItem = 2) then begin // ALE 20130819 call HC stock from the DLL if (@HCEffect05 <> nil) then HCEffect05(); result := CTRUE; end else if (intItem = 1) then begin // ALE 20130819 skip the effect result := CTRUE; end else begin // ALE 20130819 use HC stock result := CFALSE; end; end; function Effect06():short;export;cdecl; var intItem: Integer; begin intItem := frmMain.cbxEffect06.ItemIndex; if (intItem = 2) then begin // ALE 20130819 call HC stock from the DLL if (@HCEffect06 <> nil) then HCEffect06(); result := CTRUE; end else if (intItem = 1) then begin // ALE 20130819 skip the effect result := CTRUE; end else begin // ALE 20130819 use HC stock result := CFALSE; end; end; function Effect07():short;export;cdecl; var intItem: Integer; begin // ALE 20130819 there is no stock HCEffect07() intItem := frmMain.cbxEffect07.ItemIndex; if (intItem = 1) then begin // ALE 20130819 skip the effect result := CTRUE; end else begin // ALE 20130819 use HC stock result := CFALSE; end; end; function Effect08():short;export;cdecl; var intItem: Integer; begin intItem := frmMain.cbxEffect08.ItemIndex; if (intItem = 2) then begin // ALE 20130819 call HC stock from the DLL if (@HCEffect08 <> nil) then HCEffect08(); result := CTRUE; end else if (intItem = 1) then begin // ALE 20130819 skip the effect result := CTRUE; end else begin // ALE 20130819 use HC stock result := CFALSE; end; end; function Effect09():short;export;cdecl; var intItem: Integer; begin intItem := frmMain.cbxEffect09.ItemIndex; if (intItem = 2) then begin // ALE 20130819 call HC stock from the DLL if (@HCEffect09 <> nil) then HCEffect09(); result := CTRUE; end else if (intItem = 1) then begin // ALE 20130819 skip the effect result := CTRUE; end else begin // ALE 20130819 use HC stock result := CFALSE; end; end; function Effect10():short;export;cdecl; var intItem: Integer; begin intItem := frmMain.cbxEffect10.ItemIndex; if (intItem = 2) then begin // ALE 20130819 call HC stock from the DLL if (@HCEffect10 <> nil) then HCEffect10(); result := CTRUE; end else if (intItem = 1) then begin // ALE 20130819 skip the effect result := CTRUE; end else begin // ALE 20130819 use HC stock result := CFALSE; end; end; function Effect11():short;export;cdecl; var intItem: Integer; begin intItem := frmMain.cbxEffect11.ItemIndex; if (intItem = 2) then begin // ALE 20130819 call HC stock from the DLL if (@HCEffect11 <> nil) then HCEffect11(); result := CTRUE; end else if (intItem = 1) then begin // ALE 20130819 skip the effect result := CTRUE; end else begin // ALE 20130819 use HC stock result := CFALSE; end; end; function Effect12():short;export;cdecl; var intItem: Integer; begin intItem := frmMain.cbxEffect12.ItemIndex; if (intItem = 2) then begin // ALE 20130819 call HC stock from the DLL if (@HCEffect12 <> nil) then HCEffect12(); result := CTRUE; end else if (intItem = 1) then begin // ALE 20130819 skip the effect result := CTRUE; end else begin // ALE 20130819 use HC stock result := CFALSE; end; end; function Effect13():short;export;cdecl; var intItem: Integer; begin intItem := frmMain.cbxEffect13.ItemIndex; if (intItem = 2) then begin // ALE 20130819 call HC stock from the DLL if (@HCEffect13 <> nil) then HCEffect13(); result := CTRUE; end else if (intItem = 1) then begin // ALE 20130819 skip the effect result := CTRUE; end else begin // ALE 20130819 use HC stock result := CFALSE; end; end; function Effect14():short;export;cdecl; var intItem: Integer; begin intItem := frmMain.cbxEffect14.ItemIndex; if (intItem = 2) then begin // ALE 20130819 call HC stock from the DLL if (@HCEffect14 <> nil) then HCEffect14(); result := CTRUE; end else if (intItem = 1) then begin // ALE 20130819 skip the effect result := CTRUE; end else begin // ALE 20130819 use HC stock result := CFALSE; end; end; function Effect15():short;export;cdecl; var intItem: Integer; begin intItem := frmMain.cbxEffect15.ItemIndex; if (intItem = 2) then begin // ALE 20130819 call HC stock from the DLL if (@HCEffect15 <> nil) then HCEffect15(); result := CTRUE; end else if (intItem = 1) then begin // ALE 20130819 skip the effect result := CTRUE; end else begin // ALE 20130819 use HC stock result := CFALSE; end; end; function Effect16():short;export;cdecl; var intItem: Integer; begin intItem := frmMain.cbxEffect16.ItemIndex; if (intItem = 2) then begin // ALE 20130819 call HC stock from the DLL if (@HCEffect16 <> nil) then HCEffect16(); result := CTRUE; end else if (intItem = 1) then begin // ALE 20130819 skip the effect result := CTRUE; end else begin // ALE 20130819 use HC stock result := CFALSE; end; end; function Effect17():short;export;cdecl; var intItem: Integer; begin intItem := frmMain.cbxEffect17.ItemIndex; if (intItem = 2) then begin // ALE 20130819 call HC stock from the DLL if (@HCEffect17 <> nil) then HCEffect17(CFALSE); result := CTRUE; end else if (intItem = 1) then begin // ALE 20130819 skip the effect result := CTRUE; end else begin // ALE 20130819 use HC stock result := CFALSE; end; end; function Effect18():short;export;cdecl; var intItem: Integer; begin intItem := frmMain.cbxEffect18.ItemIndex; if (intItem = 2) then begin // ALE 20130819 call HC stock from the DLL if (@HCEffect18 <> nil) then HCEffect18(); result := CTRUE; end else if (intItem = 1) then begin // ALE 20130819 skip the effect result := CTRUE; end else begin // ALE 20130819 use HC stock result := CFALSE; end; end; function Effect19():short;export;cdecl; var intItem: Integer; begin intItem := frmMain.cbxEffect19.ItemIndex; if (intItem = 2) then begin // ALE 20130819 call HC stock from the DLL if (@HCEffect19 <> nil) then HCEffect19(); result := CTRUE; end else if (intItem = 1) then begin // ALE 20130819 skip the effect result := CTRUE; end else begin // ALE 20130819 use HC stock result := CFALSE; end; end; function Effect20():short;export;cdecl; var intItem: Integer; begin intItem := frmMain.cbxEffect20.ItemIndex; if (intItem = 2) then begin // ALE 20130819 call HC stock from the DLL if (@HCEffect20 <> nil) then HCEffect20(); result := CTRUE; end else if (intItem = 1) then begin // ALE 20130819 skip the effect result := CTRUE; end else begin // ALE 20130819 use HC stock result := CFALSE; end; end; function Effect21():short;export;cdecl; var intItem: Integer; begin intItem := frmMain.cbxEffect21.ItemIndex; if (intItem = 2) then begin // ALE 20130819 call HC stock from the DLL if (@HCEffect21 <> nil) then HCEffect21(); result := CTRUE; end else if (intItem = 1) then begin // ALE 20130819 skip the effect result := CTRUE; end else begin // ALE 20130819 use HC stock result := CFALSE; end; end; exports DLLVer ,DLLVerInt ,DLLDesc ,DLLFree ,DLLInit ,Effect00 ,Effect01 ,Effect02 ,Effect03 ,Effect04 ,Effect05 ,Effect06 ,Effect07 ,Effect08 ,Effect09 ,Effect10 ,Effect11 ,Effect12 ,Effect13 ,Effect14 ,Effect15 ,Effect16 ,Effect17 ,Effect18 ,Effect19 ,Effect20 ,Effect21 ; end.