mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2025-01-11 19:48:54 +01:00
internal/builtinshader: use a struct instead of a map
With a map, we might miss typos.
This commit is contained in:
parent
72004b2e23
commit
ff72898b85
@ -131,15 +131,24 @@ func Shader(filter graphicsdriver.Filter, address graphicsdriver.Address, useCol
|
|||||||
}
|
}
|
||||||
|
|
||||||
var buf bytes.Buffer
|
var buf bytes.Buffer
|
||||||
if err := tmpl.Execute(&buf, map[string]interface{}{
|
if err := tmpl.Execute(&buf, struct {
|
||||||
"Filter": filter,
|
Filter graphicsdriver.Filter
|
||||||
"FilterNearest": graphicsdriver.FilterNearest,
|
FilterNearest graphicsdriver.Filter
|
||||||
"FilterLinear": graphicsdriver.FilterLinear,
|
FilterLinear graphicsdriver.Filter
|
||||||
"Address": address,
|
Address graphicsdriver.Address
|
||||||
"AddressUnsafe": graphicsdriver.AddressUnsafe,
|
AddressUnsafe graphicsdriver.Address
|
||||||
"AddressClampToZero": graphicsdriver.AddressClampToZero,
|
AddressClampToZero graphicsdriver.Address
|
||||||
"AddressRepeat": graphicsdriver.AddressRepeat,
|
AddressRepeat graphicsdriver.Address
|
||||||
"UseColorM": useColorM,
|
UseColorM bool
|
||||||
|
}{
|
||||||
|
Filter: filter,
|
||||||
|
FilterNearest: graphicsdriver.FilterNearest,
|
||||||
|
FilterLinear: graphicsdriver.FilterLinear,
|
||||||
|
Address: address,
|
||||||
|
AddressUnsafe: graphicsdriver.AddressUnsafe,
|
||||||
|
AddressClampToZero: graphicsdriver.AddressClampToZero,
|
||||||
|
AddressRepeat: graphicsdriver.AddressRepeat,
|
||||||
|
UseColorM: useColorM,
|
||||||
}); err != nil {
|
}); err != nil {
|
||||||
panic(fmt.Sprintf("builtinshader: tmpl.Execute failed: %v", err))
|
panic(fmt.Sprintf("builtinshader: tmpl.Execute failed: %v", err))
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user