1
0
mirror of https://github.com/moparisthebest/Simba synced 2024-11-22 09:12:19 -05:00

Fixed some warnings + added FindDTM and AreaShape.

git-svn-id: http://www.villavu.com/repositories/merlijn/mufasa@100 3f818213-9676-44b0-a9b4-5e4c4e03d09d
This commit is contained in:
Wizzup? 2009-10-03 22:11:30 +00:00
parent 33b416a939
commit 490c3e1871
7 changed files with 655 additions and 518 deletions

View File

@ -7,7 +7,7 @@
<TargetFileExt Value=""/> <TargetFileExt Value=""/>
<Title Value="Mufasa Stand Alone"/> <Title Value="Mufasa Stand Alone"/>
<UseXPManifest Value="True"/> <UseXPManifest Value="True"/>
<ActiveEditorIndexAtStart Value="3"/> <ActiveEditorIndexAtStart Value="10"/>
</General> </General>
<VersionInfo> <VersionInfo>
<ProjectVersion Value=""/> <ProjectVersion Value=""/>
@ -33,7 +33,7 @@
<PackageName Value="LCL"/> <PackageName Value="LCL"/>
</Item2> </Item2>
</RequiredPackages> </RequiredPackages>
<Units Count="128"> <Units Count="129">
<Unit0> <Unit0>
<Filename Value="project1.lpr"/> <Filename Value="project1.lpr"/>
<IsPartOfProject Value="True"/> <IsPartOfProject Value="True"/>
@ -41,7 +41,7 @@
<CursorPos X="26" Y="12"/> <CursorPos X="26" Y="12"/>
<TopLine Value="1"/> <TopLine Value="1"/>
<EditorIndex Value="0"/> <EditorIndex Value="0"/>
<UsageCount Value="153"/> <UsageCount Value="157"/>
<Loaded Value="True"/> <Loaded Value="True"/>
</Unit0> </Unit0>
<Unit1> <Unit1>
@ -170,10 +170,10 @@
<HasResources Value="True"/> <HasResources Value="True"/>
<ResourceBaseClass Value="Form"/> <ResourceBaseClass Value="Form"/>
<UnitName Value="TestUnit"/> <UnitName Value="TestUnit"/>
<CursorPos X="37" Y="115"/> <CursorPos X="10" Y="11"/>
<TopLine Value="84"/> <TopLine Value="1"/>
<EditorIndex Value="11"/> <EditorIndex Value="14"/>
<UsageCount Value="119"/> <UsageCount Value="123"/>
<Loaded Value="True"/> <Loaded Value="True"/>
</Unit18> </Unit18>
<Unit19> <Unit19>
@ -302,20 +302,20 @@
<Filename Value="../../Units/MMLCore/client.pas"/> <Filename Value="../../Units/MMLCore/client.pas"/>
<IsPartOfProject Value="True"/> <IsPartOfProject Value="True"/>
<UnitName Value="Client"/> <UnitName Value="Client"/>
<CursorPos X="23" Y="18"/> <CursorPos X="39" Y="8"/>
<TopLine Value="18"/> <TopLine Value="1"/>
<EditorIndex Value="2"/> <EditorIndex Value="2"/>
<UsageCount Value="118"/> <UsageCount Value="122"/>
<Loaded Value="True"/> <Loaded Value="True"/>
</Unit37> </Unit37>
<Unit38> <Unit38>
<Filename Value="../../Units/MMLCore/mufasatypes.pas"/> <Filename Value="../../Units/MMLCore/mufasatypes.pas"/>
<IsPartOfProject Value="True"/> <IsPartOfProject Value="True"/>
<UnitName Value="MufasaTypes"/> <UnitName Value="MufasaTypes"/>
<CursorPos X="1" Y="35"/> <CursorPos X="21" Y="36"/>
<TopLine Value="21"/> <TopLine Value="30"/>
<EditorIndex Value="1"/> <EditorIndex Value="1"/>
<UsageCount Value="118"/> <UsageCount Value="122"/>
<Loaded Value="True"/> <Loaded Value="True"/>
</Unit38> </Unit38>
<Unit39> <Unit39>
@ -329,19 +329,19 @@
<Filename Value="../../Units/MMLCore/files.pas"/> <Filename Value="../../Units/MMLCore/files.pas"/>
<IsPartOfProject Value="True"/> <IsPartOfProject Value="True"/>
<UnitName Value="files"/> <UnitName Value="files"/>
<CursorPos X="30" Y="20"/> <CursorPos X="15" Y="76"/>
<TopLine Value="1"/> <TopLine Value="47"/>
<UsageCount Value="119"/> <EditorIndex Value="4"/>
<UsageCount Value="123"/>
<Loaded Value="True"/>
</Unit40> </Unit40>
<Unit41> <Unit41>
<Filename Value="../../Units/MMLCore/window.pas"/> <Filename Value="../../Units/MMLCore/window.pas"/>
<IsPartOfProject Value="True"/> <IsPartOfProject Value="True"/>
<UnitName Value="Window"/> <UnitName Value="Window"/>
<CursorPos X="29" Y="233"/> <CursorPos X="41" Y="243"/>
<TopLine Value="233"/> <TopLine Value="228"/>
<EditorIndex Value="12"/> <UsageCount Value="122"/>
<UsageCount Value="118"/>
<Loaded Value="True"/>
</Unit41> </Unit41>
<Unit42> <Unit42>
<Filename Value="../../../Documents/lazarus/lcl/forms.pp"/> <Filename Value="../../../Documents/lazarus/lcl/forms.pp"/>
@ -355,8 +355,8 @@
<UnitName Value="CompTypes"/> <UnitName Value="CompTypes"/>
<CursorPos X="35" Y="727"/> <CursorPos X="35" Y="727"/>
<TopLine Value="712"/> <TopLine Value="712"/>
<EditorIndex Value="6"/> <EditorIndex Value="9"/>
<UsageCount Value="21"/> <UsageCount Value="24"/>
<Loaded Value="True"/> <Loaded Value="True"/>
</Unit43> </Unit43>
<Unit44> <Unit44>
@ -364,26 +364,24 @@
<UnitName Value="windowutil"/> <UnitName Value="windowutil"/>
<CursorPos X="86" Y="19"/> <CursorPos X="86" Y="19"/>
<TopLine Value="1"/> <TopLine Value="1"/>
<EditorIndex Value="13"/> <UsageCount Value="43"/>
<UsageCount Value="41"/>
<Loaded Value="True"/>
</Unit44> </Unit44>
<Unit45> <Unit45>
<Filename Value="../../Units/MMLCore/input.pas"/> <Filename Value="../../Units/MMLCore/input.pas"/>
<UnitName Value="Input"/> <UnitName Value="Input"/>
<CursorPos X="32" Y="251"/> <CursorPos X="32" Y="251"/>
<TopLine Value="220"/> <TopLine Value="220"/>
<EditorIndex Value="7"/> <UsageCount Value="23"/>
<UsageCount Value="21"/>
<Loaded Value="True"/>
</Unit45> </Unit45>
<Unit46> <Unit46>
<Filename Value="../../Units/MMLCore/finder.pas"/> <Filename Value="../../Units/MMLCore/finder.pas"/>
<IsPartOfProject Value="True"/> <IsPartOfProject Value="True"/>
<UnitName Value="finder"/> <UnitName Value="finder"/>
<CursorPos X="20" Y="29"/> <CursorPos X="79" Y="29"/>
<TopLine Value="14"/> <TopLine Value="15"/>
<UsageCount Value="111"/> <EditorIndex Value="3"/>
<UsageCount Value="115"/>
<Loaded Value="True"/>
</Unit46> </Unit46>
<Unit47> <Unit47>
<Filename Value="../../../lazarus/lcl/graphics.pp"/> <Filename Value="../../../lazarus/lcl/graphics.pp"/>
@ -396,9 +394,11 @@
<Filename Value="../../Units/MMLAddon/mmlthread.pas"/> <Filename Value="../../Units/MMLAddon/mmlthread.pas"/>
<IsPartOfProject Value="True"/> <IsPartOfProject Value="True"/>
<UnitName Value="MMLThread"/> <UnitName Value="MMLThread"/>
<CursorPos X="132" Y="5"/> <CursorPos X="10" Y="62"/>
<TopLine Value="1"/> <TopLine Value="50"/>
<UsageCount Value="109"/> <EditorIndex Value="11"/>
<UsageCount Value="113"/>
<Loaded Value="True"/>
</Unit48> </Unit48>
<Unit49> <Unit49>
<Filename Value="../../../Documents/fpc/rtl/objpas/classes/classesh.inc"/> <Filename Value="../../../Documents/fpc/rtl/objpas/classes/classesh.inc"/>
@ -410,10 +410,10 @@
<Filename Value="../../Units/MMLAddon/mmlpsthread.pas"/> <Filename Value="../../Units/MMLAddon/mmlpsthread.pas"/>
<IsPartOfProject Value="True"/> <IsPartOfProject Value="True"/>
<UnitName Value="mmlpsthread"/> <UnitName Value="mmlpsthread"/>
<CursorPos X="18" Y="177"/> <CursorPos X="72" Y="15"/>
<TopLine Value="174"/> <TopLine Value="11"/>
<EditorIndex Value="8"/> <EditorIndex Value="10"/>
<UsageCount Value="107"/> <UsageCount Value="111"/>
<Loaded Value="True"/> <Loaded Value="True"/>
</Unit50> </Unit50>
<Unit51> <Unit51>
@ -521,11 +521,9 @@
</Unit65> </Unit65>
<Unit66> <Unit66>
<Filename Value="../../Units/MMLAddon/PSInc/pscompile.inc"/> <Filename Value="../../Units/MMLAddon/PSInc/pscompile.inc"/>
<CursorPos X="49" Y="13"/> <CursorPos X="33" Y="13"/>
<TopLine Value="1"/> <TopLine Value="1"/>
<EditorIndex Value="9"/> <UsageCount Value="30"/>
<UsageCount Value="28"/>
<Loaded Value="True"/>
</Unit66> </Unit66>
<Unit67> <Unit67>
<Filename Value="../../../FPC/FPCCheckout/rtl/win/tthread.inc"/> <Filename Value="../../../FPC/FPCCheckout/rtl/win/tthread.inc"/>
@ -543,9 +541,11 @@
<Filename Value="../../Units/MMLCore/bitmaps.pas"/> <Filename Value="../../Units/MMLCore/bitmaps.pas"/>
<IsPartOfProject Value="True"/> <IsPartOfProject Value="True"/>
<UnitName Value="bitmaps"/> <UnitName Value="bitmaps"/>
<CursorPos X="63" Y="428"/> <CursorPos X="31" Y="430"/>
<TopLine Value="387"/> <TopLine Value="419"/>
<UsageCount Value="97"/> <EditorIndex Value="5"/>
<UsageCount Value="101"/>
<Loaded Value="True"/>
</Unit69> </Unit69>
<Unit70> <Unit70>
<Filename Value="../../../FPC/FPCCheckout/packages/fcl-image/src/fpcanvas.pp"/> <Filename Value="../../../FPC/FPCCheckout/packages/fcl-image/src/fpcanvas.pp"/>
@ -565,7 +565,7 @@
<IsPartOfProject Value="True"/> <IsPartOfProject Value="True"/>
<CursorPos X="30" Y="34"/> <CursorPos X="30" Y="34"/>
<TopLine Value="22"/> <TopLine Value="22"/>
<UsageCount Value="96"/> <UsageCount Value="100"/>
</Unit72> </Unit72>
<Unit73> <Unit73>
<Filename Value="../../../FPC/FPCCheckout/packages/fcl-image/src/fpcanvas.inc"/> <Filename Value="../../../FPC/FPCCheckout/packages/fcl-image/src/fpcanvas.inc"/>
@ -697,7 +697,7 @@
<UnitName Value="colour_conv"/> <UnitName Value="colour_conv"/>
<CursorPos X="11" Y="148"/> <CursorPos X="11" Y="148"/>
<TopLine Value="140"/> <TopLine Value="140"/>
<UsageCount Value="79"/> <UsageCount Value="83"/>
</Unit92> </Unit92>
<Unit93> <Unit93>
<Filename Value="../../../cogat/Units/CogatUnits/compcolors.pas"/> <Filename Value="../../../cogat/Units/CogatUnits/compcolors.pas"/>
@ -756,7 +756,7 @@
<UnitName Value="plugins"/> <UnitName Value="plugins"/>
<CursorPos X="86" Y="128"/> <CursorPos X="86" Y="128"/>
<TopLine Value="128"/> <TopLine Value="128"/>
<UsageCount Value="73"/> <UsageCount Value="77"/>
</Unit101> </Unit101>
<Unit102> <Unit102>
<Filename Value="../../../Compilertje/Units/CogatUnits/compfiles.pas"/> <Filename Value="../../../Compilertje/Units/CogatUnits/compfiles.pas"/>
@ -838,20 +838,20 @@
<Unit114> <Unit114>
<Filename Value="../../../cogat/Units/CogatUnits/compdtm.pas"/> <Filename Value="../../../cogat/Units/CogatUnits/compdtm.pas"/>
<UnitName Value="compDTM"/> <UnitName Value="compDTM"/>
<CursorPos X="29" Y="11"/> <CursorPos X="1" Y="377"/>
<TopLine Value="11"/> <TopLine Value="361"/>
<EditorIndex Value="5"/> <EditorIndex Value="8"/>
<UsageCount Value="16"/> <UsageCount Value="19"/>
<Loaded Value="True"/> <Loaded Value="True"/>
</Unit114> </Unit114>
<Unit115> <Unit115>
<Filename Value="../../Units/MMLCore/dtm.pas"/> <Filename Value="../../Units/MMLCore/dtm.pas"/>
<IsPartOfProject Value="True"/> <IsPartOfProject Value="True"/>
<UnitName Value="dtm"/> <UnitName Value="dtm"/>
<CursorPos X="30" Y="133"/> <CursorPos X="48" Y="128"/>
<TopLine Value="104"/> <TopLine Value="111"/>
<EditorIndex Value="3"/> <EditorIndex Value="6"/>
<UsageCount Value="54"/> <UsageCount Value="58"/>
<Loaded Value="True"/> <Loaded Value="True"/>
</Unit115> </Unit115>
<Unit116> <Unit116>
@ -865,9 +865,11 @@
<Filename Value="../../Units/MMLAddon/colourpicker.pas"/> <Filename Value="../../Units/MMLAddon/colourpicker.pas"/>
<IsPartOfProject Value="True"/> <IsPartOfProject Value="True"/>
<UnitName Value="colourpicker"/> <UnitName Value="colourpicker"/>
<CursorPos X="27" Y="34"/> <CursorPos X="53" Y="33"/>
<TopLine Value="13"/> <TopLine Value="15"/>
<UsageCount Value="50"/> <EditorIndex Value="12"/>
<UsageCount Value="54"/>
<Loaded Value="True"/>
</Unit117> </Unit117>
<Unit118> <Unit118>
<Filename Value="../../../cogat/Units/CogatUnits/compdragger.pas"/> <Filename Value="../../../cogat/Units/CogatUnits/compdragger.pas"/>
@ -892,7 +894,7 @@
<UnitName Value="windowselector"/> <UnitName Value="windowselector"/>
<CursorPos X="76" Y="83"/> <CursorPos X="76" Y="83"/>
<TopLine Value="65"/> <TopLine Value="65"/>
<UsageCount Value="40"/> <UsageCount Value="44"/>
</Unit120> </Unit120>
<Unit121> <Unit121>
<Filename Value="../../../../../../usr/lib64/fpc/2.2.4/source/rtl/objpas/classes/classesh.inc"/> <Filename Value="../../../../../../usr/lib64/fpc/2.2.4/source/rtl/objpas/classes/classesh.inc"/>
@ -926,8 +928,8 @@
<UnitName Value="dtmutil"/> <UnitName Value="dtmutil"/>
<CursorPos X="1" Y="17"/> <CursorPos X="1" Y="17"/>
<TopLine Value="1"/> <TopLine Value="1"/>
<EditorIndex Value="4"/> <EditorIndex Value="7"/>
<UsageCount Value="27"/> <UsageCount Value="31"/>
<Loaded Value="True"/> <Loaded Value="True"/>
</Unit125> </Unit125>
<Unit126> <Unit126>
@ -939,133 +941,140 @@
</Unit126> </Unit126>
<Unit127> <Unit127>
<Filename Value="../../Units/MMLAddon/PSInc/Wrappers/dtm.inc"/> <Filename Value="../../Units/MMLAddon/PSInc/Wrappers/dtm.inc"/>
<CursorPos X="85" Y="1"/> <CursorPos X="26" Y="6"/>
<TopLine Value="1"/> <TopLine Value="1"/>
<EditorIndex Value="10"/> <EditorIndex Value="13"/>
<UsageCount Value="11"/> <UsageCount Value="14"/>
<Loaded Value="True"/> <Loaded Value="True"/>
</Unit127> </Unit127>
<Unit128>
<Filename Value="../../../../Documents/lazarus/lcl/graphics.pp"/>
<UnitName Value="Graphics"/>
<CursorPos X="3" Y="53"/>
<TopLine Value="38"/>
<UsageCount Value="10"/>
</Unit128>
</Units> </Units>
<JumpHistory Count="30" HistoryIndex="29"> <JumpHistory Count="30" HistoryIndex="29">
<Position1> <Position1>
<Filename Value="../../../cogat/Units/CogatUnits/compdtm.pas"/> <Filename Value="../../Units/MMLCore/dtm.pas"/>
<Caret Line="79" Column="21" TopLine="61"/> <Caret Line="136" Column="47" TopLine="121"/>
</Position1> </Position1>
<Position2> <Position2>
<Filename Value="../../Units/MMLCore/dtmutil.pas"/> <Filename Value="../../Units/MMLCore/dtm.pas"/>
<Caret Line="22" Column="4" TopLine="6"/> <Caret Line="125" Column="25" TopLine="110"/>
</Position2> </Position2>
<Position3> <Position3>
<Filename Value="../../../cogat/Units/CogatUnits/compdtm.pas"/> <Filename Value="../../Units/MMLCore/dtm.pas"/>
<Caret Line="79" Column="9" TopLine="61"/> <Caret Line="77" Column="27" TopLine="51"/>
</Position3> </Position3>
<Position4> <Position4>
<Filename Value="../../Units/MMLCore/dtmutil.pas"/> <Filename Value="../../Units/MMLCore/dtm.pas"/>
<Caret Line="23" Column="1" TopLine="11"/> <Caret Line="431" Column="60" TopLine="401"/>
</Position4> </Position4>
<Position5> <Position5>
<Filename Value="../../Units/MMLCore/dtm.pas"/> <Filename Value="../../Units/MMLCore/dtm.pas"/>
<Caret Line="118" Column="25" TopLine="95"/> <Caret Line="393" Column="28" TopLine="381"/>
</Position5> </Position5>
<Position6> <Position6>
<Filename Value="../../Units/MMLCore/dtm.pas"/> <Filename Value="../../Units/MMLCore/dtm.pas"/>
<Caret Line="199" Column="23" TopLine="131"/> <Caret Line="386" Column="3" TopLine="375"/>
</Position6> </Position6>
<Position7> <Position7>
<Filename Value="../../Units/MMLCore/dtm.pas"/> <Filename Value="../../Units/MMLCore/dtm.pas"/>
<Caret Line="103" Column="7" TopLine="88"/> <Caret Line="78" Column="20" TopLine="61"/>
</Position7> </Position7>
<Position8> <Position8>
<Filename Value="../../Units/MMLCore/dtm.pas"/> <Filename Value="testunit.pas"/>
<Caret Line="11" Column="42" TopLine="1"/> <Caret Line="11" Column="10" TopLine="1"/>
</Position8> </Position8>
<Position9> <Position9>
<Filename Value="../../Units/MMLCore/dtm.pas"/> <Filename Value="../../Units/MMLCore/dtm.pas"/>
<Caret Line="291" Column="31" TopLine="276"/> <Caret Line="17" Column="78" TopLine="1"/>
</Position9> </Position9>
<Position10> <Position10>
<Filename Value="../../Units/MMLCore/dtm.pas"/> <Filename Value="../../Units/MMLAddon/mmlpsthread.pas"/>
<Caret Line="10" Column="45" TopLine="1"/> <Caret Line="196" Column="48" TopLine="196"/>
</Position10> </Position10>
<Position11> <Position11>
<Filename Value="../../Units/MMLCore/dtm.pas"/> <Filename Value="../../Units/MMLAddon/mmlpsthread.pas"/>
<Caret Line="5" Column="49" TopLine="1"/> <Caret Line="69" Column="3" TopLine="54"/>
</Position11> </Position11>
<Position12> <Position12>
<Filename Value="../../Units/MMLCore/dtm.pas"/> <Filename Value="../../Units/MMLAddon/mmlpsthread.pas"/>
<Caret Line="263" Column="31" TopLine="263"/> <Caret Line="68" Column="1" TopLine="54"/>
</Position12> </Position12>
<Position13> <Position13>
<Filename Value="../../Units/MMLCore/dtm.pas"/> <Filename Value="../../Units/MMLAddon/mmlpsthread.pas"/>
<Caret Line="80" Column="60" TopLine="68"/> <Caret Line="147" Column="4" TopLine="132"/>
</Position13> </Position13>
<Position14> <Position14>
<Filename Value="../../Units/MMLCore/dtm.pas"/> <Filename Value="../../Units/MMLAddon/mmlpsthread.pas"/>
<Caret Line="269" Column="53" TopLine="18"/> <Caret Line="16" Column="37" TopLine="2"/>
</Position14> </Position14>
<Position15> <Position15>
<Filename Value="../../Units/MMLCore/dtm.pas"/> <Filename Value="../../Units/MMLAddon/mmlpsthread.pas"/>
<Caret Line="306" Column="48" TopLine="291"/> <Caret Line="191" Column="14" TopLine="171"/>
</Position15> </Position15>
<Position16> <Position16>
<Filename Value="../../Units/MMLCore/dtm.pas"/> <Filename Value="../../Units/MMLAddon/mmlpsthread.pas"/>
<Caret Line="1" Column="77" TopLine="1"/> <Caret Line="24" Column="51" TopLine="19"/>
</Position16> </Position16>
<Position17> <Position17>
<Filename Value="../../Units/MMLCore/dtm.pas"/> <Filename Value="../../Units/MMLAddon/mmlpsthread.pas"/>
<Caret Line="12" Column="63" TopLine="1"/> <Caret Line="189" Column="1" TopLine="171"/>
</Position17> </Position17>
<Position18> <Position18>
<Filename Value="../../Units/MMLCore/dtm.pas"/> <Filename Value="../../Units/MMLAddon/mmlpsthread.pas"/>
<Caret Line="7" Column="46" TopLine="1"/> <Caret Line="10" Column="50" TopLine="9"/>
</Position18> </Position18>
<Position19> <Position19>
<Filename Value="../../Units/MMLCore/dtm.pas"/> <Filename Value="../../Units/MMLAddon/mmlpsthread.pas"/>
<Caret Line="6" Column="63" TopLine="1"/> <Caret Line="25" Column="41" TopLine="10"/>
</Position19> </Position19>
<Position20> <Position20>
<Filename Value="../../../cogat/Units/CogatUnits/compdtm.pas"/> <Filename Value="../../Units/MMLAddon/mmlpsthread.pas"/>
<Caret Line="11" Column="29" TopLine="1"/> <Caret Line="27" Column="47" TopLine="12"/>
</Position20> </Position20>
<Position21> <Position21>
<Filename Value="../../../cogat/Units/CogatUnits/comptypes.pas"/> <Filename Value="../../Units/MMLAddon/mmlpsthread.pas"/>
<Caret Line="11" Column="40" TopLine="1"/> <Caret Line="236" Column="7" TopLine="231"/>
</Position21> </Position21>
<Position22> <Position22>
<Filename Value="../../../cogat/Units/CogatUnits/comptypes.pas"/> <Filename Value="../../Units/MMLAddon/mmlthread.pas"/>
<Caret Line="137" Column="11" TopLine="122"/> <Caret Line="5" Column="132" TopLine="1"/>
</Position22> </Position22>
<Position23> <Position23>
<Filename Value="../../../cogat/Units/CogatUnits/comptypes.pas"/> <Filename Value="../../Units/MMLAddon/colourpicker.pas"/>
<Caret Line="138" Column="17" TopLine="122"/> <Caret Line="34" Column="27" TopLine="13"/>
</Position23> </Position23>
<Position24> <Position24>
<Filename Value="../../Units/MMLAddon/mmlpsthread.pas"/> <Filename Value="../../Units/MMLAddon/colourpicker.pas"/>
<Caret Line="40" Column="55" TopLine="27"/> <Caret Line="87" Column="10" TopLine="72"/>
</Position24> </Position24>
<Position25> <Position25>
<Filename Value="../../Units/MMLAddon/mmlpsthread.pas"/> <Filename Value="../../Units/MMLAddon/colourpicker.pas"/>
<Caret Line="44" Column="27" TopLine="27"/> <Caret Line="28" Column="33" TopLine="13"/>
</Position25> </Position25>
<Position26> <Position26>
<Filename Value="../../Units/MMLAddon/mmlpsthread.pas"/> <Filename Value="../../Units/MMLAddon/colourpicker.pas"/>
<Caret Line="139" Column="22" TopLine="121"/> <Caret Line="105" Column="37" TopLine="90"/>
</Position26> </Position26>
<Position27> <Position27>
<Filename Value="../../Units/MMLAddon/mmlpsthread.pas"/> <Filename Value="../../Units/MMLAddon/colourpicker.pas"/>
<Caret Line="138" Column="22" TopLine="121"/> <Caret Line="156" Column="39" TopLine="141"/>
</Position27> </Position27>
<Position28> <Position28>
<Filename Value="../../Units/MMLAddon/mmlpsthread.pas"/> <Filename Value="../../Units/MMLAddon/colourpicker.pas"/>
<Caret Line="139" Column="32" TopLine="121"/> <Caret Line="30" Column="49" TopLine="15"/>
</Position28> </Position28>
<Position29> <Position29>
<Filename Value="../../Units/MMLAddon/mmlpsthread.pas"/> <Filename Value="../../Units/MMLAddon/mmlpsthread.pas"/>
<Caret Line="177" Column="18" TopLine="174"/> <Caret Line="8" Column="76" TopLine="1"/>
</Position29> </Position29>
<Position30> <Position30>
<Filename Value="../../Units/MMLAddon/PSInc/pscompile.inc"/> <Filename Value="../../Units/MMLAddon/mmlpsthread.pas"/>
<Caret Line="15" Column="1" TopLine="1"/> <Caret Line="105" Column="38" TopLine="90"/>
</Position30> </Position30>
</JumpHistory> </JumpHistory>
</ProjectOptions> </ProjectOptions>

