MCPcopy Create free account
hub / github.com/OpenTTD/OpenTTD / MaskCompanyManagerFaceBits

Function MaskCompanyManagerFaceBits

src/company_cmd.cpp:1463–1472  ·  view source on GitHub ↗

* Mask company manager face bits to ensure they are all within range. * @note Does not update the CompanyManagerFace itself. Unused bits are cleared. * @param cmf The CompanyManagerFace. * @param style The face variables. * @return The masked face bits. */

Source from the content-addressed store, hash-verified

1461 * @return The masked face bits.
1462 */
1463uint32_t MaskCompanyManagerFaceBits(const CompanyManagerFace &cmf, FaceVars vars)
1464{
1465 CompanyManagerFace face{};
1466
1467 for (auto var : SetBitIterator(GetActiveFaceVars(cmf, vars))) {
1468 vars[var].SetBits(face, vars[var].GetBits(cmf));
1469 }
1470
1471 return face.bits;
1472}
1473
1474/**
1475 * Get a face code representation of a company manager face.

Callers 2

Calls 4

SetBitIteratorClass · 0.85
GetActiveFaceVarsFunction · 0.85
SetBitsMethod · 0.80
GetBitsMethod · 0.80

Tested by

no test coverage detected