mirror of
https://github.com/moparisthebest/Simba
synced 2024-11-22 01:02:17 -05:00
We need to revise the DTM-system..
This commit is contained in:
parent
f5c6880829
commit
5dc6d43595
@ -24,13 +24,13 @@
|
||||
function ps_FindDTM(DTM: Integer; var x, y: Integer; xs, ys, xe, ye: Integer): Boolean; extdecl;
|
||||
begin
|
||||
with CurrThread.Client do
|
||||
result := MFinder.FindDTM(MDTM.GetDTM(DTM),x,y,xs,ys,xe,ye);
|
||||
result := MFinder.FindDTM(MDTM.GetDTM(DTM)^,x,y,xs,ys,xe,ye);
|
||||
end;
|
||||
|
||||
function ps_FindDTMs(DTM: Integer; var p: TPointArray; xs, ys, xe, ye: Integer): Boolean; extdecl;
|
||||
begin
|
||||
with CurrThread.Client do
|
||||
result := MFinder.FindDTMs(MDTM.GetDTM(DTM), p, xs, ys, xe, ye);
|
||||
result := MFinder.FindDTMs(MDTM.GetDTM(DTM)^, p, xs, ys, xe, ye);
|
||||
end;
|
||||
|
||||
function ps_FindDTMRotatedAlternating(DTM: Integer; var x, y: Integer; xs, ys, xe, ye:
|
||||
@ -38,7 +38,7 @@ function ps_FindDTMRotatedAlternating(DTM: Integer; var x, y: Integer; xs, ys, x
|
||||
var aFound: Extended): Boolean; extdecl;
|
||||
begin
|
||||
with CurrThread.Client do
|
||||
result := MFinder.FindDTMRotated(MDTM.GetDTM(DTM), x,y, xs, ys, xe, ye, sAngle, eAngle, aStep, aFound,true);
|
||||
result := MFinder.FindDTMRotated(MDTM.GetDTM(DTM)^, x,y, xs, ys, xe, ye, sAngle, eAngle, aStep, aFound,true);
|
||||
end;
|
||||
|
||||
function ps_FindDTMRotatedSE(DTM: Integer; var x, y: Integer; xs, ys, xe, ye:
|
||||
@ -46,20 +46,20 @@ function ps_FindDTMRotatedSE(DTM: Integer; var x, y: Integer; xs, ys, xe, ye:
|
||||
var aFound: Extended): Boolean; extdecl;
|
||||
begin
|
||||
with CurrThread.Client do
|
||||
result := MFinder.FindDTMRotated(MDTM.GetDTM(DTM), x, y, xs, ys, xe, ye, sAngle, eAngle, aStep, aFound,false);
|
||||
result := MFinder.FindDTMRotated(MDTM.GetDTM(DTM)^, x, y, xs, ys, xe, ye, sAngle, eAngle, aStep, aFound,false);
|
||||
end;
|
||||
|
||||
function ps_FindDTMsRotatedAlternating(DTM: Integer; var Points: TPointArray; xs, ys, xe, ye: Integer; sAngle, eAngle, aStep: Extended; var aFound: T2DExtendedArray): Boolean; extdecl;
|
||||
begin
|
||||
with CurrThread.Client do
|
||||
result := MFinder.FindDTMsRotated(MDTM.GetDTM(DTM), Points, xs, ys, xe, ye,
|
||||
result := MFinder.FindDTMsRotated(MDTM.GetDTM(DTM)^, Points, xs, ys, xe, ye,
|
||||
sAngle, eAngle, aStep, aFound, true);
|
||||
end;
|
||||
|
||||
function ps_FindDTMsRotatedSE(DTM: Integer; var Points: TPointArray; xs, ys, xe, ye: Integer; sAngle, eAngle, aStep: Extended; var aFound: T2DExtendedArray): Boolean; extdecl;
|
||||
begin
|
||||
with CurrThread.Client do
|
||||
result := MFinder.FindDTMsRotated(MDTM.GetDTM(DTM), Points, xs, ys, xe, ye,
|
||||
result := MFinder.FindDTMsRotated(MDTM.GetDTM(DTM)^, Points, xs, ys, xe, ye,
|
||||
sAngle, eAngle, aStep, aFound, false);
|
||||
end;
|
||||
|
||||
@ -81,7 +81,7 @@ end;
|
||||
|
||||
function ps_GetDTM(index: Integer) : pDTM; extdecl;
|
||||
begin
|
||||
result := CurrThread.Client.MDTM.GetDTM(index);
|
||||
result := CurrThread.Client.MDTM.GetDTM(index)^;
|
||||
end;
|
||||
|
||||
function ps_AddDTM(const d: TDTM): Integer; extdecl;
|
||||
|
@ -587,7 +587,6 @@ procedure TPSThread.OnProcessDirective(Sender: TPSPreProcessor;
|
||||
Parser: TPSPascalPreProcessorParser; const Active: Boolean;
|
||||
const DirectiveName, DirectiveParam: string; var Continue: Boolean);
|
||||
begin
|
||||
Continue := ProcessDirective(DirectiveName, DirectiveParam);
|
||||
end;
|
||||
|
||||
function TPSThread.PSScriptFindUnknownFile(Sender: TObject;
|
||||
|
@ -43,9 +43,10 @@ type
|
||||
public
|
||||
function AddDTM(const d: TDTM): Integer;
|
||||
function AddpDTM(const d: pDTM): Integer;
|
||||
function GetDTM(index: Integer) :pDTM;
|
||||
function GetDTM(index: Integer) :ppDTM;
|
||||
procedure FreeDTM(DTM: Integer);
|
||||
function StringToDTM(const S: String): pDTM;
|
||||
function DTMToString(const DTM : PDTM) : string;
|
||||
procedure SetDTMName(DTM: Integer;const S: String);
|
||||
constructor Create(Owner: TObject);
|
||||
destructor Destroy; override;
|
||||
@ -169,6 +170,15 @@ begin
|
||||
result.l := length(result.p);
|
||||
end;
|
||||
|
||||
|
||||
function TMDTM.DTMToString(const DTM: PDTM): string;
|
||||
var
|
||||
i : integer;
|
||||
begin
|
||||
if DTM.l = 0 then
|
||||
exit;
|
||||
end;
|
||||
|
||||
procedure TMDTM.CheckIndex(index: integer);
|
||||
begin
|
||||
if (index < 0) or (index >= Length(DTMList)) or (DTMList[Index] = nil) then
|
||||
@ -210,10 +220,10 @@ end;
|
||||
Returns true is succesfull, false if the dtm does not exist.
|
||||
/\}
|
||||
|
||||
function TMDTM.GetDTM(index: Integer) :pDTM;
|
||||
function TMDTM.GetDTM(index: Integer) :ppDTM;
|
||||
begin
|
||||
CheckIndex(index);
|
||||
result := DTMList[index]^;
|
||||
result := DTMList[index];
|
||||
end;
|
||||
|
||||
procedure TMDTM.SetDTMName(DTM: Integer;const s: string);
|
||||
|
Loading…
Reference in New Issue
Block a user