* Draws the ScannerView view. */
| 48 | * Draws the ScannerView view. |
| 49 | */ |
| 50 | void ScannerView::draw() |
| 51 | { |
| 52 | SurfaceSet *set = _game->getResourcePack()->getSurfaceSet("DETBLOB.DAT"); |
| 53 | Surface *surface = 0; |
| 54 | |
| 55 | clear(); |
| 56 | |
| 57 | this->lock(); |
| 58 | for (int x = -9; x < 10; x++) |
| 59 | { |
| 60 | for (int y = -9; y < 10; y++) |
| 61 | { |
| 62 | for (int z = 0; z < _game->getSavedGame()->getSavedBattle()->getMapSizeZ(); z++) |
| 63 | { |
| 64 | Tile *t = _game->getSavedGame()->getSavedBattle()->getTile(Position(x,y,z) + Position(_unit->getPosition().x, _unit->getPosition().y, 0)); |
| 65 | if (t && t->getUnit() && t->getUnit()->getMotionPoints()) |
| 66 | { |
| 67 | int frame = (t->getUnit()->getMotionPoints() / 5); |
| 68 | if (frame >= 0) |
| 69 | { |
| 70 | if (frame > 5) frame = 5; |
| 71 | surface = set->getFrame(frame + _frame); |
| 72 | surface->blitNShade(this, Surface::getX()+((9+x)*8)-4, Surface::getY()+((9+y)*8)-4, 0); |
| 73 | } |
| 74 | } |
| 75 | } |
| 76 | } |
| 77 | } |
| 78 | |
| 79 | // the arrow of the direction the unit is pointed |
| 80 | surface = set->getFrame(7 + _unit->getDirection()); |
| 81 | |
| 82 | surface->blitNShade(this, Surface::getX()+(9*8)-4, Surface::getY()+(9*8)-4, 0); |
| 83 | this->unlock(); |
| 84 | |
| 85 | |
| 86 | } |
| 87 | |
| 88 | /** |
| 89 | * Handles clicks on the scanner view. |
nothing calls this directly
no test coverage detected