MCPcopy Create free account
hub / github.com/DFHack/dfhack / IsTiletypeChanged

Function IsTiletypeChanged

plugins/remotefortressreader/remotefortressreader.cpp:652–666  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

650std::map<DFCoord, uint16_t> hashes;
651
652bool IsTiletypeChanged(DFCoord pos)
653{
654 uint16_t hash;
655 df::map_block * block = Maps::getBlock(pos);
656 if (block)
657 hash = fletcher16((uint8_t*)(block->tiletype), 16 * 16 * (sizeof(df::enums::tiletype::tiletype)));
658 else
659 hash = 0;
660 if (hashes[pos] != hash)
661 {
662 hashes[pos] = hash;
663 return true;
664 }
665 return false;
666}
667
668std::map<DFCoord, uint16_t> waterHashes;
669

Callers 1

GetBlockListFunction · 0.85

Calls 2

getBlockFunction · 0.85
fletcher16Function · 0.85

Tested by

no test coverage detected