src/newgrf_cargo.h
author peter1138
Tue, 22 Jan 2008 07:27:06 +0000
changeset 8374 7a1b6c89cb89
parent 8264 b1e85998c7d3
child 9111 48ce04029fe4
permissions -rw-r--r--
(svn r11940) -Codechange: Store short filename once per open file instead of once per sprite cache entry. Not all file types need this, but most of the time no sprite cache entry needed it either.
3866
b13553406a0a (svn r4902) Newgrf : Introduction of the newgrf_cargo files.
belugas
parents:
diff changeset
     1
/* $Id$ */
b13553406a0a (svn r4902) Newgrf : Introduction of the newgrf_cargo files.
belugas
parents:
diff changeset
     2
6348
6dd01da7a02b (svn r9385) -Cleanup: doxygen changes. Today, we are exploring the letter N.
belugas
parents: 6148
diff changeset
     3
/** @file newgrf_cargo.h */
6dd01da7a02b (svn r9385) -Cleanup: doxygen changes. Today, we are exploring the letter N.
belugas
parents: 6148
diff changeset
     4
3866
b13553406a0a (svn r4902) Newgrf : Introduction of the newgrf_cargo files.
belugas
parents:
diff changeset
     5
#ifndef NEWGRF_CARGO_H
b13553406a0a (svn r4902) Newgrf : Introduction of the newgrf_cargo files.
belugas
parents:
diff changeset
     6
#define NEWGRF_CARGO_H
b13553406a0a (svn r4902) Newgrf : Introduction of the newgrf_cargo files.
belugas
parents:
diff changeset
     7
7327
d810677fb909 (svn r10690) -Codechange: use the enum that describes all callback IDs in favor of "just" using an untyped integer.
rubidium
parents: 7199
diff changeset
     8
#include "newgrf_callbacks.h"
8119
52b48108425a (svn r11680) -Codechange: refactor more out of openttd.h and functions.h.
rubidium
parents: 8021
diff changeset
     9
