1
0
mirror of https://github.com/moparisthebest/Simba synced 2024-11-22 17:22:21 -05:00

Wrappers for PS.

git-svn-id: http://www.villavu.com/repositories/merlijn/mufasa@457 3f818213-9676-44b0-a9b4-5e4c4e03d09d
This commit is contained in:
Wizzup? 2010-01-24 11:45:02 +00:00
parent 778b81a9ae
commit d20f973f61
3 changed files with 40 additions and 0 deletions

View File

@ -2,3 +2,20 @@ function rs_GetUpText: String;
begin begin
Result := CurrThread.Client.MOCR.GetUpTextAtEx(7, 7, true); Result := CurrThread.Client.MOCR.GetUpTextAtEx(7, 7, true);
end; end;
function BitmapFromTextFont(text, font: String): integer;
var
bmp: TMufasaBitmap;
begin
writeln('BitmapFromText: ' + text + ' ' + font);
bmp := CurrThread.Client.MOCR.TextToFontBitmap(text, font);
Result := CurrThread.Client.MBitmaps.AddBMP(bmp);
end;
function TPAFromTextFont(text, font: String): TPointArray;
var
w,h : integer;
begin
Result := CurrThread.Client.MOCR.TextToFontTPA(text, font, w, h);
end;

View File

@ -173,6 +173,8 @@ AddFunction(@isKeyDown, 'function IsKeyDown(key: Word): Boolean;');
{ OCR} { OCR}
SetCurrSection('OCR'); SetCurrSection('OCR');
AddFunction(@rs_GetUpText, 'function rs_GetUpText: string;'); AddFunction(@rs_GetUpText, 'function rs_GetUpText: string;');
AddFunction(@BitmapFromTextFont, 'function BitmapFromTextFont(text, font: String): integer;');
AddFunction(@TPAFromTextFont, 'function TPAFromTextFont(text, font: String): TPointArray;');
{Bitmaps} {Bitmaps}

View File

@ -100,6 +100,7 @@ type
function GetBMP(Index : integer) : TMufasaBitmap; function GetBMP(Index : integer) : TMufasaBitmap;
property Bmp[Index : integer]: TMufasaBitmap read GetBMP; property Bmp[Index : integer]: TMufasaBitmap read GetBMP;
function CreateBMP(w, h: integer): Integer; function CreateBMP(w, h: integer): Integer;
function AddBMP(_bmp: TMufasaBitmap): Integer;
function CopyBMP( Bitmap : integer) : Integer; function CopyBMP( Bitmap : integer) : Integer;
function CreateMirroredBitmap(bitmap: Integer; MirrorStyle : TBmpMirrorStyle): Integer; function CreateMirroredBitmap(bitmap: Integer; MirrorStyle : TBmpMirrorStyle): Integer;
function CreateBMPFromFile(const Path : string) : integer; function CreateBMPFromFile(const Path : string) : integer;
@ -196,6 +197,26 @@ begin
BmpArray[Result].Index:= Result; BmpArray[Result].Index:= Result;
end; end;
function TMBitmaps.AddBMP(_bmp: TMufasaBitmap): Integer;
begin
if BmpsCurr < BmpsHigh then
begin;
inc(BmpsCurr);
Result := BmpsCurr;
end else if (FreeSpotsHigh > -1) then
begin;
Result := FreeSpots[FreeSpotsHigh];
dec(FreeSpotsHigh);
end else
begin;
SetLength(BmpArray, BmpsHigh + 6);
BmpsHigh := BmpsHigh + 5;
inc(BmpsCurr);
Result := BmpsCurr;
end;
BmpArray[Result] := _bmp;
end;
function TMBitmaps.CopyBMP(Bitmap: integer): Integer; function TMBitmaps.CopyBMP(Bitmap: integer): Integer;
var var
InputBMP : TMufasaBitmap; InputBMP : TMufasaBitmap;