src/gfx_type.h
author peter1138
Tue, 22 Jan 2008 07:27:06 +0000
changeset 8374 7a1b6c89cb89
parent 8123 ce31d2843a95
child 8828 28784a133c57
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.
8123
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
     1
/* $Id$ */
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
     2
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
     3
/** @file gfx_type.h Types related to the graphics and/or input devices. */
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
     4
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
     5
#ifndef GFX_TYPE_H
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
     6
#define GFX_TYPE_H
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
     7
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
     8
#include "core/enum_type.hpp"
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
     9
#include "core/geometry_type.hpp"
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
    10
#include "zoom_type.h"
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
    11
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
    12
typedef uint32 SpriteID;      ///< The number of a sprite, without mapping bits and colortables
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
    13
struct PalSpriteID {
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
    14
	SpriteID sprite;
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
    15
	SpriteID pal;
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
    16
};
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
    17
typedef int32 CursorID;
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
    18
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
    19
enum WindowKeyCodes {
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
    20
	WKC_SHIFT = 0x8000,
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
    21
	WKC_CTRL  = 0x4000,
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
    22
	WKC_ALT   = 0x2000,
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
    23
	WKC_META  = 0x1000,
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
    24
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
    25
	/* Special ones */
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
    26
	WKC_NONE        =  0,
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
    27
	WKC_ESC         =  1,
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
    28
	WKC_BACKSPACE   =  2,
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
    29
	WKC_INSERT      =  3,
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
    30
	WKC_DELETE      =  4,
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
    31
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
    32
	WKC_PAGEUP      =  5,
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
    33
	WKC_PAGEDOWN    =  6,
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
    34
	WKC_END         =  7,
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
    35
	WKC_HOME        =  8,
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
    36
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
    37
	/* Arrow keys */
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
    38
	WKC_LEFT        =  9,
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
    39
	WKC_UP          = 10,
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
    40
	WKC_RIGHT       = 11,
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
    41
	WKC_DOWN        = 12,
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
    42
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
    43
	/* Return & tab */
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
    44
	WKC_RETURN      = 13,
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
    45
	WKC_TAB         = 14,
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
    46
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
    47
	/* Space */
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
    48
	WKC_SPACE       = 32,
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
    49
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
    50
	/* Function keys */
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
    51
	WKC_F1          = 33,
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
    52
	WKC_F2          = 34,
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
    53
	WKC_F3          = 35,
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
    54
	WKC_F4          = 36,
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
    55
	WKC_F5          = 37,
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
    56
	WKC_F6          = 38,
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
    57
	WKC_F7          = 39,
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
    58
	WKC_F8          = 40,
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
    59
	WKC_F9          = 41,
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
    60
	WKC_F10         = 42,
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
    61
	WKC_F11         = 43,
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
    62
	WKC_F12         = 44,
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
    63
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
    64
	/* Backquote is the key left of "1"
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
    65
	 * we only store this key here, no matter what character is really mapped to it
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
    66
	 * on a particular keyboard. (US keyboard: ` and ~ ; German keyboard: ^ and °) */
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
    67
	WKC_BACKQUOTE   = 45,
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
    68
	WKC_PAUSE       = 46,
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
    69
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
    70
	/* 0-9 are mapped to 48-57
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
    71
	 * A-Z are mapped to 65-90
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
    72
	 * a-z are mapped to 97-122 */
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
    73
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
    74
	/* Numerical keyboard */
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
    75
	WKC_NUM_0       = 128,
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
    76
	WKC_NUM_1       = 129,
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
    77
	WKC_NUM_2       = 130,
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
    78
	WKC_NUM_3       = 131,
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
    79
	WKC_NUM_4       = 132,
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
    80
	WKC_NUM_5       = 133,
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
    81
	WKC_NUM_6       = 134,
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
    82
	WKC_NUM_7       = 135,
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
    83
	WKC_NUM_8       = 136,
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
    84
	WKC_NUM_9       = 137,
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
    85
	WKC_NUM_DIV     = 138,
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
    86
	WKC_NUM_MUL     = 139,
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
    87
	WKC_NUM_MINUS   = 140,
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
    88
	WKC_NUM_PLUS    = 141,
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
    89
	WKC_NUM_ENTER   = 142,
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
    90
	WKC_NUM_DECIMAL = 143,
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
    91
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
    92
	/* Other keys */
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
    93
	WKC_SLASH       = 144, ///< / Forward slash
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
    94
	WKC_SEMICOLON   = 145, ///< ; Semicolon
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
    95
	WKC_EQUALS      = 146, ///< = Equals
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
    96
	WKC_L_BRACKET   = 147, ///< [ Left square bracket
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
    97
	WKC_BACKSLASH   = 148, ///< \ Backslash
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
    98
	WKC_R_BRACKET   = 149, ///< ] Right square bracket
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
    99
	WKC_SINGLEQUOTE = 150, ///< ' Single quote
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
   100
	WKC_COMMA       = 151, ///< , Comma
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
   101
	WKC_PERIOD      = 152, ///< . Period
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
   102
	WKC_MINUS       = 153, ///< - Minus
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
   103
};
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
   104
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
   105
