1
0
mirror of https://github.com/moparisthebest/Simba synced 2024-11-11 03:45:06 -05:00

Made exported methods stdcall because everything supports that (better) than other calls...

git-svn-id: http://www.villavu.com/repositories/merlijn/mufasa@477 3f818213-9676-44b0-a9b4-5e4c4e03d09d
This commit is contained in:
BenLand100 2010-01-26 14:09:09 +00:00
parent a0a89be1f2
commit 44eaf71038
14 changed files with 174 additions and 168 deletions

View File

@ -11,7 +11,7 @@
<Title Value="Simba"/>
<UseXPManifest Value="True"/>
<Icon Value="0"/>
<ActiveEditorIndexAtStart Value="5"/>
<ActiveEditorIndexAtStart Value="14"/>
</General>
<VersionInfo>
<ProjectVersion Value=""/>
@ -265,8 +265,8 @@
<Filename Value="../../Units/MMLAddon/mmlpsthread.pas"/>
<IsPartOfProject Value="True"/>
<UnitName Value="mmlpsthread"/>
<CursorPos X="61" Y="256"/>
<TopLine Value="331"/>
<CursorPos X="94" Y="474"/>
<TopLine Value="452"/>
<EditorIndex Value="11"/>
<UsageCount Value="202"/>
<Loaded Value="True"/>
@ -349,7 +349,7 @@
<UnitName Value="bitmaps"/>
<CursorPos X="12" Y="93"/>
<TopLine Value="83"/>
<EditorIndex Value="12"/>
<EditorIndex Value="15"/>
<UsageCount Value="200"/>
<Loaded Value="True"/>
</Unit42>
@ -369,9 +369,11 @@
<Unit45>
<Filename Value="../../Units/MMLAddon/PSInc/Wrappers/bitmap.inc"/>
<IsPartOfProject Value="True"/>
<CursorPos X="1" Y="1"/>
<TopLine Value="1"/>
<CursorPos X="76" Y="281"/>
<TopLine Value="8"/>
<EditorIndex Value="12"/>
<UsageCount Value="201"/>
<Loaded Value="True"/>
</Unit45>
<Unit46>
<Filename Value="../../../FPC/FPCCheckout/packages/fcl-image/src/fpcanvas.inc"/>
@ -495,7 +497,7 @@
<Unit64>
<Filename Value="../../Units/MMLAddon/PSInc/Wrappers/other.inc"/>
<CursorPos X="1" Y="1"/>
<TopLine Value="95"/>
<TopLine Value="1"/>
<EditorIndex Value="7"/>
<UsageCount Value="44"/>
<Loaded Value="True"/>
@ -585,7 +587,9 @@
<UnitName Value="dtm"/>
<CursorPos X="84" Y="51"/>
<TopLine Value="33"/>
<EditorIndex Value="13"/>
<UsageCount Value="200"/>
<Loaded Value="True"/>
</Unit77>
<Unit78>
<Filename Value="../../../cogat/Units/CogatUnits/comppicker.pas"/>
@ -664,9 +668,11 @@
</Unit87>
<Unit88>
<Filename Value="../../Units/MMLAddon/PSInc/Wrappers/dtm.inc"/>
<CursorPos X="1" Y="1"/>
<TopLine Value="1"/>
<CursorPos X="60" Y="53"/>
<TopLine Value="82"/>
<EditorIndex Value="14"/>
<UsageCount Value="52"/>
<Loaded Value="True"/>
</Unit88>
<Unit89>
<Filename Value="../../../cogat/compscript.pas"/>
@ -766,8 +772,8 @@
</Unit102>
<Unit103>
<Filename Value="../../Units/MMLAddon/PSInc/Wrappers/window.inc"/>
<CursorPos X="51" Y="34"/>
<TopLine Value="19"/>
<CursorPos X="1" Y="1"/>
<TopLine Value="1"/>
<EditorIndex Value="5"/>
<UsageCount Value="17"/>
<Loaded Value="True"/>
@ -1592,7 +1598,7 @@
<UnitName Value="framefunctionlist"/>
<CursorPos X="26" Y="295"/>
<TopLine Value="7"/>
<UsageCount Value="185"/>
<UsageCount Value="186"/>
</Unit223>
<Unit224>
<Filename Value="../../../usr/local/share/lazarus/lcl/comctrls.pp"/>
@ -1649,7 +1655,7 @@
<UnitName Value="simpleanalyzer"/>
<CursorPos X="52" Y="104"/>
<TopLine Value="193"/>
<UsageCount Value="172"/>
<UsageCount Value="173"/>
</Unit231>
<Unit232>
<Filename Value="../../Units/Misc/mPasLex.pas"/>
@ -1726,7 +1732,7 @@
<UnitName Value="updater"/>
<CursorPos X="38" Y="211"/>
<TopLine Value="65"/>
<UsageCount Value="145"/>
<UsageCount Value="146"/>
</Unit242>
<Unit243>
<Filename Value="updateform.pas"/>
@ -1737,7 +1743,7 @@
<ComponentState Value="1"/>
<CursorPos X="111" Y="102"/>
<TopLine Value="207"/>
<UsageCount Value="140"/>
<UsageCount Value="141"/>
</Unit243>
<Unit244>
<Filename Value="../../../Documents/lazarus/lcl/fileutil.pas"/>
@ -1858,7 +1864,7 @@
<UnitName Value="simbasettings"/>
<CursorPos X="26" Y="9"/>
<TopLine Value="11"/>
<UsageCount Value="103"/>
<UsageCount Value="104"/>
</Unit261>
<Unit262>
<Filename Value="../../Units/MMLAddon/settings.pas"/>
@ -1896,7 +1902,7 @@
<UnitName Value="reportbug"/>
<CursorPos X="53" Y="23"/>
<TopLine Value="21"/>
<UsageCount Value="86"/>
<UsageCount Value="87"/>
</Unit266>
<Unit267>
<Filename Value="../../Units/Synapse/synsock.pas"/>
@ -1953,7 +1959,7 @@
<UnitName Value="newinternets"/>
<CursorPos X="37" Y="171"/>
<TopLine Value="153"/>
<UsageCount Value="82"/>
<UsageCount Value="83"/>
</Unit274>
<Unit275>
<Filename Value="reportbug.lrs"/>
@ -2026,7 +2032,7 @@
<UnitName Value="os_windows"/>
<CursorPos X="54" Y="348"/>
<TopLine Value="319"/>
<EditorIndex Value="13"/>
<EditorIndex Value="16"/>
<UsageCount Value="26"/>
<Loaded Value="True"/>
</Unit284>
@ -2050,7 +2056,7 @@
<UnitName Value="libloader"/>
<CursorPos X="1" Y="149"/>
<TopLine Value="128"/>
<UsageCount Value="40"/>
<UsageCount Value="41"/>
</Unit287>
<Unit288>
<Filename Value="../../Units/MMLAddon/tpa.pas"/>
@ -2181,35 +2187,35 @@
</Position22>
<Position23>
<Filename Value="../../Units/MMLCore/iomanager.pas"/>
<Caret Line="233" Column="29" TopLine="438"/>
<Caret Line="299" Column="27" TopLine="249"/>
</Position23>
<Position24>
<Filename Value="../../Units/MMLCore/iomanager.pas"/>
<Caret Line="299" Column="27" TopLine="249"/>
<Caret Line="294" Column="30" TopLine="282"/>
</Position24>
<Position25>
<Filename Value="../../Units/MMLCore/iomanager.pas"/>
<Caret Line="294" Column="30" TopLine="282"/>
<Caret Line="317" Column="30" TopLine="302"/>
</Position25>
<Position26>
<Filename Value="../../Units/MMLCore/iomanager.pas"/>
<Caret Line="317" Column="30" TopLine="302"/>
<Caret Line="249" Column="58" TopLine="230"/>
</Position26>
<Position27>
<Filename Value="../../Units/MMLCore/iomanager.pas"/>
<Caret Line="249" Column="58" TopLine="230"/>
<Caret Line="354" Column="12" TopLine="331"/>
</Position27>
<Position28>
<Filename Value="../../Units/MMLCore/iomanager.pas"/>
<Caret Line="354" Column="12" TopLine="331"/>
<Filename Value="../../Units/MMLAddon/PSInc/psexportedmethods.inc"/>
<Caret Line="14" Column="58" TopLine="1"/>
</Position28>
<Position29>
<Filename Value="../../Units/MMLAddon/PSInc/psexportedmethods.inc"/>
<Caret Line="14" Column="58" TopLine="1"/>
<Caret Line="24" Column="102" TopLine="12"/>
</Position29>
<Position30>
<Filename Value="../../Units/MMLAddon/PSInc/psexportedmethods.inc"/>
<Caret Line="24" Column="102" TopLine="12"/>
<Filename Value="../../Units/MMLCore/dtm.pas"/>
<Caret Line="51" Column="84" TopLine="33"/>
</Position30>
</JumpHistory>
</ProjectOptions>

