Better logging
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
package assetstore
|
||||
|
||||
import (
|
||||
"log"
|
||||
|
||||
"github.com/hajimehoshi/ebiten"
|
||||
|
||||
"code.ur.gs/lupine/ordoor/internal/data"
|
||||
@@ -19,6 +21,7 @@ func (a *AssetStore) Object(name string) (*Object, error) {
|
||||
if obj, ok := a.objs[name]; ok {
|
||||
return obj, nil
|
||||
}
|
||||
log.Printf("Loading object %v", name)
|
||||
|
||||
filename, err := a.lookup(name, "obj", "Obj")
|
||||
if err != nil {
|
||||
@@ -29,6 +32,7 @@ func (a *AssetStore) Object(name string) (*Object, error) {
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
raw.Name = name
|
||||
|
||||
obj := &Object{
|
||||
assets: a,
|
||||
@@ -45,6 +49,7 @@ func (o *Object) Image(idx int) (*ebiten.Image, error) {
|
||||
if img := o.images[idx]; img != nil {
|
||||
return img, nil
|
||||
}
|
||||
log.Printf("Loading sprite %v %v", o.raw.Name, idx)
|
||||
|
||||
if o.raw.Sprites[idx] == nil {
|
||||
if err := o.raw.LoadSprite(idx); err != nil {
|
||||
|
Reference in New Issue
Block a user