diff --git a/build/entrypoint.sh b/build/entrypoint.sh index 7e428b5..05f8584 100755 --- a/build/entrypoint.sh +++ b/build/entrypoint.sh @@ -1,7 +1,7 @@ #! /bin/bash cd /root/martine -CGO_ENABLED=1 CC=x86_64-w64-mingw32-gcc GOOS=windows GOARCH=amd64 go build -o ./build/martine.exe ./cli -GOOS=linux GOARCH=amd64 go build -o ./build/martine.linux ./cli +#CGO_ENABLED=1 CC=x86_64-w64-mingw32-gcc GOOS=windows GOARCH=amd64 go build -o ./build/martine.exe ./cli +GOOS=linux GOARCH=amd64 go build -o ./build/martine.linux ./ui/ diff --git a/export/ocpartstudio/loader.go b/export/ocpartstudio/loader.go index 701c256..9ad77aa 100644 --- a/export/ocpartstudio/loader.go +++ b/export/ocpartstudio/loader.go @@ -1467,8 +1467,8 @@ func BasicLoader(filePath string, p color.Palette, cfg *config.MartineConfig) er v, err := constants.FirmwareNumber(p[i]) if err == nil { out += fmt.Sprintf("%0.2d", v) - // } else { - // log.GetLogger().Error("Error while getting the hardware values for color %v, error :%v\n", p[0], err) + } else { + log.GetLogger().Error("Error while getting the hardware values for color %v, error :%v\n", p[0], err) } if i+1 < len(p) { out += "," diff --git a/gfx/common.go b/gfx/common.go index 4527702..998b765 100644 --- a/gfx/common.go +++ b/gfx/common.go @@ -411,6 +411,11 @@ func ApplyOneImage(in image.Image, } if cfg.ScrCfg.Process.Saturation > 0 || cfg.ScrCfg.Process.Brightness > 0 { palette = ci.EnhanceBrightness(newPalette, cfg.ScrCfg.Process.Brightness, cfg.ScrCfg.Process.Saturation) + refPal := constants.CpcOldPalette + if cfg.ScrCfg.IsPlus { + refPal = constants.CpcPlusPalette + } + palette = ci.ConvertPalette(palette, refPal) newPalette, out = ci.DowngradingWithPalette(out, palette) var paletteToSort color.Palette switch mode { diff --git a/ui/martine-ui/image_tab.go b/ui/martine-ui/image_tab.go index c8d69a8..91c1669 100644 --- a/ui/martine-ui/image_tab.go +++ b/ui/martine-ui/image_tab.go @@ -229,6 +229,12 @@ func (m *MartineUI) newImageTransfertTab(me *menu.ImageMenu) *fyne.Container { brightness.Step = .01 brightness.OnChanged = func(f float64) { me.Cfg.ScrCfg.Process.Brightness = f + if f == 1.0 { + me.Edited = false + me.UsePalette = false + } else { + me.Edited = true + } } saturationLabel := widget.NewLabel("Saturation") saturation := widget.NewSlider(0.0, 1.0) @@ -236,6 +242,13 @@ func (m *MartineUI) newImageTransfertTab(me *menu.ImageMenu) *fyne.Container { saturation.Step = .01 saturation.OnChanged = func(f float64) { me.Cfg.ScrCfg.Process.Saturation = f + if f == 1.0 { + me.Edited = false + me.UsePalette = false + } else { + me.Edited = true + } + } brightnessLabel := widget.NewLabel("Brightness") diff --git a/ui/martine-ui/menu/image_menu.go b/ui/martine-ui/menu/image_menu.go index 4b7700c..ea394b0 100644 --- a/ui/martine-ui/menu/image_menu.go +++ b/ui/martine-ui/menu/image_menu.go @@ -386,9 +386,15 @@ func (me *ImageMenu) NewConfig(checkOriginalImage bool) *config.MartineConfig { if me.Cfg.ScrCfg.Process.Brightness > 0 && me.Cfg.ScrCfg.Process.Saturation == 0 { me.Cfg.ScrCfg.Process.Saturation = me.Cfg.ScrCfg.Process.Brightness } + if me.Cfg.ScrCfg.Process.Brightness > 0 { + me.Edited = true + } if me.Cfg.ScrCfg.Process.Brightness == 0 && me.Cfg.ScrCfg.Process.Saturation > 0 { me.Cfg.ScrCfg.Process.Brightness = me.Cfg.ScrCfg.Process.Saturation } + if me.Cfg.ScrCfg.Process.Saturation > 0 { + me.Edited = true + } me.Cfg.ScrCfg.Size = constants.NewSizeMode(me.Cfg.ScrCfg.Mode, me.Cfg.ScrCfg.Type.IsFullScreen()) if me.Cfg.ScrCfg.Type.IsSprite() { width, _, err := me.GetWidth()