diff options
Diffstat (limited to 'mediaplugin/src')
-rw-r--r-- | mediaplugin/src/base/UPlatform.pas | 19 | ||||
-rw-r--r-- | mediaplugin/src/base/UPlatformWindows.pas | 10 | ||||
-rw-r--r-- | mediaplugin/src/media/UMediaPlugin.pas | 6 |
3 files changed, 34 insertions, 1 deletions
diff --git a/mediaplugin/src/base/UPlatform.pas b/mediaplugin/src/base/UPlatform.pas index 6d884979..4239e21a 100644 --- a/mediaplugin/src/base/UPlatform.pas +++ b/mediaplugin/src/base/UPlatform.pas @@ -51,9 +51,11 @@ type procedure Halt; virtual; function GetLogPath: IPath; virtual; abstract; - function GetMusicPath: IPath; virtual; abstract; + function GetMusicPath: IPath; virtual; function GetGameSharedPath: IPath; virtual; abstract; function GetGameUserPath: IPath; virtual; abstract; + + procedure AddLibrarySearchPath(const DLLPath: IPath); virtual; end; function Platform(): TPlatform; @@ -113,6 +115,21 @@ begin Result := ExecDir.GetAbsolutePath(); end; +{** + * Dummy implementation (Mac specific) + *} +function TPlatform.GetMusicPath: IPath; +begin + Result := PATH_NONE; +end; + +{** + * Dummy implementation (Windows specific) + *} +procedure TPlatform.AddLibrarySearchPath(const DLLPath: IPath); +begin +end; + (** * Default TerminateIfAlreadyRunning() implementation *) diff --git a/mediaplugin/src/base/UPlatformWindows.pas b/mediaplugin/src/base/UPlatformWindows.pas index 91d3cce6..a0059687 100644 --- a/mediaplugin/src/base/UPlatformWindows.pas +++ b/mediaplugin/src/base/UPlatformWindows.pas @@ -51,6 +51,7 @@ type public procedure Init; override; function TerminateIfAlreadyRunning(var WndTitle: String): Boolean; override; + procedure AddLibrarySearchPath(const DLLPath: IPath); override; function GetLogPath: IPath; override; function GetGameSharedPath: IPath; override; @@ -63,6 +64,7 @@ uses SysUtils, ShlObj, Windows, + UPathUtils, UConfig; procedure TPlatformWindows.Init; @@ -206,4 +208,12 @@ begin Result := GetSpecialPath(CSIDL_APPDATA).Append('ultrastardx', pdAppend); end; +function SetDllDirectory(lpPathName: PWideChar): Bool; stdcall; + external kernel32 name 'SetDllDirectoryW'; + +procedure TPlatformWindows.AddLibrarySearchPath(const DLLPath: IPath); +begin + SetDllDirectory(PWideChar(DLLPath.ToWide())); +end; + end. diff --git a/mediaplugin/src/media/UMediaPlugin.pas b/mediaplugin/src/media/UMediaPlugin.pas index 4baa778a..8632b9df 100644 --- a/mediaplugin/src/media/UMediaPlugin.pas +++ b/mediaplugin/src/media/UMediaPlugin.pas @@ -168,6 +168,7 @@ uses UPath, UPathUtils, ULog, + UPlatform, UAudioDecoderPlugin, UAudioConverterPlugin, UVideoDecoderPlugin; @@ -434,6 +435,11 @@ const begin MediaPlugins := TList.Create; + {$IFDEF MSWINDOWS} + // add an additional dll search path for plugin dependencies + Platform.AddLibrarySearchPath(MediaPluginPath.Append('deps')); + {$ENDIF} + LibPath := MediaPluginPath.Append('*' + ModuleExt); Iter := FileSystem.FileFind(LibPath, faAnyFile); while (Iter.HasNext) do |