mirror of
https://git.vladimir.cc/vladimir/ewsdr.git
synced 2026-08-25 18:43:51 +00:00
Fix macOS pixel format: use ARGB byte order in all raw ScanLine blending
On macOS Cocoa, TBitmap.pf32bit stores pixels in ARGB order
(byte0=A, byte1=R, byte2=G, byte3=B) rather than BGRA used on
Linux/Windows. All raw ScanLine pixel blending and channel mapping
is now guarded with { DARWIN} to use the correct offsets.
Also fix PortAudio library discovery on macOS: probe .dylib names
(including Homebrew paths) before falling through to .so/.dll.
This commit is contained in:
+16
-3
@@ -152,14 +152,22 @@ function PaInCallback(inputBuffer, outputBuffer: Pointer;
|
||||
implementation
|
||||
|
||||
const
|
||||
{$IFDEF UNIX}
|
||||
{$IFDEF DARWIN}
|
||||
PA_IN_LIBS: array[0..3] of AnsiString = (
|
||||
'libportaudio.dylib',
|
||||
'libportaudio.2.dylib',
|
||||
'/usr/local/lib/libportaudio.dylib',
|
||||
'/opt/homebrew/lib/libportaudio.dylib'
|
||||
);
|
||||
{$ELSE}
|
||||
{$IFDEF UNIX}
|
||||
PA_IN_LIBS: array[0..3] of AnsiString = (
|
||||
'libportaudio.so.2',
|
||||
'libportaudio.so',
|
||||
'libportaudio.so.2.0.0',
|
||||
'libportaudio.so.0'
|
||||
);
|
||||
{$ELSE}
|
||||
{$ELSE}
|
||||
PA_IN_LIBS: array[0..5] of AnsiString = (
|
||||
'portaudio_x64.dll',
|
||||
'portaudio_x86.dll',
|
||||
@@ -168,6 +176,7 @@ const
|
||||
'libportaudio.dll',
|
||||
'libportaudio64.dll'
|
||||
);
|
||||
{$ENDIF}
|
||||
{$ENDIF}
|
||||
PA_NO_ERROR = 0;
|
||||
PA_FLOAT32 = LongWord(1);
|
||||
@@ -276,7 +285,11 @@ begin
|
||||
{$IFDEF WINDOWS}
|
||||
FLastError := 'PortAudio DLL not found. Put portaudio_x64.dll, portaudio.dll, or libportaudio-2.dll next to ewsdr.exe';
|
||||
{$ELSE}
|
||||
FLastError := 'libportaudio not found';
|
||||
{$IFDEF DARWIN}
|
||||
FLastError := 'libportaudio not found. Install via: brew install portaudio';
|
||||
{$ELSE}
|
||||
FLastError := 'libportaudio not found. sudo apt install libportaudio2';
|
||||
{$ENDIF}
|
||||
{$ENDIF}
|
||||
Exit;
|
||||
end;
|
||||
|
||||
Reference in New Issue
Block a user