View File

@ -20,42 +20,42 @@
Bitmap.inc for the Mufasa Macro Library
}
function CreateBitmapString(bmp : integer) : string;
function CreateBitmapString(bmp : integer) : string; stdcall;
begin;
result := CurrThread.Client.MBitmaps[bmp].ToString;
end;
function GetMufasaBitmap(bmp : integer): TMufasaBitmap;
function GetMufasaBitmap(bmp : integer): TMufasaBitmap; stdcall;
begin;
result := CurrThread.Client.MBitmaps[bmp];
end;
function CreateBitmap(w,h : integer):integer;
function CreateBitmap(w,h : integer):integer; stdcall;
begin
result := CurrThread.Client.MBitmaps.CreateBMP(w,h);
end;
procedure FreeBitmap(Number : integer);
procedure FreeBitmap(Number : integer); stdcall;
begin
CurrThread.Client.MBitmaps.FreeBMP(Number);
end;
procedure SaveBitmap(Bmp : integer; path : string);
procedure SaveBitmap(Bmp : integer; path : string); stdcall;
begin;
CurrThread.Client.MBitmaps[Bmp].SaveToFile(Path);
end;
function BitmapFromString(Width,height : integer; Data : string) : integer;
function BitmapFromString(Width,height : integer; Data : string) : integer; stdcall;
begin;
Result := CurrThread.Client.MBitmaps.CreateBMPFromString(Width,Height,Data);
end;
function LoadBitmap(Path : String) : integer;
function LoadBitmap(Path : String) : integer; stdcall;
begin;
Result := CurrThread.Client.MBitmaps.CreateBMPFromFile(Path);
end;
procedure SetBitmapSize(Bmp,NewW,NewH : integer);
procedure SetBitmapSize(Bmp,NewW,NewH : integer); stdcall;
begin;
if (NewW>=0) and (NewH >=0) then
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]);
end;
procedure StretchBitmapResize(Bmp,NewW,NewH : integer);
procedure StretchBitmapResize(Bmp,NewW,NewH : integer); stdcall;
begin;
if (NewW>=0) and (NewH >=0) then
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]);
end;
procedure GetBitmapSize(Bmp : integer; out BmpW,BmpH : integer);
procedure GetBitmapSize(Bmp : integer; out BmpW,BmpH : integer); stdcall;
begin;
With CurrThread.Client.MBitmaps[bmp] do
begin;
@ -80,129 +80,129 @@ begin;
end;
end;
procedure SetBitmapName(Bmp : integer; name : string);
procedure SetBitmapName(Bmp : integer; name : string); stdcall;
begin;
CurrThread.Client.MBitmaps[Bmp].BmpName:= name;
end;
function CreateMirroredBitmap(Bmp : integer) : integer;
function CreateMirroredBitmap(Bmp : integer) : integer; stdcall;
begin;
Result := CurrThread.Client.MBitmaps.CreateMirroredBitmap(Bmp, MirrorWidth);
end;
function CreateMirroredBitmapEx(Bmp : integer; MirrorStyle : TBmpMirrorStyle) : integer;
function CreateMirroredBitmapEx(Bmp : integer; MirrorStyle : TBmpMirrorStyle) : integer; stdcall;
begin;
Result := CurrThread.Client.MBitmaps.CreateMirroredBitmap(Bmp,MirrorStyle);
end;
function FastGetPixel(bmp,x,y : integer) : LongWord;
function FastGetPixel(bmp,x,y : integer) : LongWord; stdcall;
begin;
Result := CurrThread.Client.MBitmaps[Bmp].FastGetPixel(x,y);
end;
function FastGetPixels(bmp : integer; TPA : TPointArray) : TIntegerArray;
function FastGetPixels(bmp : integer; TPA : TPointArray) : TIntegerArray; stdcall;
begin;
result := CurrThread.Client.MBitmaps[Bmp].FastGetPixels(TPA);
end;
procedure FastSetPixel(Bmp,x,y : integer; Color : TColor);
procedure FastSetPixel(Bmp,x,y : integer; Color : TColor); stdcall;
begin
CurrThread.Client.MBitmaps[bmp].FastSetPixel(x,y,color);
end;
procedure FastSetPixels(Bmp : integer; TPA : TPointArray; Colors : TIntegerArray);
procedure FastSetPixels(Bmp : integer; TPA : TPointArray; Colors : TIntegerArray); stdcall;
begin;
CurrThread.Client.MBitmaps[Bmp].FastSetPixels(TPA,Colors);
end;
procedure DrawTPABitmap(bitmap : integer; TPA : TPointArray; Color : integer);
procedure DrawTPABitmap(bitmap : integer; TPA : TPointArray; Color : integer); stdcall;
begin
CurrThread.Client.MBitmaps[Bitmap].DrawTPA(TPA,Color);
end;
procedure DrawATPABitmap(bitmap : integer; ATPA : T2DPointArray);
procedure DrawATPABitmap(bitmap : integer; ATPA : T2DPointArray); stdcall;
begin
CurrThread.Client.MBitmaps[bitmap].DrawATPA(ATPA);
end;
procedure DrawATPABitmapEx(bitmap : integer; ATPA : T2DPointArray; Colors : TIntegerArray);
procedure DrawATPABitmapEx(bitmap : integer; ATPA : T2DPointArray; Colors : TIntegerArray); stdcall;
begin
CurrThread.Client.MBitmaps[bitmap].DrawATPA(ATPA,Colors);
end;
procedure FastDrawClear(bmp : integer; Color : TColor);
procedure FastDrawClear(bmp : integer; Color : TColor); stdcall;
begin;
CurrThread.Client.MBitmaps[bmp].FastDrawClear(Color);
end;
procedure FastDrawTransparent(x, y: Integer; SourceBitmap, TargetBitmap: Integer);
procedure FastDrawTransparent(x, y: Integer; SourceBitmap, TargetBitmap: Integer); stdcall;
begin;
CurrThread.Client.MBitmaps[SourceBitmap].FastDrawTransparent(x,y,CurrThread.Client.MBitmaps[TargetBitmap]);
end;
procedure SetTransparentColor(Bmp : integer; Color : TColor);
procedure SetTransparentColor(Bmp : integer; Color : TColor); stdcall;
begin
CurrThread.Client.MBitmaps[Bmp].SetTransparentColor(Color);
end;
function GetTransparentColor(Bmp : integer) : TColor;
function GetTransparentColor(Bmp : integer) : TColor; stdcall;
begin;
Result := CurrThread.Client.MBitmaps[bmp].GetTransparentColor;
end;
procedure FastReplaceColor(bmp: Integer; OldColor, NewColor: TColor);
procedure FastReplaceColor(bmp: Integer; OldColor, NewColor: TColor); stdcall;
begin
CurrThread.Client.MBitmaps[Bmp].FastReplaceColor(OldColor,NewColor);
end;
procedure ps_CopyClientToBitmap(bmp, xs, ys, xe, ye: Integer);
procedure ps_CopyClientToBitmap(bmp, xs, ys, xe, ye: Integer); stdcall;
begin
CurrThread.Client.MBitmaps.GetBMP(bmp).CopyClientToBitmap(CurrThread.Client.IOManager, True, xs, ys, xe, ye);
end;
function BitmapFromClient(const xs, ys, xe, ye: Integer): Integer;
function BitmapFromClient(const xs, ys, xe, ye: Integer): Integer; stdcall;
begin;
result := CurrThread.Client.MBitmaps.CreateBMP(0,0);
CurrThread.Client.MBitmaps[result].CopyClientToBitmap(CurrThread.Client.IOManager,True,xs,ys,xe,ye);
end;
function FindBitmap(Bitmap: integer; out x, y: Integer): Boolean;
function FindBitmap(Bitmap: integer; out x, y: Integer): Boolean; stdcall;
begin;
with CurrThread.Client do
result := MFinder.FindBitmap( MBitmaps[bitmap],x,y);
end;
function FindBitmapIn(bitmap: integer; out x, y: Integer; xs, ys, xe, ye: Integer): Boolean;
function FindBitmapIn(bitmap: integer; out x, y: Integer; xs, ys, xe, ye: Integer): Boolean; stdcall;
begin;
with CurrThread.Client do
result := MFinder.FindBitmapIn( MBitmaps[bitmap],x,y,xs,ys,xe,ye);
end;
function FindBitmapToleranceIn(bitmap: integer; out x, y: Integer; xs, ys, xe, ye: Integer; tolerance: Integer): Boolean;
function FindBitmapToleranceIn(bitmap: integer; out x, y: Integer; xs, ys, xe, ye: Integer; tolerance: Integer): Boolean; stdcall;
begin;
with CurrThread.Client do
result := MFinder.FindBitmapToleranceIn( MBitmaps[bitmap],x,y,xs,ys,xe,ye,tolerance);
end;
function FindBitmapSpiral(bitmap: Integer; var x, y: Integer; xs, ys, xe, ye: Integer): Boolean;
function FindBitmapSpiral(bitmap: Integer; var x, y: Integer; xs, ys, xe, ye: Integer): Boolean; stdcall;
begin;
with CurrThread.Client do
result := MFinder.FindBitmapSpiral(Mbitmaps[bitmap],x,y,xs,ys,xe,ye);
end;
function FindBitmapsSpiralTolerance(bitmap: integer; x, y: Integer; out Points : TPointArray; xs, ys, xe, ye,tolerance: Integer): Boolean;
function FindBitmapsSpiralTolerance(bitmap: integer; x, y: Integer; out Points : TPointArray; xs, ys, xe, ye,tolerance: Integer): Boolean; stdcall;
begin;
with CurrThread.Client do
result := MFinder.FindBitmapsSpiralTolerance(MBitmaps[bitmap],x,y,points,xs,ys,xe,ye,tolerance);
end;
function FindBitmapSpiralTolerance(bitmap: integer; var x, y: Integer; xs, ys, xe, ye,tolerance : integer): Boolean;
function FindBitmapSpiralTolerance(bitmap: integer; var x, y: Integer; xs, ys, xe, ye,tolerance : integer): Boolean; stdcall;
begin;
with CurrThread.Client do
result := MFinder.FindBitmapSpiralTolerance(MBitmaps[bitmap],x,y,xs,ys,xe,ye,tolerance);
end;
function RotateBitmap(bitmap: Integer; angle: Extended): Integer;
function RotateBitmap(bitmap: Integer; angle: Extended): Integer; stdcall;
begin;
with CurrThread.Client.MBitmaps do
begin;
@ -211,7 +211,7 @@ begin;
end;
end;
function Desaturate(Bitmap : integer) : integer;
function Desaturate(Bitmap : integer) : integer; stdcall;
begin;
with CurrThread.Client.MBitmaps do
begin;
@ -219,15 +219,15 @@ begin;
Bmp[Bitmap].Desaturate(Bmp[result]);
end;
end;
procedure InvertBitmap(Bitmap : integer);
procedure InvertBitmap(Bitmap : integer); stdcall;
begin;
CurrThread.Client.MBitmaps[Bitmap].Invert;
end;
function CopyBitmap(Bitmap : integer) : integer;
function CopyBitmap(Bitmap : integer) : integer; stdcall;
begin;
result := Currthread.Client.MBitmaps.CopyBMP(bitmap);
end;
function GreyScaleBitmap(Bitmap : integer) : integer;
function GreyScaleBitmap(Bitmap : integer) : integer; stdcall;
begin;
with CurrThread.Client.MBitmaps do
begin;
@ -235,7 +235,7 @@ begin;
Bmp[Bitmap].GreyScale(Bmp[result]);
end;
end;
function BrightnessBitmap(Bitmap,br : integer) : integer;
function BrightnessBitmap(Bitmap,br : integer) : integer; stdcall;
begin;
with CurrThread.Client.MBitmaps do
begin;
@ -243,7 +243,7 @@ begin;
Bmp[Bitmap].Brightness(Bmp[result],br);
end;
end;
function ContrastBitmap(bitmap : integer; co : extended) : integer;
function ContrastBitmap(bitmap : integer; co : extended) : integer; stdcall;
begin;
with CurrThread.Client.MBitmaps do
begin;
@ -252,7 +252,7 @@ begin;
end;
end;
function PosterizeBitmap(Bitmap : integer; po : integer) : integer;
function PosterizeBitmap(Bitmap : integer; po : integer) : integer; stdcall;
begin;
with CurrThread.Client.MBitmaps do
begin
@ -260,16 +260,16 @@ begin;
Bmp[bitmap].Posterize(Bmp[result],po);
end;
end;
function CreateMaskFromBitmap(Bitmap : integer) : TMask;
function CreateMaskFromBitmap(Bitmap : integer) : TMask; stdcall;
begin;
result := CurrThread.Client.MBitmaps[Bitmap].CreateTMask;
end;
function FindMaskTolerance(mask: TMask; out x, y: Integer; xs,ys, xe, ye: Integer; Tolerance, ContourTolerance: Integer): Boolean;
function FindMaskTolerance(mask: TMask; out x, y: Integer; xs,ys, xe, ye: Integer; Tolerance, ContourTolerance: Integer): Boolean; stdcall;
begin;
result := CurrThread.Client.MFinder.FindMaskTolerance(Mask,x,y,xs,ys,xe,ye,tolerance,contourtolerance);
end;
function FindBitmapMaskTolerance(mask: Integer; out x, y: Integer; xs, ys, xe, ye: Integer; Tolerance, ContourTolerance: Integer): Boolean;
function FindBitmapMaskTolerance(mask: Integer; out x, y: Integer; xs, ys, xe, ye: Integer; Tolerance, ContourTolerance: Integer): Boolean; stdcall;
begin;
psWriteln('Better be using FindMaskTolerance in combination with CreateMaskFromBitmap, more efficient.');
with CurrThread.Client do
@ -278,7 +278,7 @@ end;
function FindDeformedBitmapToleranceIn(bitmap: integer; out x,
y: Integer; xs, ys, xe, ye: Integer; tolerance: Integer; Range: Integer;
AllowPartialAccuracy: Boolean; out accuracy: Extended): Boolean;
AllowPartialAccuracy: Boolean; out accuracy: Extended): Boolean; stdcall;
begin;
result := CurrThread.Client.MFinder.FindDeformedBitmapToleranceIn(CurrThread.Client.MBitmaps[Bitmap],x,y,xs,ys,xe,ye,tolerance,range,AllowPartialAccuracy,accuracy);
end;

