Where I can start make some function for rotate building? Please help!!! ??? ??? ???
Wherever you like. You will need to add a variable to Unit indicating rotation, you will need a function to rotate cell maps and lots of code in all sorts of places to check a buildings rotation and use a rotated cell map accordingly. You will need to add code to Gui (and other related classes) to allow the human player to actually rotate a building before they place it, and you will need to add code to the Renderer to check rotation and rotate the model before drawing.
In short, you will first need to know how the Engine currently does what it does... that will take a while.
why cant you just do what "Spring" does? when you press the [] buttons, the buildings rotate (but only at 90 degree angles)
Something like this is in the works for the coders. The problem is that it is seemingly at the end of a very long queue line.
I need(ed) it for shipyards, but the problem I think Hailstone was alluding to with Tiles Vs Cells means it would be pointless to continue at this time. Height data is only stored on a per tile basis, so 'flattening' terrain for a shipyard can not be done without the very real possibility of such flattening either raising the cells where a shipyard would have been able to spawn ships, such that it can't, or lowering cells that the shipyard unit xml says should be on land to the point that it is below water.
For the record, it will work as it apparently does in spring, rotations of 90 degrees only. But it is unlikely to happen until a new map format is introduced... or significant work is done to support it with the current format (which I'm not willing to do, so a new map format would seem to be a pre-requisite).