Introduce indirect file access (simple shim currently, .pak support etc soon)

This commit is contained in:
stevenhowes
2022-03-27 18:16:50 +01:00
parent 5806398bba
commit 094a2e3f64
5 changed files with 31 additions and 16 deletions
+25
View File
@@ -0,0 +1,25 @@
package GoRetro
/*
* --------------------
* File Handler
* --------------------
* All IO should pass through this rather than direct file access to allow
* the use of archive files etc in future.
*/
import "os"
type vFile struct {
Data []byte
Size int
}
func GetFile(filename string) *vFile {
Data, _ := os.ReadFile(Config.DataDir + filename)
vf := vFile{
Size: len(Data),
Data: Data,
}
return &vf
}