summaryrefslogtreecommitdiff
path: root/src/resources/image.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2012-04-07 20:04:31 +0300
committerAndrei Karas <akaras@inbox.ru>2012-04-07 20:04:31 +0300
commit4f73caba4497344c50ea245673493941d277699f (patch)
tree4827cef09b7b67bbe9f9230fe0c8217012adb96a /src/resources/image.cpp
parent8aa59221c316baf989424983d228f3bffd1b7e0a (diff)
downloadplus-4f73caba4497344c50ea245673493941d277699f.tar.gz
plus-4f73caba4497344c50ea245673493941d277699f.tar.bz2
plus-4f73caba4497344c50ea245673493941d277699f.tar.xz
plus-4f73caba4497344c50ea245673493941d277699f.zip
Add option to enable/disable texture blurring. (GL_LINEAR/GL_LINEAR)
Diffstat (limited to 'src/resources/image.cpp')
-rw-r--r--src/resources/image.cpp13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/resources/image.cpp b/src/resources/image.cpp
index c63fcab99..54a969d57 100644
--- a/src/resources/image.cpp
+++ b/src/resources/image.cpp
@@ -45,6 +45,7 @@
int Image::mUseOpenGL = 0;
int Image::mTextureType = 0;
int Image::mTextureSize = 0;
+bool Image::mBlur = true;
#endif
bool Image::mEnableAlphaCache = false;
bool Image::mEnableAlpha = true;
@@ -766,8 +767,16 @@ Image *Image::_GLload(SDL_Surface *tmpImage)
SDL_LockSurface(tmpImage);
glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
- glTexParameteri(mTextureType, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
- glTexParameteri(mTextureType, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
+ if (mBlur)
+ {
+ glTexParameteri(mTextureType, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
+ glTexParameteri(mTextureType, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
+ }
+ else
+ {
+ glTexParameteri(mTextureType, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
+ glTexParameteri(mTextureType, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
+ }
glTexImage2D(mTextureType, 0, 4, tmpImage->w, tmpImage->h,
0, GL_RGBA, GL_UNSIGNED_BYTE, tmpImage->pixels);