small fix to fix some slowdowns
now that hires textures work, optimize the code to avoid performance problems. All the speed lost caused  by the process of searching for custom textures is back again.
implemented mipmap loading from dds files. i strongly recommend that all texture mods pack their textures with internal mipmaps in dds files for maximum performance.