| 76 | |
| 77 | |
| 78 | int TextureMatrixManager::findMatrix(const std::string& texmat) const { |
| 79 | if (texmat.size() <= 0) { |
| 80 | return -1; |
| 81 | } |
| 82 | else if ((texmat[0] >= '0') && (texmat[0] <= '9')) { |
| 83 | int index = atoi(texmat.c_str()); |
| 84 | if ((index < 0) || (index >= (int)matrices.size())) { |
| 85 | return -1; |
| 86 | } |
| 87 | else { |
| 88 | return index; |
| 89 | } |
| 90 | } |
| 91 | else { |
| 92 | for (int i = 0; i < (int)matrices.size(); i++) { |
| 93 | if (matrices[i]->getName() == texmat) { |
| 94 | return i; |
| 95 | } |
| 96 | } |
| 97 | return -1; |
| 98 | } |
| 99 | } |
| 100 | |
| 101 | |
| 102 | const TextureMatrix* TextureMatrixManager::getMatrix(int id) const { |
no test coverage detected