-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathloading.go
More file actions
30 lines (28 loc) · 765 Bytes
/
Copy pathloading.go
File metadata and controls
30 lines (28 loc) · 765 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
package main
import (
"os"
tafilesread "totala_reader/ta_files_read"
"totala_reader/ta_files_read/texture"
)
func readAllGAFsFromDirectory(directoryName string) []*texture.GafEntry {
pp("Reading all GAF entries from dir %s", directoryName)
var allEntries []*texture.GafEntry
if directoryName[len(directoryName)-1] != "/"[0] {
directoryName += "/"
}
items, _ := os.ReadDir(directoryName)
for _, item := range items {
if item.IsDir() {
// do nothing
} else {
openedFileName := directoryName + item.Name()
r := &tafilesread.Reader{}
r.ReadFromFile(openedFileName)
readedGAFEntries := texture.ReadTextureFromReader(r, false)
for _, e := range readedGAFEntries {
allEntries = append(allEntries, e)
}
}
}
return allEntries
}