mirror of
https://github.com/IllusionMan1212/tinyvg-odin.git
synced 2026-10-24 10:12:38 +00:00
fix compilation for new os package
This commit is contained in:
+3
-3
@@ -1,17 +1,17 @@
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import "core:fmt"
|
import "core:fmt"
|
||||||
import "core:os/os2"
|
import "core:os"
|
||||||
|
|
||||||
import tinyvg "../"
|
import tinyvg "../"
|
||||||
|
|
||||||
main :: proc() {
|
main :: proc() {
|
||||||
if len(os2.args) < 2 {
|
if len(os.args) < 2 {
|
||||||
fmt.println("Provide a path to a tvg file")
|
fmt.println("Provide a path to a tvg file")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
tvg, err := tinyvg.load_from_file(os2.args[1])
|
tvg, err := tinyvg.load_from_file(os.args[1])
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.println(err)
|
fmt.println(err)
|
||||||
}
|
}
|
||||||
|
|||||||
+3
-5
@@ -1,11 +1,9 @@
|
|||||||
package tinyvg
|
package tinyvg
|
||||||
|
|
||||||
import "core:os/os2"
|
import "core:os"
|
||||||
import "core:fmt"
|
import "core:fmt"
|
||||||
import "core:io"
|
import "core:io"
|
||||||
import "core:slice"
|
|
||||||
import "core:bytes"
|
import "core:bytes"
|
||||||
import "core:debug/trace"
|
|
||||||
|
|
||||||
import "base:runtime"
|
import "base:runtime"
|
||||||
|
|
||||||
@@ -252,11 +250,11 @@ TvgError :: enum {
|
|||||||
Error :: union {
|
Error :: union {
|
||||||
TvgError,
|
TvgError,
|
||||||
io.Error,
|
io.Error,
|
||||||
os2.Error,
|
os.Error,
|
||||||
}
|
}
|
||||||
|
|
||||||
load_from_file :: proc(filename: string, allocator := context.allocator) -> (tvg: ^Tvg, err: Error) {
|
load_from_file :: proc(filename: string, allocator := context.allocator) -> (tvg: ^Tvg, err: Error) {
|
||||||
data := os2.read_entire_file(filename, allocator) or_return
|
data := os.read_entire_file(filename, allocator) or_return
|
||||||
defer delete(data, allocator)
|
defer delete(data, allocator)
|
||||||
|
|
||||||
return load_from_bytes(data, allocator)
|
return load_from_bytes(data, allocator)
|
||||||
|
|||||||
Reference in New Issue
Block a user