mirror of
https://github.com/moparisthebest/Simba
synced 2024-11-25 10:42:20 -05:00
Narrowed down the black-screen-colourpicker problem to the bitblt in ReturnData (I think). Removed an unneeded unit from os_windows and didn't get the black screen anymore, so I'm committing anyway =D
This commit is contained in:
parent
5ee4fef3cb
commit
b1d38fff4a
@ -27,7 +27,7 @@ unit os_windows;
|
|||||||
interface
|
interface
|
||||||
|
|
||||||
uses
|
uses
|
||||||
Classes, SysUtils, mufasatypes, windows, graphics, LCLType, bitmaps, LCLIntf, IOManager, WinKeyInput;
|
Classes, SysUtils, mufasatypes, windows, graphics, LCLType, bitmaps, IOManager, WinKeyInput;
|
||||||
|
|
||||||
type
|
type
|
||||||
|
|
||||||
@ -88,6 +88,7 @@ interface
|
|||||||
constructor Create(DesktopHandle : HWND);
|
constructor Create(DesktopHandle : HWND);
|
||||||
function WindowRect(out Rect : TRect) : Boolean;override;
|
function WindowRect(out Rect : TRect) : Boolean;override;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
TIOManager = class(TIOManager_Abstract)
|
TIOManager = class(TIOManager_Abstract)
|
||||||
public
|
public
|
||||||
constructor Create;
|
constructor Create;
|
||||||
@ -250,7 +251,7 @@ implementation
|
|||||||
|
|
||||||
function TWindow.WindowRect(out Rect : TRect) : boolean;
|
function TWindow.WindowRect(out Rect : TRect) : boolean;
|
||||||
begin
|
begin
|
||||||
result := GetWindowRect(self.handle,rect) <> 0;
|
result := Windows.GetWindowRect(self.handle,rect);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TWindow.ReturnData(xs, ys, width, height: Integer): TRetData;
|
function TWindow.ReturnData(xs, ys, width, height: Integer): TRetData;
|
||||||
@ -262,8 +263,9 @@ implementation
|
|||||||
ValidateBuffer(w,h);
|
ValidateBuffer(w,h);
|
||||||
if (xs < 0) or (xs + width > w) or (ys < 0) or (ys + height > h) then
|
if (xs < 0) or (xs + width > w) or (ys < 0) or (ys + height > h) then
|
||||||
raise Exception.CreateFMT('TMWindow.ReturnData: The parameters passed are wrong; xs,ys %d,%d width,height %d,%d',[xs,ys,width,height]);
|
raise Exception.CreateFMT('TMWindow.ReturnData: The parameters passed are wrong; xs,ys %d,%d width,height %d,%d',[xs,ys,width,height]);
|
||||||
BitBlt(self.buffer.Canvas.Handle,0,0, width, height, self.dc, xs,ys, SRCCOPY);
|
Windows.BitBlt(self.buffer.Canvas.Handle,0,0, width, height, self.dc, xs,ys, SRCCOPY);
|
||||||
Result.Ptr:= self.buffer_raw;
|
Result.Ptr:= self.buffer_raw;
|
||||||
|
|
||||||
Result.IncPtrWith:= w - width;
|
Result.IncPtrWith:= w - width;
|
||||||
Result.RowLen:= w;
|
Result.RowLen:= w;
|
||||||
end;
|
end;
|
||||||
@ -420,6 +422,8 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function TDesktopWindow.WindowRect(out Rect : TRect) : Boolean;
|
function TDesktopWindow.WindowRect(out Rect : TRect) : Boolean;
|
||||||
begin
|
begin
|
||||||
Rect.Left:= GetSystemMetrics(SM_XVIRTUALSCREEN);
|
Rect.Left:= GetSystemMetrics(SM_XVIRTUALSCREEN);
|
||||||
|
Loading…
Reference in New Issue
Block a user