#include "cargo_type.h"
8264
b1e85998c7d3 (svn r11828) -Codechange: include table/* as the last includes and remove an unneeded include from openttd.h.
rubidium
parents: 8119
diff changeset
    10
#include "gfx_type.h"
7327
d810677fb909 (svn r10690) -Codechange: use the enum that describes all callback IDs in favor of "just" using an untyped integer.
rubidium
parents: 7199
diff changeset
    11
3866
b13553406a0a (svn r4902) Newgrf : Introduction of the newgrf_cargo files.
belugas
parents:
diff changeset
    12
enum {
8021
a650a0c52856 (svn r11581) -Codechange: add some missing cargo classes and some documentation.
rubidium
parents: 7717
diff changeset
    13
	CC_NOAVAILABLE  = 0,       ///< No cargo class has been specified
a650a0c52856 (svn r11581) -Codechange: add some missing cargo classes and some documentation.
rubidium
parents: 7717
diff changeset
    14
	CC_PASSENGERS   = 1 <<  0, ///< Passengers
a650a0c52856 (svn r11581) -Codechange: add some missing cargo classes and some documentation.
rubidium
parents: 7717
diff changeset
    15
	CC_MAIL         = 1 <<  1, ///< Mail
a650a0c52856 (svn r11581) -Codechange: add some missing cargo classes and some documentation.
rubidium
parents: 7717
diff changeset
    16
	CC_EXPRESS      = 1 <<  2, ///< Express cargo (Goods, Food, Candy, but also possible for passengers)
a650a0c52856 (svn r11581) -Codechange: add some missing cargo classes and some documentation.
rubidium
parents: 7717
diff changeset
    17
	CC_ARMOURED     = 1 <<  3, ///< Armoured cargo (Valuables, Gold, Diamonds)
a650a0c52856 (svn r11581) -Codechange: add some missing cargo classes and some documentation.
rubidium
parents: 7717
diff changeset
    18
	CC_BULK         = 1 <<  4, ///< Bulk cargo (Coal, Grain etc., Ores, Fruit)
a650a0c52856 (svn r11581) -Codechange: add some missing cargo classes and some documentation.
rubidium
parents: 7717
diff changeset
    19
	CC_PIECE_GOODS  = 1 <<  5, ///< Piece goods (Livestock, Wood, Steel, Paper)
a650a0c52856 (svn r11581) -Codechange: add some missing cargo classes and some documentation.
rubidium
parents: 7717
diff changeset
    20
	CC_LIQUID       = 1 <<  6, ///< Liquids (Oil, Water, Rubber)
a650a0c52856 (svn r11581) -Codechange: add some missing cargo classes and some documentation.
rubidium
parents: 7717
diff changeset
    21
	CC_REFRIGERATED = 1 <<  7, ///< Refrigerated cargo (Food, Fruit)
a650a0c52856 (svn r11581) -Codechange: add some missing cargo classes and some documentation.
rubidium
parents: 7717
diff changeset
    22
	CC_HAZARDOUS    = 1 <<  8, ///< Hazardous cargo (Nucleair Fuel, Explosives, etc.)
a650a0c52856 (svn r11581) -Codechange: add some missing cargo classes and some documentation.
rubidium
parents: 7717
diff changeset
    23
	CC_COVERED      = 1 <<  9, ///< Covered/Sheltered Freight (Transporation in Box Vans, Silo Wagons, etc.)
a650a0c52856 (svn r11581) -Codechange: add some missing cargo classes and some documentation.
rubidium
parents: 7717
diff changeset
    24
	CC_SPECIAL      = 1 << 15  ///< Special bit used for livery refit tricks instead of normal cargoes.
3866
b13553406a0a (svn r4902) Newgrf : Introduction of the newgrf_cargo files.
belugas
parents:
diff changeset
    25
};
b13553406a0a (svn r4902) Newgrf : Introduction of the newgrf_cargo files.
belugas
parents:
diff changeset
    26
6148
5247b66aad19 (svn r8891) -Codechange: Remove remains of global cargo scheme. All cargo mapping is now dealt with only in NewGRF code, on load where possible.
peter1138
parents: 6113
diff changeset
    27
static const CargoID CT_DEFAULT      = NUM_CARGO + 0;
5247b66aad19 (svn r8891) -Codechange: Remove remains of global cargo scheme. All cargo mapping is now dealt with only in NewGRF code, on load where possible.
peter1138
parents: 6113
diff changeset
    28
static const CargoID CT_PURCHASE     = NUM_CARGO + 1;
5247b66aad19 (svn r8891) -Codechange: Remove remains of global cargo scheme. All cargo mapping is now dealt with only in NewGRF code, on load where possible.
peter1138
parents: 6113
diff changeset
    29
static const CargoID CT_DEFAULT_NA   = NUM_CARGO + 2;
3866
b13553406a0a (svn r4902) Newgrf : Introduction of the newgrf_cargo files.
belugas
parents:
diff changeset
    30
6460
705fbddbf3dc (svn r9620) -Codechange: apply cargo translation table to newstation variables 0x60..0x65
peter1138
parents: 6371
diff changeset
    31
/* Forward declarations of structs used */
6371
8ce1cab720e5 (svn r9434) -Fix (r9418): remove typedef from forward declaration to appease MSVC or something
peter1138
parents: 6365
diff changeset
    32
struct CargoSpec;
6460
705fbddbf3dc (svn r9620) -Codechange: apply cargo translation table to newstation variables 0x60..0x65
peter1138
parents: 6371
diff changeset
    33
struct GRFFile;
6365
b52bd4ca10b6 (svn r9418) -Codechange: Implement actions 1/2/3 for cargos, callback handler and custom icon sprites
peter1138
parents: 6348
diff changeset
    34
b52bd4ca10b6 (svn r9418) -Codechange: Implement actions 1/2/3 for cargos, callback handler and custom icon sprites
peter1138
parents: 6348
diff changeset
    35
SpriteID GetCustomCargoSprite(const CargoSpec *cs);
7327
d810677fb909 (svn r10690) -Codechange: use the enum that describes all callback IDs in favor of "just" using an untyped integer.
rubidium
parents: 7199
diff changeset
    36
uint16 GetCargoCallback(CallbackID callback, uint32 param1, uint32 param2, const CargoSpec *cs);
7717
3b26778638d1 (svn r11252) -Revert r11239, Fix r9620: cargo translation was not done correctly
glx
parents: 7327
diff changeset
    37
CargoID GetCargoTranslation(uint8 cargo, const GRFFile *grffile, bool usebit = false);
7199
e65a28455ee3 (svn r10477) -Codechange: add some callbacks to customise the acceptance of industries.
rubidium
parents: 6460
diff changeset
    38
uint8 GetReverseCargoTranslation(CargoID cargo, const GRFFile *grffile);
6365
b52bd4ca10b6 (svn r9418) -Codechange: Implement actions 1/2/3 for cargos, callback handler and custom icon sprites
peter1138
parents: 6348
diff changeset
    39
3866
b13553406a0a (svn r4902) Newgrf : Introduction of the newgrf_cargo files.
belugas
parents:
diff changeset
    40
#endif /* NEWGRF_CARGO_H */