diff options
author | rubidium <rubidium@openttd.org> | 2007-01-10 18:56:51 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2007-01-10 18:56:51 +0000 |
commit | a7d0cdf95fd8847ab76b35446e1c9b77f8ef1cb7 (patch) | |
tree | 1a1c59c13ddb1d152052f3a3a0bcffe4fb531173 /src/table/ai_rail.h | |
parent | ce75f6549dd379b506c9f1e9383bd881aa7cf5c7 (diff) | |
download | openttd-a7d0cdf95fd8847ab76b35446e1c9b77f8ef1cb7.tar.xz |
(svn r8038) -Merge: the cpp branch. Effort of KUDr, Celestar, glx, Smoovius, stillunknown and pv2b.
Diffstat (limited to 'src/table/ai_rail.h')
-rw-r--r-- | src/table/ai_rail.h | 232 |
1 files changed, 163 insertions, 69 deletions
diff --git a/src/table/ai_rail.h b/src/table/ai_rail.h index 8e6a49c50..218f33f3d 100644 --- a/src/table/ai_rail.h +++ b/src/table/ai_rail.h @@ -12,24 +12,23 @@ typedef struct { byte p2; byte p3; byte dir; - AiDefaultBlockData data[VARARRAY_SIZE]; + const AiDefaultBlockData *data; } AiDefaultRailBlock; typedef struct { byte dir; - AiDefaultBlockData data[VARARRAY_SIZE]; + const AiDefaultBlockData *data; } AiDefaultRoadBlock; -#define MKHDR(a,b,c,d,e) a,b,c,d,e,{ +#define MKHDR(a,b,c,d,e) a,b,c,d,e, #define MKDEPOT(a, b, c) {0, a, {b, c}} #define MKSTATION(a, b, c) {1, a, {b, c}} #define MKRAIL(a, b, c) {2, a, {b, c}} #define MKCLRRAIL(a, b, c) {3, a, {b, c}} -#define MKEND {4, 0, {0, 0}}} +#define MKEND {4, 0, {0, 0}} -static const AiDefaultRailBlock _raildata_ai_0 = { - MKHDR(1, 2, 1, 0, 1) +static const AiDefaultBlockData _raildata_ai_0_data[] = { MKDEPOT(2, -1, 1), MKSTATION(0x15, 0, -1), MKRAIL(0x26, 0, 1), @@ -37,8 +36,11 @@ static const AiDefaultRailBlock _raildata_ai_0 = { MKEND }; -static const AiDefaultRailBlock _raildata_ai_1 = { - MKHDR(1, 2, 1, 0, 3) +static const AiDefaultRailBlock _raildata_ai_0 = { + 1, 2, 1, 0, 1, _raildata_ai_0_data +}; + +static const AiDefaultBlockData _raildata_ai_1_data[] = { MKDEPOT(2, -1, -1), MKRAIL(0x26, 0, -1), MKSTATION(0x15, 0, 0), @@ -46,8 +48,11 @@ static const AiDefaultRailBlock _raildata_ai_1 = { MKEND }; -static const AiDefaultRailBlock _raildata_ai_2 = { - MKHDR(1, 2, 1, 0, 0) +static const AiDefaultRailBlock _raildata_ai_1 = { + 1, 2, 1, 0, 3, _raildata_ai_1_data +}; + +static const AiDefaultBlockData _raildata_ai_2_data[] = { MKDEPOT(1, -1, -1), MKRAIL(0x15, -1, 0), MKSTATION(0x14, 0, 0), @@ -55,8 +60,11 @@ static const AiDefaultRailBlock _raildata_ai_2 = { MKEND }; -static const AiDefaultRailBlock _raildata_ai_3 = { - MKHDR(1, 2, 1, 0, 2) +static const AiDefaultRailBlock _raildata_ai_2 = { + 1, 2, 1, 0, 0, _raildata_ai_2_data +}; + +static const AiDefaultBlockData _raildata_ai_3_data[] = { MKDEPOT(1, 1, -1), MKRAIL(0x15, 1, 0), MKSTATION(0x14, -1, 0), @@ -64,24 +72,33 @@ static const AiDefaultRailBlock _raildata_ai_3 = { MKEND }; -static const AiDefaultRailBlock _raildata_ai_4 = { - MKHDR(1, 2, 2, 0, 255) +static const AiDefaultRailBlock _raildata_ai_3 = { + 1, 2, 1, 0, 2, _raildata_ai_3_data +}; + +static const AiDefaultBlockData _raildata_ai_4_data[] = { MKSTATION(0x15, 0, 0), MKCLRRAIL(3, 0, -1), MKCLRRAIL(1, 0, 2), MKEND }; -static const AiDefaultRailBlock _raildata_ai_5 = { - MKHDR(1, 2, 2, 0, 255) +static const AiDefaultRailBlock _raildata_ai_4 = { + 1, 2, 2, 0, 255, _raildata_ai_4_data +}; + +static const AiDefaultBlockData _raildata_ai_5_data[] = { MKSTATION(0x14, 0, 0), MKCLRRAIL(0, -1, 0), MKCLRRAIL(2, 2, 0), MKEND }; -static const AiDefaultRailBlock _raildata_ai_6 = { - MKHDR(2, 3, 1, 0, 1) +static const AiDefaultRailBlock _raildata_ai_5 = { + 1, 2, 2, 0, 255, _raildata_ai_5_data +}; + +static const AiDefaultBlockData _raildata_ai_6_data[] = { MKSTATION(0x27, 0, -2), MKRAIL(0xC2, 0, 1), MKRAIL(0xC2, 1, 1), @@ -92,8 +109,11 @@ static const AiDefaultRailBlock _raildata_ai_6 = { MKEND }; -static const AiDefaultRailBlock _raildata_ai_7 = { - MKHDR(2, 3, 1, 0, 3) +static const AiDefaultRailBlock _raildata_ai_6 = { + 2, 3, 1, 0, 1, _raildata_ai_6_data +}; + +static const AiDefaultBlockData _raildata_ai_7_data[] = { MKDEPOT(1, 0, -3), MKRAIL(0x1A, 0, -2), MKRAIL(0x26, 1, -2), @@ -104,8 +124,11 @@ static const AiDefaultRailBlock _raildata_ai_7 = { MKEND }; -static const AiDefaultRailBlock _raildata_ai_8 = { - MKHDR(2, 3, 1, 0, 2) +static const AiDefaultRailBlock _raildata_ai_7 = { + 2, 3, 1, 0, 3, _raildata_ai_7_data +}; + +static const AiDefaultBlockData _raildata_ai_8_data[] = { MKSTATION(0x26, -2, 0), MKRAIL(0xC1, 1, 0), MKRAIL(0xC1, 1, 1), @@ -116,8 +139,11 @@ static const AiDefaultRailBlock _raildata_ai_8 = { MKEND }; -static const AiDefaultRailBlock _raildata_ai_9 = { - MKHDR(2, 3, 1, 0, 0) +static const AiDefaultRailBlock _raildata_ai_8 = { + 2, 3, 1, 0, 2, _raildata_ai_8_data +}; + +static const AiDefaultBlockData _raildata_ai_9_data[] = { MKDEPOT(2, -3, -1), MKRAIL(0x29, -2, -1), MKRAIL(0x15, -2, 0), @@ -128,8 +154,11 @@ static const AiDefaultRailBlock _raildata_ai_9 = { MKEND }; -static const AiDefaultRailBlock _raildata_ai_10 = { - MKHDR(2, 3, 2, 0, 255) +static const AiDefaultRailBlock _raildata_ai_9 = { + 2, 3, 1, 0, 0, _raildata_ai_9_data +}; + +static const AiDefaultBlockData _raildata_ai_10_data[] = { MKRAIL(0x1A, 0, -3), MKRAIL(0x20, 1, -3), MKRAIL(0xC2, 0, -2), @@ -144,8 +173,11 @@ static const AiDefaultRailBlock _raildata_ai_10 = { MKEND }; -static const AiDefaultRailBlock _raildata_ai_11 = { - MKHDR(2, 3, 2, 0, 255) +static const AiDefaultRailBlock _raildata_ai_10 = { + 2, 3, 2, 0, 255, _raildata_ai_10_data +}; + +static const AiDefaultBlockData _raildata_ai_11_data[] = { MKRAIL(0x29, -3, 0), MKRAIL(0x10, -3, 1), MKRAIL(0xC1, -2, 0), @@ -160,8 +192,11 @@ static const AiDefaultRailBlock _raildata_ai_11 = { MKEND }; -static const AiDefaultRailBlock _raildata_ai_12 = { - MKHDR(2, 3, 2, 1, 3) +static const AiDefaultRailBlock _raildata_ai_11 = { + 2, 3, 2, 0, 255, _raildata_ai_11_data +}; + +static const AiDefaultBlockData _raildata_ai_12_data[] = { MKRAIL(0x88, -1, -3), MKRAIL(0x6, 0, -3), MKRAIL(0x2, -1, -2), @@ -179,8 +214,11 @@ static const AiDefaultRailBlock _raildata_ai_12 = { MKEND }; -static const AiDefaultRailBlock _raildata_ai_13 = { - MKHDR(2, 3, 2, 1, 0) +static const AiDefaultRailBlock _raildata_ai_12 = { + 2, 3, 2, 1, 3, _raildata_ai_12_data +}; + +static const AiDefaultBlockData _raildata_ai_13_data[] = { MKRAIL(0x21, -3, 0), MKRAIL(0x50, -3, 1), MKRAIL(0x81, -2, 0), @@ -198,8 +236,11 @@ static const AiDefaultRailBlock _raildata_ai_13 = { MKEND }; -static const AiDefaultRailBlock _raildata_ai_14 = { - MKHDR(2, 3, 2, 1, 1) +static const AiDefaultRailBlock _raildata_ai_13 = { + 2, 3, 2, 1, 0, _raildata_ai_13_data +}; + +static const AiDefaultBlockData _raildata_ai_14_data[] = { MKRAIL(0x88, -1, -3), MKRAIL(0x6, 0, -3), MKRAIL(0x2, -1, -2), @@ -217,8 +258,11 @@ static const AiDefaultRailBlock _raildata_ai_14 = { MKEND }; -static const AiDefaultRailBlock _raildata_ai_15 = { - MKHDR(2, 3, 2, 1, 2) +static const AiDefaultRailBlock _raildata_ai_14 = { + 2, 3, 2, 1, 1, _raildata_ai_14_data +}; + +static const AiDefaultBlockData _raildata_ai_15_data[] = { MKRAIL(0x21, -3, 0), MKRAIL(0x50, -3, 1), MKRAIL(0x81, -2, 0), @@ -236,8 +280,11 @@ static const AiDefaultRailBlock _raildata_ai_15 = { MKEND }; -static const AiDefaultRailBlock _raildata_ai_16 = { - MKHDR(1, 3, 1, 0, 1) +static const AiDefaultRailBlock _raildata_ai_15 = { + 2, 3, 2, 1, 2, _raildata_ai_15_data +}; + +static const AiDefaultBlockData _raildata_ai_16_data[] = { MKSTATION(0x17, 0, -2), MKRAIL(0x1A, 0, 1), MKCLRRAIL(1, 0, 2), @@ -245,8 +292,11 @@ static const AiDefaultRailBlock _raildata_ai_16 = { MKEND }; -static const AiDefaultRailBlock _raildata_ai_17 = { - MKHDR(1, 3, 1, 0, 3) +static const AiDefaultRailBlock _raildata_ai_16 = { + 1, 3, 1, 0, 1, _raildata_ai_16_data +}; + +static const AiDefaultBlockData _raildata_ai_17_data[] = { MKCLRRAIL(3, 0, -2), MKRAIL(0x26, 0, -1), MKDEPOT(2, -1, -1), @@ -254,8 +304,11 @@ static const AiDefaultRailBlock _raildata_ai_17 = { MKEND }; -static const AiDefaultRailBlock _raildata_ai_18 = { - MKHDR(1, 3, 1, 0, 0) +static const AiDefaultRailBlock _raildata_ai_17 = { + 1, 3, 1, 0, 3, _raildata_ai_17_data +}; + +static const AiDefaultBlockData _raildata_ai_18_data[] = { MKCLRRAIL(0, -2, 0), MKRAIL(0x29, -1, 0), MKDEPOT(3, -1, 1), @@ -263,8 +316,11 @@ static const AiDefaultRailBlock _raildata_ai_18 = { MKEND }; -static const AiDefaultRailBlock _raildata_ai_19 = { - MKHDR(1, 3, 1, 0, 2) +static const AiDefaultRailBlock _raildata_ai_18 = { + 1, 3, 1, 0, 0, _raildata_ai_18_data +}; + +static const AiDefaultBlockData _raildata_ai_19_data[] = { MKSTATION(0x16, -2, 0), MKDEPOT(2, 0, -1), MKRAIL(0x20, 1, -1), @@ -273,8 +329,11 @@ static const AiDefaultRailBlock _raildata_ai_19 = { MKEND }; -static const AiDefaultRailBlock _raildata_ai_20 = { - MKHDR(2, 3, 1, 0, 1) +static const AiDefaultRailBlock _raildata_ai_19 = { + 1, 3, 1, 0, 2, _raildata_ai_19_data +}; + +static const AiDefaultBlockData _raildata_ai_20_data[] = { MKSTATION(0x26, -2, 0), MKRAIL(0xC1, 1, 0), MKRAIL(0xC1, 1, 1), @@ -285,8 +344,11 @@ static const AiDefaultRailBlock _raildata_ai_20 = { MKEND }; -static const AiDefaultRailBlock _raildata_ai_21 = { - MKHDR(2, 3, 1, 0, 3) +static const AiDefaultRailBlock _raildata_ai_20 = { + 2, 3, 1, 0, 1, _raildata_ai_20_data +}; + +static const AiDefaultBlockData _raildata_ai_21_data[] = { MKDEPOT(2, -3, -1), MKRAIL(0x3F, -2, -1), MKRAIL(0x10, -2, 0), @@ -297,8 +359,11 @@ static const AiDefaultRailBlock _raildata_ai_21 = { MKEND }; -static const AiDefaultRailBlock _raildata_ai_22 = { - MKHDR(2, 3, 1, 0, 0) +static const AiDefaultRailBlock _raildata_ai_21 = { + 2, 3, 1, 0, 3, _raildata_ai_21_data +}; + +static const AiDefaultBlockData _raildata_ai_22_data[] = { MKSTATION(0x27, 0, -2), MKRAIL(0xC2, 0, 1), MKRAIL(0xC2, 1, 1), @@ -310,8 +375,11 @@ static const AiDefaultRailBlock _raildata_ai_22 = { MKEND }; -static const AiDefaultRailBlock _raildata_ai_23 = { - MKHDR(2, 3, 1, 0, 2) +static const AiDefaultRailBlock _raildata_ai_22 = { + 2, 3, 1, 0, 0, _raildata_ai_22_data +}; + +static const AiDefaultBlockData _raildata_ai_23_data[] = { MKDEPOT(1, 0, -3), MKRAIL(0x1A, 0, -2), MKRAIL(0x29, 1, -2), @@ -322,7 +390,9 @@ static const AiDefaultRailBlock _raildata_ai_23 = { MKEND }; - +static const AiDefaultRailBlock _raildata_ai_23 = { + 2, 3, 1, 0, 2, _raildata_ai_23_data +}; static const AiDefaultRailBlock * const _default_rail_track_data[] = { &_raildata_ai_0, @@ -356,8 +426,7 @@ static const AiDefaultRailBlock * const _default_rail_track_data[] = { #define MKHDR(a) a,{ -static const AiDefaultRoadBlock _roaddata_ai_0 = { - MKHDR(0) +static const AiDefaultBlockData _roaddata_ai_0_data[] = { MKDEPOT(2, -1,1), MKSTATION(0x2, -1,0), MKRAIL(0xC, 0,0), @@ -369,8 +438,11 @@ static const AiDefaultRoadBlock _roaddata_ai_0 = { MKEND }; -static const AiDefaultRoadBlock _roaddata_ai_1 = { - MKHDR(0) +static const AiDefaultRoadBlock _roaddata_ai_0 = { + 0, _roaddata_ai_0_data +}; + +static const AiDefaultBlockData _roaddata_ai_1_data[] = { MKDEPOT(1, 0,-1), MKSTATION(0x1, 1,-1), MKRAIL(0x3, 0,0), @@ -382,8 +454,11 @@ static const AiDefaultRoadBlock _roaddata_ai_1 = { MKEND }; -static const AiDefaultRoadBlock _roaddata_ai_2 = { - MKHDR(0) +static const AiDefaultRoadBlock _roaddata_ai_1 = { + 0, _roaddata_ai_1_data +}; + +static const AiDefaultBlockData _roaddata_ai_2_data[] = { MKDEPOT(3, 1,1), MKSTATION(0x3, 0,1), MKRAIL(0x6, 0,0), @@ -395,8 +470,11 @@ static const AiDefaultRoadBlock _roaddata_ai_2 = { MKEND }; -static const AiDefaultRoadBlock _roaddata_ai_3 = { - MKHDR(0) +static const AiDefaultRoadBlock _roaddata_ai_2 = { + 0, _roaddata_ai_2_data +}; + +static const AiDefaultBlockData _roaddata_ai_3_data[] = { MKDEPOT(0, 1,0), MKSTATION(0x0, 1,1), MKRAIL(0x6, 0,0), @@ -408,8 +486,11 @@ static const AiDefaultRoadBlock _roaddata_ai_3 = { MKEND }; -static const AiDefaultRoadBlock _roaddata_ai_4 = { - MKHDR(1) +static const AiDefaultRoadBlock _roaddata_ai_3 = { + 0, _roaddata_ai_3_data +}; + +static const AiDefaultBlockData _roaddata_ai_4_data[] = { MKSTATION(0x2, -1,0), MKRAIL(0x8, 0,0), MKCLRRAIL(0, 0,-1), @@ -418,8 +499,11 @@ static const AiDefaultRoadBlock _roaddata_ai_4 = { MKEND }; -static const AiDefaultRoadBlock _roaddata_ai_5 = { - MKHDR(1) +static const AiDefaultRoadBlock _roaddata_ai_4 = { + 1, _roaddata_ai_4_data +}; + +static const AiDefaultBlockData _roaddata_ai_5_data[] = { MKSTATION(0x3, 0,1), MKRAIL(0x4, 0,0), MKCLRRAIL(0, -1,0), @@ -428,8 +512,11 @@ static const AiDefaultRoadBlock _roaddata_ai_5 = { MKEND }; -static const AiDefaultRoadBlock _roaddata_ai_6 = { - MKHDR(1) +static const AiDefaultRoadBlock _roaddata_ai_5 = { + 1, _roaddata_ai_5_data +}; + +static const AiDefaultBlockData _roaddata_ai_6_data[] = { MKSTATION(0x0, 1,1), MKRAIL(0x2, 0,1), MKCLRRAIL(0, 0,0), @@ -438,8 +525,11 @@ static const AiDefaultRoadBlock _roaddata_ai_6 = { MKEND }; -static const AiDefaultRoadBlock _roaddata_ai_7 = { - MKHDR(1) +static const AiDefaultRoadBlock _roaddata_ai_6 = { + 1, _roaddata_ai_6_data +}; + +static const AiDefaultBlockData _roaddata_ai_7_data[] = { MKSTATION(0x1, 1,-1), MKRAIL(0x1, 1,0), MKCLRRAIL(0, 0,0), @@ -448,6 +538,10 @@ static const AiDefaultRoadBlock _roaddata_ai_7 = { MKEND }; +static const AiDefaultRoadBlock _roaddata_ai_7 = { + 1, _roaddata_ai_7_data +}; + static const AiDefaultRoadBlock * const _road_default_block_data[] = { &_roaddata_ai_0, |