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

Method Map_Add_Structure

Source/Fodder.cpp:1301–1317  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1299}
1300
1301void cFodder::Map_Add_Structure(const sStructure& pStructure, int16 pTileX, int16 pTileY) {
1302
1303 for (const auto& Piece : pStructure.mTiles) {
1304
1305 MapTile_Set(pTileX + Piece.mX, pTileY + Piece.mY, Piece.mTileID);
1306 }
1307
1308 // Add the sprites
1309 for (const auto& Sprite : pStructure.mSprites) {
1310
1311 auto Sheet = Sprite_Get_Sheet(Sprite.mSpriteID, 0);
1312
1313 // - 0x40 because no sidebar
1314 Sprite_Add(Sprite.mSpriteID, ((pTileX) * 16) + (Sprite.mX - Sheet->mModX) - 0x40,
1315 ((pTileY) * 16) + (Sprite.mY - Sheet->mModY));
1316 }
1317}
1318
1319void cFodder::Map_Load_Sprites() {
1320

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected