Skip to content

Commit

Permalink
Update dependencies
Browse files Browse the repository at this point in the history
- Push minimal go version to 1.21
- tdewolff/canvas compatibility updates
  • Loading branch information
Dadido3 committed Dec 21, 2023
1 parent 905f629 commit f5a3bad
Show file tree
Hide file tree
Showing 7 changed files with 113 additions and 176 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: ^1.19
go-version: ^1.21

- name: Check out code into the Go module directory
uses: actions/checkout@v2
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: ^1.19
go-version: ^1.21

- name: Check out code into the Go module directory
uses: actions/checkout@v2
Expand Down
2 changes: 1 addition & 1 deletion bin/stitch/entities.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,6 @@ func (e Entities) Draw(destImage *image.RGBA) {

// Theoretically we would need to linearize imgRGBA first, but DefaultColorSpace assumes that the color space is linear already.
r := rasterizer.FromImage(originImage, canvas.DPMM(1.0), canvas.DefaultColorSpace)
c.Render(r)
c.RenderTo(r)
r.Close() // This just transforms the image's luminance curve back from linear into non linear.
}
20 changes: 10 additions & 10 deletions bin/stitch/entity.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ import (
//var entityDisplayFontFace *canvas.FontFace

var entityDisplayAreaDamageStyle = canvas.Style{
FillColor: color.RGBA{100, 0, 0, 100},
StrokeColor: canvas.Transparent,
Fill: canvas.Paint{Color: color.RGBA{100, 0, 0, 100}},
Stroke: canvas.Paint{},
StrokeWidth: 1.0,
StrokeCapper: canvas.ButtCap,
StrokeJoiner: canvas.MiterJoin,
Expand All @@ -26,8 +26,8 @@ var entityDisplayAreaDamageStyle = canvas.Style{
}

var entityDisplayMaterialAreaCheckerStyle = canvas.Style{
FillColor: color.RGBA{0, 0, 127, 127},
StrokeColor: canvas.Transparent,
Fill: canvas.Paint{Color: color.RGBA{0, 0, 127, 127}},
Stroke: canvas.Paint{},
StrokeWidth: 1.0,
StrokeCapper: canvas.ButtCap,
StrokeJoiner: canvas.MiterJoin,
Expand All @@ -37,8 +37,8 @@ var entityDisplayMaterialAreaCheckerStyle = canvas.Style{
}

var entityDisplayTeleportStyle = canvas.Style{
FillColor: color.RGBA{0, 127, 0, 127},
StrokeColor: canvas.Transparent,
Fill: canvas.Paint{Color: color.RGBA{0, 127, 0, 127}},
Stroke: canvas.Paint{},
StrokeWidth: 1.0,
StrokeCapper: canvas.ButtCap,
StrokeJoiner: canvas.MiterJoin,
Expand All @@ -48,8 +48,8 @@ var entityDisplayTeleportStyle = canvas.Style{
}

var entityDisplayHitBoxStyle = canvas.Style{
FillColor: color.RGBA{64, 64, 0, 64},
StrokeColor: color.RGBA{0, 0, 0, 64},
Fill: canvas.Paint{Color: color.RGBA{64, 64, 0, 64}},
Stroke: canvas.Paint{Color: color.RGBA{0, 0, 0, 64}},
StrokeWidth: 1.0,
StrokeCapper: canvas.ButtCap,
StrokeJoiner: canvas.MiterJoin,
Expand All @@ -59,8 +59,8 @@ var entityDisplayHitBoxStyle = canvas.Style{
}

var entityDisplayCollisionTriggerStyle = canvas.Style{
FillColor: color.RGBA{0, 64, 64, 64},
StrokeColor: color.RGBA{0, 0, 0, 64},
Fill: canvas.Paint{Color: color.RGBA{0, 64, 64, 64}},
Stroke: canvas.Paint{Color: color.RGBA{0, 0, 0, 64}},
StrokeWidth: 1.0,
StrokeCapper: canvas.ButtCap,
StrokeJoiner: canvas.MiterJoin,
Expand Down
10 changes: 5 additions & 5 deletions bin/stitch/player-path.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ import (
)

var playerPathDisplayStyle = canvas.Style{
FillColor: canvas.Transparent,
//StrokeColor: color.RGBA{0, 0, 0, 127},
Fill: canvas.Paint{},
//Stroke: canvas.Paint{Color: color.RGBA{0, 0, 0, 127}},
StrokeWidth: 3.0,
StrokeCapper: canvas.ButtCap,
StrokeJoiner: canvas.MiterJoin,
Expand Down Expand Up @@ -81,13 +81,13 @@ func (p PlayerPath) Draw(destImage *image.RGBA) {

if pathElement.Polymorphed {
// Set stroke color to typically polymorph color.
ctx.Style.StrokeColor = color.RGBA{127, 50, 83, 127}
ctx.Style.Stroke.Color = color.RGBA{127, 50, 83, 127}
} else {
// Set stroke color depending on HP level.
hpFactor := math.Max(math.Min(pathElement.HP/pathElement.MaxHP, 1), 0)
hpFactorInv := 1 - hpFactor
r, g, b, a := uint8((0*hpFactor+1*hpFactorInv)*127), uint8((1*hpFactor+0*hpFactorInv)*127), uint8(0), uint8(127)
ctx.Style.StrokeColor = color.RGBA{r, g, b, a}
ctx.Style.Stroke.Color = color.RGBA{r, g, b, a}
}

ctx.DrawPath(0, 0, path)
Expand All @@ -96,6 +96,6 @@ func (p PlayerPath) Draw(destImage *image.RGBA) {

// Theoretically we would need to linearize imgRGBA first, but DefaultColorSpace assumes that the color space is linear already.
r := rasterizer.FromImage(originImage, canvas.DPMM(1.0), canvas.DefaultColorSpace)
c.Render(r)
c.RenderTo(r)
r.Close() // This just transforms the image's luminance curve back from linear into non linear.
}
51 changes: 26 additions & 25 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,41 +1,42 @@
module github.com/Dadido3/noita-mapcap

go 1.19
go 1.21

require (
github.com/1lann/promptui v0.8.1-0.20220708222609-81fad96dd5e1
github.com/cheggaaa/pb/v3 v3.1.0
github.com/coreos/go-semver v0.3.0
github.com/kbinani/screenshot v0.0.0-20210720154843-7d3a670d8329
github.com/cheggaaa/pb/v3 v3.1.4
github.com/coreos/go-semver v0.3.1
github.com/kbinani/screenshot v0.0.0-20230812210009-b87d31814237
github.com/nfnt/resize v0.0.0-20180221191011-83c6a9932646
github.com/tdewolff/canvas v0.0.0-20220627195642-6566432f4b20
golang.org/x/exp v0.0.0-20220713135740-79cabaa25d75
github.com/tdewolff/canvas v0.0.0-20231218015800-2ad5075e9362
golang.org/x/exp v0.0.0-20231219180239-dc181d75b848
)

require (
github.com/ByteArena/poly2tri-go v0.0.0-20170716161910-d102ad91854f // indirect
github.com/VividCortex/ewma v1.2.0 // indirect
github.com/adrg/strutil v0.3.0 // indirect
github.com/adrg/sysfont v0.1.2 // indirect
github.com/adrg/xdg v0.4.0 // indirect
github.com/benoitkugler/textlayout v0.1.3 // indirect
github.com/benoitkugler/textprocessing v0.0.2 // indirect
github.com/benoitkugler/textlayout v0.3.0 // indirect
github.com/benoitkugler/textprocessing v0.0.3 // indirect
github.com/chzyer/readline v1.5.1 // indirect
github.com/dsnet/compress v0.0.1 // indirect
github.com/fatih/color v1.13.0 // indirect
github.com/gen2brain/shm v0.0.0-20200228170931-49f9650110c5 // indirect
github.com/go-latex/latex v0.0.0-20210823091927-c0d11ff05a81 // indirect
github.com/fatih/color v1.16.0 // indirect
github.com/gen2brain/shm v0.1.0 // indirect
github.com/go-fonts/latin-modern v0.3.2 // indirect
github.com/go-fonts/liberation v0.3.2 // indirect
github.com/go-latex/latex v0.0.0-20231108140139-5c1ce85aa4ea // indirect
github.com/go-text/typesetting v0.0.0-20231219150831-cc0073efdbb4 // indirect
github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0 // indirect
github.com/jezek/xgb v0.0.0-20210312150743-0e0f116e1240 // indirect
github.com/jezek/xgb v1.1.1 // indirect
github.com/lxn/win v0.0.0-20210218163916-a377121e959e // indirect
github.com/mattn/go-colorable v0.1.12 // indirect
github.com/mattn/go-isatty v0.0.14 // indirect
github.com/mattn/go-runewidth v0.0.13 // indirect
github.com/rivo/uniseg v0.2.0 // indirect
github.com/tdewolff/minify/v2 v2.11.10 // indirect
github.com/tdewolff/parse/v2 v2.6.0 // indirect
golang.org/x/image v0.10.0 // indirect
golang.org/x/sys v0.5.0 // indirect
golang.org/x/text v0.11.0 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/mattn/go-runewidth v0.0.15 // indirect
github.com/rivo/uniseg v0.4.4 // indirect
github.com/tdewolff/minify/v2 v2.20.10 // indirect
github.com/tdewolff/parse/v2 v2.7.7 // indirect
golang.org/x/image v0.14.0 // indirect
golang.org/x/net v0.19.0 // indirect
golang.org/x/sys v0.15.0 // indirect
golang.org/x/text v0.14.0 // indirect
star-tex.org/x/tex v0.4.0 // indirect
)
Loading

0 comments on commit f5a3bad

Please sign in to comment.