1
0
mirror of https://github.com/TomHarte/CLK.git synced 2026-03-11 04:42:20 +00:00

All these 'override's can be 'final's.

At least for the purpose of being communicative. I doubt there's much to gain in terms of compiler output — the DiskImageHolder can avoid some virtual lookups but nothing else leaps out.
This commit is contained in:
Thomas Harte
2020-01-23 22:57:51 -05:00
parent ba516387ba
commit 294e09f275
62 changed files with 299 additions and 299 deletions

View File

@@ -54,7 +54,7 @@ class Joystick: public Inputs::ConcreteJoystick {
Input(Input::Fire, 1)
}) {}
void did_set_input(const Input &digital_input, bool is_active) override {
void did_set_input(const Input &digital_input, bool is_active) final {
switch(digital_input.type) {
default: return;
@@ -168,7 +168,7 @@ class ConcreteMachine:
audio_queue_.flush();
}
void set_scan_target(Outputs::Display::ScanTarget *scan_target) override {
void set_scan_target(Outputs::Display::ScanTarget *scan_target) final {
vdp_->set_tv_standard(
(region_ == Target::Region::Europe) ?
TI::TMS::TVStandard::PAL : TI::TMS::TVStandard::NTSC);
@@ -181,15 +181,15 @@ class ConcreteMachine:
return vdp_->get_scaled_scan_status();
}
void set_display_type(Outputs::Display::DisplayType display_type) override {
void set_display_type(Outputs::Display::DisplayType display_type) final {
vdp_->set_display_type(display_type);
}
Outputs::Speaker::Speaker *get_speaker() override {
Outputs::Speaker::Speaker *get_speaker() final {
return &speaker_;
}
void run_for(const Cycles cycles) override {
void run_for(const Cycles cycles) final {
z80_.run_for(cycles);
}
@@ -344,16 +344,16 @@ class ConcreteMachine:
audio_queue_.perform();
}
const std::vector<std::unique_ptr<Inputs::Joystick>> &get_joysticks() override {
const std::vector<std::unique_ptr<Inputs::Joystick>> &get_joysticks() final {
return joysticks_;
}
// MARK: - Keyboard (i.e. the pause and reset buttons).
Inputs::Keyboard &get_keyboard() override {
Inputs::Keyboard &get_keyboard() final {
return keyboard_;
}
void keyboard_did_change_key(Inputs::Keyboard *, Inputs::Keyboard::Key key, bool is_pressed) override {
void keyboard_did_change_key(Inputs::Keyboard *, Inputs::Keyboard::Key key, bool is_pressed) final {
if(key == Inputs::Keyboard::Key::Enter) {
pause_is_pressed_ = is_pressed;
} else if(key == Inputs::Keyboard::Key::Escape) {
@@ -361,28 +361,28 @@ class ConcreteMachine:
}
}
void reset_all_keys(Inputs::Keyboard *) override {
void reset_all_keys(Inputs::Keyboard *) final {
}
// MARK: - Configuration options.
std::vector<std::unique_ptr<Configurable::Option>> get_options() override {
std::vector<std::unique_ptr<Configurable::Option>> get_options() final {
return Sega::MasterSystem::get_options();
}
void set_selections(const Configurable::SelectionSet &selections_by_option) override {
void set_selections(const Configurable::SelectionSet &selections_by_option) final {
Configurable::Display display;
if(Configurable::get_display(selections_by_option, display)) {
set_video_signal_configurable(display);
}
}
Configurable::SelectionSet get_accurate_selections() override {
Configurable::SelectionSet get_accurate_selections() final {
Configurable::SelectionSet selection_set;
Configurable::append_display_selection(selection_set, Configurable::Display::CompositeColour);
return selection_set;
}
Configurable::SelectionSet get_user_friendly_selections() override {
Configurable::SelectionSet get_user_friendly_selections() final {
Configurable::SelectionSet selection_set;
Configurable::append_display_selection(selection_set, Configurable::Display::RGB);
return selection_set;