483 /* List of cargo types available in this climate */ |
483 /* List of cargo types available in this climate */ |
484 uint32 lmask = _cargo_mask; |
484 uint32 lmask = _cargo_mask; |
485 char *b = _userstring; |
485 char *b = _userstring; |
486 |
486 |
487 /* Draw nothing if the engine is not refittable */ |
487 /* Draw nothing if the engine is not refittable */ |
488 if (COUNTBITS(cmask) <= 1) return 0; |
488 if (CountBits(cmask) <= 1) return 0; |
489 |
489 |
490 b = InlineString(b, STR_PURCHASE_INFO_REFITTABLE_TO); |
490 b = InlineString(b, STR_PURCHASE_INFO_REFITTABLE_TO); |
491 |
491 |
492 if (cmask == lmask) { |
492 if (cmask == lmask) { |
493 /* Engine can be refitted to all types in this climate */ |
493 /* Engine can be refitted to all types in this climate */ |
494 b = InlineString(b, STR_PURCHASE_INFO_ALL_TYPES); |
494 b = InlineString(b, STR_PURCHASE_INFO_ALL_TYPES); |
495 } else { |
495 } else { |
496 /* Check if we are able to refit to more cargo types and unable to. If |
496 /* Check if we are able to refit to more cargo types and unable to. If |
497 * so, invert the cargo types to list those that we can't refit to. */ |
497 * so, invert the cargo types to list those that we can't refit to. */ |
498 if (COUNTBITS(cmask ^ lmask) < COUNTBITS(cmask)) { |
498 if (CountBits(cmask ^ lmask) < CountBits(cmask)) { |
499 cmask ^= lmask; |
499 cmask ^= lmask; |
500 b = InlineString(b, STR_PURCHASE_INFO_ALL_BUT); |
500 b = InlineString(b, STR_PURCHASE_INFO_ALL_BUT); |
501 } |
501 } |
502 |
502 |
503 bool first = true; |
503 bool first = true; |