425 break; |
425 break; |
426 case 0x7E: // {NUMU16} |
426 case 0x7E: // {NUMU16} |
427 buff = FormatNoCommaNumber(buff, GetParamInt16()); |
427 buff = FormatNoCommaNumber(buff, GetParamInt16()); |
428 break; |
428 break; |
429 case 0x7F: // {CURRENCY} |
429 case 0x7F: // {CURRENCY} |
430 buff = FormatGenericCurrency(buff, &_currency_specs[_opt.currency], GetParamInt32(), false); |
430 buff = FormatGenericCurrency(buff, &_currency_specs[_opt_ptr->currency], GetParamInt32(), false); |
431 break; |
431 break; |
432 // 0x80 is reserved for EURO |
432 // 0x80 is reserved for EURO |
433 case 0x81: // {STRINL} |
433 case 0x81: // {STRINL} |
434 str += 2; |
434 str += 2; |
435 buff = GetString(buff, READ_LE_UINT16(str-2)); |
435 buff = GetString(buff, READ_LE_UINT16(str-2)); |
440 case 0x83: // {DATE_SHORT} |
440 case 0x83: // {DATE_SHORT} |
441 buff = FormatMonthAndYear(buff, GetParamUint16()); |
441 buff = FormatMonthAndYear(buff, GetParamUint16()); |
442 break; |
442 break; |
443 case 0x84: {// {VELOCITY} |
443 case 0x84: {// {VELOCITY} |
444 int value = GetParamInt16(); |
444 int value = GetParamInt16(); |
445 if (_opt.kilometers) value = value * 1648 >> 10; |
445 if (_opt_ptr->kilometers) value = value * 1648 >> 10; |
446 buff = FormatCommaNumber(buff, value); |
446 buff = FormatCommaNumber(buff, value); |
447 if (_opt.kilometers) { |
447 if (_opt_ptr->kilometers) { |
448 memcpy(buff, " km/h", 5); |
448 memcpy(buff, " km/h", 5); |
449 buff += 5; |
449 buff += 5; |
450 } else { |
450 } else { |
451 memcpy(buff, " mph", 4); |
451 memcpy(buff, " mph", 4); |
452 buff += 4; |
452 buff += 4; |
456 |
456 |
457 // 0x85 is used as escape character.. |
457 // 0x85 is used as escape character.. |
458 case 0x85: |
458 case 0x85: |
459 switch (*str++) { |
459 switch (*str++) { |
460 case 0: /* {CURRCOMPACT} */ |
460 case 0: /* {CURRCOMPACT} */ |
461 buff = FormatGenericCurrency(buff, &_currency_specs[_opt.currency], GetParamInt32(), true); |
461 buff = FormatGenericCurrency(buff, &_currency_specs[_opt_ptr->currency], GetParamInt32(), true); |
462 break; |
462 break; |
463 case 1: /* {INT32} */ |
463 case 1: /* {INT32} */ |
464 buff = FormatNoCommaNumber(buff, GetParamInt32()); |
464 buff = FormatNoCommaNumber(buff, GetParamInt32()); |
465 break; |
465 break; |
466 case 2: /* {REV} */ |
466 case 2: /* {REV} */ |
469 case 3: { /* {SHORTCARGO} */ |
469 case 3: { /* {SHORTCARGO} */ |
470 // Short description of cargotypes. Layout: |
470 // Short description of cargotypes. Layout: |
471 // 8-bit = cargo type |
471 // 8-bit = cargo type |
472 // 16-bit = cargo count |
472 // 16-bit = cargo count |
473 const char *s; |
473 const char *s; |
474 StringID cargo_str = _cargo_string_list[_opt.landscape][(byte)GetParamInt8()]; |
474 StringID cargo_str = _cargo_string_list[_opt_ptr->landscape][(byte)GetParamInt8()]; |
475 uint16 multiplier = (cargo_str == STR_LITERS) ? 1000 : 1; |
475 uint16 multiplier = (cargo_str == STR_LITERS) ? 1000 : 1; |
476 // liquid type of cargo is multiplied by 100 to get correct amount |
476 // liquid type of cargo is multiplied by 100 to get correct amount |
477 buff = FormatCommaNumber(buff, GetParamInt16() * multiplier); |
477 buff = FormatCommaNumber(buff, GetParamInt16() * multiplier); |
478 s = GetStringPtr(cargo_str); |
478 s = GetStringPtr(cargo_str); |
479 |
479 |
480 memcpy(buff++, " ", 1); |
480 memcpy(buff++, " ", 1); |
481 while (*s) *buff++ = *s++; |
481 while (*s) *buff++ = *s++; |
482 } break; |
482 } break; |
483 case 4: /* {CURRCOMPACT64} */ |
483 case 4: /* {CURRCOMPACT64} */ |
484 // 64 bit compact currency-unit |
484 // 64 bit compact currency-unit |
485 buff = FormatGenericCurrency(buff, &_currency_specs[_opt.currency], GetParamInt64(), true); |
485 buff = FormatGenericCurrency(buff, &_currency_specs[_opt_ptr->currency], GetParamInt64(), true); |
486 break; |
486 break; |
487 |
487 |
488 default: |
488 default: |
489 error("!invalid escape sequence in string"); |
489 error("!invalid escape sequence in string"); |
490 } |
490 } |
539 buff = GetString(buff, t->townnametype); |
539 buff = GetString(buff, t->townnametype); |
540 break; |
540 break; |
541 } |
541 } |
542 |
542 |
543 case 0x9C: { // {CURRENCY64} |
543 case 0x9C: { // {CURRENCY64} |
544 buff = FormatGenericCurrency(buff, &_currency_specs[_opt.currency], GetParamInt64(), false); |
544 buff = FormatGenericCurrency(buff, &_currency_specs[_opt_ptr->currency], GetParamInt64(), false); |
545 break; |
545 break; |
546 } |
546 } |
547 |
547 |
548 case 0x9D: { // {WAYPOINT} |
548 case 0x9D: { // {WAYPOINT} |
549 Waypoint *wp = GetWaypoint(GetDParam(0)); |
549 Waypoint *wp = GetWaypoint(GetDParam(0)); |