mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-11-10 04:57:26 +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
|
||||
if err := tmpl.Execute(&buf, map[string]interface{}{
|
||||
"Filter": filter,
|
||||
"FilterNearest": graphicsdriver.FilterNearest,
|
||||
"FilterLinear": graphicsdriver.FilterLinear,
|
||||
"Address": address,
|
||||
"AddressUnsafe": graphicsdriver.AddressUnsafe,
|
||||
"AddressClampToZero": graphicsdriver.AddressClampToZero,
|
||||
"AddressRepeat": graphicsdriver.AddressRepeat,
|
||||
"UseColorM": useColorM,
|
||||
if err := tmpl.Execute(&buf, struct {
|
||||
Filter graphicsdriver.Filter
|
||||
FilterNearest graphicsdriver.Filter
|
||||
FilterLinear graphicsdriver.Filter
|
||||
Address graphicsdriver.Address
|
||||
AddressUnsafe graphicsdriver.Address
|
||||
AddressClampToZero graphicsdriver.Address
|
||||
AddressRepeat graphicsdriver.Address
|
||||
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 {
|
||||
panic(fmt.Sprintf("builtinshader: tmpl.Execute failed: %v", err))
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user