88 PlayerFace ConvertFromOldPlayerFace(uint32 face) |
88 PlayerFace ConvertFromOldPlayerFace(uint32 face) |
89 { |
89 { |
90 PlayerFace pf = 0; |
90 PlayerFace pf = 0; |
91 GenderEthnicity ge = GE_WM; |
91 GenderEthnicity ge = GE_WM; |
92 |
92 |
93 if (HasBit(face, 31)) SetBitT(ge, GENDER_FEMALE); |
93 if (HasBit(face, 31)) SetBit(ge, GENDER_FEMALE); |
94 if (HasBit(face, 27) && (HasBit(face, 26) == HasBit(face, 19))) SetBitT(ge, ETHNICITY_BLACK); |
94 if (HasBit(face, 27) && (HasBit(face, 26) == HasBit(face, 19))) SetBit(ge, ETHNICITY_BLACK); |
95 |
95 |
96 SetPlayerFaceBits(pf, PFV_GEN_ETHN, ge, ge); |
96 SetPlayerFaceBits(pf, PFV_GEN_ETHN, ge, ge); |
97 SetPlayerFaceBits(pf, PFV_HAS_GLASSES, ge, GB(face, 28, 3) <= 1); |
97 SetPlayerFaceBits(pf, PFV_HAS_GLASSES, ge, GB(face, 28, 3) <= 1); |
98 SetPlayerFaceBits(pf, PFV_EYE_COLOUR, ge, HasBit(ge, ETHNICITY_BLACK) ? 0 : ClampU(GB(face, 20, 3), 5, 7) - 5); |
98 SetPlayerFaceBits(pf, PFV_EYE_COLOUR, ge, HasBit(ge, ETHNICITY_BLACK) ? 0 : ClampU(GB(face, 20, 3), 5, 7) - 5); |
99 SetPlayerFaceBits(pf, PFV_CHIN, ge, ScalePlayerFaceValue(PFV_CHIN, ge, GB(face, 4, 2))); |
99 SetPlayerFaceBits(pf, PFV_CHIN, ge, ScalePlayerFaceValue(PFV_CHIN, ge, GB(face, 4, 2))); |
601 (HasBit(e->player_avail, p) || _date >= e->intro_date + 365)) { |
601 (HasBit(e->player_avail, p) || _date >= e->intro_date + 365)) { |
602 const RailVehicleInfo *rvi = RailVehInfo(i); |
602 const RailVehicleInfo *rvi = RailVehInfo(i); |
603 |
603 |
604 if (rvi->railveh_type != RAILVEH_WAGON) { |
604 if (rvi->railveh_type != RAILVEH_WAGON) { |
605 assert(rvi->railtype < RAILTYPE_END); |
605 assert(rvi->railtype < RAILTYPE_END); |
606 SETBIT(rt, rvi->railtype); |
606 SetBit(rt, rvi->railtype); |
607 } |
607 } |
608 } |
608 } |
609 } |
609 } |
610 |
610 |
611 return rt; |
611 return rt; |
620 const Engine* e = GetEngine(i); |
620 const Engine* e = GetEngine(i); |
621 const EngineInfo *ei = EngInfo(i); |
621 const EngineInfo *ei = EngInfo(i); |
622 |
622 |
623 if (e->type == VEH_ROAD && HasBit(ei->climates, _opt.landscape) && |
623 if (e->type == VEH_ROAD && HasBit(ei->climates, _opt.landscape) && |
624 (HasBit(e->player_avail, p) || _date >= e->intro_date + 365)) { |
624 (HasBit(e->player_avail, p) || _date >= e->intro_date + 365)) { |
625 SETBIT(rt, HasBit(ei->misc_flags, EF_ROAD_TRAM) ? ROADTYPE_TRAM : ROADTYPE_ROAD); |
625 SetBit(rt, HasBit(ei->misc_flags, EF_ROAD_TRAM) ? ROADTYPE_TRAM : ROADTYPE_ROAD); |
626 } |
626 } |
627 } |
627 } |
628 |
628 |
629 return rt; |
629 return rt; |
630 } |
630 } |