View File

@ -3,7 +3,7 @@ begin
Result := CurrThread.Client.MDTM.FindDTM(DTM, x, y, x1, y1, x2, y2); Result := CurrThread.Client.MDTM.FindDTM(DTM, x, y, x1, y1, x2, y2);
end; end;
function ps_StringFromDTM(DTMString: String): Integer; function ps_DTMFromString(DTMString: String): Integer;
var var
dtm: pDTM; dtm: pDTM;
begin begin

View File

@ -1,67 +1,67 @@
Sender.Comp.AddTypeS('TIntegerArray', 'Array of integer'); Sender.Comp.AddTypeS('TIntegerArray', 'Array of integer');
Sender.Comp.AddTypeS('TPointArray','Array of TPoint'); Sender.Comp.AddTypeS('TPointArray','Array of TPoint');
Sender.Comp.AddTypeS('TBmpMirrorStyle','(MirrorWidth,MirrorHeight,MirrorLine)'); Sender.Comp.AddTypeS('TBmpMirrorStyle','(MirrorWidth,MirrorHeight,MirrorLine)');
//Sender.Comp.AddTypeS('pDTM','pDTM = record p: TPointArray; c, t, asz, ash: TIntegerArray; end'); //Sender.Comp.AddTypeS('pDTM','pDTM = record p: TPointArray; c, t, asz, ash: TIntegerArray; end');
Sender.AddFunction(@ThreadSafeCall,'function ThreadSafeCall(ProcName: string; var V: TVariantArray): Variant;'); Sender.AddFunction(@ThreadSafeCall,'function ThreadSafeCall(ProcName: string; var V: TVariantArray): Variant;');
Sender.AddFunction(@psWriteln,'procedure writeln(s : string);'); Sender.AddFunction(@psWriteln,'procedure writeln(s : string);');
{ DTM } { DTM }
Sender.AddFunction(@ps_StringFromDTM, 'function DTMFromString(DTMString: String): Integer;'); Sender.AddFunction(@ps_DTMFromString, 'function DTMFromString(DTMString: String): Integer;');
Sender.AddFunction(@ps_FreeDTM, 'procedure FreeDTM(DTM: Integer);'); Sender.AddFunction(@ps_FreeDTM, 'procedure FreeDTM(DTM: Integer);');
Sender.AddFunction(@FindDTM, 'function FindDTM(DTM: Integer; var x, y: Integer; x1, y1, x2, y2: Integer): Boolean;'); Sender.AddFunction(@FindDTM, 'function FindDTM(DTM: Integer; var x, y: Integer; x1, y1, x2, y2: Integer): Boolean;');
{maths} {maths}
sender.AddFunction(@power,'function pow(base,exponent : extended) : extended'); sender.AddFunction(@power,'function pow(base,exponent : extended) : extended');
Sender.AddFunction(@max,'function Max(a, b: Integer): Integer;'); Sender.AddFunction(@max,'function Max(a, b: Integer): Integer;');
Sender.AddFunction(@min,'function Min(a, b: Integer): Integer;'); Sender.AddFunction(@min,'function Min(a, b: Integer): Integer;');
Sender.AddFunction(@pssqr,'function Sqr(e : extended) : extended;'); Sender.AddFunction(@pssqr,'function Sqr(e : extended) : extended;');
Sender.AddFunction(@Freeze, 'function freeze:boolean;'); Sender.AddFunction(@Freeze, 'function freeze:boolean;');
Sender.AddFunction(@Unfreeze, 'function unfreeze: boolean;'); Sender.AddFunction(@Unfreeze, 'function unfreeze: boolean;');
Sender.AddFunction(@GetColor,'function GetColor(x, y: Integer): Integer;'); Sender.AddFunction(@GetColor,'function GetColor(x, y: Integer): Integer;');
Sender.AddFunction(@FindColor, 'function findcolor(var x, y: integer; color, x1, y1, x2, y2: integer): boolean;'); Sender.AddFunction(@FindColor, 'function findcolor(var x, y: integer; color, x1, y1, x2, y2: integer): boolean;');
Sender.AddFunction(@FindColorTolerance, 'function findcolortolerance(var x, y: integer; color, x1, y1, x2, y2, tol: integer): boolean;'); Sender.AddFunction(@FindColorTolerance, 'function findcolortolerance(var x, y: integer; color, x1, y1, x2, y2, tol: integer): boolean;');
Sender.AddFunction(@FindColors, 'function findcolors(var TPA: TPointArray; color, x1, y1, x2, y2: integer): boolean;'); Sender.AddFunction(@FindColors, 'function findcolors(var TPA: TPointArray; color, x1, y1, x2, y2: integer): boolean;');
Sender.AddFunction(@SimilarColors,'function SimilarColors(Col1,Col2,Tolerance : integer) : boolean'); Sender.AddFunction(@SimilarColors,'function SimilarColors(Col1,Col2,Tolerance : integer) : boolean');
Sender.AddFunction(@CountColorTolerance,'function CountColorTolerance(Color, xs, ys, xe, ye, Tolerance: Integer): Integer;'); Sender.AddFunction(@CountColorTolerance,'function CountColorTolerance(Color, xs, ys, xe, ye, Tolerance: Integer): Integer;');
Sender.AddFunction(@FindColorsTolerance,'function FindColorsTolerance(var Points: TPointArray; Color, xs, ys, xe, ye, Tolerance: Integer): Boolean;'); Sender.AddFunction(@FindColorsTolerance,'function FindColorsTolerance(var Points: TPointArray; Color, xs, ys, xe, ye, Tolerance: Integer): Boolean;');
Sender.AddFunction(@MoveMouse, 'procedure MoveMouse(x, y: integer);'); Sender.AddFunction(@MoveMouse, 'procedure MoveMouse(x, y: integer);');
Sender.AddFunction(@GetMousePos, 'procedure GetMousePos(var x, y: integer);'); Sender.AddFunction(@GetMousePos, 'procedure GetMousePos(var x, y: integer);');
Sender.AddFunction(@Wait, 'procedure wait(t: integer);'); Sender.AddFunction(@Wait, 'procedure wait(t: integer);');
Sender.AddFunction(@GetClientDimensions, 'procedure GetClientDimensions(var w, h:integer);'); Sender.AddFunction(@GetClientDimensions, 'procedure GetClientDimensions(var w, h:integer);');
Sender.AddFunction(@SetColorToleranceSpeed, 'procedure SetColorToleranceSpeed(cts: integer);'); Sender.AddFunction(@SetColorToleranceSpeed, 'procedure SetColorToleranceSpeed(cts: integer);');
Sender.AddFunction(@GetTickCount, 'function GetSystemTime: Integer;'); Sender.AddFunction(@GetTickCount, 'function GetSystemTime: Integer;');
Sender.AddFunction(@CreateBitmap,'function CreateBitmap(w,h :integer) : integer;'); Sender.AddFunction(@CreateBitmap,'function CreateBitmap(w,h :integer) : integer;');
Sender.AddFunction(@FreeBitmap,'procedure FreeBitmap(Bmp : integer);'); Sender.AddFunction(@FreeBitmap,'procedure FreeBitmap(Bmp : integer);');
Sender.AddFunction(@SaveBitmap,'procedure SaveBitmap(Bmp : integer; path : string);'); Sender.AddFunction(@SaveBitmap,'procedure SaveBitmap(Bmp : integer; path : string);');
Sender.AddFunction(@BitmapFromString,'function BitmapFromString(Width,Height : integer; Data : string): integer;'); Sender.AddFunction(@BitmapFromString,'function BitmapFromString(Width,Height : integer; Data : string): integer;');
Sender.AddFunction(@LoadBitmap,'function LoadBitmap(Path : string) : integer;'); Sender.AddFunction(@LoadBitmap,'function LoadBitmap(Path : string) : integer;');
Sender.AddFunction(@SetBitmapSize,'procedure SetBitmapSize(Bmp,NewW,NewH : integer);'); Sender.AddFunction(@SetBitmapSize,'procedure SetBitmapSize(Bmp,NewW,NewH : integer);');
Sender.AddFunction(@GetBitmapSize,'procedure GetBitmapSize(Bmp : integer; Var BmpW,BmpH : integer);'); Sender.AddFunction(@GetBitmapSize,'procedure GetBitmapSize(Bmp : integer; Var BmpW,BmpH : integer);');
Sender.AddFunction(@CreateMirroredBitmap,'function CreateMirroredBitmap(Bmp : integer) : integer;'); Sender.AddFunction(@CreateMirroredBitmap,'function CreateMirroredBitmap(Bmp : integer) : integer;');
Sender.AddFunction(@CreateMirroredBitmapEx,'function CreateMirroredBitmapEx(Bmp : integer; MirrorStyle : TBmpMirrorStyle) : integer;'); Sender.AddFunction(@CreateMirroredBitmapEx,'function CreateMirroredBitmapEx(Bmp : integer; MirrorStyle : TBmpMirrorStyle) : integer;');
Sender.AddFunction(@FastSetPixel,'procedure FastSetPixel(bmp,x,y : integer; Color : TColor);'); Sender.AddFunction(@FastSetPixel,'procedure FastSetPixel(bmp,x,y : integer; Color : TColor);');
Sender.AddFunction(@FastSetPixels,'procedure FastSetPixels(bmp : integer; TPA : TPointArray; Colors : TIntegerArray);'); Sender.AddFunction(@FastSetPixels,'procedure FastSetPixels(bmp : integer; TPA : TPointArray; Colors : TIntegerArray);');
Sender.AddFunction(@FastGetPixel,'function FastGetPixel(bmp, x,y : integer) : TColor;'); Sender.AddFunction(@FastGetPixel,'function FastGetPixel(bmp, x,y : integer) : TColor;');
Sender.AddFunction(@FastGetPixels,'function FastGetPixels(Bmp : integer; TPA : TPointArray) : TIntegerArray;'); Sender.AddFunction(@FastGetPixels,'function FastGetPixels(Bmp : integer; TPA : TPointArray) : TIntegerArray;');
Sender.AddFunction(@FastDrawClear,'procedure FastDrawClear(bmp : integer; Color : TColor)'); Sender.AddFunction(@FastDrawClear,'procedure FastDrawClear(bmp : integer; Color : TColor)');
Sender.AddFunction(@FastDrawTransparent,'procedure FastDrawTransparent(x, y: Integer; SourceBitmap, TargetBitmap: Integer);'); Sender.AddFunction(@FastDrawTransparent,'procedure FastDrawTransparent(x, y: Integer; SourceBitmap, TargetBitmap: Integer);');
Sender.AddFunction(@SetTransparentColor,'procedure SetTransparentColor(bmp : integer; Color : TColor);'); Sender.AddFunction(@SetTransparentColor,'procedure SetTransparentColor(bmp : integer; Color : TColor);');
Sender.AddFunction(@GetTransparentColor,'function GetTransparentColor(bmp: integer) : TColor;'); Sender.AddFunction(@GetTransparentColor,'function GetTransparentColor(bmp: integer) : TColor;');
Sender.AddFunction(@FastReplaceColor,'procedure FastReplaceColor(Bmp : integer; OldColor,NewColor : TColor);'); Sender.AddFunction(@FastReplaceColor,'procedure FastReplaceColor(Bmp : integer; OldColor,NewColor : TColor);');

