switched to yadu debug log

This commit is contained in:
2024-02-13 18:42:13 +01:00
parent c9f8783521
commit 48396e7e0a
11 changed files with 63 additions and 32 deletions

View File

@@ -2,10 +2,10 @@ package assets
import (
"bufio"
"fmt"
_ "image/png"
"io/fs"
"log"
"log/slog"
"openquell/util"
"os"
"path/filepath"
@@ -128,10 +128,11 @@ func LoadLevels(dir string) []RawLevel {
for _, levelfile := range entries {
if levelfile.Type().IsRegular() && strings.Contains(levelfile.Name(), ".lvl") {
path := filepath.Join("assets", dir)
fmt.Printf("LOADING level %s/%s ... ", path, levelfile)
level := ParseRawLevel(path, levelfile)
fmt.Printf("done\n")
levels = append(levels, level)
slog.Debug("loaded level", "path", path, "file", levelfile)
}
}

View File

@@ -2,10 +2,10 @@ package assets
import (
"embed"
"fmt"
"image"
_ "image/png"
"log"
"log/slog"
"os"
"path/filepath"
"strings"
@@ -30,13 +30,8 @@ func LoadImages(dir string) AssetRegistry {
log.Fatalf("failed to read assets dir %s: %s", dir, err)
}
for _, entry := range entries {
fmt.Println(entry.Name())
}
for _, imagefile := range entries {
path := filepath.Join("assets", dir, imagefile.Name())
fmt.Printf("LOADING %s ... ", path)
fd, err := os.Open(path)
if err != nil {
log.Fatalf("failed to open image file %s: %s", imagefile.Name(), err)
@@ -51,7 +46,8 @@ func LoadImages(dir string) AssetRegistry {
}
images[name] = ebiten.NewImageFromImage(img)
fmt.Printf("done\n")
slog.Debug("loaded asset", "path", path)
}
return images