View File

@ -21,94 +21,94 @@
Colour.inc for the Mufasa Macro Library
}
function GetColor(x,y : integer) : TColor;
function GetColor(x,y : integer) : TColor; stdcall;
begin;
Result := CurrThread.Client.IOManager.GetColor(x,y);
end;
function GetColors(Coords : TPointArray) : TIntegerArray;
function GetColors(Coords : TPointArray) : TIntegerArray; stdcall;
begin
result := CurrThread.Client.MFinder.GetColors(coords);
end;
function findcolor(out x, y: integer; color, x1, y1, x2, y2: integer): boolean;
function findcolor(out x, y: integer; color, x1, y1, x2, y2: integer): boolean; stdcall;
begin
Result := CurrThread.Client.MFinder.FindColor(x, y, color, x1, y1, x2, y2);
end;
function findcolortoleranceOptimised(out x, y: integer; color, x1, y1, x2, y2, tol: integer): boolean;
function findcolortoleranceOptimised(out x, y: integer; color, x1, y1, x2, y2, tol: integer): boolean; stdcall;
begin
Result := CurrThread.Client.MFinder.FindColorToleranceOptimised(x, y, color, x1, y1, x2, y2, tol);
end;
function findcolortolerance(out x, y: integer; color, x1, y1, x2, y2, tol: integer): boolean;
function findcolortolerance(out x, y: integer; color, x1, y1, x2, y2, tol: integer): boolean; stdcall;
begin
Result := CurrThread.Client.MFinder.FindColorTolerance(x, y, color, x1, y1, x2, y2, tol);
end;
function FindColors(out TPA: TPointArray; Color, x1, y1, x2, y2: Integer): Boolean;
function FindColors(out TPA: TPointArray; Color, x1, y1, x2, y2: Integer): Boolean; stdcall;
begin
Result := CurrThread.Client.MFinder.FindColors(TPA, color, x1, y1, x2, y2);
end;
procedure SetColorToleranceSpeed(cts: Integer);
procedure SetColorToleranceSpeed(cts: Integer); stdcall;
begin
CurrThread.Client.MFinder.SetToleranceSpeed(cts);
end;
function GetToleranceSpeed: Integer;
function GetToleranceSpeed: Integer; stdcall;
begin
CurrThread.Client.MFinder.GetToleranceSpeed;
end;
procedure SetToleranceSpeed2Modifiers(nHue, nSat: Extended);
procedure SetToleranceSpeed2Modifiers(nHue, nSat: Extended); stdcall;
begin
CurrThread.Client.MFinder.SetToleranceSpeed2Modifiers(nHue, nSat);
end;
procedure GetToleranceSpeed2Modifiers(out hMod, sMod: Extended);
procedure GetToleranceSpeed2Modifiers(out hMod, sMod: Extended); stdcall;
begin
CurrThread.Client.MFinder.GetToleranceSpeed2Modifiers(hMod, sMod);
end;
function SimilarColors(Col1,Col2,Tol : integer) : boolean;
function SimilarColors(Col1,Col2,Tol : integer) : boolean; stdcall;
begin;
Result := CurrThread.Client.MFinder.SimilarColors(Col1,Col2,Tol);
end;
function CountColor(Color, xs, ys, xe, ye: Integer): Integer;
function CountColor(Color, xs, ys, xe, ye: Integer): Integer; stdcall;
begin;
result := CurrThread.Client.MFinder.CountColor(color,xs,ys,xe,ye);
end;
function CountColorTolerance(Color, xs, ys, xe, ye, Tolerance: Integer): Integer;
function CountColorTolerance(Color, xs, ys, xe, ye, Tolerance: Integer): Integer; stdcall;
begin;
result := CurrThread.Client.MFinder.CountColorTolerance(color,xs,ys,xe,ye,tolerance);
end;
function FindColorsToleranceOptimised(out Points: TPointArray; Color, xs, ys, xe, ye, Tolerance: Integer): Boolean;
function FindColorsToleranceOptimised(out Points: TPointArray; Color, xs, ys, xe, ye, Tolerance: Integer): Boolean; stdcall;
begin;
result := CurrThread.Client.MFinder.FindColorsToleranceOptimised(points,color,xs,ys,xe,ye,tolerance);
end;
function FindColorsTolerance(out Points: TPointArray; Color, xs, ys, xe, ye, Tolerance: Integer): Boolean;
function FindColorsTolerance(out Points: TPointArray; Color, xs, ys, xe, ye, Tolerance: Integer): Boolean; stdcall;
begin;
result := CurrThread.Client.MFinder.FindColorsTolerance(points,color,xs,ys,xe,ye,tolerance);
end;
function FindColorSpiral(var x, y: Integer; color, xs, ys, xe, ye: Integer): Boolean;
function FindColorSpiral(var x, y: Integer; color, xs, ys, xe, ye: Integer): Boolean; stdcall;
begin;
result := CurrThread.Client.MFinder.FindColorSpiral(x,y,color,xs,ys,xe,ye);
end;
function FindColorsSpiralTolerance(x, y: Integer; out Points: TPointArray; color, xs, ys, xe, ye: Integer; Tolerance: Integer) : boolean;
function FindColorsSpiralTolerance(x, y: Integer; out Points: TPointArray; color, xs, ys, xe, ye: Integer; Tolerance: Integer) : boolean; stdcall;
begin;
result := CurrThread.Client.MFinder.FindColorsSpiralTolerance(x,y,Points,color,xs,ys,xe,ye,tolerance);
end;
function FindColoredArea(var x, y: Integer; color, xs, ys, xe, ye: Integer; MinArea: Integer): Boolean;
function FindColoredArea(var x, y: Integer; color, xs, ys, xe, ye: Integer; MinArea: Integer): Boolean; stdcall;
begin;
result := CurrThread.Client.MFinder.FindColoredArea(x,y,color,xs,ys,xe,ye,minarea);
end;
function FindColoredAreaTolerance(var x, y: Integer; Color, xs, ys, xe, ye, MinArea, tol: Integer): Boolean;
function FindColoredAreaTolerance(var x, y: Integer; Color, xs, ys, xe, ye, MinArea, tol: Integer): Boolean; stdcall;
begin;
result := CurrThread.Client.MFinder.FindColoredAreaTolerance(x,y,color,xs,ys,xe,ye,minarea,tol);
end;

