src/road_type.h
author bjarni
Thu, 19 Jun 2008 17:54:23 +0000
changeset 9561 f236daaaf93a
parent 8348 4d7c1c5055b3
child 10011 eeec680fed23
permissions -rw-r--r--
(svn r13584) -Fix: [OSX] Fixed issue where 10.5 failed to switch to fullscreen
This is done by selecting the 32bpp-anim blitter by default as it seems Apple removed some 8bpp support
Since this is done at runtime the same binary will still select 8bpp on 10.3 and 10.4
8102
906a3d3b6df1 (svn r11663) -Codechange: moving of the road related types and functions.
rubidium
parents:
diff changeset
     1
/* $Id$ */
906a3d3b6df1 (svn r11663) -Codechange: moving of the road related types and functions.
rubidium
parents:
diff changeset
     2
8348
4d7c1c5055b3 (svn r11914) -Documentation: fix some @file statement
glx
parents: 8236
diff changeset
     3
/** @file road_type.h Enums and other types related to roads. */
8102
906a3d3b6df1 (svn r11663) -Codechange: moving of the road related types and functions.
rubidium
parents:
diff changeset
     4
906a3d3b6df1 (svn r11663) -Codechange: moving of the road related types and functions.
rubidium
parents:
diff changeset
     5
#ifndef ROAD_TYPE_H
906a3d3b6df1 (svn r11663) -Codechange: moving of the road related types and functions.
rubidium
parents:
diff changeset
     6
#define ROAD_TYPE_H
906a3d3b6df1 (svn r11663) -Codechange: moving of the road related types and functions.
rubidium
parents:
diff changeset
     7
906a3d3b6df1 (svn r11663) -Codechange: moving of the road related types and functions.
rubidium
parents:
diff changeset
     8
#include "core/enum_type.hpp"
906a3d3b6df1 (svn r11663) -Codechange: moving of the road related types and functions.
rubidium
parents:
diff changeset
     9
906a3d3b6df1 (svn r11663) -Codechange: moving of the road related types and functions.
rubidium
parents:
diff changeset
    10
/**
906a3d3b6df1 (svn r11663) -Codechange: moving of the road related types and functions.
rubidium
parents:
diff changeset
    11
 * The different roadtypes we support
906a3d3b6df1 (svn r11663) -Codechange: moving of the road related types and functions.
rubidium
parents:
diff changeset
    12
 *
906a3d3b6df1 (svn r11663) -Codechange: moving of the road related types and functions.
rubidium
parents:
diff changeset
    13
 * @note currently only ROADTYPE_ROAD and ROADTYPE_TRAM are supported.
906a3d3b6df1 (svn r11663) -Codechange: moving of the road related types and functions.
rubidium
parents:
diff changeset
    14
 */
906a3d3b6df1 (svn r11663) -Codechange: moving of the road related types and functions.
rubidium
parents:
diff changeset
    15
enum RoadType {
906a3d3b6df1 (svn r11663) -Codechange: moving of the road related types and functions.
rubidium
parents:
diff changeset
    16
	ROADTYPE_ROAD = 0,      ///< Basic road type
906a3d3b6df1 (svn r11663) -Codechange: moving of the road related types and functions.
rubidium
parents:
diff changeset
    17
	ROADTYPE_TRAM = 1,      ///< Trams
906a3d3b6df1 (svn r11663) -Codechange: moving of the road related types and functions.
rubidium
parents:
diff changeset
    18
	ROADTYPE_HWAY = 2,      ///< Only a placeholder. Not sure what we are going to do with this road type.
906a3d3b6df1 (svn r11663) -Codechange: moving of the road related types and functions.
rubidium
parents:
diff changeset
    19
	ROADTYPE_END,           ///< Used for iterations
906a3d3b6df1 (svn r11663) -Codechange: moving of the road related types and functions.
rubidium
parents:
diff changeset
    20
	INVALID_ROADTYPE = 0xFF ///< flag for invalid roadtype
906a3d3b6df1 (svn r11663) -Codechange: moving of the road related types and functions.
rubidium
parents:
diff changeset
    21
};
906a3d3b6df1 (svn r11663) -Codechange: moving of the road related types and functions.
rubidium
parents:
diff changeset
    22
