Sunday, 27 May 2012

Blitting vs hardware sprites

Blitting is agnate to hardware-sprite drawing, in that both systems carbon a pattern, about a aboveboard area, at altered locations on the screen. Hardware sprites accept the advantage of getting stored in abstracted memory, and accordingly don't afflict the capital affectation memory. This allows them to be confused about the display, accoutrement the "background", with no aftereffect on it.

Blitting moves the aforementioned types of patterns about the screen, but does so by autograph into the aforementioned anamnesis as the blow of the display. This agency every time the arrangement is placed on the screen, the affectation "under" it is overwritten, or "damaged". It is up to the software to apple-pie this accident up by blitting twice, already to abolish the damage, and afresh again to abode the bit in its new location. However, there are several means to optimize this. If ample areas of the awning are taken over by the patterns, it may be added able to blit the accomplishments to the awning instead of abatement anniversary arrangement individually. A aberration involves adding the awning into segments and abatement alone the segments area patterns accept been fatigued on. This address is accepted as bedraggled rectangles.

As one ability imagine, this makes blitting decidedly slower than sprite manipulation. However blitting has one actual big advantage: there's no concrete absolute to the amount of patterns you can blit, or to the admeasurement of the patterns. Thus you can use blitting to affectation annihilation on the screen, including assuming sprites (through the double-write arrangement acclaimed above), or even text.

No comments:

Post a Comment