493 StringID l_weight; ///< Long string for weight |
493 StringID l_weight; ///< Long string for weight |
494 int v_m; ///< Multiplier for volume |
494 int v_m; ///< Multiplier for volume |
495 int v_s; ///< Shift for volume |
495 int v_s; ///< Shift for volume |
496 StringID s_volume; ///< Short string for volume |
496 StringID s_volume; ///< Short string for volume |
497 StringID l_volume; ///< Long string for volume |
497 StringID l_volume; ///< Long string for volume |
|
498 int f_m; ///< Multiplier for force |
|
499 int f_s; ///< Shift for force |
|
500 StringID force; ///< String for force |
498 } Units; |
501 } Units; |
499 |
502 |
|
503 /* Unit conversions */ |
500 static const Units units[] = { |
504 static const Units units[] = { |
501 { // Imperial (Original) |
505 { // Imperial (Original, mph, hp, metric ton, litre, metric ton force) |
502 10, 4, STR_UNITS_VELOCITY_IMPERIAL, |
506 10, 4, STR_UNITS_VELOCITY_IMPERIAL, |
503 1, 0, STR_UNITS_POWER_IMPERIAL, |
507 1, 0, STR_UNITS_POWER_IMPERIAL, |
504 1, 0, STR_UNITS_WEIGHT_SHORT_METRIC, STR_UNITS_WEIGHT_LONG_METRIC, |
508 1, 0, STR_UNITS_WEIGHT_SHORT_METRIC, STR_UNITS_WEIGHT_LONG_METRIC, |
505 1000, 0, STR_UNITS_VOLUME_SHORT_METRIC, STR_UNITS_VOLUME_LONG_METRIC, |
509 1000, 0, STR_UNITS_VOLUME_SHORT_METRIC, STR_UNITS_VOLUME_LONG_METRIC, |
|
510 835, 13, STR_UNITS_FORCE_METRIC, |
506 }, |
511 }, |
507 { // Metric |
512 { // Metric (km/h, hp, metric ton, litre, metric ton force) |
508 1, 0, STR_UNITS_VELOCITY_METRIC, |
513 1, 0, STR_UNITS_VELOCITY_METRIC, |
509 1, 0, STR_UNITS_POWER_METRIC, |
514 1, 0, STR_UNITS_POWER_METRIC, |
510 1, 0, STR_UNITS_WEIGHT_SHORT_METRIC, STR_UNITS_WEIGHT_LONG_METRIC, |
515 1, 0, STR_UNITS_WEIGHT_SHORT_METRIC, STR_UNITS_WEIGHT_LONG_METRIC, |
511 1000, 0, STR_UNITS_VOLUME_SHORT_METRIC, STR_UNITS_VOLUME_LONG_METRIC, |
516 1000, 0, STR_UNITS_VOLUME_SHORT_METRIC, STR_UNITS_VOLUME_LONG_METRIC, |
|
517 835, 13, STR_UNITS_FORCE_METRIC, |
512 }, |
518 }, |
513 { // SI |
519 { // SI (m/s, kilowatt, kilogram, cubic metres, kilonewton) |
514 284, 10, STR_UNITS_VELOCITY_SI, |
520 284, 10, STR_UNITS_VELOCITY_SI, |
515 764, 10, STR_UNITS_POWER_SI, |
521 764, 10, STR_UNITS_POWER_SI, |
516 1000, 0, STR_UNITS_WEIGHT_SHORT_SI, STR_UNITS_WEIGHT_LONG_SI, |
522 1000, 0, STR_UNITS_WEIGHT_SHORT_SI, STR_UNITS_WEIGHT_LONG_SI, |
517 1, 0, STR_UNITS_VOLUME_SHORT_SI, STR_UNITS_VOLUME_LONG_SI, |
523 1, 0, STR_UNITS_VOLUME_SHORT_SI, STR_UNITS_VOLUME_LONG_SI, |
|
524 1, 0, STR_UNITS_FORCE_SI, |
518 }, |
525 }, |
519 }; |
526 }; |
520 |
527 |
521 static char *FormatString(char *buff, const char *str, const int32 *argv, uint casei) |
528 static char *FormatString(char *buff, const char *str, const int32 *argv, uint casei) |
522 { |
529 { |