texture-atlas mapping

draft&ugly, BUT WORKING mapping with atlas and magic numbers =)