Start loading .fnt files. No display yet
This commit is contained in:
@@ -8,6 +8,7 @@ import (
|
||||
"strings"
|
||||
|
||||
"ur.gs/ordoor/internal/data"
|
||||
"ur.gs/ordoor/internal/fonts"
|
||||
"ur.gs/ordoor/internal/maps"
|
||||
"ur.gs/ordoor/internal/menus"
|
||||
"ur.gs/ordoor/internal/sets"
|
||||
@@ -31,6 +32,7 @@ func main() {
|
||||
loadMapsFrom("MultiMaps")
|
||||
loadSets()
|
||||
loadMenus()
|
||||
loadFonts()
|
||||
}
|
||||
|
||||
func loadData() {
|
||||
@@ -38,6 +40,7 @@ func loadData() {
|
||||
accountingPath := filepath.Join(dataPath, "Accounting.dat")
|
||||
genericDataPath := filepath.Join(dataPath, "GenericData.dat")
|
||||
aniObDefPath := filepath.Join(dataPath, "AniObDef.dat")
|
||||
i18nPath := filepath.Join(dataPath, data.I18nFile)
|
||||
|
||||
log.Printf("Loading %s...", accountingPath)
|
||||
accounting, err := data.LoadAccounting(accountingPath)
|
||||
@@ -62,6 +65,14 @@ func loadData() {
|
||||
}
|
||||
|
||||
log.Printf("%s: %+v", genericDataPath, genericData)
|
||||
|
||||
log.Printf("Loading %s...", i18nPath)
|
||||
i18n, err := data.LoadI18n(i18nPath)
|
||||
if err != nil {
|
||||
log.Fatalf("Failed to parse %s: %s", i18nPath, err)
|
||||
}
|
||||
|
||||
log.Printf("%s: len=%v", i18nPath, i18n.Len())
|
||||
}
|
||||
|
||||
func loadObj() {
|
||||
@@ -165,3 +176,16 @@ func displayRecord(record *menus.Record, depth int) {
|
||||
displayRecord(child, depth+1)
|
||||
}
|
||||
}
|
||||
|
||||
func loadFonts() {
|
||||
fontsPath := filepath.Join(*gamePath, "Fonts")
|
||||
|
||||
fonts, err := fonts.LoadFonts(fontsPath)
|
||||
if err != nil {
|
||||
log.Fatalf("Failed to parse %s/*.fnt as fonts: %v", fontsPath, err)
|
||||
}
|
||||
|
||||
for _, font := range fonts {
|
||||
fmt.Printf(" * `%s`: obj=%v entries=%v\n", font.Name, font.ObjectFile, font.Entries())
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user