src/gfx.cpp
branchNewGRF_ports
changeset 6800 6c09e1e86fcb
parent 6743 cabfaa4a0295
child 6868 7eb395287b3d
equal deleted inserted replaced
6799:2adc1052a548 6800:6c09e1e86fcb
   493 int DoDrawString(const char *string, int x, int y, uint16 real_color)
   493 int DoDrawString(const char *string, int x, int y, uint16 real_color)
   494 {
   494 {
   495 	DrawPixelInfo *dpi = _cur_dpi;
   495 	DrawPixelInfo *dpi = _cur_dpi;
   496 	FontSize size = _cur_fontsize;
   496 	FontSize size = _cur_fontsize;
   497 	WChar c;
   497 	WChar c;
   498 	byte color;
       
   499 	int xo = x, yo = y;
   498 	int xo = x, yo = y;
   500 
   499 
   501 	color = real_color & 0xFF;
   500 	byte color = real_color & 0xFF;
       
   501 	byte previous_color = color;
   502 
   502 
   503 	if (color != 0xFE) {
   503 	if (color != 0xFE) {
   504 		if (x >= dpi->left + dpi->width ||
   504 		if (x >= dpi->left + dpi->width ||
   505 				x + _screen.width * 2 <= dpi->left ||
   505 				x + _screen.width * 2 <= dpi->left ||
   506 				y >= dpi->top + dpi->height ||
   506 				y >= dpi->top + dpi->height ||
   546 		} else if (c == '\n') { // newline = {}
   546 		} else if (c == '\n') { // newline = {}
   547 			x = xo;
   547 			x = xo;
   548 			y += GetCharacterHeight(size);
   548 			y += GetCharacterHeight(size);
   549 			goto check_bounds;
   549 			goto check_bounds;
   550 		} else if (c >= SCC_BLUE && c <= SCC_BLACK) { // change color?
   550 		} else if (c >= SCC_BLUE && c <= SCC_BLACK) { // change color?
       
   551 			previous_color = color;
   551 			color = (byte)(c - SCC_BLUE);
   552 			color = (byte)(c - SCC_BLUE);
       
   553 			goto switch_color;
       
   554 		} else if (c == SCC_PREVIOUS_COLOUR) { // revert to the previous color
       
   555 			Swap(color, previous_color);
   552 			goto switch_color;
   556 			goto switch_color;
   553 		} else if (c == SCC_SETX) { // {SETX}
   557 		} else if (c == SCC_SETX) { // {SETX}
   554 			x = xo + (byte)*string++;
   558 			x = xo + (byte)*string++;
   555 		} else if (c == SCC_SETXY) {// {SETXY}
   559 		} else if (c == SCC_SETXY) {// {SETXY}
   556 			x = xo + (byte)*string++;
   560 			x = xo + (byte)*string++;
   838 	}
   842 	}
   839 }
   843 }
   840 
   844 
   841 void DrawMouseCursor()
   845 void DrawMouseCursor()
   842 {
   846 {
       
   847 #if defined(WINCE)
       
   848 	/* Don't ever draw the mouse for WinCE, as we work with a stylus */
       
   849 	return;
       
   850 #endif
       
   851 
   843 	Blitter *blitter = BlitterFactoryBase::GetCurrentBlitter();
   852 	Blitter *blitter = BlitterFactoryBase::GetCurrentBlitter();
   844 	int x;
   853 	int x;
   845 	int y;
   854 	int y;
   846 	int w;
   855 	int w;
   847 	int h;
   856 	int h;