diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-05-25 17:50:46 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-05-25 17:50:46 +0300 |
commit | 8e6ab562dd62383d191806e88548e89b4d0a9d65 (patch) | |
tree | 36fa576cdb6ff9aa950ec04165eab095f794f385 /src/resources/atlasmanager.cpp | |
parent | e195e09e86d18c45676431813f98c56d85cc8201 (diff) | |
download | plus-8e6ab562dd62383d191806e88548e89b4d0a9d65.tar.gz plus-8e6ab562dd62383d191806e88548e89b4d0a9d65.tar.bz2 plus-8e6ab562dd62383d191806e88548e89b4d0a9d65.tar.xz plus-8e6ab562dd62383d191806e88548e89b4d0a9d65.zip |
Add support for simple texture size detection.
This test check from 1024 to max texture size reported by driver.
Diffstat (limited to 'src/resources/atlasmanager.cpp')
-rw-r--r-- | src/resources/atlasmanager.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/resources/atlasmanager.cpp b/src/resources/atlasmanager.cpp index 49607786e..c60d6465d 100644 --- a/src/resources/atlasmanager.cpp +++ b/src/resources/atlasmanager.cpp @@ -24,6 +24,8 @@ #include "resources/atlasmanager.h" +#include "configuration.h" + #include "render/surfacegraphics.h" #include "utils/mathutils.h" @@ -53,7 +55,10 @@ AtlasResource *AtlasManager::loadTextureAtlas(const std::string &name, AtlasResource *resource = new AtlasResource; loadImages(files, images); - const int maxSize = OpenGLImageHelper::getTextureSize(); + int maxSize = OpenGLImageHelper::getTextureSize(); + const int sz = config.getIntValue("textureSize"); + if (maxSize > sz) + maxSize = sz; // sorting images on atlases. simpleSort(name, atlases, images, maxSize); |