cleanup before v208 release

This commit is contained in:
zueuk 2008-08-07 07:39:45 +00:00
parent afc5843ab6
commit 17c928c4b9
6 changed files with 86 additions and 155 deletions

View File

@ -437,7 +437,7 @@ end;
xf := xform[0];//random(NumXForms)];
for i := 0 to FUSE do begin
xf := xf.PropTable[Random(PROP_TABLE_SIZE)];
if xf.RetraceXform then continue;
//if xf.RetraceXform then continue;
xf.NextPoint(p);
end;
@ -446,40 +446,24 @@ end;
if UseFinalXform then
for i := 0 to NrPoints - 1 do begin
xf := xf.PropTable[Random(PROP_TABLE_SIZE)];
if xf.RetraceXform then begin
if xf.noPlot then
pPoint^.x := MaxDouble // hack
else begin
xf.NextPointTo(p, pPoint^);
finalXform.NextPoint(pPoint^);
end;
end
else begin
xf.NextPoint(p);
if xf.noPlot then
pPoint^.x := MaxDouble // hack
else
finalXform.NextPointTo(p, pPoint^);
end;
xf.NextPoint(p);
if xf.noPlot then
pPoint^.x := MaxDouble // hack
else
finalXform.NextPointTo(p, pPoint^);
Inc(pPoint);
end
else
for i := 0 to NrPoints - 1 do begin
xf := xf.PropTable[Random(PROP_TABLE_SIZE)];
if xf.RetraceXform then begin
if xf.noPlot then
pPoint^.x := MaxDouble // hack
else
xf.NextPointTo(p, pPoint^);
end
xf.NextPoint(p);
if xf.noPlot then
pPoint^.x := MaxDouble // hack
else begin
xf.NextPoint(p);
if xf.noPlot then
pPoint^.x := MaxDouble // hack
else begin
//pPoint^.x := p.x; pPoint^.y := p.y; pPoint^.c := p.c;
pPoint^ := p;
end;
//pPoint^.x := p.x; pPoint^.y := p.y; pPoint^.c := p.c;
pPoint^ := p;
end;
Inc(pPoint);
end;
@ -883,9 +867,9 @@ begin
end else if AnsiCompareText(CurrentToken, 'plotmode') = 0 then begin
Inc(ParsePos);
xform[CurrentXForm].noPlot := (ParseValues[ParsePos] = '1');
end else if AnsiCompareText(CurrentToken, 'retrace') = 0 then begin
Inc(ParsePos);
xform[CurrentXForm].RetraceXform := (ParseValues[ParsePos] = '1');
// end else if AnsiCompareText(CurrentToken, 'retrace') = 0 then begin
// Inc(ParsePos);
// xform[CurrentXForm].RetraceXform := (ParseValues[ParsePos] = '1');
end else begin
OutputDebugString(Pchar('Unknown Token: ' + CurrentToken));
end;
@ -1072,6 +1056,7 @@ begin
miny := 1E99;
maxy := -1E99;
for i := 0 to SUB_BATCH_SIZE - 1 do begin
if Points[i].x > 1e200 then continue;
minx := min(minx, Points[i].x);
maxx := max(maxx, Points[i].x);
miny := min(miny, Points[i].y);
@ -1092,6 +1077,7 @@ begin
cntminy := 0;
cntmaxy := 0;
for i := 0 to SUB_BATCH_SIZE - 1 do begin
if Points[i].x > 1e200 then continue;
px := points[i].x * cosa + points[i].y * sina;
py := points[i].y * cosa - points[i].x * sina;
if (Points[i].x < minx) then Inc(cntminx);
@ -1614,7 +1600,7 @@ begin
sl.Add(s);
sl.Add(Format('plotmode %d', [Ifthen(noPlot, 1, 0)]));
sl.Add(Format('retrace %d', [Ifthen(RetraceXform, 1, 0)]));
// sl.Add(Format('retrace %d', [Ifthen(RetraceXform, 1, 0)]));
end;
DecimalSeparator := OldDecimalSperator;
@ -1699,6 +1685,7 @@ begin
zoom := 0;
for i := 0 to NXFORMS do xform[i].Clear;
FinalXformEnabled := false;
soloxform := -1;
end;
function TControlPoint.HasFinalXForm: boolean;

View File

@ -422,7 +422,7 @@ object EditForm: TEditForm
Top = 31
Width = 170
Height = 331
ActivePage = tabColors
ActivePage = tabVariations
Align = alBottom
Anchors = [akLeft, akTop, akRight, akBottom]
MultiLine = True
@ -1487,7 +1487,7 @@ object EditForm: TEditForm
end
object GroupBox2: TGroupBox
Left = 8
Top = 182
Top = 168
Width = 145
Height = 77
Caption = 'Variation preview'
@ -1544,7 +1544,7 @@ object EditForm: TEditForm
Left = 8
Top = 104
Width = 145
Height = 73
Height = 57
Caption = 'Transform visibility'
TabOrder = 2
object chkXformInvisible: TCheckBox
@ -1558,22 +1558,13 @@ object EditForm: TEditForm
end
object chkXformSolo: TCheckBox
Left = 8
Top = 48
Top = 32
Width = 129
Height = 17
Caption = 'Solo'
TabOrder = 1
OnClick = chkXformSoloClick
end
object chkRetrace: TCheckBox
Left = 8
Top = 32
Width = 129
Height = 17
Caption = 'Retrace xform'
TabOrder = 2
OnClick = chkRetraceClick
end
end
end
object tabVariations: TTabSheet

View File

@ -201,7 +201,6 @@ type
GroupBox4: TGroupBox;
chkXformInvisible: TCheckBox;
chkXformSolo: TCheckBox;
chkRetrace: TCheckBox;
procedure ValidateVariable;
procedure vleVariablesValidate(Sender: TObject; ACol, ARow: Integer; const KeyName, KeyValue: string);
@ -359,7 +358,7 @@ type
procedure mnuChaosSetAllClick(Sender: TObject);
procedure mnuLinkPostxformClick(Sender: TObject);
procedure chkXformSoloClick(Sender: TObject);
procedure chkRetraceClick(Sender: TObject);
// procedure chkRetraceClick(Sender: TObject);
private
TriangleView: TCustomDrawControl;
@ -836,8 +835,8 @@ begin
chkXformInvisible.Enabled := true;
chkXformInvisible.Checked := noPlot;
chkXformSolo.Enabled := true;
chkRetrace.Enabled := not noPlot;
chkRetrace.Checked := RetraceXform;
// chkRetrace.Enabled := not noPlot;
// chkRetrace.Checked := RetraceXform;
if cp.soloXform >= 0 then begin
chkXformSolo.Checked := true;
chkXformSolo.Caption := Format('Solo transform #%d', [cp.soloXform + 1]);
@ -854,8 +853,8 @@ begin
chkXformInvisible.Enabled := false;
chkXformInvisible.Checked := false;
chkXformSolo.Enabled := false;
chkRetrace.Checked := true;
chkRetrace.Enabled := false;
// chkRetrace.Checked := true;
// chkRetrace.Enabled := false;
end;
tbEnableFinalXform.Down := EnableFinalXform;
@ -4993,18 +4992,21 @@ end;
procedure TEditForm.chkXformSoloClick(Sender: TObject);
begin
if chkXformSolo.Checked then begin
if (SelectedTriangle < Transforms) then begin
cp.soloXform := SelectedTriangle;
if chkXformSolo.Checked <> (cp.soloXform >=0) then begin
if chkXformSolo.Checked then begin
if (SelectedTriangle < Transforms) then begin
cp.soloXform := SelectedTriangle;
UpdateFlame(true);
end;
end
else begin
cp.soloXform := -1;
UpdateFlame(true);
end;
end
else begin
cp.soloXform := -1;
UpdateFlame(true);
end;
end;
{
procedure TEditForm.chkRetraceClick(Sender: TObject);
var
newValue: boolean;
@ -5018,6 +5020,7 @@ begin
end;
end;
end;
}
end.

View File

