diff options
Diffstat (limited to 'tools/compile_assets/aseprite')
| -rw-r--r-- | tools/compile_assets/aseprite/marshal.odin | 4 | ||||
| -rw-r--r-- | tools/compile_assets/aseprite/unmarshal.odin | 8 |
2 files changed, 8 insertions, 4 deletions
diff --git a/tools/compile_assets/aseprite/marshal.odin b/tools/compile_assets/aseprite/marshal.odin index 1b56de1..d94c822 100644 --- a/tools/compile_assets/aseprite/marshal.odin +++ b/tools/compile_assets/aseprite/marshal.odin @@ -1,7 +1,7 @@ package aseprite_file_handler import "core:io" -import "core:os" +import os "core:os/old" import "core:log" import "core:bytes" import "core:bufio" @@ -546,4 +546,4 @@ marshal_to_writer :: proc(doc: ^Document, ww: io.Writer, allocator := context.al return file_size, Marshal_Errors.Wrong_Write_Size } return -}
\ No newline at end of file +} 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) |
