Files @ r23483:3733e6b8ff17
Branch filter:

Location: cpp/openttd-patchpack/source/media/openttd.svg

Patric Stout
Remove: ENABLE_NETWORK switch

This switch has been a pain for years. Often disabling broke
compilation, as no developer compiles OpenTTD without, neither do
any of our official binaries.

Additionaly, it has grown so hugely in our codebase, that it
clearly shows that the current solution was a poor one. 350+
instances of "#ifdef ENABLE_NETWORK" were in the code, of which
only ~30 in the networking code itself. The rest were all around
the code to do the right thing, from GUI to NewGRF.

A more proper solution would be to stub all the functions, and
make sure the rest of the code can simply assume network is
available. This was also partially done, and most variables were
correct if networking was disabled. Despite that, often the #ifdefs
were still used.

With the recent removal of DOS, there is also no platform anymore
which we support where networking isn't working out-of-the-box.

All in all, it is time to remove the ENABLE_NETWORK switch. No
replacement is planned, but if you feel we really need this option,
we welcome any Pull Request which implements this in a way that
doesn't crawl through the code like this diff shows we used to.
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->

<svg
   xmlns:dc="http://purl.org/dc/elements/1.1/"
   xmlns:cc="http://creativecommons.org/ns#"
   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
   xmlns:svg="http://www.w3.org/2000/svg"
   xmlns="http://www.w3.org/2000/svg"
   xmlns:xlink="http://www.w3.org/1999/xlink"
   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
   version="1.0"
   width="256"
   height="256"
   id="svg2"
   inkscape:version="0.47 r22583"
   sodipodi:docname="openttd.svg">
  <metadata
     id="metadata42">
    <rdf:RDF>
      <cc:Work
         rdf:about="">
        <dc:format>image/svg+xml</dc:format>
        <dc:type
           rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
      </cc:Work>
    </rdf:RDF>
  </metadata>
  <sodipodi:namedview
     pagecolor="#ffffff"
     bordercolor="#666666"
     borderopacity="1"
     objecttolerance="10"
     gridtolerance="10"
     guidetolerance="10"
     inkscape:pageopacity="0"
     inkscape:pageshadow="2"
     inkscape:window-width="1920"
     inkscape:window-height="1177"
     id="namedview40"
     showgrid="false"
     inkscape:zoom="2.8284271"
     inkscape:cx="163.74991"
     inkscape:cy="132.32268"
     inkscape:window-x="0"
     inkscape:window-y="0"
     inkscape:window-maximized="1"
     inkscape:current-layer="svg2" />
  <defs
     id="defs4">
    <inkscape:perspective
       sodipodi:type="inkscape:persp3d"
       inkscape:vp_x="0 : 124 : 1"
       inkscape:vp_y="0 : 1000 : 0"
       inkscape:vp_z="256 : 124 : 1"
       inkscape:persp3d-origin="128 : 82.666667 : 1"
       id="perspective44" />
    <linearGradient
       id="linearGradient3421">
      <stop
         style="stop-color:#fe7600;stop-opacity:1"
         offset="0"
         id="stop3423" />
      <stop
         style="stop-color:#f2b26d;stop-opacity:1"
         offset="1"
         id="stop3425" />
    </linearGradient>
    <linearGradient
       id="linearGradient3269">
      <stop
         style="stop-color:#ffffff;stop-opacity:1"
         offset="0"
         id="stop3271" />
      <stop
         style="stop-color:#ffffff;stop-opacity:0"
         offset="1"
         id="stop3273" />
    </linearGradient>
    <linearGradient
       x1="312.62323"
       y1="468.58658"
       x2="315.21729"
       y2="471.18063"
       id="linearGradient3275"
       xlink:href="#linearGradient3269"
       gradientUnits="userSpaceOnUse" />
    <linearGradient
       x1="312.62323"
       y1="468.58658"
       x2="315.21729"
       y2="471.18063"
       id="linearGradient3289"
       xlink:href="#linearGradient3269"
       gradientUnits="userSpaceOnUse" />
    <linearGradient
       x1="312.62323"
       y1="468.58658"
       x2="315.21729"
       y2="471.18063"
       id="linearGradient3308"
       xlink:href="#linearGradient3269"
       gradientUnits="userSpaceOnUse"
       gradientTransform="matrix(0.7071068,-0.7071068,0.7071068,0.7071068,-266.24277,420.94154)" />
    <linearGradient
       x1="312.62323"
       y1="468.58658"
       x2="315.21729"
       y2="471.18063"
       id="linearGradient3326"
       xlink:href="#linearGradient3269"
       gradientUnits="userSpaceOnUse"
       gradientTransform="matrix(0.7071068,-0.7071068,0.7071068,0.7071068,-266.24277,420.94154)" />
    <linearGradient
       x1="312.62323"
       y1="468.58658"
       x2="315.21729"
       y2="471.18063"
       id="linearGradient3336"
       xlink:href="#linearGradient3269"
       gradientUnits="userSpaceOnUse"
       gradientTransform="translate(0.3591922,-0.1487874)" />
    <linearGradient
       x1="312.62323"
       y1="468.58658"
       x2="315.21729"
       y2="471.18063"
       id="linearGradient3406"
       xlink:href="#linearGradient3269"
       gradientUnits="userSpaceOnUse"
       gradientTransform="translate(-2.2643187,40.455238)" />
    <linearGradient
       x1="133.3282"
       y1="156.16792"
       x2="117.66125"
       y2="78.463249"
       id="linearGradient3431"
       xlink:href="#linearGradient3421"
       gradientUnits="userSpaceOnUse" />
    <linearGradient
       x1="133.3282"
       y1="156.16792"
       x2="117.66125"
       y2="78.463249"
       id="linearGradient3488"
       xlink:href="#linearGradient3421"
       gradientUnits="userSpaceOnUse"
       gradientTransform="translate(2,2)" />
    <filter
       id="filter3566"
       color-interpolation-filters="sRGB">
      <feGaussianBlur
         id="feGaussianBlur3568"
         stdDeviation="1.2236964"
         inkscape:collect="always" />
    </filter>
    <linearGradient
       x1="136.3282"
       y1="151.16792"
       x2="117.66125"
       y2="78.463249"
       id="linearGradient3571"
       xlink:href="#linearGradient3421"
       gradientUnits="userSpaceOnUse" />
  </defs>
  <g
     transform="translate(-246.4375,-405.5443)"
     id="layer1">
    <path
       d="m 127.34375,3.46875 c -0.48316,0.02376 -0.94805,0.22615 -1.3125,0.59375 L 7.65625,122.40625 c -0.78094,0.7811 -0.78094,2.06266 0,2.84375 L 25.25,142.84375 5,163.09375 c -0.78094,0.7811 -0.78094,2.03141 0,2.8125 l 80.40625,80.40625 c 0.7811,0.78094 2.03141,0.78093 2.8125,0 l 20.25,-20.25 17.59375,17.59375 c 0.7811,0.78093 2.03141,0.78093 2.8125,0 l 17.5625,-17.5625 20.21875,20.21875 c 0.78108,0.78094 2.06265,0.78093 2.84375,0 l 80.375,-80.40625 c 0.78094,-0.78109 0.78094,-2.0314 0,-2.8125 L 229.65625,142.875 247.25,125.28125 c 0.78094,-0.7811 0.78094,-2.06265 0,-2.84375 L 128.875,4.0625 c -0.0421,-0.04625 -0.11001,-0.11415 -0.15625,-0.15625 -0.39876,-0.33006 -0.89184,-0.46126 -1.375,-0.4375 z m -6,43.5625 14.15625,0 0,19.75 c 0.01,0.435733 0.30048,0.815 0.71875,0.9375 2.36672,0.715663 4.34765,1.46009 5.9375,2.1875 1.57854,0.722523 3.76284,1.94 6.53125,3.65625 0.23423,0.144983 0.51508,0.19598 0.78125,0.125 0.26615,-0.07098 0.49406,-0.25764 0.625,-0.5 l 2.875,-5.40625 7.75,0 9.34375,36.21875 -13.625,3.90625 c -4.11145,-10.161057 -10.59377,-17.79909 -19.46875,-22.625 -0.31359,-0.166457 -0.69786,-0.15518 -1,0.03125 -0.30216,0.186431 -0.47688,0.52006 -0.46875,0.875 l 0,24.03125 c 0.01,0.43573 0.30048,0.815 0.71875,0.9375 10.93974,3.10986 18.88772,6.27714 23.75,9.4375 4.89952,3.1848 8.58915,7.0982 11.15625,11.71875 2.57543,4.63598 3.84364,9.41467 3.84375,14.375 -1.1e-4,5.33303 -1.49612,10.44021 -4.5625,15.40625 -3.05188,4.94228 -7.57932,9.1061 -13.59375,12.46875 -5.99929,3.35409 -12.74816,5.29505 -20.375,5.84375 -0.52771,0.0331 -0.93848,0.47125 -0.9375,1 l 0,19.25 -14.15625,0 0,-20.65625 c 0.0115,-0.47702 -0.31562,-0.89572 -0.78125,-1 -6.24994,-1.46738 -12.82661,-4.66999 -19.71875,-9.6875 -0.25021,-0.18733 -0.57446,-0.24211 -0.875,-0.15625 -0.300532,0.0859 -0.54278,0.30252 -0.65625,0.59375 l -3.75,9.25 -7.625,0 -7.875,-42.34375 14.3125,-3.4375 c 2.78387,6.00776 5.47545,10.86469 8.09375,14.4375 2.72545,3.71918 5.79951,6.95217 9.21875,9.6875 2.53873,2.0772 5.32819,3.64369 8.34375,4.6875 0.30262,0.0995 0.64703,0.0602 0.90625,-0.125 0.25923,-0.18516 0.40226,-0.49396 0.40625,-0.8125 l 0,-27.875 c 0.008,-0.43878 -0.2706,-0.83165 -0.6875,-0.96875 -11.9575,-4.0043 -20.14727,-7.50583 -24.4375,-10.375 C 91.88074,118.97403 88.49102,115.30727 86,110.8125 83.50306,106.30724 82.24999,101.8073 82.25,97.25 c -1e-5,-5.212767 1.5369,-10.24246 4.65625,-15.125 3.11104,-4.869387 7.41684,-8.74009 12.96875,-11.625 5.52685,-2.871687 12.35433,-4.48215 20.5,-4.8125 0.54002,-0.01694 0.96896,-0.45971 0.96875,-1 l 0,-17.65625 z m -2,37.375 c -3.80484,0.61143 -6.64239,1.484763 -8.125,2.53125 -2.55269,1.82341 -3.68754,3.817503 -3.6875,6.21875 -3e-5,1.99888 0.82821,3.916143 2.6875,5.90625 1.5957,1.70818 4.79074,3.41885 9.125,5.03125 l 0,-19.6875 z m 18.15625,55.125 0,22.40625 c 3.64443,-0.60429 6.6344,-1.65745 8.8125,-3.25 2.37481,-1.73646 3.46868,-3.90374 3.46875,-6.875 -7e-5,-2.6212 -0.83434,-4.7944 -2.625,-6.6875 -2.27356,-2.32082 -5.55946,-4.16441 -9.65625,-5.59375 z"
       transform="translate(247,408.36218)"
       style="fill:#000000;fill-opacity:0.69019608;fill-rule:evenodd;stroke:none;filter:url(#filter3566)"
       id="path3453" />
    <path
       d="m 125.4375,3.46875 -118.375,118.375 118.375,118.375 118.40625,-118.375 L 125.4375,3.46875 z m -7.09375,40.5625 16.15625,0 0,20.75 c 2.39847,0.725255 4.41692,1.465836 6.0625,2.21875 1.64544,0.753136 3.86718,1.989686 6.65625,3.71875 l 3.15625,-5.9375 9.125,0 9.78125,37.90625 -15.375,4.4375 C 149.89001,96.694255 143.4247,89.040435 134.5,84.1875 l 0,24.03125 c 10.98855,3.12374 18.97973,6.29945 24,9.5625 5.02009,3.26318 8.85036,7.29338 11.5,12.0625 2.64944,4.76921 3.96864,9.71205 3.96875,14.84375 -1.1e-4,5.52222 -1.56729,10.83367 -4.71875,15.9375 -3.15166,5.10387 -7.80181,9.38205 -13.9375,12.8125 -6.13586,3.43045 -13.05918,5.41095 -20.8125,5.96875 l 0,20.25 -16.15625,0 0,-21.65625 c -6.41472,-1.50606 -13.12131,-4.79903 -20.09375,-9.875 l -4,9.875 -9.125,0 -8.21875,-44.09375 16,-3.84375 c 2.900524,6.35894 5.697538,11.34646 8.375,15 2.6774,3.65361 5.68442,6.8226 9.03125,9.5 2.45427,2.0081 5.13065,3.52723 8.03125,4.53125 l 0,-27.875 c -11.9927,-4.01609 -20.225144,-7.51572 -24.6875,-10.5 C 89.193843,117.73459 85.690854,113.94229 83.125,109.3125 80.559118,104.68285 79.249989,99.991365 79.25,95.25 c -9e-6,-5.410553 1.605147,-10.635971 4.8125,-15.65625 3.207321,-5.02008 7.654184,-9.01231 13.34375,-11.96875 5.68951,-2.956214 12.68204,-4.602705 20.9375,-4.9375 l 0,-18.65625 z m 0,37.15625 c -4.57399,0.613679 -7.82228,1.598881 -9.71875,2.9375 -2.73325,1.952387 -4.09379,4.29813 -4.09375,7.03125 -4e-5,2.287057 0.98853,4.4742 2.96875,6.59375 1.98014,2.119711 5.6004,4.09012 10.84375,5.875 l 0,-22.4375 z m 16.15625,54.875 0,25.125 c 4.35076,-0.55777 7.81241,-1.79097 10.40625,-3.6875 2.59369,-1.8965 3.87492,-4.45224 3.875,-7.6875 -8e-5,-2.84474 -0.95404,-5.31111 -2.90625,-7.375 -2.67751,-2.73317 -6.46645,-4.8689 -11.375,-6.375 z"
       transform="translate(247,408.36218)"
       style="fill:url(#linearGradient3571);fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0"
       id="rect3418" />
    <rect
       width="113.67383"
       height="30.562906"
       x="581.44257"
       y="195.29802"
       transform="matrix(0.7071068,0.7071068,-0.7071068,0.7071068,0,0)"
       style="fill:#6ad636;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:4;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0"
       id="rect3277" />
    <path
       d="m 271.41033,548.04524 -21.3701,21.3701 c -0.51722,0.5028 -0.72366,1.24514 -0.54025,1.94279 0.18341,0.69764 0.72825,1.24248 1.42588,1.42589 0.69765,0.1834 1.44,-0.023 1.9428,-0.54026 l 21.91555,-21.91555 -3.37388,-2.28297 z"
       style="opacity:0.7;fill:url(#linearGradient3406);fill-opacity:1;fill-rule:evenodd;stroke:none"
       id="path3404" />
    <rect
       width="167.41394"
       height="167.41394"
       x="554.57251"
       y="27.848526"
       transform="matrix(0.7071068,0.7071068,-0.7071068,0.7071068,0,0)"
       style="fill:none;stroke:#000000;stroke-width:4;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0"
       id="rect2251" />
    <path
       d="m 373.71159,410.23833 c -0.81035,-0.62925 -1.9654,-0.54334 -2.67374,0.19888 l -118.37411,118.3741 c -0.51722,0.5028 -0.72366,1.24514 -0.54025,1.94279 0.18341,0.69764 0.72825,1.24248 1.42588,1.42589 0.69765,0.1834 1.44,-0.023 1.9428,-0.54026 l 118.3741,-118.3741 c 0.42126,-0.40199 0.64643,-0.96759 0.61671,-1.54911 -0.0297,-0.58152 -0.31136,-1.12123 -0.77139,-1.47819 l 0,0 z"
       style="opacity:0.7;fill:url(#linearGradient3336);fill-opacity:1;fill-rule:evenodd;stroke:none"
       id="path3256" />
    <rect
       width="113.67384"
       height="30.56292"
       x="54.718613"
       y="-752.58502"
       transform="matrix(-0.7071068,0.7071068,-0.7071068,-0.7071068,0,0)"
       style="fill:#6ad636;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:4.00000048;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0"
       id="rect3279" />
    <rect
       width="11.142811"
       height="14.090264"
       x="602.29895"
       y="203.53435"
       transform="matrix(0.7071068,0.7071068,-0.7071068,0.7071068,0,0)"
       style="fill:none;stroke:#000000;stroke-width:4;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0"
       id="rect3291" />
    <rect
       width="11.142811"
       height="8.5145016"
       x="622.57172"
       y="203.53435"
       transform="matrix(0.7071068,0.7071068,-0.7071068,0.7071068,0,0)"
       style="fill:none;stroke:#000000;stroke-width:4;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0"
       id="rect3293" />
    <path
       d="m 308.55497,616.32265 -7.87916,-7.87915 9.96333,-9.96333 7.87916,7.87916"
       style="fill:none;stroke:#000000;stroke-width:4;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dashoffset:0"
       id="rect3295" />
    <path
       d="m 315.01081,622.77849 9.96332,-9.96333 7.87916,7.87916 -9.96333,9.96332"
       style="fill:none;stroke:#000000;stroke-width:4;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dashoffset:0"
       id="rect3297" />
    <path
       d="m 445.04627,584.86337 1.41421,1.41422 9.96579,9.96578 1.41421,1.41422 1.41421,-1.41422 6.47445,-6.47444 -2.82843,-2.82843 2.82843,-2.82843 -7.13736,-7.13736 -2.82843,2.82843 -2.82842,-2.82843 -6.47445,6.47445 -1.41421,1.41421 z m 5.65685,0 5.06023,-5.06023 7.13736,7.13736 -5.06023,5.06023 -7.13736,-7.13736 z"
       style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:none"
       id="rect3347" />
    <path
       d="m 427.09359,605.64776 -7.87916,7.87915"
       style="fill:none;stroke:#000000;stroke-width:4;stroke-linecap:square;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dashoffset:0"
       id="rect3343" />
    <path
       d="m 433.11734,619.55066 -9.96333,-9.96333"
       style="fill:none;stroke:#000000;stroke-width:4;stroke-linecap:square;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dashoffset:0"
       id="path3352" />
    <path
       d="m 441.42857,591.31278 -7.87916,7.87916"
       style="fill:none;stroke:#000000;stroke-width:4;stroke-linecap:square;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dashoffset:0"
       id="path3364" />
    <path
       d="m 447.45232,605.21568 -9.96333,-9.96333"
       style="fill:none;stroke:#000000;stroke-width:4;stroke-linecap:square;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dashoffset:0"
       id="path3366" />
    <path
       d="m 296.30415,584.14518 -9.96332,9.96333"
       style="fill:none;stroke:#000000;stroke-width:4;stroke-linecap:square;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dashoffset:0"
       id="rect3380" />
    <path
       d="m 306.75446,602.36485 7.87915,7.87916"
       style="fill:none;stroke:#000000;stroke-width:4;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dashoffset:0"
       id="path3384" />
  </g>
</svg>