mirror of
https://github.com/moparisthebest/Simba
synced 2024-08-13 16:53:59 -04:00
Cleanup (deleted unneeded variables etc).
git-svn-id: http://www.villavu.com/repositories/merlijn/mufasa@574 3f818213-9676-44b0-a9b4-5e4c4e03d09d
This commit is contained in:
parent
77b4ea33ea
commit
9e398674ae
@ -31,17 +31,17 @@ interface
|
|||||||
|
|
||||||
uses
|
uses
|
||||||
{$ifdef linux}cthreads,{$endif}Classes, SysUtils, FileUtil, LResources, Forms, Controls, Graphics, Dialogs,
|
{$ifdef linux}cthreads,{$endif}Classes, SysUtils, FileUtil, LResources, Forms, Controls, Graphics, Dialogs,
|
||||||
StdCtrls, Menus, ComCtrls, ExtCtrls, SynEdit, SynHighlighterPas, SynMemo,
|
StdCtrls, Menus, ComCtrls, ExtCtrls, SynEdit, SynHighlighterPas,
|
||||||
//Client,
|
//Client,
|
||||||
MufasaTypes,
|
MufasaTypes,
|
||||||
mmlpsthread,synedittypes,
|
mmlpsthread,synedittypes,
|
||||||
{$IFDEF MSWINDOWS} os_windows, {$ENDIF} //For ColorPicker etc.
|
{$IFDEF MSWINDOWS} os_windows, {$ENDIF} //For ColorPicker etc.
|
||||||
{$IFDEF LINUX} os_linux, {$ENDIF} //For ColorPicker etc.
|
{$IFDEF LINUX} os_linux, {$ENDIF} //For ColorPicker etc.
|
||||||
colourpicker, framescript, windowselector, lcltype, ActnList, StdActns,
|
colourpicker, framescript, windowselector, lcltype, ActnList,
|
||||||
SynExportHTML, SynEditKeyCmds, SynEditHighlighter, SynEditMarkupSpecialLine,
|
SynExportHTML, SynEditKeyCmds, SynEditHighlighter,
|
||||||
SynEditMarkupHighAll, SynEditMiscClasses, LMessages, Buttons, PairSplitter,
|
SynEditMarkupHighAll, LMessages, Buttons,
|
||||||
stringutil,mufasatypesutil,
|
stringutil,mufasatypesutil,
|
||||||
ColorBox , about, framefunctionlist, ocr, updateform, simbasettings;
|
about, framefunctionlist, ocr, updateform, simbasettings;
|
||||||
|
|
||||||
const
|
const
|
||||||
SimbaVersion = 571;
|
SimbaVersion = 571;
|
||||||
@ -379,12 +379,10 @@ var
|
|||||||
|
|
||||||
implementation
|
implementation
|
||||||
uses
|
uses
|
||||||
lclintf,plugins,
|
lclintf,
|
||||||
syncobjs, // for the critical sections
|
syncobjs, // for the critical sections
|
||||||
debugimage,
|
debugimage,
|
||||||
bitmaps,
|
|
||||||
colourhistory,
|
colourhistory,
|
||||||
simpleanalyzer,
|
|
||||||
math;
|
math;
|
||||||
|
|
||||||
//{$ifdef mswindows}
|
//{$ifdef mswindows}
|
||||||
@ -1729,6 +1727,7 @@ var
|
|||||||
Temp2Node : TTreeNode;
|
Temp2Node : TTreeNode;
|
||||||
Tree : TTreeView;
|
Tree : TTreeView;
|
||||||
begin
|
begin
|
||||||
|
SetLength(nodes,0);
|
||||||
if frmFunctionList.FunctionList.Items.Count = 0 then
|
if frmFunctionList.FunctionList.Items.Count = 0 then
|
||||||
begin;
|
begin;
|
||||||
Methods := TMThread.GetExportedMethods;
|
Methods := TMThread.GetExportedMethods;
|
||||||
@ -1997,12 +1996,6 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TForm1.FunctionListShown(ShowIt: boolean);
|
procedure TForm1.FunctionListShown(ShowIt: boolean);
|
||||||
var
|
|
||||||
Node : TTreeNode;
|
|
||||||
tmpNode : TTreeNode;
|
|
||||||
Tree : TTreeView;
|
|
||||||
Analyzer : TScriptAnalyzer;
|
|
||||||
I,ii : integer;
|
|
||||||
begin
|
begin
|
||||||
with MenuItemFunctionList, frmFunctionList do
|
with MenuItemFunctionList, frmFunctionList do
|
||||||
begin
|
begin
|
||||||
@ -2158,8 +2151,6 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
function TForm1.CanExitOrOpen: boolean;
|
function TForm1.CanExitOrOpen: boolean;
|
||||||
var
|
|
||||||
I : integer;
|
|
||||||
begin;
|
begin;
|
||||||
Self.Enabled := False;//We HAVE to answer the popup
|
Self.Enabled := False;//We HAVE to answer the popup
|
||||||
Result := True;
|
Result := True;
|
||||||
@ -2194,8 +2185,10 @@ end;
|
|||||||
|
|
||||||
function TForm1.ClearScript: boolean;
|
function TForm1.ClearScript: boolean;
|
||||||
begin
|
begin
|
||||||
|
result := false;
|
||||||
if CanExitOrOpen then
|
if CanExitOrOpen then
|
||||||
begin;
|
begin;
|
||||||
|
result := true;
|
||||||
CurrTab.Clear;
|
CurrTab.Clear;
|
||||||
RefreshTab();
|
RefreshTab();
|
||||||
end;
|
end;
|
||||||
|
@ -3,14 +3,14 @@ begin
|
|||||||
result := GetPage(S);
|
result := GetPage(S);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function ps_InitializeHTTPClient(HandleCookies, HandleRedirects: Boolean): Integer; extdecl;
|
function ps_InitializeHTTPClient(HandleCookies: Boolean): Integer; extdecl;
|
||||||
begin
|
begin
|
||||||
result := CurrThread.MInternet.CreateHTTPClient(HandleCookies);
|
result := CurrThread.MInternet.CreateHTTPClient(HandleCookies);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure ps_FreeHTTPClient(Client: Integer); extdecl;
|
procedure ps_FreeHTTPClient(Client: Integer); extdecl;
|
||||||
begin;
|
begin;
|
||||||
CurrThread.MInternet.GetHTTPClient(Client).Free;
|
CurrThread.MInternet.FreeHTTPClient(client);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function ps_GetHTTPPage(Client: Integer; URL: string): string; extdecl;
|
function ps_GetHTTPPage(Client: Integer; URL: string): string; extdecl;
|
||||||
|
@ -159,7 +159,7 @@ AddFunction(@ps_explodewrap,'procedure ExplodeWrap(del, str: string; var res : T
|
|||||||
SetCurrSection('Web');
|
SetCurrSection('Web');
|
||||||
AddFunction(@OpenWebPage,'procedure OpenWebPage(url : string);');
|
AddFunction(@OpenWebPage,'procedure OpenWebPage(url : string);');
|
||||||
AddFunction(@ps_GetPage,'function GetPage(url : string): string;');
|
AddFunction(@ps_GetPage,'function GetPage(url : string): string;');
|
||||||
AddFunction(@ps_InitializeHTTPClient,'function InitializeHTTPClient(HandleCookies, HandleRedirects: Boolean): Integer;');
|
AddFunction(@ps_InitializeHTTPClient,'function InitializeHTTPClient(HandleCookies: Boolean): Integer;');
|
||||||
AddFunction(@ps_FreeHTTPClient,'procedure FreeHTTPClient(Client: Integer);');
|
AddFunction(@ps_FreeHTTPClient,'procedure FreeHTTPClient(Client: Integer);');
|
||||||
AddFunction(@ps_GetHTTPPage,'function GetHTTPPage(Client: Integer; URL: string): string;');
|
AddFunction(@ps_GetHTTPPage,'function GetHTTPPage(Client: Integer; URL: string): string;');
|
||||||
AddFunction(@ps_SetHTTPUserAgent,'procedure SetHTTPUserAgent(Client: Integer; Agent: string);');
|
AddFunction(@ps_SetHTTPUserAgent,'procedure SetHTTPUserAgent(Client: Integer; Agent: string);');
|
||||||
|
@ -44,8 +44,6 @@ type
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
implementation
|
implementation
|
||||||
uses
|
|
||||||
synacode;
|
|
||||||
|
|
||||||
{ OTHER }
|
{ OTHER }
|
||||||
function GetPage(URL: String): String;
|
function GetPage(URL: String): String;
|
||||||
|
@ -227,8 +227,6 @@ begin;
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
function writeln_(Caller: TPSExec; p: TPSExternalProcRec; Global, Stack: TPSStack): Boolean;
|
function writeln_(Caller: TPSExec; p: TPSExternalProcRec; Global, Stack: TPSStack): Boolean;
|
||||||
var
|
|
||||||
arr: TPSVariantIFC;
|
|
||||||
begin
|
begin
|
||||||
Result:=true;
|
Result:=true;
|
||||||
psWriteln(makeString(NewTPSVariantIFC(Stack[Stack.Count-1],false)));
|
psWriteln(makeString(NewTPSVariantIFC(Stack[Stack.Count-1],false)));
|
||||||
@ -259,8 +257,6 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
function ToStr_(Caller: TPSExec; p: TPSExternalProcRec; Global, Stack: TPSStack): Boolean;
|
function ToStr_(Caller: TPSExec; p: TPSExternalProcRec; Global, Stack: TPSStack): Boolean;
|
||||||
var
|
|
||||||
data: TPSVariantIFC;
|
|
||||||
begin
|
begin
|
||||||
result := true;
|
result := true;
|
||||||
Stack.SetAnsiString(-1, MakeString(NewTPSVariantIFC(Stack[Stack.Count-2],false)));
|
Stack.SetAnsiString(-1, MakeString(NewTPSVariantIFC(Stack[Stack.Count-2],false)));
|
||||||
@ -527,6 +523,7 @@ function TPSThread.PSScriptFindUnknownFile(Sender: TObject;
|
|||||||
const OrginFileName: string; var FileName, Output: string): Boolean;
|
const OrginFileName: string; var FileName, Output: string): Boolean;
|
||||||
begin
|
begin
|
||||||
Writeln(OrginFileName + '-' + Output + '-' + FileName);
|
Writeln(OrginFileName + '-' + Output + '-' + FileName);
|
||||||
|
Result := false;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TPSThread.PSScriptProcessUnknowDirective(Sender: TPSPreProcessor;
|
procedure TPSThread.PSScriptProcessUnknowDirective(Sender: TPSPreProcessor;
|
||||||
@ -762,8 +759,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
function Interpreter_Precompiler(name, args: PChar): boolean; stdcall;
|
function Interpreter_Precompiler(name, args: PChar): boolean; stdcall;
|
||||||
var
|
|
||||||
local_name, local_args: string;
|
|
||||||
begin
|
begin
|
||||||
result:= CurrThread.ProcessDirective(name, args);
|
result:= CurrThread.ProcessDirective(name, args);
|
||||||
end;
|
end;
|
||||||
@ -818,7 +814,7 @@ end;
|
|||||||
|
|
||||||
procedure TCPThread.Execute;
|
procedure TCPThread.Execute;
|
||||||
var
|
var
|
||||||
i,ii: integer;
|
i: integer;
|
||||||
begin
|
begin
|
||||||
CurrThread := Self;
|
CurrThread := Self;
|
||||||
Starttime := GetTickCount;
|
Starttime := GetTickCount;
|
||||||
|
@ -28,14 +28,11 @@ unit settings;
|
|||||||
interface
|
interface
|
||||||
|
|
||||||
uses
|
uses
|
||||||
Classes, SysUtils, ComCtrls, xmlread, xmlwrite, DOM;
|
Classes, SysUtils, ComCtrls, xmlread, xmlwrite, DOM,mufasatypes;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
type
|
type
|
||||||
// remove later
|
|
||||||
TStringArray = Array Of String;
|
|
||||||
|
|
||||||
TSettingData = class(TObject)
|
TSettingData = class(TObject)
|
||||||
public
|
public
|
||||||
Val: String;
|
Val: String;
|
||||||
@ -104,7 +101,7 @@ type
|
|||||||
|
|
||||||
implementation
|
implementation
|
||||||
uses
|
uses
|
||||||
strutils;
|
stringutil;
|
||||||
|
|
||||||
constructor TSettingData.Create;
|
constructor TSettingData.Create;
|
||||||
begin
|
begin
|
||||||
@ -184,30 +181,8 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
function TMMLSettings.KeyNameToKeys(KeyName: String): TStringArray;
|
function TMMLSettings.KeyNameToKeys(KeyName: String): TStringArray;
|
||||||
// yay for SRL!
|
|
||||||
function srl_Explode(str, del: string): TStringArray;
|
|
||||||
var
|
|
||||||
i, l, dL: Integer;
|
|
||||||
begin
|
|
||||||
i := 0;
|
|
||||||
l := -1;
|
|
||||||
SetLength(Result, 0);
|
|
||||||
if (str = '') then
|
|
||||||
Exit;
|
|
||||||
dL := Length(del) - 1;
|
|
||||||
repeat
|
|
||||||
Inc(l);
|
|
||||||
SetLength(Result, l + 1);
|
|
||||||
i := Pos(del, str);
|
|
||||||
if i <= 0 then
|
|
||||||
Break;
|
|
||||||
Result[l] := Copy(str, 1, i - 1);
|
|
||||||
Delete(str, 1, i + dL);
|
|
||||||
until false;
|
|
||||||
Result[l] := Copy(str, 1, Length(str));
|
|
||||||
end;
|
|
||||||
begin
|
begin
|
||||||
Result := srl_Explode(KeyName, '/');
|
Result := Explode('/',KeyName);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TMMLSettings.WalkToNode(KeyName: String): TTreeNode;
|
function TMMLSettings.WalkToNode(KeyName: String): TTreeNode;
|
||||||
@ -277,8 +252,6 @@ end;
|
|||||||
function TMMLSettings.ListKeys(KeyName: String): TStringArray;
|
function TMMLSettings.ListKeys(KeyName: String): TStringArray;
|
||||||
var
|
var
|
||||||
N: TTreeNode;
|
N: TTreeNode;
|
||||||
i: Integer;
|
|
||||||
S: TStringArray;
|
|
||||||
begin
|
begin
|
||||||
SetLength(Result, 0);
|
SetLength(Result, 0);
|
||||||
N := WalkToNode(KeyName);
|
N := WalkToNode(KeyName);
|
||||||
@ -552,10 +525,6 @@ end;
|
|||||||
procedure TMMLSettings.WriteXMLData(n: TTreeNode;
|
procedure TMMLSettings.WriteXMLData(n: TTreeNode;
|
||||||
XMLNode: TDOMNode; XMLDoc: TXMLDocument;
|
XMLNode: TDOMNode; XMLDoc: TXMLDocument;
|
||||||
var XMLChild: TDOMNode; var C: Integer);
|
var XMLChild: TDOMNode; var C: Integer);
|
||||||
|
|
||||||
var
|
|
||||||
DDataNode, DataNode: TDOMNode;
|
|
||||||
|
|
||||||
begin
|
begin
|
||||||
if assigned(n.data) and (n.HasChildren) then
|
if assigned(n.data) and (n.HasChildren) then
|
||||||
writeln('Has data and children! Please close simba and remove settings.xml. if problem persists, please report your settings.xml');
|
writeln('Has data and children! Please close simba and remove settings.xml. if problem persists, please report your settings.xml');
|
||||||
|
@ -84,7 +84,7 @@ begin;
|
|||||||
result := str;
|
result := str;
|
||||||
l := length(str);
|
l := length(str);
|
||||||
cap := true;
|
cap := true;
|
||||||
Range := ['a'..'z'] + ['A'..'Z'];
|
Range := ['a'..'z','A'..'Z'];
|
||||||
for i := 1 to l do
|
for i := 1 to l do
|
||||||
if cap and (str[i] in Range) then
|
if cap and (str[i] in Range) then
|
||||||
begin;
|
begin;
|
||||||
@ -101,9 +101,10 @@ var
|
|||||||
begin;
|
begin;
|
||||||
case Extract of
|
case Extract of
|
||||||
Numbers : Range := ['0'..'9'];
|
Numbers : Range := ['0'..'9'];
|
||||||
Letters : Range := ['A'..'Z'] + ['a'..'z'];
|
Letters : Range := ['A'..'Z','a'..'z'];
|
||||||
Others : Range := [#0..#255] - ['0'..'9'] - ['A'..'Z'] - ['a'..'z'];
|
Others : Range := [#0..#255] - ['0'..'9','A'..'Z','a'..'z'];
|
||||||
end;
|
end;
|
||||||
|
Result := '';
|
||||||
for i := length(str) downto 1 do
|
for i := length(str) downto 1 do
|
||||||
if str[i] in Range then
|
if str[i] in Range then
|
||||||
result := str[i] + result;
|
result := str[i] + result;
|
||||||
|
@ -85,8 +85,7 @@ type
|
|||||||
|
|
||||||
|
|
||||||
implementation
|
implementation
|
||||||
uses
|
|
||||||
strings;
|
|
||||||
|
|
||||||
procedure TMMLFileDownloader.SetBasePath(s: string);
|
procedure TMMLFileDownloader.SetBasePath(s: string);
|
||||||
begin
|
begin
|
||||||
@ -128,9 +127,6 @@ end;
|
|||||||
|
|
||||||
procedure TMMLFileDownloader.OnMonitor(Sender: TObject; Writing: Boolean;
|
procedure TMMLFileDownloader.OnMonitor(Sender: TObject; Writing: Boolean;
|
||||||
const Buffer: TMemory; Len: Integer);
|
const Buffer: TMemory; Len: Integer);
|
||||||
|
|
||||||
var
|
|
||||||
i,p:integer;
|
|
||||||
begin
|
begin
|
||||||
if writing then exit;
|
if writing then exit;
|
||||||
Inc(FTotal, len);
|
Inc(FTotal, len);
|
||||||
@ -154,8 +150,6 @@ function TMMLFileDownloader.DownloadAndSave: Boolean;
|
|||||||
|
|
||||||
var
|
var
|
||||||
response: TStream;
|
response: TStream;
|
||||||
i:integer;
|
|
||||||
f: TFileStream;
|
|
||||||
|
|
||||||
begin
|
begin
|
||||||
Result := False;
|
Result := False;
|
||||||
|
@ -120,7 +120,7 @@ implementation
|
|||||||
|
|
||||||
uses
|
uses
|
||||||
paszlib,DCPbase64,math,
|
paszlib,DCPbase64,math,
|
||||||
colour_conv,IOManager,mufasatypesutil,tpa;
|
colour_conv,IOManager,mufasatypesutil;
|
||||||
|
|
||||||
// Needs more fixing. We need to either copy the memory ourself, or somehow
|
// Needs more fixing. We need to either copy the memory ourself, or somehow
|
||||||
// find a TRawImage feature to skip X bytes after X bytes read. (Most likely a
|
// find a TRawImage feature to skip X bytes after X bytes read. (Most likely a
|
||||||
@ -651,7 +651,7 @@ end;
|
|||||||
|
|
||||||
function TMufasaBitmap.CreateTPA(SearchCol: TColor): TPointArray;
|
function TMufasaBitmap.CreateTPA(SearchCol: TColor): TPointArray;
|
||||||
var
|
var
|
||||||
x,y,L,I : Integer;
|
x,y,L : Integer;
|
||||||
StartPtr : PRGB32;
|
StartPtr : PRGB32;
|
||||||
Search : TRGB32;
|
Search : TRGB32;
|
||||||
begin
|
begin
|
||||||
@ -661,7 +661,7 @@ begin
|
|||||||
StartPtr := Self.FData;
|
StartPtr := Self.FData;
|
||||||
For y := 0 to Self.h - 1 do
|
For y := 0 to Self.h - 1 do
|
||||||
For x := 0 to self.w - 1 do
|
For x := 0 to self.w - 1 do
|
||||||
if LongWord(StartPtr^) = LongWord(SearchCol) then
|
if LongWord(StartPtr^) = LongWord(Search) then
|
||||||
begin;
|
begin;
|
||||||
L := L + 1;
|
L := L + 1;
|
||||||
Result[L].x := x;
|
Result[L].x := x;
|
||||||
|
@ -76,7 +76,7 @@ type
|
|||||||
|
|
||||||
implementation
|
implementation
|
||||||
uses
|
uses
|
||||||
Client, dtmutil, paszlib,
|
dtmutil, paszlib,
|
||||||
graphics, // for TColor
|
graphics, // for TColor
|
||||||
math // for max
|
math // for max
|
||||||
;
|
;
|
||||||
@ -124,11 +124,11 @@ begin
|
|||||||
inherited Destroy;
|
inherited Destroy;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
Function AreaShape(Color, Tolerance, Size, Shape: Integer; P: TPoint) : Boolean; inline;
|
{Function AreaShape(Color, Tolerance, Size, Shape: Integer; P: TPoint) : Boolean; inline;
|
||||||
|
|
||||||
Begin
|
Begin
|
||||||
|
|
||||||
End;
|
End;}
|
||||||
|
|
||||||
// Rotates the given point (p) by A (in radians) around the point defined by cx, cy.
|
// Rotates the given point (p) by A (in radians) around the point defined by cx, cy.
|
||||||
|
|
||||||
|
@ -54,7 +54,7 @@ const
|
|||||||
implementation
|
implementation
|
||||||
uses math;
|
uses math;
|
||||||
|
|
||||||
Function RotatePoints_(Var P: TPointArray; A, cx, cy: Extended): TPointArray ;
|
procedure RotatePoints_(Var P: TPointArray; A, cx, cy: Extended);
|
||||||
|
|
||||||
Var
|
Var
|
||||||
I, L: Integer;
|
I, L: Integer;
|
||||||
@ -282,9 +282,6 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
function RotateDTM(const dtm: pdtm; angle: extended) : pDTM;
|
function RotateDTM(const dtm: pdtm; angle: extended) : pDTM;
|
||||||
|
|
||||||
var
|
|
||||||
i: integer;
|
|
||||||
begin
|
begin
|
||||||
if length(dtm.p) = 0 then
|
if length(dtm.p) = 0 then
|
||||||
raise Exception.Create('RotateDTM, no points in DTM.');
|
raise Exception.Create('RotateDTM, no points in DTM.');
|
||||||
@ -293,8 +290,6 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
function copydtm(const dtm: pdtm): pdtm;
|
function copydtm(const dtm: pdtm): pdtm;
|
||||||
var
|
|
||||||
i: integer;
|
|
||||||
begin
|
begin
|
||||||
initdtm(result,dtm.l);
|
initdtm(result,dtm.l);
|
||||||
Move(dtm.p[0], result.p[0], length(dtm.p) * sizeof(Tpoint));
|
Move(dtm.p[0], result.p[0], length(dtm.p) * sizeof(Tpoint));
|
||||||
|
@ -379,8 +379,6 @@ end;
|
|||||||
/\}
|
/\}
|
||||||
|
|
||||||
function TMFiles.FileSizeMuf(FileNum: Integer): LongInt;
|
function TMFiles.FileSizeMuf(FileNum: Integer): LongInt;
|
||||||
Var
|
|
||||||
tempPos: Integer;
|
|
||||||
begin
|
begin
|
||||||
|
|
||||||
If(FileNum < 0) or (FileNum >= Length(MFiles)) Then
|
If(FileNum < 0) or (FileNum >= Length(MFiles)) Then
|
||||||
@ -472,8 +470,6 @@ end;
|
|||||||
/\}
|
/\}
|
||||||
|
|
||||||
function TMFiles.WriteFileString(FileNum: Integer; s: string): Boolean;
|
function TMFiles.WriteFileString(FileNum: Integer; s: string): Boolean;
|
||||||
var
|
|
||||||
BytesRead : DWord;
|
|
||||||
begin
|
begin
|
||||||
If(FileNum < 0) or (FileNum >= Length(MFiles)) Then
|
If(FileNum < 0) or (FileNum >= Length(MFiles)) Then
|
||||||
Begin
|
Begin
|
||||||
|
@ -80,7 +80,7 @@ type
|
|||||||
function FindBitmapSpiral(bitmap: TMufasaBitmap; var x, y: Integer; xs, ys, xe, ye: Integer): Boolean;
|
function FindBitmapSpiral(bitmap: TMufasaBitmap; var x, y: Integer; xs, ys, xe, ye: Integer): Boolean;
|
||||||
function FindBitmapSpiralTolerance(bitmap: TMufasaBitmap; var x, y: Integer; xs, ys, xe, ye,tolerance : integer): Boolean;
|
function FindBitmapSpiralTolerance(bitmap: TMufasaBitmap; var x, y: Integer; xs, ys, xe, ye,tolerance : integer): Boolean;
|
||||||
function FindBitmapsSpiralTolerance(bitmap: TMufasaBitmap; x, y: Integer; out Points : TPointArray; xs, ys, xe, ye,tolerance: Integer): Boolean;
|
function FindBitmapsSpiralTolerance(bitmap: TMufasaBitmap; x, y: Integer; out Points : TPointArray; xs, ys, xe, ye,tolerance: Integer): Boolean;
|
||||||
function FindDeformedBitmapToleranceIn(bitmap: TMufasaBitmap; out x, y: Integer; xs, ys, xe, ye: Integer; tolerance: Integer; Range: Integer; AllowPartialAccuracy: Boolean; var accuracy: Extended): Boolean;
|
function FindDeformedBitmapToleranceIn(bitmap: TMufasaBitmap; out x, y: Integer; xs, ys, xe, ye: Integer; tolerance: Integer; Range: Integer; AllowPartialAccuracy: Boolean; out accuracy: Extended): Boolean;
|
||||||
|
|
||||||
function FindDTM(DTM: pDTM; out x, y: Integer; x1, y1, x2, y2: Integer): Boolean;
|
function FindDTM(DTM: pDTM; out x, y: Integer; x1, y1, x2, y2: Integer): Boolean;
|
||||||
function FindDTMs(DTM: pDTM; out Points: TPointArray; x1, y1, x2, y2, maxToFind: Integer): Boolean;
|
function FindDTMs(DTM: pDTM; out Points: TPointArray; x1, y1, x2, y2, maxToFind: Integer): Boolean;
|
||||||
@ -1765,7 +1765,7 @@ end;
|
|||||||
|
|
||||||
function TMFinder.FindDeformedBitmapToleranceIn(bitmap: TMufasaBitmap; out x,
|
function TMFinder.FindDeformedBitmapToleranceIn(bitmap: TMufasaBitmap; 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; var accuracy: Extended): Boolean;
|
AllowPartialAccuracy: Boolean; out accuracy: Extended): Boolean;
|
||||||
var
|
var
|
||||||
MainRowdata : TPRGB32Array;
|
MainRowdata : TPRGB32Array;
|
||||||
BmpRowData : TPRGB32Array;
|
BmpRowData : TPRGB32Array;
|
||||||
|
@ -75,7 +75,7 @@ type
|
|||||||
implementation
|
implementation
|
||||||
|
|
||||||
uses
|
uses
|
||||||
files, MufasaTypes;
|
MufasaTypes;
|
||||||
|
|
||||||
|
|
||||||
constructor TMFont.Create;
|
constructor TMFont.Create;
|
||||||
@ -194,8 +194,12 @@ var
|
|||||||
i: integer;
|
i: integer;
|
||||||
begin
|
begin
|
||||||
i := GetFontIndex(Name);
|
i := GetFontIndex(Name);
|
||||||
|
result := (i <> -1);
|
||||||
|
if result then
|
||||||
|
begin
|
||||||
TMFont(Fonts.Items[i]).Free;
|
TMFont(Fonts.Items[i]).Free;
|
||||||
Fonts.Delete(i);
|
Fonts.Delete(i);
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TMFonts.LoadFont(Name: String; Shadow: Boolean): boolean;
|
function TMFonts.LoadFont(Name: String; Shadow: Boolean): boolean;
|
||||||
|
@ -72,7 +72,6 @@ implementation
|
|||||||
procedure TGenericLoader.ValidateDirs;
|
procedure TGenericLoader.ValidateDirs;
|
||||||
var
|
var
|
||||||
i : integer;
|
i : integer;
|
||||||
TempStr : string;
|
|
||||||
begin
|
begin
|
||||||
for i := 0 to PluginDirs.Count - 1 do
|
for i := 0 to PluginDirs.Count - 1 do
|
||||||
begin;
|
begin;
|
||||||
@ -116,7 +115,6 @@ implementation
|
|||||||
function TGenericLoader.LoadPlugin(PluginName: string): Integer;
|
function TGenericLoader.LoadPlugin(PluginName: string): Integer;
|
||||||
var
|
var
|
||||||
i, ii : integer;
|
i, ii : integer;
|
||||||
Status : LongInt;
|
|
||||||
PlugExt: String = {$IFDEF LINUX}'.so';{$ELSE}'.dll';{$ENDIF}
|
PlugExt: String = {$IFDEF LINUX}'.so';{$ELSE}'.dll';{$ENDIF}
|
||||||
begin
|
begin
|
||||||
ii := -1;
|
ii := -1;
|
||||||
|
@ -56,7 +56,7 @@ uses
|
|||||||
|
|
||||||
function GetTextAt(atX, atY, minvspacing, maxvspacing, hspacing,
|
function GetTextAt(atX, atY, minvspacing, maxvspacing, hspacing,
|
||||||
color, tol, len: integer; font: string): string;
|
color, tol, len: integer; font: string): string;
|
||||||
function TextToFontTPA(Text, font: String; var w, h: integer): TPointArray;
|
function TextToFontTPA(Text, font: String; out w, h: integer): TPointArray;
|
||||||
function TextToFontBitmap(Text, font: String): TMufasaBitmap;
|
function TextToFontBitmap(Text, font: String): TMufasaBitmap;
|
||||||
function TextToMask(Text, font: String): TMask;
|
function TextToMask(Text, font: String): TMask;
|
||||||
|
|
||||||
@ -118,10 +118,6 @@ const
|
|||||||
|
|
||||||
{ Constructor }
|
{ Constructor }
|
||||||
constructor TMOCR.Create(Owner: TObject);
|
constructor TMOCR.Create(Owner: TObject);
|
||||||
|
|
||||||
var
|
|
||||||
files: TStringArray;
|
|
||||||
|
|
||||||
begin
|
begin
|
||||||
inherited Create;
|
inherited Create;
|
||||||
Self.Client := Owner;
|
Self.Client := Owner;
|
||||||
@ -145,15 +141,15 @@ function TMOCR.InitTOCR(path: string): boolean;
|
|||||||
var
|
var
|
||||||
dirs: array of string;
|
dirs: array of string;
|
||||||
i: longint;
|
i: longint;
|
||||||
dir: string;
|
|
||||||
begin
|
begin
|
||||||
// We're going to load all fonts now
|
// We're going to load all fonts now
|
||||||
Fonts.SetPath(path);
|
Fonts.SetPath(path);
|
||||||
dirs := GetDirectories(path);
|
dirs := GetDirectories(path);
|
||||||
|
Result := false;
|
||||||
for i := 0 to high(dirs) do
|
for i := 0 to high(dirs) do
|
||||||
begin
|
begin
|
||||||
Fonts.LoadFont(dirs[i], false);
|
if Fonts.LoadFont(dirs[i], false) then
|
||||||
|
result := true;
|
||||||
{$IFDEF FONTDEBUG}
|
{$IFDEF FONTDEBUG}
|
||||||
writeln('Loading ' + dirs[i]);
|
writeln('Loading ' + dirs[i]);
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
@ -461,8 +457,6 @@ function TMOCR.getTextPointsIn(sx, sy, w, h: Integer; shadow: boolean;
|
|||||||
var
|
var
|
||||||
bmp, shadowsbmp, charsbmp: TMufasaBitmap;
|
bmp, shadowsbmp, charsbmp: TMufasaBitmap;
|
||||||
x,y: integer;
|
x,y: integer;
|
||||||
r,g,b: integer;
|
|
||||||
n: TNormArray;
|
|
||||||
{$IFDEF OCRDEBUG}
|
{$IFDEF OCRDEBUG}
|
||||||
dx,dy: integer;
|
dx,dy: integer;
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
@ -620,6 +614,7 @@ begin
|
|||||||
bmp.Free;
|
bmp.Free;
|
||||||
charsbmp.Free;
|
charsbmp.Free;
|
||||||
shadowsbmp.Free;
|
shadowsbmp.Free;
|
||||||
|
Result := true;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{
|
{
|
||||||
@ -724,8 +719,6 @@ var
|
|||||||
fD: TocrData;
|
fD: TocrData;
|
||||||
TPA: TPointArray;
|
TPA: TPointArray;
|
||||||
STPA: T2DPointArray;
|
STPA: T2DPointArray;
|
||||||
bmp:tmufasabitmap;
|
|
||||||
|
|
||||||
|
|
||||||
begin
|
begin
|
||||||
fD := Fonts.GetFont(font);
|
fD := Fonts.GetFont(font);
|
||||||
@ -832,7 +825,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TMOCR.TextToFontTPA(Text, font: String; var w, h: integer): TPointArray;
|
function TMOCR.TextToFontTPA(Text, font: String; out w, h: integer): TPointArray;
|
||||||
|
|
||||||
var
|
var
|
||||||
fontD: TOcrData;
|
fontD: TOcrData;
|
||||||
@ -899,7 +892,6 @@ var
|
|||||||
i,x,y : integer;
|
i,x,y : integer;
|
||||||
dx,dy : integer;
|
dx,dy : integer;
|
||||||
c : integer;
|
c : integer;
|
||||||
bmp: TMufasaBitmap;
|
|
||||||
Pixels : array of array of boolean; //White = true
|
Pixels : array of array of boolean; //White = true
|
||||||
begin
|
begin
|
||||||
TPA := TextToFontTPA(text, font, w, h);
|
TPA := TextToFontTPA(text, font, w, h);
|
||||||
|
@ -65,7 +65,7 @@ type
|
|||||||
|
|
||||||
implementation
|
implementation
|
||||||
uses
|
uses
|
||||||
bitmaps, math,
|
math,
|
||||||
{Begin To-Remove units. Replace ReadBmp with TMufasaBitmap stuff later.}
|
{Begin To-Remove units. Replace ReadBmp with TMufasaBitmap stuff later.}
|
||||||
graphtype, intfgraphics,graphics;
|
graphtype, intfgraphics,graphics;
|
||||||
{End To-Remove unit}
|
{End To-Remove unit}
|
||||||
|
Loading…
Reference in New Issue
Block a user