Can confirm I just loaded an old game I had somewhere and it appears to work quite well ( I did fork it and made a few changes to get it to build, not sure if it was my clone from git).
I really like the coastline and road stuff! I know that can't have been easy to do. nice
Not sure if you'd considered (and I may be teaching to suck eggs..) but it may be easier to have zoom done by using a camera style system so a:
PointF to represent the worldPos (in the window)
and another float to represent the mapScale
this is from memory but I think its right, making the coords of a tile would be:
stdTileWidth:= 32;
stdTileHeight:= 16;
tileWidth = (int)(stdTileWidth * mapScale);
tileHeight = (int)(stdTileHeight * mapScale);
drawTileAtX = (int)((tileX + worldPos.X) * tileWidth);
drawTileAtY = (int)((tileY + worldPos.Y) * tileHeight);
You could then adjust the zoom by *= 0.05 or whatever to get an incremental zoom using the mouse wheel and get smooth scrolling.. I'm not sure if that'd help or make things more complicated :/
Also I know there's various issues in regards to the draw string methods, TextRenderer vs Drawstring yields different results depending on the context in which it's used..
The way you wrote it sounds about right, the worldPos is the center of the window.
The only difference is I don't draw tiles one by one on the panel but instead make a bitmap of the part of map to be shown and than plop the bitmap on the panel (this is causing some memory leaks but I'll try to deal with it, it won't melt your comp).
I resize and draw the individual tiles more or less the way you wrote it. The formulas may be different but the concept is the same.
The scaling in x is 8 * (8 + zoom) and in y 4 * (8 + zoom) for tiles.
The game actually implements 16 zooms, from -8 (max zoom out) to +7 (max zoom in). Zoom=0 is normal zoom.
At zoom= -8/-7/-6 (the pic I shared in the other post) Reynolds avoided dithering and drawing of coastlines.
At every zoom you have to:
1) resize a tile and draw it
2) implement dithering
3) resize a unit shield and draw it
4) resize a unit and draw it
5) resize a city and draw it
Do this in two for loops (1st loop are rows, 2nd are columns) for each tile using your drawTileAtXY coords.
Once all this is done you draw strings - city Names. These overlap
everything. I use drawString.
Anyways I'm redoing some of the map drawing stuff on my local repo, I'll push it hopefully soon, it's driving me mad.