* Get character from the map. * @param x X coordinate in pixels. * @param y Y coordinate in pixels. * @return Map character if on-map, or \c -1 if off-map. */
| 368 | * @return Map character if on-map, or \c -1 if off-map. |
| 369 | */ |
| 370 | short Micropolis::getChar(int x, int y) |
| 371 | { |
| 372 | // Convert sprite coordinates to tile coordinates. |
| 373 | x >>= 4; |
| 374 | y >>= 4; |
| 375 | |
| 376 | if (!testBounds(x, y)) { |
| 377 | return -1; |
| 378 | } else { |
| 379 | return map[x][y] & LOMASK; |
| 380 | } |
| 381 | } |
| 382 | |
| 383 | |
| 384 | /** |
nothing calls this directly
no test coverage detected