Fixed an issue where texture state wasn't restored. Thanks to @gabor_papp, @sansumbrella and @batchass for reporting it.
Merge remote-tracking branch 'upstream/master' into scons