Fix missing override keywords

This commit is contained in:
Jonathan G Rennison
2021-03-02 23:41:07 +00:00
parent 3e1589eeae
commit 865cf79915
5 changed files with 22 additions and 22 deletions

View File

@@ -72,7 +72,7 @@ public:
~SpriteFontCache(); ~SpriteFontCache();
virtual SpriteID GetUnicodeGlyph(WChar key); virtual SpriteID GetUnicodeGlyph(WChar key);
virtual void SetUnicodeGlyph(WChar key, SpriteID sprite); virtual void SetUnicodeGlyph(WChar key, SpriteID sprite);
virtual void InitializeUnicodeGlyphMap(); virtual void InitializeUnicodeGlyphMap() override;
virtual void ClearFontCache(); virtual void ClearFontCache();
virtual const Sprite *GetGlyph(GlyphID key); virtual const Sprite *GetGlyph(GlyphID key);
virtual uint GetGlyphWidth(GlyphID key); virtual uint GetGlyphWidth(GlyphID key);

View File

@@ -66,7 +66,7 @@ public:
SpriteID GetUnicodeGlyph(WChar key) override { return this->parent->GetUnicodeGlyph(key); } SpriteID GetUnicodeGlyph(WChar key) override { return this->parent->GetUnicodeGlyph(key); }
void SetUnicodeGlyph(WChar key, SpriteID sprite) override { this->parent->SetUnicodeGlyph(key, sprite); } void SetUnicodeGlyph(WChar key, SpriteID sprite) override { this->parent->SetUnicodeGlyph(key, sprite); }
virtual void InitializeUnicodeGlyphMap() virtual void InitializeUnicodeGlyphMap() override
{ {
this->parent->InitializeUnicodeGlyphMap(); this->parent->InitializeUnicodeGlyphMap();
font_height_cache[this->fs] = this->GetHeight(); font_height_cache[this->fs] = this->GetHeight();

View File

@@ -107,7 +107,7 @@ struct PlansWindow : Window {
} }
} }
virtual void OnClick(Point pt, int widget, int click_count) virtual void OnClick(Point pt, int widget, int click_count) override
{ {
switch (widget) { switch (widget) {
case WID_PLN_NEW: case WID_PLN_NEW:
@@ -232,7 +232,7 @@ struct PlansWindow : Window {
} }
} }
virtual void OnQueryTextFinished(char *str) virtual void OnQueryTextFinished(char *str) override
{ {
if (_current_plan == nullptr || str == nullptr) return; if (_current_plan == nullptr || str == nullptr) return;
@@ -247,7 +247,7 @@ struct PlansWindow : Window {
return true; return true;
} }
virtual void OnPaint() virtual void OnPaint() override
{ {
this->SetWidgetDisabledState(WID_PLN_HIDE_ALL, this->vscroll->GetCount() == 0); this->SetWidgetDisabledState(WID_PLN_HIDE_ALL, this->vscroll->GetCount() == 0);
this->SetWidgetDisabledState(WID_PLN_SHOW_ALL, this->vscroll->GetCount() == 0); this->SetWidgetDisabledState(WID_PLN_SHOW_ALL, this->vscroll->GetCount() == 0);
@@ -261,7 +261,7 @@ struct PlansWindow : Window {
this->DrawWidgets(); this->DrawWidgets();
} }
virtual void DrawWidget(const Rect &r, int widget) const virtual void DrawWidget(const Rect &r, int widget) const override
{ {
switch (widget) { switch (widget) {
case WID_PLN_LIST: { case WID_PLN_LIST: {
@@ -323,12 +323,12 @@ struct PlansWindow : Window {
} }
} }
virtual void OnResize() virtual void OnResize() override
{ {
this->vscroll->SetCapacityFromWidget(this, WID_PLN_LIST, WD_FRAMERECT_TOP + WD_FRAMERECT_BOTTOM); this->vscroll->SetCapacityFromWidget(this, WID_PLN_LIST, WD_FRAMERECT_TOP + WD_FRAMERECT_BOTTOM);
} }
virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) override
{ {
switch (widget) { switch (widget) {
case WID_PLN_LIST: case WID_PLN_LIST:
@@ -369,14 +369,14 @@ struct PlansWindow : Window {
} }
/** The drawing of a line starts. */ /** The drawing of a line starts. */
virtual void OnPlaceObject(Point pt, TileIndex tile) virtual void OnPlaceObject(Point pt, TileIndex tile) override
{ {
/* A player can't add lines to a public plan of another company. */ /* A player can't add lines to a public plan of another company. */
if (_current_plan && _current_plan->owner == _local_company) VpStartPlaceSizing(tile, VPM_X_AND_Y, DDSP_DRAW_PLANLINE); if (_current_plan && _current_plan->owner == _local_company) VpStartPlaceSizing(tile, VPM_X_AND_Y, DDSP_DRAW_PLANLINE);
} }
/** The drawing of a line is in progress. */ /** The drawing of a line is in progress. */
virtual void OnPlaceDrag(ViewportPlaceMethod select_method, ViewportDragDropSelectionProcess select_proc, Point pt) virtual void OnPlaceDrag(ViewportPlaceMethod select_method, ViewportDragDropSelectionProcess select_proc, Point pt) override
{ {
const Point p = GetTileBelowCursor(); const Point p = GetTileBelowCursor();
const TileIndex tile = TileVirtXY(p.x, p.y); const TileIndex tile = TileVirtXY(p.x, p.y);
@@ -387,13 +387,13 @@ struct PlansWindow : Window {
} }
/** The drawing of a line ends up normally. */ /** The drawing of a line ends up normally. */
virtual void OnPlaceMouseUp(ViewportPlaceMethod select_method, ViewportDragDropSelectionProcess select_proc, Point pt, TileIndex start_tile, TileIndex end_tile) virtual void OnPlaceMouseUp(ViewportPlaceMethod select_method, ViewportDragDropSelectionProcess select_proc, Point pt, TileIndex start_tile, TileIndex end_tile) override
{ {
if (_current_plan) _current_plan->ValidateNewLine(); if (_current_plan) _current_plan->ValidateNewLine();
} }
/** The drawing of a line is aborted. */ /** The drawing of a line is aborted. */
virtual void OnPlaceObjectAbort() virtual void OnPlaceObjectAbort() override
{ {
if (_current_plan) { if (_current_plan) {
_current_plan->temp_line->MarkDirty(); _current_plan->temp_line->MarkDirty();

View File

@@ -947,7 +947,7 @@ class NIHTown : public NIHelper {
return nullptr; return nullptr;
} }
virtual std::vector<uint32> GetPSAGRFIDs(uint index) const virtual std::vector<uint32> GetPSAGRFIDs(uint index) const override
{ {
Town *t = Town::Get(index); Town *t = Town::Get(index);

View File

@@ -191,7 +191,7 @@ public:
UpdateButtonState(); UpdateButtonState();
} }
virtual void OnResize() virtual void OnResize() override
{ {
NWidgetCore *template_panel = this->GetWidget<NWidgetCore>(TCW_NEW_TMPL_PANEL); NWidgetCore *template_panel = this->GetWidget<NWidgetCore>(TCW_NEW_TMPL_PANEL);
this->hscroll->SetCapacity(template_panel->current_x); this->hscroll->SetCapacity(template_panel->current_x);
@@ -201,7 +201,7 @@ public:
} }
virtual void OnInvalidateData(int data = 0, bool gui_scope = true) virtual void OnInvalidateData(int data = 0, bool gui_scope = true) override
{ {
if(!gui_scope) return; if(!gui_scope) return;
@@ -215,7 +215,7 @@ public:
UpdateButtonState(); UpdateButtonState();
} }
virtual void OnClick(Point pt, int widget, int click_count) virtual void OnClick(Point pt, int widget, int click_count) override
{ {
switch(widget) { switch(widget) {
case TCW_NEW_TMPL_PANEL: { case TCW_NEW_TMPL_PANEL: {
@@ -259,7 +259,7 @@ public:
} }
} }
virtual bool OnVehicleSelect(const Vehicle *v) virtual bool OnVehicleSelect(const Vehicle *v) override
{ {
// throw away the current virtual train // throw away the current virtual train
if (virtual_train != nullptr) { if (virtual_train != nullptr) {
@@ -276,7 +276,7 @@ public:
return true; return true;
} }
virtual void OnPlaceObjectAbort() virtual void OnPlaceObjectAbort() override
{ {
this->sel = INVALID_VEHICLE; this->sel = INVALID_VEHICLE;
this->vehicle_over = INVALID_VEHICLE; this->vehicle_over = INVALID_VEHICLE;
@@ -284,7 +284,7 @@ public:
this->SetDirty(); this->SetDirty();
} }
virtual void DrawWidget(const Rect &r, int widget) const virtual void DrawWidget(const Rect &r, int widget) const override
{ {
switch(widget) { switch(widget) {
case TCW_NEW_TMPL_PANEL: { case TCW_NEW_TMPL_PANEL: {
@@ -364,7 +364,7 @@ public:
} }
} }
virtual void OnDragDrop(Point pt, int widget) virtual void OnDragDrop(Point pt, int widget) override
{ {
switch (widget) { switch (widget) {
case TCW_NEW_TMPL_PANEL: { case TCW_NEW_TMPL_PANEL: {
@@ -425,7 +425,7 @@ public:
this->SetDirty(); this->SetDirty();
} }
virtual void OnMouseDrag(Point pt, int widget) virtual void OnMouseDrag(Point pt, int widget) override
{ {
if (this->sel == INVALID_VEHICLE) return; if (this->sel == INVALID_VEHICLE) return;
@@ -470,7 +470,7 @@ public:
this->SetWidgetDirty(widget); this->SetWidgetDirty(widget);
} }
virtual void OnPaint() virtual void OnPaint() override
{ {
uint min_width = 32; uint min_width = 32;
uint min_height = 30; uint min_height = 30;