1
0
mirror of https://github.com/moparisthebest/Simba synced 2024-12-26 01:09:08 -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:
Niels 2010-04-24 21:04:39 +02:00
parent 5ee4fef3cb
commit b1d38fff4a

View File

@ -27,7 +27,7 @@ unit os_windows;
interface
uses
Classes, SysUtils, mufasatypes, windows, graphics, LCLType, bitmaps, LCLIntf, IOManager, WinKeyInput;
Classes, SysUtils, mufasatypes, windows, graphics, LCLType, bitmaps, IOManager, WinKeyInput;
type
@ -88,6 +88,7 @@ interface
constructor Create(DesktopHandle : HWND);
function WindowRect(out Rect : TRect) : Boolean;override;
end;
TIOManager = class(TIOManager_Abstract)
public
constructor Create;
@ -250,7 +251,7 @@ implementation
function TWindow.WindowRect(out Rect : TRect) : boolean;
begin
result := GetWindowRect(self.handle,rect) <> 0;
result := Windows.GetWindowRect(self.handle,rect);
end;
function TWindow.ReturnData(xs, ys, width, height: Integer): TRetData;
@ -262,8 +263,9 @@ implementation
ValidateBuffer(w,h);
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]);
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.IncPtrWith:= w - width;
Result.RowLen:= w;
end;
@ -420,6 +422,8 @@ begin
end;
function TDesktopWindow.WindowRect(out Rect : TRect) : Boolean;
begin
Rect.Left:= GetSystemMetrics(SM_XVIRTUALSCREEN);