add palette cycling. fix cursor stuff.
This commit is contained in:
parent
e151e4b6c6
commit
a64931885d
@ -32,11 +32,15 @@ function _init()
|
|||||||
plane_mask = 0xff
|
plane_mask = 0xff
|
||||||
|
|
||||||
-- see tab 5 for palettes
|
-- see tab 5 for palettes
|
||||||
pal(palettes.additive,1)
|
pal_idx = 1
|
||||||
|
pal(palettes[palette_cycle[pal_idx]],1)
|
||||||
end
|
end
|
||||||
|
|
||||||
function _update60()
|
function _update60()
|
||||||
restore_under_cursor()
|
restore_under_cursor()
|
||||||
|
|
||||||
|
if (btnp(❎)) next_pal()
|
||||||
|
|
||||||
if stat(34) & 0x1 == 0 then
|
if stat(34) & 0x1 == 0 then
|
||||||
-- mouse up
|
-- mouse up
|
||||||
was_click = false
|
was_click = false
|
||||||
@ -170,6 +174,7 @@ end
|
|||||||
-- draw_cursor
|
-- draw_cursor
|
||||||
|
|
||||||
function draw_cursor()
|
function draw_cursor()
|
||||||
|
poke(0x5f5e,0xff)
|
||||||
cx, cy = stat(32), stat(33)
|
cx, cy = stat(32), stat(33)
|
||||||
|
|
||||||
-- save blob under cursor to
|
-- save blob under cursor to
|
||||||
@ -187,6 +192,7 @@ end
|
|||||||
|
|
||||||
function restore_under_cursor()
|
function restore_under_cursor()
|
||||||
palt(0, false)
|
palt(0, false)
|
||||||
|
poke(0x5f5e,0xff)
|
||||||
sspr(120, 24, 8, 8, cx, cy)
|
sspr(120, 24, 8, 8, cx, cy)
|
||||||
palt(0, true)
|
palt(0, true)
|
||||||
end
|
end
|
||||||
@ -194,8 +200,8 @@ end
|
|||||||
-- future ambitions
|
-- future ambitions
|
||||||
|
|
||||||
-- palette selection ui
|
-- palette selection ui
|
||||||
-- ...from a preset list
|
-- [x] ...from a preset list
|
||||||
-- ...freely
|
-- [ ] ...freely
|
||||||
-->8
|
-->8
|
||||||
-- palettes
|
-- palettes
|
||||||
|
|
||||||
@ -205,6 +211,22 @@ palettes = {
|
|||||||
additive = {[0]=0,136,3,4,1,141,13,5,6,8,139,10,140,14,12,7},
|
additive = {[0]=0,136,3,4,1,141,13,5,6,8,139,10,140,14,12,7},
|
||||||
subtractive = {[0]=7,12,14,1,10,11,136,5,6,140,130,129,132,131,2,0},
|
subtractive = {[0]=7,12,14,1,10,11,136,5,6,140,130,129,132,131,2,0},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
palette_cycle = {"additive", "subtractive", "classic", "alt"}
|
||||||
|
|
||||||
|
function draw_color_blocks()
|
||||||
|
for i=0,15 do
|
||||||
|
local x0 = 8*i
|
||||||
|
rectfill(x0, 0, x0+7, 7, i)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function next_pal()
|
||||||
|
pal_idx += 1
|
||||||
|
if (pal_idx > #palette_cycle) pal_idx = 1
|
||||||
|
pal(palettes[palette_cycle[pal_idx]], 1)
|
||||||
|
draw_color_blocks()
|
||||||
|
end
|
||||||
__gfx__
|
__gfx__
|
||||||
00000000500000005000000050000000500000005000000050000000500000005000000000000000000000000000000000000000000000000000000000000000
|
00000000500000005000000050000000500000005000000050000000500000005000000000000000000000000000000000000000000000000000000000000000
|
||||||
00000000550000005500000055000000550000005500000055000000550000005500000000000000000000000000000000000000000000000000000000000000
|
00000000550000005500000055000000550000005500000055000000550000005500000000000000000000000000000000000000000000000000000000000000
|
||||||
|
Loading…
Reference in New Issue
Block a user