bool ShaderDetailManager::changeLevel(float level) { // retrieve the current shader level in case an external change was made. const std::map<ShaderManager::GraphicsLevel, std::string>& schemes = mShaderManager.getGraphicsScheme(); if (!schemes.empty()) { std::map<ShaderManager::GraphicsLevel, std::string>::const_iterator currentLevel = schemes.find(mShaderManager.getGraphicsLevel()); if (currentLevel != schemes.end()) { mShaderLevel = currentLevel->second; } else { mShaderLevel = schemes.rbegin()->second; } } else { S_LOG_INFO("ShaderDetailManager: Shader schemes are empty"); } if (std::abs(level) < mShaderThresholdLevel) { return false; } else { bool changeMade = false; if (level > 1.0f) { changeMade |= stepDownShaderLevel(); } else { changeMade |= stepUpShaderLevel(); } return changeMade; } }
bool ShaderDetailManager::changeLevel(float level) { if (std::abs(level) < mShaderThresholdLevel) { return false; } else { if (level > 1.0f) { return stepDownShaderLevel(); } else { return stepUpShaderLevel(); } } }