View File

@ -83,7 +83,8 @@ begin
Window.SetTarget(Window.DesktopWindow); Window.SetTarget(Window.DesktopWindow);
{$ENDIF} {$ENDIF}
{$ENDIF} {$ENDIF}
w := 0;
h := 0;
Window.GetDimensions(w, h); Window.GetDimensions(w, h);
Form.Width := w; Form.Width := w;

View File

@ -5,7 +5,7 @@ unit mmlpsthread;
interface interface
uses uses
Classes, SysUtils, client, uPSComponent,uPSCompiler,uPSRuntime,stdCtrls, Plugins,uPSPreProcessor; Classes, SysUtils, client, uPSComponent,uPSCompiler,uPSRuntime,stdCtrls, uPSPreProcessor;
type type
@ -65,8 +65,7 @@ begin
end; end;
function ThreadSafeCall(ProcName: string; var V: TVariantArray): Variant; function ThreadSafeCall(ProcName: string; var V: TVariantArray): Variant;
var
i : integer;
begin; begin;
Writeln('We have a length of: ' + inttostr(length(v))); Writeln('We have a length of: ' + inttostr(length(v)));
Try Try
@ -145,7 +144,7 @@ procedure TMMLPSThread.PSScriptProcessUnknowDirective(Sender: TPSPreProcessor;
const DirectiveName, DirectiveParam: string; var Continue: Boolean); const DirectiveName, DirectiveParam: string; var Continue: Boolean);
var var
TempNum : integer; TempNum : integer;
I,II : integer; I: integer;
begin begin
if DirectiveName= 'LOADDLL' then if DirectiveName= 'LOADDLL' then
if DirectiveParam <> '' then if DirectiveParam <> '' then
@ -187,6 +186,7 @@ function TMMLPSThread.RequireFile(Sender: TObject;
const OriginFileName: String; var FileName, OutPut: string): Boolean; const OriginFileName: String; var FileName, OutPut: string): Boolean;
begin begin
Result := False;
end; end;
procedure TMMLPSThread.OnCompImport(Sender: TObject; x: TPSPascalCompiler); procedure TMMLPSThread.OnCompImport(Sender: TObject; x: TPSPascalCompiler);
@ -232,7 +232,7 @@ end;
procedure TMMLPSThread.Execute; procedure TMMLPSThread.Execute;
var var
time, i, ii: Integer; time: Integer;
begin; begin;
CurrThread := Self; CurrThread := Self;
time := lclintf.GetTickCount; time := lclintf.GetTickCount;

View File

@ -58,7 +58,8 @@ var
i,w,h: Integer; i,w,h: Integer;
begin begin
w := 0;
h := 0;
i := 0; i := 0;
while (not Terminated) and (i < 10) do while (not Terminated) and (i < 10) do
begin begin

View File

@ -1,322 +1,448 @@
unit dtm; unit dtm;
{$mode objfpc}{$H+} {$mode objfpc}{$H+}
interface interface
uses uses
Classes, SysUtils, MufasaTypes; Classes, SysUtils, MufasaTypes;
type type
TMDTM = class(TObject) TMDTM = class(TObject)
function AddDTM(d: TDTM): Integer; function AddDTM(d: TDTM): Integer;
function AddpDTM(d: pDTM): Integer; function AddpDTM(d: pDTM): Integer;
function GetDTM(index: Integer; var dtm: pDTM): Boolean; function GetDTM(index: Integer; var dtm: pDTM): Boolean;
procedure FreeDTM(DTM: Integer); procedure FreeDTM(DTM: Integer);
Function StringToDTM(S: String): pDTM; Function StringToDTM(S: String): pDTM;
function FindDTM(DTM: Integer; var x, y: Integer; x1, y1, x2, function FindDTM(DTM: Integer; var x, y: Integer; x1, y1, x2,
y2: Integer): Boolean; y2: Integer): Boolean;
{ function FindDTMs(DTM: Integer; var Points: TPointArray; x1, y1, x2, { function FindDTMs(DTM: Integer; var Points: TPointArray; x1, y1, x2,
y2: Integer): Boolean; y2: Integer): Boolean;
function FindDTMRotated(DTM: Integer; var x, y: Integer; x1, y1, x2, function FindDTMRotated(DTM: Integer; var x, y: Integer; x1, y1, x2,
y2: Integer; sAngle, eAngle, aStep: Extended; y2: Integer; sAngle, eAngle, aStep: Extended;
var aFound: Extended): Boolean; var aFound: Extended): Boolean;
function FindDTMsRotated(DTM: Integer; var Points: TPointArray; x1, function FindDTMsRotated(DTM: Integer; var Points: TPointArray; x1,
y1, x2, y2: Integer; sAngle, eAngle, y1, x2, y2: Integer; sAngle, eAngle,
aStep: Extended; var aFound: T2DExtendedArray) aStep: Extended; var aFound: T2DExtendedArray)
: Boolean; } : Boolean; }
function pFindDTM(DTM: pDTM; var x, y: Integer; x1, y1, x2, y2: function pFindDTM(DTM: pDTM; var x, y: Integer; x1, y1, x2, y2:
Integer): Boolean; Integer): Boolean;
constructor Create(Owner: TObject); constructor Create(Owner: TObject);
destructor Destroy; override; destructor Destroy; override;
private private
function AreaShape(Color, Tolerance, Size, Shape: Integer; P: TPoint) : Boolean; inline;
Client: TObject; private
Client: TObject;
// For decompressing.
BufferString: String; // For decompressing.
BufferString: String;
DTMList: Array Of pDTM;
FreeSpots: Array Of Integer; DTMList: Array Of pDTM;
end; FreeSpots: Array Of Integer;
const end;
dtm_Rectangle = 0; const
dtm_Cross = 1; dtm_Rectangle = 0;
dtm_DiagonalCross = 2; dtm_Cross = 1;
dtm_Circle = 3; dtm_DiagonalCross = 2;
dtm_Triangle = 4; dtm_Circle = 3;
dtm_Triangle = 4;
{
I am not sure wether I should simply copy and paste the old DTM implementation, {
or rewrite it from scratch. I am not sure wether I should simply copy and paste the old DTM implementation,
or rewrite it from scratch.
I recall there was something partially wrong with SCAR-alike DTM conversions
to Mufasa DTM's... I recall there was something partially wrong with SCAR-alike DTM conversions
to Mufasa DTM's...
The old DTM system problaby doesn't perform that well, but seems to be quite
stable and complete. The old DTM system problaby doesn't perform that well, but seems to be quite
stable and complete.
If I would rewrite it from scratch, it would probably be faster, and
hopefully more efficient.That won't be too hard, especially since I have If I would rewrite it from scratch, it would probably be faster, and
direct data access now. (TClient FTW!) hopefully more efficient.That won't be too hard, especially since I have
direct data access now. (TClient FTW!)
Rewrite from scratch it will be, I guess.
And AreaShape will be turned into a {$I }, inline simply doesn't cut it. Rewrite from scratch it will be, I guess.
And AreaShape will be turned into a {$I }, inline simply doesn't cut it.
~Wizz
} ~Wizz
}
implementation
uses implementation
Client, dtmutil, paszlib; uses
Client, dtmutil, paszlib, finder,
type graphics, // for TColor
TBufferByteArray = Array[0..524287] of Byte; math // for max
PBufferByteArray = ^TBufferByteArray; ;
constructor TMDTM.Create(Owner: TObject); type
begin TBufferByteArray = Array[0..524287] of Byte;
inherited Create; PBufferByteArray = ^TBufferByteArray;
Self.Client := Owner;
constructor TMDTM.Create(Owner: TObject);
SetLength(DTMList, 0); begin
SetLength(FreeSpots, 0); inherited Create;
SetLength(BufferString, 524288); Self.Client := Owner;
end;
SetLength(DTMList, 0);
destructor TMDTM.Destroy; SetLength(FreeSpots, 0);
SetLength(BufferString, 524288);
begin end;
SetLength(DTMList, 0); {$DEFINE DTM_DEBUG}
SetLength(FreeSpots, 0); destructor TMDTM.Destroy;
SetLength(BufferString, 0);
{$IFDEF DTM_DEBUG}
inherited Destroy; var
end; i, j: integer;
b:boolean;
function HexToInt(HexNum: string): LongInt;inline; {$ENDIF}
begin begin
Result:=StrToInt('$' + HexNum); {$IFDEF DTM_DEBUG}
end; writeln(inttostr(high(dtmlist)));
writeln(inttostr(high(freespots)));
function TMDTM.StringToDTM(S: String): pDTM; for i := 0 to high(DTMList) do
var begin
b: PBufferByteArray; b := false;
Source : String; for j := 0 to high(freespots) do
DestLen : longword; if i = freespots[j] then
i,ii,c : integer; begin
begin b := true;
SetLength(Result.p,0); break;
SetLength(Result.c,0); end;
SetLength(Result.t,0); if not b then
SetLength(Result.asz,0); writeln('DTM Number ' + inttostr(i) + ' was not freed');
SetLength(Result.ash,0); end;
ii := Length(S); {$ENDIF}
if (ii = 0) or (ii mod 2 <> 0) then SetLength(DTMList, 0);
Exit; SetLength(FreeSpots, 0);
ii := ii div 2; SetLength(BufferString, 0);
SetLength(Source,ii);
for i := 1 to ii do inherited Destroy;
Source[i] := Chr(HexToInt(S[i * 2 - 1] + S[i * 2])); end;
DestLen := Length(Self.BufferString);
if uncompress(PChar(Self.Bufferstring),Destlen,pchar(Source), ii) = Z_OK then type
begin; PMSimColor = function (Color1,Color2,Tolerance : Integer) : boolean of object;
if (Destlen mod 36) > 0 then PMGetCol = function (x, y: integer): TColor of object;
begin;
Writeln('Invalid DTM'); Function TMDTM.AreaShape(Color, Tolerance, Size, Shape: Integer; P: TPoint) : Boolean; inline;
Exit;
end; Var
DestLen := DestLen div 36; X, Y, S: Integer;
SetLength(Result.p,DestLen); SimCol: PMSimColor;
SetLength(Result.c,DestLen); GetCol: PMGetCol;
SetLength(Result.t,DestLen);
SetLength(Result.asz,DestLen); Begin
SetLength(Result.ash,DestLen); writeln('areashape');
b := @Self.Bufferstring[1]; SimCol := @TClient(Client).MFinder.SimilarColors;
for i := 0 to DestLen - 1 do GetCol := @TClient(Client).MWindow.GetColor;
begin; Case Shape Of
c := i * 36; dtm_Rectangle:
Result.p[i].x := PInteger(@b^[c+1])^; Begin
Result.p[i].y := PInteger(@b^[c+5])^; {
Result.asz[i] := PInteger(@b^[c+12])^; Example:
Result.ash[i] := PInteger(@b^[c+16])^; 3x3
Result.c[i] := PInteger(@b^[c+20])^; X X X
Result.t[i] := PInteger(@b^[c+24])^; X X X
end; X X X
end; }
end; For X := P.X - Size To P.X + Size Do
For Y := P.Y - Size To P.Y + Size Do
function TMDTM.AddDTM(d: TDTM): Integer; If SimCol(GetCol(X, Y), Color, Tolerance) Then
Begin
begin Result := True;
if Length(FreeSpots) > 0 then Exit;
begin End;
DTMList[FreeSpots[High(FreeSpots)]] := TDTMTopDTM(d); End;
Result := FreeSpots[High(FreeSpots)];
SetLength(FreeSpots, High(FreeSpots)); dtm_Cross:
end {
else Example:
begin 3x3
SetLength(DTMList, Length(DTMList) + 1); X
DTMList[High(DTMList)] := TDTMTopDTM(d); X X X
Result := High(DTMList); X
end; }
end; Begin
For X := P.X - Size To P.X + Size Do
{/\ If SimCol(GetCol(X, P.Y), Color, Tolerance) Then
Adds the given pDTM to the DTM Array, and returns it's index. Begin
/\} Result := True;
Exit;
function TMDTM.AddpDTM(d: pDTM): Integer; End;
For Y := P.Y - Size To P.Y + Size Do
begin If SimCol(GetCol(P.X, Y), Color, Tolerance) Then
if Length(FreeSpots) > 0 then Begin
begin Result := True;
DTMList[FreeSpots[High(FreeSpots)]] := d; Exit;
Result := FreeSpots[High(FreeSpots)]; End;
SetLength(FreeSpots, High(FreeSpots)); End;
end
Else dtm_DiagonalCross:
begin {
SetLength(DTMList, Length(DTMList) + 1); Example:
DTMList[High(DTMList)] := d; 3x3
Result := High(DTMList); X X
end; X
end; X X
{/\ }
Returns the DTM (pDTM type) in the variable dtm at the given index. Begin
Returns true is succesfull, false if the dtm does not exist. For S := -Size To Size Do
/\} Begin
If SimCol(GetCol(P.X + S, P.Y + S), Color, Tolerance) Then
function TMDTM.GetDTM(index: Integer; var dtm: pDTM): Boolean; Begin
begin Result := True;
Result := True; Exit;
try End;
dtm := DTMList[index]; If SimCol(GetCol(P.X + S, P.Y - S), Color, Tolerance) Then
except Begin
begin Result := True;
raise Exception.CreateFmt('The given DTM Index ([%d]) is invalid.', Exit;
[index]); End;
//WriteLn('DTM Index ' + IntToStr(index) + ' does not exist'); End;
Result := False; End;
end;
end {4:
end; Begin
D := Ceil(Sqrt(Pow(Size, 2) + Pow(Size, 2)));
{/\ //Will finish later
Unloads the DTM at the given index from the DTM Array.
Notes: End; }
Will keep track of not used index, so it is very memory efficient.
/\} Else
WriteLn('Incorrect Shape');
Procedure TMDTM.FreeDTM(DTM: Integer); End;
begin Result := False;
try End;
SetLength(DTMList[DTM].p, 0);
SetLength(DTMList[DTM].c, 0);
SetLength(DTMList[DTM].t, 0); function HexToInt(HexNum: string): LongInt;inline;
SetLength(DTMList[DTM].asz, 0); begin
SetLength(DTMList[DTM].ash, 0); Result:=StrToInt('$' + HexNum);
except end;
//WriteLn('Invalid DTM');
end; function TMDTM.StringToDTM(S: String): pDTM;
SetLength(FreeSpots, Length(FreeSpots) + 1); var
FreeSpots[High(FreeSpots)] := DTM; b: PBufferByteArray;
end; Source : String;
DestLen : longword;
{ i,ii,c : integer;
Tries to find the given DTM (index). If found will put the point the dtm has begin
been found at in x, y and result to true. SetLength(Result.p,0);
} SetLength(Result.c,0);
function TMDTM.FindDTM(DTM: Integer; var x, y: Integer; x1, y1, x2, y2: Integer): Boolean; SetLength(Result.t,0);
var SetLength(Result.asz,0);
temp: pDTM; SetLength(Result.ash,0);
begin ii := Length(S);
if GetDTM(DTM, temp) then if (ii = 0) or (ii mod 2 <> 0) then
Result := pFindDTM(temp, x, y, x1, y1, x2, y2) Exit;
else ii := ii div 2;
begin SetLength(Source,ii);
x := 0; for i := 1 to ii do
y := 0; Source[i] := Chr(HexToInt(S[i * 2 - 1] + S[i * 2]));
Result := False; DestLen := Length(Self.BufferString);
end; if uncompress(PChar(Self.Bufferstring),Destlen,pchar(Source), ii) = Z_OK then
end; begin;
if (Destlen mod 36) > 0 then
{ begin;
Tries to find the given pDTM. If found will put the point the dtm has Writeln('Invalid DTM');
been found at in x, y and result to true. Exit;
} end;
DestLen := DestLen div 36;
function TMDTM.pFindDTM(DTM: pDTM; var x, y: Integer; x1, y1, x2, y2: Integer): Boolean; SetLength(Result.p,DestLen);
SetLength(Result.c,DestLen);
var SetLength(Result.t,DestLen);
mP: TPointArray; SetLength(Result.asz,DestLen);
I, J, H, dH: Integer; SetLength(Result.ash,DestLen);
Found: Boolean; b := @Self.Bufferstring[1];
TempTP: TPoint; for i := 0 to DestLen - 1 do
RetData: TRetData; begin;
c := i * 36;
begin Result.p[i].x := PInteger(@b^[c+1])^;
for I := 1 to High(DTM.p) do Result.p[i].y := PInteger(@b^[c+5])^;
begin Result.asz[i] := PInteger(@b^[c+12])^;
DTM.p[I].x := DTM.p[I].x - DTM.p[0].x; Result.ash[i] := PInteger(@b^[c+16])^;
DTM.p[I].y := DTM.p[I].y - DTM.p[0].y; Result.c[i] := PInteger(@b^[c+20])^;
end; Result.t[i] := PInteger(@b^[c+24])^;
end;
// X2 := X2 - MaxSubPointDist.X end;
// Y2 := Y2 - MaxSubPointDist.Y end;
// X1 := X1 + MaxSubPointDist.X
// Y1 := Y1 + MaxSubPointDist.Y function TMDTM.AddDTM(d: TDTM): Integer;
// If X2 > X1 then Exit
// If Y2 > Y1 then Exit begin
// Will make sure there are no out of bounds exceptions, and will make it faster if Length(FreeSpots) > 0 then
begin
TClient(Client).MWindow.Freeze(); DTMList[FreeSpots[High(FreeSpots)]] := TDTMTopDTM(d);
Result := FreeSpots[High(FreeSpots)];
TClient(Client).MFinder.FindColorsTolerance(mP, DTM.c[Low(DTM.c)], SetLength(FreeSpots, High(FreeSpots));
x1, y1, x2, y2, DTM.t[Low(DTM.t)]); end
else
TClient(Client).MWindow.GetDimensions(H, dH); begin
RetData := TClient(Client).MWindow.ReturnData(0, 0, H, dH); SetLength(DTMList, Length(DTMList) + 1);
DTMList[High(DTMList)] := TDTMTopDTM(d);
H := High(mP); Result := High(DTMList);
dH := High(DTM.p); end;
for I := 0 to H do end;
begin
// Use MainPoint's AreaSize and Shape. {/\
// for Loop on mP, depending on the AreaShape. then on all the code beneath Adds the given pDTM to the DTM Array, and returns it's index.
// this point, use the var that is retrieved from the for loop. /\}
Found := True;
for J := 1 to dH do function TMDTM.AddpDTM(d: pDTM): Integer;
begin
TempTP.X := DTM.p[J].X + mP[I].X; begin
TempTP.Y := DTM.p[J].Y + mP[I].Y; if Length(FreeSpots) > 0 then
//Now would be the time to Rotate TempTP begin
//If Not AreaShape(DTM.c[J], DTM.t[J], DTM.asz[J], DTM.ash[J], TempTP) then DTMList[FreeSpots[High(FreeSpots)]] := d;
if False then Result := FreeSpots[High(FreeSpots)];
begin SetLength(FreeSpots, High(FreeSpots));
Found := False; end
Break; Else
end; begin
end; SetLength(DTMList, Length(DTMList) + 1);
DTMList[High(DTMList)] := d;
if Found then Result := High(DTMList);
begin end;
Result := True; end;
x := mP[I].X;
y := mP[I].Y; {/\
TClient(Client).MWindow.UnFreeze(); Returns the DTM (pDTM type) in the variable dtm at the given index.
Exit; Returns true is succesfull, false if the dtm does not exist.
end; /\}
end;
TClient(Client).MWindow.UnFreeze(); function TMDTM.GetDTM(index: Integer; var dtm: pDTM): Boolean;
Result := False; begin
end; Result := True;
try
end. dtm := DTMList[index];
except
begin
raise Exception.CreateFmt('The given DTM Index ([%d]) is invalid.',
[index]);
//WriteLn('DTM Index ' + IntToStr(index) + ' does not exist');
Result := False;
end;
end
end;
{/\
Unloads the DTM at the given index from the DTM Array.
Notes:
Will keep track of not used index, so it is very memory efficient.
/\}
Procedure TMDTM.FreeDTM(DTM: Integer);
begin
try
SetLength(DTMList[DTM].p, 0);
SetLength(DTMList[DTM].c, 0);
SetLength(DTMList[DTM].t, 0);
SetLength(DTMList[DTM].asz, 0);
SetLength(DTMList[DTM].ash, 0);
except
//WriteLn('Invalid DTM');
end;
SetLength(FreeSpots, Length(FreeSpots) + 1);
FreeSpots[High(FreeSpots)] := DTM;
end;
{
Tries to find the given DTM (index). If found will put the point the dtm has
been found at in x, y and result to true.
}
function TMDTM.FindDTM(DTM: Integer; var x, y: Integer; x1, y1, x2, y2: Integer): Boolean;
var
temp: pDTM;
begin
if GetDTM(DTM, temp) then
Result := pFindDTM(temp, x, y, x1, y1, x2, y2)
else
begin
x := 0;
y := 0;
Result := False;
end;
end;
{
Tries to find the given pDTM. If found will put the point the dtm has
been found at in x, y and result to true.
}
function TMDTM.pFindDTM(DTM: pDTM; var x, y: Integer; x1, y1, x2, y2: Integer): Boolean;
var
mP: TPointArray;
I, J, H, dH: Integer;
Found: Boolean;
TempTP: TPoint;
RetData: TRetData;
MaxSubPointDist: TPoint;
begin
MaxSubPointDist := Point(0,0);
for I := 1 to High(DTM.p) do
begin
DTM.p[I].x := DTM.p[I].x - DTM.p[0].x;
DTM.p[I].y := DTM.p[I].y - DTM.p[0].y;
MaxSubPointDist.X := Max(DTM.p[I].x, MaxSubPointDist.X);
MaxSubPointDist.Y := Max(DTM.p[I].y, MaxSubPointDist.Y);
end;
X2 := X2 - MaxSubPointDist.X;
Y2 := Y2 - MaxSubPointDist.Y;
X1 := X1 + MaxSubPointDist.X;
Y1 := Y1 + MaxSubPointDist.Y;
{If X2 > X1 then
//Exit;
If Y2 > Y1 then }
//Exit;
// Will make sure there are no out of bounds exceptions, and will make it faster
TClient(Client).MWindow.Freeze();
TClient(Client).MFinder.FindColorsTolerance(mP, DTM.c[Low(DTM.c)],
x1, y1, x2, y2, DTM.t[Low(DTM.t)]);
TClient(Client).MWindow.GetDimensions(H, dH);
RetData := TClient(Client).MWindow.ReturnData(0, 0, H, dH);
H := High(mP);
dH := High(DTM.p);
for I := 0 to H do
begin
// Use MainPoint's AreaSize and Shape.
// for Loop on mP, depending on the AreaShape. then on all the code beneath
// this point, use the var that is retrieved from the for loop.
Found := True;
for J := 1 to dH do
begin
TempTP.X := DTM.p[J].X + mP[I].X;
TempTP.Y := DTM.p[J].Y + mP[I].Y;
//Now would be the time to Rotate TempTP
if not AreaShape(DTM.c[J], DTM.t[J], DTM.asz[J], DTM.ash[J], TempTP) then
begin
Found := False;
Break;
end;
end;
if Found then
begin
Result := True;
x := mP[I].X;
y := mP[I].Y;
TClient(Client).MWindow.UnFreeze();
Exit;
end;
end;
TClient(Client).MWindow.UnFreeze();
Result := False;
end;
end.