1
0
mirror of https://github.com/moparisthebest/Simba synced 2025-01-11 13:48:27 -05:00

Changes to RUTIS to allow it to work on Linux. Additional units may have to be touched when we start using them. This also does not yet touch the x64 compilation issues

This commit is contained in:
Merlijn Wajer 2010-08-24 00:09:05 +02:00
parent ff86c034e8
commit b8f4f97084
4 changed files with 16 additions and 13 deletions

View File

@ -42,7 +42,7 @@ Interface
{$ENDIF} {$ENDIF}
Uses Uses
Windows, Forms, Classes, lclintf, Forms, Classes,
{$ifdef DELPHI_7_UP}Variants,{$endif} {$ifdef DELPHI_7_UP}Variants,{$endif}
SysUtils, SysUtils,
Rutis_Defs, File_Manager; Rutis_Defs, File_Manager;

View File

@ -42,7 +42,7 @@ Interface
{$ENDIF} {$ENDIF}
Uses Uses
Windows, {$ifdef DELPHI_7_UP}Variants, {$endif} lclintf, {$ifdef DELPHI_7_UP}Variants, {$endif}
SysUtils, Rutis_Stack; SysUtils, Rutis_Stack;
//==================================================================== //====================================================================

View File

@ -9,7 +9,7 @@ Interface
{$ENDIF} {$ENDIF}
Uses Uses
Windows, Forms, Math, Dialogs, SysUtils, lclintf, Forms, Math, Dialogs, SysUtils,
Rutis_Stack, Rutis_Defs, Rutis_Classes, TypInfo; Rutis_Stack, Rutis_Defs, Rutis_Classes, TypInfo;
Type Type
@ -246,13 +246,15 @@ End;
Procedure _GetAsyncKeyState(Params : PRutisParamInfoArray; Result : PRutisParamInfo); Procedure _GetAsyncKeyState(Params : PRutisParamInfoArray; Result : PRutisParamInfo);
Begin Begin
PBoolean(Result^.Data)^ := Boolean(GetAsyncKeyState(GetPWord(Params^[0].Data)) <> 0); // XXX TODO FIXME OMG
//PBoolean(Result^.Data)^ := Boolean(GetAsyncKeyState(GetPWord(Params^[0].Data)) <> 0);
End; End;
{$ifndef WINCE} {$ifndef WINCE}
Procedure _Beep(Params : PRutisParamInfoArray; Result : PRutisParamInfo); Procedure _Beep(Params : PRutisParamInfoArray; Result : PRutisParamInfo);
Begin Begin
Windows.Beep(GetPCardinal(Params^[0].Data), GetPCardinal(Params^[1].Data)); // XXX TO FIXME OMG
//Windows.Beep(GetPCardinal(Params^[0].Data), GetPCardinal(Params^[1].Data));
End; End;
{$endif WINCE} {$endif WINCE}

View File

@ -44,7 +44,7 @@ Interface
{.$define DEBUG} {.$define DEBUG}
Uses Uses
Windows, Forms, Classes, lclintf, Forms, Classes,
{$ifdef DELPHI_7_UP}Variants,{$endif} {$ifdef DELPHI_7_UP}Variants,{$endif}
SysUtils, Math, SysUtils, Math,
Rutis_Stack, Rutis_Defs, Rutis_Errors, RUTIS_Classes, RUTIS_Compiler_Delphi, Rutis_Stack, Rutis_Defs, Rutis_Errors, RUTIS_Classes, RUTIS_Compiler_Delphi,
@ -2088,9 +2088,10 @@ End;
//======================= Compiler ============================================= //======================= Compiler =============================================
//============================================================================== //==============================================================================
{$ifdef FPC} /// XXX TODO OMG WTF
{{$ifdef FPC}
function LoadLibraryA(lpLibFileName: LPCSTR): HINST; external KernelDLL name 'LoadLibraryA'; function LoadLibraryA(lpLibFileName: LPCSTR): HINST; external KernelDLL name 'LoadLibraryA';
{$endif FPC} {$endif FPC} }
Function TRutisEngine.RegisterExtDll(FileName : String) : Boolean; Function TRutisEngine.RegisterExtDll(FileName : String) : Boolean;
Var i : Integer; Var i : Integer;
@ -2102,7 +2103,7 @@ Begin
i := length(fExtDlls); i := length(fExtDlls);
SetLength(fExtDlls, i + 1); SetLength(fExtDlls, i + 1);
fExtDlls[i].DllHandle := LoadLibraryA(PAnsiChar(FileName)); // fExtDlls[i].DllHandle := LoadLibraryA(PAnsiChar(FileName));
If fExtDlls[i].DllHandle = 0 Then If fExtDlls[i].DllHandle = 0 Then
Begin Begin
@ -2112,11 +2113,11 @@ Begin
With fExtDlls[i] Do With fExtDlls[i] Do
Begin Begin
RegisterEXTMethods := TRegisterEXTMethods(GetProcAddress(DllHandle, 'RegisterEXTMethods')); { RegisterEXTMethods := TRegisterEXTMethods(GetProcAddress(DllHandle, 'RegisterEXTMethods'));
StartScript := TScriptAction(GetProcAddress(DllHandle, 'StartScript')); StartScript := TScriptAction(GetProcAddress(DllHandle, 'StartScript'));
StopScript := TScriptAction(GetProcAddress(DllHandle, 'StopScript')); StopScript := TScriptAction(GetProcAddress(DllHandle, 'StopScript'));
PauseScript := TScriptAction(GetProcAddress(DllHandle, 'PauseScript')); PauseScript := TScriptAction(GetProcAddress(DllHandle, 'PauseScript'));
Destroy := TScriptAction(GetProcAddress(DllHandle, 'Destroy')); Destroy := TScriptAction(GetProcAddress(DllHandle, 'Destroy')); }
End; End;
fExtDlls[i].RegisterEXTMethods(self); fExtDlls[i].RegisterEXTMethods(self);
@ -2127,8 +2128,8 @@ End;
Procedure TRutisEngine.UnloadExtDlls; Procedure TRutisEngine.UnloadExtDlls;
Var i : Integer; Var i : Integer;
Begin Begin
For i := 0 To high(fExtDlls) Do { For i := 0 To high(fExtDlls) Do
FreeLibrary(fExtDlls[i].DllHandle); FreeLibrary(fExtDlls[i].DllHandle); }
SetLength(fExtDlls, 0); SetLength(fExtDlls, 0);
End; End;