| 89 | } |
| 90 | |
| 91 | void Model::setLook(int index) { |
| 92 | if (_looks.empty()) return; |
| 93 | if (index < Look::None || index >= s_cast<int>(_looks.size())) { |
| 94 | if (_looks.empty() && Look::None < index && _currentLook == Look::None) { |
| 95 | _currentLook = index; |
| 96 | } |
| 97 | return; |
| 98 | } |
| 99 | if (_currentLook != index) { |
| 100 | if (_currentLook != Look::None) { |
| 101 | _looks[_currentLook]->unApply(); |
| 102 | } |
| 103 | _currentLook = index; |
| 104 | if (_currentLook != Look::None) { |
| 105 | _looks[_currentLook]->apply(); |
| 106 | } |
| 107 | } |
| 108 | } |
| 109 | |
| 110 | void Model::setLook(String name) { |
| 111 | int index = _modelDef->getLookIndexByName(name); |
no test coverage detected