mirror of
https://github.com/moparisthebest/Simba
synced 2024-12-24 00:08:52 -05:00
MMLCore: Multi platform library loading.
If Simba cannot load a plugin a.dll, it will look for a plugin called a32.dll (or a64.dll) depending on the platform and try to load it.
This commit is contained in:
parent
98ccbaf235
commit
67ebb56255
@ -23,6 +23,7 @@ interface
|
||||
procedure FreePlugins;
|
||||
procedure LoadPluginsDir(DirIndex : integer);
|
||||
function VerifyPath(Path : string) : string;
|
||||
function LoadPluginNoFallback(PluginName : string) : integer;
|
||||
protected
|
||||
function InitPlugin(plugin: TLibHandle): boolean; virtual; abstract;
|
||||
public
|
||||
@ -113,8 +114,7 @@ implementation
|
||||
end;
|
||||
end;
|
||||
|
||||
|
||||
function TGenericLoader.LoadPlugin(PluginName: string): Integer;
|
||||
function TGenericLoader.LoadPluginNoFallback(PluginName: string): Integer;
|
||||
var
|
||||
i, ii : integer;
|
||||
PlugExt: String = {$IFDEF LINUX}'.so';{$ELSE}'.dll';{$ENDIF}
|
||||
@ -151,6 +151,19 @@ implementation
|
||||
end;
|
||||
|
||||
|
||||
function TGenericLoader.LoadPlugin(PluginName: string): Integer;
|
||||
var
|
||||
CpuBits: String = {$IFDEF CPU32}'32';{$ELSE}'64';{$ENDIF}
|
||||
begin
|
||||
try
|
||||
Result := LoadPluginNoFallback(PluginName);
|
||||
except
|
||||
on exception do Result:= LoadPluginNoFallback(PluginName+CpuBits);
|
||||
end;
|
||||
|
||||
end;
|
||||
|
||||
|
||||
constructor TGenericLoader.Create;
|
||||
begin
|
||||
inherited Create;
|
||||
|
Loading…
Reference in New Issue
Block a user