| 1479 | } |
| 1480 | |
| 1481 | void TilesInView(int *rcolumns, int *rrows) |
| 1482 | { |
| 1483 | uint16_t screenWidth = GetScreenWidth(); |
| 1484 | uint16_t viewportHeight = GetViewportHeight(); |
| 1485 | |
| 1486 | int columns = screenWidth / TILE_WIDTH; |
| 1487 | if ((screenWidth % TILE_WIDTH) != 0) { |
| 1488 | columns++; |
| 1489 | } |
| 1490 | int rows = viewportHeight / TILE_HEIGHT; |
| 1491 | if ((viewportHeight % TILE_HEIGHT) != 0) { |
| 1492 | rows++; |
| 1493 | } |
| 1494 | |
| 1495 | if (*sgOptions.Graphics.zoom) { |
| 1496 | // Half the number of tiles, rounded up |
| 1497 | if ((columns & 1) != 0) { |
| 1498 | columns++; |
| 1499 | } |
| 1500 | columns /= 2; |
| 1501 | if ((rows & 1) != 0) { |
| 1502 | rows++; |
| 1503 | } |
| 1504 | rows /= 2; |
| 1505 | } |
| 1506 | |
| 1507 | *rcolumns = columns; |
| 1508 | *rrows = rows; |
| 1509 | } |
| 1510 | |
| 1511 | void CalcViewportGeometry() |
| 1512 | { |