src/gfx_type.h
author rubidium
Fri, 18 Jul 2008 12:20:31 +0000
changeset 11171 04fc8e49df1b
parent 11092 e4fce2b3cded
permissions -rw-r--r--
(svn r13729) -Fix: assumption that non-north tiles of a house do not have the 1x1 building bit set was flawed with some NewGRFs. This caused the amount of houses to differ, which causes the town radii to differ, which causes desyncs when towns are expanded.
2186
461a2aff3486 (svn r2701) Insert Id tags into all source files
tron
parents: 2134
diff changeset
     1
/* $Id$ */
461a2aff3486 (svn r2701) Insert Id tags into all source files
tron
parents: 2134
diff changeset
     2
8619
c2434269c3eb (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents: 8617
diff changeset
     3
/** @file gfx_type.h Types related to the graphics and/or input devices. */
6505
abcb0580d976 (svn r8950) -Cleanup: doxygen changes. Mostly @files missing tags and a few comments style.
belugas
parents: 6472
diff changeset
     4
8619
c2434269c3eb (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents: 8617
diff changeset
     5
#ifndef GFX_TYPE_H
c2434269c3eb (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents: 8617
diff changeset
     6
#define GFX_TYPE_H
8041
63e760418a15 (svn r11065) -Documentation [FS#1186]: of the dirty marking/repainting subsystem. Patch by Progman.
rubidium
parents: 8037
diff changeset
     7
11015
cf4b53f23fde (svn r13571) -Codechange: define channels in struct Colour in different order on LE and BE machines
smatz
parents: 10322
diff changeset
     8
#include "core/endian_type.hpp"
8619
c2434269c3eb (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents: 8617
diff changeset
     9
#include "core/enum_type.hpp"
c2434269c3eb (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents: 8617
diff changeset
    10
#include "core/geometry_type.hpp"
c2434269c3eb (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents: 8617
diff changeset
    11
#include "zoom_type.h"
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    12
8619
c2434269c3eb (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents: 8617
diff changeset
    13
typedef uint32 SpriteID;      ///< The number of a sprite, without mapping bits and colortables
c2434269c3eb (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents: 8617
diff changeset
    14
struct PalSpriteID {
c2434269c3eb (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents: 8617
diff changeset
    15
	SpriteID sprite;
c2434269c3eb (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents: 8617
diff changeset
    16
	SpriteID pal;
c2434269c3eb (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents: 8617
diff changeset
    17
};
c2434269c3eb (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents: 8617
diff changeset
    18
typedef int32 CursorID;
5887
063ca43b682c (svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents: 5838
diff changeset
    19
063ca43b682c (svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents: 5838
diff changeset
    20
enum WindowKeyCodes {
063ca43b682c (svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents: 5838
diff changeset
    21
	WKC_SHIFT = 0x8000,
063ca43b682c (svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents: 5838
diff changeset
    22
	WKC_CTRL  = 0x4000,
063ca43b682c (svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents: 5838
diff changeset
    23
	WKC_ALT   = 0x2000,
063ca43b682c (svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents: 5838
diff changeset
    24
	WKC_META  = 0x1000,
063ca43b682c (svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents: 5838
diff changeset
    25
6505
abcb0580d976 (svn r8950) -Cleanup: doxygen changes. Mostly @files missing tags and a few comments style.
belugas
parents: 6472
diff changeset
    26
	/* Special ones */
5887
063ca43b682c (svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents: 5838
diff changeset
    27
	WKC_NONE        =  0,
063ca43b682c (svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents: 5838
diff changeset
    28
	WKC_ESC         =  1,
063ca43b682c (svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents: 5838
diff changeset
    29
	WKC_BACKSPACE   =  2,
063ca43b682c (svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents: 5838
diff changeset
    30
	WKC_INSERT      =  3,
063ca43b682c (svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents: 5838
diff changeset
    31
	WKC_DELETE      =  4,
063ca43b682c (svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents: 5838
diff changeset
    32
063ca43b682c (svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents: 5838
diff changeset
    33
	WKC_PAGEUP      =  5,
063ca43b682c (svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents: 5838
diff changeset
    34
	WKC_PAGEDOWN    =  6,
063ca43b682c (svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents: 5838
diff changeset
    35
	WKC_END         =  7,
063ca43b682c (svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents: 5838
diff changeset
    36
	WKC_HOME        =  8,
063ca43b682c (svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents: 5838
diff changeset
    37
6505
abcb0580d976 (svn r8950) -Cleanup: doxygen changes. Mostly @files missing tags and a few comments style.
belugas
parents: 6472
diff changeset
    38
	/* Arrow keys */
5887
063ca43b682c (svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents: 5838
diff changeset
    39
	WKC_LEFT        =  9,
063ca43b682c (svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents: 5838
diff changeset
    40
	WKC_UP          = 10,
063ca43b682c (svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents: 5838
diff changeset
    41
	WKC_RIGHT       = 11,
063ca43b682c (svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents: 5838
diff changeset
    42
	WKC_DOWN        = 12,
063ca43b682c (svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents: 5838
diff changeset
    43
6505
abcb0580d976 (svn r8950) -Cleanup: doxygen changes. Mostly @files missing tags and a few comments style.
belugas
parents: 6472
diff changeset
    44
	/* Return & tab */
5887
063ca43b682c (svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents: 5838
diff changeset
    45
	WKC_RETURN      = 13,
063ca43b682c (svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents: 5838
diff changeset
    46
	WKC_TAB         = 14,
063ca43b682c (svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents: 5838
diff changeset
    47
6505
abcb0580d976 (svn r8950) -Cleanup: doxygen changes. Mostly @files missing tags and a few comments style.
belugas
parents: 6472
diff changeset
    48
	/* Space */
5887
063ca43b682c (svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents: 5838
diff changeset
    49
	WKC_SPACE       = 32,
063ca43b682c (svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents: 5838
diff changeset
    50
6505
abcb0580d976 (svn r8950) -Cleanup: doxygen changes. Mostly @files missing tags and a few comments style.
belugas
parents: 6472
diff changeset
    51
	/* Function keys */
5887
063ca43b682c (svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents: 5838
diff changeset
    52
	WKC_F1          = 33,
063ca43b682c (svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents: 5838
diff changeset
    53
	WKC_F2          = 34,
063ca43b682c (svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents: 5838
diff changeset
    54
	WKC_F3          = 35,
063ca43b682c (svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents: 5838
diff changeset
    55
	WKC_F4          = 36,
063ca43b682c (svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents: 5838
diff changeset
    56
	WKC_F5          = 37,
063ca43b682c (svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents: 5838
diff changeset
    57
	WKC_F6          = 38,
063ca43b682c (svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents: 5838
diff changeset
    58
	WKC_F7          = 39,
063ca43b682c (svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents: 5838
diff changeset
    59
	WKC_F8          = 40,
063ca43b682c (svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents: 5838
diff changeset
    60
	WKC_F9          = 41,
063ca43b682c (svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents: 5838
diff changeset
    61
	WKC_F10         = 42,
063ca43b682c (svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents: 5838
diff changeset
    62
	WKC_F11         = 43,
063ca43b682c (svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents: 5838
diff changeset
    63
	WKC_F12         = 44,
063ca43b682c (svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents: 5838
diff changeset
    64
7807
81a0f019daa2 (svn r10663) -Fix r10662: bad me, didn't comply with coding style, as penalty I updated the surrounding code to comply with coding style too; I will never do it again (I hope :p)
truelight
parents: 7806
diff changeset
    65
	/* Backquote is the key left of "1"
6505
abcb0580d976 (svn r8950) -Cleanup: doxygen changes. Mostly @files missing tags and a few comments style.
belugas
parents: 6472
diff changeset
    66
	 * we only store this key here, no matter what character is really mapped to it
7225
e83351234693 (svn r9961) -Fix (r7182): some file were still in iso8859-15 instead of utf8.
rubidium
parents: 7201
diff changeset
    67
	 * on a particular keyboard. (US keyboard: ` and ~ ; German keyboard: ^ and °) */
5887
063ca43b682c (svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents: 5838
diff changeset
    68
	WKC_BACKQUOTE   = 45,
063ca43b682c (svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents: 5838
diff changeset
    69
	WKC_PAUSE       = 46,
063ca43b682c (svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents: 5838
diff changeset
    70
6505
abcb0580d976 (svn r8950) -Cleanup: doxygen changes. Mostly @files missing tags and a few comments style.
belugas
parents: 6472
diff changeset
    71
	/* 0-9 are mapped to 48-57
abcb0580d976 (svn r8950) -Cleanup: doxygen changes. Mostly @files missing tags and a few comments style.
belugas
parents: 6472
diff changeset
    72
	 * A-Z are mapped to 65-90
abcb0580d976 (svn r8950) -Cleanup: doxygen changes. Mostly @files missing tags and a few comments style.
belugas
parents: 6472
diff changeset
    73
	 * a-z are mapped to 97-122 */
7806
65bd17ca1609 (svn r10662) -Add: added 'V' as new shortcut for new viewport (bilbo)
truelight
parents: 7495
diff changeset
    74
8037
3b28308ccda7 (svn r11061) -Fix [FS#1086]: [win32] some keys were handled twice
glx
parents: 7950
diff changeset
    75
	/* Numerical keyboard */
3b28308ccda7 (svn r11061) -Fix [FS#1086]: [win32] some keys were handled twice
glx
parents: 7950
diff changeset
    76
	WKC_NUM_0       = 128,
3b28308ccda7 (svn r11061) -Fix [FS#1086]: [win32] some keys were handled twice
glx
parents: 7950
diff changeset
    77
	WKC_NUM_1       = 129,
3b28308ccda7 (svn r11061) -Fix [FS#1086]: [win32] some keys were handled twice
glx
parents: 7950
diff changeset
    78
	WKC_NUM_2       = 130,
3b28308ccda7 (svn r11061) -Fix [FS#1086]: [win32] some keys were handled twice
glx
parents: 7950
diff changeset
    79
	WKC_NUM_3       = 131,
3b28308ccda7 (svn r11061) -Fix [FS#1086]: [win32] some keys were handled twice
glx
parents: 7950
diff changeset
    80
	WKC_NUM_4       = 132,
3b28308ccda7 (svn r11061) -Fix [FS#1086]: [win32] some keys were handled twice
glx
parents: 7950
diff changeset
    81
	WKC_NUM_5       = 133,
3b28308ccda7 (svn r11061) -Fix [FS#1086]: [win32] some keys were handled twice
glx
parents: 7950
diff changeset
    82
	WKC_NUM_6       = 134,
3b28308ccda7 (svn r11061) -Fix [FS#1086]: [win32] some keys were handled twice
glx
parents: 7950
diff changeset
    83
	WKC_NUM_7       = 135,
3b28308ccda7 (svn r11061) -Fix [FS#1086]: [win32] some keys were handled twice
glx
parents: 7950
diff changeset
    84
	WKC_NUM_8       = 136,
3b28308ccda7 (svn r11061) -Fix [FS#1086]: [win32] some keys were handled twice
glx
parents: 7950
diff changeset
    85
	WKC_NUM_9       = 137,
3b28308ccda7 (svn r11061) -Fix [FS#1086]: [win32] some keys were handled twice
glx
parents: 7950
diff changeset
    86
	WKC_NUM_DIV     = 138,
3b28308ccda7 (svn r11061) -Fix [FS#1086]: [win32] some keys were handled twice
glx
parents: 7950
diff changeset
    87
	WKC_NUM_MUL     = 139,
3b28308ccda7 (svn r11061) -Fix [FS#1086]: [win32] some keys were handled twice
glx
parents: 7950
diff changeset
    88
	WKC_NUM_MINUS   = 140,
3b28308ccda7 (svn r11061) -Fix [FS#1086]: [win32] some keys were handled twice
glx
parents: 7950
diff changeset
    89
	WKC_NUM_PLUS    = 141,
3b28308ccda7 (svn r11061) -Fix [FS#1086]: [win32] some keys were handled twice
glx
parents: 7950
diff changeset
    90
	WKC_NUM_ENTER   = 142,
3b28308ccda7 (svn r11061) -Fix [FS#1086]: [win32] some keys were handled twice
glx
parents: 7950
diff changeset
    91
	WKC_NUM_DECIMAL = 143,
7806
65bd17ca1609 (svn r10662) -Add: added 'V' as new shortcut for new viewport (bilbo)
truelight
parents: 7495
diff changeset
    92
8037
3b28308ccda7 (svn r11061) -Fix [FS#1086]: [win32] some keys were handled twice
glx
parents: 7950
diff changeset
    93
	/* Other keys */
3b28308ccda7 (svn r11061) -Fix [FS#1086]: [win32] some keys were handled twice
glx
parents: 7950
diff changeset
    94
	WKC_SLASH       = 144, ///< / Forward slash
3b28308ccda7 (svn r11061) -Fix [FS#1086]: [win32] some keys were handled twice
glx
parents: 7950
diff changeset
    95
	WKC_SEMICOLON   = 145, ///< ; Semicolon
3b28308ccda7 (svn r11061) -Fix [FS#1086]: [win32] some keys were handled twice
glx
parents: 7950
diff changeset
    96
	WKC_EQUALS      = 146, ///< = Equals
3b28308ccda7 (svn r11061) -Fix [FS#1086]: [win32] some keys were handled twice
glx
parents: 7950
diff changeset
    97
	WKC_L_BRACKET   = 147, ///< [ Left square bracket
3b28308ccda7 (svn r11061) -Fix [FS#1086]: [win32] some keys were handled twice
glx
parents: 7950
diff changeset
    98
	WKC_BACKSLASH   = 148, ///< \ Backslash
3b28308ccda7 (svn r11061) -Fix [FS#1086]: [win32] some keys were handled twice
glx
parents: 7950
diff changeset
    99
	WKC_R_BRACKET   = 149, ///< ] Right square bracket
3b28308ccda7 (svn r11061) -Fix [FS#1086]: [win32] some keys were handled twice
glx
parents: 7950
diff changeset
   100
	WKC_SINGLEQUOTE = 150, ///< ' Single quote
3b28308ccda7 (svn r11061) -Fix [FS#1086]: [win32] some keys were handled twice
glx
parents: 7950
diff changeset
   101
	WKC_COMMA       = 151, ///< , Comma
3b28308ccda7 (svn r11061) -Fix [FS#1086]: [win32] some keys were handled twice
glx
parents: 7950
diff changeset
   102
	WKC_PERIOD      = 152, ///< . Period
3b28308ccda7 (svn r11061) -Fix [FS#1086]: [win32] some keys were handled twice
glx
parents: 7950
diff changeset
   103
	WKC_MINUS       = 153, ///< - Minus
5887
063ca43b682c (svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents: 5838
diff changeset
   104
};
063ca43b682c (svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents: 5838
diff changeset
   105
6464
1c3515433409 (svn r8880) -Codechange: make anim cursors an array of structs.
rubidium
parents: 6192
diff changeset
   106
/** A single sprite of a list of animated cursors */
1c3515433409 (svn r8880) -Codechange: make anim cursors an array of structs.
rubidium
parents: 6192
diff changeset
   107
struct AnimCursor {
6472
ba7633d318bb (svn r8889) -Fix (r8880): a CursorID is not a SpriteID.
rubidium
parents: 6464
diff changeset
   108
	static const CursorID LAST = MAX_UVALUE(CursorID);
6464
1c3515433409 (svn r8880) -Codechange: make anim cursors an array of structs.
rubidium
parents: 6192
diff changeset
   109
	CursorID sprite;   ///< Must be set to LAST_ANIM when it is the last sprite of the loop
1c3515433409 (svn r8880) -Codechange: make anim cursors an array of structs.
rubidium
parents: 6192
diff changeset
   110
	byte display_time; ///< Amount of ticks this sprite will be shown
1c3515433409 (svn r8880) -Codechange: make anim cursors an array of structs.
rubidium
parents: 6192
diff changeset
   111
};
5887
063ca43b682c (svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents: 5838
diff changeset
   112
6574
e1d1a12faaf7 (svn r9051) -Codechange: typedef [enum|struct] Y {} X; -> [enum|struct] X {};
rubidium
parents: 6573
diff changeset
   113
struct CursorVars {
5887
063ca43b682c (svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents: 5838
diff changeset
   114
	Point pos, size, offs, delta; ///< position, size, offset from top-left, and movement
063ca43b682c (svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents: 5838
diff changeset
   115
	Point draw_pos, draw_size;    ///< position and size bounding-box for drawing
5919
2b58160d667d (svn r8128) -Codechange: Split sprite and palette remap into separate 32 bit values.
peter1138
parents: 5887
diff changeset
   116
	SpriteID sprite; ///< current image of cursor
2b58160d667d (svn r8128) -Codechange: Split sprite and palette remap into separate 32 bit values.
peter1138
parents: 5887
diff changeset
   117
	SpriteID pal;
5887
063ca43b682c (svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents: 5838
diff changeset
   118
063ca43b682c (svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents: 5838
diff changeset
   119
	int wheel;       ///< mouse wheel movement
6615
96d30d65ed35 (svn r9111) -Feature: [OSX] mighty mice and touchpads can now scroll the map (in all directions)
bjarni
parents: 6574
diff changeset
   120
96d30d65ed35 (svn r9111) -Feature: [OSX] mighty mice and touchpads can now scroll the map (in all directions)
bjarni
parents: 6574
diff changeset
   121
	/* We need two different vars to keep track of how far the scrollwheel moved.
96d30d65ed35 (svn r9111) -Feature: [OSX] mighty mice and touchpads can now scroll the map (in all directions)
bjarni
parents: 6574
diff changeset
   122
	 * OSX uses this for scrolling around the map. */
96d30d65ed35 (svn r9111) -Feature: [OSX] mighty mice and touchpads can now scroll the map (in all directions)
bjarni
parents: 6574
diff changeset
   123
	int v_wheel;
96d30d65ed35 (svn r9111) -Feature: [OSX] mighty mice and touchpads can now scroll the map (in all directions)
bjarni
parents: 6574
diff changeset
   124
	int h_wheel;
96d30d65ed35 (svn r9111) -Feature: [OSX] mighty mice and touchpads can now scroll the map (in all directions)
bjarni
parents: 6574
diff changeset
   125
6464
1c3515433409 (svn r8880) -Codechange: make anim cursors an array of structs.
rubidium
parents: 6192
diff changeset
   126
	const AnimCursor *animate_list; ///< in case of animated cursor, list of frames
1c3515433409 (svn r8880) -Codechange: make anim cursors an array of structs.
rubidium
parents: 6192
diff changeset
   127
	const AnimCursor *animate_cur;  ///< in case of animated cursor, current frame
1c3515433409 (svn r8880) -Codechange: make anim cursors an array of structs.
rubidium
parents: 6192
diff changeset
   128
	uint animate_timeout;           ///< in case of animated cursor, number of ticks to show the current cursor
5887
063ca43b682c (svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents: 5838
diff changeset
   129
063ca43b682c (svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents: 5838
diff changeset
   130
	bool visible;    ///< cursor is visible
063ca43b682c (svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents: 5838
diff changeset
   131
	bool dirty;      ///< the rect occupied by the mouse is dirty (redraw)
063ca43b682c (svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents: 5838
diff changeset
   132
	bool fix_at;     ///< mouse is moving, but cursor is not (used for scrolling)
063ca43b682c (svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents: 5838
diff changeset
   133
	bool in_window;  ///< mouse inside this window, determines drawing logic
9324
bf9cc84b889d (svn r12576) -Feature(tte) [FS#337]: highlight vehicle chain when dragging in the group and depot GUI if appropriate
smatz
parents: 8619
diff changeset
   134
bf9cc84b889d (svn r12576) -Feature(tte) [FS#337]: highlight vehicle chain when dragging in the group and depot GUI if appropriate
smatz
parents: 8619
diff changeset
   135
	bool vehchain;   ///< vehicle chain is dragged
6574
e1d1a12faaf7 (svn r9051) -Codechange: typedef [enum|struct] Y {} X; -> [enum|struct] X {};
rubidium
parents: 6573
diff changeset
   136
};
5887
063ca43b682c (svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents: 5838
diff changeset
   137
6574
e1d1a12faaf7 (svn r9051) -Codechange: typedef [enum|struct] Y {} X; -> [enum|struct] X {};
rubidium
parents: 6573
diff changeset
   138
struct DrawPixelInfo {
7374
54c06f06ecc8 (svn r10121) -Codechange: split renderer from rest of code; no longer any code directly accesses the video-buffer
truelight
parents: 7225
diff changeset
   139
	void *dst_ptr;
5887
063ca43b682c (svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents: 5838
diff changeset
   140
	int left, top, width, height;
063ca43b682c (svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents: 5838
diff changeset
   141
	int pitch;
7120
e31767effc16 (svn r9844) -Codechange: replace zoomlevel with an enum
truelight
parents: 6703
diff changeset
   142
	ZoomLevel zoom;
6574
e1d1a12faaf7 (svn r9051) -Codechange: typedef [enum|struct] Y {} X; -> [enum|struct] X {};
rubidium
parents: 6573
diff changeset
   143
};
5887
063ca43b682c (svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents: 5838
diff changeset
   144
6574
e1d1a12faaf7 (svn r9051) -Codechange: typedef [enum|struct] Y {} X; -> [enum|struct] X {};
rubidium
parents: 6573
diff changeset
   145
struct Colour {
11015
cf4b53f23fde (svn r13571) -Codechange: define channels in struct Colour in different order on LE and BE machines
smatz
parents: 10322
diff changeset
   146
#if TTD_ENDIAN == TTD_BIG_ENDIAN
cf4b53f23fde (svn r13571) -Codechange: define channels in struct Colour in different order on LE and BE machines
smatz
parents: 10322
diff changeset
   147
	uint8 a, r, g, b; ///< colour channels in BE order
cf4b53f23fde (svn r13571) -Codechange: define channels in struct Colour in different order on LE and BE machines
smatz
parents: 10322
diff changeset
   148
#else
cf4b53f23fde (svn r13571) -Codechange: define channels in struct Colour in different order on LE and BE machines
smatz
parents: 10322
diff changeset
   149
	uint8 b, g, r, a; ///< colour channels in LE order
cf4b53f23fde (svn r13571) -Codechange: define channels in struct Colour in different order on LE and BE machines
smatz
parents: 10322
diff changeset
   150
#endif /* TTD_ENDIAN == TTD_BIG_ENDIAN */
cf4b53f23fde (svn r13571) -Codechange: define channels in struct Colour in different order on LE and BE machines
smatz
parents: 10322
diff changeset
   151
11082
45ab75d184a0 (svn r13639) -Codechange: rewrite 32bpp-anim and 32bpp-optimized drawing and encoding so it uses similiar scheme as 8bpp-optimized
smatz
parents: 11015
diff changeset
   152
	operator uint32 () const { return *(uint32 *)this; }
6574
e1d1a12faaf7 (svn r9051) -Codechange: typedef [enum|struct] Y {} X; -> [enum|struct] X {};
rubidium
parents: 6573
diff changeset
   153
};
5887
063ca43b682c (svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents: 5838
diff changeset
   154
6574
e1d1a12faaf7 (svn r9051) -Codechange: typedef [enum|struct] Y {} X; -> [enum|struct] X {};
rubidium
parents: 6573
diff changeset
   155
enum FontSize {
3798
37a2090eac94 (svn r4802) - Codechange: replace _stringwidth_base and associated magic numbers with a FontSize enum, using the numbers (which are SpriteIDs) in only the places needed.
peter1138
parents: 3312
diff changeset
   156
	FS_NORMAL,
37a2090eac94 (svn r4802) - Codechange: replace _stringwidth_base and associated magic numbers with a FontSize enum, using the numbers (which are SpriteIDs) in only the places needed.
peter1138
parents: 3312
diff changeset
   157
	FS_SMALL,
37a2090eac94 (svn r4802) - Codechange: replace _stringwidth_base and associated magic numbers with a FontSize enum, using the numbers (which are SpriteIDs) in only the places needed.
peter1138
parents: 3312
diff changeset
   158
	FS_LARGE,
37a2090eac94 (svn r4802) - Codechange: replace _stringwidth_base and associated magic numbers with a FontSize enum, using the numbers (which are SpriteIDs) in only the places needed.
peter1138
parents: 3312
diff changeset
   159
	FS_END,
6574
e1d1a12faaf7 (svn r9051) -Codechange: typedef [enum|struct] Y {} X; -> [enum|struct] X {};
rubidium
parents: 6573
diff changeset
   160
};
5838
9c3129cb019b (svn r8038) -Merge: the cpp branch. Effort of KUDr, Celestar, glx, Smoovius, stillunknown and pv2b.
rubidium
parents: 5726
diff changeset
   161
DECLARE_POSTFIX_INCREMENT(FontSize);
3798
37a2090eac94 (svn r4802) - Codechange: replace _stringwidth_base and associated magic numbers with a FontSize enum, using the numbers (which are SpriteIDs) in only the places needed.
peter1138
parents: 3312
diff changeset
   162
8177
f0bcc8e149f3 (svn r11212) -Codechange: add support for drawing parts of sprites. Patch by frosch.
rubidium
parents: 8139
diff changeset
   163
/**
f0bcc8e149f3 (svn r11212) -Codechange: add support for drawing parts of sprites. Patch by frosch.
rubidium
parents: 8139
diff changeset
   164
 * Used to only draw a part of the sprite.
f0bcc8e149f3 (svn r11212) -Codechange: add support for drawing parts of sprites. Patch by frosch.
rubidium
parents: 8139
diff changeset
   165
 * Draw the subsprite in the rect (sprite_x_offset + left, sprite_y_offset + top) to (sprite_x_offset + right, sprite_y_offset + bottom).
f0bcc8e149f3 (svn r11212) -Codechange: add support for drawing parts of sprites. Patch by frosch.
rubidium
parents: 8139
diff changeset
   166
 * Both corners are included in the drawing area.
f0bcc8e149f3 (svn r11212) -Codechange: add support for drawing parts of sprites. Patch by frosch.
rubidium
parents: 8139
diff changeset
   167
 */
f0bcc8e149f3 (svn r11212) -Codechange: add support for drawing parts of sprites. Patch by frosch.
rubidium
parents: 8139
diff changeset
   168
struct SubSprite {
f0bcc8e149f3 (svn r11212) -Codechange: add support for drawing parts of sprites. Patch by frosch.
rubidium
parents: 8139
diff changeset
   169
	int left, top, right, bottom;
f0bcc8e149f3 (svn r11212) -Codechange: add support for drawing parts of sprites. Patch by frosch.
rubidium
parents: 8139
diff changeset
   170
};
f0bcc8e149f3 (svn r11212) -Codechange: add support for drawing parts of sprites. Patch by frosch.
rubidium
parents: 8139
diff changeset
   171
10322
02d72ef5a6a7 (svn r12863) -Codechange: rewrite GeneratePlayerColour to be better understandable.
rubidium
parents: 9324
diff changeset
   172
enum Colours {
4444
9c9c7f962482 (svn r6222) Remove struct ColorList, because the names of its attributes are plain confusing
tron
parents: 4437
diff changeset
   173
	COLOUR_DARK_BLUE,
9c9c7f962482 (svn r6222) Remove struct ColorList, because the names of its attributes are plain confusing
tron
parents: 4437
diff changeset
   174
	COLOUR_PALE_GREEN,
9c9c7f962482 (svn r6222) Remove struct ColorList, because the names of its attributes are plain confusing
tron
parents: 4437
diff changeset
   175
	COLOUR_PINK,
9c9c7f962482 (svn r6222) Remove struct ColorList, because the names of its attributes are plain confusing
tron
parents: 4437
diff changeset
   176
	COLOUR_YELLOW,
9c9c7f962482 (svn r6222) Remove struct ColorList, because the names of its attributes are plain confusing
tron
parents: 4437
diff changeset
   177
	COLOUR_RED,
9c9c7f962482 (svn r6222) Remove struct ColorList, because the names of its attributes are plain confusing
tron
parents: 4437
diff changeset
   178
	COLOUR_LIGHT_BLUE,
9c9c7f962482 (svn r6222) Remove struct ColorList, because the names of its attributes are plain confusing
tron
parents: 4437
diff changeset
   179
	COLOUR_GREEN,
9c9c7f962482 (svn r6222) Remove struct ColorList, because the names of its attributes are plain confusing
tron
parents: 4437
diff changeset
   180
	COLOUR_DARK_GREEN,
9c9c7f962482 (svn r6222) Remove struct ColorList, because the names of its attributes are plain confusing
tron
parents: 4437
diff changeset
   181
	COLOUR_BLUE,
9c9c7f962482 (svn r6222) Remove struct ColorList, because the names of its attributes are plain confusing
tron
parents: 4437
diff changeset
   182
	COLOUR_CREAM,
9c9c7f962482 (svn r6222) Remove struct ColorList, because the names of its attributes are plain confusing
tron
parents: 4437
diff changeset
   183
	COLOUR_MAUVE,
9c9c7f962482 (svn r6222) Remove struct ColorList, because the names of its attributes are plain confusing
tron
parents: 4437
diff changeset
   184
	COLOUR_PURPLE,
9c9c7f962482 (svn r6222) Remove struct ColorList, because the names of its attributes are plain confusing
tron
parents: 4437
diff changeset
   185
	COLOUR_ORANGE,
9c9c7f962482 (svn r6222) Remove struct ColorList, because the names of its attributes are plain confusing
tron
parents: 4437
diff changeset
   186
	COLOUR_BROWN,
9c9c7f962482 (svn r6222) Remove struct ColorList, because the names of its attributes are plain confusing
tron
parents: 4437
diff changeset
   187
	COLOUR_GREY,
10322
02d72ef5a6a7 (svn r12863) -Codechange: rewrite GeneratePlayerColour to be better understandable.
rubidium
parents: 9324
diff changeset
   188
	COLOUR_WHITE,
02d72ef5a6a7 (svn r12863) -Codechange: rewrite GeneratePlayerColour to be better understandable.
rubidium
parents: 9324
diff changeset
   189
	COLOUR_END,
02d72ef5a6a7 (svn r12863) -Codechange: rewrite GeneratePlayerColour to be better understandable.
rubidium
parents: 9324
diff changeset
   190
	INVALID_COLOUR = 0xFF
4444
9c9c7f962482 (svn r6222) Remove struct ColorList, because the names of its attributes are plain confusing
tron
parents: 4437
diff changeset
   191
};
9c9c7f962482 (svn r6222) Remove struct ColorList, because the names of its attributes are plain confusing
tron
parents: 4437
diff changeset
   192
8320
6ffad7a5d242 (svn r11374) -Codechange: Give meaning to the magical number that specifies the color of the text in a DrawString call.
belugas
parents: 8177
diff changeset
   193
/** Colour of the strings, see _string_colormap in table/palettes.h or docs/ottd-colourtext-palette.png */
6ffad7a5d242 (svn r11374) -Codechange: Give meaning to the magical number that specifies the color of the text in a DrawString call.
belugas
parents: 8177
diff changeset
   194
enum TextColour {
6ffad7a5d242 (svn r11374) -Codechange: Give meaning to the magical number that specifies the color of the text in a DrawString call.
belugas
parents: 8177
diff changeset
   195
	TC_FROMSTRING  = 0x00,
6ffad7a5d242 (svn r11374) -Codechange: Give meaning to the magical number that specifies the color of the text in a DrawString call.
belugas
parents: 8177
diff changeset
   196
	TC_BLUE        = 0x00,
6ffad7a5d242 (svn r11374) -Codechange: Give meaning to the magical number that specifies the color of the text in a DrawString call.
belugas
parents: 8177
diff changeset
   197
	TC_SILVER      = 0x01,
6ffad7a5d242 (svn r11374) -Codechange: Give meaning to the magical number that specifies the color of the text in a DrawString call.
belugas
parents: 8177
diff changeset
   198
	TC_GOLD        = 0x02,
6ffad7a5d242 (svn r11374) -Codechange: Give meaning to the magical number that specifies the color of the text in a DrawString call.
belugas
parents: 8177
diff changeset
   199
	TC_RED         = 0x03,
6ffad7a5d242 (svn r11374) -Codechange: Give meaning to the magical number that specifies the color of the text in a DrawString call.
belugas
parents: 8177
diff changeset
   200
	TC_PURPLE      = 0x04,
6ffad7a5d242 (svn r11374) -Codechange: Give meaning to the magical number that specifies the color of the text in a DrawString call.
belugas
parents: 8177
diff changeset
   201
	TC_LIGHT_BROWN = 0x05,
6ffad7a5d242 (svn r11374) -Codechange: Give meaning to the magical number that specifies the color of the text in a DrawString call.
belugas
parents: 8177
diff changeset
   202
	TC_ORANGE      = 0x06,
6ffad7a5d242 (svn r11374) -Codechange: Give meaning to the magical number that specifies the color of the text in a DrawString call.
belugas
parents: 8177
diff changeset
   203
	TC_GREEN       = 0x07,
6ffad7a5d242 (svn r11374) -Codechange: Give meaning to the magical number that specifies the color of the text in a DrawString call.
belugas
parents: 8177
diff changeset
   204
	TC_YELLOW      = 0x08,
6ffad7a5d242 (svn r11374) -Codechange: Give meaning to the magical number that specifies the color of the text in a DrawString call.
belugas
parents: 8177
diff changeset
   205
	TC_DARK_GREEN  = 0x09,
6ffad7a5d242 (svn r11374) -Codechange: Give meaning to the magical number that specifies the color of the text in a DrawString call.
belugas
parents: 8177
diff changeset
   206
	TC_CREAM       = 0x0A,
6ffad7a5d242 (svn r11374) -Codechange: Give meaning to the magical number that specifies the color of the text in a DrawString call.
belugas
parents: 8177
diff changeset
   207
	TC_BROWN       = 0x0B,
6ffad7a5d242 (svn r11374) -Codechange: Give meaning to the magical number that specifies the color of the text in a DrawString call.
belugas
parents: 8177
diff changeset
   208
	TC_WHITE       = 0x0C,
6ffad7a5d242 (svn r11374) -Codechange: Give meaning to the magical number that specifies the color of the text in a DrawString call.
belugas
parents: 8177
diff changeset
   209
	TC_LIGHT_BLUE  = 0x0D,
6ffad7a5d242 (svn r11374) -Codechange: Give meaning to the magical number that specifies the color of the text in a DrawString call.
belugas
parents: 8177
diff changeset
   210
	TC_GREY        = 0x0E,
6ffad7a5d242 (svn r11374) -Codechange: Give meaning to the magical number that specifies the color of the text in a DrawString call.
belugas
parents: 8177
diff changeset
   211
	TC_DARK_BLUE   = 0x0F,
6ffad7a5d242 (svn r11374) -Codechange: Give meaning to the magical number that specifies the color of the text in a DrawString call.
belugas
parents: 8177
diff changeset
   212
	TC_BLACK       = 0x10,
6ffad7a5d242 (svn r11374) -Codechange: Give meaning to the magical number that specifies the color of the text in a DrawString call.
belugas
parents: 8177
diff changeset
   213
};
6ffad7a5d242 (svn r11374) -Codechange: Give meaning to the magical number that specifies the color of the text in a DrawString call.
belugas
parents: 8177
diff changeset
   214
6574
e1d1a12faaf7 (svn r9051) -Codechange: typedef [enum|struct] Y {} X; -> [enum|struct] X {};
rubidium
parents: 6573
diff changeset
   215
enum StringColorFlags {
6505
abcb0580d976 (svn r8950) -Cleanup: doxygen changes. Mostly @files missing tags and a few comments style.
belugas
parents: 6472
diff changeset
   216
	IS_PALETTE_COLOR = 0x100, ///< color value is already a real palette color index, not an index of a StringColor
6574
e1d1a12faaf7 (svn r9051) -Codechange: typedef [enum|struct] Y {} X; -> [enum|struct] X {};
rubidium
parents: 6573
diff changeset
   217
};
657
40a9032b454b (svn r1091) Fix: Finally station names use 100% the correct color in transparent mode
dominik
parents: 614
diff changeset
   218
11092
e4fce2b3cded (svn r13649) -Codechange: Split the GfxFillRect() special flags from 'color' into their own parameter.
frosch
parents: 11082
diff changeset
   219
/** Define the operation GfxFillRect performs */
e4fce2b3cded (svn r13649) -Codechange: Split the GfxFillRect() special flags from 'color' into their own parameter.
frosch
parents: 11082
diff changeset
   220
enum FillRectMode {
e4fce2b3cded (svn r13649) -Codechange: Split the GfxFillRect() special flags from 'color' into their own parameter.
frosch
parents: 11082
diff changeset
   221
	FILLRECT_OPAQUE,  ///< Fill rectangle with a single color
e4fce2b3cded (svn r13649) -Codechange: Split the GfxFillRect() special flags from 'color' into their own parameter.
frosch
parents: 11082
diff changeset
   222
	FILLRECT_CHECKER, ///< Draw only every second pixel, used for greying-out
e4fce2b3cded (svn r13649) -Codechange: Split the GfxFillRect() special flags from 'color' into their own parameter.
frosch
parents: 11082
diff changeset
   223
	FILLRECT_RECOLOR, ///< Apply a recolor sprite to the screen content
e4fce2b3cded (svn r13649) -Codechange: Split the GfxFillRect() special flags from 'color' into their own parameter.
frosch
parents: 11082
diff changeset
   224
};
e4fce2b3cded (svn r13649) -Codechange: Split the GfxFillRect() special flags from 'color' into their own parameter.
frosch
parents: 11082
diff changeset
   225
8619
c2434269c3eb (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents: 8617
diff changeset
   226
#endif /* GFX_TYPE_H */