final (?) changes for version 2.03d

This commit is contained in:
zueuk 2006-04-13 16:21:32 +00:00
parent 73af4bd9d6
commit 477cad10c7
9 changed files with 72 additions and 105 deletions

View File

@ -972,7 +972,6 @@ object AdjustForm: TAdjustForm
Width = 73
Height = 21
ItemHeight = 13
ItemIndex = 0
TabOrder = 8
Text = '512'
OnChange = txtWidthChange
@ -990,13 +989,13 @@ object AdjustForm: TAdjustForm
Width = 73
Height = 21
ItemHeight = 13
ItemIndex = 0
TabOrder = 9
Text = '384'
OnChange = txtHeightChange
OnKeyPress = txtSizeKeyPress
Items.Strings = (
'384'
'400'
'480'
'512'
'600'

View File

@ -1,7 +1,7 @@
{
Flame screensaver Copyright (C) 2002 Ronald Hordijk
Apophysis Copyright (C) 2001-2004 Mark Townsend
Apophysis Copyright (C) 2005-2006 Ronald Hordijk, Piotr Boris, Peter Sdobnov
Apophysis Copyright (C) 2005-2006 Ronald Hordijk, Piotr Borys, Peter Sdobnov
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by

View File

@ -175,7 +175,10 @@ begin
Renderer.SaveImage(FileName);
if PlaySoundOnRenderComplete then
sndPlaySound(PChar(RenderCompleteSoundFile), SND_FILENAME or SND_NOSTOP or SND_ASYNC);
if RenderCompleteSoundFile <> '' then
sndPlaySound(PChar(RenderCompleteSoundFile), SND_FILENAME or SND_NOSTOP or SND_ASYNC)
else
sndPlaySound(pchar(SND_ALIAS_SYSTEMASTERISK), SND_ALIAS_ID or SND_NOSTOP or SND_ASYNC);
Renderer.Free;
Renderer := nil;

View File

@ -37,7 +37,7 @@ const
RS_XO = 2;
RS_VO = 3;
AppVersionString = 'Apophysis 2.03d pre-release 7';
AppVersionString = 'Apophysis 2.03d rc1';
type
TMouseMoveState = (msUsual, msZoomWindow, msZoomOutWindow, msZoomWindowMove, msZoomOutWindowMove, msDrag, msDragMove, msRotate, msRotateMove);
@ -1292,50 +1292,68 @@ begin
end;
function FlameToXML(const cp1: TControlPoint; sheep: boolean; compact: boolean = false): string;
function FlameToXML(const cp1: TControlPoint; sheep: boolean; exporting: boolean = false): string;
var
t, i{, j}: integer;
FileList: TStringList;
x, y: double;
{varlist,} nick, url, pal, hue: string;
parameters: string;
begin
FileList := TStringList.create;
x := cp1.center[0];
y := cp1.center[1];
{ // not supported by flam3 any more
pal := ''; hue := '';
if sheep then begin
if cp1.cmapindex >= 0 then pal := 'palette="' + IntToStr(cp1.cmapindex) + '" ';
hue := 'hue="' + format('%g', [cp1.hue_rotation]) + '" ';
end;
}
// if cp1.cmapindex >= 0 then pal := pal + 'gradient="' + IntToStr(cp1.cmapindex) + '" ';
if cp1.cmapindex >= 0 then
pal := pal + 'gradient="' + IntToStr(cp1.cmapindex) + '" ';
{ // not supported by flam3 any more
if Trim(SheepNick) <> '' then nick := 'nick="' + Trim(SheepNick) + '"';
if Trim(SheepURL) <> '' then url := 'url="' + Trim(SheepURL) + '" ';
}
try
FileList.Add('<flame name="' + CleanXMLName(cp1.name) + format('" time="%g" ', [cp1.time]) +
pal + 'size="' + IntToStr(cp1.width) + ' ' + IntToStr(cp1.height) +
parameters := '';
if cp1.time <> 0 then
parameters := parameters + format('time="%g" ', [cp1.time]);
parameters := parameters +
'size="' + IntToStr(cp1.width) + ' ' + IntToStr(cp1.height) +
format('" center="%g %g" ', [x, y]) +
format('scale="%g" ', [cp1.pixels_per_unit]) +
format('angle="%g" ', [cp1.FAngle]) +
format('rotate="%g" ', [-180 * cp1.FAngle/Pi]) +
format('zoom="%g" ', [cp1.zoom]) +
format('scale="%g" ', [cp1.pixels_per_unit]);
if cp1.FAngle <> 0 then
parameters := parameters + format('angle="%g" ', [cp1.FAngle]) +
format('rotate="%g" ', [-180 * cp1.FAngle/Pi]);
if cp1.zoom <> 0 then
parameters := parameters + format('zoom="%g" ', [cp1.zoom]);
parameters := parameters +
'oversample="' + IntToStr(cp1.spatial_oversample) +
format('" filter="%g" ', [cp1.spatial_filter_radius]) +
format('quality="%g" ', [cp1.sample_density]) +
'batches="' + IntToStr(cp1.nbatches) +
format('" background="%g %g %g" ', [cp1.background[0] / 255, cp1.background[1] / 255, cp1.background[2] / 255]) +
format('quality="%g" ', [cp1.sample_density]);
if cp1.nbatches <> 1 then parameters := parameters + 'batches="' + IntToStr(cp1.nbatches) + '" ';
parameters := parameters +
format('background="%g %g %g" ', [cp1.background[0] / 255, cp1.background[1] / 255, cp1.background[2] / 255]) +
format('brightness="%g" ', [cp1.brightness]) +
format('gamma="%g" ', [cp1.gamma]) +
format('vibrancy="%g" ', [cp1.vibrancy]) +
format('gamma="%g" ', [cp1.gamma]);
if cp1.vibrancy <> 1 then
parameters := parameters + format('vibrancy="%g" ', [cp1.vibrancy]);
if exporting then parameters := parameters +
format('estimator_radius="%g" ', [cp1.estimator]) +
format('estimator_minimum="%g" ', [cp1.estimator_min]) +
format('estimator_curve="%g" ', [cp1.estimator_curve]) +
format('temporal_samples="%d" ', [cp1.jitters]) +
format('gamma_threshold="%g" ', [cp1.gamma_treshold]) +
hue + url + nick + '>');
format('gamma_threshold="%g" ', [cp1.gamma_treshold]);
FileList.Add('<flame name="' + CleanXMLName(cp1.name) + '" ' + parameters + '>');
{ Write transform parameters }
t := cp1.NumXForms;
for i := 0 to t - 1 do
@ -1355,9 +1373,10 @@ begin
{ Write palette data }
if not sheep then begin
if compact then // say no to duplicated data! (?)
FileList.Add(ColorToXmlCompact(cp1))
else FileList.Add(ColorToXml(cp1));
if exporting then
FileList.Add(ColorToXml(cp1))
else
FileList.Add(ColorToXmlCompact(cp1));
end;
FileList.Add('</flame>');
@ -1367,66 +1386,6 @@ begin
end;
end;
//function FlameToXMLSheep(const cp1: TControlPoint): string;
//var
// t, i, j: integer;
// FileList: TStringList;
// x, y, a, b, cc, d, e, f: double;
// varlist, pal, hue: string;
//begin
// FileList := TStringList.create;
// x := cp1.center[0];
// y := cp1.center[1];
// pal := ''; hue := '';
// pal := 'palette="' + IntToStr(cp1.cmapindex) + '" ';
//// if cp1.hue_rotation = 0 then cp1.hue_rotation := 1;
// hue := ' hue="' + format('%g', [cp1.hue_rotation]) + '"';
// try
// FileList.Add('<flame' + format(' time="%g" ', [cp1.time]) +
// pal + 'size="' + IntToStr(cp1.width) + ' ' + IntToStr(cp1.height) +
// format('" center="%g %g" ', [x, y]) +
// format('scale="%g" ', [cp1.pixels_per_unit]) +
// format('zoom="%g" ', [cp1.zoom]) +
// 'oversample="' + IntToStr(cp1.spatial_oversample) +
// format('" filter="%g" ', [cp1.spatial_filter_radius]) +
// format('quality="%g" ', [cp1.sample_density]) +
// 'batches="' + IntToStr(cp1.nbatches) +
// format('" background="%g %g %g" ', [cp1.background[0] / 255, cp1.background[1] / 255, cp1.background[2] / 255]) +
// format('brightness="%g" ', [cp1.brightness]) +
// format('gamma="%g" ', [cp1.gamma]) +
// format('vibrancy="%g"', [cp1.vibrancy]) + hue + '>');
// { Write transform parameters }
// t := NumXForms(cp1);
// for i := 0 to t - 1 do
// begin
// with cp1.xform[i] do
// begin
// a := c[0][0];
// b := c[1][0];
// cc := c[0][1];
// d := c[1][1];
// e := c[2][0];
// f := c[2][1];
// varlist := '';
// for j := 0 to NRVAR - 1 do
// begin
// if vars[j] <> 0 then
// begin
// varlist := varlist + varnames(j) + format('="%f" ', [vars[j]]);
// end;
// end;
// FileList.Add(Format(' <xform weight="%g" color="%g" symmetry="%g" ', [density, color, symmetry]) +
// varlist + Format('coefs="%g %g %g %g %g %g"/>', [a, cc, b, d, e, f]));
// end;
// end;
// FileList.Add('</flame>');
// result := FileList.text;
// finally
// FileList.free
// end;
//end;
function RemoveExt(filename: string): string;
var
ext: string;
@ -1518,7 +1477,7 @@ begin
until (Pos('<' + Tag + '>', FileList[FileList.count - 1]) <> 0) or
(Pos('</Flames>', FileList[FileList.count - 1]) <> 0);
FileList.Add(Trim(FlameToXML(cp1, false, true)));
FileList.Add(Trim(FlameToXML(cp1, false)));
FileList.Add('</Flames>');
FileList.SaveToFile(filename);
@ -1532,7 +1491,7 @@ begin
AssignFile(IFile, filename);
ReWrite(IFile);
Writeln(IFile, '<Flames name="' + Tag + '">');
Write(IFile, FlameToXML(cp1, false, true));
Write(IFile, FlameToXML(cp1, false));
Writeln(IFile, '</Flames>');
CloseFile(IFile);
end;
@ -1839,7 +1798,7 @@ begin
*)
MainCp.name := RandomPrefix + RandomDate + '-' +
IntToStr(RandomIndex);
Write(F, FlameToXML(MainCp, False, true));
Write(F, FlameToXML(MainCp, False));
// Write(F, FlameToString(Title));
// WriteLn(F, ' ');
end;
@ -2486,7 +2445,7 @@ begin
AdjustForm.cmbPalette.ItemIndex := 0;
// AdjustForm.cmbPalette.Items.clear;
ExportDialog.cmbDepth.ItemIndex := 3;
ExportDialog.cmbDepth.ItemIndex := 2;
end;
procedure TMainForm.FormClose(Sender: TObject; var Action: TCloseAction);
@ -3592,7 +3551,7 @@ procedure TMainForm.mnuCopyClick(Sender: TObject);
var
txt: string;
begin
txt := Trim(FlameToXML(Maincp, false, true));
txt := Trim(FlameToXML(Maincp, false));
Clipboard.SetTextBuf(PChar(txt));
mnuPaste.enabled := true;
@ -3693,7 +3652,7 @@ begin
cp1.estimator_curve := ExportEstimatorCurve;
cp1.jitters := ExportJitters;
cp1.gamma_treshold := ExportGammaTreshold;
FileList.Text := FlameToXML(cp1, false);
FileList.Text := FlameToXML(cp1, false, true);
FileList.SaveToFile(ChangeFileExt(ExportDialog.Filename, '.flame'));
FileList.Clear;
FileList.Add('@echo off');

View File

@ -358,10 +358,10 @@ object OptionsForm: TOptionsForm
end
object chkAutoEditMode: TCheckBox
Left = 160
Top = 84
Width = 145
Top = 80
Width = 161
Height = 17
Caption = 'Prefer "Auto" edit mode'
Caption = 'Prefer "Extended" edit mode'
Checked = True
State = cbChecked
TabOrder = 2

View File

@ -717,7 +717,8 @@ end;
procedure TOptionsForm.btnBrowseSoundClick(Sender: TObject);
begin
OpenDialog.Filter := 'Waveform files (*.wav)|*.wav|MIDI files (*.mid)|*.mid';
OpenDialog.InitialDir := ExtractFilePath(RenderCompleteSoundFile);
OpenDialog.Filter := 'Waveform files (*.wav)|*.wav';
OpenDialog.FileName := '';
if OpenDialog.Execute then
begin
@ -728,7 +729,9 @@ end;
procedure TOptionsForm.btnPlayClick(Sender: TObject);
begin
if txtSoundFile.text <> '' then
sndPlaySound(PChar(txtSoundFile.text), SND_FILENAME or SND_ASYNC);
sndPlaySound(PChar(txtSoundFile.text), SND_FILENAME or SND_ASYNC)
else
sndPlaySound(pchar(SND_ALIAS_SYSTEMASTERISK), SND_ALIAS_ID or SND_NOSTOP or SND_ASYNC);
end;
end.

View File

@ -22,8 +22,8 @@ unit RenderThread;
interface
uses
Classes, windows, Messages, Graphics,
controlPoint, Render, Render64, Render64MT, RenderMM, RenderMM_MT;
Classes, Windows, Messages, Graphics,
ControlPoint, Render, Render64, Render64MT, RenderMM, RenderMM_MT;
const
WM_THREAD_COMPLETE = WM_APP + 5437;

View File

@ -97,7 +97,7 @@ type
procedure Cylinder; // var[25]
procedure Noise; // var[26]
procedure Blur; // var[27]
procedure Focus; // var[28]
// procedure Focus; // var[28]
function Mul33(const M1, M2: TMatrix): TMatrix;
function Identity: TMatrix;
@ -1543,6 +1543,7 @@ asm
{$endif}
end;
(*
//--28--///////////////////////////////////////////////////////////////////////
procedure TXForm.Focus;
{$ifndef _ASM_}
@ -1580,6 +1581,7 @@ asm
fwait
{$endif}
end;
*)
//***************************************************************************//
@ -1948,7 +1950,7 @@ begin
FFunctionList[25] := Cylinder;
FFunctionList[26] := Noise;
FFunctionList[27] := Blur;
FFunctionList[28] := Focus;
// FFunctionList[28] := Focus;
//registered
// for i := 0 to High(FRegVariations) do
@ -2003,7 +2005,9 @@ var
Name: string;
Value: double;
begin
result := Format(' <xform weight="%g" color="%g" symmetry="%g" ', [density, color, symmetry]);
result := Format(' <xform weight="%g" color="%g" ', [density, color]);
if symmetry <> 0 then result := result + format('symmetry="%g"', [symmetry]);
for i := 0 to nrvar - 1 do begin
if vars[i] <> 0 then
Result := Result + varnames(i) + format('="%g" ', [vars[i]]);

View File

@ -6,7 +6,7 @@ uses
BaseVariation;
const
NRLOCVAR = 29;
NRLOCVAR = 28;
function NrVar: integer;
function Varnames(const index: integer): String;
@ -62,8 +62,7 @@ const
'bubble',
'cylinder',
'noise',
'blur',
'focus'
'blur'
);
begin
if Index < NRLOCVAR then