rail_gui.c
changeset 3921 bf161a808b51
parent 3900 2c84ed52709d
child 4077 d4d440dd8925
equal deleted inserted replaced
3920:cca65c17b760 3921:bf161a808b51
   618 	case WE_PAINT: {
   618 	case WE_PAINT: {
   619 		int rad;
   619 		int rad;
   620 		uint bits;
   620 		uint bits;
   621 		bool newstations = _railstation.newstations;
   621 		bool newstations = _railstation.newstations;
   622 		int y_offset;
   622 		int y_offset;
       
   623 		DrawPixelInfo tmp_dpi, *old_dpi;
   623 
   624 
   624 		if (WP(w,def_d).close) return;
   625 		if (WP(w,def_d).close) return;
   625 
   626 
   626 		bits = (1<<3) << ( _railstation.orientation);
   627 		bits = (1<<3) << ( _railstation.orientation);
   627 		if (_railstation.dragdrop) {
   628 		if (_railstation.dragdrop) {
   669 		SetDParam(0, GetStationClassName(_railstation.station_class));
   670 		SetDParam(0, GetStationClassName(_railstation.station_class));
   670 		DrawWindowWidgets(w);
   671 		DrawWindowWidgets(w);
   671 
   672 
   672 		y_offset = newstations ? 90 : 0;
   673 		y_offset = newstations ? 90 : 0;
   673 
   674 
   674 		if (!DrawStationTile(39, 42 + y_offset, _cur_railtype, AXIS_X, _railstation.station_class, _railstation.station_type)) {
   675 		/* Set up a clipping area for the '/' station preview */
   675 			StationPickerDrawSprite(39, 42 + y_offset, _cur_railtype, 2);
   676 		if (FillDrawPixelInfo(&tmp_dpi, NULL, 7, 26 + y_offset, 66, 48)) {
   676 		}
   677 			old_dpi = _cur_dpi;
   677 		if (!DrawStationTile(107, 42 + y_offset, _cur_railtype, AXIS_Y, _railstation.station_class, _railstation.station_type)) {
   678 			_cur_dpi = &tmp_dpi;
   678 			StationPickerDrawSprite(107, 42 + y_offset, _cur_railtype, 3);
   679 			if (!DrawStationTile(32, 16, _cur_railtype, AXIS_X, _railstation.station_class, _railstation.station_type)) {
       
   680 				StationPickerDrawSprite(32, 16, _cur_railtype, 2);
       
   681 			}
       
   682 			_cur_dpi = old_dpi;
       
   683 		}
       
   684 
       
   685 		/* Set up a clipping area for the '\' station preview */
       
   686 		if (FillDrawPixelInfo(&tmp_dpi, NULL, 75, 26 + y_offset, 66, 48)) {
       
   687 			old_dpi = _cur_dpi;
       
   688 			_cur_dpi = &tmp_dpi;
       
   689 			if (!DrawStationTile(32, 16, _cur_railtype, AXIS_Y, _railstation.station_class, _railstation.station_type)) {
       
   690 				StationPickerDrawSprite(32, 16, _cur_railtype, 3);
       
   691 			}
       
   692 			_cur_dpi = old_dpi;
   679 		}
   693 		}
   680 
   694 
   681 		DrawStringCentered(74, 15 + y_offset, STR_3002_ORIENTATION, 0);
   695 		DrawStringCentered(74, 15 + y_offset, STR_3002_ORIENTATION, 0);
   682 		DrawStringCentered(74, 76 + y_offset, STR_3003_NUMBER_OF_TRACKS, 0);
   696 		DrawStringCentered(74, 76 + y_offset, STR_3003_NUMBER_OF_TRACKS, 0);
   683 		DrawStringCentered(74, 101 + y_offset, STR_3004_PLATFORM_LENGTH, 0);
   697 		DrawStringCentered(74, 101 + y_offset, STR_3004_PLATFORM_LENGTH, 0);