Advertisement
WarPie90

Linux debug img fix

Mar 21st, 2017
474
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Delphi 0.90 KB | None | 0 0
  1. program new;
  2. {$I SRL/OSR.simba}
  3.  
  4. {$IFDEF LINUX}
  5. const LINUX_DEBUG_MINSIZE = 128;
  6.  
  7. procedure DrawBitmapDebugImg(bmp: Integer); override;
  8. var
  9.   nW,nH, W,H, x1,y1:Int32;
  10.   tmp: TMufasaBitmap;
  11. begin
  12.   GetBitmapSize(bmp, W,H);
  13.   if (W < LINUX_DEBUG_MINSIZE) or (H < LINUX_DEBUG_MINSIZE) then
  14.   begin
  15.     nW := Max(LINUX_DEBUG_MINSIZE, W);
  16.     nH := Max(LINUX_DEBUG_MINSIZE, H);
  17.  
  18.     tmp := GetMufasaBitmap(CreateBitmap(nW,nH));
  19.     tmp.ReplaceColor(0, 15790320);
  20.     x1 := Trunc(nW / 2 - W / 2);
  21.     y1 := Trunc(nH / 2 - H / 2);
  22.     FastDrawTransparent(x1, y1, bmp, tmp.GetIndex());
  23.  
  24.     Inherited(tmp.GetIndex());
  25.     tmp.Free();
  26.   end else
  27.     Inherited(bmp);
  28. end;
  29.  
  30. procedure DisplayDebugImgWindow(W,H:Int32); override;
  31. begin
  32.   Inherited(Max(LINUX_DEBUG_MINSIZE, W), Max(LINUX_DEBUG_MINSIZE, H));
  33. end;
  34. {$ENDIF}
  35.  
  36.  
  37. begin
  38.   GetMufasaBitmap(BitmapFromClient(Box(0,0,54,216))).Debug();
  39. end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement