martinpiper / C64Public

All my public C64 stuff
Other
132 stars 25 forks source link

Sprite Multiplexor - Z ordering #10

Closed robin-raymond closed 13 hours ago

robin-raymond commented 2 weeks ago

Does the sprite multiplexor handle Z ordering so the sprites can be layered?

martinpiper commented 2 weeks ago

The sort used in the multiplexor is stable, meaning it will maintain the ordering of elements if they have the same Y position. If that is combined with Multiplex_MaintainPriority=1 then the multiplexor will try its hardest to maintain sprite ordering so they can be layered. The attached example shows the effect. Each moving blob uses two sprites to show their relative sprite priority is maintained. However, if the sprite formation gets very busy, then the sprite ordering is not maintained. TestMultiplexor.zip