* Draws the UFO blob on the radar screen. * Currently works only for original sized blobs * 13 x 13 pixels. */
| 1463 | * 13 x 13 pixels. |
| 1464 | */ |
| 1465 | void DogfightState::drawUfo() |
| 1466 | { |
| 1467 | if(_ufoSize < 0 || _ufo->isDestroyed() || _minimized) |
| 1468 | { |
| 1469 | return; |
| 1470 | } |
| 1471 | int currentUfoXposition = _battle->getWidth() / 2 - 6; |
| 1472 | int currentUfoYposition = _battle->getHeight() - (_currentDist / 8) - 6; |
| 1473 | for(int y = 0; y < 13; ++y) |
| 1474 | { |
| 1475 | for(int x = 0; x < 13; ++x) |
| 1476 | { |
| 1477 | Uint8 pixelOffset = _ufoBlobs[_ufoSize + _ufo->getHitFrame()][y][x]; |
| 1478 | if(pixelOffset == 0) |
| 1479 | { |
| 1480 | continue; |
| 1481 | } |
| 1482 | else |
| 1483 | { |
| 1484 | if(_ufo->isCrashed() || _ufo->getHitFrame() > 0) |
| 1485 | { |
| 1486 | pixelOffset *= 2; |
| 1487 | } |
| 1488 | Uint8 radarPixelColor = _window->getPixel(currentUfoXposition + x + 3, currentUfoYposition + y + 3); // + 3 cause of the window frame |
| 1489 | Uint8 color = radarPixelColor - pixelOffset; |
| 1490 | if(color < 108) |
| 1491 | { |
| 1492 | color = 108; |
| 1493 | } |
| 1494 | _battle->setPixel(currentUfoXposition + x, currentUfoYposition + y, color); |
| 1495 | } |
| 1496 | } |
| 1497 | } |
| 1498 | } |
| 1499 | |
| 1500 | /* |
| 1501 | * Draws projectiles on the radar screen. |
nothing calls this directly
no test coverage detected