From 42cd01203d33992f3eacc9e7ed59d32cd212baff Mon Sep 17 00:00:00 2001 From: Sebastian Marketsmueller Date: Fri, 25 Oct 2019 14:45:12 -0700 Subject: [PATCH] fix integer log2 for asmjs --- src/bimg_p.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bimg_p.h b/src/bimg_p.h index a9a4b2a..557bcaa 100644 --- a/src/bimg_p.h +++ b/src/bimg_p.h @@ -48,7 +48,7 @@ namespace bimg if (_hasMips) { const uint32_t max = bx::max(_width, _height, _depth); - const uint32_t num = 1 + uint32_t(bx::log2(float(max) ) ); + const uint32_t num = 1 + uint32_t(bx::log2((int32_t)max) ); return uint8_t(num); }