|
|
/* $Id$ */
|
|
|
|
|
|
/*
|
|
|
* 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/>.
|
|
|
*/
|
|
|
|
|
|
/**
|
|
|
* @file newgrf_commons.h This file simplyfies and embeds a common mechanism of
|
|
|
* loading/saving and mapping of grf entities.
|
|
|
*/
|
|
|
|
|
|
#ifndef NEWGRF_COMMONS_H
|
|
|
#define NEWGRF_COMMONS_H
|
|
|
|
|
|
#include "tile_type.h"
|
|
|
#include "sprite.h"
|
|
|
#include "core/alloc_type.hpp"
|
|
|
#include "core/smallvec_type.hpp"
|
|
|
#include "command_type.h"
|
|
|
#include "direction_type.h"
|
|
|
#include "company_type.h"
|
|
|
|
|
|
/** Context for tile accesses */
|
|
|
enum TileContext {
|
|
|
TCX_NORMAL, ///< Nothing special.
|
|
|
TCX_UPPER_HALFTILE, ///< Querying information about the upper part of a tile with halftile foundation.
|
|
|
TCX_ON_BRIDGE, ///< Querying information about stuff on the bridge (via some bridgehead).
|
|
|
};
|
|
|
|
|
|
/**
|
|
|
* Flags to enable register usage in sprite layouts.
|
|
|
*/
|
|
|
enum TileLayoutFlags {
|
|
|
TLF_NOTHING = 0x00,
|
|
|
|
|
|
TLF_DODRAW = 0x01, ///< Only draw sprite if value of register TileLayoutRegisters::dodraw is non-zero.
|
|
|
TLF_SPRITE = 0x02, ///< Add signed offset to sprite from register TileLayoutRegisters::sprite.
|
|
|
TLF_PALETTE = 0x04, ///< Add signed offset to palette from register TileLayoutRegisters::palette.
|
|
|
TLF_CUSTOM_PALETTE = 0x08, ///< Palette is from Action 1 (moved to SPRITE_MODIFIER_CUSTOM_SPRITE in palette during loading).
|