MCPcopy Create free account
hub / github.com/BZFlag-Dev/bzflag / findMatrix

Method findMatrix

src/game/TextureMatrix.cpp:78–99  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

76
77
78int 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
102const TextureMatrix* TextureMatrixManager::getMatrix(int id) const {

Callers 4

parseMaterialsFunction · 0.80
writeToManagerMethod · 0.80
GetTexMatIDMethod · 0.80
getLinkMaterialMethod · 0.80

Calls 3

c_strMethod · 0.80
sizeMethod · 0.45
getNameMethod · 0.45

Tested by

no test coverage detected