Just hardcode some values that encompass the majority of the scanner graphic (as a hack for now) Note that scanner sweeps are tricky, since the scanning graphic isn't associated with the scanner unit
| 29 | // Just hardcode some values that encompass the majority of the scanner graphic (as a hack for now) |
| 30 | // Note that scanner sweeps are tricky, since the scanning graphic isn't associated with the scanner unit |
| 31 | bool isScannerVisible(BW::Position position) |
| 32 | { |
| 33 | int left = (position.x - 64) / 32; |
| 34 | int top = (position.y - 64) / 32; |
| 35 | int right = (position.x + 64) / 32; |
| 36 | int bottom = (position.y + 64) / 32; |
| 37 | for (int x = left; x <= right; ++x) |
| 38 | { |
| 39 | for (int y = top; y <= bottom; ++y) |
| 40 | { |
| 41 | if (BroodwarImpl.isVisible(x, y)) |
| 42 | return true; |
| 43 | } |
| 44 | } |
| 45 | return false; |
| 46 | } |
| 47 | |
| 48 | void UnitImpl::updateInternalData() |
| 49 | { |
no test coverage detected