| 387 | } |
| 388 | |
| 389 | bool Screen::fillRect(const Pen &pen, int x1, int y1, int x2, int y2, bool map) |
| 390 | { |
| 391 | auto dim = getWindowSize(); |
| 392 | if (!gps || !pen.valid()) return false; |
| 393 | |
| 394 | if (x1 < 0) x1 = 0; |
| 395 | if (y1 < 0) y1 = 0; |
| 396 | if (x2 >= dim.x) x2 = dim.x-1; |
| 397 | if (y2 >= dim.y) y2 = dim.y-1; |
| 398 | if (x1 > x2 || y1 > y2) return false; |
| 399 | |
| 400 | for (int x = x1; x <= x2; x++) |
| 401 | { |
| 402 | for (int y = y1; y <= y2; y++) |
| 403 | doSetTile(pen, x, y, map); |
| 404 | } |
| 405 | |
| 406 | return true; |
| 407 | } |
| 408 | |
| 409 | bool Screen::drawBorder(const std::string &title) |
| 410 | { |