| 176 | } |
| 177 | |
| 178 | void zEntButton_Update(_zEntButton* ent, xScene* sc, F32 dt) |
| 179 | { |
| 180 | if (ent->modelPressed != NULL) |
| 181 | { |
| 182 | ent->modelPressed->Mat = ent->model->Mat; |
| 183 | } |
| 184 | |
| 185 | xEntUpdate((xEnt*)ent, sc, dt); |
| 186 | |
| 187 | if (ent->motion.mech.state != ent->oldMotState) |
| 188 | { |
| 189 | switch (ent->motion.mech.state) |
| 190 | { |
| 191 | case 0: |
| 192 | if (ent->state == 4) |
| 193 | { |
| 194 | ent->state = 0; |
| 195 | } |
| 196 | break; |
| 197 | case 2: |
| 198 | if (!xEntMotionIsStopped(&ent->motion)) |
| 199 | { |
| 200 | ent->state = 3; |
| 201 | } |
| 202 | break; |
| 203 | case 3: |
| 204 | ent->state = 4; |
| 205 | break; |
| 206 | case 4: |
| 207 | case 5: |
| 208 | case 6: |
| 209 | break; |
| 210 | } |
| 211 | } |
| 212 | ent->oldMotState = ent->motion.mech.state; |
| 213 | |
| 214 | if (ent->state != ent->oldState) |
| 215 | { |
| 216 | switch (ent->state) |
| 217 | { |
| 218 | case 1: |
| 219 | xEntMotionRun(&ent->motion); |
| 220 | break; |
| 221 | case 3: |
| 222 | xEntMotionStop(&ent->motion); |
| 223 | break; |
| 224 | case 4: |
| 225 | xEntMotionRun(&ent->motion); |
| 226 | break; |
| 227 | case 0: |
| 228 | if (ent->motion.mech.state == 0) |
| 229 | { |
| 230 | xEntMotionStop(&ent->motion); |
| 231 | } |
| 232 | if (ent->basset->actMethod == 1) |
| 233 | { |
| 234 | zEntEvent((xBase*)ent, (xBase*)ent, eEventUnpress); |
| 235 | } |
nothing calls this directly
no test coverage detected