diff options
| author | Lizzy Fleckenstein <lizzy@vlhl.dev> | 2026-06-03 02:38:00 +0200 |
|---|---|---|
| committer | Lizzy Fleckenstein <lizzy@vlhl.dev> | 2026-06-03 02:38:05 +0200 |
| commit | 82b298a39feaefb7e32bf4cfee7e2aceba0eadd3 (patch) | |
| tree | d9d5c6ed4e4599ec1a2e7dff90cb14cc12f8c880 | |
| parent | 4a79d7220f753cc9e26a2812da131218b46b6c1c (diff) | |
| download | r6p-82b298a39feaefb7e32bf4cfee7e2aceba0eadd3.tar.xz | |
use luajit compatible bit ops
| -rw-r--r-- | ui.lua | 13 |
1 files changed, 9 insertions, 4 deletions
@@ -1,4 +1,9 @@ -local bit32 = require("bit32") +local ok, bit = pcall(require, "bit") +if not ok then + ok, bit = pcall(require, "bit32") + if not ok then error("no bit library") end +end + local utf8 = require("utf8") local distribute = require("distribute") @@ -255,9 +260,9 @@ end local function color(hex) return { love.math.colorFromBytes( - bit32.band(bit32.rshift(hex, 16), 0xff), - bit32.band(bit32.rshift(hex, 8), 0xff), - bit32.band(bit32.rshift(hex, 0), 0xff) + bit.band(bit.rshift(hex, 16), 0xff), + bit.band(bit.rshift(hex, 8), 0xff), + bit.band(bit.rshift(hex, 0), 0xff) ) } end |
