added comments

This commit is contained in:
Doc
2025-08-18 12:48:48 +02:00
parent 2af5bd222e
commit bb9a47cd6d
2 changed files with 19 additions and 0 deletions

11
main.go
View File

@@ -1,6 +1,7 @@
package main
import (
"bspviz/internal/mapfmt"
"bspviz/internal/wad"
"flag"
"fmt"
@@ -48,6 +49,7 @@ func main() {
}
fmt.Printf("Map %s: Directory [%d, %d)\n", strings.ToUpper(*mapMarker), start, end)
//info über die daten in WAD
if *info {
lumps, err := w.LoadMapLumps(*mapMarker, "VERTEXES", "LINEDEFS")
if err != nil {
@@ -55,12 +57,20 @@ func main() {
}
vb := lumps["VERTEXES"]
lb := lumps["LINEDEFS"]
m, err := mapfmt.LoadMap(lumps)
if err != nil {
log.Fatal(err)
}
verts := len(vb) / 4
lines := len(lb) / 14
fmt.Printf("VERTEXES: bytes=%d count=%d\n", len(vb), verts)
fmt.Printf("LINEDEFS: bytes=%d count=%d\n", len(lb), lines)
fmt.Printf("Map has %d vertices and %d linedefs\n", len(m.Vertices), len(m.Linedefs))
fmt.Printf("First vertex: %+v\n", m.Vertices[0])
fmt.Printf("First linedef: %+v\n", m.Linedefs[0])
if len(vb)%4 != 0 {
fmt.Println("WARN: VERTEXES size ist kein Vielfaches von 4 → Format prüfen")
}
@@ -69,6 +79,7 @@ func main() {
}
}
// Generiert einzelne Lump Dateien zum Debugen
if *extract != "" {
want := strings.Split(*extract, ",")
for i := range want {