| 179 | } |
| 180 | |
| 181 | static void testMoving(AnimType at, int speed) { |
| 182 | const MockGame mg(map_id); |
| 183 | |
| 184 | auto& ch = GetEvent(at, speed); |
| 185 | |
| 186 | const auto limit = Game_Character::GetStationaryAnimFrames(ch.GetMoveSpeed()); |
| 187 | |
| 188 | CAPTURE(at); |
| 189 | CAPTURE(speed); |
| 190 | |
| 191 | // When event is moving |
| 192 | if (at == lcf::rpg::EventPage::AnimType_spin) { |
| 193 | // Continues spinning even when moving |
| 194 | testAnimSpin(ch, true, false); |
| 195 | return; |
| 196 | } |
| 197 | |
| 198 | for (int i = 0; i < 255; ++i) { |
| 199 | // HACK To make stop count increment to 0 each frame to emulate movement |
| 200 | // FIXME: Verify this matches movement |
| 201 | ch.SetStopCount(-1); |
| 202 | |
| 203 | if (ch.IsAnimated()) { |
| 204 | auto count = i % limit; |
| 205 | auto frame = ((i / limit) + 1) % 4; |
| 206 | testChar(ch, count, frame); |
| 207 | } else { |
| 208 | testChar(ch, 0, 1); |
| 209 | } |
| 210 | ForceUpdate(ch); |
| 211 | } |
| 212 | } |
| 213 | |
| 214 | static void testCenterStep(AnimType at, int speed, int frame) { |
| 215 | const MockGame mg(map_id); |
no test coverage detected