View File

@ -21,7 +21,7 @@
DTM.inc for the Mufasa Macro Library
}
function ps_FindDTM(DTM: Integer; out x, y: Integer; x1, y1, x2, y2: Integer): Boolean;
function ps_FindDTM(DTM: Integer; out x, y: Integer; x1, y1, x2, y2: Integer): Boolean; stdcall;
var
temp: pDTM;
begin
@ -35,7 +35,7 @@ begin
end;
end;
function ps_FindDTMs(DTM: Integer; out p: TPointArray; x1, y1, x2, y2: Integer): Boolean;
function ps_FindDTMs(DTM: Integer; out p: TPointArray; x1, y1, x2, y2: Integer): Boolean; stdcall;
var
temp: pDTM;
begin
@ -50,7 +50,7 @@ end;
function ps_FindDTMRotated(DTM: Integer; out x, y: Integer; x1, y1, x2, y2:
Integer; sAngle, eAngle, aStep: Extended;
out aFound: Extended): Boolean;
out aFound: Extended): Boolean; stdcall;
var
temp: pDTM;
begin
@ -64,7 +64,7 @@ begin
end;
end;
function ps_FindDTMsRotated(DTM: Integer; out Points: TPointArray; x1, y1, x2, y2: Integer; sAngle, eAngle, aStep: Extended; out aFound: T2DExtendedArray): Boolean;
function ps_FindDTMsRotated(DTM: Integer; out Points: TPointArray; x1, y1, x2, y2: Integer; sAngle, eAngle, aStep: Extended; out aFound: T2DExtendedArray): Boolean; stdcall;
var
temp: pDTM;
begin
@ -75,7 +75,7 @@ begin
Result := False;
end;
{function ps_FindDTMsRotated(DTM: Integer; out Points: TPointArray; x1,
{function ps_FindDTMsRotated(DTM: Integer; out Points: TPointArray; x1, stdcall;
y1, x2, y2: Integer; sAngle, eAngle,
aStep: Extended; out aFound: T2DExtendedArray)
: Boolean;
@ -84,7 +84,7 @@ begin
sAngle, eAngle, aStep, aFound);
end; }
function ps_DTMFromString(DTMString: String): Integer;
function ps_DTMFromString(DTMString: String): Integer; stdcall;
var
dtm: pDTM;
begin
@ -95,22 +95,22 @@ begin
end;
end;
procedure ps_FreeDTM(DTM: Integer);
procedure ps_FreeDTM(DTM: Integer); stdcall;
begin
CurrThread.Client.MDTM.FreeDTM(DTM);
end;
function ps_GetDTM(index: Integer; out dtm: pDTM): Boolean;
function ps_GetDTM(index: Integer; out dtm: pDTM): Boolean; stdcall;
begin
Result := CurrThread.Client.MDTM.GetDTM(index, dtm);
end;
function ps_AddDTM(d: TDTM): Integer;
function ps_AddDTM(d: TDTM): Integer; stdcall;
begin
Result := CurrThread.Client.MDTM.AddDTM(d);
end;
function ps_AddpDTM(d: pDTM): Integer;
function ps_AddpDTM(d: pDTM): Integer; stdcall;
begin
Result := CurrThread.Client.MDTM.AddpDTM(d);
end;

View File

@ -21,50 +21,50 @@
File.inc for the Mufasa Macro Library
}
function ps_CreateFile(Path: string): Integer;
function ps_CreateFile(Path: string): Integer; stdcall;
begin
Result := CurrThread.Client.MFiles.CreateFile(Path);
end;
function ps_OpenFile(Path: string; Shared: Boolean): Integer;
function ps_OpenFile(Path: string; Shared: Boolean): Integer; stdcall;
begin
Result := CurrThread.Client.MFiles.OpenFile(Path, Shared);
end;
function ps_RewriteFile(Path: string; Shared: Boolean): Integer;
function ps_RewriteFile(Path: string; Shared: Boolean): Integer; stdcall;
begin
Result := CurrThread.Client.MFiles.RewriteFile(Path, Shared);
end;
procedure ps_CloseFile(FileNum: Integer);
procedure ps_CloseFile(FileNum: Integer); stdcall;
begin
CurrThread.Client.MFiles.CloseFile(FileNum);
end;
function ps_EndOfFile(FileNum: Integer): Boolean;
function ps_EndOfFile(FileNum: Integer): Boolean; stdcall;
begin
Result := CurrThread.Client.MFiles.EndOfFile(FileNum);
end;
function ps_FileSize(FileNum: Integer): LongInt;
function ps_FileSize(FileNum: Integer): LongInt; stdcall;
begin
Result := CurrThread.Client.MFiles.FileSizeMuf(FileNum);
end;
function ps_ReadFileString(FileNum: Integer; out s: string; x: Integer): Boolean;
function ps_ReadFileString(FileNum: Integer; out s: string; x: Integer): Boolean; stdcall;
begin
Result := CurrThread.Client.MFiles.ReadFileString(FileNum, s, x);
end;
function ps_WriteFileString(FileNum: Integer; s: string): Boolean;
function ps_WriteFileString(FileNum: Integer; s: string): Boolean; stdcall;
begin
Result := CurrThread.Client.MFiles.WriteFileString(FileNum, s);
end;
function ps_SetFileCharPointer(FileNum, cChars, Origin: Integer): Integer;
function ps_SetFileCharPointer(FileNum, cChars, Origin: Integer): Integer; stdcall;
begin
Result := CurrThread.Client.MFiles.SetFileCharPointer(Filenum, cChars, Origin);
end;
function ps_FilePointerPos(FileNum: Integer): Integer;
function ps_FilePointerPos(FileNum: Integer): Integer; stdcall;
begin
Result := CurrThread.Client.MFiles.FilePointerPos(FileNum);
end;

