automated snapshot
This commit is contained in:
6
field.go
6
field.go
@@ -28,7 +28,7 @@ type TranslateField struct {
|
||||
x, y float32
|
||||
}
|
||||
|
||||
func (f *TranslateField) Get(x, y float32) float32 {
|
||||
func (f TranslateField) Get(x float32, y float32) float32 {
|
||||
return f.field.Get(x+f.x, y+f.y)
|
||||
}
|
||||
|
||||
@@ -65,7 +65,7 @@ func (p *ImagePixels) Get(x, y int) rl.Color {
|
||||
return p.colors[x+y*p.w]
|
||||
}
|
||||
|
||||
func NewImageField(path string) ImageField {
|
||||
func NewImageField(path string) *ImageField {
|
||||
image := rl.LoadImage(path)
|
||||
fmt.Printf("loaded image from %s\n", path)
|
||||
colors := rl.LoadImageColors(image)
|
||||
@@ -76,7 +76,7 @@ func NewImageField(path string) ImageField {
|
||||
}
|
||||
offsetX := int(image.Width)/2
|
||||
offsetY := int(image.Height)/2
|
||||
return ImageField{
|
||||
return &ImageField {
|
||||
image: image,
|
||||
pixels: pixels,
|
||||
offsetX: offsetX,
|
||||
|
||||
Reference in New Issue
Block a user