# object_land.h

Go to the documentation of this file.

    00001 /* $Id: object_land.h 25876 2013-10-17 21:41:17Z planetmaker $ */
    00002
    00003 /*
    00004  * This file is part of OpenTTD.
    00005  * 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.
    00006  * 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.
    00007  * 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/>.
    00008  */
    00009
    00012 #define TILE_SEQ_LINE(sz, img) { 0, 0, 0, 16, 16, sz, {img, PAL_NONE} },
    00013 #define TILE_SEQ_END() { (int8)0x80, 0, 0, 0, 0, 0, {0, 0} }
    00014
    00015 static const DrawTileSeqStruct _object_nothing[] = {
    00016   TILE_SEQ_END()
    00017 };
    00018
    00019 static const DrawTileSeqStruct _object_transmitter_seq[] = {
    00020   {   7,  7,  0,  2,  2, 70, {SPR_TRANSMITTER, PAL_NONE}},
    00021   TILE_SEQ_END()
    00022 };
    00023
    00024 static const DrawTileSeqStruct _object_lighthouse_seq[] = {
    00025   {   4,  4,  0,  7,  7, 61, {SPR_LIGHTHOUSE, PAL_NONE}},
    00026   TILE_SEQ_END()
    00027 };
    00028
    00029 static const DrawTileSeqStruct _object_statue_seq[] = {
    00030   {   0,  0,  0, 16, 16, 25, {SPR_STATUE_COMPANY | (1 << PALETTE_MODIFIER_COLOUR), PAL_NONE}},
    00031   TILE_SEQ_END()
    00032 };
    00033
    00034 static const DrawTileSeqStruct _object_owned_land_seq[] = {
    00035   {   8,  8,  0,  1,  1,  6, {SPR_BOUGHT_LAND    | (1 << PALETTE_MODIFIER_COLOUR), PAL_NONE}},
    00036   TILE_SEQ_END()
    00037 };
    00038
    00039 extern const DrawTileSprites _objects[] = {
    00040   { { SPR_FLAT_2_THIRD_GRASS_TILE, PAL_NONE }, _object_transmitter_seq },
    00041   { { SPR_FLAT_2_THIRD_GRASS_TILE, PAL_NONE }, _object_lighthouse_seq  },
    00042   { { SPR_CONCRETE_GROUND,         PAL_NONE }, _object_statue_seq      },
    00043   { { SPR_FLAT_BARE_LAND,          PAL_NONE }, _object_owned_land_seq  },
    00044 };
    00045
    00046
    00047 static const DrawTileSeqStruct _object_hq_medium_north[] = {
    00048   TILE_SEQ_LINE(20, SPR_MEDIUMHQ_NORTH_WALL | (1 << PALETTE_MODIFIER_COLOUR))
    00049   TILE_SEQ_END()
    00050 };
    00051
    00052 static const DrawTileSeqStruct _object_hq_medium_east[] = {
    00053   TILE_SEQ_LINE(20, SPR_MEDIUMHQ_EAST_WALL  | (1 << PALETTE_MODIFIER_COLOUR))
    00054   TILE_SEQ_END()
    00055 };
    00056
    00057 static const DrawTileSeqStruct _object_hq_medium_west[] = {
    00058   TILE_SEQ_LINE(20, SPR_MEDIUMHQ_WEST_WALL  | (1 << PALETTE_MODIFIER_COLOUR))
    00059   TILE_SEQ_END()
    00060 };
    00061
    00062 static const DrawTileSeqStruct _object_hq_large_north[] = {
    00063   TILE_SEQ_LINE(50, SPR_LARGEHQ_NORTH_BUILD | (1 << PALETTE_MODIFIER_COLOUR))
    00064   TILE_SEQ_END()
    00065 };
    00066
    00067 static const DrawTileSeqStruct _object_hq_large_east[] = {
    00068   TILE_SEQ_LINE(50, SPR_LARGEHQ_EAST_BUILD  | (1 << PALETTE_MODIFIER_COLOUR))
    00069   TILE_SEQ_END()
    00070 };
    00071
    00072 static const DrawTileSeqStruct _object_hq_large_west[] = {
    00073   TILE_SEQ_LINE(50, SPR_LARGEHQ_WEST_BUILD  | (1 << PALETTE_MODIFIER_COLOUR))
    00074   TILE_SEQ_END()
    00075 };
    00076
    00077 static const DrawTileSeqStruct _object_hq_huge_north[] = {
    00078   TILE_SEQ_LINE(60, SPR_HUGEHQ_NORTH_BUILD  | (1 << PALETTE_MODIFIER_COLOUR))
    00079   TILE_SEQ_END()
    00080 };
    00081
    00082 static const DrawTileSeqStruct _object_hq_huge_east[] = {
    00083   TILE_SEQ_LINE(60, SPR_HUGEHQ_EAST_BUILD   | (1 << PALETTE_MODIFIER_COLOUR))
    00084   TILE_SEQ_END()
    00085 };
    00086
    00087 static const DrawTileSeqStruct _object_hq_huge_west[] = {
    00088   TILE_SEQ_LINE(60, SPR_HUGEHQ_WEST_BUILD   | (1 << PALETTE_MODIFIER_COLOUR))
    00089   TILE_SEQ_END()
    00090 };
    00091
    00092 #undef TILE_SEQ_LINE
    00093 #undef TILE_SEQ_END
    00094
    00095 #define TILE_SPRITE_LINE(img, dtss) { {img | (1 << PALETTE_MODIFIER_COLOUR), PAL_NONE}, dtss },
    00096
    00097 static const DrawTileSprites _object_hq[] = {
    00098   TILE_SPRITE_LINE(SPR_TINYHQ_NORTH,         _object_nothing)
    00099   TILE_SPRITE_LINE(SPR_TINYHQ_WEST,          _object_nothing)
    00100   TILE_SPRITE_LINE(SPR_TINYHQ_EAST,          _object_nothing)
    00101   TILE_SPRITE_LINE(SPR_TINYHQ_SOUTH,         _object_nothing)
    00102
    00103   TILE_SPRITE_LINE(SPR_SMALLHQ_NORTH,        _object_nothing)
    00104   TILE_SPRITE_LINE(SPR_SMALLHQ_WEST,         _object_nothing)
    00105   TILE_SPRITE_LINE(SPR_SMALLHQ_EAST,         _object_nothing)
    00106   TILE_SPRITE_LINE(SPR_SMALLHQ_SOUTH,        _object_nothing)
    00107
    00108   TILE_SPRITE_LINE(SPR_MEDIUMHQ_NORTH,       _object_hq_medium_north)
    00109   TILE_SPRITE_LINE(SPR_MEDIUMHQ_WEST,        _object_hq_medium_west)
    00110   TILE_SPRITE_LINE(SPR_MEDIUMHQ_EAST,        _object_hq_medium_east)
    00111   TILE_SPRITE_LINE(SPR_MEDIUMHQ_SOUTH,       _object_nothing)
    00112
    00113   TILE_SPRITE_LINE(SPR_LARGEHQ_NORTH_GROUND, _object_hq_large_north)
    00114   TILE_SPRITE_LINE(SPR_LARGEHQ_WEST_GROUND,  _object_hq_large_west)
    00115   TILE_SPRITE_LINE(SPR_LARGEHQ_EAST_GROUND,  _object_hq_large_east)
    00116   TILE_SPRITE_LINE(SPR_LARGEHQ_SOUTH,        _object_nothing)
    00117
    00118   TILE_SPRITE_LINE(SPR_HUGEHQ_NORTH_GROUND,  _object_hq_huge_north)
    00119   TILE_SPRITE_LINE(SPR_HUGEHQ_WEST_GROUND,   _object_hq_huge_west)
    00120   TILE_SPRITE_LINE(SPR_HUGEHQ_EAST_GROUND,   _object_hq_huge_east)
    00121   TILE_SPRITE_LINE(SPR_HUGEHQ_SOUTH,         _object_nothing)
    00122 };
    00123
    00124 #undef TILE_SPRITE_LINE
    00125
    00126 #define M(name, size, build_cost_multiplier, clear_cost_multiplier, height, climate, gen_amount, flags) { GRFFilePropsBase<2>(), INVALID_OBJECT_CLASS, name, climate, size, build_cost_multiplier, clear_cost_multiplier, 0, 0xFFFFFFFF, flags, {0, 0, 0, 0}, 0, height, 1, gen_amount, true }
    00127
    00128 /* Climates
    00129  * T = Temperate
    00130  * A = Sub-Arctic
    00131  * S = Sub-Tropic
    00132  * Y = Toyland */
    00133 #define T 1
    00134 #define A 2
    00135 #define S 4
    00136 #define Y 8
    00137
    00138 extern const ObjectSpec _original_objects[] = {
    00139   M(STR_LAI_OBJECT_DESCRIPTION_TRANSMITTER,          0x11,   0,   0, 10, T|A|S  , 15, OBJECT_FLAG_CANNOT_REMOVE | OBJECT_FLAG_ONLY_IN_SCENEDIT),
    00140   M(STR_LAI_OBJECT_DESCRIPTION_LIGHTHOUSE,           0x11,   0,   0,  8, T|A    ,  8, OBJECT_FLAG_CANNOT_REMOVE | OBJECT_FLAG_ONLY_IN_SCENEDIT | OBJECT_FLAG_SCALE_BY_WATER),
    00141   M(STR_TOWN_BUILDING_NAME_STATUE_1,                 0x11,   0,   0,  5, T|S|A|Y,  0, OBJECT_FLAG_CANNOT_REMOVE | OBJECT_FLAG_ONLY_IN_GAME | OBJECT_FLAG_ONLY_IN_SCENEDIT), // Yes, we disallow building this everywhere. Happens in "special" case!
    00142   M(STR_LAI_OBJECT_DESCRIPTION_COMPANY_OWNED_LAND,   0x11,  10,  10,  0, T|S|A|Y,  0, OBJECT_FLAG_AUTOREMOVE | OBJECT_FLAG_ONLY_IN_GAME | OBJECT_FLAG_CLEAR_INCOME | OBJECT_FLAG_HAS_NO_FOUNDATION ), // Only non-silly use case is to use it when you cannot build a station, so disallow bridges
    00143   M(STR_LAI_OBJECT_DESCRIPTION_COMPANY_HEADQUARTERS, 0x22,   0,   0,  7, T|S|A|Y,  0, OBJECT_FLAG_CANNOT_REMOVE | OBJECT_FLAG_ONLY_IN_GAME),
    00144 };
    00145
    00146 #undef M
    00147 #undef Y
    00148 #undef S
    00149 #undef A
    00150 #undef T