diff options
author | Andrei Karas <akaras@inbox.ru> | 2013-09-25 20:32:12 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2013-09-25 20:32:12 +0300 |
commit | 136a97e5cc3499077af7b37ba6cc6a5a00f52e75 (patch) | |
tree | 3b4bd6e67d8fe6b32be986d2bd01b58c94fa9ca7 /src/graphicsmanager.cpp | |
parent | 190d4073c1c2345cc96cece3099a5e58b434ebb7 (diff) | |
download | plus-136a97e5cc3499077af7b37ba6cc6a5a00f52e75.tar.gz plus-136a97e5cc3499077af7b37ba6cc6a5a00f52e75.tar.bz2 plus-136a97e5cc3499077af7b37ba6cc6a5a00f52e75.tar.xz plus-136a97e5cc3499077af7b37ba6cc6a5a00f52e75.zip |
allow use only first video mode on Android.
Diffstat (limited to 'src/graphicsmanager.cpp')
-rw-r--r-- | src/graphicsmanager.cpp | 47 |
1 files changed, 11 insertions, 36 deletions
diff --git a/src/graphicsmanager.cpp b/src/graphicsmanager.cpp index 29e65df1b..cee3e1223 100644 --- a/src/graphicsmanager.cpp +++ b/src/graphicsmanager.cpp @@ -351,44 +351,19 @@ void GraphicsManager::setVideoMode() const bool noFrame = config.getBoolValue("noframe"); #ifdef ANDROID - int width = config.getValue("screenwidth", 0); - int height = config.getValue("screenheight", 0); +// int width = config.getValue("screenwidth", 0); +// int height = config.getValue("screenheight", 0); StringVect videoModes; SDL::getAllVideoModes(videoModes); - if (!videoModes.empty()) - { - bool found(false); - std::string str = strprintf("%dx%d", width, height); - if (width != 0 && height != 0) - { - FOR_EACH (StringVectCIter, it, videoModes) - { - if (str == *it) - { - found = true; - break; - } - } - } - - if (!found) - { - if (width != 0 && height != 0) - { - logger->log("Current resolution %s is incorrect.", - str.c_str()); - } -// str = videoModes[0]; - std::vector<int> res; - splitToIntVector(res, videoModes[0], 'x'); - if (res.size() == 2) - { - width = res[0]; - height = res[1]; - logger->log("Autoselect mode %dx%d", width, height); - } - } - } + if (videoModes.empty()) + logger->error("no video modes detected"); + std::vector<int> res; + splitToIntVector(res, videoModes[0], 'x'); + if (res.size() != 2) + logger->error("no video modes detected"); + + int width = res[0]; + int height = res[1]; #else int width = config.getIntValue("screenwidth"); int height = config.getIntValue("screenheight"); |