Rewrote texture classes. Possibly only a temporary solution.