From e9cbd15db3507b2115220123a602066e12614401 Mon Sep 17 00:00:00 2001 From: deeg05 <45331856+deeg05@users.noreply.github.com> Date: Wed, 10 Feb 2021 18:46:08 +0300 Subject: [PATCH] Update for Lua 5.3 compatibility Lua 5.3 added native support for bitwise operators and deprecated usage of bit32, so I've added support for it --- gml/lib/gfxbuffer.lua | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/gml/lib/gfxbuffer.lua b/gml/lib/gfxbuffer.lua index ae49229..b5d2bb5 100644 --- a/gml/lib/gfxbuffer.lua +++ b/gml/lib/gfxbuffer.lua @@ -9,7 +9,13 @@ local debugPrint=function() end local function convColor_8toh(hex) - local r,g,b=bit32.rshift(hex,16),bit32.rshift(hex,8)%256,hex%256 + local r, g, b + if bit32 + then + r,g,b=bit32.rshift(hex,16),bit32.rshift(hex,8)%256,hex%256 + else + r,g,b=hex>>16,(hex>>8)%256,hex%256 + end r=round(r*7/255) g=round(g*7/255) b=round(b*3/255)