Log In  

At the beginning of their draw cycle some carts use

cls()
rectfill(0,0,127,127,color)

instead of

cls(color)

Is that for performance reasons? Does it perform better if you call rectfill with your background color? Or is it because the color option for cls was introduced in a later version of pico-8?

P#63303 2019-04-07 13:51 ( Edited 2019-04-07 16:10)

Can you qualify most? I’ve reviewed a good deal of carts, and never saw that pattern!

And yeah, totally useless!

P#63305 2019-04-07 16:05

It was undocumented and therefore considered unstable at first. I don't know when exactly that changed, but the wiki wasn't updated until last June.

P#63306 2019-04-07 16:07

It's in Breakout Hero for example (cart #53976). The funny thing is, cls(1) is commented out.

P#63307 2019-04-07 16:09 ( Edited 2020-12-03 09:33)

Cls takes an argument at least since 2016!
I suspect some dev just don’t read the docs ;)

P#63324 2019-04-08 06:49

I'm pretty sure at one point one of the two was significantly faster than the other. However, now they are equal in speed, so if you're clearing the entire screen, it's more efficacious just to call cls().

P#63520 2019-04-14 23:20

[Please log in to post a comment]

Follow Lexaloffle:          
Generated 2024-03-28 11:53:18 | 0.007s | Q:17