View Single Post
Old 28 November 2015, 21:40   #89
2 contact me: email only!

Codetapper's Avatar
Join Date: May 2001
Location: Auckland / New Zealand
Posts: 3,099
[QUOTE=Mrs Beanbag;1053312]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.[QUOTE]

But then you'd have to have your engine keep track of which bobs have a different mask between animation frames so as to know which ones don't need saving/restoring?

Originally Posted by Mrs Beanbag View Post
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.
If you then have to keep track of which parts of a tile need redrawing, the added complexity in keeping track of all that will eventually outweigh any savings.

3 bullets that that partially obscure different parts of the same tile will then have 3 operations to restore it!

The engine would get more and more complex with all these special cases and at some point it's simply easier to have one optimised routine that handles everything rather than all this added complexity.

I do agree with you that it depends on the game what you're doing, but a more general approach that works well with almost all games is to save everything behind the bobs, redraw them, and restore them. And depending on the game, you don't need to waste time building up a second "clean" screen to restore the graphics from as you've saved the graphics behind the bobs anyway. If you're saving the equivalent of say 16 tiles worth of graphics behind the bobs, and in return you do not have to waste 40k of chip memory on a spare copy of the screen (to save one blitter operation/bob) and not have to draw the tiles into it, that's a big win.
Codetapper is offline  
Page generated in 0.05255 seconds with 9 queries