View File

@ -1,4 +1,4 @@
function ps_GetPage(S: String): String;
function ps_GetPage(S: String): String; stdcall;
begin
result := GetPage(S);
end;

View File

@ -21,27 +21,27 @@
Keyboard.inc for the Mufasa Macro Library
}
procedure KeyDown(key: Word);
procedure KeyDown(key: Word); stdcall;
begin
CurrThread.Client.IOManager.KeyDown(key);
end;
procedure KeyUp(key: Word);
procedure KeyUp(key: Word); stdcall;
begin
CurrThread.Client.IOManager.KeyUp(key);
end;
procedure SendKeys(s: string);
procedure SendKeys(s: string); stdcall;
begin
CurrThread.Client.IOManager.SendText(s);
end;
procedure PressKey(key: Word);
procedure PressKey(key: Word); stdcall;
begin
CurrThread.Client.IOManager.PressKey(key);
end;
function isKeyDown(key: Word): boolean;
function isKeyDown(key: Word): boolean; stdcall;
begin
Result := CurrThread.Client.IOManager.isKeyDown(key);
end;

View File

@ -21,17 +21,17 @@
Math.inc for the Mufasa Macro Library
}
function psSqr( e : extended) : extended;
function psSqr( e : extended) : extended; stdcall;
begin;
result := sqr(e);
end;
function ps_RandomRange(const aFrom, aTo: Integer): Integer;
function ps_RandomRange(const aFrom, aTo: Integer): Integer; stdcall;
begin
Result:=Random(Abs(aFrom-aTo))+Min(aTo,AFrom);
end;
function Factorial(number: longword): Int64;
function Factorial(number: longword): Int64; stdcall;
var
Loop : longword;
begin
@ -40,12 +40,12 @@ begin
result := result * loop;
end;
function BinCoe(a, b: LongInt): Extended;
function BinCoe(a, b: LongInt): Extended; stdcall;
begin
result := Factorial(a) / (factorial(b) * factorial(a-b));
end;
function FixD(Degrees : extended) : Extended;
function FixD(Degrees : extended) : Extended; stdcall;
begin;
Result := Degrees;
while Result < 0 do
@ -54,7 +54,7 @@ begin;
Result := Result - 360;
end;
procedure psSwap(var A,B);
procedure psSwap(var A,B); stdcall;
var
TempPtr : Pointer;
begin;

