Change: New company face definition system and UI. (#14319)

Bits used by company faces are now defined by a variable system instead of being hardcoded, allowing future expansion.

The four face types covering gender and skin colour are now separate face styles with their own definitions.
This commit is contained in:
Peter Nelson
2025-06-24 07:59:49 +01:00
committed by GitHub
parent ebc74c8905
commit a46a3a97f3
19 changed files with 785 additions and 763 deletions
+3 -3
View File
@@ -939,7 +939,7 @@ static bool LoadOldCompanyEconomy(LoadgameState &ls, int)
static const OldChunks _company_chunk[] = {
OCL_VAR ( OC_UINT16, 1, &_old_string_id ),
OCL_SVAR( OC_UINT32, Company, name_2 ),
OCL_SVAR( OC_UINT32, Company, face ),
OCL_SVAR( OC_UINT32, Company, face.bits ),
OCL_VAR ( OC_UINT16, 1, &_old_string_id_2 ),
OCL_SVAR( OC_UINT32, Company, president_name_2 ),
@@ -992,9 +992,9 @@ static bool LoadOldCompany(LoadgameState &ls, int num)
if (_savegame_type == SGT_TTO) {
/* adjust manager's face */
if (HasBit(c->face, 27) && GB(c->face, 26, 1) == GB(c->face, 19, 1)) {
if (HasBit(c->face.bits, 27) && GB(c->face.bits, 26, 1) == GB(c->face.bits, 19, 1)) {
/* if face would be black in TTD, adjust tie colour and thereby face colour */
ClrBit(c->face, 27);
ClrBit(c->face.bits, 27);
}
/* Company name */