From eded1071c42373ea5fbd7ef4ae53af2c13945524 Mon Sep 17 00:00:00 2001 From: tali Date: Fri, 19 Jan 2024 18:07:36 -0500 Subject: [PATCH] fix accidentally shadowing some log namespaces --- src/s2/texture.ml | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/src/s2/texture.ml b/src/s2/texture.ml index 9e0f60f..8fa242c 100644 --- a/src/s2/texture.ml +++ b/src/s2/texture.ml @@ -1,10 +1,10 @@ open Import -open Renderer +include (val Ohlog.sublogs logger "Texture") -type t = texture +type t = Renderer.texture -let width t = fst t.tsize -let height t = snd t.tsize +let width (t : t) = fst 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 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 src = reshape_3 (genarray_of_array1 data) height (pitch / stride) stride 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 = try @@ -64,14 +64,12 @@ let of_surface_free srf = Sdl.free_surface srf; raise e module Asset = struct - open Asset - let load_texture path = trace (fun m -> m "open image %S" path); try - match Sdl.Image.load (absolute_path path) with + match Sdl.Image.load (Asset.absolute_path path) with | Ok srf -> of_surface_free srf | Error (`Msg msg) -> failwith msg with - Failure msg -> raise (Error (path, msg)) + Failure msg -> raise (Asset.Error (path, msg)) end