1
0
mirror of https://github.com/20kdc/OC-KittenOS.git synced 2024-12-25 10:28:06 +11:00

Replace app-klogo with a more general app-bmpview

This commit is contained in:
20kdc 2018-07-25 23:43:29 +01:00
parent b320dfe083
commit 76448b8187
4 changed files with 16 additions and 19 deletions

View File

@ -110,31 +110,29 @@ return {
"apps/app-taskmgr.lua"
}
},
["app-klogo"] = {
desc = "KittenOS NEO Logo shower",
v = 2,
["app-bmpview"] = {
desc = "KittenOS NEO .bmp viewer",
v = 5,
deps = {
"neo",
"app-klogo-logo"
},
dirs = {
"apps"
},
files = {
"apps/app-klogo.lua",
"apps/app-bmpview.lua",
},
},
["app-klogo-logo"] = {
["neo-logo"] = {
desc = "KittenOS NEO Logo (data)",
v = 5,
deps = {
},
dirs = {
"data",
"data/app-klogo"
"doc"
},
files = {
"data/app-klogo/logo.bmp"
"doc/logo.bmp"
},
},
["app-flash"] = {
@ -179,7 +177,7 @@ return {
},
["neo-meta"] = {
desc = "KittenOS NEO: Use 'All' to install to other disks",
v = 2,
v = 5,
deps = {
"neo",
"neo-init",
@ -188,7 +186,8 @@ return {
"neo-icecap",
"neo-secpolicy",
"neo-coreapps",
"app-klogo",
"neo-logo",
"app-bmpview",
"app-flash",
"app-claw",
"app-wget"

View File

@ -5,8 +5,7 @@ local event = require("event")(neo)
local neoux = require("neoux")(event, neo)
local braille = require("braille")
local bmp = require("bmp")
local icecap = neo.requireAccess("x.neo.pub.base", "loadimg")
local file = icecap.open("/logo.bmp", false)
local file = neoux.fileDialog(false)
local header = file.read(bmp.headerMinSzBMP)
local palette = ""
@ -61,9 +60,6 @@ lcWidth = bitmap.dsSpan
local running = true
local function decodeRGB(rgb, igp, col)
if igp and bitmap.bpp > 24 then
rgb = math.floor(rgb / 256)
end
local r, g, b = math.floor(rgb / 65536) % 256, math.floor(rgb / 256) % 256, rgb % 256
-- the new KittenOS NEO logo is 'sensitive' to dithering, so disable it
if not col then
@ -82,6 +78,8 @@ local fp = neoux.tcwindow(bW, bH, {
braille.new(1, 1, bW, bH, {
selectable = true,
get = function (window, x, y, bg, fg, selected, colour)
if x > bitmap.width then return 0, 0, 0 end
if y > bitmap.height then return 0, 0, 0 end
if bitmap.ignoresPalette then
return decodeRGB(bitmap.getPixel(x - 1, y - 1, 0), true, colour)
end
@ -95,9 +93,9 @@ end, 0xFFFFFF, 0)
neoux.create(bW, bH, nil, function (w, t, r, ...)
if t == "focus" then
if r then
if r and not bitmap.ignoresPalette then
local pal = {}
for i = 0, 15 do
for i = 0, math.min(15, bitmap.paletteCol - 1) do
pal[i + 1] = bitmap.getPalette(i)
end
w.recommendPalette(pal)

View File

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

View File

@ -3,7 +3,7 @@
# This is released into the public domain.
# No warranty is provided, implied or otherwise.
cp ocemu.cfg.default ocemu.cfg && rm -rf c1-sda c1-sdb tmpfs
cp ocemu.cfg.default ocemu.cfg && rm -rf c1-sda c1-sdb
mkdir c1-sda c1-sdb
echo -n c1-sda > c1-eeprom/data.bin
cd ..