View File

@ -25,16 +25,16 @@ const
ps_mouse_right = 0;
ps_mouse_left = 1;
ps_mouse_middle = 2;
procedure MoveMouse(x, y: integer);
procedure MoveMouse(x, y: integer); stdcall;
begin
CurrThread.Client.IOManager.SetMousePos(X, Y);
end;
procedure GetMousePos(out x, y: integer);
procedure GetMousePos(out x, y: integer); stdcall;
begin
CurrThread.Client.IOManager.GetMousePos(X, Y);
end;
function ConvIntClickType(Int : Integer) : TClickType;inline;
function ConvIntClickType(Int : Integer) : TClickType;inline; stdcall;
begin;
case int of
ps_mouse_right : result := mouse_Right;
@ -45,17 +45,17 @@ begin;
end;
end;
procedure HoldMouse(x, y: integer; clickType: integer);
procedure HoldMouse(x, y: integer; clickType: integer); stdcall;
begin
CurrThread.Client.IOManager.HoldMouse(x, y, ConvIntClickType(clickType));
end;
procedure ReleaseMouse(x, y: integer; clickType: integer);
procedure ReleaseMouse(x, y: integer; clickType: integer); stdcall;
begin
CurrThread.Client.IOManager.ReleaseMouse(x, y, ConvIntClickType(clickType));
end;
procedure ClickMouse(x, y: integer; clickType: integer);
procedure ClickMouse(x, y: integer; clickType: integer); stdcall;
begin
CurrThread.Client.IOManager.ClickMouse(x, y, ConvIntClickType(clickType));
end;

