Files
@ r23483:3733e6b8ff17
Branch filter:
Location: cpp/openttd-patchpack/source/src/table/clear_land.h - annotation
r23483:3733e6b8ff17
2.1 KiB
text/x-c
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.
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.
r5475:3f5cd13d1b63 r5475:3f5cd13d1b63 r12768:980ae0491352 r12768:980ae0491352 r12768:980ae0491352 r12768:980ae0491352 r12768:980ae0491352 r12768:980ae0491352 r12768:980ae0491352 r9111:983de9c5a848 r9111:983de9c5a848 r12952:f1e4fe94bb97 r12952:f1e4fe94bb97 r12952:f1e4fe94bb97 r12952:f1e4fe94bb97 r12952:f1e4fe94bb97 r12952:f1e4fe94bb97 r12952:f1e4fe94bb97 r12952:f1e4fe94bb97 r12952:f1e4fe94bb97 r5475:3f5cd13d1b63 r5475:3f5cd13d1b63 r12952:f1e4fe94bb97 r5475:3f5cd13d1b63 r5475:3f5cd13d1b63 r5475:3f5cd13d1b63 r5475:3f5cd13d1b63 r5475:3f5cd13d1b63 r5475:3f5cd13d1b63 r12952:f1e4fe94bb97 r5475:3f5cd13d1b63 r5475:3f5cd13d1b63 r5475:3f5cd13d1b63 r5475:3f5cd13d1b63 r5475:3f5cd13d1b63 r5475:3f5cd13d1b63 r18322:cce571780fce r18322:cce571780fce r18322:cce571780fce r18322:cce571780fce r18342:a03ade1d616f r18322:cce571780fce r18322:cce571780fce r18322:cce571780fce r18322:cce571780fce r18322:cce571780fce r18322:cce571780fce r18342:a03ade1d616f r18322:cce571780fce r18322:cce571780fce r5475:3f5cd13d1b63 r12952:f1e4fe94bb97 r12952:f1e4fe94bb97 r12952:f1e4fe94bb97 r12952:f1e4fe94bb97 r12952:f1e4fe94bb97 r12952:f1e4fe94bb97 r12952:f1e4fe94bb97 r5475:3f5cd13d1b63 r5475:3f5cd13d1b63 r12952:f1e4fe94bb97 r12952:f1e4fe94bb97 r12952:f1e4fe94bb97 r12952:f1e4fe94bb97 r12952:f1e4fe94bb97 r12952:f1e4fe94bb97 r12952:f1e4fe94bb97 r12952:f1e4fe94bb97 r12952:f1e4fe94bb97 r12952:f1e4fe94bb97 r5475:3f5cd13d1b63 r5475:3f5cd13d1b63 r12952:f1e4fe94bb97 r12952:f1e4fe94bb97 r12952:f1e4fe94bb97 r12952:f1e4fe94bb97 r12952:f1e4fe94bb97 r5475:3f5cd13d1b63 | /* $Id$ */
/*
* This file is part of OpenTTD.
* OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
* OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
*/
/** @file clear_land.h Tables with sprites for clear land and fences. */
static const SpriteID _landscape_clear_sprites_rough[8] = {
SPR_FLAT_ROUGH_LAND,
SPR_FLAT_ROUGH_LAND_1,
SPR_FLAT_ROUGH_LAND_2,
SPR_FLAT_ROUGH_LAND_3,
SPR_FLAT_ROUGH_LAND_4,
SPR_FLAT_ROUGH_LAND,
SPR_FLAT_ROUGH_LAND_1,
SPR_FLAT_ROUGH_LAND_2,
};
static const byte _fence_mod_by_tileh_sw[32] = {
0, 2, 4, 0, 0, 2, 4, 0,
0, 2, 4, 0, 0, 2, 4, 0,
0, 2, 4, 0, 0, 2, 4, 4,
0, 2, 4, 2, 0, 2, 4, 0,
};
static const byte _fence_mod_by_tileh_se[32] = {
1, 1, 5, 5, 3, 3, 1, 1,
1, 1, 5, 5, 3, 3, 1, 1,
1, 1, 5, 5, 3, 3, 1, 5,
1, 1, 5, 5, 3, 3, 3, 1,
};
static const byte _fence_mod_by_tileh_ne[32] = {
0, 0, 0, 0, 4, 4, 4, 4,
2, 2, 2, 2, 0, 0, 0, 0,
0, 0, 0, 0, 4, 4, 4, 4,
2, 2, 2, 2, 0, 2, 4, 0,
};
static const byte _fence_mod_by_tileh_nw[32] = {
1, 5, 1, 5, 1, 5, 1, 5,
3, 1, 3, 1, 3, 1, 3, 1,
1, 5, 1, 5, 1, 5, 1, 5,
3, 1, 3, 5, 3, 3, 3, 1,
};
static const SpriteID _clear_land_fence_sprites[7] = {
SPR_HEDGE_BUSHES,
SPR_HEDGE_BUSHES_WITH_GATE,
SPR_HEDGE_FENCE,
SPR_HEDGE_BLOOMBUSH_YELLOW,
SPR_HEDGE_BLOOMBUSH_RED,
SPR_HEDGE_STONE,
};
static const SpriteID _clear_land_sprites_farmland[16] = {
SPR_FARMLAND_BARE,
SPR_FARMLAND_STATE_1,
SPR_FARMLAND_STATE_2,
SPR_FARMLAND_STATE_3,
SPR_FARMLAND_STATE_4,
SPR_FARMLAND_STATE_5,
SPR_FARMLAND_STATE_6,
SPR_FARMLAND_STATE_7,
SPR_FARMLAND_HAYPACKS,
};
static const SpriteID _clear_land_sprites_snow_desert[8] = {
SPR_FLAT_1_QUART_SNOW_DESERT_TILE,
SPR_FLAT_2_QUART_SNOW_DESERT_TILE,
SPR_FLAT_3_QUART_SNOW_DESERT_TILE,
SPR_FLAT_SNOW_DESERT_TILE,
};
|