2009-08-21 20:21:05 +00:00
|
|
|
/*
|
|
|
|
* This file is part of OpenTTD.
|
|
|
|
* OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
|
|
|
|
* OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
|
|
* See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
2008-05-06 15:11:33 +00:00
|
|
|
/** @file newgrf_cargo.h Cargo support for NewGRFs. */
|
2007-03-21 03:06:21 +00:00
|
|
|
|
2006-05-18 02:43:23 +00:00
|
|
|
#ifndef NEWGRF_CARGO_H
|
|
|
|
#define NEWGRF_CARGO_H
|
|
|
|
|
2007-07-25 19:06:29 +00:00
|
|
|
#include "newgrf_callbacks.h"
|
2007-12-21 22:50:51 +00:00
|
|
|
#include "cargo_type.h"
|
2008-01-13 01:21:35 +00:00
|
|
|
#include "gfx_type.h"
|
2007-07-25 19:06:29 +00:00
|
|
|
|
2024-01-08 21:40:09 +00:00
|
|
|
/**
|
|
|
|
* Sprite Group Cargo types.
|
|
|
|
* These special cargo types are used when resolving sprite groups when non-cargo-specific sprites or callbacks are needed,
|
|
|
|
* e.g. in purchase lists, or if no specific cargo type sprite group is supplied.
|
|
|
|
*/
|
|
|
|
namespace SpriteGroupCargo {
|
|
|
|
static constexpr CargoID SG_DEFAULT = NUM_CARGO; ///< Default type used when no more-specific cargo matches.
|
|
|
|
static constexpr CargoID SG_PURCHASE = NUM_CARGO + 1; ///< Used in purchase lists before an item exists.
|
|
|
|
static constexpr CargoID SG_DEFAULT_NA = NUM_CARGO + 2; ///< Used only by stations and roads when no more-specific cargo matches.
|
|
|
|
};
|
2006-05-18 02:43:23 +00:00
|
|
|
|
2007-04-13 19:32:18 +00:00
|
|
|
/* Forward declarations of structs used */
|
2007-03-24 16:09:39 +00:00
|
|
|
struct CargoSpec;
|
2007-04-13 19:32:18 +00:00
|
|
|
struct GRFFile;
|
2007-03-23 20:55:45 +00:00
|
|
|
|
|
|
|
SpriteID GetCustomCargoSprite(const CargoSpec *cs);
|
2023-05-08 17:01:06 +00:00
|
|
|
uint16_t GetCargoCallback(CallbackID callback, uint32_t param1, uint32_t param2, const CargoSpec *cs);
|
|
|
|
CargoID GetCargoTranslation(uint8_t cargo, const GRFFile *grffile, bool usebit = false);
|
2007-03-23 20:55:45 +00:00
|
|
|
|
2006-05-18 02:43:23 +00:00
|
|
|
#endif /* NEWGRF_CARGO_H */
|