aboutsummaryrefslogtreecommitdiff
path: root/tools/compile_assets/aseprite/unmarshal.odin
diff options
context:
space:
mode:
Diffstat (limited to 'tools/compile_assets/aseprite/unmarshal.odin')
-rw-r--r--tools/compile_assets/aseprite/unmarshal.odin8
1 files changed, 6 insertions, 2 deletions
diff --git a/tools/compile_assets/aseprite/unmarshal.odin b/tools/compile_assets/aseprite/unmarshal.odin
index 5e5295c..876421e 100644
--- a/tools/compile_assets/aseprite/unmarshal.odin
+++ b/tools/compile_assets/aseprite/unmarshal.odin
@@ -3,12 +3,16 @@ package aseprite_file_handler
import "base:runtime"
import "base:intrinsics"
import "core:io"
-import "core:os"
+import os "core:os/old"
import "core:log"
import "core:bytes"
import "core:bufio"
import "core:mem/virtual"
+Ase_Unmarshal_Error :: union {
+ os.Error,
+ Unmarshal_Error,
+}
unmarshal_from_bytes_buff :: proc(doc: ^Document, r: ^bytes.Reader, alloc: runtime.Allocator = {}) -> (err: Unmarshal_Error) {
rr, ok := io.to_reader(bytes.reader_to_stream(r))
@@ -26,7 +30,7 @@ unmarshal_from_bufio :: proc(doc: ^Document, r: ^bufio.Reader, alloc: runtime.Al
return unmarshal(doc, rr, alloc)
}
-unmarshal_from_filename :: proc(doc: ^Document, name: string, alloc: runtime.Allocator = {}) -> (err: Unmarshal_Error) {
+unmarshal_from_filename :: proc(doc: ^Document, name: string, alloc: runtime.Allocator = {}) -> (err: Ase_Unmarshal_Error) {
fd, fd_err := os.open(name, os.O_RDONLY, 0)
if fd_err != nil {
log.error("Unable to read because of:", fd_err)