mirror of
https://codeberg.org/scip/kageviewer.git
synced 2025-12-16 20:20:58 +01:00
check max images, use copy
This commit is contained in:
@@ -144,6 +144,10 @@ func SanitiyCheck(conf *Config) error {
|
|||||||
return fmt.Errorf("at least 1 image must be specified")
|
return fmt.Errorf("at least 1 image must be specified")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if len(conf.Image) > 4 {
|
||||||
|
return fmt.Errorf("only 4 images can be specified")
|
||||||
|
}
|
||||||
|
|
||||||
if conf.Shader == "" {
|
if conf.Shader == "" {
|
||||||
return fmt.Errorf("shader file must be specified")
|
return fmt.Errorf("shader file must be specified")
|
||||||
}
|
}
|
||||||
|
|||||||
4
game.go
4
game.go
@@ -141,9 +141,7 @@ func (game *Game) Draw(screen *ebiten.Image) {
|
|||||||
"Mouse": []float64{float64(mousex), float64(mousey)},
|
"Mouse": []float64{float64(mousex), float64(mousey)},
|
||||||
}
|
}
|
||||||
|
|
||||||
for idx, image := range game.Images {
|
copy(op.Images[:3], game.Images)
|
||||||
op.Images[idx] = image
|
|
||||||
}
|
|
||||||
|
|
||||||
op.GeoM.Translate(float64(game.Conf.X), float64(game.Conf.Y))
|
op.GeoM.Translate(float64(game.Conf.X), float64(game.Conf.Y))
|
||||||
|
|
||||||
|
|||||||
BIN
kage-viewer
BIN
kage-viewer
Binary file not shown.
Reference in New Issue
Block a user