Changeset - r28073:643e70cfa3b2
[Not reviewed]
master
0 1 0
Peter Nelson - 13 months ago 2023-10-31 18:53:07
peter1138@openttd.org
Codechange: Use unique_ptr for SmallMapWindow's overlay.
1 file changed with 2 insertions and 7 deletions:
0 comments (0 inline, 0 general)
src/smallmap_gui.cpp
Show inline comments
 
@@ -648,7 +648,7 @@ protected:
 
	int32_t 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.
 
	int zoom;        ///< Zoom level. Bigger number means more zoom-out (further away).
 

	
 
	LinkGraphOverlay *overlay;
 
	std::unique_ptr<LinkGraphOverlay> overlay;
 

	
 
	/** Notify the industry chain window to stop sending newly selected industries. */
 
	static void BreakIndustryChainLink()
 
@@ -1402,7 +1402,7 @@ public:
 
	SmallMapWindow(WindowDesc *desc, int window_number) : Window(desc)
 
	{
 
		_smallmap_industry_highlight = INVALID_INDUSTRYTYPE;
 
		this->overlay = new LinkGraphOverlay(this, WID_SM_MAP, 0, this->GetOverlayCompanyMask(), 1);
 
		this->overlay = std::make_unique<LinkGraphOverlay>(this, WID_SM_MAP, 0, this->GetOverlayCompanyMask(), 1);
 
		this->InitNested(window_number);
 
		this->LowerWidget(this->map_type + WID_SM_CONTOUR);
 

	
 
@@ -1419,11 +1419,6 @@ public:
 
		this->SetOverlayCargoMask();
 
	}
 

	
 
	virtual ~SmallMapWindow()
 
	{
 
		delete this->overlay;
 
	}
 

	
 
	/**
 
	 * Center the small map on the current center of the viewport.
 
	 */
0 comments (0 inline, 0 general)