Revert "Merge pull request #5 from gmarty/clsc"
Pretty much all of this was completely wrong. Changing the clear in flip_screen screws up the black border color Clearing the canvas to a palette color screws up the shaders They expect 0-15, not a palette color ---- Fix cls() not resetting the clip Fix clip not requiring all 4 parameters Clean up clip()
This commit is contained in:
parent
8433b7f56c
commit
36d4a12be9
9
api.lua
9
api.lua
|
@ -47,11 +47,11 @@ function api.camera(x, y)
|
|||
end
|
||||
|
||||
function api.clip(x, y, w, h)
|
||||
if x and x~="" then
|
||||
if x and y and w and h then
|
||||
love.graphics.setScissor(x, y, w, h)
|
||||
pico8.clip={x, y, w, h}
|
||||
else
|
||||
love.graphics.setScissor(0, 0, pico8.resolution[1], pico8.resolution[2])
|
||||
love.graphics.setScissor()
|
||||
pico8.clip=nil
|
||||
end
|
||||
end
|
||||
|
@ -62,8 +62,9 @@ function api.cls(c)
|
|||
c = 0
|
||||
end
|
||||
|
||||
pico8.clsc = pico8.palette[c+1]
|
||||
love.graphics.clear(pico8.clsc)
|
||||
pico8.clip=nil
|
||||
love.graphics.setScissor()
|
||||
love.graphics.clear(c, 0, 0, 255)
|
||||
pico8.cursor={0, 0}
|
||||
end
|
||||
|
||||
|
|
3
main.lua
3
main.lua
|
@ -20,7 +20,6 @@ pico8={
|
|||
{255,119,168,255},
|
||||
{255,204,170,255}
|
||||
},
|
||||
clsc={0, 0, 0, 255},
|
||||
spriteflags={},
|
||||
audio_channels={},
|
||||
sfx={},
|
||||
|
@ -381,7 +380,7 @@ function flip_screen()
|
|||
-- love.graphics.setColor(255, 255, 255, 255)
|
||||
love.graphics.setScissor()
|
||||
|
||||
love.graphics.clear(pico8.clsc)
|
||||
love.graphics.clear()
|
||||
|
||||
local screen_w, screen_h=love.graphics.getDimensions()
|
||||
if screen_w>screen_h then
|
||||
|
|
Loading…
Reference in New Issue