SpriteCache fix, Memory templates moved to cpp file