Files
@ r2078:0300868e49d0
Branch filter:
Location: cpp/openttd-patchpack/source/strings.c - annotation
r2078:0300868e49d0
22.0 KiB
text/x-c
(svn r2588) Codechange: Remove PLAYER_SEED_RANDOM
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 | r0:d63b455452f6 r1891:c5c5466afa35 r1317:3783af524858 r1309:4100b4013e37 r507:b1b0a0a3c313 r1306:a1d9c81639d7 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r6:e0814299d183 r430:c6aefd620ab0 r1542:6bae7041e7bc r2070:ae39d5bcd7da r0:d63b455452f6 r2063:f9227c383fe6 r2063:f9227c383fe6 r2063:f9227c383fe6 r0:d63b455452f6 r2063:f9227c383fe6 r0:d63b455452f6 r663:a23aa2eec081 r659:c4726c05e825 r1319:4c3fee3a2232 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r1376:2af17132fcdb r0:d63b455452f6 r1319:4c3fee3a2232 r1319:4c3fee3a2232 r1319:4c3fee3a2232 r1319:4c3fee3a2232 r1319:4c3fee3a2232 r1319:4c3fee3a2232 r1319:4c3fee3a2232 r0:d63b455452f6 r1321:544964cd20a8 r762:1ada95113bea r762:1ada95113bea r762:1ada95113bea r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r762:1ada95113bea r762:1ada95113bea r762:1ada95113bea r0:d63b455452f6 r762:1ada95113bea r0:d63b455452f6 r762:1ada95113bea r0:d63b455452f6 r762:1ada95113bea r762:1ada95113bea r762:1ada95113bea r0:d63b455452f6 r762:1ada95113bea r762:1ada95113bea r762:1ada95113bea r762:1ada95113bea r0:d63b455452f6 r759:e05ead977366 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r1321:544964cd20a8 r1316:f9cc87a62687 r1316:f9cc87a62687 r1316:f9cc87a62687 r1316:f9cc87a62687 r1316:f9cc87a62687 r1316:f9cc87a62687 r1316:f9cc87a62687 r1316:f9cc87a62687 r1316:f9cc87a62687 r1316:f9cc87a62687 r1316:f9cc87a62687 r1316:f9cc87a62687 r1316:f9cc87a62687 r1316:f9cc87a62687 r1316:f9cc87a62687 r1316:f9cc87a62687 r1316:f9cc87a62687 r1316:f9cc87a62687 r1316:f9cc87a62687 r1316:f9cc87a62687 r1316:f9cc87a62687 r1316:f9cc87a62687 r1316:f9cc87a62687 r1316:f9cc87a62687 r1316:f9cc87a62687 r1316:f9cc87a62687 r1316:f9cc87a62687 r1316:f9cc87a62687 r1316:f9cc87a62687 r1316:f9cc87a62687 r1316:f9cc87a62687 r1316:f9cc87a62687 r1316:f9cc87a62687 r1316:f9cc87a62687 r1316:f9cc87a62687 r1316:f9cc87a62687 r1316:f9cc87a62687 r1316:f9cc87a62687 r1316:f9cc87a62687 r1316:f9cc87a62687 r1316:f9cc87a62687 r1316:f9cc87a62687 r1316:f9cc87a62687 r1316:f9cc87a62687 r1316:f9cc87a62687 r1316:f9cc87a62687 r1316:f9cc87a62687 r1316:f9cc87a62687 r1316:f9cc87a62687 r1316:f9cc87a62687 r1316:f9cc87a62687 r1316:f9cc87a62687 r1316:f9cc87a62687 r1316:f9cc87a62687 r1316:f9cc87a62687 r1316:f9cc87a62687 r1316:f9cc87a62687 r1316:f9cc87a62687 r1316:f9cc87a62687 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r2063:f9227c383fe6 r2063:f9227c383fe6 r2063:f9227c383fe6 r2063:f9227c383fe6 r2063:f9227c383fe6 r2063:f9227c383fe6 r2063:f9227c383fe6 r2063:f9227c383fe6 r2063:f9227c383fe6 r2063:f9227c383fe6 r2063:f9227c383fe6 r2063:f9227c383fe6 r2063:f9227c383fe6 r2063:f9227c383fe6 r2063:f9227c383fe6 r2063:f9227c383fe6 r2063:f9227c383fe6 r2063:f9227c383fe6 r2063:f9227c383fe6 r2063:f9227c383fe6 r2063:f9227c383fe6 r2063:f9227c383fe6 r2063:f9227c383fe6 r2063:f9227c383fe6 r2063:f9227c383fe6 r2063:f9227c383fe6 r2063:f9227c383fe6 r2063:f9227c383fe6 r2063:f9227c383fe6 r2055:3f0149453249 r2055:3f0149453249 r2055:3f0149453249 r2055:3f0149453249 r2055:3f0149453249 r2055:3f0149453249 r2055:3f0149453249 r2055:3f0149453249 r2055:3f0149453249 r2055:3f0149453249 r2055:3f0149453249 r1321:544964cd20a8 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r2063:f9227c383fe6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r2063:f9227c383fe6 r2063:f9227c383fe6 r1321:544964cd20a8 r0:d63b455452f6 r1321:544964cd20a8 r1321:544964cd20a8 r2063:f9227c383fe6 r2063:f9227c383fe6 r1321:544964cd20a8 r1321:544964cd20a8 r1321:544964cd20a8 r2063:f9227c383fe6 r2063:f9227c383fe6 r1321:544964cd20a8 r0:d63b455452f6 r2063:f9227c383fe6 r1321:544964cd20a8 r1321:544964cd20a8 r0:d63b455452f6 r2063:f9227c383fe6 r2063:f9227c383fe6 r2063:f9227c383fe6 r2055:3f0149453249 r2063:f9227c383fe6 r2055:3f0149453249 r1321:544964cd20a8 r2063:f9227c383fe6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r1321:544964cd20a8 r1321:544964cd20a8 r1321:544964cd20a8 r1321:544964cd20a8 r0:d63b455452f6 r2063:f9227c383fe6 r0:d63b455452f6 r0:d63b455452f6 r2063:f9227c383fe6 r2063:f9227c383fe6 r2063:f9227c383fe6 r2063:f9227c383fe6 r2063:f9227c383fe6 r2063:f9227c383fe6 r2055:3f0149453249 r2055:3f0149453249 r2055:3f0149453249 r2055:3f0149453249 r2055:3f0149453249 r2055:3f0149453249 r2055:3f0149453249 r2055:3f0149453249 r2055:3f0149453249 r2055:3f0149453249 r2055:3f0149453249 r2055:3f0149453249 r2055:3f0149453249 r2055:3f0149453249 r2055:3f0149453249 r2055:3f0149453249 r1309:4100b4013e37 r0:d63b455452f6 r193:6aa65dc5a4b4 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r1312:cc3799d5ff15 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r1316:f9cc87a62687 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r1316:f9cc87a62687 r1312:cc3799d5ff15 r1316:f9cc87a62687 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r1316:f9cc87a62687 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r1312:cc3799d5ff15 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r1316:f9cc87a62687 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r1316:f9cc87a62687 r1312:cc3799d5ff15 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r1316:f9cc87a62687 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r1312:cc3799d5ff15 r0:d63b455452f6 r1312:cc3799d5ff15 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r1316:f9cc87a62687 r193:6aa65dc5a4b4 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r970:a6f7afe85299 r0:d63b455452f6 r0:d63b455452f6 r1312:cc3799d5ff15 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r1316:f9cc87a62687 r0:d63b455452f6 r0:d63b455452f6 r970:a6f7afe85299 r0:d63b455452f6 r0:d63b455452f6 r1312:cc3799d5ff15 r1097:51a9e274820f r1097:51a9e274820f r1097:51a9e274820f r1097:51a9e274820f r1097:51a9e274820f r1097:51a9e274820f r1097:51a9e274820f r1097:51a9e274820f r1097:51a9e274820f r1093:18f56ef2d029 r1093:18f56ef2d029 r1704:4c75cc4d21cb r26:750865a88bb2 r26:750865a88bb2 r1312:cc3799d5ff15 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r1316:f9cc87a62687 r1316:f9cc87a62687 r1316:f9cc87a62687 r1316:f9cc87a62687 r193:6aa65dc5a4b4 r788:364eb3a50ec5 r788:364eb3a50ec5 r1316:f9cc87a62687 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r193:6aa65dc5a4b4 r0:d63b455452f6 r193:6aa65dc5a4b4 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r193:6aa65dc5a4b4 r1316:f9cc87a62687 r1316:f9cc87a62687 r1316:f9cc87a62687 r1316:f9cc87a62687 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r788:364eb3a50ec5 r788:364eb3a50ec5 r1316:f9cc87a62687 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r2063:f9227c383fe6 r0:d63b455452f6 r0:d63b455452f6 r2063:f9227c383fe6 r0:d63b455452f6 r1316:f9cc87a62687 r1316:f9cc87a62687 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r2057:eae41183b544 r2063:f9227c383fe6 r2063:f9227c383fe6 r2063:f9227c383fe6 r2063:f9227c383fe6 r2063:f9227c383fe6 r2063:f9227c383fe6 r2063:f9227c383fe6 r0:d63b455452f6 r2053:fbf1210a991f r2063:f9227c383fe6 r0:d63b455452f6 r0:d63b455452f6 r2063:f9227c383fe6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r2063:f9227c383fe6 r0:d63b455452f6 r0:d63b455452f6 r2063:f9227c383fe6 r0:d63b455452f6 r0:d63b455452f6 r2063:f9227c383fe6 r0:d63b455452f6 r0:d63b455452f6 r2063:f9227c383fe6 r1704:4c75cc4d21cb r0:d63b455452f6 r1704:4c75cc4d21cb r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r193:6aa65dc5a4b4 r193:6aa65dc5a4b4 r0:d63b455452f6 r1316:f9cc87a62687 r236:fa8d11d132e4 r2063:f9227c383fe6 r0:d63b455452f6 r236:fa8d11d132e4 r1853:2833201c13cb r0:d63b455452f6 r236:fa8d11d132e4 r236:fa8d11d132e4 r0:d63b455452f6 r0:d63b455452f6 r2063:f9227c383fe6 r0:d63b455452f6 r0:d63b455452f6 r2063:f9227c383fe6 r1853:2833201c13cb r1853:2833201c13cb r1316:f9cc87a62687 r2063:f9227c383fe6 r236:fa8d11d132e4 r2063:f9227c383fe6 r2063:f9227c383fe6 r2063:f9227c383fe6 r2063:f9227c383fe6 r2063:f9227c383fe6 r2063:f9227c383fe6 r2063:f9227c383fe6 r2063:f9227c383fe6 r2063:f9227c383fe6 r2063:f9227c383fe6 r2063:f9227c383fe6 r2063:f9227c383fe6 r2063:f9227c383fe6 r0:d63b455452f6 r2063:f9227c383fe6 r2063:f9227c383fe6 r2063:f9227c383fe6 r2063:f9227c383fe6 r2063:f9227c383fe6 r2063:f9227c383fe6 r2063:f9227c383fe6 r2063:f9227c383fe6 r2063:f9227c383fe6 r2063:f9227c383fe6 r2063:f9227c383fe6 r2063:f9227c383fe6 r2063:f9227c383fe6 r2063:f9227c383fe6 r2063:f9227c383fe6 r2063:f9227c383fe6 r2063:f9227c383fe6 r2063:f9227c383fe6 r2063:f9227c383fe6 r2063:f9227c383fe6 r2070:ae39d5bcd7da r2063:f9227c383fe6 r2063:f9227c383fe6 r2063:f9227c383fe6 r0:d63b455452f6 r2070:ae39d5bcd7da r2070:ae39d5bcd7da r2070:ae39d5bcd7da r2070:ae39d5bcd7da r2070:ae39d5bcd7da r2070:ae39d5bcd7da r2070:ae39d5bcd7da r2070:ae39d5bcd7da r2070:ae39d5bcd7da r2070:ae39d5bcd7da r2070:ae39d5bcd7da r2070:ae39d5bcd7da r2070:ae39d5bcd7da r2070:ae39d5bcd7da r2070:ae39d5bcd7da r2070:ae39d5bcd7da r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r2063:f9227c383fe6 r0:d63b455452f6 r1853:2833201c13cb r2063:f9227c383fe6 r1853:2833201c13cb r1853:2833201c13cb r0:d63b455452f6 r193:6aa65dc5a4b4 r2063:f9227c383fe6 r2063:f9227c383fe6 r2063:f9227c383fe6 r2063:f9227c383fe6 r2063:f9227c383fe6 r2063:f9227c383fe6 r0:d63b455452f6 r2063:f9227c383fe6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r2063:f9227c383fe6 r0:d63b455452f6 r2063:f9227c383fe6 r2063:f9227c383fe6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r2063:f9227c383fe6 r2063:f9227c383fe6 r2063:f9227c383fe6 r1316:f9cc87a62687 r2063:f9227c383fe6 r64:7b885d8ae65b r64:7b885d8ae65b r2063:f9227c383fe6 r2063:f9227c383fe6 r2063:f9227c383fe6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r2063:f9227c383fe6 r2063:f9227c383fe6 r0:d63b455452f6 r2063:f9227c383fe6 r2063:f9227c383fe6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r2063:f9227c383fe6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r395:9c19f4df13fc r2063:f9227c383fe6 r2063:f9227c383fe6 r0:d63b455452f6 r1542:6bae7041e7bc r1542:6bae7041e7bc r0:d63b455452f6 r2063:f9227c383fe6 r2063:f9227c383fe6 r2063:f9227c383fe6 r0:d63b455452f6 r2063:f9227c383fe6 r0:d63b455452f6 r1097:51a9e274820f r1097:51a9e274820f r2063:f9227c383fe6 r1097:51a9e274820f r1097:51a9e274820f r1097:51a9e274820f r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r1316:f9cc87a62687 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r2063:f9227c383fe6 r0:d63b455452f6 r1316:f9cc87a62687 r1316:f9cc87a62687 r1316:f9cc87a62687 r1316:f9cc87a62687 r1316:f9cc87a62687 r1316:f9cc87a62687 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r2063:f9227c383fe6 r1316:f9cc87a62687 r2063:f9227c383fe6 r0:d63b455452f6 r1316:f9cc87a62687 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r1312:cc3799d5ff15 r1321:544964cd20a8 r1321:544964cd20a8 r0:d63b455452f6 r0:d63b455452f6 r2063:f9227c383fe6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r1704:4c75cc4d21cb r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r2063:f9227c383fe6 r1853:2833201c13cb r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r2063:f9227c383fe6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r1316:f9cc87a62687 r0:d63b455452f6 r233:2e962870af3f r233:2e962870af3f r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r233:2e962870af3f r233:2e962870af3f r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r1704:4c75cc4d21cb r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r1853:2833201c13cb r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r2063:f9227c383fe6 r0:d63b455452f6 r1316:f9cc87a62687 r1321:544964cd20a8 r2063:f9227c383fe6 r0:d63b455452f6 r1321:544964cd20a8 r2063:f9227c383fe6 r0:d63b455452f6 r1321:544964cd20a8 r2063:f9227c383fe6 r0:d63b455452f6 r1321:544964cd20a8 r2063:f9227c383fe6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r1316:f9cc87a62687 r2063:f9227c383fe6 r1853:2833201c13cb r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r1853:2833201c13cb r1853:2833201c13cb r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r1853:2833201c13cb r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r1321:544964cd20a8 r1321:544964cd20a8 r1321:544964cd20a8 r1321:544964cd20a8 r1321:544964cd20a8 r1321:544964cd20a8 r1321:544964cd20a8 r1321:544964cd20a8 r1321:544964cd20a8 r1321:544964cd20a8 r1321:544964cd20a8 r1321:544964cd20a8 r1321:544964cd20a8 r1321:544964cd20a8 r1321:544964cd20a8 r1321:544964cd20a8 r0:d63b455452f6 r0:d63b455452f6 r1316:f9cc87a62687 r1316:f9cc87a62687 r0:d63b455452f6 r1319:4c3fee3a2232 r0:d63b455452f6 r1312:cc3799d5ff15 r1312:cc3799d5ff15 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r1319:4c3fee3a2232 r1319:4c3fee3a2232 r1319:4c3fee3a2232 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r193:6aa65dc5a4b4 r0:d63b455452f6 r1316:f9cc87a62687 r1319:4c3fee3a2232 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r1316:f9cc87a62687 r1319:4c3fee3a2232 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r1312:cc3799d5ff15 r0:d63b455452f6 r0:d63b455452f6 r1319:4c3fee3a2232 r1316:f9cc87a62687 r1312:cc3799d5ff15 r1316:f9cc87a62687 r1316:f9cc87a62687 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r1321:544964cd20a8 r0:d63b455452f6 r0:d63b455452f6 r1321:544964cd20a8 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r1093:18f56ef2d029 r0:d63b455452f6 r0:d63b455452f6 r1321:544964cd20a8 r1321:544964cd20a8 r1321:544964cd20a8 r1321:544964cd20a8 r1319:4c3fee3a2232 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r1316:f9cc87a62687 r1321:544964cd20a8 r1321:544964cd20a8 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r1316:f9cc87a62687 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r193:6aa65dc5a4b4 r1316:f9cc87a62687 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r193:6aa65dc5a4b4 r0:d63b455452f6 r1316:f9cc87a62687 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r1316:f9cc87a62687 r1316:f9cc87a62687 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r0:d63b455452f6 r2075:832339004524 r2075:832339004524 | #include "stdafx.h"
#include "openttd.h"
#include "string.h"
#include "strings.h"
#include "table/strings.h"
#include "namegen.h"
#include "station.h"
#include "town.h"
#include "vehicle.h"
#include "news.h"
#include "screenshot.h"
#include "waypoint.h"
#include "industry.h"
static char *StationGetSpecialString(char *buff, int x);
static char *GetSpecialTownNameString(char *buff, int ind, uint32 seed);
static char *GetSpecialPlayerNameString(char *buff, int ind, const int32 *argv);
static char *FormatString(char *buff, const char *str, const int32 *argv);
extern const char _openttd_revision[];
typedef struct LanguagePack {
uint32 ident;
uint32 version; // 32-bits of auto generated version info which is basically a hash of strings.h
char name[32]; // the international name of this language
char own_name[32]; // the localized name of this language
char isocode[16]; // the ISO code for the language (not country code)
uint16 offsets[32]; // the offsets
char data[VARARRAY_SIZE];
} LanguagePack;
static char **_langpack_offs;
static LanguagePack *_langpack;
static uint _langtab_num[32]; // Offset into langpack offs
static uint _langtab_start[32]; // Offset into langpack offs
const StringID _currency_string_list[] = {
STR_CURR_GBP,
STR_CURR_USD,
STR_CURR_EUR,
STR_CURR_YEN,
STR_CURR_ATS,
STR_CURR_BEF,
STR_CURR_CHF,
STR_CURR_CZK,
STR_CURR_DEM,
STR_CURR_DKK,
STR_CURR_ESP,
STR_CURR_FIM,
STR_CURR_FRF,
STR_CURR_GRD,
STR_CURR_HUF,
STR_CURR_ISK,
STR_CURR_ITL,
STR_CURR_NLG,
STR_CURR_NOK,
STR_CURR_PLN,
STR_CURR_ROL,
STR_CURR_RUR,
STR_CURR_SEK,
STR_CURR_CUSTOM,
INVALID_STRING_ID
};
static const StringID _cargo_string_list[NUM_LANDSCAPE][NUM_CARGO] = {
{ /* LT_NORMAL */
STR_PASSENGERS,
STR_TONS,
STR_BAGS,
STR_LITERS,
STR_ITEMS,
STR_CRATES,
STR_TONS,
STR_TONS,
STR_TONS,
STR_TONS,
STR_BAGS,
STR_RES_OTHER
},
{ /* LT_HILLY */
STR_PASSENGERS,
STR_TONS,
STR_BAGS,
STR_LITERS,
STR_ITEMS,
STR_CRATES,
STR_TONS,
STR_TONS,
STR_RES_OTHER,
STR_TONS,
STR_BAGS,
STR_TONS
},
{ /* LT_DESERT */
STR_PASSENGERS,
STR_LITERS,
STR_BAGS,
STR_LITERS,
STR_TONS,
STR_CRATES,
STR_TONS,
STR_TONS,
STR_TONS,
STR_LITERS,
STR_BAGS,
STR_TONS
},
{ /* LT_CANDY */
STR_PASSENGERS,
STR_TONS,
STR_BAGS,
STR_NOTHING,
STR_NOTHING,
STR_TONS,
STR_TONS,
STR_LITERS,
STR_TONS,
STR_NOTHING,
STR_LITERS,
STR_NOTHING
}
};
// Read an int64 from the argv array.
static inline int64 GetInt64(const int32 **argv)
{
int64 result;
assert(argv);
result = (uint32)(*argv)[0] + ((uint64)(uint32)(*argv)[1] << 32);
(*argv)+=2;
return result;
}
// Read an int32 from the argv array.
static inline int32 GetInt32(const int32 **argv)
{
assert(argv);
return *(*argv)++;
}
// Read an array from the argv array.
static inline const int32 *GetArgvPtr(const int32 **argv, int n)
{
const int32 *result;
assert(*argv);
result = *argv;
(*argv) += n;
return result;
}
#define NUM_BOUND_STRINGS 8
// Array to hold the bound strings.
static const char *_bound_strings[NUM_BOUND_STRINGS];
// This index is used to implement a "round-robin" allocating of
// slots for BindCString. NUM_BOUND_STRINGS slots are reserved.
// Which means that after NUM_BOUND_STRINGS calls to BindCString,
// the indices will be reused.
static int _bind_index;
static const char *GetStringPtr(StringID string)
{
return _langpack_offs[_langtab_start[string >> 11] + (string & 0x7FF)];
}
char *GetStringWithArgs(char *buffr, StringID string, const int32 *argv)
{
uint index = string & 0x7FF;
uint tab = string >> 11;
if (!string) {
error("!invalid string id 0 in GetString");
}
switch (tab) {
case 4:
if (index >= 0xC0)
return GetSpecialTownNameString(buffr, index - 0xC0, GetInt32(&argv));
break;
case 14:
if (index >= 0xE4)
return GetSpecialPlayerNameString(buffr, index - 0xE4, argv);
break;
// User defined name
case 15:
return GetName(index, buffr);
case 31:
// dynamic strings. These are NOT to be passed through the formatter,
// but passed through verbatim.
if (index < (STR_SPEC_USERSTRING & 0x7FF)) {
return strecpy(buffr, _bound_strings[index], NULL);
}
return FormatString(buffr, _userstring, NULL);
}
if (index >= _langtab_num[tab])
error(
"!String 0x%X is invalid. "
"Probably because an old version of the .lng file.\n", string
);
return FormatString(buffr, GetStringPtr(string), argv);
}
char *GetString(char *buffr, StringID string)
{
return GetStringWithArgs(buffr, string, (int32*)_decode_parameters);
}
// This function takes a C-string and allocates a temporary string ID.
// The duration of the bound string is valid only until the next GetString,
// so be careful.
StringID BindCString(const char *str)
{
int idx = (++_bind_index) & (NUM_BOUND_STRINGS - 1);
_bound_strings[idx] = str;
return idx + STR_SPEC_DYNSTRING;
}
// This function is used to "bind" a C string to a OpenTTD dparam slot.
void SetDParamStr(uint n, const char *str)
{
SetDParam(n, BindCString(str));
}
void InjectDParam(int amount)
{
memmove(_decode_parameters + amount, _decode_parameters, sizeof(_decode_parameters) - amount * sizeof(uint32));
}
static const uint32 _divisor_table[] = {
1000000000,
100000000,
10000000,
1000000,
100000,
10000,
1000,
100,
10,
1
};
static char *FormatCommaNumber(char *buff, int32 number)
{
uint32 quot,divisor;
int i;
uint32 tot;
uint32 num;
if (number < 0) {
*buff++ = '-';
number = -number;
}
num = number;
tot = 0;
for (i = 0; i != 10; i++) {
divisor = _divisor_table[i];
quot = 0;
if (num >= divisor) {
quot = num / _divisor_table[i];
num = num % _divisor_table[i];
}
if (tot |= quot || i == 9) {
*buff++ = '0' + quot;
if (i == 0 || i == 3 || i == 6) *buff++ = ',';
}
}
*buff = '\0';
return buff;
}
static char *FormatNoCommaNumber(char *buff, int32 number)
{
uint32 quot,divisor;
int i;
uint32 tot;
uint32 num;
if (number < 0) {
*buff++ = '-';
number = -number;
}
num = number;
tot = 0;
for (i = 0; i != 10; i++) {
divisor = _divisor_table[i];
quot = 0;
if (num >= divisor) {
quot = num / _divisor_table[i];
num = num % _divisor_table[i];
}
if (tot |= quot || i == 9) {
*buff++ = '0' + quot;
}
}
*buff = '\0';
return buff;
}
static char *FormatYmdString(char *buff, uint16 number)
{
const char *src;
YearMonthDay ymd;
ConvertDayToYMD(&ymd, number);
for (src = GetStringPtr(ymd.day + STR_01AC_1ST - 1); (*buff++ = *src++) != '\0';) {}
buff[-1] = ' ';
memcpy(buff, GetStringPtr(STR_0162_JAN + ymd.month), 4);
buff[3] = ' ';
return FormatNoCommaNumber(buff+4, ymd.year + MAX_YEAR_BEGIN_REAL);
}
static char *FormatMonthAndYear(char *buff, uint16 number)
{
const char *src;
YearMonthDay ymd;
ConvertDayToYMD(&ymd, number);
for (src = GetStringPtr(STR_MONTH_JAN + ymd.month); (*buff++ = *src++) != '\0';) {}
buff[-1] = ' ';
return FormatNoCommaNumber(buff, ymd.year + MAX_YEAR_BEGIN_REAL);
}
static char *FormatTinyDate(char *buff, uint16 number)
{
YearMonthDay ymd;
ConvertDayToYMD(&ymd, number);
buff += sprintf(buff, " %02i-%02i-%04i", ymd.day, ymd.month + 1, ymd.year + MAX_YEAR_BEGIN_REAL);
return buff;
}
uint GetCurrentCurrencyRate(void)
{
return _currency_specs[_opt_ptr->currency].rate;
}
static char *FormatGenericCurrency(char *buff, const CurrencySpec *spec, int64 number, bool compact)
{
const char *s;
char c;
char buf[40], *p;
int j;
// multiply by exchange rate
number *= spec->rate;
// convert from negative
if (number < 0) {
*buff++ = '-';
number = -number;
}
// add prefix part
s = spec->prefix;
while (s != spec->prefix + lengthof(spec->prefix) && (c = *s++) != '\0') *buff++ = c;
// for huge numbers, compact the number into k or M
if (compact) {
compact = 0;
if (number >= 1000000000) {
number = (number + 500000) / 1000000;
compact = 'M';
} else if (number >= 1000000) {
number = (number + 500) / 1000;
compact = 'k';
}
}
// convert to ascii number and add commas
p = buf;
j = 4;
do {
if (--j == 0) {
*p++ = spec->separator;
j = 3;
}
*p++ = '0' + number % 10;
} while (number /= 10);
do *buff++ = *--p; while (p != buf);
if (compact) *buff++ = compact;
// add suffix part
s = spec->suffix;
while (s != spec->suffix + lengthof(spec->suffix) && (c = *s++) != '\0') *buff++ = c;
return buff;
}
static char *FormatString(char *buff, const char *str, const int32 *argv)
{
byte b;
const int32 *argv_orig = argv;
while ((b = *str++) != '\0') {
switch (b) {
case 0x1: // {SETX}
*buff++ = b;
*buff++ = *str++;
break;
case 0x2: // {SETXY}
*buff++ = b;
*buff++ = *str++;
*buff++ = *str++;
break;
case 0x7B: // {COMMA}
buff = FormatCommaNumber(buff, GetInt32(&argv));
break;
case 0x7C: // Move argument pointer
argv = argv_orig + (byte)*str++;
break;
case 0x7D:
assert(0);
break;
case 0x7E: // {NUMU16}, {INT32}
buff = FormatNoCommaNumber(buff, GetInt32(&argv));
break;
case 0x7F: // {CURRENCY}
buff = FormatGenericCurrency(buff, &_currency_specs[_opt_ptr->currency], GetInt32(&argv), false);
break;
// 0x80 is reserved for EURO
case 0x81: // {STRINL}
str += 2;
buff = GetStringWithArgs(buff, READ_LE_UINT16(str-2), argv);
break;
case 0x82: // {DATE_LONG}
buff = FormatYmdString(buff, GetInt32(&argv));
break;
case 0x83: // {DATE_SHORT}
buff = FormatMonthAndYear(buff, GetInt32(&argv));
break;
case 0x84: {// {VELOCITY}
int value = GetInt32(&argv);
if (_opt_ptr->kilometers) value = value * 1648 >> 10;
buff = FormatCommaNumber(buff, value);
if (_opt_ptr->kilometers) {
memcpy(buff, " km/h", 5);
buff += 5;
} else {
memcpy(buff, " mph", 4);
buff += 4;
}
break;
}
// 0x85 is used as escape character..
case 0x85:
switch (*str++) {
case 0: /* {CURRCOMPACT} */
buff = FormatGenericCurrency(buff, &_currency_specs[_opt_ptr->currency], GetInt32(&argv), true);
break;
case 2: /* {REV} */
buff = strecpy(buff, _openttd_revision, NULL);
break;
case 3: { /* {SHORTCARGO} */
// Short description of cargotypes. Layout:
// 8-bit = cargo type
// 16-bit = cargo count
StringID cargo_str = _cargo_string_list[_opt_ptr->landscape][GetInt32(&argv)];
uint16 multiplier = (cargo_str == STR_LITERS) ? 1000 : 1;
// liquid type of cargo is multiplied by 100 to get correct amount
buff = FormatCommaNumber(buff, GetInt32(&argv) * multiplier);
buff = strecpy(buff, " ", NULL);
buff = strecpy(buff, GetStringPtr(cargo_str), NULL);
} break;
case 4: {/* {CURRCOMPACT64} */
// 64 bit compact currency-unit
buff = FormatGenericCurrency(buff, &_currency_specs[_opt_ptr->currency], GetInt64(&argv), true);
break;
}
case 5: { /* {STRING1} */
// String that consumes ONE argument
StringID str = GetInt32(&argv);
buff = GetStringWithArgs(buff, str, GetArgvPtr(&argv, 1));
break;
}
case 6: { /* {STRING2} */
// String that consumes TWO arguments
StringID str = GetInt32(&argv);
buff = GetStringWithArgs(buff, str, GetArgvPtr(&argv, 2));
break;
}
case 7: { /* {STRING3} */
// String that consumes THREE arguments
StringID str = GetInt32(&argv);
buff = GetStringWithArgs(buff, str, GetArgvPtr(&argv, 3));
break;
}
case 8: { /* {STRING4} */
// String that consumes FOUR arguments
StringID str = GetInt32(&argv);
buff = GetStringWithArgs(buff, str, GetArgvPtr(&argv, 4));
break;
}
case 9: { /* {STRING5} */
// String that consumes FIVE arguments
StringID str = GetInt32(&argv);
buff = GetStringWithArgs(buff, str, GetArgvPtr(&argv, 5));
break;
}
case 10: { /* {STATIONFEATURES} */
buff = StationGetSpecialString(buff, GetInt32(&argv));
break;
}
case 11: { /* {INDUSTRY} */
Industry *i = GetIndustry(GetInt32(&argv));
int32 args[2];
// industry not valid anymore?
if (i->xy == 0)
break;
// First print the town name and the industry type name
// The string STR_INDUSTRY_PATTERN controls the formatting
args[0] = i->town->index;
args[1] = i->type + STR_4802_COAL_MINE;
buff = FormatString(buff, GetStringPtr(STR_INDUSTRY_FORMAT), args);
break;
}
default:
error("!invalid escape sequence in string");
}
break;
case 0x86: // {SKIP}
argv++;
break;
case 0x87: // {VOLUME}
buff = FormatCommaNumber(buff, GetInt32(&argv) * 1000);
buff = strecpy(buff, " ", NULL);
buff = strecpy(buff, GetStringPtr(STR_LITERS), NULL);
break;
case 0x88: {// {STRING}
StringID str = GetInt32(&argv);
// WARNING. It's prohibited for the included string to consume any arguments.
// For included strings that consume argument, you should use STRING1, STRING2 etc.
// To debug stuff you can set argv to NULL and it will tell you
buff = GetStringWithArgs(buff, str, argv);
break;
}
case 0x99: { // {CARGO}
// Layout now is:
// 8bit - cargo type
// 16-bit - cargo count
int cargo_str = _cargoc.names_long_s[GetInt32(&argv)];
// Now check if the cargo count is 1, if it is, increase string by 32.
if (GetInt32(&argv) != 1) cargo_str += 32;
buff = GetStringWithArgs(buff, cargo_str, argv - 1);
break;
}
case 0x9A: { // {STATION}
Station *st;
int32 temp[2];
st = GetStation(GetInt32(&argv));
if (st->xy == 0) { // station doesn't exist anymore
buff = GetStringWithArgs(buff, STR_UNKNOWN_DESTINATION, NULL);
break;
}
temp[0] = st->town->townnametype;
temp[1] = st->town->townnameparts;
buff = GetStringWithArgs(buff, st->string_id, temp);
break;
}
case 0x9B: { // {TOWN}
Town *t;
int32 temp[1];
t = GetTown(GetInt32(&argv));
assert(t->xy);
temp[0] = t->townnameparts;
buff = GetStringWithArgs(buff, t->townnametype, temp);
break;
}
case 0x9C: { // {CURRENCY64}
buff = FormatGenericCurrency(buff, &_currency_specs[_opt_ptr->currency], GetInt64(&argv), false);
break;
}
case 0x9D: { // {WAYPOINT}
int32 temp[2];
Waypoint *wp = GetWaypoint(GetInt32(&argv));
StringID str;
if (wp->string != STR_NULL) {
str = wp->string;
} else {
temp[0] = wp->town_index;
temp[1] = wp->town_cn + 1;
str = wp->town_cn == 0 ? STR_WAYPOINTNAME_CITY : STR_WAYPOINTNAME_CITY_SERIAL;
}
buff = GetStringWithArgs(buff, str, temp);
} break;
case 0x9E: { // {DATE_TINY}
buff = FormatTinyDate(buff, GetInt32(&argv));
break;
}
// case 0x88..0x98: // {COLORS}
// case 0xE: // {TINYFONT}
// case 0xF: // {BIGFONT}
// 0x9E is the highest number that is available.
default:
*buff++ = b;
}
}
*buff = '\0';
return buff;
}
static char *StationGetSpecialString(char *buff, int x)
{
if (x & 0x01) *buff++ = '\xB4';
if (x & 0x02) *buff++ = '\xB5';
if (x & 0x04) *buff++ = '\xB6';
if (x & 0x08) *buff++ = '\xB7';
if (x & 0x10) *buff++ = '\xB8';
*buff = '\0';
return buff;
}
static char *GetSpecialTownNameString(char *buff, int ind, uint32 seed)
{
_town_name_generators[ind](buff, seed);
while (*buff != '\0') buff++;
return buff;
}
static const char * const _silly_company_names[] = {
"Bloggs Brothers",
"Tiny Transport Ltd.",
"Express Travel",
"Comfy-Coach & Co.",
"Crush & Bump Ltd.",
"Broken & Late Ltd.",
"Sam Speedy & Son",
"Supersonic Travel",
"Mike's Motors",
"Lightning International",
"Pannik & Loozit Ltd.",
"Inter-City Transport",
"Getout & Pushit Ltd.",
};
static const char * const _surname_list[] = {
"Adams",
"Allan",
"Baker",
"Bigwig",
"Black",
"Bloggs",
"Brown",
"Campbell",
"Gordon",
"Hamilton",
"Hawthorn",
"Higgins",
"Green",
"Gribble",
"Jones",
"McAlpine",
"MacDonald",
"McIntosh",
"Muir",
"Murphy",
"Nelson",
"O'Donnell",
"Parker",
"Phillips",
"Pilkington",
"Quigley",
"Sharkey",
"Thomson",
"Watkins",
"Grumpy",
"Dozy",
"Speedy",
"Nosey",
"Dribble",
"Mushroom",
"Cabbage",
"Sniffle",
"Fishy",
"Swindle",
"Sneaky",
"Nutkins",
};
static const char _initial_name_letters[] = {
'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J',
'K', 'L', 'M', 'N', 'P', 'R', 'S', 'T', 'W',
};
static char *GenAndCoName(char *buff, uint32 arg)
{
uint base,num;
base = 0;
num = 29;
if (_opt_ptr->landscape == LT_CANDY) {
base = num;
num = 12;
}
buff = strecpy(buff, _surname_list[base + (num * GB(arg, 16, 8) >> 8)], NULL);
buff = strecpy(buff, " & Co.", NULL);
return buff;
}
static char *GenPresidentName(char *buff, uint32 x)
{
uint i, base, num;
buff[0] = _initial_name_letters[(sizeof(_initial_name_letters) * (byte)x) >> 8];
buff[1] = '.';
buff[2] = ' '; // Insert a space after initial and period "I. Firstname" instead of "I.Firstname"
buff += 3;
i = ((sizeof(_initial_name_letters) + 35) * (byte)(x >> 8)) >> 8;
if (i < sizeof(_initial_name_letters)) {
buff[0] = _initial_name_letters[i];
buff[1] = '.';
buff[2] = ' '; // Insert a space after initial and period "I. J. Firstname" instead of "I.J.Firstname"
buff += 3;
}
base = 0;
num = 29;
if (_opt_ptr->landscape == LT_CANDY) {
base = num;
num = 12;
}
buff = strecpy(buff, _surname_list[base + (num * GB(x, 16, 8) >> 8)], NULL);
return buff;
}
static const char * const _song_names[] = {
"Tycoon DELUXE Theme",
"Easy Driver",
"Little Red Diesel",
"Cruise Control",
"Don't Walk!",
"Fell Apart On Me",
"City Groove",
"Funk Central",
"Stoke It",
"Road Hog",
"Aliens Ate My Railway",
"Snarl Up",
"Stroll On",
"Can't Get There From Here",
"Sawyer's Tune",
"Hold That Train!",
"Movin' On",
"Goss Groove",
"Small Town",
"Broomer's Oil Rag",
"Jammit",
"Hard Drivin'"
};
static char *GetSpecialPlayerNameString(char *buff, int ind, const int32 *argv)
{
switch (ind) {
case 1: // not used
return strecpy(buff, _silly_company_names[GetInt32(&argv) & 0xFFFF], NULL);
case 2: // used for Foobar & Co company names
return GenAndCoName(buff, GetInt32(&argv));
case 3: // President name
return GenPresidentName(buff, GetInt32(&argv));
case 4: // song names
return strecpy(buff, _song_names[GetInt32(&argv) - 1], NULL);
}
// town name?
if (IS_INT_INSIDE(ind - 6, 0, SPECSTR_TOWNNAME_LAST-SPECSTR_TOWNNAME_START + 1)) {
buff = GetSpecialTownNameString(buff, ind - 6, GetInt32(&argv));
return strecpy(buff, " Transport", NULL);
}
// language name?
if (IS_INT_INSIDE(ind, (SPECSTR_LANGUAGE_START - 0x70E4), (SPECSTR_LANGUAGE_END - 0x70E4) + 1)) {
int i = ind - (SPECSTR_LANGUAGE_START - 0x70E4);
return strecpy(buff,
i == _dynlang.curr ? _langpack->own_name : _dynlang.ent[i].name, NULL);
}
// resolution size?
if (IS_INT_INSIDE(ind, (SPECSTR_RESOLUTION_START - 0x70E4), (SPECSTR_RESOLUTION_END - 0x70E4) + 1)) {
int i = ind - (SPECSTR_RESOLUTION_START - 0x70E4);
return buff + sprintf(buff, "%dx%d", _resolutions[i][0], _resolutions[i][1]);
}
// screenshot format name?
if (IS_INT_INSIDE(ind, (SPECSTR_SCREENSHOT_START - 0x70E4), (SPECSTR_SCREENSHOT_END - 0x70E4) + 1)) {
int i = ind - (SPECSTR_SCREENSHOT_START - 0x70E4);
return strecpy(buff, GetScreenshotFormatDesc(i), NULL);
}
assert(0);
return NULL;
}
// remap a string ID from the old format to the new format
StringID RemapOldStringID(StringID s)
{
switch (s) {
case 0x0006: return STR_SV_EMPTY;
case 0x7000: return STR_SV_UNNAMED;
case 0x70E4: return SPECSTR_PLAYERNAME_ENGLISH;
case 0x70E9: return SPECSTR_PLAYERNAME_ENGLISH;
case 0x8864: return STR_SV_TRAIN_NAME;
case 0x902B: return STR_SV_ROADVEH_NAME;
case 0x9830: return STR_SV_SHIP_NAME;
case 0xA02F: return STR_SV_AIRCRAFT_NAME;
default:
if (IS_INT_INSIDE(s, 0x300F, 0x3030))
return s - 0x300F + STR_SV_STNAME;
else
return s;
}
}
bool ReadLanguagePack(int lang_index)
{
int tot_count, i;
LanguagePack *lang_pack;
size_t len;
char **langpack_offs;
char *s;
{
char *lang = str_fmt("%s%s", _path.lang_dir, _dynlang.ent[lang_index].file);
lang_pack = ReadFileToMem(lang, &len, 100000);
free(lang);
}
if (lang_pack == NULL) return false;
if (len < sizeof(LanguagePack) ||
lang_pack->ident != TO_LE32(LANGUAGE_PACK_IDENT) ||
lang_pack->version != TO_LE32(LANGUAGE_PACK_VERSION)) {
free(lang_pack);
return false;
}
#if defined(TTD_BIG_ENDIAN)
for (i = 0; i != 32; i++) {
lang_pack->offsets[i] = READ_LE_UINT16(&lang_pack->offsets[i]);
}
#endif
tot_count = 0;
for (i = 0; i != 32; i++) {
uint num = lang_pack->offsets[i];
_langtab_start[i] = tot_count;
_langtab_num[i] = num;
tot_count += num;
}
// Allocate offsets
langpack_offs = malloc(tot_count * sizeof(*langpack_offs));
// Fill offsets
s = lang_pack->data;
for (i = 0; i != tot_count; i++) {
len = (byte)*s;
*s++ = '\0'; // zero terminate the string before.
if (len >= 0xC0) len = ((len & 0x3F) << 8) + (byte)*s++;
langpack_offs[i] = s;
s += len;
}
free(_langpack);
_langpack = lang_pack;
free(_langpack_offs);
_langpack_offs = langpack_offs;
ttd_strlcpy(_dynlang.curr_file, _dynlang.ent[lang_index].file, sizeof(_dynlang.curr_file));
_dynlang.curr = lang_index;
return true;
}
// make a list of the available language packs. put the data in _dynlang struct.
void InitializeLanguagePacks(void)
{
DynamicLanguages *dl = &_dynlang;
int i;
int n;
int m;
int def;
LanguagePack hdr;
FILE *in;
char *files[32];
n = GetLanguageList(files, lengthof(files));
def = 0; // default language file
// go through the language files and make sure that they are valid.
for (i = m = 0; i != n; i++) {
int j;
char *s = str_fmt("%s%s", _path.lang_dir, files[i]);
in = fopen(s, "rb");
free(s);
if (in == NULL ||
(j = fread(&hdr, sizeof(hdr), 1, in), fclose(in), j) != 1 ||
hdr.ident != TO_LE32(LANGUAGE_PACK_IDENT) ||
hdr.version != TO_LE32(LANGUAGE_PACK_VERSION)) {
free(files[i]);
continue;
}
dl->ent[m].file = files[i];
dl->ent[m].name = strdup(hdr.name);
if (strcmp(hdr.name, "English") == 0) def = m;
m++;
}
if (m == 0)
error(n == 0 ? "No available language packs" : "Invalid version of language packs");
dl->num = m;
for (i = 0; i != dl->num; i++)
dl->dropdown[i] = SPECSTR_LANGUAGE_START + i;
dl->dropdown[i] = INVALID_STRING_ID;
for (i = 0; i != dl->num; i++)
if (strcmp(dl->ent[i].file, dl->curr_file) == 0) {
def = i;
break;
}
if (!ReadLanguagePack(def))
error("can't read language pack '%s'", dl->ent[def].file);
}
|