aboutsummaryrefslogtreecommitdiff
path: root/core/image/tga/tga.odin
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2023-03-23 20:42:38 +0000
committergingerBill <bill@gingerbill.org>2023-03-23 20:53:19 +0000
commit90c44c34a9fa7f07c45f7849c32e0058f66772fb (patch)
tree1b6669d0cf7b9dbf5c28b6a953da3aea764d1f19 /core/image/tga/tga.odin
parent909ed93cd3d59b6a086bada5d4bb2c1eba42ff32 (diff)
Make `core:image` packages work on `js` platform (wasm32) by not requiring `core:os`
Diffstat (limited to 'core/image/tga/tga.odin')
-rw-r--r--core/image/tga/tga.odin29
1 files changed, 0 insertions, 29 deletions
diff --git a/core/image/tga/tga.odin b/core/image/tga/tga.odin
index 39c46c7c7..4adf426c7 100644
--- a/core/image/tga/tga.odin
+++ b/core/image/tga/tga.odin
@@ -14,7 +14,6 @@ package tga
import "core:mem"
import "core:image"
import "core:bytes"
-import "core:os"
import "core:compress"
import "core:strings"
@@ -92,20 +91,6 @@ save_to_memory :: proc(output: ^bytes.Buffer, img: ^Image, options := Options{}
return nil
}
-save_to_file :: proc(output: string, img: ^Image, options := Options{}, allocator := context.allocator) -> (err: Error) {
- context.allocator = allocator
-
- out := &bytes.Buffer{}
- defer bytes.buffer_destroy(out)
-
- save_to_memory(out, img, options) or_return
- write_ok := os.write_entire_file(output, out.buf[:])
-
- return nil if write_ok else .Unable_To_Write_File
-}
-
-save :: proc{save_to_memory, save_to_file}
-
load_from_context :: proc(ctx: ^$C, options := Options{}, allocator := context.allocator) -> (img: ^Image, err: Error) {
context.allocator = allocator
options := options
@@ -398,20 +383,6 @@ load_from_bytes :: proc(data: []byte, options := Options{}, allocator := context
return img, err
}
-load_from_file :: proc(filename: string, options := Options{}, allocator := context.allocator) -> (img: ^Image, err: Error) {
- context.allocator = allocator
-
- data, ok := os.read_entire_file(filename)
- defer delete(data)
-
- if ok {
- return load_from_bytes(data, options)
- } else {
- return nil, .Unable_To_Read_File
- }
-}
-
-load :: proc{load_from_file, load_from_bytes, load_from_context}
destroy :: proc(img: ^Image) {
if img == nil || img.width == 0 || img.height == 0 {