aboutsummaryrefslogtreecommitdiff
path: root/go/ui/mapView.go
diff options
context:
space:
mode:
Diffstat (limited to 'go/ui/mapView.go')
-rw-r--r--go/ui/mapView.go37
1 files changed, 3 insertions, 34 deletions
diff --git a/go/ui/mapView.go b/go/ui/mapView.go
index 169aaaf3..051c216f 100644
--- a/go/ui/mapView.go
+++ b/go/ui/mapView.go
@@ -2,7 +2,6 @@ package ui
import (
"fmt"
- "image"
"image/color"
"math"
"unicode"
@@ -14,20 +13,6 @@ import (
"muhq.space/muhqs-game/go/log"
)
-var (
- // No idea why image.DrawTrianglesOptions needs this it is copied from
- // the ebiten vector example.
- whiteImage = ebiten.NewImage(3, 3)
-
- // whiteSubImage is an internal sub image of whiteImage.
- // Use whiteSubImage at DrawTriangles instead of whiteImage in order to avoid bleeding edges.
- whiteSubImage = whiteImage.SubImage(image.Rect(1, 1, 2, 2)).(*ebiten.Image)
-)
-
-func init() {
- whiteImage.Fill(color.White)
-}
-
const (
PERMANENT_WIDTH int = 40
PERMANENT_HEIGHT int = 40
@@ -353,25 +338,9 @@ func drawPileHint(screen *ebiten.Image) {
path.LineTo(PILE_HINT_STARTX+PILE_HINT_LENGTH, y)
path.Close()
}
-
- var vs []ebiten.Vertex
- var is []uint16
- {
- op := &vector.StrokeOptions{Width: PILE_HINT_WIDTH}
- vs, is = path.AppendVerticesAndIndicesForStroke(nil, nil, op)
- }
-
- for i := range vs {
- vs[i].SrcX = 1
- vs[i].SrcY = 1
- vs[i].ColorR = 0
- vs[i].ColorG = 0
- vs[i].ColorB = 0
- vs[i].ColorA = 1
- }
-
- op := &ebiten.DrawTrianglesOptions{AntiAlias: true}
- screen.DrawTriangles(vs, is, whiteSubImage, op)
+ strokeOp := &vector.StrokeOptions{Width: PILE_HINT_WIDTH}
+ drawOp := &vector.DrawPathOptions{AntiAlias: true}
+ vector.StrokePath(screen, &path, strokeOp, drawOp)
}
func (vw *MapView) Draw(screen *ebiten.Image) {