fix accidentally shadowing some log namespaces
This commit is contained in:
parent
a6ee085b1a
commit
eded1071c4
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue