| 183 | } |
| 184 | |
| 185 | static void testAnimBlocked(Game_Player::PanDirection dir_x, Game_Player::PanDirection dir_y, int speed) { |
| 186 | static constexpr auto map_id = MockMap::ePassBlock20x15; |
| 187 | |
| 188 | const MockGame mg(map_id); |
| 189 | auto& ch = *mg.GetPlayer(); |
| 190 | |
| 191 | ch.SetMapId(static_cast<int>(map_id)); |
| 192 | ch.MoveTo(static_cast<int>(map_id), 0, 0); |
| 193 | |
| 194 | const auto wait = 2 * SCREEN_TILE_SIZE / (2 << speed); |
| 195 | int fx = 1 * SCREEN_TILE_SIZE; |
| 196 | int fy = 2 * SCREEN_TILE_SIZE; |
| 197 | |
| 198 | if (dir_x == Game_Player::PanRight) { |
| 199 | fx = -1 * SCREEN_TILE_SIZE; |
| 200 | } |
| 201 | if (dir_y == Game_Player::PanDown) { |
| 202 | fy = -2 * SCREEN_TILE_SIZE; |
| 203 | } |
| 204 | |
| 205 | ch.StartPan(dir_x, 1, speed); |
| 206 | ch.StartPan(dir_y, 2, speed); |
| 207 | |
| 208 | testPanAbs(ch, true, false, 0, 0, fx, fy, wait); |
| 209 | |
| 210 | for (int i = 1; i < 10; ++i) { |
| 211 | ForceUpdate(ch); |
| 212 | testPanAbs(ch, true, false, 0, 0, fx, fy, wait); |
| 213 | } |
| 214 | |
| 215 | ch.ResetPan(speed); |
| 216 | testPan(ch, false, false, 0, 0, 0, 0, 0); |
| 217 | } |
| 218 | |
| 219 | TEST_CASE("BlockedPan") { |
| 220 | for (int speed = 1; speed <= 6; ++speed) { |
no test coverage detected