remove gratuitous comments and unused view clip
This commit is contained in:
parent
7be4792771
commit
0bf07e1558
34
vacation.p8
34
vacation.p8
@ -40,19 +40,6 @@ function hz(n)
|
|||||||
return t()*2*n&1~=0
|
return t()*2*n&1~=0
|
||||||
end
|
end
|
||||||
|
|
||||||
-- generate standard "overlay"
|
|
||||||
-- constructor for type tt.
|
|
||||||
-- if more is defined, generated
|
|
||||||
-- new calls more(ret) after
|
|
||||||
-- ret is definitely not nil
|
|
||||||
-- before calling setmetatable.
|
|
||||||
-- use to initialize mutables.
|
|
||||||
--
|
|
||||||
-- if there was a previous new,
|
|
||||||
-- it is invoked on the new
|
|
||||||
-- object *after* more, because
|
|
||||||
-- this works better with the
|
|
||||||
-- `more` impls i use.
|
|
||||||
function mknew(tt, more)
|
function mknew(tt, more)
|
||||||
local mt, oldnew={__index=tt},tt.new
|
local mt, oldnew={__index=tt},tt.new
|
||||||
tt.new=function(ret)
|
tt.new=function(ret)
|
||||||
@ -178,20 +165,6 @@ function pukeboard(item)
|
|||||||
puketh(item, "@clip")
|
puketh(item, "@clip")
|
||||||
end
|
end
|
||||||
|
|
||||||
-------------------------------
|
|
||||||
-- view
|
|
||||||
-------------------------------
|
|
||||||
-- composits drawable items.
|
|
||||||
-- add items to .views to
|
|
||||||
-- composit them. x and y are
|
|
||||||
-- relative reverse camera
|
|
||||||
-- offsets. drawable items will
|
|
||||||
-- observe appropriate incoming
|
|
||||||
-- camera and clip state.
|
|
||||||
-- clipping respects existing
|
|
||||||
-- clipping so stacked views
|
|
||||||
-- intersect.
|
|
||||||
-------------------------------
|
|
||||||
view = {
|
view = {
|
||||||
x=0,
|
x=0,
|
||||||
y=0,
|
y=0,
|
||||||
@ -214,16 +187,10 @@ function view:draw()
|
|||||||
local oldcam, oldclip = $0x5f28, $0x5f20
|
local oldcam, oldclip = $0x5f28, $0x5f20
|
||||||
poke2(0x5f28, %0x5f28-self.x)
|
poke2(0x5f28, %0x5f28-self.x)
|
||||||
poke2(0x5f2a, %0x5f2a-self.y)
|
poke2(0x5f2a, %0x5f2a-self.y)
|
||||||
clip(-%0x5f28, -%0x5f2a, self.w, self.h, true)
|
|
||||||
outer_or_each_opt(self.views, "draw")
|
outer_or_each_opt(self.views, "draw")
|
||||||
poke4(0x5f20, oldclip)
|
|
||||||
poke4(0x5f28, oldcam)
|
poke4(0x5f28, oldcam)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- draws opaque rectangles.
|
|
||||||
-- default bg is equivalent to
|
|
||||||
-- clip-aware cls.
|
|
||||||
-- restores prior fill pattern.
|
|
||||||
bg = {
|
bg = {
|
||||||
x=0,y=0,w=128,h=128,fp=0,c=0
|
x=0,y=0,w=128,h=128,fp=0,c=0
|
||||||
}
|
}
|
||||||
@ -322,7 +289,6 @@ end
|
|||||||
-->8
|
-->8
|
||||||
-- text rendering
|
-- text rendering
|
||||||
|
|
||||||
-- text colors for zonk mode:
|
|
||||||
txtbox = {
|
txtbox = {
|
||||||
x=0,
|
x=0,
|
||||||
y=0,
|
y=0,
|
||||||
|
Loading…
Reference in New Issue
Block a user