1
0
mirror of https://github.com/moparisthebest/Simba synced 2024-11-24 18:22:25 -05:00

DTM uses CTS 1. FindDTM/FindDTMs are `done' for now. Unless you guys/girls really want AreaShape, then I can add those too.

git-svn-id: http://www.villavu.com/repositories/merlijn/mufasa@264 3f818213-9676-44b0-a9b4-5e4c4e03d09d
This commit is contained in:
Wizzup? 2009-12-02 20:18:38 +00:00
parent 481d3e3cd3
commit d2e3e278f1
5 changed files with 177 additions and 170 deletions

View File

@ -35,10 +35,10 @@
<Filename Value="project1.lpr"/>
<IsPartOfProject Value="True"/>
<UnitName Value="project1"/>
<CursorPos X="40" Y="78"/>
<TopLine Value="54"/>
<CursorPos X="32" Y="81"/>
<TopLine Value="63"/>
<EditorIndex Value="0"/>
<UsageCount Value="70"/>
<UsageCount Value="71"/>
<Loaded Value="True"/>
</Unit0>
<Unit1>
@ -53,7 +53,7 @@
<UnitName Value="Client"/>
<CursorPos X="21" Y="51"/>
<TopLine Value="35"/>
<EditorIndex Value="6"/>
<EditorIndex Value="7"/>
<UsageCount Value="30"/>
<Loaded Value="True"/>
</Unit2>
@ -69,22 +69,24 @@
<UnitName Value="Window"/>
<CursorPos X="55" Y="251"/>
<TopLine Value="236"/>
<EditorIndex Value="9"/>
<EditorIndex Value="10"/>
<UsageCount Value="29"/>
<Loaded Value="True"/>
</Unit4>
<Unit5>
<Filename Value="../../Units/MMLCore/colour_conv.pas"/>
<UnitName Value="colour_conv"/>
<CursorPos X="24" Y="7"/>
<TopLine Value="37"/>
<UsageCount Value="7"/>
<CursorPos X="15" Y="78"/>
<TopLine Value="60"/>
<EditorIndex Value="3"/>
<UsageCount Value="10"/>
<Loaded Value="True"/>
</Unit5>
<Unit6>
<Filename Value="../../Units/MMLCore/finder.pas"/>
<UnitName Value="finder"/>
<CursorPos X="18" Y="1692"/>
<TopLine Value="1667"/>
<CursorPos X="41" Y="1637"/>
<TopLine Value="1631"/>
<EditorIndex Value="2"/>
<UsageCount Value="33"/>
<Loaded Value="True"/>
@ -94,7 +96,7 @@
<UnitName Value="Input"/>
<CursorPos X="56" Y="49"/>
<TopLine Value="24"/>
<EditorIndex Value="5"/>
<EditorIndex Value="6"/>
<UsageCount Value="29"/>
<Loaded Value="True"/>
</Unit7>
@ -103,7 +105,7 @@
<UnitName Value="MufasaTypes"/>
<CursorPos X="1" Y="88"/>
<TopLine Value="76"/>
<EditorIndex Value="10"/>
<EditorIndex Value="11"/>
<UsageCount Value="31"/>
<Loaded Value="True"/>
</Unit8>
@ -112,7 +114,7 @@
<UnitName Value="ocr"/>
<CursorPos X="11" Y="361"/>
<TopLine Value="330"/>
<EditorIndex Value="7"/>
<EditorIndex Value="8"/>
<UsageCount Value="30"/>
<Loaded Value="True"/>
</Unit9>
@ -176,7 +178,7 @@
<Filename Value="../../Units/MMLAddon/PSInc/Wrappers/ocr.inc"/>
<CursorPos X="20" Y="5"/>
<TopLine Value="1"/>
<EditorIndex Value="8"/>
<EditorIndex Value="9"/>
<UsageCount Value="26"/>
<Loaded Value="True"/>
</Unit18>
@ -185,16 +187,16 @@
<UnitName Value="dtm"/>
<CursorPos X="33" Y="109"/>
<TopLine Value="153"/>
<EditorIndex Value="4"/>
<EditorIndex Value="5"/>
<UsageCount Value="26"/>
<Loaded Value="True"/>
</Unit19>
<Unit20>
<Filename Value="../../Units/MMLCore/dtmutil.pas"/>
<UnitName Value="dtmutil"/>
<CursorPos X="1" Y="1"/>
<TopLine Value="201"/>
<EditorIndex Value="3"/>
<CursorPos X="5" Y="219"/>
<TopLine Value="204"/>
<EditorIndex Value="4"/>
<UsageCount Value="22"/>
<Loaded Value="True"/>
</Unit20>
@ -208,124 +210,124 @@
</Units>
<JumpHistory Count="30" HistoryIndex="29">
<Position1>
<Filename Value="../../Units/MMLCore/dtmutil.pas"/>
<Caret Line="39" Column="27" TopLine="24"/>
<Filename Value="../../Units/MMLCore/finder.pas"/>
<Caret Line="82" Column="26" TopLine="63"/>
</Position1>
<Position2>
<Filename Value="../../Units/MMLCore/dtmutil.pas"/>
<Caret Line="40" Column="27" TopLine="24"/>
<Filename Value="../../Units/MMLCore/finder.pas"/>
<Caret Line="84" Column="26" TopLine="63"/>
</Position2>
<Position3>
<Filename Value="project1.lpr"/>
<Caret Line="90" Column="11" TopLine="64"/>
<Caret Line="79" Column="18" TopLine="61"/>
</Position3>
<Position4>
<Filename Value="project1.lpr"/>
<Caret Line="78" Column="19" TopLine="61"/>
<Caret Line="87" Column="42" TopLine="71"/>
</Position4>
<Position5>
<Filename Value="../../Units/MMLCore/finder.pas"/>
<Caret Line="1796" Column="59" TopLine="1771"/>
<Caret Line="1893" Column="47" TopLine="1868"/>
</Position5>
<Position6>
<Filename Value="../../Units/MMLCore/finder.pas"/>
<Caret Line="1789" Column="43" TopLine="1774"/>
<Caret Line="1892" Column="27" TopLine="1877"/>
</Position6>
<Position7>
<Filename Value="../../Units/MMLCore/finder.pas"/>
<Caret Line="707" Column="17" TopLine="697"/>
<Caret Line="1884" Column="45" TopLine="1877"/>
</Position7>
<Position8>
<Filename Value="../../Units/MMLCore/finder.pas"/>
<Caret Line="51" Column="36" TopLine="36"/>
<Caret Line="1680" Column="83" TopLine="1669"/>
</Position8>
<Position9>
<Filename Value="../../Units/MMLCore/finder.pas"/>
<Caret Line="1633" Column="15" TopLine="1619"/>
<Caret Line="1892" Column="35" TopLine="1877"/>
</Position9>
<Position10>
<Filename Value="../../Units/MMLCore/finder.pas"/>
<Caret Line="51" Column="36" TopLine="36"/>
<Caret Line="1884" Column="19" TopLine="1869"/>
</Position10>
<Position11>
<Filename Value="project1.lpr"/>
<Caret Line="86" Column="19" TopLine="71"/>
<Caret Line="66" Column="18" TopLine="55"/>
</Position11>
<Position12>
<Filename Value="../../Units/MMLCore/finder.pas"/>
<Caret Line="82" Column="26" TopLine="63"/>
<Filename Value="project1.lpr"/>
<Caret Line="88" Column="43" TopLine="61"/>
</Position12>
<Position13>
<Filename Value="../../Units/MMLCore/finder.pas"/>
<Caret Line="84" Column="26" TopLine="63"/>
<Caret Line="82" Column="26" TopLine="62"/>
</Position13>
<Position14>
<Filename Value="project1.lpr"/>
<Caret Line="79" Column="18" TopLine="61"/>
<Filename Value="../../Units/MMLCore/finder.pas"/>
<Caret Line="84" Column="26" TopLine="62"/>
</Position14>
<Position15>
<Filename Value="project1.lpr"/>
<Caret Line="87" Column="42" TopLine="71"/>
<Filename Value="../../Units/MMLCore/finder.pas"/>
<Caret Line="1586" Column="16" TopLine="1571"/>
</Position15>
<Position16>
<Filename Value="../../Units/MMLCore/finder.pas"/>
<Caret Line="1893" Column="47" TopLine="1868"/>
<Caret Line="1794" Column="10" TopLine="1781"/>
</Position16>
<Position17>
<Filename Value="../../Units/MMLCore/finder.pas"/>
<Caret Line="1892" Column="27" TopLine="1877"/>
<Caret Line="82" Column="88" TopLine="63"/>
</Position17>
<Position18>
<Filename Value="../../Units/MMLCore/finder.pas"/>
<Caret Line="1884" Column="45" TopLine="1877"/>
<Filename Value="project1.lpr"/>
<Caret Line="81" Column="16" TopLine="60"/>
</Position18>
<Position19>
<Filename Value="../../Units/MMLCore/finder.pas"/>
<Caret Line="1680" Column="83" TopLine="1669"/>
<Filename Value="project1.lpr"/>
<Caret Line="85" Column="17" TopLine="73"/>
</Position19>
<Position20>
<Filename Value="../../Units/MMLCore/finder.pas"/>
<Caret Line="1892" Column="35" TopLine="1877"/>
<Filename Value="project1.lpr"/>
<Caret Line="69" Column="57" TopLine="54"/>
</Position20>
<Position21>
<Filename Value="../../Units/MMLCore/finder.pas"/>
<Caret Line="1884" Column="19" TopLine="1869"/>
<Caret Line="1674" Column="10" TopLine="1656"/>
</Position21>
<Position22>
<Filename Value="project1.lpr"/>
<Caret Line="66" Column="18" TopLine="55"/>
<Filename Value="../../Units/MMLCore/colour_conv.pas"/>
<Caret Line="39" Column="21" TopLine="24"/>
</Position22>
<Position23>
<Filename Value="project1.lpr"/>
<Caret Line="88" Column="43" TopLine="61"/>
<Filename Value="../../Units/MMLCore/finder.pas"/>
<Caret Line="1693" Column="131" TopLine="1676"/>
</Position23>
<Position24>
<Filename Value="../../Units/MMLCore/finder.pas"/>
<Caret Line="82" Column="26" TopLine="62"/>
<Caret Line="1613" Column="26" TopLine="1608"/>
</Position24>
<Position25>
<Filename Value="../../Units/MMLCore/finder.pas"/>
<Caret Line="84" Column="26" TopLine="62"/>
<Caret Line="1696" Column="1" TopLine="1669"/>
</Position25>
<Position26>
<Filename Value="../../Units/MMLCore/finder.pas"/>
<Caret Line="1586" Column="16" TopLine="1571"/>
<Caret Line="1675" Column="25" TopLine="1660"/>
</Position26>
<Position27>
<Filename Value="../../Units/MMLCore/finder.pas"/>
<Caret Line="1794" Column="10" TopLine="1781"/>
<Caret Line="1696" Column="127" TopLine="1681"/>
</Position27>
<Position28>
<Filename Value="../../Units/MMLCore/finder.pas"/>
<Caret Line="82" Column="88" TopLine="63"/>
<Caret Line="1682" Column="1" TopLine="1671"/>
</Position28>
<Position29>
<Filename Value="project1.lpr"/>
<Caret Line="81" Column="16" TopLine="60"/>
<Filename Value="../../Units/MMLCore/finder.pas"/>
<Caret Line="1618" Column="22" TopLine="1607"/>
</Position29>
<Position30>
<Filename Value="project1.lpr"/>
<Caret Line="85" Column="17" TopLine="73"/>
<Filename Value="../../Units/MMLCore/finder.pas"/>
<Caret Line="1637" Column="18" TopLine="1621"/>
</Position30>
</JumpHistory>
</ProjectOptions>

View File

@ -78,20 +78,21 @@ begin
dtm.p[0] := Point(2, 2);
dtm.p[1] := Point(-3, -3);
dtm.p[2] := Point(0, 0);
dtm.c[0] := 0;
dtm.c[0] := 255;
dtm.t[0] := 255;
dtm.asz[1] := 1;
dtm.ash[1] := dtm_Rectangle;
setlength(p, 1);
time := GetTickCount;
C.MFinder.FindDTMs(dtm, p, 0, 0,799, 599, 10);
C.MFinder.FindDTMs(dtm, p, 0, 0,799, 599, 0);
//C.MFinder.FindDTM(dtm, p[0].x, p[0].y, 0, 0,799, 599);
writeln(inttostr(gettickcount - time));
writeln(inttostr(length(p)));
for i := 0 to high(p) do
writeln(format('%d: (%d, %d)', [i, p[i].x, p[i].y]));
{for i := 0 to high(p) do
writeln(format('%d: (%d, %d)', [i, p[i].x, p[i].y])); }
//bmp.OnDestroy:=nil;

View File

@ -38,9 +38,11 @@
<Filename Value="project1.lpr"/>
<IsPartOfProject Value="True"/>
<UnitName Value="project1"/>
<CursorPos X="17" Y="41"/>
<CursorPos X="65" Y="37"/>
<TopLine Value="16"/>
<EditorIndex Value="7"/>
<UsageCount Value="205"/>
<Loaded Value="True"/>
</Unit0>
<Unit1>
<Filename Value="unit1.pas"/>
@ -229,8 +231,8 @@
<Filename Value="../../Units/MMLCore/mufasatypes.pas"/>
<IsPartOfProject Value="True"/>
<UnitName Value="MufasaTypes"/>
<CursorPos X="11" Y="89"/>
<TopLine Value="81"/>
<CursorPos X="3" Y="50"/>
<TopLine Value="35"/>
<EditorIndex Value="0"/>
<UsageCount Value="201"/>
<Loaded Value="True"/>
@ -272,7 +274,7 @@
<UnitName Value="windowutil"/>
<CursorPos X="23" Y="8"/>
<TopLine Value="1"/>
<EditorIndex Value="10"/>
<EditorIndex Value="12"/>
<UsageCount Value="55"/>
<Loaded Value="True"/>
</Unit31>
@ -287,8 +289,8 @@
<Filename Value="../../Units/MMLCore/finder.pas"/>
<IsPartOfProject Value="True"/>
<UnitName Value="finder"/>
<CursorPos X="5" Y="1707"/>
<TopLine Value="1673"/>
<CursorPos X="97" Y="1681"/>
<TopLine Value="1666"/>
<EditorIndex Value="5"/>
<UsageCount Value="201"/>
<Loaded Value="True"/>
@ -313,7 +315,7 @@
<UnitName Value="mmlpsthread"/>
<CursorPos X="19" Y="258"/>
<TopLine Value="245"/>
<EditorIndex Value="11"/>
<EditorIndex Value="13"/>
<UsageCount Value="202"/>
<Loaded Value="True"/>
</Unit36>
@ -382,7 +384,7 @@
<Filename Value="../../Units/MMLAddon/PSInc/pscompile.inc"/>
<CursorPos X="38" Y="47"/>
<TopLine Value="38"/>
<EditorIndex Value="7"/>
<EditorIndex Value="9"/>
<UsageCount Value="100"/>
<Loaded Value="True"/>
</Unit46>
@ -402,8 +404,8 @@
<Filename Value="../../Units/MMLCore/bitmaps.pas"/>
<IsPartOfProject Value="True"/>
<UnitName Value="bitmaps"/>
<CursorPos X="1" Y="352"/>
<TopLine Value="343"/>
<CursorPos X="47" Y="361"/>
<TopLine Value="598"/>
<EditorIndex Value="2"/>
<UsageCount Value="200"/>
<Loaded Value="True"/>
@ -707,9 +709,9 @@
<Filename Value="../../Units/MMLCore/dtm.pas"/>
<IsPartOfProject Value="True"/>
<UnitName Value="dtm"/>
<CursorPos X="3" Y="44"/>
<TopLine Value="28"/>
<EditorIndex Value="6"/>
<CursorPos X="17" Y="99"/>
<TopLine Value="81"/>
<EditorIndex Value="8"/>
<UsageCount Value="200"/>
<Loaded Value="True"/>
</Unit95>
@ -783,9 +785,11 @@
<Filename Value="../../Units/MMLCore/dtmutil.pas"/>
<IsPartOfProject Value="True"/>
<UnitName Value="dtmutil"/>
<CursorPos X="32" Y="18"/>
<TopLine Value="1"/>
<CursorPos X="1" Y="1"/>
<TopLine Value="151"/>
<EditorIndex Value="6"/>
<UsageCount Value="206"/>
<Loaded Value="True"/>
</Unit105>
<Unit106>
<Filename Value="../../../cogat/Units/CogatUnits/compmaths.pas"/>
@ -797,8 +801,8 @@
<Unit107>
<Filename Value="../../Units/MMLAddon/PSInc/Wrappers/dtm.inc"/>
<CursorPos X="33" Y="34"/>
<TopLine Value="20"/>
<EditorIndex Value="8"/>
<TopLine Value="30"/>
<EditorIndex Value="10"/>
<UsageCount Value="14"/>
<Loaded Value="True"/>
</Unit107>
@ -993,7 +997,7 @@
<UnitName Value="web"/>
<CursorPos X="1" Y="1"/>
<TopLine Value="1"/>
<UsageCount Value="155"/>
<UsageCount Value="156"/>
</Unit136>
<Unit137>
<Filename Value="../../../lazarus/lcl/lazhelphtml.pas"/>
@ -1192,7 +1196,7 @@
<UnitName Value="framescript"/>
<CursorPos X="106" Y="190"/>
<TopLine Value="180"/>
<UsageCount Value="148"/>
<UsageCount Value="149"/>
</Unit161>
<Unit162>
<Filename Value="framesynedit.lrs"/>
@ -1506,8 +1510,8 @@
<UnitName Value="colourhistory"/>
<CursorPos X="3" Y="1"/>
<TopLine Value="1"/>
<EditorIndex Value="9"/>
<UsageCount Value="85"/>
<EditorIndex Value="11"/>
<UsageCount Value="86"/>
<Loaded Value="True"/>
</Unit208>
<Unit209>
@ -1758,7 +1762,7 @@
<UnitName Value="about"/>
<CursorPos X="44" Y="21"/>
<TopLine Value="4"/>
<UsageCount Value="48"/>
<UsageCount Value="49"/>
</Unit245>
<Unit246>
<Filename Value="../../Units/MMLAddon/PSInc/Wrappers/file.inc"/>
@ -1772,7 +1776,7 @@
<UnitName Value="internets"/>
<CursorPos X="87" Y="3"/>
<TopLine Value="1"/>
<UsageCount Value="42"/>
<UsageCount Value="43"/>
</Unit247>
<Unit248>
<Filename Value="debugimageform.pas"/>
@ -1781,7 +1785,7 @@
<UnitName Value="debugimageform"/>
<CursorPos X="20" Y="1"/>
<TopLine Value="1"/>
<UsageCount Value="29"/>
<UsageCount Value="30"/>
</Unit248>
<Unit249>
<Filename Value="debugimage.pas"/>
@ -1791,7 +1795,7 @@
<UnitName Value="debugimage"/>
<CursorPos X="100" Y="103"/>
<TopLine Value="82"/>
<UsageCount Value="28"/>
<UsageCount Value="29"/>
</Unit249>
<Unit250>
<Filename Value="debugimage.lrs"/>
@ -1828,124 +1832,124 @@
</Units>
<JumpHistory Count="30" HistoryIndex="29">
<Position1>
<Filename Value="../../Units/MMLCore/window.pas"/>
<Caret Line="67" Column="43" TopLine="54"/>
<Filename Value="../../Units/MMLCore/dtm.pas"/>
<Caret Line="28" Column="12" TopLine="13"/>
</Position1>
<Position2>
<Filename Value="../../Units/MMLCore/client.pas"/>
<Caret Line="64" Column="40" TopLine="56"/>
<Filename Value="../../Units/MMLCore/dtm.pas"/>
<Caret Line="33" Column="46" TopLine="23"/>
</Position2>
<Position3>
<Filename Value="../../Units/MMLCore/window.pas"/>
<Caret Line="259" Column="57" TopLine="29"/>
<Filename Value="../../Units/MMLCore/dtm.pas"/>
<Caret Line="43" Column="60" TopLine="28"/>
</Position3>
<Position4>
<Filename Value="../../Units/MMLCore/window.pas"/>
<Caret Line="745" Column="34" TopLine="719"/>
<Filename Value="../../Units/MMLCore/dtm.pas"/>
<Caret Line="46" Column="7" TopLine="31"/>
</Position4>
<Position5>
<Filename Value="../../Units/MMLCore/window.pas"/>
<Caret Line="79" Column="44" TopLine="64"/>
<Filename Value="../../Units/MMLCore/dtm.pas"/>
<Caret Line="58" Column="41" TopLine="43"/>
</Position5>
<Position6>
<Filename Value="../../Units/MMLCore/dtm.pas"/>
<Caret Line="329" Column="19" TopLine="309"/>
<Caret Line="59" Column="3" TopLine="44"/>
</Position6>
<Position7>
<Filename Value="../../Units/MMLAddon/mmlpsthread.pas"/>
<Caret Line="177" Column="37" TopLine="159"/>
<Filename Value="../../Units/MMLCore/dtm.pas"/>
<Caret Line="73" Column="65" TopLine="58"/>
</Position7>
<Position8>
<Filename Value="../../Units/MMLAddon/mmlpsthread.pas"/>
<Caret Line="210" Column="20" TopLine="195"/>
<Filename Value="../../Units/MMLCore/client.pas"/>
<Caret Line="66" Column="20" TopLine="55"/>
</Position8>
<Position9>
<Filename Value="../../Units/MMLCore/dtm.pas"/>
<Caret Line="304" Column="1" TopLine="290"/>
<Caret Line="75" Column="50" TopLine="60"/>
</Position9>
<Position10>
<Filename Value="../../Units/MMLCore/dtm.pas"/>
<Caret Line="28" Column="12" TopLine="13"/>
<Caret Line="71" Column="39" TopLine="56"/>
</Position10>
<Position11>
<Filename Value="../../Units/MMLCore/dtm.pas"/>
<Caret Line="33" Column="46" TopLine="23"/>
<Caret Line="72" Column="64" TopLine="57"/>
</Position11>
<Position12>
<Filename Value="../../Units/MMLCore/dtm.pas"/>
<Caret Line="43" Column="60" TopLine="28"/>
</Position12>
<Position13>
<Filename Value="../../Units/MMLCore/dtm.pas"/>
<Caret Line="46" Column="7" TopLine="31"/>
</Position13>
<Position14>
<Filename Value="../../Units/MMLCore/dtm.pas"/>
<Caret Line="58" Column="41" TopLine="43"/>
</Position14>
<Position15>
<Filename Value="../../Units/MMLCore/dtm.pas"/>
<Caret Line="59" Column="3" TopLine="44"/>
</Position15>
<Position16>
<Filename Value="../../Units/MMLCore/dtm.pas"/>
<Caret Line="73" Column="65" TopLine="58"/>
</Position16>
<Position17>
<Filename Value="../../Units/MMLCore/client.pas"/>
<Caret Line="66" Column="20" TopLine="55"/>
</Position17>
<Position18>
<Filename Value="../../Units/MMLCore/dtm.pas"/>
<Caret Line="75" Column="50" TopLine="60"/>
</Position18>
<Position19>
<Filename Value="../../Units/MMLCore/dtm.pas"/>
<Caret Line="71" Column="39" TopLine="56"/>
</Position19>
<Position20>
<Filename Value="../../Units/MMLCore/dtm.pas"/>
<Caret Line="72" Column="64" TopLine="57"/>
</Position20>
<Position21>
<Filename Value="../../Units/MMLAddon/mmlpsthread.pas"/>
<Caret Line="258" Column="19" TopLine="245"/>
</Position21>
<Position22>
</Position12>
<Position13>
<Filename Value="../../Units/MMLAddon/PSInc/pscompile.inc"/>
<Caret Line="16" Column="25" TopLine="1"/>
</Position22>
<Position23>
</Position13>
<Position14>
<Filename Value="../../Units/MMLCore/finder.pas"/>
<Caret Line="82" Column="26" TopLine="59"/>
</Position14>
<Position15>
<Filename Value="../../Units/MMLCore/finder.pas"/>
<Caret Line="84" Column="26" TopLine="59"/>
</Position15>
<Position16>
<Filename Value="../../Units/MMLCore/finder.pas"/>
<Caret Line="82" Column="26" TopLine="61"/>
</Position16>
<Position17>
<Filename Value="../../Units/MMLCore/finder.pas"/>
<Caret Line="83" Column="26" TopLine="61"/>
</Position17>
<Position18>
<Filename Value="../../Units/MMLCore/finder.pas"/>
<Caret Line="85" Column="26" TopLine="61"/>
</Position18>
<Position19>
<Filename Value="../../Units/MMLCore/finder.pas"/>
<Caret Line="1696" Column="35" TopLine="1672"/>
</Position19>
<Position20>
<Filename Value="../../Units/MMLCore/finder.pas"/>
<Caret Line="1682" Column="27" TopLine="1678"/>
</Position20>
<Position21>
<Filename Value="../../Units/MMLCore/dtm.pas"/>
<Caret Line="74" Column="3" TopLine="59"/>
</Position21>
<Position22>
<Filename Value="../../Units/MMLCore/finder.pas"/>
<Caret Line="1446" Column="24" TopLine="1430"/>
</Position22>
<Position23>
<Filename Value="../../Units/MMLCore/dtm.pas"/>
<Caret Line="99" Column="17" TopLine="81"/>
</Position23>
<Position24>
<Filename Value="../../Units/MMLCore/finder.pas"/>
<Caret Line="84" Column="26" TopLine="59"/>
<Caret Line="1680" Column="3" TopLine="1670"/>
</Position24>
<Position25>
<Filename Value="../../Units/MMLCore/finder.pas"/>
<Caret Line="82" Column="26" TopLine="61"/>
<Caret Line="1681" Column="80" TopLine="1666"/>
</Position25>
<Position26>
<Filename Value="../../Units/MMLCore/finder.pas"/>
<Caret Line="83" Column="26" TopLine="61"/>
<Caret Line="1741" Column="10" TopLine="1722"/>
</Position26>
<Position27>
<Filename Value="../../Units/MMLCore/finder.pas"/>
<Caret Line="85" Column="26" TopLine="61"/>
<Caret Line="1681" Column="29" TopLine="1656"/>
</Position27>
<Position28>
<Filename Value="../../Units/MMLCore/finder.pas"/>
<Caret Line="1696" Column="35" TopLine="1672"/>
<Caret Line="1616" Column="14" TopLine="1601"/>
</Position28>
<Position29>
<Filename Value="../../Units/MMLCore/finder.pas"/>
<Caret Line="1682" Column="27" TopLine="1678"/>
<Caret Line="104" Column="31" TopLine="89"/>
</Position29>
<Position30>
<Filename Value="../../Units/MMLCore/dtm.pas"/>
<Caret Line="74" Column="3" TopLine="59"/>
<Filename Value="../../Units/MMLCore/finder.pas"/>
<Caret Line="1681" Column="96" TopLine="1662"/>
</Position30>
</JumpHistory>
</ProjectOptions>

View File

@ -216,7 +216,7 @@ begin
end;
//FillChar(Result, SizeOf(TBox), 0);
writeln(Format('DTM Bounding Box: %d, %d : %d, %d', [b.x1, b.y1,b.x2,b.y2]));
//writeln(Format('DTM Bounding Box: %d, %d : %d, %d', [b.x1, b.y1,b.x2,b.y2]));
Result.x1 := x1 - b.x1;
Result.y1 := y1 - b.y1;
Result.x2 := x2 - b.x2;

View File

@ -1593,7 +1593,6 @@ begin
Exit(False);
end;
// TODO: Add a max count, so we can use it more efficiently for FindDTM?
function TMFinder.FindDTMs(DTM: pDTM; out Points: TPointArray; x1, y1, x2, y2, maxToFind: Integer): Boolean;
var
// Colours of DTMs
@ -1610,15 +1609,13 @@ var
xx, yy: integer;
i, xxx,yyy: Integer;
// for comparions.
clR, clG, clB: Integer;
// for comparisons.
rgbs: array of TRGB32;
//clientdata
cd: TPRGB32Array;
PtrData: TRetData;
Ptr: PRGB32;
PtrInc: Integer;
// point count
pc: Integer = 0;
@ -1636,9 +1633,9 @@ begin
end;
// Get the area we should search in for the Main Point.
writeln(Format('%d, %d, %d, %d', [x1,y1,x2,y2]));
//writeln(Format('%d, %d, %d, %d', [x1,y1,x2,y2]));
MA := ValidMainPointBox(DTM, x1, y1, x2, y2);
writeln(Format('%d, %d, %d, %d', [MA.x1,MA.y1,MA.x2,MA.y2]));
//writeln(Format('%d, %d, %d, %d', [MA.x1,MA.y1,MA.x2,MA.y2]));
DefaultOperations(MA.x1, MA.y1, MA.x2, MA.y2);
@ -1666,18 +1663,21 @@ begin
// Do we want to "cache" these vars?
// We will, for now. Easier to type.
Ptr := PtrData.Ptr;
PtrInc := PtrData.IncPtrWith;
cd := CalculateRowPtrs(PtrData, h + 1);
writeln(format('w,h: %d, %d', [w,h]));
//writeln(format('w,h: %d, %d', [w,h]));
// pre calc rgb values for dtms
SetLength(rgbs, dtm.l);
for i := 0 to dtm.l - 1 do
ColorToRGB(dtm.c[i], rgbs[i].r, rgbs[i].g, rgbs[i].b);
for yy := MA.y1 to MA.y2 do
for xx := MA.x1 to MA.x2 do
begin
// main point
//if dtm.c[0] <> RGBToColor(cd[yy][xx].R, cd[yy][xx].G, cd[yy][xx].B) then
if not SimilarColors(dtm.c[0], RGBToColor(cd[yy][xx].R, cd[yy][xx].G, cd[yy][xx].B), dtm.t[0]) then
if Sqrt(sqr(rgbs[0].r - cd[yy][xx].R) + sqr(rgbs[0].g - cd[yy][xx].G) + sqr(rgbs[0].b - cd[yy][xx].B)) > dtm.t[0] then
// if not SimilarColors(dtm.c[0], RGBToColor(cd[yy][xx].R, cd[yy][xx].G, cd[yy][xx].B), dtm.t[0]) then
goto AnotherLoopEnd;
b[xx][yy] := B[xx][yy] or 1;
for i := 1 to dtm.l - 1 do
@ -1688,8 +1688,8 @@ begin
// may want to remove this line, but I think it is a good optimisation.
if B[xxx][yyy] and (1 shl i) = 0 then
begin
//if dtm.c[i] = RGBToColor(cd[yyy][xxx].R, cd[yyy][xxx].G, cd[yyy][xxx].B) then
if SimilarColors(dtm.c[i], RGBToColor(cd[yyy][xxx].R, cd[yyy][xxx].G, cd[yyy][xxx].B), dtm.t[i]) then
if Sqrt(sqr(rgbs[i].r - cd[yyy][xxx].R) + sqr(rgbs[i].g - cd[yyy][xxx].G) + sqr(rgbs[i].b - cd[yyy][xxx].B)) <= dtm.t[i] then
// if SimilarColors(dtm.c[i], RGBToColor(cd[yyy][xxx].R, cd[yyy][xxx].G, cd[yyy][xxx].B), dtm.t[i]) then
b[xxx][yyy] := B[xxx][yyy] or (1 shl i)
else
goto AnotherLoopEnd;