Log In  

According to the documentation, all of PICO-8's drawing operations are subject to the draw state, however, the 'sset' called without it's third color parameter differs from 'pset' in that it does not respect the draw state.

Reproduce

function validate()
 -- reset the draw state
 clip()
 camera()
 pal()
 color(6)

 -- set the corner pixel of both sprite and screen
 pset(0,0)
 sset(0,0)

 assert(pget(0,0)==6,"screen color does not respect draw state")
 assert(sget(0,0)==6,"sprite color does not respect draw state")
end

validate()

Observed
Excluding the c param of sset always writes 0

Expected
Excluding the c param of sset should mirror pset and write with color/pal awareness, documentation should reflect this

Alternatively
The documentation should be updated that sset completely ignores draw state.

An additional concern is pset respects the camera and clip states as well, which would be undesirable to bring in line with sset as it would likely break compatibility and not be intuitive- however currently sset's two parameter version is effectively broken and correcting it to be in line with pset shouldn't break existing carts.

P#74424 2020-04-02 14:47

2

Thanks @Texel, I've given sset the draw state colour when called with 2 parameters. Aside from having a sensible default colour, I think sset and pset have quite different meanings / expectations, and it's reasonable for them to diverge in behaviour otherwise.

P#74427 2020-04-02 17:52

[Please log in to post a comment]