Skip to content

Commit

Permalink
ExternalImage type, for plugins
Browse files Browse the repository at this point in the history
  • Loading branch information
ollydev committed Sep 14, 2023
1 parent 64500c9 commit 7437aac
Show file tree
Hide file tree
Showing 9 changed files with 1,275 additions and 34 deletions.
8 changes: 4 additions & 4 deletions Source/script/imports/simba/simba.import_debugimage.pas
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ implementation
(*
Show
~~~~
> procedure Show(ATPA: T2DPointArray; Color: Integer = $0000FF);
> procedure Show(ATPA: T2DPointArray);
*)

(*
Expand Down Expand Up @@ -103,7 +103,7 @@ implementation
(*
ShowOnClient
~~~~~~~~~~~~
> procedure ShowOnClient(ATPA: T2DPointArray; Color: Integer = $0000FF);
> procedure ShowOnClient(ATPA: T2DPointArray);
*)

(*
Expand Down Expand Up @@ -269,7 +269,7 @@ procedure ImportDebugImage(Compiler: TSimbaScript_Compiler);
]);

addGlobalFunc(
'procedure Show(ATPA: T2DPointArray; Color: Integer = $0000FF); overload;', [
'procedure Show(ATPA: T2DPointArray); overload;', [
'begin',
' with ATPA.Bounds() do',
' with TImage.Create(X1+X2+1, Y1+Y2+1) do',
Expand Down Expand Up @@ -363,7 +363,7 @@ procedure ImportDebugImage(Compiler: TSimbaScript_Compiler);
]);

addGlobalFunc(
'procedure ShowOnClient(ATPA: T2DPointArray; Color: Integer = $0000FF); overload;', [
'procedure ShowOnClient(ATPA: T2DPointArray); overload;', [
'begin',
' with TImage.CreateFromTarget() do',
' try',
Expand Down
15 changes: 2 additions & 13 deletions Source/script/imports/simbaclasses/simba.import_class_image.pas
Original file line number Diff line number Diff line change
Expand Up @@ -192,19 +192,9 @@ procedure _LapeImage_LoadFromFileEx(const Params: PParamArray); LAPE_WRAPPER_CAL
(*
TImage.DrawATPA
~~~~~~~~~~~~~~~
> procedure TImage.DrawATPA(ATPA: T2DPointArray);
> procedure TImage.DrawATPA(ATPA: T2DPointArray; Color: TColor = -1);
*)
procedure _LapeImage_DrawATPA(const Params: PParamArray); LAPE_WRAPPER_CALLING_CONV
begin
PSimbaImage(Params^[0])^.DrawATPA(P2DPointArray(Params^[1])^);
end;

(*
TImage.DrawATPA
~~~~~~~~~~~~~~~
> procedure TImage.DrawATPA(ATPA: T2DPointArray; Color: TColor);
*)
procedure _LapeImage_DrawATPAEx(const Params: PParamArray); LAPE_WRAPPER_CALLING_CONV
begin
PSimbaImage(Params^[0])^.DrawATPA(P2DPointArray(Params^[1])^, PColor(Params^[2])^);
end;
Expand Down Expand Up @@ -1323,8 +1313,7 @@ procedure ImportSimbaImage(Compiler: TSimbaScript_Compiler);
addGlobalFunc('procedure TImage.DrawText(Text: String; Box: TBox; Center: Boolean; Color: TColor); overload', @_LapeImage_DrawTextEx);
addGlobalFunc('procedure TImage.DrawTextLines(Text: TStringArray; Position: TPoint; Color: TColor);', @_LapeImage_DrawTextLines);

addGlobalFunc('procedure TImage.DrawATPA(ATPA: T2DPointArray); overload', @_LapeImage_DrawATPA);
addGlobalFunc('procedure TImage.DrawATPA(ATPA: T2DPointArray; Color: TColor); overload', @_LapeImage_DrawATPAEx);
addGlobalFunc('procedure TImage.DrawATPA(ATPA: T2DPointArray; Color: TColor = -1)', @_LapeImage_DrawATPA);
addGlobalFunc('procedure TImage.DrawTPA(TPA: TPointArray; Color: TColor);', @_LapeImage_DrawTPA);

addGlobalFunc('procedure TImage.DrawCrosshairs(ACenter: TPoint; Size: Integer; Thickness: Integer; Color: TColor);', @_LapeImage_DrawCrosshairs);
Expand Down
Loading

0 comments on commit 7437aac

Please sign in to comment.