~ubuntu-branches/debian/squeeze/openttd/squeeze

« back to all changes in this revision

Viewing changes to src/gfx_type.h

  • Committer: Bazaar Package Importer
  • Author(s): Jordi Mallach, Matthijs Kooijman, Jordi Mallach
  • Date: 2009-04-15 18:22:10 UTC
  • mfrom: (1.1.6 upstream) (2.1.3 squeeze)
  • Revision ID: james.westby@ubuntu.com-20090415182210-22ktb8kdbp2tf3bm
[ Matthijs Kooijman ]
* New upstream release.
* Remove Debian specific desktop file, upstream provides one now. 
* Add debian/watch file.

[ Jordi Mallach ]
* Bump Standards-Version to 3.8.1, with no changes required.
* Move to debhelper compat 7. Bump Build-Depends accordingly.
* Use dh_prep.
* Add "set -e" to config script.
* Remove a few extra doc files that get installed by upstream Makefile.
* Add more complete copyright information.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* $Id: gfx_type.h 14269 2008-09-07 22:14:48Z rubidium $ */
 
1
/* $Id: gfx_type.h 15428 2009-02-09 02:57:15Z rubidium $ */
2
2
 
3
3
/** @file gfx_type.h Types related to the graphics and/or input devices. */
4
4
 
5
5
#ifndef GFX_TYPE_H
6
6
#define GFX_TYPE_H
7
7
 
 
8
#include "core/endian_type.hpp"
8
9
#include "core/enum_type.hpp"
9
10
#include "core/geometry_type.hpp"
10
11
#include "zoom_type.h"
11
12
 
12
 
typedef uint32 SpriteID;      ///< The number of a sprite, without mapping bits and colortables
 
13
typedef uint32 SpriteID;      ///< The number of a sprite, without mapping bits and colourtables
 
14
 
 
15
/** Combination of a palette sprite and a 'real' sprite */
13
16
struct PalSpriteID {
14
 
        SpriteID sprite;
15
 
        SpriteID pal;
 
17
        SpriteID sprite;  ///< The 'real' sprite
 
18
        SpriteID pal;     ///< The palette (use \c PAL_NONE) if not needed)
16
19
};
17
20
typedef int32 CursorID;
18
21
 
99
102
        byte display_time; ///< Amount of ticks this sprite will be shown
100
103
};
101
104
 
 
105
/** Collection of variables for cursor-display and -animation */
102
106
struct CursorVars {
103
107
        Point pos, size, offs, delta; ///< position, size, offset from top-left, and movement
104
108
        Point draw_pos, draw_size;    ///< position and size bounding-box for drawing
121
125
        bool dirty;      ///< the rect occupied by the mouse is dirty (redraw)
122
126
        bool fix_at;     ///< mouse is moving, but cursor is not (used for scrolling)
123
127
        bool in_window;  ///< mouse inside this window, determines drawing logic
 
128
 
 
129
        bool vehchain;   ///< vehicle chain is dragged
124
130
};
125
131
 
126
132
struct DrawPixelInfo {
131
137
};
132
138
 
133
139
struct Colour {
134
 
        byte r;
135
 
        byte g;
136
 
        byte b;
 
140
#if TTD_ENDIAN == TTD_BIG_ENDIAN
 
141
        uint8 a, r, g, b; ///< colour channels in BE order
 
142
#else
 
143
        uint8 b, g, r, a; ///< colour channels in LE order
 
144
#endif /* TTD_ENDIAN == TTD_BIG_ENDIAN */
 
145
 
 
146
        operator uint32 () const { return *(uint32 *)this; }
137
147
};
138
148
 
 
149
/** Available font sizes */
139
150
enum FontSize {
140
151
        FS_NORMAL,
141
152
        FS_SMALL,
153
164
        int left, top, right, bottom;
154
165
};
155
166
 
156
 
enum {
 
167
enum Colours {
157
168
        COLOUR_DARK_BLUE,
158
169
        COLOUR_PALE_GREEN,
159
170
        COLOUR_PINK,
169
180
        COLOUR_ORANGE,
170
181
        COLOUR_BROWN,
171
182
        COLOUR_GREY,
172
 
        COLOUR_WHITE
 
183
        COLOUR_WHITE,
 
184
        COLOUR_END,
 
185
        INVALID_COLOUR = 0xFF,
173
186
};
174
187
 
175
 
/** Colour of the strings, see _string_colormap in table/palettes.h or docs/ottd-colourtext-palette.png */
 
188
/** Colour of the strings, see _string_colourmap in table/palettes.h or docs/ottd-colourtext-palette.png */
176
189
enum TextColour {
177
190
        TC_FROMSTRING  = 0x00,
178
191
        TC_BLUE        = 0x00,
192
205
        TC_GREY        = 0x0E,
193
206
        TC_DARK_BLUE   = 0x0F,
194
207
        TC_BLACK       = 0x10,
195
 
};
196
 
 
197
 
enum StringColorFlags {
198
 
        IS_PALETTE_COLOR = 0x100, ///< color value is already a real palette color index, not an index of a StringColor
 
208
        TC_INVALID     = 0xFF,
 
209
 
 
210
        IS_PALETTE_COLOUR = 0x100, ///< colour value is already a real palette colour index, not an index of a StringColour
 
211
};
 
212
DECLARE_ENUM_AS_BIT_SET(TextColour);
 
213
 
 
214
/** Defines a few values that are related to animations using palette changes */
 
215
enum PaletteAnimationSizes {
 
216
        PALETTE_ANIM_SIZE_WIN   = 28,   ///< number of animated colours in Windows palette
 
217
        PALETTE_ANIM_SIZE_DOS   = 38,   ///< number of animated colours in DOS palette
 
218
        PALETTE_ANIM_SIZE_START = 217,  ///< Index in  the _palettes array from which all animations are taking places (table/palettes.h)
 
219
};
 
220
 
 
221
/** Define the operation GfxFillRect performs */
 
222
enum FillRectMode {
 
223
        FILLRECT_OPAQUE,  ///< Fill rectangle with a single colour
 
224
        FILLRECT_CHECKER, ///< Draw only every second pixel, used for greying-out
 
225
        FILLRECT_RECOLOUR, ///< Apply a recolour sprite to the screen content
 
226
};
 
227
 
 
228
/** Palettes OpenTTD supports. */
 
229
enum PaletteType {
 
230
        PAL_DOS,        ///< Use the DOS palette.
 
231
        PAL_WINDOWS,    ///< Use the Windows palette.
 
232
        PAL_AUTODETECT, ///< Automatically detect the palette based on the graphics pack.
 
233
        MAX_PAL = 2,    ///< The number of palettes.
 
234
};
 
235
 
 
236
/** Types of sprites that might be loaded */
 
237
enum SpriteType {
 
238
        ST_NORMAL   = 0,      ///< The most basic (normal) sprite
 
239
        ST_MAPGEN   = 1,      ///< Special sprite for the map generator
 
240
        ST_FONT     = 2,      ///< A sprite used for fonts
 
241
        ST_RECOLOUR = 3,      ///< Recolour sprite
 
242
        ST_INVALID  = 4,      ///< Pseudosprite or other unusable sprite, used only internally
199
243
};
200
244
 
201
245
#endif /* GFX_TYPE_H */