#include <stdio.h>#include "lintypes.h"Go to the source code of this file.
|
|
Definition at line 413 of file lin-city.h. |
|
|
Definition at line 271 of file lin-city.h. |
|
|
Definition at line 254 of file lin-city.h. |
|
|
Definition at line 374 of file lin-city.h. |
|
|
Definition at line 373 of file lin-city.h. |
|
|
Definition at line 372 of file lin-city.h. |
|
|
Definition at line 370 of file lin-city.h. |
|
|
Definition at line 366 of file lin-city.h. |
|
|
Definition at line 365 of file lin-city.h. |
|
|
Definition at line 369 of file lin-city.h. |
|
|
Definition at line 1105 of file lin-city.h. |
|
|
Definition at line 359 of file lin-city.h. |
|
|
Definition at line 462 of file lin-city.h. |
|
|
Definition at line 526 of file lin-city.h. |
|
|
Definition at line 520 of file lin-city.h. |
|
|
Definition at line 322 of file lin-city.h. |
|
|
Definition at line 385 of file lin-city.h. |
|
|
Definition at line 308 of file lin-city.h. |
|
|
Definition at line 535 of file lin-city.h. |
|
|
Definition at line 536 of file lin-city.h. |
|
|
Definition at line 423 of file lin-city.h. |
|
|
Definition at line 419 of file lin-city.h. |
|
|
Definition at line 416 of file lin-city.h. |
|
|
Definition at line 418 of file lin-city.h. |
|
|
Definition at line 498 of file lin-city.h. |
|
|
Definition at line 415 of file lin-city.h. |
|
|
Definition at line 421 of file lin-city.h. |
|
|
Definition at line 422 of file lin-city.h. |
|
|
Definition at line 250 of file lin-city.h. |
|
|
Definition at line 1107 of file lin-city.h. |
|
|
Definition at line 398 of file lin-city.h. |
|
|
Definition at line 399 of file lin-city.h. |
|
|
Definition at line 1011 of file lin-city.h. |
|
|
Definition at line 304 of file lin-city.h. |
|
|
Definition at line 311 of file lin-city.h. |
|
|
Definition at line 313 of file lin-city.h. |
|
|
Definition at line 508 of file lin-city.h. |
|
|
Definition at line 106 of file lin-city.h. |
|
|
Definition at line 538 of file lin-city.h. |
|
|
Definition at line 539 of file lin-city.h. |
|
|
Definition at line 324 of file lin-city.h. |
|
|
Definition at line 494 of file lin-city.h. |
|
|
Definition at line 341 of file lin-city.h. |
|
|
Definition at line 342 of file lin-city.h. |
|
|
Definition at line 343 of file lin-city.h. |
|
|
Definition at line 344 of file lin-city.h. |
|
|
Definition at line 345 of file lin-city.h. |
|
|
Definition at line 346 of file lin-city.h. |
|
|
Definition at line 74 of file lin-city.h. |
|
|
Definition at line 502 of file lin-city.h. |
|
|
Definition at line 218 of file lin-city.h. |
|
|
Definition at line 78 of file lin-city.h. |
|
|
Definition at line 1493 of file lin-city.h. |
|
|
Definition at line 1491 of file lin-city.h. |
|
|
Definition at line 1485 of file lin-city.h. |
|
|
Definition at line 1483 of file lin-city.h. |
|
|
Definition at line 1486 of file lin-city.h. |
|
|
Definition at line 1487 of file lin-city.h. |
|
|
Definition at line 1484 of file lin-city.h. |
|
|
Definition at line 1492 of file lin-city.h. |
|
|
Definition at line 1490 of file lin-city.h. |
|
|
Definition at line 1489 of file lin-city.h. |
|
|
Definition at line 1488 of file lin-city.h. |
|
|
Definition at line 1482 of file lin-city.h. |
|
|
Definition at line 320 of file lin-city.h. |
|
|
Definition at line 318 of file lin-city.h. |
|
|
Definition at line 317 of file lin-city.h. |
|
|
Definition at line 319 of file lin-city.h. |
|
|
Definition at line 410 of file lin-city.h. |
|
|
Definition at line 411 of file lin-city.h. |
|
|
Definition at line 412 of file lin-city.h. |
|
|
Definition at line 409 of file lin-city.h. |
|
|
Definition at line 404 of file lin-city.h. |
|
|
Definition at line 401 of file lin-city.h. |
|
|
Definition at line 403 of file lin-city.h. |
|
|
Definition at line 400 of file lin-city.h. |
|
|
Definition at line 406 of file lin-city.h. |
|
|
Definition at line 407 of file lin-city.h. |
|
|
Definition at line 408 of file lin-city.h. |
|
|
Definition at line 164 of file lin-city.h. |
|
|
Definition at line 145 of file lin-city.h. |
|
|
Definition at line 148 of file lin-city.h. |
|
|
Definition at line 147 of file lin-city.h. |
|
|
Definition at line 162 of file lin-city.h. |
|
|
Definition at line 166 of file lin-city.h. |
|
|
Definition at line 163 of file lin-city.h. |
|
|
Definition at line 165 of file lin-city.h. |
|
|
Definition at line 149 of file lin-city.h. |
|
|
Definition at line 142 of file lin-city.h. |
|
|
Definition at line 154 of file lin-city.h. |
|
|
Definition at line 150 of file lin-city.h. |
|
|
Definition at line 158 of file lin-city.h. |
|
|
Definition at line 152 of file lin-city.h. |
|
|
Definition at line 156 of file lin-city.h. |
|
|
Definition at line 160 of file lin-city.h. |
|
|
Definition at line 155 of file lin-city.h. |
|
|
Definition at line 151 of file lin-city.h. |
|
|
Definition at line 159 of file lin-city.h. |
|
|
Definition at line 153 of file lin-city.h. |
|
|
Definition at line 157 of file lin-city.h. |
|
|
Definition at line 161 of file lin-city.h. |
|
|
Definition at line 168 of file lin-city.h. |
|
|
Definition at line 167 of file lin-city.h. |
|
|
Definition at line 169 of file lin-city.h. |
|
|
Definition at line 146 of file lin-city.h. |
|
|
Definition at line 144 of file lin-city.h. |
|
|
Definition at line 143 of file lin-city.h. |
|
|
Definition at line 384 of file lin-city.h. |
|
|
Definition at line 100 of file lin-city.h. |
|
|
Definition at line 99 of file lin-city.h. |
|
|
Definition at line 98 of file lin-city.h. |
|
|
Definition at line 253 of file lin-city.h. |
|
|
Definition at line 371 of file lin-city.h. |
|
|
Definition at line 380 of file lin-city.h. |
|
|
Definition at line 392 of file lin-city.h. |
|
|
Definition at line 464 of file lin-city.h. |
|
|
Definition at line 323 of file lin-city.h. |
|
|
Definition at line 627 of file lin-city.h. |
|
|
Definition at line 1103 of file lin-city.h. |
|
|
Definition at line 666 of file lin-city.h. |
|
|
Definition at line 670 of file lin-city.h. |
|
|
Definition at line 667 of file lin-city.h. |
|
|
Definition at line 668 of file lin-city.h. |
|
|
Definition at line 669 of file lin-city.h. |
|
|
Definition at line 672 of file lin-city.h. |
|
|
Definition at line 671 of file lin-city.h. |
|
|
Definition at line 953 of file lin-city.h. |
|
|
Definition at line 957 of file lin-city.h. |
|
|
Definition at line 954 of file lin-city.h. |
|
|
Definition at line 955 of file lin-city.h. |
|
|
Definition at line 956 of file lin-city.h. |
|
|
Definition at line 959 of file lin-city.h. |
|
|
Definition at line 958 of file lin-city.h. |
|
|
Definition at line 993 of file lin-city.h. |
|
|
Definition at line 997 of file lin-city.h. |
|
|
Definition at line 994 of file lin-city.h. |
|
|
Definition at line 995 of file lin-city.h. |
|
|
Definition at line 996 of file lin-city.h. |
|
|
Definition at line 999 of file lin-city.h. |
|
|
Definition at line 998 of file lin-city.h. |
|
|
Definition at line 812 of file lin-city.h. |
|
|
Definition at line 816 of file lin-city.h. |
|
|
Definition at line 813 of file lin-city.h. |
|
|
Definition at line 814 of file lin-city.h. |
|
|
Definition at line 815 of file lin-city.h. |
|
|
Definition at line 818 of file lin-city.h. |
|
|
Definition at line 817 of file lin-city.h. |
|
|
Definition at line 796 of file lin-city.h. |
|
|
Definition at line 800 of file lin-city.h. |
|
|
Definition at line 797 of file lin-city.h. |
|
|
Definition at line 798 of file lin-city.h. |
|
|
Definition at line 799 of file lin-city.h. |
|
|
Definition at line 802 of file lin-city.h. |
|
|
Definition at line 801 of file lin-city.h. |
|
|
Definition at line 845 of file lin-city.h. |
|
|
Definition at line 849 of file lin-city.h. |
|
|
Definition at line 846 of file lin-city.h. |
|
|
Definition at line 847 of file lin-city.h. |
|
|
Definition at line 848 of file lin-city.h. |
|
|
Definition at line 851 of file lin-city.h. |
|
|
Definition at line 850 of file lin-city.h. |
|
|
Definition at line 985 of file lin-city.h. |
|
|
Definition at line 989 of file lin-city.h. |
|
|
Definition at line 986 of file lin-city.h. |
|
|
Definition at line 987 of file lin-city.h. |
|
|
Definition at line 988 of file lin-city.h. |
|
|
Definition at line 991 of file lin-city.h. |
|
|
Definition at line 990 of file lin-city.h. |
|
|
Definition at line 1019 of file lin-city.h. |
|
|
Definition at line 1023 of file lin-city.h. |
|
|
Definition at line 1020 of file lin-city.h. |
|
|
Definition at line 1021 of file lin-city.h. |
|
|
Definition at line 1022 of file lin-city.h. |
|
|
Definition at line 1025 of file lin-city.h. |
|
|
Definition at line 1024 of file lin-city.h. |
|
|
Definition at line 977 of file lin-city.h. |
|
|
Definition at line 981 of file lin-city.h. |
|
|
Definition at line 978 of file lin-city.h. |
|
|
Definition at line 979 of file lin-city.h. |
|
|
Definition at line 980 of file lin-city.h. |
|
|
Definition at line 983 of file lin-city.h. |
|
|
Definition at line 982 of file lin-city.h. |
|
|
Definition at line 912 of file lin-city.h. |
|
|
Definition at line 916 of file lin-city.h. |
|
|
Definition at line 913 of file lin-city.h. |
|
|
Definition at line 914 of file lin-city.h. |
|
|
Definition at line 915 of file lin-city.h. |
|
|
Definition at line 918 of file lin-city.h. |
|
|
Definition at line 917 of file lin-city.h. |
|
|
Definition at line 877 of file lin-city.h. |
|
|
Definition at line 881 of file lin-city.h. |
|
|
Definition at line 878 of file lin-city.h. |
|
|
Definition at line 879 of file lin-city.h. |
|
|
Definition at line 880 of file lin-city.h. |
|
|
Definition at line 883 of file lin-city.h. |
|
|
Definition at line 882 of file lin-city.h. |
|
|
Definition at line 828 of file lin-city.h. |
|
|
Definition at line 832 of file lin-city.h. |
|
|
Definition at line 829 of file lin-city.h. |
|
|
Definition at line 830 of file lin-city.h. |
|
|
Definition at line 831 of file lin-city.h. |
|
|
Definition at line 834 of file lin-city.h. |
|
|
Definition at line 833 of file lin-city.h. |
|
|
Value: ((group == GROUP_RESIDENCE_LL) || \
(group == GROUP_RESIDENCE_ML) || \
(group == GROUP_RESIDENCE_HL) || \
(group == GROUP_RESIDENCE_LH) || \
(group == GROUP_RESIDENCE_MH) || \
(group == GROUP_RESIDENCE_HH))
Definition at line 1081 of file lin-city.h. |
|
|
Value: ((group == GROUP_TRACK) || \
(group == GROUP_ROAD) || \
(group == GROUP_RAIL) || \
(group == GROUP_POWER_LINE))
Definition at line 1075 of file lin-city.h. |
|
|
Definition at line 780 of file lin-city.h. |
|
|
Definition at line 784 of file lin-city.h. |
|
|
Definition at line 781 of file lin-city.h. |
|
|
Definition at line 782 of file lin-city.h. |
|
|
Definition at line 783 of file lin-city.h. |
|
|
Definition at line 786 of file lin-city.h. |
|
|
Definition at line 785 of file lin-city.h. |
|
|
Definition at line 961 of file lin-city.h. |
|
|
Definition at line 965 of file lin-city.h. |
|
|
Definition at line 962 of file lin-city.h. |
|
|
Definition at line 963 of file lin-city.h. |
|
|
Definition at line 964 of file lin-city.h. |
|
|
Definition at line 967 of file lin-city.h. |
|
|
Definition at line 966 of file lin-city.h. |
|
|
Definition at line 937 of file lin-city.h. |
|
|
Definition at line 941 of file lin-city.h. |
|
|
Definition at line 938 of file lin-city.h. |
|
|
Definition at line 939 of file lin-city.h. |
|
|
Definition at line 940 of file lin-city.h. |
|
|
Definition at line 943 of file lin-city.h. |
|
|
Definition at line 942 of file lin-city.h. |
|
|
Definition at line 853 of file lin-city.h. |
|
|
Definition at line 857 of file lin-city.h. |
|
|
Definition at line 854 of file lin-city.h. |
|
|
Definition at line 855 of file lin-city.h. |
|
|
Definition at line 856 of file lin-city.h. |
|
|
Definition at line 859 of file lin-city.h. |
|
|
Definition at line 858 of file lin-city.h. |
|
|
Definition at line 772 of file lin-city.h. |
|
|
Definition at line 776 of file lin-city.h. |
|
|
Definition at line 773 of file lin-city.h. |
|
|
Definition at line 774 of file lin-city.h. |
|
|
Definition at line 775 of file lin-city.h. |
|
|
Definition at line 778 of file lin-city.h. |
|
|
Definition at line 777 of file lin-city.h. |
|
|
Definition at line 885 of file lin-city.h. |
|
|
Definition at line 889 of file lin-city.h. |
|
|
Definition at line 886 of file lin-city.h. |
|
|
Definition at line 887 of file lin-city.h. |
|
|
Definition at line 888 of file lin-city.h. |
|
|
Definition at line 892 of file lin-city.h. |
|
|
Definition at line 891 of file lin-city.h. |
|
|
Definition at line 890 of file lin-city.h. |
|
|
Definition at line 869 of file lin-city.h. |
|
|
Definition at line 873 of file lin-city.h. |
|
|
Definition at line 870 of file lin-city.h. |
|
|
Definition at line 871 of file lin-city.h. |
|
|
Definition at line 872 of file lin-city.h. |
|
|
Definition at line 875 of file lin-city.h. |
|
|
Definition at line 874 of file lin-city.h. |
|
|
Definition at line 969 of file lin-city.h. |
|
|
Definition at line 973 of file lin-city.h. |
|
|
Definition at line 970 of file lin-city.h. |
|
|
Definition at line 971 of file lin-city.h. |
|
|
Definition at line 972 of file lin-city.h. |
|
|
Definition at line 975 of file lin-city.h. |
|
|
Definition at line 974 of file lin-city.h. |
|
|
Definition at line 674 of file lin-city.h. |
|
|
Definition at line 678 of file lin-city.h. |
|
|
Definition at line 675 of file lin-city.h. |
|
|
Definition at line 676 of file lin-city.h. |
|
|
Definition at line 677 of file lin-city.h. |
|
|
Definition at line 680 of file lin-city.h. |
|
|
Definition at line 679 of file lin-city.h. |
|
|
Definition at line 804 of file lin-city.h. |
|
|
Definition at line 808 of file lin-city.h. |
|
|
Definition at line 805 of file lin-city.h. |
|
|
Definition at line 806 of file lin-city.h. |
|
|
Definition at line 807 of file lin-city.h. |
|
|
Definition at line 810 of file lin-city.h. |
|
|
Definition at line 809 of file lin-city.h. |
|
|
Definition at line 894 of file lin-city.h. |
|
|
Definition at line 898 of file lin-city.h. |
|
|
Definition at line 895 of file lin-city.h. |
|
|
Definition at line 896 of file lin-city.h. |
|
|
Definition at line 897 of file lin-city.h. |
|
|
Definition at line 901 of file lin-city.h. |
|
|
Definition at line 900 of file lin-city.h. |
|
|
Definition at line 899 of file lin-city.h. |
|
|
Definition at line 1067 of file lin-city.h. |
|
|
Definition at line 1071 of file lin-city.h. |
|
|
Definition at line 1068 of file lin-city.h. |
|
|
Definition at line 1069 of file lin-city.h. |
|
|
Definition at line 1070 of file lin-city.h. |
|
|
Definition at line 1073 of file lin-city.h. |
|
|
Definition at line 1072 of file lin-city.h. |
|
|
Definition at line 1043 of file lin-city.h. |
|
|
Definition at line 1047 of file lin-city.h. |
|
|
Definition at line 1044 of file lin-city.h. |
|
|
Definition at line 1045 of file lin-city.h. |
|
|
Definition at line 1046 of file lin-city.h. |
|
|
Definition at line 1049 of file lin-city.h. |
|
|
Definition at line 1048 of file lin-city.h. |
|
|
Definition at line 1051 of file lin-city.h. |
|
|
Definition at line 1055 of file lin-city.h. |
|
|
Definition at line 1052 of file lin-city.h. |
|
|
Definition at line 1053 of file lin-city.h. |
|
|
Definition at line 1054 of file lin-city.h. |
|
|
Definition at line 1057 of file lin-city.h. |
|
|
Definition at line 1056 of file lin-city.h. |
|
|
Definition at line 1089 of file lin-city.h. |
|
|
Definition at line 1089 of file lin-city.h. |
|
|
Definition at line 1093 of file lin-city.h. |
|
|
Definition at line 1093 of file lin-city.h. |
|
|
Definition at line 1090 of file lin-city.h. |
|
|
Definition at line 1090 of file lin-city.h. |
|
|
Definition at line 1091 of file lin-city.h. |
|
|
Definition at line 1091 of file lin-city.h. |
|
|
Definition at line 1092 of file lin-city.h. |
|
|
Definition at line 1092 of file lin-city.h. |
|
|
Definition at line 1095 of file lin-city.h. |
|
|
Definition at line 1095 of file lin-city.h. |
|
|
Definition at line 1094 of file lin-city.h. |
|
|
Definition at line 1094 of file lin-city.h. |
|
|
Definition at line 1059 of file lin-city.h. |
|
|
Definition at line 1063 of file lin-city.h. |
|
|
Definition at line 1060 of file lin-city.h. |
|
|
Definition at line 1061 of file lin-city.h. |
|
|
Definition at line 1062 of file lin-city.h. |
|
|
Definition at line 1065 of file lin-city.h. |
|
|
Definition at line 1064 of file lin-city.h. |
|
|
Definition at line 1035 of file lin-city.h. |
|
|
Definition at line 1039 of file lin-city.h. |
|
|
Definition at line 1036 of file lin-city.h. |
|
|
Definition at line 1037 of file lin-city.h. |
|
|
Definition at line 1038 of file lin-city.h. |
|
|
Definition at line 1041 of file lin-city.h. |
|
|
Definition at line 1040 of file lin-city.h. |
|
|
Definition at line 909 of file lin-city.h. |
|
|
Definition at line 820 of file lin-city.h. |
|
|
Definition at line 824 of file lin-city.h. |
|
|
Definition at line 821 of file lin-city.h. |
|
|
Definition at line 822 of file lin-city.h. |
|
|
Definition at line 823 of file lin-city.h. |
|
|
Definition at line 826 of file lin-city.h. |
|
|
Definition at line 825 of file lin-city.h. |
|
|
Definition at line 920 of file lin-city.h. |
|
|
Definition at line 924 of file lin-city.h. |
|
|
Definition at line 921 of file lin-city.h. |
|
|
Definition at line 922 of file lin-city.h. |
|
|
Definition at line 923 of file lin-city.h. |
|
|
Definition at line 927 of file lin-city.h. |
|
|
Definition at line 926 of file lin-city.h. |
|
|
Definition at line 925 of file lin-city.h. |
|
|
Definition at line 945 of file lin-city.h. |
|
|
Definition at line 949 of file lin-city.h. |
|
|
Definition at line 946 of file lin-city.h. |
|
|
Definition at line 947 of file lin-city.h. |
|
|
Definition at line 948 of file lin-city.h. |
|
|
Definition at line 951 of file lin-city.h. |
|
|
Definition at line 950 of file lin-city.h. |
|
|
Definition at line 1001 of file lin-city.h. |
|
|
Definition at line 1005 of file lin-city.h. |
|
|
Definition at line 1002 of file lin-city.h. |
|
|
Definition at line 1003 of file lin-city.h. |
|
|
Definition at line 1004 of file lin-city.h. |
|
|
Definition at line 1007 of file lin-city.h. |
|
|
Definition at line 1006 of file lin-city.h. |
|
|
Definition at line 694 of file lin-city.h. |
|
|
Definition at line 698 of file lin-city.h. |
|
|
Definition at line 695 of file lin-city.h. |
|
|
Definition at line 696 of file lin-city.h. |
|
|
Definition at line 697 of file lin-city.h. |
|
|
Definition at line 701 of file lin-city.h. |
|
|
Definition at line 700 of file lin-city.h. |
|
|
Definition at line 699 of file lin-city.h. |
|
|
Definition at line 703 of file lin-city.h. |
|
|
Definition at line 707 of file lin-city.h. |
|
|
Definition at line 704 of file lin-city.h. |
|
|
Definition at line 705 of file lin-city.h. |
|
|
Definition at line 706 of file lin-city.h. |
|
|
Definition at line 709 of file lin-city.h. |
|
|
Definition at line 708 of file lin-city.h. |
|
|
Definition at line 861 of file lin-city.h. |
|
|
Definition at line 865 of file lin-city.h. |
|
|
Definition at line 862 of file lin-city.h. |
|
|
Definition at line 863 of file lin-city.h. |
|
|
Definition at line 864 of file lin-city.h. |
|
|
Definition at line 867 of file lin-city.h. |
|
|
Definition at line 866 of file lin-city.h. |
|
|
Definition at line 788 of file lin-city.h. |
|
|
Definition at line 792 of file lin-city.h. |
|
|
Definition at line 789 of file lin-city.h. |
|
|
Definition at line 790 of file lin-city.h. |
|
|
Definition at line 791 of file lin-city.h. |
|
|
Definition at line 794 of file lin-city.h. |
|
|
Definition at line 793 of file lin-city.h. |
|
|
Definition at line 836 of file lin-city.h. |
|
|
Definition at line 840 of file lin-city.h. |
|
|
Definition at line 837 of file lin-city.h. |
|
|
Definition at line 838 of file lin-city.h. |
|
|
Definition at line 839 of file lin-city.h. |
|
|
Definition at line 843 of file lin-city.h. |
|
|
Definition at line 842 of file lin-city.h. |
|
|
Definition at line 841 of file lin-city.h. |
|
|
Definition at line 1027 of file lin-city.h. |
|
|
Definition at line 1031 of file lin-city.h. |
|
|
Definition at line 1028 of file lin-city.h. |
|
|
Definition at line 1029 of file lin-city.h. |
|
|
Definition at line 1030 of file lin-city.h. |
|
|
Definition at line 1033 of file lin-city.h. |
|
|
Definition at line 1032 of file lin-city.h. |
|
|
Definition at line 903 of file lin-city.h. |
|
|
Definition at line 907 of file lin-city.h. |
|
|
Definition at line 904 of file lin-city.h. |
|
|
Definition at line 905 of file lin-city.h. |
|
|
Definition at line 906 of file lin-city.h. |
|
|
Definition at line 910 of file lin-city.h. |
|
|
Definition at line 908 of file lin-city.h. |
|
|
Definition at line 929 of file lin-city.h. |
|
|
Definition at line 933 of file lin-city.h. |
|
|
Definition at line 930 of file lin-city.h. |
|
|
Definition at line 931 of file lin-city.h. |
|
|
Definition at line 932 of file lin-city.h. |
|
|
Definition at line 935 of file lin-city.h. |
|
|
Definition at line 934 of file lin-city.h. |
|
|
Definition at line 497 of file lin-city.h. |
|
|
Definition at line 472 of file lin-city.h. |
|
|
Definition at line 469 of file lin-city.h. |
|
|
Definition at line 471 of file lin-city.h. |
|
|
Definition at line 468 of file lin-city.h. |
|
|
Definition at line 476 of file lin-city.h. |
|
|
Definition at line 474 of file lin-city.h. |
|
|
Definition at line 475 of file lin-city.h. |
|
|
Definition at line 245 of file lin-city.h. |
|
|
Definition at line 246 of file lin-city.h. |
|
|
Definition at line 244 of file lin-city.h. |
|
|
Definition at line 184 of file lin-city.h. |
|
|
Definition at line 185 of file lin-city.h. |
|
|
Definition at line 326 of file lin-city.h. |
|
|
Definition at line 321 of file lin-city.h. |
|
|
Definition at line 302 of file lin-city.h. |
|
|
Definition at line 307 of file lin-city.h. |
|
|
Definition at line 296 of file lin-city.h. |
|
|
Definition at line 284 of file lin-city.h. |
|
|
Definition at line 285 of file lin-city.h. |
|
|
Definition at line 286 of file lin-city.h. |
|
|
Definition at line 287 of file lin-city.h. |
|
|
Definition at line 288 of file lin-city.h. |
|
|
Definition at line 291 of file lin-city.h. |
|
|
Definition at line 292 of file lin-city.h. |
|
|
Definition at line 289 of file lin-city.h. |
|
|
Definition at line 306 of file lin-city.h. |
|
|
Definition at line 290 of file lin-city.h. |
|
|
Definition at line 223 of file lin-city.h. |
|
|
Definition at line 496 of file lin-city.h. |
|
|
Definition at line 534 of file lin-city.h. |
|
|
Definition at line 529 of file lin-city.h. |
|
|
Definition at line 527 of file lin-city.h. |
|
|
Definition at line 528 of file lin-city.h. |
|
|
Definition at line 531 of file lin-city.h. |
|
|
Definition at line 532 of file lin-city.h. |
|
|
Definition at line 533 of file lin-city.h. |
|
|
Definition at line 573 of file lin-city.h. |
|
|
Definition at line 391 of file lin-city.h. |
|
|
Definition at line 209 of file lin-city.h. |
|
|
Definition at line 210 of file lin-city.h. |
|
|
Definition at line 131 of file lin-city.h. |
|
|
Definition at line 82 of file lin-city.h. |
|
|
Definition at line 1106 of file lin-city.h. |
|
|
Definition at line 199 of file lin-city.h. |
|
|
Definition at line 198 of file lin-city.h. |
|
|
Definition at line 493 of file lin-city.h. |
|
|
Definition at line 636 of file lin-city.h. |
|
|
Definition at line 635 of file lin-city.h. |
|
|
Definition at line 545 of file lin-city.h. |
|
|
Definition at line 486 of file lin-city.h. |
|
|
Definition at line 554 of file lin-city.h. |
|
|
Definition at line 492 of file lin-city.h. |
|
|
Definition at line 560 of file lin-city.h. |
|
|
Definition at line 480 of file lin-city.h. |
|
|
Definition at line 580 of file lin-city.h. |
|
|
Definition at line 514 of file lin-city.h. |
|
|
Definition at line 368 of file lin-city.h. |
|
|
Definition at line 299 of file lin-city.h. |
|
|
Definition at line 379 of file lin-city.h. |
|
|
Definition at line 523 of file lin-city.h. |
|
|
Definition at line 431 of file lin-city.h. |
|
|
Definition at line 280 of file lin-city.h. |
|
|
Definition at line 544 of file lin-city.h. |
|
|
Definition at line 543 of file lin-city.h. |
|
|
Definition at line 541 of file lin-city.h. |
|
|
Definition at line 542 of file lin-city.h. |
|
|
Definition at line 540 of file lin-city.h. |
|
|
Definition at line 378 of file lin-city.h. |
|
|
Definition at line 485 of file lin-city.h. |
|
|
Definition at line 484 of file lin-city.h. |
|
|
Definition at line 482 of file lin-city.h. |
|
|
Definition at line 483 of file lin-city.h. |
|
|
Definition at line 481 of file lin-city.h. |
|
|
Definition at line 367 of file lin-city.h. |
|
|
Definition at line 420 of file lin-city.h. |
|
|
Definition at line 405 of file lin-city.h. |
|
|
Definition at line 473 of file lin-city.h. |
|
|
Definition at line 283 of file lin-city.h. |
|
|
Definition at line 377 of file lin-city.h. |
|
|
Definition at line 425 of file lin-city.h. |
|
|
Definition at line 395 of file lin-city.h. |
|
|
Definition at line 553 of file lin-city.h. |
|
|
Definition at line 551 of file lin-city.h. |
|
|
Definition at line 548 of file lin-city.h. |
|
|
Definition at line 549 of file lin-city.h. |
|
|
Definition at line 547 of file lin-city.h. |
|
|
Definition at line 249 of file lin-city.h. |
|
|
Definition at line 214 of file lin-city.h. |
|
|
Definition at line 530 of file lin-city.h. |
|
|
Definition at line 417 of file lin-city.h. |
|
|
Definition at line 402 of file lin-city.h. |
|
|
Definition at line 470 of file lin-city.h. |
|
|
Definition at line 282 of file lin-city.h. |
|
|
Definition at line 433 of file lin-city.h. |
|
|
Definition at line 394 of file lin-city.h. |
|
|
Definition at line 491 of file lin-city.h. |
|
|
Definition at line 490 of file lin-city.h. |
|
|
Definition at line 488 of file lin-city.h. |
|
|
Definition at line 489 of file lin-city.h. |
|
|
Definition at line 487 of file lin-city.h. |
|
|
Definition at line 248 of file lin-city.h. |
|
|
Definition at line 300 of file lin-city.h. |
|
|
Definition at line 247 of file lin-city.h. |
|
|
Definition at line 479 of file lin-city.h. |
|
|
Definition at line 275 of file lin-city.h. |
|
|
Definition at line 298 of file lin-city.h. |
|
|
Definition at line 281 of file lin-city.h. |
|
|
Definition at line 524 of file lin-city.h. |
|
|
Definition at line 429 of file lin-city.h. |
|
|
Definition at line 463 of file lin-city.h. |
|
|
Definition at line 559 of file lin-city.h. |
|
|
Definition at line 558 of file lin-city.h. |
|
|
Definition at line 556 of file lin-city.h. |
|
|
Definition at line 557 of file lin-city.h. |
|
|
Definition at line 555 of file lin-city.h. |
|
|
Definition at line 568 of file lin-city.h. |
|
|
Definition at line 293 of file lin-city.h. |
|
|
Definition at line 579 of file lin-city.h. |
|
|
Definition at line 566 of file lin-city.h. |
|
|
Definition at line 564 of file lin-city.h. |
|
|
Definition at line 565 of file lin-city.h. |
|
|
Definition at line 563 of file lin-city.h. |
|
|
Definition at line 349 of file lin-city.h. |
|
|
Definition at line 461 of file lin-city.h. |
|
|
Definition at line 515 of file lin-city.h. |
|
|
Definition at line 513 of file lin-city.h. |
|
|
Definition at line 512 of file lin-city.h. |
|
|
Definition at line 511 of file lin-city.h. |
|
|
Definition at line 510 of file lin-city.h. |
|
|
Definition at line 219 of file lin-city.h. |
|
|
Definition at line 58 of file lin-city.h. |
|
|
Definition at line 387 of file lin-city.h. |
|
|
Definition at line 386 of file lin-city.h. |
|
|
Definition at line 382 of file lin-city.h. |
|
|
Definition at line 381 of file lin-city.h. |
|
|
Definition at line 376 of file lin-city.h. |
|
|
Definition at line 383 of file lin-city.h. |
|
|
Definition at line 507 of file lin-city.h. |
|
|
Value: (INDUSTRY_L_JOBS_LOAD_ORE\ +INDUSTRY_L_JOBS_LOAD_STEEL+INDUSTRY_L_JOBS_USED) Definition at line 294 of file lin-city.h. |
|
|
Definition at line 52 of file lin-city.h. |
|
|
Definition at line 522 of file lin-city.h. |
|
|
Definition at line 348 of file lin-city.h. |
|
|
Definition at line 196 of file lin-city.h. |
|
|
Definition at line 194 of file lin-city.h. |
|
|
Definition at line 193 of file lin-city.h. |
|
|
Definition at line 195 of file lin-city.h. |
|
|
Definition at line 187 of file lin-city.h. |
|
|
Definition at line 188 of file lin-city.h. |
|
|
Definition at line 191 of file lin-city.h. |
|
|
Definition at line 192 of file lin-city.h. |
|
|
Definition at line 190 of file lin-city.h. |
|
|
Definition at line 189 of file lin-city.h. |
|
|
Definition at line 55 of file lin-city.h. |
|
|
Definition at line 272 of file lin-city.h. |
|
|
Definition at line 357 of file lin-city.h. |
|
|
Definition at line 32 of file lin-city.h. |
|
|
Definition at line 363 of file lin-city.h. |
|
|
Definition at line 361 of file lin-city.h. |
|
|
Definition at line 360 of file lin-city.h. |
|
|
Definition at line 362 of file lin-city.h. |
|
|
Definition at line 1100 of file lin-city.h. |
|
|
Definition at line 20 of file lin-city.h. |
|
|
Definition at line 1098 of file lin-city.h. |
|
|
Definition at line 1099 of file lin-city.h. |
|
|
Definition at line 181 of file lin-city.h. |
|
|
Definition at line 179 of file lin-city.h. |
|
|
Definition at line 180 of file lin-city.h. |
|
|
Definition at line 182 of file lin-city.h. |
|
|
Definition at line 519 of file lin-city.h. |
|
|
Definition at line 216 of file lin-city.h. |
|
|
Definition at line 217 of file lin-city.h. |
|
|
Definition at line 340 of file lin-city.h. |
|
|
Definition at line 133 of file lin-city.h. |
|
|
Definition at line 202 of file lin-city.h. |
|
|
Definition at line 478 of file lin-city.h. |
|
|
Definition at line 274 of file lin-city.h. |
|
|
Definition at line 578 of file lin-city.h. |
|
|
Definition at line 521 of file lin-city.h. |
|
|
Definition at line 504 of file lin-city.h. |
|
|
Definition at line 503 of file lin-city.h. |
|
|
Definition at line 506 of file lin-city.h. |
|
|
Definition at line 501 of file lin-city.h. |
|
|
Definition at line 500 of file lin-city.h. |
|
|
Definition at line 64 of file lin-city.h. |
|
|
Definition at line 65 of file lin-city.h. |
|
|
Definition at line 315 of file lin-city.h. |
|
|
Definition at line 329 of file lin-city.h. |
|
|
Definition at line 337 of file lin-city.h. |
|
|
Definition at line 327 of file lin-city.h. |
|
|
Definition at line 331 of file lin-city.h. |
|
|
Definition at line 338 of file lin-city.h. |
|
|
Definition at line 328 of file lin-city.h. |
|
|
Definition at line 330 of file lin-city.h. |
|
|
Definition at line 309 of file lin-city.h. |
|
|
Definition at line 332 of file lin-city.h. |
|
|
Definition at line 436 of file lin-city.h. |
|
|
Definition at line 437 of file lin-city.h. |
|
|
Definition at line 427 of file lin-city.h. |
|
|
Definition at line 432 of file lin-city.h. |
|
|
Definition at line 434 of file lin-city.h. |
|
|
Definition at line 430 of file lin-city.h. |
|
|
Definition at line 428 of file lin-city.h. |
|
|
Definition at line 435 of file lin-city.h. |
|
|
Definition at line 426 of file lin-city.h. |
|
|
Definition at line 265 of file lin-city.h. |
|
|
Definition at line 301 of file lin-city.h. |
|
|
Definition at line 278 of file lin-city.h. |
|
|
Definition at line 277 of file lin-city.h. |
|
|
Definition at line 279 of file lin-city.h. |
|
|
Definition at line 305 of file lin-city.h. |
|
|
Definition at line 266 of file lin-city.h. |
|
|
Definition at line 102 of file lin-city.h. |
|
|
Definition at line 261 of file lin-city.h. |
|
|
Definition at line 262 of file lin-city.h. |
|
|
Definition at line 263 of file lin-city.h. |
|
|
Definition at line 260 of file lin-city.h. |
|
|
Definition at line 259 of file lin-city.h. |
|
|
Definition at line 257 of file lin-city.h. |
|
|
Definition at line 258 of file lin-city.h. |
|
|
Definition at line 552 of file lin-city.h. |
|
|
Definition at line 310 of file lin-city.h. |
|
|
Definition at line 567 of file lin-city.h. |
|
|
Definition at line 465 of file lin-city.h. |
|
|
Definition at line 466 of file lin-city.h. |
|
|
Definition at line 1102 of file lin-city.h. |
|
|
Definition at line 757 of file lin-city.h. |
|
|
Definition at line 758 of file lin-city.h. |
|
|
Definition at line 759 of file lin-city.h. |
|
|
Definition at line 760 of file lin-city.h. |
|
|
Definition at line 761 of file lin-city.h. |
|
|
Definition at line 762 of file lin-city.h. |
|
|
Definition at line 763 of file lin-city.h. |
|
|
Definition at line 764 of file lin-city.h. |
|
|
Definition at line 765 of file lin-city.h. |
|
|
Definition at line 766 of file lin-city.h. |
|
|
Definition at line 767 of file lin-city.h. |
|
|
Definition at line 768 of file lin-city.h. |
|
|
Definition at line 754 of file lin-city.h. |
|
|
Definition at line 755 of file lin-city.h. |
|
|
Definition at line 756 of file lin-city.h. |
|
|
Definition at line 770 of file lin-city.h. |
|
|
Definition at line 255 of file lin-city.h. |
|
|
Definition at line 212 of file lin-city.h. |
|
|
Definition at line 251 of file lin-city.h. |
|
|
Definition at line 550 of file lin-city.h. |
|
|
Definition at line 312 of file lin-city.h. |
|
|
Definition at line 454 of file lin-city.h. |
|
|
Definition at line 455 of file lin-city.h. |
|
|
Definition at line 457 of file lin-city.h. |
|
|
Definition at line 456 of file lin-city.h. |
|
|
Definition at line 448 of file lin-city.h. |
|
|
Definition at line 449 of file lin-city.h. |
|
|
Definition at line 446 of file lin-city.h. |
|
|
Definition at line 447 of file lin-city.h. |
|
|
Definition at line 453 of file lin-city.h. |
|
|
Definition at line 452 of file lin-city.h. |
|
|
Definition at line 450 of file lin-city.h. |
|
|
Definition at line 451 of file lin-city.h. |
|
|
Definition at line 132 of file lin-city.h. |
|
|
Definition at line 390 of file lin-city.h. |
|
|
Definition at line 389 of file lin-city.h. |
|
|
Definition at line 396 of file lin-city.h. |
|
|
Definition at line 650 of file lin-city.h. |
|
|
Definition at line 648 of file lin-city.h. |
|
|
Definition at line 647 of file lin-city.h. |
|
|
Definition at line 649 of file lin-city.h. |
|
|
Definition at line 646 of file lin-city.h. |
|
|
Definition at line 644 of file lin-city.h. |
|
|
Definition at line 643 of file lin-city.h. |
|
|
Definition at line 645 of file lin-city.h. |
|
|
Definition at line 638 of file lin-city.h. |
|
|
Definition at line 642 of file lin-city.h. |
|
|
Definition at line 640 of file lin-city.h. |
|
|
Definition at line 639 of file lin-city.h. |
|
|
Definition at line 641 of file lin-city.h. |
|
|
Definition at line 654 of file lin-city.h. |
|
|
Definition at line 652 of file lin-city.h. |
|
|
Definition at line 651 of file lin-city.h. |
|
|
Definition at line 653 of file lin-city.h. |
|
|
Definition at line 201 of file lin-city.h. |
|
|
Definition at line 1015 of file lin-city.h. |
|
|
Definition at line 1012 of file lin-city.h. |
|
|
Definition at line 1014 of file lin-city.h. |
|
|
Definition at line 1013 of file lin-city.h. |
|
|
Definition at line 1016 of file lin-city.h. |
|
|
Definition at line 1017 of file lin-city.h. |
|
|
Definition at line 1009 of file lin-city.h. |
|
|
Definition at line 1010 of file lin-city.h. |
|
|
Definition at line 656 of file lin-city.h. |
|
|
Definition at line 220 of file lin-city.h. |
|
|
Definition at line 39 of file lin-city.h. |
|
|
Definition at line 608 of file lin-city.h. |
|
|
Definition at line 607 of file lin-city.h. |
|
|
Definition at line 605 of file lin-city.h. |
|
|
Definition at line 606 of file lin-city.h. |
|
|
Definition at line 276 of file lin-city.h. |
|
|
Definition at line 594 of file lin-city.h. |
|
|
Definition at line 600 of file lin-city.h. |
|
|
Definition at line 602 of file lin-city.h. |
|
|
Definition at line 603 of file lin-city.h. |
|
|
Definition at line 591 of file lin-city.h. |
|
|
Definition at line 597 of file lin-city.h. |
|
|
Definition at line 589 of file lin-city.h. |
|
|
Definition at line 595 of file lin-city.h. |
|
|
Definition at line 592 of file lin-city.h. |
|
|
Definition at line 598 of file lin-city.h. |
|
|
Definition at line 590 of file lin-city.h. |
|
|
Definition at line 596 of file lin-city.h. |
|
|
Definition at line 593 of file lin-city.h. |
|
|
Definition at line 599 of file lin-city.h. |
|
|
Definition at line 173 of file lin-city.h. |
|
|
Definition at line 171 of file lin-city.h. |
|
|
Definition at line 174 of file lin-city.h. |
|
|
Definition at line 172 of file lin-city.h. |
|
|
Definition at line 175 of file lin-city.h. |
|
|
Definition at line 176 of file lin-city.h. |
|
|
Definition at line 177 of file lin-city.h. |
|
|
Definition at line 355 of file lin-city.h. |
|
|
Definition at line 350 of file lin-city.h. |
|
|
Definition at line 356 of file lin-city.h. |
|
|
Definition at line 393 of file lin-city.h. |
|
|
Definition at line 129 of file lin-city.h. |
|
|
Definition at line 128 of file lin-city.h. |
|
|
Definition at line 459 of file lin-city.h. |
|
|
Definition at line 517 of file lin-city.h. |
|
|
Definition at line 325 of file lin-city.h. |
|
|
Definition at line 71 of file lin-city.h. |
|
|
Definition at line 441 of file lin-city.h. |
|
|
Definition at line 442 of file lin-city.h. |
|
|
Definition at line 439 of file lin-city.h. |
|
|
Definition at line 440 of file lin-city.h. |
|
|
Definition at line 443 of file lin-city.h. |
|
|
Definition at line 444 of file lin-city.h. |
|
|
Definition at line 314 of file lin-city.h. |
|
|
Definition at line 68 of file lin-city.h. |
|
|
Definition at line 49 of file lin-city.h. |
|
|
Definition at line 79 of file lin-city.h. |
|
|
Definition at line 516 of file lin-city.h. |
|
|
Definition at line 1108 of file lin-city.h. |
|
|
Definition at line 268 of file lin-city.h. |
|
|
Definition at line 267 of file lin-city.h. |
|
|
Definition at line 270 of file lin-city.h. |
|
|
Definition at line 495 of file lin-city.h. |
|
|
Definition at line 215 of file lin-city.h. |
|
|
Definition at line 1104 of file lin-city.h. |
|
|
Definition at line 130 of file lin-city.h. |
|
|
Definition at line 1125 of file lin-city.h. |
|
|
Definition at line 1140 of file lin-city.h. |
|
||||||||||||
|
Definition at line 361 of file market.c. 00362 {
00363 if (numof_markets >= MAX_NUMOF_MARKETS)
00364 return (0);
00365 marketx[numof_markets] = x;
00366 markety[numof_markets] = y;
00367 numof_markets++;
00368 /* oh dear. Got to bootstap markets with jobs, otherwise power won't work */
00369 /* GCS: Is this still true? */
00370 MP_INFO(x,y).int_2 = 2000;
00371 return (1);
00372 }
|
|
|
Definition at line 3513 of file engine.c. 03514 {
03515 int r, x, y;
03516 x = rand () % WORLD_SIDE_LEN;
03517 y = rand () % WORLD_SIDE_LEN;
03518 if (numof_shanties > 0 && rand () % 8 != 0)
03519 {
03520 r = spiral_find_group (x, y, GROUP_SHANTY);
03521 if (r == -1)
03522 {
03523 printf ("Looked for a shanty, without any! x=%d y=%d\n", x, y);
03524 return;
03525 }
03526 y = r / WORLD_SIDE_LEN;
03527 x = r % WORLD_SIDE_LEN;
03528 r = spiral_find_2x2 (x, y);
03529 if (r == -1)
03530 {
03531 #ifdef commentout /* wck: These are annoying when the map is full */
03532 printf ("Adding a shanty (s), no space for it?!\n");
03533 #endif
03534 return;
03535 }
03536 y = r / WORLD_SIDE_LEN;
03537 x = r % WORLD_SIDE_LEN;
03538 }
03539 else
03540 {
03541 r = spiral_find_group (x, y, GROUP_MARKET);
03542 if (r == -1)
03543 return; /* silently return, we havn't started yet. */
03544
03545 y = r / WORLD_SIDE_LEN;
03546 x = r % WORLD_SIDE_LEN;
03547 r = spiral_find_2x2 (x, y);
03548 if (r == -1)
03549 {
03550 #ifdef commentout /* see above */
03551 printf ("Adding a shanty (r), no space for it?!\n");
03552 #endif
03553 return;
03554 }
03555 y = r / WORLD_SIDE_LEN;
03556 x = r % WORLD_SIDE_LEN;
03557 }
03558 set_mappoint (x, y, CST_SHANTY);
03559 numof_shanties++;
03560 }
|
|
||||||||||||
|
Definition at line 396 of file power.c. 00397 {
00398 if (numof_substations >= MAX_NUMOF_SUBSTATIONS)
00399 return (0);
00400 substationx[numof_substations] = x;
00401 substationy[numof_substations] = y;
00402 numof_substations++;
00403 return (1);
00404 }
|
|
||||||||||||
|
Definition at line 2620 of file screen.c. 02621 {
02622 return yn_dial_box (_("Rocket ready to launch"),
02623 _("You can launch it now or wait until later."),
02624 _("If you wait it will continue costing you money."),
02625 _("Launch it later by clicking on the rocket area."));
02626 }
|
|
||||||||||||
|
|
|
||||||||||||
|
Definition at line 2009 of file engine.c. 02010 {
02011 int i = 0;
02012 if (MP_GROUP(xt,yt) == GROUP_TRACK)
02013 {
02014 if (MP_INFO(xt,yt).int_3 < MAX_COAL_ON_TRACK)
02015 i = MAX_COAL_ON_TRACK - MP_INFO(xt,yt).int_3;
02016 }
02017 else if (MP_GROUP(xt,yt) == GROUP_ROAD)
02018 {
02019 if (MP_INFO(xt,yt).int_3 < MAX_COAL_ON_ROAD)
02020 i = MAX_COAL_ON_ROAD - MP_INFO(xt,yt).int_3;
02021 }
02022 else if (MP_GROUP(xt,yt) == GROUP_RAIL)
02023 {
02024 if (MP_INFO(xt,yt).int_3 < MAX_COAL_ON_RAIL)
02025 i = MAX_COAL_ON_RAIL - MP_INFO(xt,yt).int_3;
02026 }
02027 i = (i * PORT_IMPORT_RATE) / 1000;
02028 MP_INFO(xt,yt).int_3 += i;
02029 return (i * PORT_COAL_RATE);
02030 }
|
|
||||||||||||
|
Definition at line 1985 of file engine.c. 01986 {
01987 int i = 0;
01988 if (MP_GROUP(xt,yt) == GROUP_TRACK)
01989 {
01990 if (MP_INFO(xt,yt).int_1 < MAX_FOOD_ON_TRACK)
01991 i = MAX_FOOD_ON_TRACK - MP_INFO(xt,yt).int_1;
01992 }
01993 else if (MP_GROUP(xt,yt) == GROUP_ROAD)
01994 {
01995 if (MP_INFO(xt,yt).int_1 < MAX_FOOD_ON_ROAD)
01996 i = MAX_FOOD_ON_ROAD - MP_INFO(xt,yt).int_1;
01997 }
01998 else if (MP_GROUP(xt,yt) == GROUP_RAIL)
01999 {
02000 if (MP_INFO(xt,yt).int_1 < MAX_FOOD_ON_RAIL)
02001 i = MAX_FOOD_ON_RAIL - MP_INFO(xt,yt).int_1;
02002 }
02003 i = (i * PORT_IMPORT_RATE) / 1000;
02004 MP_INFO(xt,yt).int_1 += i;
02005 return (i * PORT_FOOD_RATE);
02006 }
|
|
||||||||||||
|
Definition at line 2057 of file engine.c. 02058 {
02059 int i = 0;
02060 if (MP_GROUP(xt,yt) == GROUP_TRACK)
02061 {
02062 if (MP_INFO(xt,yt).int_4 < MAX_GOODS_ON_TRACK)
02063 i = MAX_GOODS_ON_TRACK - MP_INFO(xt,yt).int_4;
02064 }
02065 else if (MP_GROUP(xt,yt) == GROUP_ROAD)
02066 {
02067 if (MP_INFO(xt,yt).int_4 < MAX_GOODS_ON_ROAD)
02068 i = MAX_GOODS_ON_ROAD - MP_INFO(xt,yt).int_4;
02069 }
02070 else if (MP_GROUP(xt,yt) == GROUP_RAIL)
02071 {
02072 if (MP_INFO(xt,yt).int_4 < MAX_GOODS_ON_RAIL)
02073 i = MAX_GOODS_ON_RAIL - MP_INFO(xt,yt).int_4;
02074 }
02075 i = (i * PORT_IMPORT_RATE) / 1000;
02076 MP_INFO(xt,yt).int_4 += i;
02077 return (i * PORT_GOODS_RATE);
02078 }
|
|
||||||||||||
|
|
|
||||||||||||
|
Definition at line 2033 of file engine.c. 02034 {
02035 int i = 0;
02036 if (MP_GROUP(xt,yt) == GROUP_TRACK)
02037 {
02038 if (MP_INFO(xt,yt).int_5 < MAX_ORE_ON_TRACK)
02039 i = MAX_ORE_ON_TRACK - MP_INFO(xt,yt).int_5;
02040 }
02041 else if (MP_GROUP(xt,yt) == GROUP_ROAD)
02042 {
02043 if (MP_INFO(xt,yt).int_5 < MAX_ORE_ON_ROAD)
02044 i = MAX_ORE_ON_ROAD - MP_INFO(xt,yt).int_5;
02045 }
02046 else if (MP_GROUP(xt,yt) == GROUP_RAIL)
02047 {
02048 if (MP_INFO(xt,yt).int_5 < MAX_ORE_ON_RAIL)
02049 i = MAX_ORE_ON_RAIL - MP_INFO(xt,yt).int_5;
02050 }
02051 i = (i * PORT_IMPORT_RATE) / 1000;
02052 MP_INFO(xt,yt).int_5 += i;
02053 return (i * PORT_ORE_RATE);
02054 }
|
|
||||||||||||
|
Definition at line 2082 of file engine.c. 02083 {
02084 int i = 0;
02085 if (MP_GROUP(xt,yt) == GROUP_TRACK)
02086 {
02087 if (MP_INFO(xt,yt).int_6 < MAX_STEEL_ON_TRACK)
02088 i = MAX_STEEL_ON_TRACK - MP_INFO(xt,yt).int_6;
02089 }
02090 else if (MP_GROUP(xt,yt) == GROUP_ROAD)
02091 {
02092 if (MP_INFO(xt,yt).int_6 < MAX_STEEL_ON_ROAD)
02093 i = MAX_STEEL_ON_ROAD - MP_INFO(xt,yt).int_6;
02094 }
02095 else if (MP_GROUP(xt,yt) == GROUP_RAIL)
02096 {
02097 if (MP_INFO(xt,yt).int_6 < MAX_STEEL_ON_RAIL)
02098 i = MAX_STEEL_ON_RAIL - MP_INFO(xt,yt).int_6;
02099 }
02100 i = (i * PORT_IMPORT_RATE) / 1000;
02101 MP_INFO(xt,yt).int_6 += i;
02102 return (i * PORT_STEEL_RATE);
02103 }
|
|
|
|
|
|
Definition at line 707 of file main.c. 00708 {
00709 if (cheat_flag != 0)
00710 return (1);
00711 /* TRANSLATORS: Test mode is like using "cheat codes" */
00712 if (yn_dial_box (_("TEST"), _("You have pressed a test key"),
00713 _("You will only see this message once"),
00714 _("Do you really want to play in test mode..."))!= 0)
00715 {
00716 cheat_flag = 1;
00717 print_time_for_year(); /* Displays TEST MODE or not */
00718 return (1);
00719 }
00720 return (0);
00721 }
|
|
|
Definition at line 744 of file ldsvguts.c. 00745 {
00746 static int flag = 0;
00747 char *cs;
00748 int t, x, y;
00749 t = 0;
00750 cs = (char *) &t;
00751 *cs = 1;
00752 if (t == 1) /* little endian */
00753 return;
00754 printf ("t=%x\n", t);
00755 if (flag == 0) {
00756 flag = 1;
00757 }
00758 for (y = 0; y < WORLD_SIDE_LEN; y++) {
00759 for (x = 0; x < WORLD_SIDE_LEN; x++) {
00760 eswap32 (&(MP_INFO(x,y).population));
00761 eswap32 (&(MP_INFO(x,y).flags));
00762 if (sizeof (short) == 2) {
00763 eswap16 (&(MP_INFO(x,y).coal_reserve));
00764 eswap16 (&(MP_INFO(x,y).ore_reserve));
00765 } else if (sizeof (short) == 4) {
00766 eswap32 ((int *) &(MP_INFO(x,y).coal_reserve));
00767 eswap32 ((int *) &(MP_INFO(x,y).ore_reserve));
00768 } else {
00769 printf ("Strange size (%d) for short, please mail me.\n",
00770 sizeof (short));
00771 }
00772 eswap32 (&(MP_INFO(x,y).int_1));
00773 eswap32 (&(MP_INFO(x,y).int_2));
00774 eswap32 (&(MP_INFO(x,y).int_3));
00775 eswap32 (&(MP_INFO(x,y).int_4));
00776 eswap32 (&(MP_INFO(x,y).int_5));
00777 eswap32 (&(MP_INFO(x,y).int_6));
00778 eswap32 (&(MP_INFO(x,y).int_7));
00779 }
00780 }
00781 }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Definition at line 607 of file fileutil.c. 00608 {
00609 int i = 0, j, k, r, l;
00610
00611 if (!directory_exists (lc_save_dir)) {
00612 make_savedir ();
00613 #if defined (commentout)
00614 l = lc_save_dir_len;
00615 if (l > 160) {
00616 i = l - 160;
00617 l = 160;
00618 }
00619 askdir_lines = l / 40 + ((l % 40) ? 1 : 0);
00620 r = l / askdir_lines + ((l % askdir_lines) ? 1 : 0);
00621 for (j = 0; j < askdir_lines; j++) {
00622 if ((askdir_path[j] = (char *) malloc (r + 1)) == 0)
00623 malloc_failure ();
00624 for (k = 0; k < r; k++, i++)
00625 *(askdir_path[j] + k) = lc_save_dir[i];
00626 *(askdir_path[j] + k) = 0;
00627 }
00628 return;
00629 #endif
00630 }
00631 #if defined (commentout)
00632 make_dir_ok_flag = 0; /* don't load the ask-dir */
00633 #endif
00634 }
|
|
|
|
|
|
|
|
|
Definition at line 3123 of file engine.c. 03124 {
03125 int x, y, m;
03126 m = 0xffffffff - (FLAG_FIRE_COVER | FLAG_HEALTH_COVER
03127 | FLAG_CRICKET_COVER);
03128 for (y = 0; y < WORLD_SIDE_LEN; y++)
03129 for (x = 0; x < WORLD_SIDE_LEN; x++)
03130 MP_INFO(x,y).flags &= m;
03131 /* Wow... chache misses or what! */
03132 }
|
|
||||||||||||
|
Definition at line 2103 of file screen.c. 02104 {
02105 market_cb_flag = 1;
02106 mcbx = x;
02107 mcby = y;
02108 }
|
|
||||||||||||
|
Definition at line 2209 of file screen.c. 02210 {
02211 port_cb_flag = 1;
02212 mcbx = x;
02213 mcby = y;
02214 }
|
|
|
Definition at line 304 of file main.c. 00305 {
00306 int quit = 0;
00307 int engine_updated = 0;
00308
00309 /* Set up the game */
00310 reset_start_time ();
00311
00312 update_avail_modules (0);
00313
00314 screen_full_refresh ();
00315
00316 if (no_init_help == 0) {
00317 block_help_exit = 1;
00318 help_flag = 1;
00319 #if defined (commentout)
00320 if (make_dir_ok_flag) {
00321 activate_help ("ask-dir.hlp");
00322 make_dir_ok_flag = 0;
00323 } else {
00324 activate_help ("opening.hlp");
00325 }
00326 #endif
00327 activate_help ("opening.hlp");
00328 }
00329
00330 /* Set speed */
00331 #if defined (CS_PROFILE) || defined (START_FAST_SPEED)
00332 select_fast ();
00333 #else
00334 select_medium ();
00335 #endif
00336 /* Main Loop */
00337 do {
00338 int key;
00339
00340 /* Get timestamp for this iteration */
00341 get_real_time();
00342
00343 /* Process events */
00344 #if defined (LC_X11)
00345 call_event ();
00346 key = x_key_value;
00347 x_key_value = 0;
00348 #elif defined (WIN32)
00349 call_event ();
00350 key = GetKeystroke ();
00351 #else
00352 mouse_update ();
00353 key = vga_getkey ();
00354 #endif
00355 /* nothing happened if key == 0 XXX: right? */
00356 /* GCS: I'm not sure */
00357 if (key != 0) {
00358 process_keystrokes (key);
00359 }
00360 /* Simulate the timestep */
00361 quit = execute_timestep ();
00362 } while (quit == 0);
00363 }
|
|
|
Definition at line 128 of file screen.c. 00129 {
00130 Rect* b = &scr.main_win;
00131 Fgl_enableclipping ();
00132 Fgl_setclippingwindow (b->x, b->y, b->x + b->w - 1, b->y + b->h - 1);
00133 }
|
|
|
Definition at line 2193 of file screen.c. 02194 {
02195 Rect* mcb = &scr.market_cb;
02196
02197 market_cb_flag = 0;
02198 market_cb_drawn_flag = 0;
02199
02200 Fgl_putbox (mcb->x, mcb->y, mcb->w, mcb->h
02201 ,market_cb_gbuf);
02202 Fgl_setfontcolors (TEXT_BG_COLOUR, TEXT_FG_COLOUR);
02203
02204 /* when exiting market cb, stop the mouse repeating straight away */
02205 cs_mouse_button = LC_MOUSE_LEFTBUTTON;
02206 }
|
|
|
Definition at line 2225 of file screen.c. 02226 {
02227 Rect* mcb = &scr.market_cb;
02228
02229 port_cb_flag = 0;
02230 port_cb_drawn_flag = 0;
02231
02232 Fgl_putbox (mcb->x, mcb->y, mcb->w, mcb->h, market_cb_gbuf);
02233 /* when exiting port cb, stop the mouse repeating straight away */
02234 cs_mouse_button = LC_MOUSE_LEFTBUTTON;
02235 }
|
|
|
Definition at line 465 of file simulate.c. 00466 {
00467 int i, j, x, y, xx, yy;
00468 for (i = 0; i < NUMOF_COAL_RESERVES / 5; i++)
00469 {
00470 x = (rand () % (WORLD_SIDE_LEN - 12)) + 6;
00471 y = (rand () % (WORLD_SIDE_LEN - 10)) + 6;
00472 do
00473 {
00474 xx = (rand () % 3) - 1;
00475 yy = (rand () % 3) - 1;
00476 }
00477 while (xx == 0 && yy == 0);
00478 for (j = 0; j < 5; j++)
00479 {
00480 MP_INFO(x,y).coal_reserve
00481 += rand () % COAL_RESERVE_SIZE;
00482 x += xx;
00483 y += yy;
00484 }
00485 }
00486 }
|
|
|
Definition at line 724 of file main.c. 00725 {
00726 char *s;
00727 FILE *outf;
00728 int group_count[NUM_OF_GROUPS];
00729
00730 if ((s = (char *) malloc (lc_save_dir_len + strlen (LC_SAVE_DIR)
00731 + strlen (RESULTS_FILENAME) + 64)) == 0)
00732 malloc_failure ();
00733
00734 sprintf (s, "%s%c%s", lc_save_dir, PATH_SLASH, RESULTS_FILENAME);
00735
00736 count_all_groups (group_count);
00737 if ((outf = fopen (s, "w")) == 0)
00738 {
00739 printf (_("Unable to open %s\n"), RESULTS_FILENAME);
00740 free (s);
00741 return (0);
00742 }
00743 if (cheat_flag)
00744 fprintf (outf, _("----- IN TEST MODE -------\n"));
00745 fprintf (outf, _("Game statistics from LinCity Version %s\n"), VERSION);
00746 if (strlen (given_scene) > 3)
00747 fprintf (outf, _("Initial loaded scene - %s\n"), given_scene);
00748 if (sustain_flag)
00749 fprintf (outf, _("Economy is sustainable\n"));
00750 fprintf (outf, _("Population %d of which %d are not housed.\n")
00751 ,housed_population + people_pool, people_pool);
00752 fprintf (outf,
00753 _("Max population %d Number evacuated %d Total births %d\n")
00754 ,max_pop_ever, total_evacuated, total_births);
00755 fprintf (outf,
00756 _(" Date %s %04d Money %8d Tech-level %5.1f (%5.1f)\n"),
00757 current_month(total_time), current_year(total_time), total_money,
00758 (float) tech_level * 100.0 / MAX_TECH_LEVEL,
00759 (float) highest_tech_level * 100.0 / MAX_TECH_LEVEL);
00760 fprintf (outf,
00761 _(" Deaths by starvation %7d History %8.3f\n"),
00762 total_starve_deaths, starve_deaths_history);
00763 fprintf (outf,
00764 _("Deaths from pollution %7d History %8.3f\n"),
00765 total_pollution_deaths, pollution_deaths_history);
00766 fprintf (outf, _("Years of unemployment %7d History %8.3f\n"),
00767 total_unemployed_years, unemployed_history);
00768 fprintf (outf, _("Rockets launched %2d Successful launches %2d\n"),
00769 rockets_launched, rockets_launched_success);
00770 fprintf (outf, "\n");
00771 fprintf (outf, _(" Residences %4d Markets %4d Farms %4d\n"),
00772 group_count[GROUP_RESIDENCE_LL] +
00773 group_count[GROUP_RESIDENCE_ML] +
00774 group_count[GROUP_RESIDENCE_HL] +
00775 group_count[GROUP_RESIDENCE_LH] +
00776 group_count[GROUP_RESIDENCE_MH] +
00777 group_count[GROUP_RESIDENCE_HH],
00778 group_count[GROUP_MARKET],
00779 group_count[GROUP_ORGANIC_FARM]);
00780 fprintf (outf, _(" Tracks %4d Roads %4d Rail %4d\n")
00781 ,group_count[GROUP_TRACK], group_count[GROUP_ROAD]
00782 ,group_count[GROUP_RAIL]);
00783 fprintf (outf, _(" Potteries %4d Blacksmiths %4d Mills %4d\n")
00784 ,group_count[GROUP_POTTERY], group_count[GROUP_BLACKSMITH]
00785 ,group_count[GROUP_MILL]);
00786 fprintf (outf, _(" Monuments %4d Schools %4d Universities %4d\n")
00787 ,group_count[GROUP_MONUMENT], group_count[GROUP_SCHOOL]
00788 ,group_count[GROUP_UNIVERSITY]);
00789 fprintf (outf, _(" Fire stations %4d Parks %4d Cricket gnds %4d\n")
00790 ,group_count[GROUP_FIRESTATION], group_count[GROUP_PARKLAND]
00791 ,group_count[GROUP_CRICKET]);
00792 fprintf (outf, _(" Coal mines %4d Ore mines %4d Communes %4d\n")
00793 ,group_count[GROUP_COALMINE], group_count[GROUP_OREMINE]
00794 ,group_count[GROUP_COMMUNE]);
00795 fprintf (outf, _(" Windmills %4d Coal powers %4d Solar powers %4d\n"),
00796 group_count[GROUP_WINDMILL],
00797 group_count[GROUP_COAL_POWER],
00798 group_count[GROUP_SOLAR_POWER]);
00799 fprintf (outf, _(" Substations %4d Power lines %4d Ports %4d\n")
00800 ,group_count[GROUP_SUBSTATION], group_count[GROUP_POWER_LINE]
00801 ,group_count[GROUP_PORT]);
00802 fprintf (outf, _(" Light inds %4d Heavy inds %4d Recyclers %4d\n")
00803 ,group_count[GROUP_INDUSTRY_L], group_count[GROUP_INDUSTRY_H]
00804 ,group_count[GROUP_RECYCLE]);
00805 fprintf (outf, _("Health centres %4d Tips %4d Shanties %4d\n"),
00806 group_count[GROUP_HEALTH], group_count[GROUP_TIP],
00807 group_count[GROUP_SHANTY]);
00808 fclose (outf);
00809 free (s);
00810 return (1);
00811 }
|
|
||||||||||||||||||||
|
Definition at line 78 of file shrtypes.c. 00079 {
00080 int x, y, mask, tflags;
00081 short group, type;
00082
00083 static const short power_table[16] =
00084 {
00085 CST_POWERL_H_D, CST_POWERL_V_D, CST_POWERL_H_D, CST_POWERL_RD_D,
00086 CST_POWERL_H_D, CST_POWERL_LD_D, CST_POWERL_H_D, CST_POWERL_LDR_D,
00087 CST_POWERL_V_D, CST_POWERL_V_D, CST_POWERL_RU_D, CST_POWERL_UDR_D,
00088 CST_POWERL_LU_D, CST_POWERL_LDU_D, CST_POWERL_LUR_D, CST_POWERL_LUDR_D
00089 };
00090 static const short track_table[16] =
00091 {
00092 CST_TRACK_LR, CST_TRACK_LR, CST_TRACK_UD, CST_TRACK_LU,
00093 CST_TRACK_LR, CST_TRACK_LR, CST_TRACK_UR, CST_TRACK_LUR,
00094 CST_TRACK_UD, CST_TRACK_LD, CST_TRACK_UD, CST_TRACK_LUD,
00095 CST_TRACK_DR, CST_TRACK_LDR, CST_TRACK_UDR, CST_TRACK_LUDR
00096 };
00097 static const short road_table[16] =
00098 {
00099 CST_ROAD_LR, CST_ROAD_LR, CST_ROAD_UD, CST_ROAD_LU,
00100 CST_ROAD_LR, CST_ROAD_LR, CST_ROAD_UR, CST_ROAD_LUR,
00101 CST_ROAD_UD, CST_ROAD_LD, CST_ROAD_UD, CST_ROAD_LUD,
00102 CST_ROAD_DR, CST_ROAD_LDR, CST_ROAD_UDR, CST_ROAD_LUDR
00103 };
00104 static const short rail_table[16] =
00105 {
00106 CST_RAIL_LR, CST_RAIL_LR, CST_RAIL_UD, CST_RAIL_LU,
00107 CST_RAIL_LR, CST_RAIL_LR, CST_RAIL_UR, CST_RAIL_LUR,
00108 CST_RAIL_UD, CST_RAIL_LD, CST_RAIL_UD, CST_RAIL_LUD,
00109 CST_RAIL_DR, CST_RAIL_LDR, CST_RAIL_UDR, CST_RAIL_LUDR
00110 };
00111 static const short water_table[16] =
00112 {
00113 CST_WATER, CST_WATER_D, CST_WATER_R, CST_WATER_RD,
00114 CST_WATER_L, CST_WATER_LD, CST_WATER_LR, CST_WATER_LRD,
00115 CST_WATER_U, CST_WATER_UD, CST_WATER_UR, CST_WATER_URD,
00116 CST_WATER_LU, CST_WATER_LUD, CST_WATER_LUR, CST_WATER_LURD
00117 };
00118
00119 /* Adjust originx,originy,w,h to proper range */
00120 if (originx <= 0) {
00121 w -= 1 - originx;
00122 originx = 1;
00123 }
00124 if (originy <= 0) {
00125 h -= 1 - originy;
00126 originy = 1;
00127 }
00128 if (originx + w >= WORLD_SIDE_LEN) {
00129 w = WORLD_SIDE_LEN - originx;
00130 }
00131 if (originy + h >= WORLD_SIDE_LEN) {
00132 h = WORLD_SIDE_LEN - originy;
00133 }
00134
00135 for (x = originx; x < originx + w; x++) {
00136 for (y = originy; y < originy + h; y++) {
00137 switch (MP_GROUP(x,y))
00138 {
00139 case GROUP_POWER_LINE:
00140 /* First, set up a mask indicating into which directions
00141 power may be transferred */
00142 mask = 0;
00143 #ifdef THOMMY_MAY_BE_WRONG /* just in case -- (ThMO) */
00144 if (y > 0)
00145 #endif
00146 { /* up -- (ThMO) */
00147 group = MP_GROUP(x,y-1);
00148
00149 /* see if dug under track, rail or road */
00150
00151 if (y > 1 && (group == GROUP_TRACK
00152 || group == GROUP_RAIL
00153 || group == GROUP_ROAD
00154 || group == GROUP_WATER))
00155 group = MP_GROUP(x,y-2);
00156 switch (group)
00157 {
00158 case GROUP_POWER_LINE:
00159 case GROUP_SOLAR_POWER:
00160 case GROUP_SUBSTATION:
00161 case GROUP_COAL_POWER:
00162 mask |= 8;
00163 break;
00164 }
00165 }
00166 #ifdef THOMMY_MAY_BE_WRONG /* just in case -- (ThMO) */
00167 if (x > 0)
00168 #endif
00169 { /* left -- (ThMO) */
00170 group = MP_GROUP(x-1,y);
00171 if (x > 1 && (group == GROUP_TRACK
00172 || group == GROUP_RAIL
00173 || group == GROUP_ROAD
00174 || group == GROUP_WATER))
00175 group = MP_GROUP(x-2,y);
00176 switch (group)
00177 {
00178 case GROUP_POWER_LINE:
00179 case GROUP_SOLAR_POWER:
00180 case GROUP_SUBSTATION:
00181 case GROUP_COAL_POWER:
00182 mask |= 4;
00183 break;
00184 }
00185 }
00186 #ifdef THOMMY_MAY_BE_WRONG /* just in case -- (ThMO) */
00187 if (x < WORLD_SIDE_LEN - 1)
00188 #endif
00189 { /* right -- (ThMO) */
00190 group = MP_GROUP(x+1,y);
00191 if (x < WORLD_SIDE_LEN - 2 && (group == GROUP_TRACK
00192 || group == GROUP_RAIL
00193 || group == GROUP_ROAD
00194 || group == GROUP_WATER))
00195 group = MP_GROUP(x+2,y);
00196 switch (group)
00197 {
00198 case GROUP_WINDMILL:
00199 if (MP_INFO(x + 1,y).int_2 < MODERN_WINDMILL_TECH)
00200 break;
00201 case GROUP_POWER_LINE:
00202 case GROUP_SOLAR_POWER:
00203 case GROUP_SUBSTATION:
00204 case GROUP_COAL_POWER:
00205 mask |= 2;
00206 break;
00207 }
00208 }
00209 #ifdef THOMMY_MAY_BE_WRONG /* just in case -- (ThMO) */
00210 if (y < WORLD_SIDE_LEN - 1)
00211 #endif
00212 { /* down -- (ThMO) */
00213 group = MP_GROUP(x,y+1);
00214 if (y < WORLD_SIDE_LEN - 2 && (group == GROUP_TRACK
00215 || group == GROUP_RAIL
00216 || group == GROUP_ROAD
00217 || group == GROUP_WATER))
00218 group = MP_GROUP(x,y+2);
00219 switch (group)
00220 {
00221 case GROUP_WINDMILL:
00222 if (MP_INFO(x,y + 1).int_2 < MODERN_WINDMILL_TECH)
00223 break;
00224 case GROUP_POWER_LINE:
00225 case GROUP_SOLAR_POWER:
00226 case GROUP_SUBSTATION:
00227 case GROUP_COAL_POWER:
00228 ++mask;
00229 break;
00230 }
00231 }
00232 /* Next, set the connectivity into MP_TYPE */
00233 MP_TYPE(x,y) = power_table[mask];
00234 /* Finally, adjust MP_TYPE to show electon bolt */
00235 #ifdef commentout
00236 WCK: This is done in do_power_line now
00237 if (MP_INFO(x,y).int_1 != 0)
00238 MP_TYPE(x,y) -= 11;
00239 #endif
00240 break;
00241
00242 case GROUP_TRACK:
00243 #if FLAG_LEFT != 1 || FLAG_UP != 2 || FLAG_RIGHT != 4 || FLAG_DOWN != 8
00244 #error check_track_graphics(): you loose
00245 #error this algorithm depends on proper flag settings -- (ThMO)
00246 #endif
00247 mask = 0;
00248 #ifdef THOMMY_MAY_BE_WRONG /* just in case -- (ThMO) */
00249 if (y > 0)
00250 #endif
00251 {
00252 if (MP_GROUP(x,y-1) == GROUP_TRACK)
00253 mask |= FLAG_UP;
00254 }
00255 #ifdef THOMMY_MAY_BE_WRONG /* just in case -- (ThMO) */
00256 if (x > 0)
00257 #endif
00258 {
00259 if (MP_GROUP(x-1,y) == GROUP_TRACK)
00260 mask |= FLAG_LEFT;
00261 }
00262 tflags = mask;
00263 #ifdef THOMMY_MAY_BE_WRONG /* just in case -- (ThMO) */
00264 if (x < WORLD_SIDE_LEN - 1)
00265 #endif
00266 {
00267 switch (MP_GROUP(x+1,y))
00268 {
00269 case GROUP_TRACK:
00270 tflags |= FLAG_RIGHT;
00271 case GROUP_COMMUNE:
00272 case GROUP_COALMINE:
00273 case GROUP_OREMINE:
00274 case GROUP_INDUSTRY_L:
00275 case GROUP_INDUSTRY_H:
00276 case GROUP_RECYCLE:
00277 case GROUP_TIP:
00278 case GROUP_PORT:
00279 mask |= FLAG_RIGHT;
00280 break;
00281 default:
00282 #ifdef THOMMY_MAY_BE_WRONG /* just in case -- (ThMO) */
00283 if (y > 0)
00284 #endif
00285 if (MP_GROUP(x+1,y-1) == GROUP_COAL_POWER)
00286 mask |= FLAG_RIGHT;
00287 break;
00288 }
00289 }
00290 #ifdef THOMMY_MAY_BE_WRONG /* just in case -- (ThMO) */
00291 if (y < WORLD_SIDE_LEN - 1)
00292 #endif
00293 {
00294 switch (MP_GROUP(x,y+1))
00295 {
00296 case GROUP_TRACK:
00297 tflags |= FLAG_DOWN;
00298 case GROUP_COMMUNE:
00299 case GROUP_COALMINE:
00300 case GROUP_OREMINE:
00301 case GROUP_INDUSTRY_L:
00302 case GROUP_INDUSTRY_H:
00303 case GROUP_RECYCLE:
00304 case GROUP_TIP:
00305 case GROUP_PORT:
00306 mask |= FLAG_DOWN;
00307 break;
00308 default:
00309 #ifdef THOMMY_MAY_BE_WRONG /* just in case -- (ThMO) */
00310 if (x > 0)
00311 #endif
00312 if (MP_GROUP(x-1,y+1) == GROUP_COAL_POWER)
00313 mask |= FLAG_DOWN;
00314 break;
00315 }
00316 }
00317 MP_INFO(x,y).flags &= ~(FLAG_UP | FLAG_DOWN | FLAG_LEFT
00318 | FLAG_RIGHT);
00319 MP_INFO(x,y).flags |= tflags;
00320 MP_TYPE(x,y) = track_table[mask];
00321 break;
00322
00323 case GROUP_ROAD:
00324 #if FLAG_LEFT != 1 || FLAG_UP != 2 || FLAG_RIGHT != 4 || FLAG_DOWN != 8
00325 #error check_road_graphics(): you loose
00326 #error this algorithm depends on proper flag settings -- (ThMO)
00327 #endif
00328 mask = 0;
00329 #ifdef THOMMY_MAY_BE_WRONG /* just in case -- (ThMO) */
00330 if (y > 0)
00331 #endif
00332 {
00333 if (MP_GROUP(x,y-1) == GROUP_ROAD)
00334 mask |= FLAG_UP;
00335 }
00336 #ifdef THOMMY_MAY_BE_WRONG /* just in case -- (ThMO) */
00337 if (x > 0)
00338 #endif
00339 {
00340 if (MP_GROUP(x-1,y) == GROUP_ROAD)
00341 mask |= FLAG_LEFT;
00342 }
00343 tflags = mask;
00344 #ifdef THOMMY_MAY_BE_WRONG /* just in case -- (ThMO) */
00345 if (x < WORLD_SIDE_LEN - 1)
00346 #endif
00347 {
00348 switch (MP_GROUP(x+1,y))
00349 {
00350 case GROUP_ROAD:
00351 tflags |= FLAG_RIGHT;
00352 case GROUP_COMMUNE:
00353 case GROUP_COALMINE:
00354 case GROUP_OREMINE:
00355 case GROUP_INDUSTRY_L:
00356 case GROUP_INDUSTRY_H:
00357 case GROUP_RECYCLE:
00358 case GROUP_TIP:
00359 case GROUP_PORT:
00360 mask |= FLAG_RIGHT;
00361 break;
00362 default:
00363 #ifdef THOMMY_MAY_BE_WRONG /* just in case -- (ThMO) */
00364 if (y > 0)
00365 #endif
00366 if (MP_GROUP(x+1,y-1) == GROUP_COAL_POWER)
00367 mask |= FLAG_RIGHT;
00368 break;
00369 }
00370 }
00371 #ifdef THOMMY_MAY_BE_WRONG /* just in case -- (ThMO) */
00372 if (y < WORLD_SIDE_LEN - 1)
00373 #endif
00374 {
00375 switch (MP_GROUP(x,y+1))
00376 {
00377 case GROUP_ROAD:
00378 tflags |= FLAG_DOWN;
00379 case GROUP_COMMUNE:
00380 case GROUP_COALMINE:
00381 case GROUP_OREMINE:
00382 case GROUP_INDUSTRY_L:
00383 case GROUP_INDUSTRY_H:
00384 case GROUP_RECYCLE:
00385 case GROUP_TIP:
00386 case GROUP_PORT:
00387 mask |= FLAG_DOWN;
00388 break;
00389 default:
00390 #ifdef THOMMY_MAY_BE_WRONG /* just in case -- (ThMO) */
00391 if (x > 0)
00392 #endif
00393 if (MP_GROUP(x-1,y+1) == GROUP_COAL_POWER)
00394 mask |= FLAG_DOWN;
00395 break;
00396 }
00397 }
00398 MP_INFO(x,y).flags &= ~(FLAG_UP | FLAG_DOWN | FLAG_LEFT
00399 | FLAG_RIGHT);
00400 MP_INFO(x,y).flags |= tflags;
00401 MP_TYPE(x,y) = road_table[mask];
00402 break;
00403
00404 case GROUP_RAIL:
00405 #if FLAG_LEFT != 1 || FLAG_UP != 2 || FLAG_RIGHT != 4 || FLAG_DOWN != 8
00406 #error check_rail_graphics(): you loose
00407 #error this algorithm depends on proper flag settings -- (ThMO)
00408 #endif
00409 mask = 0;
00410 #ifdef THOMMY_MAY_BE_WRONG /* just in case -- (ThMO) */
00411 if (y > 0)
00412 #endif
00413 {
00414 if (MP_GROUP(x,y-1) == GROUP_RAIL)
00415 mask |= FLAG_UP;
00416 }
00417 #ifdef THOMMY_MAY_BE_WRONG /* just in case -- (ThMO) */
00418 if (x > 0)
00419 #endif
00420 {
00421 if (MP_GROUP(x-1,y) == GROUP_RAIL)
00422 mask |= FLAG_LEFT;
00423 }
00424 tflags = mask;
00425 #ifdef THOMMY_MAY_BE_WRONG /* just in case -- (ThMO) */
00426 if (x < WORLD_SIDE_LEN - 1)
00427 #endif
00428 {
00429 switch (MP_GROUP(x+1,y))
00430 {
00431 case GROUP_RAIL:
00432 tflags |= FLAG_RIGHT;
00433 case GROUP_COMMUNE:
00434 case GROUP_COALMINE:
00435 case GROUP_OREMINE:
00436 case GROUP_INDUSTRY_L:
00437 case GROUP_INDUSTRY_H:
00438 case GROUP_RECYCLE:
00439 case GROUP_TIP:
00440 case GROUP_PORT:
00441 mask |= FLAG_RIGHT;
00442 break;
00443 default:
00444 #ifdef THOMMY_MAY_BE_WRONG /* just in case -- (ThMO) */
00445 if (y > 0)
00446 #endif
00447 if (MP_GROUP(x+1,y-1) == GROUP_COAL_POWER)
00448 mask |= FLAG_RIGHT;
00449 break;
00450 }
00451 }
00452 #ifdef THOMMY_MAY_BE_WRONG /* just in case -- (ThMO) */
00453 if (y < WORLD_SIDE_LEN - 1)
00454 #endif
00455 {
00456 switch (MP_GROUP(x,y + 1))
00457 {
00458 case GROUP_RAIL:
00459 tflags |= FLAG_DOWN;
00460 case GROUP_COMMUNE:
00461 case GROUP_COALMINE:
00462 case GROUP_OREMINE:
00463 case GROUP_INDUSTRY_L:
00464 case GROUP_INDUSTRY_H:
00465 case GROUP_RECYCLE:
00466 case GROUP_TIP:
00467 case GROUP_PORT:
00468 mask |= FLAG_DOWN;
00469 break;
00470 default:
00471 #ifdef THOMMY_MAY_BE_WRONG /* just in case -- (ThMO) */
00472 if (x > 0)
00473 #endif
00474 if (MP_GROUP(x - 1,y + 1)
00475 == GROUP_COAL_POWER)
00476 mask |= FLAG_DOWN;
00477 break;
00478 }
00479 }
00480 MP_INFO(x,y).flags &= ~(FLAG_UP | FLAG_DOWN | FLAG_LEFT
00481 | FLAG_RIGHT);
00482 MP_INFO(x,y).flags |= tflags;
00483 MP_TYPE(x,y) = rail_table[mask];
00484 break;
00485
00486 case GROUP_WATER:
00487 mask = 0;
00488 #ifdef THOMMY_MAY_BE_WRONG /* just in case -- (ThMO) */
00489 if (y > 0)
00490 #endif
00491 { /* up -- (ThMO) */
00492 if (MP_GROUP(x,y - 1)
00493 == GROUP_WATER)
00494 mask |= 8;
00495 }
00496 #ifdef THOMMY_MAY_BE_WRONG /* just in case -- (ThMO) */
00497 if (x > 0)
00498 #endif
00499 { /* left -- (ThMO) */
00500 type = MP_TYPE(x - 1,y);
00501 if ((type == CST_USED &&
00502 MP_GROUP(MP_INFO(x-1,y).int_1,MP_INFO(x-1,y).int_2)
00503 == GROUP_PORT)
00504 || get_group_of_type(type) == GROUP_WATER)
00505 mask |= 4;
00506 }
00507 #ifdef THOMMY_MAY_BE_WRONG /* just in case -- (ThMO) */
00508 if (x < WORLD_SIDE_LEN - 1)
00509 #endif
00510 { /* right -- (ThMO) */
00511 if (MP_GROUP(x + 1,y)
00512 == GROUP_WATER)
00513 mask |= 2;
00514 }
00515 #ifdef THOMMY_MAY_BE_WRONG /* just in case -- (ThMO) */
00516 if (y < WORLD_SIDE_LEN - 1)
00517 #endif
00518 { /* down -- (ThMO) */
00519 if (MP_GROUP(x,y + 1)
00520 == GROUP_WATER)
00521 ++mask;
00522 }
00523 MP_TYPE(x,y) = water_table[mask];
00524 break;
00525 } /* end switch */
00526 } /* end for */
00527 } /* end for */
00528 }
|
|
|
Definition at line 569 of file simulate.c. 00570 {
00571 int x, y, i;
00572 i = 0;
00573 for (y = 0; y < WORLD_SIDE_LEN; y++)
00574 for (x = 0; x < WORLD_SIDE_LEN; x++)
00575 if (MP_GROUP(x,y) == g)
00576 i++;
00577 return (i);
00578 }
|
|
||||||||||||||||||||
|
Definition at line 482 of file market.c. 00483 {
00484 int i, r, extra_jobs = 3, flags;
00485 flags = MP_INFO(x,y).flags;
00486 /* tracks */
00487 if (MP_GROUP(tx,ty) == GROUP_TRACK)
00488 {
00489 /* food */
00490 if ((flags & FLAG_MB_FOOD) != 0)
00491 {
00492 r = (MAX_FOOD_IN_MARKET * 1000)
00493 / (MAX_FOOD_ON_TRACK + MAX_FOOD_IN_MARKET);
00494 i = MP_INFO(x,y).int_1 + MP_INFO(tx,ty).int_1;
00495 MP_INFO(x,y).int_1 = (i * r) / 1000;
00496 MP_INFO(tx,ty).int_1 = i - MP_INFO(x,y).int_1;
00497 }
00498
00499 /* jobs */
00500 if ((flags & FLAG_MB_JOBS) != 0)
00501 {
00502 r = (MAX_JOBS_IN_MARKET * 1000)
00503 / (MAX_JOBS_ON_TRACK + MAX_JOBS_IN_MARKET);
00504 i = MP_INFO(x,y).int_2 + MP_INFO(tx,ty).int_2;
00505 MP_INFO(x,y).int_2 = (i * r) / 1000;
00506 MP_INFO(tx,ty).int_2 = i - MP_INFO(x,y).int_2;
00507 }
00508
00509 /* coal */
00510 if ((flags & FLAG_MB_COAL) != 0)
00511 {
00512 r = (MAX_COAL_IN_MARKET * 1000)
00513 / (MAX_COAL_ON_TRACK + MAX_COAL_IN_MARKET);
00514 i = MP_INFO(x,y).int_3 + MP_INFO(tx,ty).int_3;
00515 MP_INFO(x,y).int_3 = (i * r) / 1000;
00516 MP_INFO(tx,ty).int_3 = i - MP_INFO(x,y).int_3;
00517 }
00518
00519 /* goods */
00520 if ((flags & FLAG_MB_GOODS) != 0)
00521 {
00522 r = (MAX_GOODS_IN_MARKET * 1000)
00523 / (MAX_GOODS_ON_TRACK + MAX_GOODS_IN_MARKET);
00524 i = MP_INFO(x,y).int_4 + MP_INFO(tx,ty).int_4;
00525 MP_INFO(x,y).int_4 = (i * r) / 1000;
00526 MP_INFO(tx,ty).int_4 = i - MP_INFO(x,y).int_4;
00527 }
00528
00529 /* ore */
00530 if ((flags & FLAG_MB_ORE) != 0)
00531 {
00532 r = (MAX_ORE_IN_MARKET * 1000)
00533 / (MAX_ORE_ON_TRACK + MAX_ORE_IN_MARKET);
00534 i = MP_INFO(x,y).int_5 + MP_INFO(tx,ty).int_5;
00535 MP_INFO(x,y).int_5 = (i * r) / 1000;
00536 MP_INFO(tx,ty).int_5 = i - MP_INFO(x,y).int_5;
00537 }
00538
00539
00540 /* steel */
00541 if ((flags & FLAG_MB_STEEL) != 0)
00542 {
00543 r = (MAX_STEEL_IN_MARKET * 1000)
00544 / (MAX_STEEL_ON_TRACK + MAX_STEEL_IN_MARKET);
00545 i = MP_INFO(x,y).int_6 + MP_INFO(tx,ty).int_6;
00546 MP_INFO(x,y).int_6 = (i * r) / 1000;
00547 MP_INFO(tx,ty).int_6 = i - MP_INFO(x,y).int_6;
00548 }
00549
00550 /* waste */
00551 r = (MAX_WASTE_IN_MARKET * 1000)
00552 / (MAX_WASTE_ON_TRACK + MAX_WASTE_IN_MARKET);
00553 i = MP_INFO(x,y).int_7 + MP_INFO(tx,ty).int_7;
00554 MP_INFO(x,y).int_7 = (i * r) / 1000;
00555 MP_INFO(tx,ty).int_7 = i - MP_INFO(x,y).int_7;
00556
00557
00558 /* if it's full of waste, burn some to make pollution. */
00559 if (MP_INFO(x,y).int_7 >= (99 * MAX_WASTE_IN_MARKET / 100))
00560 {
00561 MP_POL(x,y) += 3000;
00562 MP_INFO(x,y).int_7 -= (7 * MAX_WASTE_IN_MARKET) / 10;
00563 #if defined (commentout)
00564 /* this should fire up the pollution mini screen within a second. */
00565 mini_screen_flags = MINI_SCREEN_POL_FLAG;
00566 #endif
00567 }
00568 }
00569
00570
00571 /* do rail traffic */
00572 else if (MP_GROUP(tx,ty) == GROUP_RAIL)
00573 {
00574 /* food */
00575 if ((flags & FLAG_MB_FOOD) != 0)
00576 {
00577 r = (MAX_FOOD_IN_MARKET * 1000)
00578 / (MAX_FOOD_ON_RAIL + MAX_FOOD_IN_MARKET);
00579 i = MP_INFO(x,y).int_1 + MP_INFO(tx,ty).int_1;
00580 MP_INFO(x,y).int_1 = (i * r) / 1000;
00581 MP_INFO(tx,ty).int_1 = i - MP_INFO(x,y).int_1;
00582 }
00583
00584 /* jobs */
00585 if ((flags & FLAG_MB_JOBS) != 0)
00586 {
00587 r = (MAX_JOBS_IN_MARKET * 1000)
00588 / (MAX_JOBS_ON_RAIL + MAX_JOBS_IN_MARKET);
00589 i = MP_INFO(x,y).int_2 + MP_INFO(tx,ty).int_2;
00590 MP_INFO(x,y).int_2 = (i * r) / 1000;
00591 MP_INFO(tx,ty).int_2 = i - MP_INFO(x,y).int_2;
00592 }
00593
00594 /* coal */
00595 if ((flags & FLAG_MB_COAL) != 0)
00596 {
00597 r = (MAX_COAL_IN_MARKET * 1000)
00598 / (MAX_COAL_ON_RAIL + MAX_COAL_IN_MARKET);
00599 i = MP_INFO(x,y).int_3 + MP_INFO(tx,ty).int_3;
00600 MP_INFO(x,y).int_3 = (i * r) / 1000;
00601 MP_INFO(tx,ty).int_3 = i - MP_INFO(x,y).int_3;
00602 }
00603
00604 /* goods */
00605 if ((flags & FLAG_MB_GOODS) != 0)
00606 {
00607 r = (MAX_GOODS_IN_MARKET * 1000)
00608 / (MAX_GOODS_ON_RAIL + MAX_GOODS_IN_MARKET);
00609 i = MP_INFO(x,y).int_4 + MP_INFO(tx,ty).int_4;
00610 MP_INFO(x,y).int_4 = (i * r) / 1000;
00611 MP_INFO(tx,ty).int_4 = i - MP_INFO(x,y).int_4;
00612 }
00613
00614 /* ore */
00615 if ((flags & FLAG_MB_ORE) != 0)
00616 {
00617 r = (MAX_ORE_IN_MARKET * 1000)
00618 / (MAX_ORE_ON_RAIL + MAX_ORE_IN_MARKET);
00619 i = MP_INFO(x,y).int_5 + MP_INFO(tx,ty).int_5;
00620 MP_INFO(x,y).int_5 = (i * r) / 1000;
00621 MP_INFO(tx,ty).int_5 = i - MP_INFO(x,y).int_5;
00622 }
00623
00624 /* steel */
00625 if ((flags & FLAG_MB_STEEL) != 0)
00626 {
00627 r = (MAX_STEEL_IN_MARKET * 1000)
00628 / (MAX_STEEL_ON_RAIL + MAX_STEEL_IN_MARKET);
00629 i = MP_INFO(x,y).int_6 + MP_INFO(tx,ty).int_6;
00630 MP_INFO(x,y).int_6 = (i * r) / 1000;
00631 MP_INFO(tx,ty).int_6 = i - MP_INFO(x,y).int_6;
00632 }
00633
00634 /* waste */
00635 r = (MAX_WASTE_IN_MARKET * 1000)
00636 / (MAX_WASTE_ON_RAIL + MAX_WASTE_IN_MARKET);
00637 i = MP_INFO(x,y).int_7 + MP_INFO(tx,ty).int_7;
00638 MP_INFO(x,y).int_7 = (i * r) / 1000;
00639 MP_INFO(tx,ty).int_7 = i - MP_INFO(x,y).int_7;
00640
00641 }
00642
00643 /* do road traffic */
00644 else if (MP_GROUP(tx,ty) == GROUP_ROAD)
00645 {
00646 /* food */
00647 if ((flags & FLAG_MB_FOOD) != 0)
00648 {
00649 r = (MAX_FOOD_IN_MARKET * 1000)
00650 / (MAX_FOOD_ON_ROAD + MAX_FOOD_IN_MARKET);
00651 i = MP_INFO(x,y).int_1 + MP_INFO(tx,ty).int_1;
00652 MP_INFO(x,y).int_1 = (i * r) / 1000;
00653 MP_INFO(tx,ty).int_1 = i - MP_INFO(x,y).int_1;
00654 }
00655
00656 /* jobs */
00657 if ((flags & FLAG_MB_JOBS) != 0)
00658 {
00659 r = (MAX_JOBS_IN_MARKET * 1000)
00660 / (MAX_JOBS_ON_ROAD + MAX_JOBS_IN_MARKET);
00661 i = MP_INFO(x,y).int_2 + MP_INFO(tx,ty).int_2;
00662 MP_INFO(x,y).int_2 = (i * r) / 1000;
00663 MP_INFO(tx,ty).int_2 = i - MP_INFO(x,y).int_2;
00664 }
00665
00666 /* coal */
00667 if ((flags & FLAG_MB_COAL) != 0)
00668 {
00669 r = (MAX_COAL_IN_MARKET * 1000)
00670 / (MAX_COAL_ON_ROAD + MAX_COAL_IN_MARKET);
00671 i = MP_INFO(x,y).int_3 + MP_INFO(tx,ty).int_3;
00672 MP_INFO(x,y).int_3 = (i * r) / 1000;
00673 MP_INFO(tx,ty).int_3 = i - MP_INFO(x,y).int_3;
00674 }
00675
00676 /* goods */
00677 if ((flags & FLAG_MB_GOODS) != 0)
00678 {
00679 r = (MAX_GOODS_IN_MARKET * 1000)
00680 / (MAX_GOODS_ON_ROAD + MAX_GOODS_IN_MARKET);
00681 i = MP_INFO(x,y).int_4 + MP_INFO(tx,ty).int_4;
00682 MP_INFO(x,y).int_4 = (i * r) / 1000;
00683 MP_INFO(tx,ty).int_4 = i - MP_INFO(x,y).int_4;
00684 }
00685
00686 /* ore */
00687 if ((flags & FLAG_MB_ORE) != 0)
00688 {
00689 r = (MAX_ORE_IN_MARKET * 1000)
00690 / (MAX_ORE_ON_ROAD + MAX_ORE_IN_MARKET);
00691 i = MP_INFO(x,y).int_5 + MP_INFO(tx,ty).int_5;
00692 MP_INFO(x,y).int_5 = (i * r) / 1000;
00693 MP_INFO(tx,ty).int_5 = i - MP_INFO(x,y).int_5;
00694 }
00695
00696 /* steel */
00697 if ((flags & FLAG_MB_STEEL) != 0)
00698 {
00699 r = (MAX_STEEL_IN_MARKET * 1000)
00700 / (MAX_STEEL_ON_ROAD + MAX_STEEL_IN_MARKET);
00701 i = MP_INFO(x,y).int_6 + MP_INFO(tx,ty).int_6;
00702 MP_INFO(x,y).int_6 = (i * r) / 1000;
00703 MP_INFO(tx,ty).int_6 = i - MP_INFO(x,y).int_6;
00704 }
00705
00706 /* waste */
00707 r = (MAX_WASTE_IN_MARKET * 1000)
00708 / (MAX_WASTE_ON_ROAD + MAX_WASTE_IN_MARKET);
00709 i = MP_INFO(x,y).int_7 + MP_INFO(tx,ty).int_7;
00710 MP_INFO(x,y).int_7 = (i * r) / 1000;
00711 MP_INFO(tx,ty).int_7 = i - MP_INFO(x,y).int_7;
00712 }
00713 else
00714 extra_jobs = 0;
00715
00716 return (extra_jobs);
00717 }
|
|
|
|
|
|
Definition at line 2603 of file screen.c. 02604 {
02605 char s[100];
02606 sprintf (s, "%d ", v);
02607 Fgl_write (280, 471, s);
02608 }
|
|
||||||||||||
|
Definition at line 2728 of file engine.c. 02729 {
02730 /*
02731 // int_1 contains the goods at the blacksmith
02732 // int_2 contains the goods made - for the animation
02733 // int_3 contains the coal store
02734 // int_4 is the animation trigger time
02735 // int_5 is the % made so far this month
02736 // int_6 is the % capacity last month
02737 */
02738 if (MP_INFO(x,y).int_3 < MAX_COAL_AT_BLACKSMITH)
02739 if (get_coal (x, y, BLACKSMITH_GET_COAL) != 0)
02740 MP_INFO(x,y).int_3 += BLACKSMITH_GET_COAL;
02741 if (MP_INFO(x,y).int_1 < MAX_GOODS_AT_BLACKSMITH
02742 && MP_INFO(x,y).int_3 >= BLACKSMITH_COAL_USED)
02743 {
02744 if (get_steel (x, y, BLACKSMITH_STEEL_USED) != 0)
02745 {
02746 MP_INFO(x,y).int_1 += GOODS_MADE_BY_BLACKSMITH;
02747 MP_INFO(x,y).int_3 -= BLACKSMITH_COAL_USED;
02748 }
02749 }
02750 if (get_jobs (x, y, BLACKSMITH_JOBS) != 0)
02751 {
02752 if (MP_INFO(x,y).int_1 > GOODS_MADE_BY_BLACKSMITH)
02753 {
02754 if (put_goods (x, y, GOODS_MADE_BY_BLACKSMITH - 1) != 0)
02755 {
02756 MP_INFO(x,y).int_1 -= (GOODS_MADE_BY_BLACKSMITH - 1);
02757 MP_INFO(x,y).int_2 += (GOODS_MADE_BY_BLACKSMITH - 1);
02758 MP_INFO(x,y).int_5++;
02759 }
02760 else
02761 put_jobs (x, y, BLACKSMITH_JOBS);
02762 }
02763 else
02764 put_jobs (x, y, BLACKSMITH_JOBS);
02765 }
02766 else
02767 MP_TYPE(x,y) = CST_BLACKSMITH_0;
02768 if (MP_INFO(x,y).int_2 > BLACKSMITH_BATCH
02769 && real_time >= MP_INFO(x,y).int_4)
02770 {
02771 MP_INFO(x,y).int_4 = real_time + BLACKSMITH_ANIM_SPEED;
02772 switch (MP_TYPE(x,y))
02773 {
02774 case (CST_BLACKSMITH_0):
02775 MP_TYPE(x,y) = CST_BLACKSMITH_1;
02776 break;
02777 case (CST_BLACKSMITH_1):
02778 MP_TYPE(x,y) = CST_BLACKSMITH_2;
02779 break;
02780 case (CST_BLACKSMITH_2):
02781 MP_TYPE(x,y) = CST_BLACKSMITH_3;
02782 break;
02783 case (CST_BLACKSMITH_3):
02784 MP_TYPE(x,y) = CST_BLACKSMITH_4;
02785 break;
02786 case (CST_BLACKSMITH_4):
02787 MP_TYPE(x,y) = CST_BLACKSMITH_5;
02788 break;
02789 case (CST_BLACKSMITH_5):
02790 MP_TYPE(x,y) = CST_BLACKSMITH_6;
02791 break;
02792 case (CST_BLACKSMITH_6):
02793 MP_TYPE(x,y) = CST_BLACKSMITH_1;
02794 MP_INFO(x,y).int_2 = 0;
02795 MP_POL(x,y)++;
02796 break;
02797 }
02798 }
02799 if (total_time % 100 == 0)
02800 {
02801 MP_INFO(x,y).int_6 = MP_INFO(x,y).int_5;
02802 MP_INFO(x,y).int_5 = 0;
02803 }
02804 }
|
|
||||||||||||
|
Definition at line 1359 of file engine.c. 01360 {
01361 /*
01362 // int_1 is the coal at the surface
01363 // int_2 is the coal reserve under the ground. More than one mine can
01364 // int_3 is the jobs collected.
01365 */
01366 /* claim the coal under ground! */
01367 int xx, yy, xs, ys, xe, ye, cr;
01368 if (MP_INFO(x,y).int_1 < (DIG_MORE_COAL_TRIGGER - 1000))
01369 {
01370 if (MP_INFO(x,y).int_2 < 0)
01371 return; /* run out of reserves */
01372
01373 xs = x - COAL_RESERVE_SEARCH_LEN;
01374 if (xs < 0)
01375 xs = 0;
01376 ys = y - COAL_RESERVE_SEARCH_LEN;
01377 if (ys < 0)
01378 ys = 0;
01379 xe = x + COAL_RESERVE_SEARCH_LEN;
01380 if (xe > WORLD_SIDE_LEN)
01381 xe = WORLD_SIDE_LEN;
01382 ye = y + COAL_RESERVE_SEARCH_LEN;
01383 if (ye > WORLD_SIDE_LEN)
01384 ye = WORLD_SIDE_LEN;
01385 cr = 0;
01386 for (yy = ys; yy < ye; yy++)
01387 for (xx = xs; xx < xe; xx++)
01388 cr += MP_INFO(xx,yy).coal_reserve;
01389 MP_INFO(x,y).int_2 = cr;
01390 if (cr > 0)
01391 {
01392 if (get_jobs (x, y, JOBS_DIG_COAL
01393 - MP_INFO(x,y).int_3) != 0)
01394 {
01395 MP_INFO(x,y).int_3 = 0;
01396 for (yy = ys; yy < ye; yy++)
01397 for (xx = xs; xx < xe; xx++)
01398 if (MP_INFO(xx,yy).coal_reserve > 0)
01399 {
01400 MP_INFO(xx,yy).coal_reserve--;
01401 MP_INFO(x,y).int_1 += 1000;
01402 coal_made += 1000;
01403 coal_tax += 1000;
01404 sust_dig_ore_coal_tip_flag = 0;
01405 MP_POL(x,y) += COALMINE_POLLUTION;
01406 yy = ye;
01407 xx = xe; /* break out */
01408
01409 }
01410 }
01411 else if (get_jobs (x, y, JOBS_DIG_COAL / 10) != 0)
01412 MP_INFO(x,y).int_3 += JOBS_DIG_COAL / 10;
01413 else if (get_jobs (x, y, JOBS_DIG_COAL / 50) != 0)
01414 MP_INFO(x,y).int_3 += JOBS_DIG_COAL / 50;
01415 }
01416 else
01417 {
01418 MP_INFO(x,y).int_1 = 0;
01419 MP_INFO(x,y).int_2 = -1;
01420 }
01421 }
01422 /* put it on the railway */
01423 if (MP_GROUP(x - 1,y) == GROUP_RAIL
01424 && MP_INFO(x - 1,y).int_3 < MAX_COAL_ON_RAIL
01425 && MP_INFO(x,y).int_1 >= (MAX_COAL_ON_RAIL
01426 - MP_INFO(x - 1,y).int_3))
01427 {
01428 if (get_jobs (x, y, JOBS_LOAD_COAL) != 0)
01429 {
01430 MP_INFO(x,y).int_1
01431 -= (MAX_COAL_ON_RAIL - MP_INFO(x - 1,y).int_3);
01432 MP_INFO(x - 1,y).int_3 = MAX_COAL_ON_RAIL;
01433 }
01434 }
01435 if (MP_GROUP(x,y-1) == GROUP_RAIL
01436 && MP_INFO(x,y - 1).int_3 < MAX_COAL_ON_RAIL
01437 && MP_INFO(x,y).int_1 >= (MAX_COAL_ON_RAIL
01438 - MP_INFO(x,y - 1).int_3))
01439 {
01440 if (get_jobs (x, y, JOBS_LOAD_COAL) != 0)
01441 {
01442 MP_INFO(x,y).int_1
01443 -= (MAX_COAL_ON_RAIL - MP_INFO(x,y - 1).int_3);
01444 MP_INFO(x,y - 1).int_3 = MAX_COAL_ON_RAIL;
01445 }
01446 }
01447 /* put it on the road */
01448 if (MP_GROUP(x-1,y) == GROUP_ROAD
01449 && MP_INFO(x - 1,y).int_3 < MAX_COAL_ON_ROAD
01450 && MP_INFO(x,y).int_1 >= (MAX_COAL_ON_ROAD
01451 - MP_INFO(x - 1,y).int_3))
01452 {
01453 if (get_jobs (x, y, JOBS_LOAD_COAL) != 0)
01454 {
01455 MP_INFO(x,y).int_1
01456 -= (MAX_COAL_ON_ROAD - MP_INFO(x - 1,y).int_3);
01457 MP_INFO(x - 1,y).int_3 = MAX_COAL_ON_ROAD;
01458 }
01459 }
01460 if (MP_GROUP(x,y-1) == GROUP_ROAD
01461 && MP_INFO(x,y - 1).int_3 < MAX_COAL_ON_ROAD
01462 && MP_INFO(x,y).int_1 >= (MAX_COAL_ON_ROAD
01463 - MP_INFO(x,y - 1).int_3))
01464 {
01465 if (get_jobs (x, y, JOBS_LOAD_COAL) != 0)
01466 {
01467 MP_INFO(x,y).int_1
01468 -= (MAX_COAL_ON_ROAD - MP_INFO(x,y - 1).int_3);
01469 MP_INFO(x,y - 1).int_3 = MAX_COAL_ON_ROAD;
01470 }
01471 }
01472 /* put it on the tracks */
01473 if (MP_GROUP(x-1,y) == GROUP_TRACK
01474 && MP_INFO(x - 1,y).int_3 < MAX_COAL_ON_TRACK
01475 && MP_INFO(x,y).int_1 >= (MAX_COAL_ON_TRACK
01476 - MP_INFO(x - 1,y).int_3))
01477 {
01478 if (get_jobs (x, y, JOBS_LOAD_COAL) != 0)
01479 {
01480 MP_INFO(x,y).int_1
01481 -= (MAX_COAL_ON_TRACK - MP_INFO(x - 1,y).int_3);
01482 MP_INFO(x - 1,y).int_3 = MAX_COAL_ON_TRACK;
01483 }
01484 }
01485 if (MP_GROUP(x,y-1) == GROUP_TRACK
01486 && MP_INFO(x,y - 1).int_3 < MAX_COAL_ON_TRACK
01487 && MP_INFO(x,y).int_1 >= (MAX_COAL_ON_TRACK
01488 - MP_INFO(x,y - 1).int_3))
01489 {
01490 if (get_jobs (x, y, JOBS_LOAD_COAL) != 0)
01491 {
01492 MP_INFO(x,y).int_1
01493 -= (MAX_COAL_ON_TRACK - MP_INFO(x,y - 1).int_3);
01494 MP_INFO(x,y - 1).int_3 = MAX_COAL_ON_TRACK;
01495 }
01496 }
01497
01498 /* choose a graphic */
01499 if (MP_INFO(x,y).int_1 > (MAX_COAL_AT_MINE - (MAX_COAL_AT_MINE / 5)))
01500 MP_TYPE(x,y) = CST_COALMINE_FULL;
01501 else if (MP_INFO(x,y).int_1 > (MAX_COAL_AT_MINE / 2))
01502 MP_TYPE(x,y) = CST_COALMINE_MED;
01503 else if (MP_INFO(x,y).int_1 > 0)
01504 MP_TYPE(x,y) = CST_COALMINE_LOW;
01505 else
01506 MP_TYPE(x,y) = CST_COALMINE_EMPTY;
01507 }
|
|
||||||||||||
|
Definition at line 1677 of file engine.c. 01678 {
01679 /*
01680 // int_1 is the animation trigger time
01681 // int_2 is the steelflag/trackflag
01682 // int_3 is the coal sold in the last 100 days 200 units is 100%
01683 // steel adds more.
01684 // int_4 is the months without selling much coal,steel,ore
01685 // int_5 is the coal, ore, steel waste flags for last month
01686 // int_6 is the coal, ore, steel waste flags so far this month
01687 */
01688 /* GCS -- I folded the trackflag into int_2, changing the logic slightly.
01689 This change only affects the animation. */
01690 int trackflag = 0;
01691 /* stick coal and ore on tracks, in SMALL doses. */
01692 if (put_coal (x, y, 2) != 0)
01693 {
01694 trackflag = 1;
01695 MP_INFO(x,y).int_3++;
01696 MP_INFO(x,y).int_6 |= 1;
01697 }
01698 if (put_ore (x, y, 6) != 0)
01699 {
01700 trackflag = 1;
01701 MP_INFO(x,y).int_3++;
01702 MP_INFO(x,y).int_6 |= 2;
01703 }
01704 /* recycle a bit of waste */
01705 if (get_waste (x, y, 20) != 0)
01706 {
01707 trackflag = 1;
01708 MP_INFO(x,y).int_3++;
01709 MP_INFO(x,y).int_6 |= 8;
01710 }
01711 if (total_time % 10 == 0)
01712 {
01713 MP_INFO(x,y).int_2 = 1;
01714 if (put_steel (x, y, 2) != 0) {
01715 MP_INFO(x,y).int_3++;
01716 MP_INFO(x,y).int_6 |= 4;
01717 } else {
01718 MP_INFO(x,y).int_2 = 0;
01719 }
01720 if (trackflag) {
01721 MP_INFO(x,y).int_2 = 0;
01722 }
01723 }
01724 if (total_time % 100 == 48)
01725 {
01726 MP_INFO(x,y).int_5 = MP_INFO(x,y).int_6;
01727 MP_INFO(x,y).int_6 = 0;
01728 if (MP_INFO(x,y).int_2 == 0 || trackflag == 0)
01729 {
01730 if (MP_TYPE(x,y) > CST_COMMUNE_7)
01731 MP_TYPE(x,y) -= 7;
01732 }
01733 else if (MP_TYPE(x,y) <= CST_COMMUNE_7)
01734 MP_TYPE(x,y) += 7;
01735 if (MP_INFO(x,y).int_3 > 0) /* >0% */
01736 {
01737 MP_INFO(x,y).int_3 = 0;
01738 if (--MP_INFO(x,y).int_4 < 0)
01739 MP_INFO(x,y).int_4 = 0;
01740 }
01741 else
01742 {
01743 MP_INFO(x,y).int_3 = 0;
01744 MP_INFO(x,y).int_4++;
01745 if (MP_INFO(x,y).int_4 > 120) /* 10 years */
01746 {
01747 do_bulldoze_area (CST_PARKLAND_PLANE, x, y);
01748 return;
01749 }
01750 }
01751 }
01752 /* animate */
01753 if (real_time >= MP_INFO(x,y).int_1)
01754 {
01755 MP_INFO(x,y).int_1 = real_time + COMMUNE_ANIM_SPEED;
01756 switch (MP_TYPE(x,y))
01757 {
01758 case (CST_COMMUNE_1):
01759 MP_TYPE(x,y) = CST_COMMUNE_2;
01760 break;
01761 case (CST_COMMUNE_2):
01762 MP_TYPE(x,y) = CST_COMMUNE_3;
01763 break;
01764 case (CST_COMMUNE_3):
01765 MP_TYPE(x,y) = CST_COMMUNE_4;
01766 break;
01767 case (CST_COMMUNE_4):
01768 MP_TYPE(x,y) = CST_COMMUNE_5;
01769 break;
01770 case (CST_COMMUNE_5):
01771 MP_TYPE(x,y) = CST_COMMUNE_6;
01772 break;
01773 case (CST_COMMUNE_6):
01774 MP_TYPE(x,y) = CST_COMMUNE_1;
01775 break;
01776 case (CST_COMMUNE_8):
01777 MP_TYPE(x,y) = CST_COMMUNE_9;
01778 break;
01779 case (CST_COMMUNE_9):
01780 MP_TYPE(x,y) = CST_COMMUNE_10;
01781 break;
01782 case (CST_COMMUNE_10):
01783 MP_TYPE(x,y) = CST_COMMUNE_11;
01784 break;
01785 case (CST_COMMUNE_11):
01786 MP_TYPE(x,y) = CST_COMMUNE_12;
01787 break;
01788 case (CST_COMMUNE_12):
01789 MP_TYPE(x,y) = CST_COMMUNE_13;
01790 break;
01791 case (CST_COMMUNE_13):
01792 MP_TYPE(x,y) = CST_COMMUNE_8;
01793 break;
01794
01795 }
01796 }
01797
01798 }
|
|
||||||||||||
|
Definition at line 3068 of file engine.c. 03069 {
03070 /*
03071 // int_1 is the jobs stored at the pavillion
03072 // int_2 is the goods stored at the pavillion
03073 // int_3 is the animation flag
03074 // int_4 is the time of the next frame
03075 */
03076 if (MP_INFO(x,y).int_1
03077 < (MAX_JOBS_AT_CRICKET - CRICKET_GET_JOBS))
03078 if (get_jobs (x, y, CRICKET_GET_JOBS) != 0)
03079 MP_INFO(x,y).int_1 += CRICKET_GET_JOBS;
03080 if (MP_INFO(x,y).int_2
03081 < (MAX_GOODS_AT_CRICKET - CRICKET_GET_GOODS))
03082 if (get_goods (x, y, CRICKET_GET_GOODS) != 0)
03083 MP_INFO(x,y).int_2 += CRICKET_GET_GOODS;
03084 /* animate */
03085 if (MP_INFO(x,y).int_3 && real_time > MP_INFO(x,y).int_4)
03086 {
03087 MP_INFO(x,y).int_4 = real_time + CRICKET_ANIMATION_SPEED;
03088 switch (MP_TYPE(x,y))
03089 {
03090 case (CST_CRICKET_1):
03091 MP_TYPE(x,y) = CST_CRICKET_2;
03092 break;
03093 case (CST_CRICKET_2):
03094 MP_TYPE(x,y) = CST_CRICKET_3;
03095 break;
03096 case (CST_CRICKET_3):
03097 MP_TYPE(x,y) = CST_CRICKET_4;
03098 break;
03099 case (CST_CRICKET_4):
03100 MP_TYPE(x,y) = CST_CRICKET_5;
03101 break;
03102 case (CST_CRICKET_5):
03103 MP_TYPE(x,y) = CST_CRICKET_6;
03104 break;
03105 case (CST_CRICKET_6):
03106 MP_TYPE(x,y) = CST_CRICKET_7;
03107 break;
03108 case (CST_CRICKET_7):
03109 MP_TYPE(x,y) = CST_CRICKET_1;
03110 MP_INFO(x,y).int_3 = 0; /* disable anim */
03111
03112 break;
03113 }
03114 }
03115
03116 /* That's all. Cover is done by different functions every 3 months or so. */
03117
03118 cricket_cost += CRICKET_RUNNING_COST;
03119 }
|
|
||||||||||||
|
Definition at line 3208 of file engine.c. 03209 {
03210 int xx, x1, x2, y1, y2;
03211 if (MP_INFO(x,y).int_1 < (CRICKET_JOBS * DAYS_BETWEEN_COVER) ||
03212 MP_INFO(x,y).int_2 < (CRICKET_GOODS * DAYS_BETWEEN_COVER))
03213 return;
03214 MP_INFO(x,y).int_1 -= (CRICKET_JOBS * DAYS_BETWEEN_COVER);
03215 MP_INFO(x,y).int_2 -= (CRICKET_GOODS * DAYS_BETWEEN_COVER);
03216 MP_INFO(x,y).int_3 = 1; /* turn on animation */
03217
03218 x1 = x - CRICKET_RANGE;
03219 if (x1 < 0)
03220 x1 = 0;
03221 x2 = x + CRICKET_RANGE;
03222 if (x2 > WORLD_SIDE_LEN)
03223 x2 = WORLD_SIDE_LEN;
03224 y1 = y - CRICKET_RANGE;
03225 if (y1 < 0)
03226 y1 = 0;
03227 y2 = y + CRICKET_RANGE;
03228 if (y2 > WORLD_SIDE_LEN)
03229 y2 = WORLD_SIDE_LEN;
03230 for (; y1 < y2; y1++)
03231 for (xx = x1; xx < x2; xx++)
03232 MP_INFO(xx,y1).flags |= FLAG_CRICKET_COVER;
03233 }
|
|
|
Definition at line 302 of file picedit.c. 00303 {
00304 #ifdef LC_X11
00305 HandleError (s, FATAL);
00306 #else
00307 vga_setmode (TEXT);
00308 printf ("%s\n", s);
00309 exit (1);
00310 #endif
00311 }
|
|
||||||||||||
|
Definition at line 3327 of file engine.c. 03328 {
03329 /*
03330 // int_1 is the next animation frame time
03331 // int_2 is the fire length
03332 // int_3 is the real_time before the fire can spread or -1 if triggered
03333 // int_4 is the idle land length
03334 */
03335 int i;
03336 /* this so we don't get whole blocks changing in one go. */
03337 if (MP_INFO(x,y).int_2 == 0)
03338
03339 MP_INFO(x,y).int_2 = rand () % (FIRE_LENGTH / 5);
03340 if (MP_INFO(x,y).int_2 > FIRE_LENGTH)
03341 {
03342 int old_type = MP_TYPE(x,y);
03343 if (MP_INFO(x,y).int_4 == 0) /* rand length here also */
03344 MP_INFO(x,y).int_4 = rand () % (AFTER_FIRE_LENGTH / 6);
03345 MP_INFO(x,y).int_4++;
03346 if (MP_INFO(x,y).int_4 > AFTER_FIRE_LENGTH)
03347 do_bulldoze_area (CST_GREEN, x, y);
03348 else if (MP_INFO(x,y).int_4 > (3 * AFTER_FIRE_LENGTH) / 4)
03349 MP_TYPE(x,y) = CST_FIRE_DONE4;
03350 else if (MP_INFO(x,y).int_4 > (2 * AFTER_FIRE_LENGTH) / 4)
03351 MP_TYPE(x,y) = CST_FIRE_DONE3;
03352 else if (MP_INFO(x,y).int_4 > (AFTER_FIRE_LENGTH) / 4)
03353 MP_TYPE(x,y) = CST_FIRE_DONE2;
03354 else
03355 MP_TYPE(x,y) = CST_FIRE_DONE1;
03356 return;
03357 }
03358 MP_INFO(x,y).int_2++;
03359 if (real_time > MP_INFO(x,y).int_1)
03360 {
03361 MP_INFO(x,y).int_1 = real_time + FIRE_ANIMATION_SPEED;
03362 if (MP_TYPE(x,y) == CST_FIRE_1)
03363 MP_TYPE(x,y) = CST_FIRE_2;
03364 else if (MP_TYPE(x,y) == CST_FIRE_2)
03365 MP_TYPE(x,y) = CST_FIRE_3;
03366 else if (MP_TYPE(x,y) == CST_FIRE_3)
03367 MP_TYPE(x,y) = CST_FIRE_4;
03368 else if (MP_TYPE(x,y) == CST_FIRE_4)
03369 MP_TYPE(x,y) = CST_FIRE_5;
03370 else if (MP_TYPE(x,y) == CST_FIRE_5)
03371 MP_TYPE(x,y) = CST_FIRE_1;
03372 }
03373 if (MP_INFO(x,y).int_3 == -1)
03374 {
03375 if ((rand () % FIRE_DAYS_PER_SPREAD) == 1)
03376 {
03377 i = rand () % 4;
03378 switch (i)
03379 {
03380 case (0):
03381 do_random_fire (x - 1, y, 0);
03382 break;
03383 case (1):
03384 do_random_fire (x, y - 1, 0);
03385 break;
03386 case (2):
03387 do_random_fire (x + 1, y, 0);
03388 break;
03389 case (3):
03390 do_random_fire (x, y + 1, 0);
03391 break;
03392 }
03393 }
03394 }
03395 /* check here 'cos we can wait in the ok box for ever. */
03396 else if (MP_INFO(x,y).int_3 == 0)
03397 MP_INFO(x,y).int_3 = real_time + 15000; /* 15 secs seem fair */
03398 else if (real_time >= MP_INFO(x,y).int_3)
03399 MP_INFO(x,y).int_3 = -1;
03400 }
|
|
||||||||||||
|
Definition at line 3154 of file engine.c. 03155 {
03156 int xx, x1, x2, y1, y2;
03157 if (MP_INFO(x,y).int_1 < (FIRESTATION_JOBS * DAYS_BETWEEN_COVER) ||
03158 MP_INFO(x,y).int_2 < (FIRESTATION_GOODS * DAYS_BETWEEN_COVER))
03159 return;
03160 MP_INFO(x,y).int_1 -= (FIRESTATION_JOBS * DAYS_BETWEEN_COVER);
03161 MP_INFO(x,y).int_2 -= (FIRESTATION_GOODS * DAYS_BETWEEN_COVER);
03162 MP_INFO(x,y).int_3 = 1; /* turn on animation */
03163
03164 x1 = x - FIRESTATION_RANGE;
03165 if (x1 < 0)
03166 x1 = 0;
03167 x2 = x + FIRESTATION_RANGE;
03168 if (x2 > WORLD_SIDE_LEN)
03169 x2 = WORLD_SIDE_LEN;
03170 y1 = y - FIRESTATION_RANGE;
03171 if (y1 < 0)
03172 y1 = 0;
03173 y2 = y + FIRESTATION_RANGE;
03174 if (y2 > WORLD_SIDE_LEN)
03175 y2 = WORLD_SIDE_LEN;
03176 for (; y1 < y2; y1++)
03177 for (xx = x1; xx < x2; xx++)
03178 MP_INFO(xx,y1).flags |= FLAG_FIRE_COVER;
03179 }
|
|
|
Definition at line 3135 of file engine.c. 03136 {
03137 int x, y;
03138 for (y = 0; y < WORLD_SIDE_LEN; y++)
03139 for (x = 0; x < WORLD_SIDE_LEN; x++)
03140 {
03141 /* The next few lines need changing to test for */
03142 /* the group if these areas are animated. */
03143
03144 if (MP_GROUP(x,y) == GROUP_FIRESTATION)
03145 do_fire_cover (x, y);
03146 else if (MP_TYPE(x,y) == CST_HEALTH)
03147 do_health_cover (x, y);
03148 else if (MP_GROUP(x,y) == GROUP_CRICKET)
03149 do_cricket_cover (x, y);
03150 }
03151 }
|
|
||||||||||||
|
Definition at line 2996 of file engine.c. 02997 {
02998 /*
02999 // int_1 is the jobs stored at the fire station
03000 // int_2 is the goods stored at the fire station
03001 // int_3 is the animation flag
03002 // int_4 is the time of the next frame
03003 // int_5 is the pause counter
03004 */
03005 if (MP_INFO(x,y).int_1
03006 < (MAX_JOBS_AT_FIRESTATION - FIRESTATION_GET_JOBS))
03007 if (get_jobs (x, y, FIRESTATION_GET_JOBS) != 0)
03008 MP_INFO(x,y).int_1 += FIRESTATION_GET_JOBS;
03009 if (MP_INFO(x,y).int_2
03010 < (MAX_GOODS_AT_FIRESTATION - FIRESTATION_GET_GOODS))
03011 if (get_goods (x, y, FIRESTATION_GET_GOODS) != 0)
03012 MP_INFO(x,y).int_2 += FIRESTATION_GET_GOODS;
03013 /* animate */
03014 if (MP_INFO(x,y).int_3 && real_time > MP_INFO(x,y).int_4)
03015 {
03016 MP_INFO(x,y).int_4 = real_time + FIRESTATION_ANIMATION_SPEED;
03017 if (MP_INFO(x,y).int_5 > 0)
03018 MP_INFO(x,y).int_5--;
03019 else
03020 {
03021 switch (MP_TYPE(x,y))
03022 {
03023 case (CST_FIRESTATION_1):
03024 MP_TYPE(x,y) = CST_FIRESTATION_2;
03025 break;
03026 case (CST_FIRESTATION_2):
03027 MP_TYPE(x,y) = CST_FIRESTATION_3;
03028 break;
03029 case (CST_FIRESTATION_3):
03030 MP_TYPE(x,y) = CST_FIRESTATION_4;
03031 break;
03032 case (CST_FIRESTATION_4):
03033 MP_TYPE(x,y) = CST_FIRESTATION_5;
03034 break;
03035 case (CST_FIRESTATION_5):
03036 MP_TYPE(x,y) = CST_FIRESTATION_6;
03037 break;
03038 case (CST_FIRESTATION_6):
03039 MP_TYPE(x,y) = CST_FIRESTATION_7;
03040 MP_INFO(x,y).int_5 = 10; /* pause */
03041
03042 break;
03043 case (CST_FIRESTATION_7):
03044 MP_TYPE(x,y) = CST_FIRESTATION_8;
03045 break;
03046 case (CST_FIRESTATION_8):
03047 MP_TYPE(x,y) = CST_FIRESTATION_9;
03048 break;
03049 case (CST_FIRESTATION_9):
03050 MP_TYPE(x,y) = CST_FIRESTATION_10;
03051 break;
03052 case (CST_FIRESTATION_10):
03053 MP_TYPE(x,y) = CST_FIRESTATION_1;
03054 MP_INFO(x,y).int_3 = 0; /* stop */
03055
03056 break;
03057
03058
03059 }
03060 }
03061 }
03062 /* That's all. Cover is done by different functions every 3 months or so. */
03063
03064 fire_cost += FIRESTATION_RUNNING_COST;
03065 }
|
|
||||||||||||
|
Definition at line 2423 of file engine.c. 02424 {
02425 /*
02426 // int_1 is the jobs stored at the health centre
02427 // int_2 is the goods stored at the health centre
02428 */
02429 if (MP_INFO(x,y).int_1
02430 < (MAX_JOBS_AT_HEALTH_CENTRE - HEALTH_CENTRE_GET_JOBS))
02431 if (get_jobs (x, y, HEALTH_CENTRE_GET_JOBS) != 0)
02432 MP_INFO(x,y).int_1 += HEALTH_CENTRE_GET_JOBS;
02433 if (MP_INFO(x,y).int_2
02434 < (MAX_GOODS_AT_HEALTH_CENTRE - HEALTH_CENTRE_GET_GOODS))
02435 if (get_goods (x, y, HEALTH_CENTRE_GET_GOODS) != 0)
02436 MP_INFO(x,y).int_2 += HEALTH_CENTRE_GET_GOODS;
02437
02438 /* That's all. Cover is done by different functions every 3 months or so. */
02439
02440 health_cost += HEALTH_RUNNING_COST;
02441 }
|
|
||||||||||||
|
Definition at line 3182 of file engine.c. 03183 {
03184 int xx, x1, x2, y1, y2;
03185 if (MP_INFO(x,y).int_1 < (HEALTH_CENTRE_JOBS * DAYS_BETWEEN_COVER) ||
03186 MP_INFO(x,y).int_2 < (HEALTH_CENTRE_GOODS * DAYS_BETWEEN_COVER))
03187 return;
03188 MP_INFO(x,y).int_1 -= (HEALTH_CENTRE_JOBS * DAYS_BETWEEN_COVER);
03189 MP_INFO(x,y).int_2 -= (HEALTH_CENTRE_GOODS * DAYS_BETWEEN_COVER);
03190 x1 = x - HEALTH_CENTRE_RANGE;
03191 if (x1 < 0)
03192 x1 = 0;
03193 x2 = x + HEALTH_CENTRE_RANGE;
03194 if (x2 > WORLD_SIDE_LEN)
03195 x2 = WORLD_SIDE_LEN;
03196 y1 = y - HEALTH_CENTRE_RANGE;
03197 if (y1 < 0)
03198 y1 = 0;
03199 y2 = y + HEALTH_CENTRE_RANGE;
03200 if (y2 > WORLD_SIDE_LEN)
03201 y2 = WORLD_SIDE_LEN;
03202 for (; y1 < y2; y1++)
03203 for (xx = x1; xx < x2; xx++)
03204 MP_INFO(xx,y1).flags |= FLAG_HEALTH_COVER;
03205 }
|
|
||||||||||||
|
Definition at line 870 of file engine.c. 00871 {
00872 int rawm, steel = 0;
00873 /*
00874 // int_1 is the steel produced this month so far
00875 // int_2 is the amount of steel in store
00876 // int_3 is the amount of raw materials in store (ore)
00877 // int_4 is the coal in store
00878 // int_5 is the percent max production last month
00879 // int_6 is the time of the next animation frame.
00880 // int_7 is whether we get power from coal (1) or elsewhere (0)
00881 */
00882
00883 /* See if there's any raw materials (ore) on the road/rail. If so, use some
00884 jobs to get it. First get some ore...
00885 */
00886 if (MP_INFO(x,y).int_3 < MAX_ORE_AT_INDUSTRY_H
00887 && ((MP_INFO(x - 1,y).flags & FLAG_IS_TRANSPORT)
00888 != 0) && MP_INFO(x - 1,y).int_5 > 0)
00889 if (get_jobs (x, y, JOBS_LOAD_ORE) != 0)
00890 {
00891 MP_INFO(x,y).int_3 += (MP_INFO(x - 1,y).int_5 / 2
00892 + ((MP_INFO(x - 1,y).int_5) % 2));
00893 MP_INFO(x - 1,y).int_5 /= 2;
00894 }
00895 if (MP_INFO(x,y).int_3 < MAX_ORE_AT_INDUSTRY_H
00896 && ((MP_INFO(x,y - 1).flags & FLAG_IS_TRANSPORT)
00897 != 0) && MP_INFO(x,y - 1).int_5 > 0)
00898 if (get_jobs (x, y, JOBS_LOAD_ORE) != 0)
00899 {
00900 MP_INFO(x,y).int_3 += (MP_INFO(x,y - 1).int_5 / 2
00901 + ((MP_INFO(x,y - 1).int_5) % 2));
00902 MP_INFO(x,y - 1).int_5 /= 2;
00903 }
00904 /* then get some coal if needed */
00905 if (MP_INFO(x,y).int_4 < MAX_COAL_AT_INDUSTRY_H
00906 && ((MP_INFO(x - 1,y).flags & FLAG_IS_TRANSPORT)
00907 != 0) && MP_INFO(x - 1,y).int_3 > 0)
00908 if (get_jobs (x, y, JOBS_LOAD_COAL) != 0)
00909 {
00910 MP_INFO(x,y).int_4 += (MP_INFO(x - 1,y).int_3 / 2
00911 + ((MP_INFO(x - 1,y).int_3) % 2));
00912 MP_INFO(x - 1,y).int_3 /= 2;
00913 }
00914 if (MP_INFO(x,y).int_4 < MAX_ORE_AT_INDUSTRY_H
00915 && ((MP_INFO(x,y - 1).flags & FLAG_IS_TRANSPORT)
00916 != 0) && MP_INFO(x,y - 1).int_3 > 0)
00917 if (get_jobs (x, y, JOBS_LOAD_COAL) != 0)
00918 {
00919 MP_INFO(x,y).int_4 += (MP_INFO(x,y - 1).int_3 / 2
00920 + ((MP_INFO(x,y - 1).int_3) % 2));
00921 MP_INFO(x,y - 1).int_3 /= 2;
00922 }
00923
00924 rawm = MP_INFO(x,y).int_3;
00925 if (rawm > MAX_MADE_AT_INDUSTRY_H)
00926 rawm = MAX_MADE_AT_INDUSTRY_H;
00927 /* turn it into steel */
00928 if (rawm > 0 && MP_INFO(x,y).int_2 < (MAX_STEEL_ON_RAIL * 10))
00929 {
00930 if (get_jobs (x, y, ((rawm / 2) / JOBS_MAKE_STEEL) + 1) != 0)
00931 {
00932 steel = (rawm) / ORE_MAKE_STEEL;
00933 MP_POL(x,y) += INDUSTRY_H_POLLUTION / 2;
00934 }
00935 else if (get_jobs (x, y, ((rawm / 4) / JOBS_MAKE_STEEL) + 1) != 0)
00936 {
00937 steel = (rawm / 2) / ORE_MAKE_STEEL;
00938 MP_POL(x,y) += INDUSTRY_H_POLLUTION / 4;
00939 }
00940 else if (get_jobs (x, y, ((rawm / 10) / JOBS_MAKE_STEEL) + 1) != 0)
00941 {
00942 steel = (rawm / 5) / ORE_MAKE_STEEL;
00943 MP_POL(x,y) += INDUSTRY_H_POLLUTION / 10;
00944 }
00945 }
00946 /* do this here rather than later 'cos maybe steel/=5 */
00947 MP_INFO(x,y).int_3 -= steel * ORE_MAKE_STEEL;
00948 ore_used += steel * ORE_MAKE_STEEL;
00949 /* check there was enough electricity, or back up to 1/10 of the
00950 production. ie same work and material useage for less production.
00951 If no real power, see if we have enough coal to generate electricity.
00952 */
00953 if (get_power (x, y, steel * POWER_MAKE_STEEL, 1) == 0)
00954 {
00955 if (MP_INFO(x,y).int_4 < (steel * 2))
00956 {
00957 MP_INFO(x,y).flags &= (0xffffffff - FLAG_POWERED);
00958 steel /= 5;
00959 }
00960 else
00961 {
00962 MP_INFO(x,y).int_4 -= (steel * 2);
00963 coal_used += (steel * 2);
00964 MP_INFO(x,y).flags |= FLAG_POWERED;
00965 MP_INFO(x,y).int_7 = 1;
00966 }
00967 }
00968 else
00969 {
00970 MP_INFO(x,y).flags |= FLAG_POWERED;
00971 MP_INFO(x,y).int_7 = 0;
00972 }
00973 MP_INFO(x,y).int_1 += steel;
00974 MP_INFO(x,y).int_2 += steel;
00975 /* now sell the steel to the road/rail */
00976 if (MP_GROUP(x,y-1) == GROUP_ROAD
00977 && (MAX_STEEL_ON_ROAD - MP_INFO(x,y - 1).int_6)
00978 <= MP_INFO(x,y).int_2)
00979 {
00980 MP_INFO(x,y).int_2 -= (MAX_STEEL_ON_ROAD
00981 - MP_INFO(x,y - 1).int_6);
00982 MP_INFO(x,y - 1).int_6 = MAX_STEEL_ON_ROAD;
00983 }
00984 else if (MP_GROUP(x,y - 1) == GROUP_RAIL
00985 && (MAX_STEEL_ON_RAIL - MP_INFO(x,y - 1).int_6)
00986 <= MP_INFO(x,y).int_2)
00987 {
00988 MP_INFO(x,y).int_2 -= (MAX_STEEL_ON_RAIL
00989 - MP_INFO(x,y - 1).int_6);
00990 MP_INFO(x,y - 1).int_6 = MAX_STEEL_ON_RAIL;
00991 }
00992 else if (MP_GROUP(x,y-1) == GROUP_TRACK
00993 && (MAX_STEEL_ON_TRACK - MP_INFO(x,y - 1).int_6)
00994 <= MP_INFO(x,y).int_2)
00995 {
00996 MP_INFO(x,y).int_2 -= (MAX_STEEL_ON_TRACK
00997 - MP_INFO(x,y - 1).int_6);
00998 MP_INFO(x,y - 1).int_6 = MAX_STEEL_ON_TRACK;
00999 }
01000
01001 if (MP_GROUP(x-1,y) == GROUP_ROAD
01002 && (MAX_STEEL_ON_ROAD - MP_INFO(x - 1,y).int_6)
01003 <= MP_INFO(x,y).int_2)
01004 {
01005 MP_INFO(x,y).int_2 -= (MAX_STEEL_ON_ROAD
01006 - MP_INFO(x - 1,y).int_6);
01007 MP_INFO(x - 1,y).int_6 = MAX_STEEL_ON_ROAD;
01008 }
01009 else if (MP_GROUP(x-1,y) == GROUP_RAIL
01010 && (MAX_STEEL_ON_RAIL - MP_INFO(x - 1,y).int_6)
01011 <= MP_INFO(x,y).int_2)
01012 {
01013 MP_INFO(x,y).int_2 -= (MAX_STEEL_ON_RAIL
01014 - MP_INFO(x - 1,y).int_6);
01015 MP_INFO(x - 1,y).int_6 = MAX_STEEL_ON_RAIL;
01016 }
01017 else if (MP_GROUP(x - 1,y) == GROUP_TRACK
01018 && (MAX_STEEL_ON_TRACK - MP_INFO(x - 1,y).int_6)
01019 <= MP_INFO(x,y).int_2)
01020 {
01021 MP_INFO(x,y).int_2 -= (MAX_STEEL_ON_TRACK
01022 - MP_INFO(x - 1,y).int_6);
01023 MP_INFO(x - 1,y).int_6 = MAX_STEEL_ON_TRACK;
01024 }
01025
01026
01027 /* now choose a graphic every month */
01028 if ((total_time % NUMOF_DAYS_IN_MONTH) == NUMOF_DAYS_IN_MONTH - 1)
01029 {
01030 MP_INFO(x,y).int_5 = MP_INFO(x,y).int_1
01031 / (MAX_MADE_AT_INDUSTRY_H / ORE_MAKE_STEEL);
01032 MP_INFO(x,y).int_1 = 0;
01033 if (MP_INFO(x,y).int_5 > 80)
01034 {
01035 switch (MP_TYPE(x,y))
01036 {
01037 case (CST_INDUSTRY_H_H1):
01038 case (CST_INDUSTRY_H_H2):
01039 case (CST_INDUSTRY_H_H3):
01040 case (CST_INDUSTRY_H_H4):
01041 case (CST_INDUSTRY_H_H5):
01042 case (CST_INDUSTRY_H_H6):
01043 case (CST_INDUSTRY_H_H7):
01044 case (CST_INDUSTRY_H_H8):
01045 break;
01046 default:
01047 MP_TYPE(x,y) = CST_INDUSTRY_H_H1;
01048 }
01049 }
01050 else if (MP_INFO(x,y).int_5 > 30)
01051 {
01052 switch (MP_TYPE(x,y))
01053 {
01054 case (CST_INDUSTRY_H_M1):
01055 case (CST_INDUSTRY_H_M2):
01056 case (CST_INDUSTRY_H_M3):
01057 case (CST_INDUSTRY_H_M4):
01058 case (CST_INDUSTRY_H_M5):
01059 case (CST_INDUSTRY_H_M6):
01060 case (CST_INDUSTRY_H_M7):
01061 case (CST_INDUSTRY_H_M8):
01062 break;
01063 default:
01064 MP_TYPE(x,y) = CST_INDUSTRY_H_M1;
01065 }
01066 }
01067 else if (MP_INFO(x,y).int_5 > 0)
01068 {
01069 switch (MP_TYPE(x,y))
01070 {
01071 case (CST_INDUSTRY_H_L1):
01072 case (CST_INDUSTRY_H_L2):
01073 case (CST_INDUSTRY_H_L3):
01074 case (CST_INDUSTRY_H_L4):
01075 case (CST_INDUSTRY_H_L5):
01076 case (CST_INDUSTRY_H_L6):
01077 case (CST_INDUSTRY_H_L7):
01078 case (CST_INDUSTRY_H_L8):
01079 break;
01080 default:
01081 MP_TYPE(x,y) = CST_INDUSTRY_H_L1;
01082 }
01083 }
01084 else
01085 MP_TYPE(x,y) = CST_INDUSTRY_H_C;
01086 }
01087 /* now animate */
01088 if (real_time >= MP_INFO(x,y).int_6)
01089 {
01090 MP_INFO(x,y).int_6 = real_time + INDUSTRY_H_ANIM_SPEED;
01091 switch (MP_TYPE(x,y))
01092 {
01093 case (CST_INDUSTRY_H_L1):
01094 MP_TYPE(x,y) = CST_INDUSTRY_H_L2;
01095 break;
01096 case (CST_INDUSTRY_H_L2):
01097 MP_TYPE(x,y) = CST_INDUSTRY_H_L3;
01098 break;
01099 case (CST_INDUSTRY_H_L3):
01100 MP_TYPE(x,y) = CST_INDUSTRY_H_L4;
01101 break;
01102 case (CST_INDUSTRY_H_L4):
01103 MP_TYPE(x,y) = CST_INDUSTRY_H_L5;
01104 break;
01105 case (CST_INDUSTRY_H_L5):
01106 MP_TYPE(x,y) = CST_INDUSTRY_H_L6;
01107 break;
01108 case (CST_INDUSTRY_H_L6):
01109 MP_TYPE(x,y) = CST_INDUSTRY_H_L7;
01110 break;
01111 case (CST_INDUSTRY_H_L7):
01112 MP_TYPE(x,y) = CST_INDUSTRY_H_L8;
01113 break;
01114 case (CST_INDUSTRY_H_L8):
01115 MP_TYPE(x,y) = CST_INDUSTRY_H_L1;
01116 break;
01117
01118 case (CST_INDUSTRY_H_M1):
01119 MP_TYPE(x,y) = CST_INDUSTRY_H_M2;
01120 break;
01121 case (CST_INDUSTRY_H_M2):
01122 MP_TYPE(x,y) = CST_INDUSTRY_H_M3;
01123 break;
01124 case (CST_INDUSTRY_H_M3):
01125 MP_TYPE(x,y) = CST_INDUSTRY_H_M4;
01126 break;
01127 case (CST_INDUSTRY_H_M4):
01128 MP_TYPE(x,y) = CST_INDUSTRY_H_M5;
01129 break;
01130 case (CST_INDUSTRY_H_M5):
01131 MP_TYPE(x,y) = CST_INDUSTRY_H_M6;
01132 break;
01133 case (CST_INDUSTRY_H_M6):
01134 MP_TYPE(x,y) = CST_INDUSTRY_H_M7;
01135 break;
01136 case (CST_INDUSTRY_H_M7):
01137 MP_TYPE(x,y) = CST_INDUSTRY_H_M8;
01138 break;
01139 case (CST_INDUSTRY_H_M8):
01140 MP_TYPE(x,y) = CST_INDUSTRY_H_M1;
01141 break;
01142
01143 case (CST_INDUSTRY_H_H1):
01144 MP_TYPE(x,y) = CST_INDUSTRY_H_H2;
01145 break;
01146 case (CST_INDUSTRY_H_H2):
01147 MP_TYPE(x,y) = CST_INDUSTRY_H_H3;
01148 break;
01149 case (CST_INDUSTRY_H_H3):
01150 MP_TYPE(x,y) = CST_INDUSTRY_H_H4;
01151 break;
01152 case (CST_INDUSTRY_H_H4):
01153 MP_TYPE(x,y) = CST_INDUSTRY_H_H5;
01154 break;
01155 case (CST_INDUSTRY_H_H5):
01156 MP_TYPE(x,y) = CST_INDUSTRY_H_H6;
01157 break;
01158 case (CST_INDUSTRY_H_H6):
01159 MP_TYPE(x,y) = CST_INDUSTRY_H_H7;
01160 break;
01161 case (CST_INDUSTRY_H_H7):
01162 MP_TYPE(x,y) = CST_INDUSTRY_H_H8;
01163 break;
01164 case (CST_INDUSTRY_H_H8):
01165 MP_TYPE(x,y) = CST_INDUSTRY_H_H1;
01166 break;
01167
01168 }
01169 }
01170 }
|
|
||||||||||||
|
Definition at line 559 of file engine.c. 00560 {
00561 int goods = 0;
00562 /*
00563 // int_1 is the goods produced this month so far
00564 // int_2 is the amount of goods in store.
00565 // int_3 is the amount of ore in store.
00566 // int_4 is the amount of steel in store.
00567 // int_5 is the jobs stored.
00568 // int_6 is the percent of capacity last month.
00569 // int 7 is the next animation frame time.
00570 */
00571 /* first get some jobs */
00572 if (MP_INFO(x,y).int_5 < MAX_JOBS_AT_INDUSTRY_L - INDUSTRY_L_GET_JOBS)
00573 {
00574 if (get_jobs (x, y, INDUSTRY_L_GET_JOBS) != 0)
00575 MP_INFO(x,y).int_5 += INDUSTRY_L_GET_JOBS;
00576 else if (get_jobs (x, y, INDUSTRY_L_GET_JOBS / 10) != 0)
00577 MP_INFO(x,y).int_5 += INDUSTRY_L_GET_JOBS / 10;
00578 }
00579 /* if we don't have enough jobs we can't do anything */
00580 if (MP_INFO(x,y).int_5 < MIN_JOBS_AT_INDUSTRY_L)
00581 return;
00582 /* get some ore */
00583 if (MP_INFO(x,y).int_3 < (MAX_ORE_AT_INDUSTRY_L
00584 - INDUSTRY_L_GET_ORE))
00585 {
00586 if ((MP_INFO(x - 1,y).flags & FLAG_IS_TRANSPORT) != 0
00587 && MP_INFO(x - 1,y).int_5 > 0)
00588 {
00589 if (MP_INFO(x - 1,y).int_5 >= INDUSTRY_L_GET_ORE)
00590 {
00591 MP_INFO(x,y).int_3 += INDUSTRY_L_GET_ORE;
00592 MP_INFO(x - 1,y).int_5 -= INDUSTRY_L_GET_ORE;
00593 }
00594 else
00595 {
00596 MP_INFO(x,y).int_3 += MP_INFO(x - 1,y).int_5;
00597 MP_INFO(x - 1,y).int_5 = 0;
00598 }
00599 MP_INFO(x,y).int_5 -= INDUSTRY_L_JOBS_LOAD_ORE;
00600 }
00601 }
00602 /* do we still need some ore? */
00603 if (MP_INFO(x,y).int_3 < (MAX_ORE_AT_INDUSTRY_L
00604 - INDUSTRY_L_GET_ORE))
00605 {
00606 if ((MP_INFO(x,y - 1).flags & FLAG_IS_TRANSPORT) != 0
00607 && MP_INFO(x,y - 1).int_5 > 0)
00608 {
00609 if (MP_INFO(x,y - 1).int_5 >= INDUSTRY_L_GET_ORE)
00610 {
00611 MP_INFO(x,y).int_3 += INDUSTRY_L_GET_ORE;
00612 MP_INFO(x,y - 1).int_5 -= INDUSTRY_L_GET_ORE;
00613 }
00614 else
00615 {
00616 MP_INFO(x,y).int_3 += MP_INFO(x,y - 1).int_5;
00617 MP_INFO(x,y - 1).int_5 = 0;
00618 }
00619 MP_INFO(x,y).int_5 -= INDUSTRY_L_JOBS_LOAD_ORE;
00620 }
00621 }
00622 /* then get some steel */
00623 if (MP_INFO(x,y).int_4 < (MAX_STEEL_AT_INDUSTRY_L
00624 - INDUSTRY_L_GET_STEEL))
00625 {
00626 if ((MP_INFO(x - 1,y).flags & FLAG_IS_TRANSPORT) != 0
00627 && MP_INFO(x - 1,y).int_6 > 0)
00628 {
00629 if (MP_INFO(x - 1,y).int_6 >= INDUSTRY_L_GET_STEEL)
00630 {
00631 MP_INFO(x,y).int_4 += INDUSTRY_L_GET_STEEL;
00632 MP_INFO(x - 1,y).int_6 -= INDUSTRY_L_GET_STEEL;
00633 }
00634 else
00635 {
00636 MP_INFO(x,y).int_4
00637 += MP_INFO(x - 1,y).int_6;
00638 MP_INFO(x - 1,y).int_6 = 0;
00639 }
00640 MP_INFO(x,y).int_5 -= INDUSTRY_L_JOBS_LOAD_STEEL;
00641 }
00642 }
00643 /* do we still need some steel? */
00644 if (MP_INFO(x,y).int_4 < (MAX_STEEL_AT_INDUSTRY_L
00645 - INDUSTRY_L_GET_STEEL))
00646 {
00647 if ((MP_INFO(x,y - 1).flags & FLAG_IS_TRANSPORT) != 0
00648 && MP_INFO(x,y - 1).int_6 > 0)
00649 {
00650 if (MP_INFO(x,y - 1).int_6 >= INDUSTRY_L_GET_STEEL)
00651 {
00652 MP_INFO(x,y).int_4 += INDUSTRY_L_GET_STEEL;
00653 MP_INFO(x,y - 1).int_6 -= INDUSTRY_L_GET_STEEL;
00654 }
00655 else
00656 {
00657 MP_INFO(x,y).int_4
00658 += MP_INFO(x,y - 1).int_6;
00659 MP_INFO(x,y - 1).int_6 = 0;
00660 }
00661 MP_INFO(x,y).int_5 -= INDUSTRY_L_JOBS_LOAD_STEEL;
00662 }
00663 }
00664 /* now make some goods */
00665 if (MP_INFO(x,y).int_2 < (MAX_GOODS_AT_INDUSTRY_L
00666 - (INDUSTRY_L_MAKE_GOODS * 8)) && MP_INFO(x,y).int_3
00667 >= INDUSTRY_L_ORE_USED)
00668 {
00669 goods += INDUSTRY_L_MAKE_GOODS;
00670 MP_INFO(x,y).int_3 -= INDUSTRY_L_ORE_USED;
00671 ore_used += INDUSTRY_L_ORE_USED;
00672 MP_INFO(x,y).int_5 -= INDUSTRY_L_JOBS_USED;
00673 MP_POL(x,y) += INDUSTRY_L_POLLUTION;
00674
00675 /* multiply by 2 if we have steel. */
00676 if (MP_INFO(x,y).int_4 >= INDUSTRY_L_STEEL_USED)
00677 {
00678 MP_INFO(x,y).int_4 -= INDUSTRY_L_STEEL_USED;
00679 goods += goods;
00680 }
00681 /* multipy by 4 if we can get power. */
00682
00683 if (MP_INFO(x,y).int_3 >= INDUSTRY_L_ORE_USED
00684 && get_power (x, y, goods * 10, 1) != 0)
00685 {
00686 goods *= 4;
00687 MP_INFO(x,y).flags |= FLAG_POWERED;
00688 /* and use more ore */
00689 MP_INFO(x,y).int_3 -= INDUSTRY_L_ORE_USED;
00690 ore_used += INDUSTRY_L_ORE_USED;
00691 }
00692 else
00693 MP_INFO(x,y).flags &= (0xffffffff - FLAG_POWERED);
00694 }
00695
00696 MP_INFO(x,y).int_1 += goods;
00697 MP_INFO(x,y).int_2 += goods;
00698 goods_made += goods;
00699
00700 /* now sell the goods to the road/rail/track */
00701 if (MP_GROUP(x,y - 1) == GROUP_ROAD
00702 && (MAX_GOODS_ON_ROAD - MP_INFO(x,y - 1).int_4) <= MP_INFO(x,y).int_2)
00703 {
00704 MP_INFO(x,y).int_2 -= (MAX_GOODS_ON_ROAD - MP_INFO(x,y - 1).int_4);
00705 MP_INFO(x,y - 1).int_4 = MAX_GOODS_ON_ROAD;
00706 }
00707 else if (MP_GROUP(x,y - 1) == GROUP_RAIL
00708 && (MAX_GOODS_ON_RAIL - MP_INFO(x,y - 1).int_4)
00709 <= MP_INFO(x,y).int_2)
00710 {
00711 MP_INFO(x,y).int_2 -= (MAX_GOODS_ON_RAIL
00712 - MP_INFO(x,y - 1).int_4);
00713 MP_INFO(x,y - 1).int_4 = MAX_GOODS_ON_RAIL;
00714 }
00715 else if (MP_GROUP(x,y - 1) == GROUP_TRACK
00716 && (MAX_GOODS_ON_TRACK - MP_INFO(x,y - 1).int_4)
00717 <= MP_INFO(x,y).int_2)
00718 {
00719 MP_INFO(x,y).int_2 -= (MAX_GOODS_ON_TRACK
00720 - MP_INFO(x,y - 1).int_4);
00721 MP_INFO(x,y - 1).int_4 = MAX_GOODS_ON_TRACK;
00722 }
00723
00724
00725 if (MP_GROUP(x - 1,y) == GROUP_ROAD
00726 && (MAX_GOODS_ON_ROAD - MP_INFO(x - 1,y).int_4)
00727 <= MP_INFO(x,y).int_2)
00728 {
00729 MP_INFO(x,y).int_2 -= (MAX_GOODS_ON_ROAD
00730 - MP_INFO(x - 1,y).int_4);
00731 MP_INFO(x - 1,y).int_4 = MAX_GOODS_ON_ROAD;
00732 }
00733 else if (MP_GROUP(x - 1,y) == GROUP_RAIL
00734 && (MAX_GOODS_ON_RAIL - MP_INFO(x - 1,y).int_4)
00735 <= MP_INFO(x,y).int_2)
00736 {
00737 MP_INFO(x,y).int_2 -= (MAX_GOODS_ON_RAIL
00738 - MP_INFO(x - 1,y).int_4);
00739 MP_INFO(x - 1,y).int_4 = MAX_GOODS_ON_RAIL;
00740 }
00741 else if (MP_GROUP(x-1,y) == GROUP_TRACK
00742 && (MAX_GOODS_ON_TRACK - MP_INFO(x - 1,y).int_4)
00743 <= MP_INFO(x,y).int_2)
00744 {
00745 MP_INFO(x,y).int_2 -= (MAX_GOODS_ON_TRACK
00746 - MP_INFO(x - 1,y).int_4);
00747 MP_INFO(x - 1,y).int_4 = MAX_GOODS_ON_TRACK;
00748 }
00749
00750 /* now choose a graphic every month */
00751 if ((total_time % NUMOF_DAYS_IN_MONTH) == NUMOF_DAYS_IN_MONTH - 1)
00752 {
00753 MP_INFO(x,y).int_6 = (MP_INFO(x,y).int_1)
00754 / (INDUSTRY_L_MAKE_GOODS * 8);
00755 MP_INFO(x,y).int_1 = 0;
00756 if (MP_INFO(x,y).int_6 > 80)
00757 {
00758 switch (MP_TYPE(x,y))
00759 {
00760 case (CST_INDUSTRY_L_H1):
00761 case (CST_INDUSTRY_L_H2):
00762 case (CST_INDUSTRY_L_H3):
00763 case (CST_INDUSTRY_L_H4):
00764 break;
00765 default:
00766 MP_TYPE(x,y) = CST_INDUSTRY_L_H1;
00767 }
00768 }
00769 else if (MP_INFO(x,y).int_6 > 55)
00770 {
00771 switch (MP_TYPE(x,y))
00772 {
00773 case (CST_INDUSTRY_L_M1):
00774 case (CST_INDUSTRY_L_M2):
00775 case (CST_INDUSTRY_L_M3):
00776 case (CST_INDUSTRY_L_M4):
00777 break;
00778 default:
00779 MP_TYPE(x,y) = CST_INDUSTRY_L_M1;
00780 }
00781 }
00782 else if (MP_INFO(x,y).int_6 > 25)
00783 {
00784 switch (MP_TYPE(x,y))
00785 {
00786 case (CST_INDUSTRY_L_L1):
00787 case (CST_INDUSTRY_L_L2):
00788 case (CST_INDUSTRY_L_L3):
00789 case (CST_INDUSTRY_L_L4):
00790 break;
00791 default:
00792 MP_TYPE(x,y) = CST_INDUSTRY_L_L1;
00793 }
00794 }
00795 else if (MP_INFO(x,y).int_6 > 0)
00796 {
00797 switch (MP_TYPE(x,y))
00798 {
00799 case (CST_INDUSTRY_L_Q1):
00800 case (CST_INDUSTRY_L_Q2):
00801 case (CST_INDUSTRY_L_Q3):
00802 case (CST_INDUSTRY_L_Q4):
00803 break;
00804 default:
00805 MP_TYPE(x,y) = CST_INDUSTRY_L_Q1;
00806 }
00807 }
00808 else
00809 MP_TYPE(x,y) = CST_INDUSTRY_L_C;
00810 }
00811 /* now animate */
00812 if (real_time >= MP_INFO(x,y).int_7)
00813 {
00814 MP_INFO(x,y).int_7 = real_time + INDUSTRY_L_ANIM_SPEED;
00815 switch (MP_TYPE(x,y))
00816 {
00817 case (CST_INDUSTRY_L_Q1):
00818 MP_TYPE(x,y) = CST_INDUSTRY_L_Q2;
00819 break;
00820 case (CST_INDUSTRY_L_Q2):
00821 MP_TYPE(x,y) = CST_INDUSTRY_L_Q3;
00822 break;
00823 case (CST_INDUSTRY_L_Q3):
00824 MP_TYPE(x,y) = CST_INDUSTRY_L_Q4;
00825 break;
00826 case (CST_INDUSTRY_L_Q4):
00827 MP_TYPE(x,y) = CST_INDUSTRY_L_Q1;
00828 break;
00829 case (CST_INDUSTRY_L_L1):
00830 MP_TYPE(x,y) = CST_INDUSTRY_L_L2;
00831 break;
00832 case (CST_INDUSTRY_L_L2):
00833 MP_TYPE(x,y) = CST_INDUSTRY_L_L3;
00834 break;
00835 case (CST_INDUSTRY_L_L3):
00836 MP_TYPE(x,y) = CST_INDUSTRY_L_L4;
00837 break;
00838 case (CST_INDUSTRY_L_L4):
00839 MP_TYPE(x,y) = CST_INDUSTRY_L_L1;
00840 break;
00841 case (CST_INDUSTRY_L_M1):
00842 MP_TYPE(x,y) = CST_INDUSTRY_L_M2;
00843 break;
00844 case (CST_INDUSTRY_L_M2):
00845 MP_TYPE(x,y) = CST_INDUSTRY_L_M3;
00846 break;
00847 case (CST_INDUSTRY_L_M3):
00848 MP_TYPE(x,y) = CST_INDUSTRY_L_M4;
00849 break;
00850 case (CST_INDUSTRY_L_M4):
00851 MP_TYPE(x,y) = CST_INDUSTRY_L_M1;
00852 break;
00853 case (CST_INDUSTRY_L_H1):
00854 MP_TYPE(x,y) = CST_INDUSTRY_L_H2;
00855 break;
00856 case (CST_INDUSTRY_L_H2):
00857 MP_TYPE(x,y) = CST_INDUSTRY_L_H3;
00858 break;
00859 case (CST_INDUSTRY_L_H3):
00860 MP_TYPE(x,y) = CST_INDUSTRY_L_H4;
00861 break;
00862 case (CST_INDUSTRY_L_H4):
00863 MP_TYPE(x,y) = CST_INDUSTRY_L_H1;
00864 break;
00865 }
00866 }
00867 }
|
|
|
Definition at line 366 of file ldsvgui.c. 00367 {
00368 Rect* mw = &scr.main_win;
00369 char c;
00370 hide_mouse ();
00371 Fgl_fillbox (mw->x, mw->y, mw->w, mw->h
00372 ,LOAD_BG_COLOUR);
00373 Fgl_setfontcolors (LOAD_BG_COLOUR, TEXT_FG_COLOUR);
00374 Fgl_write (mw->x + 140, mw->y + 15, _("Load a file"));
00375 Fgl_write (mw->x + 40, mw->y + 35
00376 ,_("Choose the number of the scene you want"));
00377 Fgl_write (mw->x + 40, mw->y + 50
00378 ,_("Entries coloured red are either not there,"));
00379 Fgl_write (mw->x + 44, mw->y + 60
00380 ,_("or they are from an earlier version, they"));
00381 Fgl_write (mw->x + 110, mw->y + 70
00382 ,_("might not load properly."));
00383 Fgl_write (mw->x + 110, mw->y + 210
00384 ,_("Press space to cancel."));
00385 draw_save_dir (LOAD_BG_COLOUR);
00386 db_flag = 1;
00387
00388 do {
00389 #ifdef LC_X11
00390 redraw_mouse ();
00391 cs_mouse_handler (0, -1, 0);
00392 cs_mouse_handler (0, 1, 0);
00393 do {
00394 call_event ();
00395 c = x_key_value;
00396 } while (c == 0);
00397 x_key_value = 0;
00398 #elif defined (WIN32)
00399 while (0 == (c = GetKeystroke ())); /* Wait for keystroke */
00400 redraw_mouse ();
00401 #else
00402 c = getchar ();
00403 redraw_mouse ();
00404 #endif
00405 if (c > '0' && c <= '9') {
00406 if (strlen (save_names[c - '0']) < 1) {
00407 redraw_mouse ();
00408 if (yn_dial_box (_("No scene."),
00409 _("There is no save scene with this number."),
00410 _("Do you want to"),
00411 _("try again?")) != 0)
00412 c = 0;
00413 else
00414 c = ' ';
00415 hide_mouse ();
00416 }
00417 }
00418 } while (c==0);
00419
00420 redraw_mouse ();
00421 if (c > '0' && c <= '9') {
00422 if (yn_dial_box (_("Loading Scene")
00423 ,_("Do you want to load the scene")
00424 ,save_names[c - '0']
00425 ,_("and forget the current game?")) != 0)
00426 {
00427 Fgl_write (mw->x + 70, mw->y + 310
00428 ,_("Loading scene... please wait"));
00429 load_saved_city (save_names[c - '0']);
00430 refresh_pbars();
00431 }
00432 }
00433 db_flag = 0;
00434 cs_mouse_handler (0, -1, 0);
00435 cs_mouse_handler (0, 1, 0);
00436 hide_mouse ();
00437 Fgl_setfontcolors (TEXT_BG_COLOUR, TEXT_FG_COLOUR);
00438 load_flag = 0;
00439 refresh_main_screen ();
00440 suppress_ok_buttons = 1;
00441 update_avail_modules (0);
00442 suppress_ok_buttons = 0;
00443 redraw_mouse ();
00444 }
|
|
||||||||||||
|
Definition at line 390 of file market.c. 00391 {
00392 /*
00393 // int_1 contains the food it holds
00394 // int_2 contains the jobs
00395 // int_3 contains the coal
00396 // int_4 contains the goods
00397 // int_5 contains the ore
00398 // int_6 contains the steel
00399 // int_7 contains the waste
00400 */
00401
00402 int extra_jobs = 0;
00403
00404 shuffle_markets ();
00405
00406 if (x > 0 && (MP_INFO(x - 1,y).flags & FLAG_IS_TRANSPORT) != 0)
00407 extra_jobs += deal_with_transport (x, y, x - 1, y);
00408 if (x > 0 && (MP_INFO(x - 1,y + 1).flags & FLAG_IS_TRANSPORT) != 0)
00409 extra_jobs += deal_with_transport (x, y, x - 1, y + 1);
00410 if (y > 0 && (MP_INFO(x,y - 1).flags & FLAG_IS_TRANSPORT) != 0)
00411 extra_jobs += deal_with_transport (x, y, x, y - 1);
00412 if (y > 0 && (MP_INFO(x + 1,y - 1).flags & FLAG_IS_TRANSPORT) != 0)
00413 extra_jobs += deal_with_transport (x, y, x + 1, y - 1);
00414 if (x < WORLD_SIDE_LEN - 2
00415 && (MP_INFO(x + 2,y).flags & FLAG_IS_TRANSPORT) != 0)
00416 extra_jobs += deal_with_transport (x, y, x + 2, y);
00417 if (x < WORLD_SIDE_LEN - 2
00418 && (MP_INFO(x + 2,y + 1).flags & FLAG_IS_TRANSPORT) != 0)
00419 extra_jobs += deal_with_transport (x, y, x + 2, y + 1);
00420 if (y < WORLD_SIDE_LEN - 2
00421 && (MP_INFO(x,y + 2).flags & FLAG_IS_TRANSPORT) != 0)
00422 extra_jobs += deal_with_transport (x, y, x, y + 2);
00423 if (y < WORLD_SIDE_LEN - 2
00424 && (MP_INFO(x + 1,y + 2).flags & FLAG_IS_TRANSPORT) != 0)
00425 extra_jobs += deal_with_transport (x, y, x + 1, y + 2);
00426
00427 if (MP_INFO(x,y).int_1 > MAX_FOOD_IN_MARKET)
00428 MP_INFO(x,y).int_1 = MAX_FOOD_IN_MARKET;
00429 if (MP_INFO(x,y).int_2 > MAX_JOBS_IN_MARKET)
00430 MP_INFO(x,y).int_2 = MAX_JOBS_IN_MARKET;
00431 if (MP_INFO(x,y).int_4 > MAX_GOODS_IN_MARKET)
00432 MP_INFO(x,y).int_4 = MAX_GOODS_IN_MARKET;
00433
00434 /* now choose a graphic only dependent on food (for now anyway) */
00435 if (total_time % 25 == 17)
00436 {
00437 if (MP_INFO(x,y).int_1 <= 0)
00438 {
00439 if (MP_INFO(x,y).int_2 > 0)
00440 MP_TYPE(x,y) = CST_MARKET_LOW;
00441 else
00442 MP_TYPE(x,y) = CST_MARKET_EMPTY;
00443 }
00444 else if (MP_INFO(x,y).int_1 < (MARKET_FOOD_SEARCH_TRIGGER / 2))
00445 MP_TYPE(x,y) = CST_MARKET_LOW;
00446 else if (MP_INFO(x,y).int_1
00447 < (MAX_FOOD_IN_MARKET - MAX_FOOD_IN_MARKET / 4))
00448 MP_TYPE(x,y) = CST_MARKET_MED;
00449 else
00450 MP_TYPE(x,y) = CST_MARKET_FULL;
00451 }
00452
00453 /* now employ some people */
00454 get_jobs (x, y, 1 + (extra_jobs / 5));
00455
00456 /* keep the pbars accurate */
00457 inventory(x,y);
00458 }
|
|
||||||||||||
|
Definition at line 2807 of file engine.c. 02808 {
02809 /*
02810 // int_1 contains the goods at the mill
02811 // int_2 contains the food store
02812 // int_3 contains the coal store
02813 // int_4 contains the animation trigger time
02814 // int_5 is the % count so far this month
02815 // int_6 is the % capacity last month
02816 */
02817 /* get food */
02818 int block_anim = 0;
02819 if (MP_INFO(x,y).int_2 < MAX_FOOD_AT_MILL)
02820 if (get_food (x, y, MILL_GET_FOOD) != 0)
02821 MP_INFO(x,y).int_2 += MILL_GET_FOOD;
02822 /* get coal */
02823 if (MP_INFO(x,y).int_3 < MAX_COAL_AT_MILL)
02824 {
02825 if (get_coal (x, y, MILL_GET_COAL) != 0)
02826 MP_INFO(x,y).int_3 += MILL_GET_COAL;
02827 else if (get_power (x, y, MILL_GET_COAL
02828 * MILL_POWER_PER_COAL, 0) != 0)
02829 MP_INFO(x,y).int_3 += MILL_GET_COAL;
02830 }
02831 if (MP_INFO(x,y).int_1 < MAX_GOODS_AT_MILL)
02832 {
02833 if (MP_INFO(x,y).int_2 > FOOD_USED_BY_MILL
02834 && MP_INFO(x,y).int_3 > COAL_USED_BY_MILL)
02835 {
02836 if (get_jobs (x, y, MILL_JOBS) != 0)
02837 {
02838 MP_INFO(x,y).int_2 -= FOOD_USED_BY_MILL;
02839 MP_INFO(x,y).int_3 -= COAL_USED_BY_MILL;
02840 MP_INFO(x,y).int_1 += GOODS_MADE_BY_MILL;
02841 MP_INFO(x,y).int_5++;
02842 }
02843 else
02844 {
02845 MP_TYPE(x,y) = CST_MILL_0;
02846 block_anim = 1;
02847 }
02848 }
02849 else
02850 block_anim = 1;
02851 }
02852
02853 if (MP_INFO(x,y).int_1 > 0)
02854 if (put_goods (x, y, MP_INFO(x,y).int_1) != 0)
02855 MP_INFO(x,y).int_1 = 0;
02856
02857 if (total_time % 100 == 0)
02858 {
02859 MP_INFO(x,y).int_6 = MP_INFO(x,y).int_5;
02860 MP_INFO(x,y).int_5 = 0;
02861 }
02862 if (real_time >= MP_INFO(x,y).int_4 && block_anim == 0)
02863 {
02864 MP_INFO(x,y).int_4 = real_time + MILL_ANIM_SPEED;
02865 switch (MP_TYPE(x,y))
02866 {
02867 case (CST_MILL_0):
02868 MP_TYPE(x,y) = CST_MILL_1;
02869 break;
02870 case (CST_MILL_1):
02871 MP_TYPE(x,y) = CST_MILL_2;
02872 break;
02873 case (CST_MILL_2):
02874 MP_TYPE(x,y) = CST_MILL_3;
02875 break;
02876 case (CST_MILL_3):
02877 MP_TYPE(x,y) = CST_MILL_4;
02878 break;
02879 case (CST_MILL_4):
02880 MP_TYPE(x,y) = CST_MILL_5;
02881 break;
02882 case (CST_MILL_5):
02883 MP_TYPE(x,y) = CST_MILL_6;
02884 break;
02885 case (CST_MILL_6):
02886 MP_TYPE(x,y) = CST_MILL_1;
02887 MP_POL(x,y)++;
02888 break;
02889 }
02890 }
02891 }
|
|
||||||||||||
|
Definition at line 2654 of file engine.c. 02655 {
02656 /*
02657 // int_1 holds the jobs used
02658 // int_2 holds the tech points made
02659 // int_3 holds the tail off count
02660 */
02661 if (MP_INFO(x,y).int_1 < BUILD_MONUMENT_JOBS)
02662 if (get_jobs (x, y, MONUMENT_GET_JOBS) != 0)
02663 MP_INFO(x,y).int_1 += MONUMENT_GET_JOBS;
02664
02665 /* now choose a graphic */
02666 if (MP_INFO(x,y).int_1 >= BUILD_MONUMENT_JOBS)
02667 {
02668 MP_TYPE(x,y) = CST_MONUMENT_5;
02669 /* inc tech level only if fully built and tech less
02670 than MONUMENT_TECH_EXPIRE */
02671 if (tech_level < (MONUMENT_TECH_EXPIRE * 1000)
02672 && (total_time % MONUMENT_DAYS_PER_TECH) == 1)
02673 {
02674 if (MP_INFO(x,y).int_3++ > (tech_level / 10000) - 2)
02675 {
02676 tech_level++;
02677 MP_INFO(x,y).int_2++;
02678 MP_INFO(x,y).int_3 = 0;
02679 }
02680 }
02681 }
02682 else if (MP_INFO(x,y).int_1 >= ((BUILD_MONUMENT_JOBS * 4) / 5))
02683 MP_TYPE(x,y) = CST_MONUMENT_4;
02684 else if (MP_INFO(x,y).int_1 >= ((BUILD_MONUMENT_JOBS * 3) / 5))
02685 MP_TYPE(x,y) = CST_MONUMENT_3;
02686 else if (MP_INFO(x,y).int_1 >= ((BUILD_MONUMENT_JOBS * 2) / 5))
02687 MP_TYPE(x,y) = CST_MONUMENT_2;
02688 else if (MP_INFO(x,y).int_1 >= (BUILD_MONUMENT_JOBS / 20))
02689 MP_TYPE(x,y) = CST_MONUMENT_1;
02690 else
02691 MP_TYPE(x,y) = CST_MONUMENT_0;
02692 }
|
|
||||||||||||
|
Definition at line 1510 of file engine.c. 01511 {
01512 /*
01513 // int_1 is the ore at in stock
01514 // int_2 is the ore reserve under the ground or at the surface really.
01515 */
01516 int xx, yy, xs, ys, xe, ye, cr;
01517 if (MP_INFO(x,y).int_1 < DIG_MORE_ORE_TRIGGER - 5000)
01518 {
01519 xs = x;
01520 ys = y;
01521 xe = x + 4;
01522 ye = y + 4;
01523 cr = 0;
01524 for (yy = ys; yy < ye; yy++)
01525 for (xx = xs; xx < xe; xx++)
01526 cr += MP_INFO(xx,yy).ore_reserve;
01527 MP_INFO(x,y).int_2 = cr;
01528 if (cr > 0)
01529 if (get_jobs (x, y, JOBS_DIG_ORE) != 0)
01530 for (yy = ys; yy < ye; yy++)
01531 for (xx = xs; xx < xe; xx++)
01532 if (MP_INFO(xx,yy).ore_reserve > 0)
01533 {
01534 MP_INFO(xx,yy).ore_reserve--;
01535 MP_INFO(x,y).int_1 += 5000;
01536 ore_made += 5000;
01537 sust_dig_ore_coal_tip_flag = 0;
01538 /* maybe want an ore tax? */
01539 yy = ye;
01540 xx = xe; /* break out */
01541 }
01542 }
01543
01544 if ((MP_INFO(x - 1,y).flags & FLAG_IS_TRANSPORT) != 0)
01545 {
01546 if (MP_GROUP(x-1,y) == GROUP_RAIL
01547 && MP_INFO(x - 1,y).int_5 < MAX_ORE_ON_RAIL
01548 && MP_INFO(x,y).int_1 >= (MAX_ORE_ON_RAIL
01549 - MP_INFO(x - 1,y).int_5))
01550 {
01551 if (get_jobs (x, y, JOBS_LOAD_ORE) != 0)
01552 {
01553 MP_INFO(x,y).int_1
01554 -= (MAX_ORE_ON_RAIL - MP_INFO(x - 1,y).int_5);
01555 MP_INFO(x - 1,y).int_5 = MAX_ORE_ON_RAIL;
01556 }
01557 }
01558 else if (MP_GROUP(x-1,y) == GROUP_ROAD
01559 && MP_INFO(x - 1,y).int_5 < MAX_ORE_ON_ROAD
01560 && MP_INFO(x,y).int_1 >= (MAX_ORE_ON_ROAD
01561 - MP_INFO(x - 1,y).int_5))
01562 {
01563 if (get_jobs (x, y, JOBS_LOAD_ORE) != 0)
01564 {
01565 MP_INFO(x,y).int_1
01566 -= (MAX_ORE_ON_ROAD - MP_INFO(x - 1,y).int_5);
01567 MP_INFO(x - 1,y).int_5 = MAX_ORE_ON_ROAD;
01568 }
01569 }
01570 else if (MP_GROUP(x - 1,y) == GROUP_TRACK
01571 && MP_INFO(x - 1,y).int_5 < MAX_ORE_ON_TRACK
01572 && MP_INFO(x,y).int_1 >= (MAX_ORE_ON_TRACK
01573 - MP_INFO(x - 1,y).int_5))
01574 {
01575 if (get_jobs (x, y, JOBS_LOAD_ORE) != 0)
01576 {
01577 MP_INFO(x,y).int_1
01578 -= (MAX_ORE_ON_TRACK - MP_INFO(x - 1,y).int_5);
01579 MP_INFO(x - 1,y).int_5 = MAX_ORE_ON_TRACK;
01580 }
01581 }
01582 }
01583
01584 if ((MP_INFO(x,y - 1).flags & FLAG_IS_TRANSPORT) != 0)
01585 {
01586 if (MP_GROUP(x,y-1) == GROUP_RAIL
01587 && MP_INFO(x,y - 1).int_5 < MAX_ORE_ON_RAIL
01588 && MP_INFO(x,y).int_1 >= (MAX_ORE_ON_RAIL
01589 - MP_INFO(x,y - 1).int_5))
01590 {
01591 if (get_jobs (x, y, JOBS_LOAD_ORE) != 0)
01592 {
01593 MP_INFO(x,y).int_1
01594 -= (MAX_ORE_ON_RAIL - MP_INFO(x,y - 1).int_5);
01595 MP_INFO(x,y - 1).int_5 = MAX_ORE_ON_RAIL;
01596 }
01597 }
01598 else if (MP_GROUP(x,y-1) == GROUP_ROAD
01599 && MP_INFO(x,y - 1).int_5 < MAX_ORE_ON_ROAD
01600 && MP_INFO(x,y).int_1 >= (MAX_ORE_ON_ROAD
01601 - MP_INFO(x,y - 1).int_5))
01602 {
01603 if (get_jobs (x, y, JOBS_LOAD_ORE) != 0)
01604 {
01605 MP_INFO(x,y).int_1
01606 -= (MAX_ORE_ON_ROAD - MP_INFO(x,y - 1).int_5);
01607 MP_INFO(x,y - 1).int_5 = MAX_ORE_ON_ROAD;
01608 }
01609 }
01610 else if (MP_GROUP(x,y-1) == GROUP_TRACK
01611 && MP_INFO(x,y - 1).int_5 < MAX_ORE_ON_TRACK
01612 && MP_INFO(x,y).int_1 >= (MAX_ORE_ON_TRACK
01613 - MP_INFO(x,y - 1).int_5))
01614 {
01615 if (get_jobs (x, y, JOBS_LOAD_ORE) != 0)
01616 {
01617 MP_INFO(x,y).int_1
01618 -= (MAX_ORE_ON_TRACK - MP_INFO(x,y - 1).int_5);
01619 MP_INFO(x,y - 1).int_5 = MAX_ORE_ON_TRACK;
01620 }
01621 }
01622 }
01623
01624
01625 /* choose a graphic */
01626 if ((total_time & 0x7f) == 0)
01627 {
01628 xx = 7 * (MP_INFO(x,y).int_2 + (3 * ORE_RESERVE / 2))
01629 / (16 * ORE_RESERVE);
01630 switch (xx)
01631 {
01632 case (0):
01633 MP_TYPE(x,y) = CST_OREMINE_8;
01634 break;
01635 case (1):
01636 MP_TYPE(x,y) = CST_OREMINE_7;
01637 break;
01638 case (2):
01639 MP_TYPE(x,y) = CST_OREMINE_6;
01640 break;
01641 case (3):
01642 MP_TYPE(x,y) = CST_OREMINE_5;
01643 break;
01644 case (4):
01645 MP_TYPE(x,y) = CST_OREMINE_4;
01646 break;
01647 case (5):
01648 MP_TYPE(x,y) = CST_OREMINE_3;
01649 break;
01650 case (6):
01651 MP_TYPE(x,y) = CST_OREMINE_2;
01652 break;
01653 case (7):
01654 MP_TYPE(x,y) = CST_OREMINE_1;
01655 break;
01656 }
01657 if (MP_INFO(x,y).int_2 <= 0) {
01658 #if defined (commentout)
01659 do_bulldoze_area (CST_GREEN, x, y);
01660 place_item(x,y,CST_TIP_0);
01661 #endif
01662 int i,j;
01663 for (j = 0; j < 4; j++) {
01664 for (i = 0; i < 4; i++) {
01665 do_bulldoze_area (CST_WATER, x+i, y+j);
01666 }
01667 }
01668 connect_rivers ();
01669 refresh_main_screen ();
01670 }
01671 }
01672 }
|
|
||||||||||||
|
Definition at line 1176 of file engine.c. 01177 {
01178 /*
01179 // int_1 is the tech level of the farm when built
01180 // int_2 is a flag so we don't create a farm with nearly ripe crops.
01181 // int_3 is the food sold count so far this year.
01182 // int_4 is the food made last year.
01183 // int_5 is the random crop rotation key.
01184 // int_6 is the random month stagger, so they don't all flash at once
01185 // int_7 is the tech-level dependent output of a powered farm with a full
01186 // workforce.
01187 */
01188 int i;
01189 if (MP_INFO(x,y).int_5 == 0) /* this should be done when we create */
01190
01191 { /* the area! */
01192
01193 MP_INFO(x,y).int_5 = (rand () % 4) + 1;
01194 MP_INFO(x,y).int_6 = rand () % 300;
01195 }
01196 MP_INFO(x,y).flags &= (0xffffffff - FLAG_POWERED);
01197 if (get_jobs (x, y, 1) == 0)
01198 put_food (x, y, 30);
01199 else if (get_jobs (x, y, FARM_JOBS_USED) != 0)
01200 {
01201 if (get_power (x, y, ORG_FARM_POWER_REC, 0) != 0)
01202 {
01203 if (put_food (x, y, (ORGANIC_FARM_FOOD_OUTPUT
01204 + MP_INFO(x,y).int_7)) == 0)
01205 put_jobs (x, y, FARM_JOBS_USED);
01206 else
01207 MP_INFO(x,y).int_3++;
01208 MP_INFO(x,y).flags |= FLAG_POWERED;
01209 }
01210 else
01211 {
01212 if (put_food (x, y, (ORGANIC_FARM_FOOD_OUTPUT / 4)) == 0)
01213 put_jobs (x, y, FARM_JOBS_USED);
01214 else
01215 MP_INFO(x,y).int_3++;
01216 }
01217 }
01218 else if (get_jobs (x, y, FARM_JOBS_USED / 4) != 0)
01219 {
01220 if (get_power (x, y, ORG_FARM_POWER_REC, 0) != 0)
01221 {
01222 if (put_food (x, y, (ORGANIC_FARM_FOOD_OUTPUT
01223 + (MP_INFO(x,y).int_7 / 4))) == 0)
01224 put_jobs (x, y, FARM_JOBS_USED / 4);
01225 else
01226 MP_INFO(x,y).int_3++;
01227 MP_INFO(x,y).flags |= FLAG_POWERED;
01228 }
01229 else
01230 {
01231 if (put_food (x, y, (ORGANIC_FARM_FOOD_OUTPUT / (4 * 4))) == 0)
01232 put_jobs (x, y, FARM_JOBS_USED / 4);
01233 else
01234 MP_INFO(x,y).int_3++;
01235 }
01236 }
01237 else
01238 {
01239 if (get_power (x, y, ORG_FARM_POWER_REC, 0) != 0)
01240 {
01241 if (put_food (x, y, (ORGANIC_FARM_FOOD_OUTPUT
01242 + (MP_INFO(x,y).int_7 / 8))) != 0)
01243 MP_INFO(x,y).int_3++;
01244 MP_INFO(x,y).flags |= FLAG_POWERED;
01245 }
01246 else if (put_food (x, y, 30
01247 + (ORGANIC_FARM_FOOD_OUTPUT / (4 * 8))) != 0)
01248 MP_INFO(x,y).int_3++;
01249 }
01250 if ((total_time & 0x7f) == 0)
01251 if ((MP_INFO(x,y).flags & FLAG_POWERED) != 0)
01252 get_waste (x, y, 0x80 * ORG_FARM_WASTE_GET);
01253 if ((total_time % 1200) == 0)
01254 {
01255 MP_INFO(x,y).int_4 = MP_INFO(x,y).int_3;
01256 MP_INFO(x,y).int_3 = 0;
01257 }
01258 i = ((total_time + (MP_INFO(x,y).int_5 * 1200)
01259 + MP_INFO(x,y).int_6) % 4800);
01260 if (i % 300 == 0)
01261 {
01262 i /= 300;
01263 if ( /* MP_INFO(x,y).int_2!=0 && */ MP_INFO(x,y).int_4
01264 > MIN_FOOD_SOLD_FOR_ANIM)
01265 {
01266 if (i % 4 == 0)
01267 {
01268 MP_INFO(x,y).int_6 = rand () % 100;
01269 }
01270 switch (i)
01271 {
01272 case (0):
01273 MP_TYPE(x,y) = CST_FARM_O3;
01274 break;
01275 case (1):
01276 MP_TYPE(x,y) = CST_FARM_O3;
01277 break;
01278 case (2):
01279 MP_TYPE(x,y) = CST_FARM_O3;
01280 break;
01281 case (3):
01282 MP_TYPE(x,y) = CST_FARM_O3;
01283 break;
01284 case (4):
01285 MP_TYPE(x,y) = CST_FARM_O7;
01286 break;
01287 case (5):
01288 MP_TYPE(x,y) = CST_FARM_O7;
01289 break;
01290 case (6):
01291 MP_TYPE(x,y) = CST_FARM_O7;
01292 break;
01293 case (7):
01294 MP_TYPE(x,y) = CST_FARM_O7;
01295 break;
01296 case (8):
01297 MP_TYPE(x,y) = CST_FARM_O11;
01298 break;
01299 case (9):
01300 MP_TYPE(x,y) = CST_FARM_O11;
01301 break;
01302 case (10):
01303 MP_TYPE(x,y) = CST_FARM_O11;
01304 break;
01305 case (11):
01306 MP_TYPE(x,y) = CST_FARM_O11;
01307 break;
01308 case (12):
01309 MP_TYPE(x,y) = CST_FARM_O15;
01310 break;
01311 case (13):
01312 MP_TYPE(x,y) = CST_FARM_O15;
01313 break;
01314 case (14):
01315 MP_TYPE(x,y) = CST_FARM_O15;
01316 break;
01317 case (15):
01318 MP_TYPE(x,y) = CST_FARM_O15;
01319 break;
01320
01321 }
01322 }
01323 else
01324 {
01325 MP_TYPE(x,y) = CST_FARM_O0;
01326 }
01327 }
01328 }
|
|
||||||||||||
|
Definition at line 2215 of file engine.c. 02216 {
02217 if (MP_POL(x,y) > 10 && (total_time & 1) == 0)
02218 MP_POL(x,y) -= 1;
02219 }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Definition at line 2151 of file engine.c. 02152 {
02153 int x, p;
02154 int* pol = &map.pollution[0][0];
02155
02156 /* Kill pollution from top edge of map */
02157 do {
02158 if (*pol > 0)
02159 *pol /= POL_DIV;
02160 } while (++pol < &map.pollution[1][0]);
02161
02162
02163 x= 1;
02164 do
02165 {
02166 /* Kill some pollution from left edge of map */
02167 if (*pol++ > 0)
02168 *(pol-1) /= POL_DIV;
02169 do {
02170 if (*pol > 10) {
02171 p = *pol / 16;
02172 *pol -= p;
02173 switch ( rand() % 11)
02174 { /* prevailing wind is *from* SW ie right down */
02175 case 0:
02176 case 1: /* up */
02177 case 2:
02178 *(pol - 1) += p;
02179 break;
02180 case 3:
02181 case 4: /* right */
02182 case 5:
02183 *(pol + WORLD_SIDE_LEN) += p;
02184 break;
02185 case 6: /* down */
02186 case 7:
02187 *(pol + 1) += p;
02188 break;
02189 case 8: /* left */
02190 case 9:
02191 *(pol - WORLD_SIDE_LEN) += p;
02192 break;
02193 case 10:
02194 *pol += p- 2;
02195 break;
02196 }
02197 }
02198 } while (++pol < &map.pollution[x][WORLD_SIDE_LEN-1]);
02199 /* Kill some pollution from right edge of map */
02200 if (*pol > 0)
02201 *pol /= POL_DIV;
02202 ++x;
02203 }
02204 while (++pol < &map.pollution[WORLD_SIDE_LEN-1][0]);
02205
02206 /* Kill pollution from bottom edge of map */
02207 do {
02208 if (*pol > 0)
02209 *pol /= POL_DIV;
02210 } while (++pol < &map.pollution[WORLD_SIDE_LEN][0]);
02211 }
|
|
||||||||||||
|
Definition at line 1801 of file engine.c. 01802 {
01803 /*
01804 // int_1 is the money made so far this month
01805 // int_2 is the money made last month
01806 // int_3 holds the 'pence/pennies/bits' to add next time round.
01807 // int_4 is the import costs so far this month
01808 // int_5 is the import costs for last month
01809 // Use int_3 to int_7 of (x+1,y) to hold the individual buy values
01810 // (x,y+1) is last month's
01811 // Use int_3 to int_7 of (x+2,y) to hold the individual sell values
01812 // (x,y+2) is last month's
01813 */
01814 int i, et = 0, ic = 0, flags, *b1, *b2, *s1, *s2;
01815 /* left connection first */
01816 flags = MP_INFO(x,y).flags;
01817 if (x > 0 && (MP_INFO(x - 1,y).flags
01818 & FLAG_IS_TRANSPORT) != 0)
01819 {
01820 if ((flags & FLAG_MB_FOOD) != 0)
01821 {
01822 i = buy_food (x - 1, y);
01823 ic += i;
01824 MP_INFO(x + 1,y).int_3 += i;
01825 }
01826 if ((flags & FLAG_MS_FOOD) != 0)
01827 {
01828 i = sell_food (x - 1, y);
01829 et += i;
01830 MP_INFO(x + 2,y).int_3 += i;
01831 }
01832 if ((flags & FLAG_MB_COAL) != 0)
01833 {
01834 i = buy_coal (x - 1, y);
01835 ic += i;
01836 MP_INFO(x + 1,y).int_4 += i;
01837 }
01838 if ((flags & FLAG_MS_COAL) != 0)
01839 {
01840 i = sell_coal (x - 1, y);
01841 et += i;
01842 MP_INFO(x + 2,y).int_4 += i;
01843 }
01844 if ((flags & FLAG_MB_ORE) != 0)
01845 {
01846 i = buy_ore (x - 1, y);
01847 ic += i;
01848 MP_INFO(x + 1,y).int_5 += i;
01849 }
01850 if ((flags & FLAG_MS_ORE) != 0)
01851 {
01852 i = sell_ore (x - 1, y);
01853 et += i;
01854 MP_INFO(x + 2,y).int_5 += i;
01855 }
01856 if ((flags & FLAG_MB_GOODS) != 0)
01857 {
01858 i = buy_goods (x - 1, y);
01859 ic += i;
01860 MP_INFO(x + 1,y).int_6 += i;
01861 }
01862 if ((flags & FLAG_MS_GOODS) != 0)
01863 {
01864 i = sell_goods (x - 1, y);
01865 et += i;
01866 MP_INFO(x + 2,y).int_6 += i;
01867 }
01868 if ((flags & FLAG_MB_STEEL) != 0)
01869 {
01870 i = buy_steel (x - 1, y);
01871 ic += i;
01872 MP_INFO(x + 1,y).int_7 += i;
01873 }
01874 if ((flags & FLAG_MS_STEEL) != 0)
01875 {
01876 i = sell_steel (x - 1, y);
01877 et += i;
01878 MP_INFO(x + 2,y).int_7 += i;
01879 }
01880 }
01881 /* upper gate next */
01882 if (y > 0 && (MP_INFO(x,y - 1).flags
01883 & FLAG_IS_TRANSPORT) != 0)
01884 {
01885 if ((flags & FLAG_MB_FOOD) != 0)
01886 {
01887 i = buy_food (x, y - 1);
01888 ic += i;
01889 MP_INFO(x + 1,y).int_3 += i;
01890 }
01891 if ((flags & FLAG_MS_FOOD) != 0)
01892 {
01893 i = sell_food (x, y - 1);
01894 et += i;
01895 MP_INFO(x + 2,y).int_3 += i;
01896 }
01897 if ((flags & FLAG_MB_COAL) != 0)
01898 {
01899 i = buy_coal (x, y - 1);
01900 ic += i;
01901 MP_INFO(x + 1,y).int_4 += i;
01902 }
01903 if ((flags & FLAG_MS_COAL) != 0)
01904 {
01905 i = sell_coal (x, y - 1);
01906 et += i;
01907 MP_INFO(x + 2,y).int_4 += i;
01908 }
01909 if ((flags & FLAG_MB_ORE) != 0)
01910 {
01911 i = buy_ore (x, y - 1);
01912 ic += i;
01913 MP_INFO(x + 1,y).int_5 += i;
01914 }
01915 if ((flags & FLAG_MS_ORE) != 0)
01916 {
01917 i = sell_ore (x, y - 1);
01918 et += i;
01919 MP_INFO(x + 2,y).int_5 += i;
01920 }
01921 if ((flags & FLAG_MB_GOODS) != 0)
01922 {
01923 i = buy_goods (x, y - 1);
01924 ic += i;
01925 MP_INFO(x + 1,y).int_6 += i;
01926 }
01927 if ((flags & FLAG_MS_GOODS) != 0)
01928 {
01929 i = sell_goods (x, y - 1);
01930 et += i;
01931 MP_INFO(x + 2,y).int_6 += i;
01932 }
01933 if ((flags & FLAG_MB_STEEL) != 0)
01934 {
01935 i = buy_steel (x, y - 1);
01936 ic += i;
01937 MP_INFO(x + 1,y).int_7 += i;
01938 }
01939 if ((flags & FLAG_MS_STEEL) != 0)
01940 {
01941 i = sell_steel (x, y - 1);
01942 et += i;
01943 MP_INFO(x + 2,y).int_7 += i;
01944 }
01945 }
01946 MP_INFO(x,y).int_1 += et;
01947 MP_INFO(x,y).int_4 += ic;
01948 if (total_time % 100 == 0)
01949 {
01950 MP_INFO(x,y).int_2 = MP_INFO(x,y).int_1;
01951 MP_INFO(x,y).int_1 = 0;
01952 MP_INFO(x,y).int_5 = MP_INFO(x,y).int_4;
01953 MP_INFO(x,y).int_4 = 0;
01954 b1 = &(MP_INFO(x + 1,y).int_3);
01955 s1 = &(MP_INFO(x + 2,y).int_3);
01956 b2 = &(MP_INFO(x,y + 1).int_3);
01957 s2 = &(MP_INFO(x,y + 2).int_3);
01958 /* GCS FIX -- This obfuscation is unnecessary. */
01959 for (i = 0; i < 5; i++)
01960 {
01961 *(b2++) = *b1;
01962 *(s2++) = *s1;
01963 *(b1++) = 0;
01964 *(s1++) = 0;
01965 }
01966 }
01967 if (et > 0)
01968 {
01969 sust_port_flag = 0;
01970 tech_level++;
01971 }
01972 if (ic > 0)
01973 {
01974 sust_port_flag = 0;
01975 tech_level++;
01976 }
01977 et += MP_INFO(x,y).int_3; /* int_3 holds the 'pence' */
01978
01979 export_tax += et / 100;
01980 MP_INFO(x,y).int_3 = et % 100;
01981 import_cost += ic;
01982 }
|
|
||||||||||||
|
Definition at line 2894 of file engine.c. 02895 {
02896 /*
02897 // int_1 contains the goods at the pottery
02898 // int_2 contains the ore at the pottery
02899 // int_3 contains the coal at the pottery
02900 // int_4 is the animation trigger time
02901 // int_5 is the % made so far this month or the close time if negative
02902 // int_6 is the % capacity last month
02903 // int_7 contains the jobs stored at the pottery
02904 */
02905 if (MP_INFO(x,y).int_5 < 0)
02906 {
02907 MP_INFO(x,y).int_5++;
02908 return;
02909 }
02910 if (MP_INFO(x,y).int_1 < (MAX_GOODS_AT_POTTERY - POTTERY_MADE_GOODS))
02911 {
02912 if (MP_INFO(x,y).int_2
02913 < (MAX_ORE_AT_POTTERY - POTTERY_GET_ORE))
02914 if (get_ore (x, y, POTTERY_GET_ORE) != 0)
02915 MP_INFO(x,y).int_2 += POTTERY_GET_ORE;
02916 if (MP_INFO(x,y).int_3
02917 < (MAX_COAL_AT_POTTERY - POTTERY_GET_COAL))
02918 if (get_coal (x, y, POTTERY_GET_COAL) != 0)
02919 MP_INFO(x,y).int_3 += POTTERY_GET_COAL;
02920 if (MP_INFO(x,y).int_7
02921 < (MAX_JOBS_AT_POTTERY - POTTERY_GET_JOBS))
02922 if (get_jobs (x, y, POTTERY_GET_JOBS) != 0)
02923 MP_INFO(x,y).int_7 += POTTERY_GET_JOBS;
02924
02925 if (MP_INFO(x,y).int_2 > POTTERY_ORE_MAKE_GOODS
02926 && MP_INFO(x,y).int_3 > POTTERY_COAL_MAKE_GOODS
02927 && MP_INFO(x,y).int_7 > POTTERY_JOBS)
02928 {
02929 MP_INFO(x,y).int_1 += POTTERY_MADE_GOODS;
02930 MP_INFO(x,y).int_2 -= POTTERY_ORE_MAKE_GOODS;
02931 MP_INFO(x,y).int_3 -= POTTERY_COAL_MAKE_GOODS;
02932 MP_INFO(x,y).int_7 -= POTTERY_JOBS;
02933 MP_INFO(x,y).int_5++;
02934 }
02935 else
02936 {
02937 MP_TYPE(x,y) = CST_POTTERY_1;
02938 MP_INFO(x,y).int_6 = 0;
02939 MP_INFO(x,y).int_5 = -POTTERY_CLOSE_TIME;
02940 return;
02941 }
02942 }
02943 if (MP_INFO(x,y).int_1 > 0)
02944 if (put_goods (x, y, MP_INFO(x,y).int_1) != 0)
02945 MP_INFO(x,y).int_1 = 0;
02946
02947 if (total_time % 100 == 0)
02948 {
02949 MP_INFO(x,y).int_6 = MP_INFO(x,y).int_5;
02950 MP_INFO(x,y).int_5 = 0;
02951 }
02952 if (real_time >= MP_INFO(x,y).int_4 /* && block_anim==0 */ )
02953 {
02954 MP_INFO(x,y).int_4 = real_time + POTTERY_ANIM_SPEED;
02955 switch (MP_TYPE(x,y))
02956 {
02957 case (CST_POTTERY_0):
02958 MP_TYPE(x,y) = CST_POTTERY_1;
02959 break;
02960 case (CST_POTTERY_1):
02961 MP_TYPE(x,y) = CST_POTTERY_2;
02962 break;
02963 case (CST_POTTERY_2):
02964 MP_TYPE(x,y) = CST_POTTERY_3;
02965 break;
02966 case (CST_POTTERY_3):
02967 MP_TYPE(x,y) = CST_POTTERY_4;
02968 break;
02969 case (CST_POTTERY_4):
02970 MP_TYPE(x,y) = CST_POTTERY_5;
02971 break;
02972 case (CST_POTTERY_5):
02973 MP_TYPE(x,y) = CST_POTTERY_6;
02974 break;
02975 case (CST_POTTERY_6):
02976 MP_TYPE(x,y) = CST_POTTERY_7;
02977 break;
02978 case (CST_POTTERY_7):
02979 MP_TYPE(x,y) = CST_POTTERY_8;
02980 break;
02981 case (CST_POTTERY_8):
02982 MP_TYPE(x,y) = CST_POTTERY_9;
02983 break;
02984 case (CST_POTTERY_9):
02985 MP_TYPE(x,y) = CST_POTTERY_10;
02986 break;
02987 case (CST_POTTERY_10):
02988 MP_TYPE(x,y) = CST_POTTERY_1;
02989 MP_POL(x,y)++;
02990 break;
02991 }
02992 }
02993 }
|
|
||||||||||||
|
Definition at line 599 of file power.c. 00600 {
00601 if (grid[MP_INFO(x,y).int_6]->powered == -1)
00602 return;
00603
00604 switch(MP_INFO(x,y).int_5)
00605 {
00606 case 0:
00607 MP_INFO(x,y).int_5 = POWER_MODULUS;
00608 break;
00609 case 1:
00610 if (!(MP_TYPE(x,y) <= 11 && MP_TYPE(x,y) >= 1))
00611 break;
00612 MP_TYPE(x,y) += 11;
00613 break;
00614 case 2:
00615 if (!(MP_TYPE(x,y) >= 11 && MP_TYPE(x,y) <= 22))
00616 break;
00617 MP_TYPE(x,y) -= 11;
00618 break;
00619 }
00620
00621 MP_INFO(x,y).int_5--;
00622 }
|
|
||||||||||||
|
Definition at line 512 of file power.c. 00513 {
00514 if (get_jobs(x, y, SOLAR_POWER_JOBS)) {
00515 MP_INFO(x,y).int_5 = MP_INFO(x,y).int_3;
00516 grid[MP_INFO(x,y).int_6]->avail_power += MP_INFO(x,y).int_3;
00517 } else {
00518 MP_INFO(x,y).int_5 = 0;
00519 }
00520 }
|
|
||||||||||||
|
Definition at line 534 of file power.c. 00535 {
00536
00537 /* Need coal? Try transport. */
00538 if (MP_INFO(x,y).int_2 < MAX_COAL_AT_POWER_STATION) {
00539
00540 /* left side */
00541 if (XY_IS_TRANSPORT(x-1, y+1) && MP_INFO(x-1, y+1).int_3 > 0) {
00542 if (get_jobs (x, y, JOBS_LOAD_COAL) != 0)
00543 {
00544 MP_INFO(x,y).int_2 += (MP_INFO(x-1, y+1).int_3 / 2
00545 + ((MP_INFO(x-1, y+1).int_3) % 2));
00546 MP_INFO(x-1, y+1).int_3 /= 2;
00547 MP_POL(x,y)++;
00548 }
00549 }
00550 /* top side */
00551 else if (XY_IS_TRANSPORT(x+1, y-1) && MP_INFO(x+1, y-1).int_3 > 0) {
00552 if (get_jobs (x, y, JOBS_LOAD_COAL) != 0)
00553 MP_INFO(x,y).int_2 += (MP_INFO(x+1, y-1).int_3 / 2
00554 + ((MP_INFO(x+1, y-1).int_3) % 2));
00555 MP_INFO(x + 1,y - 1).int_3 /= 2;
00556 MP_POL(x,y)++;
00557 }
00558 }
00559
00560 /* Need jobs? get_jobs. */
00561 if ((MP_INFO(x,y).int_3 + JOBS_COALPS_GENERATE + 10)
00562 < MAX_JOBS_AT_COALPS)
00563 if (get_jobs (x, y, JOBS_COALPS_GENERATE + 10) != 0)
00564 MP_INFO(x,y).int_3 += JOBS_COALPS_GENERATE + 10;
00565
00566 /* Generate Power */
00567 if (MP_INFO(x,y).int_2 > POWERS_COAL_OUTPUT / 500 &&
00568 MP_INFO(x,y).int_3 > JOBS_COALPS_GENERATE)
00569 {
00570 MP_INFO(x,y).int_5 = MP_INFO(x,y).int_1;
00571 MP_INFO(x,y).int_3 -= JOBS_COALPS_GENERATE;
00572 MP_INFO(x,y).int_2 -= POWERS_COAL_OUTPUT / 500;
00573 coal_used += POWERS_COAL_OUTPUT / 500;
00574 MP_POL(x,y) += POWERS_COAL_POLLUTION;
00575 grid[MP_INFO(x,y).int_6]->avail_power += MP_INFO(x,y).int_1;
00576 }
00577
00578 /* Animation */
00579 /* choose a graphic */
00580 if (MP_INFO(x,y).int_2 > (MAX_COAL_AT_POWER_STATION
00581 - (MAX_COAL_AT_POWER_STATION / 5)))
00582 MP_TYPE(x,y) = CST_POWERS_COAL_FULL;
00583 else if (MP_INFO(x,y).int_2 > (MAX_COAL_AT_POWER_STATION / 2))
00584 MP_TYPE(x,y) = CST_POWERS_COAL_MED;
00585 else if (MP_INFO(x,y).int_2 > (MAX_COAL_AT_POWER_STATION / 10))
00586 MP_TYPE(x,y) = CST_POWERS_COAL_LOW;
00587 else
00588 MP_TYPE(x,y) = CST_POWERS_COAL_EMPTY;
00589 }
|
|
||||||||||||
|
Definition at line 377 of file power.c. 00378 {
00379 switch(grid[MP_INFO(x,y).int_6]->powered) {
00380 case -1: {
00381 MP_TYPE(x,y) = CST_SUBSTATION_R;
00382 } break;
00383 case 0 : {
00384 MP_TYPE(x,y) = CST_SUBSTATION_RG;
00385 } break;
00386 case 1 : {
00387 MP_TYPE(x,y) = CST_SUBSTATION_G;
00388 } break;
00389 default : {
00390 printf("Default case in do_power_substation\n");
00391 } break;
00392 }
00393 }
|
|
||||||||||||
|
Definition at line 37 of file transport.c. 00038 {
00039 static int wb_count = 0;
00040 int *pol = &MP_POL(x,y);
00041 Map_Point_Info *minfo = &MP_INFO(x,y);
00042 transport_cost += 3;
00043 if (total_time % DAYS_PER_RAIL_POLLUTION == 0)
00044 *pol += RAIL_POLLUTION;
00045 if ((total_time & RAIL_GOODS_USED_MASK) == 0 && minfo->int_4 > 0) {
00046 --minfo->int_4;
00047 ++minfo->int_7;
00048 }
00049 if ((total_time & RAIL_STEEL_USED_MASK) == 0 && minfo->int_6 > 0) {
00050 --minfo->int_6;
00051 ++minfo->int_7;
00052 }
00053 general_transport (minfo, pol, MAX_WASTE_ON_RAIL, &wb_count);
00054 }
|
|
||||||||||||||||
|
Definition at line 3237 of file engine.c. 03238 {
03239 int xx, yy;
03240 if (x == -1 && y == -1)
03241 {
03242 x = rand () % WORLD_SIDE_LEN;
03243 y = rand () % WORLD_SIDE_LEN;
03244 }
03245 else
03246 {
03247 if (x < 0 || x >= WORLD_SIDE_LEN || y < 0 || y >= WORLD_SIDE_LEN)
03248 return;
03249 }
03250 if (MP_TYPE(x,y) == CST_USED)
03251 {
03252 xx = MP_INFO(x,y).int_1;
03253 yy = MP_INFO(x,y).int_2;
03254 x = xx;
03255 y = yy;
03256 }
03257 xx = rand () % 100;
03258 if (xx >= (main_groups[MP_GROUP(x,y)].fire_chance))
03259 return;
03260 if ((MP_INFO(x,y).flags & FLAG_FIRE_COVER) != 0)
03261 return;
03262 if (pwarning)
03263 {
03264 if (MP_GROUP(x,y) == GROUP_POWER_LINE)
03265 ok_dial_box ("fire.mes", BAD, _("It's at a power line."));
03266 else if (MP_GROUP(x,y) == GROUP_SOLAR_POWER)
03267 ok_dial_box ("fire.mes", BAD, _("It's at a solar power station."));
03268 else if (MP_GROUP(x,y) == GROUP_SUBSTATION)
03269 ok_dial_box ("fire.mes", BAD, _("It's at a substation."));
03270 else if (MP_GROUP_IS_RESIDENCE(x,y))
03271 ok_dial_box ("fire.mes", BAD, _("It's at a residential area."));
03272 else if (MP_GROUP(x,y) == GROUP_ORGANIC_FARM)
03273 ok_dial_box ("fire.mes", BAD, _("It's at a farm."));
03274 else if (MP_GROUP(x,y) == GROUP_MARKET)
03275 ok_dial_box ("fire.mes", BAD, _("It's at a market."));
03276 else if (MP_GROUP(x,y) == GROUP_TRACK)
03277 ok_dial_box ("fire.mes", BAD, _("It's at a track."));
03278 else if (MP_GROUP(x,y) == GROUP_COALMINE)
03279 ok_dial_box ("fire.mes", BAD, _("It's at a coal mine."));
03280 else if (MP_GROUP(x,y) == GROUP_RAIL)
03281 ok_dial_box ("fire.mes", BAD, _("It's at a railway."));
03282 else if (MP_GROUP(x,y) == GROUP_COAL_POWER)
03283 ok_dial_box ("fire.mes", BAD, _("It's at a coal power station."));
03284 else if (MP_GROUP(x,y) == GROUP_ROAD)
03285 ok_dial_box ("fire.mes", BAD, _("It's at a road."));
03286 else if (MP_GROUP(x,y) == GROUP_INDUSTRY_L)
03287 ok_dial_box ("fire.mes", BAD, _("It's at light industry."));
03288 else if (MP_GROUP(x,y) == GROUP_UNIVERSITY)
03289 ok_dial_box ("fire.mes", BAD, _("It's at a university."));
03290 else if (MP_GROUP(x,y) == GROUP_COMMUNE)
03291 ok_dial_box ("fire.mes", BAD, _("It's at a commune."));
03292 else if (MP_GROUP(x,y) == GROUP_TIP)
03293 ok_dial_box ("fire.mes", BAD, _("It's at a tip."));
03294 else if (MP_GROUP(x,y) == GROUP_PORT)
03295 ok_dial_box ("fire.mes", BAD, _("It's at a port."));
03296 else if (MP_GROUP(x,y) == GROUP_INDUSTRY_H)
03297 ok_dial_box ("fire.mes", BAD, _("It's at a steel works."));
03298 else if (MP_GROUP(x,y) == GROUP_RECYCLE)
03299 ok_dial_box ("fire.mes", BAD, _("It's at a recycle centre."));
03300 else if (MP_GROUP(x,y) == GROUP_HEALTH)
03301 ok_dial_box ("fire.mes", BAD, _("It's at a health centre."));
03302 else if (MP_GROUP(x,y) == GROUP_ROCKET)
03303 ok_dial_box ("fire.mes", BAD, _("It's at a rocket site."));
03304 else if (MP_GROUP(x,y) == GROUP_WINDMILL)
03305 ok_dial_box ("fire.mes", BAD, _("It's at a windmill."));
03306 else if (MP_GROUP(x,y) == GROUP_SCHOOL)
03307 ok_dial_box ("fire.mes", BAD, _("It's at a school."));
03308 else if (MP_GROUP(x,y) == GROUP_BLACKSMITH)
03309 ok_dial_box ("fire.mes", BAD, _("It's at a blacksmith."));
03310 else if (MP_GROUP(x,y) == GROUP_MILL)
03311 ok_dial_box ("fire.mes", BAD, _("It's at a mill."));
03312 else if (MP_GROUP(x,y) == GROUP_POTTERY)
03313 ok_dial_box ("fire.mes", BAD, _("It's at a pottery."));
03314 else if (MP_GROUP(x,y) == GROUP_FIRESTATION)
03315 ok_dial_box ("fire.mes", BAD, _("It's at a fire station!!!."));
03316 else if (MP_GROUP(x,y) == GROUP_CRICKET)
03317 ok_dial_box ("fire.mes", BAD, _("It's at a cricket pitch!!!."));
03318 else if (MP_GROUP(x,y) == GROUP_SHANTY)
03319 ok_dial_box ("fire.mes", BAD, _("It's at a shanty town."));
03320 else
03321 ok_dial_box ("fire.mes", BAD, _("UNKNOWN!"));
03322 }
03323 fire_area (x, y);
03324 }
|
|
||||||||||||
|
Definition at line 2271 of file engine.c. 02272 {
02273 int i;
02274 /*
02275 // int_1 is the ore made and waiting to go out
02276 // int_2 is the used goods in store
02277 // int_3 is the used steel in store NOT USED at this time
02278 // int_4 is the tech level when built
02279 // int_5 is the recycling done so far this month
02280 // int_6 is the percent of max recycling last month
02281 // int_7 is the waste in store
02282 // cost
02283 */
02284 recycle_cost += RECYCLE_RUNNING_COST;
02285
02286 /*
02287 // let these go through, even if we're full of waste. It's a waste of time
02288 // checking.
02289 */
02290 if (x > 0 && (MP_INFO(x - 1,y).flags & FLAG_IS_TRANSPORT) != 0)
02291 {
02292 i = MP_INFO(x - 1,y).int_7;
02293 if (i > MAX_WASTE_AT_RECYCLE - MP_INFO(x,y).int_2)
02294 i = MAX_WASTE_AT_RECYCLE - MP_INFO(x,y).int_2;
02295 MP_INFO(x,y).int_2 += i;
02296 MP_INFO(x - 1,y).int_7 -= i;
02297 }
02298 if (y > 0 && (MP_INFO(x,y - 1).flags & FLAG_IS_TRANSPORT) != 0)
02299 {
02300 i = MP_INFO(x,y - 1).int_7;
02301 if (i > MAX_WASTE_AT_RECYCLE - MP_INFO(x,y).int_2)
02302 i = MAX_WASTE_AT_RECYCLE - MP_INFO(x,y).int_2;
02303 MP_INFO(x,y).int_2 += i;
02304 MP_INFO(x,y - 1).int_7 -= i;
02305 }
02306
02307 /* get some startup power if not powered yet */
02308 if ((MP_INFO(x,y).flags & FLAG_POWERED) == 0)
02309 if (get_power (x, y, GOODS_RECYCLED, 1) != 0)
02310 MP_INFO(x,y).flags |= FLAG_POWERED;
02311
02312 /* no steel recycling yet - no point, it's only used to make goods.
02313 // recycle to ore.
02314 */
02315 if (MP_INFO(x,y).int_1 < MAX_ORE_AT_RECYCLE
02316 && MP_INFO(x,y).int_2 > GOODS_RECYCLED
02317 && (MP_INFO(x,y).flags & FLAG_POWERED) != 0)
02318 if (get_jobs (x, y, RECYCLE_GOODS_JOBS) != 0)
02319 {
02320 if (get_power (x, y, GOODS_RECYCLED / 2, 1) == 0)
02321 MP_INFO(x,y).flags
02322 &= (0xffffffff - FLAG_POWERED);
02323 else
02324 MP_INFO(x,y).flags |= FLAG_POWERED;
02325 MP_INFO(x,y).int_2 -= GOODS_RECYCLED;
02326 i = (GOODS_RECYCLED * (10 + ((50 * MP_INFO(x,y).int_4)
02327 / MAX_TECH_LEVEL))) / 100;
02328 if (i > (GOODS_RECYCLED * 8) / 10)
02329 i = (GOODS_RECYCLED * 8) / 10;
02330 MP_INFO(x,y).int_1 += i;
02331 ore_made += i;
02332 MP_INFO(x,y).int_5++;
02333 }
02334 if (total_time % 100 == 0)
02335 {
02336 MP_INFO(x,y).int_6 = MP_INFO(x,y).int_5;
02337 MP_INFO(x,y).int_5 = 0;
02338 }
02339 /* now bung the ore out */
02340 /* put it on the railway */
02341 if (x > 0 && MP_GROUP(x-1,y) == GROUP_RAIL
02342 && MP_INFO(x - 1,y).int_5 < MAX_ORE_ON_RAIL
02343 && MP_INFO(x,y).int_1 >= (MAX_ORE_ON_RAIL
02344 - MP_INFO(x - 1,y).int_5))
02345 {
02346 if (get_jobs (x, y, JOBS_LOAD_ORE) != 0)
02347 {
02348 MP_INFO(x,y).int_1
02349 -= (MAX_ORE_ON_RAIL - MP_INFO(x - 1,y).int_5);
02350 MP_INFO(x - 1,y).int_5 = MAX_ORE_ON_RAIL;
02351 }
02352 }
02353 if (y > 0 && MP_GROUP(x,y-1) == GROUP_RAIL
02354 && MP_INFO(x,y - 1).int_5 < MAX_ORE_ON_RAIL
02355 && MP_INFO(x,y).int_1 >= (MAX_ORE_ON_RAIL
02356 - MP_INFO(x,y - 1).int_5))
02357 {
02358 if (get_jobs (x, y, JOBS_LOAD_ORE) != 0)
02359 {
02360 MP_INFO(x,y).int_1
02361 -= (MAX_ORE_ON_RAIL - MP_INFO(x,y - 1).int_5);
02362 MP_INFO(x,y - 1).int_5 = MAX_ORE_ON_RAIL;
02363 }
02364 }
02365 /* put it on the road */
02366 if (x > 0 && MP_GROUP(x-1,y) == GROUP_ROAD
02367 && MP_INFO(x - 1,y).int_5 < MAX_ORE_ON_ROAD
02368 && MP_INFO(x,y).int_1 >= (MAX_ORE_ON_ROAD
02369 - MP_INFO(x - 1,y).int_5))
02370 {
02371 if (get_jobs (x, y, JOBS_LOAD_ORE) != 0)
02372 {
02373 MP_INFO(x,y).int_1
02374 -= (MAX_ORE_ON_ROAD - MP_INFO(x - 1,y).int_5);
02375 MP_INFO(x - 1,y).int_5 = MAX_ORE_ON_ROAD;
02376 }
02377 }
02378 if (y > 0 && MP_GROUP(x,y-1) == GROUP_ROAD
02379 && MP_INFO(x,y - 1).int_5 < MAX_ORE_ON_ROAD
02380 && MP_INFO(x,y).int_1 >= (MAX_ORE_ON_ROAD
02381 - MP_INFO(x,y - 1).int_5))
02382 {
02383 if (get_jobs (x, y, JOBS_LOAD_ORE) != 0)
02384 {
02385 MP_INFO(x,y).int_1
02386 -= (MAX_ORE_ON_ROAD - MP_INFO(x,y - 1).int_5);
02387 MP_INFO(x,y - 1).int_5 = MAX_ORE_ON_ROAD;
02388 }
02389 }
02390 /* put it on the tracks */
02391 if (x > 0 && MP_GROUP(x-1,y) == GROUP_TRACK
02392 && MP_INFO(x - 1,y).int_5 < MAX_ORE_ON_TRACK
02393 && MP_INFO(x,y).int_1 >= (MAX_ORE_ON_TRACK
02394 - MP_INFO(x - 1,y).int_5))
02395 {
02396 if (get_jobs (x, y, JOBS_LOAD_ORE) != 0)
02397 {
02398 MP_INFO(x,y).int_1
02399 -= (MAX_ORE_ON_TRACK - MP_INFO(x - 1,y).int_5);
02400 MP_INFO(x - 1,y).int_5 = MAX_ORE_ON_TRACK;
02401 }
02402 }
02403 if (y > 0 && MP_GROUP(x,y-1) == GROUP_TRACK
02404 && MP_INFO(x,y - 1).int_5 < MAX_ORE_ON_TRACK
02405 && MP_INFO(x,y).int_1 >= (MAX_ORE_ON_TRACK
02406 - MP_INFO(x,y - 1).int_5))
02407 {
02408 if (get_jobs (x, y, JOBS_LOAD_ORE) != 0)
02409 {
02410 MP_INFO(x,y).int_1
02411 -= (MAX_ORE_ON_TRACK - MP_INFO(x,y - 1).int_5);
02412 MP_INFO(x,y - 1).int_5 = MAX_ORE_ON_TRACK;
02413 }
02414 }
02415 /* if we've still got >90% ore and waste in stock, burn some waste cleanly.
02416 */
02417 if (MP_INFO(x,y).int_1 > (MAX_ORE_AT_RECYCLE * 9 / 10)
02418 && MP_INFO(x,y).int_2 > (MAX_WASTE_AT_RECYCLE * 9 / 10))
02419 MP_INFO(x,y).int_2 -= BURN_WASTE_AT_RECYCLE;
02420 }
|
|
||||||||||||
|
Definition at line 303 of file engine.c. 00304 {
00305 /*
00306 // int_1 is a job swingometer to choose +/- JOB_SWING% of normal
00307 // int_2 is the date of the last starve
00308 // int 3 is the real time for the next icon update
00309 // int_4 is the birth rate modifier.
00310 // int_5 is the death rate modifier.
00311 */
00312 int p; /* population */
00313 int bad = 35, good = 30; /* (un)desirability of living here */
00314 int r, po, swing;
00315 int hc = 0; /* have health cover ? */
00316 int brm = 0, drm = 0; /* birth/death rate modifier */
00317 int cc = 0;
00318
00319 p = MP_INFO(x,y).population;
00320 if ((MP_INFO(x,y).flags & FLAG_HEALTH_COVER) != 0)
00321 {
00322 brm += RESIDENCE_BRM_HEALTH;
00323 good += 15;
00324 hc = 1;
00325 }
00326 if ((MP_INFO(x,y).flags & FLAG_FIRE_COVER) == 0)
00327 bad += 5;
00328 else
00329 good += 15;
00330 if ((MP_INFO(x,y).flags & FLAG_CRICKET_COVER) != 0)
00331 {
00332 good += 20;
00333 cc = CRICKET_JOB_SWING;
00334 }
00335 /* normal deaths + pollution deaths */
00336 po = ((MP_POL(x,y) / 50) + 1);
00337 if ((RESIDENCE_BASE_DR - MP_INFO(x,y).int_5 - po) > 1)
00338 r = rand () % (RESIDENCE_BASE_DR - MP_INFO(x,y).int_5 - po);
00339 else
00340 r = 2;
00341 if (p > 0 && (r < po))
00342 {
00343 if (r == 0 || hc == 0)
00344 p--;
00345 else if (hc != 0 && po > 10 && rand () % 4 == 0)
00346 {
00347 p--;
00348 unnat_deaths++;
00349 total_pollution_deaths++;
00350 pollution_deaths_history += 1.0;
00351 bad += 100;
00352 }
00353 if (r > 0 && hc == 0)
00354 {
00355 unnat_deaths++;
00356 total_pollution_deaths++;
00357 pollution_deaths_history += 1.0;
00358 bad += 100;
00359 }
00360 }
00361 /* normal births - must have food and jobs... and people */
00362 if ((MP_INFO(x,y).flags & (FLAG_FED + FLAG_EMPLOYED))
00363 == (FLAG_FED + FLAG_EMPLOYED)
00364 && (rand () % (RESIDENCE_BASE_BR + MP_INFO(x,y).int_4) == 1)
00365 && p > 0)
00366 {
00367 p++;
00368 total_births++;
00369 good += 50;
00370 }
00371 /* are people starving. */
00372 if ((MP_INFO(x,y).flags & FLAG_FED) == 0 && p > 0)
00373 {
00374 if (rand () % DAYS_PER_STARVE == 1)
00375 {
00376 p--;
00377 unnat_deaths++;
00378 total_starve_deaths++;
00379 starve_deaths_history += 1.0;
00380 }
00381 starving_population += p;
00382 bad += 250;
00383 drm += 100;
00384 MP_INFO(x,y).int_2 = total_time; /* for the starve screen */
00385 }
00386 /* kick one out if overpopulated */
00387 if (MP_TYPE(x,y) == CST_RESIDENCE_LL)
00388 {
00389 brm += RESIDENCE1_BRM;
00390 drm += p * 8;
00391 if (p > 50)
00392 {
00393 p--;
00394 people_pool++;
00395 brm += 20;
00396 }
00397 }
00398 else if (MP_TYPE(x,y) == CST_RESIDENCE_ML)
00399 {
00400 brm += RESIDENCE2_BRM;
00401 drm += p * 3;
00402 if (p > 100)
00403 {
00404 p--;
00405 people_pool++;
00406 brm += 10;
00407 }
00408 }
00409 else if (MP_TYPE(x,y) == CST_RESIDENCE_HL)
00410 {
00411 brm += RESIDENCE3_BRM;
00412 drm += p;
00413 good += 40;
00414 if (p > 200)
00415 {
00416 p--;
00417 people_pool++;
00418 brm += 10;
00419 }
00420 }
00421 else if (MP_TYPE(x,y) == CST_RESIDENCE_LH)
00422 {
00423 brm += RESIDENCE4_BRM;
00424 drm += p * 5;
00425 if (p > 100)
00426 {
00427 p--;
00428 people_pool++;
00429 brm += 20;
00430 }
00431 }
00432 else if (MP_TYPE(x,y) == CST_RESIDENCE_MH)
00433 {
00434 brm += RESIDENCE5_BRM;
00435 drm += p / 2;
00436 if (p > 200)
00437 {
00438 p--;
00439 people_pool++;
00440 brm += 10;
00441 }
00442 }
00443 else if (MP_TYPE(x,y) == CST_RESIDENCE_HH)
00444 {
00445 good += 100;
00446 brm += RESIDENCE6_BRM;
00447 drm += p;
00448 if (p > 400)
00449 {
00450 p--;
00451 people_pool++;
00452 brm += 10;
00453 }
00454 }
00455
00456 population += p;
00457
00458 /* now get power */
00459 if (get_power (x, y, POWER_RES_OVERHEAD
00460 + (POWER_USE_PER_PERSON * p), 0) != 0)
00461 {
00462 MP_INFO(x,y).flags |= FLAG_POWERED;
00463 MP_INFO(x,y).flags |= FLAG_HAD_POWER;
00464 good += 10;
00465 }
00466 else
00467 {
00468 MP_INFO(x,y).flags &= (0xffffffff - FLAG_POWERED);
00469 bad += 15;
00470 if ((MP_INFO(x,y).flags & FLAG_HAD_POWER) != 0)
00471 bad += 50;
00472 }
00473 /* now get fed */
00474 if (get_food (x, y, p) != 0)
00475 {
00476 MP_INFO(x,y).flags |= FLAG_FED;
00477 good += 10;
00478 }
00479 else
00480 MP_INFO(x,y).flags &= (0xffffffff - FLAG_FED);
00481 /* now supply jobs and buy goods if employed */
00482 if (MP_INFO(x,y).int_1 > 0)
00483 swing = JOB_SWING + (hc * HC_JOB_SWING) + cc;
00484 else
00485 swing = -(JOB_SWING + (hc * HC_JOB_SWING) + cc);
00486 if (put_jobs (x, y, ((p * (WORKING_POP_PERCENT + swing)) / 100)) != 0)
00487 {
00488 MP_INFO(x,y).flags |= FLAG_EMPLOYED;
00489 MP_INFO(x,y).int_1++;
00490 if (MP_INFO(x,y).int_1 > 10)
00491 MP_INFO(x,y).int_1 = 10;
00492 good += 20;
00493 if (get_goods (x, y, p / 4) != 0)
00494 {
00495 good += 10;
00496 if (get_power (x, y, p / 2, 0) != 0) /* goods use power */
00497
00498 {
00499 good += 5;
00500 brm += 10;
00501 /* buy more goods if got power for them */
00502 if (get_goods (x, y, p / 4) != 0)
00503 good += 5;
00504 }
00505 else
00506 bad += 5;
00507 }
00508 }
00509 else if (MP_INFO(x,y).int_1 < 10)
00510 {
00511 MP_INFO(x,y).flags &= (0xffffffff - FLAG_EMPLOYED);
00512 MP_INFO(x,y).int_1 -= 11;
00513 if (MP_INFO(x,y).int_1 < -300)
00514 MP_INFO(x,y).int_1 = -300;
00515 unemployed_population += p;
00516 total_unemployed_days += p;
00517 if (total_unemployed_days >= NUMOF_DAYS_IN_YEAR)
00518 {
00519 total_unemployed_years++;
00520 /* think we're ok doing this, max of about 120 added each time. */
00521 total_unemployed_days -= NUMOF_DAYS_IN_YEAR;
00522 unemployed_history += 1.0;
00523 }
00524 unemployment_cost += p; /* hmmm */
00525
00526 bad += 70;
00527 }
00528 else
00529 {
00530 MP_INFO(x,y).int_1 -= 20;
00531 bad += 50;
00532 }
00533 drm += p / 4;
00534 /* people_pool stuff */
00535 bad += p / 2;
00536 bad += MP_POL(x,y) / 20;
00537 good += people_pool / 27;
00538 r = rand () % ((good + bad) * RESIDENCE_PPM);
00539 if (r < bad)
00540 {
00541 if (p > MIN_RES_POPULATION)
00542 {
00543 p--;
00544 people_pool++;
00545 }
00546 }
00547 else if (people_pool > 0 && r > ((good + bad) * (RESIDENCE_PPM - 1) + bad))
00548 {
00549 p++;
00550 people_pool--;
00551 }
00552 MP_INFO(x,y).population = p;
00553 MP_INFO(x,y).int_4 = brm;
00554 MP_INFO(x,y).int_5 = drm;
00555 }
|
|
||||||||||||
|
Definition at line 57 of file transport.c. 00058 {
00059 static int wb_count = 0;
00060 int *pol = &MP_POL(x,y);
00061 Map_Point_Info *minfo = &MP_INFO(x,y);
00062 ++transport_cost;
00063 if (total_time % DAYS_PER_ROAD_POLLUTION == 0)
00064 *pol += ROAD_POLLUTION;
00065 if ((total_time & ROAD_GOODS_USED_MASK) == 0 && minfo->int_4 > 0) {
00066 --minfo->int_4;
00067 ++minfo->int_7;
00068 }
00069 general_transport (minfo, pol, MAX_WASTE_ON_ROAD, &wb_count);
00070 }
|
|
||||||||||||
|
Definition at line 2444 of file engine.c. 02445 {
02446 /*
02447 // You need ROCKET_PAD_JOBS, ROCKET_PAD_GOODS and ROCKET_PAD_STEEL
02448 // to add 1 to % of ready to fire.
02449 // int_1 is the stored jobs
02450 // int_2 is the stored goods
02451 // int_3 is the stored steel
02452 // int_4 is the count which gets to ROCKET_PAD_LAUNCH to fire.
02453 // int_5 is the time of the next animation frame, when waiting for launch.
02454 */
02455 if (MP_TYPE(x,y) == CST_ROCKET_FLOWN)
02456 return; /* The rocket has been launched. */
02457
02458 /* get some jobs */
02459 if (MP_INFO(x,y).int_1 < ROCKET_PAD_JOBS_STORE)
02460 {
02461 if (get_jobs (x, y, ROCKET_PAD_JOBS + 10) != 0)
02462 MP_INFO(x,y).int_1 += ROCKET_PAD_JOBS;
02463 }
02464 /* get goods */
02465 if (MP_INFO(x,y).int_2 < ROCKET_PAD_GOODS_STORE)
02466 {
02467 if (get_goods (x, y, ROCKET_PAD_GOODS + 10) != 0)
02468 MP_INFO(x,y).int_2 += ROCKET_PAD_GOODS;
02469 else if (get_goods (x, y, ROCKET_PAD_GOODS / 10) != 0)
02470 MP_INFO(x,y).int_2 += ROCKET_PAD_GOODS / 5;
02471 else if (get_goods (x, y, ROCKET_PAD_GOODS / 50) != 0)
02472 MP_INFO(x,y).int_2 += ROCKET_PAD_GOODS / 20;
02473 }
02474 /* get steel */
02475 if (MP_INFO(x,y).int_3 < ROCKET_PAD_STEEL_STORE)
02476 {
02477 if (get_steel (x, y, ROCKET_PAD_STEEL + 10) != 0)
02478 MP_INFO(x,y).int_3 += ROCKET_PAD_STEEL + 10;
02479 else if (get_steel (x, y, ROCKET_PAD_STEEL / 5) != 0)
02480 MP_INFO(x,y).int_3 += ROCKET_PAD_STEEL / 5;
02481 else if (get_steel (x, y, ROCKET_PAD_STEEL / 20) != 0)
02482 MP_INFO(x,y).int_3 += ROCKET_PAD_STEEL / 20;
02483 }
02484 #ifdef DEBUG_ROCKETS
02485 MP_INFO(x,y).int_4++;
02486 #else
02487 /* now build the rocket. Unlike uni's need a full store to make +1% */
02488 if (MP_TYPE(x,y) < CST_ROCKET_5
02489 && MP_INFO(x,y).int_1 >= ROCKET_PAD_JOBS_STORE
02490 && MP_INFO(x,y).int_2 >= ROCKET_PAD_GOODS_STORE
02491 && MP_INFO(x,y).int_3 >= ROCKET_PAD_STEEL_STORE)
02492 {
02493 MP_INFO(x,y).int_1 -= ROCKET_PAD_JOBS_STORE;
02494 MP_INFO(x,y).int_2 -= ROCKET_PAD_GOODS_STORE;
02495 MP_INFO(x,y).int_3 -= ROCKET_PAD_STEEL_STORE;
02496 MP_INFO(x,y).int_4++;
02497 goods_used += ROCKET_PAD_GOODS_STORE;
02498
02499 }
02500 #endif
02501 rocket_pad_cost += ROCKET_PAD_RUNNING_COST;
02502 /* animate and return if already said no to launch */
02503 if (MP_TYPE(x,y) >= CST_ROCKET_5
02504 && MP_INFO(x,y).int_4 >= (100 * ROCKET_PAD_LAUNCH) / 100)
02505 {
02506 if (real_time >= MP_INFO(x,y).int_5)
02507 {
02508 MP_INFO(x,y).int_5 = real_time + ROCKET_ANIMATION_SPEED;
02509 switch (MP_TYPE(x,y))
02510 {
02511 case (CST_ROCKET_5):
02512 MP_TYPE(x,y) = CST_ROCKET_6;
02513 break;
02514 case (CST_ROCKET_6):
02515 MP_TYPE(x,y) = CST_ROCKET_7;
02516 break;
02517 case (CST_ROCKET_7):
02518 MP_TYPE(x,y) = CST_ROCKET_5;
02519 break;
02520 }
02521 }
02522 return;
02523 }
02524 /* now choose a graphic */
02525 if (MP_INFO(x,y).int_4 < (25 * ROCKET_PAD_LAUNCH) / 100)
02526 MP_TYPE(x,y) = CST_ROCKET_1;
02527 else if (MP_INFO(x,y).int_4 < (60 * ROCKET_PAD_LAUNCH) / 100)
02528 MP_TYPE(x,y) = CST_ROCKET_2;
02529 else if (MP_INFO(x,y).int_4 < (90 * ROCKET_PAD_LAUNCH) / 100)
02530 MP_TYPE(x,y) = CST_ROCKET_3;
02531 else if (MP_INFO(x,y).int_4 < (100 * ROCKET_PAD_LAUNCH) / 100)
02532 MP_TYPE(x,y) = CST_ROCKET_4;
02533 else if (MP_INFO(x,y).int_4 >= (100 * ROCKET_PAD_LAUNCH) / 100) {
02534 MP_TYPE(x,y) = CST_ROCKET_5;
02535 update_main_screen (0);
02536 if (ask_launch_rocket_now (x,y)) {
02537 launch_rocket (x,y);
02538 }
02539 /* so we don't get get our money back when we bulldoze. */
02540 if (x == last_built_x && y == last_built_y) {
02541 x = 0;
02542 y = 0;
02543 }
02544 }
02545 }
|
|
|
Definition at line 280 of file ldsvgui.c. 00281 {
00282 Rect* mw = &scr.main_win;
00283 char s[200], c;
00284 hide_mouse ();
00285 Fgl_fillbox (mw->x, mw->y, mw->w, mw->h
00286 ,SAVE_BG_COLOUR);
00287 Fgl_setfontcolors (SAVE_BG_COLOUR, TEXT_FG_COLOUR);
00288 Fgl_write (mw->x + 100, mw->y + 15, _("Save a scene"));
00289 Fgl_write (mw->x + 8, mw->y + 35
00290 ,_("Choose the number of the scene you want to save"));
00291 Fgl_write (mw->x + 110, mw->y + 210
00292 ,_("Press space to cancel."));
00293 draw_save_dir (SAVE_BG_COLOUR);
00294 db_flag = 1;
00295 #ifdef LC_X11
00296 redraw_mouse ();
00297 cs_mouse_handler (0, -1, 0);
00298 cs_mouse_handler (0, 1, 0);
00299 do
00300 {
00301 call_event ();
00302 c = x_key_value;
00303 }
00304 while (c == 0);
00305 x_key_value = 0;
00306 #elif defined (WIN32)
00307 while (0 == (c = GetKeystroke ())); /* Wait for keystroke */
00308 redraw_mouse ();
00309 #else
00310 c = getchar ();
00311 redraw_mouse ();
00312 #endif
00313 if (c > '0' && c <= '9')
00314 {
00315 Fgl_write (mw->x + 40, mw->y + 300
00316 ,_("Type comment for the saved scene"));
00317 Fgl_write (mw->x + 16, mw->y + 310
00318 ,_("The comment may be up to 40 characters"));
00319 Fgl_write (mw->x + 40, mw->y + 320
00320 ,_("and may contain spaces or % . - + ,"));
00321 strcpy (s, &(save_names[c - '0'][2]));
00322 input_save_filename (s);
00323 remove_scene (save_names[c - '0']);
00324 sprintf (save_names[c - '0'], "%d_", c - '0');
00325 strcat (save_names[c - '0'], s);
00326 Fgl_fillbox (mw->x + 5, mw->y + 300
00327 ,360, 30, SAVE_BG_COLOUR);
00328 Fgl_write (mw->x + 70, mw->y + 310
00329 ,_("Saving city scene... please wait"));
00330 save_city (save_names[c - '0']);
00331 }
00332 db_flag = 0;
00333 cs_mouse_handler (0, -1, 0);
00334 cs_mouse_handler (0, 1, 0);
00335 hide_mouse ();
00336 Fgl_setfontcolors (TEXT_BG_COLOUR, TEXT_FG_COLOUR);
00337 save_flag = 0;
00338 refresh_main_screen ();
00339 redraw_mouse ();
00340 }
|
|
||||||||||||
|
Definition at line 2695 of file engine.c. 02696 {
02697 /*
02698 // int_1 contains the job pool
02699 // int_2 contains the goods at the school
02700 // int_3 has the tech points made
02701 // int_4 is the tech count so far this 100 days
02702 // int_5 is the tech count last 100 days to give a % of max production
02703 */
02704 if (MP_INFO(x,y).int_1 < (MAX_JOBS_AT_SCHOOL - SCHOOL_JOBS))
02705 if (get_jobs (x, y, SCHOOL_JOBS) != 0)
02706 MP_INFO(x,y).int_1 += SCHOOL_JOBS;
02707 if (MP_INFO(x,y).int_2 < (MAX_GOODS_AT_SCHOOL - SCHOOL_GOODS))
02708 if (get_goods (x, y, SCHOOL_GOODS) != 0)
02709 MP_INFO(x,y).int_2 += SCHOOL_GOODS;
02710 if (MP_INFO(x,y).int_1 >= JOBS_MAKE_TECH_SCHOOL
02711 && MP_INFO(x,y).int_2 >= GOODS_MAKE_TECH_SCHOOL)
02712 {
02713 MP_INFO(x,y).int_1 -= JOBS_MAKE_TECH_SCHOOL;
02714 MP_INFO(x,y).int_2 -= GOODS_MAKE_TECH_SCHOOL;
02715 MP_INFO(x,y).int_3 += TECH_MADE_BY_SCHOOL;
02716 MP_INFO(x,y).int_4++;
02717 tech_level += TECH_MADE_BY_SCHOOL;
02718 }
02719 school_cost += SCHOOL_RUNNING_COST;
02720 if ((total_time % 100) == 0)
02721 {
02722 MP_INFO(x,y).int_5 = MP_INFO(x,y).int_4;
02723 MP_INFO(x,y).int_4 = 0;
02724 }
02725 }
|
|
||||||||||||
|
Definition at line 3603 of file engine.c. 03604 { /* just steal some stuff and make pollution. */
03605
03606 get_food (x, y, SHANTY_GET_FOOD);
03607 if (get_goods (x, y, SHANTY_GET_GOODS) != 0)
03608 if ((goods_tax -= SHANTY_GET_GOODS * 2) < 0)
03609 goods_tax = 0;
03610 get_ore (x, y, SHANTY_GET_ORE);
03611 get_steel (x, y, SHANTY_GET_STEEL);
03612 if (get_jobs (x, y, SHANTY_GET_JOBS) != 0)
03613 if ((income_tax -= SHANTY_GET_JOBS * 2) < 0)
03614 income_tax = 0;
03615 if (get_coal (x, y, SHANTY_GET_COAL) != 0)
03616 if ((coal_tax -= SHANTY_GET_COAL * 2) < 0)
03617 coal_tax = 0;
03618 if ((total_time & 1) == 0)
03619 MP_POL(x,y)++;
03620 else
03621 MP_POL(x+1,y+1)++;
03622 }
|
|
||||||||||||
|
Definition at line 3625 of file engine.c. 03626 {
03627 /*
03628 // int_1 is the amount of waste on the site.
03629 // int_2 if the amount that has flowed in so far this month
03630 // int_3 is the amount stored last month.
03631 // int_4 counts up starting when tip fills, controlling how
03632 long until the land is useful again.
03633 */
03634 int i;
03635
03636 /* XXX: put this in a header somewhere */
03637
03638 /* If the tip is full, age it until it degrades into useful soil */
03639
03640 if (MP_TYPE(x,y) == CST_TIP_8) {
03641 MP_INFO(x,y).int_4++;
03642 if (MP_INFO(x,y).int_4 >= TIP_DEGRADE_TIME) {
03643 do_bulldoze_area(CST_GREEN,x,y);
03644 }
03645 return;
03646 }
03647
03648 /* just grab as much as we can from transport */
03649 if (x > 0 && (MP_INFO(x - 1,y).flags & FLAG_IS_TRANSPORT) != 0)
03650 {
03651 i = MP_INFO(x - 1,y).int_7 / 10;
03652 MP_INFO(x,y).int_1 += i;
03653 MP_INFO(x,y).int_2 += i;
03654 MP_INFO(x - 1,y).int_7 -= i * 10;
03655 sust_dig_ore_coal_tip_flag = 0;
03656 }
03657 if (y > 0 && (MP_INFO(x,y - 1).flags & FLAG_IS_TRANSPORT) != 0)
03658 {
03659 i = MP_INFO(x,y - 1).int_7 / 10;
03660 MP_INFO(x,y).int_1 += i;
03661 MP_INFO(x,y).int_2 += i;
03662 MP_INFO(x,y - 1).int_7 -= i * 10;
03663 sust_dig_ore_coal_tip_flag = 0;
03664 }
03665
03666 #if defined (commentout)
03667 /* Increment the "ore" reserve; this prevents a new tip from being
03668 built on top of a degraded one. */
03669 MP_INFO(x,y).ore_reserve++;
03670 #endif
03671
03672 /* now choose an icon. */
03673 if ((total_time % NUMOF_DAYS_IN_MONTH) == 0)
03674 {
03675 i = (MP_INFO(x,y).int_1 * 7) / MAX_WASTE_AT_TIP;
03676 if (MP_INFO(x,y).int_1 > 0)
03677 i++;
03678 switch (i)
03679 {
03680 case (0):
03681 MP_TYPE(x,y) = CST_TIP_0;
03682 break;
03683 case (1):
03684 MP_TYPE(x,y) = CST_TIP_1;
03685 break;
03686 case (2):
03687 MP_TYPE(x,y) = CST_TIP_2;
03688 break;
03689 case (3):
03690 MP_TYPE(x,y) = CST_TIP_3;
03691 break;
03692 case (4):
03693 MP_TYPE(x,y) = CST_TIP_4;
03694 break;
03695 case (5):
03696 MP_TYPE(x,y) = CST_TIP_5;
03697 break;
03698 case (6):
03699 MP_TYPE(x,y) = CST_TIP_6;
03700 break;
03701 case (7):
03702 MP_TYPE(x,y) = CST_TIP_7;
03703 break;
03704 case (8):
03705 MP_TYPE(x,y) = CST_TIP_8;
03706 MP_INFO(x,y).int_2 = 0;
03707 MP_INFO(x,y).int_4 = 0;
03708 break;
03709
03710 }
03711 MP_INFO(x,y).int_3 = MP_INFO(x,y).int_2;
03712 MP_INFO(x,y).int_2 = 0;
03713 }
03714 }
|
|
||||||||||||
|
Definition at line 29 of file transport.c. 00030 {
00031 static int wb_count = 0;
00032 general_transport (&MP_INFO(x,y), &MP_POL(x,y),
00033 MAX_WASTE_ON_TRACK, &wb_count);
00034 }
|
|
||||||||||||
|
Definition at line 2222 of file engine.c. 02223 {
02224 /*
02225 // You need UNIVERSITY_JOBS and UNIVERSITY_GOODS to add 1 to tech_level
02226 // int_1 is the stored jobs
02227 // int_2 is the stored goods
02228 // int_3 is the total tech points made by this uni.
02229 // int_4 is the count so far in this 100 days
02230 // int_5 is the count in the last 100 days to give a percent value
02231 // get some jobs
02232 */
02233 if (MP_INFO(x,y).int_1 < UNIVERSITY_JOBS_STORE)
02234 {
02235 if (get_jobs (x, y, UNIVERSITY_JOBS + 10) != 0)
02236 MP_INFO(x,y).int_1 += UNIVERSITY_JOBS + 10;
02237 }
02238 /* get goods */
02239 if (MP_INFO(x,y).int_2 < UNIVERSITY_GOODS_STORE)
02240 {
02241 if (get_goods (x, y, UNIVERSITY_GOODS + 10) != 0)
02242 MP_INFO(x,y).int_2 += UNIVERSITY_GOODS + 10;
02243 else if (get_goods (x, y, UNIVERSITY_GOODS / 5) != 0)
02244 MP_INFO(x,y).int_2 += UNIVERSITY_GOODS / 5;
02245 else if (get_goods (x, y, UNIVERSITY_GOODS / 20) != 0)
02246 MP_INFO(x,y).int_2 += UNIVERSITY_GOODS / 20;
02247 }
02248 /* now do some research */
02249 if (MP_INFO(x,y).int_1 >= UNIVERSITY_JOBS
02250 && MP_INFO(x,y).int_2 >= UNIVERSITY_GOODS)
02251 {
02252 MP_INFO(x,y).int_1 -= UNIVERSITY_JOBS;
02253 MP_INFO(x,y).int_2 -= UNIVERSITY_GOODS;
02254 goods_used += UNIVERSITY_GOODS;
02255 if (university_intake_rate >= (total_time % 100))
02256 {
02257 MP_INFO(x,y).int_3 += UNIVERSITY_TECH_MADE;
02258 tech_level += UNIVERSITY_TECH_MADE;
02259 MP_INFO(x,y).int_4++;
02260 }
02261 }
02262 if (total_time % 100 == 0)
02263 {
02264 MP_INFO(x,y).int_5 = MP_INFO(x,y).int_4;
02265 MP_INFO(x,y).int_4 = 0;
02266 }
02267 university_cost += UNIVERSITY_RUNNING_COST;
02268 }
|
|
||||||||||||
|
Definition at line 452 of file power.c. 00453 {
00454 int anim_tile;
00455
00456 if (get_jobs (x, y, WINDMILL_JOBS) != 0) {
00457 MP_INFO(x,y).int_5 = MP_INFO(x,y).int_1;
00458 grid[MP_INFO(x,y).int_6]->avail_power += MP_INFO(x,y).int_1;
00459 } else {
00460 MP_INFO(x,y).int_4 = real_time + MODERN_WINDMILL_ANIM_SPEED;
00461 return;
00462 }
00463
00464 /* update animation */
00465 if (real_time > MP_INFO(x,y).int_4) {
00466 MP_INFO(x,y).int_3++;
00467 if (MP_INFO(x,y).int_2 < MODERN_WINDMILL_TECH) {
00468 MP_INFO(x,y).int_4 = real_time + ANTIQUE_WINDMILL_ANIM_SPEED;
00469 } else {
00470 MP_INFO(x,y).int_4 = real_time + MODERN_WINDMILL_ANIM_SPEED;
00471 }
00472 }
00473
00474 /* figure out which tile to use */
00475 anim_tile = (MP_INFO(x,y).int_3 % 3);
00476
00477 if (MP_INFO(x,y).int_2 < MODERN_WINDMILL_TECH)
00478 MP_TYPE(x,y) = CST_WINDMILL_1_W + anim_tile;
00479 else
00480 switch(grid[MP_INFO(x,y).int_6]->powered)
00481 {
00482 case -1:
00483 MP_TYPE(x,y) = CST_WINDMILL_1_R + anim_tile;
00484 break;
00485 case 0 :
00486 MP_TYPE(x,y) = CST_WINDMILL_1_RG + anim_tile;
00487 break;
00488 case 1 :
00489 MP_TYPE(x,y) = CST_WINDMILL_1_G + anim_tile;
00490 break;
00491 default :
00492 printf("Default case in do_power_substation\n");
00493 break;
00494 }
00495 }
|
|
|
Definition at line 1074 of file screen.c. 01075 {
01076 Rect* b = &scr.main_win;
01077 int x, y, xx, yy;
01078 for (y = 0; y < WORLD_SIDE_LEN; y++) {
01079 for (x = 0; x < WORLD_SIDE_LEN; x++) {
01080 if (MP_TYPE(x,y) == CST_USED) {
01081 xx = MP_INFO(x,y).int_1;
01082 yy = MP_INFO(x,y).int_2;
01083 Fgl_fillbox (b->x + x * 4, b->y + y * 4, 4, 4
01084 ,main_groups[MP_GROUP(xx,yy)].colour);
01085 } else {
01086 Fgl_fillbox (b->x + x * 4, b->y + y * 4, 4, 4
01087 ,main_groups[MP_GROUP(x,y)].colour);
01088 }
01089 }
01090 }
01091 }
|
|
||||||||||||||||||||
|
|
|
|
Definition at line 738 of file screen.c. 00739 {
00740 Rect* b = &scr.main_win;
00741 int x;
00742 for (x = 0; x < 8; x++)
00743 {
00744 Fgl_hline (b->x - 1 - x, b->y - 1 - x,
00745 b->x + b->w + x, colour + x + x);
00746 Fgl_hline (b->x - 1 - x, b->y + b->h + x,
00747 b->x + b->w + x, colour + x + x);
00748 Fgl_line (b->x - 1 - x, b->y - x, b->x - 1 - x,
00749 b->y + b->h + x, colour + x + x);
00750 Fgl_line (b->x + b->w + x, b->y - x,
00751 b->x + b->w + x, b->y + b->h + x,
00752 colour + x + x);
00753 }
00754 }
|
|
|
Definition at line 2186 of file screen.c. 02187 {
02188 market_cb_drawn_flag = 1;
02189 draw_cb_template (1);
02190 }
|
|
|
Definition at line 1039 of file screen.c. 01040 {
01041 int x, y, xx, yy;
01042 Rect* mm = &scr.mini_map;
01043
01044 mini_screen_flags = MINI_SCREEN_NORMAL_FLAG;
01045 draw_ms_button (ms_normal_button_graphic);
01046 draw_ms_text (_("Land Use "));
01047 for (y = 0; y < WORLD_SIDE_LEN; y++) {
01048 for (x = 0; x < WORLD_SIDE_LEN; x++) {
01049 if (MP_TYPE(x,y) == CST_USED) {
01050 xx = MP_INFO(x,y).int_1;
01051 yy = MP_INFO(x,y).int_2;
01052
01053 /* WCK: I think this is what is blowing up */
01054 if ((xx < 0 || xx > WORLD_SIDE_LEN) ||
01055 (yy < 0 || yy > WORLD_SIDE_LEN)) {
01056 printf("Argh! mini_screen out of range on CST_USED!\n");
01057 printf("xx=%d,yy=%d. Continuing\n",xx,yy);
01058 }
01059
01060 Fgl_setpixel (mm->x + x, mm->y + y, main_groups[MP_GROUP(xx,yy)].colour);
01061 } else {
01062 Fgl_setpixel (mm->x + x, mm->y + y, main_groups[MP_GROUP(x,y)].colour);
01063 }
01064 }
01065 }
01066 draw_mini_screen_cursor ();
01067
01068 #if defined (WIN32)
01069 RefreshArea (mm->x, mm->y, mm->x + x, mm->y + y);
01070 #endif
01071 }
|
|
|
Definition at line 1294 of file screen.c. 01295 {
01296 int x, y, col;
01297 Rect* mm = &scr.mini_map;
01298
01299 mini_screen_flags = MINI_SCREEN_COAL_FLAG;
01300 draw_ms_text (_("Coal Reserve"));
01301 draw_ms_button (ms_coal_button_graphic);
01302 if (coal_survey_done) {
01303 for (y = 0; y < WORLD_SIDE_LEN; y++) {
01304 for (x = 0; x < WORLD_SIDE_LEN; x++) {
01305 if (MP_INFO(x,y).coal_reserve == 0)
01306 col = white (4);
01307 else if (MP_INFO(x,y).coal_reserve >= COAL_RESERVE_SIZE / 2)
01308 col = white (18);
01309 else if (MP_INFO(x,y).coal_reserve < COAL_RESERVE_SIZE / 2)
01310 col = white (28);
01311 Fgl_setpixel (mm->x + x, mm->y + y, col);
01312 }
01313 }
01314 draw_mini_screen_cursor ();
01315 } else {
01316 Fgl_setfontcolors (white(4), white(28));
01317 Fgl_fillbox (mm->x, mm->y, WORLD_SIDE_LEN, WORLD_SIDE_LEN, white(4));
01318 Fgl_write (mm->x + 4, mm->y + 20, _("Click here"));
01319 Fgl_write (mm->x + 4, mm->y + 32, _(" to do "));
01320 Fgl_write (mm->x + 4, mm->y + 44, _("coal survey"));
01321 Fgl_setfontcolors (TEXT_BG_COLOUR, TEXT_FG_COLOUR);
01322 }
01323 #if defined (WIN32)
01324 RefreshArea (mm->x, mm->y, mm->x + x, mm->y + y);
01325 #endif
01326 }
|
|
|
Definition at line 1163 of file screen.c. 01164 {
01165 int x, y, xx, yy, col;
01166 Rect* mm = &scr.mini_map;
01167
01168 mini_screen_flags = MINI_SCREEN_CRICKET_COVER;
01169 draw_ms_text (_("Crickt cover"));
01170 draw_ms_button (ms_cricket_cover_button_graphic);
01171 for (y = 0; y < WORLD_SIDE_LEN; y++) {
01172 for (x = 0; x < WORLD_SIDE_LEN; x++) {
01173 if (MP_TYPE(x,y) == CST_USED)
01174 {
01175 xx = MP_INFO(x,y).int_1;
01176 yy = MP_INFO(x,y).int_2;
01177 if ((MP_INFO(xx,yy).flags & FLAG_CRICKET_COVER) == 0)
01178 col = main_groups[MP_GROUP(xx,yy)].colour;
01179 else
01180 col = green (10);
01181 }
01182 else
01183 {
01184 if ((MP_INFO(x,y).flags & FLAG_CRICKET_COVER) == 0)
01185 col = main_groups[MP_GROUP(x,y)].colour;
01186 else
01187 col = green (10);
01188 }
01189 Fgl_setpixel (mm->x + x, mm->y + y, col);
01190 }
01191 }
01192 draw_mini_screen_cursor ();
01193 #if defined (WIN32)
01194 RefreshArea (mm->x, mm->y, mm->x + x, mm->y + y);
01195 #endif
01196 }
|
|
|
Definition at line 1547 of file screen.c. 01548 {
01549 Rect* mini = &scr.mini_map;
01550 Rect* mw = &scr.main_win;
01551 Fgl_hline (mini->x + main_screen_originx
01552 ,mini->y + main_screen_originy
01553 ,mini->x + main_screen_originx + mw->w / 16 - 1
01554 ,255);
01555 Fgl_hline (mini->x + main_screen_originx
01556 ,mini->y + main_screen_originy + mw->h / 16 - 1
01557 ,mini->x + main_screen_originx + mw->w / 16 - 1
01558 ,255);
01559 Fgl_line (mini->x + main_screen_originx
01560 ,mini->y + main_screen_originy
01561 ,mini->x + main_screen_originx
01562 ,mini->y + main_screen_originy + mw->h / 16 - 1
01563 ,255);
01564 Fgl_line (mini->x + main_screen_originx + mw->w / 16 - 1
01565 ,mini->y + main_screen_originy
01566 ,mini->x + main_screen_originx + mw->w / 16 - 1
01567 ,mini->y + main_screen_originy + mw->h / 16 - 1
01568 ,255);
01569
01570 }
|
|
|
Definition at line 1125 of file screen.c. 01126 {
01127 int x, y, xx, yy, col;
01128 Rect* mm = &scr.mini_map;
01129
01130 /* GCS: This sort of works. Might be better to return to "normal"
01131 when user clicks on mini-screen, or else draw outline box. */
01132 mini_screen_flags = MINI_SCREEN_FIRE_COVER;
01133 draw_ms_text (_("Fire cover "));
01134 draw_ms_button (ms_fire_cover_button_graphic);
01135 for (y = 0; y < WORLD_SIDE_LEN; y++) {
01136 for (x = 0; x < WORLD_SIDE_LEN; x++) {
01137 if (MP_TYPE(x,y) == CST_USED)
01138 {
01139 xx = MP_INFO(x,y).int_1;
01140 yy = MP_INFO(x,y).int_2;
01141 if ((MP_INFO(xx,yy).flags & FLAG_FIRE_COVER) == 0)
01142 col = main_groups[MP_GROUP(xx,yy)].colour;
01143 else
01144 col = green (10);
01145 }
01146 else
01147 {
01148 if ((MP_INFO(x,y).flags & FLAG_FIRE_COVER) == 0)
01149 col = main_groups[MP_GROUP(x,y)].colour;
01150 else
01151 col = green (10);
01152 }
01153 Fgl_setpixel (mm->x + x, mm->y + y, col);
01154 }
01155 }
01156 draw_mini_screen_cursor ();
01157 #if defined (WIN32)
01158 RefreshArea (mm->x, mm->y, mm->x + x, mm->y + y);
01159 #endif
01160 }
|
|
|
Definition at line 1199 of file screen.c. 01200 {
01201 int x, y, xx, yy, col;
01202 Rect* mm = &scr.mini_map;
01203
01204 mini_screen_flags = MINI_SCREEN_HEALTH_COVER;
01205 draw_ms_text (_("Health cover"));
01206 draw_ms_button (ms_health_cover_button_graphic);
01207 for (y = 0; y < WORLD_SIDE_LEN; y++) {
01208 for (x = 0; x < WORLD_SIDE_LEN; x++) {
01209 if (MP_TYPE(x,y) == CST_USED)
01210 {
01211 xx = MP_INFO(x,y).int_1;
01212 yy = MP_INFO(x,y).int_2;
01213 if ((MP_INFO(xx,yy).flags & FLAG_HEALTH_COVER) == 0)
01214 col = main_groups[MP_GROUP(xx,yy)].colour;
01215 else
01216 col = green (10);
01217 }
01218 else
01219 {
01220 if ((MP_INFO(x,y).flags & FLAG_HEALTH_COVER) == 0)
01221 col = main_groups[MP_GROUP(x,y)].colour;
01222 else
01223 col = green (10);
01224 }
01225 Fgl_setpixel (mm->x + x, mm->y + y, col);
01226 }
01227 }
01228 draw_mini_screen_cursor ();
01229 #if defined (WIN32)
01230 RefreshArea (mm->x, mm->y, mm->x + x, mm->y + y);
01231 #endif
01232 }
|
|
|
Definition at line 1373 of file screen.c. 01374 {
01375 char s[100];
01376 Rect* b = &scr.mini_map;
01377 mini_screen_flags = MINI_SCREEN_NORMAL_FLAG;
01378 draw_ms_text ("Other Costs");
01379 draw_ms_button (ms_ocost_button_graphic);
01380 Fgl_fillbox (b->x, b->y,
01381 WORLD_SIDE_LEN, WORLD_SIDE_LEN, green (12));
01382 Fgl_setfontcolors (green (12), TEXT_FG_COLOUR);
01383 sprintf (s, "OC yr %04d", (total_time / NUMOF_DAYS_IN_YEAR) - 1);
01384 Fgl_write (b->x + 10, b->y + 2, s);
01385
01386 if (ly_interest > 19999)
01387 {
01388 sprintf (s, "Int %4dK", ly_interest / 1000);
01389 }
01390 else
01391 sprintf (s, "Int %5d", ly_interest);
01392 Fgl_write (b->x + 10, b->y + 16, s);
01393
01394 if (ly_school_cost > 19999)
01395 {
01396 if (ly_school_cost > 1999999)
01397 sprintf (s, "Scl %4dM", ly_school_cost / 1000000);
01398 else
01399 sprintf (s, "Scl %4dK", ly_school_cost / 1000);
01400 }
01401 else
01402 sprintf (s, "Scl %5d", ly_school_cost);
01403 Fgl_write (b->x + 10, b->y + 24, s);
01404
01405 if (ly_university_cost > 19999)
01406 {
01407 if (ly_university_cost > 1999999)
01408 sprintf (s, "Uni %4dM", ly_university_cost / 1000000);
01409 else
01410 sprintf (s, "Uni %4dK", ly_university_cost / 1000);
01411 }
01412 else
01413 sprintf (s, "Uni %5d", ly_university_cost);
01414 Fgl_write (b->x + 10, b->y + 32, s);
01415
01416 if (ly_deaths_cost > 19999)
01417 {
01418 if (ly_deaths_cost > 1999999)
01419 sprintf (s, "UnD %4dM", ly_deaths_cost / 1000000);
01420 else
01421 sprintf (s, "UnD %4dK", ly_deaths_cost / 1000);
01422 }
01423 else
01424 sprintf (s, "UnD %5d", ly_deaths_cost);
01425 Fgl_write (b->x + 10, b->y + 40, s);
01426
01427 if (ly_windmill_cost > 19999)
01428 {
01429 if (ly_windmill_cost > 1999999)
01430 sprintf (s, "WiM %4dM", ly_windmill_cost / 1000000);
01431 else
01432 sprintf (s, "WiM %4dK", ly_windmill_cost / 1000);
01433 }
01434 else
01435 sprintf (s, "WiM %5d", ly_windmill_cost);
01436 Fgl_write (b->x + 10, b->y + 48, s);
01437
01438 if (ly_recycle_cost > 19999)
01439 {
01440 if (ly_recycle_cost > 1999999)
01441 sprintf (s, "Rcy %4dM", ly_recycle_cost / 1000000);
01442 else
01443 sprintf (s, "Rcy %4dK", ly_recycle_cost / 1000);
01444 }
01445 else
01446 sprintf (s, "Rcy %5d", ly_recycle_cost);
01447 Fgl_write (b->x + 10, b->y + 56, s);
01448
01449 if (ly_health_cost > 19999)
01450 {
01451 if (ly_health_cost > 1999999)
01452 sprintf (s, "Hth %4dM", ly_health_cost / 1000000);
01453 else
01454 sprintf (s, "Hth %4dK", ly_health_cost / 1000);
01455 }
01456 else
01457 sprintf (s, "Hth %5d", ly_health_cost);
01458 Fgl_write (b->x + 10, b->y + 64, s);
01459
01460 if (ly_rocket_pad_cost > 19999)
01461 {
01462 if (ly_rocket_pad_cost > 1999999)
01463 sprintf (s, "Rok %4dM", ly_rocket_pad_cost / 1000000);
01464 else
01465 sprintf (s, "Rok %4dK", ly_rocket_pad_cost / 1000);
01466 }
01467 else
01468 sprintf (s, "Rok %5d", ly_rocket_pad_cost);
01469 Fgl_write (b->x + 10, b->y + 72, s);
01470
01471 if (ly_fire_cost > 19999)
01472 {
01473 if (ly_fire_cost > 1999999)
01474 sprintf (s, "Fst %4dM", ly_fire_cost / 1000000);
01475 else
01476 sprintf (s, "Fst %4dK", ly_fire_cost / 1000);
01477 }
01478 else
01479 sprintf (s, "Fst %5d", ly_fire_cost);
01480 Fgl_write (b->x + 10, b->y + 80, s);
01481
01482 if (ly_cricket_cost > 19999)
01483 {
01484 if (ly_cricket_cost > 1999999)
01485 sprintf (s, "Ckt %4dM", ly_cricket_cost / 1000000);
01486 else
01487 sprintf (s, "Ckt %4dK", ly_cricket_cost / 1000);
01488 }
01489 else
01490 sprintf (s, "Ckt %5d", ly_cricket_cost);
01491 Fgl_write (b->x + 10, b->y + 88, s);
01492
01493 Fgl_setfontcolors (TEXT_BG_COLOUR, TEXT_FG_COLOUR);
01494 }
|
|
|
Definition at line 1095 of file screen.c. 01096 {
01097 int x, y, col;
01098 Rect* mm = &scr.mini_map;
01099
01100 mini_screen_flags = MINI_SCREEN_POL_FLAG;
01101 draw_ms_text (_("Pollution "));
01102 draw_ms_button (ms_pollution_button_graphic);
01103 for (y = 0; y < WORLD_SIDE_LEN; y++) {
01104 for (x = 0; x < WORLD_SIDE_LEN; x++) {
01105 if (MP_POL(x,y) < 4) {
01106 col = green (24);
01107 } else if (MP_POL(x,y) < 600) {
01108 col = green (23 - (MP_POL(x,y) / 45));
01109 } else {
01110 col = (int) sqrt ((float) (MP_POL(x,y) - 600)) / 9;
01111 if (col > 20)
01112 col = 20;
01113 col += red (11);
01114 }
01115 Fgl_setpixel (mm->x + x, mm->y + y, col);
01116 }
01117 }
01118 draw_mini_screen_cursor ();
01119 #if defined (WIN32)
01120 RefreshArea (mm->x, mm->y, mm->x + x, mm->y + y);
01121 #endif
01122 }
|
|
|
|
|
|
Definition at line 1329 of file screen.c. 01330 {
01331 int x, y, xx, yy, col;
01332 int have_power = 0;
01333 Rect* mm = &scr.mini_map;
01334
01335 mini_screen_flags = MINI_SCREEN_POWER_FLAG;
01336 draw_ms_button (ms_power_button_graphic);
01337 for (y = 0; y < WORLD_SIDE_LEN; y++) {
01338 for (x = 0; x < WORLD_SIDE_LEN; x++) {
01339 short grp = MP_GROUP(x,y);
01340 if (grp == GROUP_USED) {
01341 xx = MP_INFO(x,y).int_1;
01342 yy = MP_INFO(x,y).int_2;
01343 grp = MP_GROUP(xx,yy);
01344 } else {
01345 xx = x;
01346 yy = y;
01347 }
01348 if (get_power (xx, yy, 1, 1) != 0) {
01349 have_power = 1;
01350 col = green (14);
01351 } else if (get_power (xx, yy, 1, 0) != 0) {
01352 have_power = 1;
01353 col = green (10);
01354 } else {
01355 col = main_groups[grp].colour;
01356 }
01357 Fgl_setpixel (mm->x + x, mm->y + y, col);
01358 }
01359 }
01360 if (have_power) {
01361 draw_ms_text (_("Power "));
01362 } else {
01363 draw_ms_text (_("Power (none)"));
01364 }
01365 draw_mini_screen_cursor ();
01366 #if defined (WIN32)
01367 RefreshArea (mm->x, mm->y, mm->x + x, mm->y + y);
01368 #endif
01369 }
|
|
|
Definition at line 1264 of file screen.c. 01265 {
01266 int x, y, col;
01267 Rect* mm = &scr.mini_map;
01268
01269 mini_screen_flags = MINI_SCREEN_STARVE_FLAG;
01270 draw_ms_text (_("Starvation "));
01271 draw_ms_button (ms_starve_button_graphic);
01272 Fgl_fillbox (mm->x, mm->y,
01273 WORLD_SIDE_LEN, WORLD_SIDE_LEN, green (14));
01274 for (y = 0; y < WORLD_SIDE_LEN; y++) {
01275 for (x = 0; x < WORLD_SIDE_LEN; x++) {
01276 if (MP_GROUP_IS_RESIDENCE(x,y)) {
01277 if ((total_time - MP_INFO(x,y).int_2) < 20)
01278 col = red (28);
01279 else if ((total_time - MP_INFO(x,y).int_2) < 100)
01280 col = red (14);
01281 else
01282 col = green (20);
01283 Fgl_fillbox (mm->x + x, mm->y + y, 3, 3, col);
01284 }
01285 }
01286 }
01287 draw_mini_screen_cursor ();
01288 #if defined (WIN32)
01289 RefreshArea (mm->x, mm->y, mm->x + x, mm->y + y);
01290 #endif
01291 }
|
|
|
Definition at line 1235 of file screen.c. 01236 {
01237 int x, y, col;
01238 Rect* mm = &scr.mini_map;
01239
01240 mini_screen_flags = MINI_SCREEN_UB40_FLAG;
01241 draw_ms_text (_("Unemployment"));
01242 draw_ms_button (ms_ub40_button_graphic);
01243 Fgl_fillbox (mm->x, mm->y, WORLD_SIDE_LEN, WORLD_SIDE_LEN, green (14));
01244 for (y = 0; y < WORLD_SIDE_LEN; y++) {
01245 for (x = 0; x < WORLD_SIDE_LEN; x++) {
01246 if (MP_GROUP_IS_RESIDENCE(x,y)) {
01247 if (MP_INFO(x,y).int_1 < -20)
01248 col = red (28);
01249 else if (MP_INFO(x,y).int_1 < 10)
01250 col = red (14);
01251 else
01252 col = green (20);
01253 Fgl_fillbox (mm->x + x, mm->y + y, 3, 3, col);
01254 }
01255 }
01256 }
01257 draw_mini_screen_cursor ();
01258 #if defined (WIN32)
01259 RefreshArea (mm->x, mm->y, mm->x + x, mm->y + y);
01260 #endif
01261 }
|
|
|
Definition at line 2217 of file screen.c. 02218 {
02219 port_cb_drawn_flag = 1;
02220 draw_cb_template (0);
02221 }
|
|
|
Definition at line 447 of file ldsvgui.c. 00448 {
00449 Rect* mw = &scr.main_win;
00450 char *s, s2[200];
00451 int i, j, l;
00452 #if defined (WIN32)
00453 char filespec[4];
00454 #if defined(_MSC_VER)
00455 struct _finddata_t fileinfo;
00456 #elif defined (__BORLANDC__)
00457 struct ffblk fileinfo;
00458 #endif
00459 long fh;
00460 #else
00461 struct dirent *ep;
00462 DIR *dp;
00463 #endif
00464 if ((s = (char *) malloc (lc_save_dir_len + strlen (LC_SAVE_DIR) + 64)) == 0)
00465 malloc_failure ();
00466 strcpy (s, lc_save_dir);
00467 if (!directory_exists (s))
00468 {
00469 printf (_("Couldn't find the save directory %s\n"), s);
00470 free (s);
00471 return;
00472 }
00473 /* GCS FIX: Technically speaking, there is a race condition here. */
00474 #if defined (WIN32)
00475 _chdir (s);
00476 #else
00477 dp = opendir (s);
00478 #endif
00479 for (i = 1; i < 10; i++)
00480 {
00481 save_names[i][0] = 0;
00482 #if defined (WIN32)
00483 sprintf (filespec, "%d_*", i);
00484 #if defined (_MSC_VER)
00485 fh = _findfirst (filespec, &fileinfo);
00486 #elif defined (__BORLANDC__)
00487 fh = findfirst (filespec, &fileinfo, FA_ARCH);
00488 #endif
00489 if (fh != -1)
00490 {
00491 #else
00492 while ((ep = readdir (dp))) /* extra brackets to stop warning */
00493
00494 {
00495 if (*(ep->d_name) == (i + '0')
00496 && *((ep->d_name) + 1) == '_')
00497 {
00498 #endif
00499 sprintf (s2, "%2d ", i);
00500 #if defined (WIN32)
00501 #if defined (_MSC_VER)
00502 strncpy (save_names[i], fileinfo.name, 40);
00503 #elif defined (__BORLANDC__)
00504 strncpy (save_names[i], fileinfo.ff_name, 40);
00505 #endif
00506 #else /* UNIX */
00507 strncpy (save_names[i], ep->d_name, 40);
00508 #endif
00509 if (strlen (save_names[i]) > 2)
00510 strncat (s2, &(save_names[i][2]), 40);
00511 else
00512 strcat (s2, "???");
00513 #if defined (WIN32)
00514 #if defined (_MSC_VER)
00515 _findclose (fh);
00516 #elif defined (__BORLANDC__)
00517 findclose(&fileinfo);
00518 #endif
00519 }
00520 #else
00521 }
00522 }
00523 #endif
00524 if (strlen (save_names[i]) < 1)
00525 sprintf (s2, " %d .....", i);
00526 else
00527 {
00528 l = strlen (s2);
00529 for (j = 0; j < l; j++)
00530 if (s2[j] == '_')
00531 s2[j] = ' ';
00532 }
00533 if (verify_city (save_names[i]) == 0)
00534 Fgl_setfontcolors (bg_colour, red (28));
00535 else
00536 Fgl_setfontcolors (bg_colour, green (28));
00537 Fgl_write (mw->x + 24, mw->y + 10 * (10 + i), s2);
00538 #if !defined (WIN32)
00539 rewinddir (dp);
00540 #endif
00541 }
00542 #if defined (WIN32)
00543 _chdir (LIBDIR); /* go back... */
00544 #else
00545 closedir (dp);
00546 #endif
00547 Fgl_setfontcolors (bg_colour, TEXT_FG_COLOUR);
00548 free (s);
00549 }
|
|
|
|
|
||||||||||||
|
|
|
||||||||||||||||||||
|
|
|
|
|
|
|
|
|
|
Definition at line 799 of file ldsvguts.c. 00800 {
00801 char *cs, c1, c2;
00802 cs = (char *) i;
00803 c1 = *cs;
00804 c2 = *(cs + 1);
00805 *(cs++) = c2;
00806 *cs = c1;
00807 }
|
|
|
Definition at line 784 of file ldsvguts.c. 00785 {
00786 char *cs, c1, c2, c3, c4;
00787 cs = (char *) i;
00788 c1 = *cs;
00789 c2 = *(cs + 1);
00790 c3 = *(cs + 2);
00791 c4 = *(cs + 3);
00792 *(cs++) = c4;
00793 *(cs++) = c3;
00794 *(cs++) = c2;
00795 *cs = c1;
00796 }
|
|
|
Definition at line 228 of file fileutil.c. 00229 {
00230 #if defined (HAVE_GZIP) && defined (HAVE_POPEN)
00231 pclose (fp);
00232 #elif defined (HAVE_GZIP) && !defined (HAVE_POPEN)
00233 fclose (fp);
00234 remove (lc_temp_filename);
00235 #else
00236 fclose (fp);
00237 #endif
00238 }
|
|
|
Definition at line 193 of file fileutil.c. 00194 {
00195 FILE* fp;
00196
00197 #if defined (HAVE_GZIP) && defined (HAVE_POPEN)
00198 #ifdef __EMX__
00199 const char* cmd_str = "gzip -d -c < %s 2> nul";
00200 #else
00201 const char* cmd_str = "gzip -d -c < %s 2> /dev/null";
00202 #endif
00203 char *cmd = (char*) malloc (strlen (cmd_str) + strlen (fn) + 1);
00204
00205 sprintf (cmd, cmd_str, fn);
00206 #ifdef __EMX__
00207 fp=popen(cmd,"rb");
00208 #else
00209 fp=popen(cmd,"r");
00210 #endif
00211 if (fp==NULL) {
00212 fprintf(stderr, "Failed to open pipe cmd: %s\n", cmd);
00213 }
00214 free(cmd);
00215
00216 #elif defined (HAVE_GZIP) && !defined (HAVE_POPEN)
00217 gunzip_file (fn, lc_temp_filename);
00218 fp = fopen (lc_temp_filename, "rb");
00219
00220 #else /* No gzip */
00221 fp = fopen (fn, "rb");
00222 #endif
00223
00224 return fp;
00225 }
|
|
||||||||||||||||||||
|
Definition at line 73 of file transport.c. 00075 {
00076 int tot, av, *base, xm1, xp1, ym1, yp1;
00077
00078 /* 30. Oct 1996:
00079 * we'll use a loop with pointers here instead of doin' each
00080 * operation by hand. this reduces code complexity and should
00081 * lead to a higher cache hit ratio - theoretically
00082 * (ThMO)
00083 *
00084 * 12. Dec 1996:
00085 * as this is a heavy used routine, another speedup improvement is
00086 * needed. we'll now use 1 pointer, which will be incremented and
00087 * 1 .. 4 constant indices, which replaces the old pointer-pure
00088 * version.
00089 * advantages: elimination of unnecessary pointer increments.
00090 * Note: this *only* works, if the related addresses use one and the
00091 * same address space - which is naturally for 2-dimensional
00092 * arrays.
00093 * (ThMO)
00094 */
00095
00096 base = &minfo->int_1;
00097 switch (minfo->flags & 0x0F)
00098 {
00099 case 0:
00100 return;
00101
00102 case 1: /* inlined t_av_l() -- (ThMO) */
00103 xm1 = &minfo[-WORLD_SIDE_LEN].int_1 - base;
00104 do {
00105 tot = *base + base[xm1];
00106 av = tot / 2;
00107 base[xm1] = av;
00108 *base++ = av + tot % 2;
00109 } while (base <= &minfo->int_7);
00110 break;
00111
00112 case 2: /* inlined t_av_u() -- (ThMO) */
00113 ym1 = &minfo[-1].int_1 - base;
00114 do {
00115 tot = *base + base[ym1];
00116 av = tot / 2;
00117 base[ym1] = av;
00118 *base++ = av + tot % 2;
00119 } while (base <= &minfo->int_7);
00120 break;
00121
00122 case 3: /* inlined t_av_lu() -- (ThMO) */
00123 xm1 = &minfo[-WORLD_SIDE_LEN].int_1 - base;
00124 ym1 = &minfo[-1].int_1 - base;
00125 do {
00126 tot = *base + base[xm1] + base[ym1];
00127 av = tot / 3;
00128 base[xm1] = base[ym1] = av;
00129 *base++ = av + tot % 3;
00130 } while (base <= &minfo->int_7);
00131 break;
00132
00133 case 4: /* inlined t_av_r() -- (ThMO) */
00134 xp1 = &minfo[WORLD_SIDE_LEN].int_1 - base;
00135 do {
00136 tot = *base + base[xp1];
00137 av = tot / 2;
00138 base[xp1] = av;
00139 *base++ = av + tot % 2;
00140 } while (base <= &minfo->int_7);
00141 break;
00142
00143 case 5: /* inlined t_av_lr() -- (ThMO) */
00144 xm1 = &minfo[-WORLD_SIDE_LEN].int_1 - base;
00145 xp1 = &minfo[WORLD_SIDE_LEN].int_1 - base;
00146 do {
00147 tot = *base + base[xm1] + base[xp1];
00148 av = tot / 3;
00149 base[xm1] = base[xp1] = av;
00150 *base++ = av + tot % 3;
00151 } while (base <= &minfo->int_7);
00152 break;
00153
00154 case 6: /* inline t_av_ur() -- (ThMO) */
00155 ym1 = &minfo[-1].int_1 - base;
00156 xp1 = &minfo[WORLD_SIDE_LEN].int_1 - base;
00157 do {
00158 tot = *base + base[ym1] + base[xp1];
00159 av = tot / 3;
00160 base[ym1] = base[xp1] = av;
00161 *base++ = av + tot % 3;
00162 } while (base <= &minfo->int_7);
00163 break;
00164
00165 case 7: /* inlined t_av_lur() -- (ThMO) */
00166 xm1 = &minfo[-WORLD_SIDE_LEN].int_1 - base;
00167 ym1 = &minfo[-1].int_1 - base;
00168 xp1 = &minfo[WORLD_SIDE_LEN].int_1 - base;
00169 do {
00170 tot = *base + base[xm1] + base[ym1] + base[xp1];
00171 av = tot / 4;
00172 base[xm1] = base[ym1] = base[xp1] = av;
00173 *base++ = av + tot % 4;
00174 } while (base <= &minfo->int_7);
00175 break;
00176
00177 case 8: /* inlined t_av_d() -- (ThMO) */
00178 yp1 = &minfo[1].int_1 - base;
00179 do {
00180 tot = *base + base[yp1];
00181 av = tot / 2;
00182 base[yp1] = av;
00183 *base++ = av + tot % 2;
00184 } while (base <= &minfo->int_7);
00185 break;
00186
00187 case 9: /* inlined t_av_ld() -- (ThMO) */
00188 xm1 = &minfo[-WORLD_SIDE_LEN].int_1 - base;
00189 yp1 = &minfo[1].int_1 - base;
00190 do {
00191 tot = *base + base[xm1] + base[yp1];
00192 av = tot / 3;
00193 base[xm1] = base[yp1] = av;
00194 *base++ = av + tot % 3;
00195 } while (base <= &minfo->int_7);
00196 break;
00197
00198 case 10: /* inlined t_av_ud() -- (ThMO) */
00199 ym1 = &minfo[-1].int_1 - base;
00200 yp1 = &minfo[1].int_1 - base;
00201 do {
00202 tot = *base + base[ym1] + base[yp1];
00203 av = tot / 3;
00204 base[ym1] = base[yp1] = av;
00205 *base++ = av + tot % 3;
00206 } while (base <= &minfo->int_7);
00207 break;
00208
00209 case 11: /* inlined t_av_lud() -- (ThMO) */
00210 xm1 = &minfo[-WORLD_SIDE_LEN].int_1 - base;
00211 ym1 = &minfo[-1].int_1 - base;
00212 yp1 = &minfo[1].int_1 - base;
00213 do {
00214 tot = *base + base[xm1] + base[ym1] + base[yp1];
00215 av = tot / 4;
00216 base[xm1] = base[ym1] = base[yp1] = av;
00217 *base++ = av + tot % 4;
00218 } while (base <= &minfo->int_7);
00219 break;
00220
00221 case 12: /* inlined t_av_rd() -- (ThMO) */
00222 xp1 = &minfo[WORLD_SIDE_LEN].int_1 - base;
00223 yp1 = &minfo[1].int_1 - base;
00224 do {
00225 tot = *base + base[xp1] + base[yp1];
00226 av = tot / 3;
00227 base[xp1] = base[yp1] = av;
00228 *base++ = av + tot % 3;
00229 } while (base <= &minfo->int_7);
00230 break;
00231
00232 case 13: /* inlined t_av_lrd() -- (ThMO) */
00233 xm1 = &minfo[-WORLD_SIDE_LEN].int_1 - base;
00234 xp1 = &minfo[WORLD_SIDE_LEN].int_1 - base;
00235 yp1 = &minfo[1].int_1 - base;
00236 do {
00237 tot = *base + base[xm1] + base[xp1] + base[yp1];
00238 av = tot / 4;
00239 base[xm1] = base[xp1] = base[yp1] = av;
00240 *base++ = av + tot % 4;
00241 } while (base <= &minfo->int_7);
00242 break;
00243
00244 case 14: /* inlined t_av_urd() -- (ThMO) */
00245 ym1 = &minfo[-1].int_1 - base;
00246 xp1 = &minfo[WORLD_SIDE_LEN].int_1 - base;
00247 yp1 = &minfo[1].int_1 - base;
00248 do {
00249 tot = *base + base[ym1] + base[xp1] + base[yp1];
00250 av = tot / 4;
00251 base[ym1] = base[xp1] = base[yp1] = av;
00252 *base++ = av + tot % 4;
00253 } while (base <= &minfo->int_7);
00254 break;
00255
00256 case 15: /* inlined t_av_lurd() -- (ThMO) */
00257 xm1 = &minfo[-WORLD_SIDE_LEN].int_1 - base;
00258 ym1 = &minfo[-1].int_1 - base;
00259 xp1 = &minfo[WORLD_SIDE_LEN].int_1 - base;
00260 yp1 = &minfo[1].int_1 - base;
00261 do {
00262 tot = *base + base[xm1] + base[ym1] + base[xp1] + base[yp1];
00263 av = tot / 5;
00264 base[xm1] = base[ym1] = base[xp1] = base[yp1] = av;
00265 *base++ = av + tot % 5;
00266 } while (base <= &minfo->int_7);
00267 break;
00268 }
00269 if (*--base >= max_waste) {
00270 *base -= WASTE_BURN_ON_TRANSPORT;
00271 ++*pol;
00272 if (*waste_count > TRANSPORT_BURN_WASTE_COUNT) {
00273 *waste_count = 0;
00274 } else {
00275 ++ * waste_count;
00276 }
00277 }
00278 }
|
|
||||||||||||||||
|
Definition at line 313 of file market.c. 00314 {
00315 int q;
00316 if (numof_markets > 0)
00317 {
00318 for (q = 0; q < numof_markets; q++)
00319 {
00320 if ((abs (marketx[q] - x) < MARKET_RANGE)
00321 && (abs (markety[q] - y) < MARKET_RANGE)
00322 && (MP_INFO(marketx[q],markety[q]).int_3
00323 > coal))
00324 {
00325 MP_INFO(marketx[q],markety[q]).int_3 -= coal;
00326 return (1);
00327 }
00328 }
00329 }
00330 if (get_stuff (x, y, coal, T_COAL) != 0)
00331 return (1);
00332 return (0);
00333 }
|
|
||||||||||||||||
|
Definition at line 65 of file market.c. 00066 {
00067 int q;
00068 if (numof_markets > 0)
00069 {
00070 for (q = 0; q < numof_markets; q++)
00071 {
00072 if ((abs (marketx[q] - x) < MARKET_RANGE)
00073 && (abs (markety[q] - y) < MARKET_RANGE)
00074 && (MP_INFO(marketx[q],markety[q]).int_1
00075 > food))
00076 {
00077 MP_INFO(marketx[q],markety[q]).int_1 -= food;
00078 return (1);
00079 }
00080 }
00081 }
00082 if (get_stuff (x, y, food, T_FOOD) != 0)
00083 return (1);
00084 return (0);
00085 }
|
|
||||||||||||||||
|
Definition at line 113 of file market.c. 00114 {
00115 int q;
00116 if (numof_markets > 0)
00117 {
00118 for (q = 0; q < numof_markets; q++)
00119 {
00120 if (abs (marketx[q] - x) < MARKET_RANGE
00121 && abs (markety[q] - y) < MARKET_RANGE
00122 && (MP_INFO(marketx[q],markety[q]).int_4
00123 > goods))
00124 {
00125 MP_INFO(marketx[q],markety[q]).int_4 -= goods;
00126 goods_tax += goods;
00127 goods_used += goods;
00128 /* make the waste here. */
00129 MP_INFO(marketx[q],markety[q]).int_7 += goods / 3;
00130 return (1);
00131 }
00132 }
00133 }
00134 if (get_stuff (x, y, goods, T_GOODS) != 0)
00135 {
00136 put_stuff (x, y, goods / 3, T_WASTE);
00137 goods_tax += goods;
00138 goods_used += goods;
00139 return (1);
00140 }
00141 return (0);
00142 }
|
|
||||||||||||||||
|
Definition at line 16 of file market.c. 00017 {
00018 int q;
00019 if (numof_markets > 0)
00020 {
00021 for (q = 0; q < numof_markets; q++)
00022 {
00023 if ((abs (marketx[q] - x) < MARKET_RANGE
00024 && abs (markety[q] - y) < MARKET_RANGE
00025 && (MP_INFO(marketx[q],markety[q]).int_2 > (3 * jobs / 2))))
00026 {
00027 MP_INFO(marketx[q],markety[q]).int_2 -= jobs;
00028 income_tax += jobs;
00029 return (1);
00030 }
00031 }
00032 }
00033 if (get_stuff (x, y, jobs, T_JOBS) != 0)
00034 {
00035 income_tax += jobs;
00036 return (1);
00037 }
00038 return (0);
00039 }
|
|
||||||||||||||||
|
Definition at line 265 of file market.c. 00266 {
00267 int q;
00268 if (numof_markets > 0)
00269 {
00270 for (q = 0; q < numof_markets; q++)
00271 {
00272 if ((abs (marketx[q] - x) < MARKET_RANGE)
00273 && (abs (markety[q] - y) < MARKET_RANGE)
00274 && (MP_INFO(marketx[q],markety[q]).int_5
00275 > ore))
00276 {
00277 MP_INFO(marketx[q],markety[q]).int_5 -= ore;
00278 return (1);
00279 }
00280 }
00281 }
00282 if (get_stuff (x, y, ore, T_ORE) != 0)
00283 return (1);
00284 return (0);
00285 }
|
|
||||||||||||||||||||
|
Definition at line 334 of file power.c. 00335 {
00336
00337 int i;
00338 int xi, yi;
00339 int grid_tmp; /* for simplicity */
00340
00341 if (numof_substations == 0)
00342 return(0);
00343
00344 for (i = 0; i < numof_substations; i++)
00345 {
00346 xi = substationx[i];
00347 yi = substationy[i];
00348 if (abs (xi - x) < SUBSTATION_RANGE &&
00349 abs (yi - y) < SUBSTATION_RANGE) {
00350
00351 if (block_industry != 0 && MP_GROUP(xi, yi) == GROUP_WINDMILL)
00352 continue;
00353
00354 grid_tmp = MP_INFO(xi,yi).int_6;
00355
00356 grid[grid_tmp]->demand += power;
00357 if (grid[grid_tmp]->total_power >= power) {
00358 grid[grid_tmp]->total_power -= power;
00359 MP_INFO(xi,yi).int_5 += power;
00360 return 1;
00361 }
00362
00363 }
00364 }
00365 return 0;
00366 }
|
|
|
Definition at line 95 of file timer.c. 00096 {
00097 #if defined (WIN32)
00098 const int CLOCKS_PER_MILLISECOND = CLOCKS_PER_SEC / 1000;
00099 real_time = (long) (clock () / CLOCKS_PER_MILLISECOND);
00100 #else
00101 gettimeofday (&lc_timeval, 0);
00102 real_time = (lc_timeval.tv_sec - real_start_time) * 1000
00103 + (lc_timeval.tv_usec / 1000);
00104 #endif
00105 }
|
|
|
|
|
||||||||||||||||
|
Definition at line 217 of file market.c. 00218 {
00219 int q;
00220 if (numof_markets > 0)
00221 {
00222 for (q = 0; q < numof_markets; q++)
00223 {
00224 if ((abs (marketx[q] - x) < MARKET_RANGE)
00225 && (abs (markety[q] - y) < MARKET_RANGE)
00226 && (MP_INFO(marketx[q],markety[q]).int_6
00227 > steel))
00228 {
00229 MP_INFO(marketx[q],markety[q]).int_6 -= steel;
00230 return (1);
00231 }
00232 }
00233 }
00234 if (get_stuff (x, y, steel, T_STEEL) != 0)
00235 return (1);
00236 return (0);
00237 }
|
|
||||||||||||||||||||
|
Definition at line 720 of file market.c. 00721 {
00722 int res = 0;
00723 Map_Point_Info *minfo = &MP_INFO(x,y);
00724
00725 switch (MP_SIZE(x,y))
00726 {
00727 case 2:
00728 res = get_stuff2 (minfo, stuff, stuff_type);
00729 break;
00730 case 3:
00731 res = get_stuff3 (minfo, stuff, stuff_type);
00732 break;
00733 case 4:
00734 res = get_stuff4 (minfo, stuff, stuff_type);
00735 break;
00736 default:
00737 do_error ("Bad area size in get_stuff()");
00738 }
00739 return (res);
00740 }
|
|
||||||||||||||||
|
Definition at line 757 of file market.c. 00758 {
00759 static int tstart2 = 0;
00760 int i, st, tst, *ip, *stack[8], **ssp; /* stack is a pipe -- (ThMO) */
00761
00762 /* we'll stack our found pointers so to avoid re-looping and
00763 * testing again (ThMO) */
00764
00765 tst = tstart2;
00766
00767 /* can we find enough on the transport? */
00768
00769 for (ssp = stack, st = 0, i = 0; i < 8; i++)
00770 {
00771 if (map[t2[tst]].flags & FLAG_IS_TRANSPORT)
00772 {
00773 ip = &map[t2[tst]].int_1;
00774 ip += stuff_type;
00775 st += *ip;
00776 *ssp++ = ip; /* push it -- (ThMO) */
00777 if (st >= stuff)
00778 {
00779 ssp = stack;
00780 do
00781 {
00782 ip = *ssp++; /* pop it -- (ThMO) */
00783 *ip = (stuff -= *ip) < 0 ? -stuff : 0;
00784 }
00785 while (stuff > 0);
00786 tstart2 = ++tst & 7;
00787 return (1);
00788 }
00789 }
00790 if (++tst >= 8)
00791 tst = 0;
00792 }
00793 return (0);
00794 }
|
|
||||||||||||||||
|
Definition at line 815 of file market.c. 00816 {
00817 static int tstart3 = 0;
00818
00819 int i, st, tst, *ip, *stack[12], **ssp; /* stack is a pipe -- (ThMO) */
00820
00821 /* we'll stack our found pointers so to avoid re-looping and
00822 * testing again
00823 * (ThMO)
00824 */
00825
00826 tst = tstart3;
00827
00828 /* can we find enough on the transport? */
00829
00830 for (ssp = stack, st = 0, i = 0; i < 12; i++)
00831 {
00832 if (map[t3[tst]].flags & FLAG_IS_TRANSPORT)
00833 {
00834 ip = &map[t3[tst]].int_1;
00835 ip += stuff_type;
00836 st += *ip;
00837 *ssp++ = ip; /* push it -- (ThMO) */
00838 if (st >= stuff)
00839 {
00840 ssp = stack;
00841 do
00842 {
00843 ip = *ssp++; /* pop it -- (ThMO) */
00844 *ip = (stuff -= *ip) < 0 ? -stuff : 0;
00845 }
00846 while (stuff > 0);
00847 ++tst;
00848 tstart3 = tst >= 12 ? 0 : tst;
00849 return (1);
00850 }
00851 }
00852 if (++tst >= 12)
00853 tst = 0;
00854 }
00855 return (0);
00856 }
|
|
||||||||||||||||
|
Definition at line 881 of file market.c. 00882 {
00883 static int
00884 tstart4 = 0;
00885
00886 int i, st, tst, *ip, *stack[16], **ssp; /* stack is a pipe -- (ThMO) */
00887
00888 /* we'll stack our found pointers so to avoid re-looping and
00889 * testing again
00890 * (ThMO)
00891 */
00892
00893 tst = tstart4;
00894
00895 /* can we find enough on the transport? */
00896
00897 for (ssp = stack, st = 0, i = 0; i < 16; i++)
00898 {
00899 if (map[t4[tst]].flags & FLAG_IS_TRANSPORT)
00900 {
00901 ip = &map[t4[tst]].int_1;
00902 ip += stuff_type;
00903 st += *ip;
00904 *ssp++ = ip; /* push it -- (ThMO) */
00905 if (st >= stuff)
00906 {
00907 ssp = stack;
00908 do
00909 {
00910 ip = *ssp++; /* pop it -- (ThMO) */
00911 *ip = (stuff -= *ip) < 0 ? -stuff : 0;
00912 }
00913 while (stuff > 0);
00914 tstart4 = ++tst & 15;
00915 return (1);
00916 }
00917 }
00918 if (++tst >= 16)
00919 tst = 0;
00920 }
00921 return (0);
00922 }
|
|
||||||||||||||||
|
Definition at line 193 of file market.c. 00194 {
00195 int q;
00196 if (numof_markets > 0)
00197 {
00198 for (q = 0; q < numof_markets; q++)
00199 {
00200 if ((abs (marketx[q] - x) < MARKET_RANGE)
00201 && (abs (markety[q] - y) < MARKET_RANGE)
00202 && (MP_INFO(marketx[q],markety[q]).int_7
00203 > waste))
00204 {
00205 MP_INFO(marketx[q],markety[q]).int_7 -= waste;
00206 return (1);
00207 }
00208 }
00209 }
00210 if (get_stuff (x, y, waste, T_WASTE) != 0)
00211 return (1);
00212 return (0);
00213 }
|
|
|
|
|
|
Definition at line 1331 of file engine.c. 01332 {
01333 int x;
01334 for (x = 0; x < WORLD_SIDE_LEN; x++) {
01335 mappoint_array_x[x] = x;
01336 mappoint_array_y[x] = x;
01337 }
01338 }
|
|
|
Definition at line 486 of file fileutil.c. 00487 {
00488 char* homedir = NULL;
00489 const char* intl_suffix = "";
00490 char* dm = NULL;
00491 char* td = NULL;
00492
00493 find_libdir ();
00494
00495 #if defined (WIN32)
00496 homedir = LIBDIR;
00497 #elif defined (__EMX__)
00498 homedir = getenv ("HOME");
00499 #else
00500 homedir = getenv ("HOME");
00501 #endif
00502
00503 /* Various dirs and files */
00504 lc_save_dir_len = strlen (homedir) + strlen (LC_SAVE_DIR) + 1;
00505 if ((lc_save_dir = (char *) malloc (lc_save_dir_len + 1)) == 0)
00506 malloc_failure ();
00507 sprintf (lc_save_dir, "%s%c%s", homedir, PATH_SLASH, LC_SAVE_DIR);
00508 sprintf (colour_pal_file, "%s%c%s", LIBDIR, PATH_SLASH, "colour.pal");
00509 sprintf (opening_path, "%s%c%s", LIBDIR, PATH_SLASH, "opening");
00510 #if defined (WIN32)
00511 sprintf (opening_pic, "%s%c%s",opening_path,PATH_SLASH,"open.tga");
00512 #else
00513 sprintf (opening_pic, "%s%c%s",opening_path,PATH_SLASH,"open.tga.gz");
00514 #endif
00515 sprintf (graphic_path, "%s%c%s%c", LIBDIR, PATH_SLASH, "icons",
00516 PATH_SLASH);
00517 sprintf (lincityrc_file, "%s%c%s", homedir, PATH_SLASH,
00518 LINCITYRC_FILENAME);
00519
00520 /* Paths for message & help files, etc */
00521 find_localized_paths ();
00522
00523 /* Font stuff */
00524 sprintf (fontfile, "%s%c%s", opening_path, PATH_SLASH,
00525 "iso8859-1-8x8.raw");
00526 #if defined (WIN32)
00527 /* GCS: Use windows font for extra speed */
00528 strcpy (windowsfontfile, LIBDIR);
00529 #if defined (commentout)
00530 if (!pix_double)
00531 strcat (windowsfontfile, "\\opening\\iso8859-1-8x8.fnt");
00532 else
00533 strcat (windowsfontfile, "\\opening\\iso8859-1-9x15.fnt");
00534 #endif
00535 if (!pix_double)
00536 strcat (windowsfontfile, "\\opening\\winfont_8x8.fnt");
00537 else
00538 strcat (windowsfontfile, "\\opening\\winfont_16x16.fnt");
00539 #endif
00540
00541 /* Temp file for results */
00542 lc_temp_filename = (char *) malloc (lc_save_dir_len + 16);
00543 if (lc_temp_filename == 0) {
00544 malloc_failure ();
00545 }
00546 sprintf (lc_temp_filename, "%s%c%s", lc_save_dir, PATH_SLASH, "tmp-file");
00547
00548 /* Path for localization */
00549 #if defined (ENABLE_NLS)
00550 #if defined (WIN32)
00551 sprintf (lc_textdomain_directory, "%s%c%s", LIBDIR, PATH_SLASH, "locale");
00552 #else
00553 strcpy (lc_textdomain_directory, LOCALEDIR);
00554 #endif
00555 dm = bindtextdomain (PACKAGE, lc_textdomain_directory);
00556 debug_printf ("Bound textdomain directory is %s\n", dm);
00557 td = textdomain (PACKAGE);
00558 debug_printf ("Textdomain is %s\n", td);
00559 #endif
00560 }
|
|
|
|
|
|
Definition at line 530 of file lintypes.c. 00531 {
00532 main_types[CST_GREEN].group=GROUP_BARE;
00533 main_types[CST_GREEN].graphic=load_graphic(CST_GREEN_G);
00534
00535 main_types[CST_POWERL_H_L].group=GROUP_POWER_LINE;
00536 main_types[CST_POWERL_H_L].graphic=load_graphic(CST_POWERL_H_L_G);
00537
00538 main_types[CST_POWERL_V_L].group=GROUP_POWER_LINE;
00539 main_types[CST_POWERL_V_L].graphic=load_graphic(CST_POWERL_V_L_G);
00540
00541 main_types[CST_POWERL_LD_L].group=GROUP_POWER_LINE;
00542 main_types[CST_POWERL_LD_L].graphic=load_graphic(CST_POWERL_LD_L_G);
00543
00544 main_types[CST_POWERL_RD_L].group=GROUP_POWER_LINE;
00545 main_types[CST_POWERL_RD_L].graphic=load_graphic(CST_POWERL_RD_L_G);
00546
00547 main_types[CST_POWERL_LU_L].group=GROUP_POWER_LINE;
00548 main_types[CST_POWERL_LU_L].graphic=load_graphic(CST_POWERL_LU_L_G);
00549
00550 main_types[CST_POWERL_RU_L].group=GROUP_POWER_LINE;
00551 main_types[CST_POWERL_RU_L].graphic=load_graphic(CST_POWERL_RU_L_G);
00552
00553 main_types[CST_POWERL_LDU_L].group=GROUP_POWER_LINE;
00554 main_types[CST_POWERL_LDU_L].graphic=load_graphic(CST_POWERL_LDU_L_G);
00555
00556 main_types[CST_POWERL_LDR_L].group=GROUP_POWER_LINE;
00557 main_types[CST_POWERL_LDR_L].graphic=load_graphic(CST_POWERL_LDR_L_G);
00558
00559 main_types[CST_POWERL_LUR_L].group=GROUP_POWER_LINE;
00560 main_types[CST_POWERL_LUR_L].graphic=load_graphic(CST_POWERL_LUR_L_G);
00561
00562 main_types[CST_POWERL_UDR_L].group=GROUP_POWER_LINE;
00563 main_types[CST_POWERL_UDR_L].graphic=load_graphic(CST_POWERL_UDR_L_G);
00564
00565 main_types[CST_POWERL_LUDR_L].group=GROUP_POWER_LINE;
00566 main_types[CST_POWERL_LUDR_L].graphic
00567 =load_graphic(CST_POWERL_LUDR_L_G);
00568
00569 main_types[CST_POWERL_H_D].group=GROUP_POWER_LINE;
00570 main_types[CST_POWERL_H_D].graphic=load_graphic(CST_POWERL_H_D_G);
00571
00572 main_types[CST_POWERL_V_D].group=GROUP_POWER_LINE;
00573 main_types[CST_POWERL_V_D].graphic=load_graphic(CST_POWERL_V_D_G);
00574
00575 main_types[CST_POWERL_LD_D].group=GROUP_POWER_LINE;
00576 main_types[CST_POWERL_LD_D].graphic=load_graphic(CST_POWERL_LD_D_G);
00577
00578 main_types[CST_POWERL_RD_D].group=GROUP_POWER_LINE;
00579 main_types[CST_POWERL_RD_D].graphic=load_graphic(CST_POWERL_RD_D_G);
00580
00581 main_types[CST_POWERL_LU_D].group=GROUP_POWER_LINE;
00582 main_types[CST_POWERL_LU_D].graphic=load_graphic(CST_POWERL_LU_D_G);
00583
00584 main_types[CST_POWERL_RU_D].group=GROUP_POWER_LINE;
00585 main_types[CST_POWERL_RU_D].graphic=load_graphic(CST_POWERL_RU_D_G);
00586
00587 main_types[CST_POWERL_LDU_D].group=GROUP_POWER_LINE;
00588 main_types[CST_POWERL_LDU_D].graphic=load_graphic(CST_POWERL_LDU_D_G);
00589
00590 main_types[CST_POWERL_LDR_D].group=GROUP_POWER_LINE;
00591 main_types[CST_POWERL_LDR_D].graphic=load_graphic(CST_POWERL_LDR_D_G);
00592
00593 main_types[CST_POWERL_LUR_D].group=GROUP_POWER_LINE;
00594 main_types[CST_POWERL_LUR_D].graphic=load_graphic(CST_POWERL_LUR_D_G);
00595
00596 main_types[CST_POWERL_UDR_D].group=GROUP_POWER_LINE;
00597 main_types[CST_POWERL_UDR_D].graphic=load_graphic(CST_POWERL_UDR_D_G);
00598
00599 main_types[CST_POWERL_LUDR_D].group=GROUP_POWER_LINE;
00600 main_types[CST_POWERL_LUDR_D].graphic
00601 =load_graphic(CST_POWERL_LUDR_D_G);
00602
00603 main_types[CST_POWERS_SOLAR].group=GROUP_SOLAR_POWER;
00604 main_types[CST_POWERS_SOLAR].graphic=load_graphic(CST_POWERS_SOLAR_G);
00605
00606 main_types[CST_POWERS_COAL_EMPTY].group=GROUP_COAL_POWER;
00607 main_types[CST_POWERS_COAL_EMPTY].graphic
00608 =load_graphic(CST_POWERS_COAL_EMPTY_G);
00609
00610 main_types[CST_POWERS_COAL_LOW].group=GROUP_COAL_POWER;
00611 main_types[CST_POWERS_COAL_LOW].graphic
00612 =load_graphic(CST_POWERS_COAL_LOW_G);
00613
00614 prog_box("",12);
00615
00616 main_types[CST_POWERS_COAL_MED].group=GROUP_COAL_POWER;
00617 main_types[CST_POWERS_COAL_MED].graphic
00618 =load_graphic(CST_POWERS_COAL_MED_G);
00619
00620 main_types[CST_POWERS_COAL_FULL].group=GROUP_COAL_POWER;
00621 main_types[CST_POWERS_COAL_FULL].graphic
00622 =load_graphic(CST_POWERS_COAL_FULL_G);
00623
00624 main_types[CST_SUBSTATION_R].group=GROUP_SUBSTATION;
00625 main_types[CST_SUBSTATION_R].graphic=load_graphic(CST_SUBSTATION_R_G);
00626
00627 main_types[CST_SUBSTATION_G].group=GROUP_SUBSTATION;
00628 main_types[CST_SUBSTATION_G].graphic=load_graphic(CST_SUBSTATION_G_G);
00629
00630 main_types[CST_SUBSTATION_RG].group=GROUP_SUBSTATION;
00631 main_types[CST_SUBSTATION_RG].graphic
00632 =load_graphic(CST_SUBSTATION_RG_G);
00633
00634 main_types[CST_RESIDENCE_LL].group=GROUP_RESIDENCE_LL;
00635 main_types[CST_RESIDENCE_LL].graphic=load_graphic(CST_RESIDENCE_LL_G);
00636
00637 main_types[CST_RESIDENCE_ML].group=GROUP_RESIDENCE_ML;
00638 main_types[CST_RESIDENCE_ML].graphic
00639 =load_graphic(CST_RESIDENCE_ML_G);
00640
00641 main_types[CST_RESIDENCE_HL].group=GROUP_RESIDENCE_HL;
00642 main_types[CST_RESIDENCE_HL].graphic
00643 =load_graphic(CST_RESIDENCE_HL_G);
00644
00645 main_types[CST_RESIDENCE_LH].group=GROUP_RESIDENCE_LH;
00646 main_types[CST_RESIDENCE_LH].graphic=load_graphic(CST_RESIDENCE_LH_G);
00647
00648 main_types[CST_RESIDENCE_MH].group=GROUP_RESIDENCE_MH;
00649 main_types[CST_RESIDENCE_MH].graphic=load_graphic(CST_RESIDENCE_MH_G);
00650
00651 main_types[CST_RESIDENCE_HH].group=GROUP_RESIDENCE_HH;
00652 main_types[CST_RESIDENCE_HH].graphic=load_graphic(CST_RESIDENCE_HH_G);
00653
00654
00655 main_types[CST_FARM_O0].group=GROUP_ORGANIC_FARM;
00656 main_types[CST_FARM_O0].graphic=load_graphic(CST_FARM_O0_G);
00657
00658 main_types[CST_FARM_O1].group=GROUP_ORGANIC_FARM;
00659 main_types[CST_FARM_O1].graphic=load_graphic(CST_FARM_O1_G);
00660
00661 main_types[CST_FARM_O2].group=GROUP_ORGANIC_FARM;
00662 main_types[CST_FARM_O2].graphic=load_graphic(CST_FARM_O2_G);
00663
00664 main_types[CST_FARM_O3].group=GROUP_ORGANIC_FARM;
00665 main_types[CST_FARM_O3].graphic=load_graphic(CST_FARM_O3_G);
00666
00667 main_types[CST_FARM_O4].group=GROUP_ORGANIC_FARM;
00668 main_types[CST_FARM_O4].graphic=load_graphic(CST_FARM_O4_G);
00669
00670 main_types[CST_FARM_O5].group=GROUP_ORGANIC_FARM;
00671 main_types[CST_FARM_O5].graphic=load_graphic(CST_FARM_O5_G);
00672
00673 main_types[CST_FARM_O6].group=GROUP_ORGANIC_FARM;
00674 main_types[CST_FARM_O6].graphic=load_graphic(CST_FARM_O6_G);
00675
00676 main_types[CST_FARM_O7].group=GROUP_ORGANIC_FARM;
00677 main_types[CST_FARM_O7].graphic=load_graphic(CST_FARM_O7_G);
00678
00679 main_types[CST_FARM_O8].group=GROUP_ORGANIC_FARM;
00680 main_types[CST_FARM_O8].graphic=load_graphic(CST_FARM_O8_G);
00681
00682 main_types[CST_FARM_O9].group=GROUP_ORGANIC_FARM;
00683 main_types[CST_FARM_O9].graphic=load_graphic(CST_FARM_O9_G);
00684
00685 main_types[CST_FARM_O10].group=GROUP_ORGANIC_FARM;
00686 main_types[CST_FARM_O10].graphic=load_graphic(CST_FARM_O10_G);
00687
00688 main_types[CST_FARM_O11].group=GROUP_ORGANIC_FARM;
00689 main_types[CST_FARM_O11].graphic=load_graphic(CST_FARM_O11_G);
00690
00691 main_types[CST_FARM_O12].group=GROUP_ORGANIC_FARM;
00692 main_types[CST_FARM_O12].graphic=load_graphic(CST_FARM_O12_G);
00693
00694 main_types[CST_FARM_O13].group=GROUP_ORGANIC_FARM;
00695 main_types[CST_FARM_O13].graphic=load_graphic(CST_FARM_O13_G);
00696
00697 main_types[CST_FARM_O14].group=GROUP_ORGANIC_FARM;
00698 main_types[CST_FARM_O14].graphic=load_graphic(CST_FARM_O14_G);
00699
00700 main_types[CST_FARM_O15].group=GROUP_ORGANIC_FARM;
00701 main_types[CST_FARM_O15].graphic=load_graphic(CST_FARM_O15_G);
00702
00703 main_types[CST_FARM_O16].group=GROUP_ORGANIC_FARM;
00704 main_types[CST_FARM_O16].graphic=load_graphic(CST_FARM_O16_G);
00705
00706
00707 main_types[CST_MARKET_EMPTY].group=GROUP_MARKET;
00708 main_types[CST_MARKET_EMPTY].graphic
00709 =load_graphic(CST_MARKET_EMPTY_G);
00710
00711 main_types[CST_MARKET_LOW].group=GROUP_MARKET;
00712 main_types[CST_MARKET_LOW].graphic
00713 =load_graphic(CST_MARKET_LOW_G);
00714
00715 main_types[CST_MARKET_MED].group=GROUP_MARKET;
00716 main_types[CST_MARKET_MED].graphic
00717 =load_graphic(CST_MARKET_MED_G);
00718
00719 main_types[CST_MARKET_FULL].group=GROUP_MARKET;
00720 main_types[CST_MARKET_FULL].graphic
00721 =load_graphic(CST_MARKET_FULL_G);
00722
00723 main_types[CST_TRACK_LR].group=GROUP_TRACK;
00724 main_types[CST_TRACK_LR].graphic=load_graphic(CST_TRACK_LR_G);
00725
00726 main_types[CST_TRACK_LU].group=GROUP_TRACK;
00727 main_types[CST_TRACK_LU].graphic=load_graphic(CST_TRACK_LU_G);
00728
00729 main_types[CST_TRACK_LD].group=GROUP_TRACK;
00730 main_types[CST_TRACK_LD].graphic=load_graphic(CST_TRACK_LD_G);
00731
00732 main_types[CST_TRACK_UD].group=GROUP_TRACK;
00733 main_types[CST_TRACK_UD].graphic=load_graphic(CST_TRACK_UD_G);
00734
00735 main_types[CST_TRACK_UR].group=GROUP_TRACK;
00736 main_types[CST_TRACK_UR].graphic=load_graphic(CST_TRACK_UR_G);
00737
00738 main_types[CST_TRACK_DR].group=GROUP_TRACK;
00739 main_types[CST_TRACK_DR].graphic=load_graphic(CST_TRACK_DR_G);
00740
00741 main_types[CST_TRACK_LUR].group=GROUP_TRACK;
00742 main_types[CST_TRACK_LUR].graphic=load_graphic(CST_TRACK_LUR_G);
00743
00744 main_types[CST_TRACK_LDR].group=GROUP_TRACK;
00745 main_types[CST_TRACK_LDR].graphic=load_graphic(CST_TRACK_LDR_G);
00746
00747 main_types[CST_TRACK_LUD].group=GROUP_TRACK;
00748 main_types[CST_TRACK_LUD].graphic=load_graphic(CST_TRACK_LUD_G);
00749
00750 main_types[CST_TRACK_UDR].group=GROUP_TRACK;
00751 main_types[CST_TRACK_UDR].graphic=load_graphic(CST_TRACK_UDR_G);
00752
00753 main_types[CST_TRACK_LUDR].group=GROUP_TRACK;
00754 main_types[CST_TRACK_LUDR].graphic=load_graphic(CST_TRACK_LUDR_G);
00755
00756 main_types[CST_COALMINE_EMPTY].group=GROUP_COALMINE;
00757 main_types[CST_COALMINE_EMPTY].graphic
00758 =load_graphic(CST_COALMINE_EMPTY_G);
00759
00760 prog_box("",25);
00761
00762 main_types[CST_COALMINE_LOW].group=GROUP_COALMINE;
00763 main_types[CST_COALMINE_LOW].graphic=load_graphic(CST_COALMINE_LOW_G);
00764
00765 main_types[CST_COALMINE_MED].group=GROUP_COALMINE;
00766 main_types[CST_COALMINE_MED].graphic=load_graphic(CST_COALMINE_MED_G);
00767
00768 main_types[CST_COALMINE_FULL].group=GROUP_COALMINE;
00769 main_types[CST_COALMINE_FULL].graphic
00770 =load_graphic(CST_COALMINE_FULL_G);
00771
00772
00773 main_types[CST_RAIL_LR].group=GROUP_RAIL;
00774 main_types[CST_RAIL_LR].graphic=load_graphic(CST_RAIL_LR_G);
00775
00776 main_types[CST_RAIL_LU].group=GROUP_RAIL;
00777 main_types[CST_RAIL_LU].graphic=load_graphic(CST_RAIL_LU_G);
00778
00779 main_types[CST_RAIL_LD].group=GROUP_RAIL;
00780 main_types[CST_RAIL_LD].graphic=load_graphic(CST_RAIL_LD_G);
00781
00782 main_types[CST_RAIL_UD].group=GROUP_RAIL;
00783 main_types[CST_RAIL_UD].graphic=load_graphic(CST_RAIL_UD_G);
00784
00785 main_types[CST_RAIL_UR].group=GROUP_RAIL;
00786 main_types[CST_RAIL_UR].graphic=load_graphic(CST_RAIL_UR_G);
00787
00788 main_types[CST_RAIL_DR].group=GROUP_RAIL;
00789 main_types[CST_RAIL_DR].graphic=load_graphic(CST_RAIL_DR_G);
00790
00791 main_types[CST_RAIL_LUR].group=GROUP_RAIL;
00792 main_types[CST_RAIL_LUR].graphic=load_graphic(CST_RAIL_LUR_G);
00793
00794 main_types[CST_RAIL_LDR].group=GROUP_RAIL;
00795 main_types[CST_RAIL_LDR].graphic=load_graphic(CST_RAIL_LDR_G);
00796
00797 main_types[CST_RAIL_LUD].group=GROUP_RAIL;
00798 main_types[CST_RAIL_LUD].graphic=load_graphic(CST_RAIL_LUD_G);
00799
00800 prog_box("",30);
00801
00802 main_types[CST_RAIL_UDR].group=GROUP_RAIL;
00803 main_types[CST_RAIL_UDR].graphic=load_graphic(CST_RAIL_UDR_G);
00804
00805 main_types[CST_RAIL_LUDR].group=GROUP_RAIL;
00806 main_types[CST_RAIL_LUDR].graphic=load_graphic(CST_RAIL_LUDR_G);
00807
00808 main_types[CST_ROAD_LR].group=GROUP_ROAD;
00809 main_types[CST_ROAD_LR].graphic=load_graphic(CST_ROAD_LR_G);
00810
00811 main_types[CST_ROAD_LU].group=GROUP_ROAD;
00812 main_types[CST_ROAD_LU].graphic=load_graphic(CST_ROAD_LU_G);
00813
00814 main_types[CST_ROAD_LD].group=GROUP_ROAD;
00815 main_types[CST_ROAD_LD].graphic=load_graphic(CST_ROAD_LD_G);
00816
00817 main_types[CST_ROAD_UD].group=GROUP_ROAD;
00818 main_types[CST_ROAD_UD].graphic=load_graphic(CST_ROAD_UD_G);
00819
00820 main_types[CST_ROAD_UR].group=GROUP_ROAD;
00821 main_types[CST_ROAD_UR].graphic=load_graphic(CST_ROAD_UR_G);
00822
00823 main_types[CST_ROAD_DR].group=GROUP_ROAD;
00824 main_types[CST_ROAD_DR].graphic=load_graphic(CST_ROAD_DR_G);
00825
00826 main_types[CST_ROAD_LUR].group=GROUP_ROAD;
00827 main_types[CST_ROAD_LUR].graphic=load_graphic(CST_ROAD_LUR_G);
00828
00829 main_types[CST_ROAD_LDR].group=GROUP_ROAD;
00830 main_types[CST_ROAD_LDR].graphic=load_graphic(CST_ROAD_LDR_G);
00831
00832 main_types[CST_ROAD_LUD].group=GROUP_ROAD;
00833 main_types[CST_ROAD_LUD].graphic=load_graphic(CST_ROAD_LUD_G);
00834
00835 main_types[CST_ROAD_UDR].group=GROUP_ROAD;
00836 main_types[CST_ROAD_UDR].graphic=load_graphic(CST_ROAD_UDR_G);
00837
00838 main_types[CST_ROAD_LUDR].group=GROUP_ROAD;
00839 main_types[CST_ROAD_LUDR].graphic=load_graphic(CST_ROAD_LUDR_G);
00840
00841 main_types[CST_INDUSTRY_L_C].group=GROUP_INDUSTRY_L;
00842 main_types[CST_INDUSTRY_L_C].graphic
00843 =load_graphic(CST_INDUSTRY_L_C_G);
00844
00845 main_types[CST_INDUSTRY_L_Q1].group=GROUP_INDUSTRY_L;
00846 main_types[CST_INDUSTRY_L_Q1].graphic
00847 =load_graphic(CST_INDUSTRY_L_Q1_G);
00848
00849 main_types[CST_INDUSTRY_L_Q2].group=GROUP_INDUSTRY_L;
00850 main_types[CST_INDUSTRY_L_Q2].graphic
00851 =load_graphic(CST_INDUSTRY_L_Q2_G);
00852
00853 main_types[CST_INDUSTRY_L_Q3].group=GROUP_INDUSTRY_L;
00854 main_types[CST_INDUSTRY_L_Q3].graphic
00855 =load_graphic(CST_INDUSTRY_L_Q3_G);
00856
00857 main_types[CST_INDUSTRY_L_Q4].group=GROUP_INDUSTRY_L;
00858 main_types[CST_INDUSTRY_L_Q4].graphic
00859 =load_graphic(CST_INDUSTRY_L_Q4_G);
00860
00861 main_types[CST_INDUSTRY_L_L1].group=GROUP_INDUSTRY_L;
00862 main_types[CST_INDUSTRY_L_L1].graphic
00863 =load_graphic(CST_INDUSTRY_L_L1_G);
00864
00865 main_types[CST_INDUSTRY_L_L2].group=GROUP_INDUSTRY_L;
00866 main_types[CST_INDUSTRY_L_L2].graphic
00867 =load_graphic(CST_INDUSTRY_L_L2_G);
00868
00869 main_types[CST_INDUSTRY_L_L3].group=GROUP_INDUSTRY_L;
00870 main_types[CST_INDUSTRY_L_L3].graphic
00871 =load_graphic(CST_INDUSTRY_L_L3_G);
00872
00873 main_types[CST_INDUSTRY_L_L4].group=GROUP_INDUSTRY_L;
00874 main_types[CST_INDUSTRY_L_L4].graphic
00875 =load_graphic(CST_INDUSTRY_L_L4_G);
00876
00877
00878 main_types[CST_INDUSTRY_L_M1].group=GROUP_INDUSTRY_L;
00879 main_types[CST_INDUSTRY_L_M1].graphic
00880 =load_graphic(CST_INDUSTRY_L_M1_G);
00881
00882 main_types[CST_INDUSTRY_L_M2].group=GROUP_INDUSTRY_L;
00883 main_types[CST_INDUSTRY_L_M2].graphic
00884 =load_graphic(CST_INDUSTRY_L_M2_G);
00885
00886 main_types[CST_INDUSTRY_L_M3].group=GROUP_INDUSTRY_L;
00887 main_types[CST_INDUSTRY_L_M3].graphic
00888 =load_graphic(CST_INDUSTRY_L_M3_G);
00889
00890 main_types[CST_INDUSTRY_L_M4].group=GROUP_INDUSTRY_L;
00891 main_types[CST_INDUSTRY_L_M4].graphic
00892 =load_graphic(CST_INDUSTRY_L_M4_G);
00893
00894
00895 main_types[CST_INDUSTRY_L_H1].group=GROUP_INDUSTRY_L;
00896 main_types[CST_INDUSTRY_L_H1].graphic
00897 =load_graphic(CST_INDUSTRY_L_H1_G);
00898
00899 main_types[CST_INDUSTRY_L_H2].group=GROUP_INDUSTRY_L;
00900 main_types[CST_INDUSTRY_L_H2].graphic
00901 =load_graphic(CST_INDUSTRY_L_H2_G);
00902
00903 main_types[CST_INDUSTRY_L_H3].group=GROUP_INDUSTRY_L;
00904 main_types[CST_INDUSTRY_L_H3].graphic
00905 =load_graphic(CST_INDUSTRY_L_H3_G);
00906
00907 main_types[CST_INDUSTRY_L_H4].group=GROUP_INDUSTRY_L;
00908 main_types[CST_INDUSTRY_L_H4].graphic
00909 =load_graphic(CST_INDUSTRY_L_H4_G);
00910
00911
00912
00913 main_types[CST_COMMUNE_1].group=GROUP_COMMUNE;
00914 main_types[CST_COMMUNE_1].graphic=load_graphic(CST_COMMUNE_1_G);
00915
00916 main_types[CST_COMMUNE_2].group=GROUP_COMMUNE;
00917 main_types[CST_COMMUNE_2].graphic=load_graphic(CST_COMMUNE_2_G);
00918
00919 main_types[CST_COMMUNE_3].group=GROUP_COMMUNE;
00920 main_types[CST_COMMUNE_3].graphic=load_graphic(CST_COMMUNE_3_G);
00921
00922 main_types[CST_COMMUNE_4].group=GROUP_COMMUNE;
00923 main_types[CST_COMMUNE_4].graphic=load_graphic(CST_COMMUNE_4_G);
00924
00925 main_types[CST_COMMUNE_5].group=GROUP_COMMUNE;
00926 main_types[CST_COMMUNE_5].graphic=load_graphic(CST_COMMUNE_5_G);
00927
00928 main_types[CST_COMMUNE_6].group=GROUP_COMMUNE;
00929 main_types[CST_COMMUNE_6].graphic=load_graphic(CST_COMMUNE_6_G);
00930
00931 main_types[CST_COMMUNE_7].group=GROUP_COMMUNE;
00932 main_types[CST_COMMUNE_7].graphic=load_graphic(CST_COMMUNE_7_G);
00933
00934 main_types[CST_COMMUNE_8].group=GROUP_COMMUNE;
00935 main_types[CST_COMMUNE_8].graphic=load_graphic(CST_COMMUNE_8_G);
00936
00937 main_types[CST_COMMUNE_9].group=GROUP_COMMUNE;
00938 main_types[CST_COMMUNE_9].graphic=load_graphic(CST_COMMUNE_9_G);
00939
00940 main_types[CST_COMMUNE_10].group=GROUP_COMMUNE;
00941 main_types[CST_COMMUNE_10].graphic=load_graphic(CST_COMMUNE_10_G);
00942
00943 main_types[CST_COMMUNE_11].group=GROUP_COMMUNE;
00944 main_types[CST_COMMUNE_11].graphic=load_graphic(CST_COMMUNE_11_G);
00945
00946 main_types[CST_COMMUNE_12].group=GROUP_COMMUNE;
00947 main_types[CST_COMMUNE_12].graphic=load_graphic(CST_COMMUNE_12_G);
00948
00949 main_types[CST_COMMUNE_13].group=GROUP_COMMUNE;
00950 main_types[CST_COMMUNE_13].graphic=load_graphic(CST_COMMUNE_13_G);
00951
00952 main_types[CST_COMMUNE_14].group=GROUP_COMMUNE;
00953 main_types[CST_COMMUNE_14].graphic=load_graphic(CST_COMMUNE_14_G);
00954
00955
00956 main_types[CST_UNIVERSITY].group=GROUP_UNIVERSITY;
00957 main_types[CST_UNIVERSITY].graphic=load_graphic(CST_UNIVERSITY_G);
00958
00959 main_types[CST_OREMINE_1].group=GROUP_OREMINE;
00960 main_types[CST_OREMINE_1].graphic=load_graphic(CST_OREMINE_1_G);
00961
00962 main_types[CST_OREMINE_2].group=GROUP_OREMINE;
00963 main_types[CST_OREMINE_2].graphic=load_graphic(CST_OREMINE_2_G);
00964
00965 main_types[CST_OREMINE_3].group=GROUP_OREMINE;
00966 main_types[CST_OREMINE_3].graphic=load_graphic(CST_OREMINE_3_G);
00967
00968 main_types[CST_OREMINE_4].group=GROUP_OREMINE;
00969 main_types[CST_OREMINE_4].graphic=load_graphic(CST_OREMINE_4_G);
00970
00971 main_types[CST_OREMINE_5].group=GROUP_OREMINE;
00972 main_types[CST_OREMINE_5].graphic=load_graphic(CST_OREMINE_5_G);
00973
00974 main_types[CST_OREMINE_6].group=GROUP_OREMINE;
00975 main_types[CST_OREMINE_6].graphic=load_graphic(CST_OREMINE_6_G);
00976
00977 main_types[CST_OREMINE_7].group=GROUP_OREMINE;
00978 main_types[CST_OREMINE_7].graphic=load_graphic(CST_OREMINE_7_G);
00979
00980 main_types[CST_OREMINE_8].group=GROUP_OREMINE;
00981 main_types[CST_OREMINE_8].graphic=load_graphic(CST_OREMINE_8_G);
00982
00983 main_types[CST_TIP_0].group=GROUP_TIP;
00984 main_types[CST_TIP_0].graphic=load_graphic(CST_TIP_0_G);
00985
00986 main_types[CST_TIP_1].group=GROUP_TIP;
00987 main_types[CST_TIP_1].graphic=load_graphic(CST_TIP_1_G);
00988
00989 main_types[CST_TIP_2].group=GROUP_TIP;
00990 main_types[CST_TIP_2].graphic=load_graphic(CST_TIP_2_G);
00991
00992 main_types[CST_TIP_3].group=GROUP_TIP;
00993 main_types[CST_TIP_3].graphic=load_graphic(CST_TIP_3_G);
00994
00995 main_types[CST_TIP_4].group=GROUP_TIP;
00996 main_types[CST_TIP_4].graphic=load_graphic(CST_TIP_4_G);
00997
00998 main_types[CST_TIP_5].group=GROUP_TIP;
00999 main_types[CST_TIP_5].graphic=load_graphic(CST_TIP_5_G);
01000
01001 main_types[CST_TIP_6].group=GROUP_TIP;
01002 main_types[CST_TIP_6].graphic=load_graphic(CST_TIP_6_G);
01003
01004 main_types[CST_TIP_7].group=GROUP_TIP;
01005 main_types[CST_TIP_7].graphic=load_graphic(CST_TIP_7_G);
01006
01007 main_types[CST_TIP_8].group=GROUP_TIP;
01008 main_types[CST_TIP_8].graphic=load_graphic(CST_TIP_8_G);
01009
01010
01011 main_types[CST_EX_PORT].group=GROUP_PORT;
01012 main_types[CST_EX_PORT].graphic=load_graphic(CST_EX_PORT_G);
01013
01014
01015 main_types[CST_INDUSTRY_H_C].group=GROUP_INDUSTRY_H;
01016 main_types[CST_INDUSTRY_H_C].graphic
01017 =load_graphic(CST_INDUSTRY_H_C_G);
01018
01019 main_types[CST_INDUSTRY_H_L1].group=GROUP_INDUSTRY_H;
01020 main_types[CST_INDUSTRY_H_L1].graphic
01021 =load_graphic(CST_INDUSTRY_H_L1_G);
01022
01023 main_types[CST_INDUSTRY_H_L2].group=GROUP_INDUSTRY_H;
01024 main_types[CST_INDUSTRY_H_L2].graphic
01025 =load_graphic(CST_INDUSTRY_H_L2_G);
01026
01027 main_types[CST_INDUSTRY_H_L3].group=GROUP_INDUSTRY_H;
01028 main_types[CST_INDUSTRY_H_L3].graphic
01029 =load_graphic(CST_INDUSTRY_H_L3_G);
01030
01031 main_types[CST_INDUSTRY_H_L4].group=GROUP_INDUSTRY_H;
01032 main_types[CST_INDUSTRY_H_L4].graphic
01033 =load_graphic(CST_INDUSTRY_H_L4_G);
01034
01035 main_types[CST_INDUSTRY_H_L5].group=GROUP_INDUSTRY_H;
01036 main_types[CST_INDUSTRY_H_L5].graphic
01037 =load_graphic(CST_INDUSTRY_H_L5_G);
01038
01039 main_types[CST_INDUSTRY_H_L6].group=GROUP_INDUSTRY_H;
01040 main_types[CST_INDUSTRY_H_L6].graphic
01041 =load_graphic(CST_INDUSTRY_H_L6_G);
01042
01043 main_types[CST_INDUSTRY_H_L7].group=GROUP_INDUSTRY_H;
01044 main_types[CST_INDUSTRY_H_L7].graphic
01045 =load_graphic(CST_INDUSTRY_H_L7_G);
01046
01047 main_types[CST_INDUSTRY_H_L8].group=GROUP_INDUSTRY_H;
01048 main_types[CST_INDUSTRY_H_L8].graphic
01049 =load_graphic(CST_INDUSTRY_H_L8_G);
01050
01051
01052 main_types[CST_INDUSTRY_H_M1].group=GROUP_INDUSTRY_H;
01053 main_types[CST_INDUSTRY_H_M1].graphic
01054 =load_graphic(CST_INDUSTRY_H_M1_G);
01055
01056 main_types[CST_INDUSTRY_H_M2].group=GROUP_INDUSTRY_H;
01057 main_types[CST_INDUSTRY_H_M2].graphic
01058 =load_graphic(CST_INDUSTRY_H_M2_G);
01059
01060 main_types[CST_INDUSTRY_H_M3].group=GROUP_INDUSTRY_H;
01061 main_types[CST_INDUSTRY_H_M3].graphic
01062 =load_graphic(CST_INDUSTRY_H_M3_G);
01063
01064 main_types[CST_INDUSTRY_H_M4].group=GROUP_INDUSTRY_H;
01065 main_types[CST_INDUSTRY_H_M4].graphic
01066 =load_graphic(CST_INDUSTRY_H_M4_G);
01067
01068 main_types[CST_INDUSTRY_H_M5].group=GROUP_INDUSTRY_H;
01069 main_types[CST_INDUSTRY_H_M5].graphic
01070 =load_graphic(CST_INDUSTRY_H_M5_G);
01071
01072 main_types[CST_INDUSTRY_H_M6].group=GROUP_INDUSTRY_H;
01073 main_types[CST_INDUSTRY_H_M6].graphic
01074 =load_graphic(CST_INDUSTRY_H_M6_G);
01075
01076 main_types[CST_INDUSTRY_H_M7].group=GROUP_INDUSTRY_H;
01077 main_types[CST_INDUSTRY_H_M7].graphic
01078 =load_graphic(CST_INDUSTRY_H_M7_G);
01079
01080 main_types[CST_INDUSTRY_H_M8].group=GROUP_INDUSTRY_H;
01081 main_types[CST_INDUSTRY_H_M8].graphic
01082 =load_graphic(CST_INDUSTRY_H_M8_G);
01083
01084 main_types[CST_INDUSTRY_H_H1].group=GROUP_INDUSTRY_H;
01085 main_types[CST_INDUSTRY_H_H1].graphic
01086 =load_graphic(CST_INDUSTRY_H_H1_G);
01087
01088 main_types[CST_INDUSTRY_H_H2].group=GROUP_INDUSTRY_H;
01089 main_types[CST_INDUSTRY_H_H2].graphic
01090 =load_graphic(CST_INDUSTRY_H_H2_G);
01091
01092 main_types[CST_INDUSTRY_H_H3].group=GROUP_INDUSTRY_H;
01093 main_types[CST_INDUSTRY_H_H3].graphic
01094 =load_graphic(CST_INDUSTRY_H_H3_G);
01095
01096 main_types[CST_INDUSTRY_H_H4].group=GROUP_INDUSTRY_H;
01097 main_types[CST_INDUSTRY_H_H4].graphic
01098 =load_graphic(CST_INDUSTRY_H_H4_G);
01099
01100 main_types[CST_INDUSTRY_H_H5].group=GROUP_INDUSTRY_H;
01101 main_types[CST_INDUSTRY_H_H5].graphic
01102 =load_graphic(CST_INDUSTRY_H_H5_G);
01103
01104 main_types[CST_INDUSTRY_H_H6].group=GROUP_INDUSTRY_H;
01105 main_types[CST_INDUSTRY_H_H6].graphic
01106 =load_graphic(CST_INDUSTRY_H_H6_G);
01107
01108 main_types[CST_INDUSTRY_H_H7].group=GROUP_INDUSTRY_H;
01109 main_types[CST_INDUSTRY_H_H7].graphic
01110 =load_graphic(CST_INDUSTRY_H_H7_G);
01111
01112 main_types[CST_INDUSTRY_H_H8].group=GROUP_INDUSTRY_H;
01113 main_types[CST_INDUSTRY_H_H8].graphic
01114 =load_graphic(CST_INDUSTRY_H_H8_G);
01115
01116
01117 main_types[CST_PARKLAND_PLANE].group=GROUP_PARKLAND;
01118 main_types[CST_PARKLAND_PLANE].graphic
01119 =load_graphic(CST_PARKLAND_PLANE_G);
01120
01121 prog_box("",50);
01122
01123 main_types[CST_PARKLAND_LAKE].group=GROUP_PARKLAND;
01124 main_types[CST_PARKLAND_LAKE].graphic
01125 =load_graphic(CST_PARKLAND_LAKE_G);
01126
01127 main_types[CST_RECYCLE].group=GROUP_RECYCLE;
01128 main_types[CST_RECYCLE].graphic=load_graphic(CST_RECYCLE_G);
01129
01130 main_types[CST_WATER].group=GROUP_WATER;
01131 main_types[CST_WATER].graphic=load_graphic(CST_WATER_G);
01132
01133 main_types[CST_WATER_D].group=GROUP_WATER;
01134 main_types[CST_WATER_D].graphic=load_graphic(CST_WATER_D_G);
01135
01136 main_types[CST_WATER_R].group=GROUP_WATER;
01137 main_types[CST_WATER_R].graphic=load_graphic(CST_WATER_R_G);
01138
01139 main_types[CST_WATER_U].group=GROUP_WATER;
01140 main_types[CST_WATER_U].graphic=load_graphic(CST_WATER_U_G);
01141
01142 main_types[CST_WATER_L].group=GROUP_WATER;
01143 main_types[CST_WATER_L].graphic=load_graphic(CST_WATER_L_G);
01144
01145 main_types[CST_WATER_LR].group=GROUP_WATER;
01146 main_types[CST_WATER_LR].graphic=load_graphic(CST_WATER_LR_G);
01147
01148 main_types[CST_WATER_UD].group=GROUP_WATER;
01149 main_types[CST_WATER_UD].graphic=load_graphic(CST_WATER_UD_G);
01150
01151 main_types[CST_WATER_LD].group=GROUP_WATER;
01152 main_types[CST_WATER_LD].graphic=load_graphic(CST_WATER_LD_G);
01153
01154 main_types[CST_WATER_RD].group=GROUP_WATER;
01155 main_types[CST_WATER_RD].graphic=load_graphic(CST_WATER_RD_G);
01156
01157 main_types[CST_WATER_LU].group=GROUP_WATER;
01158 main_types[CST_WATER_LU].graphic=load_graphic(CST_WATER_LU_G);
01159
01160 main_types[CST_WATER_UR].group=GROUP_WATER;
01161 main_types[CST_WATER_UR].graphic=load_graphic(CST_WATER_UR_G);
01162
01163 main_types[CST_WATER_LUD].group=GROUP_WATER;
01164 main_types[CST_WATER_LUD].graphic=load_graphic(CST_WATER_LUD_G);
01165
01166 main_types[CST_WATER_LRD].group=GROUP_WATER;
01167 main_types[CST_WATER_LRD].graphic=load_graphic(CST_WATER_LRD_G);
01168
01169 main_types[CST_WATER_LUR].group=GROUP_WATER;
01170 main_types[CST_WATER_LUR].graphic=load_graphic(CST_WATER_LUR_G);
01171
01172 main_types[CST_WATER_URD].group=GROUP_WATER;
01173 main_types[CST_WATER_URD].graphic=load_graphic(CST_WATER_URD_G);
01174
01175 main_types[CST_WATER_LURD].group=GROUP_WATER;
01176 main_types[CST_WATER_LURD].graphic=load_graphic(CST_WATER_LURD_G);
01177
01178
01179 main_types[CST_HEALTH].group=GROUP_HEALTH;
01180 main_types[CST_HEALTH].graphic=load_graphic(CST_HEALTH_G);
01181
01182 main_types[CST_ROCKET_1].group=GROUP_ROCKET;
01183 main_types[CST_ROCKET_1].graphic=load_graphic(CST_ROCKET_1_G);
01184
01185 main_types[CST_ROCKET_2].group=GROUP_ROCKET;
01186 main_types[CST_ROCKET_2].graphic=load_graphic(CST_ROCKET_2_G);
01187
01188 main_types[CST_ROCKET_3].group=GROUP_ROCKET;
01189 main_types[CST_ROCKET_3].graphic=load_graphic(CST_ROCKET_3_G);
01190
01191 main_types[CST_ROCKET_4].group=GROUP_ROCKET;
01192 main_types[CST_ROCKET_4].graphic=load_graphic(CST_ROCKET_4_G);
01193
01194 prog_box("",60);
01195
01196 main_types[CST_ROCKET_5].group=GROUP_ROCKET;
01197 main_types[CST_ROCKET_5].graphic=load_graphic(CST_ROCKET_5_G);
01198
01199 main_types[CST_ROCKET_6].group=GROUP_ROCKET;
01200 main_types[CST_ROCKET_6].graphic=load_graphic(CST_ROCKET_6_G);
01201
01202 main_types[CST_ROCKET_7].group=GROUP_ROCKET;
01203 main_types[CST_ROCKET_7].graphic=load_graphic(CST_ROCKET_7_G);
01204
01205 main_types[CST_ROCKET_FLOWN].group=GROUP_ROCKET;
01206 main_types[CST_ROCKET_FLOWN].graphic
01207 =load_graphic(CST_ROCKET_FLOWN_G);
01208
01209 main_types[CST_BURNT].group=GROUP_BURNT;
01210 main_types[CST_BURNT].graphic=load_graphic(CST_BURNT_G);
01211
01212 main_types[CST_WINDMILL_1_G].group=GROUP_WINDMILL;
01213 main_types[CST_WINDMILL_1_G].graphic
01214 =load_graphic(CST_WINDMILL_1_G_G);
01215
01216 main_types[CST_WINDMILL_2_G].group=GROUP_WINDMILL;
01217 main_types[CST_WINDMILL_2_G].graphic
01218 =load_graphic(CST_WINDMILL_2_G_G);
01219
01220 main_types[CST_WINDMILL_3_G].group=GROUP_WINDMILL;
01221 main_types[CST_WINDMILL_3_G].graphic
01222 =load_graphic(CST_WINDMILL_3_G_G);
01223
01224 main_types[CST_WINDMILL_1_RG].group=GROUP_WINDMILL;
01225 main_types[CST_WINDMILL_1_RG].graphic
01226 =load_graphic(CST_WINDMILL_1_RG_G);
01227
01228 main_types[CST_WINDMILL_2_RG].group=GROUP_WINDMILL;
01229 main_types[CST_WINDMILL_2_RG].graphic
01230 =load_graphic(CST_WINDMILL_2_RG_G);
01231
01232 main_types[CST_WINDMILL_3_RG].group=GROUP_WINDMILL;
01233 main_types[CST_WINDMILL_3_RG].graphic
01234 =load_graphic(CST_WINDMILL_3_RG_G);
01235
01236 main_types[CST_WINDMILL_1_R].group=GROUP_WINDMILL;
01237 main_types[CST_WINDMILL_1_R].graphic
01238 =load_graphic(CST_WINDMILL_1_R_G);
01239
01240 main_types[CST_WINDMILL_2_R].group=GROUP_WINDMILL;
01241 main_types[CST_WINDMILL_2_R].graphic
01242 =load_graphic(CST_WINDMILL_2_R_G);
01243
01244 main_types[CST_WINDMILL_3_R].group=GROUP_WINDMILL;
01245 main_types[CST_WINDMILL_3_R].graphic
01246 =load_graphic(CST_WINDMILL_3_R_G);
01247
01248 main_types[CST_WINDMILL_1_W].group=GROUP_WINDMILL;
01249 main_types[CST_WINDMILL_1_W].graphic
01250 =load_graphic(CST_WINDMILL_1_W_G);
01251
01252 main_types[CST_WINDMILL_2_W].group=GROUP_WINDMILL;
01253 main_types[CST_WINDMILL_2_W].graphic
01254 =load_graphic(CST_WINDMILL_2_W_G);
01255
01256 main_types[CST_WINDMILL_3_W].group=GROUP_WINDMILL;
01257 main_types[CST_WINDMILL_3_W].graphic
01258 =load_graphic(CST_WINDMILL_3_W_G);
01259
01260
01261 main_types[CST_MONUMENT_0].group=GROUP_MONUMENT;
01262 main_types[CST_MONUMENT_0].graphic=load_graphic(CST_MONUMENT_0_G);
01263
01264 main_types[CST_MONUMENT_1].group=GROUP_MONUMENT;
01265 main_types[CST_MONUMENT_1].graphic=load_graphic(CST_MONUMENT_1_G);
01266
01267 main_types[CST_MONUMENT_2].group=GROUP_MONUMENT;
01268 main_types[CST_MONUMENT_2].graphic=load_graphic(CST_MONUMENT_2_G);
01269
01270 main_types[CST_MONUMENT_3].group=GROUP_MONUMENT;
01271 main_types[CST_MONUMENT_3].graphic=load_graphic(CST_MONUMENT_3_G);
01272
01273 main_types[CST_MONUMENT_4].group=GROUP_MONUMENT;
01274 main_types[CST_MONUMENT_4].graphic=load_graphic(CST_MONUMENT_4_G);
01275
01276 main_types[CST_MONUMENT_5].group=GROUP_MONUMENT;
01277 main_types[CST_MONUMENT_5].graphic=load_graphic(CST_MONUMENT_5_G);
01278
01279
01280 main_types[CST_SCHOOL].group=GROUP_SCHOOL;
01281 main_types[CST_SCHOOL].graphic=load_graphic(CST_SCHOOL_G);
01282
01283 main_types[CST_BLACKSMITH_0].group=GROUP_BLACKSMITH;
01284 main_types[CST_BLACKSMITH_0].graphic
01285 =load_graphic(CST_BLACKSMITH_0_G);
01286
01287 main_types[CST_BLACKSMITH_1].group=GROUP_BLACKSMITH;
01288 main_types[CST_BLACKSMITH_1].graphic
01289 =load_graphic(CST_BLACKSMITH_1_G);
01290
01291 main_types[CST_BLACKSMITH_2].group=GROUP_BLACKSMITH;
01292 main_types[CST_BLACKSMITH_2].graphic
01293 =load_graphic(CST_BLACKSMITH_2_G);
01294
01295 main_types[CST_BLACKSMITH_3].group=GROUP_BLACKSMITH;
01296 main_types[CST_BLACKSMITH_3].graphic
01297 =load_graphic(CST_BLACKSMITH_3_G);
01298
01299 main_types[CST_BLACKSMITH_4].group=GROUP_BLACKSMITH;
01300 main_types[CST_BLACKSMITH_4].graphic
01301 =load_graphic(CST_BLACKSMITH_4_G);
01302
01303 main_types[CST_BLACKSMITH_5].group=GROUP_BLACKSMITH;
01304 main_types[CST_BLACKSMITH_5].graphic
01305 =load_graphic(CST_BLACKSMITH_5_G);
01306
01307 main_types[CST_BLACKSMITH_6].group=GROUP_BLACKSMITH;
01308 main_types[CST_BLACKSMITH_6].graphic
01309 =load_graphic(CST_BLACKSMITH_6_G);
01310
01311 prog_box("",75);
01312
01313 main_types[CST_MILL_0].group=GROUP_MILL;
01314 main_types[CST_MILL_0].graphic=load_graphic(CST_MILL_0_G);
01315
01316 main_types[CST_MILL_1].group=GROUP_MILL;
01317 main_types[CST_MILL_1].graphic=load_graphic(CST_MILL_1_G);
01318
01319 main_types[CST_MILL_2].group=GROUP_MILL;
01320 main_types[CST_MILL_2].graphic=load_graphic(CST_MILL_2_G);
01321
01322 main_types[CST_MILL_3].group=GROUP_MILL;
01323 main_types[CST_MILL_3].graphic=load_graphic(CST_MILL_3_G);
01324
01325 main_types[CST_MILL_4].group=GROUP_MILL;
01326 main_types[CST_MILL_4].graphic=load_graphic(CST_MILL_4_G);
01327
01328 main_types[CST_MILL_5].group=GROUP_MILL;
01329 main_types[CST_MILL_5].graphic=load_graphic(CST_MILL_5_G);
01330
01331 main_types[CST_MILL_6].group=GROUP_MILL;
01332 main_types[CST_MILL_6].graphic=load_graphic(CST_MILL_6_G);
01333
01334 main_types[CST_POTTERY_0].group=GROUP_POTTERY;
01335 main_types[CST_POTTERY_0].graphic=load_graphic(CST_POTTERY_0_G);
01336
01337 main_types[CST_POTTERY_1].group=GROUP_POTTERY;
01338 main_types[CST_POTTERY_1].graphic=load_graphic(CST_POTTERY_1_G);
01339
01340 main_types[CST_POTTERY_2].group=GROUP_POTTERY;
01341 main_types[CST_POTTERY_2].graphic=load_graphic(CST_POTTERY_2_G);
01342
01343 main_types[CST_POTTERY_3].group=GROUP_POTTERY;
01344 main_types[CST_POTTERY_3].graphic=load_graphic(CST_POTTERY_3_G);
01345
01346 main_types[CST_POTTERY_4].group=GROUP_POTTERY;
01347 main_types[CST_POTTERY_4].graphic=load_graphic(CST_POTTERY_4_G);
01348
01349 main_types[CST_POTTERY_5].group=GROUP_POTTERY;
01350 main_types[CST_POTTERY_5].graphic=load_graphic(CST_POTTERY_5_G);
01351
01352 main_types[CST_POTTERY_6].group=GROUP_POTTERY;
01353 main_types[CST_POTTERY_6].graphic=load_graphic(CST_POTTERY_6_G);
01354
01355 main_types[CST_POTTERY_7].group=GROUP_POTTERY;
01356 main_types[CST_POTTERY_7].graphic=load_graphic(CST_POTTERY_7_G);
01357
01358 main_types[CST_POTTERY_8].group=GROUP_POTTERY;
01359 main_types[CST_POTTERY_8].graphic=load_graphic(CST_POTTERY_8_G);
01360
01361 main_types[CST_POTTERY_9].group=GROUP_POTTERY;
01362 main_types[CST_POTTERY_9].graphic=load_graphic(CST_POTTERY_9_G);
01363
01364 main_types[CST_POTTERY_10].group=GROUP_POTTERY;
01365 main_types[CST_POTTERY_10].graphic=load_graphic(CST_POTTERY_10_G);
01366
01367 main_types[CST_FIRESTATION_1].group=GROUP_FIRESTATION;
01368 main_types[CST_FIRESTATION_1].graphic
01369 =load_graphic(CST_FIRESTATION_1_G);
01370
01371 main_types[CST_FIRESTATION_2].group=GROUP_FIRESTATION;
01372 main_types[CST_FIRESTATION_2].graphic
01373 =load_graphic(CST_FIRESTATION_2_G);
01374
01375 main_types[CST_FIRESTATION_3].group=GROUP_FIRESTATION;
01376 main_types[CST_FIRESTATION_3].graphic
01377 =load_graphic(CST_FIRESTATION_3_G);
01378
01379 main_types[CST_FIRESTATION_4].group=GROUP_FIRESTATION;
01380 main_types[CST_FIRESTATION_4].graphic
01381 =load_graphic(CST_FIRESTATION_4_G);
01382
01383 main_types[CST_FIRESTATION_5].group=GROUP_FIRESTATION;
01384 main_types[CST_FIRESTATION_5].graphic
01385 =load_graphic(CST_FIRESTATION_5_G);
01386
01387 main_types[CST_FIRESTATION_6].group=GROUP_FIRESTATION;
01388 main_types[CST_FIRESTATION_6].graphic
01389 =load_graphic(CST_FIRESTATION_6_G);
01390
01391 main_types[CST_FIRESTATION_7].group=GROUP_FIRESTATION;
01392 main_types[CST_FIRESTATION_7].graphic
01393 =load_graphic(CST_FIRESTATION_7_G);
01394
01395 main_types[CST_FIRESTATION_8].group=GROUP_FIRESTATION;
01396 main_types[CST_FIRESTATION_8].graphic
01397 =load_graphic(CST_FIRESTATION_8_G);
01398
01399 main_types[CST_FIRESTATION_9].group=GROUP_FIRESTATION;
01400 main_types[CST_FIRESTATION_9].graphic
01401 =load_graphic(CST_FIRESTATION_9_G);
01402
01403 main_types[CST_FIRESTATION_10].group=GROUP_FIRESTATION;
01404 main_types[CST_FIRESTATION_10].graphic
01405 =load_graphic(CST_FIRESTATION_10_G);
01406
01407
01408 main_types[CST_CRICKET_1].group=GROUP_CRICKET;
01409 main_types[CST_CRICKET_1].graphic
01410 =load_graphic(CST_CRICKET_1_G);
01411
01412 main_types[CST_CRICKET_2].group=GROUP_CRICKET;
01413 main_types[CST_CRICKET_2].graphic
01414 =load_graphic(CST_CRICKET_2_G);
01415
01416 main_types[CST_CRICKET_3].group=GROUP_CRICKET;
01417 main_types[CST_CRICKET_3].graphic
01418 =load_graphic(CST_CRICKET_3_G);
01419
01420 main_types[CST_CRICKET_4].group=GROUP_CRICKET;
01421 main_types[CST_CRICKET_4].graphic
01422 =load_graphic(CST_CRICKET_4_G);
01423
01424 prog_box("",90);
01425
01426 main_types[CST_CRICKET_5].group=GROUP_CRICKET;
01427 main_types[CST_CRICKET_5].graphic
01428 =load_graphic(CST_CRICKET_5_G);
01429
01430 main_types[CST_CRICKET_6].group=GROUP_CRICKET;
01431 main_types[CST_CRICKET_6].graphic
01432 =load_graphic(CST_CRICKET_6_G);
01433
01434 main_types[CST_CRICKET_7].group=GROUP_CRICKET;
01435 main_types[CST_CRICKET_7].graphic
01436 =load_graphic(CST_CRICKET_7_G);
01437
01438 main_types[CST_FIRE_1].group=GROUP_FIRE;
01439 main_types[CST_FIRE_1].graphic
01440 =load_graphic(CST_FIRE_1_G);
01441
01442 main_types[CST_FIRE_2].group=GROUP_FIRE;
01443 main_types[CST_FIRE_2].graphic
01444 =load_graphic(CST_FIRE_2_G);
01445
01446 main_types[CST_FIRE_3].group=GROUP_FIRE;
01447 main_types[CST_FIRE_3].graphic
01448 =load_graphic(CST_FIRE_3_G);
01449
01450 main_types[CST_FIRE_4].group=GROUP_FIRE;
01451 main_types[CST_FIRE_4].graphic
01452 =load_graphic(CST_FIRE_4_G);
01453
01454 main_types[CST_FIRE_5].group=GROUP_FIRE;
01455 main_types[CST_FIRE_5].graphic
01456 =load_graphic(CST_FIRE_5_G);
01457
01458 main_types[CST_FIRE_DONE1].group=GROUP_FIRE;
01459 main_types[CST_FIRE_DONE1].graphic
01460 =load_graphic(CST_FIRE_DONE1_G);
01461
01462 main_types[CST_FIRE_DONE2].group=GROUP_FIRE;
01463 main_types[CST_FIRE_DONE2].graphic
01464 =load_graphic(CST_FIRE_DONE2_G);
01465
01466 main_types[CST_FIRE_DONE3].group=GROUP_FIRE;
01467 main_types[CST_FIRE_DONE3].graphic
01468 =load_graphic(CST_FIRE_DONE3_G);
01469
01470 main_types[CST_FIRE_DONE4].group=GROUP_FIRE;
01471 main_types[CST_FIRE_DONE4].graphic
01472 =load_graphic(CST_FIRE_DONE4_G);
01473
01474 main_types[CST_SHANTY].group=GROUP_SHANTY;
01475 main_types[CST_SHANTY].graphic=load_graphic(CST_SHANTY_G);
01476
01477 main_types[CST_USED].group=GROUP_USED;
01478 main_types[CST_USED].graphic=0; /* Won't be dereferenced! */
01479 }
|
|
|
Definition at line 855 of file picedit.c. 00856 {
00857 #ifdef LC_X11
00858 char cpf[100];
00859 int i;
00860 FILE *finf;
00861 strcpy (cpf, LIBDIR);
00862 strcat (cpf, FONTFILE);
00863 if ((finf = fopen (cpf, "r")) == 0)
00864 HandleError ("Can't open the font file", FATAL);
00865 for (i = 0; i < 256 * 8; i++)
00866 myfont[i] = fgetc (finf);
00867 fclose (finf);
00868 #else
00869 void *font;
00870 font = malloc (256 * 8 * 8 * BYTESPERPIXEL);
00871 gl_expandfont (8, 8, white (24), gl_font8x8, font);
00872 gl_setfont (8, 8, font);
00873 #endif
00874 }
|
|
|
Definition at line 834 of file simulate.c. 00835 {
00836 income_tax_rate = INCOME_TAX_RATE;
00837 coal_tax_rate = COAL_TAX_RATE;
00838 goods_tax_rate = GOODS_TAX_RATE;
00839 dole_rate = DOLE_RATE;
00840 transport_cost_rate = TRANSPORT_COST_RATE;
00841 import_cost_rate = IM_PORT_COST_RATE;
00842 }
|
|
|
Definition at line 619 of file ldsvgui.c.
|
|
|
Definition at line 545 of file module_buttons.c. 00546 {
00547 int i, j;
00548 for (i = 0; i < 32; i++)
00549 if (sbut[i] == button)
00550 {
00551 j = i;
00552 return (j);
00553 }
00554 /* XXX: do we need this debug stuff? */
00555 /* GCS: This is a fatal error. Probably OK. */
00556 printf ("Button=%d\n", button);
00557 for (i = 0; i < 32; i++)
00558 printf ("%5d", sbut[i]);
00559 printf ("\n");
00560 do_error ("An inv_sbut error has happened.");
00561 return (-1); /* can't get here */
00562 }
|
|
||||||||||||
|
Definition at line 2548 of file engine.c. 02549 {
02550 int i, r, xx, yy, xxx, yyy;
02551 rockets_launched++;
02552 MP_TYPE(x,y) = CST_ROCKET_FLOWN;
02553 update_main_screen (0);
02554 r = rand () % MAX_TECH_LEVEL;
02555 if (r > tech_level || rand () % 100 > (rockets_launched * 15 + 25)) {
02556 /* the launch failed */
02557 display_rocket_result_dialog (ROCKET_LAUNCH_BAD);
02558 rockets_launched_success = 0;
02559 xx = ((rand () % 40) - 20) + x;
02560 yy = ((rand () % 40) - 20) + y;
02561 for (i = 0; i < 20; i++) {
02562 xxx = ((rand () % 20) - 10) + xx;
02563 yyy = ((rand () % 20) - 10) + yy;
02564 if (xxx > 0 && xxx < WORLD_SIDE_LEN
02565 && yyy > 0 && yyy < WORLD_SIDE_LEN) {
02566 /* don't crash on it's own area */
02567 if (xxx >= x && xxx < (x + 4) && yyy >= y && yyy < (y + 4))
02568 continue;
02569 fire_area (xxx, yyy);
02570 /* make a sound perhaps */
02571 }
02572 }
02573 } else {
02574 rockets_launched_success++;
02575 if (rockets_launched_success > 5) {
02576 remove_people (1000);
02577 if (people_pool || housed_population)
02578 display_rocket_result_dialog (ROCKET_LAUNCH_EVAC);
02579 } else {
02580 display_rocket_result_dialog (ROCKET_LAUNCH_GOOD);
02581 }
02582 }
02583 }
|
|
|
Definition at line 67 of file timer.c. 00068 {
00069 #if defined (WIN32)
00070 /* This function will usually sleep too long. For example, if t == 0
00071 (e.g. 1 usec), thread will sleep for the remainder of its timeslice,
00072 which might be 20 ms.
00073 */
00074 SleepEx (t / 1000, FALSE);
00075 #else
00076 struct timeval timeout;
00077 timeout.tv_sec = t / 1000000;
00078 timeout.tv_usec = t - 1000000 * timeout.tv_sec;
00079 select (1, NULL, NULL, NULL, &timeout);
00080 #endif
00081 }
|
|
||||||||||||
|
|
|
|
Definition at line 1440 of file picedit.c. 01441 {
01442 char s[256], s1[256];
01443 int i;
01444 FILE *rc;
01445
01446 strcpy (s, getenv ("HOME"));
01447 strcat (s, "/");
01448 strcat (s, ".lincityrc");
01449 if ((rc = fopen (s, "r")) == 0)
01450 {
01451 do
01452 {
01453 strcpy (s1, "cat ");
01454 strcat (s1, LIBDIR);
01455 strcat (s1, "/messages/mousetype.mes");
01456 system (s1);
01457 i = getchar ();
01458 }
01459 while (i < '0' || i > '6');
01460 if ((rc = fopen (s, "w")) == 0)
01461 {
01462 printf ("Can't open %s for writing, can't continue \n ", s);
01463 exit (1);
01464 }
01465 fprintf (rc, "mouse=%d\n", i - '0');
01466 fclose (rc);
01467 chown (s, getuid (), getgid ());
01468 if ((rc = fopen (s, "r")) == 0)
01469 {
01470 printf ("What!! can't open %s for reading after writing???\n", s);
01471 exit (1);
01472 }
01473 }
01474 while (feof (rc) == 0)
01475 {
01476 fgets (s, 99, rc);
01477 if (sscanf (s, "mouse=%d", &i) != 0)
01478 lc_mouse_type = i;
01479 }
01480 fclose (rc);
01481 }
|
|
|
Definition at line 347 of file ldsvguts.c. 00348 {
00349 unsigned long q;
00350 int i, x, y, z, n, p, ver;
00351 int num_pbars, pbar_data_size;
00352 int pbar_tmp;
00353 int dummy;
00354 FILE *ofile;
00355 char s[256];
00356 if ((ofile = fopen_read_gzipped (cname)) == NULL) {
00357 printf (_("Can't open <%s> (gzipped)"), cname);
00358 do_error ("Can't open it!");
00359 }
00360 fscanf (ofile, "%d", &ver);
00361 if (ver < MIN_LOAD_VERSION) {
00362 ok_dial_box ("too-old.mes", BAD, 0L);
00363 fclose_read_gzipped (ofile);
00364 return;
00365 }
00366
00367 init_pbars();
00368 num_pbars = NUM_PBARS;
00369 pbar_data_size = PBAR_DATA_SIZE;
00370
00371 init_inventory();
00372
00373 print_time_for_year();
00374 q = (unsigned long) sizeof (Map_Point_Info);
00375 prog_box (_("Loading scene"), 0);
00376
00377 for (x = 0; x < WORLD_SIDE_LEN; x++) {
00378 for (y = 0; y < WORLD_SIDE_LEN; y++) {
00379 for (z = 0; z < sizeof(int); z++) {
00380 fscanf (ofile, "%d", &n);
00381 *(((unsigned char *) &MP_INFO(x,y).population) + z) = n;
00382 }
00383 for (z = 0; z < sizeof(int); z++) {
00384 fscanf (ofile, "%d", &n);
00385 *(((unsigned char *) &MP_INFO(x,y).flags) + z) = n;
00386 }
00387 for (z = 0; z < sizeof(unsigned short); z++) {
00388 fscanf (ofile, "%d", &n);
00389 *(((unsigned char *) &MP_INFO(x,y).coal_reserve) + z) = n;
00390 }
00391 for (z = 0; z < sizeof(unsigned short); z++) {
00392 fscanf (ofile, "%d", &n);
00393 *(((unsigned char *) &MP_INFO(x,y).ore_reserve) + z) = n;
00394 }
00395 for (z = 0; z < sizeof(int); z++) {
00396 fscanf (ofile, "%d", &n);
00397 *(((unsigned char *) &MP_INFO(x,y).int_1) + z) = n;
00398 }
00399 for (z = 0; z < sizeof(int); z++) {
00400 fscanf (ofile, "%d", &n);
00401 *(((unsigned char *) &MP_INFO(x,y).int_2) + z) = n;
00402 }
00403 for (z = 0; z < sizeof(int); z++) {
00404 fscanf (ofile, "%d", &n);
00405 *(((unsigned char *) &MP_INFO(x,y).int_3) + z) = n;
00406 }
00407 for (z = 0; z < sizeof(int); z++) {
00408 fscanf (ofile, "%d", &n);
00409 *(((unsigned char *) &MP_INFO(x,y).int_4) + z) = n;
00410 }
00411 for (z = 0; z < sizeof(int); z++) {
00412 fscanf (ofile, "%d", &n);
00413 *(((unsigned char *) &MP_INFO(x,y).int_5) + z) = n;
00414 }
00415 for (z = 0; z < sizeof(int); z++) {
00416 fscanf (ofile, "%d", &n);
00417 *(((unsigned char *) &MP_INFO(x,y).int_6) + z) = n;
00418 }
00419 for (z = 0; z < sizeof(int); z++) {
00420 fscanf (ofile, "%d", &n);
00421 *(((unsigned char *) &MP_INFO(x,y).int_7) + z) = n;
00422 }
00423 fscanf (ofile, "%d", &n);
00424 MP_POL(x,y) = (unsigned short) n;
00425 fscanf (ofile, "%d", &n);
00426 MP_TYPE(x,y) = (short) n;
00427
00428 if (get_group_of_type(MP_TYPE(x,y)) == GROUP_MARKET)
00429 inventory(x,y);
00430 }
00431 if (((93 * x) / WORLD_SIDE_LEN) % 3 == 0)
00432 prog_box ("", (93 * x) / WORLD_SIDE_LEN);
00433 }
00434 check_endian ();
00435 set_map_groups ();
00436
00437 fscanf (ofile, "%d", &main_screen_originx);
00438 fscanf (ofile, "%d", &main_screen_originy);
00439 if (main_screen_originx > WORLD_SIDE_LEN - scr.main_win.w / 16 - 1)
00440 main_screen_originx = WORLD_SIDE_LEN - scr.main_win.w / 16 - 1;
00441
00442 if (main_screen_originy > WORLD_SIDE_LEN - scr.main_win.h / 16 - 1)
00443 main_screen_originy = WORLD_SIDE_LEN - scr.main_win.h / 16 - 1;
00444
00445 fscanf (ofile, "%d", &total_time);
00446 if (ver <= MM_MS_C_VER)
00447 i = OLD_MAX_NUMOF_SUBSTATIONS;
00448 else
00449 i = MAX_NUMOF_SUBSTATIONS;
00450 for (x = 0; x < i; x++)
00451 {
00452 fscanf (ofile, "%d", &substationx[x]);
00453 fscanf (ofile, "%d", &substationy[x]);
00454 }
00455 prog_box ("", 92);
00456 fscanf (ofile, "%d", &numof_substations);
00457 if (ver <= MM_MS_C_VER)
00458 i = OLD_MAX_NUMOF_MARKETS;
00459 else
00460 i = MAX_NUMOF_MARKETS;
00461 for (x = 0; x < i; x++)
00462 {
00463 fscanf (ofile, "%d", &marketx[x]);
00464 fscanf (ofile, "%d", &markety[x]);
00465 }
00466 prog_box ("", 94);
00467 fscanf (ofile, "%d", &numof_markets);
00468 fscanf (ofile, "%d", &people_pool);
00469 fscanf (ofile, "%d", &total_money);
00470 fscanf (ofile, "%d", &income_tax_rate);
00471 fscanf (ofile, "%d", &coal_tax_rate);
00472 fscanf (ofile, "%d", &dole_rate);
00473 fscanf (ofile, "%d", &transport_cost_rate);
00474 fscanf (ofile, "%d", &goods_tax_rate);
00475 fscanf (ofile, "%d", &export_tax);
00476 fscanf (ofile, "%d", &export_tax_rate);
00477 fscanf (ofile, "%d", &import_cost);
00478 fscanf (ofile, "%d", &import_cost_rate);
00479 fscanf (ofile, "%d", &tech_level);
00480 if (tech_level > MODERN_WINDMILL_TECH)
00481 modern_windmill_flag = 1;
00482 fscanf (ofile, "%d", &tpopulation);
00483 fscanf (ofile, "%d", &tstarving_population);
00484 fscanf (ofile, "%d", &tunemployed_population);
00485 fscanf (ofile, "%d", &x); /* waste_goods obsolete */
00486 fscanf (ofile, "%d", &power_made);
00487 fscanf (ofile, "%d", &power_used);
00488 fscanf (ofile, "%d", &coal_made);
00489 fscanf (ofile, "%d", &coal_used);
00490 fscanf (ofile, "%d", &goods_made);
00491 fscanf (ofile, "%d", &goods_used);
00492 fscanf (ofile, "%d", &ore_made);
00493 fscanf (ofile, "%d", &ore_used);
00494 fscanf (ofile, "%d", &dummy); /* &diff_old_population */
00495
00496 /* Update variables calculated from those above */
00497 housed_population = tpopulation / NUMOF_DAYS_IN_MONTH;
00498
00499 prog_box ("", 96);
00500 /* Get size of monthgraph array */
00501 if (ver <= MG_C_VER) {
00502 i = 120;
00503 } else {
00504 fscanf (ofile, "%d", &i);
00505 }
00506 for (x = 0; x < i; x++) {
00507 /* If more entries in file than will fit on screen,
00508 then we need to skip past them. */
00509 if (x >= monthgraph_size) {
00510 fscanf (ofile, "%d", &dummy); /* &monthgraph_pop[x] */
00511 fscanf (ofile, "%d", &dummy); /* &monthgraph_starve[x] */
00512 fscanf (ofile, "%d", &dummy); /* &monthgraph_nojobs[x] */
00513 fscanf (ofile, "%d", &dummy); /* &monthgraph_ppool[x] */
00514 } else {
00515 fscanf (ofile, "%d", &monthgraph_pop[x]);
00516 fscanf (ofile, "%d", &monthgraph_starve[x]);
00517 fscanf (ofile, "%d", &monthgraph_nojobs[x]);
00518 fscanf (ofile, "%d", &monthgraph_ppool[x]);
00519 }
00520 /* If our save file is old, skip past obsolete diffgraph entries */
00521 if (ver <= MG_C_VER) {
00522 fscanf (ofile, "%d", &dummy); /* &diffgraph_power[x] */
00523 fscanf (ofile, "%d", &dummy); /* &diffgraph_coal[x] */
00524 fscanf (ofile, "%d", &dummy); /* &diffgraph_goods[x] */
00525 fscanf (ofile, "%d", &dummy); /* &diffgraph_ore[x] */
00526 fscanf (ofile, "%d", &dummy); /* &diffgraph_population[x] */
00527 }
00528 }
00529 /* If screen bigger than number of entries in file, pad with zeroes */
00530 while (x < monthgraph_size) {
00531 monthgraph_pop[x] = 0;
00532 monthgraph_starve[x] = 0;
00533 monthgraph_nojobs[x] = 0;
00534 monthgraph_ppool[x] = 0;
00535 x++;
00536 }
00537 prog_box ("", 98);
00538 fscanf (ofile, "%d", &rockets_launched);
00539 fscanf (ofile, "%d", &rockets_launched_success);
00540 fscanf (ofile, "%d", &coal_survey_done);
00541
00542 for (x = 0; x < pbar_data_size; x++) {
00543 for (p = 0; p < num_pbars; p++) {
00544 fscanf (ofile, "%d", &(pbar_tmp));
00545 update_pbar(p,pbar_tmp,1);
00546 /* fscanf (ofile, "%d", &(pbars[p].data[x])); */
00547 }
00548 }
00549
00550 for (p = 0; p < num_pbars; p++)
00551 pbars[p].data_size = pbar_data_size;
00552
00553 prog_box ("", 99);
00554
00555 for (p = 0; p < num_pbars; p++) {
00556 fscanf (ofile, "%d", &(pbars[p].oldtot));
00557 fscanf (ofile, "%d", &(pbars[p].diff));
00558 }
00559
00560
00561 fscanf (ofile, "%d", &cheat_flag);
00562 fscanf (ofile, "%d", &total_pollution_deaths);
00563 fscanf (ofile, "%f", &pollution_deaths_history);
00564 fscanf (ofile, "%d", &total_starve_deaths);
00565 fscanf (ofile, "%f", &starve_deaths_history);
00566 fscanf (ofile, "%d", &total_unemployed_years);
00567 fscanf (ofile, "%f", &unemployed_history);
00568 fscanf (ofile, "%d", &max_pop_ever);
00569 fscanf (ofile, "%d", &total_evacuated);
00570 fscanf (ofile, "%d", &total_births);
00571 for (x = 0; x < NUMOF_MODULES; x++)
00572 fscanf (ofile, "%d", &(module_help_flag[x]));
00573 fscanf (ofile, "%d", &x); /* just dummy reads */
00574 fscanf (ofile, "%d", &x); /* for backwards compatibility. */
00575
00576 /* 10 dummy strings, for missed out things, have been put in save. */
00577 /* Input from this point uses them. */
00578 /* XXX: WCK: Huh? Missed out things? */
00579
00580 fscanf (ofile, "%128s", given_scene);
00581 if (strncmp (given_scene, "dummy", 5) == 0 || strlen (given_scene) < 3)
00582 given_scene[0] = 0;
00583 fscanf (ofile, "%128s", s);
00584 if (strncmp (given_scene, "dummy", 5) != 0)
00585 sscanf (s, "%d", &highest_tech_level);
00586 else
00587 highest_tech_level = 0;
00588 fgets (s, 80, ofile); /* this is the CR */
00589
00590 fgets (s, 80, ofile);
00591 if (sscanf (s, "sust %d %d %d %d %d %d %d %d %d %d"
00592 ,&sust_dig_ore_coal_count, &sust_port_count
00593 ,&sust_old_money_count, &sust_old_population_count
00594 ,&sust_old_tech_count, &sust_fire_count
00595 ,&sust_old_money, &sust_old_population, &sust_old_tech
00596 ,&sustain_flag) == 10)
00597 {
00598 sust_dig_ore_coal_tip_flag = sust_port_flag = 1;
00599 /* GCS FIX: Check after loading file if screen is drawn OK */
00600 /* draw_sustainable_window (); */
00601 }
00602 else
00603 sustain_flag = sust_dig_ore_coal_count = sust_port_count
00604 = sust_old_money_count = sust_old_population_count
00605 = sust_old_tech_count = sust_fire_count
00606 = sust_old_money = sust_old_population = sust_old_tech = 0;
00607 fclose_read_gzipped (ofile);
00608
00609 numof_shanties = count_groups (GROUP_SHANTY);
00610 numof_communes = count_groups (GROUP_COMMUNE);
00611 prog_box ("", 100);
00612
00613 /* set up the university intake. */
00614 x = count_groups (GROUP_UNIVERSITY);
00615 if (x > 0) {
00616 university_intake_rate
00617 = (count_groups (GROUP_SCHOOL) * 20) / x;
00618 if (university_intake_rate > 100)
00619 university_intake_rate = 100;
00620 }
00621 else
00622 university_intake_rate = 50;
00623 for (x = 0; x < WORLD_SIDE_LEN; x++)
00624 {
00625 for (y = 0; y < WORLD_SIDE_LEN; y++)
00626 {
00627 update_tech_dep (x, y);
00628 }
00629 }
00630
00631 unhighlight_module_button (selected_module);
00632 selected_module = sbut[7]; /* 7 is track. Watch out though! */
00633 highlight_module_button (selected_module);
00634 set_selected_module (CST_TRACK_LR);
00635
00636 print_total_money ();
00637 reset_animation_times ();
00638 map_power_grid (); /* WCK: Is this safe to do here? */
00639 }
|
|
|
Definition at line 644 of file fileutil.c. 00645 {
00646 int x,l;
00647 char ss[LC_PATH_MAX],*graphic;
00648 FILE *inf;
00649 strcpy(ss,graphic_path);
00650 strcat(ss,s);
00651 if ((inf=fopen(ss,"rb"))==NULL)
00652 {
00653 strcat(ss," -- UNABLE TO LOAD");
00654 do_error(ss);
00655 }
00656 fseek(inf,0L,SEEK_END);
00657 l=ftell(inf);
00658 fseek(inf,0L,SEEK_SET);
00659 graphic=(char *)malloc(l);
00660 for (x=0;x<l;x++)
00661 *(graphic+x)=fgetc(inf);
00662 fclose(inf);
00663 return(graphic);
00664 }
|
|
|
Definition at line 343 of file ldsvgui.c. 00344 {
00345 char *cname = (char *) malloc (strlen (opening_path) + strlen (s) + 2);
00346 sprintf (cname, "%s%c%s", opening_path, PATH_SLASH, s);
00347 load_city (cname);
00348 free (cname);
00349
00350 strcpy (given_scene, s);
00351 db_flag = 0;
00352 cs_mouse_handler (0, -1, 0);
00353 cs_mouse_handler (0, 1, 0);
00354 /* GCS: Should I hide_mouse() here, as is done in do_load_city above? */
00355 hide_mouse ();
00356 Fgl_setfontcolors (TEXT_BG_COLOUR, TEXT_FG_COLOUR);
00357 refresh_main_screen ();
00358 suppress_ok_buttons = 1;
00359 update_avail_modules (0);
00360 suppress_ok_buttons = 0;
00361 /* GCS: ?? */
00362 redraw_mouse ();
00363 }
|
|
|
|
|
|
Definition at line 49 of file splash.c. 00050 {
00051 #ifdef LC_X11
00052 XColor pal[256];
00053 XEvent xev;
00054 #endif
00055 long x, y, l, r, g, b;
00056 FILE *fp;
00057
00058 fp = fopen_read_gzipped (opening_pic);
00059 if (fp == NULL) {
00060 return;
00061 }
00062
00063 for (x = 0; x < 7; x++)
00064 l = fgetc (fp);
00065 l &= 0xff;
00066 if (l == 0)
00067 l = 256;
00068 for (x = 0; x < l; x++)
00069 {
00070 r = fgetc (fp);
00071 g = fgetc (fp);
00072 b = fgetc (fp);
00073 #ifdef LC_X11
00074 pal[x].red = r;
00075 pal[x].green = g;
00076 pal[x].blue = b;
00077 pal[x].flags = DoRed | DoGreen | DoBlue;
00078 #else
00079 gl_setpalettecolor (x, r, g, b);
00080 #endif
00081 }
00082 /* use last 4 colours for text */
00083 #ifdef LC_X11
00084 pal[SI_BLACK].red = 0;
00085 pal[SI_BLACK].green = 0;
00086 pal[SI_BLACK].blue = 0;
00087 pal[SI_BLACK].flags = DoRed | DoGreen | DoBlue;
00088 pal[SI_RED].red = 60;
00089 pal[SI_RED].green = 0;
00090 pal[SI_RED].blue = 0;
00091 pal[SI_RED].flags = DoRed | DoGreen | DoBlue;
00092 pal[SI_GREEN].red = 0;
00093 pal[SI_GREEN].green = 60;
00094 pal[SI_GREEN].blue = 0;
00095 pal[SI_GREEN].flags = DoRed | DoGreen | DoBlue;
00096 pal[SI_YELLOW].red = 60;
00097 pal[SI_YELLOW].green = 60;
00098 pal[SI_YELLOW].blue = 0;
00099 pal[SI_YELLOW].flags = DoRed | DoGreen | DoBlue;
00100 open_setcustompalette (pal);
00101 suppress_next_expose = 1;
00102 do
00103 {
00104 while (XPending (display.dpy) == 0);
00105 XNextEvent (display.dpy, &xev);
00106 HandleEvent (&xev);
00107 }
00108 while (xev.type != MapNotify);
00109
00110 #else
00111 gl_setpalettecolor (SI_BLACK, 0, 0, 0);
00112 gl_setpalettecolor (SI_RED, 60, 0, 0);
00113 gl_setpalettecolor (SI_GREEN, 0, 60, 0);
00114 gl_setpalettecolor (SI_YELLOW, 60, 60, 0);
00115 #endif
00116 #if defined (WIN32)
00117 UpdatePalette ();
00118 #endif
00119 for (y = 0; y < 480; y++)
00120 for (x = 0; x < 640; x++)
00121 {
00122 l = fgetc (fp);
00123 /*
00124 // printf("l=%d x=%d y=%d ",l,x,y);
00125 // octree doesn't seem to want to generate images with 252 colours!
00126 // So the next best thing (well the easyest) is to just map the pixels
00127 // coloured as the last 4 colours to the 4 before that.
00128 // If it looks OK, leave it.
00129 */
00130 if (l == SI_BLACK)
00131 l = SI_BLACK - 4;
00132 if (l == SI_RED)
00133 l = SI_RED - 4;
00134 if (l == SI_GREEN)
00135 l = SI_GREEN - 4;
00136 if (l == SI_YELLOW)
00137 l = SI_YELLOW - 4;
00138 Fgl_setpixel (x, y, l);
00139 }
00140
00141 fclose_read_gzipped (fp);
00142
00143 #if defined (WIN32)
00144 RefreshScreen ();
00145 #endif
00146 start_image_text ();
00147 }
|
|
|
|
|
|
Definition at line 573 of file fileutil.c. 00574 {
00575 #if !defined (WIN32)
00576 DIR *dp;
00577 #endif
00578
00579 #if defined (commentout)
00580 if (make_dir_ok_flag == 0)
00581 return;
00582 #endif
00583
00584 #if defined (WIN32)
00585 if (_mkdir (lc_save_dir)) {
00586 printf (_("Couldn't create the save directory %s\n"), lc_save_dir);
00587 exit (-1);
00588 }
00589 #else
00590 mkdir (lc_save_dir, 0755);
00591 chown (lc_save_dir, getuid (), getgid ());
00592 if ((dp = opendir (lc_save_dir)) == NULL)
00593 {
00594 /* change this to a screen message. */
00595 printf (_("Couldn't create the save directory %s\n"), lc_save_dir);
00596 exit (1);
00597 }
00598 closedir (dp);
00599 #endif
00600
00601 #if defined (commentout)
00602 make_dir_ok_flag = 0;
00603 #endif
00604 }
|
|
|
Definition at line 637 of file fileutil.c. 00638 {
00639 printf (_("Out of memory: malloc failure\n"));
00640 exit (1);
00641 }
|
|
||||||||||||||||
|
Definition at line 441 of file simulate.c. 00442 {
00443 clear_game ();
00444 coal_reserve_setup ();
00445 setup_river ();
00446 ore_reserve_setup ();
00447 init_pbars ();
00448
00449 /* Initial population is 100 for empty board or 200
00450 for random village (100 are housed). */
00451 people_pool = 100;
00452
00453 if (random_village != 0) {
00454 random_start (originx, originy);
00455 update_pbar(PPOP,200,1); /* So pbars don't flash */
00456 } else {
00457 *originx = *originy = WORLD_SIDE_LEN/2 ;
00458 update_pbar(PPOP,100,1);
00459 }
00460 connect_transport (1,1,WORLD_SIDE_LEN-2,WORLD_SIDE_LEN-2);
00461 refresh_pbars ();
00462 }
|
|
|
Definition at line 42 of file engine.c. 00043 {
00044 if (total_money >= 0)
00045 return (0);
00046
00047 #ifdef GROUP_POWER_SOURCE_NO_CREDIT
00048 if (selected_group == GROUP_POWER_SOURCE) {
00049 return (1);
00050 }
00051 #endif
00052 #ifdef GROUP_UNIVERSITY_NO_CREDIT
00053 if (selected_group == GROUP_UNIVERSITY) {
00054 return (1);
00055 }
00056 #endif
00057 #ifdef GROUP_PARKLAND_NO_CREDIT
00058 if (selected_group == GROUP_PARKLAND) {
00059 return (1);
00060 }
00061 #endif
00062 #ifdef GROUP_RECYCLE_NO_CREDIT
00063 if (selected_group == GROUP_RECYCLE) {
00064 return (1);
00065 }
00066 #endif
00067 #ifdef GROUP_ROCKET
00068 if (selected_group == GROUP_ROCKET) {
00069 return (1);
00070 }
00071 #endif
00072
00073 if (main_groups[selected_group].no_credit == TRUE ) {
00074 return (1);
00075 }
00076 return (0);
00077 }
|
|
||||||||||||||||
|
Definition at line 2254 of file screen.c. 02255 {
02256 FILE *inf;
02257 struct stat statbuf;
02258 int colour;
02259 char * ss;
02260 char s[LC_PATH_MAX];
02261 int retval;
02262
02263 if (suppress_ok_buttons != 0)
02264 return;
02265 if (good_bad == GOOD || good_bad == RESULTS)
02266 colour = green (14);
02267 else if (good_bad == BAD)
02268 colour = red (12);
02269 else
02270 colour = white (12);
02271 if (good_bad == RESULTS)
02272 strcpy (s, fn);
02273 else
02274 {
02275 strcpy (s, message_path);
02276 strcat (s, fn);
02277 }
02278
02279 if ((inf = fopen (s, "rb")) == NULL)
02280 {
02281 printf ("Can't open message <%s> for OK dialog box\n", s);
02282 strcpy (s, message_path);
02283 strcat (s, "error.mes");
02284 if ((inf = fopen (s, "rb")) == NULL)
02285 {
02286 fprintf (stderr,
02287 "Can't open default message <%s> either\n", s);
02288 fprintf (stderr, " ...it was not displayed");
02289 return;
02290 }
02291 }
02292 stat(s,&statbuf);
02293
02294 ss = (char *)lcalloc(statbuf.st_size + 1);
02295 retval = fread(ss,sizeof(char),statbuf.st_size,inf);
02296 ss[statbuf.st_size] = '\0';
02297
02298 undosify_string (ss);
02299
02300 #if defined (commentout)
02301 if (xs != 0)
02302 dialog_box(colour,3,
02303 0,0,ss,
02304 0,0,xs,
02305 2,' ',_("OK"));
02306 else
02307 dialog_box(colour,2,
02308 0,0,ss,
02309 2,' ',_("OK"));
02310 #endif
02311 fclose(inf);
02312
02313 display_info_message (colour, ss, xs);
02314 }
|
|
|
|
|
|
Definition at line 489 of file simulate.c. 00490 {
00491 int x, y;
00492 for (y = 0; y < WORLD_SIDE_LEN; y++)
00493 for (x = 0; x < WORLD_SIDE_LEN; x++)
00494 MP_INFO(x,y).ore_reserve = ORE_RESERVE;
00495 }
|
|
||||||||||||
|
Definition at line 206 of file lcsvga.c. 00207 {
00208 int option;
00209 extern char *optarg;
00210
00211 /* GCS FIX: Need to print usage and exit when illegal option spec'd */
00212 while ((option = getopt (argc, argv, "wR:G:B:m:")) != EOF)
00213 {
00214 switch (option)
00215 {
00216 case 'm':
00217 sscanf (optarg, "%d", &vga_mode);
00218 if (vga_mode > 13 || vga_mode < 10)
00219 vga_mode = -1;
00220 break;
00221 case 'w':
00222 gamma_correct_red = GAMMA_CORRECT_RED;
00223 gamma_correct_green = GAMMA_CORRECT_GREEN;
00224 gamma_correct_blue = GAMMA_CORRECT_BLUE;
00225 break;
00226 case 'R':
00227 sscanf (optarg, "%f", &gamma_correct_red);
00228 break;
00229 case 'G':
00230 sscanf (optarg, "%f", &gamma_correct_green);
00231 break;
00232 case 'B':
00233 sscanf (optarg, "%f", &gamma_correct_blue);
00234 break;
00235 }
00236 }
00237 }
|
|
|
|
|
|
Definition at line 1839 of file screen.c. 01840 {
01841 char s[50];
01842 Rect* b = &scr.date;
01843 sprintf (s, _("Date %s %04d "), current_month(total_time),
01844 current_year(total_time));
01845 Fgl_write (b->x, b->y, s);
01846 #if defined (WIN32)
01847 UpdateWindow (display.hWnd);
01848 #endif
01849 }
|
|
|
Definition at line 815 of file main.c. 00816 {
00817 #if !defined (WIN32) /* GCS FIX: How should I do this? */
00818 char *s;
00819 if (compile_results () == 0)
00820 return;
00821 if ((s = (char *) malloc (lc_save_dir_len + strlen (LC_SAVE_DIR)
00822 + strlen (RESULTS_FILENAME) + 64)) == 0)
00823 malloc_failure ();
00824
00825 strcpy (s, "cat ");
00826 strcat (s, lc_save_dir);
00827 strcat (s, "/");
00828 strcat (s, RESULTS_FILENAME);
00829 printf ("\n");
00830 system (s);
00831 printf ("\n");
00832 #endif
00833 }
|
|
|
Definition at line 1660 of file screen.c. 01661 {
01662 static int flag = 0;
01663 int monthgraph_full_update = 0;
01664
01665 if (flag == 0) {
01666 initialize_print_stats ();
01667 flag = 1;
01668 }
01669
01670 #if !defined (WIN32)
01671 hide_mouse ();
01672 #endif
01673
01674 if (total_time % NUMOF_DAYS_IN_MONTH == (NUMOF_DAYS_IN_MONTH - 1)) {
01675 update_scoreboard.monthly = 1;
01676 }
01677 if (total_time % NUMOF_DAYS_IN_YEAR == (NUMOF_DAYS_IN_YEAR - 1)) {
01678 update_scoreboard.yearly_1 = 1;
01679 update_scoreboard.money = 1;
01680 }
01681 if ((total_time % NUMOF_DAYS_IN_YEAR) == 0) {
01682 update_scoreboard.yearly_2 = 1;
01683 }
01684 if (real_time > mappoint_stats_time) {
01685 update_scoreboard.mps = 1;
01686 mappoint_stats_time = real_time + 1000;
01687 }
01688 if (mini_screen_flags != MINI_SCREEN_NORMAL_FLAG
01689 && real_time > mini_screen_time) {
01690 update_scoreboard.mini = 1;
01691 mini_screen_time = real_time + 1000;
01692 }
01693 if ((total_time % NUMOF_DAYS_IN_YEAR) == 0) {
01694 calculate_time_for_year ();
01695 print_time_for_year ();
01696 }
01697 if (total_time % NUMOF_DAYS_IN_MONTH == 1) {
01698 update_scoreboard.date = 1;
01699 }
01700
01701 /* Decode and perform update requests according to scoreboard */
01702 if (update_scoreboard.mps) {
01703 update_scoreboard.mps = 0;
01704 /* Update the global style if timeout has occurred */
01705 if (help_flag || load_flag || save_flag || mappoint_stats_flag) {
01706 mps_global_style_timeout = real_time + 6000;
01707 }
01708 if (real_time > mps_global_style_timeout) {
01709 if (time_multiplex_stats) {
01710 advance_mps_style ();
01711 }
01712 }
01713 if (!mappoint_stats_flag) {
01714 mappoint_stats (-2, -2, mps_global_style);
01715 } else {
01716 mappoint_stats (-1, -1, -1);
01717 }
01718 }
01719
01720 if (update_scoreboard.mini) {
01721 update_scoreboard.mini = 0;
01722 update_mini_screen ();
01723 }
01724
01725 if (update_scoreboard.date) {
01726 update_scoreboard.date = 0;
01727 print_date ();
01728 }
01729
01730 if (update_scoreboard.money) {
01731 update_scoreboard.money = 0;
01732 print_total_money ();
01733 }
01734
01735 if (update_scoreboard.monthly) {
01736 update_scoreboard.monthly = 0;
01737
01738 /* Update the global style if timeout has occurred */
01739 if (help_flag || load_flag || save_flag) {
01740 if (monthgraph_style == MONTHGRAPH_STYLE_ECONOMY) {
01741 monthgraph_style_timeout = real_time + 10000;
01742 } else {
01743 monthgraph_style_timeout = real_time + 4000;
01744 }
01745 }
01746 if (real_time > monthgraph_style_timeout) {
01747 if (time_multiplex_stats) {
01748 monthgraph_full_update = 1;
01749 monthgraph_style = (monthgraph_style % 2) + 1;
01750 }
01751 if (monthgraph_style == MONTHGRAPH_STYLE_ECONOMY) {
01752 monthgraph_style_timeout = real_time + 10000;
01753 } else {
01754 monthgraph_style_timeout = real_time + 4000;
01755 }
01756 }
01757
01758 do_monthgraph (monthgraph_full_update);
01759
01760 #if defined (STATS_WINDOW)
01761 sprintf (s, "%5d ", housed_population + people_pool);
01762 Fgl_write (STATS_X + 8 * 11, STATS_Y, s);
01763 i = ((tstarving_population / NUMOF_DAYS_IN_MONTH)
01764 * 1000) / ((tpopulation / NUMOF_DAYS_IN_MONTH) + 1);
01765 sprintf (s, "%3d.%1d ", i / 10, i % 10);
01766 Fgl_write (STATS_X + 8 * 11, STATS_Y + 8, s);
01767 sprintf (s, "%5d ", tfood_in_markets / NUMOF_DAYS_IN_MONTH);
01768 Fgl_write (STATS_X + 8 * 11, STATS_Y + 16, s);
01769 i = ((tunemployed_population / NUMOF_DAYS_IN_MONTH)
01770 * 1000) / ((tpopulation / NUMOF_DAYS_IN_MONTH) + 1);
01771 sprintf (s, "%3d.%1d ", i / 10, i % 10);
01772 Fgl_write (STATS_X + 8 * 11, STATS_Y + 24, s);
01773 sprintf (s, "%5d ", numof_shanties);
01774 Fgl_write (STATS_X + 8 * (12 + 20), STATS_Y + 24, s);
01775 sprintf (s, "%5.1f ", (float) tech_level * 100.0 / MAX_TECH_LEVEL);
01776 Fgl_write (STATS_X + (20 + 12) * 8, STATS_Y, s);
01777 sprintf (s, "%5d ", unnat_deaths);
01778 Fgl_write (STATS_X + (20 + 12) * 8, STATS_Y + 8, s);
01779 #endif
01780
01781 update_pbars_monthly();
01782
01783 refresh_pbars();
01784
01785 /* GCS, May 11, 2003. Quick hack for SVGALIB. Basically,
01786 * I need to workaround the fact that a dialog box might pop
01787 * up, causing move_mouse() to nest hide_mouse() calls,
01788 * which means that the cursor will leave a trail. */
01789 #if !defined (WIN32)
01790 redraw_mouse ();
01791 #endif
01792 update_avail_modules (1);
01793 #if !defined (WIN32)
01794 hide_mouse ();
01795 #endif
01796 }
01797
01798 if (update_scoreboard.yearly_1) {
01799 update_scoreboard.yearly_1 = 0;
01800 }
01801
01802 if (update_scoreboard.message_area > 0
01803 && real_time > update_scoreboard.message_area) {
01804 reset_status_message ();
01805 }
01806
01807 #if defined (WIN32)
01808 UpdateWindow (display.hWnd);
01809 #else
01810 redraw_mouse ();
01811 #endif
01812 }
|
|
|
Definition at line 1815 of file screen.c. 01816 {
01817 Rect* b = &scr.money;
01818 char str[MONEY_W / CHAR_WIDTH + 1];
01819 size_t count;
01820
01821 count = sprintf(str, _("Money: "));
01822 count += commify(str + count, (MONEY_W / CHAR_WIDTH) - count, total_money);
01823 count += snprintf(str + count, (MONEY_W / CHAR_WIDTH) - count,
01824 " ");
01825 str[MONEY_W / CHAR_WIDTH] = '\0';
01826
01827 if (total_money < 0)
01828 Fgl_setfontcolors (TEXT_BG_COLOUR, red (30));
01829
01830 /* Fgl_putbox (b->x, b->y, 16, 16, money_pbar_graphic); */
01831 //Fgl_write (b->x + 16, b->y, str);
01832 Fgl_write (b->x + 32, b->y, str);
01833
01834 if (total_money < 0)
01835 Fgl_setfontcolors (TEXT_BG_COLOUR, TEXT_FG_COLOUR);
01836 }
|
|
||||||||||||
|
Definition at line 2389 of file screen.c. 02390 {
02391 static int flag = 0, oldpercent = 0;
02392 char s[100];
02393 int i;
02394 if (flag == 0) {
02395 hide_mouse ();
02396 Fgl_getbox (PROGBOXX - 8, PROGBOXY - 8, PROGBOXW + 16,
02397 PROGBOXH + 16, progbox);
02398 Fgl_fillbox (PROGBOXX, PROGBOXY,
02399 PROGBOXW, PROGBOXH, PROGBOX_BG_COLOUR);
02400 for (i = 1; i < 8; i++) {
02401 Fgl_hline (PROGBOXX - i, PROGBOXY - i,
02402 PROGBOXX + PROGBOXW + i - 1,
02403 PROGBOX_BG_COLOUR + i + i);
02404 Fgl_hline (PROGBOXX - i, PROGBOXY + PROGBOXH + i - 1,
02405 PROGBOXX + PROGBOXW + i - 1,
02406 PROGBOX_BG_COLOUR + i + i);
02407 Fgl_line (PROGBOXX - i, PROGBOXY - i,
02408 PROGBOXX - i, PROGBOXY + PROGBOXH + i - 1,
02409 PROGBOX_BG_COLOUR + i + i);
02410 Fgl_line (PROGBOXX + PROGBOXW + i - 1, PROGBOXY - i,
02411 PROGBOXX + PROGBOXW + i - 1,
02412 PROGBOXY + PROGBOXH + i - 1,
02413 PROGBOX_BG_COLOUR + i + i);
02414 }
02415
02416
02417 Fgl_setfontcolors (PROGBOX_BG_COLOUR, TEXT_FG_COLOUR);
02418 Fgl_write ((PROGBOXX + PROGBOXW / 2)
02419 - (strlen (title) * 4), PROGBOXY + 8, title);
02420 Fgl_setfontcolors (TEXT_BG_COLOUR, TEXT_FG_COLOUR);
02421
02422 flag = 1;
02423 }
02424 if (percent != oldpercent)
02425 {
02426 Fgl_fillbox (PROGBOXX + 20, PROGBOXY + 60,
02427 ((PROGBOXW - 40) * percent) / 100,
02428 20, PROGBOX_DONE_COL);
02429 Fgl_fillbox (PROGBOXX + 20 + (((PROGBOXW - 40) * percent) / 100),
02430 PROGBOXY + 60,
02431 PROGBOXW - 40 - (((PROGBOXW - 40) * percent) / 100),
02432 20, PROGBOX_NOTDONE_COL);
02433 oldpercent = percent;
02434 Fgl_fillbox (PROGBOXX + (PROGBOXW / 2) - 20,
02435 PROGBOXY + 24, 40, 16, PROGBOX_BG_COLOUR);
02436 sprintf (s, "%3d%%", percent);
02437 Fgl_setfontcolors (PROGBOX_BG_COLOUR, TEXT_FG_COLOUR);
02438 Fgl_write (PROGBOXX + (PROGBOXW / 2) - 20, PROGBOXY + 24, s);
02439 Fgl_setfontcolors (TEXT_BG_COLOUR, TEXT_FG_COLOUR);
02440 }
02441 #ifdef LC_X11
02442 XSync (display.dpy, FALSE);
02443 #endif
02444 if (percent < 100)
02445 {
02446 #if defined (WIN32) /* GCS FIX: Do I need this ????? */
02447 /* GCS: Fgl_putbox does a refresh; no need to refresh twice */
02448 RefreshArea (PROGBOXX - 8, PROGBOXY - 8, PROGBOXW + 16, PROGBOXH + 16);
02449 #endif
02450 return;
02451 }
02452
02453 Fgl_putbox (PROGBOXX - 8, PROGBOXY - 8, PROGBOXW + 16, PROGBOXH + 16, progbox);
02454 redraw_mouse ();
02455 flag = 0;
02456 }
|
|
||||||||||||||||
|
Definition at line 336 of file market.c. 00337 {
00338 int q;
00339 if (numof_markets > 0)
00340 {
00341 for (q = 0; q < numof_markets; q++)
00342 {
00343 if (MP_INFO(marketx[q],markety[q]).int_3
00344 >= (MAX_COAL_IN_MARKET - coal))
00345 continue;
00346 if ((abs (marketx[q] - x) < MARKET_RANGE)
00347 && (abs (markety[q] - y) < MARKET_RANGE))
00348 {
00349 MP_INFO(marketx[q],markety[q]).int_3 += coal;
00350 return (1);
00351 }
00352 }
00353 }
00354 if (put_stuff (x, y, coal, T_COAL) != 0)
00355 return (1);
00356 return (0);
00357 }
|
|
||||||||||||||||
|
Definition at line 88 of file market.c. 00089 {
00090 int q;
00091 if (numof_markets > 0)
00092 {
00093 for (q = 0; q < numof_markets; q++)
00094 {
00095 if (MP_INFO(marketx[q],markety[q]).int_1
00096 >= (MAX_FOOD_IN_MARKET - food))
00097 continue;
00098 if ((abs (marketx[q] - x) < ORG_FARM_RANGE)
00099 && (abs (markety[q] - y) < ORG_FARM_RANGE))
00100 {
00101 MP_INFO(marketx[q],markety[q]).int_1 += food;
00102 return (1);
00103 }
00104 }
00105 }
00106 if (put_stuff (x, y, food, T_FOOD) != 0)
00107 return (1);
00108 return (0);
00109 }
|
|
||||||||||||||||
|
Definition at line 145 of file market.c. 00146 {
00147 int q;
00148 if (numof_markets > 0)
00149 {
00150 for (q = 0; q < numof_markets; q++)
00151 {
00152 if (MP_INFO(marketx[q],markety[q]).int_4
00153 >= (MAX_GOODS_IN_MARKET - goods))
00154 continue;
00155 if ((abs (marketx[q] - x) < MARKET_RANGE)
00156 && (abs (markety[q] - y) < MARKET_RANGE))
00157 {
00158 MP_INFO(marketx[q],markety[q]).int_4 += goods;
00159 return (1);
00160 }
00161 }
00162 }
00163 if (put_stuff (x, y, goods, T_GOODS) != 0)
00164 return (1);
00165 return (0);
00166 }
|
|
||||||||||||||||
|
Definition at line 42 of file market.c. 00043 {
00044 int q;
00045 if (numof_markets > 0) {
00046 for (q = 0; q < numof_markets; q++) {
00047 if (MP_INFO(marketx[q],markety[q]).int_2
00048 >= (MAX_JOBS_IN_MARKET - jobs))
00049 continue;
00050 if (abs (marketx[q] - x) < EMPLOYER_RANGE
00051 && abs (markety[q] - y) < EMPLOYER_RANGE)
00052 {
00053 MP_INFO(marketx[q],markety[q]).int_2 += jobs;
00054 return (1);
00055 }
00056 }
00057 }
00058 if (put_stuff (x, y, jobs, T_JOBS) != 0) {
00059 return (1);
00060 }
00061 return (0);
00062 }
|
|
||||||||||||||||
|
Definition at line 288 of file market.c. 00289 {
00290 int q;
00291 if (numof_markets > 0)
00292 {
00293 for (q = 0; q < numof_markets; q++)
00294 {
00295 if (MP_INFO(marketx[q],markety[q]).int_5
00296 >= (MAX_ORE_IN_MARKET - ore))
00297 continue;
00298 if ((abs (marketx[q] - x) < MARKET_RANGE)
00299 && (abs (markety[q] - y) < MARKET_RANGE))
00300 {
00301 MP_INFO(marketx[q],markety[q]).int_5 += ore;
00302 return (1);
00303 }
00304 }
00305 }
00306 if (put_stuff (x, y, ore, T_ORE) != 0)
00307 return (1);
00308 return (0);
00309 }
|
|
||||||||||||||||
|
Definition at line 240 of file market.c. 00241 {
00242 int q;
00243 if (numof_markets > 0)
00244 {
00245 for (q = 0; q < numof_markets; q++)
00246 {
00247 if (MP_INFO(marketx[q],markety[q]).int_6
00248 >= (MAX_STEEL_IN_MARKET - steel))
00249 continue;
00250 if ((abs (marketx[q] - x) < MARKET_RANGE)
00251 && (abs (markety[q] - y) < MARKET_RANGE))
00252 {
00253 MP_INFO(marketx[q],markety[q]).int_6 += steel;
00254 return (1);
00255 }
00256 }
00257 }
00258 if (put_stuff (x, y, steel, T_STEEL) != 0)
00259 return (1);
00260 return (0);
00261 }
|
|
||||||||||||||||||||
|
Definition at line 925 of file market.c. 00926 {
00927 int res = 0;
00928 short *type = &MP_TYPE(x,y);
00929 Map_Point_Info *minfo = &MP_INFO(x,y);
00930 switch (MP_SIZE(x,y))
00931 {
00932 case 2:
00933 res = put_stuff2 (minfo, type, stuff, stuff_type);
00934 break;
00935 case 3:
00936 res = put_stuff3 (minfo, type, stuff, stuff_type);
00937 break;
00938 case 4:
00939 res = put_stuff4 (minfo, type, stuff, stuff_type);
00940 break;
00941 default:
00942 do_error ("Bad area size in put_stuff()");
00943 }
00944 return res;
00945 }
|
|
||||||||||||||||||||
|
Definition at line 968 of file market.c. 00969 {
00970 static int tstart2 = 0;
00971 int i, st, tst, *ip, tp = 0;
00972 struct stack stack[8], *ssp; /* stack is really a pipe -- (ThMO) */
00973
00974 /* we'll stack our found pointers so to avoid re-looping and
00975 * testing again (ThMO) */
00976
00977 tst = tstart2;
00978
00979 /* can we put enough on the transport? */
00980
00981 for (ssp = stack, st = 0, i = 0; i < 8; i++) {
00982 int map_index = t2[tst];
00983 if (minfo[map_index].flags & FLAG_IS_TRANSPORT) {
00984 switch (get_group_of_type(type[map_index]))
00985 {
00986 case GROUP_TRACK:
00987 tp = tmax[0][stuff_type];
00988 break;
00989 case GROUP_ROAD:
00990 tp = tmax[1][stuff_type];
00991 break;
00992 case GROUP_RAIL:
00993 tp = tmax[2][stuff_type];
00994 break;
00995 default:
00996 do_error ("Bad transport type in put_stuff2");
00997 }
00998 ip = &minfo[map_index].int_1;
00999 ssp->ip = ip += stuff_type; /* push it -- (ThMO) */
01000 ssp++->max_val = tp;
01001 st += tp - *ip;
01002 if (st >= stuff) {
01003 ssp = stack;
01004 do {
01005 tp = ssp->max_val - *ssp->ip; /* pop it -- (ThMO) */
01006 if ((stuff -= tp) < 0)
01007 *ssp->ip += tp + stuff; /* == orig. stuff -- (ThMO) */
01008 else
01009 *ssp->ip = ssp->max_val;
01010 ++ssp;
01011 } while (stuff > 0);
01012 tstart2 = ++tst & 7;
01013 return (1);
01014 }
01015 }
01016 if (++tst >= 8)
01017 tst = 0;
01018 }
01019 return (0);
01020 }
|
|
||||||||||||||||||||
|
Definition at line 1024 of file market.c. 01025 {
01026 static int tstart3 = 0;
01027 int i, st, tst, *ip, tp = 0;
01028 struct stack stack[12], *ssp; /* stack is really a pipe -- (ThMO)
01029 we'll stack our found pointers so
01030 to avoid re-looping and
01031 testing again (ThMO) */
01032
01033 tst = tstart3;
01034
01035 /* can we put enough on the transport? */
01036
01037 for (ssp = stack, st = 0, i = 0; i < 12; i++) {
01038 int map_index = t3[tst];
01039 if (minfo[map_index].flags & FLAG_IS_TRANSPORT) {
01040 switch (get_group_of_type(type[map_index]))
01041 {
01042 case GROUP_TRACK:
01043 tp = tmax[0][stuff_type];
01044 break;
01045 case GROUP_ROAD:
01046 tp = tmax[1][stuff_type];
01047 break;
01048 case GROUP_RAIL:
01049 tp = tmax[2][stuff_type];
01050 break;
01051 default:
01052 do_error ("Bad transport type in put_stuff3");
01053 }
01054 ip = &minfo[map_index].int_1;
01055 ssp->ip = ip += stuff_type; /* push it -- (ThMO) */
01056 ssp++->max_val = tp;
01057 st += tp - *ip;
01058 if (st >= stuff) {
01059 ssp = stack;
01060 do {
01061 tp = ssp->max_val - *ssp->ip; /* pop it -- (ThMO) */
01062 if ((stuff -= tp) < 0)
01063 *ssp->ip += tp + stuff; /* == orig. stuff -- (ThMO) */
01064 else
01065 *ssp->ip = ssp->max_val;
01066 ++ssp;
01067 } while (stuff > 0);
01068 ++tst;
01069 tstart3 = tst >= 12 ? 0 : tst;
01070 return (1);
01071 }
01072 }
01073 if (++tst >= 12)
01074 tst = 0;
01075 }
01076 return (0);
01077 }
|
|
||||||||||||||||||||
|
Definition at line 1081 of file market.c. 01082 {
01083 static int tstart4 = 0;
01084 int i, st, tst, *ip, tp = 0;
01085 struct stack stack[16], *ssp; /* stack is really a pipe -- (ThMO)
01086 */
01087 /* we'll stack our found pointers so to avoid re-looping and
01088 * testing again (ThMO) */
01089
01090 tst = tstart4;
01091
01092 /* can we put enough on the transport? */
01093
01094 for (ssp = stack, st = 0, i = 0; i < 16; i++) {
01095 int map_index = t4[tst];
01096 if (minfo[map_index].flags & FLAG_IS_TRANSPORT) {
01097 switch (get_group_of_type(type[map_index]))
01098 {
01099 case GROUP_TRACK:
01100 tp = tmax[0][stuff_type];
01101 break;
01102 case GROUP_ROAD:
01103 tp = tmax[1][stuff_type];
01104 break;
01105 case GROUP_RAIL:
01106 tp = tmax[2][stuff_type];
01107 break;
01108 default:
01109 do_error ("Bad transport type in put_stuff4");
01110 }
01111 ip = &minfo[map_index].int_1;
01112 ssp->ip = ip += stuff_type; /* push it -- (ThMO) */
01113 ssp++->max_val = tp;
01114 st += tp - *ip;
01115 if (st >= stuff) {
01116 ssp = stack;
01117 do {
01118 tp = ssp->max_val - *ssp->ip; /* pop it -- (ThMO) */
01119 if ((stuff -= tp) < 0)
01120 *ssp->ip += tp + stuff; /* == orig. stuff -- (ThMO) */
01121 else
01122 *ssp->ip = ssp->max_val;
01123 ++ssp;
01124 } while (stuff > 0);
01125 tstart4 = ++tst & 15;
01126 return (1);
01127 }
01128 }
01129 if (++tst >= 16)
01130 tst = 0;
01131 }
01132 return (0);
01133 }
|
|
||||||||||||||||
|
Definition at line 169 of file market.c. 00170 {
00171 int q;
00172 if (numof_markets > 0)
00173 {
00174 for (q = 0; q < numof_markets; q++)
00175 {
00176 if (MP_INFO(marketx[q],markety[q]).int_7
00177 >= (MAX_WASTE_IN_MARKET - waste))
00178 continue;
00179 if ((abs (marketx[q] - x) < MARKET_RANGE)
00180 && (abs (markety[q] - y) < MARKET_RANGE))
00181 {
00182 MP_INFO(marketx[q],markety[q]).int_7 += waste;
00183 return (1);
00184 }
00185 }
00186 }
00187 if (put_stuff (x, y, waste, T_WASTE) != 0)
00188 return (1);
00189 return (0);
00190 }
|
|
||||||||||||
|
Definition at line 375 of file market.c. 00376 {
00377 int q;
00378 for (q = 0; q < numof_markets; q++)
00379 if (marketx[q] == x && markety[q] == y)
00380 break;
00381 for (; q < numof_markets; q++)
00382 {
00383 marketx[q] = marketx[q + 1];
00384 markety[q] = markety[q + 1];
00385 }
00386 numof_markets--;
00387 }
|
|
|
Definition at line 3563 of file engine.c. 03564 {
03565 int x, y, r;
03566 if (numof_shanties <= 0)
03567 return;
03568 x = rand () % WORLD_SIDE_LEN;
03569 y = rand () % WORLD_SIDE_LEN;
03570 r = spiral_find_group (x, y, GROUP_SHANTY);
03571 if (r == -1) {
03572 printf ("Can't find a shanty to remove! ?\n");
03573 return;
03574 }
03575 y = r / WORLD_SIDE_LEN;
03576 x = r % WORLD_SIDE_LEN;
03577 /* decrement of numof_shanties is done in fire area() */
03578 fire_area (x, y);
03579 /* now put the fire out */
03580 MP_INFO(x,y).int_2 = FIRE_LENGTH + 1;
03581 MP_INFO(x + 1,y).int_2 = FIRE_LENGTH + 1;
03582 MP_INFO(x,y + 1).int_2 = FIRE_LENGTH + 1;
03583 MP_INFO(x + 1,y + 1).int_2 = FIRE_LENGTH + 1;
03584 }
|
|
||||||||||||
|
Definition at line 407 of file power.c. 00408 {
00409 int q;
00410 for (q = 0; q < numof_substations; q++)
00411 if (substationx[q] == x && substationy[q] == y)
00412 break;
00413 for (; q < numof_substations; q++)
00414 {
00415 substationx[q] = substationx[q + 1];
00416 substationy[q] = substationy[q + 1];
00417 }
00418 numof_substations--;
00419 }
|
|
|
Definition at line 2586 of file engine.c. 02587 {
02588 #if defined (commentout)
02589 int x, y, f;
02590 time_t t;
02591 f = 1;
02592 t = time (0);
02593 while (f && (num > 0)) {
02594 for (y = 0; y < WORLD_SIDE_LEN; y++)
02595 for (x = 0; x < WORLD_SIDE_LEN; x++)
02596 if (MP_GROUP_IS_RESIDENCE(x,y) && MP_INFO(x,y).population > 0)
02597 {
02598 MP_INFO(x,y).population--;
02599 // f = 1;
02600 f |= (MP_INFO(x,y).population > 0);
02601 num--;
02602 total_evacuated++;
02603 }
02604 }
02605 while (num > 0 && people_pool > 0) {
02606 num--;
02607 total_evacuated++;
02608 people_pool--;
02609 }
02610 #endif
02611
02612 int x, y;
02613 /* reset housed population so that we can display it correctly */
02614 housed_population = 1;
02615 while (housed_population && (num > 0)) {
02616 housed_population = 0;
02617 for (y = 0; y < WORLD_SIDE_LEN; y++)
02618 for (x = 0; x < WORLD_SIDE_LEN; x++)
02619 if (MP_GROUP_IS_RESIDENCE(x,y) && MP_INFO(x,y).population > 0) {
02620 MP_INFO(x,y).population--;
02621 housed_population += MP_INFO(x,y).population;
02622 num--;
02623 total_evacuated++;
02624 }
02625 }
02626 while (num > 0 && people_pool > 0) {
02627 num--;
02628 total_evacuated++;
02629 people_pool--;
02630 }
02631
02632 refresh_population_text ();
02633
02634 #if defined (commentout)
02635 /* last ship wasn't full so everyone has gone. */
02636 if (num > 0)
02637 {
02638 if (t > HOF_START && t < HOF_STOP)
02639 ok_dial_box ("launch-gone-mail.mes", GOOD, 0L);
02640 else
02641 ok_dial_box ("launch-gone.mes", GOOD, 0L);
02642 housed_population = 0;
02643 }
02644 #endif
02645
02646 /* Note that the previous test was inaccurate. There could be
02647 exactly 1000 people left. */
02648 if (!housed_population && !people_pool) {
02649 ok_dial_box ("launch-gone.mes", GOOD, 0L);
02650 }
02651 }
|
|
|
Definition at line 100 of file ldsvguts.c. 00101 {
00102 char *s;
00103 int l;
00104 if ((l = strlen (cname)) < 2) /* Thanks to Chris J. Kiick */
00105 return;
00106
00107 if ((s = (char *) malloc (lc_save_dir_len + l + 16)) == 0)
00108 malloc_failure ();
00109 sprintf (s, "%s%c%s", lc_save_dir, PATH_SLASH, cname);
00110 remove (s);
00111 free (s);
00112 }
|
|
|
Definition at line 651 of file ldsvguts.c. 00652 {
00653 int x, y;
00654 for (y = 0; y < WORLD_SIDE_LEN; y++)
00655 for (x = 0; x < WORLD_SIDE_LEN; x++) {
00656 if (MP_GROUP_IS_RESIDENCE(x,y))
00657 MP_INFO(x,y).int_3 = 0;
00658 else if (MP_GROUP(x,y) == GROUP_WINDMILL)
00659 MP_INFO(x,y).int_4 = 0;
00660 else if (MP_GROUP(x,y) == GROUP_BLACKSMITH)
00661 MP_INFO(x,y).int_4 = 0;
00662 else if (MP_GROUP(x,y) == GROUP_MILL)
00663 MP_INFO(x,y).int_4 = 0;
00664 else if (MP_GROUP(x,y) == GROUP_POTTERY)
00665 MP_INFO(x,y).int_4 = 0;
00666 else if (MP_GROUP(x,y) == GROUP_CRICKET)
00667 MP_INFO(x,y).int_4 = 0;
00668 else if (MP_GROUP(x,y) == GROUP_FIRESTATION)
00669 MP_INFO(x,y).int_4 = 0;
00670 else if (MP_GROUP(x,y) == GROUP_FIRE)
00671 {
00672 MP_INFO(x,y).int_1 = 0;
00673 MP_INFO(x,y).int_3 = 0;
00674 }
00675 else if (MP_GROUP(x,y) == GROUP_COMMUNE)
00676 MP_INFO(x,y).int_1 = 0;
00677 else if (MP_GROUP(x,y) == GROUP_ROCKET)
00678 MP_INFO(x,y).int_5 = 0;
00679 else if (MP_GROUP(x,y) == GROUP_INDUSTRY_H)
00680 MP_INFO(x,y).int_6 = 0;
00681 else if (MP_GROUP(x,y) == GROUP_INDUSTRY_L)
00682 MP_INFO(x,y).int_7 = 0;
00683 }
00684 }
|
|
|
Definition at line 309 of file ldsvguts.c. 00310 {
00311 char *s, *s2, *s3, *s4;
00312 int l;
00313
00314 if ((l = strlen (cname)) < 2)
00315 return;
00316 if ((s = (char *) malloc (lc_save_dir_len + l + 16)) == 0)
00317 malloc_failure ();
00318 if ((s2 = (char *) malloc (lc_save_dir_len + l + 32)) == 0)
00319 malloc_failure ();
00320 if ((s3 = (char *) malloc ((lc_save_dir_len + l) * 2 + 32)) == 0)
00321 malloc_failure ();
00322 if ((s4 = (char *) malloc ((lc_save_dir_len + l) * 2 + 32)) == 0)
00323 malloc_failure ();
00324
00325 sprintf (s, "%s%c%s", lc_save_dir, PATH_SLASH, cname);
00326 sprintf (s2, "%s%c%s", lc_save_dir, PATH_SLASH, "tmp-save");
00327 sprintf (s3, "gzip -f %s", s2);
00328 sprintf (s4, "mv %s.gz %s", s2, s);
00329
00330 #if defined (WIN32)
00331 save_city_raw (s);
00332 #else
00333 save_city_raw (s2);
00334 if (system (s3) != 0)
00335 do_error ("gzip failed while in save_city");
00336 if (system (s4) != 0)
00337 do_error ("mv failed while in save_city");
00338 #endif
00339
00340 free (s);
00341 free (s2);
00342 free (s3);
00343 free (s4);
00344 }
|
|
||||||||||||||||||||
|
|
|
||||||||||||||||||||
|
|
|
||||||||||||||||||||
|
|
|
||||||||||||||||||||
|
|
|
||||||||||||||||||||
|
|
|
||||||||||||
|
Definition at line 2115 of file engine.c. 02116 {
02117 int i = 0;
02118 i = (MP_INFO(xt,yt).int_3 * PORT_EXPORT_RATE) / 1000;
02119 MP_INFO(xt,yt).int_3 -= i;
02120 return (i * PORT_COAL_RATE);
02121 }
|
|
||||||||||||
|
Definition at line 2106 of file engine.c. 02107 {
02108 int i = 0;
02109 i = (MP_INFO(xt,yt).int_1 * PORT_EXPORT_RATE) / 1000;
02110 MP_INFO(xt,yt).int_1 -= i;
02111 return (i * PORT_FOOD_RATE);
02112 }
|
|
||||||||||||
|
Definition at line 2133 of file engine.c. 02134 {
02135 int i = 0;
02136 i = (MP_INFO(xt,yt).int_4 * PORT_EXPORT_RATE) / 1000;
02137 MP_INFO(xt,yt).int_4 -= i;
02138 return (i * PORT_GOODS_RATE);
02139 }
|
|
||||||||||||
|
|
|
||||||||||||
|
Definition at line 2124 of file engine.c. 02125 {
02126 int i = 0;
02127 i = (MP_INFO(xt,yt).int_5 * PORT_EXPORT_RATE) / 1000;
02128 MP_INFO(xt,yt).int_5 -= i;
02129 return (i * PORT_ORE_RATE);
02130 }
|
|
||||||||||||
|
Definition at line 2142 of file engine.c. 02143 {
02144 int i = 0;
02145 i = (MP_INFO(xt,yt).int_6 * PORT_EXPORT_RATE) / 1000;
02146 MP_INFO(xt,yt).int_6 -= i;
02147 return (i * PORT_STEEL_RATE);
02148 }
|
|
||||||||||||||||
|
Definition at line 29 of file shrtypes.c. 00030 {
00031 int grp;
00032
00033 if ((grp = get_group_of_type(selected_type)) < 0) return;
00034
00035 MP_TYPE(x,y) = selected_type;
00036 MP_GROUP(x,y) = grp;
00037
00038 if (main_groups[grp].size == 2)
00039 {
00040 set_mappoint_used (x, y, x + 1, y);
00041 set_mappoint_used (x, y, x, y + 1);
00042 set_mappoint_used (x, y, x + 1, y + 1);
00043 }
00044 else if (main_groups[grp].size == 3)
00045 {
00046 set_mappoint_used (x, y, x + 1, y);
00047 set_mappoint_used (x, y, x + 2, y);
00048 set_mappoint_used (x, y, x + 1, y + 1);
00049 set_mappoint_used (x, y, x + 2, y + 1);
00050 set_mappoint_used (x, y, x + 1, y + 2);
00051 set_mappoint_used (x, y, x + 2, y + 2);
00052 set_mappoint_used (x, y, x, y + 1);
00053 set_mappoint_used (x, y, x, y + 2);
00054 }
00055 else if (main_groups[grp].size == 4)
00056 {
00057 set_mappoint_used (x, y, x + 1, y);
00058 set_mappoint_used (x, y, x + 2, y);
00059 set_mappoint_used (x, y, x + 1, y + 1);
00060 set_mappoint_used (x, y, x + 2, y + 1);
00061 set_mappoint_used (x, y, x + 1, y + 2);
00062 set_mappoint_used (x, y, x + 2, y + 2);
00063 set_mappoint_used (x, y, x, y + 1);
00064 set_mappoint_used (x, y, x, y + 2);
00065
00066 set_mappoint_used (x, y, x + 3, y);
00067 set_mappoint_used (x, y, x + 3, y + 1);
00068 set_mappoint_used (x, y, x + 3, y + 2);
00069 set_mappoint_used (x, y, x + 3, y + 3);
00070 set_mappoint_used (x, y, x, y + 3);
00071 set_mappoint_used (x, y, x + 1, y + 3);
00072 set_mappoint_used (x, y, x + 2, y + 3);
00073 }
00074 }
|
|
||||||||||||||||||||
|
|
|
||||||||||||||||||||
|
Definition at line 19 of file shrtypes.c. 00020 {
00021 MP_TYPE(x,y) = CST_USED;
00022 MP_GROUP(x,y) = GROUP_USED;
00023 MP_INFO(x,y).int_1 = fromx;
00024 MP_INFO(x,y).int_2 = fromy;
00025 }
|
|
|
Definition at line 259 of file lcsvga.c. 00260 {
00261 char s[100];
00262 int i, n, r, g, b, flag[256];
00263 FILE *inf;
00264 Palette pal;
00265 for (i = 0; i < 256; i++)
00266 flag[i] = 0;
00267 if ((inf = fopen (colour_pal_file, "r")) == 0)
00268 {
00269 printf ("The colour palette file <%s>... ", colour_pal_file);
00270 do_error ("Can't find it.");
00271 }
00272 while (feof (inf) == 0)
00273 {
00274 fgets (s, 99, inf);
00275 if (sscanf (s, "%d %d %d %d", &n, &r, &g, &b) == 4)
00276 {
00277 pal.color[n].red = r;
00278 pal.color[n].green = g;
00279 pal.color[n].blue = b;
00280 flag[n] = 1;
00281 }
00282 }
00283 fclose (inf);
00284 for (i = 0; i < 256; i++)
00285 {
00286 if (flag[i] == 0)
00287 {
00288 printf ("Colour %d not loaded\n", i);
00289 do_error ("Can't continue");
00290 }
00291 pal.color[i].red = (unsigned char) ((pal.color[i].red
00292 * (1 - gamma_correct_red)) + (64 * sin ((float) pal.color[i].red
00293 * M_PI / 128)) * gamma_correct_red);
00294
00295 pal.color[i].green = (unsigned char) ((pal.color[i].green
00296 * (1 - gamma_correct_green)) + (64 * sin ((float) pal.color[i].green
00297 * M_PI / 128)) * gamma_correct_green);
00298
00299 pal.color[i].blue = (unsigned char) ((pal.color[i].blue
00300 * (1 - gamma_correct_blue)) + (64 * sin ((float) pal.color[i].blue
00301 * M_PI / 128)) * gamma_correct_blue);
00302 }
00303 gl_setpalette (&pal);
00304 }
|
|
|
Definition at line 498 of file simulate.c. 00499 {
00500 int x, y, i, j;
00501 x = WORLD_SIDE_LEN / 2;
00502 y = WORLD_SIDE_LEN - 1;
00503 i = (rand () % 12) + 6;
00504 for (j = 0; j < i; j++) {
00505 x += (rand () % 3) - 1;
00506 MP_TYPE(x,y) = CST_WATER;
00507 MP_GROUP(x,y) = GROUP_WATER;
00508 MP_INFO(x,y).flags |= FLAG_IS_RIVER;
00509 MP_TYPE(x+1,y) = CST_WATER;
00510 MP_GROUP(x+1,y) = GROUP_WATER;
00511 MP_INFO(x+1,y).flags |= FLAG_IS_RIVER;
00512 MP_TYPE(x-1,y) = CST_WATER;
00513 MP_GROUP(x-1,y) = GROUP_WATER;
00514 MP_INFO(x-1,y).flags |= FLAG_IS_RIVER;
00515 y--;
00516 }
00517 MP_TYPE(x,y) = CST_WATER;
00518 MP_GROUP(x,y) = GROUP_WATER;
00519 MP_INFO(x,y).flags |= FLAG_IS_RIVER;
00520 MP_TYPE(x+1,y) = CST_WATER;
00521 MP_GROUP(x+1,y) = GROUP_WATER;
00522 MP_INFO(x+1,y).flags |= FLAG_IS_RIVER;
00523 MP_TYPE(x-1,y) = CST_WATER;
00524 MP_GROUP(x-1,y) = GROUP_WATER;
00525 MP_INFO(x-1,y).flags |= FLAG_IS_RIVER;
00526
00527 setup_river2 (x - 1, y, -1); /* left tributary */
00528 setup_river2 (x + 1, y, 1); /* right tributary */
00529 }
|
|
||||||||||||||||
|
Definition at line 532 of file simulate.c. 00533 {
00534 int i, j, r;
00535 i = (rand () % 55) + 15;
00536 for (j = 0; j < i; j++)
00537 {
00538 r = (rand () % 3) - 1 + (d * (rand () % 3));
00539 if (r < -1)
00540 r = -1;
00541 else if (r > 1)
00542 r = 1;
00543 x += r;
00544 if (MP_TYPE(x+(d+d),y) != 0
00545 || MP_TYPE(x+(d+d+d),y) != 0)
00546 return;
00547 if (x > 5 && x < WORLD_SIDE_LEN - 5)
00548 {
00549 MP_TYPE(x,y) = CST_WATER;
00550 MP_GROUP(x,y) = GROUP_WATER;
00551 MP_INFO(x,y).flags |= FLAG_IS_RIVER;
00552 MP_TYPE(x + d,y) = CST_WATER;
00553 MP_GROUP(x+d,y) = GROUP_WATER;
00554 MP_INFO(x+d,y).flags |= FLAG_IS_RIVER;
00555 }
00556 if (--y < 10 || x < 5 || x > WORLD_SIDE_LEN - 5)
00557 break;
00558 }
00559 if (y > 20)
00560 {
00561 if (x > 5 && x < WORLD_SIDE_LEN - 5)
00562 setup_river2 (x, y, -1);
00563 if (x > 5 && x < WORLD_SIDE_LEN - 5)
00564 setup_river2 (x, y, 1);
00565 }
00566 }
|
|
|
Definition at line 1341 of file engine.c. 01342 {
01343 int i, x, a;
01344 for (i = 0; i < SHUFFLE_MAPPOINT_COUNT; i++)
01345 {
01346 x = rand () % WORLD_SIDE_LEN;
01347 a = mappoint_array_x[i];
01348 mappoint_array_x[i] = mappoint_array_x[x];
01349 mappoint_array_x[x] = a;
01350 x = rand () % WORLD_SIDE_LEN;
01351 a = mappoint_array_y[i];
01352 mappoint_array_y[i] = mappoint_array_y[x];
01353 mappoint_array_y[x] = a;
01354 }
01355 }
|
|
|
Definition at line 461 of file market.c. 00462 {
00463 register int x;
00464 int q, r, m;
00465 m = (numof_markets / 4) + 1;
00466 for (x = 0; x < m; x++)
00467 {
00468 r = rand () % numof_markets;
00469 if (r == x)
00470 continue;
00471 q = marketx[x];
00472 marketx[x] = marketx[r];
00473 marketx[r] = q;
00474 q = markety[x];
00475 markety[x] = markety[r];
00476 markety[r] = q;
00477 }
00478 }
|
|
|
Definition at line 422 of file power.c. 00423 {
00424 int q, x, r, m;
00425 m = (numof_substations / 2) + 1;
00426 for (x = 0; x < m; x++)
00427 {
00428 r = rand () % numof_substations;
00429 if (r == x)
00430 continue;
00431 q = substationx[x];
00432 substationx[x] = substationx[r];
00433 substationx[r] = q;
00434 q = substationy[x];
00435 substationy[x] = substationy[r];
00436 substationy[r] = q;
00437 }
00438 }
|
|
|
Definition at line 287 of file splash.c. 00288 {
00289 char c;
00290 if (feof (inf) != 0)
00291 fseek (inf, 0L, SEEK_SET);
00292 c = fgetc (inf);
00293 if (c == 0xa || c == 0xd)
00294 c = ' ';
00295 return (c);
00296 }
|
|
|
Definition at line 164 of file splash.c. 00165 {
00166 char s[LC_PATH_MAX], line1[100], line2[100], line3[100], c;
00167 int i, t, l1c = 0, l2c = 0, l3c = 0;
00168 FILE *inf1, *inf2, *inf3;
00169 #ifdef LC_X11
00170 XEvent xev;
00171 #endif
00172 Fgl_enableclipping ();
00173 sprintf (s, "%s%c%s", opening_path, PATH_SLASH, "text1");
00174 if ((inf1 = fopen (s, "rb")) == NULL)
00175 do_error ("Can't open opening/text1");
00176 for (i = 0; i < 52; i++)
00177 line1[i] = si_next_char (inf1);
00178 line1[52] = 0;
00179 sprintf (s, "%s%c%s", opening_path, PATH_SLASH, "text2");
00180 if ((inf2 = fopen (s, "rb")) == NULL)
00181 do_error ("Can't open opening/text2");
00182 for (i = 0; i < 52; i++)
00183 line2[i] = si_next_char (inf2);
00184 line2[52] = 0;
00185 sprintf (s, "%s%c%s", opening_path, PATH_SLASH, "text3");
00186 if ((inf3 = fopen (s, "rb")) == NULL)
00187 do_error ("Can't open opening/text3");
00188 for (i = 0; i < 52; i++)
00189 line3[i] = si_next_char (inf3);
00190 line3[52] = 0;
00191 do
00192 {
00193 get_real_time ();
00194 t = real_time + SPLASH_SCROLL_DELAY;
00195 #ifdef LC_X11
00196 if (XPending (display.dpy))
00197
00198 {
00199 XNextEvent (display.dpy, &xev);
00200 HandleEvent (&xev);
00201 }
00202
00203 c = x_key_value;
00204 #elif defined (WIN32)
00205 c = GetKeystroke ();
00206 #else
00207 c = vga_getkey ();
00208 #endif
00209 if (l1c >= 8)
00210 {
00211 for (i = 0; i < 51; i++)
00212 line1[i] = line1[i + 1];
00213 line1[51] = si_next_char (inf1);
00214 l1c = 0;
00215 }
00216 Fgl_setfont (8, 8, start_font1);
00217 Fgl_setclippingwindow (120, 30, 520, 40);
00218 Fgl_setfontcolors (SI_BLACK, SI_RED);
00219 #if defined (LC_X11) || defined (WIN32)
00220 open_write (120 - l1c, 31, line1);
00221 #else
00222 Fgl_write (120 - l1c, 31, line1);
00223 #endif
00224 l1c++;
00225
00226 if (l2c >= 8)
00227 {
00228 for (i = 0; i < 51; i++)
00229 line2[i] = line2[i + 1];
00230 line2[51] = si_next_char (inf2);
00231 l2c = 0;
00232 }
00233 Fgl_setfont (8, 16, start_font2);
00234 Fgl_setclippingwindow (120, 55, 520, 73);
00235 Fgl_setfontcolors (SI_BLACK, SI_GREEN);
00236 #if defined (LC_X11) || defined (WIN32)
00237 open_write (120 - l2c, 57, line2);
00238 #else
00239 Fgl_write (120 - l2c, 57, line2);
00240 #endif
00241 l2c += 2;
00242
00243 if (l3c >= 8)
00244 {
00245 for (i = 0; i < 51; i++)
00246 line3[i] = line3[i + 1];
00247 line3[51] = si_next_char (inf3);
00248 l3c = 0;
00249 }
00250 Fgl_setfont (8, 16, start_font3);
00251 Fgl_setclippingwindow (120, 88, 520, 106);
00252 Fgl_setfontcolors (SI_BLACK, SI_YELLOW);
00253 #if defined (LC_X11) || defined (WIN32)
00254 open_write (120 - l3c, 90, line3);
00255 #else
00256 Fgl_write (120 - l3c, 90, line3);
00257 #endif
00258 l3c += 2;
00259 #if defined (WIN32) /* Scroll a little faster for WIN32 */
00260 if (pix_double)
00261 {
00262 l1c += 10;
00263 l2c += 10;
00264 l3c += 10;
00265 }
00266 else
00267 {
00268 l1c += 2;
00269 l2c += 4;
00270 l3c += 4;
00271 }
00272 #endif
00273 while (real_time < t)
00274 {
00275 lc_usleep (1);
00276 get_real_time ();
00277 }
00278 }
00279 while (c == 0);
00280 fclose (inf1);
00281 fclose (inf2);
00282 fclose (inf3);
00283 Fgl_disableclipping ();
00284 }
|
|
||||||||||||
|
Definition at line 3455 of file engine.c. 03456 {
03457 int i, j, x, y;
03458 x = startx;
03459 y = starty;
03460 /* let's just do a complete spiral for now, work out the bounds later */
03461 for (i = 1; i < (WORLD_SIDE_LEN + WORLD_SIDE_LEN); i++)
03462 {
03463 for (j = 0; j < i; j++)
03464 {
03465 x--;
03466 if (x > 1 && x < WORLD_SIDE_LEN - 2 && y > 1
03467 && y < WORLD_SIDE_LEN - 2)
03468 if (MP_TYPE(x,y) == CST_GREEN
03469 && MP_TYPE(x + 1,y) == CST_GREEN
03470 && MP_TYPE(x,y + 1) == CST_GREEN
03471 && MP_TYPE(x + 1,y + 1) == CST_GREEN)
03472 return (x + y * WORLD_SIDE_LEN);
03473 }
03474 for (j = 0; j < i; j++)
03475 {
03476 y--;
03477 if (x > 1 && x < WORLD_SIDE_LEN - 2 && y > 1
03478 && y < WORLD_SIDE_LEN - 2)
03479 if (MP_TYPE(x,y) == CST_GREEN
03480 && MP_TYPE(x + 1,y) == CST_GREEN
03481 && MP_TYPE(x,y + 1) == CST_GREEN
03482 && MP_TYPE(x + 1,y + 1) == CST_GREEN)
03483 return (x + y * WORLD_SIDE_LEN);
03484 }
03485 i++;
03486 for (j = 0; j < i; j++)
03487 {
03488 x++;
03489 if (x > 1 && x < WORLD_SIDE_LEN - 2 && y > 1
03490 && y < WORLD_SIDE_LEN - 2)
03491 if (MP_TYPE(x,y) == CST_GREEN
03492 && MP_TYPE(x + 1,y) == CST_GREEN
03493 && MP_TYPE(x,y + 1) == CST_GREEN
03494 && MP_TYPE(x + 1,y + 1) == CST_GREEN)
03495 return (x + y * WORLD_SIDE_LEN);
03496 }
03497 for (j = 0; j < i; j++)
03498 {
03499 y++;
03500 if (x > 1 && x < WORLD_SIDE_LEN - 2 && y > 1
03501 && y < WORLD_SIDE_LEN - 2)
03502 if (MP_TYPE(x,y) == CST_GREEN
03503 && MP_TYPE(x + 1,y) == CST_GREEN
03504 && MP_TYPE(x,y + 1) == CST_GREEN
03505 && MP_TYPE(x + 1,y + 1) == CST_GREEN)
03506 return (x + y * WORLD_SIDE_LEN);
03507 }
03508 }
03509 return (-1);
03510 }
|
|
||||||||||||||||
|
Definition at line 3408 of file engine.c. 03409 {
03410 int i, j, x, y;
03411 x = startx;
03412 y = starty;
03413 /* let's just do a complete spiral for now, work out the bounds later */
03414 for (i = 1; i < (WORLD_SIDE_LEN + WORLD_SIDE_LEN); i++)
03415 {
03416 for (j = 0; j < i; j++)
03417 {
03418 x--;
03419 if (x > 0 && x < WORLD_SIDE_LEN && y > 0 && y < WORLD_SIDE_LEN)
03420 if (MP_GROUP(x,y) == group)
03421 return (x + y * WORLD_SIDE_LEN);
03422 }
03423 for (j = 0; j < i; j++)
03424 {
03425 y--;
03426 if (x > 0 && x < WORLD_SIDE_LEN && y > 0 && y < WORLD_SIDE_LEN)
03427 if (MP_GROUP(x,y) == group)
03428 return (x + y * WORLD_SIDE_LEN);
03429 }
03430 i++;
03431 for (j = 0; j < i; j++)
03432 {
03433 x++;
03434 if (x > 0 && x < WORLD_SIDE_LEN && y > 0 && y < WORLD_SIDE_LEN)
03435 if (MP_GROUP(x,y) == group)
03436 return (x + y * WORLD_SIDE_LEN);
03437 }
03438 for (j = 0; j < i; j++)
03439 {
03440 y++;
03441 if (x > 0 && x < WORLD_SIDE_LEN && y > 0 && y < WORLD_SIDE_LEN)
03442 if (MP_GROUP(x,y) == group)
03443 return (x + y * WORLD_SIDE_LEN);
03444 }
03445 }
03446 return (-1);
03447 }
|
|
|
Definition at line 150 of file splash.c. 00151 {
00152 #if defined (SVGALIB)
00153 gl_setwritemode (FONT_COMPRESSED);
00154 #endif
00155 Fgl_setfont (8, 8, start_font1);
00156 #if defined (SVGALIB)
00157 gl_setwritemode (FONT_COMPRESSED);
00158 #endif
00159 Fgl_setfontcolors (SI_BLACK, SI_RED);
00160 si_scroll_text ();
00161 }
|
|
|
Definition at line 797 of file simulate.c. 00798 {
00799 int x, y;
00800 for (x = 0; x < WORLD_SIDE_LEN; x++)
00801 for (y = 0; y < WORLD_SIDE_LEN; y++)
00802 {
00803 if (MP_GROUP(x,y) == GROUP_BARE
00804 || MP_TYPE(x,y) == CST_USED
00805 || MP_GROUP(x,y) == GROUP_WATER
00806 || MP_GROUP(x,y) == GROUP_POWER_LINE
00807 || MP_GROUP(x,y) == GROUP_OREMINE
00808 || MP_GROUP(x,y) == GROUP_ROCKET
00809 || MP_GROUP(x,y) == GROUP_MONUMENT
00810 || MP_GROUP(x,y) == GROUP_BURNT)
00811 ; /* do nothing */
00812
00813 else if ((MP_INFO(x,y).flags & FLAG_FIRE_COVER) == 0)
00814 return (0);
00815 }
00816 return (1);
00817 }
|
|
|
Definition at line 727 of file simulate.c. 00728 {
00729 int i;
00730 if (sust_dig_ore_coal_tip_flag == 0)
00731 {
00732 sust_dig_ore_coal_tip_flag = 1;
00733 sust_dig_ore_coal_count = 0;
00734 }
00735 else
00736 sust_dig_ore_coal_count++;
00737
00738 if (sust_port_flag == 0)
00739 {
00740 sust_port_flag = 1;
00741 sust_port_count = 0;
00742 }
00743 else
00744 sust_port_count++;
00745
00746 /* Money must be going up or the same. (ie can't build.) */
00747 if (sust_old_money > total_money)
00748 sust_old_money_count = 0;
00749 else
00750 sust_old_money_count++;
00751 sust_old_money = total_money;
00752
00753 /* population must be withing 2% of when it started. */
00754 i = (housed_population + people_pool) - sust_old_population;
00755 if (abs (i) > (sust_old_population / 40) /* 2.5% */
00756 || (housed_population + people_pool) < SUST_MIN_POPULATION)
00757 {
00758 sust_old_population = (housed_population + people_pool);
00759 sust_old_population_count = 0;
00760 }
00761 else
00762 sust_old_population_count++;
00763
00764 /* tech level must be going up or not fall more than 0.5% from it's
00765 highest during the sus count
00766 */
00767 i = tech_level - sust_old_tech;
00768 if (i < 0 || tech_level < SUST_MIN_TECH_LEVEL)
00769 {
00770 i = -i;
00771 if ((i > sust_old_tech / 100) || tech_level < SUST_MIN_TECH_LEVEL)
00772 {
00773 sust_old_tech_count = 0;
00774 sust_old_tech = tech_level;
00775 }
00776 else
00777 sust_old_tech_count++;
00778 }
00779 else
00780 {
00781 sust_old_tech_count++;
00782 sust_old_tech = tech_level;
00783 }
00784
00785 /* check fire cover only every three years */
00786 if (total_time % (NUMOF_DAYS_IN_YEAR * 3) == 0)
00787 {
00788 if (sust_fire_cover () != 0)
00789 sust_fire_count += 3;
00790 else
00791 sust_fire_count = 0;
00792
00793 }
00794 }
|
|
|
Definition at line 136 of file screen.c. 00137 {
00138 Fgl_disableclipping ();
00139 }
|
|
|
|
|
|
Definition at line 940 of file screen.c. 00941 {
00942 switch (mini_screen_flags)
00943 {
00944 case MINI_SCREEN_NORMAL_FLAG:
00945 draw_mini_screen ();
00946 break;
00947 case MINI_SCREEN_POL_FLAG:
00948 draw_mini_screen_pollution ();
00949 break;
00950 case MINI_SCREEN_UB40_FLAG:
00951 draw_mini_screen_ub40 ();
00952 break;
00953 case MINI_SCREEN_STARVE_FLAG:
00954 draw_mini_screen_starve ();
00955 break;
00956 #if defined (commentout)
00957 case MINI_SCREEN_PORT_FLAG:
00958 draw_mini_screen_port ();
00959 break;
00960 #endif
00961 case MINI_SCREEN_POWER_FLAG:
00962 draw_mini_screen_power ();
00963 break;
00964 case MINI_SCREEN_FIRE_COVER:
00965 draw_mini_screen_fire_cover ();
00966 break;
00967 case MINI_SCREEN_CRICKET_COVER:
00968 draw_mini_screen_cricket_cover ();
00969 break;
00970 case MINI_SCREEN_HEALTH_COVER:
00971 draw_mini_screen_health_cover ();
00972 break;
00973 case MINI_SCREEN_COAL_FLAG:
00974 draw_mini_screen_coal ();
00975 break;
00976 }
00977 }
|
|
|
|
|
|
Definition at line 3587 of file engine.c. 03588 {
03589 int i, pp;
03590 pp = people_pool - (COMMUNE_POP * numof_communes);
03591 i = (pp - SHANTY_MIN_PP) / SHANTY_POP;
03592 if (i > numof_shanties)
03593 add_a_shanty (); /* vv-- schmitt trigger */
03594
03595 else if (numof_shanties > 0 && i < (numof_shanties - 1))
03596 remove_a_shanty ();
03597 else if (numof_shanties > 0 && rand () % 100 == 10)
03598 remove_a_shanty (); /* randomly close some down. */
03599
03600 }
|
|
||||||||||||
|
Definition at line 3771 of file engine.c. 03772 {
03773 switch (MP_GROUP(x,y))
03774 {
03775 case (GROUP_ORGANIC_FARM):
03776 MP_INFO(x,y).int_7 = ((double) MP_INFO(x,y).int_1
03777 * ORGANIC_FARM_FOOD_OUTPUT) / MAX_TECH_LEVEL;
03778 break;
03779 case (GROUP_WINDMILL):
03780 #ifdef OLD_POWER_CODE
03781 MP_INFO(x,y).int_5 = WINDMILL_POWER
03782 #else
03783 MP_INFO(x,y).int_1 = WINDMILL_POWER
03784 #endif
03785 + (((double) MP_INFO(x,y).int_2 * WINDMILL_POWER) / MAX_TECH_LEVEL);
03786 break;
03787 case (GROUP_COAL_POWER):
03788 #ifdef OLD_POWER_CODE
03789 MP_INFO(x,y).int_5 = POWERS_COAL_OUTPUT
03790 #else
03791 MP_INFO(x,y).int_1 = POWERS_COAL_OUTPUT
03792 #endif
03793 + (((double) MP_INFO(x,y).int_4 * POWERS_COAL_OUTPUT)
03794 / MAX_TECH_LEVEL);
03795 break;
03796 case (GROUP_SOLAR_POWER):
03797 MP_INFO(x,y).int_3 = POWERS_SOLAR_OUTPUT
03798 + (((double) MP_INFO(x,y).int_2 * POWERS_SOLAR_OUTPUT)
03799 / MAX_TECH_LEVEL);
03800 break;
03801 }
03802 }
|
|
|
|
|
|
Definition at line 852 of file main.c. 00853 {
00854 char *s;
00855 if (compile_results () == 0)
00856 return;
00857 if ((s = (char *) malloc (lc_save_dir_len + strlen (LC_SAVE_DIR)
00858 + strlen (RESULTS_FILENAME) + 64)) == 0)
00859 malloc_failure ();
00860 sprintf (s, "%s%c%s", lc_save_dir, PATH_SLASH, RESULTS_FILENAME);
00861 ok_dial_box (s, RESULTS, 0L);
00862 }
|
|
||||||||||||||||||||
|
Definition at line 2238 of file screen.c. 02239 {
02240 int result;
02241 result = dialog_box(red(10),7,
02242 0,0,s1,
02243 0,0,"",
02244 0,0,s2,
02245 0,0,s3,
02246 0,0,s4,
02247 1,'y',_("Yes"),
02248 1,'n',_("No"));
02249
02250 return (result == 'y') ? 1 : 0;
02251 }
|
1.3.9.1