Changeset - r20063:f808fc7ab0bd
[Not reviewed]
master
0 1 0
rubidium - 11 years ago 2013-02-17 20:55:26
rubidium@openttd.org
(svn r25021) -Codechange: make a lot of SmallMapWindow members protected (fonsinchen)
1 file changed with 21 insertions and 22 deletions:
0 comments (0 inline, 0 general)
src/smallmap_gui.h
Show inline comments
 
@@ -60,12 +60,13 @@ protected:
 

	
 
	static const uint LEGEND_BLOB_WIDTH = 8;              ///< Width of the coloured blob in front of a line text in the #WID_SM_LEGEND widget.
 
	static const uint INDUSTRY_MIN_NUMBER_OF_COLUMNS = 2; ///< Minimal number of columns in the #WID_SM_LEGEND widget for the #SMT_INDUSTRY legend.
 
	static const uint FORCE_REFRESH_PERIOD = 0x1F; ///< map is redrawn after that many ticks
 
	static const uint BLINK_PERIOD         = 0x0F; ///< highlight blinking interval
 

	
 
	uint min_number_of_columns;    ///< Minimal number of columns in legends.
 
	uint min_number_of_fixed_rows; ///< Minimal number of rows in the legends for the fixed layouts only (all except #SMT_INDUSTRY).
 
	uint column_width;             ///< Width of a column in the #WID_SM_LEGEND widget.
 

	
 
	int32 scroll_x;  ///< Horizontal world coordinate of the base tile left of the top-left corner of the smallmap display.
 
	int32 scroll_y;  ///< Vertical world coordinate of the base tile left of the top-left corner of the smallmap display.
 
	int32 subscroll; ///< Number of pixels (0..3) between the right end of the base tile and the pixel at the top-left corner of the smallmap display.
 
@@ -96,34 +97,12 @@ protected:
 
	static inline void DrawHorizMapIndicator(int x, int x2, int y)
 
	{
 
		GfxFillRect(x,      y, x + 3, y, PC_VERY_LIGHT_YELLOW);
 
		GfxFillRect(x2 - 3, y, x2,    y, PC_VERY_LIGHT_YELLOW);
 
	}
 

	
 
	void DrawMapIndicators() const;
 
	void DrawSmallMapColumn(void *dst, uint xc, uint yc, int pitch, int reps, int start_pos, int end_pos, Blitter *blitter) const;
 
	void DrawVehicles(const DrawPixelInfo *dpi, Blitter *blitter) const;
 
	void DrawTowns(const DrawPixelInfo *dpi) const;
 
	void DrawSmallMap(DrawPixelInfo *dpi) const;
 

	
 
	Point RemapTile(int tile_x, int tile_y) const;
 
	Point PixelToTile(int px, int py, int *sub, bool add_sub = true) const;
 
	Point ComputeScroll(int tx, int ty, int x, int y, int *sub);
 
	void SetZoomLevel(ZoomLevelChange change, const Point *zoom_pt);
 
	void SetupWidgetData();
 
	uint32 GetTileColours(const TileArea &ta) const;
 

	
 
	int GetPositionOnLegend(Point pt);
 

	
 

	
 
public:
 

	
 
	uint min_number_of_columns;    ///< Minimal number of columns in legends.
 

	
 
	SmallMapWindow(const WindowDesc *desc, int window_number);
 

	
 
	/**
 
	 * Compute minimal required width of the legends.
 
	 * @return Minimally needed width for displaying the smallmap legends in pixels.
 
	 */
 
	inline uint GetMinLegendWidth() const
 
	{
 
@@ -151,12 +130,32 @@ public:
 
	}
 

	
 
	uint GetNumberRowsLegend(uint columns) const;
 
	void SelectLegendItem(int click_pos, LegendAndColour *legend, int end_legend_item, int begin_legend_item = 0);
 
	void SwitchMapType(SmallMapType map_type);
 
	void SetNewScroll(int sx, int sy, int sub);
 

	
 
	void DrawMapIndicators() const;
 
	void DrawSmallMapColumn(void *dst, uint xc, uint yc, int pitch, int reps, int start_pos, int end_pos, Blitter *blitter) const;
 
	void DrawVehicles(const DrawPixelInfo *dpi, Blitter *blitter) const;
 
	void DrawTowns(const DrawPixelInfo *dpi) const;
 
	void DrawSmallMap(DrawPixelInfo *dpi) const;
 

	
 
	Point RemapTile(int tile_x, int tile_y) const;
 
	Point PixelToTile(int px, int py, int *sub, bool add_sub = true) const;
 
	Point ComputeScroll(int tx, int ty, int x, int y, int *sub);
 
	void SetZoomLevel(ZoomLevelChange change, const Point *zoom_pt);
 
	void SetupWidgetData();
 
	uint32 GetTileColours(const TileArea &ta) const;
 

	
 
	int GetPositionOnLegend(Point pt);
 

	
 
public:
 
	friend class NWidgetSmallmapDisplay;
 

	
 
	SmallMapWindow(const WindowDesc *desc, int window_number);
 
	void SmallMapCenterOnCurrentPos();
 

	
 
	virtual void SetStringParameters(int widget) const;
 
	virtual void OnInit();
 
	virtual void OnPaint();
 
	virtual void DrawWidget(const Rect &r, int widget) const;
0 comments (0 inline, 0 general)