| 505 | bool BaseScreen::isTransition() { return false; } |
| 506 | |
| 507 | void BaseScreen::renderBase() |
| 508 | { |
| 509 | const Vec2<int> BASE_POS = baseView->getLocationOnScreen(); |
| 510 | |
| 511 | BaseGraphics::renderBase(BASE_POS, *state->current_base); |
| 512 | |
| 513 | // Draw selection |
| 514 | if (selection != NO_SELECTION) |
| 515 | { |
| 516 | Vec2<int> pos = selection; |
| 517 | Vec2<int> size = {BaseGraphics::TILE_SIZE, BaseGraphics::TILE_SIZE}; |
| 518 | if (drag && dragFacility) |
| 519 | { |
| 520 | size *= dragFacility->size; |
| 521 | } |
| 522 | else if (selFacility != nullptr) |
| 523 | { |
| 524 | pos = selFacility->pos; |
| 525 | size *= selFacility->type->size; |
| 526 | } |
| 527 | pos = BASE_POS + pos * BaseGraphics::TILE_SIZE; |
| 528 | fw().renderer->drawRect(pos, size, Colour{255, 255, 255}); |
| 529 | } |
| 530 | |
| 531 | // Draw dragged facility |
| 532 | if (drag && dragFacility) |
| 533 | { |
| 534 | sp<Image> facility = dragFacility->sprite; |
| 535 | Vec2<int> pos; |
| 536 | if (selection == NO_SELECTION) |
| 537 | { |
| 538 | pos = mousePos - Vec2<int>{BaseGraphics::TILE_SIZE, BaseGraphics::TILE_SIZE} / 2 * |
| 539 | dragFacility->size; |
| 540 | } |
| 541 | else |
| 542 | { |
| 543 | pos = BASE_POS + selection * BaseGraphics::TILE_SIZE; |
| 544 | } |
| 545 | fw().renderer->draw(facility, pos); |
| 546 | } |
| 547 | } |
| 548 | |
| 549 | }; // namespace OpenApoc |
nothing calls this directly
no test coverage detected