Added some global variables
This commit is contained in:
parent
510c4c87a9
commit
6066459f61
@ -49,13 +49,6 @@ object RenderForm: TRenderForm
|
|||||||
OnShow = FormShow
|
OnShow = FormShow
|
||||||
PixelsPerInch = 96
|
PixelsPerInch = 96
|
||||||
TextHeight = 13
|
TextHeight = 13
|
||||||
object Label6: TLabel
|
|
||||||
Left = 204
|
|
||||||
Top = 340
|
|
||||||
Width = 118
|
|
||||||
Height = 13
|
|
||||||
Caption = 'TestValue Nr Of Threads'
|
|
||||||
end
|
|
||||||
object ProgressBar: TProgressBar
|
object ProgressBar: TProgressBar
|
||||||
Left = 0
|
Left = 0
|
||||||
Top = 392
|
Top = 392
|
||||||
@ -469,16 +462,6 @@ object RenderForm: TRenderForm
|
|||||||
Caption = 'Post render'
|
Caption = 'Post render'
|
||||||
TabOrder = 9
|
TabOrder = 9
|
||||||
end
|
end
|
||||||
object edtNrThreads: TEdit
|
|
||||||
Left = 336
|
|
||||||
Top = 336
|
|
||||||
Width = 73
|
|
||||||
Height = 21
|
|
||||||
BiDiMode = bdRightToLeft
|
|
||||||
ParentBiDiMode = False
|
|
||||||
TabOrder = 13
|
|
||||||
Text = '1'
|
|
||||||
end
|
|
||||||
object SaveDialog: TSaveDialog
|
object SaveDialog: TSaveDialog
|
||||||
Left = 368
|
Left = 368
|
||||||
Top = 256
|
Top = 256
|
||||||
|
@ -66,8 +66,6 @@ type
|
|||||||
StatusBar: TStatusBar;
|
StatusBar: TStatusBar;
|
||||||
chkShutdown: TCheckBox;
|
chkShutdown: TCheckBox;
|
||||||
cbPostProcess: TCheckBox;
|
cbPostProcess: TCheckBox;
|
||||||
edtNrThreads: TEdit;
|
|
||||||
Label6: TLabel;
|
|
||||||
txtDensity: TComboBox;
|
txtDensity: TComboBox;
|
||||||
procedure FormCreate(Sender: TObject);
|
procedure FormCreate(Sender: TObject);
|
||||||
procedure FormDestroy(Sender: TObject);
|
procedure FormDestroy(Sender: TObject);
|
||||||
@ -339,7 +337,7 @@ begin
|
|||||||
Renderer.Compatibility := compatibility;
|
Renderer.Compatibility := compatibility;
|
||||||
Renderer.SetCP(cp);
|
Renderer.SetCP(cp);
|
||||||
Renderer.Priority := tpLower;
|
Renderer.Priority := tpLower;
|
||||||
Renderer.NrThreads := StrToInt(edtNrThreads.text);
|
Renderer.NrThreads := NrTreads;
|
||||||
Renderer.Resume;
|
Renderer.Resume;
|
||||||
|
|
||||||
// enable screensaver
|
// enable screensaver
|
||||||
|
@ -127,7 +127,10 @@ var
|
|||||||
defLibrary: string;
|
defLibrary: string;
|
||||||
LimitVibrancy: Boolean;
|
LimitVibrancy: Boolean;
|
||||||
DefaultPalette: TColorMap;
|
DefaultPalette: TColorMap;
|
||||||
|
PNGTransparency: integer;
|
||||||
|
ShowTransparency: boolean;
|
||||||
|
NrTreads: Integer;
|
||||||
|
UseNrThreads: integer;
|
||||||
|
|
||||||
function Round6(x: double): double;
|
function Round6(x: double): double;
|
||||||
|
|
||||||
|
@ -146,8 +146,10 @@ end;
|
|||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
function TImageMaker.GetImage: TBitmap;
|
function TImageMaker.GetImage: TBitmap;
|
||||||
begin
|
begin
|
||||||
// Result := GetTransparentImage;
|
if ShowTransparency then
|
||||||
Result := FBitmap;
|
Result := GetTransparentImage
|
||||||
|
else
|
||||||
|
Result := FBitmap;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
@ -193,8 +195,14 @@ end;
|
|||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
procedure TImageMaker.CreateImage(YOffset: integer);
|
procedure TImageMaker.CreateImage(YOffset: integer);
|
||||||
begin
|
begin
|
||||||
CreateImage_Flame3(YOffset);
|
Case PNGTransparency of
|
||||||
// CreateImage_MB(YOffset);
|
0,1:
|
||||||
|
CreateImage_Flame3(YOffset);
|
||||||
|
2:
|
||||||
|
CreateImage_MB(YOffset);
|
||||||
|
else
|
||||||
|
Exception.CreateFmt('Unexpected value of PNGTransparency [%d]', [PNGTransparency]);
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
@ -586,13 +594,22 @@ begin
|
|||||||
if UpperCase(ExtractFileExt(FileName)) = '.PNG' then begin
|
if UpperCase(ExtractFileExt(FileName)) = '.PNG' then begin
|
||||||
PngObject := TPngObject.Create;
|
PngObject := TPngObject.Create;
|
||||||
PngObject.Assign(FBitmap);
|
PngObject.Assign(FBitmap);
|
||||||
PngObject.CreateAlpha;
|
Case PNGTransparency of
|
||||||
for i:= 0 to FAlphaBitmap.Height - 1 do begin
|
0:
|
||||||
rowbm := PByteArray(FAlphaBitmap.scanline[i]);
|
; // do nothing
|
||||||
rowpng := PByteArray(PngObject.AlphaScanline[i]);
|
1,2:
|
||||||
for row := 0 to FAlphaBitmap.Width -1 do begin
|
begin
|
||||||
rowpng[row] := rowbm[row];
|
PngObject.CreateAlpha;
|
||||||
|
for i:= 0 to FAlphaBitmap.Height - 1 do begin
|
||||||
|
rowbm := PByteArray(FAlphaBitmap.scanline[i]);
|
||||||
|
rowpng := PByteArray(PngObject.AlphaScanline[i]);
|
||||||
|
for row := 0 to FAlphaBitmap.Width -1 do begin
|
||||||
|
rowpng[row] := rowbm[row];
|
||||||
|
end;
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
|
else
|
||||||
|
Exception.CreateFmt('Unexpected value of PNGTransparency [%d]', [PNGTransparency]);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
PngObject.SaveToFile(FileName);
|
PngObject.SaveToFile(FileName);
|
||||||
|
@ -161,6 +161,68 @@ object OptionsForm: TOptionsForm
|
|||||||
Caption = 'Resize on load'
|
Caption = 'Resize on load'
|
||||||
TabOrder = 5
|
TabOrder = 5
|
||||||
end
|
end
|
||||||
|
object GroupBox15: TGroupBox
|
||||||
|
Left = 8
|
||||||
|
Top = 134
|
||||||
|
Width = 129
|
||||||
|
Height = 83
|
||||||
|
Caption = 'PNG Transparency'
|
||||||
|
TabOrder = 6
|
||||||
|
object RadioButton1: TRadioButton
|
||||||
|
Left = 12
|
||||||
|
Top = 16
|
||||||
|
Width = 113
|
||||||
|
Height = 17
|
||||||
|
Caption = 'No transparency'
|
||||||
|
TabOrder = 0
|
||||||
|
end
|
||||||
|
object RadioButton2: TRadioButton
|
||||||
|
Left = 12
|
||||||
|
Top = 32
|
||||||
|
Width = 113
|
||||||
|
Height = 17
|
||||||
|
Caption = 'Like Flame3'
|
||||||
|
TabOrder = 1
|
||||||
|
end
|
||||||
|
object RadioButton3: TRadioButton
|
||||||
|
Left = 12
|
||||||
|
Top = 48
|
||||||
|
Width = 113
|
||||||
|
Height = 17
|
||||||
|
Caption = 'Like Flamesong'
|
||||||
|
TabOrder = 2
|
||||||
|
end
|
||||||
|
end
|
||||||
|
object GroupBox16: TGroupBox
|
||||||
|
Left = 140
|
||||||
|
Top = 134
|
||||||
|
Width = 117
|
||||||
|
Height = 51
|
||||||
|
Caption = 'Nr processors'
|
||||||
|
TabOrder = 7
|
||||||
|
object cbNrTheads: TComboBox
|
||||||
|
Left = 12
|
||||||
|
Top = 20
|
||||||
|
Width = 89
|
||||||
|
Height = 21
|
||||||
|
ItemHeight = 13
|
||||||
|
TabOrder = 0
|
||||||
|
Text = '200'
|
||||||
|
Items.Strings = (
|
||||||
|
'Off'
|
||||||
|
'2'
|
||||||
|
'4'
|
||||||
|
'8')
|
||||||
|
end
|
||||||
|
end
|
||||||
|
object cbShowTransparancy: TCheckBox
|
||||||
|
Left = 144
|
||||||
|
Top = 196
|
||||||
|
Width = 169
|
||||||
|
Height = 17
|
||||||
|
Caption = 'Show Transparancy'
|
||||||
|
TabOrder = 8
|
||||||
|
end
|
||||||
end
|
end
|
||||||
object DisplayPage: TTabSheet
|
object DisplayPage: TTabSheet
|
||||||
Caption = 'Display'
|
Caption = 'Display'
|
||||||
@ -553,10 +615,11 @@ object OptionsForm: TOptionsForm
|
|||||||
object clbVarEnabled: TCheckListBox
|
object clbVarEnabled: TCheckListBox
|
||||||
Left = 12
|
Left = 12
|
||||||
Top = 16
|
Top = 16
|
||||||
Width = 205
|
Width = 309
|
||||||
Height = 189
|
Height = 189
|
||||||
ItemHeight = 13
|
ItemHeight = 13
|
||||||
TabOrder = 0
|
TabOrder = 0
|
||||||
|
TabWidth = 100
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
object btnSetAll: TButton
|
object btnSetAll: TButton
|
||||||
|
@ -174,6 +174,13 @@ type
|
|||||||
Label37: TLabel;
|
Label37: TLabel;
|
||||||
txtLibrary: TEdit;
|
txtLibrary: TEdit;
|
||||||
clbVarEnabled: TCheckListBox;
|
clbVarEnabled: TCheckListBox;
|
||||||
|
GroupBox15: TGroupBox;
|
||||||
|
RadioButton1: TRadioButton;
|
||||||
|
RadioButton2: TRadioButton;
|
||||||
|
RadioButton3: TRadioButton;
|
||||||
|
GroupBox16: TGroupBox;
|
||||||
|
cbNrTheads: TComboBox;
|
||||||
|
cbShowTransparancy: TCheckBox;
|
||||||
procedure btnCancelClick(Sender: TObject);
|
procedure btnCancelClick(Sender: TObject);
|
||||||
procedure FormShow(Sender: TObject);
|
procedure FormShow(Sender: TObject);
|
||||||
procedure btnOKClick(Sender: TObject);
|
procedure btnOKClick(Sender: TObject);
|
||||||
@ -250,6 +257,17 @@ begin
|
|||||||
chkFixedReference.Checked := FixedReference;
|
chkFixedReference.Checked := FixedReference;
|
||||||
udBatchSize.Position := BatchSize;
|
udBatchSize.Position := BatchSize;
|
||||||
chkResize.checked := ResizeOnLoad;
|
chkResize.checked := ResizeOnLoad;
|
||||||
|
case PNGTransparency of
|
||||||
|
0: RadioButton1.Checked := True;
|
||||||
|
1: RadioButton2.Checked := True;
|
||||||
|
2: RadioButton3.Checked := True;
|
||||||
|
else
|
||||||
|
end;
|
||||||
|
if NrTreads <= 1 then
|
||||||
|
cbNrTheads.ItemIndex := 0
|
||||||
|
else
|
||||||
|
cbNrTheads.text := intTostr(NrTreads);
|
||||||
|
cbShowTransparancy.Checked := ShowTransparency;
|
||||||
|
|
||||||
{ Display tab }
|
{ Display tab }
|
||||||
txtSampleDensity.Text := FloatToStr(defSampleDensity);
|
txtSampleDensity.Text := FloatToStr(defSampleDensity);
|
||||||
@ -345,6 +363,16 @@ begin
|
|||||||
if BatchSize < 1 then BatchSize := 1;
|
if BatchSize < 1 then BatchSize := 1;
|
||||||
if BatchSize > 300 then BatchSize := 300;
|
if BatchSize > 300 then BatchSize := 300;
|
||||||
|
|
||||||
|
if RadioButton1.Checked then
|
||||||
|
PNGTransparency := 0
|
||||||
|
else if RadioButton2.Checked then
|
||||||
|
PNGTransparency := 1
|
||||||
|
else if RadioButton3.Checked then
|
||||||
|
PNGTransparency := 2;
|
||||||
|
|
||||||
|
ShowTransparency := cbShowTransparancy.Checked;
|
||||||
|
|
||||||
|
NrTreads := StrToIntDef(cbNrTheads.text, 0);
|
||||||
ConfirmDelete := chkConfirmDel.Checked;
|
ConfirmDelete := chkConfirmDel.Checked;
|
||||||
FixedReference := chkFixedReference.Checked;
|
FixedReference := chkFixedReference.Checked;
|
||||||
ResizeOnLoad := chkResize.checked;
|
ResizeOnLoad := chkResize.checked;
|
||||||
|
@ -480,11 +480,29 @@ begin
|
|||||||
if Registry.ValueExists('ShowProgress') then
|
if Registry.ValueExists('ShowProgress') then
|
||||||
begin
|
begin
|
||||||
ShowProgress := Registry.ReadBool('ShowProgress');
|
ShowProgress := Registry.ReadBool('ShowProgress');
|
||||||
end
|
end else begin
|
||||||
else
|
|
||||||
begin
|
|
||||||
ShowProgress := true;
|
ShowProgress := true;
|
||||||
end;
|
end;
|
||||||
|
if Registry.ValueExists('PNGTransparency') then begin
|
||||||
|
PNGTransparency := Registry.ReadInteger('PNGTransparency');
|
||||||
|
end else begin
|
||||||
|
PNGTransparency := 2
|
||||||
|
end;
|
||||||
|
if Registry.ValueExists('ShowTransparency') then begin
|
||||||
|
ShowTransparency := Registry.ReadBool('ShowTransparency');
|
||||||
|
end else begin
|
||||||
|
ShowTransparency := False;
|
||||||
|
end;
|
||||||
|
if Registry.ValueExists('NrTreads') then begin
|
||||||
|
NrTreads := Registry.ReadInteger('NrTreads');
|
||||||
|
end else begin
|
||||||
|
NrTreads := 1;
|
||||||
|
end;
|
||||||
|
if Registry.ValueExists('UseNrThreads') then begin
|
||||||
|
UseNrThreads := Registry.ReadInteger('UseNrThreads');
|
||||||
|
end else begin
|
||||||
|
UseNrThreads := 1;
|
||||||
|
end;
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
begin
|
begin
|
||||||
@ -542,6 +560,10 @@ begin
|
|||||||
SheepServer := 'http://v2d5.sheepserver.net/';
|
SheepServer := 'http://v2d5.sheepserver.net/';
|
||||||
ResizeOnLoad := False;
|
ResizeOnLoad := False;
|
||||||
ShowProgress := true;
|
ShowProgress := true;
|
||||||
|
PNGTransparency := 2;
|
||||||
|
ShowTransparency := False;
|
||||||
|
NrTreads := 1;
|
||||||
|
UseNrThreads := 1;
|
||||||
end;
|
end;
|
||||||
Registry.CloseKey;
|
Registry.CloseKey;
|
||||||
{ Render }
|
{ Render }
|
||||||
@ -876,6 +898,11 @@ begin
|
|||||||
Registry.WriteBool('ShowProgress', ShowProgress);
|
Registry.WriteBool('ShowProgress', ShowProgress);
|
||||||
Registry.WriteBool('KeepBackground', KeepBackground);
|
Registry.WriteBool('KeepBackground', KeepBackground);
|
||||||
Registry.WriteString('FunctionLibrary', defLibrary);
|
Registry.WriteString('FunctionLibrary', defLibrary);
|
||||||
|
|
||||||
|
Registry.WriteBool('ShowTransparency', ShowTransparency);
|
||||||
|
Registry.WriteInteger('PNGTransparency', PNGTransparency);
|
||||||
|
Registry.WriteInteger('NrTreads', NrTreads);
|
||||||
|
Registry.WriteInteger('UseNrThreads', UseNrThreads);
|
||||||
end;
|
end;
|
||||||
{ Display }
|
{ Display }
|
||||||
if Registry.OpenKey('\Software\' + APP_NAME + '\Display', True) then
|
if Registry.OpenKey('\Software\' + APP_NAME + '\Display', True) then
|
||||||
|
Loading…
Reference in New Issue
Block a user