From dc5faea665d76f5b51fa6437a73602084cb4008a Mon Sep 17 00:00:00 2001 From: ennewalker Date: Tue, 18 Aug 2009 13:53:14 +0000 Subject: Fixing blurriness on some tiles textures. This may fix the related issue on SF. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@10569 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/tilereg.cc | 5 +++-- crawl-ref/source/tilereg.h | 2 +- crawl-ref/source/tilesdl.cc | 6 +++++- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/crawl-ref/source/tilereg.cc b/crawl-ref/source/tilereg.cc index 7e559d1b79..aa4bed5b7c 100644 --- a/crawl-ref/source/tilereg.cc +++ b/crawl-ref/source/tilereg.cc @@ -3618,9 +3618,10 @@ ImageManager::~ImageManager() unload_textures(); } -bool ImageManager::load_textures() +bool ImageManager::load_textures(bool need_mips) { - GenericTexture::MipMapOptions mip = GenericTexture::MIPMAP_CREATE; + GenericTexture::MipMapOptions mip = need_mips ? + GenericTexture::MIPMAP_CREATE : GenericTexture::MIPMAP_NONE; if (!m_textures[TEX_DUNGEON].load_texture("dngn.png", mip)) return (false); diff --git a/crawl-ref/source/tilereg.h b/crawl-ref/source/tilereg.h index 3ea855a493..92eacc40eb 100644 --- a/crawl-ref/source/tilereg.h +++ b/crawl-ref/source/tilereg.h @@ -25,7 +25,7 @@ public: ImageManager(); virtual ~ImageManager(); - bool load_textures(); + bool load_textures(bool need_mips); bool load_item_texture(); void unload_textures(); diff --git a/crawl-ref/source/tilesdl.cc b/crawl-ref/source/tilesdl.cc index f49bc3e48a..6f12ddb31b 100644 --- a/crawl-ref/source/tilesdl.cc +++ b/crawl-ref/source/tilesdl.cc @@ -313,7 +313,11 @@ bool TilesFramework::initialise() return (false); } - if (!m_image.load_textures()) + // If the window size is less than the view height, the textures will + // have to be shrunk. If this isn't the case, then don't create mipmaps, + // as this appears to make things blurry on some users machines. + bool need_mips = (m_windowsz.y < 32 * VIEW_MIN_HEIGHT); + if (!m_image.load_textures(need_mips)) return (false); calculate_default_options(); -- cgit v1.2.3-54-g00ecf