Files
@ r6250:8f26e7e58ba0
Branch filter:
Location: cpp/openttd-patchpack/source/src/tree_map.h
r6250:8f26e7e58ba0
2.7 KiB
text/x-c
(svn r9054) -Update: WebTranslator2 update to 2007-03-07 18:39:14
catalan - 2 fixed by arnaullv (2)
croatian - 95 fixed, 34 changed by Ydobon (129)
czech - 1 fixed, 3 deleted, 109 changed by Hadez (113)
danish - 4 fixed by ThomasA (4)
dutch - 2 fixed by habell (2)
esperanto - 5 fixed by LaPingvino (5)
french - 2 fixed by glx (2)
german - 1 fixed by Neonox (1)
hungarian - 1 fixed by miham (1)
italian - 1 fixed by sidew (1)
japanese - 14 fixed by ickoonite (14)
korean - 9 fixed by Nios (9)
norwegian_nynorsk - 1 fixed by Eikje3 (1)
polish - 2 fixed by meush (2)
simplified_chinese - 5 fixed by Fishingsnow (5)
slovenian - 1 fixed by Necrolyte (1)
spanish - 5 fixed by eusebio (5)
swedish - 5 fixed by daishan (5)
traditional_chinese - 7 fixed by sam0737 (7)
ukrainian - 1 fixed by znikoz (1)
catalan - 2 fixed by arnaullv (2)
croatian - 95 fixed, 34 changed by Ydobon (129)
czech - 1 fixed, 3 deleted, 109 changed by Hadez (113)
danish - 4 fixed by ThomasA (4)
dutch - 2 fixed by habell (2)
esperanto - 5 fixed by LaPingvino (5)
french - 2 fixed by glx (2)
german - 1 fixed by Neonox (1)
hungarian - 1 fixed by miham (1)
italian - 1 fixed by sidew (1)
japanese - 14 fixed by ickoonite (14)
korean - 9 fixed by Nios (9)
norwegian_nynorsk - 1 fixed by Eikje3 (1)
polish - 2 fixed by meush (2)
simplified_chinese - 5 fixed by Fishingsnow (5)
slovenian - 1 fixed by Necrolyte (1)
spanish - 5 fixed by eusebio (5)
swedish - 5 fixed by daishan (5)
traditional_chinese - 7 fixed by sam0737 (7)
ukrainian - 1 fixed by znikoz (1)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 | /* $Id$ */
#ifndef TREE_MAP_H
#define TREE_MAP_H
#include "macros.h"
enum TreeType {
TREE_INVALID = -1,
TREE_TEMPERATE = 0,
TREE_SUB_ARCTIC = 12,
TREE_RAINFOREST = 20,
TREE_CACTUS = 27,
TREE_SUB_TROPICAL = 28,
TREE_TOYLAND = 32
};
enum {
TREE_COUNT_TEMPERATE = TREE_SUB_ARCTIC - TREE_TEMPERATE,
TREE_COUNT_SUB_ARCTIC = TREE_RAINFOREST - TREE_SUB_ARCTIC,
TREE_COUNT_RAINFOREST = TREE_CACTUS - TREE_RAINFOREST,
TREE_COUNT_SUB_TROPICAL = TREE_SUB_TROPICAL - TREE_CACTUS,
TREE_COUNT_TOYLAND = 9
};
/* ground type, m2 bits 4...5
* valid densities (bits 6...7) in comments after the enum */
enum TreeGround {
TREE_GROUND_GRASS = 0, // 0
TREE_GROUND_ROUGH = 1, // 0
TREE_GROUND_SNOW_DESERT = 2 // 0-3 for snow, 3 for desert
};
static inline TreeType GetTreeType(TileIndex t)
{
assert(IsTileType(t, MP_TREES));
return (TreeType)_m[t].m3;
}
static inline TreeGround GetTreeGround(TileIndex t)
{
assert(IsTileType(t, MP_TREES));
return (TreeGround)GB(_m[t].m2, 4, 2);
}
static inline uint GetTreeDensity(TileIndex t)
{
assert(IsTileType(t, MP_TREES));
return GB(_m[t].m2, 6, 2);
}
static inline void SetTreeGroundDensity(TileIndex t, TreeGround g, uint d)
{
assert(IsTileType(t, MP_TREES)); // XXX incomplete
SB(_m[t].m2, 4, 2, g);
SB(_m[t].m2, 6, 2, d);
}
static inline uint GetTreeCount(TileIndex t)
{
assert(IsTileType(t, MP_TREES));
return GB(_m[t].m5, 6, 2);
}
static inline void AddTreeCount(TileIndex t, int c)
{
assert(IsTileType(t, MP_TREES)); // XXX incomplete
_m[t].m5 += c << 6;
}
static inline void SetTreeCount(TileIndex t, uint c)
{
assert(IsTileType(t, MP_TREES)); // XXX incomplete
SB(_m[t].m5, 6, 2, c);
}
static inline uint GetTreeGrowth(TileIndex t)
{
assert(IsTileType(t, MP_TREES));
return GB(_m[t].m5, 0, 3);
}
static inline void AddTreeGrowth(TileIndex t, int a)
{
assert(IsTileType(t, MP_TREES)); // XXX incomplete
_m[t].m5 += a;
}
static inline void SetTreeGrowth(TileIndex t, uint g)
{
assert(IsTileType(t, MP_TREES)); // XXX incomplete
SB(_m[t].m5, 0, 3, g);
}
static inline uint GetTreeCounter(TileIndex t)
{
assert(IsTileType(t, MP_TREES));
return GB(_m[t].m2, 0, 4);
}
static inline void AddTreeCounter(TileIndex t, int a)
{
assert(IsTileType(t, MP_TREES)); // XXX incomplete
_m[t].m2 += a;
}
static inline void SetTreeCounter(TileIndex t, uint c)
{
assert(IsTileType(t, MP_TREES)); // XXX incomplete
SB(_m[t].m2, 0, 4, c);
}
static inline void MakeTree(TileIndex t, TreeType type, uint count, uint growth, TreeGround ground, uint density)
{
SetTileType(t, MP_TREES);
SetTileOwner(t, OWNER_NONE);
_m[t].m2 = density << 6 | ground << 4 | 0;
_m[t].m3 = type;
_m[t].m4 = 0 << 5 | 0 << 2;
_m[t].m5 = count << 6 | growth;
}
#endif /* TREE_MAP_H */
|