# cargotype.cpp File Reference

`#include "stdafx.h"`
`#include "openttd.h"`
`#include "newgrf_cargo.h"`
`#include "cargotype.h"`
`#include "core/bitmath_func.hpp"`
`#include "table/sprites.h"`
`#include "table/strings.h"`
`#include "table/cargo_const.h"`

Go to the source code of this file.

## Functions
void | SetupCargoForClimate (LandscapeID l)
const CargoSpec * | GetCargo (CargoID c)
CargoID | GetCargoIDByLabel (CargoLabel cl)
CargoID | GetCargoIDByBitnum (uint8 bitnum)
| Find the CargoID of a 'bitnum' value.
## Variables
CargoSpec | _cargo [NUM_CARGO]
static const byte | INVALID_CARGO = 0xFF
uint32 | _cargo_mask

## Detailed Description

Definition in file cargotype.cpp.

## Function Documentation

CargoID GetCargoIDByBitnum | ( | uint8 | bitnum | ) |

Find the CargoID of a 'bitnum' value.

Parameters:

  | bitnum | 'bitnum' to find.

Returns:
  First CargoID with the given bitnum, or CT_INVALID if not found.

Definition at line 88 of file cargotype.cpp.