View File

@ -1,9 +1,9 @@
function rs_GetUpText: String;
function rs_GetUpText: String; stdcall;
begin
Result := CurrThread.Client.MOCR.GetUpTextAtEx(7, 7, true);
end;
function BitmapFromText(text, font: String): integer;
function BitmapFromText(text, font: String): integer; stdcall;
var
bmp: TMufasaBitmap;
begin
@ -12,12 +12,12 @@ begin
Result := CurrThread.Client.MBitmaps.AddBMP(bmp);
end;
function MaskFromText(text, font: String): TMask;
function MaskFromText(text, font: String): TMask; stdcall;
begin
Result := CurrThread.Client.MOCR.TextToMask(text,font);
end;
function TPAFromText(text, font: String): TPointArray;
function TPAFromText(text, font: String): TPointArray; stdcall;
var
w,h : integer;
begin

View File

@ -21,7 +21,7 @@
Other.inc for the Mufasa Macro Library
}
procedure psWait(t: Integer);
procedure psWait(t: Integer); stdcall;
{$ifdef MSWINDOWS}
begin
Sleep(t);
@ -42,13 +42,13 @@ begin
end;
{$endif}
procedure ClearDebug;
procedure ClearDebug; stdcall;
begin
if Assigned(CurrThread.DebugMemo) then
CurrThread.Synchronize(@CurrThread.DebugMemo.Clear);
end;
procedure SaveScreenshot(FileName: string);
procedure SaveScreenshot(FileName: string); stdcall;
var
w,h : integer;
bmp: TMufasaBitmap;
@ -60,12 +60,12 @@ begin;
bmp.Free;
end;
function MinE(a, b: Extended): Extended;
function MinE(a, b: Extended): Extended; stdcall;
begin;
result := min(a,b);
end;
function IntToBox(x1,y1,x2,y2 : integer) : TBox;
function IntToBox(x1,y1,x2,y2 : integer) : TBox; stdcall;
begin;
result.x1 := x1;
result.y1 := y1;
@ -73,45 +73,45 @@ begin;
result.y2 := y2;
end;
function IntInBox(x, y: Integer; Box: TBox): Boolean;
function IntInBox(x, y: Integer; Box: TBox): Boolean; stdcall;
begin;
result := (((x >= Box.x1) and(x <= Box.x2)) and ((y >= box.y1) and (y <= box.y2)));
end;
function Distance(x1, y1, x2, y2: Integer): Integer;
function Distance(x1, y1, x2, y2: Integer): Integer; stdcall;
begin;
Result := Round(Sqrt(Sqr(x2-x1) + Sqr(y2-y1)));
end;
procedure DisplayDebugImgWindow(w,h : integer);
procedure DisplayDebugImgWindow(w,h : integer); stdcall;
begin;
CurrThread.DebugImg.DispSize^ := Classes.Point(w,h);
CurrThread.Synchronize( CurrThread.DebugImg.ShowForm);
end;
procedure DrawBitmapDebugImg(bmp : integer);
procedure DrawBitmapDebugImg(bmp : integer); stdcall;
begin;
CurrThread.DebugImg.ToDrawBitmap^ := CurrThread.Client.MBitmaps[bmp];
CurrThread.Synchronize(CurrThread.DebugImg.DrawBitmap);
end;
function GetDebugBitmap : integer;
function GetDebugBitmap : integer; stdcall;
begin;
result := CurrThread.Client.MBitmaps.CreateBMP(0,0);
CurrThread.DebugImg.GetDebugBitmap^ := CurrThread.Client.MBitmaps[result];
CurrThread.Synchronize(CurrThread.DebugImg.GetBitmap);
end;
procedure TerminateScript;
procedure TerminateScript; stdcall;
begin;
CurrThread.Terminate;
end;
function GetTimeRunning: LongWord;
function GetTimeRunning: LongWord; stdcall;
begin;
result := GetTickCount - CurrThread.StartTime;
end;
procedure ConvertTime(Time : integer; var h,m,s : integer);
procedure ConvertTime(Time : integer; var h,m,s : integer); stdcall;
var
x : integer;
begin;
@ -123,7 +123,7 @@ begin;
s := x div (1000);
end;
procedure HakunaMatata;
procedure HakunaMatata; stdcall;
begin;
OpenWebPage('http://www.youtube.com/v/ejEVczA8PLU&hl=en&fs=1&autoplay=1');
end;

