src/gfx.h
branchnoai
changeset 9704 197cb8c6ae17
parent 9703 d2a6acdbd665
child 9722 ebf0ece7d8f6
equal deleted inserted replaced
9703:d2a6acdbd665 9704:197cb8c6ae17
   240 DECLARE_POSTFIX_INCREMENT(FontSize);
   240 DECLARE_POSTFIX_INCREMENT(FontSize);
   241 
   241 
   242 void RedrawScreenRect(int left, int top, int right, int bottom);
   242 void RedrawScreenRect(int left, int top, int right, int bottom);
   243 void GfxScroll(int left, int top, int width, int height, int xo, int yo);
   243 void GfxScroll(int left, int top, int width, int height, int xo, int yo);
   244 
   244 
       
   245 /**
       
   246  * Used to only draw a part of the sprite.
       
   247  * Draw the subsprite in the rect (sprite_x_offset + left, sprite_y_offset + top) to (sprite_x_offset + right, sprite_y_offset + bottom).
       
   248  * Both corners are included in the drawing area.
       
   249  */
       
   250 struct SubSprite {
       
   251 	int left, top, right, bottom;
       
   252 };
       
   253 
       
   254 void DrawSprite(SpriteID img, SpriteID pal, int x, int y, const SubSprite *sub = NULL);
   245 
   255 
   246 /* XXX doesn't really belong here, but the only
   256 /* XXX doesn't really belong here, but the only
   247  * consumers always use it in conjunction with DoDrawString() */
   257  * consumers always use it in conjunction with DoDrawString() */
   248 #define UPARROW   "\xEE\x8A\x80"
   258 #define UPARROW   "\xEE\x8A\x80"
   249 #define DOWNARROW "\xEE\x8A\xAA"
   259 #define DOWNARROW "\xEE\x8A\xAA"
   266 void DrawStringRightAlignedTruncated(int x, int y, StringID str, uint16 color, uint maxw);
   276 void DrawStringRightAlignedTruncated(int x, int y, StringID str, uint16 color, uint maxw);
   267 void DrawStringRightAlignedUnderline(int x, int y, StringID str, uint16 color);
   277 void DrawStringRightAlignedUnderline(int x, int y, StringID str, uint16 color);
   268 
   278 
   269 void GfxFillRect(int left, int top, int right, int bottom, int color);
   279 void GfxFillRect(int left, int top, int right, int bottom, int color);
   270 void GfxDrawLine(int left, int top, int right, int bottom, int color);
   280 void GfxDrawLine(int left, int top, int right, int bottom, int color);
       
   281 void DrawBox(int x, int y, int dx1, int dy1, int dx2, int dy2, int dx3, int dy3);
   271 
   282 
   272 BoundingRect GetStringBoundingBox(const char *str);
   283 BoundingRect GetStringBoundingBox(const char *str);
   273 uint32 FormatStringLinebreaks(char *str, int maxw);
   284 uint32 FormatStringLinebreaks(char *str, int maxw);
   274 void LoadStringWidthTable();
   285 void LoadStringWidthTable();
   275 void DrawStringMultiCenter(int x, int y, StringID str, int maxw);
   286 void DrawStringMultiCenter(int x, int y, StringID str, int maxw);