| 38 | |
| 39 | |
| 40 | bool CustomTextureMatrix::read(const char* cmd, std::istream& input) { |
| 41 | if (strcasecmp("fixedshift", cmd) == 0) { |
| 42 | float u, v; |
| 43 | if (!(input >> u >> v)) { |
| 44 | return false; |
| 45 | } |
| 46 | texmat->setStaticShift(u, v); |
| 47 | } |
| 48 | else if (strcasecmp("fixedscale", cmd) == 0) { |
| 49 | float u, v; |
| 50 | if (!(input >> u >> v)) { |
| 51 | return false; |
| 52 | } |
| 53 | texmat->setStaticScale(u, v); |
| 54 | } |
| 55 | else if (strcasecmp("fixedspin", cmd) == 0) { |
| 56 | float angle; |
| 57 | if (!(input >> angle)) { |
| 58 | return false; |
| 59 | } |
| 60 | texmat->setStaticSpin(angle); |
| 61 | } |
| 62 | else if (strcasecmp("fixedcenter", cmd) == 0) { |
| 63 | float u, v; |
| 64 | if (!(input >> u >> v)) { |
| 65 | return false; |
| 66 | } |
| 67 | texmat->setStaticCenter(u, v); |
| 68 | } |
| 69 | else if (strcasecmp("shift", cmd) == 0) { |
| 70 | float uFreq, vFreq; |
| 71 | if (!(input >> uFreq >> vFreq)) { |
| 72 | return false; |
| 73 | } |
| 74 | texmat->setDynamicShift(uFreq, vFreq); |
| 75 | } |
| 76 | else if (strcasecmp("spin", cmd) == 0) { |
| 77 | float freq; |
| 78 | if (!(input >> freq)) { |
| 79 | return false; |
| 80 | } |
| 81 | texmat->setDynamicSpin(freq); |
| 82 | } |
| 83 | else if (strcasecmp("scale", cmd) == 0) { |
| 84 | float uFreq, vFreq, uScale, vScale; |
| 85 | if (!(input >> uFreq >> vFreq >> uScale >> vScale)) { |
| 86 | return false; |
| 87 | } |
| 88 | texmat->setDynamicScale(uFreq, vFreq, uScale, vScale); |
| 89 | } |
| 90 | else if (strcasecmp("center", cmd) == 0) { |
| 91 | float u, v; |
| 92 | if (!(input >> u >> v)) { |
| 93 | return false; |
| 94 | } |
| 95 | texmat->setDynamicCenter(u, v); |
| 96 | } |
| 97 | else if (strcasecmp("spinVar", cmd) == 0) { |
nothing calls this directly
no test coverage detected