Move rotate/scale code to transform.c and rewrite the logic.
Authored by: utunnels 2011-09-17
Parent: [r3450]
Child: [r3452]