The Mage2D engine rewritten in C++