/** A single sprite of a list of animated cursors */
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
   106
struct AnimCursor {
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
   107
	static const CursorID LAST = MAX_UVALUE(CursorID);
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
   108
	CursorID sprite;   ///< Must be set to LAST_ANIM when it is the last sprite of the loop
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
   109
	byte display_time; ///< Amount of ticks this sprite will be shown
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
   110
};
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
   111
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
   112
struct CursorVars {
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
   113
	Point pos, size, offs, delta; ///< position, size, offset from top-left, and movement
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
   114
	Point draw_pos, draw_size;    ///< position and size bounding-box for drawing
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
   115
	SpriteID sprite; ///< current image of cursor
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
   116
	SpriteID pal;
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
   117
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
   118
	int wheel;       ///< mouse wheel movement
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
   119
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
   120
	/* We need two different vars to keep track of how far the scrollwheel moved.
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
   121
	 * OSX uses this for scrolling around the map. */
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
   122
	int v_wheel;
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
   123
	int h_wheel;
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
   124
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
   125
	const AnimCursor *animate_list; ///< in case of animated cursor, list of frames
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
   126
	const AnimCursor *animate_cur;  ///< in case of animated cursor, current frame
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
   127
	uint animate_timeout;           ///< in case of animated cursor, number of ticks to show the current cursor
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
   128
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
   129
	bool visible;    ///< cursor is visible
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
   130
	bool dirty;      ///< the rect occupied by the mouse is dirty (redraw)
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
   131
	bool fix_at;     ///< mouse is moving, but cursor is not (used for scrolling)
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
   132
	bool in_window;  ///< mouse inside this window, determines drawing logic
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
   133
};
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
   134
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
   135
struct DrawPixelInfo {
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
   136
	void *dst_ptr;
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
   137
	int left, top, width, height;
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
   138
	int pitch;
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
   139
	ZoomLevel zoom;
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
   140
};
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
   141
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
   142
struct Colour {
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
   143
	byte r;
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
   144
	byte g;
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
   145
	byte b;
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
   146
};
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
   147
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
   148
enum FontSize {
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
   149
	FS_NORMAL,
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
   150
	FS_SMALL,
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
   151
	FS_LARGE,
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
   152
	FS_END,
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
   153
};
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
   154
DECLARE_POSTFIX_INCREMENT(FontSize);
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
   155
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
   156
/**
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
   157
 * Used to only draw a part of the sprite.
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
   158
 * Draw the subsprite in the rect (sprite_x_offset + left, sprite_y_offset + top) to (sprite_x_offset + right, sprite_y_offset + bottom).
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
   159
 * Both corners are included in the drawing area.
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
   160
 */
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
   161
struct SubSprite {
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
   162
	int left, top, right, bottom;
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
   163
};
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
   164
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
   165
enum {
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
   166
	COLOUR_DARK_BLUE,
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
   167
	COLOUR_PALE_GREEN,
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
   168
	COLOUR_PINK,
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
   169
	COLOUR_YELLOW,
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
   170
	COLOUR_RED,
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
   171
	COLOUR_LIGHT_BLUE,
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
   172
	COLOUR_GREEN,
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
   173
	COLOUR_DARK_GREEN,
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
   174
	COLOUR_BLUE,
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
   175
	COLOUR_CREAM,
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
   176
	COLOUR_MAUVE,
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
   177
	COLOUR_PURPLE,
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
   178
	COLOUR_ORANGE,
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
   179
	COLOUR_BROWN,
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
   180
	COLOUR_GREY,
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
   181
	COLOUR_WHITE
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
   182
};
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
   183
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
   184
/** Colour of the strings, see _string_colormap in table/palettes.h or docs/ottd-colourtext-palette.png */
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
   185
enum TextColour {
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
   186
	TC_FROMSTRING  = 0x00,
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
   187
	TC_BLUE        = 0x00,
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
   188
	TC_SILVER      = 0x01,
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
   189
	TC_GOLD        = 0x02,
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
   190
	TC_RED         = 0x03,
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
   191
	TC_PURPLE      = 0x04,
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
   192
	TC_LIGHT_BROWN = 0x05,
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
   193
	TC_ORANGE      = 0x06,
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
   194
	TC_GREEN       = 0x07,
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
   195
	TC_YELLOW      = 0x08,
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
   196
	TC_DARK_GREEN  = 0x09,
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
   197
	TC_CREAM       = 0x0A,
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
   198
	TC_BROWN       = 0x0B,
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
   199
	TC_WHITE       = 0x0C,
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
   200
	TC_LIGHT_BLUE  = 0x0D,
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
   201
	TC_GREY        = 0x0E,
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
   202
	TC_DARK_BLUE   = 0x0F,
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
   203
	TC_BLACK       = 0x10,
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
   204
};
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
   205
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
   206
enum StringColorFlags {
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
   207
	IS_PALETTE_COLOR = 0x100, ///< color value is already a real palette color index, not an index of a StringColor
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
   208
};
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
   209
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
   210
#endif /* GFX_TYPE_H */