| 192 | } |
| 193 | |
| 194 | void TileView::applyScrolling() |
| 195 | { |
| 196 | Vec3<float> newPos = this->centerPos; |
| 197 | if (this->viewMode == TileViewMode::Isometric) |
| 198 | { |
| 199 | if (scrollLeftKB || scrollLeftM) |
| 200 | { |
| 201 | newPos.x -= isoScrollSpeed.x; |
| 202 | newPos.y += isoScrollSpeed.y; |
| 203 | } |
| 204 | if (scrollRightKB || scrollRightM) |
| 205 | { |
| 206 | newPos.x += isoScrollSpeed.x; |
| 207 | newPos.y -= isoScrollSpeed.y; |
| 208 | } |
| 209 | if (scrollUpKB || scrollUpM) |
| 210 | { |
| 211 | newPos.y -= isoScrollSpeed.y; |
| 212 | newPos.x -= isoScrollSpeed.x; |
| 213 | } |
| 214 | if (scrollDownKB || scrollDownM) |
| 215 | { |
| 216 | newPos.y += isoScrollSpeed.y; |
| 217 | newPos.x += isoScrollSpeed.x; |
| 218 | } |
| 219 | } |
| 220 | else if (this->viewMode == TileViewMode::Strategy) |
| 221 | { |
| 222 | if (scrollLeftKB || scrollLeftM) |
| 223 | newPos.x -= stratScrollSpeed.x; |
| 224 | if (scrollRightKB || scrollRightM) |
| 225 | newPos.x += stratScrollSpeed.x; |
| 226 | if (scrollUpKB || scrollUpM) |
| 227 | newPos.y -= stratScrollSpeed.y; |
| 228 | if (scrollDownKB || scrollDownM) |
| 229 | newPos.y += stratScrollSpeed.y; |
| 230 | } |
| 231 | else |
| 232 | { |
| 233 | LogError("Unknown view mode"); |
| 234 | } |
| 235 | |
| 236 | this->setScreenCenterTile(newPos); |
| 237 | } |
| 238 | |
| 239 | void TileView::renderStrategyOverlay(Renderer &r) |
| 240 | { |
nothing calls this directly
no test coverage detected