@ -42,7 +42,7 @@ const
RS_XO = 2;
RS_VO = 3;
AppVersionString = 'Apophysis 2.08 beta pre5';
AppVersionString = 'Apophysis 2.08 beta pre6';
type
TMouseMoveState = (msUsual, msZoomWindow, msZoomOutWindow, msZoomWindowMove,
@ -1369,6 +1369,9 @@ begin
if cp1.vibrancy <> 1 then
parameters := parameters + format('vibrancy="%g" ', [cp1.vibrancy]);
if cp1.soloXform >= 0 then
parameters := parameters + format('soloxform="%d" ', [cp1.soloXform]);
if exporting then parameters := parameters +
format('estimator_radius="%g" ', [cp1.estimator]) +
format('estimator_minimum="%g" ', [cp1.estimator_min]) +
@ -4067,15 +4070,7 @@ begin
Tokens := TStringList.Create;
try
if TagName='xformset' then // unused in this release...
begin
v := Attributes.Value('enabled');
if v <> '' then ParseCP.finalXformEnabled := (StrToInt(v) <> 0)
else ParseCP.finalXformEnabled := true;
inc(activeXformSet);
end
else if TagName='flame' then
if TagName='flame' then
begin
v := Attributes.value('name');
if v <> '' then Parsecp.name := v else Parsecp.name := 'untitled';
@ -4142,6 +4137,9 @@ begin
Parsecp.background[2] := 0;
end;
v := Attributes.Value('soloxform');
if v <> '' then Parsecp.soloXform := StrToInt(v);
v := Attributes.Value('nick');
if Trim(v) = '' then v := SheepNick;
Parsecp.Nick := v;
@ -4250,15 +4248,15 @@ begin
if v <> '' then begin
if v = 'off' then begin
noPlot := true;
RetraceXform := false;
end
else if v = 'retrace' then begin
noPlot := false;
RetraceXform := true;
//RetraceXform := false;
end
// else if v = 'retrace' then begin
// noPlot := false;
// RetraceXform := true;
// end
else begin
noPlot := false;
RetraceXform := false;
//RetraceXform := false;
end;
end;

View File

@ -106,7 +106,7 @@ var
Bucket: PBucket32;
MapColor: PColorMapColor;
p, q: TCPPoint;
p: TCPPoint;
xf: TXForm;
begin
{$ifndef _ASM_}
@ -133,38 +133,22 @@ end;
xf := fcp.xform[0];//random(fcp.NumXForms)];
for i := 0 to FUSE do begin
xf := xf.PropTable[Random(PROP_TABLE_SIZE)];
if xf.RetraceXform then continue;
xf.NextPoint(p);
end;
for i := 0 to SUB_BATCH_SIZE-1 do begin
xf := xf.PropTable[Random(PROP_TABLE_SIZE)];
if xf.RetraceXform then begin
if xf.noPlot then continue;
xf.NextPoint(p);
xf.NextPointTo(p, q);
if xf.noPlot then continue;
px := q.x - camX0;
if (px < 0) or (px > camW) then continue;
py := q.y - camY0;
if (py < 0) or (py > camH) then continue;
px := p.x - camX0;
if (px < 0) or (px > camW) then continue;
py := p.y - camY0;
if (py < 0) or (py > camH) then continue;
Bucket := @buckets[Round(bhs * py)][Round(bws * px)];
MapColor := @ColorMap[Round(q.c * 255)];
end
else begin
xf.NextPoint(p);
if xf.noPlot then continue;
px := p.x - camX0;
if (px < 0) or (px > camW) then continue;
py := p.y - camY0;
if (py < 0) or (py > camH) then continue;
Bucket := @buckets[Round(bhs * py)][Round(bws * px)];
MapColor := @ColorMap[Round(p.c * 255)];
end;
Bucket := @buckets[Round(bhs * py)][Round(bws * px)];
MapColor := @ColorMap[Round(p.c * 255)];
Inc(Bucket.Red, MapColor.Red);
Inc(Bucket.Green, MapColor.Green);
@ -186,7 +170,7 @@ var
Bucket: PBucket32;
MapColor: PColorMapColor;
p, q: TCPPoint;
p: TCPPoint;
xf: TXForm;
begin
{$ifndef _ASM_}
@ -213,38 +197,22 @@ end;
xf := fcp.xform[0];//random(fcp.NumXForms)];
for i := 0 to FUSE do begin
xf := xf.PropTable[Random(PROP_TABLE_SIZE)];
if xf.RetraceXform then continue;
xf.NextPoint(p);
end;
for i := 0 to SUB_BATCH_SIZE-1 do begin
xf := xf.PropTable[Random(PROP_TABLE_SIZE)];
if xf.RetraceXform then begin
if xf.noPlot then continue;
xf.NextPoint(p);
xf.NextPointTo(p, q);
if xf.noPlot then continue;
px := q.x * cosa + q.y * sina + rcX;
if (px < 0) or (px > camW) then continue;
py := q.y * cosa - q.x * sina + rcY;
if (py < 0) or (py > camH) then continue;
px := p.x * cosa + p.y * sina + rcX;
if (px < 0) or (px > camW) then continue;
py := p.y * cosa - p.x * sina + rcY;
if (py < 0) or (py > camH) then continue;
Bucket := @buckets[Round(bhs * py)][Round(bws * px)];
MapColor := @ColorMap[Round(q.c * 255)];
end
else begin
xf.NextPoint(p);
if xf.noPlot then continue;
px := p.x * cosa + p.y * sina + rcX;
if (px < 0) or (px > camW) then continue;
py := p.y * cosa - p.x * sina + rcY;
if (py < 0) or (py > camH) then continue;
Bucket := @buckets[Round(bhs * py)][Round(bws * px)];
MapColor := @ColorMap[Round(p.c * 255)];
end;
Bucket := @buckets[Round(bhs * py)][Round(bws * px)];
MapColor := @ColorMap[Round(p.c * 255)];
Inc(Bucket.Red, MapColor.Red);
Inc(Bucket.Green, MapColor.Green);
@ -294,25 +262,16 @@ end;
xf := fcp.xform[0];//random(fcp.NumXForms)];
for i := 0 to FUSE do begin
xf := xf.PropTable[Random(PROP_TABLE_SIZE)];
if xf.RetraceXform then continue;
xf.NextPoint(p);
end;
for i := 0 to SUB_BATCH_SIZE-1 do begin
xf := xf.PropTable[Random(PROP_TABLE_SIZE)];
if xf.RetraceXform then begin
if xf.noPlot then continue;
xf.NextPoint(p);
xf.NextPointTo(p, q);
finalXform.NextPoint(q);
end
else begin
xf.NextPoint(p);
if xf.noPlot then continue;
if xf.noPlot then continue;
finalXform.NextPointTo(p, q);
end;
finalXform.NextPointTo(p, q);
px := q.x - camX0;
if (px < 0) or (px > camW) then continue;
@ -369,25 +328,16 @@ end;
xf := fcp.xform[0];//random(fcp.NumXForms)];
for i := 0 to FUSE do begin
xf := xf.PropTable[Random(PROP_TABLE_SIZE)];
if xf.RetraceXform then continue;
xf.NextPoint(p);
end;
for i := 0 to SUB_BATCH_SIZE-1 do begin
xf := xf.PropTable[Random(PROP_TABLE_SIZE)];
if xf.RetraceXform then begin
if xf.noPlot then continue;
xf.NextPoint(p);
xf.NextPointTo(p, q);
finalXform.NextPoint(q);
end
else begin
xf.NextPoint(p);
if xf.noPlot then continue;
if xf.noPlot then continue;
finalXform.NextPointTo(p, q);
end;
finalXform.NextPointTo(p, q);
px := q.x * cosa + q.y * sina + rcX;
if (px < 0) or (px > camW) then continue;

View File

@ -66,7 +66,8 @@ type
postXswap: boolean;
noPlot: boolean;
RetraceXform: boolean;
//RetraceXform: boolean;
// nx,ny,x,y: double;
// script: TatPascalScripter;
@ -234,7 +235,7 @@ begin
modWeights[i] := 1;
noPlot := false;
RetraceXform := false;
//RetraceXform := false;
end;
///////////////////////////////////////////////////////////////////////////////
@ -2146,7 +2147,7 @@ begin
modWeights[i] := xform.modWeights[i];
noPlot := xform.noPlot;
RetraceXform := xform.RetraceXform;
//RetraceXform := xform.RetraceXform;
end;
///////////////////////////////////////////////////////////////////////////////
@ -2191,9 +2192,10 @@ begin
Result := Result + '" ';
end;
if RetraceXform then
Result := Result + 'plotmode="retrace" '
else if noPlot then
// if RetraceXform then
// Result := Result + 'plotmode="retrace" '
// else
if noPlot then
Result := Result + 'plotmode="off" ';
Result := Result + '/>';