1
0
mirror of https://github.com/moparisthebest/Simba synced 2024-11-14 21:35:07 -05:00
Simba/Units/MMLAddon/PSInc/Wrappers/dtm.inc

116 lines
3.8 KiB
PHP
Raw Normal View History

{
This file is part of the Mufasa Macro Library (MML)
Copyright (c) 2009 by Raymond van Venetië and Merlijn Wajer
MML is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
MML is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with MML. If not, see <http://www.gnu.org/licenses/>.
See the file COPYING, included in this distribution,
for details about the copyright.
DTM.inc for the Mufasa Macro Library
}
2010-04-18 11:14:19 -04:00
function ps_FindDTM(DTM: Integer; var x, y: Integer; xs, ys, xe, ye: Integer): Boolean; extdecl;
begin
with CurrThread.Client do
result := MFinder.FindDTM(MDTMs[DTM],x,y,xs,ys,xe,ye);
end;
2010-04-18 11:14:19 -04:00
function ps_FindDTMs(DTM: Integer; var p: TPointArray; xs, ys, xe, ye: Integer): Boolean; extdecl;
begin
with CurrThread.Client do
result := MFinder.FindDTMs(MDTMs[DTM], p, xs, ys, xe, ye);
end;
2010-04-18 11:14:19 -04:00
function ps_FindDTMRotatedAlternating(DTM: Integer; var x, y: Integer; xs, ys, xe, ye:
Integer; sAngle, eAngle, aStep: Extended;
2010-04-18 11:14:19 -04:00
var aFound: Extended): Boolean; extdecl;
begin
with CurrThread.Client do
result := MFinder.FindDTMRotated(MDTMs[DTM], x,y, xs, ys, xe, ye, sAngle, eAngle, aStep, aFound,true);
end;
2010-04-18 11:14:19 -04:00
function ps_FindDTMRotatedSE(DTM: Integer; var x, y: Integer; xs, ys, xe, ye:
Integer; sAngle, eAngle, aStep: Extended;
2010-04-18 11:14:19 -04:00
var aFound: Extended): Boolean; extdecl;
begin
with CurrThread.Client do
result := MFinder.FindDTMRotated(MDTMs[DTM], x, y, xs, ys, xe, ye, sAngle, eAngle, aStep, aFound,false);
end;
2010-04-18 17:26:21 -04:00
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(MDTMs[DTM], Points, xs, ys, xe, ye,
sAngle, eAngle, aStep, aFound, true);
end;
2010-04-18 17:26:21 -04:00
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(MDTMs[DTM], Points, xs, ys, xe, ye,
sAngle, eAngle, aStep, aFound, false);
end;
procedure ps_SetDTMName(DTM : integer;const name : string);
begin
CurrThread.Client.MDTMs[DTM].Name := Name;
end;
function ps_DTMFromString(const DTMString: String): Integer; extdecl;
begin
2010-05-19 14:01:46 -04:00
Result := CurrThread.Client.MDTMs.StringToDTM(DTMString);
end;
procedure ps_FreeDTM(DTM: Integer); extdecl;
begin
CurrThread.Client.MDTMs.FreeDTM(DTM);
end;
function ps_GetDTM(index: Integer) : TMDTM; extdecl;
begin
result := CurrThread.Client.MDTMs[Index];
end;
function ps_AddTSDTM(const d: TSDTM): Integer; extdecl;
begin
Result := CurrThread.Client.MDTMs.AddDTM(d);
end;
function ps_AddDTM(const d: TMDTM): Integer; extdecl;
begin
Result := CurrThread.Client.MDTMs.AddDTM(d);
end;
procedure ps_PrintDTM(const aDTM : TMDTM);extdecl;
begin
PrintDTM(aDTM);
end;
function ps_MDTMToSDTM(Const DTM: TMDTM): TSDTM;extdecl;
begin
result := MDTMToSDTM(DTM);
end;
function ps_SDTMToMDTM(Const DTM: TSDTM): TMDTM;extdecl;
begin
result := SDTMToMDTM(DTM);
2010-05-19 17:32:54 -04:00
CurrThread.Client.MDTMs.AddDTM(result);
end;
2010-05-19 14:01:46 -04:00
function ps_CreateDTMPoint(x,y,c,t,asz : integer; bp : boolean) : TMDTMPoint;
begin
result := CreateDTMPoint(x,y,c,t,asz,bp);
end;