View File

@ -1,9 +1,9 @@
function psFormat(const fmt : string;const args : array of const) : string;
function psFormat(const fmt : string;const args : array of const) : string; stdcall;
begin;
Result := Format(fmt,Args);
end;
function Capitalize(str : string) : string;
function Capitalize(str : string) : string; stdcall;
var
i , l : integer;
cap : boolean;
@ -20,7 +20,7 @@ begin;
cap := true;
end;
function psBoolToStr(bool : boolean) : string;
function psBoolToStr(bool : boolean) : string; stdcall;
begin;
result := BoolToStr(bool,true);
end;

View File

@ -21,74 +21,74 @@
window.inc for the Mufasa Macro Library
}
procedure SetDesktopAsClient;
procedure SetDesktopAsClient; stdcall;
begin;
CurrThread.Client.IOManager.SetDesktop;
end;
function SetTargetArray(P: Integer; w, h: integer): integer;
function SetTargetArray(P: Integer; w, h: integer): integer; stdcall;
begin
result:= CurrThread.Client.IOManager.SetTarget(PRGB32(P), classes.point(w,h));
end;
function SetTargetBitmap(bitmap: Integer): integer;
function SetTargetBitmap(bitmap: Integer): integer; stdcall;
begin;
result:= CurrThread.Client.IOManager.SetTarget(CurrThread.Client.MBitmaps[Bitmap]);
end;
function SetEIOSTarget(name: string; args: Variant): integer;
function SetEIOSTarget(name: string; args: Variant): integer; stdcall;
begin
result:= CurrThread.Client.IOManager.SetTarget(name, @args);
end;
procedure SetImageTarget(idx: integer);
procedure SetImageTarget(idx: integer); stdcall;
begin
CurrThread.Client.IOManager.SetImageTarget(idx);
end;
procedure SetKeyMouseTarget(idx: integer);
procedure SetKeyMouseTarget(idx: integer); stdcall;
begin
CurrThread.Client.IOManager.SetKeyMouseTarget(idx);
end;
function GetImageTarget: integer;
function GetImageTarget: integer; stdcall;
begin
CurrThread.Client.IOManager.GetImageTarget(result);
end;
function GetKeyMouseTarget: integer;
function GetKeyMouseTarget: integer; stdcall;
begin
CurrThread.Client.IOManager.GetKeyMouseTarget(result);
end;
procedure FreeTarget(idx: integer);
procedure FreeTarget(idx: integer); stdcall;
begin
CurrThread.Client.IOManager.FreeTarget(idx);
end;
procedure GetClientDimensions(out w, h: integer);
procedure GetClientDimensions(out w, h: integer); stdcall;
begin
CurrThread.Client.IOManager.GetDimensions(w, h);
end;
function Freeze: boolean;
function Freeze: boolean; stdcall;
begin
CurrThread.Client.IOManager.SetFrozen(true);
result := true; //dunno what the result is supposed to mean
end;
function Unfreeze: boolean;
function Unfreeze: boolean; stdcall;
begin
CurrThread.Client.IOManager.SetFrozen(false);
result := true; //dunno what the result is supposed to mean
end;
procedure ActivateClient;
procedure ActivateClient; stdcall;
begin
CurrThread.Client.IOManager.ActivateClient;
end;
function IsTargetValid: boolean;
function IsTargetValid: boolean; stdcall;
begin
result:= CurrThread.Client.IOManager.TargetValid;
end;

View File

@ -471,7 +471,7 @@ begin
//Export all the methods
for i := 0 to high(ExportedMethods) do
if ExportedMethods[i].FuncPtr <> nil then
PSScript.AddFunction(ExportedMethods[i].FuncPtr,ExportedMethods[i].FuncDecl);
PSScript.AddFunctionEx(ExportedMethods[i].FuncPtr,ExportedMethods[i].FuncDecl,cdStdCall);
end;
function TPSThread.RequireFile(Sender: TObject;