src/gfx.h
branchcpp_gui
changeset 6303 84c215fc8eb8
parent 6300 1f0d2abac815
equal deleted inserted replaced
6302:bd80897189ba 6303:84c215fc8eb8
     4 
     4 
     5 #ifndef GFX_H
     5 #ifndef GFX_H
     6 #define GFX_H
     6 #define GFX_H
     7 
     7 
     8 #include "misc/rect.hpp"
     8 #include "misc/rect.hpp"
       
     9 #include "openttd.h"
     9 
    10 
    10 enum WindowKeyCodes {
    11 enum WindowKeyCodes {
    11 	WKC_SHIFT = 0x8000,
    12 	WKC_SHIFT = 0x8000,
    12 	WKC_CTRL  = 0x4000,
    13 	WKC_CTRL  = 0x4000,
    13 	WKC_ALT   = 0x2000,
    14 	WKC_ALT   = 0x2000,
   110 	Point draw_pos, draw_size;    ///< position and size bounding-box for drawing
   111 	Point draw_pos, draw_size;    ///< position and size bounding-box for drawing
   111 	SpriteID sprite; ///< current image of cursor
   112 	SpriteID sprite; ///< current image of cursor
   112 	SpriteID pal;
   113 	SpriteID pal;
   113 
   114 
   114 	int wheel;       ///< mouse wheel movement
   115 	int wheel;       ///< mouse wheel movement
       
   116 
       
   117 	/* We need two different vars to keep track of how far the scrollwheel moved.
       
   118 	 * OSX uses this for scrolling around the map. */
       
   119 	int v_wheel;
       
   120 	int h_wheel;
       
   121 
   115 	const AnimCursor *animate_list; ///< in case of animated cursor, list of frames
   122 	const AnimCursor *animate_list; ///< in case of animated cursor, list of frames
   116 	const AnimCursor *animate_cur;  ///< in case of animated cursor, current frame
   123 	const AnimCursor *animate_cur;  ///< in case of animated cursor, current frame
   117 	uint animate_timeout;           ///< in case of animated cursor, number of ticks to show the current cursor
   124 	uint animate_timeout;           ///< in case of animated cursor, number of ticks to show the current cursor
   118 
   125 
   119 	bool visible;    ///< cursor is visible
   126 	bool visible;    ///< cursor is visible
   221 
   228 
   222 BoundingRect GetStringBoundingBox(const char *str);
   229 BoundingRect GetStringBoundingBox(const char *str);
   223 uint32 FormatStringLinebreaks(char *str, int maxw);
   230 uint32 FormatStringLinebreaks(char *str, int maxw);
   224 void LoadStringWidthTable();
   231 void LoadStringWidthTable();
   225 void DrawStringMultiCenter(int x, int y, StringID str, int maxw);
   232 void DrawStringMultiCenter(int x, int y, StringID str, int maxw);
   226 uint DrawStringMultiLine(int x, int y, StringID str, int maxw);
   233 uint DrawStringMultiLine(int x, int y, StringID str, int maxw, int maxh = -1);
   227 void DrawDirtyBlocks();
   234 void DrawDirtyBlocks();
   228 void SetDirtyBlocks(int left, int top, int right, int bottom);
   235 void SetDirtyBlocks(int left, int top, int right, int bottom);
   229 void MarkWholeScreenDirty();
   236 void MarkWholeScreenDirty();
   230 
   237 
   231 void GfxInitPalettes();
   238 void GfxInitPalettes();