mirror of
https://github.com/moparisthebest/Simba
synced 2024-11-29 04:22:16 -05:00
PascalScript worked like shit with StdCall, so for now I've made a macro to define the calling convention:
Define PS_StdCall to use StdCall. git-svn-id: http://www.villavu.com/repositories/merlijn/mufasa@479 3f818213-9676-44b0-a9b4-5e4c4e03d09d
This commit is contained in:
parent
ce03a57713
commit
b2a6b0e15c
@ -20,42 +20,42 @@
|
|||||||
|
|
||||||
Bitmap.inc for the Mufasa Macro Library
|
Bitmap.inc for the Mufasa Macro Library
|
||||||
}
|
}
|
||||||
function CreateBitmapString(bmp : integer) : string; stdcall;
|
function CreateBitmapString(bmp : integer) : string; ps_decl;
|
||||||
begin;
|
begin;
|
||||||
result := CurrThread.Client.MBitmaps[bmp].ToString;
|
result := CurrThread.Client.MBitmaps[bmp].ToString;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function GetMufasaBitmap(bmp : integer): TMufasaBitmap; stdcall;
|
function GetMufasaBitmap(bmp : integer): TMufasaBitmap; ps_decl;
|
||||||
begin;
|
begin;
|
||||||
result := CurrThread.Client.MBitmaps[bmp];
|
result := CurrThread.Client.MBitmaps[bmp];
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function CreateBitmap(w,h : integer):integer; stdcall;
|
function CreateBitmap(w,h : integer):integer; ps_decl;
|
||||||
begin
|
begin
|
||||||
result := CurrThread.Client.MBitmaps.CreateBMP(w,h);
|
result := CurrThread.Client.MBitmaps.CreateBMP(w,h);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure FreeBitmap(Number : integer); stdcall;
|
procedure FreeBitmap(Number : integer); ps_decl;
|
||||||
begin
|
begin
|
||||||
CurrThread.Client.MBitmaps.FreeBMP(Number);
|
CurrThread.Client.MBitmaps.FreeBMP(Number);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure SaveBitmap(Bmp : integer; path : string); stdcall;
|
procedure SaveBitmap(Bmp : integer; path : string); ps_decl;
|
||||||
begin;
|
begin;
|
||||||
CurrThread.Client.MBitmaps[Bmp].SaveToFile(Path);
|
CurrThread.Client.MBitmaps[Bmp].SaveToFile(Path);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function BitmapFromString(Width,height : integer; Data : string) : integer; stdcall;
|
function BitmapFromString(Width,height : integer; Data : string) : integer; ps_decl;
|
||||||
begin;
|
begin;
|
||||||
Result := CurrThread.Client.MBitmaps.CreateBMPFromString(Width,Height,Data);
|
Result := CurrThread.Client.MBitmaps.CreateBMPFromString(Width,Height,Data);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function LoadBitmap(Path : String) : integer; stdcall;
|
function LoadBitmap(Path : String) : integer; ps_decl;
|
||||||
begin;
|
begin;
|
||||||
Result := CurrThread.Client.MBitmaps.CreateBMPFromFile(Path);
|
Result := CurrThread.Client.MBitmaps.CreateBMPFromFile(Path);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure SetBitmapSize(Bmp,NewW,NewH : integer); stdcall;
|
procedure SetBitmapSize(Bmp,NewW,NewH : integer); ps_decl;
|
||||||
begin;
|
begin;
|
||||||
if (NewW>=0) and (NewH >=0) then
|
if (NewW>=0) and (NewH >=0) then
|
||||||
CurrThread.Client.MBitmaps[Bmp].SetSize(NewW,NewH)
|
CurrThread.Client.MBitmaps[Bmp].SetSize(NewW,NewH)
|
||||||
@ -63,7 +63,7 @@ begin;
|
|||||||
raise exception.createfmt('Wrong Width or Height in SetBitmapSize: (%d,%d)',[NewW,NewH]);
|
raise exception.createfmt('Wrong Width or Height in SetBitmapSize: (%d,%d)',[NewW,NewH]);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure StretchBitmapResize(Bmp,NewW,NewH : integer); stdcall;
|
procedure StretchBitmapResize(Bmp,NewW,NewH : integer); ps_decl;
|
||||||
begin;
|
begin;
|
||||||
if (NewW>=0) and (NewH >=0) then
|
if (NewW>=0) and (NewH >=0) then
|
||||||
CurrThread.Client.MBitmaps[Bmp].StretchResize(NewW,NewH)
|
CurrThread.Client.MBitmaps[Bmp].StretchResize(NewW,NewH)
|
||||||
@ -71,7 +71,7 @@ begin;
|
|||||||
raise exception.createfmt('Wrong Width or Height in ScretchResize: (%d,%d)',[NewW,NewH]);
|
raise exception.createfmt('Wrong Width or Height in ScretchResize: (%d,%d)',[NewW,NewH]);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure GetBitmapSize(Bmp : integer; out BmpW,BmpH : integer); stdcall;
|
procedure GetBitmapSize(Bmp : integer; out BmpW,BmpH : integer); ps_decl;
|
||||||
begin;
|
begin;
|
||||||
With CurrThread.Client.MBitmaps[bmp] do
|
With CurrThread.Client.MBitmaps[bmp] do
|
||||||
begin;
|
begin;
|
||||||
@ -80,129 +80,129 @@ begin;
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure SetBitmapName(Bmp : integer; name : string); stdcall;
|
procedure SetBitmapName(Bmp : integer; name : string); ps_decl;
|
||||||
begin;
|
begin;
|
||||||
CurrThread.Client.MBitmaps[Bmp].BmpName:= name;
|
CurrThread.Client.MBitmaps[Bmp].BmpName:= name;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function CreateMirroredBitmap(Bmp : integer) : integer; stdcall;
|
function CreateMirroredBitmap(Bmp : integer) : integer; ps_decl;
|
||||||
begin;
|
begin;
|
||||||
Result := CurrThread.Client.MBitmaps.CreateMirroredBitmap(Bmp, MirrorWidth);
|
Result := CurrThread.Client.MBitmaps.CreateMirroredBitmap(Bmp, MirrorWidth);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function CreateMirroredBitmapEx(Bmp : integer; MirrorStyle : TBmpMirrorStyle) : integer; stdcall;
|
function CreateMirroredBitmapEx(Bmp : integer; MirrorStyle : TBmpMirrorStyle) : integer; ps_decl;
|
||||||
begin;
|
begin;
|
||||||
Result := CurrThread.Client.MBitmaps.CreateMirroredBitmap(Bmp,MirrorStyle);
|
Result := CurrThread.Client.MBitmaps.CreateMirroredBitmap(Bmp,MirrorStyle);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function FastGetPixel(bmp,x,y : integer) : LongWord; stdcall;
|
function FastGetPixel(bmp,x,y : integer) : LongWord; ps_decl;
|
||||||
begin;
|
begin;
|
||||||
Result := CurrThread.Client.MBitmaps[Bmp].FastGetPixel(x,y);
|
Result := CurrThread.Client.MBitmaps[Bmp].FastGetPixel(x,y);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function FastGetPixels(bmp : integer; TPA : TPointArray) : TIntegerArray; stdcall;
|
function FastGetPixels(bmp : integer; TPA : TPointArray) : TIntegerArray; ps_decl;
|
||||||
begin;
|
begin;
|
||||||
result := CurrThread.Client.MBitmaps[Bmp].FastGetPixels(TPA);
|
result := CurrThread.Client.MBitmaps[Bmp].FastGetPixels(TPA);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure FastSetPixel(Bmp,x,y : integer; Color : TColor); stdcall;
|
procedure FastSetPixel(Bmp,x,y : integer; Color : TColor); ps_decl;
|
||||||
begin
|
begin
|
||||||
CurrThread.Client.MBitmaps[bmp].FastSetPixel(x,y,color);
|
CurrThread.Client.MBitmaps[bmp].FastSetPixel(x,y,color);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure FastSetPixels(Bmp : integer; TPA : TPointArray; Colors : TIntegerArray); stdcall;
|
procedure FastSetPixels(Bmp : integer; TPA : TPointArray; Colors : TIntegerArray); ps_decl;
|
||||||
begin;
|
begin;
|
||||||
CurrThread.Client.MBitmaps[Bmp].FastSetPixels(TPA,Colors);
|
CurrThread.Client.MBitmaps[Bmp].FastSetPixels(TPA,Colors);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure DrawTPABitmap(bitmap : integer; TPA : TPointArray; Color : integer); stdcall;
|
procedure DrawTPABitmap(bitmap : integer; TPA : TPointArray; Color : integer); ps_decl;
|
||||||
begin
|
begin
|
||||||
CurrThread.Client.MBitmaps[Bitmap].DrawTPA(TPA,Color);
|
CurrThread.Client.MBitmaps[Bitmap].DrawTPA(TPA,Color);
|
||||||
end;
|
end;
|
||||||
procedure DrawATPABitmap(bitmap : integer; ATPA : T2DPointArray); stdcall;
|
procedure DrawATPABitmap(bitmap : integer; ATPA : T2DPointArray); ps_decl;
|
||||||
begin
|
begin
|
||||||
CurrThread.Client.MBitmaps[bitmap].DrawATPA(ATPA);
|
CurrThread.Client.MBitmaps[bitmap].DrawATPA(ATPA);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure DrawATPABitmapEx(bitmap : integer; ATPA : T2DPointArray; Colors : TIntegerArray); stdcall;
|
procedure DrawATPABitmapEx(bitmap : integer; ATPA : T2DPointArray; Colors : TIntegerArray); ps_decl;
|
||||||
begin
|
begin
|
||||||
CurrThread.Client.MBitmaps[bitmap].DrawATPA(ATPA,Colors);
|
CurrThread.Client.MBitmaps[bitmap].DrawATPA(ATPA,Colors);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure FastDrawClear(bmp : integer; Color : TColor); stdcall;
|
procedure FastDrawClear(bmp : integer; Color : TColor); ps_decl;
|
||||||
begin;
|
begin;
|
||||||
CurrThread.Client.MBitmaps[bmp].FastDrawClear(Color);
|
CurrThread.Client.MBitmaps[bmp].FastDrawClear(Color);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure FastDrawTransparent(x, y: Integer; SourceBitmap, TargetBitmap: Integer); stdcall;
|
procedure FastDrawTransparent(x, y: Integer; SourceBitmap, TargetBitmap: Integer); ps_decl;
|
||||||
begin;
|
begin;
|
||||||
CurrThread.Client.MBitmaps[SourceBitmap].FastDrawTransparent(x,y,CurrThread.Client.MBitmaps[TargetBitmap]);
|
CurrThread.Client.MBitmaps[SourceBitmap].FastDrawTransparent(x,y,CurrThread.Client.MBitmaps[TargetBitmap]);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure SetTransparentColor(Bmp : integer; Color : TColor); stdcall;
|
procedure SetTransparentColor(Bmp : integer; Color : TColor); ps_decl;
|
||||||
begin
|
begin
|
||||||
CurrThread.Client.MBitmaps[Bmp].SetTransparentColor(Color);
|
CurrThread.Client.MBitmaps[Bmp].SetTransparentColor(Color);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function GetTransparentColor(Bmp : integer) : TColor; stdcall;
|
function GetTransparentColor(Bmp : integer) : TColor; ps_decl;
|
||||||
begin;
|
begin;
|
||||||
Result := CurrThread.Client.MBitmaps[bmp].GetTransparentColor;
|
Result := CurrThread.Client.MBitmaps[bmp].GetTransparentColor;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure FastReplaceColor(bmp: Integer; OldColor, NewColor: TColor); stdcall;
|
procedure FastReplaceColor(bmp: Integer; OldColor, NewColor: TColor); ps_decl;
|
||||||
begin
|
begin
|
||||||
CurrThread.Client.MBitmaps[Bmp].FastReplaceColor(OldColor,NewColor);
|
CurrThread.Client.MBitmaps[Bmp].FastReplaceColor(OldColor,NewColor);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure ps_CopyClientToBitmap(bmp, xs, ys, xe, ye: Integer); stdcall;
|
procedure ps_CopyClientToBitmap(bmp, xs, ys, xe, ye: Integer); ps_decl;
|
||||||
begin
|
begin
|
||||||
CurrThread.Client.MBitmaps.GetBMP(bmp).CopyClientToBitmap(CurrThread.Client.IOManager, True, xs, ys, xe, ye);
|
CurrThread.Client.MBitmaps.GetBMP(bmp).CopyClientToBitmap(CurrThread.Client.IOManager, True, xs, ys, xe, ye);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function BitmapFromClient(const xs, ys, xe, ye: Integer): Integer; stdcall;
|
function BitmapFromClient(const xs, ys, xe, ye: Integer): Integer; ps_decl;
|
||||||
begin;
|
begin;
|
||||||
result := CurrThread.Client.MBitmaps.CreateBMP(0,0);
|
result := CurrThread.Client.MBitmaps.CreateBMP(0,0);
|
||||||
CurrThread.Client.MBitmaps[result].CopyClientToBitmap(CurrThread.Client.IOManager,True,xs,ys,xe,ye);
|
CurrThread.Client.MBitmaps[result].CopyClientToBitmap(CurrThread.Client.IOManager,True,xs,ys,xe,ye);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function FindBitmap(Bitmap: integer; out x, y: Integer): Boolean; stdcall;
|
function FindBitmap(Bitmap: integer; out x, y: Integer): Boolean; ps_decl;
|
||||||
begin;
|
begin;
|
||||||
with CurrThread.Client do
|
with CurrThread.Client do
|
||||||
result := MFinder.FindBitmap( MBitmaps[bitmap],x,y);
|
result := MFinder.FindBitmap( MBitmaps[bitmap],x,y);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function FindBitmapIn(bitmap: integer; out x, y: Integer; xs, ys, xe, ye: Integer): Boolean; stdcall;
|
function FindBitmapIn(bitmap: integer; out x, y: Integer; xs, ys, xe, ye: Integer): Boolean; ps_decl;
|
||||||
begin;
|
begin;
|
||||||
with CurrThread.Client do
|
with CurrThread.Client do
|
||||||
result := MFinder.FindBitmapIn( MBitmaps[bitmap],x,y,xs,ys,xe,ye);
|
result := MFinder.FindBitmapIn( MBitmaps[bitmap],x,y,xs,ys,xe,ye);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function FindBitmapToleranceIn(bitmap: integer; out x, y: Integer; xs, ys, xe, ye: Integer; tolerance: Integer): Boolean; stdcall;
|
function FindBitmapToleranceIn(bitmap: integer; out x, y: Integer; xs, ys, xe, ye: Integer; tolerance: Integer): Boolean; ps_decl;
|
||||||
begin;
|
begin;
|
||||||
with CurrThread.Client do
|
with CurrThread.Client do
|
||||||
result := MFinder.FindBitmapToleranceIn( MBitmaps[bitmap],x,y,xs,ys,xe,ye,tolerance);
|
result := MFinder.FindBitmapToleranceIn( MBitmaps[bitmap],x,y,xs,ys,xe,ye,tolerance);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
function FindBitmapSpiral(bitmap: Integer; var x, y: Integer; xs, ys, xe, ye: Integer): Boolean; stdcall;
|
function FindBitmapSpiral(bitmap: Integer; var x, y: Integer; xs, ys, xe, ye: Integer): Boolean; ps_decl;
|
||||||
begin;
|
begin;
|
||||||
with CurrThread.Client do
|
with CurrThread.Client do
|
||||||
result := MFinder.FindBitmapSpiral(Mbitmaps[bitmap],x,y,xs,ys,xe,ye);
|
result := MFinder.FindBitmapSpiral(Mbitmaps[bitmap],x,y,xs,ys,xe,ye);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function FindBitmapsSpiralTolerance(bitmap: integer; x, y: Integer; out Points : TPointArray; xs, ys, xe, ye,tolerance: Integer): Boolean; stdcall;
|
function FindBitmapsSpiralTolerance(bitmap: integer; x, y: Integer; out Points : TPointArray; xs, ys, xe, ye,tolerance: Integer): Boolean; ps_decl;
|
||||||
begin;
|
begin;
|
||||||
with CurrThread.Client do
|
with CurrThread.Client do
|
||||||
result := MFinder.FindBitmapsSpiralTolerance(MBitmaps[bitmap],x,y,points,xs,ys,xe,ye,tolerance);
|
result := MFinder.FindBitmapsSpiralTolerance(MBitmaps[bitmap],x,y,points,xs,ys,xe,ye,tolerance);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function FindBitmapSpiralTolerance(bitmap: integer; var x, y: Integer; xs, ys, xe, ye,tolerance : integer): Boolean; stdcall;
|
function FindBitmapSpiralTolerance(bitmap: integer; var x, y: Integer; xs, ys, xe, ye,tolerance : integer): Boolean; ps_decl;
|
||||||
begin;
|
begin;
|
||||||
with CurrThread.Client do
|
with CurrThread.Client do
|
||||||
result := MFinder.FindBitmapSpiralTolerance(MBitmaps[bitmap],x,y,xs,ys,xe,ye,tolerance);
|
result := MFinder.FindBitmapSpiralTolerance(MBitmaps[bitmap],x,y,xs,ys,xe,ye,tolerance);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function RotateBitmap(bitmap: Integer; angle: Extended): Integer; stdcall;
|
function RotateBitmap(bitmap: Integer; angle: Extended): Integer; ps_decl;
|
||||||
begin;
|
begin;
|
||||||
with CurrThread.Client.MBitmaps do
|
with CurrThread.Client.MBitmaps do
|
||||||
begin;
|
begin;
|
||||||
@ -211,7 +211,7 @@ begin;
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function Desaturate(Bitmap : integer) : integer; stdcall;
|
function Desaturate(Bitmap : integer) : integer; ps_decl;
|
||||||
begin;
|
begin;
|
||||||
with CurrThread.Client.MBitmaps do
|
with CurrThread.Client.MBitmaps do
|
||||||
begin;
|
begin;
|
||||||
@ -219,15 +219,15 @@ begin;
|
|||||||
Bmp[Bitmap].Desaturate(Bmp[result]);
|
Bmp[Bitmap].Desaturate(Bmp[result]);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
procedure InvertBitmap(Bitmap : integer); stdcall;
|
procedure InvertBitmap(Bitmap : integer); ps_decl;
|
||||||
begin;
|
begin;
|
||||||
CurrThread.Client.MBitmaps[Bitmap].Invert;
|
CurrThread.Client.MBitmaps[Bitmap].Invert;
|
||||||
end;
|
end;
|
||||||
function CopyBitmap(Bitmap : integer) : integer; stdcall;
|
function CopyBitmap(Bitmap : integer) : integer; ps_decl;
|
||||||
begin;
|
begin;
|
||||||
result := Currthread.Client.MBitmaps.CopyBMP(bitmap);
|
result := Currthread.Client.MBitmaps.CopyBMP(bitmap);
|
||||||
end;
|
end;
|
||||||
function GreyScaleBitmap(Bitmap : integer) : integer; stdcall;
|
function GreyScaleBitmap(Bitmap : integer) : integer; ps_decl;
|
||||||
begin;
|
begin;
|
||||||
with CurrThread.Client.MBitmaps do
|
with CurrThread.Client.MBitmaps do
|
||||||
begin;
|
begin;
|
||||||
@ -235,7 +235,7 @@ begin;
|
|||||||
Bmp[Bitmap].GreyScale(Bmp[result]);
|
Bmp[Bitmap].GreyScale(Bmp[result]);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
function BrightnessBitmap(Bitmap,br : integer) : integer; stdcall;
|
function BrightnessBitmap(Bitmap,br : integer) : integer; ps_decl;
|
||||||
begin;
|
begin;
|
||||||
with CurrThread.Client.MBitmaps do
|
with CurrThread.Client.MBitmaps do
|
||||||
begin;
|
begin;
|
||||||
@ -243,7 +243,7 @@ begin;
|
|||||||
Bmp[Bitmap].Brightness(Bmp[result],br);
|
Bmp[Bitmap].Brightness(Bmp[result],br);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
function ContrastBitmap(bitmap : integer; co : extended) : integer; stdcall;
|
function ContrastBitmap(bitmap : integer; co : extended) : integer; ps_decl;
|
||||||
begin;
|
begin;
|
||||||
with CurrThread.Client.MBitmaps do
|
with CurrThread.Client.MBitmaps do
|
||||||
begin;
|
begin;
|
||||||
@ -252,7 +252,7 @@ begin;
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function PosterizeBitmap(Bitmap : integer; po : integer) : integer; stdcall;
|
function PosterizeBitmap(Bitmap : integer; po : integer) : integer; ps_decl;
|
||||||
begin;
|
begin;
|
||||||
with CurrThread.Client.MBitmaps do
|
with CurrThread.Client.MBitmaps do
|
||||||
begin
|
begin
|
||||||
@ -260,16 +260,16 @@ begin;
|
|||||||
Bmp[bitmap].Posterize(Bmp[result],po);
|
Bmp[bitmap].Posterize(Bmp[result],po);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
function CreateMaskFromBitmap(Bitmap : integer) : TMask; stdcall;
|
function CreateMaskFromBitmap(Bitmap : integer) : TMask; ps_decl;
|
||||||
begin;
|
begin;
|
||||||
result := CurrThread.Client.MBitmaps[Bitmap].CreateTMask;
|
result := CurrThread.Client.MBitmaps[Bitmap].CreateTMask;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function FindMaskTolerance(mask: TMask; out x, y: Integer; xs,ys, xe, ye: Integer; Tolerance, ContourTolerance: Integer): Boolean; stdcall;
|
function FindMaskTolerance(mask: TMask; out x, y: Integer; xs,ys, xe, ye: Integer; Tolerance, ContourTolerance: Integer): Boolean; ps_decl;
|
||||||
begin;
|
begin;
|
||||||
result := CurrThread.Client.MFinder.FindMaskTolerance(Mask,x,y,xs,ys,xe,ye,tolerance,contourtolerance);
|
result := CurrThread.Client.MFinder.FindMaskTolerance(Mask,x,y,xs,ys,xe,ye,tolerance,contourtolerance);
|
||||||
end;
|
end;
|
||||||
function FindBitmapMaskTolerance(mask: Integer; out x, y: Integer; xs, ys, xe, ye: Integer; Tolerance, ContourTolerance: Integer): Boolean; stdcall;
|
function FindBitmapMaskTolerance(mask: Integer; out x, y: Integer; xs, ys, xe, ye: Integer; Tolerance, ContourTolerance: Integer): Boolean; ps_decl;
|
||||||
begin;
|
begin;
|
||||||
psWriteln('Better be using FindMaskTolerance in combination with CreateMaskFromBitmap, more efficient.');
|
psWriteln('Better be using FindMaskTolerance in combination with CreateMaskFromBitmap, more efficient.');
|
||||||
with CurrThread.Client do
|
with CurrThread.Client do
|
||||||
@ -278,7 +278,7 @@ end;
|
|||||||
|
|
||||||
function FindDeformedBitmapToleranceIn(bitmap: integer; out x,
|
function FindDeformedBitmapToleranceIn(bitmap: integer; out x,
|
||||||
y: Integer; xs, ys, xe, ye: Integer; tolerance: Integer; Range: Integer;
|
y: Integer; xs, ys, xe, ye: Integer; tolerance: Integer; Range: Integer;
|
||||||
AllowPartialAccuracy: Boolean; out accuracy: Extended): Boolean; stdcall;
|
AllowPartialAccuracy: Boolean; out accuracy: Extended): Boolean; ps_decl;
|
||||||
begin;
|
begin;
|
||||||
result := CurrThread.Client.MFinder.FindDeformedBitmapToleranceIn(CurrThread.Client.MBitmaps[Bitmap],x,y,xs,ys,xe,ye,tolerance,range,AllowPartialAccuracy,accuracy);
|
result := CurrThread.Client.MFinder.FindDeformedBitmapToleranceIn(CurrThread.Client.MBitmaps[Bitmap],x,y,xs,ys,xe,ye,tolerance,range,AllowPartialAccuracy,accuracy);
|
||||||
end;
|
end;
|
||||||
|
@ -21,94 +21,94 @@
|
|||||||
Colour.inc for the Mufasa Macro Library
|
Colour.inc for the Mufasa Macro Library
|
||||||
}
|
}
|
||||||
|
|
||||||
function GetColor(x,y : integer) : TColor; stdcall;
|
function GetColor(x,y : integer) : TColor; ps_decl;
|
||||||
begin;
|
begin;
|
||||||
Result := CurrThread.Client.IOManager.GetColor(x,y);
|
Result := CurrThread.Client.IOManager.GetColor(x,y);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function GetColors(Coords : TPointArray) : TIntegerArray; stdcall;
|
function GetColors(Coords : TPointArray) : TIntegerArray; ps_decl;
|
||||||
begin
|
begin
|
||||||
result := CurrThread.Client.MFinder.GetColors(coords);
|
result := CurrThread.Client.MFinder.GetColors(coords);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function findcolor(out x, y: integer; color, x1, y1, x2, y2: integer): boolean; stdcall;
|
function findcolor(out x, y: integer; color, x1, y1, x2, y2: integer): boolean; ps_decl;
|
||||||
begin
|
begin
|
||||||
Result := CurrThread.Client.MFinder.FindColor(x, y, color, x1, y1, x2, y2);
|
Result := CurrThread.Client.MFinder.FindColor(x, y, color, x1, y1, x2, y2);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function findcolortoleranceOptimised(out x, y: integer; color, x1, y1, x2, y2, tol: integer): boolean; stdcall;
|
function findcolortoleranceOptimised(out x, y: integer; color, x1, y1, x2, y2, tol: integer): boolean; ps_decl;
|
||||||
begin
|
begin
|
||||||
Result := CurrThread.Client.MFinder.FindColorToleranceOptimised(x, y, color, x1, y1, x2, y2, tol);
|
Result := CurrThread.Client.MFinder.FindColorToleranceOptimised(x, y, color, x1, y1, x2, y2, tol);
|
||||||
end;
|
end;
|
||||||
function findcolortolerance(out x, y: integer; color, x1, y1, x2, y2, tol: integer): boolean; stdcall;
|
function findcolortolerance(out x, y: integer; color, x1, y1, x2, y2, tol: integer): boolean; ps_decl;
|
||||||
begin
|
begin
|
||||||
Result := CurrThread.Client.MFinder.FindColorTolerance(x, y, color, x1, y1, x2, y2, tol);
|
Result := CurrThread.Client.MFinder.FindColorTolerance(x, y, color, x1, y1, x2, y2, tol);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function FindColors(out TPA: TPointArray; Color, x1, y1, x2, y2: Integer): Boolean; stdcall;
|
function FindColors(out TPA: TPointArray; Color, x1, y1, x2, y2: Integer): Boolean; ps_decl;
|
||||||
begin
|
begin
|
||||||
Result := CurrThread.Client.MFinder.FindColors(TPA, color, x1, y1, x2, y2);
|
Result := CurrThread.Client.MFinder.FindColors(TPA, color, x1, y1, x2, y2);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure SetColorToleranceSpeed(cts: Integer); stdcall;
|
procedure SetColorToleranceSpeed(cts: Integer); ps_decl;
|
||||||
begin
|
begin
|
||||||
CurrThread.Client.MFinder.SetToleranceSpeed(cts);
|
CurrThread.Client.MFinder.SetToleranceSpeed(cts);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function GetToleranceSpeed: Integer; stdcall;
|
function GetToleranceSpeed: Integer; ps_decl;
|
||||||
begin
|
begin
|
||||||
CurrThread.Client.MFinder.GetToleranceSpeed;
|
CurrThread.Client.MFinder.GetToleranceSpeed;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure SetToleranceSpeed2Modifiers(nHue, nSat: Extended); stdcall;
|
procedure SetToleranceSpeed2Modifiers(nHue, nSat: Extended); ps_decl;
|
||||||
begin
|
begin
|
||||||
CurrThread.Client.MFinder.SetToleranceSpeed2Modifiers(nHue, nSat);
|
CurrThread.Client.MFinder.SetToleranceSpeed2Modifiers(nHue, nSat);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure GetToleranceSpeed2Modifiers(out hMod, sMod: Extended); stdcall;
|
procedure GetToleranceSpeed2Modifiers(out hMod, sMod: Extended); ps_decl;
|
||||||
begin
|
begin
|
||||||
CurrThread.Client.MFinder.GetToleranceSpeed2Modifiers(hMod, sMod);
|
CurrThread.Client.MFinder.GetToleranceSpeed2Modifiers(hMod, sMod);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function SimilarColors(Col1,Col2,Tol : integer) : boolean; stdcall;
|
function SimilarColors(Col1,Col2,Tol : integer) : boolean; ps_decl;
|
||||||
begin;
|
begin;
|
||||||
Result := CurrThread.Client.MFinder.SimilarColors(Col1,Col2,Tol);
|
Result := CurrThread.Client.MFinder.SimilarColors(Col1,Col2,Tol);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function CountColor(Color, xs, ys, xe, ye: Integer): Integer; stdcall;
|
function CountColor(Color, xs, ys, xe, ye: Integer): Integer; ps_decl;
|
||||||
begin;
|
begin;
|
||||||
result := CurrThread.Client.MFinder.CountColor(color,xs,ys,xe,ye);
|
result := CurrThread.Client.MFinder.CountColor(color,xs,ys,xe,ye);
|
||||||
end;
|
end;
|
||||||
function CountColorTolerance(Color, xs, ys, xe, ye, Tolerance: Integer): Integer; stdcall;
|
function CountColorTolerance(Color, xs, ys, xe, ye, Tolerance: Integer): Integer; ps_decl;
|
||||||
begin;
|
begin;
|
||||||
result := CurrThread.Client.MFinder.CountColorTolerance(color,xs,ys,xe,ye,tolerance);
|
result := CurrThread.Client.MFinder.CountColorTolerance(color,xs,ys,xe,ye,tolerance);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function FindColorsToleranceOptimised(out Points: TPointArray; Color, xs, ys, xe, ye, Tolerance: Integer): Boolean; stdcall;
|
function FindColorsToleranceOptimised(out Points: TPointArray; Color, xs, ys, xe, ye, Tolerance: Integer): Boolean; ps_decl;
|
||||||
begin;
|
begin;
|
||||||
result := CurrThread.Client.MFinder.FindColorsToleranceOptimised(points,color,xs,ys,xe,ye,tolerance);
|
result := CurrThread.Client.MFinder.FindColorsToleranceOptimised(points,color,xs,ys,xe,ye,tolerance);
|
||||||
end;
|
end;
|
||||||
function FindColorsTolerance(out Points: TPointArray; Color, xs, ys, xe, ye, Tolerance: Integer): Boolean; stdcall;
|
function FindColorsTolerance(out Points: TPointArray; Color, xs, ys, xe, ye, Tolerance: Integer): Boolean; ps_decl;
|
||||||
begin;
|
begin;
|
||||||
result := CurrThread.Client.MFinder.FindColorsTolerance(points,color,xs,ys,xe,ye,tolerance);
|
result := CurrThread.Client.MFinder.FindColorsTolerance(points,color,xs,ys,xe,ye,tolerance);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function FindColorSpiral(var x, y: Integer; color, xs, ys, xe, ye: Integer): Boolean; stdcall;
|
function FindColorSpiral(var x, y: Integer; color, xs, ys, xe, ye: Integer): Boolean; ps_decl;
|
||||||
begin;
|
begin;
|
||||||
result := CurrThread.Client.MFinder.FindColorSpiral(x,y,color,xs,ys,xe,ye);
|
result := CurrThread.Client.MFinder.FindColorSpiral(x,y,color,xs,ys,xe,ye);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function FindColorsSpiralTolerance(x, y: Integer; out Points: TPointArray; color, xs, ys, xe, ye: Integer; Tolerance: Integer) : boolean; stdcall;
|
function FindColorsSpiralTolerance(x, y: Integer; out Points: TPointArray; color, xs, ys, xe, ye: Integer; Tolerance: Integer) : boolean; ps_decl;
|
||||||
begin;
|
begin;
|
||||||
result := CurrThread.Client.MFinder.FindColorsSpiralTolerance(x,y,Points,color,xs,ys,xe,ye,tolerance);
|
result := CurrThread.Client.MFinder.FindColorsSpiralTolerance(x,y,Points,color,xs,ys,xe,ye,tolerance);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function FindColoredArea(var x, y: Integer; color, xs, ys, xe, ye: Integer; MinArea: Integer): Boolean; stdcall;
|
function FindColoredArea(var x, y: Integer; color, xs, ys, xe, ye: Integer; MinArea: Integer): Boolean; ps_decl;
|
||||||
begin;
|
begin;
|
||||||
result := CurrThread.Client.MFinder.FindColoredArea(x,y,color,xs,ys,xe,ye,minarea);
|
result := CurrThread.Client.MFinder.FindColoredArea(x,y,color,xs,ys,xe,ye,minarea);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function FindColoredAreaTolerance(var x, y: Integer; Color, xs, ys, xe, ye, MinArea, tol: Integer): Boolean; stdcall;
|
function FindColoredAreaTolerance(var x, y: Integer; Color, xs, ys, xe, ye, MinArea, tol: Integer): Boolean; ps_decl;
|
||||||
begin;
|
begin;
|
||||||
result := CurrThread.Client.MFinder.FindColoredAreaTolerance(x,y,color,xs,ys,xe,ye,minarea,tol);
|
result := CurrThread.Client.MFinder.FindColoredAreaTolerance(x,y,color,xs,ys,xe,ye,minarea,tol);
|
||||||
end;
|
end;
|
||||||
|
@ -21,7 +21,7 @@
|
|||||||
DTM.inc for the Mufasa Macro Library
|
DTM.inc for the Mufasa Macro Library
|
||||||
}
|
}
|
||||||
|
|
||||||
function ps_FindDTM(DTM: Integer; out x, y: Integer; x1, y1, x2, y2: Integer): Boolean; stdcall;
|
function ps_FindDTM(DTM: Integer; out x, y: Integer; x1, y1, x2, y2: Integer): Boolean; ps_decl;
|
||||||
var
|
var
|
||||||
temp: pDTM;
|
temp: pDTM;
|
||||||
begin
|
begin
|
||||||
@ -35,7 +35,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function ps_FindDTMs(DTM: Integer; out p: TPointArray; x1, y1, x2, y2: Integer): Boolean; stdcall;
|
function ps_FindDTMs(DTM: Integer; out p: TPointArray; x1, y1, x2, y2: Integer): Boolean; ps_decl;
|
||||||
var
|
var
|
||||||
temp: pDTM;
|
temp: pDTM;
|
||||||
begin
|
begin
|
||||||
@ -50,7 +50,7 @@ end;
|
|||||||
|
|
||||||
function ps_FindDTMRotated(DTM: Integer; out x, y: Integer; x1, y1, x2, y2:
|
function ps_FindDTMRotated(DTM: Integer; out x, y: Integer; x1, y1, x2, y2:
|
||||||
Integer; sAngle, eAngle, aStep: Extended;
|
Integer; sAngle, eAngle, aStep: Extended;
|
||||||
out aFound: Extended): Boolean; stdcall;
|
out aFound: Extended): Boolean; ps_decl;
|
||||||
var
|
var
|
||||||
temp: pDTM;
|
temp: pDTM;
|
||||||
begin
|
begin
|
||||||
@ -64,7 +64,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function ps_FindDTMsRotated(DTM: Integer; out Points: TPointArray; x1, y1, x2, y2: Integer; sAngle, eAngle, aStep: Extended; out aFound: T2DExtendedArray): Boolean; stdcall;
|
function ps_FindDTMsRotated(DTM: Integer; out Points: TPointArray; x1, y1, x2, y2: Integer; sAngle, eAngle, aStep: Extended; out aFound: T2DExtendedArray): Boolean; ps_decl;
|
||||||
var
|
var
|
||||||
temp: pDTM;
|
temp: pDTM;
|
||||||
begin
|
begin
|
||||||
@ -75,7 +75,7 @@ begin
|
|||||||
Result := False;
|
Result := False;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{function ps_FindDTMsRotated(DTM: Integer; out Points: TPointArray; x1, stdcall;
|
{function ps_FindDTMsRotated(DTM: Integer; out Points: TPointArray; x1, ps_decl;
|
||||||
y1, x2, y2: Integer; sAngle, eAngle,
|
y1, x2, y2: Integer; sAngle, eAngle,
|
||||||
aStep: Extended; out aFound: T2DExtendedArray)
|
aStep: Extended; out aFound: T2DExtendedArray)
|
||||||
: Boolean;
|
: Boolean;
|
||||||
@ -84,7 +84,7 @@ begin
|
|||||||
sAngle, eAngle, aStep, aFound);
|
sAngle, eAngle, aStep, aFound);
|
||||||
end; }
|
end; }
|
||||||
|
|
||||||
function ps_DTMFromString(DTMString: String): Integer; stdcall;
|
function ps_DTMFromString(DTMString: String): Integer; ps_decl;
|
||||||
var
|
var
|
||||||
dtm: pDTM;
|
dtm: pDTM;
|
||||||
begin
|
begin
|
||||||
@ -95,22 +95,28 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure ps_FreeDTM(DTM: Integer); stdcall;
|
procedure ps_FreeDTM(DTM: Integer); ps_decl;
|
||||||
begin
|
begin
|
||||||
CurrThread.Client.MDTM.FreeDTM(DTM);
|
CurrThread.Client.MDTM.FreeDTM(DTM);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function ps_GetDTM(index: Integer; out dtm: pDTM): Boolean; stdcall;
|
function ps_GetDTM(index: Integer; out dtm: pDTM): Boolean; ps_decl;
|
||||||
begin
|
begin
|
||||||
Result := CurrThread.Client.MDTM.GetDTM(index, dtm);
|
Result := CurrThread.Client.MDTM.GetDTM(index, dtm);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function ps_AddDTM(d: TDTM): Integer; stdcall;
|
function ps_AddDTM(d: TDTM): Integer; ps_decl;
|
||||||
begin
|
begin
|
||||||
Result := CurrThread.Client.MDTM.AddDTM(d);
|
Result := CurrThread.Client.MDTM.AddDTM(d);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function ps_AddpDTM(d: pDTM): Integer; stdcall;
|
function ps_AddpDTM(d: pDTM): Integer; ps_decl;
|
||||||
begin
|
begin
|
||||||
Result := CurrThread.Client.MDTM.AddpDTM(d);
|
Result := CurrThread.Client.MDTM.AddpDTM(d);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
Procedure ps_PrintpDTM(aDTM : pDTM);ps_decl;
|
||||||
|
begin
|
||||||
|
PrintpDTM(aDTM);
|
||||||
|
end;
|
||||||
|
|
||||||
|
@ -21,50 +21,50 @@
|
|||||||
File.inc for the Mufasa Macro Library
|
File.inc for the Mufasa Macro Library
|
||||||
}
|
}
|
||||||
|
|
||||||
function ps_CreateFile(Path: string): Integer; stdcall;
|
function ps_CreateFile(Path: string): Integer; ps_decl;
|
||||||
begin
|
begin
|
||||||
Result := CurrThread.Client.MFiles.CreateFile(Path);
|
Result := CurrThread.Client.MFiles.CreateFile(Path);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function ps_OpenFile(Path: string; Shared: Boolean): Integer; stdcall;
|
function ps_OpenFile(Path: string; Shared: Boolean): Integer; ps_decl;
|
||||||
begin
|
begin
|
||||||
Result := CurrThread.Client.MFiles.OpenFile(Path, Shared);
|
Result := CurrThread.Client.MFiles.OpenFile(Path, Shared);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function ps_RewriteFile(Path: string; Shared: Boolean): Integer; stdcall;
|
function ps_RewriteFile(Path: string; Shared: Boolean): Integer; ps_decl;
|
||||||
begin
|
begin
|
||||||
Result := CurrThread.Client.MFiles.RewriteFile(Path, Shared);
|
Result := CurrThread.Client.MFiles.RewriteFile(Path, Shared);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure ps_CloseFile(FileNum: Integer); stdcall;
|
procedure ps_CloseFile(FileNum: Integer); ps_decl;
|
||||||
begin
|
begin
|
||||||
CurrThread.Client.MFiles.CloseFile(FileNum);
|
CurrThread.Client.MFiles.CloseFile(FileNum);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function ps_EndOfFile(FileNum: Integer): Boolean; stdcall;
|
function ps_EndOfFile(FileNum: Integer): Boolean; ps_decl;
|
||||||
begin
|
begin
|
||||||
Result := CurrThread.Client.MFiles.EndOfFile(FileNum);
|
Result := CurrThread.Client.MFiles.EndOfFile(FileNum);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function ps_FileSize(FileNum: Integer): LongInt; stdcall;
|
function ps_FileSize(FileNum: Integer): LongInt; ps_decl;
|
||||||
begin
|
begin
|
||||||
Result := CurrThread.Client.MFiles.FileSizeMuf(FileNum);
|
Result := CurrThread.Client.MFiles.FileSizeMuf(FileNum);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function ps_ReadFileString(FileNum: Integer; out s: string; x: Integer): Boolean; stdcall;
|
function ps_ReadFileString(FileNum: Integer; out s: string; x: Integer): Boolean; ps_decl;
|
||||||
begin
|
begin
|
||||||
Result := CurrThread.Client.MFiles.ReadFileString(FileNum, s, x);
|
Result := CurrThread.Client.MFiles.ReadFileString(FileNum, s, x);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function ps_WriteFileString(FileNum: Integer; s: string): Boolean; stdcall;
|
function ps_WriteFileString(FileNum: Integer; s: string): Boolean; ps_decl;
|
||||||
begin
|
begin
|
||||||
Result := CurrThread.Client.MFiles.WriteFileString(FileNum, s);
|
Result := CurrThread.Client.MFiles.WriteFileString(FileNum, s);
|
||||||
end;
|
end;
|
||||||
function ps_SetFileCharPointer(FileNum, cChars, Origin: Integer): Integer; stdcall;
|
function ps_SetFileCharPointer(FileNum, cChars, Origin: Integer): Integer; ps_decl;
|
||||||
begin
|
begin
|
||||||
Result := CurrThread.Client.MFiles.SetFileCharPointer(Filenum, cChars, Origin);
|
Result := CurrThread.Client.MFiles.SetFileCharPointer(Filenum, cChars, Origin);
|
||||||
end;
|
end;
|
||||||
function ps_FilePointerPos(FileNum: Integer): Integer; stdcall;
|
function ps_FilePointerPos(FileNum: Integer): Integer; ps_decl;
|
||||||
begin
|
begin
|
||||||
Result := CurrThread.Client.MFiles.FilePointerPos(FileNum);
|
Result := CurrThread.Client.MFiles.FilePointerPos(FileNum);
|
||||||
end;
|
end;
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
function ps_GetPage(S: String): String; stdcall;
|
function ps_GetPage(S: String): String; ps_decl;
|
||||||
begin
|
begin
|
||||||
result := GetPage(S);
|
result := GetPage(S);
|
||||||
end;
|
end;
|
||||||
|
@ -21,27 +21,27 @@
|
|||||||
Keyboard.inc for the Mufasa Macro Library
|
Keyboard.inc for the Mufasa Macro Library
|
||||||
}
|
}
|
||||||
|
|
||||||
procedure KeyDown(key: Word); stdcall;
|
procedure KeyDown(key: Word); ps_decl;
|
||||||
begin
|
begin
|
||||||
CurrThread.Client.IOManager.KeyDown(key);
|
CurrThread.Client.IOManager.KeyDown(key);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure KeyUp(key: Word); stdcall;
|
procedure KeyUp(key: Word); ps_decl;
|
||||||
begin
|
begin
|
||||||
CurrThread.Client.IOManager.KeyUp(key);
|
CurrThread.Client.IOManager.KeyUp(key);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure SendKeys(s: string); stdcall;
|
procedure SendKeys(s: string); ps_decl;
|
||||||
begin
|
begin
|
||||||
CurrThread.Client.IOManager.SendText(s);
|
CurrThread.Client.IOManager.SendText(s);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure PressKey(key: Word); stdcall;
|
procedure PressKey(key: Word); ps_decl;
|
||||||
begin
|
begin
|
||||||
CurrThread.Client.IOManager.PressKey(key);
|
CurrThread.Client.IOManager.PressKey(key);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function isKeyDown(key: Word): boolean; stdcall;
|
function isKeyDown(key: Word): boolean; ps_decl;
|
||||||
begin
|
begin
|
||||||
Result := CurrThread.Client.IOManager.isKeyDown(key);
|
Result := CurrThread.Client.IOManager.isKeyDown(key);
|
||||||
end;
|
end;
|
||||||
|
@ -21,17 +21,61 @@
|
|||||||
Math.inc for the Mufasa Macro Library
|
Math.inc for the Mufasa Macro Library
|
||||||
}
|
}
|
||||||
|
|
||||||
function psSqr( e : extended) : extended; stdcall;
|
function ps_ceil(e : extended) : integer;ps_decl;
|
||||||
begin;
|
begin
|
||||||
|
result := ceil(e);
|
||||||
|
end;
|
||||||
|
|
||||||
|
function ps_pow(base,exponent : extended) : extended; ps_decl;
|
||||||
|
begin
|
||||||
|
result := power(base,exponent);
|
||||||
|
end;
|
||||||
|
|
||||||
|
function ps_Max(a,b : integer) : integer; ps_decl;
|
||||||
|
begin
|
||||||
|
result := max(a,b);
|
||||||
|
end;
|
||||||
|
|
||||||
|
function ps_Min(a, b: Integer): Integer; ps_decl;
|
||||||
|
begin
|
||||||
|
result := min(a,b);
|
||||||
|
end;
|
||||||
|
|
||||||
|
function ps_MinE(a, b : extended) : extended; ps_decl;
|
||||||
|
begin
|
||||||
|
result := min(a,b);
|
||||||
|
end;
|
||||||
|
|
||||||
|
function ps_MaxE(a,b : extended) : extended; ps_decl;
|
||||||
|
begin
|
||||||
|
result := max(a,b);
|
||||||
|
end;
|
||||||
|
|
||||||
|
function ps_Sqr(e : extended) : extended;ps_decl;
|
||||||
|
begin
|
||||||
result := sqr(e);
|
result := sqr(e);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function ps_RandomRange(const aFrom, aTo: Integer): Integer; stdcall;
|
function ps_Point(x,y : integer) : TPoint;ps_decl;
|
||||||
|
begin
|
||||||
|
result := classes.point(x,y);
|
||||||
|
end;
|
||||||
|
function ps_Distance(x1,y1,x2,y2 : integer) : integer;ps_decl;
|
||||||
|
begin
|
||||||
|
Result := Round(Sqrt(Sqr(x2-x1) + Sqr(y2-y1)));
|
||||||
|
end;
|
||||||
|
|
||||||
|
function ps_Hypot(X, Y: Extended): Extended;ps_decl;
|
||||||
|
begin
|
||||||
|
result := hypot(x,y);
|
||||||
|
end;
|
||||||
|
|
||||||
|
function ps_RandomRange(const aFrom, aTo: Integer): Integer; ps_decl;
|
||||||
begin
|
begin
|
||||||
Result:=Random(Abs(aFrom-aTo))+Min(aTo,AFrom);
|
Result:=Random(Abs(aFrom-aTo))+Min(aTo,AFrom);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function Factorial(number: longword): Int64; stdcall;
|
function Factorial(number: longword): Int64; ps_decl;
|
||||||
var
|
var
|
||||||
Loop : longword;
|
Loop : longword;
|
||||||
begin
|
begin
|
||||||
@ -40,12 +84,12 @@ begin
|
|||||||
result := result * loop;
|
result := result * loop;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function BinCoe(a, b: LongInt): Extended; stdcall;
|
function BinCoe(a, b: LongInt): Extended; ps_decl;
|
||||||
begin
|
begin
|
||||||
result := Factorial(a) / (factorial(b) * factorial(a-b));
|
result := Factorial(a) / (factorial(b) * factorial(a-b));
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function FixD(Degrees : extended) : Extended; stdcall;
|
function FixD(Degrees : extended) : Extended; ps_decl;
|
||||||
begin;
|
begin;
|
||||||
Result := Degrees;
|
Result := Degrees;
|
||||||
while Result < 0 do
|
while Result < 0 do
|
||||||
@ -53,12 +97,3 @@ begin;
|
|||||||
while Result > 360 do
|
while Result > 360 do
|
||||||
Result := Result - 360;
|
Result := Result - 360;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure psSwap(var A,B); stdcall;
|
|
||||||
var
|
|
||||||
TempPtr : Pointer;
|
|
||||||
begin;
|
|
||||||
TempPtr := pointer(A);
|
|
||||||
pointer(a) := pointer(b);
|
|
||||||
pointer(b) := TempPtr;
|
|
||||||
end;
|
|
||||||
|
@ -25,16 +25,16 @@ const
|
|||||||
ps_mouse_right = 0;
|
ps_mouse_right = 0;
|
||||||
ps_mouse_left = 1;
|
ps_mouse_left = 1;
|
||||||
ps_mouse_middle = 2;
|
ps_mouse_middle = 2;
|
||||||
procedure MoveMouse(x, y: integer); stdcall;
|
procedure MoveMouse(x, y: integer); ps_decl;
|
||||||
begin
|
begin
|
||||||
CurrThread.Client.IOManager.SetMousePos(X, Y);
|
CurrThread.Client.IOManager.SetMousePos(X, Y);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure GetMousePos(out x, y: integer); stdcall;
|
procedure GetMousePos(out x, y: integer); ps_decl;
|
||||||
begin
|
begin
|
||||||
CurrThread.Client.IOManager.GetMousePos(X, Y);
|
CurrThread.Client.IOManager.GetMousePos(X, Y);
|
||||||
end;
|
end;
|
||||||
function ConvIntClickType(Int : Integer) : TClickType;inline; stdcall;
|
function ConvIntClickType(Int : Integer) : TClickType;inline;
|
||||||
begin;
|
begin;
|
||||||
case int of
|
case int of
|
||||||
ps_mouse_right : result := mouse_Right;
|
ps_mouse_right : result := mouse_Right;
|
||||||
@ -45,17 +45,17 @@ begin;
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure HoldMouse(x, y: integer; clickType: integer); stdcall;
|
procedure HoldMouse(x, y: integer; clickType: integer); ps_decl;
|
||||||
begin
|
begin
|
||||||
CurrThread.Client.IOManager.HoldMouse(x, y, ConvIntClickType(clickType));
|
CurrThread.Client.IOManager.HoldMouse(x, y, ConvIntClickType(clickType));
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure ReleaseMouse(x, y: integer; clickType: integer); stdcall;
|
procedure ReleaseMouse(x, y: integer; clickType: integer); ps_decl;
|
||||||
begin
|
begin
|
||||||
CurrThread.Client.IOManager.ReleaseMouse(x, y, ConvIntClickType(clickType));
|
CurrThread.Client.IOManager.ReleaseMouse(x, y, ConvIntClickType(clickType));
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure ClickMouse(x, y: integer; clickType: integer); stdcall;
|
procedure ClickMouse(x, y: integer; clickType: integer); ps_decl;
|
||||||
begin
|
begin
|
||||||
CurrThread.Client.IOManager.ClickMouse(x, y, ConvIntClickType(clickType));
|
CurrThread.Client.IOManager.ClickMouse(x, y, ConvIntClickType(clickType));
|
||||||
end;
|
end;
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
function rs_GetUpText: String; stdcall;
|
function rs_GetUpText: String; ps_decl;
|
||||||
begin
|
begin
|
||||||
Result := CurrThread.Client.MOCR.GetUpTextAtEx(7, 7, true);
|
Result := CurrThread.Client.MOCR.GetUpTextAtEx(7, 7, true);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function BitmapFromText(text, font: String): integer; stdcall;
|
function BitmapFromText(text, font: String): integer; ps_decl;
|
||||||
var
|
var
|
||||||
bmp: TMufasaBitmap;
|
bmp: TMufasaBitmap;
|
||||||
begin
|
begin
|
||||||
@ -12,12 +12,12 @@ begin
|
|||||||
Result := CurrThread.Client.MBitmaps.AddBMP(bmp);
|
Result := CurrThread.Client.MBitmaps.AddBMP(bmp);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function MaskFromText(text, font: String): TMask; stdcall;
|
function MaskFromText(text, font: String): TMask; ps_decl;
|
||||||
begin
|
begin
|
||||||
Result := CurrThread.Client.MOCR.TextToMask(text,font);
|
Result := CurrThread.Client.MOCR.TextToMask(text,font);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TPAFromText(text, font: String): TPointArray; stdcall;
|
function TPAFromText(text, font: String): TPointArray; ps_decl;
|
||||||
var
|
var
|
||||||
w,h : integer;
|
w,h : integer;
|
||||||
begin
|
begin
|
||||||
|
@ -21,7 +21,7 @@
|
|||||||
Other.inc for the Mufasa Macro Library
|
Other.inc for the Mufasa Macro Library
|
||||||
}
|
}
|
||||||
|
|
||||||
procedure psWait(t: Integer); stdcall;
|
procedure psWait(t: Integer); ps_decl;
|
||||||
{$ifdef MSWINDOWS}
|
{$ifdef MSWINDOWS}
|
||||||
begin
|
begin
|
||||||
Sleep(t);
|
Sleep(t);
|
||||||
@ -42,13 +42,13 @@ begin
|
|||||||
end;
|
end;
|
||||||
{$endif}
|
{$endif}
|
||||||
|
|
||||||
procedure ClearDebug; stdcall;
|
procedure ClearDebug; ps_decl;
|
||||||
begin
|
begin
|
||||||
if Assigned(CurrThread.DebugMemo) then
|
if Assigned(CurrThread.DebugMemo) then
|
||||||
CurrThread.Synchronize(@CurrThread.DebugMemo.Clear);
|
CurrThread.Synchronize(@CurrThread.DebugMemo.Clear);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure SaveScreenshot(FileName: string); stdcall;
|
procedure SaveScreenshot(FileName: string); ps_decl;
|
||||||
var
|
var
|
||||||
w,h : integer;
|
w,h : integer;
|
||||||
bmp: TMufasaBitmap;
|
bmp: TMufasaBitmap;
|
||||||
@ -60,12 +60,7 @@ begin;
|
|||||||
bmp.Free;
|
bmp.Free;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function MinE(a, b: Extended): Extended; stdcall;
|
function IntToBox(x1,y1,x2,y2 : integer) : TBox; ps_decl;
|
||||||
begin;
|
|
||||||
result := min(a,b);
|
|
||||||
end;
|
|
||||||
|
|
||||||
function IntToBox(x1,y1,x2,y2 : integer) : TBox; stdcall;
|
|
||||||
begin;
|
begin;
|
||||||
result.x1 := x1;
|
result.x1 := x1;
|
||||||
result.y1 := y1;
|
result.y1 := y1;
|
||||||
@ -73,45 +68,40 @@ begin;
|
|||||||
result.y2 := y2;
|
result.y2 := y2;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function IntInBox(x, y: Integer; Box: TBox): Boolean; stdcall;
|
function IntInBox(x, y: Integer; Box: TBox): Boolean; ps_decl;
|
||||||
begin;
|
begin;
|
||||||
result := (((x >= Box.x1) and(x <= Box.x2)) and ((y >= box.y1) and (y <= box.y2)));
|
result := (((x >= Box.x1) and(x <= Box.x2)) and ((y >= box.y1) and (y <= box.y2)));
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function Distance(x1, y1, x2, y2: Integer): Integer; stdcall;
|
procedure DisplayDebugImgWindow(w,h : integer); ps_decl;
|
||||||
begin;
|
|
||||||
Result := Round(Sqrt(Sqr(x2-x1) + Sqr(y2-y1)));
|
|
||||||
end;
|
|
||||||
|
|
||||||
procedure DisplayDebugImgWindow(w,h : integer); stdcall;
|
|
||||||
begin;
|
begin;
|
||||||
CurrThread.DebugImg.DispSize^ := Classes.Point(w,h);
|
CurrThread.DebugImg.DispSize^ := Classes.Point(w,h);
|
||||||
CurrThread.Synchronize( CurrThread.DebugImg.ShowForm);
|
CurrThread.Synchronize( CurrThread.DebugImg.ShowForm);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure DrawBitmapDebugImg(bmp : integer); stdcall;
|
procedure DrawBitmapDebugImg(bmp : integer); ps_decl;
|
||||||
begin;
|
begin;
|
||||||
CurrThread.DebugImg.ToDrawBitmap^ := CurrThread.Client.MBitmaps[bmp];
|
CurrThread.DebugImg.ToDrawBitmap^ := CurrThread.Client.MBitmaps[bmp];
|
||||||
CurrThread.Synchronize(CurrThread.DebugImg.DrawBitmap);
|
CurrThread.Synchronize(CurrThread.DebugImg.DrawBitmap);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function GetDebugBitmap : integer; stdcall;
|
function GetDebugBitmap : integer; ps_decl;
|
||||||
begin;
|
begin;
|
||||||
result := CurrThread.Client.MBitmaps.CreateBMP(0,0);
|
result := CurrThread.Client.MBitmaps.CreateBMP(0,0);
|
||||||
CurrThread.DebugImg.GetDebugBitmap^ := CurrThread.Client.MBitmaps[result];
|
CurrThread.DebugImg.GetDebugBitmap^ := CurrThread.Client.MBitmaps[result];
|
||||||
CurrThread.Synchronize(CurrThread.DebugImg.GetBitmap);
|
CurrThread.Synchronize(CurrThread.DebugImg.GetBitmap);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TerminateScript; stdcall;
|
procedure TerminateScript; ps_decl;
|
||||||
begin;
|
begin;
|
||||||
CurrThread.Terminate;
|
CurrThread.Terminate;
|
||||||
end;
|
end;
|
||||||
function GetTimeRunning: LongWord; stdcall;
|
function GetTimeRunning: LongWord; ps_decl;
|
||||||
begin;
|
begin;
|
||||||
result := GetTickCount - CurrThread.StartTime;
|
result := GetTickCount - CurrThread.StartTime;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure ConvertTime(Time : integer; var h,m,s : integer); stdcall;
|
procedure ConvertTime(Time : integer; var h,m,s : integer); ps_decl;
|
||||||
var
|
var
|
||||||
x : integer;
|
x : integer;
|
||||||
begin;
|
begin;
|
||||||
@ -123,7 +113,7 @@ begin;
|
|||||||
s := x div (1000);
|
s := x div (1000);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure HakunaMatata; stdcall;
|
procedure HakunaMatata; ps_decl;
|
||||||
begin;
|
begin;
|
||||||
OpenWebPage('http://www.youtube.com/v/ejEVczA8PLU&hl=en&fs=1&autoplay=1');
|
OpenWebPage('http://www.youtube.com/v/ejEVczA8PLU&hl=en&fs=1&autoplay=1');
|
||||||
end;
|
end;
|
||||||
|
@ -1,26 +1 @@
|
|||||||
function psFormat(const fmt : string;const args : array of const) : string;
stdcall;
|
function psFormat(const fmt : string;const args : array of const) : string;
ps_decl;
begin;
Result := Format(fmt,Args);
end;
function Capitalize(str : string) : string;
ps_decl;
var
i , l : integer;
cap : boolean;
begin;
result := str;
l := length(str);
cap := true;
for i := 1 to l do
if cap and (str[i] in ['a'..'z'] + ['A'..'Z']) then
begin;
result[i] := UpperCase(str[i])[1];
cap := false;
end else if not (str[i] in ['a'..'z'] + ['A'..'Z']) then
cap := true;
end;
function psBoolToStr(bool : boolean) : string;
ps_decl;
begin;
result := BoolToStr(bool,true);
end;
|
||||||
begin;
|
|
||||||
Result := Format(fmt,Args);
|
|
||||||
end;
|
|
||||||
|
|
||||||
function Capitalize(str : string) : string;
stdcall;
|
|
||||||
var
|
|
||||||
i , l : integer;
|
|
||||||
cap : boolean;
|
|
||||||
begin;
|
|
||||||
result := str;
|
|
||||||
l := length(str);
|
|
||||||
cap := true;
|
|
||||||
for i := 1 to l do
|
|
||||||
if cap and (str[i] in ['a'..'z'] + ['A'..'Z']) then
|
|
||||||
begin;
|
|
||||||
result[i] := UpperCase(str[i])[1];
|
|
||||||
cap := false;
|
|
||||||
end else if not (str[i] in ['a'..'z'] + ['A'..'Z']) then
|
|
||||||
cap := true;
|
|
||||||
end;
|
|
||||||
|
|
||||||
function psBoolToStr(bool : boolean) : string;
stdcall;
|
|
||||||
begin;
|
|
||||||
result := BoolToStr(bool,true);
|
|
||||||
end;
|
|
@ -21,74 +21,74 @@
|
|||||||
window.inc for the Mufasa Macro Library
|
window.inc for the Mufasa Macro Library
|
||||||
}
|
}
|
||||||
|
|
||||||
procedure SetDesktopAsClient; stdcall;
|
procedure SetDesktopAsClient; ps_decl;
|
||||||
begin;
|
begin;
|
||||||
CurrThread.Client.IOManager.SetDesktop;
|
CurrThread.Client.IOManager.SetDesktop;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function SetTargetArray(P: Integer; w, h: integer): integer; stdcall;
|
function SetTargetArray(P: Integer; w, h: integer): integer; ps_decl;
|
||||||
begin
|
begin
|
||||||
result:= CurrThread.Client.IOManager.SetTarget(PRGB32(P), classes.point(w,h));
|
result:= CurrThread.Client.IOManager.SetTarget(PRGB32(P), classes.point(w,h));
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function SetTargetBitmap(bitmap: Integer): integer; stdcall;
|
function SetTargetBitmap(bitmap: Integer): integer; ps_decl;
|
||||||
begin;
|
begin;
|
||||||
result:= CurrThread.Client.IOManager.SetTarget(CurrThread.Client.MBitmaps[Bitmap]);
|
result:= CurrThread.Client.IOManager.SetTarget(CurrThread.Client.MBitmaps[Bitmap]);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function SetEIOSTarget(name: string; args: Variant): integer; stdcall;
|
function SetEIOSTarget(name: string; args: Variant): integer; ps_decl;
|
||||||
begin
|
begin
|
||||||
result:= CurrThread.Client.IOManager.SetTarget(name, @args);
|
result:= CurrThread.Client.IOManager.SetTarget(name, @args);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure SetImageTarget(idx: integer); stdcall;
|
procedure SetImageTarget(idx: integer); ps_decl;
|
||||||
begin
|
begin
|
||||||
CurrThread.Client.IOManager.SetImageTarget(idx);
|
CurrThread.Client.IOManager.SetImageTarget(idx);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure SetKeyMouseTarget(idx: integer); stdcall;
|
procedure SetKeyMouseTarget(idx: integer); ps_decl;
|
||||||
begin
|
begin
|
||||||
CurrThread.Client.IOManager.SetKeyMouseTarget(idx);
|
CurrThread.Client.IOManager.SetKeyMouseTarget(idx);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function GetImageTarget: integer; stdcall;
|
function GetImageTarget: integer; ps_decl;
|
||||||
begin
|
begin
|
||||||
CurrThread.Client.IOManager.GetImageTarget(result);
|
CurrThread.Client.IOManager.GetImageTarget(result);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function GetKeyMouseTarget: integer; stdcall;
|
function GetKeyMouseTarget: integer; ps_decl;
|
||||||
begin
|
begin
|
||||||
CurrThread.Client.IOManager.GetKeyMouseTarget(result);
|
CurrThread.Client.IOManager.GetKeyMouseTarget(result);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure FreeTarget(idx: integer); stdcall;
|
procedure FreeTarget(idx: integer); ps_decl;
|
||||||
begin
|
begin
|
||||||
CurrThread.Client.IOManager.FreeTarget(idx);
|
CurrThread.Client.IOManager.FreeTarget(idx);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure GetClientDimensions(out w, h: integer); stdcall;
|
procedure GetClientDimensions(out w, h: integer); ps_decl;
|
||||||
begin
|
begin
|
||||||
CurrThread.Client.IOManager.GetDimensions(w, h);
|
CurrThread.Client.IOManager.GetDimensions(w, h);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function Freeze: boolean; stdcall;
|
function Freeze: boolean; ps_decl;
|
||||||
begin
|
begin
|
||||||
CurrThread.Client.IOManager.SetFrozen(true);
|
CurrThread.Client.IOManager.SetFrozen(true);
|
||||||
result := true; //dunno what the result is supposed to mean
|
result := true; //dunno what the result is supposed to mean
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function Unfreeze: boolean; stdcall;
|
function Unfreeze: boolean; ps_decl;
|
||||||
begin
|
begin
|
||||||
CurrThread.Client.IOManager.SetFrozen(false);
|
CurrThread.Client.IOManager.SetFrozen(false);
|
||||||
result := true; //dunno what the result is supposed to mean
|
result := true; //dunno what the result is supposed to mean
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure ActivateClient; stdcall;
|
procedure ActivateClient; ps_decl;
|
||||||
begin
|
begin
|
||||||
CurrThread.Client.IOManager.ActivateClient;
|
CurrThread.Client.IOManager.ActivateClient;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function IsTargetValid: boolean; stdcall;
|
function IsTargetValid: boolean; ps_decl;
|
||||||
begin
|
begin
|
||||||
result:= CurrThread.Client.IOManager.TargetValid;
|
result:= CurrThread.Client.IOManager.TargetValid;
|
||||||
end;
|
end;
|
||||||
|
@ -26,7 +26,7 @@ AddFunction(nil,'procedure Writeln(x);'); //We use special function for this
|
|||||||
|
|
||||||
{ DTM }
|
{ DTM }
|
||||||
SetCurrSection('DTM');
|
SetCurrSection('DTM');
|
||||||
AddFunction(@PrintpDTM, 'Procedure PrintpDTM(tDTM : pDTM);');
|
AddFunction(@ps_PrintpDTM, 'Procedure PrintpDTM(tDTM : pDTM);');
|
||||||
AddFunction(@ps_GetDTM ,'function GetDTM(index: Integer; out dtm: pDTM): Boolean;');
|
AddFunction(@ps_GetDTM ,'function GetDTM(index: Integer; out dtm: pDTM): Boolean;');
|
||||||
AddFunction(@pDTMToTDTM, 'Function pDTMToTDTM(DTM: pDTM): TDTM;');
|
AddFunction(@pDTMToTDTM, 'Function pDTMToTDTM(DTM: pDTM): TDTM;');
|
||||||
AddFunction(@tDTMTopDTM, 'Function tDTMTopDTM(DTM: TDTM): pDTM;');
|
AddFunction(@tDTMTopDTM, 'Function tDTMTopDTM(DTM: TDTM): pDTM;');
|
||||||
@ -39,20 +39,21 @@ AddFunction(@ps_FindDTMsRotated, 'function FindDTMsRotated(DTM: Integer; out Poi
|
|||||||
AddFunction(@ps_addDTM, 'function AddDTM(d: TDTM): Integer;');
|
AddFunction(@ps_addDTM, 'function AddDTM(d: TDTM): Integer;');
|
||||||
AddFunction(@ps_addpDTM, 'function AddpDTM(d: pDTM): Integer;');
|
AddFunction(@ps_addpDTM, 'function AddpDTM(d: pDTM): Integer;');
|
||||||
|
|
||||||
|
|
||||||
{maths}
|
{maths}
|
||||||
SetCurrSection('Math');
|
SetCurrSection('Math');
|
||||||
AddFunction(nil,'function Round(e:extended) : integer');
|
AddFunction(nil,'function Round(e:extended) : integer');
|
||||||
AddFunction(@ceil,'function ceil(e : extended) : integer');
|
AddFunction(@ps_ceil,'function ceil(e : extended) : integer');
|
||||||
AddFunction(@power,'function pow(base,exponent : extended) : extended');
|
AddFunction(@ps_pow,'function pow(base,exponent : extended) : extended');
|
||||||
AddFunction(@max,'function Max(a, b: Integer): Integer;');
|
AddFunction(@ps_max,'function Max(a, b: Integer): Integer;');
|
||||||
AddFunction(@min,'function Min(a, b: Integer): Integer;');
|
AddFunction(@ps_min,'function Min(a, b: Integer): Integer;');
|
||||||
AddFunction(@minE,'function MinE(a, b: extended): Extended;');
|
AddFunction(@ps_minE,'function MinE(a, b: extended): Extended;');
|
||||||
AddFunction(@IntToBox,'function IntToBox(x1,y1,x2,y2 : integer) : TBox;');
|
AddFunction(@IntToBox,'function IntToBox(x1,y1,x2,y2 : integer) : TBox;');
|
||||||
AddFunction(@IntInBox,'function IntInBox(x, y: Integer; Box: TBox): Boolean;');
|
AddFunction(@IntInBox,'function IntInBox(x, y: Integer; Box: TBox): Boolean;');
|
||||||
AddFunction(@pssqr,'function Sqr(e : extended) : extended;');
|
AddFunction(@ps_sqr,'function Sqr(e : extended) : extended;');
|
||||||
AddFunction(@classes.point,'function Point(x,y:integer) : TPoint;');
|
AddFunction(@ps_point,'function Point(x,y:integer) : TPoint;');
|
||||||
AddFunction(@Distance,'function Distance(x1,y1,x2,y2 : integer) : integer;');
|
AddFunction(@ps_Distance,'function Distance(x1,y1,x2,y2 : integer) : integer;');
|
||||||
AddFunction(@hypot,'function Hypot(X, Y: Extended): Extended;');
|
AddFunction(@ps_hypot,'function Hypot(X, Y: Extended): Extended;');
|
||||||
AddFunction(@ps_RandomRange,'function RandomRange(aFrom,aTo: Integer): Integer;');
|
AddFunction(@ps_RandomRange,'function RandomRange(aFrom,aTo: Integer): Integer;');
|
||||||
AddFunction(@BinCoe,'function BinCoe(a, b: LongInt): Extended;');
|
AddFunction(@BinCoe,'function BinCoe(a, b: LongInt): Extended;');
|
||||||
AddFunction(@FixD,'function FixD(Degrees : extended) : Extended;');
|
AddFunction(@FixD,'function FixD(Degrees : extended) : Extended;');
|
||||||
|
@ -24,6 +24,8 @@
|
|||||||
unit mmlpsthread;
|
unit mmlpsthread;
|
||||||
|
|
||||||
{$Define PS_USESSUPPORT}
|
{$Define PS_USESSUPPORT}
|
||||||
|
//{$define PS_StdCall}
|
||||||
|
|
||||||
{$mode objfpc}{$H+}
|
{$mode objfpc}{$H+}
|
||||||
|
|
||||||
interface
|
interface
|
||||||
@ -158,6 +160,12 @@ uses
|
|||||||
forms,//Forms
|
forms,//Forms
|
||||||
lclintf; // for GetTickCount and others.
|
lclintf; // for GetTickCount and others.
|
||||||
|
|
||||||
|
{$MACRO ON}
|
||||||
|
{$ifdef PS_StdCall}
|
||||||
|
{$define ps_decl := stdcall}
|
||||||
|
{$else}
|
||||||
|
{$define ps_decl := REGISTER}
|
||||||
|
{$endif}
|
||||||
|
|
||||||
{Some General PS Functions here}
|
{Some General PS Functions here}
|
||||||
procedure psWriteln(str : string);
|
procedure psWriteln(str : string);
|
||||||
@ -331,7 +339,7 @@ begin
|
|||||||
FontPath:= FontP;
|
FontPath:= FontP;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function ThreadSafeCall(ProcName: string; var V: TVariantArray): Variant;
|
function ThreadSafeCall(ProcName: string; var V: TVariantArray): Variant;ps_decl;
|
||||||
begin
|
begin
|
||||||
CurrThread.SyncInfo^.MethodName:= ProcName;
|
CurrThread.SyncInfo^.MethodName:= ProcName;
|
||||||
CurrThread.SyncInfo^.V:= V;
|
CurrThread.SyncInfo^.V:= V;
|
||||||
@ -471,7 +479,8 @@ begin
|
|||||||
//Export all the methods
|
//Export all the methods
|
||||||
for i := 0 to high(ExportedMethods) do
|
for i := 0 to high(ExportedMethods) do
|
||||||
if ExportedMethods[i].FuncPtr <> nil then
|
if ExportedMethods[i].FuncPtr <> nil then
|
||||||
PSScript.AddFunctionEx(ExportedMethods[i].FuncPtr,ExportedMethods[i].FuncDecl,cdStdCall);
|
PSScript.AddFunctionEx(ExportedMethods[i].FuncPtr,ExportedMethods[i].FuncDecl,
|
||||||
|
{$ifdef PS_StdCall}cdStdCall{$else}cdRegister {$endif});
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TPSThread.RequireFile(Sender: TObject;
|
function TPSThread.RequireFile(Sender: TObject;
|
||||||
|
Loading…
Reference in New Issue
Block a user