View Single Post
Old 28 November 2015, 20:44   #88
Mrs Beanbag
Glastonbridge Software
Mrs Beanbag's Avatar
Join Date: Jan 2012
Location: Edinburgh/Scotland
Posts: 2,202
Originally Posted by Codetapper View Post
Consider the situation of a background tilemap, with 10 enemies that hardly move/animate, and say a bullet (with higher priority) passing over them. If you restore from tiles, you have to restore the background, then paste down the enemies, then the new bullet, when really only the graphics behind the bullet need to be replaced.
So what you suggest, is you save the background and then draw, for each individual bob, rather than do all the saving, then do all the drawing... well, if a bob doesn't move (or if it animates but its mask doesn't change) we need not redraw its background at all anyway, but we do still need to redraw the bob itself. The best technique obviously depends on use case. Do you have a lot of bobs that don't move very often? If there are only a few, then 2 drawing operations instead of 3 still seems worthwhile.

Also the tile method can be extremely wasteful. If you have a small bullet (say 8 pixels wide by 2 high), that could potentially be covering 4 different tiles (and doesn't Mr Beanbag use massive 32x32 tiles?). That's a hell of a lot of blitter use just to move a tiny bullet.
It is possible to blit just part of a tile. There is no need to redraw an entire tile just because one corner of it got covered up. Using bigger tiles means a tile-boundary span happens less often for small objects.
Mrs Beanbag is offline  
Page generated in 0.03913 seconds with 10 queries