Remove internal/conv

This sets font rendering back a little bit, but not much.
This commit is contained in:
2020-03-21 13:37:20 +00:00
parent 4c0355ac4f
commit be4229b8fe
8 changed files with 145 additions and 220 deletions

View File

@@ -14,11 +14,12 @@ var (
type Set struct {
assets *AssetStore
raw *sets.MapSet
raw *sets.MapSet
NumObjects int
}
func (s *Set) Object(idx int) (*Object, error) {
if idx < 0 || idx >= len(s.raw.Palette) {
if idx < 0 || idx >= s.NumObjects {
return nil, ErrOutOfBounds
}
@@ -27,6 +28,7 @@ func (s *Set) Object(idx int) (*Object, error) {
func (a *AssetStore) Set(name string) (*Set, error) {
name = canonical(name)
if set, ok := a.sets[name]; ok {
return set, nil
}
@@ -43,8 +45,9 @@ func (a *AssetStore) Set(name string) (*Set, error) {
}
set := &Set{
assets: a,
raw: raw,
assets: a,
raw: raw,
NumObjects: len(raw.Palette),
}
a.sets[name] = set