DECLARE_POSTFIX_INCREMENT(RoadType);
906a3d3b6df1 (svn r11663) -Codechange: moving of the road related types and functions.
rubidium
parents:
diff changeset
    23
906a3d3b6df1 (svn r11663) -Codechange: moving of the road related types and functions.
rubidium
parents:
diff changeset
    24
/**
906a3d3b6df1 (svn r11663) -Codechange: moving of the road related types and functions.
rubidium
parents:
diff changeset
    25
 * The different roadtypes we support, but then a bitmask of them
906a3d3b6df1 (svn r11663) -Codechange: moving of the road related types and functions.
rubidium
parents:
diff changeset
    26
 * @note currently only roadtypes with ROADTYPE_ROAD and ROADTYPE_TRAM are supported.
906a3d3b6df1 (svn r11663) -Codechange: moving of the road related types and functions.
rubidium
parents:
diff changeset
    27
 */
906a3d3b6df1 (svn r11663) -Codechange: moving of the road related types and functions.
rubidium
parents:
diff changeset
    28
enum RoadTypes {
906a3d3b6df1 (svn r11663) -Codechange: moving of the road related types and functions.
rubidium
parents:
diff changeset
    29
	ROADTYPES_NONE     = 0,                                                 ///< No roadtypes
906a3d3b6df1 (svn r11663) -Codechange: moving of the road related types and functions.
rubidium
parents:
diff changeset
    30
	ROADTYPES_ROAD     = 1 << ROADTYPE_ROAD,                                ///< Road
906a3d3b6df1 (svn r11663) -Codechange: moving of the road related types and functions.
rubidium
parents:
diff changeset
    31
	ROADTYPES_TRAM     = 1 << ROADTYPE_TRAM,                                ///< Trams
906a3d3b6df1 (svn r11663) -Codechange: moving of the road related types and functions.
rubidium
parents:
diff changeset
    32
	ROADTYPES_HWAY     = 1 << ROADTYPE_HWAY,                                ///< Highway (or whatever substitute)
906a3d3b6df1 (svn r11663) -Codechange: moving of the road related types and functions.
rubidium
parents:
diff changeset
    33
	ROADTYPES_ROADTRAM = ROADTYPES_ROAD | ROADTYPES_TRAM,                   ///< Road + trams
906a3d3b6df1 (svn r11663) -Codechange: moving of the road related types and functions.
rubidium
parents:
diff changeset
    34
	ROADTYPES_ROADHWAY = ROADTYPES_ROAD | ROADTYPES_HWAY,                   ///< Road + highway (or whatever substitute)
906a3d3b6df1 (svn r11663) -Codechange: moving of the road related types and functions.
rubidium
parents:
diff changeset
    35
	ROADTYPES_TRAMHWAY = ROADTYPES_TRAM | ROADTYPES_HWAY,                   ///< Trams + highway (or whatever substitute)
906a3d3b6df1 (svn r11663) -Codechange: moving of the road related types and functions.
rubidium
parents:
diff changeset
    36
	ROADTYPES_ALL      = ROADTYPES_ROAD | ROADTYPES_TRAM | ROADTYPES_HWAY,  ///< Road + trams + highway (or whatever substitute)
8236
8a5dd0b42e47 (svn r11800) -Codechange: move some functions to a more logical location + some type safety.
rubidium
parents: 8102
diff changeset
    37
	ROADTYPES_END,                                                          ///< Used for iterations?
8a5dd0b42e47 (svn r11800) -Codechange: move some functions to a more logical location + some type safety.
rubidium
parents: 8102
diff changeset
    38
	INVALID_ROADTYPES  = 0xFF                                               ///< Invalid roadtypes
8102
906a3d3b6df1 (svn r11663) -Codechange: moving of the road related types and functions.
rubidium
parents:
diff changeset
    39
};
906a3d3b6df1 (svn r11663) -Codechange: moving of the road related types and functions.
rubidium
parents:
diff changeset
    40
DECLARE_ENUM_AS_BIT_SET(RoadTypes);
8236
8a5dd0b42e47 (svn r11800) -Codechange: move some functions to a more logical location + some type safety.
rubidium
parents: 8102
diff changeset
    41
