Changed connected texture generation method for efficiency; added a
temporary measure to generate the texture IDs in code rather than using
constants.  This will be removed once we have fancy connected textures
and replaced with constants.