Original Post
I am working on some optimizations for my tile based engine. This is my first engine so the road has been rough, but so far I am very happy with what I''ve put together. I have a couple questions for you tile engine veterans.
1. My engine supports 3 layers of tiles - ground, objects, and decals. Currently Render() goes through the visible area and blt''s the correct number of tiles to each map point. Example: Tile 10x10 has 3 tiles, and tile 10x11 has just 1. Render() comes through and draws 3 tiles at 10x10 and then moves over 32 pixels to 10x11 and then draws 1 tile, etc. Would it be faster to draw the whole layer at one time rather than cycling through the tiles to be drawn for each point?
2. Do long names produce additional overhead? Example:
World[iY][iX].iTileIndex[TEntries[iIndex].iLayer]
versus
int iLayer = TEntries[iIndex].iLayer;
World[iY][iX].iTileIndex[iLayer];
Certainly the second one is more readable, but is there any difference performance wise? Thanks!!