MCPcopy Create free account
hub / github.com/OpenFodder/openfodder / MapTile_Set

Method MapTile_Set

Source/Fodder.cpp:8704–8716  ·  view source on GitHub ↗

* Sets a map tile to a certain ID, positioned based on the current camera */

Source from the content-addressed store, hash-verified

8702 * Sets a map tile to a certain ID, positioned based on the current camera
8703 */
8704void cFodder::MapTile_Set(const size_t pTileX, const size_t pTileY, const size_t pTileID) {
8705
8706 if ((int32) pTileX > mMapLoaded->getWidth() || (int32) pTileY > mMapLoaded->getHeight())
8707 return;
8708
8709 size_t Tile = (((pTileY * mMapLoaded->getWidth()) + pTileX)) + mMapLoaded->getWidth();
8710
8711 uint8* CurrentMapPtr = mMap->data() + mMapTile_Ptr + (Tile * 2);
8712 if (CurrentMapPtr > mMap->data() + mMap->size())
8713 return;
8714
8715 writeLEWord(CurrentMapPtr, (uint16)pTileID);
8716}
8717
8718sSprite* cFodder::Sprite_Add(size_t pSpriteID, int16 pSpriteX, int16 pSpriteY) {
8719

Callers

nothing calls this directly

Calls 4

writeLEWordFunction · 0.85
getWidthMethod · 0.45
getHeightMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected