fix accidentally shadowing some log namespaces

This commit is contained in:
tali 2024-01-19 18:07:36 -05:00
parent a6ee085b1a
commit eded1071c4
1 changed files with 7 additions and 9 deletions

View File

@ -1,10 +1,10 @@
open Import open Import
open Renderer include (val Ohlog.sublogs logger "Texture")
type t = texture type t = Renderer.texture
let width t = fst t.tsize let width (t : t) = fst t.tsize
let height t = snd t.tsize let height (t : t) = snd t.tsize
let conv_alpha_premultiply ofs_r ofs_g ofs_b ofs_a src width height = let conv_alpha_premultiply ofs_r ofs_g ofs_b ofs_a src width height =
let dst = Array3.create Float32 C_layout height width 4 in let dst = Array3.create Float32 C_layout height width 4 in
@ -54,7 +54,7 @@ let of_surface srf =
let data = Sdl.get_surface_pixels srf Int8_unsigned in let data = Sdl.get_surface_pixels srf Int8_unsigned in
let src = reshape_3 (genarray_of_array1 data) height (pitch / stride) stride in let src = reshape_3 (genarray_of_array1 data) height (pitch / stride) stride in
let dst, fmt = conv src width height in let dst, fmt = conv src width height in
make_texture width height fmt dst Renderer.make_texture width height fmt dst
let of_surface_free srf = let of_surface_free srf =
try try
@ -64,14 +64,12 @@ let of_surface_free srf =
Sdl.free_surface srf; raise e Sdl.free_surface srf; raise e
module Asset = struct module Asset = struct
open Asset
let load_texture path = let load_texture path =
trace (fun m -> m "open image %S" path); trace (fun m -> m "open image %S" path);
try try
match Sdl.Image.load (absolute_path path) with match Sdl.Image.load (Asset.absolute_path path) with
| Ok srf -> of_surface_free srf | Ok srf -> of_surface_free srf
| Error (`Msg msg) -> failwith msg | Error (`Msg msg) -> failwith msg
with with
Failure msg -> raise (Error (path, msg)) Failure msg -> raise (Asset.Error (path, msg))
end end