| 8685 | } |
| 8686 | |
| 8687 | int32 cFodder::MapTile_Get(const size_t pTileX, const size_t pTileY) { |
| 8688 | |
| 8689 | if ((int32) pTileX > mMapLoaded->getWidth() || (int32) pTileY > mMapLoaded->getHeight()) |
| 8690 | return -1; |
| 8691 | |
| 8692 | size_t Tile = (((pTileY * mMapLoaded->getWidth()) + pTileX)) + mMapLoaded->getWidth(); |
| 8693 | |
| 8694 | uint8* CurrentMapPtr = mMap->data() + mMapTile_Ptr + (Tile * 2); |
| 8695 | if (CurrentMapPtr > mMap->data() + mMap->size()) |
| 8696 | return -1; |
| 8697 | |
| 8698 | return readLE<int16>(CurrentMapPtr); |
| 8699 | } |
| 8700 | |
| 8701 | /** |
| 8702 | * Sets a map tile to a certain ID, positioned based on the current camera |