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

Method read

src/bzfs/CustomTextureMatrix.cpp:40–121  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

38
39
40bool 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) {

Callers

nothing calls this directly

Calls 11

setStaticShiftMethod · 0.80
setStaticScaleMethod · 0.80
setStaticSpinMethod · 0.80
setStaticCenterMethod · 0.80
setDynamicShiftMethod · 0.80
setDynamicSpinMethod · 0.80
setDynamicScaleMethod · 0.80
setDynamicCenterMethod · 0.80
setDynamicSpinVarMethod · 0.80
setDynamicScaleVarMethod · 0.80
setDynamicShiftVarMethod · 0.80

Tested by

no test coverage detected