template <> struct EnumPropsT<RoadTypes> : MakeEnumPropsT<RoadTypes, byte, ROADTYPES_NONE, ROADTYPES_END, INVALID_ROADTYPES> {};
8a5dd0b42e47 (svn r11800) -Codechange: move some functions to a more logical location + some type safety.
rubidium
parents: 8102
diff changeset
    42
typedef TinyEnumT<RoadTypes> RoadTypesByte;
8102
906a3d3b6df1 (svn r11663) -Codechange: moving of the road related types and functions.
rubidium
parents:
diff changeset
    43
906a3d3b6df1 (svn r11663) -Codechange: moving of the road related types and functions.
rubidium
parents:
diff changeset
    44
906a3d3b6df1 (svn r11663) -Codechange: moving of the road related types and functions.
rubidium
parents:
diff changeset
    45
/**
906a3d3b6df1 (svn r11663) -Codechange: moving of the road related types and functions.
rubidium
parents:
diff changeset
    46
 * Enumeration for the road parts on a tile.
906a3d3b6df1 (svn r11663) -Codechange: moving of the road related types and functions.
rubidium
parents:
diff changeset
    47
 *
906a3d3b6df1 (svn r11663) -Codechange: moving of the road related types and functions.
rubidium
parents:
diff changeset
    48
 * This enumeration defines the possible road parts which
906a3d3b6df1 (svn r11663) -Codechange: moving of the road related types and functions.
rubidium
parents:
diff changeset
    49
 * can be build on a tile.
906a3d3b6df1 (svn r11663) -Codechange: moving of the road related types and functions.
rubidium
parents:
diff changeset
    50
 */
906a3d3b6df1 (svn r11663) -Codechange: moving of the road related types and functions.
rubidium
parents:
diff changeset
    51
enum RoadBits {
906a3d3b6df1 (svn r11663) -Codechange: moving of the road related types and functions.
rubidium
parents:
diff changeset
    52
	ROAD_NONE = 0U,                  ///< No road-part is build
906a3d3b6df1 (svn r11663) -Codechange: moving of the road related types and functions.
rubidium
parents:
diff changeset
    53
	ROAD_NW   = 1U,                  ///< North-west part
906a3d3b6df1 (svn r11663) -Codechange: moving of the road related types and functions.
rubidium
parents:
diff changeset
    54
	ROAD_SW   = 2U,                  ///< South-west part
906a3d3b6df1 (svn r11663) -Codechange: moving of the road related types and functions.
rubidium
parents:
diff changeset
    55
	ROAD_SE   = 4U,                  ///< South-east part
906a3d3b6df1 (svn r11663) -Codechange: moving of the road related types and functions.
rubidium
parents:
diff changeset
    56
	ROAD_NE   = 8U,                  ///< North-east part
906a3d3b6df1 (svn r11663) -Codechange: moving of the road related types and functions.
rubidium
parents:
diff changeset
    57
	ROAD_X    = ROAD_SW | ROAD_NE,   ///< Full road along the x-axis (south-west + north-east)
906a3d3b6df1 (svn r11663) -Codechange: moving of the road related types and functions.
rubidium
parents:
diff changeset
    58
	ROAD_Y    = ROAD_NW | ROAD_SE,   ///< Full road along the y-axis (north-west + south-east)
906a3d3b6df1 (svn r11663) -Codechange: moving of the road related types and functions.
rubidium
parents:
diff changeset
    59
	ROAD_ALL  = ROAD_X  | ROAD_Y     ///< Full 4-way crossing
906a3d3b6df1 (svn r11663) -Codechange: moving of the road related types and functions.
rubidium
parents:
diff changeset
    60
};
906a3d3b6df1 (svn r11663) -Codechange: moving of the road related types and functions.
rubidium
parents:
diff changeset
    61
DECLARE_ENUM_AS_BIT_SET(RoadBits);
906a3d3b6df1 (svn r11663) -Codechange: moving of the road related types and functions.
rubidium
parents:
diff changeset
    62
906a3d3b6df1 (svn r11663) -Codechange: moving of the road related types and functions.
rubidium
parents:
diff changeset
    63
#endif /* ROAD_TYPE_H */