mirror of
https://github.com/20kdc/OC-KittenOS.git
synced 2024-12-27 03:18:06 +11:00
Apparently the previous commit was not enough to sate BMP's hunger for my mind
Take this offering BMP gods, with alpha "support"
This commit is contained in:
parent
a837148c3b
commit
9caf0115d2
@ -60,7 +60,10 @@ lcWidth = bitmap.dsSpan
|
||||
|
||||
local running = true
|
||||
|
||||
local function decodeRGB(rgb)
|
||||
local function decodeRGB(rgb, igp)
|
||||
if igp and bitmap.bpp > 24 then
|
||||
rgb = math.floor(rgb / 256)
|
||||
end
|
||||
return math.floor(rgb / 65536) % 256, math.floor(rgb / 256) % 256, rgb % 256
|
||||
end
|
||||
|
||||
@ -70,9 +73,9 @@ neoux.create(bW, bH, nil, neoux.tcwindow(bW, bH, {
|
||||
selectable = true,
|
||||
get = function (window, x, y, bg, fg, selected, colour)
|
||||
if bitmap.ignoresPalette then
|
||||
return decodeRGB(bitmap.getPixel(x - 1, y - 1, 0))
|
||||
return decodeRGB(bitmap.getPixel(x - 1, y - 1, 0), true)
|
||||
end
|
||||
return decodeRGB(bitmap.getPalette(bitmap.getPixel(x - 1, y - 1, 0)))
|
||||
return decodeRGB(bitmap.getPalette(bitmap.getPixel(x - 1, y - 1, 0)), false)
|
||||
end
|
||||
}, 1)
|
||||
}, function (w)
|
||||
|
Loading…
Reference in New Issue
Block a user