equal
deleted
inserted
replaced
2 |
2 |
3 /** @file cargotype.cpp */ |
3 /** @file cargotype.cpp */ |
4 |
4 |
5 #include "stdafx.h" |
5 #include "stdafx.h" |
6 #include "openttd.h" |
6 #include "openttd.h" |
7 #include "macros.h" |
7 #include "newgrf_cargo.h" |
|
8 #include "cargotype.h" |
|
9 #include "core/bitmath_func.hpp" |
|
10 |
8 #include "table/sprites.h" |
11 #include "table/sprites.h" |
9 #include "table/strings.h" |
12 #include "table/strings.h" |
10 #include "newgrf_cargo.h" |
|
11 #include "cargotype.h" |
|
12 |
|
13 #include "table/cargo_const.h" |
13 #include "table/cargo_const.h" |
14 |
14 |
15 CargoSpec _cargo[NUM_CARGO]; |
15 CargoSpec _cargo[NUM_CARGO]; |
16 |
16 |
17 static const byte INVALID_CARGO = 0xFF; |
17 static const byte INVALID_CARGO = 0xFF; |
35 |
35 |
36 /* Bzzt: check if cl is just an index into the cargo table */ |
36 /* Bzzt: check if cl is just an index into the cargo table */ |
37 if (cl < lengthof(_default_cargo)) { |
37 if (cl < lengthof(_default_cargo)) { |
38 /* Copy the indexed cargo */ |
38 /* Copy the indexed cargo */ |
39 _cargo[i] = _default_cargo[cl]; |
39 _cargo[i] = _default_cargo[cl]; |
40 SetBit(_cargo_mask, i); |
40 if (_cargo[i].bitnum != INVALID_CARGO) SetBit(_cargo_mask, i); |
41 continue; |
41 continue; |
42 } |
42 } |
43 |
43 |
44 /* Loop through each of the default cargo types to see if |
44 /* Loop through each of the default cargo types to see if |
45 * the label matches */ |
45 * the label matches */ |