Cache Map / Edge Update ScrollerArchives Forums/BlitzPlus Programming/Cache Map / Edge Update Scroller
| I've added this to the graphics part of the code archives if anyone's interested. If you're doing a scrolling game that uses small tiles (eg, 16x16) or multiple layers of larger tiles (32x32) then you'd do well to check it out as it might save you a helluva' lot of frame time.|
And hopefully it even works! :)
Very nice. Too late as I've used a similar idea in my latest game although using images larger than the screen then clipping. I hope people start using this rather than wasting stacks of processor time drawing all the tiles every frame (even on a static background). Up till now mappy been quite popular which is great for moving screens but is four times slower than my code (and yours) for a static background at 320x240 and seven times at 640x480 on a PII 360 with 16x16 tiles. Don't have the time but it might be worthwhile to interface the code with mappy files.
| Ta', actually I've just updated the code (there were four variables called cmg\ instead of cm_cmg\ - doh!) but I might look at the mappy spec to see if it's easy to adapt. As it is there's only one line in the bit of code which would ever need altering by the user so I imagine it'd be something people could fairly easily do themselves, but thanks for the nice words and I'll look into it! (does Mappy store the parallax relation between each layer of tiles?) |