Skip to content

Commit 84c741b

Browse files
committed
Add auto-register for BMP loader.
1 parent 7534474 commit 84c741b

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

core/image/bmp/bmp.odin

+7-7
Original file line numberDiff line numberDiff line change
@@ -632,15 +632,10 @@ skip_space :: proc(ctx: ^$C, bytes_to_skip: int) -> (err: Error) {
632632
return
633633
}
634634

635-
/*
636-
Cleanup of image-specific data.
637-
*/
635+
// Cleanup of image-specific data.
638636
destroy :: proc(img: ^Image) {
639637
if img == nil {
640-
/*
641-
Nothing to do.
642-
Load must've returned with an error.
643-
*/
638+
// Nothing to do. Load must've returned with an error.
644639
return
645640
}
646641

@@ -649,4 +644,9 @@ destroy :: proc(img: ^Image) {
649644
free(v)
650645
}
651646
free(img)
647+
}
648+
649+
@(init, private)
650+
_register :: proc() {
651+
image.register(.BMP, load_from_bytes, destroy)
652652
}

0 commit comments

Comments
 (0)