diff --git a/2.10/Source/Adjust.dfm b/2.10/Source/Adjust.dfm index 76c6282..bb12156 100644 --- a/2.10/Source/Adjust.dfm +++ b/2.10/Source/Adjust.dfm @@ -173,7 +173,7 @@ object AdjustForm: TAdjustForm Top = 133 Width = 390 Height = 131 - ActivePage = TabSheet2 + ActivePage = TabSheet3 Align = alBottom TabOrder = 1 object TabSheet1: TTabSheet @@ -912,7 +912,7 @@ object AdjustForm: TAdjustForm Top = 12 Width = 73 Height = 21 - ItemHeight = 13 + ItemHeight = 0 ItemIndex = 0 TabOrder = 7 Text = '512' @@ -930,7 +930,7 @@ object AdjustForm: TAdjustForm Top = 36 Width = 73 Height = 21 - ItemHeight = 13 + ItemHeight = 0 ItemIndex = 0 TabOrder = 8 Text = '384' diff --git a/2.10/Source/Adjust.pas b/2.10/Source/Adjust.pas index 1aaefcd..3d3f7ad 100644 --- a/2.10/Source/Adjust.pas +++ b/2.10/Source/Adjust.pas @@ -281,6 +281,7 @@ type procedure WritePreset(n: integer); function PresetToStr(n: integer): string; + procedure UpdateGradient(Pal: TColorMap); // -- public PreviewDensity: double; @@ -291,7 +292,6 @@ type procedure UpdateDisplay; procedure UpdateFlame; - procedure UpdateGradient(Pal: TColorMap); end; var @@ -364,7 +364,12 @@ begin Resetting := False; DrawPreview; - Palette:=cp.cmap; + // gradient + if cp.cmapindex >= 0 then + cmbPalette.ItemIndex := cp.cmapindex; + ScrollBar.Position := 0; + Palette := cp.cmap; + BackupPal := cp.cmap; DrawPalette; end; diff --git a/2.10/Source/Browser.dfm b/2.10/Source/Browser.dfm index 2990032..76d653a 100644 --- a/2.10/Source/Browser.dfm +++ b/2.10/Source/Browser.dfm @@ -43,7 +43,6 @@ object GradientBrowser: TGradientBrowser 0000800300008003000080030000800300008003000080030000800300008003 000080030000800300008003000080070000800F0000801F0000803F0000} OldCreateOrder = False - Position = poDefaultPosOnly OnClose = FormClose OnCreate = FormCreate OnDestroy = FormDestroy @@ -54,7 +53,7 @@ object GradientBrowser: TGradientBrowser Left = 0 Top = 4 Width = 372 - Height = 105 + Height = 99 Align = alClient BevelOuter = bvNone TabOrder = 0 @@ -98,7 +97,7 @@ object GradientBrowser: TGradientBrowser end object pnlControls: TPanel Left = 0 - Top = 109 + Top = 103 Width = 372 Height = 51 Align = alBottom diff --git a/2.10/Source/Browser.pas b/2.10/Source/Browser.pas index 18865a4..d2bffd4 100644 --- a/2.10/Source/Browser.pas +++ b/2.10/Source/Browser.pas @@ -470,10 +470,8 @@ begin MainForm.StopThread; MainForm.UpdateUndo; MainCp.cmap := Palette; - //gradientForm.UpdateGradient(Palette); - AdjustForm.UpdateGradient(Palette); if EditForm.Visible then EditForm.UpdateDisplay; -// if AdjustForm.Visible then AdjustForm.UpdateDisplay; + if AdjustForm.Visible then AdjustForm.UpdateDisplay; if MutateForm.Visible then MutateForm.UpdateDisplay; MainForm.RedrawTimer.enabled := true; end; diff --git a/2.10/Source/Global.pas b/2.10/Source/Global.pas index 7b71ca4..504f339 100644 --- a/2.10/Source/Global.pas +++ b/2.10/Source/Global.pas @@ -76,7 +76,6 @@ var UPRHeight: Integer; ImageFolder: string; UPRPath: string; // Name and folder of last UPR file - UpdateGradient: boolean; cmap_index: integer; // Index to current gradient Variation: TVariation; // Current variation NumTries, TryLength: integer; // Settings for smooth palette diff --git a/2.10/Source/Main.dfm b/2.10/Source/Main.dfm index 397f1b6..86c6e20 100644 --- a/2.10/Source/Main.dfm +++ b/2.10/Source/Main.dfm @@ -27,7 +27,7 @@ object MainForm: TMainForm Left = 160 Top = 28 Width = 4 - Height = 480 + Height = 494 end object ToolBar: TToolBar Left = 0 @@ -283,7 +283,7 @@ object MainForm: TMainForm Left = 0 Top = 28 Width = 160 - Height = 480 + Height = 494 Align = alLeft Columns = < item @@ -302,7 +302,7 @@ object MainForm: TMainForm Left = 164 Top = 28 Width = 433 - Height = 480 + Height = 494 Align = alClient BevelInner = bvLowered BevelOuter = bvNone @@ -326,7 +326,7 @@ object MainForm: TMainForm end object StatusBar: TStatusBar Left = 0 - Top = 508 + Top = 522 Width = 597 Height = 19 Panels = < diff --git a/2.10/Source/Main.pas b/2.10/Source/Main.pas index 1396044..0a0dfee 100644 --- a/2.10/Source/Main.pas +++ b/2.10/Source/Main.pas @@ -1363,11 +1363,11 @@ begin x := cp1.center[0]; y := cp1.center[1]; pal := ''; hue := ''; - if sheep then - begin +// if sheep then +// begin pal := 'palette="' + IntToStr(cp1.cmapindex) + '" '; hue := 'hue="' + format('%g', [cp1.hue_rotation]) + '" '; - end; +// end; if Trim(SheepNick) <> '' then nick := 'nick="' + Trim(SheepNick) + '"'; if Trim(SheepURL) <> '' then url := 'url="' + Trim(SheepURL) + '" '; try @@ -1386,6 +1386,7 @@ begin format('brightness="%g" ', [cp1.brightness]) + format('gamma="%g" ', [cp1.gamma]) + format('vibrancy="%g" ', [cp1.vibrancy]) + hue + url + nick + '>'); + { Write transform parameters } t := NumXForms(cp1); for i := 0 to t - 1 do begin @@ -2334,8 +2335,9 @@ begin MainCp.name := RandomPrefix + RandomDate + '-' + IntToStr(RandomIndex); Transforms := TrianglesFromCP(MainCp, MainTriangles); -// if GradientForm.visible then GradientForm.UpdateGradient(Maincp.cmap); - if AdjustForm.visible then AdjustForm.UpdateGradient(Maincp.cmap); + + if AdjustForm.visible then + AdjustForm.UpdateDisplay; StatusBar.Panels[2].text := maincp.name; ResetLocation; @@ -2977,8 +2979,8 @@ end; procedure TMainForm.UpdateWindows; begin - if AdjustForm.visible then AdjustForm.UpdateGradient(maincp.cmap); -// if GradientForm.visible then GradientForm.UpdateGradient(maincp.cmap); + if AdjustForm.visible then + AdjustForm.UpdateDisplay; if EditForm.visible then EditForm.UpdateDisplay; // hmm I think I still have some problems with EditForm updating @@ -3052,9 +3054,12 @@ begin Transforms := TrianglesFromCP(maincp, MainTriangles); // Trim undo index from title maincp.name := Copy(Fstrings[0], 6, length(Fstrings[0]) - 7); - if SavedPal then maincp.cmap := palette; -// if GradientForm.visible then GradientForm.UpdateGradient(maincp.cmap); - if AdjustForm.visible then AdjustForm.UpdateGradient(maincp.cmap); + + if SavedPal then + maincp.cmap := palette; + if AdjustForm.visible then + AdjustForm.UpdateDisplay; + RedrawTimer.Enabled := True; UpdateWindows; finally @@ -3121,8 +3126,6 @@ end; procedure TMainForm.mnuGradClick(Sender: TObject); begin - //gradientForm.UpdateGradient(maincp.cmap); - //GradientForm.Show; AdjustForm.UpdateDisplay; AdjustForm.PageControl.TabIndex:=2; AdjustForm.Show; @@ -3299,7 +3302,7 @@ begin StopThread; UpdateUndo; maincp.cmap := Pal; - AdjustForm.UpdateGradient(maincp.cmap); + AdjustForm.UpdateDisplay; if EditForm.Visible then EditForm.UpdateDisplay; if MutateForm.Visible then MutateForm.UpdateDisplay; @@ -3720,24 +3723,25 @@ begin ScriptEditor.Stopped := True; StopThread; nxform := 0; + Parsecp.cmapindex := -2; // generate pallet from cmapindex and hue (apo 1 and earlier) ParseCp.symmetry := 0; XMLScanner.LoadFromBuffer(params); XMLScanner.Execute; cp1.copy(ParseCp); - if Parsecp.cmapindex <> -1 then + if Parsecp.cmapindex = -2 then begin if cp1.cmapindex < NRCMAPS then GetCMap(cp1.cmapindex, 1, cp1.cmap) else ShowMessage('Palette index too high'); - end; - if (cp1.hue_rotation > 0) and (cp1.hue_rotation < 1) then - begin - for i := 0 to 255 do - begin - RGBToHSV(cp1.cmap[i][0], cp1.cmap[i][1], cp1.cmap[i][2], h, s, v); - h := Round(360 + h + (cp1.hue_rotation * 360)) mod 360; - HSVToRGB(h, s, v, cp1.cmap[i][0], cp1.cmap[i][1], cp1.cmap[i][2]); + + if (cp1.hue_rotation > 0) and (cp1.hue_rotation < 1) then begin + for i := 0 to 255 do + begin + RGBToHSV(cp1.cmap[i][0], cp1.cmap[i][1], cp1.cmap[i][2], h, s, v); + h := Round(360 + h + (cp1.hue_rotation * 360)) mod 360; + HSVToRGB(h, s, v, cp1.cmap[i][0], cp1.cmap[i][1], cp1.cmap[i][2]); + end; end; end; @@ -4094,6 +4098,10 @@ procedure ParseCompactcolors(cp: TControlPoint; count: integer; data: string); var i: integer; begin + // diable generating pallete + if Parsecp.cmapindex = -2 then + Parsecp.cmapindex := -1; + Assert(Count = 256,'only 256 color Colormaps are supported at the moment'); Assert((Count * 8) = Length(data),'Data size MisMatch'); for i := 0 to Count -1 do begin @@ -4172,6 +4180,10 @@ begin end; if TagName = 'color' then begin + // diable generating pallete + if Parsecp.cmapindex = -2 then + Parsecp.cmapindex := -1; + i := StrToInt(Attributes.value('index')); v := Attributes.value('rgb'); GetTokens(v, tokens); diff --git a/2.10/Source/RndFlame.pas b/2.10/Source/RndFlame.pas index 0d6f958..80a137b 100644 --- a/2.10/Source/RndFlame.pas +++ b/2.10/Source/RndFlame.pas @@ -38,7 +38,7 @@ begin begin cmap_index := Random(NRCMAPS); GetCMap(cmap_index, 1, DestCP.cmap); - cmap_index := DestCP.cmapindex; +// cmap_index := DestCP.cmapindex; DestCP.cmapIndex := cmap_index; end; 1: diff --git a/2.10/Source/ScriptForm.pas b/2.10/Source/ScriptForm.pas index f07610d..2446ac5 100644 --- a/2.10/Source/ScriptForm.pas +++ b/2.10/Source/ScriptForm.pas @@ -2958,10 +2958,8 @@ begin MainCp.cmap := cp.cmap; MainForm.RedrawTimer.enabled := true; if EditForm.Visible then EditForm.UpdateDisplay; -// if AdjustForm.Visible then AdjustForm.UpdateDisplay; + if AdjustForm.Visible then AdjustForm.UpdateDisplay; if MutateForm.Visible then MutateForm.UpdateDisplay; -// if GradientForm.Visible then GradientForm.UpdateGradient(cmap) - if AdjustForm.Visible then AdjustForm.UpdateGradient(cmap) end; { ******************************* functions ********************************** }