Better logging
This commit is contained in:
@@ -1,8 +1,10 @@
|
|||||||
package assetstore
|
package assetstore
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/hajimehoshi/ebiten"
|
|
||||||
"image"
|
"image"
|
||||||
|
"log"
|
||||||
|
|
||||||
|
"github.com/hajimehoshi/ebiten"
|
||||||
|
|
||||||
"code.ur.gs/lupine/ordoor/internal/maps"
|
"code.ur.gs/lupine/ordoor/internal/maps"
|
||||||
)
|
)
|
||||||
@@ -22,6 +24,7 @@ func (a *AssetStore) Map(name string) (*Map, error) {
|
|||||||
if m, ok := a.maps[name]; ok {
|
if m, ok := a.maps[name]; ok {
|
||||||
return m, nil
|
return m, nil
|
||||||
}
|
}
|
||||||
|
log.Printf("Loading map %v", name)
|
||||||
|
|
||||||
mapFile, err := a.lookup(name, "map", "Maps", "MultiMaps")
|
mapFile, err := a.lookup(name, "map", "Maps", "MultiMaps")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -67,7 +70,7 @@ func (m *Map) ImagesForCell(x, y, z int) ([]*ebiten.Image, error) {
|
|||||||
cell := m.raw.At(x, y, z)
|
cell := m.raw.At(x, y, z)
|
||||||
images := make([]*ebiten.Image, 0, 4)
|
images := make([]*ebiten.Image, 0, 4)
|
||||||
|
|
||||||
for _, ref := range []maps.ObjRef{cell.Surface, cell.Center, cell.Left, cell.Right} {
|
for _, ref := range []maps.ObjRef{cell.Surface, cell.Right, cell.Left, cell.Center} {
|
||||||
if !ref.IsActive() {
|
if !ref.IsActive() {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
@@ -1,6 +1,8 @@
|
|||||||
package assetstore
|
package assetstore
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"log"
|
||||||
|
|
||||||
"github.com/hajimehoshi/ebiten"
|
"github.com/hajimehoshi/ebiten"
|
||||||
|
|
||||||
"code.ur.gs/lupine/ordoor/internal/data"
|
"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 {
|
if obj, ok := a.objs[name]; ok {
|
||||||
return obj, nil
|
return obj, nil
|
||||||
}
|
}
|
||||||
|
log.Printf("Loading object %v", name)
|
||||||
|
|
||||||
filename, err := a.lookup(name, "obj", "Obj")
|
filename, err := a.lookup(name, "obj", "Obj")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -29,6 +32,7 @@ func (a *AssetStore) Object(name string) (*Object, error) {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
raw.Name = name
|
||||||
|
|
||||||
obj := &Object{
|
obj := &Object{
|
||||||
assets: a,
|
assets: a,
|
||||||
@@ -45,6 +49,7 @@ func (o *Object) Image(idx int) (*ebiten.Image, error) {
|
|||||||
if img := o.images[idx]; img != nil {
|
if img := o.images[idx]; img != nil {
|
||||||
return img, nil
|
return img, nil
|
||||||
}
|
}
|
||||||
|
log.Printf("Loading sprite %v %v", o.raw.Name, idx)
|
||||||
|
|
||||||
if o.raw.Sprites[idx] == nil {
|
if o.raw.Sprites[idx] == nil {
|
||||||
if err := o.raw.LoadSprite(idx); err != nil {
|
if err := o.raw.LoadSprite(idx); err != nil {
|
||||||
|
@@ -2,6 +2,7 @@ package assetstore
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"errors"
|
"errors"
|
||||||
|
"log"
|
||||||
|
|
||||||
"code.ur.gs/lupine/ordoor/internal/sets"
|
"code.ur.gs/lupine/ordoor/internal/sets"
|
||||||
)
|
)
|
||||||
@@ -29,6 +30,7 @@ func (a *AssetStore) Set(name string) (*Set, error) {
|
|||||||
if set, ok := a.sets[name]; ok {
|
if set, ok := a.sets[name]; ok {
|
||||||
return set, nil
|
return set, nil
|
||||||
}
|
}
|
||||||
|
log.Printf("Loading set %v", name)
|
||||||
|
|
||||||
filename, err := a.lookup(name, "set", "Sets")
|
filename, err := a.lookup(name, "set", "Sets")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
Reference in New Issue
Block a user