From ed3f739fb8a3d510e650e0a2f7ee9e8c1a3908bc Mon Sep 17 00:00:00 2001 From: Alex Yatskov Date: Mon, 21 Jan 2019 19:34:53 -0800 Subject: [PATCH] some more work on loading dcc --- formats/dcc/dcc.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/formats/dcc/dcc.go b/formats/dcc/dcc.go index 83346bc..dbe4bb0 100644 --- a/formats/dcc/dcc.go +++ b/formats/dcc/dcc.go @@ -2,6 +2,7 @@ package dcc import ( "encoding/binary" + "fmt" "io" ) @@ -55,5 +56,14 @@ func NewFromReader(reader io.ReadSeeker) (*Sprite, error) { return nil, err } + dirOffsets := make([]uint32, fileHead.DirCount) + for i := 0; i < int(fileHead.DirCount); i++ { + if err := binary.Read(reader, binary.LittleEndian, &dirOffsets[i]); err != nil { + return nil, err + } + } + + fmt.Printf("%+v\n", fileHead) + fmt.Printf("%+v\n", dirOffsets) return nil, nil }